Commit b6574626 authored by Xiaowu Zhang's avatar Xiaowu Zhang

Reimplementation of Formulator ERP5 GadgetField

The new implementation of GadgetField allow to integrate renderjs's
gadget into ERP5 ui. Some examples are in bt erp5_ui_test to validate
implementation.
parent 65ae7d9f
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_gadget_field</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>5.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Field</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Foo_viewGadgetField</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_field_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Testing Gadget Fields</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Gadget Field</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Gadget Field</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_file\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_file\']</td>\n
<td>test</td>\n
</tr>\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyPortalStatusMessage</td>\n
<td>Data updated.</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField/getData</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyBodyText</td>\n
<td>test</td>\n
<td></td>\n
</tr>\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testBlobSave</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -36,11 +36,101 @@
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<div>\n
<div id="activity_watcher_gadget"></div>\n
<script src="jquery/core/jquery.js"></script>\n
<script src="activity-watcher-gadget.js"></script>\n
</div>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Gadget Field</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Gadget Field</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<!-- Initialize -->\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_subject\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_subject\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
\n
<tr>\n
<td>click</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>pause</td>\n
<td>2000</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyBodyText</td>\n
<td>"Error: URL is not a dataURL"</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </value>
</item>
......@@ -54,7 +144,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityWatcherGadget_view</string> </value>
<value> <string>testNotDataURLException</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Gadget Field</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Gadget Field</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_language\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_language\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyPortalStatusMessage</td>\n
<td>Data updated.</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_language\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'my_language\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testNotEditable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Gadget Field</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Gadget Field</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_description\']</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_description\']</td>\n
<td>123</td>\n
</tr>\n
\n
\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyPortalStatusMessage</td>\n
<td>Data updated.</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_description\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'my_description\']</td>\n
<td>123</td>\n
</tr>\n
\n
\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSaveAndLoad</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Gadget Field</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Gadget Field</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/ListBoxZuite_reset</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Reset Successfully.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewGadgetField</td>\n
<td></td>\n
</tr>\n
\n
\n
\n
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_right\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_format\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_right\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'my_format\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyPortalStatusMessage</td>\n
<td>Data updated.</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_right\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'my_format\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'my_right\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'my_format\']</td>\n
<td></td>\n
</tr>\n
\n
</tbody></table>\n
</body>\n
</html>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSaveAndNotEditableInIFrame</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -51,12 +51,36 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>File</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string>multipart/form-data</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_right</string>
<string>my_format</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_id</string>
<string>my_title</string>
<string>my_description</string>
<string>my_language</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_file</string>
<string>my_subject</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Foo_viewGadgetField</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Foo_viewGadgetField</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Foo_viewGadgetField</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_description</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_stringfield.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_file</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_file</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_create_manual_dataurl.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_format</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string>iframe</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_format</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_stringfield.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_id</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>id</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_language</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_language</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_stringfield.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_right</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string>iframe</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_right</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_stringfield.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_subject</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_subject</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_create_manual_generalurl.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16492962.91</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_create_manual_dataurl.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
<!-- renderjs -->\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<!-- custom script -->\n
<script src="gadget_create_manual_dataurl.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<input type=\'text\'/>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>498</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16394141.44</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_create_manual_dataurl.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>/*global window, rJS, btoa*/\n
/*jslint nomen: true, maxlen:80, indent:2*/\n
(function (rJS) {\n
"use strict";\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
})\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
});\n
})\n
.declareMethod(\'render\', function (options) {\n
var gadget = this;\n
gadget.props.key = options.key || "";\n
gadget.props.element.querySelector(\'input\').value = options.value;\n
gadget.props.element.querySelector(\'input\').title = options.key;\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
var input = this.props.element.querySelector(\'input\'),\n
form_gadget = this,\n
result = {};\n
if (input.value) {\n
result[form_gadget.props.key] = {\'url\': "data:text/plain;base64,"\n
+ btoa(input.value),\n
\'type\': \'text/plain\',\n
\'file_name\': \'test.txt\'};\n
}\n
return result;\n
});\n
\n
}(rJS));</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1093</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16492973.44</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_create_manual_generalurl.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
\n
\n
<!-- renderjs -->\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<!-- custom script -->\n
<script src="gadget_create_manual_generalurl.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<input type=\'text\'/>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>505</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16394133.05</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_create_manual_generalurl.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>/*global window, rJS, console, RSVP */\n
/*jslint nomen: true, maxlen:80, indent:2*/\n
(function (rJS) {\n
"use strict";\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
})\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
});\n
})\n
.declareMethod(\'render\', function (options) {\n
var gadget = this;\n
gadget.props.key = options.key || "";\n
gadget.props.element.querySelector(\'input\').value = options.value || "";\n
gadget.props.element.querySelector(\'input\').title = options.key;\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
var input = this.props.element.querySelector(\'input\'),\n
form_gadget = this,\n
result = {};\n
if (input.value) {\n
result[form_gadget.props.key] = {\'url\': input.value,\n
\'type\': \'text/html\',\n
\'file_name\': \'test.txt\'};\n
}\n
return result;\n
});\n
\n
}(rJS));</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1028</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16492914.94</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_stringfield.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
<title>ERP5 Stringfield</title>\n
\n
<!-- renderjs -->\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<!-- custom script -->\n
<script src="gadget_stringfield.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<input type=\'text\'/>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>525</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16406199.62</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_stringfield.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>/*global window, rJS*/\n
/*jslint nomen: true, maxlen:80, indent:2*/\n
(function (rJS) {\n
"use strict";\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
})\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
});\n
})\n
.declareMethod(\'render\', function (options) {\n
this.props.key = options.key || "";\n
this.props.element.querySelector(\'input\').value = options.value || "";\n
this.props.element.querySelector(\'input\').title = options.key;\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
var input = this.props.element.querySelector(\'input\'),\n
form_gadget = this,\n
result = {};\n
result[form_gadget.props.key] = input.value;\n
return result;\n
});\n
\n
}(rJS));</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>806</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -57,31 +57,15 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_cache_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_cached</string> </key>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_connection</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_html</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_property</string> </key>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -132,31 +116,17 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_cache_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_cached</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_connection</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_html</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_id</string> </key>
<value> <string></string> </value>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>gadget_property</string> </key>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -230,10 +200,18 @@
<key> <string>gadget_property</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Watcher</string> </value>
......@@ -244,4 +222,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_activity_watcher.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>activity-watcher-gadget.js</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*\n
This script generate a lot of html tags inside a div.\n
It would be better to use templates (like mustache)\n
*/\n
(function () {\n
var interval = 1000,\n
div = \'#activity_watcher_gadget\',\n
html_content = \'\',\n
basedir = location.pathname.split(\'/\').slice(0,-1).join(\'/\') + \'/\',\n
fillMessageList = function (data,messagetype,string) {\n
if (data[string] && data[string].line_list) {\n
for (i = 0; i < data[string].line_list.length; i++) {\n
var key_list = [\'message\',\'method_id\',\'node\',\'min_pri\',\'max_pri\'], j;\n
html_content +=\n
\'<tr>\' +\n
\'<td>\' + messagetype + \'</td>\';\n
for (j = 0; j < key_list.length; j++) {\n
html_content +=\n
\'<td>\' + data[string].line_list[i][key_list[j]] + \'</td>\';\n
}\n
html_content +=\n
\'</tr>\';\n
}\n
}\n
},\n
fillMessagePri = function (data,messagetype,string) {\n
if (data[string] && data[string].line_list) {\n
for (i = 0; i < data[string].line_list.length; i++) {\n
var key_list = [\'min\',\'avg\',\'max\'], j;\n
html_content +=\n
\'<tr>\' +\n
\'<td>\' + messagetype + \'</td>\' +\n
\'<td>\' + data[string].line_list[i].pri + \'</td>\';\n
for (j = 0; j < key_list.length; j++) {\n
html_content +=\n
\'<td>\' + data[string].line_list[i][key_list[j]] + \'</td>\';\n
}\n
html_content +=\n
\'</tr>\';\n
}\n
}\n
},\n
watcher = function () {\n
$.ajax({\n
url: basedir + \'ActivityTool_getSqlStatisticList\',\n
type: \'POST\',\n
timeout: 10000,\n
success: function (response) {\n
var i, data, today = new Date();\n
data = JSON.parse(response);\n
html_content =\n
\'Date : \' + today.toTimeString() +\n
\'<table>\' +\n
\' <tr>\' +\n
\' <th>Type</th>\'+\n
\' <th>Message</th>\'+\n
\' <th>Method Id</th>\'+\n
\' <th>Processing Node</th>\'+\n
\' <th>Min pri</th>\'+\n
\' <th>Max pri</th>\' +\n
\' </tr>\';\n
fillMessageList (data,\'dict\',\'SQLDict\');\n
fillMessageList (data,\'queue\',\'SQLQueue\');\n
html_content +=\n
\' </table>\' +\n
\'<table>\'+\n
\' <tr>\'+\n
\' <th>Type</th>\'+\n
\' <th>Pri</th>\'+\n
\' <th>Min</th>\'+\n
\' <th>Avg</th>\'+\n
\' <th>Max</th>\'+\n
\' </tr>\';\n
fillMessagePri (data,\'dict\',\'SQLDict2\');\n
fillMessagePri (data,\'queue\',\'SQLQueue2\');\n
html_content +=\n
\' </table>\';\n
$(div).html(html_content);\n
setTimeout(watcher,interval);\n
},\n
error: function (type) {\n
if (!html_content) {\n
$(div).html(\'ERROR \' + type.status + \': \' + type.statusText);\n
} else {\n
$(div).html(\'ERROR \' + type.status + \': \' + type.statusText +\n
\'<br />\' + html_content);\n
}\n
if (type.status < 400) {\n
setTimeout(watcher,interval);\n
}\n
}\n
});\n
};\n
watcher();\n
}());\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16502968.34</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_activity_watcher.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
<script src="handlebars.js" type="text/javascript"></script>\n
<script id="getData" type="text/x-handlebars-template">\n
Date : {{time}} \n
<table>\n
<tr>\n
<th>Type</th>\n
<th>Message</th>\n
<th>Method Id</th>\n
<th>Processing Node</th>\n
<th>Min pri</th>\n
<th>Max pri</th>\n
</tr>\n
{{#each messageList1}}\n
<tr> \n
<td>{{this.messagetype}} </td>\n
<td>{{this.message}}</td>\n
<td>{{this.method_id}}</td>\n
<td>{{this.node}}</td>\n
<td>{{this.min_pri}}</td>\n
<td>{{this.max_pri}}</td>\n
</tr> \n
{{/each}}\n
{{#each messageList2}}\n
<tr> \n
<td>{{this.messagetype}} </td>\n
<td>{{this.message}}</td>\n
<td>{{this.method_id}}</td>\n
<td>{{this.node}}</td>\n
<td>{{this.min_pri}}</td>\n
<td>{{this.max_pri}}</td>\n
</tr> \n
{{/each}}\n
</table>\n
<table>\n
<tr>\n
<th>Type</th>\n
<th>Pri</th>\n
<th>Min</th>\n
<th>Avg</th>\n
<th>Max</th>\n
</tr>\n
{{#each messagePri1}}\n
<tr> \n
<td>{{this.messagetype}} </td>\n
<td>{{this.pri}}</td>\n
<td>{{this.min}}</td>\n
<td>{{this.avg}}</td>\n
<td>{{this.max}}</td>\n
</tr> \n
{{/each}}\n
{{#each messagePri2}}\n
<tr> \n
<td>{{this.messagetype}} </td>\n
<td>{{this.pri}}</td>\n
<td>{{this.min}}</td>\n
<td>{{this.avg}}</td>\n
<td>{{this.max}}</td>\n
</tr> \n
{{/each}}\n
</table>\n
</script> \n
\n
\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="jio_sha256.amd.js" type="text/javascript"></script>\n
<script src="jio.js" type="text/javascript"></script>\n
<script src="gadget_activity_watcher.js" type="text/javascript"></script>\n
\n
</head>\n
\n
<body>\n
<div class="activity_watcher_gadget"></div>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2109</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16394919.58</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_activity_watcher.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[
/*global window, rJS, RSVP, Handlebars, jIO, location */\n
/*jslint nomen: true, maxlen:80, indent:2*/\n
(function (rJS, jIO, Handlebars, RSVP, window) {\n
"use strict";\n
var gk = rJS(window),\n
data_source = gk.__template_element.getElementById(\'getData\').innerHTML,\n
get_data_template = Handlebars.compile(data_source);\n
\n
function putMessageType(data, messagetype, string) {\n
var i;\n
if (data[string] && data[string].line_list) {\n
for (i = 0; i < data[string].line_list.length; i += 1) {\n
data[string].line_list[i].messagetype = messagetype;\n
}\n
return data[string].line_list;\n
}\n
return \'\';\n
}\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
})\n
.ready(function (g) {\n
return g.getElement().push(function (element) {\n
g.props.element = element;\n
});\n
})\n
.declareService(function () {\n
var form_gadget = this,\n
html_content,\n
basedir = location.pathname.split(\'/\').slice(0, -1).join(\'/\') + \'/\',\n
queue = new RSVP.Queue();\n
function getDataExamine() {\n
queue\n
.push(function () {\n
return jIO.util.ajax(\n
{\n
"type": "POST",\n
"url": basedir + \'ActivityTool_getSqlStatisticList\',\n
"xhrFields": {\n
withCredentials: true\n
}\n
}\n
);\n
})\n
.push(function (evt) {\n
var data = JSON.parse(evt.target.response);\n
html_content = get_data_template(\n
{\n
time: new Date().toTimeString(),\n
messageList1: putMessageType(data, \'dict\', \'SQLDict\'),\n
messageList2: putMessageType(data, \'queue\', \'SQLQueue\'),\n
messagePri1 : putMessageType(data, \'dict\', \'SQLDict2\'),\n
messagePri2 : putMessageType(data, \'queue\', \'SQLQueue2\')\n
}\n
);\n
\n
form_gadget.props.element.querySelector(".activity_watcher_gadget")\n
.innerHTML = html_content;\n
return RSVP.delay(1000);\n
})\n
.push(function () {\n
return getDataExamine();\n
});\n
}\n
return queue.push(function () {\n
return getDataExamine();\n
});\n
});\n
}(rJS, jIO, Handlebars, RSVP, window));
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2318</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?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>ts16413519.07</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>erp5_gadgetfield.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[
/*global window, rJS, RSVP, Blob, Uint8Array, document, FormData, jIO */\n
/*jslint nomen: true, maxlen:80, indent:2*/\n
(function (window, rJS, RSVP) {\n
"use strict";\n
function convertDataURL2Blob(url, type) {\n
var binary,\n
array = [],\n
i;\n
url = url.split(\',\')[1];\n
if (url !== undefined) {\n
binary = window.atob(url);\n
for (i = 0; i < binary.length; i += 1) {\n
array.push(binary.charCodeAt(i));\n
}\n
return new Blob([new Uint8Array(array)], {type: type});\n
}\n
throw "Error: URL is not a dataURL";\n
}\n
\n
function promiseEventListener(target, type, useCapture) {\n
//////////////////////////\n
// Resolve the promise as soon as the event is triggered\n
// eventListener is removed when promise is cancelled/resolved/rejected\n
//////////////////////////\n
var handle_event_callback;\n
\n
function canceller() {\n
target.removeEventListener(type, handle_event_callback, useCapture);\n
}\n
\n
function resolver(resolve) {\n
handle_event_callback = function (evt) {\n
canceller();\n
evt.stopPropagation();\n
evt.preventDefault();\n
resolve(evt);\n
return false;\n
};\n
\n
target.addEventListener(type, handle_event_callback, useCapture);\n
}\n
return new RSVP.Promise(resolver, canceller);\n
}\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
// Init local properties\n
.ready(function (g) {\n
g.props = {};\n
})\n
\n
// Assign the element to a variable\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
});\n
})\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareService(function () {\n
var g = this,\n
i,\n
formdata,\n
list_gadget = document.getElementsByClassName("gadget"),\n
all_gadget,\n
list = [],\n
gadget_attributes = [],\n
scope,\n
tmp;\n
for (i = 0; i < list_gadget.length; i += 1) {\n
scope = list_gadget[i].getAttribute("data-gadget-scope");\n
if (scope !== undefined) {\n
tmp = {};\n
list.push(g.getDeclaredGadget(scope));\n
tmp.sandbox = list_gadget[i].getAttribute("data-gadget-sandbox");\n
tmp.key = scope;\n
tmp.editable = list_gadget[i].getAttribute("editable");\n
tmp.value = list_gadget[i].getAttribute("value");\n
gadget_attributes.push(tmp);\n
}\n
}\n
return new RSVP.Queue()\n
.push(function () {\n
return RSVP.all(list);\n
})\n
.push(function (results) {\n
all_gadget = results;\n
list = [];\n
for (i = 0; i < gadget_attributes.length; i += 1) {\n
if (gadget_attributes[i].sandbox === "iframe") {\n
list.push(all_gadget[i].getElement());\n
}\n
}\n
return RSVP.all(list);\n
})\n
.push(function (elements) {\n
var iframe,\n
j;\n
list = [];\n
for (i = 0, j = 0; i < gadget_attributes.length; i += 1) {\n
if (all_gadget[i].render !== undefined) {\n
list.push(\n
all_gadget[i].render(\n
{\n
"key": gadget_attributes[i].key,\n
"value": gadget_attributes[i].value\n
}\n
)\n
);\n
}\n
if (gadget_attributes[i].sandbox === "iframe") {\n
iframe = elements[j].querySelector(\'iframe\');\n
//xxx input field\n
elements[j].parentNode.style.width = "100%";\n
elements[j].parentNode.style.height = "100%";\n
//xxx section div\n
elements[j].style.width = "100%";\n
elements[j].style.height = "100%";\n
iframe.style.width = "100%";\n
iframe.style.height = "100%";\n
j += 1;\n
}\n
}\n
return RSVP.all(list);\n
})\n
.push(function () {\n
return promiseEventListener(g.props.element,\n
\'submit\', false);\n
})\n
.push(function (evt) {\n
list = [];\n
formdata = new FormData(evt.target);\n
for (i = 0; i < all_gadget.length; i += 1) {\n
if (all_gadget[i].getContent !== undefined &&\n
gadget_attributes[i].editable !== null) {\n
list.push(all_gadget[i].getContent());\n
}\n
}\n
return RSVP.all(list);\n
})\n
.push(function (all_content) {\n
var key,\n
form,\n
arg,\n
result;\n
for (i = 0; i < all_content.length; i += 1) {\n
for (key in all_content[i]) {\n
if (all_content[i].hasOwnProperty(key)) {\n
if (typeof all_content[i][key] === "object") {\n
arg = all_content[i][key];\n
result = convertDataURL2Blob(arg.url, arg.type);\n
formdata.append(key, result, arg.file_name);\n
} else {\n
formdata.append(key, all_content[i][key]);\n
}\n
}\n
}\n
}\n
form = g.props.element.querySelector(\'form\');\n
return jIO.util.ajax(\n
{\n
"type": form.getAttribute("method"),\n
"url": form.getAttribute("action"),\n
"data": formdata,\n
"xhrFields":\n
{\n
withCredentials: true\n
}\n
}\n
);\n
})\n
.push(function (evt) {\n
//XXX WORK ONLY IN ERP5!!!!!\n
//In erp5, after form submit, a new page is redirected automatically\n
//so get the new url, it should use getResponseHeader(\'Location\')\n
//But since the response code is 302, we have no way to get new url\n
//with getResponseHeader, that\'s why in this cas, we use responseURL \n
//It only works in erp5. \n
return window.location.replace(evt.target.responseURL);\n
});\n
});\n
}(window, rJS, RSVP));
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6233</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?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>ts16413671.77</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>jio_sha256.amd.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[
(function (dependencies, module) {\n
if (typeof define === \'function\' && define.amd) {\n
return define(dependencies, module);\n
}\n
if (typeof exports === \'object\') {\n
return module(exports);\n
}\n
module(window);\n
}([\'exports\'], function (window) {\n
/* A JavaScript implementation of the Secure Hash Algorithm, SHA-256\n
* Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/\n
* Distributed under the BSD License\n
* Some bits taken from Paul Johnston\'s SHA-1 implementation\n
*/\n
(function () {\n
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */\n
function safe_add (x, y) {\n
var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n
return (msw << 16) | (lsw & 0xFFFF);\n
}\n
function S (X, n) {return ( X >>> n ) | (X << (32 - n));}\n
function R (X, n) {return ( X >>> n );}\n
function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));}\n
function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));}\n
function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));}\n
function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));}\n
function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));}\n
function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));}\n
function newArray (n) {\n
var a = [];\n
for (;n>0;n--) {\n
a.push(undefined);\n
}\n
return a;\n
}\n
function core_sha256 (m, l) {\n
var K = [0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,0x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,0x81C2C92E,0x92722C85,0xA2BFE8A1,0xA81A664B,0xC24B8B70,0xC76C51A3,0xD192E819,0xD6990624,0xF40E3585,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,0x682E6FF3,0x748F82EE,0x78A5636F,0x84C87814,0x8CC70208,0x90BEFFFA,0xA4506CEB,0xBEF9A3F7,0xC67178F2];\n
var HASH = [0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19];\n
var W = newArray(64);\n
var a, b, c, d, e, f, g, h, i, j;\n
var T1, T2;\n
/* append padding */\n
m[l >> 5] |= 0x80 << (24 - l % 32);\n
m[((l + 64 >> 9) << 4) + 15] = l;\n
for ( var i = 0; i<m.length; i+=16 ) {\n
a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3];\n
e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];\n
for ( var j = 0; j<64; j++) {\n
if (j < 16) {\n
W[j] = m[j + i];\n
} else {\n
W[j] = safe_add(safe_add(safe_add(Gamma1256(\n
W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n
}\n
T1 = safe_add(safe_add(safe_add(\n
safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n
T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n
h = g; g = f; f = e; e = safe_add(d, T1);\n
d = c; c = b; b = a; a = safe_add(T1, T2);\n
}\n
HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]);\n
HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]);\n
HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]);\n
HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);\n
}\n
return HASH;\n
}\n
function str2binb (str) {\n
var bin = Array();\n
var mask = (1 << chrsz) - 1;\n
for(var i = 0; i < str.length * chrsz; i += chrsz)\n
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);\n
return bin;\n
}\n
function binb2hex (binarray) {\n
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\n
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";\n
var str = "";\n
for (var i = 0; i < binarray.length * 4; i++) {\n
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n
}\n
return str;\n
}\n
function hex_sha256(s){\n
return binb2hex(core_sha256(str2binb(s),s.length * chrsz));\n
}\n
window.hex_sha256 = hex_sha256;\n
}());\n
}));
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4494</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16495763.71</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>renderjs.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>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>74799</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Pdata" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*\n
* js_channel is a very lightweight abstraction on top of\n
* postMessage which defines message formats and semantics\n
* to support interactions more rich than just message passing\n
* js_channel supports:\n
* + query/response - traditional rpc\n
* + query/update/response - incremental async return of results\n
* to a query\n
* + notifications - fire and forget\n
* + error handling\n
*\n
* js_channel is based heavily on json-rpc, but is focused at the\n
* problem of inter-iframe RPC.\n
*\n
* Message types:\n
* There are 5 types of messages that can flow over this channel,\n
* and you may determine what type of message an object is by\n
* examining its parameters:\n
* 1. Requests\n
* + integer id\n
* + string method\n
* + (optional) any params\n
* 2. Callback Invocations (or just "Callbacks")\n
* + integer id\n
* + string callback\n
* + (optional) params\n
* 3. Error Responses (or just "Errors)\n
* + integer id\n
* + string error\n
* + (optional) string message\n
* 4. Responses\n
* + integer id\n
* + (optional) any result\n
* 5. Notifications\n
* + string method\n
* + (optional) any params\n
*/\n
\n
;var Channel = (function() {\n
"use strict";\n
\n
// current transaction id, start out at a random *odd* number between 1 and a million\n
// There is one current transaction counter id per page, and it\'s shared between\n
// channel instances. That means of all messages posted from a single javascript\n
// evaluation context, we\'ll never have two with the same id.\n
var s_curTranId = Math.floor(Math.random()*1000001);\n
\n
// no two bound channels in the same javascript evaluation context may have the same origin, scope, and window.\n
// futher if two bound channels have the same window and scope, they may not have *overlapping* origins\n
// (either one or both support \'*\'). This restriction allows a single onMessage handler to efficiently\n
// route messages based on origin and scope. The s_boundChans maps origins to scopes, to message\n
// handlers. Request and Notification messages are routed using this table.\n
// Finally, channels are inserted into this table when built, and removed when destroyed.\n
var s_boundChans = { };\n
\n
// add a channel to s_boundChans, throwing if a dup exists\n
function s_addBoundChan(win, origin, scope, handler) {\n
function hasWin(arr) {\n
for (var i = 0; i < arr.length; i++) if (arr[i].win === win) return true;\n
return false;\n
}\n
\n
// does she exist?\n
var exists = false;\n
\n
\n
if (origin === \'*\') {\n
// we must check all other origins, sadly.\n
for (var k in s_boundChans) {\n
if (!s_boundChans.hasOwnProperty(k)) continue;\n
if (k === \'*\') continue;\n
if (typeof s_boundChans[k][scope] === \'object\') {\n
exists = hasWin(s_boundChans[k][scope]);\n
if (exists) break;\n
}\n
}\n
} else {\n
// we must check only \'*\'\n
if ((s_boundChans[\'*\'] && s_boundChans[\'*\'][scope])) {\n
exists = hasWin(s_boundChans[\'*\'][scope]);\n
}\n
if (!exists && s_boundChans[origin] && s_boundChans[origin][scope])\n
{\n
exists = hasWin(s_boundChans[origin][scope]);\n
}\n
}\n
if (exists) throw "A channel is already bound to the same window which overlaps with origin \'"+ origin +"\' and has scope \'"+scope+"\'";\n
\n
if (typeof s_boundChans[origin] != \'object\') s_boundChans[origin] = { };\n
if (typeof s_boundChans[origin][scope] != \'object\') s_boundChans[origin][scope] = [ ];\n
s_boundChans[origin][scope].push({win: win, handler: handler});\n
}\n
\n
function s_removeBoundChan(win, origin, scope) {\n
var arr = s_boundChans[origin][scope];\n
for (var i = 0; i < arr.length; i++) {\n
if (arr[i].win === win) {\n
arr.splice(i,1);\n
}\n
}\n
if (s_boundChans[origin][scope].length === 0) {\n
delete s_boundChans[origin][scope];\n
}\n
}\n
\n
function s_isArray(obj) {\n
if (Array.isArray) return Array.isArray(obj);\n
else {\n
return (obj.constructor.toString().indexOf("Array") != -1);\n
}\n
}\n
\n
// No two outstanding outbound messages may have the same id, period. Given that, a single table\n
// mapping "transaction ids" to message handlers, allows efficient routing of Callback, Error, and\n
// Response messages. Entries are added to this table when requests are sent, and removed when\n
// responses are received.\n
var s_transIds = { };\n
\n
// class singleton onMessage handler\n
// this function is registered once and all incoming messages route through here. This\n
// arrangement allows certain efficiencies, message data is only parsed once and dispatch\n
// is more efficient, especially for large numbers of simultaneous channels.\n
var s_onMessage = function(e) {\n
try {\n
var m = JSON.parse(e.data);\n
if (typeof m !== \'object\' || m === null) throw "malformed";\n
} catch(e) {\n
// just ignore any posted messages that do not consist of valid JSON\n
return;\n
}\n
\n
var w = e.source;\n
var o = e.origin;\n
var s, i, meth;\n
\n
if (typeof m.method === \'string\') {\n
var ar = m.method.split(\'::\');\n
if (ar.length == 2) {\n
s = ar[0];\n
meth = ar[1];\n
} else {\n
meth = m.method;\n
}\n
}\n
\n
if (typeof m.id !== \'undefined\') i = m.id;\n
\n
// w is message source window\n
// o is message origin\n
// m is parsed message\n
// s is message scope\n
// i is message id (or undefined)\n
// meth is unscoped method name\n
// ^^ based on these factors we can route the message\n
\n
// if it has a method it\'s either a notification or a request,\n
// route using s_boundChans\n
if (typeof meth === \'string\') {\n
var delivered = false;\n
if (s_boundChans[o] && s_boundChans[o][s]) {\n
for (var j = 0; j < s_boundChans[o][s].length; j++) {\n
if (s_boundChans[o][s][j].win === w) {\n
s_boundChans[o][s][j].handler(o, meth, m);\n
delivered = true;\n
break;\n
}\n
}\n
}\n
\n
if (!delivered && s_boundChans[\'*\'] && s_boundChans[\'*\'][s]) {\n
for (var j = 0; j < s_boundChans[\'*\'][s].length; j++) {\n
if (s_boundChans[\'*\'][s][j].win === w) {\n
s_boundChans[\'*\'][s][j].handler(o, meth, m);\n
break;\n
}\n
}\n
}\n
}\n
// otherwise it must have an id (or be poorly formed\n
else if (typeof i != \'undefined\') {\n
if (s_transIds[i]) s_transIds[i](o, meth, m);\n
}\n
};\n
\n
// Setup postMessage event listeners\n
if (window.addEventListener) window.addEventListener(\'message\', s_onMessage, false);\n
else if(window.attachEvent) window.attachEvent(\'onmessage\', s_onMessage);\n
\n
/* a messaging channel is constructed from a window and an origin.\n
* the channel will assert that all messages received over the\n
* channel match the origin\n
*\n
* Arguments to Channel.build(cfg):\n
*\n
* cfg.window - the remote window with which we\'ll communicate\n
* cfg.origin - the expected origin of the remote window, may be \'*\'\n
* which matches any origin\n
* cfg.scope - the \'scope\' of messages. a scope string that is\n
* prepended to message names. local and remote endpoints\n
* of a single channel must agree upon scope. Scope may\n
* not contain double colons (\'::\').\n
* cfg.debugOutput - A boolean value. If true and window.console.log is\n
* a function, then debug strings will be emitted to that\n
* function.\n
* cfg.debugOutput - A boolean value. If true and window.console.log is\n
* a function, then debug strings will be emitted to that\n
* function.\n
* cfg.postMessageObserver - A function that will be passed two arguments,\n
* an origin and a message. It will be passed these immediately\n
* before messages are posted.\n
* cfg.gotMessageObserver - A function that will be passed two arguments,\n
* an origin and a message. It will be passed these arguments\n
* immediately after they pass scope and origin checks, but before\n
* they are processed.\n
* cfg.onReady - A function that will be invoked when a channel becomes "ready",\n
* this occurs once both sides of the channel have been\n
* instantiated and an application level handshake is exchanged.\n
* the onReady function will be passed a single argument which is\n
* the channel object that was returned from build().\n
*/\n
return {\n
build: function(cfg) {\n
var debug = function(m) {\n
if (cfg.debugOutput && window.console && window.console.log) {\n
// try to stringify, if it doesn\'t work we\'ll let javascript\'s built in toString do its magic\n
try { if (typeof m !== \'string\') m = JSON.stringify(m); } catch(e) { }\n
console.log("["+chanId+"] " + m);\n
}\n
};\n
\n
/* browser capabilities check */\n
if (!window.postMessage) throw("jschannel cannot run this browser, no postMessage");\n
if (!window.JSON || !window.JSON.stringify || ! window.JSON.parse) {\n
throw("jschannel cannot run this browser, no JSON parsing/serialization");\n
}\n
\n
/* basic argument validation */\n
if (typeof cfg != \'object\') throw("Channel build invoked without a proper object argument");\n
\n
if (!cfg.window || !cfg.window.postMessage) throw("Channel.build() called without a valid window argument");\n
\n
/* we\'d have to do a little more work to be able to run multiple channels that intercommunicate the same\n
* window... Not sure if we care to support that */\n
if (window === cfg.window) throw("target window is same as present window -- not allowed");\n
\n
// let\'s require that the client specify an origin. if we just assume \'*\' we\'ll be\n
// propagating unsafe practices. that would be lame.\n
var validOrigin = false;\n
if (typeof cfg.origin === \'string\') {\n
var oMatch;\n
if (cfg.origin === "*") validOrigin = true;\n
// allow valid domains under http and https. Also, trim paths off otherwise valid origins.\n
else if (null !== (oMatch = cfg.origin.match(/^https?:\\/\\/(?:[-a-zA-Z0-9_\\.])+(?::\\d+)?/))) {\n
cfg.origin = oMatch[0].toLowerCase();\n
validOrigin = true;\n
}\n
}\n
\n
if (!validOrigin) throw ("Channel.build() called with an invalid origin");\n
\n
if (typeof cfg.scope !== \'undefined\') {\n
if (typeof cfg.scope !== \'string\') throw \'scope, when specified, must be a string\';\n
if (cfg.scope.split(\'::\').length > 1) throw "scope may not contain double colons: \'::\'";\n
}\n
\n
/* private variables */\n
// generate a random and psuedo unique id for this channel\n
var chanId = (function () {\n
var text = "";\n
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";\n
for(var i=0; i < 5; i++) text += alpha.charAt(Math.floor(Math.random() * alpha.length));\n
return text;\n
})();\n
\n
// registrations: mapping method names to call objects\n
var regTbl = { };\n
// current oustanding sent requests\n
var outTbl = { };\n
// current oustanding received requests\n
var inTbl = { };\n
// are we ready yet? when false we will block outbound messages.\n
var ready = false;\n
var pendingQueue = [ ];\n
\n
var createTransaction = function(id,origin,callbacks) {\n
var shouldDelayReturn = false;\n
var completed = false;\n
\n
return {\n
origin: origin,\n
invoke: function(cbName, v) {\n
// verify in table\n
if (!inTbl[id]) throw "attempting to invoke a callback of a nonexistent transaction: " + id;\n
// verify that the callback name is valid\n
var valid = false;\n
for (var i = 0; i < callbacks.length; i++) if (cbName === callbacks[i]) { valid = true; break; }\n
if (!valid) throw "request supports no such callback \'" + cbName + "\'";\n
\n
// send callback invocation\n
postMessage({ id: id, callback: cbName, params: v});\n
},\n
error: function(error, message) {\n
completed = true;\n
// verify in table\n
if (!inTbl[id]) throw "error called for nonexistent message: " + id;\n
\n
// remove transaction from table\n
delete inTbl[id];\n
\n
// send error\n
postMessage({ id: id, error: error, message: message });\n
},\n
complete: function(v) {\n
completed = true;\n
// verify in table\n
if (!inTbl[id]) throw "complete called for nonexistent message: " + id;\n
// remove transaction from table\n
delete inTbl[id];\n
// send complete\n
postMessage({ id: id, result: v });\n
},\n
delayReturn: function(delay) {\n
if (typeof delay === \'boolean\') {\n
shouldDelayReturn = (delay === true);\n
}\n
return shouldDelayReturn;\n
},\n
completed: function() {\n
return completed;\n
}\n
};\n
};\n
\n
var setTransactionTimeout = function(transId, timeout, method) {\n
return window.setTimeout(function() {\n
if (outTbl[transId]) {\n
// XXX: what if client code raises an exception here?\n
var msg = "timeout (" + timeout + "ms) exceeded on method \'" + method + "\'";\n
(1,outTbl[transId].error)("timeout_error", msg);\n
delete outTbl[transId];\n
delete s_transIds[transId];\n
}\n
}, timeout);\n
};\n
\n
var onMessage = function(origin, method, m) {\n
// if an observer was specified at allocation time, invoke it\n
if (typeof cfg.gotMessageObserver === \'function\') {\n
// pass observer a clone of the object so that our\n
// manipulations are not visible (i.e. method unscoping).\n
// This is not particularly efficient, but then we expect\n
// that message observers are primarily for debugging anyway.\n
try {\n
cfg.gotMessageObserver(origin, m);\n
} catch (e) {\n
debug("gotMessageObserver() raised an exception: " + e.toString());\n
}\n
}\n
\n
// now, what type of message is this?\n
if (m.id && method) {\n
// a request! do we have a registered handler for this request?\n
if (regTbl[method]) {\n
var trans = createTransaction(m.id, origin, m.callbacks ? m.callbacks : [ ]);\n
inTbl[m.id] = { };\n
try {\n
// callback handling. we\'ll magically create functions inside the parameter list for each\n
// callback\n
if (m.callbacks && s_isArray(m.callbacks) && m.callbacks.length > 0) {\n
for (var i = 0; i < m.callbacks.length; i++) {\n
var path = m.callbacks[i];\n
var obj = m.params;\n
var pathItems = path.split(\'/\');\n
for (var j = 0; j < pathItems.length - 1; j++) {\n
var cp = pathItems[j];\n
if (typeof obj[cp] !== \'object\') obj[cp] = { };\n
obj = obj[cp];\n
}\n
obj[pathItems[pathItems.length - 1]] = (function() {\n
var cbName = path;\n
return function(params) {\n
return trans.invoke(cbName, params);\n
};\n
})();\n
}\n
}\n
var resp = regTbl[method](trans, m.params);\n
if (!trans.delayReturn() && !trans.completed()) trans.complete(resp);\n
} catch(e) {\n
// automagic handling of exceptions:\n
var error = "runtime_error";\n
var message = null;\n
// * if it\'s a string then it gets an error code of \'runtime_error\' and string is the message\n
if (typeof e === \'string\') {\n
message = e;\n
} else if (typeof e === \'object\') {\n
// either an array or an object\n
// * if it\'s an array of length two, then array[0] is the code, array[1] is the error message\n
if (e && s_isArray(e) && e.length == 2) {\n
error = e[0];\n
message = e[1];\n
}\n
// * if it\'s an object then we\'ll look form error and message parameters\n
else if (typeof e.error === \'string\') {\n
error = e.error;\n
if (!e.message) message = "";\n
else if (typeof e.message === \'string\') message = e.message;\n
else e = e.message; // let the stringify/toString message give us a reasonable verbose error string\n
}\n
}\n
\n
// message is *still* null, let\'s try harder\n
if (message === null) {\n
try {\n
message = JSON.stringify(e);\n
/* On MSIE8, this can result in \'out of memory\', which\n
* leaves message undefined. */\n
if (typeof(message) == \'undefined\')\n
message = e.toString();\n
} catch (e2) {\n
message = e.toString();\n
}\n
}\n
\n
trans.error(error,message);\n
}\n
}\n
} else if (m.id && m.callback) {\n
if (!outTbl[m.id] ||!outTbl[m.id].callbacks || !outTbl[m.id].callbacks[m.callback])\n
{\n
debug("ignoring invalid callback, id:"+m.id+ " (" + m.callback +")");\n
} else {\n
// XXX: what if client code raises an exception here?\n
outTbl[m.id].callbacks[m.callback](m.params);\n
}\n
} else if (m.id) {\n
if (!outTbl[m.id]) {\n
debug("ignoring invalid response: " + m.id);\n
} else {\n
// XXX: what if client code raises an exception here?\n
if (m.error) {\n
(1,outTbl[m.id].error)(m.error, m.message);\n
} else {\n
if (m.result !== undefined) (1,outTbl[m.id].success)(m.result);\n
else (1,outTbl[m.id].success)();\n
}\n
delete outTbl[m.id];\n
delete s_transIds[m.id];\n
}\n
} else if (method) {\n
// tis a notification.\n
if (regTbl[method]) {\n
// yep, there\'s a handler for that.\n
// transaction has only origin for notifications.\n
regTbl[method]({ origin: origin }, m.params);\n
// if the client throws, we\'ll just let it bubble out\n
// what can we do? Also, here we\'ll ignore return values\n
}\n
}\n
};\n
\n
// now register our bound channel for msg routing\n
s_addBoundChan(cfg.window, cfg.origin, ((typeof cfg.scope === \'string\') ? cfg.scope : \'\'), onMessage);\n
\n
// scope method names based on cfg.scope specified when the Channel was instantiated\n
var scopeMethod = function(m) {\n
if (typeof cfg.scope === \'string\' && cfg.scope.length) m = [cfg.scope, m].join("::");\n
return m;\n
};\n
\n
// a small wrapper around postmessage whose primary function is to handle the\n
// case that clients start sending messages before the other end is "ready"\n
var postMessage = function(msg, force) {\n
if (!msg) throw "postMessage called with null message";\n
\n
// delay posting if we\'re not ready yet.\n
var verb = (ready ? "post " : "queue ");\n
debug(verb + " message: " + JSON.stringify(msg));\n
if (!force && !ready) {\n
pendingQueue.push(msg);\n
} else {\n
if (typeof cfg.postMessageObserver === \'function\') {\n
try {\n
cfg.postMessageObserver(cfg.origin, msg);\n
} catch (e) {\n
debug("postMessageObserver() raised an exception: " + e.toString());\n
}\n
}\n
\n
cfg.window.postMessage(JSON.stringify(msg), cfg.origin);\n
}\n
};\n
\n
var onReady = function(trans, type) {\n
debug(\'ready msg received\');\n
if (ready) throw "received ready message while in ready state. help!";\n
\n
if (type === \'ping\') {\n
chanId += \'-R\';\n
} else {\n
chanId += \'-L\';\n
}\n
\n
obj.unbind(\'__ready\'); // now this handler isn\'t needed any more.\n
ready = true;\n
debug(\'ready msg accepted.\');\n
\n
if (type === \'ping\') {\n
obj.notify({ method: \'__ready\', params: \'pong\' });\n
}\n
\n
// flush queue\n
while (pendingQueue.length) {\n
postMessage(pendingQueue.pop());\n
}\n
\n
// invoke onReady observer if provided\n
if (typeof cfg.onReady === \'function\') cfg.onReady(obj);\n
};\n
\n
var obj = {\n
// tries to unbind a bound message handler. returns false if not possible\n
unbind: function (method) {\n
if (regTbl[method]) {\n
if (!(delete regTbl[method])) throw ("can\'t delete method: " + method);\n
return true;\n
}\n
return false;\n
},\n
bind: function (method, cb) {\n
if (!method || typeof method !== \'string\') throw "\'method\' argument to bind must be string";\n
if (!cb || typeof cb !== \'function\') throw "callback missing from bind params";\n
\n
if (regTbl[method]) throw "method \'"+method+"\' is already bound!";\n
regTbl[method] = cb;\n
return this;\n
},\n
call: function(m) {\n
if (!m) throw \'missing arguments to call function\';\n
if (!m.method || typeof m.method !== \'string\') throw "\'method\' argument to call must be string";\n
if (!m.success || typeof m.success !== \'function\') throw "\'success\' callback missing from call";\n
\n
// now it\'s time to support the \'callback\' feature of jschannel. We\'ll traverse the argument\n
// object and pick out all of the functions that were passed as arguments.\n
var callbacks = { };\n
var callbackNames = [ ];\n
\n
var pruneFunctions = function (path, obj) {\n
if (typeof obj === \'object\') {\n
for (var k in obj) {\n
if (!obj.hasOwnProperty(k)) continue;\n
var np = path + (path.length ? \'/\' : \'\') + k;\n
if (typeof obj[k] === \'function\') {\n
callbacks[np] = obj[k];\n
callbackNames.push(np);\n
delete obj[k];\n
} else if (typeof obj[k] === \'object\') {\n
pruneFunctions(np, obj[k]);\n
}\n
}\n
}\n
};\n
pruneFunctions("", m.params);\n
\n
// build a \'request\' message and send it\n
var msg = { id: s_curTranId, method: scopeMethod(m.method), params: m.params };\n
if (callbackNames.length) msg.callbacks = callbackNames;\n
\n
if (m.timeout)\n
// XXX: This function returns a timeout ID, but we don\'t do anything with it.\n
// We might want to keep track of it so we can cancel it using clearTimeout()\n
// when the transaction completes.\n
setTransactionTimeout(s_curTranId, m.timeout, scopeMethod(m.method));\n
\n
// insert into the transaction table\n
outTbl[s_curTranId] = { callbacks: callbacks, error: m.error, success: m.success };\n
s_transIds[s_curTranId] = onMessage;\n
\n
// increment current id\n
s_curTranId++;\n
\n
postMessage(msg);\n
},\n
notify: function(m) {\n
if (!m) throw \'missing arguments to notify function\';\n
if (!m.method || typeof m.method !== \'string\') throw "\'method\' argument to notify must be string";\n
\n
// no need to go into any transaction table\n
postMessage({ method: scopeMethod(m.method), params: m.params });\n
},\n
destroy: function () {\n
s_removeBoundChan(cfg.window, cfg.origin, ((typeof cfg.scope === \'string\') ? cfg.scope : \'\'));\n
if (window.removeEventListener) window.removeEventListener(\'message\', onMessage, false);\n
else if(window.detachEvent) window.detachEvent(\'onmessage\', onMessage);\n
ready = false;\n
regTbl = { };\n
inTbl = { };\n
outTbl = { };\n
cfg.origin = null;\n
pendingQueue = [ ];\n
debug("channel destroyed");\n
chanId = "";\n
}\n
};\n
\n
obj.bind(\'__ready\', onReady);\n
setTimeout(function() {\n
postMessage({ method: scopeMethod(\'__ready\'), params: "ping" }, true);\n
}, 0);\n
\n
return obj;\n
}\n
};\n
})();\n
;/*\n
* DOMParser HTML extension\n
* 2012-09-04\n
*\n
* By Eli Grey, http://eligrey.com\n
* Public domain.\n
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n
*/\n
/*! @source https://gist.github.com/1129031 */\n
(function (DOMParser) {\n
"use strict";\n
var DOMParser_proto = DOMParser.prototype,\n
real_parseFromString = DOMParser_proto.parseFromString;\n
\n
// Firefox/Opera/IE throw errors on unsupported types\n
try {\n
// WebKit returns null on unsupported types\n
if ((new DOMParser()).parseFromString("", "text/html")) {\n
// text/html parsing is natively supported\n
return;\n
}\n
} catch (ignore) {}\n
\n
DOMParser_proto.parseFromString = function (markup, type) {\n
var result, doc, doc_elt, first_elt;\n
if (/^\\s*text\\/html\\s*(?:;|$)/i.test(type)) {\n
doc = document.implementation.createHTMLDocument("");\n
doc_elt = doc.documentElement;\n
\n
doc_elt.innerHTML = markup;\n
first_elt = doc_elt.firstElementChild;\n
\n
if (doc_elt.childElementCount === 1\n
&& first_elt.localName.toLowerCase() === "html") {\n
doc.replaceChild(first_elt, doc_elt);\n
}\n
\n
result = doc;\n
} else {\n
result = real_parseFromString.apply(this, arguments);\n
}\n
return result;\n
};\n
}(DOMParser));\n
\n
;/*! RenderJs */\n
/*jslint nomen: true*/\n
\n
/*\n
* renderJs - Generic Gadget library renderer.\n
* http://www.renderjs.org/documentation\n
*/\n
(function (document, window, RSVP, DOMParser, Channel, MutationObserver,\n
Node) {\n
"use strict";\n
\n
var gadget_model_dict = {},\n
javascript_registration_dict = {},\n
stylesheet_registration_dict = {},\n
gadget_loading_klass,\n
loading_klass_promise,\n
renderJS,\n
Monitor;\n
\n
/////////////////////////////////////////////////////////////////\n
// Helper functions\n
/////////////////////////////////////////////////////////////////\n
function removeHash(url) {\n
var index = url.indexOf(\'#\');\n
if (index > 0) {\n
url = url.substring(0, index);\n
}\n
return url;\n
}\n
\n
function letsCrash(e) {\n
if (e.constructor === XMLHttpRequest) {\n
e = {\n
readyState: e.readyState,\n
status: e.status,\n
statusText: e.statusText,\n
response_headers: e.getAllResponseHeaders()\n
};\n
}\n
if (e.constructor === Array ||\n
e.constructor === String ||\n
e.constructor === Object) {\n
try {\n
e = JSON.stringify(e);\n
} catch (ignore) {\n
}\n
}\n
document.getElementsByTagName(\'body\')[0].textContent = e;\n
// XXX Do not crash the application if it fails\n
// Where to write the error?\n
/*global console*/\n
console.error(e.stack);\n
console.error(e);\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// Service Monitor promise\n
/////////////////////////////////////////////////////////////////\n
function ResolvedMonitorError(message) {\n
this.name = "resolved";\n
if ((message !== undefined) && (typeof message !== "string")) {\n
throw new TypeError(\'You must pass a string.\');\n
}\n
this.message = message || "Default Message";\n
}\n
ResolvedMonitorError.prototype = new Error();\n
ResolvedMonitorError.prototype.constructor = ResolvedMonitorError;\n
\n
Monitor = function () {\n
var monitor = this,\n
promise_list = [],\n
promise,\n
reject,\n
notify,\n
resolved;\n
\n
if (!(this instanceof Monitor)) {\n
return new Monitor();\n
}\n
\n
function canceller() {\n
var len = promise_list.length,\n
i;\n
for (i = 0; i < len; i += 1) {\n
promise_list[i].cancel();\n
}\n
// Clean it to speed up other canceller run\n
promise_list = [];\n
}\n
\n
promise = new RSVP.Promise(function (done, fail, progress) {\n
reject = function (rejectedReason) {\n
if (resolved) {\n
return;\n
}\n
monitor.isRejected = true;\n
monitor.rejectedReason = rejectedReason;\n
resolved = true;\n
canceller();\n
return fail(rejectedReason);\n
};\n
notify = progress;\n
}, canceller);\n
\n
monitor.cancel = function () {\n
if (resolved) {\n
return;\n
}\n
resolved = true;\n
promise.cancel();\n
promise.fail(function (rejectedReason) {\n
monitor.isRejected = true;\n
monitor.rejectedReason = rejectedReason;\n
});\n
};\n
monitor.then = function () {\n
return promise.then.apply(promise, arguments);\n
};\n
monitor.fail = function () {\n
return promise.fail.apply(promise, arguments);\n
};\n
\n
monitor.monitor = function (promise_to_monitor) {\n
if (resolved) {\n
throw new ResolvedMonitorError();\n
}\n
var queue = new RSVP.Queue()\n
.push(function () {\n
return promise_to_monitor;\n
})\n
.push(function (fulfillmentValue) {\n
// Promise to monitor is fullfilled, remove it from the list\n
var len = promise_list.length,\n
sub_promise_to_monitor,\n
new_promise_list = [],\n
i;\n
for (i = 0; i < len; i += 1) {\n
sub_promise_to_monitor = promise_list[i];\n
if (!(sub_promise_to_monitor.isFulfilled ||\n
sub_promise_to_monitor.isRejected)) {\n
new_promise_list.push(sub_promise_to_monitor);\n
}\n
}\n
promise_list = new_promise_list;\n
}, function (rejectedReason) {\n
if (rejectedReason instanceof RSVP.CancellationError) {\n
if (!(promise_to_monitor.isFulfilled &&\n
promise_to_monitor.isRejected)) {\n
// The queue could be cancelled before the first push is run\n
promise_to_monitor.cancel();\n
}\n
}\n
reject(rejectedReason);\n
throw rejectedReason;\n
}, function (notificationValue) {\n
notify(notificationValue);\n
return notificationValue;\n
});\n
\n
promise_list.push(queue);\n
\n
return this;\n
};\n
};\n
\n
Monitor.prototype = Object.create(RSVP.Promise.prototype);\n
Monitor.prototype.constructor = Monitor;\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget\n
/////////////////////////////////////////////////////////////////\n
function RenderJSGadget() {\n
if (!(this instanceof RenderJSGadget)) {\n
return new RenderJSGadget();\n
}\n
}\n
RenderJSGadget.prototype.__title = "";\n
RenderJSGadget.prototype.__interface_list = [];\n
RenderJSGadget.prototype.__path = "";\n
RenderJSGadget.prototype.__html = "";\n
RenderJSGadget.prototype.__required_css_list = [];\n
RenderJSGadget.prototype.__required_js_list = [];\n
\n
function createMonitor(g) {\n
if (g.__monitor !== undefined) {\n
g.__monitor.cancel();\n
}\n
g.__monitor = new Monitor();\n
g.__monitor.fail(function (error) {\n
if (!(error instanceof RSVP.CancellationError)) {\n
return g.aq_reportServiceError(error);\n
}\n
}).fail(function (error) {\n
// Crash the application if the acquisition generates an error.\n
return letsCrash(error);\n
});\n
}\n
\n
function clearGadgetInternalParameters(g) {\n
g.__sub_gadget_dict = {};\n
createMonitor(g);\n
}\n
\n
function loadSubGadgetDOMDeclaration(g) {\n
var element_list = g.__element.querySelectorAll(\'[data-gadget-scope]\'),\n
element,\n
promise_list = [],\n
scope,\n
url,\n
sandbox,\n
i;\n
\n
for (i = 0; i < element_list.length; i += 1) {\n
element = element_list[i];\n
scope = element.getAttribute("data-gadget-scope");\n
url = element.getAttribute("data-gadget-url");\n
sandbox = element.getAttribute("data-gadget-sandbox");\n
if ((scope !== null) && (url !== null)) {\n
promise_list.push(g.declareGadget(url, {\n
element: element,\n
scope: scope || undefined,\n
sandbox: sandbox || undefined\n
}));\n
}\n
}\n
\n
return RSVP.all(promise_list);\n
}\n
\n
RenderJSGadget.__ready_list = [clearGadgetInternalParameters,\n
loadSubGadgetDOMDeclaration];\n
RenderJSGadget.ready = function (callback) {\n
this.__ready_list.push(callback);\n
return this;\n
};\n
\n
RenderJSGadget.__service_list = [];\n
RenderJSGadget.declareService = function (callback) {\n
this.__service_list.push(callback);\n
return this;\n
};\n
\n
function startService(gadget) {\n
gadget.__monitor.monitor(new RSVP.Queue()\n
.push(function () {\n
var i,\n
service_list = gadget.constructor.__service_list;\n
for (i = 0; i < service_list.length; i += 1) {\n
gadget.__monitor.monitor(service_list[i].apply(gadget));\n
}\n
})\n
);\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget.declareMethod\n
/////////////////////////////////////////////////////////////////\n
RenderJSGadget.declareMethod = function (name, callback) {\n
this.prototype[name] = function () {\n
var context = this,\n
argument_list = arguments;\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return callback.apply(context, argument_list);\n
});\n
};\n
// Allow chain\n
return this;\n
};\n
\n
RenderJSGadget\n
.declareMethod(\'getInterfaceList\', function () {\n
// Returns the list of gadget prototype\n
return this.__interface_list;\n
})\n
.declareMethod(\'getRequiredCSSList\', function () {\n
// Returns a list of CSS required by the gadget\n
return this.__required_css_list;\n
})\n
.declareMethod(\'getRequiredJSList\', function () {\n
// Returns a list of JS required by the gadget\n
return this.__required_js_list;\n
})\n
.declareMethod(\'getPath\', function () {\n
// Returns the path of the code of a gadget\n
return this.__path;\n
})\n
.declareMethod(\'getTitle\', function () {\n
// Returns the title of a gadget\n
return this.__title;\n
})\n
.declareMethod(\'getElement\', function () {\n
// Returns the DOM Element of a gadget\n
if (this.__element === undefined) {\n
throw new Error("No element defined");\n
}\n
return this.__element;\n
});\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget.declareAcquiredMethod\n
/////////////////////////////////////////////////////////////////\n
function acquire(child_gadget, method_name, argument_list) {\n
var gadget = this,\n
key,\n
gadget_scope;\n
\n
for (key in gadget.__sub_gadget_dict) {\n
if (gadget.__sub_gadget_dict.hasOwnProperty(key)) {\n
if (gadget.__sub_gadget_dict[key] === child_gadget) {\n
gadget_scope = key;\n
}\n
}\n
}\n
return new RSVP.Queue()\n
.push(function () {\n
// Do not specify default __acquired_method_dict on prototype\n
// to prevent modifying this default value (with\n
// allowPublicAcquiredMethod for example)\n
var aq_dict = gadget.__acquired_method_dict || {};\n
if (aq_dict.hasOwnProperty(method_name)) {\n
return aq_dict[method_name].apply(gadget,\n
[argument_list, gadget_scope]);\n
}\n
throw new renderJS.AcquisitionError("aq_dynamic is not defined");\n
})\n
.push(undefined, function (error) {\n
if (error instanceof renderJS.AcquisitionError) {\n
return gadget.__aq_parent(method_name, argument_list);\n
}\n
throw error;\n
});\n
}\n
\n
RenderJSGadget.declareAcquiredMethod =\n
function (name, method_name_to_acquire) {\n
this.prototype[name] = function () {\n
var argument_list = Array.prototype.slice.call(arguments, 0),\n
gadget = this;\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.__aq_parent(method_name_to_acquire, argument_list);\n
});\n
};\n
\n
// Allow chain\n
return this;\n
};\n
RenderJSGadget.declareAcquiredMethod("aq_reportServiceError",\n
"reportServiceError");\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget.allowPublicAcquisition\n
/////////////////////////////////////////////////////////////////\n
RenderJSGadget.allowPublicAcquisition =\n
function (method_name, callback) {\n
this.prototype.__acquired_method_dict[method_name] = callback;\n
\n
// Allow chain\n
return this;\n
};\n
\n
// Set aq_parent on gadget_instance which call acquire on parent_gadget\n
function setAqParent(gadget_instance, parent_gadget) {\n
gadget_instance.__aq_parent = function (method_name, argument_list) {\n
return acquire.apply(parent_gadget, [gadget_instance, method_name,\n
argument_list]);\n
};\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSEmbeddedGadget\n
/////////////////////////////////////////////////////////////////\n
// Class inheritance\n
function RenderJSEmbeddedGadget() {\n
if (!(this instanceof RenderJSEmbeddedGadget)) {\n
return new RenderJSEmbeddedGadget();\n
}\n
RenderJSGadget.call(this);\n
}\n
RenderJSEmbeddedGadget.__ready_list = RenderJSGadget.__ready_list.slice();\n
RenderJSEmbeddedGadget.__service_list =\n
RenderJSGadget.__service_list.slice();\n
RenderJSEmbeddedGadget.ready =\n
RenderJSGadget.ready;\n
RenderJSEmbeddedGadget.declareService =\n
RenderJSGadget.declareService;\n
RenderJSEmbeddedGadget.prototype = new RenderJSGadget();\n
RenderJSEmbeddedGadget.prototype.constructor = RenderJSEmbeddedGadget;\n
\n
/////////////////////////////////////////////////////////////////\n
// privateDeclarePublicGadget\n
/////////////////////////////////////////////////////////////////\n
function privateDeclarePublicGadget(url, options, parent_gadget) {\n
var gadget_instance;\n
if (options.element === undefined) {\n
options.element = document.createElement("div");\n
}\n
\n
function loadDependency(method, url) {\n
return function () {\n
return method(url);\n
};\n
}\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return renderJS.declareGadgetKlass(url);\n
})\n
// Get the gadget class and instanciate it\n
.push(function (Klass) {\n
var i,\n
template_node_list = Klass.__template_element.body.childNodes;\n
gadget_loading_klass = Klass;\n
gadget_instance = new Klass();\n
gadget_instance.__element = options.element;\n
for (i = 0; i < template_node_list.length; i += 1) {\n
gadget_instance.__element.appendChild(\n
template_node_list[i].cloneNode(true)\n
);\n
}\n
setAqParent(gadget_instance, parent_gadget);\n
// Load dependencies if needed\n
return RSVP.all([\n
gadget_instance.getRequiredJSList(),\n
gadget_instance.getRequiredCSSList()\n
]);\n
})\n
// Load all JS/CSS\n
.push(function (all_list) {\n
var q = new RSVP.Queue(),\n
i;\n
// Load JS\n
for (i = 0; i < all_list[0].length; i += 1) {\n
q.push(loadDependency(renderJS.declareJS, all_list[0][i]));\n
}\n
// Load CSS\n
for (i = 0; i < all_list[1].length; i += 1) {\n
q.push(loadDependency(renderJS.declareCSS, all_list[1][i]));\n
}\n
return q;\n
})\n
.push(function () {\n
return gadget_instance;\n
});\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSIframeGadget\n
/////////////////////////////////////////////////////////////////\n
function RenderJSIframeGadget() {\n
if (!(this instanceof RenderJSIframeGadget)) {\n
return new RenderJSIframeGadget();\n
}\n
RenderJSGadget.call(this);\n
}\n
RenderJSIframeGadget.__ready_list = RenderJSGadget.__ready_list.slice();\n
RenderJSIframeGadget.ready =\n
RenderJSGadget.ready;\n
RenderJSIframeGadget.__service_list = RenderJSGadget.__service_list.slice();\n
RenderJSIframeGadget.declareService =\n
RenderJSGadget.declareService;\n
RenderJSIframeGadget.prototype = new RenderJSGadget();\n
RenderJSIframeGadget.prototype.constructor = RenderJSIframeGadget;\n
\n
/////////////////////////////////////////////////////////////////\n
// privateDeclareIframeGadget\n
/////////////////////////////////////////////////////////////////\n
function privateDeclareIframeGadget(url, options, parent_gadget) {\n
var gadget_instance,\n
iframe,\n
iframe_loading_deferred = RSVP.defer();\n
if (options.element === undefined) {\n
throw new Error("DOM element is required to create Iframe Gadget " +\n
url);\n
}\n
\n
// Check if the element is attached to the DOM\n
if (!document.contains(options.element)) {\n
throw new Error("The parent element is not attached to the DOM for " +\n
url);\n
}\n
\n
gadget_instance = new RenderJSIframeGadget();\n
setAqParent(gadget_instance, parent_gadget);\n
iframe = document.createElement("iframe");\n
// gadget_instance.element.setAttribute("seamless", "seamless");\n
iframe.setAttribute("src", url);\n
gadget_instance.__path = url;\n
gadget_instance.__element = options.element;\n
// Attach it to the DOM\n
options.element.appendChild(iframe);\n
\n
// XXX Manage unbind when deleting the gadget\n
\n
// Create the communication channel with the iframe\n
gadget_instance.__chan = Channel.build({\n
window: iframe.contentWindow,\n
origin: "*",\n
scope: "renderJS"\n
});\n
\n
// Create new method from the declareMethod call inside the iframe\n
gadget_instance.__chan.bind("declareMethod",\n
function (trans, method_name) {\n
gadget_instance[method_name] = function () {\n
var argument_list = arguments;\n
return new RSVP.Promise(function (resolve, reject) {\n
gadget_instance.__chan.call({\n
method: "methodCall",\n
params: [\n
method_name,\n
Array.prototype.slice.call(argument_list, 0)],\n
success: function (s) {\n
resolve(s);\n
},\n
error: function (e) {\n
reject(e);\n
}\n
});\n
});\n
};\n
return "OK";\n
});\n
\n
// Wait for the iframe to be loaded before continuing\n
gadget_instance.__chan.bind("ready", function (trans) {\n
iframe_loading_deferred.resolve(gadget_instance);\n
return "OK";\n
});\n
gadget_instance.__chan.bind("failed", function (trans, params) {\n
iframe_loading_deferred.reject(params);\n
return "OK";\n
});\n
gadget_instance.__chan.bind("acquire", function (trans, params) {\n
gadget_instance.__aq_parent.apply(gadget_instance, params)\n
.then(function (g) {\n
trans.complete(g);\n
}).fail(function (e) {\n
trans.error(e.toString());\n
});\n
trans.delayReturn(true);\n
});\n
\n
return RSVP.any([\n
iframe_loading_deferred.promise,\n
// Timeout to prevent non renderJS embeddable gadget\n
// XXX Maybe using iframe.onload/onerror would be safer?\n
RSVP.timeout(5000)\n
]);\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget.declareGadget\n
/////////////////////////////////////////////////////////////////\n
RenderJSGadget\n
.declareMethod(\'declareGadget\', function (url, options) {\n
var queue,\n
parent_gadget = this,\n
local_loading_klass_promise,\n
previous_loading_klass_promise = loading_klass_promise;\n
\n
if (options === undefined) {\n
options = {};\n
}\n
if (options.sandbox === undefined) {\n
options.sandbox = "public";\n
}\n
\n
// transform url to absolute url if it is relative\n
url = renderJS.getAbsoluteURL(url, this.__path);\n
// Change the global variable to update the loading queue\n
loading_klass_promise = new RSVP.Queue()\n
// Wait for previous gadget loading to finish first\n
.push(function () {\n
return previous_loading_klass_promise;\n
})\n
.push(undefined, function () {\n
// Forget previous declareGadget error\n
return;\n
})\n
.push(function () {\n
var method;\n
if (options.sandbox === "public") {\n
method = privateDeclarePublicGadget;\n
} else if (options.sandbox === "iframe") {\n
method = privateDeclareIframeGadget;\n
} else {\n
throw new Error("Unsupported sandbox options \'" +\n
options.sandbox + "\'");\n
}\n
return method(url, options, parent_gadget);\n
})\n
// Set the HTML context\n
.push(function (gadget_instance) {\n
// Drop the current loading klass info used by selector\n
gadget_loading_klass = undefined;\n
return gadget_instance;\n
})\n
.push(undefined, function (e) {\n
// Drop the current loading klass info used by selector\n
// even in case of error\n
gadget_loading_klass = undefined;\n
throw e;\n
});\n
local_loading_klass_promise = loading_klass_promise;\n
\n
queue = new RSVP.Queue()\n
.push(function () {\n
return local_loading_klass_promise;\n
})\n
// Set the HTML context\n
.push(function (gadget_instance) {\n
var i;\n
// Trigger calling of all ready callback\n
function ready_wrapper() {\n
return gadget_instance;\n
}\n
for (i = 0; i < gadget_instance.constructor.__ready_list.length;\n
i += 1) {\n
// Put a timeout?\n
queue.push(gadget_instance.constructor.__ready_list[i]);\n
// Always return the gadget instance after ready function\n
queue.push(ready_wrapper);\n
}\n
\n
// Store local reference to the gadget instance\n
if (options.scope !== undefined) {\n
parent_gadget.__sub_gadget_dict[options.scope] = gadget_instance;\n
gadget_instance.__element.setAttribute("data-gadget-scope",\n
options.scope);\n
}\n
\n
// Put some attribute to ease page layout comprehension\n
gadget_instance.__element.setAttribute("data-gadget-url", url);\n
gadget_instance.__element.setAttribute("data-gadget-sandbox",\n
options.sandbox);\n
gadget_instance.__element._gadget = gadget_instance;\n
\n
if (document.contains(gadget_instance.__element)) {\n
// Put a timeout\n
queue.push(startService);\n
}\n
// Always return the gadget instance after ready function\n
queue.push(ready_wrapper);\n
\n
return gadget_instance;\n
});\n
return queue;\n
})\n
.declareMethod(\'getDeclaredGadget\', function (gadget_scope) {\n
if (!this.__sub_gadget_dict.hasOwnProperty(gadget_scope)) {\n
throw new Error("Gadget scope \'" + gadget_scope + "\' is not known.");\n
}\n
return this.__sub_gadget_dict[gadget_scope];\n
})\n
.declareMethod(\'dropGadget\', function (gadget_scope) {\n
if (!this.__sub_gadget_dict.hasOwnProperty(gadget_scope)) {\n
throw new Error("Gadget scope \'" + gadget_scope + "\' is not known.");\n
}\n
// http://perfectionkills.com/understanding-delete/\n
delete this.__sub_gadget_dict[gadget_scope];\n
});\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS selector\n
/////////////////////////////////////////////////////////////////\n
renderJS = function (selector) {\n
var result;\n
if (selector === window) {\n
// window is the \'this\' value when loading a javascript file\n
// In this case, use the current loading gadget constructor\n
result = gadget_loading_klass;\n
}\n
if (result === undefined) {\n
throw new Error("Unknown selector \'" + selector + "\'");\n
}\n
return result;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.AcquisitionError\n
/////////////////////////////////////////////////////////////////\n
renderJS.AcquisitionError = function (message) {\n
this.name = "AcquisitionError";\n
if ((message !== undefined) && (typeof message !== "string")) {\n
throw new TypeError(\'You must pass a string.\');\n
}\n
this.message = message || "Acquisition failed";\n
};\n
renderJS.AcquisitionError.prototype = new Error();\n
renderJS.AcquisitionError.prototype.constructor =\n
renderJS.AcquisitionError;\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.getAbsoluteURL\n
/////////////////////////////////////////////////////////////////\n
renderJS.getAbsoluteURL = function (url, base_url) {\n
var doc, base, link,\n
html = "<!doctype><html><head></head></html>",\n
isAbsoluteOrDataURL = new RegExp(\'^(?:[a-z]+:)?//|data:\', \'i\');\n
\n
if (url && base_url && !isAbsoluteOrDataURL.test(url)) {\n
doc = (new DOMParser()).parseFromString(html, \'text/html\');\n
base = doc.createElement(\'base\');\n
link = doc.createElement(\'link\');\n
doc.head.appendChild(base);\n
doc.head.appendChild(link);\n
base.href = base_url;\n
link.href = url;\n
return link.href;\n
}\n
return url;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.declareJS\n
/////////////////////////////////////////////////////////////////\n
renderJS.declareJS = function (url) {\n
// Prevent infinite recursion if loading render.js\n
// more than once\n
var result;\n
if (javascript_registration_dict.hasOwnProperty(url)) {\n
result = RSVP.resolve();\n
} else {\n
result = new RSVP.Promise(function (resolve, reject) {\n
var newScript;\n
newScript = document.createElement(\'script\');\n
newScript.type = \'text/javascript\';\n
newScript.src = url;\n
newScript.onload = function () {\n
javascript_registration_dict[url] = null;\n
resolve();\n
};\n
newScript.onerror = function (e) {\n
reject(e);\n
};\n
document.head.appendChild(newScript);\n
});\n
}\n
return result;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.declareCSS\n
/////////////////////////////////////////////////////////////////\n
renderJS.declareCSS = function (url) {\n
// https://github.com/furf/jquery-getCSS/blob/master/jquery.getCSS.js\n
// No way to cleanly check if a css has been loaded\n
// So, always resolve the promise...\n
// http://requirejs.org/docs/faq-advanced.html#css\n
var result;\n
if (stylesheet_registration_dict.hasOwnProperty(url)) {\n
result = RSVP.resolve();\n
} else {\n
result = new RSVP.Promise(function (resolve, reject) {\n
var link;\n
link = document.createElement(\'link\');\n
link.rel = \'stylesheet\';\n
link.type = \'text/css\';\n
link.href = url;\n
link.onload = function () {\n
stylesheet_registration_dict[url] = null;\n
resolve();\n
};\n
link.onerror = function (e) {\n
reject(e);\n
};\n
document.head.appendChild(link);\n
});\n
}\n
return result;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.declareGadgetKlass\n
/////////////////////////////////////////////////////////////////\n
renderJS.declareGadgetKlass = function (url) {\n
var result,\n
xhr;\n
\n
function parse() {\n
var tmp_constructor,\n
key,\n
parsed_html;\n
if (!gadget_model_dict.hasOwnProperty(url)) {\n
// Class inheritance\n
tmp_constructor = function () {\n
RenderJSGadget.call(this);\n
};\n
tmp_constructor.__ready_list = RenderJSGadget.__ready_list.slice();\n
tmp_constructor.__service_list = RenderJSGadget.__service_list.slice();\n
tmp_constructor.declareMethod =\n
RenderJSGadget.declareMethod;\n
tmp_constructor.declareAcquiredMethod =\n
RenderJSGadget.declareAcquiredMethod;\n
tmp_constructor.allowPublicAcquisition =\n
RenderJSGadget.allowPublicAcquisition;\n
tmp_constructor.ready =\n
RenderJSGadget.ready;\n
tmp_constructor.declareService =\n
RenderJSGadget.declareService;\n
tmp_constructor.prototype = new RenderJSGadget();\n
tmp_constructor.prototype.constructor = tmp_constructor;\n
tmp_constructor.prototype.__path = url;\n
tmp_constructor.prototype.__acquired_method_dict = {};\n
// https://developer.mozilla.org/en-US/docs/HTML_in_XMLHttpRequest\n
// https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n
// https://developer.mozilla.org/en-US/docs/Code_snippets/HTML_to_DOM\n
tmp_constructor.__template_element =\n
(new DOMParser()).parseFromString(xhr.responseText, "text/html");\n
parsed_html = renderJS.parseGadgetHTMLDocument(\n
tmp_constructor.__template_element,\n
url\n
);\n
for (key in parsed_html) {\n
if (parsed_html.hasOwnProperty(key)) {\n
tmp_constructor.prototype[\'__\' + key] = parsed_html[key];\n
}\n
}\n
\n
gadget_model_dict[url] = tmp_constructor;\n
}\n
\n
return gadget_model_dict[url];\n
}\n
\n
function resolver(resolve, reject) {\n
function handler() {\n
var tmp_result;\n
try {\n
if (xhr.readyState === 0) {\n
// UNSENT\n
reject(xhr);\n
} else if (xhr.readyState === 4) {\n
// DONE\n
if ((xhr.status < 200) || (xhr.status >= 300) ||\n
(!/^text\\/html[;]?/.test(\n
xhr.getResponseHeader("Content-Type") || ""\n
))) {\n
reject(xhr);\n
} else {\n
tmp_result = parse();\n
resolve(tmp_result);\n
}\n
}\n
} catch (e) {\n
reject(e);\n
}\n
}\n
\n
xhr = new XMLHttpRequest();\n
xhr.open("GET", url);\n
xhr.onreadystatechange = handler;\n
xhr.setRequestHeader(\'Accept\', \'text/html\');\n
xhr.withCredentials = true;\n
xhr.send();\n
}\n
\n
function canceller() {\n
if ((xhr !== undefined) && (xhr.readyState !== xhr.DONE)) {\n
xhr.abort();\n
}\n
}\n
\n
if (gadget_model_dict.hasOwnProperty(url)) {\n
// Return klass object if it already exists\n
result = RSVP.resolve(gadget_model_dict[url]);\n
} else {\n
// Fetch the HTML page and parse it\n
result = new RSVP.Promise(resolver, canceller);\n
}\n
return result;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.clearGadgetKlassList\n
/////////////////////////////////////////////////////////////////\n
// For test purpose only\n
renderJS.clearGadgetKlassList = function () {\n
gadget_model_dict = {};\n
javascript_registration_dict = {};\n
stylesheet_registration_dict = {};\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// renderJS.parseGadgetHTMLDocument\n
/////////////////////////////////////////////////////////////////\n
renderJS.parseGadgetHTMLDocument = function (document_element, url) {\n
var settings = {\n
title: "",\n
interface_list: [],\n
required_css_list: [],\n
required_js_list: []\n
},\n
i,\n
element,\n
isAbsoluteURL = new RegExp(\'^(?:[a-z]+:)?//\', \'i\');\n
\n
if (!url || !isAbsoluteURL.test(url)) {\n
throw new Error("The url should be absolute: " + url);\n
}\n
\n
if (document_element.nodeType === 9) {\n
settings.title = document_element.title;\n
\n
for (i = 0; i < document_element.head.children.length; i += 1) {\n
element = document_element.head.children[i];\n
if (element.href !== null) {\n
// XXX Manage relative URL during extraction of URLs\n
// element.href returns absolute URL in firefox but "" in chrome;\n
if (element.rel === "stylesheet") {\n
settings.required_css_list.push(\n
renderJS.getAbsoluteURL(element.getAttribute("href"), url)\n
);\n
} else if (element.nodeName === "SCRIPT" &&\n
(element.type === "text/javascript" ||\n
!element.type)) {\n
settings.required_js_list.push(\n
renderJS.getAbsoluteURL(element.getAttribute("src"), url)\n
);\n
} else if (element.rel === "http://www.renderjs.org/rel/interface") {\n
settings.interface_list.push(\n
renderJS.getAbsoluteURL(element.getAttribute("href"), url)\n
);\n
}\n
}\n
}\n
} else {\n
throw new Error("The first parameter should be an HTMLDocument");\n
}\n
return settings;\n
};\n
\n
/////////////////////////////////////////////////////////////////\n
// global\n
/////////////////////////////////////////////////////////////////\n
window.rJS = window.renderJS = renderJS;\n
window.__RenderJSGadget = RenderJSGadget;\n
window.__RenderJSEmbeddedGadget = RenderJSEmbeddedGadget;\n
window.__RenderJSIframeGadget = RenderJSIframeGadget;\n
\n
///////////////////////////////////////////////////\n
// Bootstrap process. Register the self gadget.\n
///////////////////////////////////////////////////\n
\n
function bootstrap() {\n
var url = removeHash(window.location.href),\n
tmp_constructor,\n
root_gadget,\n
loading_gadget_promise = new RSVP.Queue(),\n
declare_method_count = 0,\n
embedded_channel,\n
notifyReady,\n
notifyDeclareMethod,\n
gadget_ready = false,\n
iframe_top_gadget,\n
last_acquisition_gadget;\n
\n
// Create the gadget class for the current url\n
if (gadget_model_dict.hasOwnProperty(url)) {\n
throw new Error("bootstrap should not be called twice");\n
}\n
loading_klass_promise = new RSVP.Promise(function (resolve, reject) {\n
\n
last_acquisition_gadget = new RenderJSGadget();\n
last_acquisition_gadget.__acquired_method_dict = {\n
getTopURL: function () {\n
return url;\n
},\n
reportServiceError: function (param_list) {\n
letsCrash(param_list[0]);\n
}\n
};\n
// Stop acquisition on the last acquisition gadget\n
// Do not put this on the klass, as their could be multiple instances\n
last_acquisition_gadget.__aq_parent = function (method_name) {\n
throw new renderJS.AcquisitionError(\n
"No gadget provides " + method_name\n
);\n
};\n
\n
//we need to determine tmp_constructor\'s value before exit bootstrap\n
//because of function : renderJS\n
//but since the channel checking is async,\n
//we can\'t use code structure like:\n
// if channel communication is ok\n
// tmp_constructor = RenderJSGadget\n
// else\n
// tmp_constructor = RenderJSEmbeddedGadget\n
if (window.self === window.top) {\n
// XXX Copy/Paste from declareGadgetKlass\n
tmp_constructor = function () {\n
RenderJSGadget.call(this);\n
};\n
tmp_constructor.declareMethod = RenderJSGadget.declareMethod;\n
tmp_constructor.declareAcquiredMethod =\n
RenderJSGadget.declareAcquiredMethod;\n
tmp_constructor.allowPublicAcquisition =\n
RenderJSGadget.allowPublicAcquisition;\n
tmp_constructor.__ready_list = RenderJSGadget.__ready_list.slice();\n
tmp_constructor.ready = RenderJSGadget.ready;\n
tmp_constructor.__service_list = RenderJSGadget.__service_list.slice();\n
tmp_constructor.declareService =\n
RenderJSGadget.declareService;\n
tmp_constructor.prototype = new RenderJSGadget();\n
tmp_constructor.prototype.constructor = tmp_constructor;\n
tmp_constructor.prototype.__path = url;\n
gadget_model_dict[url] = tmp_constructor;\n
\n
// Create the root gadget instance and put it in the loading stack\n
root_gadget = new gadget_model_dict[url]();\n
\n
setAqParent(root_gadget, last_acquisition_gadget);\n
\n
} else {\n
// Create the communication channel\n
embedded_channel = Channel.build({\n
window: window.parent,\n
origin: "*",\n
scope: "renderJS"\n
});\n
// Create the root gadget instance and put it in the loading stack\n
tmp_constructor = RenderJSEmbeddedGadget;\n
tmp_constructor.__ready_list = RenderJSGadget.__ready_list.slice();\n
tmp_constructor.__service_list = RenderJSGadget.__service_list.slice();\n
tmp_constructor.prototype.__path = url;\n
root_gadget = new RenderJSEmbeddedGadget();\n
\n
\n
// Notify parent about gadget instanciation\n
notifyReady = function () {\n
if ((declare_method_count === 0) && (gadget_ready === true)) {\n
embedded_channel.notify({method: "ready"});\n
}\n
};\n
\n
// Inform parent gadget about declareMethod calls here.\n
notifyDeclareMethod = function (name) {\n
declare_method_count += 1;\n
embedded_channel.call({\n
method: "declareMethod",\n
params: name,\n
success: function () {\n
declare_method_count -= 1;\n
notifyReady();\n
},\n
error: function () {\n
declare_method_count -= 1;\n
}\n
});\n
};\n
\n
notifyDeclareMethod("getInterfaceList");\n
notifyDeclareMethod("getRequiredCSSList");\n
notifyDeclareMethod("getRequiredJSList");\n
notifyDeclareMethod("getPath");\n
notifyDeclareMethod("getTitle");\n
\n
// Surcharge declareMethod to inform parent window\n
tmp_constructor.declareMethod = function (name, callback) {\n
var result = RenderJSGadget.declareMethod.apply(\n
this,\n
[name, callback]\n
);\n
notifyDeclareMethod(name);\n
return result;\n
};\n
\n
tmp_constructor.declareService =\n
RenderJSGadget.declareService;\n
tmp_constructor.declareAcquiredMethod =\n
RenderJSGadget.declareAcquiredMethod;\n
tmp_constructor.allowPublicAcquisition =\n
RenderJSGadget.allowPublicAcquisition;\n
\n
//Default: Define __aq_parent to inform parent window\n
tmp_constructor.prototype.__aq_parent = function (method_name,\n
argument_list, time_out) {\n
return new RSVP.Promise(function (resolve, reject) {\n
embedded_channel.call({\n
method: "acquire",\n
params: [\n
method_name,\n
argument_list\n
],\n
success: function (s) {\n
resolve(s);\n
},\n
error: function (e) {\n
reject(e);\n
},\n
timeout: time_out\n
});\n
});\n
};\n
}\n
\n
tmp_constructor.prototype.__acquired_method_dict = {};\n
gadget_loading_klass = tmp_constructor;\n
\n
function init() {\n
// XXX HTML properties can only be set when the DOM is fully loaded\n
var settings = renderJS.parseGadgetHTMLDocument(document, url),\n
j,\n
key;\n
for (key in settings) {\n
if (settings.hasOwnProperty(key)) {\n
tmp_constructor.prototype[\'__\' + key] = settings[key];\n
}\n
}\n
tmp_constructor.__template_element = document.createElement("div");\n
root_gadget.__element = document.body;\n
for (j = 0; j < root_gadget.__element.childNodes.length; j += 1) {\n
tmp_constructor.__template_element.appendChild(\n
root_gadget.__element.childNodes[j].cloneNode(true)\n
);\n
}\n
RSVP.all([root_gadget.getRequiredJSList(),\n
root_gadget.getRequiredCSSList()])\n
.then(function (all_list) {\n
var i,\n
js_list = all_list[0],\n
css_list = all_list[1];\n
for (i = 0; i < js_list.length; i += 1) {\n
javascript_registration_dict[js_list[i]] = null;\n
}\n
for (i = 0; i < css_list.length; i += 1) {\n
stylesheet_registration_dict[css_list[i]] = null;\n
}\n
gadget_loading_klass = undefined;\n
}).then(function () {\n
\n
// select the target node\n
var target = document.querySelector(\'body\'),\n
// create an observer instance\n
observer = new MutationObserver(function (mutations) {\n
var i, k, len, len2, node, added_list;\n
mutations.forEach(function (mutation) {\n
if (mutation.type === \'childList\') {\n
\n
len = mutation.removedNodes.length;\n
for (i = 0; i < len; i += 1) {\n
node = mutation.removedNodes[i];\n
if (node.nodeType === Node.ELEMENT_NODE) {\n
if (node.hasAttribute("data-gadget-url") &&\n
(node._gadget !== undefined)) {\n
createMonitor(node._gadget);\n
}\n
added_list =\n
node.querySelectorAll("[data-gadget-url]");\n
len2 = added_list.length;\n
for (k = 0; k < len2; k += 1) {\n
node = added_list[k];\n
if (node._gadget !== undefined) {\n
createMonitor(node._gadget);\n
}\n
}\n
}\n
}\n
\n
len = mutation.addedNodes.length;\n
for (i = 0; i < len; i += 1) {\n
node = mutation.addedNodes[i];\n
if (node.nodeType === Node.ELEMENT_NODE) {\n
if (node.hasAttribute("data-gadget-url") &&\n
(node._gadget !== undefined)) {\n
if (document.contains(node)) {\n
startService(node._gadget);\n
}\n
}\n
added_list =\n
node.querySelectorAll("[data-gadget-url]");\n
len2 = added_list.length;\n
for (k = 0; k < len2; k += 1) {\n
node = added_list[k];\n
if (document.contains(node)) {\n
if (node._gadget !== undefined) {\n
startService(node._gadget);\n
}\n
}\n
}\n
}\n
}\n
\n
}\n
});\n
}),\n
// configuration of the observer:\n
config = {\n
childList: true,\n
subtree: true,\n
attributes: false,\n
characterData: false\n
};\n
\n
// pass in the target node, as well as the observer options\n
observer.observe(target, config);\n
\n
return root_gadget;\n
}).then(resolve, function (e) {\n
reject(e);\n
console.error(e);\n
throw e;\n
});\n
}\n
document.addEventListener(\'DOMContentLoaded\', init, false);\n
});\n
\n
loading_gadget_promise\n
.push(function () {\n
return loading_klass_promise;\n
})\n
.push(function (root_gadget) {\n
var i;\n
\n
function ready_wrapper() {\n
return root_gadget;\n
}\n
\n
if (window.top !== window.self) {\n
//checking channel should be done before sub gadget\'s declaration\n
//__ready_list:\n
//0: clearGadgetInternalParameters\n
//1: loadSubGadgetDOMDeclaration\n
//.....\n
tmp_constructor.__ready_list.splice(1, 0, function () {\n
return root_gadget.__aq_parent(\'getTopURL\', [], 3000)\n
.then(function (topURL) {\n
var base = document.createElement(\'base\');\n
base.href = topURL;\n
base.target = "_top";\n
document.head.appendChild(base);\n
//the channel is ok\n
//so bind calls to renderJS method on the instance\n
embedded_channel.bind("methodCall", function (trans, v) {\n
root_gadget[v[0]].apply(root_gadget, v[1])\n
.then(function (g) {\n
trans.complete(g);\n
}).fail(function (e) {\n
trans.error(e.toString());\n
});\n
trans.delayReturn(true);\n
});\n
})\n
.fail(function (error) {\n
if (error === "timeout_error") {\n
//the channel fail\n
//we consider current gadget is parent gadget\n
//redifine last acquisition gadget\n
iframe_top_gadget = true;\n
setAqParent(root_gadget, last_acquisition_gadget);\n
} else {\n
throw error;\n
}\n
});\n
});\n
}\n
\n
tmp_constructor.ready(function (g) {\n
return startService(g);\n
});\n
\n
loading_gadget_promise.push(ready_wrapper);\n
for (i = 0; i < tmp_constructor.__ready_list.length; i += 1) {\n
// Put a timeout?\n
loading_gadget_promise\n
.push(tmp_constructor.__ready_list[i])\n
// Always return the gadget instance after ready function\n
.push(ready_wrapper);\n
}\n
});\n
if (window.self === window.top) {\n
loading_gadget_promise\n
.fail(function (e) {\n
letsCrash(e);\n
throw e;\n
});\n
} else {\n
// Inform parent window that gadget is correctly loaded\n
loading_gadget_promise\n
.then(function () {\n
gadget_ready = true;\n
notifyReady();\n
})\n
.fail(function (e) {\n
//top gadget in iframe\n
if (iframe_top_gadget) {\n
letsCrash(e);\n
} else {\n
embedded_channel.notify({method: "failed", params: e.toString()});\n
}\n
throw e;\n
});\n
}\n
\n
}\n
bootstrap();\n
\n
}(document, window, RSVP, DOMParser, Channel, MutationObserver, Node));\n
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ts16413642.31</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>rsvp.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[
(function(globals) {\n
var define, requireModule;\n
\n
(function() {\n
var registry = {}, seen = {};\n
\n
define = function(name, deps, callback) {\n
registry[name] = { deps: deps, callback: callback };\n
};\n
\n
requireModule = function(name) {\n
if (seen[name]) { return seen[name]; }\n
seen[name] = {};\n
\n
var mod = registry[name];\n
if (!mod) {\n
throw new Error("Module \'" + name + "\' not found.");\n
}\n
\n
var deps = mod.deps,\n
callback = mod.callback,\n
reified = [],\n
exports;\n
\n
for (var i=0, l=deps.length; i<l; i++) {\n
if (deps[i] === \'exports\') {\n
reified.push(exports = {});\n
} else {\n
reified.push(requireModule(deps[i]));\n
}\n
}\n
\n
var value = callback.apply(this, reified);\n
return seen[name] = exports || value;\n
};\n
})();\n
\n
define("rsvp/all",\n
["rsvp/promise","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
/* global toString */\n
\n
\n
function promiseAtLeast(expected_count, promises) {\n
if (Object.prototype.toString.call(promises) !== "[object Array]") {\n
throw new TypeError(\'You must pass an array to all.\');\n
}\n
\n
function canceller() {\n
var promise;\n
for (var i = 0; i < promises.length; i++) {\n
promise = promises[i];\n
\n
if (promise && typeof promise.then === \'function\' &&\n
typeof promise.cancel === \'function\') {\n
promise.cancel();\n
}\n
}\n
}\n
\n
return new Promise(function(resolve, reject, notify) {\n
var results = [], remaining = promises.length,\n
promise, remaining_count = promises.length - expected_count;\n
\n
if (remaining === 0) {\n
if (expected_count === 1) {\n
resolve();\n
} else {\n
resolve([]);\n
}\n
}\n
\n
function resolver(index) {\n
return function(value) {\n
resolveAll(index, value);\n
};\n
}\n
\n
function resolveAll(index, value) {\n
results[index] = value;\n
if (--remaining === remaining_count) {\n
if (remaining_count === 0) {\n
resolve(results);\n
} else {\n
resolve(value);\n
canceller();\n
}\n
}\n
}\n
\n
function notifier(index) {\n
return function(value) {\n
notify({"index": index, "value": value});\n
};\n
}\n
\n
function cancelAll(rejectionValue) {\n
reject(rejectionValue);\n
canceller();\n
}\n
\n
for (var i = 0; i < promises.length; i++) {\n
promise = promises[i];\n
\n
if (promise && typeof promise.then === \'function\') {\n
promise.then(resolver(i), cancelAll, notifier(i));\n
} else {\n
resolveAll(i, promise);\n
}\n
}\n
}, canceller\n
);\n
}\n
\n
function all(promises) {\n
return promiseAtLeast(promises.length, promises);\n
}\n
\n
function any(promises) {\n
return promiseAtLeast(1, promises);\n
}\n
\n
\n
__exports__.all = all;\n
__exports__.any = any;\n
});\n
define("rsvp/async",\n
["exports"],\n
function(__exports__) {\n
"use strict";\n
var browserGlobal = (typeof window !== \'undefined\') ? window : {};\n
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n
var async;\n
var local = (typeof global !== \'undefined\') ? global : this;\n
\n
// old node\n
function useNextTick() {\n
return function(callback, arg) {\n
process.nextTick(function() {\n
callback(arg);\n
});\n
};\n
}\n
\n
// node >= 0.10.x\n
function useSetImmediate() {\n
return function(callback, arg) {\n
/* global setImmediate */\n
setImmediate(function(){\n
callback(arg);\n
});\n
};\n
}\n
\n
function useMutationObserver() {\n
var queue = [];\n
\n
var observer = new BrowserMutationObserver(function() {\n
var toProcess = queue.slice();\n
queue = [];\n
\n
toProcess.forEach(function(tuple) {\n
var callback = tuple[0], arg= tuple[1];\n
callback(arg);\n
});\n
});\n
\n
var element = document.createElement(\'div\');\n
observer.observe(element, { attributes: true });\n
\n
// Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n
window.addEventListener(\'unload\', function(){\n
observer.disconnect();\n
observer = null;\n
}, false);\n
\n
return function(callback, arg) {\n
queue.push([callback, arg]);\n
element.setAttribute(\'drainQueue\', \'drainQueue\');\n
};\n
}\n
\n
function useSetTimeout() {\n
return function(callback, arg) {\n
local.setTimeout(function() {\n
callback(arg);\n
}, 1);\n
};\n
}\n
\n
if (typeof setImmediate === \'function\') {\n
async = useSetImmediate();\n
} else if (typeof process !== \'undefined\' && {}.toString.call(process) === \'[object process]\') {\n
async = useNextTick();\n
} else if (BrowserMutationObserver) {\n
async = useMutationObserver();\n
} else {\n
async = useSetTimeout();\n
}\n
\n
\n
__exports__.async = async;\n
});\n
define("rsvp/cancellation_error",\n
["exports"],\n
function(__exports__) {\n
"use strict";\n
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n
function CancellationError(message) {\n
this.name = "cancel";\n
if ((message !== undefined) && (typeof message !== "string")) {\n
throw new TypeError(\'You must pass a string.\');\n
}\n
this.message = message || "Default Message";\n
}\n
CancellationError.prototype = new Error();\n
CancellationError.prototype.constructor = CancellationError;\n
\n
\n
__exports__.CancellationError = CancellationError;\n
});\n
define("rsvp/config",\n
["rsvp/async","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var async = __dependency1__.async;\n
\n
var config = {};\n
config.async = async;\n
\n
\n
__exports__.config = config;\n
});\n
define("rsvp/defer",\n
["rsvp/promise","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
\n
function defer() {\n
var deferred = {\n
// pre-allocate shape\n
resolve: undefined,\n
reject: undefined,\n
promise: undefined\n
};\n
\n
deferred.promise = new Promise(function(resolve, reject) {\n
deferred.resolve = resolve;\n
deferred.reject = reject;\n
});\n
\n
return deferred;\n
}\n
\n
\n
__exports__.defer = defer;\n
});\n
define("rsvp/events",\n
["exports"],\n
function(__exports__) {\n
"use strict";\n
var Event = function(type, options) {\n
this.type = type;\n
\n
for (var option in options) {\n
if (!options.hasOwnProperty(option)) { continue; }\n
\n
this[option] = options[option];\n
}\n
};\n
\n
var indexOf = function(callbacks, callback) {\n
for (var i=0, l=callbacks.length; i<l; i++) {\n
if (callbacks[i][0] === callback) { return i; }\n
}\n
\n
return -1;\n
};\n
\n
var callbacksFor = function(object) {\n
var callbacks = object._promiseCallbacks;\n
\n
if (!callbacks) {\n
callbacks = object._promiseCallbacks = {};\n
}\n
\n
return callbacks;\n
};\n
\n
var EventTarget = {\n
mixin: function(object) {\n
object.on = this.on;\n
object.off = this.off;\n
object.trigger = this.trigger;\n
return object;\n
},\n
\n
on: function(eventNames, callback, binding) {\n
var allCallbacks = callbacksFor(this), callbacks, eventName;\n
eventNames = eventNames.split(/\\s+/);\n
binding = binding || this;\n
\n
while (eventName = eventNames.shift()) {\n
callbacks = allCallbacks[eventName];\n
\n
if (!callbacks) {\n
callbacks = allCallbacks[eventName] = [];\n
}\n
\n
if (indexOf(callbacks, callback) === -1) {\n
callbacks.push([callback, binding]);\n
}\n
}\n
},\n
\n
off: function(eventNames, callback) {\n
var allCallbacks = callbacksFor(this), callbacks, eventName, index;\n
eventNames = eventNames.split(/\\s+/);\n
\n
while (eventName = eventNames.shift()) {\n
if (!callback) {\n
allCallbacks[eventName] = [];\n
continue;\n
}\n
\n
callbacks = allCallbacks[eventName];\n
\n
index = indexOf(callbacks, callback);\n
\n
if (index !== -1) { callbacks.splice(index, 1); }\n
}\n
},\n
\n
trigger: function(eventName, options) {\n
var allCallbacks = callbacksFor(this),\n
callbacks, callbackTuple, callback, binding, event;\n
\n
if (callbacks = allCallbacks[eventName]) {\n
// Don\'t cache the callbacks.length since it may grow\n
for (var i=0; i<callbacks.length; i++) {\n
callbackTuple = callbacks[i];\n
callback = callbackTuple[0];\n
binding = callbackTuple[1];\n
\n
if (typeof options !== \'object\') {\n
options = { detail: options };\n
}\n
\n
event = new Event(eventName, options);\n
callback.call(binding, event);\n
}\n
}\n
}\n
};\n
\n
\n
__exports__.EventTarget = EventTarget;\n
});\n
define("rsvp/hash",\n
["rsvp/defer","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var defer = __dependency1__.defer;\n
\n
function size(object) {\n
var s = 0;\n
\n
for (var prop in object) {\n
s++;\n
}\n
\n
return s;\n
}\n
\n
function hash(promises) {\n
var results = {}, deferred = defer(), remaining = size(promises);\n
\n
if (remaining === 0) {\n
deferred.resolve({});\n
}\n
\n
var resolver = function(prop) {\n
return function(value) {\n
resolveAll(prop, value);\n
};\n
};\n
\n
var resolveAll = function(prop, value) {\n
results[prop] = value;\n
if (--remaining === 0) {\n
deferred.resolve(results);\n
}\n
};\n
\n
var rejectAll = function(error) {\n
deferred.reject(error);\n
};\n
\n
for (var prop in promises) {\n
if (promises[prop] && typeof promises[prop].then === \'function\') {\n
promises[prop].then(resolver(prop), rejectAll);\n
} else {\n
resolveAll(prop, promises[prop]);\n
}\n
}\n
\n
return deferred.promise;\n
}\n
\n
\n
__exports__.hash = hash;\n
});\n
define("rsvp/node",\n
["rsvp/promise","rsvp/all","exports"],\n
function(__dependency1__, __dependency2__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
var all = __dependency2__.all;\n
\n
function makeNodeCallbackFor(resolve, reject) {\n
return function (error, value) {\n
if (error) {\n
reject(error);\n
} else if (arguments.length > 2) {\n
resolve(Array.prototype.slice.call(arguments, 1));\n
} else {\n
resolve(value);\n
}\n
};\n
}\n
\n
function denodeify(nodeFunc) {\n
return function() {\n
var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;\n
var thisArg = this;\n
\n
var promise = new Promise(function(nodeResolve, nodeReject) {\n
resolve = nodeResolve;\n
reject = nodeReject;\n
});\n
\n
all(nodeArgs).then(function(nodeArgs) {\n
nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n
\n
try {\n
nodeFunc.apply(thisArg, nodeArgs);\n
} catch(e) {\n
reject(e);\n
}\n
});\n
\n
return promise;\n
};\n
}\n
\n
\n
__exports__.denodeify = denodeify;\n
});\n
define("rsvp/promise",\n
["rsvp/config","rsvp/events","rsvp/cancellation_error","exports"],\n
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n
"use strict";\n
var config = __dependency1__.config;\n
var EventTarget = __dependency2__.EventTarget;\n
var CancellationError = __dependency3__.CancellationError;\n
\n
function objectOrFunction(x) {\n
return isFunction(x) || (typeof x === "object" && x !== null);\n
}\n
\n
function isFunction(x){\n
return typeof x === "function";\n
}\n
\n
var Promise = function(resolver, canceller) {\n
var promise = this,\n
resolved = false;\n
\n
if (typeof resolver !== \'function\') {\n
throw new TypeError(\'You must pass a resolver function as the sole argument to the promise constructor\');\n
}\n
\n
if ((canceller !== undefined) && (typeof canceller !== \'function\')) {\n
throw new TypeError(\'You can only pass a canceller function\' +\n
\' as the second argument to the promise constructor\');\n
}\n
\n
if (!(promise instanceof Promise)) {\n
return new Promise(resolver, canceller);\n
}\n
\n
var resolvePromise = function(value) {\n
if (resolved) { return; }\n
resolved = true;\n
resolve(promise, value);\n
};\n
\n
var rejectPromise = function(value) {\n
if (resolved) { return; }\n
resolved = true;\n
reject(promise, value);\n
};\n
\n
var notifyPromise = function(value) {\n
if (resolved) { return; }\n
notify(promise, value);\n
};\n
\n
this.on(\'promise:failed\', function(event) {\n
this.trigger(\'error\', { detail: event.detail });\n
}, this);\n
\n
this.on(\'error\', onerror);\n
\n
this.cancel = function () {\n
// For now, simply reject the promise and does not propagate the cancel\n
// to parent or children\n
if (resolved) { return; }\n
if (canceller !== undefined) {\n
try {\n
canceller();\n
} catch (e) {\n
rejectPromise(e);\n
return;\n
}\n
}\n
// Trigger cancel?\n
rejectPromise(new CancellationError());\n
};\n
\n
try {\n
resolver(resolvePromise, rejectPromise, notifyPromise);\n
} catch(e) {\n
rejectPromise(e);\n
}\n
};\n
\n
function onerror(event) {\n
if (config.onerror) {\n
config.onerror(event.detail);\n
}\n
}\n
\n
var invokeCallback = function(type, promise, callback, event) {\n
var hasCallback = isFunction(callback),\n
value, error, succeeded, failed;\n
\n
if (promise.isFulfilled) { return; }\n
if (promise.isRejected) { return; }\n
\n
if (hasCallback) {\n
try {\n
value = callback(event.detail);\n
succeeded = true;\n
} catch(e) {\n
failed = true;\n
error = e;\n
}\n
} else {\n
value = event.detail;\n
succeeded = true;\n
}\n
\n
if (handleThenable(promise, value)) {\n
return;\n
} else if (hasCallback && succeeded) {\n
resolve(promise, value);\n
} else if (failed) {\n
reject(promise, error);\n
} else if (type === \'resolve\') {\n
resolve(promise, value);\n
} else if (type === \'reject\') {\n
reject(promise, value);\n
}\n
};\n
\n
\n
var invokeNotifyCallback = function(promise, callback, event) {\n
var value;\n
if (typeof callback === \'function\') {\n
try {\n
value = callback(event.detail);\n
} catch (e) {\n
// stop propagating\n
return;\n
}\n
notify(promise, value);\n
} else {\n
notify(promise, event.detail);\n
}\n
};\n
\n
Promise.prototype = {\n
constructor: Promise,\n
\n
isRejected: undefined,\n
isFulfilled: undefined,\n
rejectedReason: undefined,\n
fulfillmentValue: undefined,\n
\n
then: function(done, fail, progress) {\n
this.off(\'error\', onerror);\n
\n
var thenPromise = new this.constructor(function() {},\n
function () {\n
thenPromise.trigger(\'promise:cancelled\', {});\n
});\n
\n
if (this.isFulfilled) {\n
config.async(function(promise) {\n
invokeCallback(\'resolve\', thenPromise, done, { detail: promise.fulfillmentValue });\n
}, this);\n
}\n
\n
if (this.isRejected) {\n
config.async(function(promise) {\n
invokeCallback(\'reject\', thenPromise, fail, { detail: promise.rejectedReason });\n
}, this);\n
}\n
\n
this.on(\'promise:resolved\', function(event) {\n
invokeCallback(\'resolve\', thenPromise, done, event);\n
});\n
\n
this.on(\'promise:failed\', function(event) {\n
invokeCallback(\'reject\', thenPromise, fail, event);\n
});\n
\n
this.on(\'promise:notified\', function (event) {\n
invokeNotifyCallback(thenPromise, progress, event);\n
});\n
\n
return thenPromise;\n
},\n
\n
fail: function(fail) {\n
return this.then(null, fail);\n
},\n
\n
always: function(fail) {\n
return this.then(fail, fail);\n
}\n
};\n
\n
EventTarget.mixin(Promise.prototype);\n
\n
function resolve(promise, value) {\n
if (promise === value) {\n
fulfill(promise, value);\n
} else if (!handleThenable(promise, value)) {\n
fulfill(promise, value);\n
}\n
}\n
\n
function handleThenable(promise, value) {\n
var then = null,\n
resolved;\n
\n
try {\n
if (promise === value) {\n
throw new TypeError("A promises callback cannot return that same promise.");\n
}\n
\n
if (objectOrFunction(value)) {\n
then = value.then;\n
\n
if (isFunction(then)) {\n
if (isFunction(value.on)) {\n
value.on(\'promise:notified\', function (event) {\n
notify(promise, event.detail);\n
});\n
}\n
promise.on(\'promise:cancelled\', function(event) {\n
if (isFunction(value.cancel)) {\n
value.cancel();\n
}\n
});\n
then.call(value, function(val) {\n
if (resolved) { return true; }\n
resolved = true;\n
\n
if (value !== val) {\n
resolve(promise, val);\n
} else {\n
fulfill(promise, val);\n
}\n
}, function(val) {\n
if (resolved) { return true; }\n
resolved = true;\n
\n
reject(promise, val);\n
});\n
\n
return true;\n
}\n
}\n
} catch (error) {\n
reject(promise, error);\n
return true;\n
}\n
\n
return false;\n
}\n
\n
function fulfill(promise, value) {\n
config.async(function() {\n
if (promise.isFulfilled) { return; }\n
if (promise.isRejected) { return; }\n
promise.trigger(\'promise:resolved\', { detail: value });\n
promise.isFulfilled = true;\n
promise.fulfillmentValue = value;\n
});\n
}\n
\n
function reject(promise, value) {\n
config.async(function() {\n
if (promise.isFulfilled) { return; }\n
if (promise.isRejected) { return; }\n
promise.trigger(\'promise:failed\', { detail: value });\n
promise.isRejected = true;\n
promise.rejectedReason = value;\n
});\n
}\n
\n
function notify(promise, value) {\n
config.async(function() {\n
promise.trigger(\'promise:notified\', { detail: value });\n
});\n
}\n
\n
\n
__exports__.Promise = Promise;\n
});\n
define("rsvp/queue",\n
["rsvp/promise","rsvp/timeout","exports"],\n
function(__dependency1__, __dependency2__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
var delay = __dependency2__.delay;\n
\n
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n
function ResolvedQueueError(message) {\n
this.name = "resolved";\n
if ((message !== undefined) && (typeof message !== "string")) {\n
throw new TypeError(\'You must pass a string.\');\n
}\n
this.message = message || "Default Message";\n
}\n
ResolvedQueueError.prototype = new Error();\n
ResolvedQueueError.prototype.constructor = ResolvedQueueError;\n
\n
var Queue = function() {\n
var queue = this,\n
promise_list = [],\n
promise,\n
fulfill,\n
reject,\n
notify,\n
resolved;\n
\n
if (!(this instanceof Queue)) {\n
return new Queue();\n
}\n
\n
function canceller() {\n
for (var i = 0; i < 2; i++) {\n
promise_list[i].cancel();\n
}\n
}\n
\n
promise = new Promise(function(done, fail, progress) {\n
fulfill = function (fulfillmentValue) {\n
if (resolved) {return;}\n
queue.isFulfilled = true;\n
queue.fulfillmentValue = fulfillmentValue;\n
resolved = true;\n
return done(fulfillmentValue);\n
};\n
reject = function (rejectedReason) {\n
if (resolved) {return;}\n
queue.isRejected = true;\n
queue.rejectedReason = rejectedReason ;\n
resolved = true;\n
return fail(rejectedReason);\n
};\n
notify = progress;\n
}, canceller);\n
\n
promise_list.push(delay());\n
promise_list.push(promise_list[0].then(function () {\n
promise_list.splice(0, 2);\n
if (promise_list.length === 0) {\n
fulfill();\n
}\n
}));\n
\n
queue.cancel = function () {\n
if (resolved) {return;}\n
resolved = true;\n
promise.cancel();\n
promise.fail(function (rejectedReason) {\n
queue.isRejected = true;\n
queue.rejectedReason = rejectedReason;\n
});\n
};\n
queue.then = function () {\n
return promise.then.apply(promise, arguments);\n
};\n
\n
queue.push = function(done, fail, progress) {\n
var last_promise = promise_list[promise_list.length - 1],\n
next_promise;\n
\n
if (resolved) {\n
throw new ResolvedQueueError();\n
}\n
\n
next_promise = last_promise.then(done, fail, progress);\n
promise_list.push(next_promise);\n
\n
// Handle pop\n
last_promise = next_promise.then(function (fulfillmentValue) {\n
promise_list.splice(0, 2);\n
if (promise_list.length === 0) {\n
fulfill(fulfillmentValue);\n
} else {\n
return fulfillmentValue;\n
}\n
}, function (rejectedReason) {\n
promise_list.splice(0, 2);\n
if (promise_list.length === 0) {\n
reject(rejectedReason);\n
} else {\n
throw rejectedReason;\n
}\n
}, function (notificationValue) {\n
if (promise_list[promise_list.length - 1] === last_promise) {\n
notify(notificationValue);\n
}\n
return notificationValue;\n
});\n
promise_list.push(last_promise);\n
\n
return this;\n
};\n
};\n
\n
Queue.prototype = Object.create(Promise.prototype);\n
Queue.prototype.constructor = Queue;\n
\n
\n
__exports__.Queue = Queue;\n
__exports__.ResolvedQueueError = ResolvedQueueError;\n
});\n
define("rsvp/reject",\n
["rsvp/promise","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
\n
function reject(reason) {\n
return new Promise(function (resolve, reject) {\n
reject(reason);\n
});\n
}\n
\n
\n
__exports__.reject = reject;\n
});\n
define("rsvp/resolve",\n
["rsvp/promise","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
\n
function resolve(thenable) {\n
return new Promise(function(resolve, reject) {\n
if (typeof thenable === "object" && thenable !== null) {\n
var then = thenable.then;\n
if ((then !== undefined) && (typeof then === "function")) {\n
return then.apply(thenable, [resolve, reject]);\n
}\n
}\n
return resolve(thenable);\n
}, function () {\n
if ((thenable !== undefined) && (thenable.cancel !== undefined)) {\n
thenable.cancel();\n
}\n
});\n
}\n
\n
\n
__exports__.resolve = resolve;\n
});\n
define("rsvp/rethrow",\n
["exports"],\n
function(__exports__) {\n
"use strict";\n
var local = (typeof global === "undefined") ? this : global;\n
\n
function rethrow(reason) {\n
local.setTimeout(function() {\n
throw reason;\n
});\n
throw reason;\n
}\n
\n
\n
__exports__.rethrow = rethrow;\n
});\n
define("rsvp/timeout",\n
["rsvp/promise","exports"],\n
function(__dependency1__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
\n
function promiseSetTimeout(millisecond, should_reject, message) {\n
var timeout_id;\n
\n
function resolver(resolve, reject) {\n
timeout_id = setTimeout(function () {\n
if (should_reject) {\n
reject(message);\n
} else {\n
resolve(message);\n
}\n
}, millisecond);\n
}\n
function canceller() {\n
clearTimeout(timeout_id);\n
}\n
return new Promise(resolver, canceller);\n
}\n
\n
function delay(millisecond, message) {\n
return promiseSetTimeout(millisecond, false, message);\n
}\n
\n
function timeout(millisecond) {\n
return promiseSetTimeout(millisecond, true,\n
"Timed out after " + millisecond + " ms");\n
}\n
\n
Promise.prototype.delay = function(millisecond) {\n
return this.then(function (fulfillmentValue) {\n
return delay(millisecond, fulfillmentValue);\n
});\n
};\n
\n
\n
__exports__.delay = delay;\n
__exports__.timeout = timeout;\n
});\n
define("rsvp/watcher",\n
["rsvp/promise","rsvp/queue","rsvp/cancellation_error","exports"],\n
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n
"use strict";\n
var Promise = __dependency1__.Promise;\n
var Queue = __dependency2__.Queue;\n
var CancellationError = __dependency3__.CancellationError;\n
\n
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n
function ResolvedMonitorError(message) {\n
this.name = "resolved";\n
if ((message !== undefined) && (typeof message !== "string")) {\n
throw new TypeError(\'You must pass a string.\');\n
}\n
this.message = message || "Default Message";\n
}\n
ResolvedMonitorError.prototype = new Error();\n
ResolvedMonitorError.prototype.constructor = ResolvedMonitorError;\n
\n
function isFunction(x){\n
return typeof x === "function";\n
}\n
\n
var Monitor = function() {\n
var monitor = this,\n
promise_list = [],\n
promise,\n
reject,\n
notify,\n
resolved;\n
\n
if (!(this instanceof Monitor)) {\n
return new Monitor();\n
}\n
\n
function canceller() {\n
var len = promise_list.length,\n
i;\n
for (i = 0; i < len; i += 1) {\n
promise_list[i].cancel();\n
}\n
// Clean it to speed up other canceller run\n
promise_list = [];\n
}\n
\n
promise = new Promise(function(done, fail, progress) {\n
reject = function (rejectedReason) {\n
if (resolved) {return;}\n
monitor.isRejected = true;\n
monitor.rejectedReason = rejectedReason ;\n
resolved = true;\n
canceller();\n
return fail(rejectedReason);\n
};\n
notify = progress;\n
}, canceller);\n
\n
monitor.cancel = function () {\n
if (resolved) {return;}\n
resolved = true;\n
promise.cancel();\n
promise.fail(function (rejectedReason) {\n
monitor.isRejected = true;\n
monitor.rejectedReason = rejectedReason;\n
});\n
};\n
monitor.then = function () {\n
return promise.then.apply(promise, arguments);\n
};\n
\n
monitor.monitor = function(promise_to_monitor) {\n
if (resolved) {\n
throw new ResolvedMonitorError();\n
}\n
var queue = new Queue()\n
.push(function () {\n
return promise_to_monitor;\n
})\n
.push(function (fulfillmentValue) {\n
// Promise to monitor is fullfilled, remove it from the list\n
var len = promise_list.length,\n
promise_to_monitor,\n
new_promise_list = [],\n
i;\n
for (i = 0; i < len; i += 1) {\n
promise_to_monitor = promise_list[i];\n
if (!(promise_to_monitor.isFulfilled ||\n
promise_to_monitor.isRejected)) {\n
new_promise_list.push(promise_to_monitor);\n
}\n
}\n
promise_list = new_promise_list;\n
}, function (rejectedReason) {\n
if (rejectedReason instanceof CancellationError) {\n
if (!(promise_to_monitor.isFulfilled && promise_to_monitor.isRejected)) {\n
// The queue could be cancelled before the first push is run\n
promise_to_monitor.cancel();\n
}\n
}\n
reject(rejectedReason);\n
throw rejectedReason;\n
}, function (notificationValue) {\n
notify(notificationValue);\n
return notificationValue;\n
});\n
\n
promise_list.push(queue);\n
\n
return this;\n
};\n
};\n
\n
Monitor.prototype = Object.create(Promise.prototype);\n
Monitor.prototype.constructor = Monitor;\n
\n
\n
__exports__.Monitor = Monitor;\n
__exports__.ResolvedMonitorError = ResolvedMonitorError;\n
});\n
define("rsvp",\n
["rsvp/events","rsvp/cancellation_error","rsvp/promise","rsvp/node","rsvp/all","rsvp/queue","rsvp/watcher","rsvp/timeout","rsvp/hash","rsvp/rethrow","rsvp/defer","rsvp/config","rsvp/resolve","rsvp/reject","exports"],\n
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __exports__) {\n
"use strict";\n
var EventTarget = __dependency1__.EventTarget;\n
var CancellationError = __dependency2__.CancellationError;\n
var Promise = __dependency3__.Promise;\n
var denodeify = __dependency4__.denodeify;\n
var all = __dependency5__.all;\n
var any = __dependency5__.any;\n
var Queue = __dependency6__.Queue;\n
var ResolvedQueueError = __dependency6__.ResolvedQueueError;\n
var Monitor = __dependency7__.Monitor;\n
var ResolvedMonitorError = __dependency7__.ResolvedMonitorError;\n
var delay = __dependency8__.delay;\n
var timeout = __dependency8__.timeout;\n
var hash = __dependency9__.hash;\n
var rethrow = __dependency10__.rethrow;\n
var defer = __dependency11__.defer;\n
var config = __dependency12__.config;\n
var resolve = __dependency13__.resolve;\n
var reject = __dependency14__.reject;\n
\n
function configure(name, value) {\n
config[name] = value;\n
}\n
\n
\n
__exports__.CancellationError = CancellationError;\n
__exports__.Promise = Promise;\n
__exports__.EventTarget = EventTarget;\n
__exports__.all = all;\n
__exports__.any = any;\n
__exports__.Queue = Queue;\n
__exports__.ResolvedQueueError = ResolvedQueueError;\n
__exports__.Monitor = Monitor;\n
__exports__.ResolvedMonitorError = ResolvedMonitorError;\n
__exports__.delay = delay;\n
__exports__.timeout = timeout;\n
__exports__.hash = hash;\n
__exports__.rethrow = rethrow;\n
__exports__.defer = defer;\n
__exports__.denodeify = denodeify;\n
__exports__.configure = configure;\n
__exports__.resolve = resolve;\n
__exports__.reject = reject;\n
});\n
window.RSVP = requireModule("rsvp");\n
})(window);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>30923</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,77 +2,63 @@ from Products.Formulator.Field import ZMIField
from Products.Formulator import Widget
from Products.Formulator.DummyField import fields
from Products.Formulator import Validator
from zLOG import LOG
from zLOG import LOG, ERROR
class GadgetWidget(Widget.TextWidget):
"""
A widget that displays a renderjs gadget
"""
property_names = Widget.TextWidget.property_names + \
['gadget_html', 'gadget_cached', 'gadget_cache_id', 'gadget_property',
'gadget_connection', 'gadget_id']
['gadget_url', 'js_sandbox']
gadget_html = fields.StringField('gadget_html',
title='Gadget Html',
description=("The id of the html page containing the \
gadget_url = fields.StringField('gadget_url',
title='Gadget Url',
description=("The url of the html page containing the \
gadget"),
default='',
required=0)
gadget_id = fields.StringField('gadget_id',
title='Gadget Id',
description=("The id of the gadget"),
js_sandbox = fields.StringField('js_sandbox',
title='Gadget Sandbox',
description=("Gadget sandbox"),
default='',
required=0)
gadget_cache_id = fields.StringField('gadget_cache_id',
title='Gadget Cache Id',
description=("The id of the cache in localstorage"),
default='',
required=0)
gadget_property = fields.StringField('gadget_property',
title='Gadget Properties',
description=("Json Data used to initialize the gadget"),
default='',
required=0)
gadget_connection = fields.StringField('gadget_connection',
title='Gadget Connections',
description=("Json Data used to define interactions"),
default='',
required=0)
gadget_cached = fields.CheckBoxField('gadget_cached',
title='Gadget Cached',
description=("The rendering of the gadget will be \
cached in localstorage."),
default=0,
required=0)
def render(self, field, key, value, REQUEST, render_prefix=None):
return self.render_view(field, value, REQUEST, render_prefix)
return self.render_view(field, value, REQUEST, render_prefix, key)
def render_view(self, field, value, REQUEST=None, render_prefix=None):
def render_view(self, field, value, REQUEST=None, render_prefix=None, key=None):
kw = {}
gadget_mapping = {"gadget_cached": "data-gadget-cacheable",
"gadget_cache_id": "data-gadget-cache-id",
"gadget_html": "data-gadget",
"gadget_id": "id",
"gadget_connection": "data-gadget-connection",
"gadget_property": "data-gadget-property"}
for property_name in gadget_mapping.keys():
property_value = field.get_value(property_name)
if property_value or property_name=="gadget_html":
kw[gadget_mapping[property_name]] = property_value
return Widget.render_element("div",
kw['data-gadget-url'] = field.get_value('gadget_url')
kw['data-gadget-scope'] = field.id
if key is not None:
kw['editable'] = key
kw['class'] = "gadget"
kw['value'] = value
kw['data-gadget-sandbox'] = field.get_value('js_sandbox')
return Widget.render_element("section",
**kw)
def get_javascript_list(self, field, REQUEST=None):
"""
Returns list of javascript needed by the widget
"""
js_list = ['rsvp.js', 'renderjs.js', 'erp5_gadgetfield.js',
'jio_sha256.amd.js', 'jio.js']
result = []
try:
for js_file in js_list:
result.append(field.restrictedTraverse(js_file).absolute_url())
except KeyError:
LOG('keyError:', ERROR, 'Error Value: %s' % js_file)
return []
return result
GadgetWidgetInstance = GadgetWidget()
class GadgetField(ZMIField):
""" Gadget field
"""
meta_type = "GadgetField"
widget = GadgetWidgetInstance
......
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