From f4e03e053c3287ef396a2437b4c571b9f794463f Mon Sep 17 00:00:00 2001 From: amrani Date: Thu, 3 May 2018 08:15:22 +0000 Subject: [PATCH 1/3] Add cryptostorage to dropbox configurator --- ...dget_officejs_page_jio_configurator_js.xml | 4 +-- ...icejs_page_jio_dropbox_configurator_js.txt | 29 ++++++++++++++----- ...icejs_page_jio_dropbox_configurator_js.xml | 4 +-- ...dget_officejs_text_editor_router_html.html | 2 +- ...adget_officejs_text_editor_router_html.xml | 6 ++-- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.xml index e78be35cd92..3a121ede268 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_configurator_js.xml @@ -236,7 +236,7 @@ serial - 961.10686.10882.5973 + 967.9072.63621.10803 state @@ -254,7 +254,7 @@ - 1501771018.12 + 1524834305.31 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt index 1c97241827c..2dc3b36837c 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt @@ -34,6 +34,8 @@ check_remote_modification: true, check_remote_creation: true, check_remote_deletion: true, + parallel_operation_attachment_amount: 50, + parallel_operation_amount: 50, signature_sub_storage: { type: "query", sub_storage: { @@ -45,12 +47,21 @@ } }, local_sub_storage: { - type: "query", + type: "mapping", + attachment: { + DOCUMENT_REGEXP : { + get: {uri_template: 'enclosure'}, + put: {uri_template: 'enclosure'} + } + }, sub_storage: { - type: "uuid", + type: "query", sub_storage: { - type: "indexeddb", - database: "officejs-dropbox" + type: "uuid", + sub_storage: { + type: "indexeddb", + database: "officejs-dropbox" + } } } }, @@ -70,9 +81,13 @@ sub_storage: { type: "drivetojiomapping", sub_storage: { - type: "dropbox", - access_token: token, - root: "sandbox" + type: "crypt", + key: 'amrani', + sub_storage: { + type: "dropbox", + access_token: token, + root: "sandbox" + } } } } diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml index aed41168d14..9afadb8e7dd 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml @@ -242,7 +242,7 @@ serial - 965.41982.41699.42325 + 967.9063.45697.9454 state @@ -260,7 +260,7 @@ - 1519203768.55 + 1525334912.53 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.html index 500390d4b61..cf210a934e4 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.html +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.html @@ -19,7 +19,7 @@ - +
\ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.xml index aec853e0870..5a155d25d24 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_router_html.xml @@ -265,7 +265,7 @@
actor - vincent + zope comment @@ -279,7 +279,7 @@ serial - 964.45561.47559.9591 + 966.44456.34486.30566 state @@ -297,7 +297,7 @@ - 1515684319.77 + 1524666086.89 UTC -- 2.30.9 From df54ab657a60c834dc3d4c2c9806b4e6376c7a0a Mon Sep 17 00:00:00 2001 From: amrani Date: Tue, 31 Jul 2018 10:19:09 +0000 Subject: [PATCH 2/3] Added POPUP gadget Added POPUP file to appchache some Modification to support dropbox encryption and cryptostorage added callback to mapping and date storage as well as all other JIO storage --- .../gadget_erp5_popup_html.html | 27 ++ .../gadget_erp5_popup_html.xml | 322 +++++++++++++++++ .../web_page_module/gadget_erp5_popup_js.js | 161 +++++++++ .../web_page_module/gadget_erp5_popup_js.xml | 328 ++++++++++++++++++ ...get_officejs_bookmark_manager_appcache.xml | 8 +- .../gadget_officejs_drive_app_appcache.xml | 8 +- .../gadget_officejs_illustration_appcache.xml | 8 +- .../web_page_module/gadget_officejs_jio_js.js | 29 +- .../gadget_officejs_jio_js.xml | 6 +- ...icejs_page_jio_dropbox_configurator_js.txt | 22 +- ...icejs_page_jio_dropbox_configurator_js.xml | 4 +- .../gadget_officejs_pdf_viewer_appcache.xml | 8 +- .../gadget_officejs_text_editor_appcache.xml | 10 +- .../web_page_module/jio_ojs_storage_js.js | 15 +- .../web_page_module/jio_ojs_storage_js.xml | 6 +- .../ojs_wallsearch_appcache.xml | 8 +- 16 files changed, 915 insertions(+), 55 deletions(-) create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.html create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.xml create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.js create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.xml diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.html new file mode 100644 index 00000000000..f87eaac4193 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.html @@ -0,0 +1,27 @@ + + + + + + ERP5 OJS POPUP + + + + + + + + + + + \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.xml new file mode 100644 index 00000000000..bbfca0b68c0 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_html.xml @@ -0,0 +1,322 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + text/html + + + default_reference + gadget_erp5_popup.html + + + description + + + + + + id + gadget_erp5_popup_html + + + language + en + + + portal_type + Web Page + + + short_title + + + + + + title + gadget popup + + + version + 001 + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1530875434.6 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 969.12330.13902.31846 + + + state + current + + + time + + + + + + + + + + + 1532721257.96 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1530819762.62 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.js new file mode 100644 index 00000000000..f666e3c89c5 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.js @@ -0,0 +1,161 @@ +/*jslint nomen: true, indent: 2, maxerr: 3 */ +/*global window, rJS, Handlebars, RSVP, TextEncoder */ +(function (window, rJS, RSVP, Handlebars, TextEncoder) { + "use strict"; + + var gadget_klass = rJS(window), + popup = gadget_klass.__template_element + .getElementById("popup_password") + .innerHTML, + popup_template = Handlebars.compile(popup); + +///////////////////////////////////////////////////////////////// +// declared methods +///////////////////////////////////////////////////////////////// + gadget_klass + .declareAcquiredMethod("notifySubmitted", "notifySubmitted") + .declareAcquiredMethod("redirect", "redirect") + +////////////////////////////////////////// +// Converting from user key to Cryptokey +///////////////////////////////////////// + .declareMethod('convertKey', function (str) { + var buffer = new TextEncoder("utf-8").encode(str); + // We transform the string into an arraybuffer. + return new RSVP.Queue() + .push(function () { + return RSVP.all([window.crypto.subtle.digest("SHA-256", buffer), + window.crypto.subtle.importKey( + "raw", + buffer, + {name: "PBKDF2" + }, + false, + ["deriveKey"] + ) + ]); + }) + .push(function (my_array) { + return { + CryptoKey: my_array[1], + Salt: my_array[0] + }; + }) + .push(undefined, function (error) { + throw error; + }); + }) + +////////////////////////////////////////// +// Displaying POPUP function +///////////////////////////////////////// + .declareMethod('display_popup', function (options) { + var gadget = this; + if (options && options.message && options.addkey && options.error) { + return this.changeState({ + visible: true, + message: options.message, + addkey: options.addkey, + error: options.error + }) + .push(function () { + return gadget.notifySubmitted({message: gadget.state.error.error_message, + status: 'failure'}); + }); + } + }) + + .declareMethod('close', function () { + return this.changeState({ + visible: false + }); + }) + + .onStateChange(function (modification_dict) { + var gadget = this; + if (modification_dict.hasOwnProperty('visible')) { + if (gadget.state.visible) { + if (!gadget.element.classList.contains('visible')) { + gadget.element.classList.toggle('visible'); + } + } else { + if (gadget.element.classList.contains('visible')) { + gadget.element.classList.remove('visible'); + } + } + } + + if (modification_dict.hasOwnProperty('message') && modification_dict.hasOwnProperty('addkey') && + modification_dict.hasOwnProperty('error')) { + //window.top.document.body.addEventListener("click", function (evt) { + //evt.stopPropagation(); + //evt.preventDefault(); + //}, true); + gadget.element.innerHTML = popup_template({ + message: gadget.state.message + }); + } + + }) + +////////////////////////////////////////// +// Evenet lisener on input +///////////////////////////////////////// + + .declareMethod('add_lisener_input', function (input_pass) { + var gadget = this; + input_pass.addEventListener('input', function () { + gadget.notifySubmitted(); + }, {once: true}); + return; + }) + + + +////////////////////////////////////////// +// Form submit +///////////////////////////////////////// + .onEvent('submit', function () { + var gadget = this, + input_pass_value, + input_pass = this.element.querySelector("input.ui-password-overlay"); + if (input_pass.value !== undefined && input_pass.value !== null && input_pass.value !== "") { + input_pass_value = input_pass.value; + if (input_pass_value.match(/^(?=[\w\W]*\d)(?=[\w\W]*[a-z])(?=[\w\W]*[A-Z])[0-9a-zA-Z]{8,}$/)) { + return gadget.convertKey(input_pass_value) + .push(function (obj) { + return gadget.state.addkey(obj); + }) + .push(function () { + return gadget.notifySubmitted(); + }) + .push(function () { + return gadget.close(); + }) + .push(function () { + return gadget.redirect({command: "display", options: {page: 'ojs_sync', auto_repair: 'true'}}); + }); + } + return gadget.add_lisener_input(input_pass) + .push(function () { + return gadget.notifySubmitted({message: 'Passwords must contain: \n' + + 'a lower case letter [a-z] \n' + + 'a upper case letter [A-Z] \n' + + 'a numeric character [0-9] and \n ' + + 'at least 8 characters in length', status: 'failure'}); + }); + } + return gadget.notifySubmitted({message: 'no field found', status: 'failure'}); + }) + .declareMethod("triggerSubmit", function () { + return this.element.querySelector('button[type="submit"]').click(); + }); + + //.onEvent('click', function (evt) { + //if ((evt.target.nodeType === Node.ELEMENT_NODE) && + // (evt.target.tagName === 'BUTTON')) { + //return this.close(); + //} + //}, false, false); + +}(window, rJS, RSVP, Handlebars, TextEncoder)); \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.xml new file mode 100644 index 00000000000..a59c09b7d6e --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_popup_js.xml @@ -0,0 +1,328 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + + + + + + default_reference + gadget_erp5_popup.js + + + description + + + + + + id + gadget_erp5_popup_js + + + language + + + + + + portal_type + Web Script + + + short_title + + + + + + title + ERP5 POPUP + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1530875421.75 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 969.12328.29106.49612 + + + state + current + + + time + + + + + + + + + + + 1532721180.95 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1530819762.57 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_manager_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_manager_appcache.xml index f33b6f8a3d7..03657991813 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_manager_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_manager_appcache.xml @@ -181,6 +181,8 @@ gadget_html5_element.html\n gadget_html5_element.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_field_string.html\n gadget_erp5_field_string.js\n gadget_erp5_field_editor.html\n @@ -348,7 +350,7 @@ NETWORK:\n actor - vincent + zope comment @@ -362,7 +364,7 @@ NETWORK:\n serial - 964.48513.5538.10342 + 966.44456.34486.30566 state @@ -380,7 +382,7 @@ NETWORK:\n - 1516115771.45 + 1532963989.74 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_drive_app_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_drive_app_appcache.xml index 1d2c7f73533..578682209d0 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_drive_app_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_drive_app_appcache.xml @@ -185,6 +185,8 @@ gadget_html5_element.html\n gadget_html5_element.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_field_string.html\n gadget_erp5_field_string.js\n gadget_erp5_field_editor.html\n @@ -352,7 +354,7 @@ NETWORK:\n actor - vincent + zope comment @@ -366,7 +368,7 @@ NETWORK:\n serial - 964.45561.47559.9591 + 966.44456.34486.30566 state @@ -384,7 +386,7 @@ NETWORK:\n - 1515771172.06 + 1532963940.17 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_illustration_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_illustration_appcache.xml index 9b132a0ad18..d0c81c9c6ca 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_illustration_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_illustration_appcache.xml @@ -182,6 +182,8 @@ gadget_html5_element.html\n gadget_html5_element.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_field_string.html\n gadget_erp5_field_string.js\n gadget_erp5_field_editor.html\n @@ -603,7 +605,7 @@ NETWORK:\n actor - vincent + zope comment @@ -617,7 +619,7 @@ NETWORK:\n serial - 964.58581.32438.37376 + 966.44456.34486.30566 state @@ -635,7 +637,7 @@ NETWORK:\n - 1518539910.86 + 1532963922.74 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js index 86be8d4f0b3..83157c03c05 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js @@ -1,6 +1,8 @@ +/*global window, rJS, jIO, FormData, UriTemplate */ + /*global window, rJS, jIO, FormData, UriTemplate */ /*jslint indent: 2, maxerr: 3 */ -(function (window, rJS, jIO) { +(function (window, rJS, jIO, RSVP) { "use strict"; // jIO call wrapper for redirection to authentication page if needed @@ -49,6 +51,11 @@ return gadget.redirect({ command: "row", url: site}); } } + if (error.hasOwnProperty("status_code") && error.status_code === 801) { + if (gadget.state_parameter_dict.jio_storage_name === "DROPBOX") { + throw error.message; + } + } throw error; }); } @@ -64,9 +71,21 @@ .declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod('getUrlFor', 'getUrlFor') - + .declareAcquiredMethod('popupshow', 'popupshow') .declareMethod('createJio', function (jio_options) { - var gadget = this; + var gadget = this, + utils = {"crypto_getCryptoKey": function (callback) { + return new RSVP.Queue() + .push(function () { + return gadget.popupshow({message: "Provide your password for dropbox encryption ", + addkey: callback.addkey_crypto, + error: callback.error_crypto }); + }) + .push(undefined, function (error) { + throw error; + }); + } + }; if (jio_options === undefined) { return; } @@ -76,7 +95,7 @@ property_list: ['modification_date'] }; try { - this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options); + this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options, utils); } catch (error) { this.state_parameter_dict.jio_storage = undefined; } @@ -116,4 +135,4 @@ return wrapJioCall(this, 'repair', arguments); }); -}(window, rJS, jIO)); \ No newline at end of file +}(window, rJS, jIO, RSVP)); \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml index df7055f795e..9380291ae1e 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml @@ -222,7 +222,7 @@ actor - vincent + zope comment @@ -236,7 +236,7 @@ serial - 962.36985.29761.10359 + 969.1654.46860.62464 state @@ -254,7 +254,7 @@ - 1507216488.77 + 1532081552.21 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt index 2dc3b36837c..b1653d7cd90 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.txt @@ -4,6 +4,7 @@ "use strict"; function setDropboxConfiguration(gadget, token) { + var keyid = "key" + Math.floor(Math.random() * 7000).toString(); return new RSVP.Queue() .push(function () { return RSVP.all([ @@ -34,8 +35,6 @@ check_remote_modification: true, check_remote_creation: true, check_remote_deletion: true, - parallel_operation_attachment_amount: 50, - parallel_operation_amount: 50, signature_sub_storage: { type: "query", sub_storage: { @@ -47,21 +46,12 @@ } }, local_sub_storage: { - type: "mapping", - attachment: { - DOCUMENT_REGEXP : { - get: {uri_template: 'enclosure'}, - put: {uri_template: 'enclosure'} - } - }, + type: "query", sub_storage: { - type: "query", + type: "uuid", sub_storage: { - type: "uuid", - sub_storage: { - type: "indexeddb", - database: "officejs-dropbox" - } + type: "indexeddb", + database: "officejs-dropbox" } } }, @@ -82,7 +72,7 @@ type: "drivetojiomapping", sub_storage: { type: "crypt", - key: 'amrani', + keyid: keyid, sub_storage: { type: "dropbox", access_token: token, diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml index 9afadb8e7dd..6f5cfdc4cc2 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_jio_dropbox_configurator_js.xml @@ -242,7 +242,7 @@ serial - 967.9063.45697.9454 + 968.63024.5682.53521 state @@ -260,7 +260,7 @@ - 1525334912.53 + 1531832487.77 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_appcache.xml index 3156739d900..82d4d1e90a7 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_pdf_viewer_appcache.xml @@ -182,6 +182,8 @@ gadget_html5_element.html\n gadget_html5_element.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_field_string.html\n gadget_erp5_field_string.js\n gadget_erp5_field_editor.html\n @@ -575,7 +577,7 @@ NETWORK:\n actor - vincent + zope comment @@ -589,7 +591,7 @@ NETWORK:\n serial - 964.54546.48173.5239 + 966.44456.34486.30566 state @@ -607,7 +609,7 @@ NETWORK:\n - 1516026588.79 + 1532963871.52 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_appcache.xml index d8e84e38401..4089f50e28a 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_text_editor_appcache.xml @@ -159,8 +159,8 @@ 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_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_page_ojs_sync.html\n gadget_erp5_page_ojs_sync.js\n gadget_erp5_page_ojs_document_list.html\n @@ -685,7 +685,7 @@ NETWORK:\n actor - vincent + zope comment @@ -699,7 +699,7 @@ NETWORK:\n serial - 964.48519.41997.58350 + 967.34686.32911.56883 state @@ -717,7 +717,7 @@ NETWORK:\n - 1515675473.77 + 1532944919.09 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.js index 56d3264f679..bd7ac9b0e41 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.js +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.js @@ -178,9 +178,10 @@ } } - function MappingStorage(spec) { + function MappingStorage(spec, utils) { + this.utils = utils; this._mapping_dict = spec.property || {}; - this._sub_storage = jIO.createJIO(spec.sub_storage); + this._sub_storage = jIO.createJIO(spec.sub_storage, utils); this._map_all_property = spec.map_all_property !== undefined ? spec.map_all_property : true; this._no_sub_query_id = spec.no_sub_query_id; @@ -648,8 +649,9 @@ return doc; } - function DateUpdaterStorage(spec) { - this._sub_storage = jIO.createJIO(spec.sub_storage); + function DateUpdaterStorage(spec, utils) { + this.utils = utils; + this._sub_storage = jIO.createJIO(spec.sub_storage, utils); this._property_list = spec.property_list || []; } @@ -726,8 +728,9 @@ */ - function SafeRepairStorage(spec) { - this._sub_storage = jIO.createJIO(spec.sub_storage); + function SafeRepairStorage(spec, utils) { + this.utils = utils; + this._sub_storage = jIO.createJIO(spec.sub_storage, utils); this._id_dict = {}; } diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.xml index d778db422dd..6b872b3aa9d 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/jio_ojs_storage_js.xml @@ -228,7 +228,7 @@ actor - vincent + zope comment @@ -242,7 +242,7 @@ serial - 962.45923.44376.29252 + 966.44456.34486.30566 state @@ -260,7 +260,7 @@ - 1507730215.96 + 1530609994.82 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_wallsearch_appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_wallsearch_appcache.xml index 6e5c1bc50a7..394e83c4b60 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_wallsearch_appcache.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_wallsearch_appcache.xml @@ -175,6 +175,8 @@ gadget_html5_element.html\n gadget_html5_element.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_field_string.html\n gadget_erp5_field_string.js\n gadget_erp5_field_editor.html\n @@ -326,7 +328,7 @@ NETWORK:\n actor - vincent + zope comment @@ -340,7 +342,7 @@ NETWORK:\n serial - 964.45561.47559.9591 + 966.44456.34486.30566 state @@ -358,7 +360,7 @@ NETWORK:\n - 1515773947.57 + 1532963857.09 UTC -- 2.30.9 From bd8aed5e9b747c6385ab2bb6144c9df8b86c65fa Mon Sep 17 00:00:00 2001 From: amrani Date: Tue, 31 Jul 2018 10:25:24 +0000 Subject: [PATCH 3/3] Added support for POPUP gadget in launcher --- .../rjs_gadget_erp5_appcache.xml | 6 +- .../rjs_gadget_erp5_launcher_html.html | 4 + .../rjs_gadget_erp5_launcher_html.xml | 4 +- .../rjs_gadget_erp5_launcher_js.js | 6 + .../rjs_gadget_erp5_launcher_js.xml | 4 +- .../erp5_web_renderjs_ui/erp5css.less.txt | 119 +++++++++++++++--- 6 files changed, 123 insertions(+), 20 deletions(-) diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml index b0a00a27fa4..6e5dcb06d0f 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml @@ -182,6 +182,8 @@ gadget_erp5_label_field.html\n gadget_erp5_label_field.js\n gadget_erp5_notification.html\n gadget_erp5_notification.js\n +gadget_erp5_popup.html\n +gadget_erp5_popup.js\n gadget_erp5_page_action.html\n gadget_erp5_page_action.js\n gadget_erp5_page_export.html\n @@ -386,7 +388,7 @@ NETWORK:\n serial - 965.19284.27735.63931 + 969.16049.29484.11946 state @@ -404,7 +406,7 @@ NETWORK:\n - 1517844236.51 + 1532944412.48 UTC diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html index af9cdbabb14..2ff1dc1f4f1 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html @@ -44,6 +44,10 @@ data-gadget-scope="notification" data-gadget-sandbox="public"> +
+
diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml index 841f8a5dd3f..989f12490c7 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml @@ -236,7 +236,7 @@
serial - 965.19244.9866.14694 + 968.54671.14652.65092 state @@ -254,7 +254,7 @@ - 1517843980.1 + 1531350333.5 UTC diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js index c8bdf623492..7e6f7b82638 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js @@ -374,6 +374,12 @@ ]); }) + .allowPublicAcquisition('popupshow', function (argument_list) { + return RSVP.all([ + route(this, "popup", 'display_popup', argument_list) + ]); + }) + .allowPublicAcquisition('isDesktopMedia', function (argument_list) { return window.matchMedia("(min-width: 85em)").matches; }) diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml index 52e32e56e99..c9d5bf583f1 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml @@ -230,7 +230,7 @@ serial - 966.11431.6711.50466 + 968.55010.57056.26112 state @@ -248,7 +248,7 @@ - 1521043696.52 + 1531350348.55 UTC diff --git a/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt b/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt index db80b68b0d4..205d24b3148 100644 --- a/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt +++ b/bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/erp5css.less.txt @@ -997,9 +997,6 @@ div[data-gadget-scope='header'] .ui-header { @media @desktop { .renderDesktopSubLink(); } - &.ui-icon-warning { - background-color: @coloraccent; - } } } @@ -1492,11 +1489,6 @@ div[data-gadget-scope='header'] .ui-header { } } - .ui-icon-warning { - color: @coloraccent; - // Link is disabled in this case - opacity: 1; - } } /********************************************** @@ -1524,9 +1516,107 @@ div[data-gadget-scope='header'] .ui-header { } } +/********************************************** +* POPUP +**********************************************/ +@color_1: #FFFFFF; +@color_2: #ffffff; +@background_color_1: rgba(0,0,0,0.5); +@background_color_2: rgba(255, 255, 255, 1); +@background_color_3: #f4511e; +@background_color_4: #085078; + +@keyframes overlayanimation { + 0% { + margin-left: 100%; + transform: translateX(0%); + } + 100% { + margin-left: 50%; + transform: translateX(-50%); + } +} +@media screen and (min-width: 320px) and (max-width: 400px) { + div[data-gadget-scope='popup'] { + div.overlay { + width: 320px; + } + } +} +@media screen and (min-width: 400px) { + div[data-gadget-scope='popup'] { + div.overlay { + width: 400px; + } + } +} +div[data-gadget-scope='popup'] { + background-color: @background_color_1; + visibility: hidden; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; + text-align: center; + z-index: 99998; + div.overlay { + margin: 100px auto; + padding: 0px; + padding-top: 0px; + text-align: center; + background-color: @background_color_2; + border: 1px solid #111111; + box-shadow: 2px 2px 40px #222; + animation: overlayanimation 0.2s ease-out; + } + form { + width: auto; + height: auto; + margin: 0 auto; + padding: 10px; + padding-top: 0px; + position: relative; + } + button { + display: inline-block; + background-color: @background_color_3; + border: none; + color: @color_1; + text-align: center; + font-size: 15px; + padding: 10px; + width: 100px; + cursor: pointer; + margin: 5px; + margin-top: 15px; + } + h3 { + font-size: 15px; + background-color: @background_color_4; + color: @color_2; + height: 30px; + line-height: 30px; + text-align: center; + border-bottom: 1px solid #000000; + } + span { + font-size: 45px; + overflow: hidden; + } +} +div[data-gadget-scope='popup'].visible { + visibility: visible; +} + + + /********************************************** * Listbox **********************************************/ + div[data-gadget-scope='erp5_searchfield'] { padding-top: @margin-size; @@ -1904,9 +1994,6 @@ div[data-gadget-scope='notification'] { .ui-controlgroup-controls { button, a { .renderTabletHeaderButton(); - &.ui-icon-warning { - background-color: @coloraccent; - } } } @@ -1964,6 +2051,13 @@ div[data-gadget-scope='maximize'] button { } } +.ui-icon-warning { + background-color: @coloraccent !important; + &::before { + content: "\f071"; + } +} + .ui-icon-spinner { // Don't fade spinner opacity: 1; @@ -2306,9 +2400,6 @@ div[data-gadget-scope='maximize'] button { .ui-icon-eye-slash::before { content: "\f070"; } -.ui-icon-warning::before { - content: "\f071"; -} .ui-icon-low-vision::before { content: "\f2a8"; } -- 2.30.9