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

erp5_web_renderjs_ui: jslint

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