summaryrefslogtreecommitdiff
path: root/includes/js/dojox/timing/tests
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/timing/tests
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-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/timing/tests')
-rw-r--r--includes/js/dojox/timing/tests/test_Sequence.html80
-rw-r--r--includes/js/dojox/timing/tests/test_ThreadPool.html16
2 files changed, 96 insertions, 0 deletions
diff --git a/includes/js/dojox/timing/tests/test_Sequence.html b/includes/js/dojox/timing/tests/test_Sequence.html
new file mode 100644
index 0000000..84f4bfb
--- /dev/null
+++ b/includes/js/dojox/timing/tests/test_Sequence.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>dojox.timing.Sequence class</title>
+
+ <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true" ></script>
+ <script type="text/javascript" src="../Sequence.js"></script>
+ <style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ @import "../../../dijit/themes/dijit.css";
+ @import "../../../dijit/themes/tundra/tundra.css";
+ @import "../../../dijit/tests/css/dijitTests.css";
+ </style>
+ <script type="text/javascript">
+ // dojo.require("dojox.timing.Sequence");
+
+ var seqObj = null; var outputNode = null;
+
+ dojo.addOnLoad(function(){
+ outputNode = dojo.byId('logBox');
+ seqObj = new dojox.timing.Sequence({});
+ });
+
+ function runSequence(){
+ outputNode.innerHTML = "";
+ seqObj.go(seq, function() { logMsg('done') });
+ };
+
+ function logMsg(msg){
+ outputNode.innerHTML += msg + "<br>";
+ }
+
+ function showMessage(msg) {
+ logMsg(msg);
+ }
+
+ function returnWhenDone() {
+ logMsg("in returnWhenDone");
+ window.setTimeout(continueSequence,1000);
+ return false;
+ }
+ function continueSequence() {
+ // continue the sequence run
+ seqObj.goOn();
+ }
+
+ // this is our example sequence array:
+ var seq = [
+ {func: [showMessage, window, "i am first"], pauseAfter: 1000},
+ {func: [showMessage, window, "after 1000ms pause this should be seen"], pauseAfter: 2000},
+ {func: [showMessage, window, "another 2000ms pause and 1000ms pause before"], pauseAfter: 1000},
+ {func: [showMessage, window, "repeat 10 times and pause 100ms after"], repeat: 10, pauseAfter: 100},
+ {func: returnWhenDone} // no array, just a function to call
+ ];
+
+
+
+
+ </script>
+</head>
+<body class="tundra">
+
+ <h1>dojox.timing.Sequence tests</h1>
+
+ <br>(example code in page source)<br>
+ <input type="button" onClick="runSequence()" value="Run Sequence">
+
+ <h3>Sequence output:</h3>
+ <div id="logBox" style="width:420px; height:250px; overflow:auto; border:1px solid #ccc;">
+ </div>
+
+ <p>TODO: maybe need to put an _Animation sequence example here? seems much more robust
+ than using chains and combines with delays and durations to hack timing ... also, need
+ examples for stop() and other methods of class</p>
+
+
+
+</body>
+</html>
diff --git a/includes/js/dojox/timing/tests/test_ThreadPool.html b/includes/js/dojox/timing/tests/test_ThreadPool.html
new file mode 100644
index 0000000..53e4bfb
--- /dev/null
+++ b/includes/js/dojox/timing/tests/test_ThreadPool.html
@@ -0,0 +1,16 @@
+<html>
+ <head>
+ <title>Quick Thread Pool Test</title>
+ <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true" ></script>
+ <script type="text/javascript" src="../ThreadPool.js"></script>
+ <style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ </style>
+ <script type="text/javascript">
+ dojo.require("dojox.timing.ThreadPool");
+ </script>
+ </head>
+ <body>
+ testing.
+ </body>
+</html>