summaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/widgetsInTemplate.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dijit/tests/widgetsInTemplate.html
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/tests/widgetsInTemplate.html')
-rw-r--r--includes/js/dijit/tests/widgetsInTemplate.html112
1 files changed, 0 insertions, 112 deletions
diff --git a/includes/js/dijit/tests/widgetsInTemplate.html b/includes/js/dijit/tests/widgetsInTemplate.html
deleted file mode 100644
index ae3b6f9..0000000
--- a/includes/js/dijit/tests/widgetsInTemplate.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<html>
- <head>
- <title>testing widgetsInTemplate support</title>
- <script type="text/javascript" src="../../dojo/dojo.js"
- djConfig="parseOnLoad: true, isDebug: true"></script>
- <script type="text/javascript">
- dojo.require("doh.runner");
-
- dojo.require("dijit.form.Button");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dijit.ProgressBar");
-
- dojo.addOnLoad(function(){
- var testW;
- doh.register("t",
- [
- {
- name: "dojoAttachPoint",
- runTest: function(t){
- var testW = dijit.byId("test1Widget");
- t.t(testW.normalNode);
- t.f(isNaN(testW.normalNode.nodeType));
- t.t(testW.buttonWidget instanceof dijit.form.Button);
- t.t(testW.checkboxWidget instanceof dijit.form.CheckBox);
- t.t(testW.progressBarWidget instanceof dijit.ProgressBar);
-// alert((testW.buttonWidget instanceof dijit.form.Button)+(testW.checkboxWidget instanceof dijit.form.CheckBox)+(testW.progressBarWidget instanceof dijit.ProgressBar)+
-// (testW.buttonWidget._counter==1)+(testW.checkboxWidget._counter==1)+(testW.progressBarWidget._counter==1));
- testW = dijit.byId("test2Widget");
- t.t(testW.containerNode);
- t.f(isNaN(testW.containerNode.nodeType));
- t.is(undefined,testW.buttonWidget);
- t.t(testW.checkboxWidget instanceof dijit.form.CheckBox);
- }
- },
- {
- name: "dojoAttachEvent",
- runTest: function(t){
- var testW = dijit.byId("test1Widget");
- testW.buttonWidget._counter=0;
- testW.buttonWidget.onClick(testW.buttonWidget);
- testW.checkboxWidget._counter=0;
- testW.checkboxWidget.onClick(testW.checkboxWidget);
- testW.progressBarWidget._counter=0;
- testW.progressBarWidget.onChange(testW.progressBarWidget);
- t.is(1,testW.buttonWidget._counter);
- t.is(1,testW.checkboxWidget._counter);
- t.is(1,testW.progressBarWidget._counter);
- }
- }
- ]
- );
- doh.run();
- });
- </script>
- <style type="text/css">
- @import "../themes/tundra/tundra.css";
- </style>
- </head>
- <body>
- <h1>testing widgetsInTemplate support</h1>
- <xmp id="Test1Template" style="display:none;">
- <div>
- <div dojoAttachPoint="normalNode" >normal node</div>
- <button dojoAttachPoint="buttonWidget" dojoAttachEvent="onClick:onClick" dojoType="dijit.form.Button">button #1</button>
- <div dojoAttachPoint="checkboxWidget" dojoAttachEvent="onClick:onClick" dojoType="dijit.form.CheckBox"></div> checkbox #1
- <div dojoAttachPoint="progressBarWidget" dojoAttachEvent="onChange:onClick" style="width:400px" annotate="true"
- maximum="200" progress="20" dojoType="dijit.ProgressBar"></div>
- </div>
- </xmp>
- <script>
- dojo.declare('Test1Widget',
- [dijit._Widget, dijit._Templated],
- {
- widgetsInTemplate: true,
- // isContainer: true,
-
- templateString: dojo.byId('Test1Template').textContent || dojo.byId('Test1Template').innerText,
- onClick: function(e){
- if(e.target){
- alert('onClick widgetId='+e.target.id);
- }else{
- if(e._counter == undefined){
- e._counter = 1;
- }else{
- e._counter++;
- }
- }
- }
- });
- </script>
- <!-- can use widget immediately in markup - no parsing occurs until document loaded and scripts run -->
- <div dojoType="Test1Widget" id="test1Widget" ></div>
-
-
- <xmp id="Test2Template" style="display:none;">
- <div>
- <div dojoAttachPoint="containerNode" ><div dojoAttachPoint="checkboxWidget" dojoType="dijit.form.CheckBox"></div> checkbox #2</div>
- </div>
- </xmp>
- <script>
- dojo.declare('Test2Widget',
- [dijit._Widget, dijit._Templated],
- {
- widgetsInTemplate: true,
-
- templateString: dojo.byId('Test2Template').textContent || dojo.byId('Test2Template').innerText
- });
- </script>
- <div dojoType="Test2Widget" id="test2Widget" ><button dojoAttachPoint="buttonWidget" dojoType="dijit.form.Button">button #2</button></div>
- </body>
-</html>
-