Commit eb1dfb50 authored by Ivan Tyagov's avatar Ivan Tyagov

Moved to RenderJs.

parent 92075997
......@@ -40,7 +40,6 @@
\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
\074script src="interactor.js"\076\074/script\076\n
\n
\074/head\076\n
\n
......
<?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>ts36565830.87</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>interactor.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 encoding="cdata"><![CDATA[
// Basic gadget interaction library\n
var InteractionGadget = {\n
\n
bind: function (dom){\n
/*\n
* Bind event between gadgets.\n
*/\n
dom.find("connect").each(function (key, value){\n
source = $(value).attr("source").split(".");\n
source_gadget_id = source[0];\n
source_method_id = source[1];\n
source_gadget = GadgetIndex.getGadgetById(source_gadget_id);\n
\n
destination = $(value).attr("destination").split(".");\n
destination_gadget_id = destination[0];\n
destination_method_id = destination[1];\n
destination_gadget = GadgetIndex.getGadgetById(destination_gadget_id);\n
\n
if (source_gadget.hasOwnProperty(source_method_id)){\n
// direct javascript use case\n
func_body = \'GadgetIndex.getGadgetById("\' + source_gadget_id + \'")["original_\' + source_method_id + \'"]();\';\n
func_body = func_body + \'\\nGadgetIndex.getGadgetById("\' + destination_gadget_id + \'")["\' + destination_method_id + \'"]();\';\n
func = new Function(func_body);\n
source_gadget["original_" + source_method_id] = source_gadget[source_method_id];\n
source_gadget[source_method_id] = func;\n
}\n
else{\n
// this is a custom event attached to HTML gadget representation\n
func_body = \'GadgetIndex.getGadgetById("\' + destination_gadget_id + \'")["\' + destination_method_id + \'"]();\';\n
func = new Function(func_body);\n
source_gadget.dom.bind(source_method_id, func);\n
}\n
console.log(source_gadget_id, \'.\', source_method_id, \'-->\', destination_gadget_id, \'.\', destination_method_id);\n
}\n
);\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>1590</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
3
\ No newline at end of file
4
\ 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