diff options
Diffstat (limited to 'includes/js/dojo/tests/_base')
37 files changed, 0 insertions, 4494 deletions
diff --git a/includes/js/dojo/tests/_base/Color.js b/includes/js/dojo/tests/_base/Color.js deleted file mode 100644 index fa09842..0000000 --- a/includes/js/dojo/tests/_base/Color.js +++ /dev/null @@ -1,32 +0,0 @@ -if(!dojo._hasResource["tests._base.Color"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.Color"] = true; -dojo.provide("tests._base.Color"); - -(function(){ - var white = dojo.colorFromString("white").toRgba(); - var maroon = dojo.colorFromString("maroon").toRgba(); - var verifyColor = function(t, source, expected){ - var color = new dojo.Color(source); - t.is(expected, color.toRgba()); - dojo.forEach(color.toRgba(), function(n){ t.is("number", typeof(n)); }); - } - - doh.register("tests._base.Color", - [ - function testColor1(t){ verifyColor(t, "maroon", maroon); }, - function testColor2(t){ verifyColor(t, "white", white); }, - function testColor3(t){ verifyColor(t, "#fff", white); }, - function testColor4(t){ verifyColor(t, "#ffffff", white); }, - function testColor5(t){ verifyColor(t, "rgb(255,255,255)", white); }, - function testColor6(t){ verifyColor(t, "#800000", maroon); }, - function testColor7(t){ verifyColor(t, "rgb(128, 0, 0)", maroon); }, - function testColor8(t){ verifyColor(t, "rgba(128, 0, 0, 0.5)", [128, 0, 0, 0.5]); }, - function testColor9(t){ verifyColor(t, maroon, maroon); }, - function testColor10(t){ verifyColor(t, [1, 2, 3], [1, 2, 3, 1]); }, - function testColor11(t){ verifyColor(t, [1, 2, 3, 0.5], [1, 2, 3, 0.5]); }, - function testColor12(t){ verifyColor(t, dojo.blendColors(new dojo.Color("black"), new dojo.Color("white"), 0.5), [128, 128, 128, 1]); } - ] - ); -})(); - -} diff --git a/includes/js/dojo/tests/_base/Deferred.js b/includes/js/dojo/tests/_base/Deferred.js deleted file mode 100644 index 5dcf003..0000000 --- a/includes/js/dojo/tests/_base/Deferred.js +++ /dev/null @@ -1,76 +0,0 @@ -if(!dojo._hasResource["tests._base.Deferred"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.Deferred"] = true; -dojo.provide("tests._base.Deferred"); - -doh.register("tests._base.Deferred", - [ - - function callback(t){ - var nd = new dojo.Deferred(); - var cnt = 0; - nd.addCallback(function(res){ - doh.debug("debug from dojo.Deferred callback"); - return res; - }); - nd.addCallback(function(res){ - // t.debug("val:", res); - cnt+=res; - return cnt; - }); - nd.callback(5); - // t.debug("cnt:", cnt); - t.assertEqual(cnt, 5); - }, - - function callback_extra_args(t){ - var nd = new dojo.Deferred(); - var cnt = 0; - nd.addCallback(dojo.global, function(base, res){ cnt+=base; cnt+=res; return cnt; }, 30); - nd.callback(5); - t.assertEqual(cnt, 35); - }, - - function errback(t){ - var nd = new dojo.Deferred(); - var cnt = 0; - nd.addErrback(function(val){ - return ++cnt; - }); - nd.errback(); - t.assertEqual(cnt, 1); - }, - - function callbackTwice(t){ - var nd = new dojo.Deferred(); - var cnt = 0; - nd.addCallback(function(res){ - return ++cnt; - }); - nd.callback(); - t.assertEqual(cnt, 1); - var thrown = false; - try{ - nd.callback(); - }catch(e){ - thrown = true; - } - t.assertTrue(thrown); - }, - - function addBoth(t){ - var nd = new dojo.Deferred(); - var cnt = 0; - nd.addBoth(function(res){ - return ++cnt; - }); - nd.callback(); - t.assertEqual(cnt, 1); - - // nd.callback(); - // t.debug(cnt); - // t.assertEqual(cnt, 1); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/NodeList.html b/includes/js/dojo/tests/_base/NodeList.html deleted file mode 100644 index e3f08c5..0000000 --- a/includes/js/dojo/tests/_base/NodeList.html +++ /dev/null @@ -1,370 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<!-- - we use a strict-mode DTD to ensure that the box model is the same for these - basic tests ---> -<html> - <head> - <style type="text/css"> - @import "../../resources/dojo.css"; - html, body { - padding: 0px; - margin: 0px; - border: 0px; - } - - #sq100 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - </style> - <title>testing dojo.NodeList</title> - <script type="text/javascript" src="../../dojo.js" - djConfig="isDebug: true, noFirebugLite: true"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - dojo.addOnLoad(function(){ - var c = dojo.byId("c1"); - var t = dojo.byId("t"); - var s = dojo.byId("sq100"); - var fourElementNL = new dojo.NodeList(c, t, c, t); - doh.register("t", - [ - // constructor tests - function ctor(){ - var nl = new dojo.NodeList(); - nl.push(c); - doh.is(1, nl.length); - }, - function ctorArgs(){ - var nl = new dojo.NodeList(4); - nl.push(c); - doh.is(5, nl.length); - }, - function ctorArgs2(){ - var nl = new dojo.NodeList(c, t); - doh.is(2, nl.length); - doh.is(c, nl[0]); - doh.is(t, nl[1]); - }, - // iteration and array tests - function forEach(){ - var lastItem; - var nl = new dojo.NodeList(c, t); - nl.forEach(function(i){ lastItem = i; }); - doh.is(t, lastItem); - - var r = nl.forEach(function(i, idx, arr){ - doh.t(arr.constructor == dojo.NodeList); - doh.is(2, arr.length); - }); - doh.t(r.constructor == dojo.NodeList); - doh.is(r, nl); - }, - - function indexOf(){ - doh.is(0, fourElementNL.indexOf(c)); - doh.is(1, fourElementNL.indexOf(t)); - doh.is(-1, fourElementNL.indexOf(null)); - }, - - function lastIndexOf(){ - doh.is(2, fourElementNL.lastIndexOf(c)); - doh.is(3, fourElementNL.lastIndexOf(t)); - doh.is(-1, fourElementNL.lastIndexOf(null)); - }, - - function every(){ - var ctr = 0; - var ret = fourElementNL.every(function(){ - ctr++; - return true; - }); - doh.is(4, ctr); - doh.t(ret); - - ctr = 0; - var ret = fourElementNL.every(function(){ - ctr++; - return false; - }); - doh.is(1, ctr); - doh.f(ret); - }, - - function some(){ - var ret = fourElementNL.some(function(){ - return true; - }); - doh.t(ret); - - var ret = fourElementNL.some(function(i){ - return (i.id == "t"); - }); - doh.t(ret); - }, - - function map(){ - var ret = fourElementNL.map(function(){ - return true; - }); - - doh.is(ret, [true, true, true, true]); - var cnt = 0; - var ret = fourElementNL.map(function(){ - return cnt++; - }); - // doh.is(ret, [0, 1, 2, 3]); - - doh.t(ret.constructor == dojo.NodeList); - - // make sure that map() returns a NodeList - var sum = 0; - fourElementNL.map(function(){ return 2; }).forEach( function(x){ sum += x; } ); - doh.is(sum, 8); - }, - - function slice(){ - var pnl = new dojo.NodeList(t, t, c); - doh.is(2, pnl.slice(1).length); - doh.is(3, pnl.length); - doh.is(c, pnl.slice(-1)[0]); - doh.is(2, pnl.slice(-2).length); - }, - - function splice(){ - var pnl = new dojo.NodeList(t, t, c); - console.debug(pnl.splice(1)); - /* - doh.is(2, pnl.splice(1).length); - doh.is(1, pnl.length); - pnl = new dojo.NodeList(t, t, c); - doh.is(c, pnl.splice(-1)[0]); - doh.is(2, pnl.length); - pnl = new dojo.NodeList(t, t, c); - doh.is(2, pnl.splice(-2).length); - */ - }, - - function spliceInsert(){ - // insert 1 - var pnl = new dojo.NodeList(t, t, c); - pnl.splice(0, 0, c); - doh.is(4, pnl.length); - doh.is(c, pnl[0]); - - // insert multiple - pnl = new dojo.NodeList(t, t, c); - pnl.splice(0, 0, c, s); - doh.is(5, pnl.length); - doh.is(c, pnl[0]); - doh.is(s, pnl[1]); - doh.is(t, pnl[2]); - - // insert multiple at offset - pnl = new dojo.NodeList(t, t, c); - pnl.splice(1, 0, c, s); - doh.is(5, pnl.length); - doh.is(t, pnl[0]); - doh.is(c, pnl[1]); - doh.is(s, pnl[2]); - doh.is(t, pnl[3]); - }, - - function spliceDel(){ - // clobbery 1 - var pnl = new dojo.NodeList(c, t, s); - pnl.splice(0, 1); - doh.is(2, pnl.length); - doh.is(t, pnl[0]); - - // clobber multiple - pnl = new dojo.NodeList(c, t, s); - pnl.splice(0, 2); - doh.is(1, pnl.length); - doh.is(s, pnl[0]); - - // ...at an offset - pnl = new dojo.NodeList(c, t, s); - pnl.splice(1, 1); - doh.is(2, pnl.length); - doh.is(c, pnl[0]); - doh.is(s, pnl[1]); - - }, - - function spliceInsertDel(){ - // clobbery 1 - var pnl = new dojo.NodeList(c, t, s); - pnl.splice(1, 1, s); - doh.is(3, pnl.length); - doh.is(dojo.NodeList(c, s, s), pnl); - - pnl = new dojo.NodeList(c, t, s); - pnl.splice(1, 2, s); - doh.is(2, pnl.length); - doh.is(dojo.NodeList(c, s), pnl); - }, - - // sub-search - function query(){ - var pnl = new dojo.NodeList(t); - doh.is(c, pnl.query("span")[0]); - doh.is(t, dojo.query("body").query(":last-child")[0]); - doh.is(c, dojo.query("body").query(":last-child")[1]); - doh.is(1, pnl.query().length); - }, - - function filter(){ - doh.is(dojo.query("body :first-child").filter(":last-child")[0], c); - doh.is(1, dojo.query("*").filter(function(n){ return (n.nodeName.toLowerCase() == "span"); }).length); - - var filterObj = { - filterFunc: function(n){ - return (n.nodeName.toLowerCase() == "span"); - } - }; - doh.is(1, dojo.query("*").filter(filterObj.filterFunc).length); - doh.is(1, dojo.query("*").filter(filterObj.filterFunc, filterObj).length); - }, - - // layout DOM functions - function coords(){ - var tnl = new dojo.NodeList(dojo.byId('sq100')) - doh.t(dojo.isArray(tnl)); - doh.is(100, tnl.coords()[0].w); - doh.is(100, tnl.coords()[0].h); - doh.is(document.body.getElementsByTagName("*").length, dojo.query("body *").coords().length); - }, - - function styleGet(){ - // test getting - var tnl = new dojo.NodeList(s); - doh.is(1, tnl.style("opacity")[0]); - tnl.push(t); - dojo.style(t, "opacity", 0.5); - doh.is(0.5, tnl.style("opacity").slice(-1)[0]); - tnl.style("opacity", 1); - }, - - function styleSet(){ - // test setting - var tnl = new dojo.NodeList(s, t); - tnl.style("opacity", 0.5); - doh.is(0.5, dojo.style(tnl[0], "opacity")); - doh.is(0.5, dojo.style(tnl[1], "opacity")); - // reset - tnl.style("opacity", 1); - }, - - function style(){ - var tnl = new dojo.NodeList(s, t); - tnl.style("opacity", 1); - doh.is(1, tnl.style("opacity")[0]); - dojo.style(t, "opacity", 0.5); - doh.is(1.0, tnl.style("opacity")[0]); - doh.is(0.5, tnl.style("opacity")[1]); - // reset things - tnl.style("opacity", 1); - }, - - function concat(){ - var spans = dojo.query("span"); - var divs = dojo.query("div"); - console.debug(spans.concat(divs)); - doh.is(spans.concat(divs).constructor, dojo.NodeList); - doh.is((divs.length + spans.length), spans.concat(divs).length); - }, - - function concat2(t){ - var spans = dojo.query("span"); - var divs = dojo.query("div"); - doh.is(spans.concat([]).constructor, dojo.NodeList); - }, - - function place(t){ - var ih = "<div><span></span></div><span class='thud'><b>blah</b></span>"; - - var tn = document.createElement("div"); - tn.innerHTML = ih; - dojo.body().appendChild(tn); - var nl = dojo.query("b", tn).place(tn, "first"); - doh.t(nl.constructor == dojo.NodeList); - doh.is(1, nl.length); - doh.is("b", nl[0].nodeName.toLowerCase()); - doh.is(tn, nl[0].parentNode); - doh.is(tn.firstChild, nl[0]); - }, - - function orphan(t){ - var ih = "<div><span></span></div><span class='thud'><b>blah</b></span>"; - - var tn = document.createElement("div"); - tn.innerHTML = ih; - dojo.body().appendChild(tn); - var nl = dojo.query("span", tn).orphan(); - doh.t(nl.constructor == dojo.NodeList); - - doh.is(2, nl.length); - doh.is(1, tn.getElementsByTagName("*").length); - - tn.innerHTML = ih; - var nl = dojo.query("*", tn).orphan("b"); - doh.is(1, nl.length); - doh.is("blah", nl[0].innerHTML); - }, - - /* - // FIXME - function adopt(t){ - }, - - function addContent(t){ - }, - */ - - function connect(t){ - var ih = "<div><span></span></div><span class='thud'><button>blah</button></span>"; - - var tn = document.createElement("div"); - tn.innerHTML = ih; - dojo.body().appendChild(tn); - - var ctr = 0; - var nl = dojo.query("button", tn).connect("onclick", function(){ - ctr++; - }); - nl[0].click(); - doh.is(1, ctr); - nl[0].click(); - nl[0].click(); - doh.is(3, ctr); - } - ] - ); - doh.run(); - }); - </script> - </head> - <body> - <h1>testing dojo.NodeList</h1> - <div id="sq100"> - 100px square, abs - </div> - <div id="t"> - <span id="c1">c1</span> - </div> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/addLoadEvents.html b/includes/js/dojo/tests/_base/_loader/addLoadEvents.html deleted file mode 100644 index 53e669f..0000000 --- a/includes/js/dojo/tests/_base/_loader/addLoadEvents.html +++ /dev/null @@ -1,37 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Testing dojo.addOnLoad() and dojo.addOnUnload()</title> - <script type="text/javascript" - src="../../../dojo.js" djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.addOnLoad(function(){ - console.debug("addOnLoad(func) works"); - }); - var scope = { - named: function(){ console.debug("addOnLoad(obj, name) works"); }, - refd: function(){ console.debug("addOnLoad(obj, func) works"); } - }; - dojo.addOnLoad(scope, "named"); - dojo.addOnLoad(scope, scope.refd); - // dojo.addOnLoad(scope, "named"); - // dojo.addOnLoad(scope, scope.refd); - - dojo.addOnUnload(function(){ - alert("addOnUnload works"); - }); - </script> - </head> - <body> - <h1>Testing dojo.addOnLoad() and dojo.addOnUnload()</h1> - - <p>This page has registers a function with dojo.addOnLoad() and dojo.addOnUnload.</p> - - <p><b>dojo.addOnLoad()</b>: You should see an alert with the page first loads ("addOnLoad works").</p> - - <p><b>dojo.addOnUnload()</b>: You should see an alert if the page is reloaded, or if you navigate to a - different web page ("addOnUnload works"). - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/afterOnLoad.html b/includes/js/dojo/tests/_base/_loader/afterOnLoad.html deleted file mode 100644 index 48ebd60..0000000 --- a/includes/js/dojo/tests/_base/_loader/afterOnLoad.html +++ /dev/null @@ -1,56 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Testing afterOnLoad</title> - - <link rel="stylesheet" type="text/css" href="../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../dijit/tests/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - window.onload = function(){ - //Create global djConfig object first. We cannot use the djConfig attribute - //on the script tag since it may not be visible in some browsers at the time - //dojo.js executes. This causes problems when the "require" property is used - //as part of djConfig. Also note that you have to set baseUrl directly, since - //it cannot be detected as part of script tag. - djConfig = { - baseUrl: "../../../", - parseOnLoad: true, - afterOnLoad:true, - require: [ - 'dojo.parser', - 'dijit._Calendar' - ], - isDebug: true - }; - - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = "../../../dojo.js"; - - document.getElementsByTagName("head")[0].appendChild(script); - } - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - </script> - </head> - <body> - <h1>Testing afterOnLoad</h1> - - <p><b>This page only works with a dojo build</b>. It will not work properly if you run it directly from the subversion source.</p> - - <p>This page tests loading dojo after the page is loaded. </p> - - <p>When the window.onload fires, the dojo script tag will be added to the DOM - and configured to fire the onload callbacks. If everything works, you should - see a Calendar below.</p> - - <p class="tundra"> - <input id="calendar1" dojoType="dijit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - </body> -</html> diff --git a/includes/js/dojo/tests/_base/_loader/bootstrap.js b/includes/js/dojo/tests/_base/_loader/bootstrap.js deleted file mode 100644 index c2605cb..0000000 --- a/includes/js/dojo/tests/_base/_loader/bootstrap.js +++ /dev/null @@ -1,86 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.bootstrap"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.bootstrap"] = true; -dojo.provide("tests._base._loader.bootstrap"); - -tests.register("tests._base._loader.bootstrap", - [ - - function hasConsole(t){ - t.assertTrue("console" in dojo.global); - t.assertTrue("assert" in console); - t.assertEqual("function", typeof console.assert); - }, - - { - name: "getObject", - setUp: function(){ - //Set an object in global scope. - dojo.global.globalValue = { - color: "blue", - size: 20 - }; - - //Set up an object in a specific scope. - this.foo = { - bar: { - color: "red", - size: 100 - } - }; - }, - runTest: function(t){ - //Test for existing object using global as root path. - var globalVar = dojo.getObject("globalValue"); - t.is("object", (typeof globalVar)); - t.assertEqual("blue", globalVar.color); - t.assertEqual(20, globalVar.size); - t.assertEqual("blue", dojo.getObject("globalValue.color")); - - //Test for non-existent object using global as root path. - //Then create it. - t.assertFalse(dojo.getObject("something.thatisNew")); - t.assertTrue(typeof(dojo.getObject("something.thatisNew", true)) == "object"); - - //Test for existing object using another object as root path. - var scopedVar = dojo.getObject("foo.bar", false, this); - t.assertTrue(typeof(scopedVar) == "object"); - t.assertEqual("red", scopedVar.color); - t.assertEqual(100, scopedVar.size); - t.assertEqual("red", dojo.getObject("foo.bar.color", true, this)); - - //Test for existing object using another object as root path. - //Then create it. - t.assertFalse(dojo.getObject("something.thatisNew", false, this)); - t.assertTrue(typeof(dojo.getObject("something.thatisNew", true, this)) == "object"); - }, - tearDown: function(){ - //Clean up global object that should not exist if - //the test is re-run. - try{ - delete dojo.global.something; - delete this.something; - }catch(e){} - } - }, - - { - name: "exists", - setUp: function(){ - this.foo = { - bar: {} - }; - }, - runTest: function(t){ - t.assertTrue(dojo.exists("foo.bar", this)); - t.assertFalse(dojo.exists("foo.bar")); - } - }, - - function evalWorks(t){ - t.assertTrue(dojo.eval("(true)")); - t.assertFalse(dojo.eval("(false)")); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/getText.txt b/includes/js/dojo/tests/_base/_loader/getText.txt deleted file mode 100644 index 054e8e8..0000000 --- a/includes/js/dojo/tests/_base/_loader/getText.txt +++ /dev/null @@ -1 +0,0 @@ -dojo._getText() test data
\ No newline at end of file diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_browser.js b/includes/js/dojo/tests/_base/_loader/hostenv_browser.js deleted file mode 100644 index 255fca5..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_browser.js +++ /dev/null @@ -1,15 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_browser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_browser"] = true; -dojo.provide("tests._base._loader.hostenv_browser"); - -tests.register("tests._base._loader.hostenv_browser", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = dojo._getText(filePath); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js b/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js deleted file mode 100644 index c121576..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_rhino.js +++ /dev/null @@ -1,17 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_rhino"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_rhino"] = true; -dojo.provide("tests._base._loader.hostenv_rhino"); - -tests.register("tests._base._loader.hostenv_rhino", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = (new String(readText(filePath))); - //The Java file read seems to add a line return. - text = text.replace(/[\r\n]+$/, ""); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js b/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js deleted file mode 100644 index 980d624..0000000 --- a/includes/js/dojo/tests/_base/_loader/hostenv_spidermonkey.js +++ /dev/null @@ -1,15 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.hostenv_spidermonkey"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.hostenv_spidermonkey"] = true; -dojo.provide("tests._base._loader.hostenv_spidermonkey"); - -tests.register("tests._base._loader.hostenv_spidermonkey", - [ - function getText(t){ - var filePath = dojo.moduleUrl("tests._base._loader", "getText.txt"); - var text = readText(filePath); - t.assertEqual("dojo._getText() test data", text); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/loader.js b/includes/js/dojo/tests/_base/_loader/loader.js deleted file mode 100644 index af1a338..0000000 --- a/includes/js/dojo/tests/_base/_loader/loader.js +++ /dev/null @@ -1,52 +0,0 @@ -if(!dojo._hasResource["tests._base._loader.loader"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base._loader.loader"] = true; -dojo.provide("tests._base._loader.loader"); - -tests.register("tests._base._loader.loader", - [ - function baseUrl(t){ - var originalBaseUrl = dojo.config["baseUrl"] || "./"; - - t.assertEqual(originalBaseUrl, dojo.baseUrl); - }, - - function modulePaths(t){ - dojo.registerModulePath("mycoolmod", "../some/path/mycoolpath"); - dojo.registerModulePath("mycoolmod.widget", "http://some.domain.com/another/path/mycoolpath/widget"); - - t.assertEqual("../some/path/mycoolpath/util", dojo._getModuleSymbols("mycoolmod.util").join("/")); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget", dojo._getModuleSymbols("mycoolmod.widget").join("/")); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/thingy", dojo._getModuleSymbols("mycoolmod.widget.thingy").join("/")); - }, - - function moduleUrls(t){ - dojo.registerModulePath("mycoolmod", "some/path/mycoolpath"); - dojo.registerModulePath("mycoolmod2", "/some/path/mycoolpath2"); - dojo.registerModulePath("mycoolmod.widget", "http://some.domain.com/another/path/mycoolpath/widget"); - - - var basePrefix = dojo.baseUrl; - //dojo._Uri will strip off "./" characters, so do the same here - if(basePrefix == "./"){ - basePrefix = ""; - } - - t.assertEqual(basePrefix + "some/path/mycoolpath/my/favorite.html", - dojo.moduleUrl("mycoolmod", "my/favorite.html").toString()); - t.assertEqual(basePrefix + "some/path/mycoolpath/my/favorite.html", - dojo.moduleUrl("mycoolmod.my", "favorite.html").toString()); - - t.assertEqual("/some/path/mycoolpath2/my/favorite.html", - dojo.moduleUrl("mycoolmod2", "my/favorite.html").toString()); - t.assertEqual("/some/path/mycoolpath2/my/favorite.html", - dojo.moduleUrl("mycoolmod2.my", "favorite.html").toString()); - - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/my/favorite.html", - dojo.moduleUrl("mycoolmod.widget", "my/favorite.html").toString()); - t.assertEqual("http://some.domain.com/another/path/mycoolpath/widget/my/favorite.html", - dojo.moduleUrl("mycoolmod.widget.my", "favorite.html").toString()); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/_loader/scope/scope04.html b/includes/js/dojo/tests/_base/_loader/scope/scope04.html deleted file mode 100644 index 1866e4a..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scope04.html +++ /dev/null @@ -1,80 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Multiversion Dojo: 0.4.3 and 1.0</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true - }; - </script> - <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script> - - <script type="text/javascript"> - //Need scope map defined in a script block. It will not work as part of the - //djConfig attribute on the script that loads Dojo. - //Also, just adding properties instead of redefining djConfig, since that - //will wipe out djConfig values set up by the 0.4.3 dojo. - djConfig.parseOnLoad = true; - djConfig.baseUrl = "../../../../"; - djConfig.scopeMap = [ - ["dojo", "dojo10"], - ["dijit", "dijit10"], - ["dojox", "dojox10"] - ]; - </script> - <script type="text/javascript" src="../../../../dojo.js"></script> - <script type="text/javascript"> - dojo.require("dojo.widget.DropdownDatePicker"); - dojo10.require("dijit._Calendar"); - dojo10.require("dojo.date.locale"); - dojo10.require("dojo.parser"); // scan page for widgets - - dojo.addOnLoad(function(){ - dojo.byId("output043").innerHTML = dojo.version.toString(); - }); - dojo10.addOnLoad(function(){ - dojo.byId("output10").innerHTML = dojo10.version.toString(); - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - - function foobar(){ - dojo.byId("typeOut").innerHTML = (typeof dojo.addClass); - } - setTimeout(foobar, 2000); - - </script> - </head> - <body> - <h1>Multiversion Dojo: 0.4.3 and 1.0</h1> - - <p><b>NOTE: This test only works with a built version of Dojo</b></p> - - <p>This page loads Dojo 0.4.3 and Dojo 1.0.</p> - - <p>Dojo 0.4.3 version: <span id="output043"></span></p> - - <p>Dojo 1.0 version: <span id="output10"></span></p> - - <p><b>dojo.addClass should be undefined:</b> <span id="typeOut"></span></p> - - <p> - <input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" > - </p> - - <p class="tundra"> - <input id="calendar1" dojo10Type="dijit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html b/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html deleted file mode 100644 index 0acea5b..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeContained.html +++ /dev/null @@ -1,71 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Multiversion Dojo: 0.4.3 and 1.0</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true - }; - </script> - <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script> - - <script type="text/javascript"> - //Scope map for this page is "burned in" via a build command (see HTML notes below). - //Also, just adding properties instead of redefining djConfig, since that - //will wipe out djConfig values set up by the 0.4.3 dojo. - djConfig.parseOnLoad = true; - djConfig.baseUrl = "../../../../"; - </script> - <script type="text/javascript" src="../../../../dojo.js"></script> - <script type="text/javascript"> - dojo.require("dojo.widget.DropdownDatePicker"); - - //Notice that dijit._Calendar is required, not jidit._Calendar. - //Same for the dojo resources (not jodo resources). - jodo.require("dijit._Calendar"); - jodo.require("dojo.date.locale"); - jodo.require("dojo.parser"); // scan page for widgets - - dojo.addOnLoad(function(){ - dojo.byId("output043").innerHTML = dojo.version.toString(); - }); - jodo.addOnLoad(function(){ - dojo.byId("output10").innerHTML = jodo.version.toString(); - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - </script> - </head> - <body> - <h1>Multiversion Dojo: 0.4.3 and 1.0</h1> - - <p><b>NOTE: This test only works with a built version of Dojo, and it must be built with the scopeMap parameter (the backslashes below are required):</b></p> - - <p style="color: blue; background-color: yellow">build.sh profile=standard action=release scopeMap=[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]]</p> - - <p>This page loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)</p> - - <p>Dojo 0.4.3 version: <span id="output043"></span></p> - - <p>Jodo version: <span id="output10"></span></p> - - <p> - <input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" > - </p> - - <p class="tundra"> - <input id="calendar1" jodoType="dijit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html b/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html deleted file mode 100644 index c4c2eda..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeContainedXd.html +++ /dev/null @@ -1,84 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Multiversion Dojo: 0.4.3 and 1.0</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true - }; - </script> - <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script> - - <script type="text/javascript"> - //Scope map for this page is "burned in" via a build command (see HTML notes below). - //Also, just adding properties instead of redefining djConfig, since that - //will wipe out djConfig values set up by the 0.4.3 dojo. - djConfig.parseOnLoad = true; - djConfig.baseUrl = "../../../../"; - djConfig.useXDomain = true; //Technically this was set already in the 0.4.3 xd dojo.js file. - </script> - <script type="text/javascript" src="../../../../dojo.xd.js"></script> - <script type="text/javascript"> - dojo.require("dojo.widget.DropdownDatePicker"); - - //Get base xd path - var xdPath = location.href; - var lastIndex = location.href.lastIndexOf("/"); - xdPath = xdPath.substring(0, lastIndex + 1); - - //Set up xdomain locations for dojo/dijit/dojox. - jodo.registerModulePath("dojo", xdPath + "../../../../../dojo"); - jodo.registerModulePath("dijit", xdPath + "../../../../../dijit"); - jodo.registerModulePath("dojox", xdPath + "../../../../../dojox"); - - //Notice that dijit._Calendar is required, not jidit._Calendar. - //Same for the dojo resources (not jodo resources). - jodo.require("dijit._Calendar"); - jodo.require("dojo.date.locale"); - jodo.require("dojo.parser"); // scan page for widgets - - dojo.addOnLoad(function(){ - dojo.byId("output043").innerHTML = dojo.version.toString(); - }); - jodo.addOnLoad(function(){ - dojo.byId("output10").innerHTML = jodo.version.toString(); - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - </script> - </head> - <body> - <h1>XDomain Multiversion Dojo: 0.4.3 and 1.0</h1> - - <p><b>NOTE: This test only works with a built, xdomain version of Dojo, and it must be built with the scopeMap parameter (the backslashes below are required):</b></p> - - <p style="color: blue; background-color: yellow">build.sh profile=standard action=release scopeMap=[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]] xdDojoScopeName=jodo loader=xdomain</p> - - <p><b>Only load this page from an http:// URL</b>. Otherwise, the xd loading will not happen.</p> - - <p>This page xdomain loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)</p> - - <p>Dojo 0.4.3 version: <span id="output043"></span></p> - - <p>Jodo version: <span id="output10"></span></p> - - <p> - <input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" > - </p> - - <p class="tundra"> - <input id="calendar1" jodoType="dijit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html b/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html deleted file mode 100644 index 0ef5daa..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeDjConfig.html +++ /dev/null @@ -1,64 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Multiversion Dojo: 0.4.3 and 1.0 (scoped djConfig)</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true - }; - </script> - <script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.3/dojo.js"></script> - - <script type="text/javascript" src="../../../../dojo.js"></script> - <script type="text/javascript"> - dojo.require("dojo.widget.DropdownDatePicker"); - - //Notice that dijit._Calendar is required, not jidit._Calendar. - //Same for the dojo resources (not jodo resources). - jodo.require("dijit._Calendar"); - jodo.require("dojo.date.locale"); - jodo.require("dojo.parser"); // scan page for widgets - - dojo.addOnLoad(function(){ - dojo.byId("output043").innerHTML = djConfig.baseUrl; - }); - jodo.addOnLoad(function(){ - dojo.byId("output10").innerHTML = jodo.baseUrl; - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - </script> - </head> - <body> - <h1>Multiversion Dojo: 0.4.3 and 1.0 (scoped djConfig)</h1> - - <p><b>NOTE: This test only works with a built version of Dojo, and it must be built with the scopeDjConfig parameter (the backslashes below are required):</b></p> - - <p style="color: blue; background-color: yellow">build.sh profile=standard action=release scopeDjConfig=\{parseOnLoad:true,baseUrl:\"../../../../\",foo:\"bar\",scopeMap:[[\"dojo\",\"jodo\"],[\"dijit\",\"jidit\"],[\"dojox\",\"jodox\"]]\}</p> - - <p>This page loads Dojo 0.4.3 and Dojo 1.0 (under the jodo scope)</p> - - <p>djConfig.baseUrl should <b>not</b> exist: <span id="output043"></span></p> - - <p>jodo.baseUrl should be "../../../../": <span id="output10"></span></p> - - <p> - <input dojoType="dropdowndatepicker" value="2006-10-31" containerToggle="wipe" containerToggleDuration="300" > - </p> - - <p class="tundra"> - <input id="calendar1" jodoType="dijit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html b/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html deleted file mode 100644 index 759fcbe..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeSingle.html +++ /dev/null @@ -1,62 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Using scope names inside dojo.require/dojoType</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true, - parseOnLoad: true, - baseUrl: "../../../../", - scopeMap: [ - ["dojo", "jodo"], - ["dijit", "jidit"], - ["dojox", "jodox"] - ] - }; - </script> - - <script type="text/javascript" src="../../../../dojo.js"></script> - <script type="text/javascript"> - - //Notice that dijit._Calendar is required, not jidit._Calendar. - //Same for the dojo resources (not jodo resources). - jodo.require("dijit._Calendar"); - jodo.require("dojo.date.locale"); - jodo.require("dojo.parser"); // scan page for widgets - - jodo.addOnLoad(function(){ - jodo.byId("output10").innerHTML = jodo.version.toString(); - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - function foobar(){ - jodo.byId("typeOut").innerHTML = "typeof dojo: " + (typeof dojo) + "<br>typeof dijit: " + (typeof dijit) + "<br>typeof dojox: " + (typeof dojox); - } - setTimeout(foobar, 2000); - </script> - </head> - <body> - <h1>Using scope names inside dojo.require/dojoType</h1> - - <p><b>NOTE: This test only works with a built version of Dojo.</b></p> - - <p>Jodo version: <span id="output10"></span></p> - - <p><b>typeof dojo, dijit and dojox should be undefined</b>: <br><span id="typeOut"></span></p> - - <p class="tundra"> - <input id="calendar1" jodoType="jidit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html b/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html deleted file mode 100644 index 8f9d7d8..0000000 --- a/includes/js/dojo/tests/_base/_loader/scope/scopeSingleDaac.html +++ /dev/null @@ -1,63 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>Using scope names inside dojo.require/dojoType</title> - - <link rel="stylesheet" type="text/css" href="../../../../resources/dojo.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/css/dijitTests.css" /> - <link rel="stylesheet" type="text/css" href="../../../../../dijit/themes/tundra/tundra.css" /> - - <script type="text/javascript"> - //djConfig for 0.4.3 setup. - djConfig = { - isDebug: true, - debugAtAllCosts: true, - parseOnLoad: true, - baseUrl: "../../../../", - scopeMap: [ - ["dojo", "jodo"], - ["dijit", "jidit"], - ["dojox", "jodox"] - ] - }; - </script> - - <script type="text/javascript" src="../../../../dojo.js"></script> - <script type="text/javascript"> - - //Notice that dijit._Calendar is required, not jidit._Calendar. - //Same for the dojo resources (not jodo resources). - jodo.require("dijit._Calendar"); - jodo.require("dojo.date.locale"); - jodo.require("dojo.parser"); // scan page for widgets - - jodo.addOnLoad(function(){ - jodo.byId("output10").innerHTML = jodo.version.toString(); - }); - - function myHandler(id,newValue){ - console.debug("onChange for id = " + id + ", value: " + newValue); - } - function foobar(){ - jodo.byId("typeOut").innerHTML = "typeof dojo: " + (typeof dojo) + "<br>typeof dijit: " + (typeof dijit) + "<br>typeof dojox: " + (typeof dojox); - } - setTimeout(foobar, 2000); - </script> - </head> - <body> - <h1>Using scope names inside dojo.require/dojoType</h1> - - <p><b>NOTE: This test only works with a built version of Dojo.</b></p> - - <p>Jodo version: <span id="output10"></span></p> - - <p><b>typeof dojo, dijit and dojox should be object, since debugAtAllCosts is ON</b>: <br><span id="typeOut"></span></p> - - <p class="tundra"> - <input id="calendar1" jodoType="jidit._Calendar" onChange="myHandler(this.id,arguments[0])"> - </p> - - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/array.js b/includes/js/dojo/tests/_base/array.js deleted file mode 100644 index 6611257..0000000 --- a/includes/js/dojo/tests/_base/array.js +++ /dev/null @@ -1,301 +0,0 @@ -if(!dojo._hasResource["tests._base.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.array"] = true; -dojo.provide("tests._base.array"); - -tests.register("tests._base.array", - [ - function testIndexOf(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "ccc"]; - - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56)); - t.assertEqual(1, dojo.indexOf([Number, String, Date], String)); - t.assertEqual(1, dojo.indexOf(foo, foo[1])); - t.assertEqual(2, dojo.indexOf(foo, foo[2])); - t.assertEqual(1, dojo.indexOf(bar, bar[1])); - t.assertEqual(2, dojo.indexOf(bar, bar[2])); - t.assertEqual(-1, dojo.indexOf({a:1}, "a")); - - foo.push(bar); - t.assertEqual(3, dojo.indexOf(foo, bar)); - }, - - function testIndexOfFromIndex(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "ccc"]; - - t.assertEqual(-1, dojo.indexOf([45, 56, 85], 56, 2)); - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56, 1)); - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56, -1)); - // Make sure going out of bounds doesn't throw us in an infinite loop - t.assertEqual(-1, dojo.indexOf([45, 56, 85], 56, 3)); - }, - - function testLastIndexOf(t){ - var foo = [128, 256, 512]; - var bar = ["aaa", "bbb", "aaa", "ccc"]; - - t.assertEqual(1, dojo.indexOf([45, 56, 85], 56)); - t.assertEqual(1, dojo.indexOf([Number, String, Date], String)); - t.assertEqual(1, dojo.lastIndexOf(foo, foo[1])); - t.assertEqual(2, dojo.lastIndexOf(foo, foo[2])); - t.assertEqual(1, dojo.lastIndexOf(bar, bar[1])); - t.assertEqual(2, dojo.lastIndexOf(bar, bar[2])); - t.assertEqual(2, dojo.lastIndexOf(bar, bar[0])); - }, - - function testLastIndexOfFromIndex(t){ - t.assertEqual(1, dojo.lastIndexOf([45, 56, 85], 56, 1)); - t.assertEqual(-1, dojo.lastIndexOf([45, 56, 85], 85, 1)); - t.assertEqual(-1, dojo.lastIndexOf([45, 56, 85], 85, -1)); - t.assertEqual(0, dojo.lastIndexOf([45, 56, 45], 45, 0)); - }, - - function testForEach(t){ - var foo = [128, "bbb", 512]; - dojo.forEach(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); break; - case 1: t.assertEqual("bbb", elt); break; - case 2: t.assertEqual(512, elt); break; - default: t.assertTrue(false); - } - }); - - var noException = true; - try{ - dojo.forEach(undefined, function(){}); - }catch(e){ - noException = false; - } - t.assertTrue(noException); - }, - - function testForEach_str(t){ - var bar = 'abc'; - dojo.forEach(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); break; - case 1: t.assertEqual("b", elt); break; - case 2: t.assertEqual("c", elt); break; - default: t.assertTrue(false); - } - }); - }, - // FIXME: test forEach w/ a NodeList()? - - function testForEach_string_callback(t){ - // Test using strings as callback", which accept the parameters with - // the names "item", "index" and "array"! - var foo = [128, "bbb", 512]; - // Test that the variable "item" contains the value of each item. - this._res = ""; - dojo.forEach(foo, 'this._res+=item', this); - t.assertEqual(this._res, "128bbb512"); - // Test that the variable "index" contains each index. - this._res = []; - dojo.forEach(foo, 'this._res.push(index)', this); - t.assertEqual(this._res, [0,1,2]); - // Test that the variable "array" always contains the entire array. - this._res = []; - dojo.forEach(foo, 'this._res.push(array)', this); - t.assertEqual(this._res, [[128, "bbb", 512],[128, "bbb", 512],[128, "bbb", 512]]); - // Catch undefined variable usage (I used to use "i" :-)). - var caughtException = false; - try{ - dojo.forEach(foo, 'this._res+=i', this); - }catch(e){ - caughtException = true; - } - t.assertTrue(caughtException); - }, - - // FIXME: test forEach w/ a NodeList()? - function testEvery(t){ - var foo = [128, "bbb", 512]; - - t.assertTrue( - dojo.every(foo, function(elt, idx, array){ - t.assertEqual(Array, array.constructor); - t.assertTrue(dojo.isArray(array)); - t.assertTrue(typeof idx == "number"); - if(idx == 1){ t.assertEqual("bbb" , elt); } - return true; - }) - ); - - t.assertTrue( - dojo.every(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); return true; - case 1: t.assertEqual("bbb", elt); return true; - case 2: t.assertEqual(512, elt); return true; - default: return false; - } - }) - ); - - t.assertFalse( - dojo.every(foo, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual(128, elt); return true; - case 1: t.assertEqual("bbb", elt); return true; - case 2: t.assertEqual(512, elt); return false; - default: return true; - } - }) - ); - - }, - - function testEvery_str(t){ - var bar = 'abc'; - t.assertTrue( - dojo.every(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return true; - default: return false; - } - }) - ); - - t.assertFalse( - dojo.every(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return false; - default: return true; - } - }) - ); - }, - // FIXME: test NodeList for every()? - - function testSome(t){ - var foo = [128, "bbb", 512]; - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - t.assertEqual(3, array.length); - return true; - }) - ); - - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - if(idx < 1){ return true; } - return false; - }) - ); - - t.assertFalse( - dojo.some(foo, function(elt, idx, array){ - return false; - }) - ); - - t.assertTrue( - dojo.some(foo, function(elt, idx, array){ - t.assertEqual(Array, array.constructor); - t.assertTrue(dojo.isArray(array)); - t.assertTrue(typeof idx == "number"); - if(idx == 1){ t.assertEqual("bbb" , elt); } - return true; - }) - ); - }, - - function testSome_str(t){ - var bar = 'abc'; - t.assertTrue( - dojo.some(bar, function(elt, idx, array){ - t.assertEqual(3, array.length); - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return true; - default: return false; - } - }) - ); - - t.assertTrue( - dojo.some(bar, function(elt, idx, array){ - switch(idx){ - case 0: t.assertEqual("a", elt); return true; - case 1: t.assertEqual("b", elt); return true; - case 2: t.assertEqual("c", elt); return false; - default: return true; - } - }) - ); - - t.assertFalse( - dojo.some(bar, function(elt, idx, array){ - return false; - }) - ); - }, - // FIXME: need to add scoping tests for all of these!!! - - function testFilter(t){ - var foo = ["foo", "bar", 10]; - - t.assertEqual(["foo"], - dojo.filter(foo, function(elt, idx, array){ - return idx < 1; - }) - ); - - t.assertEqual(["foo"], - dojo.filter(foo, function(elt, idx, array){ - return elt == "foo"; - }) - ); - - t.assertEqual([], - dojo.filter(foo, function(elt, idx, array){ - return false; - }) - ); - - t.assertEqual([10], - dojo.filter(foo, function(elt, idx, array){ - return typeof elt == "number"; - }) - ); - }, - - function testFilter_str(t){ - var foo = "thinger blah blah blah"; - t.assertEqual(["t", "h", "i"], - dojo.filter(foo, function(elt, idx, array){ - return idx < 3; - }) - ); - - t.assertEqual([], - dojo.filter(foo, function(elt, idx, array){ - return false; - }) - ); - }, - - function testMap(t){ - t.assertEqual([], - dojo.map([], function(){ return true; }) - ); - - t.assertEqual([1, 2, 3], - dojo.map(["cat", "dog", "mouse"], function(elt, idx, array){ - return idx+1; - }) - ); - } - ] -); - - -} diff --git a/includes/js/dojo/tests/_base/connect.js b/includes/js/dojo/tests/_base/connect.js deleted file mode 100644 index 3761861..0000000 --- a/includes/js/dojo/tests/_base/connect.js +++ /dev/null @@ -1,225 +0,0 @@ -if(!dojo._hasResource["tests._base.connect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.connect"] = true; -dojo.provide("tests._base.connect"); - -hub = function(){ -} - -failures = 0; -bad = function(){ - failures++; -} - -good = function(){ -} - -// make 'iterations' connections to hub -// roughly half of which will be to 'good' and -// half to 'bad' -// all connections to 'bad' are disconnected -// test can then be performed on the values -// 'failures' and 'successes' -markAndSweepTest = function(iterations){ - var marked = []; - // connections - for(var i=0; i<iterations; i++){ - if(Math.random() < 0.5){ - marked.push(dojo.connect('hub', bad)); - }else{ - dojo.connect('hub', good); - } - } - // Randomize markers (only if the count isn't very high) - if(i < Math.pow(10, 4)){ - var rm = [ ]; - while(marked.length){ - var m = Math.floor(Math.random() * marked.length); - rm.push(marked[m]); - marked.splice(m, 1); - } - marked = rm; - } - for(var m=0; m<marked.length; m++){ - dojo.disconnect(marked[m]); - } - // test - failures = 0; - hub(); - // return number of disconnected functions that fired (should be 0) - return failures; -} - -markAndSweepSubscribersTest = function(iterations){ - var topic = "hubbins"; - var marked = []; - // connections - for(var i=0; i<iterations; i++){ - if(Math.random() < 0.5){ - marked.push(dojo.subscribe(topic, bad)); - }else{ - dojo.subscribe(topic, good); - } - } - // Randomize markers (only if the count isn't very high) - if(i < Math.pow(10, 4)){ - var rm = [ ]; - while(marked.length){ - var m = Math.floor(Math.random() * marked.length); - rm.push(marked[m]); - marked.splice(m, 1); - } - marked = rm; - } - for(var m=0; m<marked.length; m++){ - dojo.unsubscribe(marked[m]); - } - // test - failures = 0; - dojo.publish(topic); - // return number of unsubscribed functions that fired (should be 0) - return failures; -} - -tests.register("tests._base.connect", - [ - function smokeTest(t){ - // foo sets ok to false - var ok = false; - var foo = { "foo": function(){ ok=false; } }; - // connected function sets ok to true - dojo.connect(foo, "foo", null, function(){ ok=true; }); - foo.foo(); - t.is(true, ok); - }, - function basicTest(t) { - var out = ''; - var obj = { - foo: function() { - out += 'foo'; - }, - bar: function() { - out += 'bar'; - }, - baz: function() { - out += 'baz'; - } - }; - // - var foobar = dojo.connect(obj, "foo", obj, "bar"); - dojo.connect(obj, "bar", obj, "baz"); - // - out = ''; - obj.foo(); - t.is('foobarbaz', out); - // - out = ''; - obj.bar(); - t.is('barbaz', out); - // - out = ''; - obj.baz(); - t.is('baz', out); - // - dojo.connect(obj, "foo", obj, "baz"); - dojo.disconnect(foobar); - // - out = ''; - obj.foo(); - t.is('foobaz', out); - // - out = ''; - obj.bar(); - t.is('barbaz', out); - // - out = ''; - obj.baz(); - t.is('baz', out); - }, - function hubConnectDisconnect1000(t){ - t.is(0, markAndSweepTest(1000)); - }, - function args4Test(t){ - // standard 4 args test - var ok, obj = { foo: function(){ok=false;}, bar: function(){ok=true} }; - dojo.connect(obj, "foo", obj, "bar"); - obj.foo(); - t.is(true, ok); - }, - function args3Test(t){ - // make some globals - var ok; - dojo.global["gFoo"] = function(){ok=false;}; - dojo.global["gOk"] = function(){ok=true;}; - // 3 arg shorthand for globals (a) - var link = dojo.connect("gFoo", null, "gOk"); - gFoo(); - dojo.disconnect(link); - t.is(true, ok); - // 3 arg shorthand for globals (b) - link = dojo.connect(null, "gFoo", "gOk"); - gFoo(); - dojo.disconnect(link); - t.is(true, ok); - // verify disconnections - gFoo(); - t.is(false, ok); - }, - function args2Test(t){ - // make some globals - var ok; - dojo.global["gFoo"] = function(){ok=false;}; - dojo.global["gOk"] = function(){ok=true;}; - // 2 arg shorthand for globals - var link = dojo.connect("gFoo", "gOk"); - gFoo(); - dojo.disconnect(link); - t.is(true, ok); - // 2 arg shorthand for globals, alternate scoping - link = dojo.connect("gFoo", gOk); - gFoo(); - dojo.disconnect(link); - t.is(true, ok); - }, - function scopeTest1(t){ - var foo = { ok: true, foo: function(){this.ok=false;} }; - var bar = { ok: false, bar: function(){this.ok=true} }; - // link foo.foo to bar.bar with natural scope - var link = dojo.connect(foo, "foo", bar, "bar"); - foo.foo(); - t.is(false, foo.ok); - t.is(true, bar.ok); - }, - function scopeTest2(t){ - var foo = { ok: true, foo: function(){this.ok=false;} }; - var bar = { ok: false, bar: function(){this.ok=true} }; - // link foo.foo to bar.bar such that scope is always 'foo' - var link = dojo.connect(foo, "foo", bar.bar); - foo.foo(); - t.is(true, foo.ok); - t.is(false, bar.ok); - }, - function connectPublisher(t){ - var foo = { inc: 0, foo: function(){ this.inc++; } }; - var bar = { inc: 0, bar: function(){ this.inc++; } }; - var c1h = dojo.connectPublisher("/blah", foo, "foo"); - var c2h = dojo.connectPublisher("/blah", foo, "foo"); - dojo.subscribe("/blah", bar, "bar"); - foo.foo(); - t.is(1, foo.inc); - t.is(2, bar.inc); - dojo.disconnect(c1h); - foo.foo(); - t.is(2, foo.inc); - t.is(3, bar.inc); - dojo.disconnect(c2h); - foo.foo(); - t.is(3, foo.inc); - t.is(3, bar.inc); - }, - function publishSubscribe1000(t){ - t.is(markAndSweepSubscribersTest(1000), 0); - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/declare.js b/includes/js/dojo/tests/_base/declare.js deleted file mode 100644 index 11720ec..0000000 --- a/includes/js/dojo/tests/_base/declare.js +++ /dev/null @@ -1,197 +0,0 @@ -if(!dojo._hasResource["tests._base.declare"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.declare"] = true; -dojo.provide("tests._base.declare"); - -tests.register("tests._base.declare", - [ - function smokeTest(t){ - dojo.declare("tests._base.declare.tmp"); - var tmp = new tests._base.declare.tmp(); - dojo.declare("testsFoo"); - var tmp = new testsFoo(); - }, - function smokeTest2(t){ - dojo.declare("tests._base.declare.foo", null, { - foo: "thonk" - }); - var tmp = new tests._base.declare.foo(); - t.is("thonk", tmp.foo); - - dojo.declare("testsFoo2", null, { - foo: "thonk" - }); - var tmp2 = new testsFoo2(); - t.is("thonk", tmp2.foo); - }, - function smokeTestWithCtor(t){ - dojo.declare("tests._base.declare.fooBar", null, { - constructor: function(){ - this.foo = "blah"; - }, - foo: "thonk" - }); - var tmp = new tests._base.declare.fooBar(); - t.is("blah", tmp.foo); - }, - function smokeTestCompactArgs(t){ - dojo.declare("tests._base.declare.fooBar2", null, { - foo: "thonk" - }); - var tmp = new tests._base.declare.fooBar2(); - t.is("thonk", tmp.foo); - }, - function subclass(t){ - dojo.declare("tests._base.declare.tmp3", null, { - foo: "thonk" - }); - dojo.declare("tests._base.declare.tmp4", tests._base.declare.tmp3); - var tmp = new tests._base.declare.tmp4(); - t.is("thonk", tmp.foo); - }, - function subclassWithCtor(t){ - dojo.declare("tests._base.declare.tmp5", null, { - constructor: function(){ - this.foo = "blah"; - }, - foo: "thonk" - }); - dojo.declare("tests._base.declare.tmp6", tests._base.declare.tmp5); - var tmp = new tests._base.declare.tmp6(); - t.is("blah", tmp.foo); - }, - function mixinSubclass(t){ - dojo.declare("tests._base.declare.tmp7", null, { - foo: "thonk" - }); - dojo.declare("tests._base.declare.tmp8", null, { - constructor: function(){ - this.foo = "blah"; - } - }); - var tmp = new tests._base.declare.tmp8(); - t.is("blah", tmp.foo); - dojo.declare("tests._base.declare.tmp9", - [ - tests._base.declare.tmp7, // prototypal - tests._base.declare.tmp8 // mixin - ]); - var tmp2 = new tests._base.declare.tmp9(); - t.is("blah", tmp2.foo); - }, - function superclassRef(t){ - dojo.declare("tests._base.declare.tmp10", null, { - foo: "thonk" - }); - dojo.declare("tests._base.declare.tmp11", tests._base.declare.tmp10, { - constructor: function(){ - this.foo = "blah"; - } - }); - var tmp = new tests._base.declare.tmp11(); - t.is("blah", tmp.foo); - t.is("thonk", tests._base.declare.tmp11.superclass.foo); - }, - function inheritedCall(t){ - var foo = "xyzzy"; - dojo.declare("tests._base.declare.tmp12", null, { - foo: "thonk", - bar: function(arg1, arg2){ - if(arg1){ - this.foo = arg1; - } - if(arg2){ - foo = arg2; - } - } - }); - dojo.declare("tests._base.declare.tmp13", tests._base.declare.tmp12, { - constructor: function(){ - this.foo = "blah"; - } - }); - var tmp = new tests._base.declare.tmp13(); - t.is("blah", tmp.foo); - t.is("xyzzy", foo); - tmp.bar("zot"); - t.is("zot", tmp.foo); - t.is("xyzzy", foo); - tmp.bar("trousers", "squiggle"); - t.is("trousers", tmp.foo); - t.is("squiggle", foo); - }, - function inheritedExplicitCall(t){ - var foo = "xyzzy"; - dojo.declare("tests._base.declare.tmp14", null, { - foo: "thonk", - bar: function(arg1, arg2){ - if(arg1){ - this.foo = arg1; - } - if(arg2){ - foo = arg2; - } - } - }); - dojo.declare("tests._base.declare.tmp15", tests._base.declare.tmp14, { - constructor: function(){ - this.foo = "blah"; - }, - bar: function(arg1, arg2){ - this.inherited("bar", arguments, [arg2, arg1]); - }, - baz: function(arg1, arg2){ - tests._base.declare.tmp15.superclass.bar.apply(this, arguments); - } - }); - var tmp = new tests._base.declare.tmp15(); - t.is("blah", tmp.foo); - t.is("xyzzy", foo); - tmp.baz("zot"); - t.is("zot", tmp.foo); - t.is("xyzzy", foo); - tmp.bar("trousers", "squiggle"); - t.is("squiggle", tmp.foo); - t.is("trousers", foo); - }, - function inheritedMixinCalls(t){ - dojo.declare("tests._base.declare.tmp16", null, { - foo: "", - bar: function(){ - this.foo += "tmp16"; - } - }); - dojo.declare("tests._base.declare.mixin16", null, { - bar: function(){ - this.inherited(arguments); - this.foo += ".mixin16"; - } - }); - dojo.declare("tests._base.declare.mixin17", tests._base.declare.mixin16, { - bar: function(){ - this.inherited(arguments); - this.foo += ".mixin17"; - } - }); - dojo.declare("tests._base.declare.tmp17", [tests._base.declare.tmp16, tests._base.declare.mixin17], { - bar: function(){ - this.inherited(arguments); - this.foo += ".tmp17"; - } - }); - var tmp = new tests._base.declare.tmp17(); - tmp.bar(); - t.is("tmp16.mixin16.mixin17.tmp17", tmp.foo); - }, - function mixinPreamble(t){ - var passed = false; - dojo.declare("tests._base.declare.tmp16"); - new tests._base.declare.tmp16({ preamble: function(){ passed = true; } }); - t.t(passed); - } - // FIXME: there are still some permutations to test like: - // - ctor arguments - // - multi-level inheritance + L/R conflict checks - ] -); - -} diff --git a/includes/js/dojo/tests/_base/fx.html b/includes/js/dojo/tests/_base/fx.html deleted file mode 100644 index 2ef751c..0000000 --- a/includes/js/dojo/tests/_base/fx.html +++ /dev/null @@ -1,342 +0,0 @@ -<html> - <head> - <title>testing Core FX</title> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" - src="../../dojo.js" - djConfig="isDebug: true"></script> - <script type="text/javascript" src="../../_base/fx.js"></script> - <script type="text/javascript"> - var duration = 500; - var timeout = 750; - dojo.require("doh.runner"); - dojo.addOnLoad(function(){ - doh.register("t", - [ - { - name: "fadeOut", - timeout: timeout, - runTest: function(){ - var opacity = dojo.style('foo', 'opacity'); - doh.is(1, opacity); - var anim = dojo.fadeOut({ node: 'foo', duration: duration }); - var d = new doh.Deferred(); - dojo.connect(anim, "onEnd", function(){ - var opacity = dojo.style('foo', 'opacity'); - var elapsed = (new Date()) - anim._start; - doh.is(0, opacity); - doh.t(elapsed >= duration); - d.callback(true); - }); - anim._start = new Date(); - anim.play(); - return d; - } - }, - { - name: "fadeIn", - timeout: timeout, - runTest: function(){ - var opacity = dojo.style('foo', 'opacity'); - doh.is(0, opacity); - var anim = dojo.fadeIn({ node: 'foo', duration: duration }); - var d = new doh.Deferred(); - dojo.connect(anim, "onEnd", function(){ - var opacity = dojo.style('foo', 'opacity'); - var elapsed = (new Date()) - anim._start; - doh.is(1, opacity); - doh.t(elapsed >= duration); - d.callback(true); - }); - anim._start = new Date(); - anim.play(); - return d; - } - }, - { - name: "animateColor", - timeout: timeout, - runTest: function(){ - var d = new doh.Deferred(); - var anim = dojo.animateProperty({ - node: "foo", - duration: duration, - properties: { - color: { start: "black", end: "white" }, - backgroundColor: { start: "white", end: "black" } - } - }); - dojo.connect(anim, "onEnd", anim, function(){ - d.callback(true); - }); - anim.play(); - return d; - } - }, - { - name: "animateColorBack", - timeout: timeout, - runTest: function(){ - var d = new doh.Deferred(); - var anim = dojo.animateProperty({ - node: "foo", - duration: duration, - properties: { - color: { end: "black" }, - backgroundColor: { end: "#5d81b4" }, - letterSpacing: { start: 0, end: 10 } - } - }); - dojo.connect(anim, "onEnd", anim, function(){ - d.callback(true); - }); - anim.play(); - return d; - } - }, - { - name: "animateHeight", - timeout: timeout, - runTest: function(t){ - dojo.byId("foo").style.height = ""; - var startHeight = dojo.marginBox("foo").h; - var endHeight = Math.round(startHeight / 2); - - var anim = dojo.animateProperty({ - node: "foo", - properties: { height: { end: endHeight } }, - duration: duration - }); - - var d = new doh.Deferred(); - - dojo.connect(anim, "onEnd", anim, function(){ - var elapsed = (new Date().valueOf()) - anim._startTime; - doh.t(elapsed >= duration); - var height = dojo.marginBox("foo").h; - doh.is(height, endHeight); - d.callback(true); - }); - - anim.play(); - return d; - } - }, - { - name: "animateHeight_defaults_syntax", - timeout: timeout, - runTest: function(){ - dojo.byId("foo").style.height = ""; - var startHeight = dojo.marginBox("foo").h; - var endHeight = Math.round(startHeight / 2); - - var anim = dojo.animateProperty({ - node: "foo", - properties: { height: endHeight }, - duration: duration - }); - - var d = new doh.Deferred(); - - dojo.connect(anim, "onEnd", anim, function(){ - var elapsed = (new Date().valueOf()) - anim._startTime; - doh.t(elapsed >= duration); - var height = dojo.marginBox("foo").h; - doh.is(height, endHeight); - d.callback(true); - }); - - anim.play(); - return d; - } - }, - { - name: "inlineWidth", - timeout: timeout, - runTest: function(){ - dojo.style("foo", "display", "none"); - dojo.style("bar", "display", ""); - var startWidth = dojo.marginBox("bar").w; - var endWidth = Math.round(startWidth / 2); - - var anim = dojo.animateProperty({ - node: "bar", - properties: { width: endWidth }, - duration: duration - }); - - var d = new doh.Deferred(); - - dojo.connect(anim, "onEnd", anim, function(){ - var elapsed = (new Date().valueOf()) - anim._startTime; - doh.t(elapsed >= duration); - doh.is(dojo.marginBox("bar").w, endWidth); - d.callback(true); - }); - - anim.play(); - return d; - } - }, - { - name: "anim", - timeout: timeout+500, - runTest: function(){ - var id = "baz"; - dojo.style("bar", "display", "none"); - dojo.style(id, "display", ""); - var kickoff = new Date().valueOf(); - var startWidth = dojo.marginBox(id).w; - var endWidth = Math.round(startWidth / 2); - - var d = new doh.Deferred(); - var anim = dojo.anim( - id, - { - width: endWidth, - opacity: 0 - }, - duration, - null, - function(){ - var elapsed = (new Date().valueOf()) - anim._startTime; - doh.t(elapsed >= duration); - doh.t((new Date().valueOf()) >= (kickoff+duration+500)); - doh.is(dojo.marginBox(id).w, endWidth); - doh.is(dojo.style(id, "opacity"), 0); - d.callback(true); - }, - 500 - ); - return d; - } - }, - { - name: "anim_defaults", - timeout: 1000, - runTest: function(){ - var id = "thud"; - dojo.style("baz", "display", "none"); - dojo.style(id, "display", ""); - var startWidth = dojo.marginBox(id).w; - var endWidth = Math.round(startWidth / 2); - - var d = new doh.Deferred(); - var anim = dojo.anim(id, { width: endWidth }); - dojo.connect(anim, "onEnd", function(){ - var elapsed = (new Date().valueOf()) - anim._startTime; - doh.t(elapsed >= dojo._Animation.prototype.duration); // the default - doh.is(dojo.marginBox(id).w, endWidth); - d.callback(true); - }); - return d; - } - } - ] - ); - doh.run(); - }); - </script> - <style type="text/css"> - body { - margin: 1em; - background-color: #DEDEDE; - } - - .box { - color: #292929; - /* color: #424242; */ - /* text-align: left; */ - width: 300px; - border: 1px solid #BABABA; - background-color: white; - padding-left: 10px; - padding-right: 10px; - margin-left: 10px; - -o-border-radius: 10px; - -moz-border-radius: 12px; - -webkit-border-radius: 10px; - /* -opera-border-radius: 10px; */ - border-radius: 10px; - -moz-box-sizing: border-box; - -opera-sizing: border-box; - -webkit-box-sizing: border-box; - -khtml-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - /* position: absolute; */ - } - </style> - </head> - <body> - <h1>testing Core FX</h1> - <form name="testForm"> - <input type="button" onClick="dojo.fadeOut({ node: 'foo', duration: 1000 }).play()" value="fade out"></input> - <input type="button" onClick="dojo.fadeIn({ node: 'foo', duration: 1000 }).play()" value="fade in"></input> - </form> - <div id="foo" class="box" style="float: left;"> - <p> - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean - semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. - Proin porta rutrum lacus. Etiam consequat scelerisque quam. Nulla - facilisi. Maecenas luctus venenatis nulla. In sit amet dui non mi - semper iaculis. Sed molestie tortor at ipsum. Morbi dictum rutrum - magna. Sed vitae risus. - </p> - <p> - Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer - lorem nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean - id mi in massa bibendum suscipit. Integer eros. Nullam suscipit - mauris. In pellentesque. Mauris ipsum est, pharetra semper, - pharetra in, viverra quis, tellus. Etiam purus. Quisque egestas, - tortor ac cursus lacinia, felis leo adipiscing nisi, et rhoncus - elit dolor eget eros. Fusce ut quam. Suspendisse eleifend leo vitae - ligula. Nulla facilisi. Nulla rutrum, erat vitae lacinia dictum, - pede purus imperdiet lacus, ut semper velit ante id metus. Praesent - massa dolor, porttitor sed, pulvinar in, consequat ut, leo. Nullam - nec est. Aenean id risus blandit tortor pharetra congue. - Suspendisse pulvinar. - </p> - </div> - <p id="bar" style="display: none;"> - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean semper - sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin porta - rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi. - Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis. - Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae - risus. - </p> - <p id="baz" style="display: none;"> - Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem - nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in - massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In - pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra - quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia, - felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut - quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla - rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut - semper velit ante id metus. Praesent massa dolor, porttitor sed, - pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit - tortor pharetra congue. Suspendisse pulvinar. - </p> - <p id="thud" style="display: none;"> - Aliquam vitae enim. Duis scelerisque metus auctor est venenatis - imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem - nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in - massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In - pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra - quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia, - felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut - quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla - rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut - semper velit ante id metus. Praesent massa dolor, porttitor sed, - pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit - tortor pharetra congue. Suspendisse pulvinar. - </p> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/fx.js b/includes/js/dojo/tests/_base/fx.js deleted file mode 100644 index acb1ca3..0000000 --- a/includes/js/dojo/tests/_base/fx.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests._base.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.fx"] = true; -dojo.provide("tests._base.fx"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.fx", dojo.moduleUrl("tests", "_base/fx.html"), 15000); -} - -} diff --git a/includes/js/dojo/tests/_base/fx_delay.html b/includes/js/dojo/tests/_base/fx_delay.html deleted file mode 100644 index c2a1cd9..0000000 --- a/includes/js/dojo/tests/_base/fx_delay.html +++ /dev/null @@ -1,22 +0,0 @@ -<html> -<head> -<style type="text/css"> -#inner { width: 200px; height: 200px; background-color: #484} -</style> -<script type="text/javascript" src="../../dojo.js"></script> -<script type="text/javascript"> -dojo.require("dojo._base.fx"); -dojo.require("dojo._base.html"); -dojo.addOnLoad(function(){ - var box = dojo.byId("box"); - dojo.connect(box, "onclick", function(){ - dojo.style(box, "opacity", "0"); - dojo.fadeIn({node:box, delay:1}).play(); - }); -}); -</script> -</head> -<body> -<div id="box"><button id="inner">click me</button></div> -</body> -</html> diff --git a/includes/js/dojo/tests/_base/html.html b/includes/js/dojo/tests/_base/html.html deleted file mode 100644 index 912c8a6..0000000 --- a/includes/js/dojo/tests/_base/html.html +++ /dev/null @@ -1,556 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<!-- - we use a strict-mode DTD to ensure that the box model is the same for these - basic tests ---> -<html> - <head> - <title>testing Core HTML/DOM/CSS/Style utils</title> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" - src="../../dojo.js" - djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - - function getIframeDocument(/*DOMNode*/iframeNode){ - //summary: Returns the document object associated with the iframe DOM Node argument. - var doc = iframeNode.contentDocument || // W3 - ( - (iframeNode.contentWindow)&&(iframeNode.contentWindow.document) - ) || // IE - ( - (iframeNode.name)&&(documendoh.frames[iframeNode.name])&& - (documendoh.frames[iframeNode.name].document) - ) || null; - return doc; - } - - dojo.addOnLoad(function(){ - doh.register("t", - [ - "doh.is(100, dojo.marginBox('sq100').w);", - "doh.is(100, dojo.marginBox('sq100').h);", - - "doh.is(120, dojo.marginBox('sq100margin10').w);", - "doh.is(120, dojo.marginBox('sq100margin10').h);", - "doh.is(100, dojo.contentBox('sq100margin10').w);", - "doh.is(100, dojo.contentBox('sq100margin10').h);", - - "doh.is(140, dojo.marginBox('sq100margin10pad10').w);", - "doh.is(140, dojo.marginBox('sq100margin10pad10').h);", - - "doh.is(120, dojo.marginBox('sq100pad10').w);", - "doh.is(120, dojo.marginBox('sq100pad10').h);", - - "doh.is(110, dojo.marginBox('sq100ltpad10').w);", - "doh.is(110, dojo.marginBox('sq100ltpad10').h);", - "doh.is(100, dojo.contentBox('sq100ltpad10').w);", - "doh.is(100, dojo.contentBox('sq100ltpad10').h);", - - "doh.is(120, dojo.marginBox('sq100ltpad10rbmargin10').w);", - "doh.is(120, dojo.marginBox('sq100ltpad10rbmargin10').h);", - - "doh.is(120, dojo.marginBox('sq100border10').w);", - "doh.is(120, dojo.marginBox('sq100border10').h);", - "doh.is(100, dojo.contentBox('sq100border10').w);", - "doh.is(100, dojo.contentBox('sq100border10').h);", - - "doh.is(140, dojo.marginBox('sq100border10margin10').w);", - "doh.is(140, dojo.marginBox('sq100border10margin10').h);", - "doh.is(100, dojo.contentBox('sq100border10margin10').w);", - "doh.is(100, dojo.contentBox('sq100border10margin10').h);", - - "doh.is(160, dojo.marginBox('sq100border10margin10pad10').w);", - "doh.is(160, dojo.marginBox('sq100border10margin10pad10').h);", - "doh.is(100, dojo.contentBox('sq100border10margin10pad10').w);", - "doh.is(100, dojo.contentBox('sq100border10margin10pad10').h);", - - // FIXME: the 'correct' w is not 100 on Safari WebKit (2.0.4 [419.3]), the right-margin extends to the document edge - // "doh.is(100, dojo.marginBox('sq100nopos').w);", - "doh.is(100, dojo.marginBox('sq100nopos').h);", - - "doh.is(10, dojo._getPadExtents(dojo.byId('sq100ltpad10rbmargin10')).l);", - "doh.is(10, dojo._getPadExtents(dojo.byId('sq100ltpad10rbmargin10')).t);", - "doh.is(10, dojo._getPadExtents(dojo.byId('sq100ltpad10rbmargin10')).w);", - "doh.is(10, dojo._getPadExtents(dojo.byId('sq100ltpad10rbmargin10')).h);", - - "doh.is(0, dojo._getMarginExtents(dojo.byId('sq100ltpad10rbmargin10')).l);", - "doh.is(0, dojo._getMarginExtents(dojo.byId('sq100ltpad10rbmargin10')).t);", - "doh.is(10, dojo._getMarginExtents(dojo.byId('sq100ltpad10rbmargin10')).w);", - "doh.is(10, dojo._getMarginExtents(dojo.byId('sq100ltpad10rbmargin10')).h);", - - "doh.is(10, dojo._getBorderExtents(dojo.byId('sq100border10margin10pad10')).l);", - "doh.is(10, dojo._getBorderExtents(dojo.byId('sq100border10margin10pad10')).t);", - "doh.is(20, dojo._getBorderExtents(dojo.byId('sq100border10margin10pad10')).w);", - "doh.is(20, dojo._getBorderExtents(dojo.byId('sq100border10margin10pad10')).h);", - - "doh.is(20, dojo._getPadBorderExtents(dojo.byId('sq100border10margin10pad10')).l);", - "doh.is(20, dojo._getPadBorderExtents(dojo.byId('sq100border10margin10pad10')).t);", - "doh.is(40, dojo._getPadBorderExtents(dojo.byId('sq100border10margin10pad10')).w);", - "doh.is(40, dojo._getPadBorderExtents(dojo.byId('sq100border10margin10pad10')).h);", - - function coordsBasic(t){ - var pos = dojo.coords("sq100", false); - // console.debug(pos); - doh.is(100, pos.x); - doh.is(100, pos.y); - doh.is(100, pos.w); - doh.is(100, pos.h); - }, - function coordsMargin(t){ - // coords is getting us the margin-box location, is - // this right? - var pos = dojo.coords("sq100margin10", false); - doh.is(260, pos.x); - doh.is(110, pos.y); - doh.is(120, pos.w); - doh.is(120, pos.h); - }, - function coordsBorder(t){ - var pos = dojo.coords("sq100border10", false); - doh.is(100, pos.x); - doh.is(400, pos.y); - }, - function sq100nopos(t){ - var pos = dojo.coords("sq100nopos", false); - // console.debug(pos); - doh.is(0, pos.x); - doh.t(pos.y > 0); - // FIXME: the 'correct' w is not 100 on Safari WebKit (2.0.4 [419.3]), the right-margin extends to the document edge - // doh.is(100, pos.w); - doh.is(100, pos.h); - }, - function coordsScrolled(t) { - var s = document.createElement('div'); - var c = document.createElement('div'); - document.body.appendChild(s); - s.appendChild(c); - var x=257, y= 285; - with (s.style) { - position = 'absolute'; - overflow = 'scroll'; - border = "10px solid black"; - } - dojo._setMarginBox(s, x, y, 100, 100); - dojo._setMarginBox(c, 0, 0, 500, 500); - s.scrollTop = 200; - var pos = dojo.coords(s, true); - doh.is(x, pos.x); - doh.is(y, pos.y); - }, - "doh.is(1, dojo.style('sq100nopos', 'opacity'));", - "doh.is(0.1, dojo.style('sq100nopos', 'opacity', 0.1));", - "doh.is(0.8, dojo.style('sq100nopos', 'opacity', 0.8));", - function styleObject(){ - dojo.style('sq100nopos', { 'opacity': 0.1 }); - doh.is(0.1, dojo.style('sq100nopos', 'opacity')); - dojo.style('sq100nopos', { 'opacity': 0.8 }); - doh.is(0.8, dojo.style('sq100nopos', 'opacity')); - }, - "doh.is('static', dojo.style('sq100nopos', 'position'));", - function getBgcolor(t){ - var bgc = dojo.style('sq100nopos', 'backgroundColor'); - doh.t((bgc == "rgb(0, 0, 0)")||(bgc == "black")||(bgc == "#000000")); - }, - function isDescendant(t){ - doh.t(dojo.isDescendant("sq100", dojo.body())); - doh.t(dojo.isDescendant("sq100", dojo.doc)); - doh.t(dojo.isDescendant("sq100", "sq100")); - doh.t(dojo.isDescendant(dojo.byId("sq100"), "sq100")); - doh.f(dojo.isDescendant("sq100", dojo.byId("sq100").firstChild)); - doh.t(dojo.isDescendant(dojo.byId("sq100").firstChild, "sq100")); - }, - function isDescendantIframe(t){ - var bif = dojo.byId("blah"); - getIframeDocument(bif).write("<html><body><div id='subDiv'></div></body></html>"); - getIframeDocument(bif).close(); - // this test barely makes sense. disabling it for now. - // doh.t(dojo.isDescendant(bif.contentDocument.getElementById("subDiv"), bif.parentNode)); - var subDiv = getIframeDocument(bif).getElementById("subDiv"); - doh.t(dojo.isDescendant(subDiv, subDiv)); - doh.t(dojo.isDescendant(subDiv, subDiv.parentNode)); - doh.f(dojo.isDescendant(subDiv.parentNode, subDiv)); - - }, - function testClassFunctions(t){ - var node = dojo.byId("sq100"); - dojo.addClass(node, "a"); - doh.is("a", node.className); - dojo.removeClass(node, "c"); - doh.is("a", node.className); - t.assertTrue(dojo.hasClass(node, "a")); - t.assertFalse(dojo.hasClass(node, "b")); - dojo.addClass(node, "b"); - doh.is("a b", node.className); - t.assertTrue(dojo.hasClass(node, "a")); - t.assertTrue(dojo.hasClass(node, "b")); - dojo.removeClass(node, "a"); - doh.is("b", node.className); - t.assertFalse(dojo.hasClass(node, "a")); - t.assertTrue(dojo.hasClass(node, "b")); - dojo.toggleClass(node, "a"); - doh.is("b a", node.className); - t.assertTrue(dojo.hasClass(node, "a")); - t.assertTrue(dojo.hasClass(node, "b")); - dojo.toggleClass(node, "a"); - doh.is("b", node.className); - t.assertFalse(dojo.hasClass(node, "a")); - t.assertTrue(dojo.hasClass(node, "b")); - dojo.toggleClass(node, "b"); - doh.is("", node.className); - t.assertFalse(dojo.hasClass(node, "a")); - t.assertFalse(dojo.hasClass(node, "b")); - dojo.removeClass(node, "c"); - t.assertTrue(!node.className); - }, - function getTypeInput(t){ - doh.f(dojo.hasAttr(dojo.byId("input-no-type"), "type")); - doh.is("text", dojo.attr(dojo.byId("input-no-type"), "type")); - doh.t(dojo.hasAttr(dojo.byId("input-with-type"), "type")); - doh.is("checkbox", dojo.attr(dojo.byId("input-with-type"), "type")); - }, - function getWithString(t){ - doh.f(dojo.hasAttr("input-no-type", "type")); - doh.is("text", dojo.attr("input-no-type", "type")); - doh.t(dojo.hasAttr("input-with-type", "type")); - doh.is("checkbox", dojo.attr("input-with-type", "type")); - }, - function attrId(t){ - doh.t(dojo.hasAttr("div-no-tabindex", "id")); - doh.is("div-no-tabindex", dojo.attr("div-no-tabindex", "id")); - var div = document.createElement("div"); - doh.f(dojo.hasAttr(div, "id")); - doh.is(null, dojo.attr(div, "id")); - dojo.attr(div, "id", "attrId1"); - doh.t(dojo.hasAttr(div, "id")); - doh.is("attrId1", dojo.attr(div, "id")); - dojo.removeAttr(div, "id"); - doh.f(dojo.hasAttr(div, "id")); - doh.is(null, dojo.attr(div, "id")); - }, - function getTabindexDiv(t){ - doh.f(dojo.hasAttr("div-no-tabindex", "tabindex")); - doh.is(null, dojo.attr("div-no-tabindex", "tabindex")); - doh.t(dojo.hasAttr("div-tabindex-minus-1", "tabindex")); - if(!dojo.isOpera){ - // Opera (at least <= 9) does not support tabindex="-1" - doh.is(-1, dojo.attr("div-tabindex-minus-1", "tabindex")); - } - doh.t(dojo.hasAttr("div-tabindex-0", "tabindex")); - doh.is(0, dojo.attr("div-tabindex-0", "tabindex")); - doh.is(1, dojo.attr("div-tabindex-1", "tabindex")); - }, - function getTabindexInput(t){ - doh.f(dojo.hasAttr("input-no-tabindex", "tabindex")); - doh.is(null, dojo.attr("input-no-tabindex", "tabindex")); - doh.t(dojo.hasAttr("input-tabindex-minus-1", "tabindex")); - if(!dojo.isOpera){ - // Opera (at least <= 9) does not support tabindex="-1" - doh.is(-1, dojo.attr("input-tabindex-minus-1", "tabindex")); - } - doh.t(dojo.hasAttr("input-tabindex-0", "tabindex")); - doh.is(0, dojo.attr("input-tabindex-0", "tabindex")); - doh.is(1, dojo.attr("input-tabindex-1", "tabindex")); - }, - function setTabindexDiv(t){ - var div = document.createElement("div"); - doh.is(null, dojo.attr(div, "tabindex")); - dojo.attr(div, "tabindex", -1); - if(!dojo.isOpera){ - // Opera (at least <= 9) does not support tabindex="-1" - doh.is(-1, dojo.attr(div, "tabindex")); - } - dojo.attr(div, "tabindex", 0); - doh.is(0, dojo.attr(div, "tabindex")); - dojo.attr(div, "tabindex", 1); - doh.is(1, dojo.attr(div, "tabindex")); - }, - function setTabindexInput(t){ - var input = document.createElement("input"); - doh.is(null, dojo.attr(input, "tabindex")); - dojo.attr(input, "tabindex", -1); - if(!dojo.isOpera){ - // Opera (at least <= 9) does not support tabindex="-1" - doh.is(-1, dojo.attr(input, "tabindex")); - } - dojo.attr(input, "tabindex", 0); - doh.is(0, dojo.attr(input, "tabindex")); - dojo.attr(input, "tabindex", 1); - doh.is(1, dojo.attr(input, "tabindex")); - }, - function removeTabindexFromDiv(t){ - var div = document.createElement("div"); - dojo.attr(div, "tabindex", 1); - doh.is(1, dojo.attr(div, "tabindex")); - dojo.removeAttr(div, "tabindex"); - doh.is(null, dojo.attr(div, "tabindex")); - }, - function removeTabindexFromInput(t){ - var input = document.createElement("input"); - dojo.attr(input, "tabindex", 1); - doh.is(1, dojo.attr(input, "tabindex")); - dojo.removeAttr(input, "tabindex"); - doh.is(null, dojo.attr(input, "tabindex")); - }, - function attr_map(t){ - var input = document.createElement("input"); - var ctr= 0; - dojo.attr(input, { - "tabindex": 1, - "type": "text", - "onfocus": function(e){ - ctr++; - } - }); - dojo.body().appendChild(input); - doh.is(1, dojo.attr(input, "tabindex")); - doh.is("text", dojo.attr(input, "type")); - doh.is(0, ctr); - var def = new doh.Deferred(); - input.focus(); - setTimeout(function(){ - doh.is(1, ctr); - input.blur(); - input.focus(); - setTimeout(function(){ - doh.is(2, ctr); - def.callback(true); - }, 10); - }, 10); - return def; - }, - function attr_reconnect(t){ - var input = document.createElement("input"); - var ctr = 0; - dojo.attr(input, "type", "text"); - dojo.attr(input, "onfocus", function(e){ ctr++; }); - dojo.attr(input, "onfocus", function(e){ ctr++; }); - dojo.attr(input, "onfocus", function(e){ ctr++; }); - dojo.body().appendChild(input); - doh.is("text", dojo.attr(input, "type")); - doh.is(0, ctr); - var def = new doh.Deferred(); - input.focus(); - setTimeout(function(){ - doh.is(1, ctr); - input.blur(); - input.focus(); - setTimeout(function(){ - doh.is(2, ctr); - def.callback(true); - }, 10); - }, 10); - return def; - } - ] - ); - doh.run(); - }); - </script> - <style type="text/css"> - html, body { - padding: 0px; - margin: 0px; - border: 0px; - } - - #sq100 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100margin10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 10px; - overflow: hidden; - } - - #sq100margin10pad10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 10px; - margin: 10px; - overflow: hidden; - } - - #sq100pad10 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding: 10px; - margin: 0px; - overflow: hidden; - } - - #sq100ltpad10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding-left: 10px; - padding-top: 10px; - padding-right: 0px; - padding-bottom: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100ltpad10rbmargin10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding-left: 10px; - padding-top: 10px; - padding-right: 0px; - padding-bottom: 0px; - margin-left: 0px; - margin-top: 0px; - margin-right: 10px; - margin-bottom: 10px; - overflow: hidden; - } - - #sq100border10 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100border10margin10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 0px; - margin: 10px; - overflow: hidden; - } - - #sq100border10margin10pad10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 10px; - margin: 10px; - overflow: hidden; - } - - #sq100nopos { - background-color: black; - color: white; - width: 100px; - height: 100px; - padding: 0px; - margin: 0px; - } - - </style> - </head> - <body> - <h1>testing Core HTML/DOM/CSS/Style utils</h1> - <div id="sq100"> - 100px square, abs - </div> - <div id="sq100margin10"> - 100px square, abs, 10px margin - </div> - <div id="sq100margin10pad10"> - 100px square, abs, 10px margin, 10px padding - </div> - <div id="sq100pad10"> - 100px square, abs, 10px padding - </div> - <div id="sq100ltpad10"> - 100px square, abs, 10px left and top padding - </div> - <div id="sq100ltpad10rbmargin10"> - 100px square, abs, 10px left and top padding, 10px bottom and right margin - </div> - <div id="sq100border10"> - 100px square, abs, 10px yellow border - </div> - <div id="sq100border10margin10"> - 100px square, abs, 10px yellow border, 10px margin - </div> - <div id="sq100border10margin10pad10"> - 100px square, abs, 10px yellow border, 10px margin, 10px padding - </div> - <div id="sq100nopos"> - 100px square, no positioning - </div> - <iframe id="blah"></iframe> - - <div id="div-no-tabindex"></div> - <div id="div-tabindex-minus-1" tabindex="-1"></div> - <div id="div-tabindex-0" tabindex="0"></div> - <div id="div-tabindex-1" tabindex="1"></div> - - <div> - <input id="input-no-type"> - <input id="input-with-type" type="checkbox"> - <input id="input-no-tabindex"> - <input id="input-tabindex-minus-1" tabindex="-1"> - <input id="input-tabindex-0" tabindex="0"> - <input id="input-tabindex-1" tabindex="1"> - </div> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/html.js b/includes/js/dojo/tests/_base/html.js deleted file mode 100644 index 99fe80b..0000000 --- a/includes/js/dojo/tests/_base/html.js +++ /dev/null @@ -1,12 +0,0 @@ -if(!dojo._hasResource["tests._base.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.html"] = true; -dojo.provide("tests._base.html"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.html", dojo.moduleUrl("tests", "_base/html.html"), 15000); - doh.registerUrl("tests._base.html_rtl", dojo.moduleUrl("tests", "_base/html_rtl.html"), 15000); - doh.registerUrl("tests._base.html_quirks", dojo.moduleUrl("tests", "_base/html_quirks.html"), 15000); - doh.registerUrl("tests._base.html_box", dojo.moduleUrl("tests", "_base/html_box.html"), 35000); - doh.registerUrl("tests._base.html_box_quirks", dojo.moduleUrl("tests", "_base/html_box_quirks.html"), 35000); -} - -} diff --git a/includes/js/dojo/tests/_base/html_box.html b/includes/js/dojo/tests/_base/html_box.html deleted file mode 100644 index fd7ec53..0000000 --- a/includes/js/dojo/tests/_base/html_box.html +++ /dev/null @@ -1,207 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<!--
- we use a strict-mode DTD to ensure that the box model is the same for these
- basic tests
--->
-<html>
- <head>
- <title> test html.js Box utils</title>
- <style type="text/css">
- /*@import "../../resources/dojo.css";*/
- </style>
- <script type="text/javascript"
- src="../../dojo.js"
- djConfig="isDebug: true"></script>
- <script type="text/javascript">
- dojo.require("doh.runner");
-
- var margin = '1px';
- var border = '3px solid black';
- var padding = '5px';
- var defaultStyles = {
- height: '100px',
- width: '100px',
- position: 'absolute',
- backgroundColor: 'red'
- };
-
- var defaultChildStyles = {
- height: '20px',
- width: '20px',
- backgroundColor: 'blue'
- }
-
- var testStyles = [
- {},
- {margin: margin},
- {border: border},
- {padding: padding},
- {margin: margin, border: border},
- {margin: margin, padding: padding},
- {border: border, padding: padding},
- {margin: margin, border: border, padding: padding}
- ]
-
-
- function sameBox(inBox1, inBox2) {
- for (var i in inBox1)
- if (inBox1[i] != inBox2[i]) {
- console.log((arguments[2]||'box1') + '.' + i + ': ', inBox1[i], ' != ', (arguments[3]||'box2') + '.' + i + ': ', inBox2[i]);
- return false;
- }
- return true;
- }
-
- function reciprocalMarginBoxTest(inNode, inBox) {
- var s = inBox || dojo.marginBox(inNode);
- dojo.marginBox(inNode, s);
- var e = dojo.marginBox(inNode);
- return sameBox(s, e);
- }
-
- function fitTest(inParent, inChild) {
- var pcb = dojo.contentBox(inParent);
- return reciprocalMarginBoxTest(inChild, pcb);
- }
-
- function createStyledElement(inStyle, inParent, inElement, inNoDefault) {
- inStyle = inStyle||{};
- if (!inNoDefault) {
- for (var i in defaultStyles)
- if (!inStyle[i])
- inStyle[i] = defaultStyles[i];
- }
- var n = document.createElement(inElement || 'div');
- (inParent||document.body).appendChild(n);
- dojo.mixin(n.style, inStyle);
- return n;
- }
-
- var _testTopInc = 0;
- var _testTop = 150;
- var _testInitTop = 250;
- function styleIncTop(inStyle) {
- inStyle = dojo.mixin({}, inStyle||{});
- inStyle.top = (_testInitTop + _testTop*_testTopInc) + 'px';
- _testTopInc++;
- return inStyle;
- }
-
- function removeTestNode(inNode) {
- // leave nodes for inspection or don't return to delete them
- return;
- inNode = dojo.byId(inNode);
- inNode.parentNode.removeChild(inNode);
- _testTopInc--;
- }
-
- function testAndCallback(inTest, inAssert, inComment, inOk, inErr) {
- inTest.assertTrue('/* ' + inComment + '*/' + inAssert);
- if (inAssert)
- inOk&&inOk();
- else
- inErr&&inErr();
- }
-
- // args are (styles, parent, element name, no default)
- function mixCreateElementArgs(inMix, inArgs) {
- args = [{}];
- if (inArgs&&inArgs[0])
- dojo.mixin(args[0], inArgs[0]);
- if (inMix.length)
- dojo.mixin(args[0], inMix[0]||{});
- // parent comes from source
- if (inMix.length > 1)
- args[1] = inMix[1];
- args[2] = inArgs[2];
- args[3] = inArgs[3]
- return args;
- };
-
- function createStyledNodes(inArgs, inFunc) {
- for (var i=0, n; (s=testStyles[i]); i++) {
- n = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inArgs));
- inFunc&&inFunc(n);
- }
- }
-
- function createStyledParentChild(inParentArgs, inChildArgs, inFunc) {
- for (var i=0, s, p, c; (s=testStyles[i]); i++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([{}, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
- }
-
- function createStyledParentChildren(inParentArgs, inChildArgs, inFunc) {
- for (var i=0, s, p; (s=testStyles[i]); i++)
- for (var j=0, sc, c, props; (sc=testStyles[j]); j++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([sc, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
-
- for (var i=0, s, p, c; (s=testStyles[i]); i++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([{}, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
- }
-
-
- function runFitTest(inTest, inParentStyles, inChildStyles) {
- createStyledParentChildren([inParentStyles], [inChildStyles], function(p, c) {
- testAndCallback(inTest, fitTest(p, c), '', function() {removeTestNode(p); });
- });
- }
-
- dojo.addOnLoad(function(){
- doh.register("t",
- [
- function reciprocalTests(t) {
- createStyledNodes([], function(n) {
- testAndCallback(t, reciprocalMarginBoxTest(n), '', function() {removeTestNode(n); });
- });
- },
- function fitTests(t) {
- runFitTest(t, null, dojo.mixin({}, defaultChildStyles));
- },
- function fitTestsOverflow(t) {
- runFitTest(t, null, dojo.mixin({overflow:'hidden'}, defaultChildStyles));
- runFitTest(t, {overflow: 'hidden'}, dojo.mixin({}, defaultChildStyles));
- runFitTest(t, {overflow: 'hidden'}, dojo.mixin({overflow:'hidden'}, defaultChildStyles));
- },
- function fitTestsFloat(t) {
- runFitTest(t, null, dojo.mixin({float: 'left'}, defaultChildStyles));
- runFitTest(t, {float: 'left'}, dojo.mixin({}, defaultChildStyles));
- runFitTest(t, {float: 'left'}, dojo.mixin({float: 'left'}, defaultChildStyles));
- },
- function reciprocalTestsInline(t) {
- createStyledParentChild([], [{}, null, 'span'], function(p, c) {
- c.innerHTML = 'Hello World';
- testAndCallback(t, reciprocalMarginBoxTest(c), '', function() {removeTestNode(c); });
- });
- },
- function reciprocalTestsButtonChild(t) {
- createStyledParentChild([], [{}, null, 'button'], function(p, c) {
- c.innerHTML = 'Hello World';
- testAndCallback(t, reciprocalMarginBoxTest(c), '', function() {removeTestNode(c); });
- });
- }
- ]
- );
- doh.run();
- });
- </script>
- <style type="text/css">
- html, body {
- padding: 0px;
- margin: 0px;
- border: 0px;
- }
- </style>
- </head>
- <body>
- </body>
-</html>
-
diff --git a/includes/js/dojo/tests/_base/html_box_quirks.html b/includes/js/dojo/tests/_base/html_box_quirks.html deleted file mode 100644 index f87ca44..0000000 --- a/includes/js/dojo/tests/_base/html_box_quirks.html +++ /dev/null @@ -1,205 +0,0 @@ -<!--
- we use a quirks-mode DTD to check for quirks!
--->
-<html>
- <head>
- <title> test html.js Box utils</title>
- <style type="text/css">
- /*@import "../../resources/dojo.css";*/
- </style>
- <script type="text/javascript"
- src="../../dojo.js"
- djConfig="isDebug: true"></script>
- <script type="text/javascript">
- dojo.require("doh.runner");
-
- var margin = '1px';
- var border = '3px solid black';
- var padding = '5px';
- var defaultStyles = {
- height: '100px',
- width: '100px',
- position: 'absolute',
- backgroundColor: 'red'
- };
-
- var defaultChildStyles = {
- height: '20px',
- width: '20px',
- backgroundColor: 'blue'
- }
-
- var testStyles = [
- {},
- {margin: margin},
- {border: border},
- {padding: padding},
- {margin: margin, border: border},
- {margin: margin, padding: padding},
- {border: border, padding: padding},
- {margin: margin, border: border, padding: padding}
- ]
-
-
- function sameBox(inBox1, inBox2) {
- for (var i in inBox1)
- if (inBox1[i] != inBox2[i]) {
- console.log((arguments[2]||'box1') + '.' + i + ': ', inBox1[i], ' != ', (arguments[3]||'box2') + '.' + i + ': ', inBox2[i]);
- return false;
- }
- return true;
- }
-
- function reciprocalMarginBoxTest(inNode, inBox) {
- var s = inBox || dojo.marginBox(inNode);
- dojo.marginBox(inNode, s);
- var e = dojo.marginBox(inNode);
- return sameBox(s, e);
- }
-
- function fitTest(inParent, inChild) {
- var pcb = dojo.contentBox(inParent);
- return reciprocalMarginBoxTest(inChild, pcb);
- }
-
- function createStyledElement(inStyle, inParent, inElement, inNoDefault) {
- inStyle = inStyle||{};
- if (!inNoDefault) {
- for (var i in defaultStyles)
- if (!inStyle[i])
- inStyle[i] = defaultStyles[i];
- }
- var n = document.createElement(inElement || 'div');
- (inParent||document.body).appendChild(n);
- dojo.mixin(n.style, inStyle);
- return n;
- }
-
- var _testTopInc = 0;
- var _testTop = 150;
- var _testInitTop = 250;
- function styleIncTop(inStyle) {
- inStyle = dojo.mixin({}, inStyle||{});
- inStyle.top = (_testInitTop + _testTop*_testTopInc) + 'px';
- _testTopInc++;
- return inStyle;
- }
-
- function removeTestNode(inNode) {
- // leave nodes for inspection or don't return to delete them
- return;
- inNode = dojo.byId(inNode);
- inNode.parentNode.removeChild(inNode);
- _testTopInc--;
- }
-
- function testAndCallback(inTest, inAssert, inComment, inOk, inErr) {
- inTest.assertTrue('/* ' + inComment + '*/' + inAssert);
- if (inAssert)
- inOk&&inOk();
- else
- inErr&&inErr();
- }
-
- // args are (styles, parent, element name, no default)
- function mixCreateElementArgs(inMix, inArgs) {
- args = [{}];
- if (inArgs&&inArgs[0])
- dojo.mixin(args[0], inArgs[0]);
- if (inMix.length)
- dojo.mixin(args[0], inMix[0]||{});
- // parent comes from source
- if (inMix.length > 1)
- args[1] = inMix[1];
- args[2] = inArgs[2];
- args[3] = inArgs[3]
- return args;
- };
-
- function createStyledNodes(inArgs, inFunc) {
- for (var i=0, n; (s=testStyles[i]); i++) {
- n = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inArgs));
- inFunc&&inFunc(n);
- }
- }
-
- function createStyledParentChild(inParentArgs, inChildArgs, inFunc) {
- for (var i=0, s, p, c; (s=testStyles[i]); i++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([{}, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
- }
-
- function createStyledParentChildren(inParentArgs, inChildArgs, inFunc) {
- for (var i=0, s, p; (s=testStyles[i]); i++)
- for (var j=0, sc, c, props; (sc=testStyles[j]); j++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([sc, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
-
- for (var i=0, s, p, c; (s=testStyles[i]); i++) {
- p = createStyledElement.apply(this, mixCreateElementArgs([styleIncTop(s)], inParentArgs));
- c = createStyledElement.apply(this, mixCreateElementArgs([{}, p], inChildArgs));
- inFunc&&inFunc(p, c);
- }
- }
-
-
- function runFitTest(inTest, inParentStyles, inChildStyles) {
- createStyledParentChildren([inParentStyles], [inChildStyles], function(p, c) {
- testAndCallback(inTest, fitTest(p, c), '', function() {removeTestNode(p); });
- });
- }
-
- dojo.addOnLoad(function(){
- doh.register("t",
- [
- function reciprocalTests(t) {
- createStyledNodes([], function(n) {
- testAndCallback(t, reciprocalMarginBoxTest(n), '', function() {removeTestNode(n); });
- });
- },
- function fitTests(t) {
- runFitTest(t, null, dojo.mixin({}, defaultChildStyles));
- },
- function fitTestsOverflow(t) {
- runFitTest(t, null, dojo.mixin({overflow:'hidden'}, defaultChildStyles));
- runFitTest(t, {overflow: 'hidden'}, dojo.mixin({}, defaultChildStyles));
- runFitTest(t, {overflow: 'hidden'}, dojo.mixin({overflow:'hidden'}, defaultChildStyles));
- },
- function fitTestsFloat(t) {
- runFitTest(t, null, dojo.mixin({float: 'left'}, defaultChildStyles));
- runFitTest(t, {float: 'left'}, dojo.mixin({}, defaultChildStyles));
- runFitTest(t, {float: 'left'}, dojo.mixin({float: 'left'}, defaultChildStyles));
- },
- function reciprocalTestsInline(t) {
- createStyledParentChild([], [{}, null, 'span'], function(p, c) {
- c.innerHTML = 'Hello World';
- testAndCallback(t, reciprocalMarginBoxTest(c), '', function() {removeTestNode(c); });
- });
- },
- function reciprocalTestsButtonChild(t) {
- createStyledParentChild([], [{}, null, 'button'], function(p, c) {
- c.innerHTML = 'Hello World';
- testAndCallback(t, reciprocalMarginBoxTest(c), '', function() {removeTestNode(c); });
- });
- }
- ]
- );
- doh.run();
- });
- </script>
- <style type="text/css">
- html, body {
- padding: 0px;
- margin: 0px;
- border: 0px;
- }
- </style>
- </head>
- <body>
- </body>
-</html>
-
diff --git a/includes/js/dojo/tests/_base/html_quirks.html b/includes/js/dojo/tests/_base/html_quirks.html deleted file mode 100644 index ddc7825..0000000 --- a/includes/js/dojo/tests/_base/html_quirks.html +++ /dev/null @@ -1,322 +0,0 @@ -<html> - <!-- - we use a quirks-mode DTD on purpose to ensure that things go tilt. Wheee!! - --> - <head> - <title>testing Core HTML/DOM/CSS/Style utils in quirks mode</title> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" - src="../../dojo.js" - djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - dojo.addOnLoad(function(){ - doh.register("t", - [ - "t.is(100, dojo.marginBox('sq100').w);", - "t.is(100, dojo.marginBox('sq100').h);", - - "t.is(120, dojo.marginBox('sq100margin10').w);", - "t.is(120, dojo.marginBox('sq100margin10').h);", - "t.is(100, dojo.contentBox('sq100margin10').w);", - "t.is(100, dojo.contentBox('sq100margin10').h);", - - // FIXME: the 'correct' w is not 100 on Safari WebKit (2.0.4 [419.3]), the right-margin extends to the document edge - //"t.is(100, dojo.marginBox('sq100nopos').w);", - "t.is(100, dojo.marginBox('sq100nopos').h);", - - function coordsBasic(t){ - var pos = dojo.coords("sq100", false); - // console.debug(pos); - t.is(100, pos.x); - t.is(100, pos.y); - t.is(100, pos.w); - t.is(100, pos.h); - }, - function coordsMargin(t){ - // coords is getting us the margin-box location, is - // this right? - var pos = dojo.coords("sq100margin10", false); - t.is(260, pos.x); - t.is(110, pos.y); - t.is(120, pos.w); - t.is(120, pos.h); - }, - function coordsBorder(t){ - var pos = dojo.coords("sq100border10", false); - t.is(100, pos.x); - t.is(400, pos.y); - }, - function sq100nopos(t){ - var pos = dojo.coords("sq100nopos", false); - // console.debug(pos); - t.is(0, pos.x); - t.t(pos.y > 0); - // FIXME: the 'correct' w is not 100 on Safari WebKit (2.0.4 [419.3]), the right-margin extends to the document edge - //t.is(100, pos.w); - t.is(100, pos.h); - } - ] - ); - if(dojo.isIE){ - // IE collapses padding in quirks mode. We just report on it. - doh.register("t", - [ - "t.is(120, dojo.marginBox('sq100margin10pad10').w);", - "t.is(120, dojo.marginBox('sq100margin10pad10').h);", - - "t.is(100, dojo.marginBox('sq100pad10').w);", - "t.is(100, dojo.marginBox('sq100pad10').h);", - - "t.is(100, dojo.marginBox('sq100ltpad10').w);", - "t.is(100, dojo.marginBox('sq100ltpad10').h);", - "t.is(90, dojo.contentBox('sq100ltpad10').w);", - "t.is(90, dojo.contentBox('sq100ltpad10').h);", - - "t.is(110, dojo.marginBox('sq100ltpad10rbmargin10').w);", - "t.is(110, dojo.marginBox('sq100ltpad10rbmargin10').h);", - - "t.is(100, dojo.marginBox('sq100border10').w);", - "t.is(100, dojo.marginBox('sq100border10').h);", - "t.is(80, dojo.contentBox('sq100border10').w);", - "t.is(80, dojo.contentBox('sq100border10').h);", - - "t.is(120, dojo.marginBox('sq100border10margin10').w);", - "t.is(120, dojo.marginBox('sq100border10margin10').h);", - "t.is(80, dojo.contentBox('sq100border10margin10').w);", - "t.is(80, dojo.contentBox('sq100border10margin10').h);", - - "t.is(120, dojo.marginBox('sq100border10margin10pad10').w);", - "t.is(120, dojo.marginBox('sq100border10margin10pad10').h);", - "t.is(60, dojo.contentBox('sq100border10margin10pad10').w);", - "t.is(60, dojo.contentBox('sq100border10margin10pad10').h);" - ] - ); - }else{ - doh.register("t", - [ - "t.is(140, dojo.marginBox('sq100margin10pad10').w);", - "t.is(140, dojo.marginBox('sq100margin10pad10').h);", - - "t.is(120, dojo.marginBox('sq100pad10').w);", - "t.is(120, dojo.marginBox('sq100pad10').h);", - - "t.is(110, dojo.marginBox('sq100ltpad10').w);", - "t.is(110, dojo.marginBox('sq100ltpad10').h);", - "t.is(100, dojo.contentBox('sq100ltpad10').w);", - "t.is(100, dojo.contentBox('sq100ltpad10').h);", - - "t.is(120, dojo.marginBox('sq100ltpad10rbmargin10').w);", - "t.is(120, dojo.marginBox('sq100ltpad10rbmargin10').h);", - - "t.is(120, dojo.marginBox('sq100border10').w);", - "t.is(120, dojo.marginBox('sq100border10').h);", - "t.is(100, dojo.contentBox('sq100border10').w);", - "t.is(100, dojo.contentBox('sq100border10').h);", - - "t.is(140, dojo.marginBox('sq100border10margin10').w);", - "t.is(140, dojo.marginBox('sq100border10margin10').h);", - "t.is(100, dojo.contentBox('sq100border10margin10').w);", - "t.is(100, dojo.contentBox('sq100border10margin10').h);", - - "t.is(160, dojo.marginBox('sq100border10margin10pad10').w);", - "t.is(160, dojo.marginBox('sq100border10margin10pad10').h);", - "t.is(100, dojo.contentBox('sq100border10margin10pad10').w);", - "t.is(100, dojo.contentBox('sq100border10margin10pad10').h);" - ] - ); - } - - doh.run(); - }); - </script> - <style type="text/css"> - html, body { - padding: 0px; - margin: 0px; - border: 0px; - } - - #sq100 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100margin10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 10px; - overflow: hidden; - } - - #sq100margin10pad10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 10px; - margin: 10px; - overflow: hidden; - } - - #sq100pad10 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding: 10px; - margin: 0px; - overflow: hidden; - } - - #sq100ltpad10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding-left: 10px; - padding-top: 10px; - padding-right: 0px; - padding-bottom: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100ltpad10rbmargin10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 250px; - width: 100px; - height: 100px; - border: 0px; - padding-left: 10px; - padding-top: 10px; - padding-right: 0px; - padding-bottom: 0px; - margin-left: 0px; - margin-top: 0px; - margin-right: 10px; - margin-bottom: 10px; - overflow: hidden; - } - - #sq100border10 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - #sq100border10margin10 { - background-color: black; - color: white; - position: absolute; - left: 250px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 0px; - margin: 10px; - overflow: hidden; - } - - #sq100border10margin10pad10 { - background-color: black; - color: white; - position: absolute; - left: 400px; - top: 400px; - width: 100px; - height: 100px; - border: 10px solid yellow; - padding: 10px; - margin: 10px; - overflow: hidden; - } - - #sq100nopos { - background-color: black; - color: white; - width: 100px; - height: 100px; - padding: 0px; - margin: 0px; - } - - </style> - </head> - <body> - <h1>testing Core HTML/DOM/CSS/Style utils</h1> - <div id="sq100"> - 100px square, abs - </div> - <div id="sq100margin10"> - 100px square, abs, 10px margin - </div> - <div id="sq100margin10pad10"> - 100px square, abs, 10px margin, 10px padding - </div> - <div id="sq100pad10"> - 100px square, abs, 10px padding - </div> - <div id="sq100ltpad10"> - 100px square, abs, 10px left and top padding - </div> - <div id="sq100ltpad10rbmargin10"> - 100px square, abs, 10px left and top padding, 10px bottom and right margin - </div> - <div id="sq100border10"> - 100px square, abs, 10px yellow border - </div> - <div id="sq100border10margin10"> - 100px square, abs, 10px yellow border, 10px margin - </div> - <div id="sq100border10margin10pad10"> - 100px square, abs, 10px yellow border, 10px margin, 10px padding - </div> - <div id="sq100nopos"> - 100px square, no positioning - </div> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/html_rtl.html b/includes/js/dojo/tests/_base/html_rtl.html deleted file mode 100644 index 8d74afa..0000000 --- a/includes/js/dojo/tests/_base/html_rtl.html +++ /dev/null @@ -1,110 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html dir="rtl"> - <head> - <title>testing Core HTML/DOM/CSS/Style utils</title> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" - src="../../dojo.js" - djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - - dojo.addOnLoad(function(){ - doh.register("t", - [ - function coordsWithVertScrollbar(t){ - // show vertical scrollbar - dojo.byId("rect_vert").style.display = ""; - try{ - t.is(100, dojo.coords('rect100').x); - }finally{ - dojo.byId("rect_vert").style.display = "none"; - } - }, - - function coordsWithHorzScrollbar(t){ - // show horizonal scrollbar & scroll a bit left - dojo.byId("rect_horz").style.display = ""; - scrollBy(-50, 0); - try{ - t.is(100, dojo.coords('rect100', true).x); - }finally{ - dojo.byId("rect_horz").style.display = "none"; - } - }, - - function eventClientXY(t){ // IE only test - if(dojo.isIE){ - // show vertical scrollbar - dojo.byId("rect_vert").style.display = ""; - - var rect = dojo.byId("rect100"); - var assertException = null; - - function rect_onclick(e){ - // move the rectangle to the mouse point - rect.style.left = e.pageX + "px"; - rect.style.top = e.pageY + "px"; - window.alert("Do NOT move your mouse!!!\n\n" + - "The black rectangle's top-left point should be under the mouse point.\n\n" + - "If not, you will see a failure in the test report later.\n\n" + - "Now press the space bar, but do NOT move your mouse."); - rect.fireEvent('ondblclick'); - } - - function rect_ondblclick(){ - // test if the rectangle is really under the mouse point - try{ - t.is(0, event.offsetX); - t.is(0, event.offsetY); - }catch (e){ // allow the exception in a event handler go to the event firer - assertException = e; - } - } - - dojo.connect(rect, "onclick", null, rect_onclick); - dojo.connect(rect, "ondblclick", null, rect_ondblclick); - window.alert("Move the mouse to anywhere in this page, and then press the space bar."); - rect.fireEvent('onclick'); - if(assertException != null){ - throw assertException; - } - } - } - - ] - ); - doh.run(); - }); - </script> - <style type="text/css"> - #rect100 { - background-color: black; - color: white; - position: absolute; - left: 100px; - top: 100px; - width: 100px; - height: 100px; - border: 0px; - padding: 0px; - margin: 0px; - overflow: hidden; - } - - </style> - </head> - <body> - <h1>testing Core HTML/DOM/CSS/Style utils</h1> - <div id="rect100"> - 100px rect, abs, - mouse point is at top-left after the test "eventClientXY" - </div> - <div id="rect_vert" style="height:1600px;display:none">show vertical scrollbar</div> - <div id="rect_horz" style="width:1600px;display:none">show horizonal scrollbar</div> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/json.js b/includes/js/dojo/tests/_base/json.js deleted file mode 100644 index 3a9a24c..0000000 --- a/includes/js/dojo/tests/_base/json.js +++ /dev/null @@ -1,37 +0,0 @@ -if(!dojo._hasResource["tests._base.json"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.json"] = true; -dojo.provide("tests._base.json"); - -tests.register("tests._base.json", - [ - //Not testing dojo.toJson() on its own since Rhino will output the object properties in a different order. - //Still valid json, but just in a different order than the source string. - - // take a json-compatible object, convert it to a json string, then put it back into json. - function toAndFromJson(t){ - var testObj = {a:"a", b:1, c:"c", d:"d", e:{e1:"e1", e2:2}, f:[1,2,3], g:"g",h:{h1:{h2:{h3:"h3"}}}}; - - var mirrorObj = dojo.fromJson(dojo.toJson(testObj)); - t.assertEqual("a", mirrorObj.a); - t.assertEqual(1, mirrorObj.b); - t.assertEqual("c", mirrorObj.c); - t.assertEqual("d", mirrorObj.d); - t.assertEqual("e1", mirrorObj.e.e1); - t.assertEqual(2, mirrorObj.e.e2); - t.assertEqual(1, mirrorObj.f[0]); - t.assertEqual(2, mirrorObj.f[1]); - t.assertEqual(3, mirrorObj.f[2]); - t.assertEqual("g", mirrorObj.g); - t.assertEqual("h3", mirrorObj.h.h1.h2.h3); - var badJson; - try{ - badJson = dojo.fromJson("bad json"); // this should throw an exception, and not set badJson - }catch(e){ - } - t.assertEqual(undefined,badJson); - } - ] -); - - -} diff --git a/includes/js/dojo/tests/_base/lang.js b/includes/js/dojo/tests/_base/lang.js deleted file mode 100644 index 38acbff..0000000 --- a/includes/js/dojo/tests/_base/lang.js +++ /dev/null @@ -1,180 +0,0 @@ -if(!dojo._hasResource["tests._base.lang"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.lang"] = true; -dojo.provide("tests._base.lang"); - -tests.register("tests._base.lang", - [ - function mixin(t){ - var src = { - foo: function(){ - t.debug("foo"); - }, - bar: "bar" - }; - var dest = {}; - dojo.mixin(dest, src); - t.assertEqual("function", typeof dest["foo"]); - t.assertEqual("string", typeof dest["bar"]); - }, - - function extend(t){ - var src = { - foo: function(){ - t.debug("foo"); - }, - bar: "bar" - }; - function dest(){} - dojo.extend(dest, src); - var test = new dest(); - t.assertEqual("function", typeof test["foo"]); - t.assertEqual("string", typeof test["bar"]); - }, - - function isObject(t){ - t.assertFalse(dojo.isObject(true)); - t.assertFalse(dojo.isObject(false)); - t.assertFalse(dojo.isObject("foo")); - t.assertTrue(dojo.isObject(new String("foo"))); - t.assertTrue(dojo.isObject(null)); - t.assertTrue(dojo.isObject({})); - t.assertTrue(dojo.isObject([])); - t.assertTrue(dojo.isObject(new Array())); - }, - - function isArray(t){ - t.assertTrue(dojo.isArray([])); - t.assertTrue(dojo.isArray(new Array())); - t.assertFalse(dojo.isArray({})); - }, - - function isArrayLike(t){ - t.assertFalse(dojo.isArrayLike("thinger")); - t.assertTrue(dojo.isArrayLike(new Array())); - t.assertFalse(dojo.isArrayLike({})); - t.assertTrue(dojo.isArrayLike(arguments)); - }, - - function isString(t){ - t.assertFalse(dojo.isString(true)); - t.assertFalse(dojo.isString(false)); - t.assertTrue(dojo.isString("foo")); - t.assertTrue(dojo.isString(new String("foo"))); - t.assertFalse(dojo.isString(null)); - t.assertFalse(dojo.isString({})); - t.assertFalse(dojo.isString([])); - }, - - function partial(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(arg1, arg2){ - return [this.foo, arg1, arg2]; - } - - var st1 = dojo.partial(thinger); - t.assertEqual("bar", st1.call(scope)[0]); - t.assertEqual(undefined, st1()[0]); - var st2 = dojo.partial(thinger, "foo", "bar"); - t.assertEqual("bar", st2()[2]); - var st3 = dojo.partial(thinger, "foo", "bar"); - }, - - function nestedPartial(t){ - function thinger(arg1, arg2){ - return [arg1, arg2]; - } - - var st1 = dojo.partial(thinger, "foo"); - t.assertEqual(undefined, st1()[1]); - t.assertEqual("bar", st1("bar")[1]); - - // partials can accumulate - var st2 = dojo.partial(st1, "thud"); - t.assertEqual("foo", st2()[0]); - t.assertEqual("thud", st2()[1]); - }, - - function hitch(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(){ - return [this.foo, arguments.length]; - } - - var st1 = dojo.hitch(scope, thinger); - t.assertEqual("bar", st1()[0]); - t.assertEqual(0, st1()[1]); - - var st2 = dojo.hitch(scope2, thinger); - t.assertEqual("baz", st2()[0]); - t.assertEqual(0, st1()[1]); - t.assertEqual(1, st1("blah")[1]); - - // st2 should be "scope proof" - t.assertEqual("baz", st2.call(scope)[0]); - }, - - function hitchWithArgs(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(){ - return [this.foo, arguments.length]; - } - - var st1 = dojo.hitch(scope, thinger, "foo", "bar"); - t.assertEqual("bar", st1()[0]); - t.assertEqual(2, st1()[1]); - var st2 = dojo.hitch(scope2, thinger, "foo", "bar"); - t.assertEqual("baz", st2()[0]); - t.assertEqual(2, st2()[1]); - }, - - function hitchAsPartial(t){ - var scope = { foo: "bar" }; - var scope2 = { foo: "baz" }; - function thinger(arg1, arg2){ - return [this.foo, arg1, arg2]; - } - - var st1 = dojo.hitch(null, thinger); - t.assertEqual("bar", st1.call(scope)[0]); - t.assertEqual(undefined, st1()[0]); - var st2 = dojo.hitch(null, thinger, "foo", "bar"); - t.assertEqual("bar", st2()[2]); - var st3 = dojo.hitch(null, thinger, "foo", "bar"); - }, - - function _toArray(t){ - var obj1 = [ 'foo', 'bar', 'spam', 'ham' ]; - - function thinger(){ - return dojo._toArray(arguments); - } - var obj2 = thinger.apply(this, obj1); - t.assertEqual(obj1[0], obj2[0]); - }, - - function clone(t) { - var obj1 = {foo: 'bar', answer: 42, jan102007: new Date(2007, 0, 10), - baz: { - a: null, - b: [ - 1, "b", 2.3, true, false - //, function(){ return 4; }, /\d+/gm - ] - } - }; - var obj2 = dojo.clone(obj1); - t.assertEqual(obj1.foo, obj2.foo); - t.assertEqual(obj1.answer, obj2.answer); - t.assertEqual(obj1.jan102007, obj2.jan102007); - t.assertEqual(obj1.baz.a, obj2.baz.a); - for(var i = 0; i < obj1.baz.b.length; ++i){ - t.assertEqual(obj1.baz.b[i], obj2.baz.b[i]); - } - } - ] -); - -} diff --git a/includes/js/dojo/tests/_base/query.html b/includes/js/dojo/tests/_base/query.html deleted file mode 100644 index 5c92221..0000000 --- a/includes/js/dojo/tests/_base/query.html +++ /dev/null @@ -1,154 +0,0 @@ -<html> - <head> - <title>testing dojo.query()</title> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" src="../../dojo.js" - djConfig="isDebug: true, debugAtAllCosts: false, noFirebugLite: true"></script> - <script type="text/javascript" src="../../../util/doh/runner.js"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - dojo.require("dojox.data.dom"); - dojo.addOnLoad(function(){ - doh.register("t", - [ - // basic sanity checks - "doh.is(4, (dojo.query('h3')).length);", - "doh.is(1, (dojo.query('h1:first-child')).length);", - "doh.is(2, (dojo.query('h3:first-child')).length);", - "doh.is(1, (dojo.query('#t')).length);", - "doh.is(1, (dojo.query('#bug')).length);", - "doh.is(4, (dojo.query('#t h3')).length);", - "doh.is(1, (dojo.query('div#t')).length);", - "doh.is(4, (dojo.query('div#t h3')).length);", - "doh.is(0, (dojo.query('span#t')).length);", - "doh.is(1, (dojo.query('#t div > h3')).length);", - "doh.is(2, (dojo.query('.foo')).length);", - "doh.is(1, (dojo.query('.foo.bar')).length);", - "doh.is(2, (dojo.query('.baz')).length);", - "doh.is(3, (dojo.query('#t > h3')).length);", - // syntactic equivalents - "doh.is(12, (dojo.query('#t > *')).length);", - "doh.is(12, (dojo.query('#t >')).length);", - "doh.is(3, (dojo.query('.foo >')).length);", - "doh.is(3, (dojo.query('.foo > *')).length);", - // with a root, by ID - "doh.is(3, (dojo.query('> *', 'container')).length);", - "doh.is(3, (dojo.query('> h3', 't')).length);", - // compound queries - "doh.is(2, (dojo.query('.foo, .bar')).length);", - "doh.is(2, (dojo.query('.foo,.bar')).length);", - // multiple class attribute - "doh.is(1, (dojo.query('.foo.bar')).length);", - "doh.is(2, (dojo.query('.foo')).length);", - "doh.is(2, (dojo.query('.baz')).length);", - // case sensitivity - "doh.is(1, (dojo.query('span.baz')).length);", - "doh.is(1, (dojo.query('sPaN.baz')).length);", - "doh.is(1, (dojo.query('SPAN.baz')).length);", - "doh.is(1, (dojo.query('[class = \"foo bar\"]')).length);", - "doh.is(2, (dojo.query('[foo~=\"bar\"]')).length);", - "doh.is(2, (dojo.query('[ foo ~= \"bar\" ]')).length);", - // "t.is(0, (dojo.query('[ foo ~= \"\\'bar\\'\" ]')).length);", - "doh.is(3, (dojo.query('[foo]')).length);", - "doh.is(1, (dojo.query('[foo$=\"thud\"]')).length);", - "doh.is(1, (dojo.query('[foo$=thud]')).length);", - "doh.is(1, (dojo.query('[foo$=\"thudish\"]')).length);", - "doh.is(1, (dojo.query('#t [foo$=thud]')).length);", - "doh.is(1, (dojo.query('#t [ title $= thud ]')).length);", - "doh.is(0, (dojo.query('#t span[ title $= thud ]')).length);", - "doh.is(1, (dojo.query('[foo|=\"bar\"]')).length);", - "doh.is(1, (dojo.query('[foo|=\"bar-baz\"]')).length);", - "doh.is(0, (dojo.query('[foo|=\"baz\"]')).length);", - "doh.is(dojo.byId('_foo'), dojo.query('.foo:nth-child(2)')[0]);", - "doh.is(dojo.query('style')[0], dojo.query(':nth-child(2)')[0]);", - // descendant selectors - "doh.is(3, dojo.query('>', 'container').length);", - "doh.is(3, dojo.query('> *', 'container').length);", - "doh.is(2, dojo.query('> [qux]', 'container').length);", - "doh.is('child1', dojo.query('> [qux]', 'container')[0].id);", - "doh.is('child3', dojo.query('> [qux]', 'container')[1].id);", - "doh.is(3, dojo.query('>', 'container').length);", - "doh.is(3, dojo.query('> *', 'container').length);", - "doh.is('passed', dojo.query('#bug')[0].value);", - // sibling selectors - "doh.is(1, dojo.query('+', 'container').length);", - "doh.is(3, dojo.query('~', 'container').length);", - "doh.is(1, (dojo.query('.foo + span')).length);", - "doh.is(4, (dojo.query('.foo ~ span')).length);", - "doh.is(1, (dojo.query('#foo ~ *')).length);", - "doh.is(1, (dojo.query('#foo ~')).length);", - // sub-selector parsing - "doh.is(1, dojo.query('#t span.foo:not(span:first-child)').length);", - "doh.is(1, dojo.query('#t span.foo:not(:first-child)').length);", - - // nth-child tests - "doh.is(2, dojo.query('#t > h3:nth-child(odd)').length);", - "doh.is(3, dojo.query('#t h3:nth-child(odd)').length);", - "doh.is(3, dojo.query('#t h3:nth-child(2n+1)').length);", - "doh.is(1, dojo.query('#t h3:nth-child(even)').length);", - "doh.is(1, dojo.query('#t h3:nth-child(2n)').length);", - "doh.is(0, dojo.query('#t h3:nth-child(2n+3)').length);", - "doh.is(2, dojo.query('#t h3:nth-child(1)').length);", - "doh.is(1, dojo.query('#t > h3:nth-child(1)').length);", - "doh.is(3, dojo.query('#t :nth-child(3)').length);", - "doh.is(0, dojo.query('#t > div:nth-child(1)').length);", - "doh.is(7, dojo.query('#t span').length);", - // :empty pseudo-selector - "doh.is(4, dojo.query('#t > span:empty').length);", - "doh.is(6, dojo.query('#t span:empty').length);", - "doh.is(0, dojo.query('h3 span:empty').length);", - "doh.is(1, dojo.query('h3 :not(:empty)').length);", - // escaping of ":" chars inside an ID - function silly_IDs1(){ - doh.t(document.getElementById("silly:id::with:colons")); - doh.is(1, dojo.query("#silly\\:id\\:\\:with\\:colons").length); - }, - function NodeList_identity(){ - var foo = new dojo.NodeList([dojo.byId("container")]); - doh.is(foo, dojo.query(foo)); - }, - function xml(){ - try{ - var doc = dojox.data.dom.createDocument("<ResultSet><Result>One</Result><Result>Two</Result></ResultSet>"); - console.debug(doc); - console.debug(dojox.data.dom.innerXML(doc.documentElement)); - console.debug(dojo.query("Result", doc.documentElement).length); - }catch(e){ console.debug(e); } - } - ] - ); - doh.run(); - }); - </script> - </head> - <body> - <h1>testing dojo.query()</h1> - <div id="t"> - <h3>h3 <span>span</span> endh3 </h3> - <!-- comment to throw things off --> - <div class="foo bar" id="_foo"> - <h3>h3</h3> - <span id="foo"></span> - <span></span> - </div> - <h3>h3</h3> - <h3 class="baz" title="thud">h3</h3> - <span class="foobar baz foo"></span> - <span foo="bar"></span> - <span foo="baz bar thud"></span> - <!-- FIXME: should foo="bar-baz-thud" match? [foo$=thud] ??? --> - <span foo="bar-baz-thudish" id="silly:id::with:colons"></span> - <div id="container"> - <div id="child1" qux="true"></div> - <div id="child2"></div> - <div id="child3" qux="true"></div> - </div> - <div qux="true"></div> - <input id="notbug" name="bug" type="hidden" value="failed" /> - <input id="bug" type="hidden" value="passed" /> - </div> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/query.js b/includes/js/dojo/tests/_base/query.js deleted file mode 100644 index 20d2fc4..0000000 --- a/includes/js/dojo/tests/_base/query.js +++ /dev/null @@ -1,9 +0,0 @@ -if(!dojo._hasResource["tests._base.query"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.query"] = true; -dojo.provide("tests._base.query"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.query", dojo.moduleUrl("tests", "_base/query.html")); - doh.registerUrl("tests._base.NodeList", dojo.moduleUrl("tests", "_base/NodeList.html")); -} - -} diff --git a/includes/js/dojo/tests/_base/timeout.php b/includes/js/dojo/tests/_base/timeout.php deleted file mode 100644 index 560b0d3..0000000 --- a/includes/js/dojo/tests/_base/timeout.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -$callbackName = $_REQUEST["callback"]; -sleep(5); -print "SuperXFooBarVariable = 'Oh no! SuperXFooBarVariable is defined (should not be for timeout case).'; {$callbackName}({Status: 'good'});"; - -?> diff --git a/includes/js/dojo/tests/_base/xhr.html b/includes/js/dojo/tests/_base/xhr.html deleted file mode 100644 index ddc1bb4..0000000 --- a/includes/js/dojo/tests/_base/xhr.html +++ /dev/null @@ -1,404 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> - <head> - <title>testing form and xhr utils</title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <style type="text/css"> - @import "../../resources/dojo.css"; - </style> - <script type="text/javascript" - src="../../dojo.js" djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.require("doh.runner"); - dojo.addOnLoad(function(){ - var f1fo = { 'blah': "blah" }; - var f1foStr = "blah=blah"; - var f1foJson = '{"blah":"blah"}'; - - var f2fo = { - blah: "blah", - multi: [ - "thud", - "thonk" - ], - textarea: "textarea_value" - }; - var f2foStr = "blah=blah&multi=thud&multi=thonk&textarea=textarea_value"; - var f2foJson = '{"blah":"blah","multi":["thud","thonk"],"textarea":"textarea_value"}'; - - var f3fo = { - spaces: "string with spaces" - }; - var f3foStr = "spaces=string%20with%20spaces&"; - var f3foJson = '{"spaces":"string with spaces"}'; - - var f5fo = { 'blåh': "bláh" }; - var f5foStr = "bl%C3%A5h=bl%C3%A1h"; - var f5foJson = '{"blåh":"bláh"}'; - - - doh.register("t", - [ - function formNodeToObject(t){ - t.is(f1fo , dojo.formToObject(dojo.byId("f1"))); - t.is(f5fo , dojo.formToObject(dojo.byId("f5"))); - }, - function formIdToObject(t){ - t.is(f1fo , dojo.formToObject("f1")); - t.is(f5fo , dojo.formToObject("f5")); - }, - function formToObjectWithMultiSelect(t){ - t.is(f2fo , dojo.formToObject("f2")); - }, - function objectToQuery(t){ - t.is(f1foStr , dojo.objectToQuery(f1fo)); - t.is(f5foStr , dojo.objectToQuery(f5fo)); - }, - function objectToQueryArr(t){ - t.is(f2foStr, dojo.objectToQuery(f2fo)); - }, - function formToQuery(t){ - t.is(f1foStr, dojo.formToQuery("f1")); - t.is(f5foStr, dojo.formToQuery("f5")); - }, - function formToQueryArr(t){ - t.is(f2foStr, dojo.formToQuery("f2")); - }, - function formToJson(t){ - t.is(f1foJson, dojo.formToJson("f1")); - t.is(f5foJson, dojo.formToJson("f5")); - }, - function formToJsonArr(t){ - t.is(f2foJson, dojo.formToJson("f2")); - }, - function queryToObject(t){ - t.is(f1fo , dojo.queryToObject(f1foStr)); - t.is(f2fo , dojo.queryToObject(f2foStr)); - t.is(f3fo , dojo.queryToObject(f3foStr)); - t.is(f5fo , dojo.queryToObject(f5foStr)); - }, - function textContentHandler(t){ - t.is("foo bar baz ", - dojo._contentHandlers.text({ - responseText: "foo bar baz " - }) - ); - }, - function jsonContentHandler(t){ - var jsonObj = { - foo: "bar", - baz: [ - { thonk: "blarg" }, - "xyzzy!" - ] - }; - t.is(jsonObj, - dojo._contentHandlers.json({ - responseText: dojo.toJson(jsonObj) - }) - ); - }, - function jsonCFContentHandler(t){ - var jsonObj = { - foo: "bar", - baz: [ - { thonk: "blarg" }, - "xyzzy!" - ] - }; - var e; - try{ - dojo._contentHandlers["json-comment-filtered"]({ - responseText: dojo.toJson(jsonObj) - }) - }catch(ex){ - e = ex; - }finally{ - // did we fail closed? - t.is((typeof e), "object"); - } - t.is(jsonObj, - dojo._contentHandlers["json-comment-filtered"]({ - responseText: "\tblag\n/*"+dojo.toJson(jsonObj)+"*/\n\r\t\r" - }) - ); - }, - function jsContentHandler(t){ - var jsonObj = { - foo: "bar", - baz: [ - { thonk: "blarg" }, - "xyzzy!" - ] - }; - t.is(jsonObj, - dojo._contentHandlers["javascript"]({ - responseText: "("+dojo.toJson(jsonObj)+")" - }) - ); - t.t(dojo._contentHandlers["javascript"]({ - responseText: "true;" - }) - ); - t.f(dojo._contentHandlers["javascript"]({ - responseText: "false;" - }) - ); - }, - function xmlContentHandler(t){ - var fauxObj = { - foo: "bar", - baz: [ - { thonk: "blarg" }, - "xyzzy!" - ] - }; - t.is(fauxObj, - dojo._contentHandlers["xml"]({ responseXML: fauxObj }) - ); - }, - function xhrGet(t){ - var d = new doh.Deferred(); - var td = dojo.xhrGet({ - url: "xhr.html", // self - preventCache: true, - load: function(text, ioArgs){ - t.is(4, ioArgs.xhr.readyState); - return text; //must return a value here or the parent test deferred fails. - } - }); - t.t(td instanceof dojo.Deferred); - td.addCallback(d, "callback"); - return d; - }, - function xhrGet404(t){ - var d = new doh.Deferred(); - try{ - var td = dojo.xhrGet({ - url: "xhr_blarg.html", // doesn't exist - error: function(err, ioArgs){ - t.is(404, ioArgs.xhr.status); - return err; //must return a value here or the parent test deferred fails. - } - }); - // td.addErrback(d, "callback"); - }catch(e){ - d.callback(true); - } - // return d; - }, - function xhrGetContent(t){ - var d = new doh.Deferred(); - var td = dojo.xhrGet({ - url: "xhr.html?color=blue", - content: { - foo: [ "bar", "baz" ], - thud: "thonk", - xyzzy: 3 - } - }); - td.addCallback(function(text){ - // console.debug(td, td.xhr, td.args); - t.is("xhr.html?color=blue&foo=bar&foo=baz&thud=thonk&xyzzy=3", - td.ioArgs.url); - d.callback(true); - }); - return d; - }, - function xhrGetForm(t){ - var d = new doh.Deferred(); - var td = dojo.xhrGet({ - url: "xhr.html", // self - form: "f3" - }); - td.addCallback(function(xhr){ - // console.debug(td.args.url); - t.is("xhr.html?spaces=string%20with%20spaces", td.ioArgs.url); - d.callback(true); - }); - return d; - }, - function xhrGetFormWithContent(t){ - // ensure that stuff passed via content over-rides - // what's specified in the form - var d = new doh.Deferred(); - var td = dojo.xhrGet({ - url: "xhr.html", // self - form: "f3", - content: { spaces: "blah" } - }); - td.addCallback(function(xhr){ - // console.debug(td.args.url); - t.is("xhr.html?spaces=blah", td.ioArgs.url); - d.callback(true); - }); - return d; - }, - function xhrPost(t){ - var d = new doh.Deferred(); - var td = dojo.xhrPost({ - url: "xhr.html?foo=bar", // self - content: { color: "blue"}, - handle: function(res, ioArgs){ - if((dojo._isDocumentOk(ioArgs.xhr))|| - (ioArgs.xhr.status == 405) - ){ - d.callback(true); - }else{ - d.errback(false); - } - } - }); - // t.t(td instanceof dojo.Deferred); - return d; - }, - function xhrPostWithContent(t){ - var d = new doh.Deferred(); - var td = dojo.xhrPost({ - url: "xhr.html", - content: { - foo: [ "bar", "baz" ], - thud: "thonk", - xyzzy: 3 - } - }); - td.addBoth(function(text){ - t.is("foo=bar&foo=baz&thud=thonk&xyzzy=3", - td.ioArgs.query); - if( (dojo._isDocumentOk(td.ioArgs.xhr))|| - (td.ioArgs.xhr.status == 405) - ){ - d.callback(true); - }else{ - d.errback(false); - } - }); - return d; - }, - function xhrPostForm(t){ - var d = new doh.Deferred(); - var form = dojo.byId("f4"); - - //Make sure we can send a form to its - //action URL. See trac: #2844. - var td = dojo.xhrPost({ - form: form - }); - td.addCallback(function(){ - d.callback(true); - }); - td.addErrback(function(error){ - d.callback(error); - }); - // t.t(td instanceof dojo.Deferred); - return d; - }, - function rawXhrPost(t){ - var d = new doh.Deferred(); - var td = dojo.rawXhrPost({ - url: "xhr.html", // self - postContent: "foo=bar&color=blue&height=average", - handle: function(res, ioArgs){ - if((dojo._isDocumentOk(ioArgs.xhr))|| - (ioArgs.xhr.status == 405) - ){ - d.callback(true); - }else{ - d.errback(false); - } - } - }); - // t.t(td instanceof dojo.Deferred); - return d; - }, - function xhrPut(t){ - var d = new doh.Deferred(); - var td = dojo.xhrPut({ - url: "xhrDummyMethod.php?foo=bar", // self - content: { color: "blue"}, - handle: function(res, ioArgs){ - if((dojo._isDocumentOk(ioArgs.xhr))|| - (ioArgs.xhr.status == 403) - ){ - d.callback(true); - }else{ - d.errback(false); - } - } - }); - // t.t(td instanceof dojo.Deferred); - return d; - }, - function xhrDelete(t){ - var d = new doh.Deferred(); - var td = dojo.xhrDelete({ - url: "xhrDummyMethod.php", // self - preventCache: true, - handle: function(res, ioArgs){ - if((dojo._isDocumentOk(ioArgs.xhr))|| - (ioArgs.xhr.status == 403) - ){ - d.callback(true); - }else{ - d.errback(false); - } - } - }); - // t.t(td instanceof dojo.Deferred); - return d; - }, - function xhrCancel(t){ - var d = new doh.Deferred(); - var td = dojo.xhrPost({ - url: "xhrDummyMethod.php", // self - handle: function(res, ioArgs){ - if(res instanceof Error && res.dojoType == "cancel"){ - d.callback(true); - }else{ - d.errback(false); - } - } - }); - td.cancel(); - // t.t(td instanceof dojo.Deferred); - return d; - } - // FIXME: need to add tests for wrapForm - ] - ); - doh.run(); - }); - </script> - </head> - <body> - <form id="f1" style="border: 1px solid black;"> - <input type="text" name="blah" value="blah"> - <input type="text" name="no_value" value="blah" disabled> - <input type="button" name="no_value2" value="blah"> - </form> - <form id="f2" style="border: 1px solid black;"> - <input type="text" name="blah" value="blah"> - <input type="text" name="no_value" value="blah" disabled> - <input type="button" name="no_value2" value="blah"> - <select type="select" multiple name="multi" size="5"> - <option value="blah">blah</option> - <option value="thud" selected>thud</option> - <option value="thonk" selected>thonk</option> - </select> - <textarea name="textarea">textarea_value</textarea> - </form> - <form id="f3" style="border: 1px solid black;"> - <input type="hidden" name="spaces" value="string with spaces"> - </form> - <form id="f4" style="border: 1px solid black;" action="xhrDummyMethod.php"> - <input type="hidden" name="action" value="Form with input named action"> - </form> - <form id="f5" style="border: 1px solid black;"> - <input type="text" name="blåh" value="bláh"> - <input type="text" name="no_value" value="blah" disabled> - <input type="button" name="no_value2" value="blah"> - </form> - </body> -</html> - diff --git a/includes/js/dojo/tests/_base/xhr.js b/includes/js/dojo/tests/_base/xhr.js deleted file mode 100644 index 885bbfe..0000000 --- a/includes/js/dojo/tests/_base/xhr.js +++ /dev/null @@ -1,8 +0,0 @@ -if(!dojo._hasResource["tests._base.xhr"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["tests._base.xhr"] = true; -dojo.provide("tests._base.xhr"); -if(dojo.isBrowser){ - doh.registerUrl("tests._base.xhr", dojo.moduleUrl("tests", "_base/xhr.html")); -} - -} diff --git a/includes/js/dojo/tests/_base/xhrDummyMethod.php b/includes/js/dojo/tests/_base/xhrDummyMethod.php deleted file mode 100644 index c9206fe..0000000 --- a/includes/js/dojo/tests/_base/xhrDummyMethod.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php -//Just a dummy end point to use in HTTP method calls like PUT and DELETE. -//This avoids getting a 405 method not allowed calls for the tests that reference -//this file. - -header("HTTP/1.1 200 OK"); -?> |