Commit 051678be authored by Roque's avatar Roque Committed by Roque

erp5_officejs: replace multiple setSetting calls by setSettingList to

speedup
parent 7e2fac60
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
.declareAcquiredMethod("notifySubmitted", "notifySubmitted") .declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSettingList", "getSettingList") .declareAcquiredMethod("getSettingList", "getSettingList")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSettingList", "setSettingList")
.declareAcquiredMethod('getUrlFor', 'getUrlFor') .declareAcquiredMethod('getUrlFor', 'getUrlFor')
.declareMethod('updateConfiguration', function (appcache_storage, origin_url, .declareMethod('updateConfiguration', function (appcache_storage, origin_url,
...@@ -125,10 +125,8 @@ ...@@ -125,10 +125,8 @@
return appcache_storage.repair(current_version); return appcache_storage.repair(current_version);
}) })
.push(function () { .push(function () {
return gadget.setSetting("migration_version", current_version); return gadget.setSettingList({"migration_version": current_version,
}) "previous_storage_name": storage_name});
.push(function () {
return gadget.setSetting("previous_storage_name", storage_name);
}); });
}) })
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.7652.21916.23961</string> </value> <value> <string>980.6859.48060.59835</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1571071046.04</float> <float>1574956293.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -32,13 +32,9 @@ ...@@ -32,13 +32,9 @@
} }
} }
}; };
return gadget.setSetting('jio_storage_description', configuration) return gadget.setSettingList({'jio_storage_description': configuration,
.push(function () { 'jio_storage_name': 'LOCAL',
return gadget.setSetting('jio_storage_name', "LOCAL"); 'sync_reload': true})
})
.push(function () {
return gadget.setSetting('sync_reload', true);
})
.push(function () { .push(function () {
return gadget.redirect({command: "display", options: {page: 'ojs_sync', auto_repair: 'true'}}); return gadget.redirect({command: "display", options: {page: 'ojs_sync', auto_repair: 'true'}});
}); });
...@@ -97,8 +93,8 @@ ...@@ -97,8 +93,8 @@
.declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSettingList", "setSettingList")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this; var gadget = this;
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.27141.2695.3276</string> </value> <value> <string>980.6862.7827.1604</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1545233718.42</float> <float>1574956283.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
var gadget_klass = rJS(window) var gadget_klass = rJS(window)
.declareAcquiredMethod('setSetting', 'setSetting') .declareAcquiredMethod('setSettingList', 'setSettingList')
.declareMethod('redirect', function (param_list) { .declareMethod('redirect', function (param_list) {
return this.getDeclaredGadget('erp5_router') return this.getDeclaredGadget('erp5_router')
...@@ -50,21 +50,19 @@ ...@@ -50,21 +50,19 @@
key, key,
value, value,
i, i,
setting_dict = {},
queue = new RSVP.Queue(); queue = new RSVP.Queue();
function setSetting(key, value) {
queue.push(function () {
return gadget.setSetting(key, value);
});
}
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
key = element_list[i].getAttribute('data-renderjs-configuration'); key = element_list[i].getAttribute('data-renderjs-configuration');
value = element_list[i].textContent; value = element_list[i].textContent;
setSetting(key, value); setting_dict[key] = value;
} }
return queue return queue
.push(function () {
return gadget.setSettingList(setting_dict);
})
.push(function () { .push(function () {
return gadget.getDeclaredGadget('erp5_router'); return gadget.getDeclaredGadget('erp5_router');
}) })
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>967.24634.17714.15001</string> </value> <value> <string>980.6802.7091.54510</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1526889176.44</float> <float>1574952936.12</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