Commit 9791a957 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: jslint

parent c30c9dd9
...@@ -317,7 +317,8 @@ ...@@ -317,7 +317,8 @@
throw error; throw error;
}) })
.push(function (doc) { .push(function (doc) {
for (var key in setting_dict) { var key;
for (key in setting_dict) {
if (setting_dict.hasOwnProperty(key)) { if (setting_dict.hasOwnProperty(key)) {
if (!doc.hasOwnProperty(key) || if (!doc.hasOwnProperty(key) ||
doc[key] !== setting_dict[key]) { doc[key] !== setting_dict[key]) {
...@@ -942,34 +943,34 @@ ...@@ -942,34 +943,34 @@
navigator.serviceWorker navigator.serviceWorker
.register(service_worker_url) .register(service_worker_url)
.then(function (registration) { .then(function (registration) {
gadget.state.service_worker_registration = registration; gadget.state.service_worker_registration = registration;
}), }),
// Check when a new worker has been activated from another tab // Check when a new worker has been activated from another tab
// XXX Not promise based, but we do not want to add a new dependency // XXX Not promise based, but we do not want to add a new dependency
navigator.serviceWorker navigator.serviceWorker
.addEventListener('message', .addEventListener('message',
function handleMessage(event) { function handleMessage(event) {
if (event.data == 'claim') { if (event.data === 'claim') {
gadget.state.service_worker_claimed = true; gadget.state.service_worker_claimed = true;
} }
}) })
]); ]);
} }
}) })
.declareJob('deferServiceWorkerUpdate', .declareJob('deferServiceWorkerUpdate',
function deferServiceWorkerUpdate(registration) { function deferServiceWorkerUpdate(registration) {
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
// Delay service worker update, so that: // Delay service worker update, so that:
// * it does not slow down the current page rendering // * it does not slow down the current page rendering
// * it is not triggered too often if user click on multiple links // * it is not triggered too often if user click on multiple links
// * it is triggered only if the user browse the site // * it is triggered only if the user browse the site
return RSVP.delay(60000); return RSVP.delay(60000);
}) })
.push(function () { .push(function () {
return registration.update(); return registration.update();
}); });
}); });
}(window, document, RSVP, rJS, }(window, document, RSVP, rJS,
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.50747.28799.6519</string> </value> <value> <string>981.50758.795.2560</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>1581434645.85</float> <float>1581435244.54</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -124,10 +124,10 @@ ...@@ -124,10 +124,10 @@
}) })
.then(function (client_list) { .then(function (client_list) {
// Notify all clients that they can reload the page // Notify all clients that they can reload the page
var i, var j,
len = client_list.length; client_len = client_list.length;
for (i = 0; i < len; i += 1) { for (j = 0; j < client_len; j += 1) {
client_list[i].postMessage('claim'); client_list[j].postMessage('claim');
} }
}) })
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.50723.46947.51387</string> </value> <value> <string>981.50754.31879.22749</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>1581433826.93</float> <float>1581435049.45</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