aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/_programaticTest.html
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/dijit/tests/_programaticTest.html
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/dijit/tests/_programaticTest.html')
-rw-r--r--includes/js/dijit/tests/_programaticTest.html109
1 files changed, 109 insertions, 0 deletions
diff --git a/includes/js/dijit/tests/_programaticTest.html b/includes/js/dijit/tests/_programaticTest.html
new file mode 100644
index 0000000..41b1815
--- /dev/null
+++ b/includes/js/dijit/tests/_programaticTest.html
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Dijit raw programatic test suite | The Dojo Toolkit</title>
+
+ <style type="text/css">
+ @import "../../dojo/resources/dojo.css";
+ @import "css/dijitTests.css";
+ body, html { width:100%; height:100%; margin:0; padding:0; background:#fff !important; }
+ </style>
+
+ <script type="text/javascript" src="../../dojo/dojo.js"
+ djConfig="parseOnLoad: true, isDebug: true"></script>
+ <script type="text/javascript" src="_testCommon.js"></script>
+
+ <script language="JavaScript" type="text/javascript">
+ dojo.require("dojo.data.ItemFileReadStore");
+ dojo.require("dijit.dijit-all");
+
+ var randomParams = function(){
+ // need better params to test passing
+ return { "length" : 20 };
+ };
+
+ var inspectClass = function(fullClassName){
+ var newDijit, newDijitDom, newDijitParam = null;
+ var createdWidgets = [];
+ className = eval(fullClassName); //
+
+ // just try to make the class:
+ try{
+ newDijit = new className({});
+ createdWidgets.push(newDijit);
+ }catch(e){
+ console.warn('new only: ',fullClassName,e);
+ }
+
+ // try starting this widget
+ try{
+ if (newDijit && newDijit.startup){ newDijit.startup(); }
+ }catch(e){
+ console.warn('call startup: ',fullClassName,e);
+ }
+
+ // try with a div in the dom
+ try{
+ var tmpDiv = dojo.body().appendChild(document.createElement('div'));
+ newDijitDom = new className({},tmpDiv);
+ createdWidgets.push(newDijitDom);
+ }catch(e){
+ console.warn('attached to div: ',fullClassName,e);
+ }
+
+ // lets pass random parameters
+ try{
+ var tmpDiv = dojo.body().appendChild(document.createElement('div'));
+ newDijitParam = new className(randomParams(),tmpDiv);
+ createdWidgets.push(newDijitParam);
+ }catch(e){
+ console.warn('random param test: ',fullClassName,e);
+ }
+ // add more tests ...
+
+ // cleanup after ourselves
+ dojo.forEach(createdWidgets,function(byeWidget){
+ try{
+ if(byeWidget.destroy){ byeWidget.destroy(); }
+ }catch(e){
+ console.warn('destroying: ',byeWidget.declaredClass,e,byeWidget);
+ }
+ });
+
+ };
+
+ var storeError = function(e,request){
+ console.warn(e,request);
+ };
+
+ var storeReady = function(items,request){
+ dojo.forEach(items,function(item){
+ var testClass = theStore.getValue(item,"className");
+ try{
+ inspectClass(testClass);
+ }catch(e){
+ console.warn(e);
+ }
+ });
+ };
+
+ var init = function(){
+ var request = {
+ query: { },
+ onComplete: storeReady,
+ onError: storeError
+ };
+ theStore.fetch(request);
+ };
+ dojo.addOnLoad(init);
+
+ </script>
+
+</head>
+<body>
+ <div dojoType="dojo.data.ItemFileReadStore" jsId="theStore"
+ url="../tests/_data/dijits.json"></div>
+
+</body>
+</html>