Commit 55c5ddd3 authored by Romain Courteaud's avatar Romain Courteaud Committed by Sebastien Robin

WIP full javascript ERP5 rendering.

parent 46321547
<?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>version_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>33.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Versions</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}/Document_viewVersionList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</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}/WebPage_view</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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> <string>python: object is not None and not object.isWebMode()</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_editor</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.1</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit</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}/WebPage_viewEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</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}/WebManifest_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:object is not None and object.isWebMode() and object.hasBaseData() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>version_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>33.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Versions</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}/Document_viewVersionList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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> <string>python: object is not None and not object.isWebMode()</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</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}/WebPage_viewEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_editor</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.1</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit</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}/WebPage_view</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</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}/WebScript_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:object is not None and object.isWebMode() and object.hasBaseData() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>version_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>33.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Versions</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}/Document_viewVersionList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</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}/WebPage_view</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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> <string>python: object is not None and not object.isWebMode()</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_editor</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.1</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit</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}/WebPage_viewEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</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}/WebStyle_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:object is not None and object.isWebMode() and object.hasBaseData() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
def Listbox_getListMethodName(self, field):
""" XXXX"""
list_method = field.get_value('list_method')
try:
list_method_name = getattr(list_method, 'method_name')
except AttributeError:
list_method_name = list_method
return list_method_name
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>RSVP.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_RSVP_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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>title</string> </key>
<value> <string>RSVP</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>URI.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>/*! URI.js v1.12.0 http://medialize.github.com/URI.js/ */\n
/* build contains: IPv6.js, punycode.js, SecondLevelDomains.js, URI.js, URI.fragmentQuery.js */</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_URI_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*! URI.js v1.12.0 http://medialize.github.com/URI.js/ */\n
/* build contains: IPv6.js, punycode.js, SecondLevelDomains.js, URI.js, URI.fragmentQuery.js */\n
(function(e,k){"object"===typeof exports?module.exports=k():"function"===typeof define&&define.amd?define(k):e.IPv6=k(e)})(this,function(e){var k=e&&e.IPv6;return{best:function(e){e=e.toLowerCase().split(":");var k=e.length,d=8;""===e[0]&&""===e[1]&&""===e[2]?(e.shift(),e.shift()):""===e[0]&&""===e[1]?e.shift():""===e[k-1]&&""===e[k-2]&&e.pop();k=e.length;-1!==e[k-1].indexOf(".")&&(d=7);var g;for(g=0;g<k&&""!==e[g];g++);if(g<d)for(e.splice(g,1,"0000");e.length<d;)e.splice(g,0,"0000");for(g=0;g<d;g++){for(var k=\n
e[g].split(""),q=0;3>q;q++)if("0"===k[0]&&1<k.length)k.splice(0,1);else break;e[g]=k.join("")}var k=-1,l=q=0,r=-1,z=!1;for(g=0;g<d;g++)z?"0"===e[g]?l+=1:(z=!1,l>q&&(k=r,q=l)):"0"==e[g]&&(z=!0,r=g,l=1);l>q&&(k=r,q=l);1<q&&e.splice(k,q,"");k=e.length;d="";""===e[0]&&(beststr=":");for(g=0;g<k;g++){d+=e[g];if(g===k-1)break;d+=":"}""===e[k-1]&&(d+=":");return d},noConflict:function(){e.IPv6===this&&(e.IPv6=k);return this}}});\n
(function(e){function k(a){throw RangeError(p[a]);}function u(a,b){for(var c=a.length;c--;)a[c]=b(a[c]);return a}function m(a,b){return u(a.split(h),b).join(".")}function d(a){for(var b=[],c=0,d=a.length,h,p;c<d;)h=a.charCodeAt(c++),55296<=h&&56319>=h&&c<d?(p=a.charCodeAt(c++),56320==(p&64512)?b.push(((h&1023)<<10)+(p&1023)+65536):(b.push(h),c--)):b.push(h);return b}function g(a){return u(a,function(a){var b="";65535<a&&(a-=65536,b+=x(a>>>10&1023|55296),a=56320|a&1023);return b+=x(a)}).join("")}function q(a,\n
b){return a+22+75*(26>a)-((0!=b)<<5)}function l(a,b,c){var d=0;a=c?A(a/H):a>>1;for(a+=A(a/b);a>n*y>>1;d+=s)a=A(a/n);return A(d+(n+1)*a/(a+I))}function r(b){var c=[],d=b.length,h,p=0,e=F,f=G,n,x,q,t,m;n=b.lastIndexOf(a);0>n&&(n=0);for(x=0;x<n;++x)128<=b.charCodeAt(x)&&k("not-basic"),c.push(b.charCodeAt(x));for(n=0<n?n+1:0;n<d;){x=p;h=1;for(q=s;;q+=s){n>=d&&k("invalid-input");t=b.charCodeAt(n++);t=10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:s;(t>=s||t>A((w-p)/h))&&k("overflow");p+=t*h;m=q<=f?v:q>=f+y?y:\n
q-f;if(t<m)break;t=s-m;h>A(w/t)&&k("overflow");h*=t}h=c.length+1;f=l(p-x,h,0==x);A(p/h)>w-e&&k("overflow");e+=A(p/h);p%=h;c.splice(p++,0,e)}return g(c)}function z(b){var c,h,p,e,f,n,g,m,r,t=[],B,u,z;b=d(b);B=b.length;c=F;h=0;f=G;for(n=0;n<B;++n)r=b[n],128>r&&t.push(x(r));for((p=e=t.length)&&t.push(a);p<B;){g=w;for(n=0;n<B;++n)r=b[n],r>=c&&r<g&&(g=r);u=p+1;g-c>A((w-h)/u)&&k("overflow");h+=(g-c)*u;c=g;for(n=0;n<B;++n)if(r=b[n],r<c&&++h>w&&k("overflow"),r==c){m=h;for(g=s;;g+=s){r=g<=f?v:g>=f+y?y:g-f;\n
if(m<r)break;z=m-r;m=s-r;t.push(x(q(r+z%m,0)));m=A(z/m)}t.push(x(q(m,0)));f=l(h,u,p==e);h=0;++p}++h;++c}return t.join("")}var D="object"==typeof exports&&exports,E="object"==typeof module&&module&&module.exports==D&&module,C="object"==typeof global&&global;if(C.global===C||C.window===C)e=C;var f,w=2147483647,s=36,v=1,y=26,I=38,H=700,G=72,F=128,a="-",b=/^xn--/,c=/[^ -~]/,h=/\\x2E|\\u3002|\\uFF0E|\\uFF61/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)",\n
"invalid-input":"Invalid input"},n=s-v,A=Math.floor,x=String.fromCharCode,B;f={version:"1.2.3",ucs2:{decode:d,encode:g},decode:r,encode:z,toASCII:function(a){return m(a,function(a){return c.test(a)?"xn--"+z(a):a})},toUnicode:function(a){return m(a,function(a){return b.test(a)?r(a.slice(4).toLowerCase()):a})}};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return f});else if(D&&!D.nodeType)if(E)E.exports=f;else for(B in f)f.hasOwnProperty(B)&&(D[B]=f[B]);else e.punycode=\n
f})(this);\n
(function(e,k){"object"===typeof exports?module.exports=k():"function"===typeof define&&define.amd?define(k):e.SecondLevelDomains=k(e)})(this,function(e){var k=e&&e.SecondLevelDomains,u=Object.prototype.hasOwnProperty,m={list:{ac:"com|gov|mil|net|org",ae:"ac|co|gov|mil|name|net|org|pro|sch",af:"com|edu|gov|net|org",al:"com|edu|gov|mil|net|org",ao:"co|ed|gv|it|og|pb",ar:"com|edu|gob|gov|int|mil|net|org|tur",at:"ac|co|gv|or",au:"asn|com|csiro|edu|gov|id|net|org",ba:"co|com|edu|gov|mil|net|org|rs|unbi|unmo|unsa|untz|unze",bb:"biz|co|com|edu|gov|info|net|org|store|tv",\n
bh:"biz|cc|com|edu|gov|info|net|org",bn:"com|edu|gov|net|org",bo:"com|edu|gob|gov|int|mil|net|org|tv",br:"adm|adv|agr|am|arq|art|ato|b|bio|blog|bmd|cim|cng|cnt|com|coop|ecn|edu|eng|esp|etc|eti|far|flog|fm|fnd|fot|fst|g12|ggf|gov|imb|ind|inf|jor|jus|lel|mat|med|mil|mus|net|nom|not|ntr|odo|org|ppg|pro|psc|psi|qsl|rec|slg|srv|tmp|trd|tur|tv|vet|vlog|wiki|zlg",bs:"com|edu|gov|net|org",bz:"du|et|om|ov|rg",ca:"ab|bc|mb|nb|nf|nl|ns|nt|nu|on|pe|qc|sk|yk",ck:"biz|co|edu|gen|gov|info|net|org",cn:"ac|ah|bj|com|cq|edu|fj|gd|gov|gs|gx|gz|ha|hb|he|hi|hl|hn|jl|js|jx|ln|mil|net|nm|nx|org|qh|sc|sd|sh|sn|sx|tj|tw|xj|xz|yn|zj",\n
co:"com|edu|gov|mil|net|nom|org",cr:"ac|c|co|ed|fi|go|or|sa",cy:"ac|biz|com|ekloges|gov|ltd|name|net|org|parliament|press|pro|tm","do":"art|com|edu|gob|gov|mil|net|org|sld|web",dz:"art|asso|com|edu|gov|net|org|pol",ec:"com|edu|fin|gov|info|med|mil|net|org|pro",eg:"com|edu|eun|gov|mil|name|net|org|sci",er:"com|edu|gov|ind|mil|net|org|rochest|w",es:"com|edu|gob|nom|org",et:"biz|com|edu|gov|info|name|net|org",fj:"ac|biz|com|info|mil|name|net|org|pro",fk:"ac|co|gov|net|nom|org",fr:"asso|com|f|gouv|nom|prd|presse|tm",\n
gg:"co|net|org",gh:"com|edu|gov|mil|org",gn:"ac|com|gov|net|org",gr:"com|edu|gov|mil|net|org",gt:"com|edu|gob|ind|mil|net|org",gu:"com|edu|gov|net|org",hk:"com|edu|gov|idv|net|org",id:"ac|co|go|mil|net|or|sch|web",il:"ac|co|gov|idf|k12|muni|net|org","in":"ac|co|edu|ernet|firm|gen|gov|i|ind|mil|net|nic|org|res",iq:"com|edu|gov|i|mil|net|org",ir:"ac|co|dnssec|gov|i|id|net|org|sch",it:"edu|gov",je:"co|net|org",jo:"com|edu|gov|mil|name|net|org|sch",jp:"ac|ad|co|ed|go|gr|lg|ne|or",ke:"ac|co|go|info|me|mobi|ne|or|sc",\n
kh:"com|edu|gov|mil|net|org|per",ki:"biz|com|de|edu|gov|info|mob|net|org|tel",km:"asso|com|coop|edu|gouv|k|medecin|mil|nom|notaires|pharmaciens|presse|tm|veterinaire",kn:"edu|gov|net|org",kr:"ac|busan|chungbuk|chungnam|co|daegu|daejeon|es|gangwon|go|gwangju|gyeongbuk|gyeonggi|gyeongnam|hs|incheon|jeju|jeonbuk|jeonnam|k|kg|mil|ms|ne|or|pe|re|sc|seoul|ulsan",kw:"com|edu|gov|net|org",ky:"com|edu|gov|net|org",kz:"com|edu|gov|mil|net|org",lb:"com|edu|gov|net|org",lk:"assn|com|edu|gov|grp|hotel|int|ltd|net|ngo|org|sch|soc|web",\n
lr:"com|edu|gov|net|org",lv:"asn|com|conf|edu|gov|id|mil|net|org",ly:"com|edu|gov|id|med|net|org|plc|sch",ma:"ac|co|gov|m|net|org|press",mc:"asso|tm",me:"ac|co|edu|gov|its|net|org|priv",mg:"com|edu|gov|mil|nom|org|prd|tm",mk:"com|edu|gov|inf|name|net|org|pro",ml:"com|edu|gov|net|org|presse",mn:"edu|gov|org",mo:"com|edu|gov|net|org",mt:"com|edu|gov|net|org",mv:"aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro",mw:"ac|co|com|coop|edu|gov|int|museum|net|org",mx:"com|edu|gob|net|org",my:"com|edu|gov|mil|name|net|org|sch",\n
nf:"arts|com|firm|info|net|other|per|rec|store|web",ng:"biz|com|edu|gov|mil|mobi|name|net|org|sch",ni:"ac|co|com|edu|gob|mil|net|nom|org",np:"com|edu|gov|mil|net|org",nr:"biz|com|edu|gov|info|net|org",om:"ac|biz|co|com|edu|gov|med|mil|museum|net|org|pro|sch",pe:"com|edu|gob|mil|net|nom|org|sld",ph:"com|edu|gov|i|mil|net|ngo|org",pk:"biz|com|edu|fam|gob|gok|gon|gop|gos|gov|net|org|web",pl:"art|bialystok|biz|com|edu|gda|gdansk|gorzow|gov|info|katowice|krakow|lodz|lublin|mil|net|ngo|olsztyn|org|poznan|pwr|radom|slupsk|szczecin|torun|warszawa|waw|wroc|wroclaw|zgora",\n
pr:"ac|biz|com|edu|est|gov|info|isla|name|net|org|pro|prof",ps:"com|edu|gov|net|org|plo|sec",pw:"belau|co|ed|go|ne|or",ro:"arts|com|firm|info|nom|nt|org|rec|store|tm|www",rs:"ac|co|edu|gov|in|org",sb:"com|edu|gov|net|org",sc:"com|edu|gov|net|org",sh:"co|com|edu|gov|net|nom|org",sl:"com|edu|gov|net|org",st:"co|com|consulado|edu|embaixada|gov|mil|net|org|principe|saotome|store",sv:"com|edu|gob|org|red",sz:"ac|co|org",tr:"av|bbs|bel|biz|com|dr|edu|gen|gov|info|k12|name|net|org|pol|tel|tsk|tv|web",tt:"aero|biz|cat|co|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel",\n
tw:"club|com|ebiz|edu|game|gov|idv|mil|net|org",mu:"ac|co|com|gov|net|or|org",mz:"ac|co|edu|gov|org",na:"co|com",nz:"ac|co|cri|geek|gen|govt|health|iwi|maori|mil|net|org|parliament|school",pa:"abo|ac|com|edu|gob|ing|med|net|nom|org|sld",pt:"com|edu|gov|int|net|nome|org|publ",py:"com|edu|gov|mil|net|org",qa:"com|edu|gov|mil|net|org",re:"asso|com|nom",ru:"ac|adygeya|altai|amur|arkhangelsk|astrakhan|bashkiria|belgorod|bir|bryansk|buryatia|cbg|chel|chelyabinsk|chita|chukotka|chuvashia|com|dagestan|e-burg|edu|gov|grozny|int|irkutsk|ivanovo|izhevsk|jar|joshkar-ola|kalmykia|kaluga|kamchatka|karelia|kazan|kchr|kemerovo|khabarovsk|khakassia|khv|kirov|koenig|komi|kostroma|kranoyarsk|kuban|kurgan|kursk|lipetsk|magadan|mari|mari-el|marine|mil|mordovia|mosreg|msk|murmansk|nalchik|net|nnov|nov|novosibirsk|nsk|omsk|orenburg|org|oryol|penza|perm|pp|pskov|ptz|rnd|ryazan|sakhalin|samara|saratov|simbirsk|smolensk|spb|stavropol|stv|surgut|tambov|tatarstan|tom|tomsk|tsaritsyn|tsk|tula|tuva|tver|tyumen|udm|udmurtia|ulan-ude|vladikavkaz|vladimir|vladivostok|volgograd|vologda|voronezh|vrn|vyatka|yakutia|yamal|yekaterinburg|yuzhno-sakhalinsk",\n
rw:"ac|co|com|edu|gouv|gov|int|mil|net",sa:"com|edu|gov|med|net|org|pub|sch",sd:"com|edu|gov|info|med|net|org|tv",se:"a|ac|b|bd|c|d|e|f|g|h|i|k|l|m|n|o|org|p|parti|pp|press|r|s|t|tm|u|w|x|y|z",sg:"com|edu|gov|idn|net|org|per",sn:"art|com|edu|gouv|org|perso|univ",sy:"com|edu|gov|mil|net|news|org",th:"ac|co|go|in|mi|net|or",tj:"ac|biz|co|com|edu|go|gov|info|int|mil|name|net|nic|org|test|web",tn:"agrinet|com|defense|edunet|ens|fin|gov|ind|info|intl|mincom|nat|net|org|perso|rnrt|rns|rnu|tourism",tz:"ac|co|go|ne|or",\n
ua:"biz|cherkassy|chernigov|chernovtsy|ck|cn|co|com|crimea|cv|dn|dnepropetrovsk|donetsk|dp|edu|gov|if|in|ivano-frankivsk|kh|kharkov|kherson|khmelnitskiy|kiev|kirovograd|km|kr|ks|kv|lg|lugansk|lutsk|lviv|me|mk|net|nikolaev|od|odessa|org|pl|poltava|pp|rovno|rv|sebastopol|sumy|te|ternopil|uzhgorod|vinnica|vn|zaporizhzhe|zhitomir|zp|zt",ug:"ac|co|go|ne|or|org|sc",uk:"ac|bl|british-library|co|cym|gov|govt|icnet|jet|lea|ltd|me|mil|mod|national-library-scotland|nel|net|nhs|nic|nls|org|orgn|parliament|plc|police|sch|scot|soc",\n
us:"dni|fed|isa|kids|nsn",uy:"com|edu|gub|mil|net|org",ve:"co|com|edu|gob|info|mil|net|org|web",vi:"co|com|k12|net|org",vn:"ac|biz|com|edu|gov|health|info|int|name|net|org|pro",ye:"co|com|gov|ltd|me|net|org|plc",yu:"ac|co|edu|gov|org",za:"ac|agric|alt|bourse|city|co|cybernet|db|edu|gov|grondar|iaccess|imt|inca|landesign|law|mil|net|ngo|nis|nom|olivetti|org|pix|school|tm|web",zm:"ac|co|com|edu|gov|net|org|sch"},has_expression:null,is_expression:null,has:function(d){return!!d.match(m.has_expression)},\n
is:function(d){return!!d.match(m.is_expression)},get:function(d){return(d=d.match(m.has_expression))&&d[1]||null},noConflict:function(){e.SecondLevelDomains===this&&(e.SecondLevelDomains=k);return this},init:function(){var d="",e;for(e in m.list)u.call(m.list,e)&&(d+="|("+("("+m.list[e]+")."+e)+")");m.has_expression=RegExp("\\\\.("+d.substr(1)+")$","i");m.is_expression=RegExp("^("+d.substr(1)+")$","i")}};m.init();return m});\n
(function(e,k){"object"===typeof exports?module.exports=k(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],k):e.URI=k(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(this,function(e,k,u,m){function d(a,b){if(!(this instanceof d))return new d(a,b);void 0===a&&(a="undefined"!==typeof location?location.href+"":"");this.href(a);return void 0!==b?this.absoluteTo(b):this}function g(a){return a.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\n
"\\\\$1")}function q(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function l(a){return"Array"===q(a)}function r(a,b){var c,d;if(l(b)){c=0;for(d=b.length;c<d;c++)if(!r(a,b[c]))return!1;return!0}var p=q(b);c=0;for(d=a.length;c<d;c++)if("RegExp"===p){if("string"===typeof a[c]&&a[c].match(b))return!0}else if(a[c]===b)return!0;return!1}function z(a,b){if(!l(a)||!l(b)||a.length!==b.length)return!1;a.sort();b.sort();for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;\n
return!0}function D(a){return escape(a)}function E(a){return encodeURIComponent(a).replace(/[!\'()*]/g,D).replace(/\\*/g,"%2A")}var C=m&&m.URI;d.version="1.12.0";var f=d.prototype,w=Object.prototype.hasOwnProperty;d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}};d.duplicateQueryParameters=!1;d.escapeQuerySpace=!0;d.protocol_expression=\n
/^[a-z][a-z0-9.+-]*$/i;d.idn_expression=/[^a-z0-9\\.-]/i;d.punycode_expression=/(xn--)/i;d.ip4_expression=/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;d.ip6_expression=/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/;\n
d.find_uri_expression=/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\'".,<>?\\u00ab\\u00bb\\u201c\\u201d\\u2018\\u2019]))/ig;d.findUri={start:/\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,end:/[\\s\\r\\n]|$/,trim:/[`!()\\[\\]{};:\'".,<>?\\u00ab\\u00bb\\u201c\\u201d\\u201e\\u2018\\u2019]+$/};d.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};d.invalid_hostname_characters=\n
/[^a-zA-Z0-9\\.-]/;d.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"};d.getDomAttribute=function(a){if(a&&a.nodeName){var b=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void 0:d.domAttributes[b]}};d.encode=E;d.decode=decodeURIComponent;d.iso8859=function(){d.encode=escape;d.decode=unescape};d.unicode=function(){d.encode=E;d.decode=decodeURIComponent};d.characters=\n
{pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\\/\\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"\'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}};d.encodeQuery=\n
function(a,b){var c=d.encode(a+"");return b?c.replace(/%20/g,"+"):c};d.decodeQuery=function(a,b){a+="";try{return d.decode(b?a.replace(/\\+/g,"%20"):a)}catch(c){return a}};d.recodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=d.encodePathSegment(d.decode(a[b]));return a.join("/")};d.decodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=d.decodePathSegment(a[b]);return a.join("/")};var s={encode:"encode",decode:"decode"},v,y=function(a,b){return function(c){return d[b](c+\n
"").replace(d.characters[a][b].expression,function(c){return d.characters[a][b].map[c]})}};for(v in s)d[v+"PathSegment"]=y("pathname",s[v]);d.encodeReserved=y("reserved","encode");d.parse=function(a,b){var c;b||(b={});c=a.indexOf("#");-1<c&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c));c=a.indexOf("?");-1<c&&(b.query=a.substring(c+1)||null,a=a.substring(0,c));"//"===a.substring(0,2)?(b.protocol=null,a=a.substring(2),a=d.parseAuthority(a,b)):(c=a.indexOf(":"),-1<c&&(b.protocol=a.substring(0,\n
c)||null,b.protocol&&!b.protocol.match(d.protocol_expression)?b.protocol=void 0:"file"===b.protocol?a=a.substring(c+3):"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=d.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0)));b.path=a;return b};d.parseHost=function(a,b){var c=a.indexOf("/"),d;-1===c&&(c=a.length);"["===a.charAt(0)?(d=a.indexOf("]"),b.hostname=a.substring(1,d)||null,b.port=a.substring(d+2,c)||null):a.indexOf(":")!==a.lastIndexOf(":")?(b.hostname=a.substring(0,c)||null,b.port=null):(d=\n
a.substring(0,c).split(":"),b.hostname=d[0]||null,b.port=d[1]||null);b.hostname&&"/"!==a.substring(c).charAt(0)&&(c++,a="/"+a);return a.substring(c)||"/"};d.parseAuthority=function(a,b){a=d.parseUserinfo(a,b);return d.parseHost(a,b)};d.parseUserinfo=function(a,b){var c=a.indexOf("/"),h=-1<c?a.lastIndexOf("@",c):a.indexOf("@");-1<h&&(-1===c||h<c)?(c=a.substring(0,h).split(":"),b.username=c[0]?d.decode(c[0]):null,c.shift(),b.password=c[0]?d.decode(c.join(":")):null,a=a.substring(h+1)):(b.username=null,\n
b.password=null);return a};d.parseQuery=function(a,b){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\\?*&*|&+$/g,"");if(!a)return{};for(var c={},h=a.split("&"),p=h.length,n,e,f=0;f<p;f++)n=h[f].split("="),e=d.decodeQuery(n.shift(),b),n=n.length?d.decodeQuery(n.join("="),b):null,c[e]?("string"===typeof c[e]&&(c[e]=[c[e]]),c[e].push(n)):c[e]=n;return c};d.build=function(a){var b="";a.protocol&&(b+=a.protocol+":");a.urn||!b&&!a.hostname||(b+="//");b+=d.buildAuthority(a)||"";"string"===typeof a.path&&\n
("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(b+="/"),b+=a.path);"string"===typeof a.query&&a.query&&(b+="?"+a.query);"string"===typeof a.fragment&&a.fragment&&(b+="#"+a.fragment);return b};d.buildHost=function(a){var b="";if(a.hostname)d.ip6_expression.test(a.hostname)?b=a.port?b+("["+a.hostname+"]:"+a.port):b+a.hostname:(b+=a.hostname,a.port&&(b+=":"+a.port));else return"";return b};d.buildAuthority=function(a){return d.buildUserinfo(a)+d.buildHost(a)};d.buildUserinfo=function(a){var b=\n
"";a.username&&(b+=d.encode(a.username),a.password&&(b+=":"+d.encode(a.password)),b+="@");return b};d.buildQuery=function(a,b,c){var h="",p,e,f,k;for(e in a)if(w.call(a,e)&&e)if(l(a[e]))for(p={},f=0,k=a[e].length;f<k;f++)void 0!==a[e][f]&&void 0===p[a[e][f]+""]&&(h+="&"+d.buildQueryParameter(e,a[e][f],c),!0!==b&&(p[a[e][f]+""]=!0));else void 0!==a[e]&&(h+="&"+d.buildQueryParameter(e,a[e],c));return h.substring(1)};d.buildQueryParameter=function(a,b,c){return d.encodeQuery(a,c)+(null!==b?"="+d.encodeQuery(b,\n
c):"")};d.addQuery=function(a,b,c){if("object"===typeof b)for(var h in b)w.call(b,h)&&d.addQuery(a,h,b[h]);else if("string"===typeof b)void 0===a[b]?a[b]=c:("string"===typeof a[b]&&(a[b]=[a[b]]),l(c)||(c=[c]),a[b]=a[b].concat(c));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};d.removeQuery=function(a,b,c){var h;if(l(b))for(c=0,h=b.length;c<h;c++)a[b[c]]=void 0;else if("object"===typeof b)for(h in b)w.call(b,h)&&d.removeQuery(a,h,b[h]);else if("string"===\n
typeof b)if(void 0!==c)if(a[b]===c)a[b]=void 0;else{if(l(a[b])){h=a[b];var p={},e,f;if(l(c))for(e=0,f=c.length;e<f;e++)p[c[e]]=!0;else p[c]=!0;e=0;for(f=h.length;e<f;e++)void 0!==p[h[e]]&&(h.splice(e,1),f--,e--);a[b]=h}}else a[b]=void 0;else throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");};d.hasQuery=function(a,b,c,h){if("object"===typeof b){for(var e in b)if(w.call(b,e)&&!d.hasQuery(a,e,b[e]))return!1;return!0}if("string"!==typeof b)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");\n
switch(q(c)){case "Undefined":return b in a;case "Boolean":return a=Boolean(l(a[b])?a[b].length:a[b]),c===a;case "Function":return!!c(a[b],b,a);case "Array":return l(a[b])?(h?r:z)(a[b],c):!1;case "RegExp":return l(a[b])?h?r(a[b],c):!1:Boolean(a[b]&&a[b].match(c));case "Number":c=String(c);case "String":return l(a[b])?h?r(a[b],c):!1:a[b]===c;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};d.commonPath=function(a,b){var c=\n
Math.min(a.length,b.length),d;for(d=0;d<c;d++)if(a.charAt(d)!==b.charAt(d)){d--;break}if(1>d)return a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(d)||"/"!==b.charAt(d))d=a.substring(0,d).lastIndexOf("/");return a.substring(0,d+1)};d.withinString=function(a,b,c){c||(c={});var h=c.start||d.findUri.start,e=c.end||d.findUri.end,f=c.trim||d.findUri.trim,k=/[a-z0-9-]=["\']?$/i;for(h.lastIndex=0;;){var g=h.exec(a);if(!g)break;g=g.index;if(c.ignoreHtml){var l=a.slice(Math.max(g-3,0),\n
g);if(l&&k.test(l))continue}var l=g+a.slice(g).search(e),q=a.slice(g,l).replace(f,"");c.ignore&&c.ignore.test(q)||(l=g+q.length,q=b(q,g,l,a),a=a.slice(0,g)+q+a.slice(l),h.lastIndex=g+q.length)}h.lastIndex=0;return a};d.ensureValidHostname=function(a){if(a.match(d.invalid_hostname_characters)){if(!e)throw new TypeError("Hostname \'"+a+"\' contains characters other than [A-Z0-9.-] and Punycode.js is not available");if(e.toASCII(a).match(d.invalid_hostname_characters))throw new TypeError("Hostname \'"+\n
a+"\' contains characters other than [A-Z0-9.-]");}};d.noConflict=function(a){if(a)return a={URI:this.noConflict()},URITemplate&&"function"==typeof URITemplate.noConflict&&(a.URITemplate=URITemplate.noConflict()),k&&"function"==typeof k.noConflict&&(a.IPv6=k.noConflict()),SecondLevelDomains&&"function"==typeof SecondLevelDomains.noConflict&&(a.SecondLevelDomains=SecondLevelDomains.noConflict()),a;m.URI===this&&(m.URI=C);return this};f.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0===\n
a||this._deferred_build)this._string=d.build(this._parts),this._deferred_build=!1;return this};f.clone=function(){return new d(this)};f.valueOf=f.toString=function(){return this.build(!1)._string};s={protocol:"protocol",username:"username",password:"password",hostname:"hostname",port:"port"};y=function(a){return function(b,c){if(void 0===b)return this._parts[a]||"";this._parts[a]=b||null;this.build(!c);return this}};for(v in s)f[v]=y(s[v]);s={query:"?",fragment:"#"};y=function(a,b){return function(c,\n
d){if(void 0===c)return this._parts[a]||"";null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1)));this._parts[a]=c;this.build(!d);return this}};for(v in s)f[v]=y(v,s[v]);s={search:["?","query"],hash:["#","fragment"]};y=function(a,b){return function(c,d){var e=this[a](c,d);return"string"===typeof e&&e.length?b+e:e}};for(v in s)f[v]=y(s[v][1],s[v][0]);f.pathname=function(a,b){if(void 0===a||!0===a){var c=this._parts.path||(this._parts.hostname?"/":"");return a?d.decodePath(c):c}this._parts.path=a?d.recodePath(a):\n
"/";this.build(!b);return this};f.path=f.pathname;f.href=function(a,b){var c;if(void 0===a)return this.toString();this._string="";this._parts=d._parts();var h=a instanceof d,e="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(e=d.getDomAttribute(a),a=a[e]||"",e=!1);!h&&e&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a)this._parts=d.parse(a,this._parts);else if(h||e)for(c in h=h?a._parts:a,h)w.call(this._parts,c)&&(this._parts[c]=h[c]);else throw new TypeError("invalid input");\n
this.build(!b);return this};f.is=function(a){var b=!1,c=!1,h=!1,e=!1,f=!1,g=!1,k=!1,l=!this._parts.urn;this._parts.hostname&&(l=!1,c=d.ip4_expression.test(this._parts.hostname),h=d.ip6_expression.test(this._parts.hostname),b=c||h,f=(e=!b)&&u&&u.has(this._parts.hostname),g=e&&d.idn_expression.test(this._parts.hostname),k=e&&d.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return l;case "absolute":return!l;case "domain":case "name":return e;case "sld":return f;\n
case "ip":return b;case "ip4":case "ipv4":case "inet4":return c;case "ip6":case "ipv6":case "inet6":return h;case "idn":return g;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return k}return null};var I=f.protocol,H=f.port,G=f.hostname;f.protocol=function(a,b){if(void 0!==a&&a&&(a=a.replace(/:(\\/\\/)?$/,""),!a.match(d.protocol_expression)))throw new TypeError("Protocol \'"+a+"\' contains characters other than [A-Z0-9.+-] or doesn\'t start with [A-Z]");return I.call(this,\n
a,b)};f.scheme=f.protocol;f.port=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError("Port \'"+a+"\' contains characters other than [0-9]");return H.call(this,a,b)};f.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={};d.parseHost(a,c);a=c.hostname}return G.call(this,a,b)};f.host=function(a,b){if(this._parts.urn)return void 0===a?"":this;\n
if(void 0===a)return this._parts.hostname?d.buildHost(this._parts):"";d.parseHost(a,this._parts);this.build(!b);return this};f.authority=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?d.buildAuthority(this._parts):"";d.parseAuthority(a,this._parts);this.build(!b);return this};f.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var c=d.buildUserinfo(this._parts);return c.substring(0,\n
c.length-1)}"@"!==a[a.length-1]&&(a+="@");d.parseUserinfo(a,this._parts);this.build(!b);return this};f.resource=function(a,b){var c;if(void 0===a)return this.path()+this.search()+this.hash();c=d.parse(a);this._parts.path=c.path;this._parts.query=c.query;this._parts.fragment=c.fragment;this.build(!b);return this};f.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.length-this.domain().length-\n
1;return this._parts.hostname.substring(0,c)||""}c=this._parts.hostname.length-this.domain().length;c=this._parts.hostname.substring(0,c);c=RegExp("^"+g(c));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&d.ensureValidHostname(a);this._parts.hostname=this._parts.hostname.replace(c,a);this.build(!b);return this};f.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.match(/\\./g);\n
if(c&&2>c.length)return this._parts.hostname;c=this._parts.hostname.length-this.tld(b).length-1;c=this._parts.hostname.lastIndexOf(".",c-1)+1;return this._parts.hostname.substring(c)||""}if(!a)throw new TypeError("cannot set domain empty");d.ensureValidHostname(a);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(c=RegExp(g(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a));this.build(!b);return this};f.tld=function(a,b){if(this._parts.urn)return void 0===a?"":\n
this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.lastIndexOf("."),c=this._parts.hostname.substring(c+1);return!0!==b&&u&&u.list[c.toLowerCase()]?u.get(this._parts.hostname)||c:c}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(u&&u.is(a))c=RegExp(g(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a);else throw new TypeError("TLD \'"+a+"\' contains characters other than [A-Z0-9]");else{if(!this._parts.hostname||\n
this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=RegExp(g(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError("cannot set TLD empty");this.build(!b);return this};f.directory=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var c=this._parts.path.length-this.filename().length-1,c=this._parts.path.substring(0,\n
c)||(this._parts.hostname?"/":"");return a?d.decodePath(c):c}c=this._parts.path.length-this.filename().length;c=this._parts.path.substring(0,c);c=RegExp("^"+g(c));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=d.recodePath(a);this._parts.path=this._parts.path.replace(c,a);this.build(!b);return this};f.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";\n
var c=this._parts.path.lastIndexOf("/"),c=this._parts.path.substring(c+1);return a?d.decodePathSegment(c):c}c=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\\.?\\//)&&(c=!0);var h=RegExp(g(this.filename())+"$");a=d.recodePath(a);this._parts.path=this._parts.path.replace(h,a);c?this.normalizePath(b):this.build(!b);return this};f.suffix=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var c=this.filename(),h=c.lastIndexOf(".");\n
if(-1===h)return"";c=c.substring(h+1);c=/^[a-z0-9%]+$/i.test(c)?c:"";return a?d.decodePathSegment(c):c}"."===a.charAt(0)&&(a=a.substring(1));if(c=this.suffix())h=a?RegExp(g(c)+"$"):RegExp(g("."+c)+"$");else{if(!a)return this;this._parts.path+="."+d.recodePath(a)}h&&(a=d.recodePath(a),this._parts.path=this._parts.path.replace(h,a));this.build(!b);return this};f.segment=function(a,b,c){var d=this._parts.urn?":":"/",e=this.path(),f="/"===e.substring(0,1),e=e.split(d);void 0!==a&&"number"!==typeof a&&\n
(c=b,b=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error("Bad segment \'"+a+"\', must be 0-based integer");f&&e.shift();0>a&&(a=Math.max(e.length+a,0));if(void 0===b)return void 0===a?e:e[a];if(null===a||void 0===e[a])if(l(b)){e=[];a=0;for(var g=b.length;a<g;a++)if(b[a].length||e.length&&e[e.length-1].length)e.length&&!e[e.length-1].length&&e.pop(),e.push(b[a])}else{if(b||"string"===typeof b)""===e[e.length-1]?e[e.length-1]=b:e.push(b)}else b||"string"===typeof b&&b.length?e[a]=b:e.splice(a,\n
1);f&&e.unshift("");return this.path(e.join(d),c)};f.segmentCoded=function(a,b,c){var e,f;"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0===b){a=this.segment(a,b,c);if(l(a))for(e=0,f=a.length;e<f;e++)a[e]=d.decode(a[e]);else a=void 0!==a?d.decode(a):void 0;return a}if(l(b))for(e=0,f=b.length;e<f;e++)b[e]=d.decode(b[e]);else b="string"===typeof b?d.encode(b):b;return this.segment(a,b,c)};var F=f.query;f.query=function(a,b){if(!0===a)return d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);\n
if("function"===typeof a){var c=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace),e=a.call(this,c);this._parts.query=d.buildQuery(e||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!b);return this}return void 0!==a&&"string"!==typeof a?(this._parts.query=d.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):F.call(this,a,b)};f.setQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);\n
if("object"===typeof a)for(var f in a)w.call(a,f)&&(e[f]=a[f]);else if("string"===typeof a)e[a]=void 0!==b?b:null;else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};f.addQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);d.addQuery(e,a,void 0===b?null:b);this._parts.query=\n
d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};f.removeQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);d.removeQuery(e,a,b);this._parts.query=d.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};f.hasQuery=function(a,b,c){var e=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);\n
return d.hasQuery(e,a,b,c)};f.setSearch=f.setQuery;f.addSearch=f.addQuery;f.removeSearch=f.removeQuery;f.hasSearch=f.hasQuery;f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};f.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),\n
this.build(!a));return this};f.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&k&&(this._parts.hostname=k.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a));return this};f.normalizePort=function(a){"string"===typeof this._parts.protocol&&this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};f.normalizePath=\n
function(a){if(this._parts.urn||!this._parts.path||"/"===this._parts.path)return this;var b,c=this._parts.path,e="",f,g;"/"!==c.charAt(0)&&(b=!0,c="/"+c);c=c.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g,"/").replace(/\\/{2,}/g,"/");b&&(e=c.substring(1).match(/^(\\.\\.\\/)+/)||"")&&(e=e[0]);for(;;){f=c.indexOf("/..");if(-1===f)break;else if(0===f){c=c.substring(3);continue}g=c.substring(0,f).lastIndexOf("/");-1===g&&(g=f);c=c.substring(0,g)+c.substring(f+3)}b&&this.is("relative")&&(c=e+c.substring(1));c=d.recodePath(c);\n
this._parts.path=c;this.build(!a);return this};f.normalizePathname=f.normalizePath;f.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a));return this};f.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};f.normalizeSearch=f.normalizeQuery;f.normalizeHash=f.normalizeFragment;f.iso8859=function(){var a=\n
d.encode,b=d.decode;d.encode=escape;d.decode=decodeURIComponent;this.normalize();d.encode=a;d.decode=b;return this};f.unicode=function(){var a=d.encode,b=d.decode;d.encode=E;d.decode=unescape;this.normalize();d.encode=a;d.decode=b;return this};f.readable=function(){var a=this.clone();a.username("").password("").normalize();var b="";a._parts.protocol&&(b+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&e?(b+=e.toUnicode(a._parts.hostname),a._parts.port&&(b+=":"+a._parts.port)):b+=a.host());\n
a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(b+="/");b+=a.path(!0);if(a._parts.query){for(var c="",f=0,g=a._parts.query.split("&"),k=g.length;f<k;f++){var l=(g[f]||"").split("="),c=c+("&"+d.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"));void 0!==l[1]&&(c+="="+d.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}b+="?"+c.substring(1)}return b+=d.decodeQuery(a.hash(),!0)};f.absoluteTo=function(a){var b=this.clone(),c=["protocol","username",\n
"password","hostname","port"],e,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof d||(a=new d(a));b._parts.protocol||(b._parts.protocol=a._parts.protocol);if(this._parts.hostname)return b;for(e=0;f=c[e];e++)b._parts[f]=a._parts[f];b._parts.path?".."===b._parts.path.substring(-2)&&(b._parts.path+="/"):(b._parts.path=a._parts.path,b._parts.query||(b._parts.query=a._parts.query));"/"!==b.path().charAt(0)&&(a=a.directory(),b._parts.path=(a?\n
a+"/":"")+b._parts.path,b.normalizePath());b.build();return b};f.relativeTo=function(a){var b=this.clone().normalize(),c,e,f,g;if(b._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new d(a)).normalize();c=b._parts;e=a._parts;f=b.path();g=a.path();if("/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==g.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");c.protocol===e.protocol&&(c.protocol=null);if(c.username===\n
e.username&&c.password===e.password&&null===c.protocol&&null===c.username&&null===c.password&&c.hostname===e.hostname&&c.port===e.port)c.hostname=null,c.port=null;else return b.build();if(f===g)return c.path="",b.build();a=d.commonPath(b.path(),a.path());if(!a)return b.build();e=e.path.substring(a.length).replace(/[^\\/]*$/,"").replace(/.*?\\//g,"../");c.path=e+c.path.substring(a.length);return b.build()};f.equals=function(a){var b=this.clone();a=new d(a);var c={},e={},f={},g;b.normalize();a.normalize();\n
if(b.toString()===a.toString())return!0;c=b.query();e=a.query();b.query("");a.query("");if(b.toString()!==a.toString()||c.length!==e.length)return!1;c=d.parseQuery(c,this._parts.escapeQuerySpace);e=d.parseQuery(e,this._parts.escapeQuerySpace);for(g in c)if(w.call(c,g)){if(!l(c[g])){if(c[g]!==e[g])return!1}else if(!z(c[g],e[g]))return!1;f[g]=!0}for(g in e)if(w.call(e,g)&&!f[g])return!1;return!0};f.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};f.escapeQuerySpace=\n
function(a){this._parts.escapeQuerySpace=!!a;return this};return d});\n
(function(e,k){"object"===typeof exports?module.exports=k(require("./URI")):"function"===typeof define&&define.amd?define(["./URI"],k):k(e.URI)})(this,function(e){var k=e.prototype,u=k.fragment;e.fragmentPrefix="?";var m=e._parts;e._parts=function(){var d=m();d.fragmentPrefix=e.fragmentPrefix;return d};k.fragmentPrefix=function(d){this._parts.fragmentPrefix=d;return this};k.fragment=function(d,g){var k=this._parts.fragmentPrefix,l=this._parts.fragment||"";return!0===d?l.substring(0,k.length)!==k?\n
{}:e.parseQuery(l.substring(k.length)):void 0!==d&&"string"!==typeof d?(this._parts.fragment=k+e.buildQuery(d),this.build(!g),this):u.call(this,d,g)};k.addFragment=function(d,g,k){var l=this._parts.fragmentPrefix,m=e.parseQuery((this._parts.fragment||"").substring(l.length));e.addQuery(m,d,g);this._parts.fragment=l+e.buildQuery(m);"string"!==typeof d&&(k=g);this.build(!k);return this};k.removeFragment=function(d,g,k){var l=this._parts.fragmentPrefix,m=e.parseQuery((this._parts.fragment||"").substring(l.length));\n
e.removeQuery(m,d,g);this._parts.fragment=l+e.buildQuery(m);"string"!==typeof d&&(k=g);this.build(!k);return this};k.addHash=k.addFragment;k.removeHash=k.removeFragment;return{}});
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>URI.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>1.12.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_dialog.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_dialog_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>.CodeMirror-dialog {\n
position: absolute;\n
left: 0; right: 0;\n
background: white;\n
z-index: 15;\n
padding: .1em .8em;\n
overflow: hidden;\n
color: #333;\n
}\n
\n
.CodeMirror-dialog-top {\n
border-bottom: 1px solid #eee;\n
top: 0;\n
}\n
\n
.CodeMirror-dialog-bottom {\n
border-top: 1px solid #eee;\n
bottom: 0;\n
}\n
\n
.CodeMirror-dialog input {\n
border: none;\n
outline: none;\n
background: transparent;\n
width: 20em;\n
color: inherit;\n
font-family: monospace;\n
}\n
\n
.CodeMirror-dialog button {\n
font-size: 70%;\n
}\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Codemirror Addon Dialog CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_dialog.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_dialog_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
// Open simple dialogs on top of an editor. Relies on dialog.css.\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
function dialogDiv(cm, template, bottom) {\n
var wrap = cm.getWrapperElement();\n
var dialog;\n
dialog = wrap.appendChild(document.createElement("div"));\n
if (bottom) {\n
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";\n
} else {\n
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";\n
}\n
if (typeof template == "string") {\n
dialog.innerHTML = template;\n
} else { // Assuming it\'s a detached DOM element.\n
dialog.appendChild(template);\n
}\n
return dialog;\n
}\n
\n
function closeNotification(cm, newVal) {\n
if (cm.state.currentNotificationClose)\n
cm.state.currentNotificationClose();\n
cm.state.currentNotificationClose = newVal;\n
}\n
\n
CodeMirror.defineExtension("openDialog", function(template, callback, options) {\n
closeNotification(this, null);\n
var dialog = dialogDiv(this, template, options && options.bottom);\n
var closed = false, me = this;\n
function close(newVal) {\n
if (typeof newVal == \'string\') {\n
inp.value = newVal;\n
} else {\n
if (closed) return;\n
closed = true;\n
dialog.parentNode.removeChild(dialog);\n
}\n
}\n
var inp = dialog.getElementsByTagName("input")[0], button;\n
if (inp) {\n
if (options && options.value) inp.value = options.value;\n
CodeMirror.on(inp, "keydown", function(e) {\n
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n
if (e.keyCode == 13 || e.keyCode == 27) {\n
inp.blur();\n
CodeMirror.e_stop(e);\n
close();\n
me.focus();\n
if (e.keyCode == 13) callback(inp.value);\n
}\n
});\n
if (options && options.onKeyUp) {\n
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});\n
}\n
if (options && options.value) inp.value = options.value;\n
inp.focus();\n
CodeMirror.on(inp, "blur", close);\n
} else if (button = dialog.getElementsByTagName("button")[0]) {\n
CodeMirror.on(button, "click", function() {\n
close();\n
me.focus();\n
});\n
button.focus();\n
CodeMirror.on(button, "blur", close);\n
}\n
return close;\n
});\n
\n
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {\n
closeNotification(this, null);\n
var dialog = dialogDiv(this, template, options && options.bottom);\n
var buttons = dialog.getElementsByTagName("button");\n
var closed = false, me = this, blurring = 1;\n
function close() {\n
if (closed) return;\n
closed = true;\n
dialog.parentNode.removeChild(dialog);\n
me.focus();\n
}\n
buttons[0].focus();\n
for (var i = 0; i < buttons.length; ++i) {\n
var b = buttons[i];\n
(function(callback) {\n
CodeMirror.on(b, "click", function(e) {\n
CodeMirror.e_preventDefault(e);\n
close();\n
if (callback) callback(me);\n
});\n
})(callbacks[i]);\n
CodeMirror.on(b, "blur", function() {\n
--blurring;\n
setTimeout(function() { if (blurring <= 0) close(); }, 200);\n
});\n
CodeMirror.on(b, "focus", function() { ++blurring; });\n
}\n
});\n
\n
/*\n
* openNotification\n
* Opens a notification, that can be closed with an optional timer\n
* (default 5000ms timer) and always closes on click.\n
*\n
* If a notification is opened while another is opened, it will close the\n
* currently opened one and open the new one immediately.\n
*/\n
CodeMirror.defineExtension("openNotification", function(template, options) {\n
closeNotification(this, close);\n
var dialog = dialogDiv(this, template, options && options.bottom);\n
var duration = options && (options.duration === undefined ? 5000 : options.duration);\n
var closed = false, doneTimer;\n
\n
function close() {\n
if (closed) return;\n
closed = true;\n
clearTimeout(doneTimer);\n
dialog.parentNode.removeChild(dialog);\n
}\n
\n
CodeMirror.on(dialog, \'click\', function(e) {\n
CodeMirror.e_preventDefault(e);\n
close();\n
});\n
if (duration)\n
doneTimer = setTimeout(close, options.duration);\n
});\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Addon Dialog</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_display_fullscreen.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_display_fullscreen_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>.CodeMirror-fullscreen {\n
position: fixed;\n
top: 0; left: 0; right: 0; bottom: 0;\n
height: auto;\n
z-index: 9;\n
}\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Codemirror Addon Display Fullscreen CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>002</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_display_fullscreen.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_display_fullscreen_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
"use strict";\n
\n
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {\n
if (old == CodeMirror.Init) old = false;\n
if (!old == !val) return;\n
if (val) setFullscreen(cm);\n
else setNormal(cm);\n
});\n
\n
function setFullscreen(cm) {\n
var wrap = cm.getWrapperElement();\n
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,\n
width: wrap.style.width, height: wrap.style.height};\n
wrap.style.width = "";\n
wrap.style.height = "auto";\n
wrap.className += " CodeMirror-fullscreen";\n
document.documentElement.style.overflow = "hidden";\n
cm.refresh();\n
}\n
\n
function setNormal(cm) {\n
var wrap = cm.getWrapperElement();\n
wrap.className = wrap.className.replace(/\\s*CodeMirror-fullscreen\\b/, "");\n
document.documentElement.style.overflow = "";\n
var info = cm.state.fullScreenRestore;\n
wrap.style.width = info.width; wrap.style.height = info.height;\n
window.scrollTo(info.scrollLeft, info.scrollTop);\n
cm.refresh();\n
}\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Addon Display Fullscreen</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_edit_matchbrackets.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_edit_matchbrackets_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n
(document.documentMode == null || document.documentMode < 8);\n
\n
var Pos = CodeMirror.Pos;\n
\n
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};\n
\n
function findMatchingBracket(cm, where, strict, config) {\n
var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];\n
if (!match) return null;\n
var dir = match.charAt(1) == ">" ? 1 : -1;\n
if (strict && (dir > 0) != (pos == where.ch)) return null;\n
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n
\n
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);\n
if (found == null) return null;\n
return {from: Pos(where.line, pos), to: found && found.pos,\n
match: found && found.ch == match.charAt(0), forward: dir > 0};\n
}\n
\n
// bracketRegex is used to specify which type of bracket to scan\n
// should be a regexp, e.g. /[[\\]]/\n
//\n
// Note: If "where" is on an open bracket, then this bracket is ignored.\n
//\n
// Returns false when no bracket was found, null when it reached\n
// maxScanLines and gave up\n
function scanForBracket(cm, where, dir, style, config) {\n
var maxScanLen = (config && config.maxScanLineLength) || 10000;\n
var maxScanLines = (config && config.maxScanLines) || 1000;\n
\n
var stack = [];\n
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\\]]/;\n
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n
var line = cm.getLine(lineNo);\n
if (!line) continue;\n
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n
if (line.length > maxScanLen) continue;\n
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n
for (; pos != end; pos += dir) {\n
var ch = line.charAt(pos);\n
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {\n
var match = matching[ch];\n
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);\n
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n
else stack.pop();\n
}\n
}\n
}\n
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n
}\n
\n
function matchBrackets(cm, autoclear, config) {\n
// Disable brace matching in long lines, since it\'ll cause hugely slow updates\n
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;\n
var marks = [], ranges = cm.listSelections();\n
for (var i = 0; i < ranges.length; i++) {\n
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);\n
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {\n
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";\n
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n
}\n
}\n
\n
if (marks.length) {\n
// Kludge to work around the IE bug from issue #1193, where text\n
// input stops going to the textare whever this fires.\n
if (ie_lt8 && cm.state.focused) cm.display.input.focus();\n
\n
var clear = function() {\n
cm.operation(function() {\n
for (var i = 0; i < marks.length; i++) marks[i].clear();\n
});\n
};\n
if (autoclear) setTimeout(clear, 800);\n
else return clear;\n
}\n
}\n
\n
var currentlyHighlighted = null;\n
function doMatchBrackets(cm) {\n
cm.operation(function() {\n
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}\n
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n
});\n
}\n
\n
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {\n
if (old && old != CodeMirror.Init)\n
cm.off("cursorActivity", doMatchBrackets);\n
if (val) {\n
cm.state.matchBrackets = typeof val == "object" ? val : {};\n
cm.on("cursorActivity", doMatchBrackets);\n
}\n
});\n
\n
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});\n
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){\n
return findMatchingBracket(this, pos, strict, config);\n
});\n
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){\n
return scanForBracket(this, pos, dir, style, config);\n
});\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Addon Edit MatchBracket</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_addon_searchcursor.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_addon_searchcursor_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
"use strict";\n
var Pos = CodeMirror.Pos;\n
\n
function SearchCursor(doc, query, pos, caseFold) {\n
this.atOccurrence = false; this.doc = doc;\n
if (caseFold == null && typeof query == "string") caseFold = false;\n
\n
pos = pos ? doc.clipPos(pos) : Pos(0, 0);\n
this.pos = {from: pos, to: pos};\n
\n
// The matches method is filled in based on the type of query.\n
// It takes a position and a direction, and returns an object\n
// describing the next occurrence of the query, or null if no\n
// more matches were found.\n
if (typeof query != "string") { // Regexp match\n
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");\n
this.matches = function(reverse, pos) {\n
if (reverse) {\n
query.lastIndex = 0;\n
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;\n
for (;;) {\n
query.lastIndex = cutOff;\n
var newMatch = query.exec(line);\n
if (!newMatch) break;\n
match = newMatch;\n
start = match.index;\n
cutOff = match.index + (match[0].length || 1);\n
if (cutOff == line.length) break;\n
}\n
var matchLen = (match && match[0].length) || 0;\n
if (!matchLen) {\n
if (start == 0 && line.length == 0) {match = undefined;}\n
else if (start != doc.getLine(pos.line).length) {\n
matchLen++;\n
}\n
}\n
} else {\n
query.lastIndex = pos.ch;\n
var line = doc.getLine(pos.line), match = query.exec(line);\n
var matchLen = (match && match[0].length) || 0;\n
var start = match && match.index;\n
if (start + matchLen != line.length && !matchLen) matchLen = 1;\n
}\n
if (match && matchLen)\n
return {from: Pos(pos.line, start),\n
to: Pos(pos.line, start + matchLen),\n
match: match};\n
};\n
} else { // String query\n
var origQuery = query;\n
if (caseFold) query = query.toLowerCase();\n
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};\n
var target = query.split("\\n");\n
// Different methods for single-line and multi-line queries\n
if (target.length == 1) {\n
if (!query.length) {\n
// Empty string would match anything and never progress, so\n
// we define it to match nothing instead.\n
this.matches = function() {};\n
} else {\n
this.matches = function(reverse, pos) {\n
if (reverse) {\n
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);\n
var match = line.lastIndexOf(query);\n
if (match > -1) {\n
match = adjustPos(orig, line, match);\n
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};\n
}\n
} else {\n
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);\n
var match = line.indexOf(query);\n
if (match > -1) {\n
match = adjustPos(orig, line, match) + pos.ch;\n
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};\n
}\n
}\n
};\n
}\n
} else {\n
var origTarget = origQuery.split("\\n");\n
this.matches = function(reverse, pos) {\n
var last = target.length - 1;\n
if (reverse) {\n
if (pos.line - (target.length - 1) < doc.firstLine()) return;\n
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;\n
var to = Pos(pos.line, origTarget[last].length);\n
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)\n
if (target[i] != fold(doc.getLine(ln))) return;\n
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;\n
if (fold(line.slice(cut)) != target[0]) return;\n
return {from: Pos(ln, cut), to: to};\n
} else {\n
if (pos.line + (target.length - 1) > doc.lastLine()) return;\n
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;\n
if (fold(line.slice(cut)) != target[0]) return;\n
var from = Pos(pos.line, cut);\n
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)\n
if (target[i] != fold(doc.getLine(ln))) return;\n
if (doc.getLine(ln).slice(0, origTarget[last].length) != target[last]) return;\n
return {from: from, to: Pos(ln, origTarget[last].length)};\n
}\n
};\n
}\n
}\n
}\n
\n
SearchCursor.prototype = {\n
findNext: function() {return this.find(false);},\n
findPrevious: function() {return this.find(true);},\n
\n
find: function(reverse) {\n
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n
function savePosAndFail(line) {\n
var pos = Pos(line, 0);\n
self.pos = {from: pos, to: pos};\n
self.atOccurrence = false;\n
return false;\n
}\n
\n
for (;;) {\n
if (this.pos = this.matches(reverse, pos)) {\n
this.atOccurrence = true;\n
return this.pos.match || true;\n
}\n
if (reverse) {\n
if (!pos.line) return savePosAndFail(0);\n
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);\n
}\n
else {\n
var maxLine = this.doc.lineCount();\n
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);\n
pos = Pos(pos.line + 1, 0);\n
}\n
}\n
},\n
\n
from: function() {if (this.atOccurrence) return this.pos.from;},\n
to: function() {if (this.atOccurrence) return this.pos.to;},\n
\n
replace: function(newText) {\n
if (!this.atOccurrence) return;\n
var lines = CodeMirror.splitLines(newText);\n
this.doc.replaceRange(lines, this.pos.from, this.pos.to);\n
this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));\n
}\n
};\n
\n
// Maps a position in a case-folded line back to a position in the original line\n
// (compensating for codepoints increasing in number during folding)\n
function adjustPos(orig, folded, pos) {\n
if (orig.length == folded.length) return pos;\n
for (var pos1 = Math.min(pos, orig.length);;) {\n
var len1 = orig.slice(0, pos1).toLowerCase().length;\n
if (len1 < pos) ++pos1;\n
else if (len1 > pos) --pos1;\n
else return pos1;\n
}\n
}\n
\n
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {\n
return new SearchCursor(this.doc, query, pos, caseFold);\n
});\n
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {\n
return new SearchCursor(this, query, pos, caseFold);\n
});\n
\n
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {\n
var ranges = [], next;\n
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);\n
while (next = cur.findNext()) {\n
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;\n
ranges.push({anchor: cur.from(), head: cur.to()});\n
}\n
if (ranges.length)\n
this.setSelections(ranges, 0);\n
});\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Addon Search SearchCursor</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/* BASICS */\n
\n
.CodeMirror {\n
/* Set height, width, borders, and global font properties here */\n
font-family: monospace;\n
height: 300px;\n
}\n
.CodeMirror-scroll {\n
/* Set scrolling behaviour here */\n
overflow: auto;\n
}\n
\n
/* PADDING */\n
\n
.CodeMirror-lines {\n
padding: 4px 0; /* Vertical padding around content */\n
}\n
.CodeMirror pre {\n
padding: 0 4px; /* Horizontal padding of content */\n
}\n
\n
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n
background-color: white; /* The little square between H and V scrollbars */\n
}\n
\n
/* GUTTER */\n
\n
.CodeMirror-gutters {\n
border-right: 1px solid #ddd;\n
background-color: #f7f7f7;\n
white-space: nowrap;\n
}\n
.CodeMirror-linenumbers {}\n
.CodeMirror-linenumber {\n
padding: 0 3px 0 5px;\n
min-width: 20px;\n
text-align: right;\n
color: #999;\n
-moz-box-sizing: content-box;\n
box-sizing: content-box;\n
}\n
\n
.CodeMirror-guttermarker { color: black; }\n
.CodeMirror-guttermarker-subtle { color: #999; }\n
\n
/* CURSOR */\n
\n
.CodeMirror div.CodeMirror-cursor {\n
border-left: 1px solid black;\n
}\n
/* Shown when moving in bi-directional text */\n
.CodeMirror div.CodeMirror-secondarycursor {\n
border-left: 1px solid silver;\n
}\n
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {\n
width: auto;\n
border: 0;\n
background: #7e7;\n
}\n
.cm-animate-fat-cursor {\n
width: auto;\n
border: 0;\n
-webkit-animation: blink 1.06s steps(1) infinite;\n
-moz-animation: blink 1.06s steps(1) infinite;\n
animation: blink 1.06s steps(1) infinite;\n
}\n
@-moz-keyframes blink {\n
0% { background: #7e7; }\n
50% { background: none; }\n
100% { background: #7e7; }\n
}\n
@-webkit-keyframes blink {\n
0% { background: #7e7; }\n
50% { background: none; }\n
100% { background: #7e7; }\n
}\n
@keyframes blink {\n
0% { background: #7e7; }\n
50% { background: none; }\n
100% { background: #7e7; }\n
}\n
\n
/* Can style cursor different in overwrite (non-insert) mode */\n
div.CodeMirror-overwrite div.CodeMirror-cursor {}\n
\n
.cm-tab { display: inline-block; }\n
\n
.CodeMirror-ruler {\n
border-left: 1px solid #ccc;\n
position: absolute;\n
}\n
\n
/* DEFAULT THEME */\n
\n
.cm-s-default .cm-keyword {color: #708;}\n
.cm-s-default .cm-atom {color: #219;}\n
.cm-s-default .cm-number {color: #164;}\n
.cm-s-default .cm-def {color: #00f;}\n
.cm-s-default .cm-variable,\n
.cm-s-default .cm-punctuation,\n
.cm-s-default .cm-property,\n
.cm-s-default .cm-operator {}\n
.cm-s-default .cm-variable-2 {color: #05a;}\n
.cm-s-default .cm-variable-3 {color: #085;}\n
.cm-s-default .cm-comment {color: #a50;}\n
.cm-s-default .cm-string {color: #a11;}\n
.cm-s-default .cm-string-2 {color: #f50;}\n
.cm-s-default .cm-meta {color: #555;}\n
.cm-s-default .cm-qualifier {color: #555;}\n
.cm-s-default .cm-builtin {color: #30a;}\n
.cm-s-default .cm-bracket {color: #997;}\n
.cm-s-default .cm-tag {color: #170;}\n
.cm-s-default .cm-attribute {color: #00c;}\n
.cm-s-default .cm-header {color: blue;}\n
.cm-s-default .cm-quote {color: #090;}\n
.cm-s-default .cm-hr {color: #999;}\n
.cm-s-default .cm-link {color: #00c;}\n
\n
.cm-negative {color: #d44;}\n
.cm-positive {color: #292;}\n
.cm-header, .cm-strong {font-weight: bold;}\n
.cm-em {font-style: italic;}\n
.cm-link {text-decoration: underline;}\n
\n
.cm-s-default .cm-error {color: #f00;}\n
.cm-invalidchar {color: #f00;}\n
\n
/* Default styles for common addons */\n
\n
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\n
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\n
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n
.CodeMirror-activeline-background {background: #e8f2ff;}\n
\n
/* STOP */\n
\n
/* The rest of this file contains styles related to the mechanics of\n
the editor. You probably shouldn\'t touch them. */\n
\n
.CodeMirror {\n
line-height: 1;\n
position: relative;\n
overflow: hidden;\n
background: white;\n
color: black;\n
}\n
\n
.CodeMirror-scroll {\n
/* 30px is the magic margin used to hide the element\'s real scrollbars */\n
/* See overflow: hidden in .CodeMirror */\n
margin-bottom: -30px; margin-right: -30px;\n
padding-bottom: 30px;\n
height: 100%;\n
outline: none; /* Prevent dragging from highlighting the element */\n
position: relative;\n
-moz-box-sizing: content-box;\n
box-sizing: content-box;\n
}\n
.CodeMirror-sizer {\n
position: relative;\n
border-right: 30px solid transparent;\n
-moz-box-sizing: content-box;\n
box-sizing: content-box;\n
}\n
\n
/* The fake, visible scrollbars. Used to force redraw during scrolling\n
before actuall scrolling happens, thus preventing shaking and\n
flickering artifacts. */\n
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n
position: absolute;\n
z-index: 6;\n
display: none;\n
}\n
.CodeMirror-vscrollbar {\n
right: 0; top: 0;\n
overflow-x: hidden;\n
overflow-y: scroll;\n
}\n
.CodeMirror-hscrollbar {\n
bottom: 0; left: 0;\n
overflow-y: hidden;\n
overflow-x: scroll;\n
}\n
.CodeMirror-scrollbar-filler {\n
right: 0; bottom: 0;\n
}\n
.CodeMirror-gutter-filler {\n
left: 0; bottom: 0;\n
}\n
\n
.CodeMirror-gutters {\n
position: absolute; left: 0; top: 0;\n
padding-bottom: 30px;\n
z-index: 3;\n
}\n
.CodeMirror-gutter {\n
white-space: normal;\n
height: 100%;\n
-moz-box-sizing: content-box;\n
box-sizing: content-box;\n
padding-bottom: 30px;\n
margin-bottom: -32px;\n
display: inline-block;\n
/* Hack to make IE7 behave */\n
*zoom:1;\n
*display:inline;\n
}\n
.CodeMirror-gutter-elt {\n
position: absolute;\n
cursor: default;\n
z-index: 4;\n
}\n
\n
.CodeMirror-lines {\n
cursor: text;\n
}\n
.CodeMirror pre {\n
/* Reset some styles that the rest of the page might have set */\n
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n
border-width: 0;\n
background: transparent;\n
font-family: inherit;\n
font-size: inherit;\n
margin: 0;\n
white-space: pre;\n
word-wrap: normal;\n
line-height: inherit;\n
color: inherit;\n
z-index: 2;\n
position: relative;\n
overflow: visible;\n
}\n
.CodeMirror-wrap pre {\n
word-wrap: break-word;\n
white-space: pre-wrap;\n
word-break: normal;\n
}\n
\n
.CodeMirror-linebackground {\n
position: absolute;\n
left: 0; right: 0; top: 0; bottom: 0;\n
z-index: 0;\n
}\n
\n
.CodeMirror-linewidget {\n
position: relative;\n
z-index: 2;\n
overflow: auto;\n
}\n
\n
.CodeMirror-widget {}\n
\n
.CodeMirror-wrap .CodeMirror-scroll {\n
overflow-x: hidden;\n
}\n
\n
.CodeMirror-measure {\n
position: absolute;\n
width: 100%;\n
height: 0;\n
overflow: hidden;\n
visibility: hidden;\n
}\n
.CodeMirror-measure pre { position: static; }\n
\n
.CodeMirror div.CodeMirror-cursor {\n
position: absolute;\n
border-right: none;\n
width: 0;\n
}\n
\n
div.CodeMirror-cursors {\n
visibility: hidden;\n
position: relative;\n
z-index: 1;\n
}\n
.CodeMirror-focused div.CodeMirror-cursors {\n
visibility: visible;\n
}\n
\n
.CodeMirror-selected { background: #d9d9d9; }\n
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n
.CodeMirror-crosshair { cursor: crosshair; }\n
\n
.cm-searching {\n
background: #ffa;\n
background: rgba(255, 255, 0, .4);\n
}\n
\n
/* IE7 hack to prevent it from returning funny offsetTops on the spans */\n
.CodeMirror span { *vertical-align: text-bottom; }\n
\n
/* Used to force a border model for a node */\n
.cm-force-border { padding-right: .1px; }\n
\n
@media print {\n
/* Hide the cursor when printing */\n
.CodeMirror div.CodeMirror-cursors {\n
visibility: hidden;\n
}\n
}\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</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.
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="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_mode_clike.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_mode_clike_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
"use strict";\n
\n
CodeMirror.defineMode("clike", function(config, parserConfig) {\n
var indentUnit = config.indentUnit,\n
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,\n
dontAlignCalls = parserConfig.dontAlignCalls,\n
keywords = parserConfig.keywords || {},\n
builtin = parserConfig.builtin || {},\n
blockKeywords = parserConfig.blockKeywords || {},\n
atoms = parserConfig.atoms || {},\n
hooks = parserConfig.hooks || {},\n
multiLineStrings = parserConfig.multiLineStrings;\n
var isOperatorChar = /[+\\-*&%=<>!?|\\/]/;\n
\n
var curPunc;\n
\n
function tokenBase(stream, state) {\n
var ch = stream.next();\n
if (hooks[ch]) {\n
var result = hooks[ch](stream, state);\n
if (result !== false) return result;\n
}\n
if (ch == \'"\' || ch == "\'") {\n
state.tokenize = tokenString(ch);\n
return state.tokenize(stream, state);\n
}\n
if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n
curPunc = ch;\n
return null;\n
}\n
if (/\\d/.test(ch)) {\n
stream.eatWhile(/[\\w\\.]/);\n
return "number";\n
}\n
if (ch == "/") {\n
if (stream.eat("*")) {\n
state.tokenize = tokenComment;\n
return tokenComment(stream, state);\n
}\n
if (stream.eat("/")) {\n
stream.skipToEnd();\n
return "comment";\n
}\n
}\n
if (isOperatorChar.test(ch)) {\n
stream.eatWhile(isOperatorChar);\n
return "operator";\n
}\n
stream.eatWhile(/[\\w\\$_]/);\n
var cur = stream.current();\n
if (keywords.propertyIsEnumerable(cur)) {\n
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";\n
return "keyword";\n
}\n
if (builtin.propertyIsEnumerable(cur)) {\n
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";\n
return "builtin";\n
}\n
if (atoms.propertyIsEnumerable(cur)) return "atom";\n
return "variable";\n
}\n
\n
function tokenString(quote) {\n
return function(stream, state) {\n
var escaped = false, next, end = false;\n
while ((next = stream.next()) != null) {\n
if (next == quote && !escaped) {end = true; break;}\n
escaped = !escaped && next == "\\\\";\n
}\n
if (end || !(escaped || multiLineStrings))\n
state.tokenize = null;\n
return "string";\n
};\n
}\n
\n
function tokenComment(stream, state) {\n
var maybeEnd = false, ch;\n
while (ch = stream.next()) {\n
if (ch == "/" && maybeEnd) {\n
state.tokenize = null;\n
break;\n
}\n
maybeEnd = (ch == "*");\n
}\n
return "comment";\n
}\n
\n
function Context(indented, column, type, align, prev) {\n
this.indented = indented;\n
this.column = column;\n
this.type = type;\n
this.align = align;\n
this.prev = prev;\n
}\n
function pushContext(state, col, type) {\n
var indent = state.indented;\n
if (state.context && state.context.type == "statement")\n
indent = state.context.indented;\n
return state.context = new Context(indent, col, type, null, state.context);\n
}\n
function popContext(state) {\n
var t = state.context.type;\n
if (t == ")" || t == "]" || t == "}")\n
state.indented = state.context.indented;\n
return state.context = state.context.prev;\n
}\n
\n
// Interface\n
\n
return {\n
startState: function(basecolumn) {\n
return {\n
tokenize: null,\n
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),\n
indented: 0,\n
startOfLine: true\n
};\n
},\n
\n
token: function(stream, state) {\n
var ctx = state.context;\n
if (stream.sol()) {\n
if (ctx.align == null) ctx.align = false;\n
state.indented = stream.indentation();\n
state.startOfLine = true;\n
}\n
if (stream.eatSpace()) return null;\n
curPunc = null;\n
var style = (state.tokenize || tokenBase)(stream, state);\n
if (style == "comment" || style == "meta") return style;\n
if (ctx.align == null) ctx.align = true;\n
\n
if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);\n
else if (curPunc == "{") pushContext(state, stream.column(), "}");\n
else if (curPunc == "[") pushContext(state, stream.column(), "]");\n
else if (curPunc == "(") pushContext(state, stream.column(), ")");\n
else if (curPunc == "}") {\n
while (ctx.type == "statement") ctx = popContext(state);\n
if (ctx.type == "}") ctx = popContext(state);\n
while (ctx.type == "statement") ctx = popContext(state);\n
}\n
else if (curPunc == ctx.type) popContext(state);\n
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != \';\') || (ctx.type == "statement" && curPunc == "newstatement"))\n
pushContext(state, stream.column(), "statement");\n
state.startOfLine = false;\n
return style;\n
},\n
\n
indent: function(state, textAfter) {\n
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;\n
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);\n
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;\n
var closing = firstChar == ctx.type;\n
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);\n
else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);\n
else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;\n
else return ctx.indented + (closing ? 0 : indentUnit);\n
},\n
\n
electricChars: "{}",\n
blockCommentStart: "/*",\n
blockCommentEnd: "*/",\n
lineComment: "//",\n
fold: "brace"\n
};\n
});\n
\n
function words(str) {\n
var obj = {}, words = str.split(" ");\n
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n
return obj;\n
}\n
var cKeywords = "auto if break int case long char register continue return default short do sizeof " +\n
"double static else struct entry switch extern typedef float union for unsigned " +\n
"goto while enum void const signed volatile";\n
\n
function cppHook(stream, state) {\n
if (!state.startOfLine) return false;\n
for (;;) {\n
if (stream.skipTo("\\\\")) {\n
stream.next();\n
if (stream.eol()) {\n
state.tokenize = cppHook;\n
break;\n
}\n
} else {\n
stream.skipToEnd();\n
state.tokenize = null;\n
break;\n
}\n
}\n
return "meta";\n
}\n
\n
function cpp11StringHook(stream, state) {\n
stream.backUp(1);\n
// Raw strings.\n
if (stream.match(/(R|u8R|uR|UR|LR)/)) {\n
var match = stream.match(/"([^\\s\\\\()]{0,16})\\(/);\n
if (!match) {\n
return false;\n
}\n
state.cpp11RawStringDelim = match[1];\n
state.tokenize = tokenRawString;\n
return tokenRawString(stream, state);\n
}\n
// Unicode strings/chars.\n
if (stream.match(/(u8|u|U|L)/)) {\n
if (stream.match(/["\']/, /* eat */ false)) {\n
return "string";\n
}\n
return false;\n
}\n
// Ignore this hook.\n
stream.next();\n
return false;\n
}\n
\n
// C#-style strings where "" escapes a quote.\n
function tokenAtString(stream, state) {\n
var next;\n
while ((next = stream.next()) != null) {\n
if (next == \'"\' && !stream.eat(\'"\')) {\n
state.tokenize = null;\n
break;\n
}\n
}\n
return "string";\n
}\n
\n
// C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where\n
// <delim> can be a string up to 16 characters long.\n
function tokenRawString(stream, state) {\n
// Escape characters that have special regex meanings.\n
var delim = state.cpp11RawStringDelim.replace(/[^\\w\\s]/g, \'\\\\$&\');\n
var match = stream.match(new RegExp(".*?\\\\)" + delim + \'"\'));\n
if (match)\n
state.tokenize = null;\n
else\n
stream.skipToEnd();\n
return "string";\n
}\n
\n
function def(mimes, mode) {\n
if (typeof mimes == "string") mimes = [mimes];\n
var words = [];\n
function add(obj) {\n
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))\n
words.push(prop);\n
}\n
add(mode.keywords);\n
add(mode.builtin);\n
add(mode.atoms);\n
if (words.length) {\n
mode.helperType = mimes[0];\n
CodeMirror.registerHelper("hintWords", mimes[0], words);\n
}\n
\n
for (var i = 0; i < mimes.length; ++i)\n
CodeMirror.defineMIME(mimes[i], mode);\n
}\n
\n
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {\n
name: "clike",\n
keywords: words(cKeywords),\n
blockKeywords: words("case do else for if switch while struct"),\n
atoms: words("null"),\n
hooks: {"#": cppHook},\n
modeProps: {fold: ["brace", "include"]}\n
});\n
\n
def(["text/x-c++src", "text/x-c++hdr"], {\n
name: "clike",\n
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +\n
"static_cast typeid catch operator template typename class friend private " +\n
"this using const_cast inline public throw virtual delete mutable protected " +\n
"wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " +\n
"static_assert override"),\n
blockKeywords: words("catch class do else finally for if struct switch try while"),\n
atoms: words("true false null"),\n
hooks: {\n
"#": cppHook,\n
"u": cpp11StringHook,\n
"U": cpp11StringHook,\n
"L": cpp11StringHook,\n
"R": cpp11StringHook\n
},\n
modeProps: {fold: ["brace", "include"]}\n
});\n
def("text/x-java", {\n
name: "clike",\n
keywords: words("abstract assert boolean break byte case catch char class const continue default " +\n
"do double else enum extends final finally float for goto if implements import " +\n
"instanceof int interface long native new package private protected public " +\n
"return short static strictfp super switch synchronized this throw throws transient " +\n
"try void volatile while"),\n
blockKeywords: words("catch class do else finally for if switch try while"),\n
atoms: words("true false null"),\n
hooks: {\n
"@": function(stream) {\n
stream.eatWhile(/[\\w\\$_]/);\n
return "meta";\n
}\n
},\n
modeProps: {fold: ["brace", "import"]}\n
});\n
def("text/x-csharp", {\n
name: "clike",\n
keywords: words("abstract as base break case catch checked class const continue" +\n
" default delegate do else enum event explicit extern finally fixed for" +\n
" foreach goto if implicit in interface internal is lock namespace new" +\n
" operator out override params private protected public readonly ref return sealed" +\n
" sizeof stackalloc static struct switch this throw try typeof unchecked" +\n
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +\n
" global group into join let orderby partial remove select set value var yield"),\n
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),\n
builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +\n
" Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +\n
" UInt64 bool byte char decimal double short int long object" +\n
" sbyte float string ushort uint ulong"),\n
atoms: words("true false null"),\n
hooks: {\n
"@": function(stream, state) {\n
if (stream.eat(\'"\')) {\n
state.tokenize = tokenAtString;\n
return tokenAtString(stream, state);\n
}\n
stream.eatWhile(/[\\w\\$_]/);\n
return "meta";\n
}\n
}\n
});\n
def("text/x-scala", {\n
name: "clike",\n
keywords: words(\n
\n
/* scala */\n
"abstract case catch class def do else extends false final finally for forSome if " +\n
"implicit import lazy match new null object override package private protected return " +\n
"sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +\n
"<% >: # @ " +\n
\n
/* package scala */\n
"assert assume require print println printf readLine readBoolean readByte readShort " +\n
"readChar readInt readLong readFloat readDouble " +\n
\n
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +\n
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +\n
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +\n
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +\n
"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " +\n
\n
/* package java.lang */\n
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +\n
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +\n
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +\n
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"\n
\n
\n
),\n
blockKeywords: words("catch class do else finally for forSome if match switch try while"),\n
atoms: words("true false null"),\n
hooks: {\n
"@": function(stream) {\n
stream.eatWhile(/[\\w\\$_]/);\n
return "meta";\n
}\n
}\n
});\n
def(["x-shader/x-vertex", "x-shader/x-fragment"], {\n
name: "clike",\n
keywords: words("float int bool void " +\n
"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +\n
"mat2 mat3 mat4 " +\n
"sampler1D sampler2D sampler3D samplerCube " +\n
"sampler1DShadow sampler2DShadow" +\n
"const attribute uniform varying " +\n
"break continue discard return " +\n
"for while do if else struct " +\n
"in out inout"),\n
blockKeywords: words("for while do if else struct"),\n
builtin: words("radians degrees sin cos tan asin acos atan " +\n
"pow exp log exp2 sqrt inversesqrt " +\n
"abs sign floor ceil fract mod min max clamp mix step smootstep " +\n
"length distance dot cross normalize ftransform faceforward " +\n
"reflect refract matrixCompMult " +\n
"lessThan lessThanEqual greaterThan greaterThanEqual " +\n
"equal notEqual any all not " +\n
"texture1D texture1DProj texture1DLod texture1DProjLod " +\n
"texture2D texture2DProj texture2DLod texture2DProjLod " +\n
"texture3D texture3DProj texture3DLod texture3DProjLod " +\n
"textureCube textureCubeLod " +\n
"shadow1D shadow2D shadow1DProj shadow2DProj " +\n
"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +\n
"dFdx dFdy fwidth " +\n
"noise1 noise2 noise3 noise4"),\n
atoms: words("true false " +\n
"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +\n
"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +\n
"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +\n
"gl_FogCoord " +\n
"gl_Position gl_PointSize gl_ClipVertex " +\n
"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +\n
"gl_TexCoord gl_FogFragCoord " +\n
"gl_FragCoord gl_FrontFacing " +\n
"gl_FragColor gl_FragData gl_FragDepth " +\n
"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +\n
"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +\n
"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +\n
"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +\n
"gl_ProjectionMatrixInverseTranspose " +\n
"gl_ModelViewProjectionMatrixInverseTranspose " +\n
"gl_TextureMatrixInverseTranspose " +\n
"gl_NormalScale gl_DepthRange gl_ClipPlane " +\n
"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +\n
"gl_FrontLightModelProduct gl_BackLightModelProduct " +\n
"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +\n
"gl_FogParameters " +\n
"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +\n
"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +\n
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +\n
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +\n
"gl_MaxDrawBuffers"),\n
hooks: {"#": cppHook},\n
modeProps: {fold: ["brace", "include"]}\n
});\n
\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Mode CLike</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_mode_javascript.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_mode_javascript_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
// CodeMirror, copyright (c) by Marijn Haverbeke and others\n
// Distributed under an MIT license: http://codemirror.net/LICENSE\n
\n
// TODO actually recognize syntax of TypeScript constructs\n
\n
(function(mod) {\n
if (typeof exports == "object" && typeof module == "object") // CommonJS\n
mod(require("../../lib/codemirror"));\n
else if (typeof define == "function" && define.amd) // AMD\n
define(["../../lib/codemirror"], mod);\n
else // Plain browser env\n
mod(CodeMirror);\n
})(function(CodeMirror) {\n
"use strict";\n
\n
CodeMirror.defineMode("javascript", function(config, parserConfig) {\n
var indentUnit = config.indentUnit;\n
var statementIndent = parserConfig.statementIndent;\n
var jsonldMode = parserConfig.jsonld;\n
var jsonMode = parserConfig.json || jsonldMode;\n
var isTS = parserConfig.typescript;\n
\n
// Tokenizer\n
\n
var keywords = function(){\n
function kw(type) {return {type: type, style: "keyword"};}\n
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");\n
var operator = kw("operator"), atom = {type: "atom", style: "atom"};\n
\n
var jsKeywords = {\n
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,\n
"return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,\n
"var": kw("var"), "const": kw("var"), "let": kw("var"),\n
"function": kw("function"), "catch": kw("catch"),\n
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),\n
"in": operator, "typeof": operator, "instanceof": operator,\n
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,\n
"this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),\n
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C\n
};\n
\n
// Extend the \'normal\' keywords with the TypeScript language extensions\n
if (isTS) {\n
var type = {type: "variable", style: "variable-3"};\n
var tsKeywords = {\n
// object-like things\n
"interface": kw("interface"),\n
"extends": kw("extends"),\n
"constructor": kw("constructor"),\n
\n
// scope modifiers\n
"public": kw("public"),\n
"private": kw("private"),\n
"protected": kw("protected"),\n
"static": kw("static"),\n
\n
// types\n
"string": type, "number": type, "bool": type, "any": type\n
};\n
\n
for (var attr in tsKeywords) {\n
jsKeywords[attr] = tsKeywords[attr];\n
}\n
}\n
\n
return jsKeywords;\n
}();\n
\n
var isOperatorChar = /[+\\-*&%=<>!?|~^]/;\n
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;\n
\n
function readRegexp(stream) {\n
var escaped = false, next, inSet = false;\n
while ((next = stream.next()) != null) {\n
if (!escaped) {\n
if (next == "/" && !inSet) return;\n
if (next == "[") inSet = true;\n
else if (inSet && next == "]") inSet = false;\n
}\n
escaped = !escaped && next == "\\\\";\n
}\n
}\n
\n
// Used as scratch variables to communicate multiple values without\n
// consing up tons of objects.\n
var type, content;\n
function ret(tp, style, cont) {\n
type = tp; content = cont;\n
return style;\n
}\n
function tokenBase(stream, state) {\n
var ch = stream.next();\n
if (ch == \'"\' || ch == "\'") {\n
state.tokenize = tokenString(ch);\n
return state.tokenize(stream, state);\n
} else if (ch == "." && stream.match(/^\\d+(?:[eE][+\\-]?\\d+)?/)) {\n
return ret("number", "number");\n
} else if (ch == "." && stream.match("..")) {\n
return ret("spread", "meta");\n
} else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n
return ret(ch);\n
} else if (ch == "=" && stream.eat(">")) {\n
return ret("=>", "operator");\n
} else if (ch == "0" && stream.eat(/x/i)) {\n
stream.eatWhile(/[\\da-f]/i);\n
return ret("number", "number");\n
} else if (/\\d/.test(ch)) {\n
stream.match(/^\\d*(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/);\n
return ret("number", "number");\n
} else if (ch == "/") {\n
if (stream.eat("*")) {\n
state.tokenize = tokenComment;\n
return tokenComment(stream, state);\n
} else if (stream.eat("/")) {\n
stream.skipToEnd();\n
return ret("comment", "comment");\n
} else if (state.lastType == "operator" || state.lastType == "keyword c" ||\n
state.lastType == "sof" || /^[\\[{}\\(,;:]$/.test(state.lastType)) {\n
readRegexp(stream);\n
stream.eatWhile(/[gimy]/); // \'y\' is "sticky" option in Mozilla\n
return ret("regexp", "string-2");\n
} else {\n
stream.eatWhile(isOperatorChar);\n
return ret("operator", "operator", stream.current());\n
}\n
} else if (ch == "`") {\n
state.tokenize = tokenQuasi;\n
return tokenQuasi(stream, state);\n
} else if (ch == "#") {\n
stream.skipToEnd();\n
return ret("error", "error");\n
} else if (isOperatorChar.test(ch)) {\n
stream.eatWhile(isOperatorChar);\n
return ret("operator", "operator", stream.current());\n
} else {\n
stream.eatWhile(/[\\w\\$_]/);\n
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];\n
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :\n
ret("variable", "variable", word);\n
}\n
}\n
\n
function tokenString(quote) {\n
return function(stream, state) {\n
var escaped = false, next;\n
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){\n
state.tokenize = tokenBase;\n
return ret("jsonld-keyword", "meta");\n
}\n
while ((next = stream.next()) != null) {\n
if (next == quote && !escaped) break;\n
escaped = !escaped && next == "\\\\";\n
}\n
if (!escaped) state.tokenize = tokenBase;\n
return ret("string", "string");\n
};\n
}\n
\n
function tokenComment(stream, state) {\n
var maybeEnd = false, ch;\n
while (ch = stream.next()) {\n
if (ch == "/" && maybeEnd) {\n
state.tokenize = tokenBase;\n
break;\n
}\n
maybeEnd = (ch == "*");\n
}\n
return ret("comment", "comment");\n
}\n
\n
function tokenQuasi(stream, state) {\n
var escaped = false, next;\n
while ((next = stream.next()) != null) {\n
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {\n
state.tokenize = tokenBase;\n
break;\n
}\n
escaped = !escaped && next == "\\\\";\n
}\n
return ret("quasi", "string-2", stream.current());\n
}\n
\n
var brackets = "([{}])";\n
// This is a crude lookahead trick to try and notice that we\'re\n
// parsing the argument patterns for a fat-arrow function before we\n
// actually hit the arrow token. It only works if the arrow is on\n
// the same line as the arguments and there\'s no strange noise\n
// (comments) in between. Fallback is to only notice when we hit the\n
// arrow, and not declare the arguments as locals for the arrow\n
// body.\n
function findFatArrow(stream, state) {\n
if (state.fatArrowAt) state.fatArrowAt = null;\n
var arrow = stream.string.indexOf("=>", stream.start);\n
if (arrow < 0) return;\n
\n
var depth = 0, sawSomething = false;\n
for (var pos = arrow - 1; pos >= 0; --pos) {\n
var ch = stream.string.charAt(pos);\n
var bracket = brackets.indexOf(ch);\n
if (bracket >= 0 && bracket < 3) {\n
if (!depth) { ++pos; break; }\n
if (--depth == 0) break;\n
} else if (bracket >= 3 && bracket < 6) {\n
++depth;\n
} else if (/[$\\w]/.test(ch)) {\n
sawSomething = true;\n
} else if (sawSomething && !depth) {\n
++pos;\n
break;\n
}\n
}\n
if (sawSomething && !depth) state.fatArrowAt = pos;\n
}\n
\n
// Parser\n
\n
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};\n
\n
function JSLexical(indented, column, type, align, prev, info) {\n
this.indented = indented;\n
this.column = column;\n
this.type = type;\n
this.prev = prev;\n
this.info = info;\n
if (align != null) this.align = align;\n
}\n
\n
function inScope(state, varname) {\n
for (var v = state.localVars; v; v = v.next)\n
if (v.name == varname) return true;\n
for (var cx = state.context; cx; cx = cx.prev) {\n
for (var v = cx.vars; v; v = v.next)\n
if (v.name == varname) return true;\n
}\n
}\n
\n
function parseJS(state, style, type, content, stream) {\n
var cc = state.cc;\n
// Communicate our context to the combinators.\n
// (Less wasteful than consing up a hundred closures on every call.)\n
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n
\n
if (!state.lexical.hasOwnProperty("align"))\n
state.lexical.align = true;\n
\n
while(true) {\n
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n
if (combinator(type, content)) {\n
while(cc.length && cc[cc.length - 1].lex)\n
cc.pop()();\n
if (cx.marked) return cx.marked;\n
if (type == "variable" && inScope(state, content)) return "variable-2";\n
return style;\n
}\n
}\n
}\n
\n
// Combinator utils\n
\n
var cx = {state: null, column: null, marked: null, cc: null};\n
function pass() {\n
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n
}\n
function cont() {\n
pass.apply(null, arguments);\n
return true;\n
}\n
function register(varname) {\n
function inList(list) {\n
for (var v = list; v; v = v.next)\n
if (v.name == varname) return true;\n
return false;\n
}\n
var state = cx.state;\n
if (state.context) {\n
cx.marked = "def";\n
if (inList(state.localVars)) return;\n
state.localVars = {name: varname, next: state.localVars};\n
} else {\n
if (inList(state.globalVars)) return;\n
if (parserConfig.globalVars)\n
state.globalVars = {name: varname, next: state.globalVars};\n
}\n
}\n
\n
// Combinators\n
\n
var defaultVars = {name: "this", next: {name: "arguments"}};\n
function pushcontext() {\n
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};\n
cx.state.localVars = defaultVars;\n
}\n
function popcontext() {\n
cx.state.localVars = cx.state.context.vars;\n
cx.state.context = cx.state.context.prev;\n
}\n
function pushlex(type, info) {\n
var result = function() {\n
var state = cx.state, indent = state.indented;\n
if (state.lexical.type == "stat") indent = state.lexical.indented;\n
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n
};\n
result.lex = true;\n
return result;\n
}\n
function poplex() {\n
var state = cx.state;\n
if (state.lexical.prev) {\n
if (state.lexical.type == ")")\n
state.indented = state.lexical.indented;\n
state.lexical = state.lexical.prev;\n
}\n
}\n
poplex.lex = true;\n
\n
function expect(wanted) {\n
function exp(type) {\n
if (type == wanted) return cont();\n
else if (wanted == ";") return pass();\n
else return cont(exp);\n
};\n
return exp;\n
}\n
\n
function statement(type, value) {\n
if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);\n
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);\n
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);\n
if (type == "{") return cont(pushlex("}"), block, poplex);\n
if (type == ";") return cont();\n
if (type == "if") {\n
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n
cx.state.cc.pop()();\n
return cont(pushlex("form"), expression, statement, poplex, maybeelse);\n
}\n
if (type == "function") return cont(functiondef);\n
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);\n
if (type == "variable") return cont(pushlex("stat"), maybelabel);\n
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),\n
block, poplex, poplex);\n
if (type == "case") return cont(expression, expect(":"));\n
if (type == "default") return cont(expect(":"));\n
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),\n
statement, poplex, popcontext);\n
if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);\n
if (type == "class") return cont(pushlex("form"), className, poplex);\n
if (type == "export") return cont(pushlex("form"), afterExport, poplex);\n
if (type == "import") return cont(pushlex("form"), afterImport, poplex);\n
return pass(pushlex("stat"), expression, expect(";"), poplex);\n
}\n
function expression(type) {\n
return expressionInner(type, false);\n
}\n
function expressionNoComma(type) {\n
return expressionInner(type, true);\n
}\n
function expressionInner(type, noComma) {\n
if (cx.state.fatArrowAt == cx.stream.start) {\n
var body = noComma ? arrowBodyNoComma : arrowBody;\n
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);\n
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);\n
}\n
\n
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n
if (type == "function") return cont(functiondef, maybeop);\n
if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);\n
if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);\n
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);\n
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);\n
if (type == "{") return contCommasep(objprop, "}", null, maybeop);\n
if (type == "quasi") { return pass(quasi, maybeop); }\n
return cont();\n
}\n
function maybeexpression(type) {\n
if (type.match(/[;\\}\\)\\],]/)) return pass();\n
return pass(expression);\n
}\n
function maybeexpressionNoComma(type) {\n
if (type.match(/[;\\}\\)\\],]/)) return pass();\n
return pass(expressionNoComma);\n
}\n
\n
function maybeoperatorComma(type, value) {\n
if (type == ",") return cont(expression);\n
return maybeoperatorNoComma(type, value, false);\n
}\n
function maybeoperatorNoComma(type, value, noComma) {\n
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n
var expr = noComma == false ? expression : expressionNoComma;\n
if (value == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n
if (type == "operator") {\n
if (/\\+\\+|--/.test(value)) return cont(me);\n
if (value == "?") return cont(expression, expect(":"), expr);\n
return cont(expr);\n
}\n
if (type == "quasi") { return pass(quasi, me); }\n
if (type == ";") return;\n
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);\n
if (type == ".") return cont(property, me);\n
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);\n
}\n
function quasi(type, value) {\n
if (type != "quasi") return pass();\n
if (value.slice(value.length - 2) != "${") return cont(quasi);\n
return cont(expression, continueQuasi);\n
}\n
function continueQuasi(type) {\n
if (type == "}") {\n
cx.marked = "string-2";\n
cx.state.tokenize = tokenQuasi;\n
return cont(quasi);\n
}\n
}\n
function arrowBody(type) {\n
findFatArrow(cx.stream, cx.state);\n
if (type == "{") return pass(statement);\n
return pass(expression);\n
}\n
function arrowBodyNoComma(type) {\n
findFatArrow(cx.stream, cx.state);\n
if (type == "{") return pass(statement);\n
return pass(expressionNoComma);\n
}\n
function maybelabel(type) {\n
if (type == ":") return cont(poplex, statement);\n
return pass(maybeoperatorComma, expect(";"), poplex);\n
}\n
function property(type) {\n
if (type == "variable") {cx.marked = "property"; return cont();}\n
}\n
function objprop(type, value) {\n
if (type == "variable" || cx.style == "keyword") {\n
cx.marked = "property";\n
if (value == "get" || value == "set") return cont(getterSetter);\n
return cont(afterprop);\n
} else if (type == "number" || type == "string") {\n
cx.marked = jsonldMode ? "property" : (cx.style + " property");\n
return cont(afterprop);\n
} else if (type == "jsonld-keyword") {\n
return cont(afterprop);\n
} else if (type == "[") {\n
return cont(expression, expect("]"), afterprop);\n
}\n
}\n
function getterSetter(type) {\n
if (type != "variable") return pass(afterprop);\n
cx.marked = "property";\n
return cont(functiondef);\n
}\n
function afterprop(type) {\n
if (type == ":") return cont(expressionNoComma);\n
if (type == "(") return pass(functiondef);\n
}\n
function commasep(what, end) {\n
function proceed(type) {\n
if (type == ",") {\n
var lex = cx.state.lexical;\n
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;\n
return cont(what, proceed);\n
}\n
if (type == end) return cont();\n
return cont(expect(end));\n
}\n
return function(type) {\n
if (type == end) return cont();\n
return pass(what, proceed);\n
};\n
}\n
function contCommasep(what, end, info) {\n
for (var i = 3; i < arguments.length; i++)\n
cx.cc.push(arguments[i]);\n
return cont(pushlex(end, info), commasep(what, end), poplex);\n
}\n
function block(type) {\n
if (type == "}") return cont();\n
return pass(statement, block);\n
}\n
function maybetype(type) {\n
if (isTS && type == ":") return cont(typedef);\n
}\n
function typedef(type) {\n
if (type == "variable"){cx.marked = "variable-3"; return cont();}\n
}\n
function vardef() {\n
return pass(pattern, maybetype, maybeAssign, vardefCont);\n
}\n
function pattern(type, value) {\n
if (type == "variable") { register(value); return cont(); }\n
if (type == "[") return contCommasep(pattern, "]");\n
if (type == "{") return contCommasep(proppattern, "}");\n
}\n
function proppattern(type, value) {\n
if (type == "variable" && !cx.stream.match(/^\\s*:/, false)) {\n
register(value);\n
return cont(maybeAssign);\n
}\n
if (type == "variable") cx.marked = "property";\n
return cont(expect(":"), pattern, maybeAssign);\n
}\n
function maybeAssign(_type, value) {\n
if (value == "=") return cont(expressionNoComma);\n
}\n
function vardefCont(type) {\n
if (type == ",") return cont(vardef);\n
}\n
function maybeelse(type, value) {\n
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);\n
}\n
function forspec(type) {\n
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);\n
}\n
function forspec1(type) {\n
if (type == "var") return cont(vardef, expect(";"), forspec2);\n
if (type == ";") return cont(forspec2);\n
if (type == "variable") return cont(formaybeinof);\n
return pass(expression, expect(";"), forspec2);\n
}\n
function formaybeinof(_type, value) {\n
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }\n
return cont(maybeoperatorComma, forspec2);\n
}\n
function forspec2(type, value) {\n
if (type == ";") return cont(forspec3);\n
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }\n
return pass(expression, expect(";"), forspec3);\n
}\n
function forspec3(type) {\n
if (type != ")") cont(expression);\n
}\n
function functiondef(type, value) {\n
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}\n
if (type == "variable") {register(value); return cont(functiondef);}\n
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext);\n
}\n
function funarg(type) {\n
if (type == "spread") return cont(funarg);\n
return pass(pattern, maybetype);\n
}\n
function className(type, value) {\n
if (type == "variable") {register(value); return cont(classNameAfter);}\n
}\n
function classNameAfter(type, value) {\n
if (value == "extends") return cont(expression, classNameAfter);\n
if (type == "{") return cont(pushlex("}"), classBody, poplex);\n
}\n
function classBody(type, value) {\n
if (type == "variable" || cx.style == "keyword") {\n
cx.marked = "property";\n
if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody);\n
return cont(functiondef, classBody);\n
}\n
if (value == "*") {\n
cx.marked = "keyword";\n
return cont(classBody);\n
}\n
if (type == ";") return cont(classBody);\n
if (type == "}") return cont();\n
}\n
function classGetterSetter(type) {\n
if (type != "variable") return pass();\n
cx.marked = "property";\n
return cont();\n
}\n
function afterModule(type, value) {\n
if (type == "string") return cont(statement);\n
if (type == "variable") { register(value); return cont(maybeFrom); }\n
}\n
function afterExport(_type, value) {\n
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }\n
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }\n
return pass(statement);\n
}\n
function afterImport(type) {\n
if (type == "string") return cont();\n
return pass(importSpec, maybeFrom);\n
}\n
function importSpec(type, value) {\n
if (type == "{") return contCommasep(importSpec, "}");\n
if (type == "variable") register(value);\n
return cont();\n
}\n
function maybeFrom(_type, value) {\n
if (value == "from") { cx.marked = "keyword"; return cont(expression); }\n
}\n
function arrayLiteral(type) {\n
if (type == "]") return cont();\n
return pass(expressionNoComma, maybeArrayComprehension);\n
}\n
function maybeArrayComprehension(type) {\n
if (type == "for") return pass(comprehension, expect("]"));\n
if (type == ",") return cont(commasep(expressionNoComma, "]"));\n
return pass(commasep(expressionNoComma, "]"));\n
}\n
function comprehension(type) {\n
if (type == "for") return cont(forspec, comprehension);\n
if (type == "if") return cont(expression, comprehension);\n
}\n
\n
// Interface\n
\n
return {\n
startState: function(basecolumn) {\n
var state = {\n
tokenize: tokenBase,\n
lastType: "sof",\n
cc: [],\n
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),\n
localVars: parserConfig.localVars,\n
context: parserConfig.localVars && {vars: parserConfig.localVars},\n
indented: 0\n
};\n
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")\n
state.globalVars = parserConfig.globalVars;\n
return state;\n
},\n
\n
token: function(stream, state) {\n
if (stream.sol()) {\n
if (!state.lexical.hasOwnProperty("align"))\n
state.lexical.align = false;\n
state.indented = stream.indentation();\n
findFatArrow(stream, state);\n
}\n
if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n
var style = state.tokenize(stream, state);\n
if (type == "comment") return style;\n
state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;\n
return parseJS(state, style, type, content, stream);\n
},\n
\n
indent: function(state, textAfter) {\n
if (state.tokenize == tokenComment) return CodeMirror.Pass;\n
if (state.tokenize != tokenBase) return 0;\n
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;\n
// Kludge to prevent \'maybelse\' from blocking lexical scope pops\n
if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n
var c = state.cc[i];\n
if (c == poplex) lexical = lexical.prev;\n
else if (c != maybeelse) break;\n
}\n
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;\n
if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")\n
lexical = lexical.prev;\n
var type = lexical.type, closing = firstChar == type;\n
\n
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);\n
else if (type == "form" && firstChar == "{") return lexical.indented;\n
else if (type == "form") return lexical.indented + indentUnit;\n
else if (type == "stat")\n
return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0);\n
else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)\n
return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n
else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n
else return lexical.indented + (closing ? 0 : indentUnit);\n
},\n
\n
electricChars: ":{}",\n
blockCommentStart: jsonMode ? null : "/*",\n
blockCommentEnd: jsonMode ? null : "*/",\n
lineComment: jsonMode ? null : "//",\n
fold: "brace",\n
\n
helperType: jsonMode ? "json" : "javascript",\n
jsonldMode: jsonldMode,\n
jsonMode: jsonMode\n
};\n
});\n
\n
CodeMirror.registerHelper("wordChars", "javascript", /[\\\\w$]/);\n
\n
CodeMirror.defineMIME("text/javascript", "javascript");\n
CodeMirror.defineMIME("text/ecmascript", "javascript");\n
CodeMirror.defineMIME("application/javascript", "javascript");\n
CodeMirror.defineMIME("application/x-javascript", "javascript");\n
CodeMirror.defineMIME("application/ecmascript", "javascript");\n
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});\n
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});\n
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});\n
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });\n
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });\n
\n
});\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Mode Javascript</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>codemirror_theme_solarized.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_codemirror_theme_solarized_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/*\n
Solarized theme for code-mirror\n
http://ethanschoonover.com/solarized\n
*/\n
\n
/*\n
Solarized color pallet\n
http://ethanschoonover.com/solarized/img/solarized-palette.png\n
*/\n
\n
.solarized.base03 { color: #002b36; }\n
.solarized.base02 { color: #073642; }\n
.solarized.base01 { color: #586e75; }\n
.solarized.base00 { color: #657b83; }\n
.solarized.base0 { color: #839496; }\n
.solarized.base1 { color: #93a1a1; }\n
.solarized.base2 { color: #eee8d5; }\n
.solarized.base3 { color: #fdf6e3; }\n
.solarized.solar-yellow { color: #b58900; }\n
.solarized.solar-orange { color: #cb4b16; }\n
.solarized.solar-red { color: #dc322f; }\n
.solarized.solar-magenta { color: #d33682; }\n
.solarized.solar-violet { color: #6c71c4; }\n
.solarized.solar-blue { color: #268bd2; }\n
.solarized.solar-cyan { color: #2aa198; }\n
.solarized.solar-green { color: #859900; }\n
\n
/* Color scheme for code-mirror */\n
\n
.cm-s-solarized {\n
line-height: 1.45em;\n
color-profile: sRGB;\n
rendering-intent: auto;\n
}\n
.cm-s-solarized.cm-s-dark {\n
color: #839496;\n
background-color: #002b36;\n
text-shadow: #002b36 0 1px;\n
}\n
.cm-s-solarized.cm-s-light {\n
background-color: #fdf6e3;\n
color: #657b83;\n
text-shadow: #eee8d5 0 1px;\n
}\n
\n
.cm-s-solarized .CodeMirror-widget {\n
text-shadow: none;\n
}\n
\n
\n
.cm-s-solarized .cm-keyword { color: #cb4b16 }\n
.cm-s-solarized .cm-atom { color: #d33682; }\n
.cm-s-solarized .cm-number { color: #d33682; }\n
.cm-s-solarized .cm-def { color: #2aa198; }\n
\n
.cm-s-solarized .cm-variable { color: #268bd2; }\n
.cm-s-solarized .cm-variable-2 { color: #b58900; }\n
.cm-s-solarized .cm-variable-3 { color: #6c71c4; }\n
\n
.cm-s-solarized .cm-property { color: #2aa198; }\n
.cm-s-solarized .cm-operator {color: #6c71c4;}\n
\n
.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; }\n
\n
.cm-s-solarized .cm-string { color: #859900; }\n
.cm-s-solarized .cm-string-2 { color: #b58900; }\n
\n
.cm-s-solarized .cm-meta { color: #859900; }\n
.cm-s-solarized .cm-qualifier { color: #b58900; }\n
.cm-s-solarized .cm-builtin { color: #d33682; }\n
.cm-s-solarized .cm-bracket { color: #cb4b16; }\n
.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; }\n
.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; }\n
.cm-s-solarized .cm-tag { color: #93a1a1 }\n
.cm-s-solarized .cm-attribute { color: #2aa198; }\n
.cm-s-solarized .cm-header { color: #586e75; }\n
.cm-s-solarized .cm-quote { color: #93a1a1; }\n
.cm-s-solarized .cm-hr {\n
color: transparent;\n
border-top: 1px solid #586e75;\n
display: block;\n
}\n
.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; }\n
.cm-s-solarized .cm-special { color: #6c71c4; }\n
.cm-s-solarized .cm-em {\n
color: #999;\n
text-decoration: underline;\n
text-decoration-style: dotted;\n
}\n
.cm-s-solarized .cm-strong { color: #eee; }\n
.cm-s-solarized .cm-tab:before {\n
content: "➤"; /*visualize tab character*/\n
color: #586e75;\n
position:absolute;\n
}\n
.cm-s-solarized .cm-error,\n
.cm-s-solarized .cm-invalidchar {\n
color: #586e75;\n
border-bottom: 1px dotted #dc322f;\n
}\n
\n
.cm-s-solarized.cm-s-dark .CodeMirror-selected {\n
background: #073642;\n
}\n
\n
.cm-s-solarized.cm-s-light .CodeMirror-selected {\n
background: #eee8d5;\n
}\n
\n
/* Editor styling */\n
\n
\n
\n
/* Little shadow on the view-port of the buffer view */\n
.cm-s-solarized.CodeMirror {\n
-moz-box-shadow: inset 7px 0 12px -6px #000;\n
-webkit-box-shadow: inset 7px 0 12px -6px #000;\n
box-shadow: inset 7px 0 12px -6px #000;\n
}\n
\n
/* Gutter border and some shadow from it */\n
.cm-s-solarized .CodeMirror-gutters {\n
border-right: 1px solid;\n
}\n
\n
/* Gutter colors and line number styling based of color scheme (dark / light) */\n
\n
/* Dark */\n
.cm-s-solarized.cm-s-dark .CodeMirror-gutters {\n
background-color: #002b36;\n
border-color: #00232c;\n
}\n
\n
.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {\n
text-shadow: #021014 0 -1px;\n
}\n
\n
/* Light */\n
.cm-s-solarized.cm-s-light .CodeMirror-gutters {\n
background-color: #fdf6e3;\n
border-color: #eee8d5;\n
}\n
\n
/* Common */\n
.cm-s-solarized .CodeMirror-linenumber {\n
color: #586e75;\n
padding: 0 5px;\n
}\n
.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; }\n
.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; }\n
.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; }\n
\n
.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text {\n
color: #586e75;\n
}\n
\n
.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor {\n
border-left: 1px solid #819090;\n
}\n
\n
/*\n
Active line. Negative margin compensates left padding of the text in the\n
view-port\n
*/\n
.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {\n
background: rgba(255, 255, 255, 0.10);\n
}\n
.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {\n
background: rgba(0, 0, 0, 0.10);\n
}\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CodeMirror Theme Solarized</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>4.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_bin.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_bin_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>iframe {\n
width: 100%;\n
height: 50em;\n
}</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget Bin CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_bin.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This gadget starts a development environment to develop new gadget.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_bin_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>RenderJS Bin</title>\n
<link rel="shortcut icon" href="favicon.ico">\n
\n
<link rel="stylesheet" href="jquerymobile.css">\n
<link rel="stylesheet" href="gadget_bin.css">\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="jquery.js" type="text/javascript"></script>\n
<script src="jquerymobile.js"> type="text/javascript"></script>\n
<script src="handlebars.js" type="text/javascript"></script>\n
<script src="gadget_bin.js" type="text/javascript"></script>\n
\n
<script id="panel-template" type="text/x-handlebars-template">\n
<ul data-role="listview">\n
<li><a class="home_link ui-btn ui-icon-home ui-btn-icon-left" data-icon="home">Documents</a></li>\n
<li><a class="fast_input_link ui-btn ui-icon-plus ui-btn-icon-left" data-icon="plus">New Document</a></li>\n
{{#navigationlist}}\n
<li><a href="{{link}}">{{title}}</a></li>\n
{{/navigationlist}}\n
</ul>\n
</script>\n
\n
<script id="active-navigation-template" type="text/x-handlebars-template">\n
<li><a class="ui-btn-active ui-state-persist" href="{{link}}">{{title}}</a></li>\n
</script>\n
\n
<script id="navigation-template" type="text/x-handlebars-template">\n
<li><a href="{{link}}">{{title}}</a></li>\n
</script>\n
\n
</head>\n
<body>\n
\n
<!-- ID are bad, but required for JQM panel -->\n
<div class="jqm-navmenu-panel"\n
data-role="panel"\n
id="leftpanel"\n
data-display="overlay"\n
data-position="left"\n
data-theme="b">\n
</div>\n
\n
<header data-role="header">\n
\n
<div data-role="controlgroup" data-type="horizontal" class="ui-btn-left">\n
<a href="#leftpanel"\n
data-icon="bars"\n
class="menu_link ui-btn ui-icon-bars ui-btn-icon-left">Menu</a>\n
<a data-icon="carat-u"\n
class="back_link ui-btn ui-icon-carat-u ui-btn-icon-left">Parent</a>\n
</div>\n
<h1>RenderJS Gadget Bin</h1>\n
\n
<div data-role="controlgroup" data-type="horizontal" class="ui-btn-right">\n
<a data-icon="forward"\n
class="next_link ui-btn ui-icon-forward ui-btn-icon-right">Next</a>\n
</div>\n
\n
</header>\n
\n
<div class="nav_container"></div>\n
\n
<article class="gadget_container">\n
\n
<section data-gadget-url="gadget_codemirror.html"\n
data-gadget-scope="editor"\n
data-gadget-sandbox="iframe"></section>\n
\n
</article>\n
\n
<section data-gadget-url="gadget_jio.html"\n
data-gadget-scope="jio"\n
data-gadget-sandbox="public"></section>\n
<aside>\n
</aside>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget Bin</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_bin.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_bin_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global jQuery, rJS, RSVP, Handlebars, initGadgetMixin */\n
/*jslint nomen: true */\n
(function (window, $, rJS, RSVP, Handlebars, initGadgetMixin) {\n
"use strict";\n
/////////////////////////////////////////////////////////////////\n
// Desactivate jQuery Mobile URL management\n
/////////////////////////////////////////////////////////////////\n
$.mobile.ajaxEnabled = false;\n
$.mobile.linkBindingEnabled = false;\n
$.mobile.hashListeningEnabled = false;\n
$.mobile.pushStateEnabled = false;\n
\n
/////////////////////////////////////////////////////////////////\n
// Minimalistic ERP5\'s like portal type configuration\n
/////////////////////////////////////////////////////////////////\n
// XXX we should use lists instead to keep ordering\n
var portal_types = {\n
"Input Module": {\n
"view": {\n
"gadget": "InputModule_viewInputList",\n
"type": "object_list",\n
"title": "Document List"\n
},\n
"view_fast_input": {\n
"gadget": "InputModule_viewAddDocumentDialog",\n
"type": "object_fast_input",\n
"title": "Create Document"\n
}\n
},\n
"Input": {\n
"view": {\n
"gadget": "Input_viewProductionLine",\n
"type": "object_view",\n
"title": "Production Line"\n
},\n
"view_wip_part_spreadsheet": {\n
"gadget": "Input_viewWipPartSpreadsheet",\n
"type": "object_view",\n
"title": "WIP Part Spreadsheet",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.wip_part_spreadsheet);\n
}\n
},\n
"view_shift_spreadsheet": {\n
"gadget": "Input_viewShiftSpreadsheet",\n
"type": "object_view",\n
"title": "Shift Spreadsheet",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.shift_spreadsheet);\n
}\n
},\n
"view_available_capacity_spreadsheet": {\n
"gadget": "Input_viewAvailableCapacitySpreadsheet",\n
"type": "object_view",\n
"title": "Available Capacity Spreadsheet",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.capacity_by_project_spreadsheet);\n
}\n
},\n
"view_required_capacity_spreadsheet": {\n
"gadget": "Input_viewRequiredCapacitySpreadsheet",\n
"type": "object_view",\n
"title": "Required Capacity Spreadsheet",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.capacity_by_station_spreadsheet);\n
}\n
},\n
"view_simu": {\n
"gadget": "Input_viewSimulation",\n
"type": "object_view",\n
"title": "Run simulation"\n
},\n
"view_management": {\n
"gadget": "Input_viewDocumentManagement",\n
"type": "object_view",\n
"title": "Manage document"\n
},\n
"view_result": {\n
"gadget": "Input_viewResultList",\n
"type": "object_view",\n
"title": "Results"\n
}\n
},\n
"Output": {\n
"view": {\n
"gadget": "Output_viewStationUtilisationGraph",\n
"type": "object_view",\n
"title": "Stations Utilization",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.station_utilisation_graph);\n
}\n
},\n
"view_capacity_utilization": {\n
"gadget": "Output_viewCapacityUtilisationGraph",\n
"type": "object_view",\n
"title": "Capacity Utilization",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.capacity_utilisation_graph);\n
}\n
},\n
"view_queue_stat": {\n
"gadget": "Output_viewQueueStatGraph",\n
"type": "object_view",\n
"title": "Queues Statistics",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.queue_stat);\n
}\n
},\n
"view_exit_stat": {\n
"gadget": "Output_viewExitStatistics",\n
"type": "object_view",\n
"title": "Exit Statistics",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.exit_stat);\n
}\n
},\n
"view_gantt": {\n
"gadget": "Output_viewJobGantt",\n
"type": "object_view",\n
"title": "Job Gantt",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.job_gantt);\n
}\n
},\n
"view_schedule": {\n
"gadget": "Output_viewJobScheduleSpreadsheet",\n
"type": "object_view",\n
"title": "Job Schedule",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.job_schedule_spreadsheet);\n
}\n
},\n
"view_debug": {\n
"gadget": "Output_viewDebugJson",\n
"type": "object_view",\n
"title": "Debug JSON",\n
"condition": function (gadget) {\n
return (gadget.props.configuration_dict[\'Dream-Configuration\']\n
.gui.debug_json);\n
}\n
}\n
}\n
},\n
panel_template,\n
navigation_template,\n
active_navigation_template,\n
gadget_klass = rJS(window);\n
\n
function calculateTabHTML(gadget, options, key, title, active) {\n
return new RSVP.Queue()\n
.push(function () {\n
var kw = {\n
action: key,\n
id: options.id\n
};\n
if (options.result !== undefined) {\n
kw.result = options.result;\n
}\n
return gadget.aq_pleasePublishMyState(kw);\n
})\n
.push(function (url) {\n
var kw = {\n
title: title,\n
link: url\n
};\n
if (active === true) {\n
return active_navigation_template(kw);\n
}\n
\n
return navigation_template(kw);\n
\n
});\n
}\n
\n
function getNextLink(gadget, portal_type, options) {\n
var forward_kw = {action: options.action || "view"},\n
queue = new RSVP.Queue();\n
if (portal_type === "Input") {\n
forward_kw.id = options.id;\n
} else if (portal_type === "Output") {\n
forward_kw.id = options.id;\n
queue\n
.push(function () {\n
return gadget.getDeclaredGadget("jio");\n
})\n
.push(function (jio_gadget) {\n
return jio_gadget.getAttachment({\n
_id: options.id,\n
"_attachment": "simulation.json"\n
});\n
})\n
.push(function (sim_json) {\n
var document_list = JSON.parse(sim_json),\n
current = parseInt(options.result, 10);\n
if (current === (document_list.length - 1)) {\n
forward_kw.result = 0;\n
} else {\n
forward_kw.result = current + 1;\n
}\n
});\n
} else if (portal_type !== "Input Module") {\n
throw new Error("Unknown portal type: " + portal_type);\n
}\n
return queue.push(function () {\n
return gadget.aq_pleasePublishMyState(forward_kw);\n
});\n
}\n
\n
function getTitle(gadget, portal_type, options) {\n
var title;\n
if (portal_type === "Input Module") {\n
title = "Documents";\n
} else if (portal_type === "Input") {\n
title = gadget.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.get({_id: options.id});\n
})\n
.push(function (jio_doc) {\n
return jio_doc.data.title + " (" + jio_doc.data.modified + ")";\n
});\n
} else if (portal_type === "Output") {\n
title = gadget.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.getAttachment({\n
_id: options.id,\n
"_attachment": "simulation.json"\n
});\n
})\n
.push(function (sim_json) {\n
var document_list = JSON.parse(sim_json);\n
return document_list[options.result].score + " " +\n
document_list[options.result].key;\n
});\n
} else {\n
throw new Error("Unknown portal type: " + portal_type);\n
}\n
return title;\n
}\n
\n
function calculateNavigationHTML(gadget, portal_type, options) {\n
var nav_html,\n
action;\n
if (portal_types[portal_type][options.action].type ===\n
"object_view") {\n
return new RSVP.Queue()\n
.push(function () {\n
var url_list = [],\n
key2;\n
for (key2 in portal_types[portal_type]) {\n
if (portal_types[portal_type].hasOwnProperty(key2)) {\n
action = portal_types[portal_type][key2];\n
if (action.type === "object_view") {\n
if ((action.condition === undefined) ||\n
(action.condition(gadget))) {\n
url_list.push(\n
calculateTabHTML(gadget, options, key2, action.title,\n
(key2 === options.action))\n
);\n
}\n
}\n
\n
}\n
}\n
return RSVP.all(url_list);\n
})\n
.push(function (entry_list) {\n
var i;\n
nav_html =\n
\'<nav data-role="navbar" data-collapsible="true"><ul>\';\n
for (i = 0; i < entry_list.length; i += 1) {\n
nav_html += entry_list[i];\n
}\n
nav_html += \'</ul></nav>\';\n
return nav_html;\n
});\n
}\n
}\n
\n
initGadgetMixin(gadget_klass);\n
gadget_klass\n
/////////////////////////////////////////////////////////////////\n
// Acquired methods\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
\n
/////////////////////////////////////////////////////////////////\n
// Handle acquisition\n
/////////////////////////////////////////////////////////////////\n
// Bridge to jio gadget\n
.allowPublicAcquisition("jio_allDocs", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.allDocs.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_ajax", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.ajax.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_post", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.post.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_remove", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.remove.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_get", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.get.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_putAttachment", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.putAttachment.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_getAttachment", function (param_list) {\n
return this.getDeclaredGadget("jio")\n
.push(function (jio_gadget) {\n
return jio_gadget.getAttachment.apply(jio_gadget, param_list);\n
});\n
})\n
\n
.allowPublicAcquisition("whoWantsToDisplayHome", function () {\n
// Hey, I want to display some URL\n
return this.aq_pleasePublishMyState({});\n
})\n
.allowPublicAcquisition("whoWantsToDisplayThisDocument",\n
function (param_list) {\n
// Hey, I want to display some jIO document\n
// XXX should be merged with whoWantsToDisplayThisResult\n
var kw = {\n
action: param_list[1] || "view"\n
};\n
if (param_list[0] !== undefined) {\n
kw.id = param_list[0];\n
}\n
return this.aq_pleasePublishMyState(kw);\n
})\n
.allowPublicAcquisition("whoWantsToDisplayThisResult",\n
function (param_list) {\n
// Hey, I want to display some jIO document\n
\n
// We\'ll display the result using the first enabled action\n
var action = "view", action_info, action_id;\n
for (action_id in portal_types.Output) {\n
if (portal_types.Output.hasOwnProperty(action_id)) {\n
action_info = portal_types.Output[action_id];\n
if ((action_info.condition === undefined) ||\n
(action_info.condition(this))) {\n
action = action_id;\n
break;\n
}\n
}\n
}\n
return this.aq_pleasePublishMyState({\n
action: action,\n
id: param_list[0],\n
result: param_list[1]\n
});\n
})\n
.allowPublicAcquisition("getConfigurationDict", function () {\n
return this.props.configuration_dict;\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
.ready(function () {\n
if (panel_template === undefined) {\n
// XXX Only works as root gadget\n
panel_template = Handlebars.compile(\n
document.getElementById("panel-template").innerHTML\n
);\n
navigation_template = Handlebars.compile(\n
document.getElementById("navigation-template").innerHTML\n
);\n
active_navigation_template = Handlebars.compile(\n
document.getElementById("active-navigation-template").innerHTML\n
);\n
}\n
})\n
\n
// Create some link on the page\n
.ready(function (g) {\n
return new RSVP.Queue()\n
.push(function () {\n
return RSVP.all([\n
g.aq_pleasePublishMyState({}),\n
g.aq_pleasePublishMyState({action: "view_fast_input"})\n
]);\n
})\n
.push(function (link_list) {\n
var panel = g.props.element.querySelector("#leftpanel");\n
\n
panel.innerHTML =\n
panel_template({navigationlist: []});\n
panel.getElementsByClassName("home_link")[0].href = link_list[0];\n
panel.getElementsByClassName("fast_input_link")[0].href =\n
link_list[1];\n
// XXX JQuery mobile\n
$(panel).trigger("create");\n
});\n
})\n
\n
// Configure jIO to use localstorage\n
// And load configuration from server\n
.ready(function (g) {\n
var jio_gadget;\n
return g.getDeclaredGadget("jio")\n
.push(function (gadget) {\n
jio_gadget = gadget;\n
return jio_gadget.createJio({\n
type: "local",\n
username: "dream",\n
applicationname: "dream"\n
});\n
})\n
.push(function () {\n
// XXX Hardcoded relative URL\n
return jio_gadget.ajax({url: "../../getConfigurationDict"});\n
})\n
.push(function (evt) {\n
g.props.configuration_dict = JSON.parse(evt.target.responseText);\n
});\n
})\n
\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
// Render the page\n
.declareMethod("render", function (options) {\n
var gadget = this,\n
back_kw = {action: "view"},\n
page_gadget,\n
portal_type = "Input Module",\n
nav_element = gadget.props.element\n
.getElementsByClassName("nav_container")[0],\n
element = gadget.props.element\n
.getElementsByClassName("gadget_container")[0];\n
\n
if (options.action === undefined) {\n
// Redirect to the view action\n
options.action = "view";\n
return gadget.aq_pleasePublishMyState(options)\n
.push(gadget.pleaseRedirectMyHash.bind(gadget));\n
}\n
\n
// Detect what is the kind of document displayed\n
if (options.id !== undefined) {\n
if (options.result === undefined) {\n
portal_type = "Input";\n
} else {\n
portal_type = "Output";\n
back_kw.action = "view_result";\n
back_kw.id = options.id;\n
}\n
}\n
\n
// Get the action information\n
return gadget.declareGadget(\n
portal_types[portal_type][options.action].gadget + ".html"\n
)\n
.push(function (g) {\n
page_gadget = g;\n
if (page_gadget.render !== undefined) {\n
return page_gadget.render(options);\n
}\n
}).push(function () {\n
return RSVP.all([\n
page_gadget.getElement(),\n
calculateNavigationHTML(gadget, portal_type, options),\n
gadget.aq_pleasePublishMyState(back_kw),\n
getTitle(gadget, portal_type, options),\n
getNextLink(gadget, portal_type, options)\n
]);\n
}).push(function (result_list) {\n
var nav_html = result_list[1],\n
page_element = result_list[0];\n
\n
// Update title\n
gadget.props.element.querySelector("header h1").textContent =\n
result_list[3];\n
\n
// XXX Hide the back button in case of module display?\n
// Update back link\n
gadget.props.element\n
.getElementsByClassName("back_link")[0].href = result_list[2];\n
// XXX Hide the forward button in case of non result?\n
// Update forward link\n
gadget.props.element\n
.getElementsByClassName("next_link")[0].href = result_list[4];\n
\n
// Update the navigation panel\n
// Clear the previous rendering\n
while (nav_element.firstChild) {\n
nav_element.removeChild(nav_element.firstChild);\n
}\n
if (nav_html !== undefined) {\n
nav_element.innerHTML = nav_html;\n
$(nav_element).trigger("create");\n
}\n
\n
// Append in the DOM at the end to reduce flickering and reduce DOM\n
// modifications\n
// Clear the previous rendering\n
while (element.firstChild) {\n
element.removeChild(element.firstChild);\n
}\n
element.appendChild(page_element);\n
$(element).trigger(\'create\');\n
\n
// XXX RenderJS hack to start sub gadget services\n
// Only work if this gadget has no parent.\n
if (page_gadget.startService !== undefined) {\n
return page_gadget.startService();\n
}\n
});\n
});\n
}(window, jQuery, rJS, RSVP));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget Bin JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_codemirror.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_codemirror_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>.CodeMirror, .codemirror_gadget {\n
// FIXME: hardcoded value\n
height: 50em;\n
}</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Codemirror Gadget CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_codemirror.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Codemirror with vim bindings</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_codemirror_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Codemirror with vim binding</title>\n
\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
\n
<link rel="stylesheet" href="codemirror.css">\n
<link rel="stylesheet" href="codemirror_theme_solarized.css">\n
<link rel="stylesheet" href="gadget_codemirror.css">\n
<link rel="stylesheet" href="codemirror_addon_display_fullscreen.css">\n
<link rel="stylesheet" href="codemirror_addon_dialog.css">\n
\n
<script src="codemirror.js"></script>\n
<script src="codemirror_addon_searchcursor.js"></script>\n
<script src="codemirror_mode_javascript.js"></script>\n
<script src="codemirror_addon_edit_matchbrackets.js"></script>\n
<script src="codemirror_keymap_vim.js"></script>\n
<script src="codemirror_addon_display_fullscreen.js"></script>\n
<script src="codemirror_addon_dialog.js"></script>\n
<script src="gadget_codemirror.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
\n
<div class="codemirror_gadget"><textarea name="code"></textarea></div>\n
\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Codemirror Gadget</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_codemirror.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_codemirror_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>(function (window, rJS, RSVP, CodeMirror) {\n
"use strict";\n
\n
rJS(window)\n
.declareMethod(\'render\', function (options) {\n
var field_json = options.field_json || {};\n
this.name = field_json.key;\n
this.editor.setValue(field_json.value || field_json.default || "");\n
})\n
.declareMethod(\'getContent\', function () {\n
var result = {};\n
result[this.name] = this.editor.getValue();\n
return result;\n
})\n
\n
.declareService(function () {\n
this.editor.refresh();\n
this.editor.focus();\n
})\n
\n
.ready(function (g) {\n
\n
g.editor = CodeMirror.fromTextArea(g.__element.querySelector("textarea"), {\n
lineNumbers: true,\n
// mode: "text/x-csrc",\n
theme: "solarized light",\n
// fullScreen: true,\n
vimMode: true,\n
matchBrackets: true,\n
showCursorWhenSelecting: true,\n
autofocus: true,\n
});\n
\n
});\n
\n
// CodeMirror.commands.save = function(){ alert("Saving"); };\n
}(window, rJS, RSVP, CodeMirror));</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Codemirror Gadget JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Manifest" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5.appcache</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_appcache</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Fri, 18 Jul 2014 12:16:29 +0000\n
CACHE:\n
gadget_erp5_listbox.js\n
URI.js\n
gadget_jio.html\n
codemirror_addon_dialog.css\n
codemirror_theme_solarized.css\n
codemirror.css\n
codemirror_keymap_vim.js\n
codemirror_addon_edit_matchbrackets.js\n
codemirror_addon_searchcursor.js\n
gadget_codemirror.js\n
gadget_codemirror.html\n
jquerymobile.css\n
gadget_bin.js\n
RSVP.js\n
gadget_erp5_listfield.js\n
gadget_erp5_form.html\n
gadget_erp5.js\n
gadget_erp5.html\n
jio_sha1.amd.js\n
uritemplate.js\n
gadget_bin.css\n
codemirror_mode_clike.js\n
jquerymobile.js\n
renderjs.js\n
codemirror_mode_javascript.js\n
gadget_erp5_listfield.html\n
gadget_erp5_stringfield.js\n
gadget_erp5_stringfield.html\n
gadget_erp5_listbox.html\n
handlebars.js\n
gadget_jio.js\n
jquery.js\n
gadget_bin.html\n
gadget_global.js\n
gadget_erp5_form.js\n
gadget_erp5.css\n
jio_storage_erp5.js\n
jio_complex_queries.js\n
jio.js\n
jio_sha256.amd.js\n
jio_sha2.amd.js\n
codemirror_addon_display_fullscreen.js\n
codemirror_addon_display_fullscreen.css\n
codemirror_addon_dialog.js\n
gadget_codemirror.css\n
NETWORK:\n
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget ERP5 AppCache</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>table {\n
border-top: 0.1em solid #3D6474;\n
border-bottom: 0.1em solid #3D6474;\n
border-left: 0.1em solid #3D6474;\n
// background: #C1DAEB;\n
\n
// tbody {\n
// tr:nth-child(2n) {\n
// background: black;\n
// color : white;\n
// text-align : center;\n
// }\n
// tr:nth-child(2n+1) {\n
// background: #FFFFFF;\n
// background-color : gray;\n
// color : white;\n
// text-align : center;\n
// }\n
// }\n
\n
th {\n
border-right: 0.1em solid #3D6474;\n
}\n
}\n
\n
form .left, form .right, .center, .bottom {\n
display: inline-block;\n
vertical-align: top;\n
margin: 1em;\n
}\n
.center, .bottom {\n
display: block;\n
}\n
.left, .right {\n
width: 46%;\n
}\n
\n
iframe {\n
width: 95%;\n
height: 500px;\n
}</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget ERP5 CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_form.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_form_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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 Form</title>\n
\n
<!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
\n
<!-- custom script -->\n
<script src="gadget_global.js" type="text/javascript"></script>\n
<script src="gadget_erp5_form.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<!-- XXX action, method, fieldset -->\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
<div class="field_container">\n
</div>\n
</form>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Form</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_form.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_form_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, jQuery, Handlebars,\n
promiseEventListener, console */\n
/*jslint nomen: true */\n
/*global window, rJS, RSVP, StatelessJS, alert, FormData, document, console */\n
/*jslint maxlen:200, nomen: true */\n
(function (window, rJS, RSVP, $) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window);\n
\n
gadget_klass\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
.declareAcquiredMethod("aq_put", "jio_put")\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n
var i,\n
erp5_document = options.erp5_document,\n
form_definition = options.form_definition,\n
rendered_form = erp5_document._embedded._view,\n
group_list = form_definition.group_list,\n
queue = new RSVP.Queue(),\n
form_gadget = this,\n
parent_element = document.createElement("div");\n
\n
delete options.erp5_document;\n
delete options.form_definition;\n
\n
\n
options = options.form_gadget || {};\n
form_gadget.state_parameter_dict = options;\n
\n
form_gadget.props.gadget_list = [];\n
form_gadget.props.id = erp5_document._id;\n
\n
function addGroup(group) {\n
queue\n
.push(function () {\n
var j,\n
fieldset_element = document.createElement("fieldset"),\n
group_queue = new RSVP.Queue();\n
\n
function addField(field, scope) {\n
group_queue.push(function () {\n
if (rendered_form.hasOwnProperty(field[0])) {\n
// Field is enabled in this context\n
var field_queue = new RSVP.Queue(),\n
field_url = \'gadget_erp5_stringfield.html\',\n
field_element = document.createElement("div"),\n
gadget_element = document.createElement("div"),\n
label_element = document.createElement("label"),\n
renderered_field = rendered_form[field[0]];\n
\n
// field_element.setAttribute(\'data-role\', \'fieldcontain\');\n
label_element.setAttribute(\'for\', renderered_field.key);\n
label_element.textContent = renderered_field.title;\n
field_element.appendChild(label_element);\n
field_element.appendChild(gadget_element);\n
fieldset_element.appendChild(field_element);\n
\n
if ((renderered_field.type === \'ListField\') ||\n
(renderered_field.type === \'ParallelListField\') ||\n
(renderered_field.type === \'MultiListField\')) {\n
field_url = \'gadget_erp5_listfield.html\';\n
} else if (renderered_field.type === \'ListBox\') {\n
field_url = \'gadget_erp5_listbox.html\';\n
} else if (renderered_field.type === \'EditorField\') {\n
field_url = \'gadget_codemirror.html\';\n
}\n
\n
return field_queue\n
.push(function () {\n
return form_gadget.declareGadget(field_url, {\n
scope: renderered_field.key,\n
element: gadget_element\n
});\n
})\n
.push(function (field_gadget) {\n
form_gadget.props.gadget_list.push(field_gadget);\n
var suboptions = options[renderered_field.key] || {};\n
suboptions.field_json = renderered_field;\n
return field_gadget.render(suboptions);\n
});\n
}\n
});\n
}\n
\n
fieldset_element.setAttribute("class", group[0]);\n
for (j = 0; j < group[1].length; j += 1) {\n
addField(group[1][j]);\n
}\n
return group_queue.push(function () {\n
parent_element.appendChild(fieldset_element);\n
});\n
});\n
}\n
\n
for (i = 0; i < group_list.length; i += 1) {\n
addGroup(group_list[i]);\n
}\n
\n
return queue\n
.push(function () {\n
var dom_element = form_gadget.props.element\n
.querySelector(".field_container");\n
while (dom_element.firstChild) {\n
dom_element.removeChild(dom_element.firstChild);\n
}\n
dom_element.appendChild(parent_element);\n
return $(parent_element).trigger("create");\n
\n
});\n
})\n
\n
\n
.declareService(function () {\n
var form_gadget = this;\n
\n
function formSubmit() {\n
var k,\n
field_gadget,\n
count = form_gadget.props.gadget_list.length,\n
// // data = new FormData(),\n
data = {"_id": form_gadget.props.id},\n
queue = new RSVP.Queue();\n
\n
function extendData(field_data) {\n
var key;\n
for (key in field_data) {\n
if (field_data.hasOwnProperty(key)) {\n
data[key] = field_data[key];\n
}\n
}\n
}\n
\n
for (k = 0; k < count; k += 1) {\n
field_gadget = form_gadget.props.gadget_list[k];\n
// XXX Hack until better defined\n
if (field_gadget.getContent !== undefined) {\n
queue\n
.push(field_gadget.getContent.bind(field_gadget))\n
.push(extendData);\n
}\n
}\n
return queue\n
.push(function () {\n
return form_gadget.aq_put(data);//, {"_view": "XXX"});\n
});\n
}\n
\n
// Listen to form submit\n
return loopEventListener(\n
form_gadget.props.element.querySelector(\'form\'),\n
\'submit\',\n
false,\n
formSubmit\n
);\n
});\n
\n
}(window, rJS, RSVP, jQuery));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Form JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This gadget starts a development environment to develop new gadget.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<!--html manifest="gadget_erp5.appcache"-->\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>RenderJS Bin</title>\n
<link rel="shortcut icon" href="favicon.ico">\n
\n
<link rel="stylesheet" href="jquerymobile.css">\n
<link rel="stylesheet" href="gadget_erp5.css">\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
<script src="jquery.js" type="text/javascript"></script>\n
<script src="jquerymobile.js"> type="text/javascript"></script>\n
<script src="handlebars.js" type="text/javascript"></script>\n
<script src="gadget_erp5.js" type="text/javascript"></script>\n
\n
<script id="panel-template" type="text/x-handlebars-template">\n
<ul data-role="listview">\n
<li><a class="home_link ui-btn ui-icon-home ui-btn-icon-left" data-icon="home">Documents</a></li>\n
<li><a class="fast_input_link ui-btn ui-icon-plus ui-btn-icon-left" data-icon="plus">New Document</a></li>\n
{{#navigationlist}}\n
<li><a href="{{link}}">{{title}}</a></li>\n
{{/navigationlist}}\n
</ul>\n
</script>\n
\n
<script id="active-navigation-template" type="text/x-handlebars-template">\n
<li><a class="ui-btn-active ui-state-persist" href="{{link}}">{{title}}</a></li>\n
</script>\n
\n
<script id="navigation-template" type="text/x-handlebars-template">\n
<li><a href="{{link}}">{{title}}</a></li>\n
</script>\n
\n
</head>\n
<body>\n
\n
<div data-role="panel" id="leftpanel" data-display="overlay"></div>\n
<!--div data-role="panel" id="rightpanel" data-display="overlay"\n
data-position="right"></div-->\n
\n
<header data-role="header">\n
<a href="#leftpanel">Open panel</a>\n
<h1>ERP5</h1>\n
<!--form><input type="text" name="couscous"\n
value="couscous"></input><button type="submit">Search</button></form-->\n
<a href="#">Home</a>\n
<!--a href="#rightpanel">Open panel</a-->\n
</header>\n
\n
<article id="mainarticle"\n
data-gadget-url="gadget_erp5_form.html"\n
data-gadget-scope="form_gadget"\n
data-gadget-sandbox="public"></article>\n
\n
<section data-gadget-url="gadget_jio.html"\n
data-gadget-scope="jio_gadget"\n
data-gadget-sandbox="public"></section>\n
<aside>\n
</aside>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget ERP5</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, jQuery, URI, console */\n
/*jslint nomen: true */\n
(function (rJS, $, RSVP, URI) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// Desactivate jQuery Mobile URL management\n
/////////////////////////////////////////////////////////////////\n
$.mobile.ajaxEnabled = false;\n
$.mobile.linkBindingEnabled = false;\n
$.mobile.hashListeningEnabled = false;\n
$.mobile.pushStateEnabled = false;\n
\n
/////////////////////////////////////////////////////////////////\n
// Gadget behaviour\n
/////////////////////////////////////////////////////////////////\n
\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
// Configure jIO to use localstorage\n
// And load configuration from server\n
.ready(function (g) {\n
return g.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.createJio({\n
type: "erp5",\n
url: "https://softinst51669.host.vifib.net/erp5/web_site_module/hateoas/"\n
});\n
});\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// handle acquisition\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
// Bridge to jio gadget\n
.allowPublicAcquisition("jio_allDocs", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.allDocs.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_ajax", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.ajax.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_post", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.post.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_put", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.put.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_remove", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.remove.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_get", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.get.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_putAttachment", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.putAttachment.apply(jio_gadget, param_list);\n
});\n
})\n
.allowPublicAcquisition("jio_getAttachment", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.getAttachment.apply(jio_gadget, param_list);\n
});\n
})\n
\n
.allowPublicAcquisition("whoWantToDisplayThis", function (param_list) {\n
// Hey, I want to display some URL\n
return this.aq_pleasePublishMyState({jio_key: param_list[0]});\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
// Render the page\n
.declareMethod(\'render\', function (options) {\n
var gadget = this;\n
\n
// $.mobile.loading(\'show\');\n
if (options.jio_key === undefined) {\n
// Redirect to the default view\n
return gadget.aq_pleasePublishMyState({jio_key: "person_module"})\n
.push(gadget.pleaseRedirectMyHash.bind(gadget));\n
}\n
return gadget.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
var jio_key = options.jio_key,\n
view = options.view || "view";\n
///////////////////////////////////////////////\n
// Display erp5 document view\n
///////////////////////////////////////////////\n
return jio_gadget.get({"_id": jio_key}, {"_view": view});\n
})\n
.push(function (result) {\n
var uri = new URI(\n
result.data._embedded._view._links.form_definition.href\n
);\n
// if ((uri.scheme() === "urn") &&\n
// (uri.segment(0) === "jio") &&\n
// (uri.segment(1) === "get")) {\n
// }\n
return RSVP.all([\n
result,\n
gadget.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.get(\n
{"_id": uri.segment(2)},\n
{"_view": "view"}\n
);\n
})\n
]);\n
})\n
.push(function (result) {\n
var sub_options = options.form_gadget || {};\n
sub_options.erp5_document = result[0].data;\n
sub_options.form_definition = result[1].data;\n
\n
return gadget.getDeclaredGadget("form_gadget")\n
.push(function (form_gadget) {\n
return form_gadget.render(sub_options);\n
});\n
})\n
.push(function () {\n
return gadget.getDeclaredGadget("form_gadget");\n
})\n
.push(function (form_gadget) {\n
return form_gadget.getElement();\n
})\n
// .push(function (element) {\n
// // XXX JQuery mobile\n
// // $.mobile.loading(\'hide\');\n
// // return $(element).trigger("create");\n
// })\n
.push(undefined, function (error) {\n
console.error(error);\n
console.error(error.stack);\n
$.mobile.loading(\'hide\');\n
throw error;\n
});\n
});\n
\n
}(rJS, jQuery, RSVP, URI));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget ERP5 JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_listbox.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_listbox_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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 Listbox</title>\n
\n
<!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
\n
\n
<!-- custom script -->\n
<script src="gadget_erp5_listbox.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<table>\n
<thead>\n
</thead>\n
</table>\n
\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Listbox</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_listbox.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_listbox_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global window, rJS, document, RSVP, URI, console */\n
/*jslint maxlen:120, nomen: true */\n
(function (rJS, document, RSVP, window, URI) {\n
"use strict";\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
//////////////////////////////////////////////\n
// acquired method\n
//////////////////////////////////////////////\n
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
//////////////////////////////////////////////\n
// initialize the gadget content\n
//////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n
var gadget = this,\n
thead = gadget.props.element.querySelector(\'thead\'),\n
field_json = options.field_json,\n
tr = document.createElement("tr"),\n
th,\n
i;\n
\n
gadget.props.field_json = field_json;\n
gadget.props.begin_from = parseInt(options.begin_from, 10) || 0;\n
\n
for (i = 0; i < field_json.column_list.length; i += 1) {\n
th = document.createElement("th");\n
th.textContent = field_json.column_list[i][1];\n
tr.appendChild(th);\n
}\n
thead.appendChild(tr);\n
})\n
\n
//////////////////////////////////////////////\n
// render the listbox in an asynchronous way\n
//////////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this,\n
field_json = gadget.props.field_json,\n
begin_from = gadget.props.begin_from,\n
table = gadget.props.element.querySelector(\'table\'),\n
tbody = document.createElement("tbody"),\n
select_list = [],\n
i;\n
\n
for (i = 0; i < field_json.column_list.length; i += 1) {\n
select_list.push(field_json.column_list[i][0]);\n
}\n
\n
return gadget.jio_allDocs({\n
"query": new URI(field_json.query).query(true).query,\n
"limit": [begin_from, begin_from + field_json.lines + 1],\n
"select_list": select_list\n
}).push(function (result) {\n
var promise_list = [result];\n
\n
for (i = 0; i < (result.data.rows.length - 1); i += 1) {\n
promise_list.push(\n
gadget.whoWantToDisplayThis(result.data.rows[i].id)\n
);\n
}\n
return RSVP.all(promise_list);\n
\n
}).push(function (result_list) {\n
var j,\n
tr,\n
th,\n
a,\n
result = result_list[0],\n
url_param = {},\n
tmp_url;\n
\n
for (i = 0; i < (result.data.rows.length - 1); i += 1) {\n
tr = document.createElement("tr");\n
// tmp_url = "#/f/" + encodeURIComponent(result.data.rows[i].id) + "/view";\n
tmp_url = result_list[i + 1];\n
\n
for (j = 0; j < field_json.column_list.length; j += 1) {\n
th = document.createElement("th");\n
a = document.createElement("a");\n
a.href = tmp_url;\n
a.textContent = (result.data.rows[i]\n
.value[field_json.column_list[j][0]] || "");\n
th.appendChild(a);\n
tr.appendChild(th);\n
}\n
tbody.appendChild(tr);\n
}\n
\n
if (result.data.rows.length > field_json.lines) {\n
url_param.begin_from = begin_from + field_json.lines;\n
}\n
// return gadget.acquire("generateMyUrlXXX", url_param);\n
return RSVP.all([\n
gadget.aq_pleasePublishMyState({}),\n
gadget.aq_pleasePublishMyState(url_param)\n
]);\n
// return gadget.acquire("generateMyUrlXXX", url_param);\n
// [{jio_key: param_list[0]}]);\n
}).push(function () {\n
// if (begin_from !== 0) {\n
// tmp_element_1.innerHTML += "<a href=\'" + lala[0] +\n
// "\'>Start</a> ";\n
// }\n
// tmp_element_1.innerHTML += "<a href=\'" + lala[1] +\n
// "\'>Next page!</a>";\n
table.appendChild(tbody);\n
// if (result.data.rows.length > field_json.lines) {\n
// tmp_element_1.innerHTML += "<a href=\'#begin_from=56\'>Next page!</a>";\n
// window.location = "http://www.free.fr";\n
// }\n
});\n
});\n
\n
}(rJS, document, RSVP, window, URI));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Listbox JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_listfield.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_listfield_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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>Listfield</title>\n
\n
<!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="handlebars.js" type="text/javascript"></script>\n
<!-- custom script -->\n
<script src="gadget_erp5_listfield.js" type="text/javascript"></script>\n
\n
<script id="option-template" type="text/x-handlebars-template">\n
<option value="{{value}}">{{text}}</option>\n
</script>\n
\n
<script id="selected-option-template" type="text/x-handlebars-template">\n
<option selected="selected" value="{{value}}">{{text}}</option>\n
</script>\n
\n
</head>\n
<body>\n
<select />\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Listfield</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_listfield.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_listfield_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global window, rJS, Handlebars */\n
/*jslint nomen: true */\n
(function (window, rJS, Handlebars) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window),\n
option_source = gadget_klass.__template_element\n
.getElementById("option-template")\n
.innerHTML,\n
option_template = Handlebars.compile(option_source),\n
selected_option_source = gadget_klass.__template_element\n
.getElementById("option-template")\n
.innerHTML,\n
selected_option_template = Handlebars.compile(selected_option_source);\n
\n
gadget_klass\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.element = element;\n
});\n
})\n
.declareMethod(\'render\', function (options) {\n
var select = this.element.getElementsByTagName(\'select\')[0],\n
i,\n
template,\n
field_json = options.field_json,\n
tmp = \'\';\n
select.setAttribute(\'name\', field_json.key);\n
for (i = 0; i < field_json.items.length; i += 1) {\n
\n
if (field_json.items[i][1] === field_json.default[0]) {\n
template = selected_option_template;\n
} else {\n
template = option_template;\n
}\n
tmp += template({\n
value: field_json.items[i][1],\n
text: field_json.items[i][0]\n
});\n
}\n
select.innerHTML += tmp;\n
});\n
\n
}(window, rJS, Handlebars));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 listfield JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_stringfield.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_stringfield_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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
<script src="URI.js" type="text/javascript"></script>\n
<!-- custom script -->\n
<script src="gadget_erp5_stringfield.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<input type=\'text\' data-mini="true" />\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Stringfield</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_stringfield.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_stringfield_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, console, RSVP */\n
(function (rJS) {\n
"use strict";\n
\n
rJS(window)\n
.ready(function (gadget) {\n
return gadget.getElement()\n
.push(function (element) {\n
gadget.element = element;\n
});\n
})\n
.declareMethod(\'render\', function (options) {\n
var input = this.element.querySelector(\'input\'),\n
field_json = options.field_json || {};\n
console.log(options);\n
input.setAttribute(\n
\'value\',\n
field_json.value || field_json.default || ""\n
);\n
input.setAttribute(\'name\', field_json.key);\n
input.setAttribute(\'title\', field_json.title);\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
var input = this.element.querySelector(\'input\'),\n
result = {};\n
result[input.getAttribute(\'name\')] = input.value;\n
return result;\n
});\n
\n
}(rJS));</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Stringfield JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_global.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_global_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global RSVP, FileReader */\n
/*jslint unparam: true */\n
(function (window, RSVP, FileReader) {\n
"use strict";\n
\n
window.loopEventListener = function (target, type, useCapture, callback,\n
allowDefault) {\n
//////////////////////////\n
// Infinite event listener (promise is never resolved)\n
// eventListener is removed when promise is cancelled/rejected\n
//////////////////////////\n
var handle_event_callback,\n
callback_promise;\n
\n
function cancelResolver() {\n
if ((callback_promise !== undefined) &&\n
(typeof callback_promise.cancel === "function")) {\n
callback_promise.cancel();\n
}\n
}\n
\n
function canceller() {\n
if (handle_event_callback !== undefined) {\n
target.removeEventListener(type, handle_event_callback, useCapture);\n
}\n
cancelResolver();\n
}\n
function itsANonResolvableTrap(resolve, reject) {\n
\n
handle_event_callback = function (evt) {\n
evt.stopPropagation();\n
if (allowDefault !== true) {\n
evt.preventDefault();\n
}\n
cancelResolver();\n
callback_promise = new RSVP.Queue()\n
.push(function () {\n
return callback(evt);\n
})\n
.push(undefined, function (error) {\n
if (!(error instanceof RSVP.CancellationError)) {\n
canceller();\n
reject(error);\n
}\n
});\n
};\n
\n
target.addEventListener(type, handle_event_callback, useCapture);\n
}\n
return new RSVP.Promise(itsANonResolvableTrap, canceller);\n
};\n
\n
window.promiseEventListener = function (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
\n
window.promiseReadAsText = function (file) {\n
return new RSVP.Promise(function (resolve, reject) {\n
var reader = new FileReader();\n
reader.onload = function (evt) {\n
resolve(evt.target.result);\n
};\n
reader.onerror = function (evt) {\n
reject(evt);\n
};\n
reader.readAsText(file);\n
});\n
};\n
\n
}(window, RSVP, FileReader));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_global.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_jio.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Jio access</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_jio_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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>Jio Gadget</title>\n
\n
<!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
\n
<script src="uritemplate.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
\n
<script src="jio_sha1.amd.js" type="text/javascript"></script>\n
<script src="jio_sha2.amd.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="jio_complex_queries.js" type="text/javascript"></script>\n
<script src="jio_storage_erp5.js" type="text/javascript"></script>\n
\n
\n
\n
<!-- custom script -->\n
<script src="gadget_jio.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Jio Gadget</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_jio.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_jio_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, jIO */\n
(function (rJS, jIO) {\n
"use strict";\n
\n
rJS(window)\n
\n
.ready(function (gadget) {\n
// Initialize the gadget local parameters\n
gadget.state_parameter_dict = {};\n
})\n
\n
.declareMethod(\'createJio\', function (jio_options) {\n
this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options);\n
})\n
.declareMethod(\'ajax\', function () {\n
return jIO.util.ajax.apply(this, arguments);\n
})\n
.declareMethod(\'allDocs\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.allDocs.apply(storage, arguments);\n
})\n
.declareMethod(\'get\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.get.apply(storage, arguments);\n
})\n
.declareMethod(\'remove\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.remove.apply(storage, arguments);\n
})\n
.declareMethod(\'getAttachment\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.getAttachment.apply(storage, arguments)\n
// XXX Where to put this &@! blob reading\n
.then(function (response) {\n
return jIO.util.readBlobAsText(response.data);\n
})\n
.then(function (lala) {\n
return lala.target.result;\n
});\n
})\n
.declareMethod(\'putAttachment\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.putAttachment.apply(storage, arguments);\n
})\n
.declareMethod(\'put\', function () {\n
// XXX set modified value\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.put.apply(storage, arguments);\n
})\n
.declareMethod(\'post\', function () {\n
// XXX set modified value\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.post.apply(storage, arguments);\n
});\n
\n
}(rJS, jIO));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Jio Gadget JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>handlebars.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_handlebars_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*!\n
\n
handlebars v1.3.0\n
\n
Copyright (C) 2011 by Yehuda Katz\n
\n
Permission is hereby granted, free of charge, to any person obtaining a copy\n
of this software and associated documentation files (the "Software"), to deal\n
in the Software without restriction, including without limitation the rights\n
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n
copies of the Software, and to permit persons to whom the Software is\n
furnished to do so, subject to the following conditions:\n
\n
The above copyright notice and this permission notice shall be included in\n
all copies or substantial portions of the Software.\n
\n
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n
THE SOFTWARE.\n
\n
@license\n
*/\n
/* exported Handlebars */\n
var Handlebars = (function() {\n
// handlebars/safe-string.js\n
var __module4__ = (function() {\n
"use strict";\n
var __exports__;\n
// Build out our basic SafeString type\n
function SafeString(string) {\n
this.string = string;\n
}\n
\n
SafeString.prototype.toString = function() {\n
return "" + this.string;\n
};\n
\n
__exports__ = SafeString;\n
return __exports__;\n
})();\n
\n
// handlebars/utils.js\n
var __module3__ = (function(__dependency1__) {\n
"use strict";\n
var __exports__ = {};\n
/*jshint -W004 */\n
var SafeString = __dependency1__;\n
\n
var escape = {\n
"&": "&amp;",\n
"<": "&lt;",\n
">": "&gt;",\n
\'"\': "&quot;",\n
"\'": "&#x27;",\n
"`": "&#x60;"\n
};\n
\n
var badChars = /[&<>"\'`]/g;\n
var possible = /[&<>"\'`]/;\n
\n
function escapeChar(chr) {\n
return escape[chr] || "&amp;";\n
}\n
\n
function extend(obj, value) {\n
for(var key in value) {\n
if(Object.prototype.hasOwnProperty.call(value, key)) {\n
obj[key] = value[key];\n
}\n
}\n
}\n
\n
__exports__.extend = extend;var toString = Object.prototype.toString;\n
__exports__.toString = toString;\n
// Sourced from lodash\n
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt\n
var isFunction = function(value) {\n
return typeof value === \'function\';\n
};\n
// fallback for older versions of Chrome and Safari\n
if (isFunction(/x/)) {\n
isFunction = function(value) {\n
return typeof value === \'function\' && toString.call(value) === \'[object Function]\';\n
};\n
}\n
var isFunction;\n
__exports__.isFunction = isFunction;\n
var isArray = Array.isArray || function(value) {\n
return (value && typeof value === \'object\') ? toString.call(value) === \'[object Array]\' : false;\n
};\n
__exports__.isArray = isArray;\n
\n
function escapeExpression(string) {\n
// don\'t escape SafeStrings, since they\'re already safe\n
if (string instanceof SafeString) {\n
return string.toString();\n
} else if (!string && string !== 0) {\n
return "";\n
}\n
\n
// Force a string conversion as this will be done by the append regardless and\n
// the regex test will do this transparently behind the scenes, causing issues if\n
// an object\'s to string has escaped characters in it.\n
string = "" + string;\n
\n
if(!possible.test(string)) { return string; }\n
return string.replace(badChars, escapeChar);\n
}\n
\n
__exports__.escapeExpression = escapeExpression;function isEmpty(value) {\n
if (!value && value !== 0) {\n
return true;\n
} else if (isArray(value) && value.length === 0) {\n
return true;\n
} else {\n
return false;\n
}\n
}\n
\n
__exports__.isEmpty = isEmpty;\n
return __exports__;\n
})(__module4__);\n
\n
// handlebars/exception.js\n
var __module5__ = (function() {\n
"use strict";\n
var __exports__;\n
\n
var errorProps = [\'description\', \'fileName\', \'lineNumber\', \'message\', \'name\', \'number\', \'stack\'];\n
\n
function Exception(message, node) {\n
var line;\n
if (node && node.firstLine) {\n
line = node.firstLine;\n
\n
message += \' - \' + line + \':\' + node.firstColumn;\n
}\n
\n
var tmp = Error.prototype.constructor.call(this, message);\n
\n
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn\'t work.\n
for (var idx = 0; idx < errorProps.length; idx++) {\n
this[errorProps[idx]] = tmp[errorProps[idx]];\n
}\n
\n
if (line) {\n
this.lineNumber = line;\n
this.column = node.firstColumn;\n
}\n
}\n
\n
Exception.prototype = new Error();\n
\n
__exports__ = Exception;\n
return __exports__;\n
})();\n
\n
// handlebars/base.js\n
var __module2__ = (function(__dependency1__, __dependency2__) {\n
"use strict";\n
var __exports__ = {};\n
var Utils = __dependency1__;\n
var Exception = __dependency2__;\n
\n
var VERSION = "1.3.0";\n
__exports__.VERSION = VERSION;var COMPILER_REVISION = 4;\n
__exports__.COMPILER_REVISION = COMPILER_REVISION;\n
var REVISION_CHANGES = {\n
1: \'<= 1.0.rc.2\', // 1.0.rc.2 is actually rev2 but doesn\'t report it\n
2: \'== 1.0.0-rc.3\',\n
3: \'== 1.0.0-rc.4\',\n
4: \'>= 1.0.0\'\n
};\n
__exports__.REVISION_CHANGES = REVISION_CHANGES;\n
var isArray = Utils.isArray,\n
isFunction = Utils.isFunction,\n
toString = Utils.toString,\n
objectType = \'[object Object]\';\n
\n
function HandlebarsEnvironment(helpers, partials) {\n
this.helpers = helpers || {};\n
this.partials = partials || {};\n
\n
registerDefaultHelpers(this);\n
}\n
\n
__exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {\n
constructor: HandlebarsEnvironment,\n
\n
logger: logger,\n
log: log,\n
\n
registerHelper: function(name, fn, inverse) {\n
if (toString.call(name) === objectType) {\n
if (inverse || fn) { throw new Exception(\'Arg not supported with multiple helpers\'); }\n
Utils.extend(this.helpers, name);\n
} else {\n
if (inverse) { fn.not = inverse; }\n
this.helpers[name] = fn;\n
}\n
},\n
\n
registerPartial: function(name, str) {\n
if (toString.call(name) === objectType) {\n
Utils.extend(this.partials, name);\n
} else {\n
this.partials[name] = str;\n
}\n
}\n
};\n
\n
function registerDefaultHelpers(instance) {\n
instance.registerHelper(\'helperMissing\', function(arg) {\n
if(arguments.length === 2) {\n
return undefined;\n
} else {\n
throw new Exception("Missing helper: \'" + arg + "\'");\n
}\n
});\n
\n
instance.registerHelper(\'blockHelperMissing\', function(context, options) {\n
var inverse = options.inverse || function() {}, fn = options.fn;\n
\n
if (isFunction(context)) { context = context.call(this); }\n
\n
if(context === true) {\n
return fn(this);\n
} else if(context === false || context == null) {\n
return inverse(this);\n
} else if (isArray(context)) {\n
if(context.length > 0) {\n
return instance.helpers.each(context, options);\n
} else {\n
return inverse(this);\n
}\n
} else {\n
return fn(context);\n
}\n
});\n
\n
instance.registerHelper(\'each\', function(context, options) {\n
var fn = options.fn, inverse = options.inverse;\n
var i = 0, ret = "", data;\n
\n
if (isFunction(context)) { context = context.call(this); }\n
\n
if (options.data) {\n
data = createFrame(options.data);\n
}\n
\n
if(context && typeof context === \'object\') {\n
if (isArray(context)) {\n
for(var j = context.length; i<j; i++) {\n
if (data) {\n
data.index = i;\n
data.first = (i === 0);\n
data.last = (i === (context.length-1));\n
}\n
ret = ret + fn(context[i], { data: data });\n
}\n
} else {\n
for(var key in context) {\n
if(context.hasOwnProperty(key)) {\n
if(data) { \n
data.key = key; \n
data.index = i;\n
data.first = (i === 0);\n
}\n
ret = ret + fn(context[key], {data: data});\n
i++;\n
}\n
}\n
}\n
}\n
\n
if(i === 0){\n
ret = inverse(this);\n
}\n
\n
return ret;\n
});\n
\n
instance.registerHelper(\'if\', function(conditional, options) {\n
if (isFunction(conditional)) { conditional = conditional.call(this); }\n
\n
// Default behavior is to render the positive path if the value is truthy and not empty.\n
// The `includeZero` option may be set to treat the condtional as purely not empty based on the\n
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.\n
if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {\n
return options.inverse(this);\n
} else {\n
return options.fn(this);\n
}\n
});\n
\n
instance.registerHelper(\'unless\', function(conditional, options) {\n
return instance.helpers[\'if\'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});\n
});\n
\n
instance.registerHelper(\'with\', function(context, options) {\n
if (isFunction(context)) { context = context.call(this); }\n
\n
if (!Utils.isEmpty(context)) return options.fn(context);\n
});\n
\n
instance.registerHelper(\'log\', function(context, options) {\n
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;\n
instance.log(level, context);\n
});\n
}\n
\n
var logger = {\n
methodMap: { 0: \'debug\', 1: \'info\', 2: \'warn\', 3: \'error\' },\n
\n
// State enum\n
DEBUG: 0,\n
INFO: 1,\n
WARN: 2,\n
ERROR: 3,\n
level: 3,\n
\n
// can be overridden in the host environment\n
log: function(level, obj) {\n
if (logger.level <= level) {\n
var method = logger.methodMap[level];\n
if (typeof console !== \'undefined\' && console[method]) {\n
console[method].call(console, obj);\n
}\n
}\n
}\n
};\n
__exports__.logger = logger;\n
function log(level, obj) { logger.log(level, obj); }\n
\n
__exports__.log = log;var createFrame = function(object) {\n
var obj = {};\n
Utils.extend(obj, object);\n
return obj;\n
};\n
__exports__.createFrame = createFrame;\n
return __exports__;\n
})(__module3__, __module5__);\n
\n
// handlebars/runtime.js\n
var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {\n
"use strict";\n
var __exports__ = {};\n
var Utils = __dependency1__;\n
var Exception = __dependency2__;\n
var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;\n
var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;\n
\n
function checkRevision(compilerInfo) {\n
var compilerRevision = compilerInfo && compilerInfo[0] || 1,\n
currentRevision = COMPILER_REVISION;\n
\n
if (compilerRevision !== currentRevision) {\n
if (compilerRevision < currentRevision) {\n
var runtimeVersions = REVISION_CHANGES[currentRevision],\n
compilerVersions = REVISION_CHANGES[compilerRevision];\n
throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+\n
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");\n
} else {\n
// Use the embedded version info since the runtime doesn\'t know about this revision yet\n
throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+\n
"Please update your runtime to a newer version ("+compilerInfo[1]+").");\n
}\n
}\n
}\n
\n
__exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial\n
\n
function template(templateSpec, env) {\n
if (!env) {\n
throw new Exception("No environment passed to template");\n
}\n
\n
// Note: Using env.VM references rather than local var references throughout this section to allow\n
// for external users to override these as psuedo-supported APIs.\n
var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n
var result = env.VM.invokePartial.apply(this, arguments);\n
if (result != null) { return result; }\n
\n
if (env.compile) {\n
var options = { helpers: helpers, partials: partials, data: data };\n
partials[name] = env.compile(partial, { data: data !== undefined }, env);\n
return partials[name](context, options);\n
} else {\n
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");\n
}\n
};\n
\n
// Just add water\n
var container = {\n
escapeExpression: Utils.escapeExpression,\n
invokePartial: invokePartialWrapper,\n
programs: [],\n
program: function(i, fn, data) {\n
var programWrapper = this.programs[i];\n
if(data) {\n
programWrapper = program(i, fn, data);\n
} else if (!programWrapper) {\n
programWrapper = this.programs[i] = program(i, fn);\n
}\n
return programWrapper;\n
},\n
merge: function(param, common) {\n
var ret = param || common;\n
\n
if (param && common && (param !== common)) {\n
ret = {};\n
Utils.extend(ret, common);\n
Utils.extend(ret, param);\n
}\n
return ret;\n
},\n
programWithDepth: env.VM.programWithDepth,\n
noop: env.VM.noop,\n
compilerInfo: null\n
};\n
\n
return function(context, options) {\n
options = options || {};\n
var namespace = options.partial ? options : env,\n
helpers,\n
partials;\n
\n
if (!options.partial) {\n
helpers = options.helpers;\n
partials = options.partials;\n
}\n
var result = templateSpec.call(\n
container,\n
namespace, context,\n
helpers,\n
partials,\n
options.data);\n
\n
if (!options.partial) {\n
env.VM.checkRevision(container.compilerInfo);\n
}\n
\n
return result;\n
};\n
}\n
\n
__exports__.template = template;function programWithDepth(i, fn, data /*, $depth */) {\n
var args = Array.prototype.slice.call(arguments, 3);\n
\n
var prog = function(context, options) {\n
options = options || {};\n
\n
return fn.apply(this, [context, options.data || data].concat(args));\n
};\n
prog.program = i;\n
prog.depth = args.length;\n
return prog;\n
}\n
\n
__exports__.programWithDepth = programWithDepth;function program(i, fn, data) {\n
var prog = function(context, options) {\n
options = options || {};\n
\n
return fn(context, options.data || data);\n
};\n
prog.program = i;\n
prog.depth = 0;\n
return prog;\n
}\n
\n
__exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {\n
var options = { partial: true, helpers: helpers, partials: partials, data: data };\n
\n
if(partial === undefined) {\n
throw new Exception("The partial " + name + " could not be found");\n
} else if(partial instanceof Function) {\n
return partial(context, options);\n
}\n
}\n
\n
__exports__.invokePartial = invokePartial;function noop() { return ""; }\n
\n
__exports__.noop = noop;\n
return __exports__;\n
})(__module3__, __module5__, __module2__);\n
\n
// handlebars.runtime.js\n
var __module1__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {\n
"use strict";\n
var __exports__;\n
/*globals Handlebars: true */\n
var base = __dependency1__;\n
\n
// Each of these augment the Handlebars object. No need to setup here.\n
// (This is done to easily share code between commonjs and browse envs)\n
var SafeString = __dependency2__;\n
var Exception = __dependency3__;\n
var Utils = __dependency4__;\n
var runtime = __dependency5__;\n
\n
// For compatibility and usage outside of module systems, make the Handlebars object a namespace\n
var create = function() {\n
var hb = new base.HandlebarsEnvironment();\n
\n
Utils.extend(hb, base);\n
hb.SafeString = SafeString;\n
hb.Exception = Exception;\n
hb.Utils = Utils;\n
\n
hb.VM = runtime;\n
hb.template = function(spec) {\n
return runtime.template(spec, hb);\n
};\n
\n
return hb;\n
};\n
\n
var Handlebars = create();\n
Handlebars.create = create;\n
\n
__exports__ = Handlebars;\n
return __exports__;\n
})(__module2__, __module4__, __module5__, __module3__, __module6__);\n
\n
// handlebars/compiler/ast.js\n
var __module7__ = (function(__dependency1__) {\n
"use strict";\n
var __exports__;\n
var Exception = __dependency1__;\n
\n
function LocationInfo(locInfo){\n
locInfo = locInfo || {};\n
this.firstLine = locInfo.first_line;\n
this.firstColumn = locInfo.first_column;\n
this.lastColumn = locInfo.last_column;\n
this.lastLine = locInfo.last_line;\n
}\n
\n
var AST = {\n
ProgramNode: function(statements, inverseStrip, inverse, locInfo) {\n
var inverseLocationInfo, firstInverseNode;\n
if (arguments.length === 3) {\n
locInfo = inverse;\n
inverse = null;\n
} else if (arguments.length === 2) {\n
locInfo = inverseStrip;\n
inverseStrip = null;\n
}\n
\n
LocationInfo.call(this, locInfo);\n
this.type = "program";\n
this.statements = statements;\n
this.strip = {};\n
\n
if(inverse) {\n
firstInverseNode = inverse[0];\n
if (firstInverseNode) {\n
inverseLocationInfo = {\n
first_line: firstInverseNode.firstLine,\n
last_line: firstInverseNode.lastLine,\n
last_column: firstInverseNode.lastColumn,\n
first_column: firstInverseNode.firstColumn\n
};\n
this.inverse = new AST.ProgramNode(inverse, inverseStrip, inverseLocationInfo);\n
} else {\n
this.inverse = new AST.ProgramNode(inverse, inverseStrip);\n
}\n
this.strip.right = inverseStrip.left;\n
} else if (inverseStrip) {\n
this.strip.left = inverseStrip.right;\n
}\n
},\n
\n
MustacheNode: function(rawParams, hash, open, strip, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "mustache";\n
this.strip = strip;\n
\n
// Open may be a string parsed from the parser or a passed boolean flag\n
if (open != null && open.charAt) {\n
// Must use charAt to support IE pre-10\n
var escapeFlag = open.charAt(3) || open.charAt(2);\n
this.escaped = escapeFlag !== \'{\' && escapeFlag !== \'&\';\n
} else {\n
this.escaped = !!open;\n
}\n
\n
if (rawParams instanceof AST.SexprNode) {\n
this.sexpr = rawParams;\n
} else {\n
// Support old AST API\n
this.sexpr = new AST.SexprNode(rawParams, hash);\n
}\n
\n
this.sexpr.isRoot = true;\n
\n
// Support old AST API that stored this info in MustacheNode\n
this.id = this.sexpr.id;\n
this.params = this.sexpr.params;\n
this.hash = this.sexpr.hash;\n
this.eligibleHelper = this.sexpr.eligibleHelper;\n
this.isHelper = this.sexpr.isHelper;\n
},\n
\n
SexprNode: function(rawParams, hash, locInfo) {\n
LocationInfo.call(this, locInfo);\n
\n
this.type = "sexpr";\n
this.hash = hash;\n
\n
var id = this.id = rawParams[0];\n
var params = this.params = rawParams.slice(1);\n
\n
// a mustache is an eligible helper if:\n
// * its id is simple (a single part, not `this` or `..`)\n
var eligibleHelper = this.eligibleHelper = id.isSimple;\n
\n
// a mustache is definitely a helper if:\n
// * it is an eligible helper, and\n
// * it has at least one parameter or hash segment\n
this.isHelper = eligibleHelper && (params.length || hash);\n
\n
// if a mustache is an eligible helper but not a definite\n
// helper, it is ambiguous, and will be resolved in a later\n
// pass or at runtime.\n
},\n
\n
PartialNode: function(partialName, context, strip, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "partial";\n
this.partialName = partialName;\n
this.context = context;\n
this.strip = strip;\n
},\n
\n
BlockNode: function(mustache, program, inverse, close, locInfo) {\n
LocationInfo.call(this, locInfo);\n
\n
if(mustache.sexpr.id.original !== close.path.original) {\n
throw new Exception(mustache.sexpr.id.original + " doesn\'t match " + close.path.original, this);\n
}\n
\n
this.type = \'block\';\n
this.mustache = mustache;\n
this.program = program;\n
this.inverse = inverse;\n
\n
this.strip = {\n
left: mustache.strip.left,\n
right: close.strip.right\n
};\n
\n
(program || inverse).strip.left = mustache.strip.right;\n
(inverse || program).strip.right = close.strip.left;\n
\n
if (inverse && !program) {\n
this.isInverse = true;\n
}\n
},\n
\n
ContentNode: function(string, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "content";\n
this.string = string;\n
},\n
\n
HashNode: function(pairs, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "hash";\n
this.pairs = pairs;\n
},\n
\n
IdNode: function(parts, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "ID";\n
\n
var original = "",\n
dig = [],\n
depth = 0;\n
\n
for(var i=0,l=parts.length; i<l; i++) {\n
var part = parts[i].part;\n
original += (parts[i].separator || \'\') + part;\n
\n
if (part === ".." || part === "." || part === "this") {\n
if (dig.length > 0) {\n
throw new Exception("Invalid path: " + original, this);\n
} else if (part === "..") {\n
depth++;\n
} else {\n
this.isScoped = true;\n
}\n
} else {\n
dig.push(part);\n
}\n
}\n
\n
this.original = original;\n
this.parts = dig;\n
this.string = dig.join(\'.\');\n
this.depth = depth;\n
\n
// an ID is simple if it only has one part, and that part is not\n
// `..` or `this`.\n
this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;\n
\n
this.stringModeValue = this.string;\n
},\n
\n
PartialNameNode: function(name, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "PARTIAL_NAME";\n
this.name = name.original;\n
},\n
\n
DataNode: function(id, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "DATA";\n
this.id = id;\n
},\n
\n
StringNode: function(string, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "STRING";\n
this.original =\n
this.string =\n
this.stringModeValue = string;\n
},\n
\n
IntegerNode: function(integer, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "INTEGER";\n
this.original =\n
this.integer = integer;\n
this.stringModeValue = Number(integer);\n
},\n
\n
BooleanNode: function(bool, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "BOOLEAN";\n
this.bool = bool;\n
this.stringModeValue = bool === "true";\n
},\n
\n
CommentNode: function(comment, locInfo) {\n
LocationInfo.call(this, locInfo);\n
this.type = "comment";\n
this.comment = comment;\n
}\n
};\n
\n
// Must be exported as an object rather than the root of the module as the jison lexer\n
// most modify the object to operate properly.\n
__exports__ = AST;\n
return __exports__;\n
})(__module5__);\n
\n
// handlebars/compiler/parser.js\n
var __module9__ = (function() {\n
"use strict";\n
var __exports__;\n
/* jshint ignore:start */\n
/* Jison generated parser */\n
var handlebars = (function(){\n
var parser = {trace: function trace() { },\n
yy: {},\n
symbols_: {"error":2,"root":3,"statements":4,"EOF":5,"program":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"sexpr":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"partial_option0":27,"sexpr_repetition0":28,"sexpr_option0":29,"dataName":30,"param":31,"STRING":32,"INTEGER":33,"BOOLEAN":34,"OPEN_SEXPR":35,"CLOSE_SEXPR":36,"hash":37,"hash_repetition_plus0":38,"hashSegment":39,"ID":40,"EQUALS":41,"DATA":42,"pathSegments":43,"SEP":44,"$accept":0,"$end":1},\n
terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},\n
productions_: [0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],\n
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {\n
\n
var $0 = $$.length - 1;\n
switch (yystate) {\n
case 1: return new yy.ProgramNode($$[$0-1], this._$); \n
break;\n
case 2: return new yy.ProgramNode([], this._$); \n
break;\n
case 3:this.$ = new yy.ProgramNode([], $$[$0-1], $$[$0], this._$);\n
break;\n
case 4:this.$ = new yy.ProgramNode($$[$0-2], $$[$0-1], $$[$0], this._$);\n
break;\n
case 5:this.$ = new yy.ProgramNode($$[$0-1], $$[$0], [], this._$);\n
break;\n
case 6:this.$ = new yy.ProgramNode($$[$0], this._$);\n
break;\n
case 7:this.$ = new yy.ProgramNode([], this._$);\n
break;\n
case 8:this.$ = new yy.ProgramNode([], this._$);\n
break;\n
case 9:this.$ = [$$[$0]];\n
break;\n
case 10: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; \n
break;\n
case 11:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0], this._$);\n
break;\n
case 12:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0], this._$);\n
break;\n
case 13:this.$ = $$[$0];\n
break;\n
case 14:this.$ = $$[$0];\n
break;\n
case 15:this.$ = new yy.ContentNode($$[$0], this._$);\n
break;\n
case 16:this.$ = new yy.CommentNode($$[$0], this._$);\n
break;\n
case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);\n
break;\n
case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);\n
break;\n
case 19:this.$ = {path: $$[$0-1], strip: stripFlags($$[$0-2], $$[$0])};\n
break;\n
case 20:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);\n
break;\n
case 21:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);\n
break;\n
case 22:this.$ = new yy.PartialNode($$[$0-2], $$[$0-1], stripFlags($$[$0-3], $$[$0]), this._$);\n
break;\n
case 23:this.$ = stripFlags($$[$0-1], $$[$0]);\n
break;\n
case 24:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$);\n
break;\n
case 25:this.$ = new yy.SexprNode([$$[$0]], null, this._$);\n
break;\n
case 26:this.$ = $$[$0];\n
break;\n
case 27:this.$ = new yy.StringNode($$[$0], this._$);\n
break;\n
case 28:this.$ = new yy.IntegerNode($$[$0], this._$);\n
break;\n
case 29:this.$ = new yy.BooleanNode($$[$0], this._$);\n
break;\n
case 30:this.$ = $$[$0];\n
break;\n
case 31:$$[$0-1].isHelper = true; this.$ = $$[$0-1];\n
break;\n
case 32:this.$ = new yy.HashNode($$[$0], this._$);\n
break;\n
case 33:this.$ = [$$[$0-2], $$[$0]];\n
break;\n
case 34:this.$ = new yy.PartialNameNode($$[$0], this._$);\n
break;\n
case 35:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$);\n
break;\n
case 36:this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0], this._$));\n
break;\n
case 37:this.$ = new yy.DataNode($$[$0], this._$);\n
break;\n
case 38:this.$ = new yy.IdNode($$[$0], this._$);\n
break;\n
case 39: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; \n
break;\n
case 40:this.$ = [{part: $$[$0]}];\n
break;\n
case 43:this.$ = [];\n
break;\n
case 44:$$[$0-1].push($$[$0]);\n
break;\n
case 47:this.$ = [$$[$0]];\n
break;\n
case 48:$$[$0-1].push($$[$0]);\n
break;\n
}\n
},\n
table: [{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],\n
defaultActions: {3:[2,2],16:[2,1],50:[2,42]},\n
parseError: function parseError(str, hash) {\n
throw new Error(str);\n
},\n
parse: function parse(input) {\n
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n
this.lexer.setInput(input);\n
this.lexer.yy = this.yy;\n
this.yy.lexer = this.lexer;\n
this.yy.parser = this;\n
if (typeof this.lexer.yylloc == "undefined")\n
this.lexer.yylloc = {};\n
var yyloc = this.lexer.yylloc;\n
lstack.push(yyloc);\n
var ranges = this.lexer.options && this.lexer.options.ranges;\n
if (typeof this.yy.parseError === "function")\n
this.parseError = this.yy.parseError;\n
function popStack(n) {\n
stack.length = stack.length - 2 * n;\n
vstack.length = vstack.length - n;\n
lstack.length = lstack.length - n;\n
}\n
function lex() {\n
var token;\n
token = self.lexer.lex() || 1;\n
if (typeof token !== "number") {\n
token = self.symbols_[token] || token;\n
}\n
return token;\n
}\n
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n
while (true) {\n
state = stack[stack.length - 1];\n
if (this.defaultActions[state]) {\n
action = this.defaultActions[state];\n
} else {\n
if (symbol === null || typeof symbol == "undefined") {\n
symbol = lex();\n
}\n
action = table[state] && table[state][symbol];\n
}\n
if (typeof action === "undefined" || !action.length || !action[0]) {\n
var errStr = "";\n
if (!recovering) {\n
expected = [];\n
for (p in table[state])\n
if (this.terminals_[p] && p > 2) {\n
expected.push("\'" + this.terminals_[p] + "\'");\n
}\n
if (this.lexer.showPosition) {\n
errStr = "Parse error on line " + (yylineno + 1) + ":\\n" + this.lexer.showPosition() + "\\nExpecting " + expected.join(", ") + ", got \'" + (this.terminals_[symbol] || symbol) + "\'";\n
} else {\n
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"\'" + (this.terminals_[symbol] || symbol) + "\'");\n
}\n
this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});\n
}\n
}\n
if (action[0] instanceof Array && action.length > 1) {\n
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);\n
}\n
switch (action[0]) {\n
case 1:\n
stack.push(symbol);\n
vstack.push(this.lexer.yytext);\n
lstack.push(this.lexer.yylloc);\n
stack.push(action[1]);\n
symbol = null;\n
if (!preErrorSymbol) {\n
yyleng = this.lexer.yyleng;\n
yytext = this.lexer.yytext;\n
yylineno = this.lexer.yylineno;\n
yyloc = this.lexer.yylloc;\n
if (recovering > 0)\n
recovering--;\n
} else {\n
symbol = preErrorSymbol;\n
preErrorSymbol = null;\n
}\n
break;\n
case 2:\n
len = this.productions_[action[1]][1];\n
yyval.$ = vstack[vstack.length - len];\n
yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};\n
if (ranges) {\n
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];\n
}\n
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);\n
if (typeof r !== "undefined") {\n
return r;\n
}\n
if (len) {\n
stack = stack.slice(0, -1 * len * 2);\n
vstack = vstack.slice(0, -1 * len);\n
lstack = lstack.slice(0, -1 * len);\n
}\n
stack.push(this.productions_[action[1]][0]);\n
vstack.push(yyval.$);\n
lstack.push(yyval._$);\n
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n
stack.push(newState);\n
break;\n
case 3:\n
return true;\n
}\n
}\n
return true;\n
}\n
};\n
\n
\n
function stripFlags(open, close) {\n
return {\n
left: open.charAt(2) === \'~\',\n
right: close.charAt(0) === \'~\' || close.charAt(1) === \'~\'\n
};\n
}\n
\n
/* Jison generated lexer */\n
var lexer = (function(){\n
var lexer = ({EOF:1,\n
parseError:function parseError(str, hash) {\n
if (this.yy.parser) {\n
this.yy.parser.parseError(str, hash);\n
} else {\n
throw new Error(str);\n
}\n
},\n
setInput:function (input) {\n
this._input = input;\n
this._more = this._less = this.done = false;\n
this.yylineno = this.yyleng = 0;\n
this.yytext = this.matched = this.match = \'\';\n
this.conditionStack = [\'INITIAL\'];\n
this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};\n
if (this.options.ranges) this.yylloc.range = [0,0];\n
this.offset = 0;\n
return this;\n
},\n
input:function () {\n
var ch = this._input[0];\n
this.yytext += ch;\n
this.yyleng++;\n
this.offset++;\n
this.match += ch;\n
this.matched += ch;\n
var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n
if (lines) {\n
this.yylineno++;\n
this.yylloc.last_line++;\n
} else {\n
this.yylloc.last_column++;\n
}\n
if (this.options.ranges) this.yylloc.range[1]++;\n
\n
this._input = this._input.slice(1);\n
return ch;\n
},\n
unput:function (ch) {\n
var len = ch.length;\n
var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n
\n
this._input = ch + this._input;\n
this.yytext = this.yytext.substr(0, this.yytext.length-len-1);\n
//this.yyleng -= len;\n
this.offset -= len;\n
var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n
this.match = this.match.substr(0, this.match.length-1);\n
this.matched = this.matched.substr(0, this.matched.length-1);\n
\n
if (lines.length-1) this.yylineno -= lines.length-1;\n
var r = this.yylloc.range;\n
\n
this.yylloc = {first_line: this.yylloc.first_line,\n
last_line: this.yylineno+1,\n
first_column: this.yylloc.first_column,\n
last_column: lines ?\n
(lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:\n
this.yylloc.first_column - len\n
};\n
\n
if (this.options.ranges) {\n
this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n
}\n
return this;\n
},\n
more:function () {\n
this._more = true;\n
return this;\n
},\n
less:function (n) {\n
this.unput(this.match.slice(n));\n
},\n
pastInput:function () {\n
var past = this.matched.substr(0, this.matched.length - this.match.length);\n
return (past.length > 20 ? \'...\':\'\') + past.substr(-20).replace(/\\n/g, "");\n
},\n
upcomingInput:function () {\n
var next = this.match;\n
if (next.length < 20) {\n
next += this._input.substr(0, 20-next.length);\n
}\n
return (next.substr(0,20)+(next.length > 20 ? \'...\':\'\')).replace(/\\n/g, "");\n
},\n
showPosition:function () {\n
var pre = this.pastInput();\n
var c = new Array(pre.length + 1).join("-");\n
return pre + this.upcomingInput() + "\\n" + c+"^";\n
},\n
next:function () {\n
if (this.done) {\n
return this.EOF;\n
}\n
if (!this._input) this.done = true;\n
\n
var token,\n
match,\n
tempMatch,\n
index,\n
col,\n
lines;\n
if (!this._more) {\n
this.yytext = \'\';\n
this.match = \'\';\n
}\n
var rules = this._currentRules();\n
for (var i=0;i < rules.length; i++) {\n
tempMatch = this._input.match(this.rules[rules[i]]);\n
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n
match = tempMatch;\n
index = i;\n
if (!this.options.flex) break;\n
}\n
}\n
if (match) {\n
lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n
if (lines) this.yylineno += lines.length;\n
this.yylloc = {first_line: this.yylloc.last_line,\n
last_line: this.yylineno+1,\n
first_column: this.yylloc.last_column,\n
last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length};\n
this.yytext += match[0];\n
this.match += match[0];\n
this.matches = match;\n
this.yyleng = this.yytext.length;\n
if (this.options.ranges) {\n
this.yylloc.range = [this.offset, this.offset += this.yyleng];\n
}\n
this._more = false;\n
this._input = this._input.slice(match[0].length);\n
this.matched += match[0];\n
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);\n
if (this.done && this._input) this.done = false;\n
if (token) return token;\n
else return;\n
}\n
if (this._input === "") {\n
return this.EOF;\n
} else {\n
return this.parseError(\'Lexical error on line \'+(this.yylineno+1)+\'. Unrecognized text.\\n\'+this.showPosition(),\n
{text: "", token: null, line: this.yylineno});\n
}\n
},\n
lex:function lex() {\n
var r = this.next();\n
if (typeof r !== \'undefined\') {\n
return r;\n
} else {\n
return this.lex();\n
}\n
},\n
begin:function begin(condition) {\n
this.conditionStack.push(condition);\n
},\n
popState:function popState() {\n
return this.conditionStack.pop();\n
},\n
_currentRules:function _currentRules() {\n
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;\n
},\n
topState:function () {\n
return this.conditionStack[this.conditionStack.length-2];\n
},\n
pushState:function begin(condition) {\n
this.begin(condition);\n
}});\n
lexer.options = {};\n
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\n
\n
\n
function strip(start, end) {\n
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);\n
}\n
\n
\n
var YYSTATE=YY_START\n
switch($avoiding_name_collisions) {\n
case 0:\n
if(yy_.yytext.slice(-2) === "\\\\\\\\") {\n
strip(0,1);\n
this.begin("mu");\n
} else if(yy_.yytext.slice(-1) === "\\\\") {\n
strip(0,1);\n
this.begin("emu");\n
} else {\n
this.begin("mu");\n
}\n
if(yy_.yytext) return 14;\n
\n
break;\n
case 1:return 14;\n
break;\n
case 2:\n
this.popState();\n
return 14;\n
\n
break;\n
case 3:strip(0,4); this.popState(); return 15;\n
break;\n
case 4:return 35;\n
break;\n
case 5:return 36;\n
break;\n
case 6:return 25;\n
break;\n
case 7:return 16;\n
break;\n
case 8:return 20;\n
break;\n
case 9:return 19;\n
break;\n
case 10:return 19;\n
break;\n
case 11:return 23;\n
break;\n
case 12:return 22;\n
break;\n
case 13:this.popState(); this.begin(\'com\');\n
break;\n
case 14:strip(3,5); this.popState(); return 15;\n
break;\n
case 15:return 22;\n
break;\n
case 16:return 41;\n
break;\n
case 17:return 40;\n
break;\n
case 18:return 40;\n
break;\n
case 19:return 44;\n
break;\n
case 20:// ignore whitespace\n
break;\n
case 21:this.popState(); return 24;\n
break;\n
case 22:this.popState(); return 18;\n
break;\n
case 23:yy_.yytext = strip(1,2).replace(/\\\\"/g,\'"\'); return 32;\n
break;\n
case 24:yy_.yytext = strip(1,2).replace(/\\\\\'/g,"\'"); return 32;\n
break;\n
case 25:return 42;\n
break;\n
case 26:return 34;\n
break;\n
case 27:return 34;\n
break;\n
case 28:return 33;\n
break;\n
case 29:return 40;\n
break;\n
case 30:yy_.yytext = strip(1,2); return 40;\n
break;\n
case 31:return \'INVALID\';\n
break;\n
case 32:return 5;\n
break;\n
}\n
};\n
lexer.rules = [/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:[\\s\\S]*?--\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{!--)/,/^(?:\\{\\{![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:"(\\\\["]|[^"])*")/,/^(?:\'(\\\\[\']|[^\'])*\')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:-?[0-9]+(?=([~}\\s)])))/,/^(?:([^\\s!"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)]))))/,/^(?:\\[[^\\]]*\\])/,/^(?:.)/,/^(?:$)/];\n
lexer.conditions = {"mu":{"rules":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[3],"inclusive":false},"INITIAL":{"rules":[0,1,32],"inclusive":true}};\n
return lexer;})()\n
parser.lexer = lexer;\n
function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;\n
return new Parser;\n
})();__exports__ = handlebars;\n
/* jshint ignore:end */\n
return __exports__;\n
})();\n
\n
// handlebars/compiler/base.js\n
var __module8__ = (function(__dependency1__, __dependency2__) {\n
"use strict";\n
var __exports__ = {};\n
var parser = __dependency1__;\n
var AST = __dependency2__;\n
\n
__exports__.parser = parser;\n
\n
function parse(input) {\n
// Just return if an already-compile AST was passed in.\n
if(input.constructor === AST.ProgramNode) { return input; }\n
\n
parser.yy = AST;\n
return parser.parse(input);\n
}\n
\n
__exports__.parse = parse;\n
return __exports__;\n
})(__module9__, __module7__);\n
\n
// handlebars/compiler/compiler.js\n
var __module10__ = (function(__dependency1__) {\n
"use strict";\n
var __exports__ = {};\n
var Exception = __dependency1__;\n
\n
function Compiler() {}\n
\n
__exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a\n
// function in a context. This is necessary for mustache compatibility, which\n
// requires that context functions in blocks are evaluated by blockHelperMissing,\n
// and then proceed as if the resulting value was provided to blockHelperMissing.\n
\n
Compiler.prototype = {\n
compiler: Compiler,\n
\n
disassemble: function() {\n
var opcodes = this.opcodes, opcode, out = [], params, param;\n
\n
for (var i=0, l=opcodes.length; i<l; i++) {\n
opcode = opcodes[i];\n
\n
if (opcode.opcode === \'DECLARE\') {\n
out.push("DECLARE " + opcode.name + "=" + opcode.value);\n
} else {\n
params = [];\n
for (var j=0; j<opcode.args.length; j++) {\n
param = opcode.args[j];\n
if (typeof param === "string") {\n
param = "\\"" + param.replace("\\n", "\\\\n") + "\\"";\n
}\n
params.push(param);\n
}\n
out.push(opcode.opcode + " " + params.join(" "));\n
}\n
}\n
\n
return out.join("\\n");\n
},\n
\n
equals: function(other) {\n
var len = this.opcodes.length;\n
if (other.opcodes.length !== len) {\n
return false;\n
}\n
\n
for (var i = 0; i < len; i++) {\n
var opcode = this.opcodes[i],\n
otherOpcode = other.opcodes[i];\n
if (opcode.opcode !== otherOpcode.opcode || opcode.args.length !== otherOpcode.args.length) {\n
return false;\n
}\n
for (var j = 0; j < opcode.args.length; j++) {\n
if (opcode.args[j] !== otherOpcode.args[j]) {\n
return false;\n
}\n
}\n
}\n
\n
len = this.children.length;\n
if (other.children.length !== len) {\n
return false;\n
}\n
for (i = 0; i < len; i++) {\n
if (!this.children[i].equals(other.children[i])) {\n
return false;\n
}\n
}\n
\n
return true;\n
},\n
\n
guid: 0,\n
\n
compile: function(program, options) {\n
this.opcodes = [];\n
this.children = [];\n
this.depths = {list: []};\n
this.options = options;\n
\n
// These changes will propagate to the other compiler components\n
var knownHelpers = this.options.knownHelpers;\n
this.options.knownHelpers = {\n
\'helperMissing\': true,\n
\'blockHelperMissing\': true,\n
\'each\': true,\n
\'if\': true,\n
\'unless\': true,\n
\'with\': true,\n
\'log\': true\n
};\n
if (knownHelpers) {\n
for (var name in knownHelpers) {\n
this.options.knownHelpers[name] = knownHelpers[name];\n
}\n
}\n
\n
return this.accept(program);\n
},\n
\n
accept: function(node) {\n
var strip = node.strip || {},\n
ret;\n
if (strip.left) {\n
this.opcode(\'strip\');\n
}\n
\n
ret = this[node.type](node);\n
\n
if (strip.right) {\n
this.opcode(\'strip\');\n
}\n
\n
return ret;\n
},\n
\n
program: function(program) {\n
var statements = program.statements;\n
\n
for(var i=0, l=statements.length; i<l; i++) {\n
this.accept(statements[i]);\n
}\n
this.isSimple = l === 1;\n
\n
this.depths.list = this.depths.list.sort(function(a, b) {\n
return a - b;\n
});\n
\n
return this;\n
},\n
\n
compileProgram: function(program) {\n
var result = new this.compiler().compile(program, this.options);\n
var guid = this.guid++, depth;\n
\n
this.usePartial = this.usePartial || result.usePartial;\n
\n
this.children[guid] = result;\n
\n
for(var i=0, l=result.depths.list.length; i<l; i++) {\n
depth = result.depths.list[i];\n
\n
if(depth < 2) { continue; }\n
else { this.addDepth(depth - 1); }\n
}\n
\n
return guid;\n
},\n
\n
block: function(block) {\n
var mustache = block.mustache,\n
program = block.program,\n
inverse = block.inverse;\n
\n
if (program) {\n
program = this.compileProgram(program);\n
}\n
\n
if (inverse) {\n
inverse = this.compileProgram(inverse);\n
}\n
\n
var sexpr = mustache.sexpr;\n
var type = this.classifySexpr(sexpr);\n
\n
if (type === "helper") {\n
this.helperSexpr(sexpr, program, inverse);\n
} else if (type === "simple") {\n
this.simpleSexpr(sexpr);\n
\n
// now that the simple mustache is resolved, we need to\n
// evaluate it by executing `blockHelperMissing`\n
this.opcode(\'pushProgram\', program);\n
this.opcode(\'pushProgram\', inverse);\n
this.opcode(\'emptyHash\');\n
this.opcode(\'blockValue\');\n
} else {\n
this.ambiguousSexpr(sexpr, program, inverse);\n
\n
// now that the simple mustache is resolved, we need to\n
// evaluate it by executing `blockHelperMissing`\n
this.opcode(\'pushProgram\', program);\n
this.opcode(\'pushProgram\', inverse);\n
this.opcode(\'emptyHash\');\n
this.opcode(\'ambiguousBlockValue\');\n
}\n
\n
this.opcode(\'append\');\n
},\n
\n
hash: function(hash) {\n
var pairs = hash.pairs, pair, val;\n
\n
this.opcode(\'pushHash\');\n
\n
for(var i=0, l=pairs.length; i<l; i++) {\n
pair = pairs[i];\n
val = pair[1];\n
\n
if (this.options.stringParams) {\n
if(val.depth) {\n
this.addDepth(val.depth);\n
}\n
this.opcode(\'getContext\', val.depth || 0);\n
this.opcode(\'pushStringParam\', val.stringModeValue, val.type);\n
\n
if (val.type === \'sexpr\') {\n
// Subexpressions get evaluated and passed in\n
// in string params mode.\n
this.sexpr(val);\n
}\n
} else {\n
this.accept(val);\n
}\n
\n
this.opcode(\'assignToHash\', pair[0]);\n
}\n
this.opcode(\'popHash\');\n
},\n
\n
partial: function(partial) {\n
var partialName = partial.partialName;\n
this.usePartial = true;\n
\n
if(partial.context) {\n
this.ID(partial.context);\n
} else {\n
this.opcode(\'push\', \'depth0\');\n
}\n
\n
this.opcode(\'invokePartial\', partialName.name);\n
this.opcode(\'append\');\n
},\n
\n
content: function(content) {\n
this.opcode(\'appendContent\', content.string);\n
},\n
\n
mustache: function(mustache) {\n
this.sexpr(mustache.sexpr);\n
\n
if(mustache.escaped && !this.options.noEscape) {\n
this.opcode(\'appendEscaped\');\n
} else {\n
this.opcode(\'append\');\n
}\n
},\n
\n
ambiguousSexpr: function(sexpr, program, inverse) {\n
var id = sexpr.id,\n
name = id.parts[0],\n
isBlock = program != null || inverse != null;\n
\n
this.opcode(\'getContext\', id.depth);\n
\n
this.opcode(\'pushProgram\', program);\n
this.opcode(\'pushProgram\', inverse);\n
\n
this.opcode(\'invokeAmbiguous\', name, isBlock);\n
},\n
\n
simpleSexpr: function(sexpr) {\n
var id = sexpr.id;\n
\n
if (id.type === \'DATA\') {\n
this.DATA(id);\n
} else if (id.parts.length) {\n
this.ID(id);\n
} else {\n
// Simplified ID for `this`\n
this.addDepth(id.depth);\n
this.opcode(\'getContext\', id.depth);\n
this.opcode(\'pushContext\');\n
}\n
\n
this.opcode(\'resolvePossibleLambda\');\n
},\n
\n
helperSexpr: function(sexpr, program, inverse) {\n
var params = this.setupFullMustacheParams(sexpr, program, inverse),\n
name = sexpr.id.parts[0];\n
\n
if (this.options.knownHelpers[name]) {\n
this.opcode(\'invokeKnownHelper\', params.length, name);\n
} else if (this.options.knownHelpersOnly) {\n
throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);\n
} else {\n
this.opcode(\'invokeHelper\', params.length, name, sexpr.isRoot);\n
}\n
},\n
\n
sexpr: function(sexpr) {\n
var type = this.classifySexpr(sexpr);\n
\n
if (type === "simple") {\n
this.simpleSexpr(sexpr);\n
} else if (type === "helper") {\n
this.helperSexpr(sexpr);\n
} else {\n
this.ambiguousSexpr(sexpr);\n
}\n
},\n
\n
ID: function(id) {\n
this.addDepth(id.depth);\n
this.opcode(\'getContext\', id.depth);\n
\n
var name = id.parts[0];\n
if (!name) {\n
this.opcode(\'pushContext\');\n
} else {\n
this.opcode(\'lookupOnContext\', id.parts[0]);\n
}\n
\n
for(var i=1, l=id.parts.length; i<l; i++) {\n
this.opcode(\'lookup\', id.parts[i]);\n
}\n
},\n
\n
DATA: function(data) {\n
this.options.data = true;\n
if (data.id.isScoped || data.id.depth) {\n
throw new Exception(\'Scoped data references are not supported: \' + data.original, data);\n
}\n
\n
this.opcode(\'lookupData\');\n
var parts = data.id.parts;\n
for(var i=0, l=parts.length; i<l; i++) {\n
this.opcode(\'lookup\', parts[i]);\n
}\n
},\n
\n
STRING: function(string) {\n
this.opcode(\'pushString\', string.string);\n
},\n
\n
INTEGER: function(integer) {\n
this.opcode(\'pushLiteral\', integer.integer);\n
},\n
\n
BOOLEAN: function(bool) {\n
this.opcode(\'pushLiteral\', bool.bool);\n
},\n
\n
comment: function() {},\n
\n
// HELPERS\n
opcode: function(name) {\n
this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });\n
},\n
\n
declare: function(name, value) {\n
this.opcodes.push({ opcode: \'DECLARE\', name: name, value: value });\n
},\n
\n
addDepth: function(depth) {\n
if(depth === 0) { return; }\n
\n
if(!this.depths[depth]) {\n
this.depths[depth] = true;\n
this.depths.list.push(depth);\n
}\n
},\n
\n
classifySexpr: function(sexpr) {\n
var isHelper = sexpr.isHelper;\n
var isEligible = sexpr.eligibleHelper;\n
var options = this.options;\n
\n
// if ambiguous, we can possibly resolve the ambiguity now\n
if (isEligible && !isHelper) {\n
var name = sexpr.id.parts[0];\n
\n
if (options.knownHelpers[name]) {\n
isHelper = true;\n
} else if (options.knownHelpersOnly) {\n
isEligible = false;\n
}\n
}\n
\n
if (isHelper) { return "helper"; }\n
else if (isEligible) { return "ambiguous"; }\n
else { return "simple"; }\n
},\n
\n
pushParams: function(params) {\n
var i = params.length, param;\n
\n
while(i--) {\n
param = params[i];\n
\n
if(this.options.stringParams) {\n
if(param.depth) {\n
this.addDepth(param.depth);\n
}\n
\n
this.opcode(\'getContext\', param.depth || 0);\n
this.opcode(\'pushStringParam\', param.stringModeValue, param.type);\n
\n
if (param.type === \'sexpr\') {\n
// Subexpressions get evaluated and passed in\n
// in string params mode.\n
this.sexpr(param);\n
}\n
} else {\n
this[param.type](param);\n
}\n
}\n
},\n
\n
setupFullMustacheParams: function(sexpr, program, inverse) {\n
var params = sexpr.params;\n
this.pushParams(params);\n
\n
this.opcode(\'pushProgram\', program);\n
this.opcode(\'pushProgram\', inverse);\n
\n
if (sexpr.hash) {\n
this.hash(sexpr.hash);\n
} else {\n
this.opcode(\'emptyHash\');\n
}\n
\n
return params;\n
}\n
};\n
\n
function precompile(input, options, env) {\n
if (input == null || (typeof input !== \'string\' && input.constructor !== env.AST.ProgramNode)) {\n
throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);\n
}\n
\n
options = options || {};\n
if (!(\'data\' in options)) {\n
options.data = true;\n
}\n
\n
var ast = env.parse(input);\n
var environment = new env.Compiler().compile(ast, options);\n
return new env.JavaScriptCompiler().compile(environment, options);\n
}\n
\n
__exports__.precompile = precompile;function compile(input, options, env) {\n
if (input == null || (typeof input !== \'string\' && input.constructor !== env.AST.ProgramNode)) {\n
throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);\n
}\n
\n
options = options || {};\n
\n
if (!(\'data\' in options)) {\n
options.data = true;\n
}\n
\n
var compiled;\n
\n
function compileInput() {\n
var ast = env.parse(input);\n
var environment = new env.Compiler().compile(ast, options);\n
var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);\n
return env.template(templateSpec);\n
}\n
\n
// Template is only compiled on first use and cached after that point.\n
return function(context, options) {\n
if (!compiled) {\n
compiled = compileInput();\n
}\n
return compiled.call(this, context, options);\n
};\n
}\n
\n
__exports__.compile = compile;\n
return __exports__;\n
})(__module5__);\n
\n
// handlebars/compiler/javascript-compiler.js\n
var __module11__ = (function(__dependency1__, __dependency2__) {\n
"use strict";\n
var __exports__;\n
var COMPILER_REVISION = __dependency1__.COMPILER_REVISION;\n
var REVISION_CHANGES = __dependency1__.REVISION_CHANGES;\n
var log = __dependency1__.log;\n
var Exception = __dependency2__;\n
\n
function Literal(value) {\n
this.value = value;\n
}\n
\n
function JavaScriptCompiler() {}\n
\n
JavaScriptCompiler.prototype = {\n
// PUBLIC API: You can override these methods in a subclass to provide\n
// alternative compiled forms for name lookup and buffering semantics\n
nameLookup: function(parent, name /* , type*/) {\n
var wrap,\n
ret;\n
if (parent.indexOf(\'depth\') === 0) {\n
wrap = true;\n
}\n
\n
if (/^[0-9]+$/.test(name)) {\n
ret = parent + "[" + name + "]";\n
} else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {\n
ret = parent + "." + name;\n
}\n
else {\n
ret = parent + "[\'" + name + "\']";\n
}\n
\n
if (wrap) {\n
return \'(\' + parent + \' && \' + ret + \')\';\n
} else {\n
return ret;\n
}\n
},\n
\n
compilerInfo: function() {\n
var revision = COMPILER_REVISION,\n
versions = REVISION_CHANGES[revision];\n
return "this.compilerInfo = ["+revision+",\'"+versions+"\'];\\n";\n
},\n
\n
appendToBuffer: function(string) {\n
if (this.environment.isSimple) {\n
return "return " + string + ";";\n
} else {\n
return {\n
appendToBuffer: true,\n
content: string,\n
toString: function() { return "buffer += " + string + ";"; }\n
};\n
}\n
},\n
\n
initializeBuffer: function() {\n
return this.quotedString("");\n
},\n
\n
namespace: "Handlebars",\n
// END PUBLIC API\n
\n
compile: function(environment, options, context, asObject) {\n
this.environment = environment;\n
this.options = options || {};\n
\n
log(\'debug\', this.environment.disassemble() + "\\n\\n");\n
\n
this.name = this.environment.name;\n
this.isChild = !!context;\n
this.context = context || {\n
programs: [],\n
environments: [],\n
aliases: { }\n
};\n
\n
this.preamble();\n
\n
this.stackSlot = 0;\n
this.stackVars = [];\n
this.registers = { list: [] };\n
this.hashes = [];\n
this.compileStack = [];\n
this.inlineStack = [];\n
\n
this.compileChildren(environment, options);\n
\n
var opcodes = environment.opcodes, opcode;\n
\n
this.i = 0;\n
\n
for(var l=opcodes.length; this.i<l; this.i++) {\n
opcode = opcodes[this.i];\n
\n
if(opcode.opcode === \'DECLARE\') {\n
this[opcode.name] = opcode.value;\n
} else {\n
this[opcode.opcode].apply(this, opcode.args);\n
}\n
\n
// Reset the stripNext flag if it was not set by this operation.\n
if (opcode.opcode !== this.stripNext) {\n
this.stripNext = false;\n
}\n
}\n
\n
// Flush any trailing content that might be pending.\n
this.pushSource(\'\');\n
\n
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {\n
throw new Exception(\'Compile completed with content left on stack\');\n
}\n
\n
return this.createFunctionContext(asObject);\n
},\n
\n
preamble: function() {\n
var out = [];\n
\n
if (!this.isChild) {\n
var namespace = this.namespace;\n
\n
var copies = "helpers = this.merge(helpers, " + namespace + ".helpers);";\n
if (this.environment.usePartial) { copies = copies + " partials = this.merge(partials, " + namespace + ".partials);"; }\n
if (this.options.data) { copies = copies + " data = data || {};"; }\n
out.push(copies);\n
} else {\n
out.push(\'\');\n
}\n
\n
if (!this.environment.isSimple) {\n
out.push(", buffer = " + this.initializeBuffer());\n
} else {\n
out.push("");\n
}\n
\n
// track the last context pushed into place to allow skipping the\n
// getContext opcode when it would be a noop\n
this.lastContext = 0;\n
this.source = out;\n
},\n
\n
createFunctionContext: function(asObject) {\n
var locals = this.stackVars.concat(this.registers.list);\n
\n
if(locals.length > 0) {\n
this.source[1] = this.source[1] + ", " + locals.join(", ");\n
}\n
\n
// Generate minimizer alias mappings\n
if (!this.isChild) {\n
for (var alias in this.context.aliases) {\n
if (this.context.aliases.hasOwnProperty(alias)) {\n
this.source[1] = this.source[1] + \', \' + alias + \'=\' + this.context.aliases[alias];\n
}\n
}\n
}\n
\n
if (this.source[1]) {\n
this.source[1] = "var " + this.source[1].substring(2) + ";";\n
}\n
\n
// Merge children\n
if (!this.isChild) {\n
this.source[1] += \'\\n\' + this.context.programs.join(\'\\n\') + \'\\n\';\n
}\n
\n
if (!this.environment.isSimple) {\n
this.pushSource("return buffer;");\n
}\n
\n
var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];\n
\n
for(var i=0, l=this.environment.depths.list.length; i<l; i++) {\n
params.push("depth" + this.environment.depths.list[i]);\n
}\n
\n
// Perform a second pass over the output to merge content when possible\n
var source = this.mergeSource();\n
\n
if (!this.isChild) {\n
source = this.compilerInfo()+source;\n
}\n
\n
if (asObject) {\n
params.push(source);\n
\n
return Function.apply(this, params);\n
} else {\n
var functionSource = \'function \' + (this.name || \'\') + \'(\' + params.join(\',\') + \') {\\n \' + source + \'}\';\n
log(\'debug\', functionSource + "\\n\\n");\n
return functionSource;\n
}\n
},\n
mergeSource: function() {\n
// WARN: We are not handling the case where buffer is still populated as the source should\n
// not have buffer append operations as their final action.\n
var source = \'\',\n
buffer;\n
for (var i = 0, len = this.source.length; i < len; i++) {\n
var line = this.source[i];\n
if (line.appendToBuffer) {\n
if (buffer) {\n
buffer = buffer + \'\\n + \' + line.content;\n
} else {\n
buffer = line.content;\n
}\n
} else {\n
if (buffer) {\n
source += \'buffer += \' + buffer + \';\\n \';\n
buffer = undefined;\n
}\n
source += line + \'\\n \';\n
}\n
}\n
return source;\n
},\n
\n
// [blockValue]\n
//\n
// On stack, before: hash, inverse, program, value\n
// On stack, after: return value of blockHelperMissing\n
//\n
// The purpose of this opcode is to take a block of the form\n
// `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and\n
// replace it on the stack with the result of properly\n
// invoking blockHelperMissing.\n
blockValue: function() {\n
this.context.aliases.blockHelperMissing = \'helpers.blockHelperMissing\';\n
\n
var params = ["depth0"];\n
this.setupParams(0, params);\n
\n
this.replaceStack(function(current) {\n
params.splice(1, 0, current);\n
return "blockHelperMissing.call(" + params.join(", ") + ")";\n
});\n
},\n
\n
// [ambiguousBlockValue]\n
//\n
// On stack, before: hash, inverse, program, value\n
// Compiler value, before: lastHelper=value of last found helper, if any\n
// On stack, after, if no lastHelper: same as [blockValue]\n
// On stack, after, if lastHelper: value\n
ambiguousBlockValue: function() {\n
this.context.aliases.blockHelperMissing = \'helpers.blockHelperMissing\';\n
\n
var params = ["depth0"];\n
this.setupParams(0, params);\n
\n
var current = this.topStack();\n
params.splice(1, 0, current);\n
\n
this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");\n
},\n
\n
// [appendContent]\n
//\n
// On stack, before: ...\n
// On stack, after: ...\n
//\n
// Appends the string value of `content` to the current buffer\n
appendContent: function(content) {\n
if (this.pendingContent) {\n
content = this.pendingContent + content;\n
}\n
if (this.stripNext) {\n
content = content.replace(/^\\s+/, \'\');\n
}\n
\n
this.pendingContent = content;\n
},\n
\n
// [strip]\n
//\n
// On stack, before: ...\n
// On stack, after: ...\n
//\n
// Removes any trailing whitespace from the prior content node and flags\n
// the next operation for stripping if it is a content node.\n
strip: function() {\n
if (this.pendingContent) {\n
this.pendingContent = this.pendingContent.replace(/\\s+$/, \'\');\n
}\n
this.stripNext = \'strip\';\n
},\n
\n
// [append]\n
//\n
// On stack, before: value, ...\n
// On stack, after: ...\n
//\n
// Coerces `value` to a String and appends it to the current buffer.\n
//\n
// If `value` is truthy, or 0, it is coerced into a string and appended\n
// Otherwise, the empty string is appended\n
append: function() {\n
// Force anything that is inlined onto the stack so we don\'t have duplication\n
// when we examine local\n
this.flushInline();\n
var local = this.popStack();\n
this.pushSource("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");\n
if (this.environment.isSimple) {\n
this.pushSource("else { " + this.appendToBuffer("\'\'") + " }");\n
}\n
},\n
\n
// [appendEscaped]\n
//\n
// On stack, before: value, ...\n
// On stack, after: ...\n
//\n
// Escape `value` and append it to the buffer\n
appendEscaped: function() {\n
this.context.aliases.escapeExpression = \'this.escapeExpression\';\n
\n
this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));\n
},\n
\n
// [getContext]\n
//\n
// On stack, before: ...\n
// On stack, after: ...\n
// Compiler value, after: lastContext=depth\n
//\n
// Set the value of the `lastContext` compiler value to the depth\n
getContext: function(depth) {\n
if(this.lastContext !== depth) {\n
this.lastContext = depth;\n
}\n
},\n
\n
// [lookupOnContext]\n
//\n
// On stack, before: ...\n
// On stack, after: currentContext[name], ...\n
//\n
// Looks up the value of `name` on the current context and pushes\n
// it onto the stack.\n
lookupOnContext: function(name) {\n
this.push(this.nameLookup(\'depth\' + this.lastContext, name, \'context\'));\n
},\n
\n
// [pushContext]\n
//\n
// On stack, before: ...\n
// On stack, after: currentContext, ...\n
//\n
// Pushes the value of the current context onto the stack.\n
pushContext: function() {\n
this.pushStackLiteral(\'depth\' + this.lastContext);\n
},\n
\n
// [resolvePossibleLambda]\n
//\n
// On stack, before: value, ...\n
// On stack, after: resolved value, ...\n
//\n
// If the `value` is a lambda, replace it on the stack by\n
// the return value of the lambda\n
resolvePossibleLambda: function() {\n
this.context.aliases.functionType = \'"function"\';\n
\n
this.replaceStack(function(current) {\n
return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;\n
});\n
},\n
\n
// [lookup]\n
//\n
// On stack, before: value, ...\n
// On stack, after: value[name], ...\n
//\n
// Replace the value on the stack with the result of looking\n
// up `name` on `value`\n
lookup: function(name) {\n
this.replaceStack(function(current) {\n
return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, \'context\');\n
});\n
},\n
\n
// [lookupData]\n
//\n
// On stack, before: ...\n
// On stack, after: data, ...\n
//\n
// Push the data lookup operator\n
lookupData: function() {\n
this.pushStackLiteral(\'data\');\n
},\n
\n
// [pushStringParam]\n
//\n
// On stack, before: ...\n
// On stack, after: string, currentContext, ...\n
//\n
// This opcode is designed for use in string mode, which\n
// provides the string value of a parameter along with its\n
// depth rather than resolving it immediately.\n
pushStringParam: function(string, type) {\n
this.pushStackLiteral(\'depth\' + this.lastContext);\n
\n
this.pushString(type);\n
\n
// If it\'s a subexpression, the string result\n
// will be pushed after this opcode.\n
if (type !== \'sexpr\') {\n
if (typeof string === \'string\') {\n
this.pushString(string);\n
} else {\n
this.pushStackLiteral(string);\n
}\n
}\n
},\n
\n
emptyHash: function() {\n
this.pushStackLiteral(\'{}\');\n
\n
if (this.options.stringParams) {\n
this.push(\'{}\'); // hashContexts\n
this.push(\'{}\'); // hashTypes\n
}\n
},\n
pushHash: function() {\n
if (this.hash) {\n
this.hashes.push(this.hash);\n
}\n
this.hash = {values: [], types: [], contexts: []};\n
},\n
popHash: function() {\n
var hash = this.hash;\n
this.hash = this.hashes.pop();\n
\n
if (this.options.stringParams) {\n
this.push(\'{\' + hash.contexts.join(\',\') + \'}\');\n
this.push(\'{\' + hash.types.join(\',\') + \'}\');\n
}\n
\n
this.push(\'{\\n \' + hash.values.join(\',\\n \') + \'\\n }\');\n
},\n
\n
// [pushString]\n
//\n
// On stack, before: ...\n
// On stack, after: quotedString(string), ...\n
//\n
// Push a quoted version of `string` onto the stack\n
pushString: function(string) {\n
this.pushStackLiteral(this.quotedString(string));\n
},\n
\n
// [push]\n
//\n
// On stack, before: ...\n
// On stack, after: expr, ...\n
//\n
// Push an expression onto the stack\n
push: function(expr) {\n
this.inlineStack.push(expr);\n
return expr;\n
},\n
\n
// [pushLiteral]\n
//\n
// On stack, before: ...\n
// On stack, after: value, ...\n
//\n
// Pushes a value onto the stack. This operation prevents\n
// the compiler from creating a temporary variable to hold\n
// it.\n
pushLiteral: function(value) {\n
this.pushStackLiteral(value);\n
},\n
\n
// [pushProgram]\n
//\n
// On stack, before: ...\n
// On stack, after: program(guid), ...\n
//\n
// Push a program expression onto the stack. This takes\n
// a compile-time guid and converts it into a runtime-accessible\n
// expression.\n
pushProgram: function(guid) {\n
if (guid != null) {\n
this.pushStackLiteral(this.programExpression(guid));\n
} else {\n
this.pushStackLiteral(null);\n
}\n
},\n
\n
// [invokeHelper]\n
//\n
// On stack, before: hash, inverse, program, params..., ...\n
// On stack, after: result of helper invocation\n
//\n
// Pops off the helper\'s parameters, invokes the helper,\n
// and pushes the helper\'s return value onto the stack.\n
//\n
// If the helper is not found, `helperMissing` is called.\n
invokeHelper: function(paramSize, name, isRoot) {\n
this.context.aliases.helperMissing = \'helpers.helperMissing\';\n
this.useRegister(\'helper\');\n
\n
var helper = this.lastHelper = this.setupHelper(paramSize, name, true);\n
var nonHelper = this.nameLookup(\'depth\' + this.lastContext, name, \'context\');\n
\n
var lookup = \'helper = \' + helper.name + \' || \' + nonHelper;\n
if (helper.paramsInit) {\n
lookup += \',\' + helper.paramsInit;\n
}\n
\n
this.push(\n
\'(\'\n
+ lookup\n
+ \',helper \'\n
+ \'? helper.call(\' + helper.callParams + \') \'\n
+ \': helperMissing.call(\' + helper.helperMissingParams + \'))\');\n
\n
// Always flush subexpressions. This is both to prevent the compounding size issue that\n
// occurs when the code has to be duplicated for inlining and also to prevent errors\n
// due to the incorrect options object being passed due to the shared register.\n
if (!isRoot) {\n
this.flushInline();\n
}\n
},\n
\n
// [invokeKnownHelper]\n
//\n
// On stack, before: hash, inverse, program, params..., ...\n
// On stack, after: result of helper invocation\n
//\n
// This operation is used when the helper is known to exist,\n
// so a `helperMissing` fallback is not required.\n
invokeKnownHelper: function(paramSize, name) {\n
var helper = this.setupHelper(paramSize, name);\n
this.push(helper.name + ".call(" + helper.callParams + ")");\n
},\n
\n
// [invokeAmbiguous]\n
//\n
// On stack, before: hash, inverse, program, params..., ...\n
// On stack, after: result of disambiguation\n
//\n
// This operation is used when an expression like `{{foo}}`\n
// is provided, but we don\'t know at compile-time whether it\n
// is a helper or a path.\n
//\n
// This operation emits more code than the other options,\n
// and can be avoided by passing the `knownHelpers` and\n
// `knownHelpersOnly` flags at compile-time.\n
invokeAmbiguous: function(name, helperCall) {\n
this.context.aliases.functionType = \'"function"\';\n
this.useRegister(\'helper\');\n
\n
this.emptyHash();\n
var helper = this.setupHelper(0, name, helperCall);\n
\n
var helperName = this.lastHelper = this.nameLookup(\'helpers\', name, \'helper\');\n
\n
var nonHelper = this.nameLookup(\'depth\' + this.lastContext, name, \'context\');\n
var nextStack = this.nextStack();\n
\n
if (helper.paramsInit) {\n
this.pushSource(helper.paramsInit);\n
}\n
this.pushSource(\'if (helper = \' + helperName + \') { \' + nextStack + \' = helper.call(\' + helper.callParams + \'); }\');\n
this.pushSource(\'else { helper = \' + nonHelper + \'; \' + nextStack + \' = typeof helper === functionType ? helper.call(\' + helper.callParams + \') : helper; }\');\n
},\n
\n
// [invokePartial]\n
//\n
// On stack, before: context, ...\n
// On stack after: result of partial invocation\n
//\n
// This operation pops off a context, invokes a partial with that context,\n
// and pushes the result of the invocation back.\n
invokePartial: function(name) {\n
var params = [this.nameLookup(\'partials\', name, \'partial\'), "\'" + name + "\'", this.popStack(), "helpers", "partials"];\n
\n
if (this.options.data) {\n
params.push("data");\n
}\n
\n
this.context.aliases.self = "this";\n
this.push("self.invokePartial(" + params.join(", ") + ")");\n
},\n
\n
// [assignToHash]\n
//\n
// On stack, before: value, hash, ...\n
// On stack, after: hash, ...\n
//\n
// Pops a value and hash off the stack, assigns `hash[key] = value`\n
// and pushes the hash back onto the stack.\n
assignToHash: function(key) {\n
var value = this.popStack(),\n
context,\n
type;\n
\n
if (this.options.stringParams) {\n
type = this.popStack();\n
context = this.popStack();\n
}\n
\n
var hash = this.hash;\n
if (context) {\n
hash.contexts.push("\'" + key + "\': " + context);\n
}\n
if (type) {\n
hash.types.push("\'" + key + "\': " + type);\n
}\n
hash.values.push("\'" + key + "\': (" + value + ")");\n
},\n
\n
// HELPERS\n
\n
compiler: JavaScriptCompiler,\n
\n
compileChildren: function(environment, options) {\n
var children = environment.children, child, compiler;\n
\n
for(var i=0, l=children.length; i<l; i++) {\n
child = children[i];\n
compiler = new this.compiler();\n
\n
var index = this.matchExistingProgram(child);\n
\n
if (index == null) {\n
this.context.programs.push(\'\'); // Placeholder to prevent name conflicts for nested children\n
index = this.context.programs.length;\n
child.index = index;\n
child.name = \'program\' + index;\n
this.context.programs[index] = compiler.compile(child, options, this.context);\n
this.context.environments[index] = child;\n
} else {\n
child.index = index;\n
child.name = \'program\' + index;\n
}\n
}\n
},\n
matchExistingProgram: function(child) {\n
for (var i = 0, len = this.context.environments.length; i < len; i++) {\n
var environment = this.context.environments[i];\n
if (environment && environment.equals(child)) {\n
return i;\n
}\n
}\n
},\n
\n
programExpression: function(guid) {\n
this.context.aliases.self = "this";\n
\n
if(guid == null) {\n
return "self.noop";\n
}\n
\n
var child = this.environment.children[guid],\n
depths = child.depths.list, depth;\n
\n
var programParams = [child.index, child.name, "data"];\n
\n
for(var i=0, l = depths.length; i<l; i++) {\n
depth = depths[i];\n
\n
if(depth === 1) { programParams.push("depth0"); }\n
else { programParams.push("depth" + (depth - 1)); }\n
}\n
\n
return (depths.length === 0 ? "self.program(" : "self.programWithDepth(") + programParams.join(", ") + ")";\n
},\n
\n
register: function(name, val) {\n
this.useRegister(name);\n
this.pushSource(name + " = " + val + ";");\n
},\n
\n
useRegister: function(name) {\n
if(!this.registers[name]) {\n
this.registers[name] = true;\n
this.registers.list.push(name);\n
}\n
},\n
\n
pushStackLiteral: function(item) {\n
return this.push(new Literal(item));\n
},\n
\n
pushSource: function(source) {\n
if (this.pendingContent) {\n
this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent)));\n
this.pendingContent = undefined;\n
}\n
\n
if (source) {\n
this.source.push(source);\n
}\n
},\n
\n
pushStack: function(item) {\n
this.flushInline();\n
\n
var stack = this.incrStack();\n
if (item) {\n
this.pushSource(stack + " = " + item + ";");\n
}\n
this.compileStack.push(stack);\n
return stack;\n
},\n
\n
replaceStack: function(callback) {\n
var prefix = \'\',\n
inline = this.isInline(),\n
stack,\n
createdStack,\n
usedLiteral;\n
\n
// If we are currently inline then we want to merge the inline statement into the\n
// replacement statement via \',\'\n
if (inline) {\n
var top = this.popStack(true);\n
\n
if (top instanceof Literal) {\n
// Literals do not need to be inlined\n
stack = top.value;\n
usedLiteral = true;\n
} else {\n
// Get or create the current stack name for use by the inline\n
createdStack = !this.stackSlot;\n
var name = !createdStack ? this.topStackName() : this.incrStack();\n
\n
prefix = \'(\' + this.push(name) + \' = \' + top + \'),\';\n
stack = this.topStack();\n
}\n
} else {\n
stack = this.topStack();\n
}\n
\n
var item = callback.call(this, stack);\n
\n
if (inline) {\n
if (!usedLiteral) {\n
this.popStack();\n
}\n
if (createdStack) {\n
this.stackSlot--;\n
}\n
this.push(\'(\' + prefix + item + \')\');\n
} else {\n
// Prevent modification of the context depth variable. Through replaceStack\n
if (!/^stack/.test(stack)) {\n
stack = this.nextStack();\n
}\n
\n
this.pushSource(stack + " = (" + prefix + item + ");");\n
}\n
return stack;\n
},\n
\n
nextStack: function() {\n
return this.pushStack();\n
},\n
\n
incrStack: function() {\n
this.stackSlot++;\n
if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }\n
return this.topStackName();\n
},\n
topStackName: function() {\n
return "stack" + this.stackSlot;\n
},\n
flushInline: function() {\n
var inlineStack = this.inlineStack;\n
if (inlineStack.length) {\n
this.inlineStack = [];\n
for (var i = 0, len = inlineStack.length; i < len; i++) {\n
var entry = inlineStack[i];\n
if (entry instanceof Literal) {\n
this.compileStack.push(entry);\n
} else {\n
this.pushStack(entry);\n
}\n
}\n
}\n
},\n
isInline: function() {\n
return this.inlineStack.length;\n
},\n
\n
popStack: function(wrapped) {\n
var inline = this.isInline(),\n
item = (inline ? this.inlineStack : this.compileStack).pop();\n
\n
if (!wrapped && (item instanceof Literal)) {\n
return item.value;\n
} else {\n
if (!inline) {\n
if (!this.stackSlot) {\n
throw new Exception(\'Invalid stack pop\');\n
}\n
this.stackSlot--;\n
}\n
return item;\n
}\n
},\n
\n
topStack: function(wrapped) {\n
var stack = (this.isInline() ? this.inlineStack : this.compileStack),\n
item = stack[stack.length - 1];\n
\n
if (!wrapped && (item instanceof Literal)) {\n
return item.value;\n
} else {\n
return item;\n
}\n
},\n
\n
quotedString: function(str) {\n
return \'"\' + str\n
.replace(/\\\\/g, \'\\\\\\\\\')\n
.replace(/"/g, \'\\\\"\')\n
.replace(/\\n/g, \'\\\\n\')\n
.replace(/\\r/g, \'\\\\r\')\n
.replace(/\\u2028/g, \'\\\\u2028\') // Per Ecma-262 7.3 + 7.8.4\n
.replace(/\\u2029/g, \'\\\\u2029\') + \'"\';\n
},\n
\n
setupHelper: function(paramSize, name, missingParams) {\n
var params = [],\n
paramsInit = this.setupParams(paramSize, params, missingParams);\n
var foundHelper = this.nameLookup(\'helpers\', name, \'helper\');\n
\n
return {\n
params: params,\n
paramsInit: paramsInit,\n
name: foundHelper,\n
callParams: ["depth0"].concat(params).join(", "),\n
helperMissingParams: missingParams && ["depth0", this.quotedString(name)].concat(params).join(", ")\n
};\n
},\n
\n
setupOptions: function(paramSize, params) {\n
var options = [], contexts = [], types = [], param, inverse, program;\n
\n
options.push("hash:" + this.popStack());\n
\n
if (this.options.stringParams) {\n
options.push("hashTypes:" + this.popStack());\n
options.push("hashContexts:" + this.popStack());\n
}\n
\n
inverse = this.popStack();\n
program = this.popStack();\n
\n
// Avoid setting fn and inverse if neither are set. This allows\n
// helpers to do a check for `if (options.fn)`\n
if (program || inverse) {\n
if (!program) {\n
this.context.aliases.self = "this";\n
program = "self.noop";\n
}\n
\n
if (!inverse) {\n
this.context.aliases.self = "this";\n
inverse = "self.noop";\n
}\n
\n
options.push("inverse:" + inverse);\n
options.push("fn:" + program);\n
}\n
\n
for(var i=0; i<paramSize; i++) {\n
param = this.popStack();\n
params.push(param);\n
\n
if(this.options.stringParams) {\n
types.push(this.popStack());\n
contexts.push(this.popStack());\n
}\n
}\n
\n
if (this.options.stringParams) {\n
options.push("contexts:[" + contexts.join(",") + "]");\n
options.push("types:[" + types.join(",") + "]");\n
}\n
\n
if(this.options.data) {\n
options.push("data:data");\n
}\n
\n
return options;\n
},\n
\n
// the params and contexts arguments are passed in arrays\n
// to fill in\n
setupParams: function(paramSize, params, useRegister) {\n
var options = \'{\' + this.setupOptions(paramSize, params).join(\',\') + \'}\';\n
\n
if (useRegister) {\n
this.useRegister(\'options\');\n
params.push(\'options\');\n
return \'options=\' + options;\n
} else {\n
params.push(options);\n
return \'\';\n
}\n
}\n
};\n
\n
var reservedWords = (\n
"break else new var" +\n
" case finally return void" +\n
" catch for switch while" +\n
" continue function this with" +\n
" default if throw" +\n
" delete in try" +\n
" do instanceof typeof" +\n
" abstract enum int short" +\n
" boolean export interface static" +\n
" byte extends long super" +\n
" char final native synchronized" +\n
" class float package throws" +\n
" const goto private transient" +\n
" debugger implements protected volatile" +\n
" double import public let yield"\n
).split(" ");\n
\n
var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};\n
\n
for(var i=0, l=reservedWords.length; i<l; i++) {\n
compilerWords[reservedWords[i]] = true;\n
}\n
\n
JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {\n
if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) {\n
return true;\n
}\n
return false;\n
};\n
\n
__exports__ = JavaScriptCompiler;\n
return __exports__;\n
})(__module2__, __module5__);\n
\n
// handlebars.js\n
var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {\n
"use strict";\n
var __exports__;\n
/*globals Handlebars: true */\n
var Handlebars = __dependency1__;\n
\n
// Compiler imports\n
var AST = __dependency2__;\n
var Parser = __dependency3__.parser;\n
var parse = __dependency3__.parse;\n
var Compiler = __dependency4__.Compiler;\n
var compile = __dependency4__.compile;\n
var precompile = __dependency4__.precompile;\n
var JavaScriptCompiler = __dependency5__;\n
\n
var _create = Handlebars.create;\n
var create = function() {\n
var hb = _create();\n
\n
hb.compile = function(input, options) {\n
return compile(input, options, hb);\n
};\n
hb.precompile = function (input, options) {\n
return precompile(input, options, hb);\n
};\n
\n
hb.AST = AST;\n
hb.Compiler = Compiler;\n
hb.JavaScriptCompiler = JavaScriptCompiler;\n
hb.Parser = Parser;\n
hb.parse = parse;\n
\n
return hb;\n
};\n
\n
Handlebars = create();\n
Handlebars.create = create;\n
\n
__exports__ = Handlebars;\n
return __exports__;\n
})(__module1__, __module7__, __module8__, __module10__, __module11__);\n
\n
return __module0__;\n
})();\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>handlebars.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>1.3.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_complex_queries.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_jio_complex_queries_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*\n
* Copyright 2013, Nexedi SA\n
* Released under the LGPL license.\n
* http://www.gnu.org/licenses/lgpl.html\n
*/\n
\n
/**\n
* Provides some function to use complex queries with item list\n
*\n
* @module complex_queries\n
*/\n
// define([module_name], [dependencies], module);\n
(function (dependencies, module) {\n
"use strict";\n
if (typeof define === \'function\' && define.amd) {\n
return define(dependencies, module);\n
}\n
if (typeof exports === \'object\') {\n
return module(exports);\n
}\n
window.complex_queries = {};\n
module(window.complex_queries, RSVP);\n
}([\'exports\', \'rsvp\'], function (to_export, RSVP) {\n
"use strict";\n
\n
/**\n
* Add a secured (write permission denied) property to an object.\n
*\n
* @param {Object} object The object to fill\n
* @param {String} key The object key where to store the property\n
* @param {Any} value The value to store\n
*/\n
function _export(key, value) {\n
Object.defineProperty(to_export, key, {\n
"configurable": false,\n
"enumerable": true,\n
"writable": false,\n
"value": value\n
});\n
}\n
\n
/**\n
* Parse a text request to a json query object tree\n
*\n
* @param {String} string The string to parse\n
* @return {Object} The json query tree\n
*/\n
function parseStringToObject(string) {\n
\n
\n
/*\n
\tDefault template driver for JS/CC generated parsers running as\n
\tbrowser-based JavaScript/ECMAScript applications.\n
\t\n
\tWARNING: \tThis parser template will not run as console and has lesser\n
\t\t\t\tfeatures for debugging than the console derivates for the\n
\t\t\t\tvarious JavaScript platforms.\n
\t\n
\tFeatures:\n
\t- Parser trace messages\n
\t- Integrated panic-mode error recovery\n
\t\n
\tWritten 2007, 2008 by Jan Max Meyer, J.M.K S.F. Software Technologies\n
\t\n
\tThis is in the public domain.\n
*/\n
\n
var NODEJS__dbg_withtrace\t\t= false;\n
var NODEJS__dbg_string\t\t\t= new String();\n
\n
function __NODEJS_dbg_print( text )\n
{\n
\tNODEJS__dbg_string += text + "\\n";\n
}\n
\n
function __NODEJS_lex( info )\n
{\n
\tvar state\t\t= 0;\n
\tvar match\t\t= -1;\n
\tvar match_pos\t= 0;\n
\tvar start\t\t= 0;\n
\tvar pos\t\t\t= info.offset + 1;\n
\n
\tdo\n
\t{\n
\t\tpos--;\n
\t\tstate = 0;\n
\t\tmatch = -2;\n
\t\tstart = pos;\n
\n
\t\tif( info.src.length <= start )\n
\t\t\treturn 19;\n
\n
\t\tdo\n
\t\t{\n
\n
switch( state )\n
{\n
\tcase 0:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 8 ) || ( info.src.charCodeAt( pos ) >= 10 && info.src.charCodeAt( pos ) <= 31 ) || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || info.src.charCodeAt( pos ) == 59 || ( info.src.charCodeAt( pos ) >= 63 && info.src.charCodeAt( pos ) <= 64 ) || ( info.src.charCodeAt( pos ) >= 66 && info.src.charCodeAt( pos ) <= 77 ) || ( info.src.charCodeAt( pos ) >= 80 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 9 ) state = 2;\n
\t\telse if( info.src.charCodeAt( pos ) == 40 ) state = 3;\n
\t\telse if( info.src.charCodeAt( pos ) == 41 ) state = 4;\n
\t\telse if( info.src.charCodeAt( pos ) == 60 || info.src.charCodeAt( pos ) == 62 ) state = 5;\n
\t\telse if( info.src.charCodeAt( pos ) == 33 ) state = 11;\n
\t\telse if( info.src.charCodeAt( pos ) == 79 ) state = 12;\n
\t\telse if( info.src.charCodeAt( pos ) == 32 ) state = 13;\n
\t\telse if( info.src.charCodeAt( pos ) == 61 ) state = 14;\n
\t\telse if( info.src.charCodeAt( pos ) == 34 ) state = 15;\n
\t\telse if( info.src.charCodeAt( pos ) == 65 ) state = 19;\n
\t\telse if( info.src.charCodeAt( pos ) == 78 ) state = 20;\n
\t\telse state = -1;\n
\t\tbreak;\n
\n
\tcase 1:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 2:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse state = -1;\n
\t\tmatch = 1;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 3:\n
\t\tstate = -1;\n
\t\tmatch = 3;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 4:\n
\t\tstate = -1;\n
\t\tmatch = 4;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 5:\n
\t\tif( info.src.charCodeAt( pos ) == 61 ) state = 14;\n
\t\telse state = -1;\n
\t\tmatch = 11;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 6:\n
\t\tstate = -1;\n
\t\tmatch = 8;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 7:\n
\t\tstate = -1;\n
\t\tmatch = 9;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 8:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse state = -1;\n
\t\tmatch = 6;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 9:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse state = -1;\n
\t\tmatch = 5;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 10:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse state = -1;\n
\t\tmatch = 7;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 11:\n
\t\tif( info.src.charCodeAt( pos ) == 61 ) state = 14;\n
\t\telse state = -1;\n
\t\tbreak;\n
\n
\tcase 12:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 81 ) || ( info.src.charCodeAt( pos ) >= 83 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse if( info.src.charCodeAt( pos ) == 82 ) state = 8;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 13:\n
\t\tstate = -1;\n
\t\tmatch = 1;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 14:\n
\t\tstate = -1;\n
\t\tmatch = 11;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 15:\n
\t\tif( info.src.charCodeAt( pos ) == 34 ) state = 7;\n
\t\telse if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 33 ) || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 91 ) || ( info.src.charCodeAt( pos ) >= 93 && info.src.charCodeAt( pos ) <= 254 ) ) state = 15;\n
\t\telse if( info.src.charCodeAt( pos ) == 92 ) state = 17;\n
\t\telse state = -1;\n
\t\tbreak;\n
\n
\tcase 16:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 67 ) || ( info.src.charCodeAt( pos ) >= 69 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse if( info.src.charCodeAt( pos ) == 68 ) state = 9;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 17:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 254 ) ) state = 15;\n
\t\telse state = -1;\n
\t\tbreak;\n
\n
\tcase 18:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 83 ) || ( info.src.charCodeAt( pos ) >= 85 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse if( info.src.charCodeAt( pos ) == 84 ) state = 10;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 19:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 77 ) || ( info.src.charCodeAt( pos ) >= 79 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse if( info.src.charCodeAt( pos ) == 78 ) state = 16;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
\tcase 20:\n
\t\tif( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 78 ) || ( info.src.charCodeAt( pos ) >= 80 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;\n
\t\telse if( info.src.charCodeAt( pos ) == 58 ) state = 6;\n
\t\telse if( info.src.charCodeAt( pos ) == 79 ) state = 18;\n
\t\telse state = -1;\n
\t\tmatch = 10;\n
\t\tmatch_pos = pos;\n
\t\tbreak;\n
\n
}\n
\n
\n
\t\t\tpos++;\n
\n
\t\t}\n
\t\twhile( state > -1 );\n
\n
\t}\n
\twhile( 1 > -1 && match == 1 );\n
\n
\tif( match > -1 )\n
\t{\n
\t\tinfo.att = info.src.substr( start, match_pos - start );\n
\t\tinfo.offset = match_pos;\n
\t\t\n
\n
\t}\n
\telse\n
\t{\n
\t\tinfo.att = new String();\n
\t\tmatch = -1;\n
\t}\n
\n
\treturn match;\n
}\n
\n
\n
function __NODEJS_parse( src, err_off, err_la )\n
{\n
\tvar\t\tsstack\t\t\t= new Array();\n
\tvar\t\tvstack\t\t\t= new Array();\n
\tvar \terr_cnt\t\t\t= 0;\n
\tvar\t\tact;\n
\tvar\t\tgo;\n
\tvar\t\tla;\n
\tvar\t\trval;\n
\tvar \tparseinfo\t\t= new Function( "", "var offset; var src; var att;" );\n
\tvar\t\tinfo\t\t\t= new parseinfo();\n
\t\n
/* Pop-Table */\n
var pop_tab = new Array(\n
\tnew Array( 0/* begin\' */, 1 ),\n
\tnew Array( 13/* begin */, 1 ),\n
\tnew Array( 12/* search_text */, 1 ),\n
\tnew Array( 12/* search_text */, 2 ),\n
\tnew Array( 12/* search_text */, 3 ),\n
\tnew Array( 14/* and_expression */, 1 ),\n
\tnew Array( 14/* and_expression */, 3 ),\n
\tnew Array( 15/* boolean_expression */, 2 ),\n
\tnew Array( 15/* boolean_expression */, 1 ),\n
\tnew Array( 16/* expression */, 3 ),\n
\tnew Array( 16/* expression */, 2 ),\n
\tnew Array( 16/* expression */, 1 ),\n
\tnew Array( 17/* value */, 2 ),\n
\tnew Array( 17/* value */, 1 ),\n
\tnew Array( 18/* string */, 1 ),\n
\tnew Array( 18/* string */, 1 )\n
);\n
\n
/* Action-Table */\n
var act_tab = new Array(\n
\t/* State 0 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 1 */ new Array( 19/* "$" */,0 ),\n
\t/* State 2 */ new Array( 19/* "$" */,-1 ),\n
\t/* State 3 */ new Array( 6/* "OR" */,14 , 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 , 19/* "$" */,-2 , 4/* "RIGHT_PARENTHESE" */,-2 ),\n
\t/* State 4 */ new Array( 5/* "AND" */,16 , 19/* "$" */,-5 , 7/* "NOT" */,-5 , 3/* "LEFT_PARENTHESE" */,-5 , 8/* "COLUMN" */,-5 , 11/* "OPERATOR" */,-5 , 10/* "WORD" */,-5 , 9/* "STRING" */,-5 , 6/* "OR" */,-5 , 4/* "RIGHT_PARENTHESE" */,-5 ),\n
\t/* State 5 */ new Array( 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 6 */ new Array( 19/* "$" */,-8 , 7/* "NOT" */,-8 , 3/* "LEFT_PARENTHESE" */,-8 , 8/* "COLUMN" */,-8 , 11/* "OPERATOR" */,-8 , 10/* "WORD" */,-8 , 9/* "STRING" */,-8 , 6/* "OR" */,-8 , 5/* "AND" */,-8 , 4/* "RIGHT_PARENTHESE" */,-8 ),\n
\t/* State 7 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 8 */ new Array( 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 9 */ new Array( 19/* "$" */,-11 , 7/* "NOT" */,-11 , 3/* "LEFT_PARENTHESE" */,-11 , 8/* "COLUMN" */,-11 , 11/* "OPERATOR" */,-11 , 10/* "WORD" */,-11 , 9/* "STRING" */,-11 , 6/* "OR" */,-11 , 5/* "AND" */,-11 , 4/* "RIGHT_PARENTHESE" */,-11 ),\n
\t/* State 10 */ new Array( 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 11 */ new Array( 19/* "$" */,-13 , 7/* "NOT" */,-13 , 3/* "LEFT_PARENTHESE" */,-13 , 8/* "COLUMN" */,-13 , 11/* "OPERATOR" */,-13 , 10/* "WORD" */,-13 , 9/* "STRING" */,-13 , 6/* "OR" */,-13 , 5/* "AND" */,-13 , 4/* "RIGHT_PARENTHESE" */,-13 ),\n
\t/* State 12 */ new Array( 19/* "$" */,-14 , 7/* "NOT" */,-14 , 3/* "LEFT_PARENTHESE" */,-14 , 8/* "COLUMN" */,-14 , 11/* "OPERATOR" */,-14 , 10/* "WORD" */,-14 , 9/* "STRING" */,-14 , 6/* "OR" */,-14 , 5/* "AND" */,-14 , 4/* "RIGHT_PARENTHESE" */,-14 ),\n
\t/* State 13 */ new Array( 19/* "$" */,-15 , 7/* "NOT" */,-15 , 3/* "LEFT_PARENTHESE" */,-15 , 8/* "COLUMN" */,-15 , 11/* "OPERATOR" */,-15 , 10/* "WORD" */,-15 , 9/* "STRING" */,-15 , 6/* "OR" */,-15 , 5/* "AND" */,-15 , 4/* "RIGHT_PARENTHESE" */,-15 ),\n
\t/* State 14 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 15 */ new Array( 19/* "$" */,-3 , 4/* "RIGHT_PARENTHESE" */,-3 ),\n
\t/* State 16 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),\n
\t/* State 17 */ new Array( 19/* "$" */,-7 , 7/* "NOT" */,-7 , 3/* "LEFT_PARENTHESE" */,-7 , 8/* "COLUMN" */,-7 , 11/* "OPERATOR" */,-7 , 10/* "WORD" */,-7 , 9/* "STRING" */,-7 , 6/* "OR" */,-7 , 5/* "AND" */,-7 , 4/* "RIGHT_PARENTHESE" */,-7 ),\n
\t/* State 18 */ new Array( 4/* "RIGHT_PARENTHESE" */,23 ),\n
\t/* State 19 */ new Array( 19/* "$" */,-10 , 7/* "NOT" */,-10 , 3/* "LEFT_PARENTHESE" */,-10 , 8/* "COLUMN" */,-10 , 11/* "OPERATOR" */,-10 , 10/* "WORD" */,-10 , 9/* "STRING" */,-10 , 6/* "OR" */,-10 , 5/* "AND" */,-10 , 4/* "RIGHT_PARENTHESE" */,-10 ),\n
\t/* State 20 */ new Array( 19/* "$" */,-12 , 7/* "NOT" */,-12 , 3/* "LEFT_PARENTHESE" */,-12 , 8/* "COLUMN" */,-12 , 11/* "OPERATOR" */,-12 , 10/* "WORD" */,-12 , 9/* "STRING" */,-12 , 6/* "OR" */,-12 , 5/* "AND" */,-12 , 4/* "RIGHT_PARENTHESE" */,-12 ),\n
\t/* State 21 */ new Array( 19/* "$" */,-4 , 4/* "RIGHT_PARENTHESE" */,-4 ),\n
\t/* State 22 */ new Array( 19/* "$" */,-6 , 7/* "NOT" */,-6 , 3/* "LEFT_PARENTHESE" */,-6 , 8/* "COLUMN" */,-6 , 11/* "OPERATOR" */,-6 , 10/* "WORD" */,-6 , 9/* "STRING" */,-6 , 6/* "OR" */,-6 , 4/* "RIGHT_PARENTHESE" */,-6 ),\n
\t/* State 23 */ new Array( 19/* "$" */,-9 , 7/* "NOT" */,-9 , 3/* "LEFT_PARENTHESE" */,-9 , 8/* "COLUMN" */,-9 , 11/* "OPERATOR" */,-9 , 10/* "WORD" */,-9 , 9/* "STRING" */,-9 , 6/* "OR" */,-9 , 5/* "AND" */,-9 , 4/* "RIGHT_PARENTHESE" */,-9 )\n
);\n
\n
/* Goto-Table */\n
var goto_tab = new Array(\n
\t/* State 0 */ new Array( 13/* begin */,1 , 12/* search_text */,2 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 1 */ new Array( ),\n
\t/* State 2 */ new Array( ),\n
\t/* State 3 */ new Array( 12/* search_text */,15 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 4 */ new Array( ),\n
\t/* State 5 */ new Array( 16/* expression */,17 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 6 */ new Array( ),\n
\t/* State 7 */ new Array( 12/* search_text */,18 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 8 */ new Array( 16/* expression */,19 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 9 */ new Array( ),\n
\t/* State 10 */ new Array( 18/* string */,20 ),\n
\t/* State 11 */ new Array( ),\n
\t/* State 12 */ new Array( ),\n
\t/* State 13 */ new Array( ),\n
\t/* State 14 */ new Array( 12/* search_text */,21 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 15 */ new Array( ),\n
\t/* State 16 */ new Array( 14/* and_expression */,22 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),\n
\t/* State 17 */ new Array( ),\n
\t/* State 18 */ new Array( ),\n
\t/* State 19 */ new Array( ),\n
\t/* State 20 */ new Array( ),\n
\t/* State 21 */ new Array( ),\n
\t/* State 22 */ new Array( ),\n
\t/* State 23 */ new Array( )\n
);\n
\n
\n
\n
/* Symbol labels */\n
var labels = new Array(\n
\t"begin\'" /* Non-terminal symbol */,\n
\t"WHITESPACE" /* Terminal symbol */,\n
\t"WHITESPACE" /* Terminal symbol */,\n
\t"LEFT_PARENTHESE" /* Terminal symbol */,\n
\t"RIGHT_PARENTHESE" /* Terminal symbol */,\n
\t"AND" /* Terminal symbol */,\n
\t"OR" /* Terminal symbol */,\n
\t"NOT" /* Terminal symbol */,\n
\t"COLUMN" /* Terminal symbol */,\n
\t"STRING" /* Terminal symbol */,\n
\t"WORD" /* Terminal symbol */,\n
\t"OPERATOR" /* Terminal symbol */,\n
\t"search_text" /* Non-terminal symbol */,\n
\t"begin" /* Non-terminal symbol */,\n
\t"and_expression" /* Non-terminal symbol */,\n
\t"boolean_expression" /* Non-terminal symbol */,\n
\t"expression" /* Non-terminal symbol */,\n
\t"value" /* Non-terminal symbol */,\n
\t"string" /* Non-terminal symbol */,\n
\t"$" /* Terminal symbol */\n
);\n
\n
\n
\t\n
\tinfo.offset = 0;\n
\tinfo.src = src;\n
\tinfo.att = new String();\n
\t\n
\tif( !err_off )\n
\t\terr_off\t= new Array();\n
\tif( !err_la )\n
\terr_la = new Array();\n
\t\n
\tsstack.push( 0 );\n
\tvstack.push( 0 );\n
\t\n
\tla = __NODEJS_lex( info );\n
\n
\twhile( true )\n
\t{\n
\t\tact = 25;\n
\t\tfor( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )\n
\t\t{\n
\t\t\tif( act_tab[sstack[sstack.length-1]][i] == la )\n
\t\t\t{\n
\t\t\t\tact = act_tab[sstack[sstack.length-1]][i+1];\n
\t\t\t\tbreak;\n
\t\t\t}\n
\t\t}\n
\n
\t\tif( NODEJS__dbg_withtrace && sstack.length > 0 )\n
\t\t{\n
\t\t\t__NODEJS_dbg_print( "\\nState " + sstack[sstack.length-1] + "\\n" +\n
\t\t\t\t\t\t\t"\\tLookahead: " + labels[la] + " (\\"" + info.att + "\\")\\n" +\n
\t\t\t\t\t\t\t"\\tAction: " + act + "\\n" + \n
\t\t\t\t\t\t\t"\\tSource: \\"" + info.src.substr( info.offset, 30 ) + ( ( info.offset + 30 < info.src.length ) ?\n
\t\t\t\t\t\t\t\t\t"..." : "" ) + "\\"\\n" +\n
\t\t\t\t\t\t\t"\\tStack: " + sstack.join() + "\\n" +\n
\t\t\t\t\t\t\t"\\tValue stack: " + vstack.join() + "\\n" );\n
\t\t}\n
\t\t\n
\t\t\t\n
\t\t//Panic-mode: Try recovery when parse-error occurs!\n
\t\tif( act == 25 )\n
\t\t{\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "Error detected: There is no reduce or shift on the symbol " + labels[la] );\n
\t\t\t\n
\t\t\terr_cnt++;\n
\t\t\terr_off.push( info.offset - info.att.length );\t\t\t\n
\t\t\terr_la.push( new Array() );\n
\t\t\tfor( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )\n
\t\t\t\terr_la[err_la.length-1].push( labels[act_tab[sstack[sstack.length-1]][i]] );\n
\t\t\t\n
\t\t\t//Remember the original stack!\n
\t\t\tvar rsstack = new Array();\n
\t\t\tvar rvstack = new Array();\n
\t\t\tfor( var i = 0; i < sstack.length; i++ )\n
\t\t\t{\n
\t\t\t\trsstack[i] = sstack[i];\n
\t\t\t\trvstack[i] = vstack[i];\n
\t\t\t}\n
\t\t\t\n
\t\t\twhile( act == 25 && la != 19 )\n
\t\t\t{\n
\t\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t\t__NODEJS_dbg_print( "\\tError recovery\\n" +\n
\t\t\t\t\t\t\t\t\t"Current lookahead: " + labels[la] + " (" + info.att + ")\\n" +\n
\t\t\t\t\t\t\t\t\t"Action: " + act + "\\n\\n" );\n
\t\t\t\tif( la == -1 )\n
\t\t\t\t\tinfo.offset++;\n
\t\t\t\t\t\n
\t\t\t\twhile( act == 25 && sstack.length > 0 )\n
\t\t\t\t{\n
\t\t\t\t\tsstack.pop();\n
\t\t\t\t\tvstack.pop();\n
\t\t\t\t\t\n
\t\t\t\t\tif( sstack.length == 0 )\n
\t\t\t\t\t\tbreak;\n
\t\t\t\t\t\t\n
\t\t\t\t\tact = 25;\n
\t\t\t\t\tfor( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )\n
\t\t\t\t\t{\n
\t\t\t\t\t\tif( act_tab[sstack[sstack.length-1]][i] == la )\n
\t\t\t\t\t\t{\n
\t\t\t\t\t\t\tact = act_tab[sstack[sstack.length-1]][i+1];\n
\t\t\t\t\t\t\tbreak;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t\t\n
\t\t\t\tif( act != 25 )\n
\t\t\t\t\tbreak;\n
\t\t\t\t\n
\t\t\t\tfor( var i = 0; i < rsstack.length; i++ )\n
\t\t\t\t{\n
\t\t\t\t\tsstack.push( rsstack[i] );\n
\t\t\t\t\tvstack.push( rvstack[i] );\n
\t\t\t\t}\n
\t\t\t\t\n
\t\t\t\tla = __NODEJS_lex( info );\n
\t\t\t}\n
\t\t\t\n
\t\t\tif( act == 25 )\n
\t\t\t{\n
\t\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t\t__NODEJS_dbg_print( "\\tError recovery failed, terminating parse process..." );\n
\t\t\t\tbreak;\n
\t\t\t}\n
\n
\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "\\tError recovery succeeded, continuing" );\n
\t\t}\n
\t\t\n
\t\t/*\n
\t\tif( act == 25 )\n
\t\t\tbreak;\n
\t\t*/\n
\t\t\n
\t\t\n
\t\t//Shift\n
\t\tif( act > 0 )\n
\t\t{\t\t\t\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "Shifting symbol: " + labels[la] + " (" + info.att + ")" );\n
\t\t\n
\t\t\tsstack.push( act );\n
\t\t\tvstack.push( info.att );\n
\t\t\t\n
\t\t\tla = __NODEJS_lex( info );\n
\t\t\t\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "\\tNew lookahead symbol: " + labels[la] + " (" + info.att + ")" );\n
\t\t}\n
\t\t//Reduce\n
\t\telse\n
\t\t{\t\t\n
\t\t\tact *= -1;\n
\t\t\t\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "Reducing by producution: " + act );\n
\t\t\t\n
\t\t\trval = void(0);\n
\t\t\t\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "\\tPerforming semantic action..." );\n
\t\t\t\n
switch( act )\n
{\n
\tcase 0:\n
\t{\n
\t\trval = vstack[ vstack.length - 1 ];\n
\t}\n
\tbreak;\n
\tcase 1:\n
\t{\n
\t\t result = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 2:\n
\t{\n
\t\t rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 3:\n
\t{\n
\t\t rval = mkComplexQuery(\'OR\',[vstack[ vstack.length - 2 ],vstack[ vstack.length - 1 ]]); \n
\t}\n
\tbreak;\n
\tcase 4:\n
\t{\n
\t\t rval = mkComplexQuery(\'OR\',[vstack[ vstack.length - 3 ],vstack[ vstack.length - 1 ]]); \n
\t}\n
\tbreak;\n
\tcase 5:\n
\t{\n
\t\t rval = vstack[ vstack.length - 1 ] ; \n
\t}\n
\tbreak;\n
\tcase 6:\n
\t{\n
\t\t rval = mkComplexQuery(\'AND\',[vstack[ vstack.length - 3 ],vstack[ vstack.length - 1 ]]); \n
\t}\n
\tbreak;\n
\tcase 7:\n
\t{\n
\t\t rval = mkNotQuery(vstack[ vstack.length - 1 ]); \n
\t}\n
\tbreak;\n
\tcase 8:\n
\t{\n
\t\t rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 9:\n
\t{\n
\t\t rval = vstack[ vstack.length - 2 ]; \n
\t}\n
\tbreak;\n
\tcase 10:\n
\t{\n
\t\t simpleQuerySetKey(vstack[ vstack.length - 1 ],vstack[ vstack.length - 2 ].split(\':\').slice(0,-1).join(\':\')); rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 11:\n
\t{\n
\t\t rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 12:\n
\t{\n
\t\t vstack[ vstack.length - 1 ].operator = vstack[ vstack.length - 2 ] ; rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 13:\n
\t{\n
\t\t rval = vstack[ vstack.length - 1 ]; \n
\t}\n
\tbreak;\n
\tcase 14:\n
\t{\n
\t\t rval = mkSimpleQuery(\'\',vstack[ vstack.length - 1 ]); \n
\t}\n
\tbreak;\n
\tcase 15:\n
\t{\n
\t\t rval = mkSimpleQuery(\'\',vstack[ vstack.length - 1 ].split(\'"\').slice(1,-1).join(\'"\')); \n
\t}\n
\tbreak;\n
}\n
\n
\n
\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "\\tPopping " + pop_tab[act][1] + " off the stack..." );\n
\t\t\t\t\n
\t\t\tfor( var i = 0; i < pop_tab[act][1]; i++ )\n
\t\t\t{\n
\t\t\t\tsstack.pop();\n
\t\t\t\tvstack.pop();\n
\t\t\t}\n
\t\t\t\t\t\t\t\t\t\n
\t\t\tgo = -1;\n
\t\t\tfor( var i = 0; i < goto_tab[sstack[sstack.length-1]].length; i+=2 )\n
\t\t\t{\n
\t\t\t\tif( goto_tab[sstack[sstack.length-1]][i] == pop_tab[act][0] )\n
\t\t\t\t{\n
\t\t\t\t\tgo = goto_tab[sstack[sstack.length-1]][i+1];\n
\t\t\t\t\tbreak;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\t\n
\t\t\tif( act == 0 )\n
\t\t\t\tbreak;\n
\t\t\t\t\n
\t\t\tif( NODEJS__dbg_withtrace )\n
\t\t\t\t__NODEJS_dbg_print( "\\tPushing non-terminal " + labels[ pop_tab[act][0] ] );\n
\t\t\t\t\n
\t\t\tsstack.push( go );\n
\t\t\tvstack.push( rval );\t\t\t\n
\t\t}\n
\t\t\n
\t\tif( NODEJS__dbg_withtrace )\n
\t\t{\t\t\n
\t\t\talert( NODEJS__dbg_string );\n
\t\t\tNODEJS__dbg_string = new String();\n
\t\t}\n
\t}\n
\n
\tif( NODEJS__dbg_withtrace )\n
\t{\n
\t\t__NODEJS_dbg_print( "\\nParse complete." );\n
\t\talert( NODEJS__dbg_string );\n
\t}\n
\t\n
\treturn err_cnt;\n
}\n
\n
\n
\n
var arrayExtend = function () {\n
var j, i, newlist = [], list_list = arguments;\n
for (j = 0; j < list_list.length; j += 1) {\n
for (i = 0; i < list_list[j].length; i += 1) {\n
newlist.push(list_list[j][i]);\n
}\n
}\n
return newlist;\n
\n
}, mkSimpleQuery = function (key, value, operator) {\n
var object = {"type": "simple", "key": key, "value": value};\n
if (operator !== undefined) {\n
object.operator = operator;\n
}\n
return object;\n
\n
}, mkNotQuery = function (query) {\n
if (query.operator === "NOT") {\n
return query.query_list[0];\n
}\n
return {"type": "complex", "operator": "NOT", "query_list": [query]};\n
\n
}, mkComplexQuery = function (operator, query_list) {\n
var i, query_list2 = [];\n
for (i = 0; i < query_list.length; i += 1) {\n
if (query_list[i].operator === operator) {\n
query_list2 = arrayExtend(query_list2, query_list[i].query_list);\n
} else {\n
query_list2.push(query_list[i]);\n
}\n
}\n
return {type:"complex",operator:operator,query_list:query_list2};\n
\n
}, simpleQuerySetKey = function (query, key) {\n
var i;\n
if (query.type === "complex") {\n
for (i = 0; i < query.query_list.length; ++i) {\n
simpleQuerySetKey (query.query_list[i],key);\n
}\n
return true;\n
}\n
if (query.type === "simple" && !query.key) {\n
query.key = key;\n
return true;\n
}\n
return false;\n
},\n
error_offsets = [],\n
error_lookaheads = [],\n
error_count = 0,\n
result;\n
\n
if ((error_count = __NODEJS_parse(string, error_offsets, error_lookaheads)) > 0) {\n
var i;\n
for (i = 0; i < error_count; i += 1) {\n
throw new Error("Parse error near \\"" +\n
string.substr(error_offsets[i]) +\n
"\\", expecting \\"" +\n
error_lookaheads[i].join() + "\\"");\n
}\n
}\n
\n
\n
return result;\n
} // parseStringToObject\n
\n
_export(\'parseStringToObject\', parseStringToObject);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true */\n
\n
var query_class_dict = {};\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global Query: true, query_class_dict: true, inherits: true,\n
_export, QueryFactory, RSVP, sequence */\n
\n
/**\n
* The ComplexQuery inherits from Query, and compares one or several metadata\n
* values.\n
*\n
* @class ComplexQuery\n
* @extends Query\n
* @param {Object} [spec={}] The specifications\n
* @param {String} [spec.operator="AND"] The compare method to use\n
* @param {String} spec.key The metadata key\n
* @param {String} spec.value The value of the metadata to compare\n
*/\n
function ComplexQuery(spec, key_schema) {\n
Query.call(this);\n
\n
/**\n
* Logical operator to use to compare object values\n
*\n
* @attribute operator\n
* @type String\n
* @default "AND"\n
* @optional\n
*/\n
this.operator = spec.operator || "AND";\n
\n
/**\n
* The sub Query list which are used to query an item.\n
*\n
* @attribute query_list\n
* @type Array\n
* @default []\n
* @optional\n
*/\n
this.query_list = spec.query_list || [];\n
/*jslint unparam: true*/\n
this.query_list = this.query_list.map(\n
// decorate the map to avoid sending the index as key_schema argument\n
function (o, i) { return QueryFactory.create(o, key_schema); }\n
);\n
/*jslint unparam: false*/\n
\n
}\n
inherits(ComplexQuery, Query);\n
\n
/**\n
* #crossLink "Query/match:method"\n
*/\n
ComplexQuery.prototype.match = function (item) {\n
var operator = this.operator;\n
if (!(/^(?:AND|OR|NOT)$/i.test(operator))) {\n
operator = "AND";\n
}\n
return this[operator.toUpperCase()](item);\n
};\n
\n
/**\n
* #crossLink "Query/toString:method"\n
*/\n
ComplexQuery.prototype.toString = function () {\n
var str_list = ["("], this_operator = this.operator;\n
this.query_list.forEach(function (query) {\n
str_list.push(query.toString());\n
str_list.push(this_operator);\n
});\n
str_list[str_list.length - 1] = ")"; // replace last operator\n
return str_list.join(" ");\n
};\n
\n
/**\n
* #crossLink "Query/serialized:method"\n
*/\n
ComplexQuery.prototype.serialized = function () {\n
var s = {\n
"type": "complex",\n
"operator": this.operator,\n
"query_list": []\n
};\n
this.query_list.forEach(function (query) {\n
s.query_list.push(query.serialized());\n
});\n
return s;\n
};\n
ComplexQuery.prototype.toJSON = ComplexQuery.prototype.serialized;\n
\n
/**\n
* Comparison operator, test if all sub queries match the\n
* item value\n
*\n
* @method AND\n
* @param {Object} item The item to match\n
* @return {Boolean} true if all match, false otherwise\n
*/\n
ComplexQuery.prototype.AND = function (item) {\n
var j, promises = [];\n
for (j = 0; j < this.query_list.length; j += 1) {\n
promises.push(this.query_list[j].match(item));\n
}\n
\n
function cancel() {\n
var i;\n
for (i = 0; i < promises.length; i += 1) {\n
if (typeof promises.cancel === \'function\') {\n
promises.cancel();\n
}\n
}\n
}\n
\n
return new RSVP.Promise(function (resolve, reject) {\n
var i, count = 0;\n
function resolver(value) {\n
if (!value) {\n
resolve(false);\n
}\n
count += 1;\n
if (count === promises.length) {\n
resolve(true);\n
}\n
}\n
\n
function rejecter(err) {\n
reject(err);\n
cancel();\n
}\n
\n
for (i = 0; i < promises.length; i += 1) {\n
promises[i].then(resolver, rejecter);\n
}\n
}, cancel);\n
};\n
\n
/**\n
* Comparison operator, test if one of the sub queries matches the\n
* item value\n
*\n
* @method OR\n
* @param {Object} item The item to match\n
* @return {Boolean} true if one match, false otherwise\n
*/\n
ComplexQuery.prototype.OR = function (item) {\n
var j, promises = [];\n
for (j = 0; j < this.query_list.length; j += 1) {\n
promises.push(this.query_list[j].match(item));\n
}\n
\n
function cancel() {\n
var i;\n
for (i = 0; i < promises.length; i += 1) {\n
if (typeof promises.cancel === \'function\') {\n
promises.cancel();\n
}\n
}\n
}\n
\n
return new RSVP.Promise(function (resolve, reject) {\n
var i, count = 0;\n
function resolver(value) {\n
if (value) {\n
resolve(true);\n
}\n
count += 1;\n
if (count === promises.length) {\n
resolve(false);\n
}\n
}\n
\n
function rejecter(err) {\n
reject(err);\n
cancel();\n
}\n
\n
for (i = 0; i < promises.length; i += 1) {\n
promises[i].then(resolver, rejecter);\n
}\n
}, cancel);\n
};\n
\n
/**\n
* Comparison operator, test if the sub query does not match the\n
* item value\n
*\n
* @method NOT\n
* @param {Object} item The item to match\n
* @return {Boolean} true if one match, false otherwise\n
*/\n
ComplexQuery.prototype.NOT = function (item) {\n
return sequence([function () {\n
return this.query_list[0].match(item);\n
}, function (answer) {\n
return !answer;\n
}]);\n
};\n
\n
query_class_dict.complex = ComplexQuery;\n
\n
_export("ComplexQuery", ComplexQuery);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global parseStringToObject: true, emptyFunction: true, sortOn: true, limit:\n
true, select: true, _export: true, stringEscapeRegexpCharacters: true,\n
deepClone, RSVP, sequence */\n
\n
/**\n
* The query to use to filter a list of objects.\n
* This is an abstract class.\n
*\n
* @class Query\n
* @constructor\n
*/\n
function Query() {\n
\n
/**\n
* Called before parsing the query. Must be overridden!\n
*\n
* @method onParseStart\n
* @param {Object} object The object shared in the parse process\n
* @param {Object} option Some option gave in parse()\n
*/\n
this.onParseStart = emptyFunction;\n
\n
/**\n
* Called when parsing a simple query. Must be overridden!\n
*\n
* @method onParseSimpleQuery\n
* @param {Object} object The object shared in the parse process\n
* @param {Object} option Some option gave in parse()\n
*/\n
this.onParseSimpleQuery = emptyFunction;\n
\n
/**\n
* Called when parsing a complex query. Must be overridden!\n
*\n
* @method onParseComplexQuery\n
* @param {Object} object The object shared in the parse process\n
* @param {Object} option Some option gave in parse()\n
*/\n
this.onParseComplexQuery = emptyFunction;\n
\n
/**\n
* Called after parsing the query. Must be overridden!\n
*\n
* @method onParseEnd\n
* @param {Object} object The object shared in the parse process\n
* @param {Object} option Some option gave in parse()\n
*/\n
this.onParseEnd = emptyFunction;\n
\n
}\n
\n
/**\n
* Filter the item list with matching item only\n
*\n
* @method exec\n
* @param {Array} item_list The list of object\n
* @param {Object} [option] Some operation option\n
* @param {Array} [option.select_list] A object keys to retrieve\n
* @param {Array} [option.sort_on] Couples of object keys and "ascending"\n
* or "descending"\n
* @param {Array} [option.limit] Couple of integer, first is an index and\n
* second is the length.\n
*/\n
Query.prototype.exec = function (item_list, option) {\n
var i, promises = [];\n
if (!Array.isArray(item_list)) {\n
throw new TypeError("Query().exec(): Argument 1 is not of type \'array\'");\n
}\n
if (option === undefined) {\n
option = {};\n
}\n
if (typeof option !== \'object\') {\n
throw new TypeError("Query().exec(): " +\n
"Optional argument 2 is not of type \'object\'");\n
}\n
for (i = 0; i < item_list.length; i += 1) {\n
if (!item_list[i]) {\n
promises.push(RSVP.resolve(false));\n
} else {\n
promises.push(this.match(item_list[i]));\n
}\n
}\n
return sequence([function () {\n
return RSVP.all(promises);\n
}, function (answers) {\n
var j;\n
for (j = answers.length - 1; j >= 0; j -= 1) {\n
if (!answers[j]) {\n
item_list.splice(j, 1);\n
}\n
}\n
if (option.sort_on) {\n
return sortOn(option.sort_on, item_list);\n
}\n
}, function () {\n
if (option.limit) {\n
return limit(option.limit, item_list);\n
}\n
}, function () {\n
return select(option.select_list || [], item_list);\n
}, function () {\n
return item_list;\n
}]);\n
};\n
\n
/**\n
* Test if an item matches this query\n
*\n
* @method match\n
* @param {Object} item The object to test\n
* @return {Boolean} true if match, false otherwise\n
*/\n
Query.prototype.match = function () {\n
return RSVP.resolve(true);\n
};\n
\n
\n
/**\n
* Browse the Query in deep calling parser method in each step.\n
*\n
* `onParseStart` is called first, on end `onParseEnd` is called.\n
* It starts from the simple queries at the bottom of the tree calling the\n
* parser method `onParseSimpleQuery`, and go up calling the\n
* `onParseComplexQuery` method.\n
*\n
* @method parse\n
* @param {Object} option Any options you want (except \'parsed\')\n
* @return {Any} The parse result\n
*/\n
Query.prototype.parse = function (option) {\n
var that = this, object;\n
/**\n
* The recursive parser.\n
*\n
* @param {Object} object The object shared in the parse process\n
* @param {Object} options Some options usable in the parseMethods\n
* @return {Any} The parser result\n
*/\n
function recParse(object, option) {\n
var query = object.parsed;\n
if (query.type === "complex") {\n
return sequence([function () {\n
return sequence(query.query_list.map(function (v, i) {\n
/*jslint unparam: true */\n
return function () {\n
sequence([function () {\n
object.parsed = query.query_list[i];\n
return recParse(object, option);\n
}, function () {\n
query.query_list[i] = object.parsed;\n
}]);\n
};\n
}));\n
}, function () {\n
object.parsed = query;\n
return that.onParseComplexQuery(object, option);\n
}]);\n
}\n
if (query.type === "simple") {\n
return that.onParseSimpleQuery(object, option);\n
}\n
}\n
object = {"parsed": JSON.parse(JSON.stringify(that.serialized()))};\n
return sequence([function () {\n
return that.onParseStart(object, option);\n
}, function () {\n
return recParse(object, option);\n
}, function () {\n
return that.onParseEnd(object, option);\n
}, function () {\n
return object.parsed;\n
}]);\n
};\n
\n
/**\n
* Convert this query to a parsable string.\n
*\n
* @method toString\n
* @return {String} The string version of this query\n
*/\n
Query.prototype.toString = function () {\n
return "";\n
};\n
\n
/**\n
* Convert this query to an jsonable object in order to be remake thanks to\n
* QueryFactory class.\n
*\n
* @method serialized\n
* @return {Object} The jsonable object\n
*/\n
Query.prototype.serialized = function () {\n
return undefined;\n
};\n
\n
_export("Query", Query);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global _export, ComplexQuery, SimpleQuery, Query, parseStringToObject,\n
query_class_dict */\n
\n
/**\n
* Provides static methods to create Query object\n
*\n
* @class QueryFactory\n
*/\n
function QueryFactory() {\n
return;\n
}\n
\n
/**\n
* Creates Query object from a search text string or a serialized version\n
* of a Query.\n
*\n
* @method create\n
* @static\n
* @param {Object,String} object The search text or the serialized version\n
* of a Query\n
* @return {Query} A Query object\n
*/\n
QueryFactory.create = function (object, key_schema) {\n
if (object === "") {\n
return new Query();\n
}\n
if (typeof object === "string") {\n
object = parseStringToObject(object);\n
}\n
if (typeof (object || {}).type === "string" &&\n
query_class_dict[object.type]) {\n
return new query_class_dict[object.type](object, key_schema);\n
}\n
throw new TypeError("QueryFactory.create(): " +\n
"Argument 1 is not a search text or a parsable object");\n
};\n
\n
_export("QueryFactory", QueryFactory);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global _export: true */\n
\n
function objectToSearchText(query) {\n
var str_list = [];\n
if (query.type === "complex") {\n
str_list.push("(");\n
(query.query_list || []).forEach(function (sub_query) {\n
str_list.push(objectToSearchText(sub_query));\n
str_list.push(query.operator);\n
});\n
str_list.length -= 1;\n
str_list.push(")");\n
return str_list.join(" ");\n
}\n
if (query.type === "simple") {\n
return (query.key ? query.key + ": " : "") +\n
(query.operator || "") + \' "\' + query.value + \'"\';\n
}\n
throw new TypeError("This object is not a query");\n
}\n
_export("objectToSearchText", objectToSearchText);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global Query: true, inherits: true, query_class_dict: true, _export: true,\n
searchTextToRegExp, RSVP */\n
\n
var checkKeySchema = function (key_schema) {\n
var prop;\n
\n
if (key_schema !== undefined) {\n
if (typeof key_schema !== \'object\') {\n
throw new TypeError("SimpleQuery().create(): " +\n
"key_schema is not of type \'object\'");\n
}\n
// key_set is mandatory\n
if (key_schema.key_set === undefined) {\n
throw new TypeError("SimpleQuery().create(): " +\n
"key_schema has no \'key_set\' property");\n
}\n
for (prop in key_schema) {\n
if (key_schema.hasOwnProperty(prop)) {\n
switch (prop) {\n
case \'key_set\':\n
case \'cast_lookup\':\n
case \'match_lookup\':\n
break;\n
default:\n
throw new TypeError("SimpleQuery().create(): " +\n
"key_schema has unknown property \'" + prop + "\'");\n
}\n
}\n
}\n
}\n
};\n
\n
\n
/**\n
* The SimpleQuery inherits from Query, and compares one metadata value\n
*\n
* @class SimpleQuery\n
* @extends Query\n
* @param {Object} [spec={}] The specifications\n
* @param {String} [spec.operator="="] The compare method to use\n
* @param {String} spec.key The metadata key\n
* @param {String} spec.value The value of the metadata to compare\n
*/\n
function SimpleQuery(spec, key_schema) {\n
Query.call(this);\n
\n
checkKeySchema(key_schema);\n
\n
this._key_schema = key_schema || {};\n
\n
/**\n
* Operator to use to compare object values\n
*\n
* @attribute operator\n
* @type String\n
* @optional\n
*/\n
this.operator = spec.operator;\n
\n
/**\n
* Key of the object which refers to the value to compare\n
*\n
* @attribute key\n
* @type String\n
*/\n
this.key = spec.key;\n
\n
/**\n
* Value is used to do the comparison with the object value\n
*\n
* @attribute value\n
* @type String\n
*/\n
this.value = spec.value;\n
\n
}\n
inherits(SimpleQuery, Query);\n
\n
\n
var checkKey = function (key) {\n
var prop;\n
\n
if (key.read_from === undefined) {\n
throw new TypeError("Custom key is missing the read_from property");\n
}\n
\n
for (prop in key) {\n
if (key.hasOwnProperty(prop)) {\n
switch (prop) {\n
case \'read_from\':\n
case \'cast_to\':\n
case \'equal_match\':\n
break;\n
default:\n
throw new TypeError("Custom key has unknown property \'" +\n
prop + "\'");\n
}\n
}\n
}\n
};\n
\n
\n
/**\n
* #crossLink "Query/match:method"\n
*/\n
SimpleQuery.prototype.match = function (item) {\n
var object_value = null,\n
equal_match = null,\n
cast_to = null,\n
matchMethod = null,\n
operator = this.operator,\n
value = null,\n
key = this.key;\n
\n
/*jslint regexp: true */\n
if (!(/^(?:!?=|<=?|>=?)$/i.test(operator))) {\n
// `operator` is not correct, we have to change it to "like" or "="\n
if (/%/.test(this.value)) {\n
// `value` contains a non escaped `%`\n
operator = "like";\n
} else {\n
// `value` does not contain non escaped `%`\n
operator = "=";\n
}\n
}\n
\n
matchMethod = this[operator];\n
\n
if (this._key_schema.key_set && this._key_schema.key_set[key] !== undefined) {\n
key = this._key_schema.key_set[key];\n
}\n
\n
if (typeof key === \'object\') {\n
checkKey(key);\n
object_value = item[key.read_from];\n
\n
equal_match = key.equal_match;\n
\n
// equal_match can be a string\n
if (typeof equal_match === \'string\') {\n
// XXX raise error if equal_match not in match_lookup\n
equal_match = this._key_schema.match_lookup[equal_match];\n
}\n
\n
// equal_match overrides the default \'=\' operator\n
if (equal_match !== undefined) {\n
matchMethod = (operator === "=" || operator === "like" ?\n
equal_match : matchMethod);\n
}\n
\n
value = this.value;\n
cast_to = key.cast_to;\n
if (cast_to) {\n
// cast_to can be a string\n
if (typeof cast_to === \'string\') {\n
// XXX raise error if cast_to not in cast_lookup\n
cast_to = this._key_schema.cast_lookup[cast_to];\n
}\n
\n
value = cast_to(value);\n
object_value = cast_to(object_value);\n
}\n
} else {\n
object_value = item[key];\n
value = this.value;\n
}\n
if (object_value === undefined || value === undefined) {\n
return RSVP.resolve(false);\n
}\n
return matchMethod(object_value, value);\n
};\n
\n
/**\n
* #crossLink "Query/toString:method"\n
*/\n
SimpleQuery.prototype.toString = function () {\n
return (this.key ? this.key + ":" : "") +\n
(this.operator ? " " + this.operator : "") + \' "\' + this.value + \'"\';\n
};\n
\n
/**\n
* #crossLink "Query/serialized:method"\n
*/\n
SimpleQuery.prototype.serialized = function () {\n
var object = {\n
"type": "simple",\n
"key": this.key,\n
"value": this.value\n
};\n
if (this.operator !== undefined) {\n
object.operator = this.operator;\n
}\n
return object;\n
};\n
SimpleQuery.prototype.toJSON = SimpleQuery.prototype.serialized;\n
\n
/**\n
* Comparison operator, test if this query value matches the item value\n
*\n
* @method =\n
* @param {String} object_value The value to compare\n
* @param {String} comparison_value The comparison value\n
* @return {Boolean} true if match, false otherwise\n
*/\n
SimpleQuery.prototype["="] = function (object_value, comparison_value) {\n
var value, i;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
for (i = 0; i < object_value.length; i += 1) {\n
value = object_value[i];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) === 0);\n
}\n
if (\n
searchTextToRegExp(comparison_value.toString(), false).\n
test(value.toString())\n
) {\n
return RSVP.resolve(true);\n
}\n
}\n
return RSVP.resolve(false);\n
};\n
\n
/**\n
* Comparison operator, test if this query value matches the item value\n
*\n
* @method like\n
* @param {String} object_value The value to compare\n
* @param {String} comparison_value The comparison value\n
* @return {Boolean} true if match, false otherwise\n
*/\n
SimpleQuery.prototype.like = function (object_value, comparison_value) {\n
var value, i;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
for (i = 0; i < object_value.length; i += 1) {\n
value = object_value[i];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) === 0);\n
}\n
if (\n
searchTextToRegExp(comparison_value.toString()).test(value.toString())\n
) {\n
return RSVP.resolve(true);\n
}\n
}\n
return RSVP.resolve(false);\n
};\n
\n
/**\n
* Comparison operator, test if this query value does not match the item value\n
*\n
* @method !=\n
* @param {String} object_value The value to compare\n
* @param {String} comparison_value The comparison value\n
* @return {Boolean} true if not match, false otherwise\n
*/\n
SimpleQuery.prototype["!="] = function (object_value, comparison_value) {\n
var value, i;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
for (i = 0; i < object_value.length; i += 1) {\n
value = object_value[i];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) !== 0);\n
}\n
if (\n
searchTextToRegExp(comparison_value.toString(), false).\n
test(value.toString())\n
) {\n
return RSVP.resolve(false);\n
}\n
}\n
return RSVP.resolve(true);\n
};\n
\n
/**\n
* Comparison operator, test if this query value is lower than the item value\n
*\n
* @method <\n
* @param {Number, String} object_value The value to compare\n
* @param {Number, String} comparison_value The comparison value\n
* @return {Boolean} true if lower, false otherwise\n
*/\n
SimpleQuery.prototype["<"] = function (object_value, comparison_value) {\n
var value;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
value = object_value[0];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) < 0);\n
}\n
return RSVP.resolve(value < comparison_value);\n
};\n
\n
/**\n
* Comparison operator, test if this query value is equal or lower than the\n
* item value\n
*\n
* @method <=\n
* @param {Number, String} object_value The value to compare\n
* @param {Number, String} comparison_value The comparison value\n
* @return {Boolean} true if equal or lower, false otherwise\n
*/\n
SimpleQuery.prototype["<="] = function (object_value, comparison_value) {\n
var value;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
value = object_value[0];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) <= 0);\n
}\n
return RSVP.resolve(value <= comparison_value);\n
};\n
\n
/**\n
* Comparison operator, test if this query value is greater than the item\n
* value\n
*\n
* @method >\n
* @param {Number, String} object_value The value to compare\n
* @param {Number, String} comparison_value The comparison value\n
* @return {Boolean} true if greater, false otherwise\n
*/\n
SimpleQuery.prototype[">"] = function (object_value, comparison_value) {\n
var value;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
value = object_value[0];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) > 0);\n
}\n
return RSVP.resolve(value > comparison_value);\n
};\n
\n
/**\n
* Comparison operator, test if this query value is equal or greater than the\n
* item value\n
*\n
* @method >=\n
* @param {Number, String} object_value The value to compare\n
* @param {Number, String} comparison_value The comparison value\n
* @return {Boolean} true if equal or greater, false otherwise\n
*/\n
SimpleQuery.prototype[">="] = function (object_value, comparison_value) {\n
var value;\n
if (!Array.isArray(object_value)) {\n
object_value = [object_value];\n
}\n
value = object_value[0];\n
if (typeof value === \'object\' && value.hasOwnProperty(\'content\')) {\n
value = value.content;\n
}\n
if (typeof value.cmp === "function") {\n
return RSVP.resolve(value.cmp(comparison_value) >= 0);\n
}\n
return RSVP.resolve(value >= comparison_value);\n
};\n
\n
query_class_dict.simple = SimpleQuery;\n
\n
_export("SimpleQuery", SimpleQuery);\n
\n
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */\n
/*global _export, RSVP */\n
\n
/**\n
* Escapes regexp special chars from a string.\n
*\n
* @param {String} string The string to escape\n
* @return {String} The escaped string\n
*/\n
function stringEscapeRegexpCharacters(string) {\n
if (typeof string === "string") {\n
return string.replace(/([\\\\\\.\\$\\[\\]\\(\\)\\{\\}\\^\\?\\*\\+\\-])/g, "\\\\$1");\n
}\n
throw new TypeError("complex_queries.stringEscapeRegexpCharacters(): " +\n
"Argument no 1 is not of type \'string\'");\n
}\n
\n
_export("stringEscapeRegexpCharacters", stringEscapeRegexpCharacters);\n
\n
/**\n
* Convert metadata values to array of strings. ex:\n
*\n
* "a" -> ["a"],\n
* {"content": "a"} -> ["a"]\n
*\n
* @param {Any} value The metadata value\n
* @return {Array} The value in string array format\n
*/\n
function metadataValueToStringArray(value) {\n
var i, new_value = [];\n
if (value === undefined) {\n
return undefined;\n
}\n
if (!Array.isArray(value)) {\n
value = [value];\n
}\n
for (i = 0; i < value.length; i += 1) {\n
if (typeof value[i] === \'object\') {\n
new_value[i] = value[i].content;\n
} else {\n
new_value[i] = value[i];\n
}\n
}\n
return new_value;\n
}\n
\n
/**\n
* A sort function to sort items by key\n
*\n
* @param {String} key The key to sort on\n
* @param {String} [way="ascending"] \'ascending\' or \'descending\'\n
* @return {Function} The sort function\n
*/\n
function sortFunction(key, way) {\n
if (way === \'descending\') {\n
return function (a, b) {\n
// this comparison is 5 times faster than json comparison\n
var i, l;\n
a = metadataValueToStringArray(a[key]) || [];\n
b = metadataValueToStringArray(b[key]) || [];\n
l = a.length > b.length ? a.length : b.length;\n
for (i = 0; i < l; i += 1) {\n
if (a[i] === undefined) {\n
return 1;\n
}\n
if (b[i] === undefined) {\n
return -1;\n
}\n
if (a[i] > b[i]) {\n
return -1;\n
}\n
if (a[i] < b[i]) {\n
return 1;\n
}\n
}\n
return 0;\n
};\n
}\n
if (way === \'ascending\') {\n
return function (a, b) {\n
// this comparison is 5 times faster than json comparison\n
var i, l;\n
a = metadataValueToStringArray(a[key]) || [];\n
b = metadataValueToStringArray(b[key]) || [];\n
l = a.length > b.length ? a.length : b.length;\n
for (i = 0; i < l; i += 1) {\n
if (a[i] === undefined) {\n
return -1;\n
}\n
if (b[i] === undefined) {\n
return 1;\n
}\n
if (a[i] > b[i]) {\n
return 1;\n
}\n
if (a[i] < b[i]) {\n
return -1;\n
}\n
}\n
return 0;\n
};\n
}\n
throw new TypeError("complex_queries.sortFunction(): " +\n
"Argument 2 must be \'ascending\' or \'descending\'");\n
}\n
\n
/**\n
* Clones all native object in deep. Managed types: Object, Array, String,\n
* Number, Boolean, null.\n
*\n
* @param {A} object The object to clone\n
* @return {A} The cloned object\n
*/\n
function deepClone(object) {\n
var i, cloned;\n
if (Array.isArray(object)) {\n
cloned = [];\n
for (i = 0; i < object.length; i += 1) {\n
cloned[i] = deepClone(object[i]);\n
}\n
return cloned;\n
}\n
if (typeof object === "object") {\n
cloned = {};\n
for (i in object) {\n
if (object.hasOwnProperty(i)) {\n
cloned[i] = deepClone(object[i]);\n
}\n
}\n
return cloned;\n
}\n
return object;\n
}\n
\n
/**\n
* Inherits the prototype methods from one constructor into another. The\n
* prototype of `constructor` will be set to a new object created from\n
* `superConstructor`.\n
*\n
* @param {Function} constructor The constructor which inherits the super one\n
* @param {Function} superConstructor The super constructor\n
*/\n
function inherits(constructor, superConstructor) {\n
constructor.super_ = superConstructor;\n
constructor.prototype = Object.create(superConstructor.prototype, {\n
"constructor": {\n
"configurable": true,\n
"enumerable": false,\n
"writable": true,\n
"value": constructor\n
}\n
});\n
}\n
\n
/**\n
* Does nothing\n
*/\n
function emptyFunction() {\n
return;\n
}\n
\n
/**\n
* Filter a list of items, modifying them to select only wanted keys. If\n
* `clone` is true, then the method will act on a cloned list.\n
*\n
* @param {Array} select_option Key list to keep\n
* @param {Array} list The item list to filter\n
* @param {Boolean} [clone=false] If true, modifies a clone of the list\n
* @return {Array} The filtered list\n
*/\n
function select(select_option, list, clone) {\n
var i, j, new_item;\n
if (!Array.isArray(select_option)) {\n
throw new TypeError("complex_queries.select(): " +\n
"Argument 1 is not of type Array");\n
}\n
if (!Array.isArray(list)) {\n
throw new TypeError("complex_queries.select(): " +\n
"Argument 2 is not of type Array");\n
}\n
if (clone === true) {\n
list = deepClone(list);\n
}\n
for (i = 0; i < list.length; i += 1) {\n
new_item = {};\n
for (j = 0; j < select_option.length; j += 1) {\n
if (list[i].hasOwnProperty([select_option[j]])) {\n
new_item[select_option[j]] = list[i][select_option[j]];\n
}\n
}\n
for (j in new_item) {\n
if (new_item.hasOwnProperty(j)) {\n
list[i] = new_item;\n
break;\n
}\n
}\n
}\n
return list;\n
}\n
\n
_export(\'select\', select);\n
\n
/**\n
* Sort a list of items, according to keys and directions. If `clone` is true,\n
* then the method will act on a cloned list.\n
*\n
* @param {Array} sort_on_option List of couples [key, direction]\n
* @param {Array} list The item list to sort\n
* @param {Boolean} [clone=false] If true, modifies a clone of the list\n
* @return {Array} The filtered list\n
*/\n
function sortOn(sort_on_option, list, clone) {\n
var sort_index;\n
if (!Array.isArray(sort_on_option)) {\n
throw new TypeError("complex_queries.sortOn(): " +\n
"Argument 1 is not of type \'array\'");\n
}\n
if (clone) {\n
list = deepClone(list);\n
}\n
for (sort_index = sort_on_option.length - 1; sort_index >= 0;\n
sort_index -= 1) {\n
list.sort(sortFunction(\n
sort_on_option[sort_index][0],\n
sort_on_option[sort_index][1]\n
));\n
}\n
return list;\n
}\n
\n
_export(\'sortOn\', sortOn);\n
\n
/**\n
* Limit a list of items, according to index and length. If `clone` is true,\n
* then the method will act on a cloned list.\n
*\n
* @param {Array} limit_option A couple [from, length]\n
* @param {Array} list The item list to limit\n
* @param {Boolean} [clone=false] If true, modifies a clone of the list\n
* @return {Array} The filtered list\n
*/\n
function limit(limit_option, list, clone) {\n
if (!Array.isArray(limit_option)) {\n
throw new TypeError("complex_queries.limit(): " +\n
"Argument 1 is not of type \'array\'");\n
}\n
if (!Array.isArray(list)) {\n
throw new TypeError("complex_queries.limit(): " +\n
"Argument 2 is not of type \'array\'");\n
}\n
if (clone) {\n
list = deepClone(list);\n
}\n
list.splice(0, limit_option[0]);\n
if (limit_option[1]) {\n
list.splice(limit_option[1]);\n
}\n
return list;\n
}\n
\n
_export(\'limit\', limit);\n
\n
/**\n
* Convert a search text to a regexp.\n
*\n
* @param {String} string The string to convert\n
* @param {Boolean} [use_wildcard_character=true] Use wildcard "%" and "_"\n
* @return {RegExp} The search text regexp\n
*/\n
function searchTextToRegExp(string, use_wildcard_characters) {\n
if (typeof string !== \'string\') {\n
throw new TypeError("complex_queries.searchTextToRegExp(): " +\n
"Argument 1 is not of type \'string\'");\n
}\n
if (use_wildcard_characters === false) {\n
return new RegExp("^" + stringEscapeRegexpCharacters(string) + "$");\n
}\n
return new RegExp("^" + stringEscapeRegexpCharacters(string).replace(\n
/%/g,\n
".*"\n
).replace(\n
/_/g,\n
"."\n
) + "$");\n
}\n
\n
_export("searchTextToRegExp", searchTextToRegExp);\n
\n
/**\n
* sequence(thens): Promise\n
*\n
* Executes a sequence of *then* callbacks. It acts like\n
* `smth().then(callback).then(callback)...`. The first callback is called with\n
* no parameter.\n
*\n
* Elements of `thens` array can be a function or an array contaning at most\n
* three *then* callbacks: *onFulfilled*, *onRejected*, *onNotified*.\n
*\n
* When `cancel()` is executed, each then promises are cancelled at the same\n
* time.\n
*\n
* @param {Array} thens An array of *then* callbacks\n
* @return {Promise} A new promise\n
*/\n
function sequence(thens) {\n
var promises = [];\n
return new RSVP.Promise(function (resolve, reject, notify) {\n
var i;\n
promises[0] = new RSVP.Promise(function (resolve) {\n
resolve();\n
});\n
for (i = 0; i < thens.length; i += 1) {\n
if (Array.isArray(thens[i])) {\n
promises[i + 1] = promises[i].\n
then(thens[i][0], thens[i][1], thens[i][2]);\n
} else {\n
promises[i + 1] = promises[i].then(thens[i]);\n
}\n
}\n
promises[i].then(resolve, reject, notify);\n
}, function () {\n
var i;\n
for (i = 0; i < promises.length; i += 1) {\n
promises[i].cancel();\n
}\n
});\n
}\n
\n
\n
return to_export;\n
}));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>jio_complex_queries.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</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="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_sha1.amd.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_jio_sha1_amd_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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 (exports) {\n
/*\n
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n
* in FIPS PUB 180-1\n
* Version 2.1a Copyright Paul Johnston 2000 - 2002.\n
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n
* Distributed under the BSD License\n
* See http://pajhome.org.uk/crypt/md5 for details.\n
*/\n
\n
/*\n
* Configurable variables. You may need to tweak these to be compatible with\n
* the server-side, but the defaults work in most cases.\n
*/\n
\n
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\n
var b64pad = "="; /* base-64 pad character. "=" for strict RFC compliance */\n
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */\n
\n
/*\n
* These are the functions you\'ll usually want to call\n
* They take string arguments and return either hex or base-64 encoded strings\n
*/\n
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}\n
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}\n
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}\n
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}\n
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}\n
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}\n
\n
/*\n
* Perform a simple self-test to see if the VM is working\n
*/\n
function sha1_vm_test()\n
{\n
return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";\n
}\n
\n
/*\n
* Calculate the SHA-1 of an array of big-endian words, and a bit length\n
*/\n
function core_sha1(x, len)\n
{\n
/* append padding */\n
x[len >> 5] |= 0x80 << (24 - len % 32);\n
x[((len + 64 >> 9) << 4) + 15] = len;\n
\n
var w = Array(80);\n
var a = 1732584193;\n
var b = -271733879;\n
var c = -1732584194;\n
var d = 271733878;\n
var e = -1009589776;\n
\n
for(var i = 0; i < x.length; i += 16)\n
{\n
var olda = a;\n
var oldb = b;\n
var oldc = c;\n
var oldd = d;\n
var olde = e;\n
\n
for(var j = 0; j < 80; j++)\n
{\n
if(j < 16) w[j] = x[i + j];\n
else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n
var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n
safe_add(safe_add(e, w[j]), sha1_kt(j)));\n
e = d;\n
d = c;\n
c = rol(b, 30);\n
b = a;\n
a = t;\n
}\n
\n
a = safe_add(a, olda);\n
b = safe_add(b, oldb);\n
c = safe_add(c, oldc);\n
d = safe_add(d, oldd);\n
e = safe_add(e, olde);\n
}\n
return Array(a, b, c, d, e);\n
\n
}\n
\n
/*\n
* Perform the appropriate triplet combination function for the current\n
* iteration\n
*/\n
function sha1_ft(t, b, c, d)\n
{\n
if(t < 20) return (b & c) | ((~b) & d);\n
if(t < 40) return b ^ c ^ d;\n
if(t < 60) return (b & c) | (b & d) | (c & d);\n
return b ^ c ^ d;\n
}\n
\n
/*\n
* Determine the appropriate additive constant for the current iteration\n
*/\n
function sha1_kt(t)\n
{\n
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n
(t < 60) ? -1894007588 : -899497514;\n
}\n
\n
/*\n
* Calculate the HMAC-SHA1 of a key and some data\n
*/\n
function core_hmac_sha1(key, data)\n
{\n
var bkey = str2binb(key);\n
if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n
\n
var ipad = Array(16), opad = Array(16);\n
for(var i = 0; i < 16; i++)\n
{\n
ipad[i] = bkey[i] ^ 0x36363636;\n
opad[i] = bkey[i] ^ 0x5C5C5C5C;\n
}\n
\n
var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n
return core_sha1(opad.concat(hash), 512 + 160);\n
}\n
\n
/*\n
* Add integers, wrapping at 2^32. This uses 16-bit operations internally\n
* to work around bugs in some JS interpreters.\n
*/\n
function safe_add(x, y)\n
{\n
var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n
return (msw << 16) | (lsw & 0xFFFF);\n
}\n
\n
/*\n
* Bitwise rotate a 32-bit number to the left.\n
*/\n
function rol(num, cnt)\n
{\n
return (num << cnt) | (num >>> (32 - cnt));\n
}\n
\n
/*\n
* Convert an 8-bit or 16-bit string to an array of big-endian words\n
* In 8-bit function, characters >255 have their hi-byte silently ignored.\n
*/\n
function str2binb(str)\n
{\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) << (32 - chrsz - i%32);\n
return bin;\n
}\n
\n
/*\n
* Convert an array of big-endian words to a string\n
*/\n
function binb2str(bin)\n
{\n
var str = "";\n
var mask = (1 << chrsz) - 1;\n
for(var i = 0; i < bin.length * 32; i += chrsz)\n
str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);\n
return str;\n
}\n
\n
/*\n
* Convert an array of big-endian words to a hex string.\n
*/\n
function binb2hex(binarray)\n
{\n
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";\n
var str = "";\n
for(var i = 0; i < binarray.length * 4; i++)\n
{\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
\n
/*\n
* Convert an array of big-endian words to a base-64 string\n
*/\n
function binb2b64(binarray)\n
{\n
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n
var str = "";\n
for(var i = 0; i < binarray.length * 4; i += 3)\n
{\n
var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)\n
| (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )\n
| ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);\n
for(var j = 0; j < 4; j++)\n
{\n
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;\n
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);\n
}\n
}\n
return str;\n
}\n
\n
exports.hex_sha1 = hex_sha1;\n
exports.b64_sha1 = b64_sha1;\n
exports.str_sha1 = str_sha1;\n
exports.hex_hmac_sha1 = hex_hmac_sha1;\n
exports.b64_hmac_sha1 = b64_hmac_sha1;\n
exports.str_hmac_sha1 = str_hmac_sha1;\n
}));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>jio_sha1.amd.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_sha256.amd.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_jio_sha256_amd_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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>title</string> </key>
<value> <string>jio_sha256.amd.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_sha2.amd.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_jio_sha2_amd_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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 Standard\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
var hexcase = 0;/* hex output format. 0 - lowercase; 1 - uppercase */\n
\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
\n
function S (X, n) {return ( X >>> n ) | (X << (32 - n));}\n
\n
function R (X, n) {return ( X >>> n );}\n
\n
function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));}\n
\n
function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));}\n
\n
function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));}\n
\n
function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));}\n
\n
function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));}\n
\n
function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));}\n
\n
function Sigma0512(x) {return (S(x, 28) ^ S(x, 34) ^ S(x, 39));}\n
\n
function Sigma1512(x) {return (S(x, 14) ^ S(x, 18) ^ S(x, 41));}\n
\n
function Gamma0512(x) {return (S(x, 1) ^ S(x, 8) ^ R(x, 7));}\n
\n
function Gamma1512(x) {return (S(x, 19) ^ S(x, 61) ^ R(x, 6));}\n
\n
function newArray (n) {\n
var a = [];\n
for (;n>0;n--) {\n
a.push(undefined);\n
}\n
return a;\n
}\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
\n
/* append padding */\n
m[l >> 5] |= 0x80 << (24 - l % 32);\n
m[((l + 64 >> 9) << 4) + 15] = l;\n
\n
for ( var i = 0; i<m.length; i+=16 ) {\n
a = HASH[0];\n
b = HASH[1];\n
c = HASH[2];\n
d = HASH[3];\n
e = HASH[4];\n
f = HASH[5];\n
g = HASH[6];\n
h = HASH[7];\n
\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
\n
T1 = safe_add(safe_add(safe_add(safe_add(\n
h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n
T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n
\n
h = g;\n
g = f;\n
f = e;\n
e = safe_add(d, T1);\n
d = c;\n
c = b;\n
b = a;\n
a = safe_add(T1, T2);\n
}\n
\n
HASH[0] = safe_add(a, HASH[0]);\n
HASH[1] = safe_add(b, HASH[1]);\n
HASH[2] = safe_add(c, HASH[2]);\n
HASH[3] = safe_add(d, HASH[3]);\n
HASH[4] = safe_add(e, HASH[4]);\n
HASH[5] = safe_add(f, HASH[5]);\n
HASH[6] = safe_add(g, HASH[6]);\n
HASH[7] = safe_add(h, HASH[7]);\n
}\n
return HASH;\n
}\n
\n
function core_sha512 (m, l) {\n
var K = [0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817];\n
var HASH = [0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179];\n
var W = newArray(80);\n
var a, b, c, d, e, f, g, h, i, j;\n
var T1, T2;\n
\n
}\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
\n
function binb2str (bin) {\n
var str = "";\n
var mask = (1 << chrsz) - 1;\n
for(var i = 0; i < bin.length * 32; i += chrsz)\n
str += String.fromCharCode((bin[i>>5] >>> (24 - i%32)) & mask);\n
return str;\n
}\n
\n
function binb2hex (binarray) {\n
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";\n
var str = "";\n
for(var i = 0; i < binarray.length * 4; i++)\n
{\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
\n
function binb2b64 (binarray) {\n
var tab =\n
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n
var str = "";\n
for(var i = 0; i < binarray.length * 4; i += 3) {\n
var triplet = (((binarray[i >> 2] >> 8 * (3- i %4)) & 0xFF) << 16) |\n
(((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) |\n
((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);\n
for(var j = 0; j < 4; j++) {\n
if(i * 8 + j * 6 > binarray.length * 32) { str += b64pad; }\n
else {str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);}\n
}\n
}\n
return str;\n
}\n
\n
function hex_sha256(s){\n
return binb2hex(core_sha256(str2binb(s),s.length * chrsz));\n
}\n
function b64_sha256(s){\n
return binb2b64(core_sha256(str2binb(s),s.length * chrsz));\n
}\n
function str_sha256(s){\n
return binb2str(core_sha256(str2binb(s),s.length * chrsz));\n
}\n
window.hex_sha256 = hex_sha256;\n
window.b64_sha256 = b64_sha256;\n
window.str_sha256 = str_sha256;\n
}());\n
}));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>jio_sha2.amd.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_storage_erp5.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_jio_storage_erp5_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*\n
* Copyright 2013, Nexedi SA\n
* Released under the LGPL license.\n
* http://www.gnu.org/licenses/lgpl.html\n
*/\n
// JIO ERP5 Storage Description :\n
// {\n
// type: "erp5"\n
// url: {string}\n
// default_view: {string} (optional)\n
// }\n
\n
/*jslint indent: 2, nomen: true, unparam: true */\n
/*global jIO, UriTemplate, FormData, RSVP, URI, DOMParser, Blob,\n
ProgressEvent, define */\n
\n
(function (root, dependencies, module) {\n
"use strict";\n
if (typeof define === \'function\' && define.amd) {\n
return define(dependencies, module);\n
}\n
var namespace = module(RSVP, jIO, URI, UriTemplate);\n
if (namespace !== undefined) { root.ERP5Storage = namespace; }\n
}(this, [\n
"rsvp",\n
"jio",\n
"uri",\n
"uritemplate"\n
], function (RSVP, jIO, URI, UriTemplate) {\n
"use strict";\n
\n
var hasOwnProperty = Function.prototype.call.bind(\n
Object.prototype.hasOwnProperty\n
), constant = {};\n
\n
constant.method_notification_message_obj = {\n
"get": "Getting document.",\n
"post": "Posting document.",\n
"put": "Putting document.",\n
"remove": "Removing document.",\n
"getAttachment": "Getting attachment.",\n
"putAttachment": "Putting attachment.",\n
"removeAttacment": "Removing attachment.",\n
"allDocs": "Getting document list."\n
};\n
\n
// XXX docstring\n
function formatGetSuccessAnswer(answer) {\n
if (answer === undefined || answer === null) { throw answer; }\n
var result;\n
if (typeof answer.data === "object" && answer.data) {\n
return answer;\n
}\n
if (answer.target &&\n
typeof answer.target.status === "number" &&\n
typeof answer.target.statusText === "string") {\n
result = {\n
"status": answer.target.status\n
};\n
if (typeof answer.target.response === "object" &&\n
answer.target.response !== null) {\n
if (typeof answer.target.response.toJSON === "function") {\n
result.data = answer.target.response.toJSON();\n
} else {\n
result.data = answer.target.response;\n
}\n
} else if (answer.target.response instanceof Blob) {\n
return jIO.util.readBlobAsText(answer.target.response).\n
then(function (text) {\n
result.data = JSON.parse(text);\n
return result;\n
});\n
}\n
return result;\n
}\n
return answer;\n
}\n
\n
// XXX docstring\n
function formatUpdateSuccessAnswer(answer) {\n
if (answer === undefined || answer === null) { throw answer; }\n
var result;\n
if (typeof answer.target === "object" && answer.target !== null &&\n
typeof answer.target.status === "number") {\n
result = {\n
"status": answer.target.status\n
};\n
return result;\n
}\n
return answer;\n
}\n
\n
// XXX docstring\n
function formatErrorAnswer(answer) {\n
if (answer === undefined || answer === null) { throw answer; }\n
var result, dom;\n
if (answer.target &&\n
typeof answer.target.status === "number" &&\n
typeof answer.target.statusText === "string") {\n
// seams to be a ProgressEvent\n
result = {\n
"status": answer.target.status\n
};\n
if (typeof answer.target.response === "object" &&\n
answer.target.response !== null) {\n
if (typeof answer.target.response.toJSON === "function") {\n
result.data = answer.target.response.toJSON();\n
} else {\n
result.data = answer.target.response;\n
}\n
} else if (typeof answer.target.responseText === "string") {\n
dom = new DOMParser().parseFromString(\n
answer.target.responseText,\n
"text/html"\n
);\n
result.message = (dom.querySelector(\'#master\') ||\n
dom.firstElementChild).textContent;\n
if (!result.message) { delete result.message; }\n
}\n
throw result;\n
}\n
throw answer;\n
}\n
\n
// XXX docstring\n
function formatNotification(method, notif) {\n
var result;\n
if (notif) {\n
if (typeof notif.loaded === "number" &&\n
typeof notif.total === "number") {\n
result = {};\n
// can be a ProgressEvent or a jIO notification\n
if (notif.method !== method) {\n
result = {\n
"method": method,\n
"loaded": notif.loaded,\n
"total": notif.total\n
};\n
if (typeof notif.percentage === "number") {\n
result.percentage = notif.percentage;\n
}\n
}\n
if (typeof notif.message === "string") {\n
result.message = notif.message;\n
} else {\n
result.message = constant.method_notification_message_obj[method];\n
}\n
return result;\n
}\n
}\n
throw null; // stop propagation\n
}\n
\n
constant.formatSuccessAnswerFor = {\n
"post": formatUpdateSuccessAnswer,\n
"put": formatUpdateSuccessAnswer,\n
"get": formatGetSuccessAnswer\n
};\n
\n
//////////////////////////////////////////////////////////////////////\n
\n
// XXX docstring\n
function ERP5Storage(spec) {\n
if (typeof spec.url !== "string" || !spec.url) {\n
throw new TypeError("ERP5 \'url\' must be a string " +\n
"which contains more than one character.");\n
}\n
this._url = spec.url;\n
this._default_view = spec.default_view;\n
}\n
\n
// XXX docstring\n
function methodGenerator(method) {\n
return function (command, param, options) {\n
RSVP.resolve().\n
then(function () {\n
var view = ERP5Storage.onView[options._view || this._default_view] ||\n
ERP5Storage.onView["default"];\n
if (typeof view[method] !== "function") {\n
view = ERP5Storage.onView["default"];\n
}\n
return view[method].call(this, param, options);\n
}.bind(this)).\n
then(constant.formatSuccessAnswerFor[method]).\n
then(null, formatErrorAnswer, formatNotification.bind(null, method)).\n
then(command.success, command.error, command.progress);\n
};\n
}\n
\n
// XXX docstring\n
[\n
"post",\n
"put",\n
"get",\n
"remove",\n
"putAttachment",\n
"getAttachment",\n
"removeAttachment",\n
"allDocs",\n
"check",\n
"repair"\n
].forEach(function (method) {\n
ERP5Storage.prototype[method] = methodGenerator(method);\n
});\n
// XXX docstring\n
function getSiteDocument(url) {\n
if (typeof url !== "string" &&\n
typeof (this && this._url) !== "string") {\n
throw new TypeError("ERP5Storage.getSiteDocument(): Argument 1 `url` " +\n
"or `this._url` are not of type string.");\n
}\n
return jIO.util.ajax({\n
"type": "GET",\n
"url": url || this._url,\n
"xhrFields": {\n
withCredentials: true\n
}\n
}).then(function (event) {\n
return JSON.parse(event.target.responseText);\n
});\n
}\n
ERP5Storage.getSiteDocument = getSiteDocument;\n
\n
// XXX docstring\n
function getDocumentAndHatoas(param, options) {\n
var this_ = this;\n
return ERP5Storage.getSiteDocument(this._url).\n
then(function (site_hal) {\n
// XXX need to get modified metadata\n
return jIO.util.ajax({\n
"type": "GET",\n
"url": UriTemplate.parse(site_hal._links.traverse.href)\n
.expand({\n
relative_url: param._id,\n
view: options._view || this_._default_view || "view"\n
}),\n
"xhrFields": {\n
withCredentials: true\n
}\n
});\n
});\n
}\n
\n
ERP5Storage.onView = {};\n
ERP5Storage.onView["default"] = {};\n
\n
// XXX docstring\n
ERP5Storage.onView["default"].get = function (param, options) {\n
return getDocumentAndHatoas.call(this, param, options).\n
then(function (response) {\n
var result = JSON.parse(response.target.responseText);\n
result._id = param._id;\n
result.portal_type = result._links.type.name;\n
// XXX\n
// delete result._embedded;\n
// delete result._links;\n
// delete result._debug;\n
// new jIO.Metadata(result).format();\n
return {"data": result};\n
});\n
};\n
\n
// XXX docstring\n
ERP5Storage.onView["default"].post = function (metadata, options) {\n
var final_response;\n
return getSiteDocument(this._url)\n
.then(function (site_hal) {\n
/*jslint forin: true */\n
var post_action = site_hal._actions.add,\n
data = new FormData();\n
\n
data.append("portal_type", metadata.portal_type);\n
\n
return jIO.util.ajax({\n
"type": post_action.method,\n
"url": post_action.href,\n
"data": data,\n
"xhrFields": {\n
withCredentials: true\n
}\n
});\n
}).then(function (event) {\n
final_response = {"status": event.target.status};\n
if (!metadata._id) {\n
// XXX Really depend on server response...\n
var uri = new URI(event.target.getResponseHeader("X-Location"));\n
final_response.id = uri.segment(2);\n
metadata._id = final_response.id;\n
}\n
}).\n
then(ERP5Storage.onView["default"].put.bind(this, metadata, options)).\n
then(function () { return final_response; });\n
};\n
\n
// XXX docstring\n
ERP5Storage.onView["default"].put = function (metadata, options) {\n
return getDocumentAndHatoas.call(this, metadata, options).\n
then(function (result) {\n
/*jslint forin: true */\n
result = JSON.parse(result.target.responseText);\n
var put_action = result._embedded._view._actions.put,\n
renderer_form = result._embedded._view,\n
data = new FormData(),\n
key;\n
data.append(renderer_form.form_id.key,\n
renderer_form.form_id[\'default\']);\n
for (key in metadata) {\n
// console.log(key);\n
if (hasOwnProperty(metadata, key)) {\n
if (key !== "_id") {\n
// Hardcoded my_ ERP5 behaviour\n
data.append(key, metadata[key]);\n
// if (hasOwnProperty(renderer_form, "my_" + key)) {\n
// console.log("ok");\n
// data.append(renderer_form["my_" + key].key, metadata[key]);\n
// }\n
}\n
}\n
}\n
return jIO.util.ajax({\n
"type": put_action.method,\n
"url": put_action.href,\n
"data": data,\n
"xhrFields": {\n
withCredentials: true\n
}\n
});\n
});\n
};\n
\n
ERP5Storage.onView["default"].remove = function () {\n
return;\n
};\n
\n
ERP5Storage.onView["default"].allDocs = function (param, options) {\n
if (typeof options.query !== "string") {\n
options.query = (options.query ?\n
jIO.Query.objectToSearchText(options.query) :\n
undefined);\n
}\n
return getSiteDocument(this._url)\n
.then(function (site_hal) {\n
return jIO.util.ajax({\n
"type": "GET",\n
"url": UriTemplate.parse(site_hal._links.raw_search.href)\n
.expand({\n
query: options.query,\n
// XXX Force erp5 to return embedded document\n
select_list: options.select_list || ["title", "reference"],\n
limit: options.limit\n
}),\n
"xhrFields": {\n
withCredentials: true\n
}\n
});\n
})\n
.then(function (response) {\n
return JSON.parse(response.target.responseText);\n
})\n
.then(function (catalog_json) {\n
var data = catalog_json._embedded.contents,\n
count = data.length,\n
i,\n
uri,\n
item,\n
result = [],\n
promise_list = [result];\n
for (i = 0; i < count; i += 1) {\n
item = data[i];\n
uri = new URI(item._links.self.href);\n
result.push({\n
id: uri.segment(2),\n
key: uri.segment(2),\n
doc: {},\n
value: item\n
});\n
// if (options.include_docs) {\n
// promise_list.push(RSVP.Queue().push(function () {\n
// return this._get({_id: item.name}, {_view: "View"});\n
// }).push\n
// }\n
}\n
return RSVP.all(promise_list);\n
})\n
.then(function (promise_list) {\n
var result = promise_list[0];\n
return {"data": {"rows": result, "total_rows": result.length}};\n
});\n
};\n
\n
ERP5Storage.onView["default"].check = function () {\n
return;\n
};\n
\n
ERP5Storage.onView["default"].repair = function () {\n
return;\n
};\n
\n
jIO.addStorage("erp5", ERP5Storage);\n
\n
return ERP5Storage;\n
\n
}));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>jio_storage_erp5.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</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.
This source diff could not be displayed because it is too large. You can view the blob instead.
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="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>renderjs.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_renderjs_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</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
;var DOMattachCSS = \'data:text/css;base64,QGtleWZyYW1lcyBub2RlSW5zZXJ0ZWQgeyAgCiAgICBmcm9tIHsgIAogICAgICAgIG91dGxpbmUtY29sb3I6ICNmZmY7IAogICAgfQogICAgdG8geyAgCiAgICAgICAgb3V0bGluZS1jb2xvcjogIzAwMDsKICAgIH0gCn0KCkAtbW96LWtleWZyYW1lcyBub2RlSW5zZXJ0ZWQgeyAgCiAgICBmcm9tIHsgIAogICAgICAgIG91dGxpbmUtY29sb3I6ICNmZmY7IAogICAgfQogICAgdG8geyAgCiAgICAgICAgb3V0bGluZS1jb2xvcjogIzAwMDsKICAgIH0gIAp9CgpALXdlYmtpdC1rZXlmcmFtZXMgbm9kZUluc2VydGVkIHsgIAogICAgZnJvbSB7ICAKICAgICAgICBvdXRsaW5lLWNvbG9yOiAjZmZmOyAKICAgIH0KICAgIHRvIHsgIAogICAgICAgIG91dGxpbmUtY29sb3I6ICMwMDA7CiAgICB9ICAKfQoKW2RhdGEtZ2FkZ2V0LXVybF0gewogICAgYW5pbWF0aW9uLWR1cmF0aW9uOiAwLjAxczsKICAgIC1tb3otYW5pbWF0aW9uLWR1cmF0aW9uOiAwLjAxczsKICAgIC13ZWJraXQtYW5pbWF0aW9uLWR1cmF0aW9uOiAwLjAxczsKICAgIGFuaW1hdGlvbi1uYW1lOiBub2RlSW5zZXJ0ZWQ7CiAgICAtbW96LWFuaW1hdGlvbi1uYW1lOiBub2RlSW5zZXJ0ZWQ7CiAgICAtd2Via2l0LWFuaW1hdGlvbi1uYW1lOiBub2RlSW5zZXJ0ZWQ7Cn0K\';;/*! RenderJs */\n
/*jslint nomen: true*/\n
\n
function promiseEventListener(target, type, useCapture) {\n
"use strict";\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
\n
function loopEventListener(target, type, useCapture, callback) {\n
"use strict";\n
//////////////////////////\n
// Infinite event listener (promise is never resolved)\n
// eventListener is removed when promise is cancelled/rejected\n
//////////////////////////\n
var handle_event_callback,\n
callback_promise;\n
\n
function cancelResolver() {\n
if ((callback_promise !== undefined) &&\n
(typeof callback_promise.cancel === "function")) {\n
callback_promise.cancel();\n
}\n
}\n
\n
function canceller() {\n
if (handle_event_callback !== undefined) {\n
target.removeEventListener(type, handle_event_callback, useCapture);\n
}\n
cancelResolver();\n
}\n
function itsANonResolvableTrap(resolve, reject) {\n
\n
handle_event_callback = function (evt) {\n
evt.stopPropagation();\n
evt.preventDefault();\n
cancelResolver();\n
callback_promise = new RSVP.Queue()\n
.push(function () {\n
return callback(evt);\n
})\n
.push(undefined, function (error) {\n
if (!(error instanceof RSVP.CancellationError)) {\n
canceller();\n
reject(error);\n
}\n
});\n
};\n
\n
target.addEventListener(type, handle_event_callback, useCapture);\n
}\n
return new RSVP.Promise(itsANonResolvableTrap, canceller);\n
}\n
\n
/*\n
* renderJs - Generic Gadget library renderer.\n
* http://www.renderjs.org/documentation\n
*/\n
(function (document, window, RSVP, DOMParser, Channel, DOMattachCSS,\n
undefined) {\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
waitForDomAttachment,\n
renderJS;\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
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget\n
/////////////////////////////////////////////////////////////////\n
function RenderJSGadget() {\n
if (!(this instanceof RenderJSGadget)) {\n
return new RenderJSGadget();\n
}\n
}\n
// RenderJSGadget.prototype.__monitor = RSVP.reject(new Error("No monitor"));\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 dError(error) {\n
// console.error(error);\n
// alert(error);\n
// }\n
\n
function letsCrash(e) {\n
console.error(e);\n
console.error(e.stack);\n
// XXX Do not crash the application if it fails\n
// Where to write the error?\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
// console.error(exception);\n
}\n
}\n
// console.warn(e);\n
document.getElementsByTagName(\'body\')[0].textContent = e;\n
}\n
\n
function createMonitor(g) {\n
if (g.__monitor !== undefined) {\n
g.__monitor.cancel();\n
}\n
g.__monitor = new RSVP.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
// + listen for DOM detach\n
function checkDetachEvent(evt) {\n
// gadget.__monitor.cancel("Et hop");\n
// if (evt.eventPhase === 2) {\n
// console.log("Removed from DOM");\n
// var previous_monitor = gadget.__monitor;\n
createMonitor(gadget);\n
// previous_monitor.cancel("Removed from DOM");\n
gadget.__monitor.monitor(waitForDomAttachment(gadget));\n
// gadget_instance.__monitor = new RSVP.Monitor();\n
// startService(gadget_instance);\n
// evt.stopPropagation();\n
// evt.preventDefault();\n
// return false;\n
// }\n
}\n
gadget.__monitor.monitor(\n
loopEventListener(\n
gadget.__element,\n
"DOMNodeRemovedFromDocument",\n
false,\n
checkDetachEvent\n
)\n
);\n
\n
})\n
);\n
\n
}\n
\n
waitForDomAttachment = function (gadget) {\n
function waitForAnimationEvent(event_name) {\n
gadget.__monitor.monitor(\n
new RSVP.Queue()\n
.push(function () {\n
return promiseEventListener(\n
gadget.__element,\n
event_name,\n
false\n
);\n
})\n
.push(function (evt) {\n
if (evt.eventPhase === 2) {\n
if (evt.animationName === \'nodeInserted\') {\n
// if (evt.target === gadget_instance.__element) {\n
createMonitor(gadget);\n
startService(gadget);\n
// evt.stopPropagation();\n
// evt.preventDefault();\n
return false;\n
}\n
}\n
})\n
\n
);\n
}\n
\n
gadget.__monitor.monitor(waitForAnimationEvent("animationstart"));\n
gadget.__monitor.monitor(waitForAnimationEvent("webkitAnimationStart"));\n
\n
// gadget.__monitor.monitor(new RSVP.Queue()\n
// .push(function () {\n
// // + listen for DOM attach\n
// })\n
// );\n
//\n
//\n
//\n
// gadget_instance.__element.addEventListener(\n
// // "DOMNodeRemovedFromDocument",\n
// "animationstart",\n
// function (evt) {\n
// // console.log("Inserted: " + gadget_instance);\n
// // console.log(evt);\n
// // console.log(gadget_instance.__element);\n
// if (evt.eventPhase === 2) {\n
// if (evt.animationName === \'nodeInserted\') {\n
// // if (evt.target === gadget_instance.__element) {\n
// createMonitor(gadget_instance);\n
// startService(gadget_instance);\n
// evt.stopPropagation();\n
// evt.preventDefault();\n
// return false;\n
// }\n
// }\n
// // console.log(evt);\n
// },\n
// false\n
// );\n
//\n
// gadget_instance.__element.addEventListener(\n
// // "DOMNodeRemovedFromDocument",\n
// "webkitAnimationStart",\n
// function (evt) {\n
// // console.log("Inserted: " + gadget_instance);\n
// // console.log(evt);\n
// // console.log(gadget_instance.__element);\n
// if (evt.eventPhase === 2) {\n
// if (evt.animationName === \'nodeInserted\') {\n
// // if (evt.target === gadget_instance.__element) {\n
// createMonitor(gadget_instance);\n
// startService(gadget_instance);\n
// evt.stopPropagation();\n
// evt.preventDefault();\n
// return false;\n
// }\n
// }\n
// // console.log(evt);\n
// },\n
// false\n
// );\n
\n
\n
\n
\n
\n
\n
};\n
/////////////////////////////////////////////////////////////////\n
// RenderJSGadget.declareMethod\n
/////////////////////////////////////////////////////////////////\n
// function checkIfMonitorFailed(gadget, result) {\n
// if (gadget.hasOwnProperty("__monitor")) {\n
// // Do not use queue, as\n
// return gadget.__monitor.then(function () {return ;});\n
//\n
// }\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
var result = callback.apply(context, argument_list);\n
// if (context.hasOwnProperty("__monitor")) {\n
// result = RSVP.any([\n
// result,\n
// // monitor is never supposed to succeed\n
// context.__monitor.then(function () {return; })\n
// ]);\n
// }\n
return result;\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
// console.log("Acquiring " + method_name);\n
// console.log(argument_list);\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
var result = gadget.__aq_parent(method_name_to_acquire,\n
argument_list);\n
// if (gadget.hasOwnProperty("__monitor")) {\n
// result = RSVP.any([\n
// result,\n
// // monitor is never supposed to succeed\n
// gadget.__monitor.then(function () {return; })\n
// ]);\n
// }\n
return result;\n
});\n
};\n
\n
// Allow chain\n
return this;\n
};\n
RenderJSGadget.declareAcquiredMethod("aq_pleasePublishMyState",\n
"pleasePublishMyState");\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
function pleasePublishMyState(param_list, child_gadget_scope) {\n
var new_param = {},\n
key;\n
for (key in this.state_parameter_dict) {\n
if (this.state_parameter_dict.hasOwnProperty(key)) {\n
new_param[key] = this.state_parameter_dict[key];\n
}\n
}\n
if (child_gadget_scope === undefined) {\n
throw new Error("gadget scope is mandatory");\n
}\n
new_param[child_gadget_scope] = param_list[0];\n
param_list = [new_param];\n
return this.aq_pleasePublishMyState.apply(this, param_list);\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
\n
if (document.contains(gadget_instance.__element)) {\n
// Put a timeout\n
queue.push(startService);\n
} else {\n
// Listen for DOM attachment\n
queue.push(waitForDomAttachment);\n
}\n
// Always return the gadget instance after ready function\n
queue.push(ready_wrapper);\n
\n
// console.log(document.contains(gadget_instance.__element));\n
\n
// gadget_instance.__element.addEventListener(\n
// // "DOMNodeRemovedFromDocument",\n
// "DOMNodeRemoved",\n
// function (evt) {\n
// // console.log("Dropped: " + gadget_instance);\n
// // if (evt.target === gadget_instance.__element) {\n
// if (evt.eventPhase === 2) {\n
// gadget_instance.__monitor.cancel("Removed from DOM");\n
// evt.stopPropagation();\n
// evt.preventDefault();\n
// return false;\n
// }\n
// },\n
// false\n
// );\n
\n
// gadget_instance.__element.unload = function () {\n
// alert("couscous");\n
// };\n
\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
tmp_constructor.allowPublicAcquisition("pleasePublishMyState",\n
pleasePublishMyState);\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 mergeSubDict(dict) {\n
var subkey,\n
subkey2,\n
subresult2,\n
value,\n
result = {};\n
for (subkey in dict) {\n
if (dict.hasOwnProperty(subkey)) {\n
value = dict[subkey];\n
if (value instanceof Object) {\n
subresult2 = mergeSubDict(value);\n
for (subkey2 in subresult2) {\n
if (subresult2.hasOwnProperty(subkey2)) {\n
// XXX key should not have an . inside\n
if (result.hasOwnProperty(subkey + "." + subkey2)) {\n
throw new Error("Key " + subkey + "." +\n
subkey2 + " already present");\n
}\n
result[subkey + "." + subkey2] = subresult2[subkey2];\n
}\n
}\n
} else {\n
if (result.hasOwnProperty(subkey)) {\n
throw new Error("Key " + subkey + " already present");\n
}\n
result[subkey] = value;\n
}\n
}\n
}\n
return result;\n
\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
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
if (window.self === window.top) {\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
pleaseRedirectMyHash: function (param_list) {\n
window.location.replace(param_list[0]);\n
},\n
pleasePublishMyState: function (param_list) {\n
var key,\n
first = true,\n
hash = "#";\n
param_list[0] = mergeSubDict(param_list[0]);\n
for (key in param_list[0]) {\n
if (param_list[0].hasOwnProperty(key)) {\n
if (!first) {\n
hash += "&";\n
}\n
hash += encodeURIComponent(key) + "=" +\n
encodeURIComponent(param_list[0][key]);\n
first = false;\n
}\n
}\n
return hash;\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
// 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
// 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]).then(function (g) {\n
trans.complete(g);\n
}).fail(function (e) {\n
trans.error(e.toString());\n
});\n
trans.delayReturn(true);\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
// Define __aq_parent to inform parent window\n
tmp_constructor.prototype.__aq_parent = function (method_name,\n
argument_list) {\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
});\n
});\n
};\n
}\n
\n
tmp_constructor.prototype.__acquired_method_dict = {};\n
tmp_constructor.allowPublicAcquisition("pleasePublishMyState",\n
pleasePublishMyState);\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
return renderJS.declareCSS(DOMattachCSS);\n
}).then(function () {\n
return root_gadget;\n
}).then(resolve, function (e) {\n
reject(e);\n
/*global console */\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
tmp_constructor.ready(function () {\n
var base = document.createElement(\'base\');\n
return root_gadget.__aq_parent(\'getTopURL\', [])\n
.then(function (topURL) {\n
base.href = topURL;\n
base.target = "_top";\n
document.head.appendChild(base);\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
// 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
embedded_channel.notify({method: "failed", params: e.toString()});\n
throw e;\n
});\n
} else {\n
// XXX Bootstrap run\n
loading_gadget_promise\n
.then(function () {\n
\n
function extractHashAndDispatch(evt) {\n
var hash = evt.newURL.split(\'#\')[1],\n
subhashes,\n
subhash,\n
keyvalue,\n
index,\n
options = {};\n
if (hash === undefined) {\n
hash = "";\n
} else {\n
hash = hash.split(\'?\')[0];\n
}\n
\n
function optionalize(key, value, dict) {\n
var key_list = key.split("."),\n
kk,\n
i;\n
for (i = 0; i < key_list.length; i += 1) {\n
kk = key_list[i];\n
if (i === key_list.length - 1) {\n
dict[kk] = value;\n
} else {\n
if (!dict.hasOwnProperty(kk)) {\n
dict[kk] = {};\n
}\n
dict = dict[kk];\n
}\n
}\n
}\n
\n
subhashes = hash.split(\'&\');\n
for (index in subhashes) {\n
if (subhashes.hasOwnProperty(index)) {\n
subhash = subhashes[index];\n
if (subhash !== \'\') {\n
keyvalue = subhash.split(\'=\');\n
if (keyvalue.length === 2) {\n
\n
optionalize(decodeURIComponent(keyvalue[0]),\n
decodeURIComponent(keyvalue[1]),\n
options);\n
\n
}\n
}\n
}\n
}\n
\n
if (root_gadget.render !== undefined) {\n
return root_gadget.render(options);\n
}\n
}\n
\n
// XXX Put it in a service\n
// XXX Manually trigger hashchange event!\n
return RSVP.all([\n
extractHashAndDispatch({newURL: window.location.toString()}),\n
loopEventListener(window, \'hashchange\', false,\n
extractHashAndDispatch)\n
]);\n
\n
}).fail(function (e) {\n
letsCrash(e);\n
});\n
\n
\n
}\n
loading_gadget_promise\n
.fail(function (e) {\n
console.error(e);\n
throw e;\n
});\n
\n
}\n
bootstrap();\n
\n
}(document, window, RSVP, DOMParser, Channel, DOMattachCSS));\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>uritemplate.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>http://git.erp5.org/gitweb/uritemplate-js.git/blob_plain/HEAD:/bin/uritemplate.js</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_uritemplate_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global unescape, module, define, window, global*/\n
\n
/*\n
UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.\n
Available via the MIT license.\n
*/\n
\n
(function (exportCallback) {\n
"use strict";\n
\n
var UriTemplateError = (function () {\n
\n
function UriTemplateError (options) {\n
this.options = options;\n
}\n
\n
UriTemplateError.prototype.toString = function () {\n
if (JSON && JSON.stringify) {\n
return JSON.stringify(this.options);\n
}\n
else {\n
return this.options;\n
}\n
};\n
\n
return UriTemplateError;\n
}());\n
\n
var objectHelper = (function () {\n
function isArray (value) {\n
return Object.prototype.toString.apply(value) === \'[object Array]\';\n
}\n
\n
function isString (value) {\n
return Object.prototype.toString.apply(value) === \'[object String]\';\n
}\n
\n
function isNumber (value) {\n
return Object.prototype.toString.apply(value) === \'[object Number]\';\n
}\n
\n
function isBoolean (value) {\n
return Object.prototype.toString.apply(value) === \'[object Boolean]\';\n
}\n
\n
function join (arr, separator) {\n
var\n
result = \'\',\n
first = true,\n
index;\n
for (index = 0; index < arr.length; index += 1) {\n
if (first) {\n
first = false;\n
}\n
else {\n
result += separator;\n
}\n
result += arr[index];\n
}\n
return result;\n
}\n
\n
function map (arr, mapper) {\n
var\n
result = [],\n
index = 0;\n
for (; index < arr.length; index += 1) {\n
result.push(mapper(arr[index]));\n
}\n
return result;\n
}\n
\n
function filter (arr, predicate) {\n
var\n
result = [],\n
index = 0;\n
for (; index < arr.length; index += 1) {\n
if (predicate(arr[index])) {\n
result.push(arr[index]);\n
}\n
}\n
return result;\n
}\n
\n
function deepFreezeUsingObjectFreeze (object) {\n
if (typeof object !== "object" || object === null) {\n
return object;\n
}\n
Object.freeze(object);\n
var property, propertyName;\n
for (propertyName in object) {\n
if (object.hasOwnProperty(propertyName)) {\n
property = object[propertyName];\n
// be aware, arrays are \'object\', too\n
if (typeof property === "object") {\n
deepFreeze(property);\n
}\n
}\n
}\n
return object;\n
}\n
\n
function deepFreeze (object) {\n
if (typeof Object.freeze === \'function\') {\n
return deepFreezeUsingObjectFreeze(object);\n
}\n
return object;\n
}\n
\n
\n
return {\n
isArray: isArray,\n
isString: isString,\n
isNumber: isNumber,\n
isBoolean: isBoolean,\n
join: join,\n
map: map,\n
filter: filter,\n
deepFreeze: deepFreeze\n
};\n
}());\n
\n
var charHelper = (function () {\n
\n
function isAlpha (chr) {\n
return (chr >= \'a\' && chr <= \'z\') || ((chr >= \'A\' && chr <= \'Z\'));\n
}\n
\n
function isDigit (chr) {\n
return chr >= \'0\' && chr <= \'9\';\n
}\n
\n
function isHexDigit (chr) {\n
return isDigit(chr) || (chr >= \'a\' && chr <= \'f\') || (chr >= \'A\' && chr <= \'F\');\n
}\n
\n
return {\n
isAlpha: isAlpha,\n
isDigit: isDigit,\n
isHexDigit: isHexDigit\n
};\n
}());\n
\n
var pctEncoder = (function () {\n
var utf8 = {\n
encode: function (chr) {\n
// see http://ecmanaut.blogspot.de/2006/07/encoding-decoding-utf8-in-javascript.html\n
return unescape(encodeURIComponent(chr));\n
},\n
numBytes: function (firstCharCode) {\n
if (firstCharCode <= 0x7F) {\n
return 1;\n
}\n
else if (0xC2 <= firstCharCode && firstCharCode <= 0xDF) {\n
return 2;\n
}\n
else if (0xE0 <= firstCharCode && firstCharCode <= 0xEF) {\n
return 3;\n
}\n
else if (0xF0 <= firstCharCode && firstCharCode <= 0xF4) {\n
return 4;\n
}\n
// no valid first octet\n
return 0;\n
},\n
isValidFollowingCharCode: function (charCode) {\n
return 0x80 <= charCode && charCode <= 0xBF;\n
}\n
};\n
\n
/**\n
* encodes a character, if needed or not.\n
* @param chr\n
* @return pct-encoded character\n
*/\n
function encodeCharacter (chr) {\n
var\n
result = \'\',\n
octets = utf8.encode(chr),\n
octet,\n
index;\n
for (index = 0; index < octets.length; index += 1) {\n
octet = octets.charCodeAt(index);\n
result += \'%\' + (octet < 0x10 ? \'0\' : \'\') + octet.toString(16).toUpperCase();\n
}\n
return result;\n
}\n
\n
/**\n
* Returns, whether the given text at start is in the form \'percent hex-digit hex-digit\', like \'%3F\'\n
* @param text\n
* @param start\n
* @return {boolean|*|*}\n
*/\n
function isPercentDigitDigit (text, start) {\n
return text.charAt(start) === \'%\' && charHelper.isHexDigit(text.charAt(start + 1)) && charHelper.isHexDigit(text.charAt(start + 2));\n
}\n
\n
/**\n
* Parses a hex number from start with length 2.\n
* @param text a string\n
* @param start the start index of the 2-digit hex number\n
* @return {Number}\n
*/\n
function parseHex2 (text, start) {\n
return parseInt(text.substr(start, 2), 16);\n
}\n
\n
/**\n
* Returns whether or not the given char sequence is a correctly pct-encoded sequence.\n
* @param chr\n
* @return {boolean}\n
*/\n
function isPctEncoded (chr) {\n
if (!isPercentDigitDigit(chr, 0)) {\n
return false;\n
}\n
var firstCharCode = parseHex2(chr, 1);\n
var numBytes = utf8.numBytes(firstCharCode);\n
if (numBytes === 0) {\n
return false;\n
}\n
for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {\n
if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {\n
return false;\n
}\n
}\n
return true;\n
}\n
\n
/**\n
* Reads as much as needed from the text, e.g. \'%20\' or \'%C3%B6\'. It does not decode!\n
* @param text\n
* @param startIndex\n
* @return the character or pct-string of the text at startIndex\n
*/\n
function pctCharAt(text, startIndex) {\n
var chr = text.charAt(startIndex);\n
if (!isPercentDigitDigit(text, startIndex)) {\n
return chr;\n
}\n
var utf8CharCode = parseHex2(text, startIndex + 1);\n
var numBytes = utf8.numBytes(utf8CharCode);\n
if (numBytes === 0) {\n
return chr;\n
}\n
for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {\n
if (!isPercentDigitDigit(text, startIndex + 3 * byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(text, startIndex + 3 * byteNumber + 1))) {\n
return chr;\n
}\n
}\n
return text.substr(startIndex, 3 * numBytes);\n
}\n
\n
return {\n
encodeCharacter: encodeCharacter,\n
isPctEncoded: isPctEncoded,\n
pctCharAt: pctCharAt\n
};\n
}());\n
\n
var rfcCharHelper = (function () {\n
\n
/**\n
* Returns if an character is an varchar character according 2.3 of rfc 6570\n
* @param chr\n
* @return (Boolean)\n
*/\n
function isVarchar (chr) {\n
return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === \'_\' || pctEncoder.isPctEncoded(chr);\n
}\n
\n
/**\n
* Returns if chr is an unreserved character according 1.5 of rfc 6570\n
* @param chr\n
* @return {Boolean}\n
*/\n
function isUnreserved (chr) {\n
return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === \'-\' || chr === \'.\' || chr === \'_\' || chr === \'~\';\n
}\n
\n
/**\n
* Returns if chr is an reserved character according 1.5 of rfc 6570\n
* or the percent character mentioned in 3.2.1.\n
* @param chr\n
* @return {Boolean}\n
*/\n
function isReserved (chr) {\n
return chr === \':\' || chr === \'/\' || chr === \'?\' || chr === \'#\' || chr === \'[\' || chr === \']\' || chr === \'@\' || chr === \'!\' || chr === \'$\' || chr === \'&\' || chr === \'(\' ||\n
chr === \')\' || chr === \'*\' || chr === \'+\' || chr === \',\' || chr === \';\' || chr === \'=\' || chr === "\'";\n
}\n
\n
return {\n
isVarchar: isVarchar,\n
isUnreserved: isUnreserved,\n
isReserved: isReserved\n
};\n
\n
}());\n
\n
/**\n
* encoding of rfc 6570\n
*/\n
var encodingHelper = (function () {\n
\n
function encode (text, passReserved) {\n
var\n
result = \'\',\n
index,\n
chr = \'\';\n
if (typeof text === "number" || typeof text === "boolean") {\n
text = text.toString();\n
}\n
for (index = 0; index < text.length; index += chr.length) {\n
chr = text.charAt(index);\n
result += rfcCharHelper.isUnreserved(chr) || (passReserved && rfcCharHelper.isReserved(chr)) ? chr : pctEncoder.encodeCharacter(chr);\n
}\n
return result;\n
}\n
\n
function encodePassReserved (text) {\n
return encode(text, true);\n
}\n
\n
function encodeLiteralCharacter (literal, index) {\n
var chr = pctEncoder.pctCharAt(literal, index);\n
if (chr.length > 1) {\n
return chr;\n
}\n
else {\n
return rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);\n
}\n
}\n
\n
function encodeLiteral (literal) {\n
var\n
result = \'\',\n
index,\n
chr = \'\';\n
for (index = 0; index < literal.length; index += chr.length) {\n
chr = pctEncoder.pctCharAt(literal, index);\n
if (chr.length > 1) {\n
result += chr;\n
}\n
else {\n
result += rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);\n
}\n
}\n
return result;\n
}\n
\n
return {\n
encode: encode,\n
encodePassReserved: encodePassReserved,\n
encodeLiteral: encodeLiteral,\n
encodeLiteralCharacter: encodeLiteralCharacter\n
};\n
\n
}());\n
\n
\n
// the operators defined by rfc 6570\n
var operators = (function () {\n
\n
var\n
bySymbol = {};\n
\n
function create (symbol) {\n
bySymbol[symbol] = {\n
symbol: symbol,\n
separator: (symbol === \'?\') ? \'&\' : (symbol === \'\' || symbol === \'+\' || symbol === \'#\') ? \',\' : symbol,\n
named: symbol === \';\' || symbol === \'&\' || symbol === \'?\',\n
ifEmpty: (symbol === \'&\' || symbol === \'?\') ? \'=\' : \'\',\n
first: (symbol === \'+\' ) ? \'\' : symbol,\n
encode: (symbol === \'+\' || symbol === \'#\') ? encodingHelper.encodePassReserved : encodingHelper.encode,\n
toString: function () {\n
return this.symbol;\n
}\n
};\n
}\n
\n
create(\'\');\n
create(\'+\');\n
create(\'#\');\n
create(\'.\');\n
create(\'/\');\n
create(\';\');\n
create(\'?\');\n
create(\'&\');\n
return {\n
valueOf: function (chr) {\n
if (bySymbol[chr]) {\n
return bySymbol[chr];\n
}\n
if ("=,!@|".indexOf(chr) >= 0) {\n
return null;\n
}\n
return bySymbol[\'\'];\n
}\n
};\n
}());\n
\n
\n
/**\n
* Detects, whether a given element is defined in the sense of rfc 6570\n
* Section 2.3 of the RFC makes clear defintions:\n
* * undefined and null are not defined.\n
* * the empty string is defined\n
* * an array ("list") is defined, if it is not empty (even if all elements are not defined)\n
* * an object ("map") is defined, if it contains at least one property with defined value\n
* @param object\n
* @return {Boolean}\n
*/\n
function isDefined (object) {\n
var\n
propertyName;\n
if (object === null || object === undefined) {\n
return false;\n
}\n
if (objectHelper.isArray(object)) {\n
// Section 2.3: A variable defined as a list value is considered undefined if the list contains zero members\n
return object.length > 0;\n
}\n
if (typeof object === "string" || typeof object === "number" || typeof object === "boolean") {\n
// falsy values like empty strings, false or 0 are "defined"\n
return true;\n
}\n
// else Object\n
for (propertyName in object) {\n
if (object.hasOwnProperty(propertyName) && isDefined(object[propertyName])) {\n
return true;\n
}\n
}\n
return false;\n
}\n
\n
var LiteralExpression = (function () {\n
function LiteralExpression (literal) {\n
this.literal = encodingHelper.encodeLiteral(literal);\n
}\n
\n
LiteralExpression.prototype.expand = function () {\n
return this.literal;\n
};\n
\n
LiteralExpression.prototype.toString = LiteralExpression.prototype.expand;\n
\n
return LiteralExpression;\n
}());\n
\n
var parse = (function () {\n
\n
function parseExpression (expressionText) {\n
var\n
operator,\n
varspecs = [],\n
varspec = null,\n
varnameStart = null,\n
maxLengthStart = null,\n
index,\n
chr = \'\';\n
\n
function closeVarname () {\n
var varname = expressionText.substring(varnameStart, index);\n
if (varname.length === 0) {\n
throw new UriTemplateError({expressionText: expressionText, message: "a varname must be specified", position: index});\n
}\n
varspec = {varname: varname, exploded: false, maxLength: null};\n
varnameStart = null;\n
}\n
\n
function closeMaxLength () {\n
if (maxLengthStart === index) {\n
throw new UriTemplateError({expressionText: expressionText, message: "after a \':\' you have to specify the length", position: index});\n
}\n
varspec.maxLength = parseInt(expressionText.substring(maxLengthStart, index), 10);\n
maxLengthStart = null;\n
}\n
\n
operator = (function (operatorText) {\n
var op = operators.valueOf(operatorText);\n
if (op === null) {\n
throw new UriTemplateError({expressionText: expressionText, message: "illegal use of reserved operator", position: index, operator: operatorText});\n
}\n
return op;\n
}(expressionText.charAt(0)));\n
index = operator.symbol.length;\n
\n
varnameStart = index;\n
\n
for (; index < expressionText.length; index += chr.length) {\n
chr = pctEncoder.pctCharAt(expressionText, index);\n
\n
if (varnameStart !== null) {\n
// the spec says: varname = varchar *( ["."] varchar )\n
// so a dot is allowed except for the first char\n
if (chr === \'.\') {\n
if (varnameStart === index) {\n
throw new UriTemplateError({expressionText: expressionText, message: "a varname MUST NOT start with a dot", position: index});\n
}\n
continue;\n
}\n
if (rfcCharHelper.isVarchar(chr)) {\n
continue;\n
}\n
closeVarname();\n
}\n
if (maxLengthStart !== null) {\n
if (index === maxLengthStart && chr === \'0\') {\n
throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must not start with digit 0", position: index});\n
}\n
if (charHelper.isDigit(chr)) {\n
if (index - maxLengthStart >= 4) {\n
throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must have max 4 digits", position: index});\n
}\n
continue;\n
}\n
closeMaxLength();\n
}\n
if (chr === \':\') {\n
if (varspec.maxLength !== null) {\n
throw new UriTemplateError({expressionText: expressionText, message: "only one :maxLength is allowed per varspec", position: index});\n
}\n
if (varspec.exploded) {\n
throw new UriTemplateError({expressionText: expressionText, message: "an exploeded varspec MUST NOT be varspeced", position: index});\n
}\n
maxLengthStart = index + 1;\n
continue;\n
}\n
if (chr === \'*\') {\n
if (varspec === null) {\n
throw new UriTemplateError({expressionText: expressionText, message: "exploded without varspec", position: index});\n
}\n
if (varspec.exploded) {\n
throw new UriTemplateError({expressionText: expressionText, message: "exploded twice", position: index});\n
}\n
if (varspec.maxLength) {\n
throw new UriTemplateError({expressionText: expressionText, message: "an explode (*) MUST NOT follow to a prefix", position: index});\n
}\n
varspec.exploded = true;\n
continue;\n
}\n
// the only legal character now is the comma\n
if (chr === \',\') {\n
varspecs.push(varspec);\n
varspec = null;\n
varnameStart = index + 1;\n
continue;\n
}\n
throw new UriTemplateError({expressionText: expressionText, message: "illegal character", character: chr, position: index});\n
} // for chr\n
if (varnameStart !== null) {\n
closeVarname();\n
}\n
if (maxLengthStart !== null) {\n
closeMaxLength();\n
}\n
varspecs.push(varspec);\n
return new VariableExpression(expressionText, operator, varspecs);\n
}\n
\n
function escape_regexp_string(string) {\n
// http://simonwillison.net/2006/Jan/20/escape/\n
return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, "\\\\$&");\n
}\n
\n
function parse (uriTemplateText) {\n
// assert filled string\n
var\n
index,\n
chr,\n
expressions = [],\n
expression,\n
braceOpenIndex = null,\n
regexp_string = \'\',\n
can_match = true,\n
literalStart = 0;\n
for (index = 0; index < uriTemplateText.length; index += 1) {\n
chr = uriTemplateText.charAt(index);\n
if (literalStart !== null) {\n
if (chr === \'}\') {\n
throw new UriTemplateError({templateText: uriTemplateText, message: "unopened brace closed", position: index});\n
}\n
if (chr === \'{\') {\n
if (literalStart < index) {\n
expression = new LiteralExpression(uriTemplateText.substring(literalStart, index));\n
expressions.push(expression);\n
regexp_string += escape_regexp_string(\n
expression.literal);\n
}\n
literalStart = null;\n
braceOpenIndex = index;\n
}\n
continue;\n
}\n
\n
if (braceOpenIndex !== null) {\n
// here just { is forbidden\n
if (chr === \'{\') {\n
throw new UriTemplateError({templateText: uriTemplateText, message: "brace already opened", position: index});\n
}\n
if (chr === \'}\') {\n
if (braceOpenIndex + 1 === index) {\n
throw new UriTemplateError({templateText: uriTemplateText, message: "empty braces", position: braceOpenIndex});\n
}\n
try {\n
expression = parseExpression(uriTemplateText.substring(braceOpenIndex + 1, index));\n
}\n
catch (error) {\n
if (error.prototype === UriTemplateError.prototype) {\n
throw new UriTemplateError({templateText: uriTemplateText, message: error.options.message, position: braceOpenIndex + error.options.position, details: error.options});\n
}\n
throw error;\n
}\n
expressions.push(expression);\n
if (expression.operator.symbol.length === 0) {\n
regexp_string += "([^/]+)";\n
} else {\n
can_match = false;\n
}\n
braceOpenIndex = null;\n
literalStart = index + 1;\n
}\n
continue;\n
}\n
throw new Error(\'reached unreachable code\');\n
}\n
if (braceOpenIndex !== null) {\n
throw new UriTemplateError({templateText: uriTemplateText, message: "unclosed brace", position: braceOpenIndex});\n
}\n
if (literalStart < uriTemplateText.length) {\n
expression = new LiteralExpression(uriTemplateText.substring(literalStart));\n
expressions.push(expression);\n
regexp_string += escape_regexp_string(expression.literal);\n
}\n
if (can_match === false) {\n
regexp_string = undefined;\n
}\n
return new UriTemplate(uriTemplateText, expressions, regexp_string);\n
}\n
\n
return parse;\n
}());\n
\n
var VariableExpression = (function () {\n
// helper function if JSON is not available\n
function prettyPrint (value) {\n
return (JSON && JSON.stringify) ? JSON.stringify(value) : value;\n
}\n
\n
function isEmpty (value) {\n
if (!isDefined(value)) {\n
return true;\n
}\n
if (objectHelper.isString(value)) {\n
return value === \'\';\n
}\n
if (objectHelper.isNumber(value) || objectHelper.isBoolean(value)) {\n
return false;\n
}\n
if (objectHelper.isArray(value)) {\n
return value.length === 0;\n
}\n
for (var propertyName in value) {\n
if (value.hasOwnProperty(propertyName)) {\n
return false;\n
}\n
}\n
return true;\n
}\n
\n
function propertyArray (object) {\n
var\n
result = [],\n
propertyName;\n
for (propertyName in object) {\n
if (object.hasOwnProperty(propertyName)) {\n
result.push({name: propertyName, value: object[propertyName]});\n
}\n
}\n
return result;\n
}\n
\n
function VariableExpression (templateText, operator, varspecs) {\n
this.templateText = templateText;\n
this.operator = operator;\n
this.varspecs = varspecs;\n
}\n
\n
VariableExpression.prototype.toString = function () {\n
return this.templateText;\n
};\n
\n
function expandSimpleValue(varspec, operator, value) {\n
var result = \'\';\n
value = value.toString();\n
if (operator.named) {\n
result += encodingHelper.encodeLiteral(varspec.varname);\n
if (value === \'\') {\n
result += operator.ifEmpty;\n
return result;\n
}\n
result += \'=\';\n
}\n
if (varspec.maxLength !== null) {\n
value = value.substr(0, varspec.maxLength);\n
}\n
result += operator.encode(value);\n
return result;\n
}\n
\n
function valueDefined (nameValue) {\n
return isDefined(nameValue.value);\n
}\n
\n
function expandNotExploded(varspec, operator, value) {\n
var\n
arr = [],\n
result = \'\';\n
if (operator.named) {\n
result += encodingHelper.encodeLiteral(varspec.varname);\n
if (isEmpty(value)) {\n
result += operator.ifEmpty;\n
return result;\n
}\n
result += \'=\';\n
}\n
if (objectHelper.isArray(value)) {\n
arr = value;\n
arr = objectHelper.filter(arr, isDefined);\n
arr = objectHelper.map(arr, operator.encode);\n
result += objectHelper.join(arr, \',\');\n
}\n
else {\n
arr = propertyArray(value);\n
arr = objectHelper.filter(arr, valueDefined);\n
arr = objectHelper.map(arr, function (nameValue) {\n
return operator.encode(nameValue.name) + \',\' + operator.encode(nameValue.value);\n
});\n
result += objectHelper.join(arr, \',\');\n
}\n
return result;\n
}\n
\n
function expandExplodedNamed (varspec, operator, value) {\n
var\n
isArray = objectHelper.isArray(value),\n
arr = [];\n
if (isArray) {\n
arr = value;\n
arr = objectHelper.filter(arr, isDefined);\n
arr = objectHelper.map(arr, function (listElement) {\n
var tmp = encodingHelper.encodeLiteral(varspec.varname);\n
if (isEmpty(listElement)) {\n
tmp += operator.ifEmpty;\n
}\n
else {\n
tmp += \'=\' + operator.encode(listElement);\n
}\n
return tmp;\n
});\n
}\n
else {\n
arr = propertyArray(value);\n
arr = objectHelper.filter(arr, valueDefined);\n
arr = objectHelper.map(arr, function (nameValue) {\n
var tmp = encodingHelper.encodeLiteral(nameValue.name);\n
if (isEmpty(nameValue.value)) {\n
tmp += operator.ifEmpty;\n
}\n
else {\n
tmp += \'=\' + operator.encode(nameValue.value);\n
}\n
return tmp;\n
});\n
}\n
return objectHelper.join(arr, operator.separator);\n
}\n
\n
function expandExplodedUnnamed (operator, value) {\n
var\n
arr = [],\n
result = \'\';\n
if (objectHelper.isArray(value)) {\n
arr = value;\n
arr = objectHelper.filter(arr, isDefined);\n
arr = objectHelper.map(arr, operator.encode);\n
result += objectHelper.join(arr, operator.separator);\n
}\n
else {\n
arr = propertyArray(value);\n
arr = objectHelper.filter(arr, function (nameValue) {\n
return isDefined(nameValue.value);\n
});\n
arr = objectHelper.map(arr, function (nameValue) {\n
return operator.encode(nameValue.name) + \'=\' + operator.encode(nameValue.value);\n
});\n
result += objectHelper.join(arr, operator.separator);\n
}\n
return result;\n
}\n
\n
\n
VariableExpression.prototype.expand = function (variables) {\n
var\n
expanded = [],\n
index,\n
varspec,\n
value,\n
valueIsArr,\n
oneExploded = false,\n
operator = this.operator;\n
\n
// expand each varspec and join with operator\'s separator\n
for (index = 0; index < this.varspecs.length; index += 1) {\n
varspec = this.varspecs[index];\n
value = variables[varspec.varname];\n
// if (!isDefined(value)) {\n
// if (variables.hasOwnProperty(varspec.name)) {\n
if (value === null || value === undefined) {\n
continue;\n
}\n
if (varspec.exploded) {\n
oneExploded = true;\n
}\n
valueIsArr = objectHelper.isArray(value);\n
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {\n
expanded.push(expandSimpleValue(varspec, operator, value));\n
}\n
else if (varspec.maxLength && isDefined(value)) {\n
// 2.4.1 of the spec says: "Prefix modifiers are not applicable to variables that have composite values."\n
throw new Error(\'Prefix modifiers are not applicable to variables that have composite values. You tried to expand \' + this + " with " + prettyPrint(value));\n
}\n
else if (!varspec.exploded) {\n
if (operator.named || !isEmpty(value)) {\n
expanded.push(expandNotExploded(varspec, operator, value));\n
}\n
}\n
else if (isDefined(value)) {\n
if (operator.named) {\n
expanded.push(expandExplodedNamed(varspec, operator, value));\n
}\n
else {\n
expanded.push(expandExplodedUnnamed(operator, value));\n
}\n
}\n
}\n
\n
if (expanded.length === 0) {\n
return "";\n
}\n
else {\n
return operator.first + objectHelper.join(expanded, operator.separator);\n
}\n
};\n
\n
return VariableExpression;\n
}());\n
\n
var UriTemplate = (function () {\n
function UriTemplate (templateText, expressions, regexp_string) {\n
this.templateText = templateText;\n
this.expressions = expressions;\n
\n
if (regexp_string !== undefined) {\n
this.regexp = new RegExp("^" + regexp_string + "$");\n
}\n
\n
objectHelper.deepFreeze(this);\n
}\n
\n
UriTemplate.prototype.toString = function () {\n
return this.templateText;\n
};\n
\n
UriTemplate.prototype.expand = function (variables) {\n
// this.expressions.map(function (expression) {return expression.expand(variables);}).join(\'\');\n
var\n
index,\n
result = \'\';\n
for (index = 0; index < this.expressions.length; index += 1) {\n
result += this.expressions[index].expand(variables);\n
}\n
return result;\n
};\n
\n
UriTemplate.prototype.extract = function (text) {\n
var expression_index,\n
extracted_index = 1,\n
expression,\n
varspec,\n
matched = true,\n
variables = {},\n
result;\n
\n
if ((this.regexp !== undefined) && (this.regexp.test(text))) {\n
result = this.regexp.exec(text);\n
for (expression_index = 0; expression_index < this.expressions.length; expression_index += 1) {\n
expression = this.expressions[expression_index];\n
if (expression.literal === undefined) {\n
if ((expression.operator !== undefined) && (expression.operator.symbol.length === 0) && (expression.varspecs.length === 1)) {\n
varspec = expression.varspecs[0];\n
if ((varspec.exploded === false) && (varspec.maxLength === null)) {\n
if (result[extracted_index].indexOf(\',\') === -1) {\n
variables[varspec.varname] = decodeURIComponent(result[extracted_index]);\n
extracted_index += 1;\n
} else {\n
matched = false;\n
}\n
} else {\n
matched = false;\n
}\n
} else {\n
matched = false;\n
}\n
}\n
}\n
if (matched) {\n
return variables;\n
}\n
}\n
return false;\n
};\n
\n
UriTemplate.parse = parse;\n
UriTemplate.UriTemplateError = UriTemplateError;\n
return UriTemplate;\n
}());\n
\n
exportCallback(UriTemplate);\n
\n
}(function (UriTemplate) {\n
"use strict";\n
// export UriTemplate, when module is present, or pass it to window or global\n
if (typeof module !== "undefined") {\n
module.exports = UriTemplate;\n
}\n
else if (typeof define === "function") {\n
define([],function() {\n
return UriTemplate;\n
});\n
}\n
else if (typeof window !== "undefined") {\n
window.UriTemplate = UriTemplate;\n
}\n
else {\n
global.UriTemplate = UriTemplate;\n
}\n
}\n
));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>uritemplate.js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>1.12.0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Site" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string>
<string>Member</string>
<string>Owner</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string>
<string>Member</string>
<string>Owner</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
<item>
<key> <string>__before_publishing_traverse__</string> </key>
<value>
<object>
<klass>
<global name="MultiHook" module="ZPublisher.BeforeTraverse"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_defined_in_class</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_hookname</string> </key>
<value> <string>__before_publishing_traverse__</string> </value>
</item>
<item>
<key> <string>_list</string> </key>
<value>
<list>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</list>
</value>
</item>
<item>
<key> <string>_prior</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>__before_traverse__</string> </key>
<value>
<dictionary>
<item>
<key>
<tuple>
<int>99</int>
<string>ERP5 Web Site/renderjs_runner</string>
</tuple>
</key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>available_language</string> </key>
<value>
<tuple>
<string>en</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>aggregate/web_page_module/rjs_gadget_erp5_html</string>
</tuple>
</value>
</item>
<item>
<key> <string>container_layout</string> </key>
<value> <string>WebSection_renderDefaultPageAsGadget</string> </value>
</item>
<item>
<key> <string>content_layout</string> </key>
<value> <string>WebSection_renderDefaultPageAsGadget</string> </value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_renderDefaultPageAsGadget</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_runner</string> </value>
</item>
<item>
<key> <string>layout_configuration_form_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Site</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>RJS</string> </value>
</item>
<item>
<key> <string>static_language_selection</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Runner</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
</pickle>
<pickle>
<dictionary/>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>category_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global id="6.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981226.91</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>embedded</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_action</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="6.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981321.92</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>embedded</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="6.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981321.93</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="7" aka="AAAAAAAAAAc=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global id="7.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981226.92</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7137.51255.34423</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981253.28</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7138.14513.38707</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981310.13</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7139.23973.56763</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404981387.54</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7140.30090.16486</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404982546.53</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7159.50830.8891</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404983218.09</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7170.63460.49510</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404983252.15</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7171.35124.28381</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1404983347.51</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.7173.8220.41540</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1405426668.65</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.14561.53150.17442</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1405932903.43</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.22999.3755.45004</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="7.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1405933462.45</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<allowed_content_type_list>
<portal_type id="Web Page Module">
<item>Web Manifest</item>
<item>Web Script</item>
<item>Web Style</item>
</portal_type>
</allowed_content_type_list>
\ No newline at end of file
<base_category_list>
<portal_type id="Web Manifest">
<item>follow_up</item>
<item>function</item>
<item>group</item>
<item>predecessor</item>
<item>publication_section</item>
<item>similar</item>
<item>site</item>
<item>successor</item>
</portal_type>
<portal_type id="Web Script">
<item>follow_up</item>
<item>function</item>
<item>group</item>
<item>predecessor</item>
<item>publication_section</item>
<item>similar</item>
<item>site</item>
<item>successor</item>
</portal_type>
<portal_type id="Web Style">
<item>follow_up</item>
<item>function</item>
<item>group</item>
<item>predecessor</item>
<item>publication_section</item>
<item>similar</item>
<item>site</item>
<item>successor</item>
</portal_type>
</base_category_list>
\ No newline at end of file
<property_sheet_list>
<portal_type id="Web Manifest">
<item>Reference</item>
<item>SortIndex</item>
</portal_type>
<portal_type id="Web Script">
<item>Reference</item>
<item>SortIndex</item>
</portal_type>
<portal_type id="Web Style">
<item>Reference</item>
<item>SortIndex</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
<type_roles>
<role id='Assignor; Assignee; Associate; Auditor; Author'>
<property id='title'>Default</property>
<property id='description'>Configured by ERP5 Configurator</property>
<multi_property id='category'>group/woelfel</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor; Assignee; Associate; Auditor; Author'>
<property id='title'>Default</property>
<property id='description'>Configured by ERP5 Configurator</property>
<multi_property id='category'>group/woelfel</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor; Assignee; Associate; Auditor; Author'>
<property id='title'>Default</property>
<property id='description'>Configured by ERP5 Configurator</property>
<multi_property id='category'>group/woelfel</multi_property>
</role>
</type_roles>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>web_page.png</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Text Document</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A Web Style is a CSS document</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addTextDocument</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>document</string>
<string>my_document</string>
<string>recent_document</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>searchable_text_method_id</string> </key>
<value>
<tuple>
<string>asRawText</string>
</tuple>
</value>
</item>
<item>
<key> <string>searchable_text_property_id</string> </key>
<value>
<tuple>
<string>title</string>
<string>description</string>
<string>reference</string>
<string>version</string>
<string>short_title</string>
<string>subject_list</string>
<string>filename</string>
<string>source_project_title</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>TextDocument</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>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>web_page.png</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Text Document</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A Web Script is an Javascript document</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addTextDocument</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>document</string>
<string>my_document</string>
<string>recent_document</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>searchable_text_method_id</string> </key>
<value>
<tuple>
<string>asRawText</string>
</tuple>
</value>
</item>
<item>
<key> <string>searchable_text_property_id</string> </key>
<value>
<tuple>
<string>title</string>
<string>description</string>
<string>reference</string>
<string>version</string>
<string>short_title</string>
<string>subject_list</string>
<string>filename</string>
<string>source_project_title</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>TextDocument</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>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>web_page.png</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Text Document</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A Web Style is a CSS document</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addTextDocument</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>document</string>
<string>my_document</string>
<string>recent_document</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>searchable_text_method_id</string> </key>
<value>
<tuple>
<string>asRawText</string>
</tuple>
</value>
</item>
<item>
<key> <string>searchable_text_property_id</string> </key>
<value>
<tuple>
<string>title</string>
<string>description</string>
<string>reference</string>
<string>version</string>
<string>short_title</string>
<string>subject_list</string>
<string>filename</string>
<string>source_project_title</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>TextDocument</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>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<workflow_chain>
<chain>
<type>Web Manifest</type>
<workflow>document_conversion_interaction_workflow, document_publication_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow</workflow>
</chain>
<chain>
<type>Web Script</type>
<workflow>document_conversion_interaction_workflow, document_publication_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow</workflow>
</chain>
<chain>
<type>Web Style</type>
<workflow>document_conversion_interaction_workflow, document_publication_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_web_renderjs_ui</skin_folder>
<skin_selection>RJS</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>99.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_web_renderjs_ui</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="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>from DateTime import DateTime\n
if REQUEST is None:\n
REQUEST = context.REQUEST\n
if response is None:\n
response = REQUEST.RESPONSE\n
\n
web_script = context\n
\n
modified_header = REQUEST.getHeader(\'If-Modified-Since\', \'\')\n
\n
if (modified_header != "") and (web_script.getModificationDate().rfc822() == DateTime(modified_header).rfc822()):\n
response.setStatus(304)\n
return ""\n
\n
js_content = web_script.getTextContent()\n
\n
response.setHeader(\'Content-Type\', \'text/cache-manifest\')\n
return js_content\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebManifest_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>if REQUEST is None:\n
REQUEST = context.REQUEST\n
if response is None:\n
response = REQUEST.RESPONSE\n
\n
web_script = context\n
\n
if REQUEST.getHeader(\'If-Modified-Since\', \'\') == web_script.getModificationDate().rfc822():\n
response.setStatus(304)\n
return ""\n
\n
js_content = web_script.getTextContent()\n
\n
# Do not allow to put inside an iframe\n
response.setHeader("X-Frame-Options", "SAMEORIGIN")\n
response.setHeader("X-Content-Type-Options", "nosniff")\n
\n
# Only fetch code (html, js, css, image) and data from this ERP5, to prevent any data leak as the web site do not control the gadget\'s code\n
response.setHeader("Content-Security-Policy", "default-src \'none\'; img-src \'self\' data:; media-src \'self\'; connect-src \'self\'; script-src \'self\' \'unsafe-eval\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' data:")\n
\n
\n
response.setHeader(\'Content-Type\', \'text/html\')\n
return js_content\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_viewAsGadget</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>from DateTime import DateTime\n
if REQUEST is None:\n
REQUEST = context.REQUEST\n
if response is None:\n
response = REQUEST.RESPONSE\n
\n
web_script = context\n
\n
modified_header = REQUEST.getHeader(\'If-Modified-Since\', \'\')\n
\n
if (modified_header != "") and (web_script.getModificationDate().rfc822() == DateTime(modified_header).rfc822()):\n
response.setStatus(304)\n
return ""\n
\n
js_content = web_script.getTextContent()\n
\n
response.setHeader(\'Content-Type\', \'application/javascript\')\n
return js_content\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebScript_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>if REQUEST is None:\n
REQUEST = context.REQUEST\n
if response is None:\n
response = REQUEST.RESPONSE\n
\n
web_section = context\n
default_web_page = web_section.getDefaultDocumentValue()\n
\n
return default_web_page.WebPage_viewAsGadget()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_renderDefaultPageAsGadget</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>if REQUEST is None:\n
REQUEST = context.REQUEST\n
if response is None:\n
response = REQUEST.RESPONSE\n
\n
web_script = context\n
\n
modified_header = REQUEST.getHeader(\'If-Modified-Since\', \'\')\n
\n
if (modified_header != "") and (web_script.getModificationDate().rfc822() == DateTime(modified_header).rfc822()):\n
response.setStatus(304)\n
return ""\n
\n
js_content = web_script.getTextContent()\n
\n
response.setHeader(\'Content-Type\', \'text/css\')\n
return js_content\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebStyle_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_hal_json_style
\ No newline at end of file
GPL
\ No newline at end of file
1
\ No newline at end of file
Web Manifest | version_view
Web Manifest | view
Web Manifest | view_editor
Web Manifest | web_view
Web Script | version_view
Web Script | view
Web Script | view_editor
Web Script | web_view
Web Style | version_view
Web Style | view
Web Style | view_editor
Web Style | web_view
\ No newline at end of file
web_site_module/renderjs_runner
web_page_module/rjs_*
\ No newline at end of file
web_page_module/rjs_*
web_site_module/renderjs_runner
web_site_module/renderjs_runner/**
\ No newline at end of file
Web Page Module | Web Manifest
Web Page Module | Web Script
Web Page Module | Web Style
\ No newline at end of file
Web Manifest | follow_up
Web Manifest | function
Web Manifest | group
Web Manifest | predecessor
Web Manifest | publication_section
Web Manifest | similar
Web Manifest | site
Web Manifest | successor
Web Script | follow_up
Web Script | function
Web Script | group
Web Script | predecessor
Web Script | publication_section
Web Script | similar
Web Script | site
Web Script | successor
Web Style | follow_up
Web Style | function
Web Style | group
Web Style | predecessor
Web Style | publication_section
Web Style | similar
Web Style | site
Web Style | successor
\ No newline at end of file
Web Manifest
Web Script
Web Style
\ No newline at end of file
Web Manifest | Reference
Web Manifest | SortIndex
Web Script | Reference
Web Script | SortIndex
Web Style | Reference
Web Style | SortIndex
\ No newline at end of file
Web Manifest
Web Script
Web Style
\ No newline at end of file
Web Manifest | document_conversion_interaction_workflow
Web Manifest | document_publication_workflow
Web Manifest | document_security_interaction_workflow
Web Manifest | edit_workflow
Web Manifest | processing_status_workflow
Web Script | document_conversion_interaction_workflow
Web Script | document_publication_workflow
Web Script | document_security_interaction_workflow
Web Script | edit_workflow
Web Script | processing_status_workflow
Web Style | document_conversion_interaction_workflow
Web Style | document_publication_workflow
Web Style | document_security_interaction_workflow
Web Style | edit_workflow
Web Style | processing_status_workflow
\ No newline at end of file
erp5_web_renderjs_ui | RJS
\ No newline at end of file
erp5_web_renderjs_ui
\ No newline at end of file
erp5_web_renderjs_ui
\ No newline at end of file
0.1
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment