Add frontend assets and plugin bundles
Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
This commit is contained in:
119
assets/plugins/dynatree/tests/qunit.css
Normal file
119
assets/plugins/dynatree/tests/qunit.css
Normal file
@@ -0,0 +1,119 @@
|
||||
|
||||
ol#qunit-tests {
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
margin:0;
|
||||
padding:0;
|
||||
list-style-position:inside;
|
||||
|
||||
font-size: smaller;
|
||||
}
|
||||
ol#qunit-tests li{
|
||||
padding:0.4em 0.5em 0.4em 2.5em;
|
||||
border-bottom:1px solid #fff;
|
||||
font-size:small;
|
||||
list-style-position:inside;
|
||||
}
|
||||
ol#qunit-tests li ol{
|
||||
box-shadow: inset 0px 2px 13px #999;
|
||||
-moz-box-shadow: inset 0px 2px 13px #999;
|
||||
-webkit-box-shadow: inset 0px 2px 13px #999;
|
||||
margin-top:0.5em;
|
||||
margin-left:0;
|
||||
padding:0.5em;
|
||||
background-color:#fff;
|
||||
border-radius:15px;
|
||||
-moz-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
}
|
||||
ol#qunit-tests li li{
|
||||
border-bottom:none;
|
||||
margin:0.5em;
|
||||
background-color:#fff;
|
||||
list-style-position: inside;
|
||||
padding:0.4em 0.5em 0.4em 0.5em;
|
||||
}
|
||||
|
||||
ol#qunit-tests li li.pass{
|
||||
border-left:26px solid #C6E746;
|
||||
background-color:#fff;
|
||||
color:#5E740B;
|
||||
}
|
||||
ol#qunit-tests li li.fail{
|
||||
border-left:26px solid #EE5757;
|
||||
background-color:#fff;
|
||||
color:#710909;
|
||||
}
|
||||
ol#qunit-tests li.pass{
|
||||
background-color:#D2E0E6;
|
||||
color:#528CE0;
|
||||
}
|
||||
ol#qunit-tests li.fail{
|
||||
background-color:#EE5757;
|
||||
color:#000;
|
||||
}
|
||||
ol#qunit-tests li strong {
|
||||
cursor:pointer;
|
||||
}
|
||||
h1#qunit-header{
|
||||
background-color:#0d3349;
|
||||
margin:0;
|
||||
padding:0.5em 0 0.5em 1em;
|
||||
color:#fff;
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
border-top-right-radius:15px;
|
||||
border-top-left-radius:15px;
|
||||
-moz-border-radius-topright:15px;
|
||||
-moz-border-radius-topleft:15px;
|
||||
-webkit-border-top-right-radius:15px;
|
||||
-webkit-border-top-left-radius:15px;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px;
|
||||
}
|
||||
h2#qunit-banner{
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
height:5px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
h2#qunit-banner.qunit-pass{
|
||||
background-color:#C6E746;
|
||||
}
|
||||
h2#qunit-banner.qunit-fail, #qunit-testrunner-toolbar {
|
||||
background-color:#EE5757;
|
||||
}
|
||||
#qunit-testrunner-toolbar {
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
padding:0;
|
||||
/*width:80%;*/
|
||||
padding:0em 0 0.5em 2em;
|
||||
font-size: small;
|
||||
}
|
||||
h2#qunit-userAgent {
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
background-color:#2b81af;
|
||||
margin:0;
|
||||
padding:0;
|
||||
color:#fff;
|
||||
font-size: small;
|
||||
padding:0.5em 0 0.5em 2.5em;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||
}
|
||||
p#qunit-testresult{
|
||||
font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
|
||||
margin:0;
|
||||
font-size: small;
|
||||
color:#2b81af;
|
||||
border-bottom-right-radius:15px;
|
||||
border-bottom-left-radius:15px;
|
||||
-moz-border-radius-bottomright:15px;
|
||||
-moz-border-radius-bottomleft:15px;
|
||||
-webkit-border-bottom-right-radius:15px;
|
||||
-webkit-border-bottom-left-radius:15px;
|
||||
background-color:#D2E0E6;
|
||||
padding:0.5em 0.5em 0.5em 2.5em;
|
||||
}
|
||||
strong b.fail{
|
||||
color:#710909;
|
||||
}
|
||||
strong b.pass{
|
||||
color:#5E740B;
|
||||
}
|
||||
1043
assets/plugins/dynatree/tests/qunit.js
Normal file
1043
assets/plugins/dynatree/tests/qunit.js
Normal file
File diff suppressed because it is too large
Load Diff
22
assets/plugins/dynatree/tests/sample-data1.json
Normal file
22
assets/plugins/dynatree/tests/sample-data1.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{"title": "Item 1"},
|
||||
{"title": "Folder 2", "isFolder": true, "key": "folder2",
|
||||
"children": [
|
||||
{"title": "Sub-item 2.1"},
|
||||
{"title": "Sub-item 2.2"}
|
||||
]
|
||||
},
|
||||
{"title": "Folder 3", "isFolder": true, "key": "folder3",
|
||||
"children": [
|
||||
{"title": "Sub-item 3.1"},
|
||||
{"title": "Sub-item 3.2"}
|
||||
]
|
||||
},
|
||||
{"title": "Lazy Folder 4", "isFolder": true, "isLazy": true, "key": "folder4",
|
||||
"children": [
|
||||
{"title": "Sub-item 4.1"},
|
||||
{"title": "Sub-item 4.2"}
|
||||
]
|
||||
},
|
||||
{"title": "Item 5"}
|
||||
]
|
||||
1
assets/plugins/dynatree/tests/sample-data2.json
Normal file
1
assets/plugins/dynatree/tests/sample-data2.json
Normal file
@@ -0,0 +1 @@
|
||||
[ {"title": "SubItem 1", "isLazy": true }, {"title": "SubFolder 2", "isFolder": true, "isLazy": true } ]
|
||||
51
assets/plugins/dynatree/tests/test-adhoc.html
Normal file
51
assets/plugins/dynatree/tests/test-adhoc.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Dynatree - AdHoc tests</title>
|
||||
|
||||
<script src="../jquery/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery.cookie.js" type="text/javascript"></script>
|
||||
|
||||
<link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css">
|
||||
<script src="../src/jquery.dynatree.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
// Initialize the tree inside the <div>element.
|
||||
// The tree structure is read from the contained <ul> tag.
|
||||
$("#tree").dynatree({
|
||||
initAjax: {
|
||||
url: "sample-data1.json"
|
||||
},
|
||||
});
|
||||
$("#btn01").click(function(){
|
||||
var a = [];
|
||||
alert("" + !!a.length);
|
||||
});
|
||||
$("#btn11").click(function(){
|
||||
alert("11");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="example">
|
||||
<h1>Dynatree Test</h1>
|
||||
<p class="description">
|
||||
Testbed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="#" id="btn01">Test 01</a> -
|
||||
</p>
|
||||
<div id="tree"></div>
|
||||
|
||||
<div>Active node: <span id="echoActive">-</span></div>
|
||||
<div>Focused node: <span id="echoFocused">-</span></div>
|
||||
<p>
|
||||
<button id="btn11">Test 11</button>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
242
assets/plugins/dynatree/tests/test-bench.html
Normal file
242
assets/plugins/dynatree/tests/test-bench.html
Normal file
@@ -0,0 +1,242 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Dynatree - Example</title>
|
||||
|
||||
<script src="../jquery/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery.cookie.js" type="text/javascript"></script>
|
||||
|
||||
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript" src="qunit.js"></script>
|
||||
|
||||
<link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css">
|
||||
<script src="../src/jquery.dynatree.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Start_Exclude: This block is not part of the sample code -->
|
||||
<link href="prettify.css" rel="stylesheet">
|
||||
<script src="prettify.js" type="text/javascript"></script>
|
||||
<link href="sample.css" rel="stylesheet" type="text/css">
|
||||
<script src="sample.js" type="text/javascript"></script>
|
||||
<!-- End_Exclude -->
|
||||
|
||||
<!-- Add code to initialize the tree when the document is loaded: -->
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
/*******************************************************************************
|
||||
* QUnit setup
|
||||
*/
|
||||
QUnit.log = function(result, message) {
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(result +' :: '+ message);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Tool functions
|
||||
*/
|
||||
function makeBenchWrapper(testName, callback) {
|
||||
return function() {
|
||||
var start = +new Date;
|
||||
// callback.apply(this, arguments);
|
||||
callback.call();
|
||||
var elap = +new Date - start;
|
||||
ok(true, testName + " took " + elap + " milliseconds");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function benchmark(testName, callback) {
|
||||
// Execute callback immediately and log timing as test result.
|
||||
// This function should be called inside a test() function.
|
||||
makeBenchWrapper(testName, callback).call();
|
||||
}
|
||||
|
||||
|
||||
function timedTest(testName, callback) {
|
||||
// Same as test(testName, callback), but adds a timing assertion.
|
||||
test(testName, makeBenchWrapper(testName, callback));
|
||||
}
|
||||
|
||||
|
||||
function simulateClick(selector) {
|
||||
var e = document.createEvent("MouseEvents");
|
||||
e.initEvent("click", true, true);
|
||||
$(selector).each(function(){
|
||||
this.dispatchEvent(e);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function addNodes(node, level1, level2, level3, forceUpdate) {
|
||||
if( forceUpdate != true )
|
||||
node.tree.enableUpdate(false);
|
||||
|
||||
var key;
|
||||
for (var i=0; i<level1; i++) {
|
||||
key = "" + (i+1);
|
||||
var f = node.addChild({title: "Folder_" + key,
|
||||
key: key,
|
||||
isFolder: true
|
||||
});
|
||||
for (var j=0; j<level2; j++) {
|
||||
key = "" + (i+1) + "." + (j+1);
|
||||
var d = f.addChild({title: "Node_" + key,
|
||||
key: key
|
||||
});
|
||||
for (var k=0; k<level3; k++) {
|
||||
key = "" + (i+1) + "." + (j+1) + "." + (k+1);
|
||||
d.addChild({title: "Node_" + key,
|
||||
key: key
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
node.tree.enableUpdate(true);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Module Init
|
||||
*/
|
||||
module("Init");
|
||||
|
||||
test("Create dynatree", function() {
|
||||
$("#tree").dynatree({
|
||||
children: [
|
||||
{key: "_1", title: "Add 100 nodes (flat, force update)...", isFolder: true, isLazy: true, mode: "add100_flat_u" },
|
||||
{key: "_2", title: "Add 100 nodes (flat)...", isFolder: true, isLazy: true, mode: "add100_flat" },
|
||||
{key: "_3", title: "Add 1.000 nodes (flat)...", isFolder: true, isLazy: true, mode: "add1000_flat" },
|
||||
{key: "_4", title: "Add 1.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add1000_deep" },
|
||||
{key: "_5", title: "Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add10000_deep" },
|
||||
{key: "_6", title: "Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "addJsonFile" }
|
||||
],
|
||||
onSelect: function(node) {
|
||||
alert("You selected " + node.data.title);
|
||||
},
|
||||
onLazyRead: function(node) {
|
||||
var tree = node.tree;
|
||||
var start = +new Date;
|
||||
logMsg("Benchmarking mode='" + node.data.mode + "'...");
|
||||
switch( node.data.mode ) {
|
||||
case "add100_flat_u":
|
||||
addNodes(node, 100, 0, 0, true)
|
||||
break;
|
||||
case "add100_flat":
|
||||
addNodes(node, 100, 0, 0)
|
||||
break;
|
||||
case "add1000_flat":
|
||||
addNodes(node, 1000, 0, 0)
|
||||
break;
|
||||
case "add1000_deep":
|
||||
addNodes(node, 10, 10, 10)
|
||||
break;
|
||||
case "add10000_deep":
|
||||
addNodes(node, 10, 100, 10)
|
||||
break;
|
||||
case "addJsonFile":
|
||||
node.appendAjax({
|
||||
url: "sample-data2.json"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw "Invalid Mode "+ node.data.mode;
|
||||
}
|
||||
logMsg("Benchmarking mode='" + node.data.mode + "' done: " + (+new Date - start) + " milliseconds");
|
||||
// Return true, to show we're finished
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*******************************************************************************
|
||||
* Module Load
|
||||
*/
|
||||
module("Load");
|
||||
/*
|
||||
asyncTest("Expand lazy nodes (simulated async click())", function() {
|
||||
var tree = $("#tree").dynatree("getTree");
|
||||
simulateClick("#dynatree-id-_2");
|
||||
start();
|
||||
// equals(tree.getNodeByKey("1").data.title, "Folder_1");
|
||||
// simulateClick("#dynatree-id-_2");
|
||||
});
|
||||
|
||||
test(".expand() lazy nodes", function() {
|
||||
var tree = $("#tree").dynatree("getTree");
|
||||
tree.getNodeByKey("_3").expand();
|
||||
});
|
||||
*/
|
||||
test(".click() top level nodes", function() {
|
||||
expect(6);
|
||||
benchmark("add100_flat_u", function() {
|
||||
$("#dynatree-id-_1").click();
|
||||
});
|
||||
benchmark("add100_flat", function() {
|
||||
$("#dynatree-id-_2").click();
|
||||
});
|
||||
benchmark("add1000_flat", function() {
|
||||
$("#dynatree-id-_3").click();
|
||||
});
|
||||
benchmark("add1000_deep", function() {
|
||||
$("#dynatree-id-_4").click();
|
||||
});
|
||||
benchmark("add10000_deep", function() {
|
||||
$("#dynatree-id-_5").click();
|
||||
});
|
||||
benchmark("addJsonFile", function() {
|
||||
$("#dynatree-id-_6").click();
|
||||
});
|
||||
});
|
||||
|
||||
timedTest(".click() add10000_deep", function() {
|
||||
$("#dynatree-id-_5").click();
|
||||
});
|
||||
/*
|
||||
test("Load 100 nodes (flat)", function() {
|
||||
var parent = $("#tree").dynatree("getTree").getNodeByKey("_1");
|
||||
// addNodes(parent, 100, 0, 0)
|
||||
ok( true, "all pass" );
|
||||
});
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Module Cleanup
|
||||
*/
|
||||
module("Cleanup");
|
||||
/*
|
||||
test("Remove children", function() {
|
||||
var root = $("#tree").dynatree("getRoot");
|
||||
for(var i = 0; i<root.childList.length; i++)
|
||||
root.childList[i].removeChildren();
|
||||
// ok( true, "all pass" );
|
||||
});
|
||||
*/
|
||||
// ---
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="example">
|
||||
<h1 id="qunit-header">Dynatree unit tests: benchmarks</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
|
||||
<hr />
|
||||
|
||||
<div id='tree'> </div>
|
||||
|
||||
<!-- Start_Exclude: This block is not part of the sample code -->
|
||||
<hr>
|
||||
<p class="sample-links no_code">
|
||||
<a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a>
|
||||
<a class="hideOutsideFS" href="#">Link to this page</a>
|
||||
<a class="hideInsideFS" href="samples.html">Example Browser</a>
|
||||
<a href="#" id="codeExample">View source code</a>
|
||||
</p>
|
||||
<pre id="sourceCode" class="prettyprint" style="display:none"></pre>
|
||||
<!-- End_Exclude -->
|
||||
</body>
|
||||
</html>
|
||||
199
assets/plugins/dynatree/tests/test-dynatree.js
Normal file
199
assets/plugins/dynatree/tests/test-dynatree.js
Normal file
@@ -0,0 +1,199 @@
|
||||
$(function(){
|
||||
|
||||
/*******************************************************************************
|
||||
* QUnit setup
|
||||
*/
|
||||
QUnit.log = function(result, message) {
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(result +' :: '+ message);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Tool functions
|
||||
*/
|
||||
function makeBenchWrapper(testName, callback) {
|
||||
return function() {
|
||||
var start = +new Date;
|
||||
// callback.apply(this, arguments);
|
||||
callback.call();
|
||||
var elap = +new Date - start;
|
||||
ok(true, testName + " took " + elap + " milliseconds");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function benchmark(testName, callback) {
|
||||
// Execute callback immediately and log timing as test result.
|
||||
// This function should be called inside a test() function.
|
||||
makeBenchWrapper(testName, callback).call();
|
||||
}
|
||||
|
||||
|
||||
function timedTest(testName, callback) {
|
||||
// Same as test(testName, callback), but adds a timing assertion.
|
||||
test(testName, makeBenchWrapper(testName, callback));
|
||||
}
|
||||
|
||||
|
||||
function simulateClick(selector) {
|
||||
var e = document.createEvent("MouseEvents");
|
||||
e.initEvent("click", true, true);
|
||||
$(selector).each(function(){
|
||||
this.dispatchEvent(e);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function addNodes(dtnode, level1, level2, level3, forceUpdate) {
|
||||
if( forceUpdate != true )
|
||||
dtnode.tree.enableUpdate(false);
|
||||
|
||||
var key;
|
||||
for (var i=0; i<level1; i++) {
|
||||
key = "" + (i+1);
|
||||
var f = dtnode.addChild({title: "Folder_" + key,
|
||||
key: key,
|
||||
isFolder: true
|
||||
});
|
||||
for (var j=0; j<level2; j++) {
|
||||
key = "" + (i+1) + "." + (j+1);
|
||||
var d = f.addChild({title: "Node_" + key,
|
||||
key: key
|
||||
});
|
||||
for (var k=0; k<level3; k++) {
|
||||
key = "" + (i+1) + "." + (j+1) + "." + (k+1);
|
||||
d.addChild({title: "Node_" + key,
|
||||
key: key
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
dtnode.tree.enableUpdate(true);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Module Init
|
||||
*/
|
||||
module("Init");
|
||||
|
||||
test("Create dynatree", function() {
|
||||
$("#tree").dynatree({
|
||||
children: [
|
||||
{key: "_1", title: "Lazy Add 100 nodes (flat, force update)...", isFolder: true, isLazy: true, mode: "add100_flat_u" },
|
||||
{key: "_2", title: "Lazy Add 100 nodes (flat)...", isFolder: true, isLazy: true, mode: "add100_flat" },
|
||||
{key: "_3", title: "Lazy Add 1.000 nodes (flat)...", isFolder: true, isLazy: true, mode: "add1000_flat" },
|
||||
{key: "_4", title: "Lazy Add 1.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add1000_deep" },
|
||||
{key: "_5", title: "Lazy Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add10000_deep" },
|
||||
{key: "_6", title: "Lazy Add JSON file...", isFolder: true, isLazy: true, mode: "addJsonFile" },
|
||||
{key: "_7", title: "Add 1.000 nodes (flat)", isFolder: true },
|
||||
{key: "_8", title: "Add 1.000 nodes (deep)", isFolder: true }
|
||||
],
|
||||
onSelect: function(dtnode) {
|
||||
alert("You selected " + dtnode.data.title);
|
||||
},
|
||||
onLazyRead: function(dtnode) {
|
||||
var tree = dtnode.tree;
|
||||
var start = +new Date;
|
||||
logMsg("Benchmarking mode='" + dtnode.data.mode + "'...");
|
||||
switch( dtnode.data.mode ) {
|
||||
case "add100_flat_u":
|
||||
addNodes(dtnode, 100, 0, 0, true)
|
||||
break;
|
||||
case "add100_flat":
|
||||
addNodes(dtnode, 100, 0, 0)
|
||||
break;
|
||||
case "add1000_flat":
|
||||
addNodes(dtnode, 1000, 0, 0)
|
||||
break;
|
||||
case "add1000_deep":
|
||||
addNodes(dtnode, 10, 10, 10)
|
||||
break;
|
||||
case "add10000_deep":
|
||||
addNodes(dtnode, 10, 100, 10)
|
||||
break;
|
||||
case "addJsonFile":
|
||||
dtnode.appendAjax({
|
||||
url: "sample-data2.json"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw "Invalid Mode "+ dtnode.data.mode;
|
||||
}
|
||||
logMsg("Benchmarking mode='" + dtnode.data.mode + "' done: " + (+new Date - start) + " milliseconds");
|
||||
// Return true, to show we're finished
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*******************************************************************************
|
||||
* Module Load
|
||||
*/
|
||||
module("Load");
|
||||
|
||||
test("Add nodes to folder using API witout expanding", function() {
|
||||
expect(2);
|
||||
|
||||
benchmark("1000 nodes flat", function() {
|
||||
var node = $("#tree").dynatree("getTree").getNodeByKey("_7");
|
||||
addNodes(node, 1000, 0, 0);
|
||||
});
|
||||
|
||||
benchmark("1000 nodes deep", function() {
|
||||
var node = $("#tree").dynatree("getTree").getNodeByKey("_8");
|
||||
addNodes(node, 10, 10, 10);
|
||||
});
|
||||
});
|
||||
|
||||
test(".click() top level nodes (triggers lazy loading)", function() {
|
||||
expect(3);
|
||||
/*
|
||||
benchmark("Click add100_flat_u", function() {
|
||||
$("#dynatree-id-_1").click();
|
||||
});
|
||||
benchmark("Click add100_flat", function() {
|
||||
$("#dynatree-id-_2").click();
|
||||
});
|
||||
*/
|
||||
benchmark("Click add1000_flat", function() {
|
||||
$("#dynatree-id-_3").click();
|
||||
});
|
||||
|
||||
benchmark("Click add1000_deep", function() {
|
||||
$("#dynatree-id-_4").click();
|
||||
});
|
||||
/*
|
||||
benchmark("Click add10000_deep", function() {
|
||||
$("#dynatree-id-_5").click();
|
||||
});
|
||||
*/
|
||||
benchmark("Click addJsonFile", function() {
|
||||
$("#dynatree-id-_6").click();
|
||||
});
|
||||
});
|
||||
/*
|
||||
timedTest(".click() add10000_deep", function() {
|
||||
$("#dynatree-id-_5").click();
|
||||
});
|
||||
|
||||
test("Load 100 nodes (flat)", function() {
|
||||
var parent = $("#tree").dynatree("getTree").getNodeByKey("_1");
|
||||
// addNodes(parent, 100, 0, 0)
|
||||
ok( true, "all pass" );
|
||||
});
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Module Cleanup
|
||||
*/
|
||||
module("Cleanup");
|
||||
/*
|
||||
test("Remove children", function() {
|
||||
var root = $("#tree").dynatree("getRoot");
|
||||
for(var i = 0; i<root.childList.length; i++)
|
||||
root.childList[i].removeChildren();
|
||||
// ok( true, "all pass" );
|
||||
});
|
||||
*/
|
||||
// ---
|
||||
});
|
||||
24
assets/plugins/dynatree/tests/test.html
Normal file
24
assets/plugins/dynatree/tests/test.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<script src="../jquery/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script>
|
||||
<script src="../jquery/jquery.cookie.js" type="text/javascript"></script>
|
||||
|
||||
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript" src="qunit.js"></script>
|
||||
|
||||
<link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css">
|
||||
<script src="../src/jquery.dynatree.js" type="text/javascript"></script>
|
||||
|
||||
<script src="test-dynatree.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="qunit-header">Dynatree unit tests</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<hr />
|
||||
<div id="tree"></div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
assets/plugins/dynatree/tests/tests - Shortcut.lnk
Normal file
BIN
assets/plugins/dynatree/tests/tests - Shortcut.lnk
Normal file
Binary file not shown.
Reference in New Issue
Block a user