Commit 0463d878 authored by Vincent Bechu's avatar Vincent Bechu Committed by Eteri

[Officejs] Update officejs to use rjs gadgets.

parent 2191bb1c
...@@ -116,8 +116,8 @@ gadget_erp5_nojqm.css\n ...@@ -116,8 +116,8 @@ gadget_erp5_nojqm.css\n
ckeditor/adapters/jquery.js\n ckeditor/adapters/jquery.js\n
ckeditor/build-config.js\n ckeditor/build-config.js\n
ckeditor/ckeditor.js\n ckeditor/ckeditor.js\n
ckeditor/config.js\n
ckeditor/contents.css\n ckeditor/contents.css\n
ckeditor/config.js\n
ckeditor/lang/af.js\n ckeditor/lang/af.js\n
ckeditor/lang/ar.js\n ckeditor/lang/ar.js\n
ckeditor/lang/bg.js\n ckeditor/lang/bg.js\n
...@@ -568,7 +568,7 @@ NETWORK:\n ...@@ -568,7 +568,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.28759.28788.38792</string> </value> <value> <string>958.44217.46814.8652</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -586,7 +586,7 @@ NETWORK:\n ...@@ -586,7 +586,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1491383488.14</float> <float>1501162811.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
</head> </head>
<body> <body>
<div class="ckeditor_gadget"><textarea></textarea></div> <div class="ckeditor_gadget" style="display:none;"><textarea></textarea></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -136,16 +136,10 @@ ...@@ -136,16 +136,10 @@
<key> <string>data</string> </key> <key> <string>data</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>edit_workflow</string> </key> <key> <string>edit_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -155,59 +149,6 @@ ...@@ -155,59 +149,6 @@
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <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> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
...@@ -222,7 +163,7 @@ ...@@ -222,7 +163,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>vincent</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +177,7 @@ ...@@ -236,7 +177,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>957.29599.9551.41830</string> </value> <value> <string>959.65360.8858.42939</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +195,7 @@ ...@@ -254,7 +195,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1487770197.8</float> <float>1497272689.07</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -4,15 +4,10 @@ ...@@ -4,15 +4,10 @@
"use strict"; "use strict";
rJS(window) rJS(window)
.ready(function (g) { .ready(function () {
g.props = {}; var gadget = this,
}) textarea = gadget.element.querySelector('textarea');
.ready(function (g) { gadget.state.ckeditor = CKEDITOR.replace(
return g.getElement()
.push(function (element) {
var textarea = element.querySelector('textarea');
g.props.element = element;
g.props.ckeditor = CKEDITOR.replace(
textarea, textarea,
{ {
removeButtons: 'NewPage,Preview,Cut,Paste,Copy,PasteText,' + removeButtons: 'NewPage,Preview,Cut,Paste,Copy,PasteText,' +
...@@ -23,33 +18,40 @@ ...@@ -23,33 +18,40 @@
extraAllowedContent: "details section article" extraAllowedContent: "details section article"
} }
); );
g.props.ckeditor.addCommand('saveRJS', { gadget.state.ckeditor.addCommand('saveRJS', {
readOnly: 1, readOnly: 1,
exec: function () { exec: function () {
return g.submitContent(); return gadget.submitContent();
} }
}); });
g.props.ckeditor.ui.addButton('Save', { gadget.state.ckeditor.ui.addButton('Save', {
label: "Save", label: "Save",
command: 'saveRJS', command: 'saveRJS',
toolbar: 'document,1' toolbar: 'document,1'
}); });
g.props.ckeditor.on('instanceReady', function (event) { gadget.state.ckeditor.on('instanceReady', function (event) {
event.editor.execCommand('maximize'); event.editor.execCommand('maximize');
}); });
}); gadget.state.ckeditor.on('change', gadget.notifyChange);
}) })
.declareAcquiredMethod("submitContent", "triggerSubmit") .declareAcquiredMethod("submitContent", "triggerSubmit")
.declareAcquiredMethod("notifyChange", 'notifyChange')
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
this.props.key = options.key || "text_content"; return this.changeState({
this.props.ckeditor.setData(options.value || ""); key: options.key || "text_content",
return {}; data: options.value || ""
});
}) })
.declareMethod('getContent', function () { .declareMethod('getContent', function () {
var result = {}; var result = {};
result[this.props.key] = this.props.ckeditor.getData(); result[this.state.key] = this.state.ckeditor.getData();
return result; return result;
})
.onStateChange(function () {
var gadget = this;
return gadget.state.ckeditor.setData(gadget.state.data);
}); });
}(rJS, CKEDITOR)); }(rJS, CKEDITOR));
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64903.6566.48281</string> </value> <value> <string>960.64612.15949.44475</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1486128239.58</float> <float>1501073715.33</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -118,61 +118,93 @@ font-awesome/font-awesome-webfont.woff\n ...@@ -118,61 +118,93 @@ font-awesome/font-awesome-webfont.woff\n
font-awesome/font-awesome-webfont.woff2\n font-awesome/font-awesome-webfont.woff2\n
font-awesome/font-awesome-webfont.ttf\n font-awesome/font-awesome-webfont.ttf\n
font-awesome/font-awesome-webfont.svg\n font-awesome/font-awesome-webfont.svg\n
gadget_erp5_nojqm.css\n
jio_mappingstorage.js\n jio_mappingstorage.js\n
jio_fixstorage.js\n jio_fixstorage.js\n
erp5_launcher.js\n gadget_erp5_global.js\n
gadget_erp5.css\n URI.js\n
gadget_erp5_editor_panel.html\n dygraph.js\n
gadget_erp5_editor_panel.js\n handlebars.js\n
jiodev.js\n
renderjs.js\n
rsvp.js\n
gadget_global.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.html\n
gadget_jio.js\n gadget_jio.js\n
gadget_officejs_application_panel.js\n gadget_translate.html\n
gadget_officejs_bookmark_manager_panel.html\n gadget_translate.js\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_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.html\n
gadget_translation.js\n gadget_translation.js\n
gadget_officejs_liberator.html\n gadget_translation_data.js\n
gadget_officejs_liberator.js\n gadget_erp5_editor_panel.html\n
handlebars.js\n gadget_erp5_editor_panel.js\n
jiodev.js\n gadget_erp5_header.html\n
jquery.js\n gadget_erp5_header.js\n
jquerymobile.css\n gadget_ojs_jio.html\n
jquerymobile.js\n gadget_ojs_jio.js\n
renderjs.js\n gadget_erp5_page_ojs_controller.html\n
rsvp.js\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
\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
NETWORK:\n NETWORK:\n
*</string> </value> *</string> </value>
</item> </item>
...@@ -315,7 +347,7 @@ NETWORK:\n ...@@ -315,7 +347,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.25484.60987.38638</string> </value> <value> <string>961.9215.29642.18432</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -333,7 +365,7 @@ NETWORK:\n ...@@ -333,7 +365,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1499072426.32</float> <float>1501681934.74</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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,50 +3,67 @@ ...@@ -3,50 +3,67 @@
<head> <head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />
<title>OfficeJS Text Editor Panel Gadget</title> <title>ERP5 Panel</title>
<!--
data-i18n=Editable
-->
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script> <script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.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"> <script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit"> <div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left"> <div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls"> <div class="ui-controlgroup-controls">
<form action="#" method="post"> <button data-i18n="Close" class="ui-btn ui-btn-icon-notext ui-icon-delete">Close</button>
<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> </div>
</div> </div>
</script> </script>
<script id="panel-template-body" type="text/x-handlebars-template"> <script id="panel-template-body" type="text/x-handlebars-template">
<div class="ui-content"> <div class="ui-content">
<ul data-role="listview" class="ui-listview">
<li><a href="#page=bookmark_list" data-i18n="Bookmark List">Bookmark List</a></li> <form class="dialog_form">
<li><a href="#page=bookmark_dispatcher" data-i18n="Search">Search</a></li> <button type="submit" class="ui-btn ui-btn-b ui-btn-inline
<li><a href="#page=bookmark_preference" data-i18n="Preferences">Preferences</a></li> ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li> <div data-gadget-url="gadget_erp5_searchfield.html"
<li><a href="#page=sync&auto_repair=true" data-i18n="Synchronize">Synchronize</a></li> data-gadget-scope="erp5_searchfield"
<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> data-gadget-sandbox="public"></div>
</ul> </form>
<ul data-role="listview" class="ui-listview" data-enhanced="true"></ul>
<dl></dl>
</div> </div>
</script> </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 --> <!-- custom script -->
<script src="gadget_officejs_application_panel.js" type="text/javascript"></script> <script src="gadget_erp5_ojs_bookmark_panel.js" type="text/javascript"></script>
</head> </head>
<body> <body>
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_bookmark_manager_panel.html</string> </value> <value> <string>gadget_erp5_ojs_bookmark_panel.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>957.575.7829.27238</string> </value> <value> <string>961.9234.12589.52992</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1486556932.46</float> <float>1501746672.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -18,6 +18,6 @@ ...@@ -18,6 +18,6 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">bookmark_module</script> <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" 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="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script> <div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>959.26241.25958.12748</string> </value> <value> <string>959.56480.11254.21418</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1495026940.62</float> <float>1501600658.73</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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) {
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_document_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": 0,
"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
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_add_bookmark.js</string> </value> <value> <string>gadget_erp5_page_ojs_add_bookmark.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_add_bookmark_js</string> </value> <value> <string>gadget_officejs_bookmark_page_add_bookmark_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value> <value> <string>Web Script</string> </value>
</item> </item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Add Bookmark JS</string> </value> <value> <string>OfficeJS Add Bookmark JS</string> </value>
...@@ -222,7 +228,7 @@ ...@@ -222,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +242,7 @@ ...@@ -236,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.50193.21595.21913</string> </value> <value> <string>961.10273.32311.54476</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +260,7 @@ ...@@ -254,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1500208552.85</float> <float>1501746606.13</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!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
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_add_bookmark.html</string> </value> <value> <string>gadget_erp5_page_ojs_add_bookmark.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_add_bookmark_html</string> </value> <value> <string>gadget_officejs_bookmark_page_add_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value> <value> <string>Web Page</string> </value>
</item> </item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Add Bookmark</string> </value> <value> <string>OfficeJS Add Bookmark</string> </value>
...@@ -236,7 +242,7 @@ ...@@ -236,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64678.36333.6946</string> </value> <value> <string>961.9211.50185.40243</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +260,7 @@ ...@@ -254,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485780894.37</float> <float>1501746768.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*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
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_dispatcher.js</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_dispatcher.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_dispatcher_js</string> </value> <value> <string>gadget_officejs_bookmark_page_dispatcher.js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value> <value> <string>Web Script</string> </value>
</item> </item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Bookmark Dispatcher JS</string> </value> <value> <string>OfficeJS Bookmark Dispatcher JS</string> </value>
...@@ -222,7 +228,7 @@ ...@@ -222,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +242,7 @@ ...@@ -236,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.51909.43417.21213</string> </value> <value> <string>961.10293.23355.24473</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +260,7 @@ ...@@ -254,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1500311903.57</float> <float>1501746582.52</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,21 +9,18 @@ ...@@ -9,21 +9,18 @@
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_officejs_page_bookmark_dispatcher.js"></script> <script src="gadget_erp5_page_ojs_bookmark_dispatcher.js"></script>
</head> </head>
<body> <body>
<form class="search-bar"> <form class="dialog_form ui-body-c" novalidate>
<div class="center ui-field-contain"> <button type="submit" class="ui-btn ui-btn-b ui-btn-inline
<div class="ui-input-text ui-corner-all ui-shadow-inset ui-input-has-clear"> ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<input type="text" data-enhanced="true" value="" name="search" /> <div data-gadget-url="gadget_erp5_searchfield.html"
<div class="ui-btn ui-input-clear ui-input-btn ui-corner-all ui-icon-search ui-btn-icon-notext" data-i18n="[node]header-submit"> data-gadget-scope="erp5_searchfield"
<input data-enhanced="true" type="submit" data-i18n="[value]header-submit" value="Submit" /> data-gadget-sandbox="public">
</div>
</div>
</div> </div>
</form> </form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_dispatcher.html</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_dispatcher.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_dispatcher_html</string> </value> <value> <string>gadget_officejs_bookmark_page_dispatcher_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64677.1467.64529</string> </value> <value> <string>961.9156.29616.4744</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485780792.24</float> <float>1501746747.44</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_officejs_page_bookmark_list.js"></script> <script src="gadget_erp5_page_ojs_bookmark_list.js"></script>
</head> </head>
<body> <body>
<div data-gadget-url="gadget_officejs_widget_listbox.html" data-gadget-scope="listbox"></div> <div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body> </body>
</html> </html>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_list.html</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_list.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_list_html</string> </value> <value> <string>gadget_officejs_bookmark_page_list_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64450.52709.9386</string> </value> <value> <string>961.9212.16810.29730</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485780721.46</float> <float>1501746788.51</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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("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
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_list.js</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_list.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_list_js</string> </value> <value> <string>gadget_officejs_bookmark_page_list_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value> <value> <string>Web Script</string> </value>
</item> </item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Bookmark List JS</string> </value> <value> <string>OfficeJS Bookmark List JS</string> </value>
...@@ -222,7 +228,7 @@ ...@@ -222,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +242,7 @@ ...@@ -236,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.50482.54730.15138</string> </value> <value> <string>961.9215.4122.51694</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +260,7 @@ ...@@ -254,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1500225946.73</float> <float>1501746703.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!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>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_preference.html</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_preference.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_preference_html</string> </value> <value> <string>gadget_officejs_bookmark_page_preference_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.32715.46116.17902</string> </value> <value> <string>961.9275.45248.48947</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1499161500.2</float> <float>1501746637.86</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*globals window, RSVP, rJS, URL*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS, URL) {
"use strict";
function saveOptionDict(gadget) {
var option_dict = {
search_engine: gadget.element.querySelector(
".options input[name=\"search_engine\"]"
).value,
auto_redirect: gadget.element.querySelector(
".options input[name=\"auto_redirect\"]"
).checked
};
return gadget.setSetting("option", option_dict);
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
/////////////////////////////////////////////////////////////////
// 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": "title",
"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 () {
saveOptionDict(this);
});
}(window, RSVP, rJS, URL));
\ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_bookmark_preference.js</string> </value> <value> <string>gadget_erp5_page_ojs_bookmark_preference.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_page_bookmark_preference_js</string> </value> <value> <string>gadget_officejs_bookmark_page_preference_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.53098.25350.56115</string> </value> <value> <string>961.9320.43291.25821</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1500382833.07</float> <float>1501746619.11</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -12,38 +12,20 @@ ...@@ -12,38 +12,20 @@
<script class="view-web-page-template" type="text/x-handlebars-template"> <script class="view-web-page-template" type="text/x-handlebars-template">
<a href="{{url_string}}" style="display: block; text-align: center; font-size: 1.7em;">{{url_string}}</a> <a href="{{url_string}}" style="display: block; text-align: center; font-size: 1.7em;">{{url_string}}</a>
<form class="view-web-page-form">
<div class="center">
<div class="ui-field-contain">
<label data-i18n="Reference:">Reference:</label>
<input type="text" name="reference" value="{{reference}}">
</div>
<div class="ui-field-contain">
<label data-i18n="Title:">Title:</label>
<input type="text" name="title" value="{{title}}">
</div>
<div class="ui-field-contain">
<label data-i18n="Url:">Url:</label>
<input type="text" name="url_string" value="{{url_string}}">
</div>
<div class="ui-field-contain">
<label data-i18n="Description:">Description:</label>
<textarea name="description">{{description}}</textarea>
</div>
<div>
<button type="submit" data-i18n="Save" style="display:none;">Save</button>
</div>
</div>
</form>
</script> </script>
<script src="gadget_officejs_jio_bookmark_view.js"></script> <script src="gadget_officejs_jio_bookmark_view.js"></script>
</head> </head>
<body> <body>
<div class="template-view"></div>
<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> </body>
</html> </html>
\ No newline at end of file
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_bookmark_view_html</string> </value> <value> <string>gadget_officejs_bookmark_view_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.50196.61213.58965</string> </value> <value> <string>961.8981.40656.43178</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1500208665.49</float> <float>1501746717.77</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*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.props.element.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"
},
"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));
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_bookmark_view_js</string> </value> <value> <string>gadget_officejs_bookmark_view_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.64652.63438.53777</string> </value> <value> <string>961.9092.3808.5495</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485781314.69</float> <float>1501746726.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<key> <string>_Add_portal_content_Permission</string> </key> <key> <string>_Add_portal_content_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
...@@ -43,8 +42,6 @@ ...@@ -43,8 +42,6 @@
<key> <string>_Modify_portal_content_Permission</string> </key> <key> <string>_Modify_portal_content_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -75,7 +72,7 @@ ...@@ -75,7 +72,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_jio_spreadsheet_view.html</string> </value> <value> <string>gadget_ojs_configurator_access.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,13 +82,11 @@ ...@@ -85,13 +82,11 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_spreadsheet_view_html</string> </value> <value> <string>gadget_officejs_configurator_access_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
<value> <value> <string>en</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
...@@ -105,19 +100,11 @@ ...@@ -105,19 +100,11 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Jio Spreadsheet View</string> </value> <value> <string>Gadget OJS Configurator Access</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
<value> <value> <string>001</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
...@@ -173,11 +160,11 @@ ...@@ -173,11 +160,11 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>publish_alive</string> </value> <value> <string>publish</string> </value>
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -199,7 +186,7 @@ ...@@ -199,7 +186,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1448023917.39</float> <float>1499430478.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -208,7 +195,7 @@ ...@@ -208,7 +195,7 @@
</item> </item>
<item> <item>
<key> <string>validation_state</string> </key> <key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value> <value> <string>published</string> </value>
</item> </item>
</dictionary> </dictionary>
</list> </list>
...@@ -244,7 +231,7 @@ ...@@ -244,7 +231,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.16435.61501.22323</string> </value> <value> <string>960.37226.18505.39901</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +249,7 @@ ...@@ -262,7 +249,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1444332775.99</float> <float>1499430384.08</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -319,7 +306,7 @@ ...@@ -319,7 +306,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1444169070.83</float> <float>1499429359.69</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*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
/*global document, window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (document, window, rJS) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.allowPublicAcquisition('notifySubmit', function () {
return this.triggerSubmit();
})
.declareMethod('triggerSubmit', function () {
return this.getDeclaredGadget('fg')
.push(function (g) {
return g.triggerSubmit();
});
})
.declareMethod("render", function (options) {
var gadget = this,
child_gadget_url;
return gadget.jio_get(options.jio_key)
.push(function (result) {
if (result.portal_type !== undefined) {
child_gadget_url = 'gadget_officejs_jio_' +
result.portal_type.replace(' ', '_').toLowerCase() +
'_view.html';
} else {
throw new Error('Can not display document: ' + options.jio_key);
}
return gadget.changeState({
jio_key: options.jio_key,
doc: result,
child_gadget_url: child_gadget_url,
editable: options.editable
});
});
})
.onStateChange(function () {
var fragment = document.createElement('div'),
gadget = this;
// Clear first to DOM, append after to reduce flickering/manip
while (this.element.firstChild) {
this.element.removeChild(this.element.firstChild);
}
this.element.appendChild(fragment);
return gadget.declareGadget(gadget.state.child_gadget_url, {element: fragment,
scope: 'fg'})
.push(function (form_gadget) {
return form_gadget.render({
jio_key: gadget.state.jio_key,
doc: gadget.state.doc,
editable: gadget.state.editable
});
});
});
}(document, window, rJS));
\ No newline at end of file
...@@ -183,6 +183,9 @@ gadget_officejs_jio_crib_from.html\n ...@@ -183,6 +183,9 @@ gadget_officejs_jio_crib_from.html\n
gadget_officejs_page_jio_crib_configurator.html\n gadget_officejs_page_jio_crib_configurator.html\n
gadget_officejs_page_jio_crib_configurator.js\n gadget_officejs_page_jio_crib_configurator.js\n
gadget_officejs_crib_panel.html\n gadget_officejs_crib_panel.html\n
GADGET:\n
officejs_codemirror/\n
officejs_setting_gadget/\n
NETWORK:\n NETWORK:\n
*</string> </value> *</string> </value>
</item> </item>
...@@ -325,7 +328,7 @@ NETWORK:\n ...@@ -325,7 +328,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.25484.60987.38638</string> </value> <value> <string>960.34163.780.59682</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -343,7 +346,7 @@ NETWORK:\n ...@@ -343,7 +346,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1499072418.75</float> <float>1501062971.88</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Add Bookmark</title> <title>OfficeJS Text Editor List</title>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="handlebars.js"></script> <script src="gadget_erp5_page_ojs_document_list.js"></script>
<script src="gadget_officejs_page_add_bookmark.js"></script>
</head> </head>
<body> <body>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body> </body>
</html> </html>
/*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
/////////////////////////////////////////////////////////////////
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, date, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("modification_date")) {
date = new Date(result.data.rows[i].value.modification_date);
result.data.rows[i].value.modification_date = {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: 0,
description: "The Date",
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": date.toUTCString(),
key: "modification_date",
required: 0,
timezone_style: 0,
title: "Modification Date",
type: "DateTimeField"
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
};
}
}
return result;
});
})
.onEvent('submit', function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.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 = [
['title', 'Title'],
['reference', 'Reference'],
['language', 'Language'],
['description', 'Description'],
['version', 'Version'],
['modification_date', 'Modification Date']
];
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_document"}}),
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
<html>
<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>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_import.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_form.html" data-gadget-scope="form_view"></div>
</body>
</html>
\ 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 Text Document</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojs_add_document.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>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_officejs_jio.js" type="text/javascript"></script> <script src="gadget_ojs_jio.js" type="text/javascript"></script>
</head> </head>
<body> <body>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_jio.html</string> </value> <value> <string>gadget_ojs_jio.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.25484.60987.38638</string> </value> <value> <string>960.3901.52182.22272</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1498833707.82</float> <float>1497517315.49</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>957.14780.57195.40277</string> </value> <value> <string>958.44217.46814.8652</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1486719196.44</float> <float>1501255689.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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