Commit fdc2737c authored by Boris Kocherov's avatar Boris Kocherov Committed by Boris Kocherov

erp5_officejs: jslint cleanup

parent b175dc91
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
} }
} }
if ('serviceWorker' in navigator) { if (navigator.serviceWorker !== undefined) {
// importatant register service worker // importatant register service worker
// for client reconnect if url change // for client reconnect if url change
queue.push(function () { queue.push(function () {
...@@ -271,16 +271,15 @@ ...@@ -271,16 +271,15 @@
if (options !== undefined && options.toExternal) { if (options !== undefined && options.toExternal) {
window.location.replace(options.url); window.location.replace(options.url);
return RSVP.timeout(REDIRECT_TIMEOUT); // timeout if not redirected return RSVP.timeout(REDIRECT_TIMEOUT); // timeout if not redirected
} else {
return this.getCommandUrlFor(options)
.push(function (hash) {
window.location.replace(hash);
// prevent returning unexpected response
// wait for the hash change to occur
// fail if nothing happens
return RSVP.timeout(REDIRECT_TIMEOUT);
});
} }
return this.getCommandUrlFor(options)
.push(function (hash) {
window.location.replace(hash);
// prevent returning unexpected response
// wait for the hash change to occur
// fail if nothing happens
return RSVP.timeout(REDIRECT_TIMEOUT);
});
}) })
.declareMethod('route', function (options) { .declareMethod('route', function (options) {
...@@ -356,7 +355,7 @@ ...@@ -356,7 +355,7 @@
return gadget.props.start_deferred.promise; return gadget.props.start_deferred.promise;
}) })
.push(function () { .push(function () {
if (('serviceWorker' in navigator) && (NAME !== "web page")) { if ((navigator.serviceWorker !== undefined) && (NAME !== "web page")) {
return gadget.getSetting('jio_' + NAME + '_modification_date') return gadget.getSetting('jio_' + NAME + '_modification_date')
.push(function (modification_date) { .push(function (modification_date) {
return gadget.getSetting('jio_' + NAME + '_cache_description') return gadget.getSetting('jio_' + NAME + '_cache_description')
...@@ -364,15 +363,14 @@ ...@@ -364,15 +363,14 @@
var jio_store = get_jio_replicate_storage(NAME); var jio_store = get_jio_replicate_storage(NAME);
if (jio_store.__storage._query_options.query === query && modification_date) { if (jio_store.__storage._query_options.query === query && modification_date) {
return get_jio_replicate_storage(NAME, modification_date).repair(); return get_jio_replicate_storage(NAME, modification_date).repair();
} else {
return gadget.setSetting(
'jio_' + NAME + '_cache_description',
jio_store.__storage._query_options.query
)
.push(function () {
return jio_store.repair();
});
} }
return gadget.setSetting(
'jio_' + NAME + '_cache_description',
jio_store.__storage._query_options.query
)
.push(function () {
return jio_store.repair();
});
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
// fix offline mode bypass network errors // fix offline mode bypass network errors
...@@ -380,9 +378,8 @@ ...@@ -380,9 +378,8 @@
error.srcElement instanceof XMLHttpRequest && error.srcElement instanceof XMLHttpRequest &&
error.type === "error") { error.type === "error") {
return {}; return {};
} else {
throw error;
} }
throw error;
}) })
.push(function () { .push(function () {
jIO.createJIO(get_jio_cache_storage(NAME)).allDocs({ jIO.createJIO(get_jio_cache_storage(NAME)).allDocs({
...@@ -411,13 +408,12 @@ ...@@ -411,13 +408,12 @@
return {}; return {};
}); });
}); });
} else {
return {};
} }
return {};
}) })
.push(function () { .push(function () {
return listenHashChange(gadget); return listenHashChange(gadget);
}); });
}); });
}(window, rJS)); }(window, rJS));
\ No newline at end of file
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.19276.22837.65433</string> </value> <value> <string>955.22065.61366.57770</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1479212571.34</float> <float>1479378360.51</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