diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
commit | e44a7e37b6c7b5961adaffc62b9042b8d442938e (patch) | |
tree | 95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/widget/tests/test_Loader.html | |
parent | a62b9742ee5e28bcec6872d88f50f25b820914f6 (diff) | |
download | semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2 |
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/widget/tests/test_Loader.html')
-rw-r--r-- | includes/js/dojox/widget/tests/test_Loader.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/includes/js/dojox/widget/tests/test_Loader.html b/includes/js/dojox/widget/tests/test_Loader.html new file mode 100644 index 0000000..3c014a2 --- /dev/null +++ b/includes/js/dojox/widget/tests/test_Loader.html @@ -0,0 +1,81 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <title>Dojo Visual Loader Test</title> + <style type="text/css"> + @import "../../../dojo/resources/dojo.css"; + @import "../../../dijit/themes/tundra/tundra.css"; + @import "../../../dijit/themes/dijit.css"; + @import "../../../dijit/tests/css/dijitTests.css"; + @import "../Loader/Loader.css"; + </style> + + <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script> + <script type="text/javascript" src="../Loader.js"></script> + <script type="text/javascript"> + // dojo.require("dojox.widget.Loader"); + dojo.require("dojo.parser"); // scan page for widgets and instantiate them + + function getHoney(){ + // simple xhrGet example + var foo = dojo.xhrGet({ + url: '../Loader/honey.php?delay=0', + handleAs: 'text', + load: function(result){ + content.innerHTML = result; + } + }); + } + + function postHoney(){ + // simple xhrPost example + var foo = dojo.xhrPost({ + url: '../Loader/honey.php?delay=0', + handleAs: 'text', + load: function(result){ + content.innerHTML = result; + } + }); + } + + function alertMe(){ + console.log('subscription fired',arguments); + } + + var content = null; + dojo.addOnLoad(function(){ + + content = dojo.byId("dataholder"); + // FIXME: why aren't you working? + // var foo = dojo.subscribe("Loader",null,"alertMe"); + // console.log(foo); + + }); + </script> +</head> +<body class="tundra"> + <div id="globalLoader" dojoType="dojox.widget.Loader"></div> + + <!-- Other examples: + <div id="globalLoader" dojoType="dojox.widget.Loader" hasVisuals="false"></div> + <div id="globalLoader" dojoType="dojox.widget.Loader" hasVisuals="true" attachToPointer="false"></div> + --> + + <h1 class="testTitle">Dojox xhrListener test</h1> + + <a href="javascript:getHoney();">start xhrGet demo</a> + <a href="javascript:postHoney();">start xhrPost demo</a> + + <p>No additional code is required except for the existance of a + dojoType="dojox.widget.Loader" node. It will listen for the start + and end of xhr* requests (via _ioSetArgs [ugh] and Deferred.prototype._fire .. + </p> + + <br> + <div id="dataholder" style="float:left; height:300px; overflow:auto; width:400px; border:1px solid #ccc; "></div> + <!-- make me a scrollbar. a Taaaaaall scrollbar --> + <div style="float:left; height:2000px; width:1px; overflow:hidden">spacer</div> + +</body> +</html> |