Commit e1159379 authored by Vincent Bechu's avatar Vincent Bechu

erp5_officejs: add cribjs link in panel application

parent 19746a59
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<li><a href="#page=document_list" data-i18n="Document List">Document List</a></li> <li><a href="#page=document_list" data-i18n="Document List">Document List</a></li>
<li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li> <li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li>
<li><a href="#page=sync&auto_repair=true" data-i18n="Synchronization">Synchronization</a></li> <li><a href="#page=sync&auto_repair=true" data-i18n="Synchronization">Synchronization</a></li>
<li><a href="https://www.cribjs.com/#page=jio_crib_configurator&application_name={{app_name}}&communication_gadget={{location}}gadget_officejs_liberator.html" data-i18n="Edit Me">Edit Me</a></li>
</ul> </ul>
</div> </div>
</script> </script>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,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>957.4910.31194.16179</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>1486126948.54</float> <float>1486551848.79</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -66,9 +66,20 @@ ...@@ -66,9 +66,20 @@
key, key,
value, value,
i, i,
queue = gadget.translateHtml(panel_template_header() + panel_template_body({"location": window.location.origin + window.location.pathname})); queue = new RSVP.Queue()
.push(function () {
queue return gadget.getSetting("application_title", "");
})
.push(function (application_name) {
return gadget.translateHtml(
panel_template_header() + panel_template_body(
{
"location": window.location.origin + window.location.pathname,
"app_name": application_name
}
)
);
})
.push(function (my_translated_or_plain_html) { .push(function (my_translated_or_plain_html) {
gadget.props.jelement.html(my_translated_or_plain_html); gadget.props.jelement.html(my_translated_or_plain_html);
gadget.props.jelement.trigger("create"); gadget.props.jelement.trigger("create");
......
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>957.598.45791.65518</string> </value> <value> <string>957.11997.57654.14353</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -284,7 +284,7 @@ ...@@ -284,7 +284,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1485868259.98</float> <float>1486556869.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<li><a href="#page=bookmark_preference" data-i18n="Preferences">Preferences</a></li> <li><a href="#page=bookmark_preference" data-i18n="Preferences">Preferences</a></li>
<li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li> <li><a href="#page=jio_configurator" data-i18n="Storage Configuration">Storage Configuration</a></li>
<li><a href="#page=sync&auto_repair=true" data-i18n="Synchronize">Synchronize</a></li> <li><a href="#page=sync&auto_repair=true" data-i18n="Synchronize">Synchronize</a></li>
<li><a href="https://www.cribjs.com/#page=jio_crib_configurator&application_name=Bookmark Manager&communication_gadget={{location}}gadget_officejs_liberator.html" data-i18n="Edit Me">Edit Me</a></li> <li><a href="https://www.cribjs.com/#page=jio_crib_configurator&application_name={{app_name}}&communication_gadget={{location}}gadget_officejs_liberator.html" data-i18n="Edit Me">Edit Me</a></li>
</ul> </ul>
</div> </div>
</script> </script>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,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>957.575.7829.27238</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>1485866827.11</float> <float>1486556932.46</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script> <script src="jiodev.js" type="text/javascript"></script>
<script src="jio_mappingstorage.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_officejs_jio.js" type="text/javascript"></script> <script src="gadget_officejs_jio.js" type="text/javascript"></script>
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,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>
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>945.38462.10321.2167</string> </value> <value> <string>956.64903.6566.48281</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>1441645344.7</float> <float>1486545131.79</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"use strict"; "use strict";
function setjIODAVConfiguration(gadget) { function setjIODAVConfiguration(gadget) {
var dav_url = gadget.props.element.querySelector("input[name='dav_url']").value;
return gadget.getSetting("portal_type") return gadget.getSetting("portal_type")
.push(function (portal_type) { .push(function (portal_type) {
var old_date = new Date(), var old_date = new Date(),
...@@ -30,25 +31,52 @@ ...@@ -30,25 +31,52 @@
check_remote_creation: true, check_remote_creation: true,
check_remote_deletion: true, check_remote_deletion: true,
local_sub_storage: { local_sub_storage: {
type: "query", type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
sub_storage: { sub_storage: {
type: "uuid", type: "query",
sub_storage: { sub_storage: {
type: "indexeddb", type: "uuid",
database: "officejs-dav" sub_storage: {
type: "indexeddb",
database: "officejs-dav"
}
} }
} }
}, },
remote_sub_storage: { remote_sub_storage: {
type: "query", type: "mapping",
attachment: {
'data': {
get: {uri_template: 'enclosure'},
put: {uri_template: 'enclosure'}
}
},
sub_storage: { sub_storage: {
type: "drivetojiomapping", type: "query",
sub_storage: { sub_storage: {
type: "dav", type: "drivetojiomapping",
url: gadget.props.element.querySelector("input[name='dav_url']").value, sub_storage: {
basic_login: btoa(gadget.props.element.querySelector("input[name='dav_username']").value type: "mapping",
+ ':' + gadget.props.element.querySelector("input[name='dav_password']").value), property: {
with_credentials: true "portal_type": [
"switchPropertyValue",
{"PDF":"pdf", "Web Page": "txt"}
]
},
sub_storage: {
type: "dav",
url: gadget.props.element.querySelector("input[name='dav_url']").value,
basic_login: btoa(gadget.props.element.querySelector("input[name='dav_username']").value
+ ':' + gadget.props.element.querySelector("input[name='dav_password']").value),
with_credentials: true
}
}
} }
} }
} }
...@@ -58,6 +86,9 @@ ...@@ -58,6 +86,9 @@
.push(function () { .push(function () {
return gadget.setSetting('jio_storage_name', "DAV"); return gadget.setSetting('jio_storage_name', "DAV");
}) })
.push(function () {
return gadget.setGlobalSetting('dav_url', dav_url);
})
.push(function () { .push(function () {
return gadget.setSetting('sync_reload', true); return gadget.setSetting('sync_reload', true);
}) })
...@@ -92,6 +123,20 @@ ...@@ -92,6 +123,20 @@
.declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("getGlobalSetting", function (key) {
var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget")
.push(function (global_setting_gadget) {
return global_setting_gadget.getSetting(key);
});
})
.declareMethod("setGlobalSetting", function (key, value) {
var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget")
.push(function (global_setting_gadget) {
return global_setting_gadget.setSetting(key, value);
});
})
.declareMethod("render", function () { .declareMethod("render", function () {
var gadget = this; var gadget = this;
return gadget.updateHeader({ return gadget.updateHeader({
...@@ -123,7 +168,39 @@ ...@@ -123,7 +168,39 @@
} }
); );
}); });
}); })
.declareService(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.props.deferred.promise;
})
.push(function () {
return gadget.getSetting("global_setting_gadget_url");
})
.push(function (global_setting_gadget_url) {
return gadget.declareGadget(
global_setting_gadget_url,
{
scope: "global_setting_gadget",
sandbox: "iframe",
element: gadget.props.element.querySelector(".global_setting_gadget")
}
);
})
.push(function (global_setting_gadget) {
return global_setting_gadget.getSetting("dav_url");
})
.push(function (dav_url) {
var erp5_url_input =
gadget.props.element.querySelector("input[name='dav_url']");
erp5_url_input.value = dav_url || "https://www.example.com";
erp5_url_input.removeAttribute("disabled");
erp5_url_input.parentNode.classList.remove('ui-state-disabled');
erp5_url_input.focus();
});
});
}(window, rJS, RSVP)); }(window, rJS, RSVP));
\ No newline at end of file
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1486042968.05</float> <float>1486545798.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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