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