diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/dtl/demos/demo_Dijitless.html | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-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/dojox/dtl/demos/demo_Dijitless.html')
-rw-r--r-- | includes/js/dojox/dtl/demos/demo_Dijitless.html | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/includes/js/dojox/dtl/demos/demo_Dijitless.html b/includes/js/dojox/dtl/demos/demo_Dijitless.html deleted file mode 100644 index 2aaceaa..0000000 --- a/includes/js/dojox/dtl/demos/demo_Dijitless.html +++ /dev/null @@ -1,50 +0,0 @@ -<html> - <head> - <title>Demo using dojox.dtl._HtmlTemplated without Dijit</title> - <script type="text/javascript" src="../../../dojo/dojo.js" - djConfig="isDebug: true"></script> - <script type="text/javascript"> - dojo.require("dojox.dtl.html"); - dojo.require("dojox.dtl.render.html"); - dojo.require("dojox.dtl.Context"); - - dojo.addOnLoad(function(){ - var context = new dojox.dtl.Context({ - items: ["apple", "banana", "orange"] - }); - - var template = new dojox.dtl.HtmlTemplate("<ul><!--{% for item in items %}--><li><!--{{ item }}--></li><!--{% endfor %}--></ul>"); - // Render it plain - var node = template.render(context).getRootNode(); - dojo.body().appendChild(node); - - // Now show an example of how hard it is to manage stuff if the root node changes - var template2 = new dojox.dtl.HtmlTemplate("<!--{% ifequal items.length 3 %}--><ul><!--{% for item in items %}--><li><!--{{ item }}--></li><!--{% endfor %}--></ul>{% else %}<div>More than 3 items!</div>{% endifequal %}"); - // Render it plain - var node2 = template2.render(context).getRootNode(); - dojo.body().appendChild(node2); - - // Now show how the HTML Render object makes this easier - var renderer = new dojox.dtl.render.html.Render(dojo.byId("attach"), new dojox.dtl.HtmlTemplate("<!--{% ifequal items.length 3 %}--><ul><!--{% for item in items reversed %}--><li><!--{{ item }}--></li><!--{% endfor %}--></ul>{% else %}<div>More than 3 items!</div>{% endifequal %}")); - renderer.render(context); - - // Now re-render and break template2 - setTimeout(function(){ - context.items.push("guava"); - template.render(context); - template2.render(context); - renderer.render(context); - - // This is what has to be done to fix template2 - setTimeout(function(){ - var frag = template2.render(context).getRootNode(); - node2.parentNode.replaceChild(frag, node2); - }, 3000); - }, 3000); - }); - </script> - </head> - <body> - <div id="attach"></div> - </body> -</html> |