Commit e07cc601 authored by Boxiang Sun's avatar Boxiang Sun

officejs_mixing the echarts

parent aea9102b
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Field parameters for response an event",
"properties": {
"value": {
"description": "Parameters which a event should contiains",
"properties": {
"chartType": {
"description": "Chart type, e.g 'line', 'bar', 'pie' , etc...",
"type": "string"
},
"itemType": {
"description": "Item type name, e.g 'series', 'markLine', 'markPoint', 'timeLine' ",
"type": "string"
},
"itemCategory": {
"description": "The category which this item belong. e.g. The item state marked as \"Opened\".",
"type": "string"
},
"itemGroup": {
"description": "The group which this item belong. e.g. The item grouped as \"Less than 2 days\".",
"type": "string"
},
"chartItemValue": {
"description": "The value of a certain chart item. Which may not a number, maybe a date, or what ever. So use string to represent.",
"type": "string"
},
"chartItemColor": {
"description": "The color of a certain chart item",
"type": "string"
}
},
"additionalProperties": false
}
},
"type": "object"
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" 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>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>
<string>Owner</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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>630d4ea27f4ecdef1f399f791eddc182</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_chart_event_interface_html_schema_json</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>File</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_chart_event_interface_html_schema.json</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Field parameters to specify an item in a certain chart gadget.",
"properties": {
"value": {
"description": "Parameters which a used to identify an item.",
"properties": {
"chartId": {
"description": "The id of a chart gadget.",
"type": "string"
},
"itemName": {
"description": "The chart item name.",
"type": "string"
}
},
"additionalProperties": false
}
},
"type": "object"
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" 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>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>
<string>Owner</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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>14078a530b5b9d2824ff5c3502b98d06</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_chart_instropection_interface_html_schema_json</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>File</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_chart_instropection_interface_html_schema.json</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<title>Graph Event Interface</title>
</head>
<body>
<h1>chart_event_interface(Draft)</h1>
<h3>List of chart events interface which can reponse the correspond events in a chart.</h3>
<p>
The purpose of this interface definition is to provide an unique API for various charting
libraries event processing. Then other gadget can provide these function to reponse chart's events.
</p>
<p>
Suppose a user use mouse to click one item in a chart. If another gadget want to reponse that event.
It need to provide the correspond function by <code>allowPublicAcquisition</code>. In this case,
the function is <code>chartItemClicked</code>. Chart gadget will pass parameters to this function.
Then the gadget can do some custom processing with the parameters in this function.
</p>
<dl>
<dt>chartItemClicked</dt>
<dd>Cilck an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
One item in a chart was clicked. Any gadget which defined this function
can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemDblClick</dt>
<dd>Double cilck an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
One item in a chart was double clicked. Any gadget which defined this
function can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemHover</dt>
<dd>Mouse pointer hovers on an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Mouse pointer hovers on one item in a chart. Any gadget which defined
this function can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemOut</dt>
<dd>Mouse pointer move out an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
Schema available here : <a href="gadget_chart_event_interface_html_schema.json">gadget_chart_event_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Mouse pointer move out an item in a chart. This is the counter part of
<code>chartItemHover</code>. Any gadget which defined this function
can do some custom processing to response that event.
Please see json schema for supported parameters.
</code></dd>
</dl>
</dl>
<dl>
<dt>chartItemSelected</dt>
<dd><strong>(Draft)</strong> One or more items were get selected in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">event_params</dt>
<dd>
There must have a mechanism to save the items which current get selected.
I need to find out how does this get implemented in different chart libaries.
</dd>
</dl>
</dl>
</body>
</html>
......@@ -24,6 +24,7 @@
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
......@@ -42,6 +43,8 @@
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
......@@ -60,6 +63,14 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -72,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_ojs_panel.html</string> </value>
<value> <string>gadget_chart_event_interface.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -82,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_erp5_panel_html</string> </value>
<value> <string>gadget_chart_event_interface_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -100,7 +111,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Officejs Panel</string> </value>
<value> <string>Graph Event Interface</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -160,7 +171,7 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish</string> </value>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -186,7 +197,7 @@
</tuple>
<state>
<tuple>
<float>1497254719.34</float>
<float>1503585449.72</float>
<string>UTC</string>
</tuple>
</state>
......@@ -195,7 +206,7 @@
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published</string> </value>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
......@@ -231,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.7872.48022.62771</string> </value>
<value> <string>961.42366.1811.55040</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1501601900.29</float>
<float>1503671059.0</float>
<string>UTC</string>
</tuple>
</state>
......@@ -306,7 +317,7 @@
</tuple>
<state>
<tuple>
<float>1497254393.91</float>
<float>1503585377.97</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<title>Graph Introspection Interface(Draft)</title>
</head>
<body>
<h1>chart_introspection_interface</h1>
<h3>List of chart introspection interfaces which can let gadget to introspect the inside of a chart.</h3>
<p>
The purpose of this interface definition is to provide an unique
API for various charting libraries to introspect the chart itself. Then other gadget can provide these functions to introspect the chart.
</p>
<p>
Suppose a gadget want to a value of a specific item in a chart. It can aquire the correspond function by <code>declareAcquiredMethod</code>.
In this case, it is <code>getChartItemValue</code>. Chart wrapper gadget need to provide this function by using <code>allowPublicAcquisition</code>.
</p>
<p>
For now, the chart item was identified by <code>name</code> field. This need to do more investivation, For example, I'm not sure that if all chart
libraries support to assign different names for all items in the combined-bar chart.
</p>
<dl>
<dt>getChartItemValue</dt>
<dd>Get the value of an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the value of one item in a chart which specified by item name.
For now, the chart was idendifed by gadget id.
The chart item was identified by <code>name</code> field. This need to do more investivation,
For example, I'm not sure that if all chart libraries support to assign different names for all items in the combined-bar chart.
</code></dd>
</dl>
</dl>
<dl>
<dt>getChartItemColor</dt>
<dd>Get the color of an item in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the color of one item in a chart which specified by item name.
Parameter: Same as above.
</code>
</dd>
</dl>
</dl>
<dl>
<dt>getChartItemCategory</dt>
<dd>Get the category of an item which belonged to in a chart.</dd>
<dl>
<dt data-parameter-required="required" data-parameter-type="object">item_name</dt>
<dd>
Schema available here : <a href="gadget_chart_introspection_interface_html_schema.json">gadget_chart_introspection_interface_html_schema.json</a><br>
<code style="display:block;white-space:pre-wrap">
Get the category of an item which belonged to in a chart which specified by item name.
Parameter: Same as above.
</code></dd>
</dl>
</dl>
</body>
</html>
......@@ -10,11 +10,8 @@
<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>Manager</string>
<string>Owner</string>
</tuple>
......@@ -24,8 +21,10 @@
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -42,7 +41,10 @@
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -50,16 +52,21 @@
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -72,7 +79,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_import.html</string> </value>
<value> <string>gadget_chart_introspect_interface.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -82,7 +89,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_erp5_page_import_html</string> </value>
<value> <string>gadget_chart_introspect_interface_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -100,7 +107,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Import</string> </value>
<value> <string>Graph Introspection Interface</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -160,7 +167,9 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -186,7 +195,7 @@
</tuple>
<state>
<tuple>
<float>1497363230.5</float>
<float>1503585455.08</float>
<string>UTC</string>
</tuple>
</state>
......@@ -195,7 +204,7 @@
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published</string> </value>
<value> <string>draft</string> </value>
</item>
</dictionary>
</list>
......@@ -231,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.1347.49644.187</string> </value>
<value> <string>961.42367.18257.9540</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1497364542.09</float>
<float>1503671051.64</float>
<string>UTC</string>
</tuple>
</state>
......@@ -306,7 +315,7 @@
</tuple>
<state>
<tuple>
<float>1497363213.76</float>
<float>1503585455.07</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -116,8 +116,8 @@ gadget_erp5_nojqm.css\n
ckeditor/adapters/jquery.js\n
ckeditor/build-config.js\n
ckeditor/ckeditor.js\n
ckeditor/contents.css\n
ckeditor/config.js\n
ckeditor/contents.css\n
ckeditor/lang/af.js\n
ckeditor/lang/ar.js\n
ckeditor/lang/bg.js\n
......@@ -568,7 +568,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.44217.46814.8652</string> </value>
<value> <string>958.28759.28788.38792</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -586,7 +586,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1501162811.43</float>
<float>1491383488.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,6 +15,6 @@
</head>
<body>
<div class="ckeditor_gadget" style="display:none;"><textarea></textarea></div>
<div class="ckeditor_gadget"><textarea></textarea></div>
</body>
</html>
\ No newline at end of file
......@@ -137,11 +137,17 @@
<value>
<dictionary>
<item>
<key> <string>edit_workflow</string> </key>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -149,6 +155,59 @@
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</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 name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442854416.99</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
......@@ -163,7 +222,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -177,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.65360.8858.42939</string> </value>
<value> <string>957.29599.9551.41830</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -195,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1497272689.07</float>
<float>1487770197.8</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,10 +4,15 @@
"use strict";
rJS(window)
.ready(function () {
var gadget = this,
textarea = gadget.element.querySelector('textarea');
gadget.state.ckeditor = CKEDITOR.replace(
.ready(function (g) {
g.props = {};
})
.ready(function (g) {
return g.getElement()
.push(function (element) {
var textarea = element.querySelector('textarea');
g.props.element = element;
g.props.ckeditor = CKEDITOR.replace(
textarea,
{
removeButtons: 'NewPage,Preview,Cut,Paste,Copy,PasteText,' +
......@@ -18,40 +23,33 @@
extraAllowedContent: "details section article"
}
);
gadget.state.ckeditor.addCommand('saveRJS', {
g.props.ckeditor.addCommand('saveRJS', {
readOnly: 1,
exec: function () {
return gadget.submitContent();
return g.submitContent();
}
});
gadget.state.ckeditor.ui.addButton('Save', {
g.props.ckeditor.ui.addButton('Save', {
label: "Save",
command: 'saveRJS',
toolbar: 'document,1'
});
gadget.state.ckeditor.on('instanceReady', function (event) {
g.props.ckeditor.on('instanceReady', function (event) {
event.editor.execCommand('maximize');
});
gadget.state.ckeditor.on('change', gadget.notifyChange);
});
})
.declareAcquiredMethod("submitContent", "triggerSubmit")
.declareAcquiredMethod("notifyChange", 'notifyChange')
.declareMethod('render', function (options) {
return this.changeState({
key: options.key || "text_content",
data: options.value || ""
});
this.props.key = options.key || "text_content";
this.props.ckeditor.setData(options.value || "");
return {};
})
.declareMethod('getContent', function () {
var result = {};
result[this.state.key] = this.state.ckeditor.getData();
result[this.props.key] = this.props.ckeditor.getData();
return result;
})
.onStateChange(function () {
var gadget = this;
return gadget.state.ckeditor.setData(gadget.state.data);
});
}(rJS, CKEDITOR));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.64612.15949.44475</string> </value>
<value> <string>956.64903.6566.48281</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1501073715.33</float>
<float>1486128239.58</float>
<string>UTC</string>
</tuple>
</state>
......
<html>
<!DOCTYPE html>
<!--html style="height: 100%"-->
<html style="height: 300px">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Controller</title>
<title>ERP5 Widget Graph</title>
<!-- interfaces -->
<link rel="http://www.renderjs.org/rel/interface" href="gadget_field_graph_interface.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- libraries needed for graphs -->
<script src="echarts-all.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_ojs_controller.js" type="text/javascript"></script>
<script src="unsafe/gadget_field_graph_echarts.js" type="text/javascript"></script>
</head>
<body>
<body style="height: 100%; margin: 0">
<div class="graph-content" style="height: 95%; width: 95%">
</div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, console, echarts */
/*jslint nomen: true, indent: 2 */
(function (window, rJS, RSVP, echarts) {
"use strict";
/////////////////////////////////////////////////////////////////
// templates
/////////////////////////////////////////////////////////////////
var gadget_klass = rJS(window),
getGraphDataAndParameterFromConfiguration = function (configuration_dict) {
var graph_data_and_parameter = {},
data,
trace,
trace_type,
type_list = [],
label_list = [],
trace_value_dict,
dataset_list = [],
dataset,
i,
j,
layout,
title,
type = 'bar',
x_label,
y_label;
if (configuration_dict.constructor === String) {
configuration_dict = JSON.parse(configuration_dict);
}
data = configuration_dict.data || [];
layout = configuration_dict.layout || {};
title = layout.title;
console.log("Configuration dict", configuration_dict);
console.log("Layout", layout);
console.log("Title", layout.title);
// title
// The position of the title in plotly was fixed, like the "x:center" in echarts.
// For now, every graph have to provide a title.
if (title === undefined) {
throw new Error("No title provided", data);
}
graph_data_and_parameter.title = {text: title, x: "center"};
// tooltip
// ECharts have to enable the tooltip manually.
graph_data_and_parameter.tooltip = {};
graph_data_and_parameter.tooltip.trigger = "item";
// legend
// Initialize the legend.
graph_data_and_parameter.legend = {};
graph_data_and_parameter.legend.y = 25;
graph_data_and_parameter.legend.data = [];
// Axis
// Initialize the axis
graph_data_and_parameter.xAxis = [];
graph_data_and_parameter.yAxis = [];
for (i = 0; i < data.length; i = i + 1) {
trace = data[i];
trace_type = trace.type || 'bar';
type_list.push(trace_type);
trace_value_dict = trace.value_dict || {};
if (trace_value_dict[0] === undefined || trace_value_dict[1] === undefined) {
throw new Error("Unexpected data for ECharts", data);
}
dataset = {};
dataset.type = trace_type;
dataset.name = trace.title || {};
// If the graph type is pie, set the pie radius
// plotly doesn't have this option.
if (trace_type === 'pie') {
dataset.radius = '55%';
}
// For pie graph, the legend labels come from each item's title(aka trace.title)
// For graph which contains the axis, the legend labels come from the item's value_dict[0].
// See the trace_value_dict in below. But the duplicated value_dict[0] seems for 2D graph
// seems is redandunt.
if (trace.type !== 'pie') {
graph_data_and_parameter.legend.data.push(dataset.name);
}
dataset.data = [];
for (j = 0; j < trace_value_dict[0].length; j = j + 1) {
if (label_list.length !== trace_value_dict[0].length) {
label_list[j] = trace_value_dict[0][j];
}
}
// Value
console.log("Trace value dict", trace_value_dict[1]);
for (j = 0; j < trace_value_dict[1].length; j = j + 1) {
dataset.data.push(
{
value: trace_value_dict[1][j],
name: label_list[j],
itemStyle: null
}
);
// Handle the colors in different ways. Maybe enhanced latter
if (trace.colors) {
// In the pie graph, set the color each individual "data" item.
if (trace.type === 'pie') {
console.log("Color", trace.colors);
dataset.data[j].itemStyle = {normal: {color: trace.colors[j]}};
} else {
// In other types of graph, set the color for each group.
dataset.itemStyle = {normal: {color: trace.colors[0]}};
}
}
}
dataset_list.push(dataset);
}
console.log("Label list", label_list);
// For the pie graph, the legend label is the value_dict[0]
if (trace.type === 'pie') {
graph_data_and_parameter.legend.data = label_list;
}
// Axis
console.log("Axis dict 1", layout.axis_dict[1]);
if (trace.type !== 'pie') {
// if not value type provided, set it as "value".
// if (layout.axis_dict[1].value_type === "number") {
graph_data_and_parameter.yAxis.push({type: 'value'});
// }
graph_data_and_parameter.xAxis.push({data: label_list});
} else {
graph_data_and_parameter.xAxis = null;
graph_data_and_parameter.yAxis = null;
}
console.log("Data list", dataset_list);
graph_data_and_parameter.series = dataset_list;
console.log("Converted API", graph_data_and_parameter);
return graph_data_and_parameter;
};
/////////////////////////////////////////////////////////////////
// some methods
/////////////////////////////////////////////////////////////////
gadget_klass
.declareAcquiredMethod("onEventGraphClick", "onEventGraphClick")
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
.ready(function (gadget) {
gadget.property_dict = {};
})
/////////////////////////////////////////////////////////////////
// published methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// acquired methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('render', function (option_dict) {
var gadget = this;
console.log("render called!");
console.log(option_dict);
//delegate rendering to onStateChange to avoid redrawing the graph
//every time render is called (a form might call render every time
//some other fields needs update)
gadget.changeState({value: option_dict.value});
})
.onStateChange(function (modification_dict) {
var gadget = this,
container,
graph_data_and_parameter,
chart;
console.log("Graph configuration dict", modification_dict.value);
container = gadget.element.querySelector(".graph-content");
chart = echarts.init(container);
graph_data_and_parameter = getGraphDataAndParameterFromConfiguration(modification_dict.value);
console.log("graph_data_and_parameter", graph_data_and_parameter);
chart.setOption(graph_data_and_parameter);
this.listenToClickEventOnTheChart(chart);
// XXX
window.onresize = function () {
chart.resize();
};
gadget.property_dict.chart = chart;
})
.declareJob('listenToClickEventOnTheChart', function (chart) {
var gadget = this,
defer = RSVP.defer();
// XXX https://lab.nexedi.com/nexedi/renderjs/blob/master/renderjs.js#L25
chart.on('click', function (params) {
console.log('Clicked in chart on listener: ' + params.name);
// return gadget.onEventGraphClick(gadget, [params.name, params.seriesName])
return gadget.onEventGraphClick([params.name, params.seriesName])
.push(undefined, defer.reject);
// return gadget.itemClick(params);
});
return defer.promise;
});
}(window, rJS, RSVP, echarts));
\ No newline at end of file
......@@ -118,100 +118,61 @@ font-awesome/font-awesome-webfont.woff\n
font-awesome/font-awesome-webfont.woff2\n
font-awesome/font-awesome-webfont.ttf\n
font-awesome/font-awesome-webfont.svg\n
gadget_erp5_nojqm.css\n
jio_mappingstorage.js\n
jio_fixstorage.js\n
gadget_erp5_global.js\n
URI.js\n
dygraph.js\n
handlebars.js\n
jiodev.js\n
renderjs.js\n
rsvp.js\n
erp5_launcher.js\n
gadget_erp5.css\n
gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_global.js\n
erp5_launcher_nojqm.js\n
gadget_officejs_router.js\n
gadget_erp5_router.html\n
gadget_erp5_router.js\n
gadget_officejs_liberator.html\n
gadget_officejs_liberator.js\n
gadget_jio.html\n
gadget_jio.js\n
gadget_translate.html\n
gadget_translate.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_translation_data.js\n
gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_ojs_jio.html\n
gadget_ojs_jio.js\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.js\n
gadget_erp5_page_ojs_dav_configurator.html\n
gadget_erp5_page_ojs_dav_configurator.js\n
gadget_erp5_page_ojs_erp5_configurator.html\n
gadget_erp5_page_ojs_erp5_configurator.js\n
gadget_erp5_page_ojs_dropbox_configurator.html\n
gadget_erp5_page_ojs_dropbox_configurator.js\n
gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.js\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.js\n
gadget_html5_input.html\n
gadget_html5_input.js\n
gadget_erp5_field_multicheckbox.html\n
gadget_erp5_field_multicheckbox.js\n
gadget_erp5_searchfield.html\n
gadget_erp5_searchfield.js\n
gadget_erp5_pt_form_list.html\n
gadget_erp5_pt_form_list.js\n
gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_datetime.html\n
gadget_erp5_field_datetime.js\n
gadget_html5_element.html\n
gadget_html5_element.js\n
gadget_erp5_notification.html\n
gadget_erp5_notification.js\n
gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n
gadget_erp5_field_editor.html\n
gadget_erp5_field_editor.js\n
gadget_erp5_field_gadget.html\n
gadget_erp5_field_gadget.js\n
gadget_erp5_search_editor.html\n
gadget_erp5_search_editor.js\n
gadget_erp5_sort_editor.html\n
gadget_erp5_sort_editor.js\n
gadget_erp5_field_password.html\n
gadget_erp5_field_password.js\n
\n
gadget_erp5_field_checkbox.html\n
gadget_erp5_field_checkbox.js\n
gadget_officejs_application_panel.js\n
gadget_officejs_bookmark_manager_panel.html\n
gadget_officejs_bookmark_manager_router.html\n
gadget_officejs_header.html\n
gadget_officejs_header.js\n
gadget_officejs_page_document_list.html\n
gadget_officejs_page_document_list.js\n
gadget_officejs_jio.html\n
gadget_officejs_jio.js\n
gadget_officejs_jio_bookmark_view.html\n
gadget_officejs_jio_bookmark_view.js\n
gadget_erp5_page_ojs_add_bookmark.html\n
gadget_erp5_page_ojs_add_bookmark.js\n
gadget_erp5_page_ojs_bookmark_list.html\n
gadget_erp5_page_ojs_bookmark_list.js\n
gadget_erp5_ojs_bookmark_panel.html\n
gadget_erp5_ojs_bookmark_panel.js\n
gadget_erp5_page_ojs_bookmark_dispatcher.html\n
gadget_erp5_page_ojs_bookmark_dispatcher.js\n
gadget_erp5_page_ojs_bookmark_preference.html\n
gadget_erp5_page_ojs_bookmark_preference.js\n
GADGET:\n
officejs_setting_gadget/\n
gadget_officejs_page_add_document.html\n
gadget_officejs_page_add_document.js\n
gadget_officejs_page_add_bookmark.html\n
gadget_officejs_page_add_bookmark.js\n
gadget_officejs_page_bookmark_dispatcher.html\n
gadget_officejs_page_bookmark_dispatcher.js\n
gadget_officejs_page_bookmark_list.html\n
gadget_officejs_page_bookmark_list.js\n
gadget_officejs_page_bookmark_preference.html\n
gadget_officejs_page_bookmark_preference.js\n
gadget_officejs_page_jio_configurator.html\n
gadget_officejs_page_jio_configurator.js\n
gadget_officejs_page_jio_dav_configurator.html\n
gadget_officejs_page_jio_dav_configurator.js\n
gadget_officejs_page_jio_erp5_configurator.js\n
gadget_officejs_page_jio_erp5_configurator.html\n
gadget_officejs_page_jio_dropbox_configurator.html\n
gadget_officejs_page_jio_dropbox_configurator.js\n
gadget_officejs_page_sync.html\n
gadget_officejs_page_sync.js\n
gadget_officejs_router.js\n
gadget_officejs_widget_listbox.html\n
gadget_officejs_widget_listbox.js\n
gadget_translation_data.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_officejs_liberator.html\n
gadget_officejs_liberator.js\n
handlebars.js\n
jiodev.js\n
jquery.js\n
jquerymobile.css\n
jquerymobile.js\n
renderjs.js\n
rsvp.js\n
NETWORK:\n
*</string> </value>
</item>
......@@ -354,7 +315,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.29120.20296.36078</string> </value>
<value> <string>960.25484.60987.38638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -372,7 +333,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1502953757.56</float>
<float>1499072426.32</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="">
<link rel="shortcut icon" href="favicon.ico">
<title>Bookmark Manager</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="jquerymobile.css">
<link rel="stylesheet" href="gadget_erp5.css">
<script data-renderjs-configuration="application_title" type="text/x-renderjs-configuration">Bookmark Manager</script>
<script data-renderjs-configuration="panel_gadget" type="text/x-renderjs-configuration">gadget_officejs_bookmark_manager_panel.html</script>
<script data-renderjs-configuration="action_view" type="text/x-renderjs-configuration">object_view</script>
<script data-renderjs-configuration="default_view_reference" type="text/x-renderjs-configuration">view</script>
<script data-renderjs-configuration="hateoas_url" type="text/x-renderjs-configuration">hateoas/</script>
<script src="jquery.js"></script>
<script src="jquerymobile.js"></script>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_global.js" ></script>
<script src="erp5_launcher.js"></script>
</head>
<body>
<div data-role="page">
<div data-gadget-url="gadget_jio.html"
data-gadget-scope="setting_gadget"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_officejs_bookmark_manager_router.html"
data-gadget-scope="router"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_translation.html"
data-gadget-scope="translation_gadget"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_officejs_header.html"
data-gadget-scope="header"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_officejs_jio.html"
data-gadget-scope="jio_gadget"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_erp5_editor_panel.html"
data-gadget-scope="editor_panel"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_officejs_bookmark_manager_panel.html"
data-gadget-scope="panel"
data-gadget-sandbox="public"></div>
<div role="main" class="ui-content gadget-content"></div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -3,67 +3,50 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Panel</title>
<!--
data-i18n=Editable
-->
<title>OfficeJS Text Editor Panel Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquerymobile.js" type="text/javascript"></script>
<script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<button data-i18n="Close" class="ui-btn ui-btn-icon-notext ui-icon-delete">Close</button>
<form action="#" method="post">
<input type="submit" data-i18n="[value]Close" data-icon="delete" data-iconpos="notext" value="Close" />
</form>
</div>
</div>
<img class="ui-title" alt="ERP5" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAAA/CAMAAADaDqrIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMEM5NUE4MzQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMEM5NUE4NDQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAwQzk1QTgxNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAwQzk1QTgyNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+J9MJsAAAAwBQTFRF///////M//+Z//9m//8z//8A/8z//8zM/8yZ/8xm/8wz/8wA/5n//5nM/5mZ/5lm/5kz/5kA/2b//2bM/2aZ/2Zm/2Yz/2YA/zP//zPM/zOZ/zNm/zMz/zMA/wD//wDM/wCZ/wBm/wAz/wAAzP//zP/MzP+ZzP9mzP8zzP8AzMz/zMzMzMyZzMxmzMwzzMwAzJn/zJnMzJmZzJlmzJkzzJkAzGb/zGbMzGaZzGZmzGYzzGYAzDP/zDPMzDOZzDNmzDMzzDMAzAD/zADMzACZzABmzAAzzAAAmf//mf/Mmf+Zmf9mmf8zmf8Amcz/mczMmcyZmcxmmcwzmcwAmZn/mZnMmZmZmZlmmZkzmZkAmWb/mWbMmWaZmWZmmWYzmWYAmTP/mTPMmTOZmTNmmTMzmTMAmQD/mQDMmQCZmQBmmQAzmQAAZv//Zv/MZv+ZZv9mZv8zZv8AZsz/ZszMZsyZZsxmZswzZswAZpn/ZpnMZpmZZplmZpkzZpkAZmb/ZmbMZmaZZmZmZmYzZmYAZjP/ZjPMZjOZZjNmZjMzZjMAZgD/ZgDMZgCZZgBmZgAzZgAAM///M//MM/+ZM/9mM/8zM/8AM8z/M8zMM8yZM8xmM8wzM8wAM5n/M5nMM5mZM5lmM5kzM5kAM2b/M2bMM2aZM2ZmM2YzM2YAMzP/MzPMMzOZMzNmMzMzMzMAMwD/MwDMMwCZMwBmMwAzMwAAAP//AP/MAP+ZAP9mAP8zAP8AAMz/AMzMAMyZAMxmAMwzAMwAAJn/AJnMAJmZAJlmAJkzAJkAAGb/AGbMAGaZAGZmAGYzAGYAADP/ADPMADOZADNmADMzADMAAAD/AADMAACZAABmAAAzAAAAHHa7K3/AOojESZHJWZvNaKTSd63Whrbblb/fpMjks9Howtrt4e320uTx8Pb6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdfKHSQAAAOh0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ALItoLoAAAJkSURBVHja7NlZsqsgEABQ979C5kGGddxo4os0Q8BAynoFn0nUU23TNGRB9xzLdE3XdE3XdP2fLnIzF2VSrsYvC72HizAh9eZ5DVuOl15S4/jWwC+kDC8HPzCSJVHcRY8QXV2PwQuujUYTsYrvYlBv1yKLrsXHsPghnvR3Lazoip/JKuwpF8sm6/bY01Ow9CBlTXi53PNoRcUktEZT1NV1PIPnXAjtMJIMlzerFIzU1dVWF7aPj3Tetae4gjdxktG2et/qQjJ4kZFrv6ED4bK4eR1qduHzvEi4+PbGwD0EGu9CQQLFrv1F4jBc6BcuW3YhkPiPX1hOfxQvnHfh0HVMRqc4HuqiQf5k3mO6dq1s8Hx0H/Le5kq9YaNcxAcrZLpOvAv+ClcgNcZFtnrucd5Fwx4mXj0drnbBYXMuJmFDAV3Uhm4qlbHh3ddOrmholHNxFTVC+xTl2mf6pI4uVe4LwSp0DPGOmh/hAnM94bKZjkHlWuiLeV+cTab4luMKk82wy/Px2fLJskvKUk03hRf9RZ0wiYiZ4uVwVwTb9E71y0XboTYXGuTaa33Y47W5zBjXM3P11y7TfR2ycFdxyaW7uwSc5m0un9ix91m3TWJfW+1ijfW+wcVAfjS5dOP62LyvZZdcLHnA1MkFAtbgwq+Vm47po8OA1buwyy/a1ec5urzveAes2sV8kfW963mFaHNhlT0b6+Yi5+StchH1CtaK0ThXELDPLiyOPZHldzm/J1z9O/B14g7/K+DtkP7U8ivSeD4xaPCTSQvy+YIfubZWzRgtRe1iMP+3mq7pmq7p6jv+BBgAPrgi/TzwWzkAAAAASUVORK5CYII="/>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<a href="#" class="ui-btn ui-btn-icon-notext ui-icon-home" data-i18n="Home">Home</a>
</div>
</div>
</div>
</script>
<script id="panel-template-body" type="text/x-handlebars-template">
<div class="ui-content">
<form class="dialog_form">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div>
</form>
<ul data-role="listview" class="ui-listview" data-enhanced="true"></ul>
<dl></dl>
<ul data-role="listview" class="ui-listview">
<li><a href="#page=bookmark_list" data-i18n="Bookmark List">Bookmark List</a></li>
<li><a href="#page=bookmark_dispatcher" data-i18n="Search">Search</a></li>
<li><a href="#page=bookmark_preference" data-i18n="Preferences">Preferences</a></li>
<li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li>
<li><a href="#page=sync&auto_repair=true" data-i18n="Synchronize">Synchronize</a></li>
<li><a href="https://www.cribjs.com/#page=jio_crib_configurator&application_name={{app_name}}&communication_gadget={{location}}gadget_officejs_liberator.html" data-i18n="Edit Me">Edit Me</a></li>
</ul>
</div>
</script>
<script id="panel-template-body-list" type="text/x-handlebars-template">
<li class="ui-first-child"><a href="{{document_list_href}}" class="ui-btn ui-btn-icon-left ui-icon-clipboard" data-i18n="Bookmarks" accesskey="s">Bookmarks</a></li>
<li><a href="{{bookmark_dispatcher_href}}" class="ui-btn ui-btn-icon-left ui-icon-search" data-i18n="Search">Search</a></li>
<li><a href="{{bookmark_preference_href}}" class="ui-btn ui-btn-icon-left ui-icon-gear" data-i18n="Preferences">Preferences</a></li>
<li><a href="{{sync_href}}" class="ui-btn ui-btn-icon-left ui-icon-refresh" data-i18n="Synchronize">Synchronize</a></li>
<li class="ui-last-child"><a href="{{storage_href}}" class="ui-btn ui-btn-icon-left ui-icon-gear" data-i18n="Storages">Storages</a></li>
</script>
<script id="panel-template-body-desktop" type="text/x-handlebars-template">
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-eye" data-i18n="Views">Views</dt>
{{#each view_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-cogs" data-i18n="Decisions">Decisions</dt>
{{#each workflow_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
</script>
<!-- custom script -->
<script src="gadget_erp5_ojs_bookmark_panel.js" type="text/javascript"></script>
<script src="gadget_officejs_application_panel.js" type="text/javascript"></script>
</head>
<body>
......
......@@ -91,7 +91,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_ojs_bookmark_panel.html</string> </value>
<value> <string>gadget_officejs_bookmark_manager_panel.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.9234.12589.52992</string> </value>
<value> <string>957.575.7829.27238</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1501746672.37</float>
<float>1486556932.46</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,8 +18,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">bookmark_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Bookmark</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">r47azfr1dgqwxdp</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
</body>
</html>
\ No newline at end of file
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.15329.8421.26146</string> </value>
<value> <string>959.26241.25958.12748</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1502049023.81</float>
<float>1495026940.62</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.onEvent('submit', function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (doc) {
doc.modification_date = (new Date()).toISOString();
return gadget.jio_post(doc);
})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change", "options": {"page": "ojs_bookmark_list"}});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting('portal_type'),
gadget.getSetting('parent_relative_url')
]);
})
.push(function (result) {
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_reference": {
"description": "The name of a document in ERP5",
"title": "Reference",
"default": "",
"css_class": "",
"required": 0,
"editable": 1,
"key": "reference",
"hidden": 0,
"type": "StringField"
},
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"default": "",
"css_class": "",
"required": 0,
"editable": 1,
"key": "title",
"hidden": 0,
"type": "StringField"
},
"my_url_string": {
"description": "",
"title": "Url",
"default": options.url_string || "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "url_string",
"hidden": 0,
"type": "StringField"
},
"my_description": {
"description": "",
"title": "Description",
"default": "",
"css_class": "",
"required": 0,
"editable": 1,
"key": "description",
"hidden": 0,
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"default": result[1],
"css_class": "",
"required": 1,
"editable": 1,
"key": "portal_type",
"hidden": 1,
"type": "StringField"
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"default": result[2],
"css_class": "",
"required": 1,
"editable": 1,
"key": "parent_relative_url",
"hidden": 1,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_reference"], ["my_title"], ["my_url_string"], ["my_description"],
["my_portal_type"], ["my_parent_relative_url"]]
]]
}
});
})
.push(function () {
return gadget.updateHeader({
page_title: "New Bookmark",
save_action: true
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Add Bookmark</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_erp5_page_ojs_add_bookmark.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
\ No newline at end of file
/*globals window, RSVP, rJS*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS) {
"use strict";
function redirectFromSearch(gadget, search) {
return new RSVP.Queue()
.push(function () {
var query = "",
command = "",
parameter = "",
index;
if (search) {
if (search.startsWith("!")) {
index = search.indexOf(" ");
if (index !== -1) {
command = search.substring(1, index);
parameter = search.substr(index + 1);
} else {
command = search.substr(1);
parameter = "";
}
if (command === "add") {
return gadget.redirect({
command: 'display',
options: {
page: "ojs_add_bookmark",
url_string: parameter
}
});
}
query = {
query: '(reference:"' + command + '")' +
' AND portal_type:"' + gadget.state.portal_type + '"',
select_list: ['url_string']
};
} else {
query = {
query: '(title:"%' + search +
'%" OR url_string:"%' + search +
'%" OR description:"%' + search +
'%") AND portal_type:"' + gadget.state.portal_type + '"',
select_list: ['title', 'url_string', 'description']
};
}
return gadget.jio_allDocs(query)
.push(function (query_result) {
var result_list_length = query_result.data.rows.length;
// if 0 result, let's search with a real search engine
if (result_list_length === 0 &&
gadget.state.search_engine !== '') {
return gadget.redirect({
command: 'raw',
options: {
url: gadget.state.search_engine +
window.encodeURIComponent(search)
}
});
}
if (result_list_length === 1 &&
(gadget.state.auto_redirect === true ||
command !== "")) {
// if 1 result, and redirect or command ,we go there
return gadget.redirect({
command: 'raw',
options: {
url: query_result.data.rows[0].value.url_string +
parameter
}
});
}
return gadget.redirect({
command: 'display',
options: {
page: "ojs_bookmark_list",
extended_search: search
}
});
});
}
});
}
rJS(window)
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod('getSetting', 'getSetting')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareMethod('triggerSubmit', function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.updateHeader({
page_title: 'Search in Bookmarks',
submit_action: true
});
})
.push(function () {
return RSVP.all([
gadget.getSetting('portal_type'),
gadget.getSetting('bookmark_auto_redirect', true),
gadget.getSetting(
'bookmark_search_engine',
"https://duckduckgo.com/?q="
)
]);
})
.push(function (result) {
return gadget.changeState({
search: options.search || "",
portal_type: result[0],
auto_redirect: result[1],
search_engine: result[2],
extended_search: options.extended_search || ""
});
});
})
.onStateChange(function (modification_dict) {
var gadget = this;
if (modification_dict.search) {
return redirectFromSearch(gadget, gadget.state.search);
}
if (modification_dict.extended_search) {
return redirectFromSearch(gadget, modification_dict.extended_search);
}
return gadget.getDeclaredGadget('erp5_searchfield')
.push(function (search_gadget) {
return search_gadget.render({
extended_search: gadget.state.search
});
});
})
.onEvent("submit", function () {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('erp5_searchfield');
})
.push(function (search_gadget) {
return search_gadget.getContent();
})
.push(function (content) {
return redirectFromSearch(gadget, content.search);
});
});
}(window, RSVP, rJS));
\ No newline at end of file
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getSetting", "getSetting")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.getSetting("portal_type")
]);
})
.push(function (result) {
var column_list = [
['reference', 'Reference'],
['title', 'Title'],
['url_string', 'Url'],
['description', 'Description']
];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 1,
"editable_column_list": [],
"key": "field_listbox",
"lines": 30,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%22" +
result[1] + "%22",
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [['modification_date', 'descending']],
"title": "Documents",
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "ojs_add_bookmark"}}),
gadget.getSetting('document_title_plural')
]);
})
.push(function (result) {
return gadget.updateHeader({
page_title: result[1],
filter_action: true,
add_url: result[0]
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Bookmark Manager Preferences</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojs_bookmark_preference.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
/*globals window, RSVP, rJS, URL*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS, URL) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('triggerSubmit', function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function () {
var gadget = this;
return gadget.updateHeader({
page_title: 'Bookmark Manager Preferences',
save_action: true
})
.push(function () {
return RSVP.all([
gadget.getSetting('bookmark_auto_redirect', true),
gadget.getSetting(
'bookmark_search_engine',
"https://duckduckgo.com/?q="
)
]);
})
.push(function (setting_list) {
return gadget.changeState({
auto_redirect: setting_list[0],
search_engine: setting_list[1],
share_url: (new URL(
"#/?page=ojs_bookmark_dispatcher&search=%s", window.location
)).href
});
});
})
.onStateChange(function () {
var gadget = this;
return gadget.getDeclaredGadget("form_view")
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_share_url": {
"description": "To use the bookmark manager as a search " +
"engine, add this url to the search engine" +
"list of your browser",
"title": "Share Url",
"default": gadget.state.share_url,
"css_class": "",
"required": 0,
"editable": 1,
"key": "share_url",
"hidden": 0,
"type": "StringField"
},
"my_auto_redirect": {
"description": "Automatic redirection on single result",
"title": "Auto Redirection",
"default": gadget.state.auto_redirect,
"css_class": "",
"required": 1,
"editable": 1,
"key": "auto_redirect",
"hidden": 0,
"type": "CheckBoxField"
},
"my_search_engine": {
"description": "",
"title": "Search Engine",
"default": gadget.state.search_engine,
"css_class": "",
"required": 0,
"editable": 1,
"key": "search_engine",
"hidden": 0,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"top",
[["my_share_url"], ["my_auto_redirect"], ["my_search_engine"]]
]]
}
});
});
})
.onEvent("submit", function () {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget("form_view");
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
return RSVP.all([
gadget.setSetting('bookmark_auto_redirect', content.auto_redirect),
gadget.setSetting('bookmark_search_engine', content.search_engine)
]);
})
.push(function () {
return gadget.notifySubmitted('Preferences Saved');
});
});
}(window, RSVP, rJS, URL));
\ No newline at end of file
/*global window, rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.querySelector(".view-web-page-template")
.innerHTML,
template = Handlebars.compile(source);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("translateHtml", "translateHtml")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc
});
})
.onEvent('submit', function () {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
var doc;
if (!gadget.state.editable) {
doc = content;
content.portal_type = gadget.state.doc.portal_type;
content.parent_relative_url = gadget.state.doc.parent_relative_url;
content.text_content = gadget.state.doc.text_content;
} else {
doc = gadget.state.doc;
doc.text_content = content.text_content;
}
doc.modification_date = (new Date()).toISOString();
return gadget.jio_put(gadget.state.jio_key, doc);
})
.push(function () {
return RSVP.all([
gadget.notifySubmitted('Data Updated')
]);
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.onStateChange(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.translateHtml(template({url_string: gadget.state.doc.url_string}));
})
.push(function (html) {
gadget.element.querySelector('.template-view').innerHTML = html;
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_reference": {
"description": "",
"title": "Reference",
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1,
"key": "reference",
"hidden": 0,
"type": "StringField"
},
"my_title": {
"description": "",
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1,
"key": "title",
"hidden": 0,
"type": "StringField"
},
"my_url_string": {
"description": "",
"title": "Url",
"default": gadget.state.doc.url_string,
"css_class": "",
"required": 0,
"editable": 1,
"key": "url_string",
"hidden": 0,
"type": "StringField"
},
"my_description": {
"description": "",
"title": "Description",
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1,
"key": "description",
"hidden": 0,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_reference"], ["my_title"], ["my_url_string"], ["my_description"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
});
});
});
}(window, rJS, RSVP, Handlebars));
<!DOCTYPE html>
<html>
<html manifest="gadget_officejs_bootloader.appcache">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
......@@ -21,5 +21,7 @@
<script data-install-configuration="redirect_url" type="text/x-renderjs-configuration">${redirect_url}/</script>
<script data-install-configuration="cache_file" type="text/x-renderjs-configuration">${cache_file}</script>
<script data-install-configuration="app_name" type="text/x-renderjs-configuration">${application_name}</script>
<script data-install-configuration="landing_page" type="text/x-renderjs-configuration">${landing_page}</script>
<script data-install-configuration="sub_app_installer" type="text/x-renderjs-configuration">${sub_gadget_installer}</script>
</body>
</html>
\ No newline at end of file
......@@ -241,7 +241,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.282.28573.14114</string> </value>
<value> <string>959.27737.62903.2116</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -259,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>1501754635.21</float>
<float>1496242886.73</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
<global name="Web Manifest" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -74,17 +74,9 @@
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>cedric.le.ninivin</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_ojs_document_list.js</string> </value>
<value> <string>gadget_officejs_bootloader.appcache</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -94,36 +86,15 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_erp5_page_document_list_js</string> </value>
<value> <string>gadget_officejs_bootloader_appcache</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1455284352.18</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
<value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
......@@ -131,9 +102,30 @@
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Wed, 26 Apr 2017 11:45:33 +0000\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
/\n
development/jiodev.js\n
development/rsvp.js\n
development/renderjs.js\n
gadget_erp5_nojqm.css\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
jio_appcachestorage.js\n
NETWORK:\n
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Document List JS</string> </value>
<value> <string>Gadget Bootloader AppCache</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
......@@ -225,7 +217,7 @@
</tuple>
<state>
<tuple>
<float>1495446491.04</float>
<float>1493728283.88</float>
<string>UTC</string>
</tuple>
</state>
......@@ -270,7 +262,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.10686.10882.5973</string> </value>
<value> <string>959.48233.9194.50227</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +280,7 @@
</tuple>
<state>
<tuple>
<float>1503059476.75</float>
<float>1496245831.78</float>
<string>UTC</string>
</tuple>
</state>
......@@ -345,7 +337,7 @@
</tuple>
<state>
<tuple>
<float>1495446386.43</float>
<float>1493199934.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.29242.42246.47598</string> </value>
<value> <string>960.25484.60987.38638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1502886442.31</float>
<float>1499245437.8</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,8 +8,8 @@
<link rel="stylesheet" href="gadget_officejs_bootloader_presentation.css">
<!-- renderjs -->
<script src="app/rsvp.js" type="text/javascript"></script>
<script src="app/renderjs.js" type="text/javascript"></script>
<script src="development/rsvp.js" type="text/javascript"></script>
<script src="development/renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_officejs_bootloader_presentation.js" type="text/javascript"></script>
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.16133.53728.41011</string> </value>
<value> <string>958.64452.27945.28586</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1502097067.26</float>
<float>1493372430.42</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -5,8 +5,18 @@ var IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABUCAYAAAACoiByA
"use strict";
rJS(window)
.ready(function (g) {
g.props = {};
})
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
.declareMethod('render', function (options) {
var inner =
this.props.element.querySelector("center")
.innerHTML =
"<header>OfficeJS Installer</header>" +
"<br>" +
"<br>" +
......@@ -17,21 +27,10 @@ var IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABUCAYAAAACoiByA
"<br>" +
'<img width="100" height="100" title="" alt="" src="' + IMAGE + '" />' +
"<br>" +
'<div> Preparing ' + options.app_name + '</div>' +
'<div>Installing ' + options.app_name + '</div>' +
"<br> We prepare your application for a 100 % offline mode" +
'<div class="loader"></div>',
error_message;
if (options.retry > 0) {
error_message = options.error.message || 'Unknow Error';
inner += "<br>" +
"<div> Last Error: " + error_message + "</div>" +
"<div>Retry n° " + options.retry + "</div>";
}
inner += '<div><a href="' +
options.redirect_url + '">Skip</a></div>';
this.element.querySelector("center")
.innerHTML = inner;
return;
'<div class="loader"></div>';
return {};
});
}(window, rJS));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.10577.42640.30924</string> </value>
<value> <string>956.64509.32061.2201</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1501764672.06</float>
<float>1485770737.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -5,6 +5,8 @@ var global = self, window = self;
(function (self, fetch, Request, Response) {
"use strict";
self.IDBTransaction = self.IDBTransaction || self.webkitIDBTransaction || self.msIDBTransaction || {READ_WRITE: "readwrite"};
self.IDBKeyRange = self.IDBKeyRange || self.webkitIDBKeyRange || self.msIDBKeyRange;
self.DOMParser = {};
self.sessionStorage = {};
self.localStorage = {};
......@@ -12,7 +14,7 @@ var global = self, window = self;
self.DOMError = {};
self.postMessage = function () {return; };
self.importScripts('app/rsvp.js', 'app/jiodev.js');
self.importScripts('development/rsvp.js', 'development/jiodev.js');
self.storage = {};
......@@ -25,20 +27,6 @@ var global = self, window = self;
});
}
function getFromLocal(relative_url) {
if (self.storage.get === undefined) {
self.storage = createStorage("ojs_source_code");
}
return self.storage.getAttachment(self.registration.scope, relative_url)
.push(function (blob) {
return new Response(blob, {
'headers': {
'content-type': blob.type
}
});
});
}
self.addEventListener('install', function (event) {
event.waitUntil(self.skipWaiting());
});
......@@ -53,45 +41,34 @@ var global = self, window = self;
if (relative_url === "") {
relative_url = "/";
}
if (relative_url === 'no-cache') {
event.respondWith(new Response(self.cache_list));
return;
}
else if (event.request !== undefined && event.request.referrer === self.registration.scope) {
event.respondWith(
new self.RSVP.Queue()
.push(function () {
return fetch(event.request);
})
.push(function (response) {
if (response.status === 200) {
return response;
if (self.storage.get === undefined) {
self.storage = createStorage(self.registration.scope);
}
return getFromLocal(relative_url);
})
.push(undefined, function (error) {
return new Response(error, {"statusText": error.message, "status": 500});
})
);
} else {
event.respondWith(
new self.RSVP.Queue()
.push(function () {
return getFromLocal(relative_url);
return self.storage.getAttachment("/", relative_url)
.push(function (blob) {
return new Response(blob, {
'headers': {
'content-type': blob.type
}
});
});
})
.push(undefined, function (error) {
if (error instanceof self.jIO.util.jIOError) {
if (relative_url.indexOf('http') === -1) {
if (self.cache_list.indexOf(relative_url) === -1) {
self.cache_list.push(relative_url);
}
}
self.console.log(
"Relative_Url: ",
relative_url,
"\nCause: ",
error.message
);
return fetch(event.request);
}
return new Response(error, {"statusText": error.message, "status": 500});
})
);
}
});
}(self, fetch, Request, Response));
\ No newline at end of file
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.30858.43041.57309</string> </value>
<value> <string>960.4199.25759.2730</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>1502980874.99</float>
<float>1497613210.46</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Worklist
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Page Worklist</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_ojs_configurator_access.js" type="text/javascript"></script>
<!-- XXX must set theme here! -->
<script id="table-template" type="text/x-handlebars-template">
<article class="ui-content ui-body-c document-access">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-file-text-o">&nbsp;</span>
Your Documents
</h3>
</section>
<section class="ui-body-c ui-content-section">
<ul data-role="listview" class="document-listview">
<li>
<a href="{{sync_href}}" data-i18n="Synchronize">Synchronize</a>
</li><li>
<a href="{{document_list_href}}" data-i18n="Go to document List">Go to Document List</a>
</li>
</ul>
</section>
</article>
</script>
</head>
<body>
<section class="document_list"></section>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
/////////////////////////////////////////////////////////////////
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.getElementById("table-template")
.innerHTML,
table_template = Handlebars.compile(source);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getSetting", "getSetting")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (storage_name) {
var gadget = this;
return gadget.getSetting("jio_storage_name", undefined)
.push(function (name) {
if (name === storage_name) {
return RSVP.all([
gadget.getUrlFor({command: "display", options: {page: "ojs_document_list"}}),
gadget.getUrlFor(
{command: "display", options: {page: "ojs_sync", auto_repair: true}}
),
gadget.getSetting("jio_storage_name", false)
]);
}
return [];
})
.push(function (result) {
if (result[2]) {
return gadget.element.querySelector('.document_list').innerHTML =
table_template({document_list_href: result[0], sync_href: result[1]});
}
});
});
}(window, rJS, RSVP, Handlebars, URI));
\ No newline at end of file
......@@ -183,9 +183,6 @@ gadget_officejs_jio_crib_from.html\n
gadget_officejs_page_jio_crib_configurator.html\n
gadget_officejs_page_jio_crib_configurator.js\n
gadget_officejs_crib_panel.html\n
GADGET:\n
officejs_codemirror/\n
officejs_setting_gadget/\n
NETWORK:\n
*</string> </value>
</item>
......@@ -328,7 +325,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.34163.780.59682</string> </value>
<value> <string>960.25484.60987.38638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -346,7 +343,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1501062971.88</float>
<float>1499072418.75</float>
<string>UTC</string>
</tuple>
</state>
......
This diff is collapsed.
This diff is collapsed.
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