Commit bda83e7c authored by Ivan Tyagov's avatar Ivan Tyagov

Use require.js to script loading.

parent eb1dfb50
......@@ -34,35 +34,27 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode>\074!DOCTYPE html\076\n
\074html\076\n
<value> <unicode encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
\n
\074head\076\n
\074script src="jquery/core/jquery.js"\076\074/script\076\n
\074script src="jquery/plugin/renderjs/renderjs.js"\076\074/script\076\n
<head>\n
<script data-main="main" src="require.js"></script>\n
\n
\074/head\076\n
</head>\n
\n
\074body\076\n
<body>\n
\n
\074h1\076test\074/h1\076\n
<h1>test</h1>\n
\n
\074div id="content" gadget="test_gadgets/A"\076\074/div\076\n
<div id="content"\n
gadget="test_gadgets/A"></div>\n
\n
\074script type="text/javascript" language="javascript"\076\n
//\074![CDATA[\n
$(document).ready(function() {\n
RenderJs.bootstrap($("#content"));\n
GadgetIndex.getRootGadget().getDom().one("ready", function (){\n
RenderJs.update($("#content"));\n
});\n
});\n
//]]\076\n
\074/script\076\n
\n
\n
\074/body\076\n
\074/html\076</unicode> </value>
</body>\n
</html>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts36991431.45</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>main.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>require(["jquery/core/jquery.js", "jquery/plugin/renderjs/renderjs.js"], function(util) {\n
\n
$(document).ready(function() {\n
RenderJs.bootstrap($("#content"));\n
GadgetIndex.getRootGadget().getDom().one("ready", function (){\n
RenderJs.update($("#content"));\n
});\n
});\n
});</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>303</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -44,15 +44,16 @@
\n
\074script type="text/javascript" language="javascript"\076\n
//\074![CDATA[\n
$(document).ready(function() {\n
gadget = GadgetIndex.getGadgetById("B");\n
gadget.jsCall1 = function (){alert("B.jscall1");};\n
gadget.jsCall2 = function (){alert("B.jscall2");};\n
gadget.myOwnHtmlEvent1 = function (){\n
$("#hide").toggle();\n
alert("B.myOwnHtmlEvent1");\n
};\n
});\n
$(document).ready(function() {\n
gadget = GadgetIndex.getGadgetById("B");\n
gadget.jsCall1 = function (){alert("B.jscall1");};\n
gadget.jsCall2 = function (){alert("B.jscall2");};\n
gadget.myOwnHtmlEvent1 = function (){\n
$("#hide").toggle();\n
alert("B.myOwnHtmlEvent1");\n
};\n
});\n
\n
//]]\076\n
\074/script\076</unicode> </value>
</item>
......
4
\ No newline at end of file
5
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment