Unified · Split
| @@ -265,7 +265,7 @@ app.DB = class DB { · 264 unmodified lines | ||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | version(doc, fn) { |
| 268 | − let version = this.cachedVersion(doc); | |
| 268 | + const version = this.cachedVersion(doc); | |
| 269 | 269 | if (version != null) { |
| 270 | 270 | fn(version); |
| 271 | 271 | return; |
| @@ -302,7 +302,7 @@ app.DB = class DB { · 30 unmodified lines | ||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | versions(docs, fn) { |
| 305 | − let versions = this.cachedVersions(docs); | |
| 305 | + const versions = this.cachedVersions(docs); | |
| 306 | 306 | if (versions) { |
| 307 | 307 | fn(versions); |
| 308 | 308 | return; |
| @@ -324,7 +324,7 @@ app.DB = class DB { · 15 unmodified lines | ||
| 324 | 324 | const store = txn.objectStore("docs"); |
| 325 | 325 | var result = {}; |
| 326 | 326 | |
| 327 | − docs.forEach(function (doc) { | |
| 327 | + docs.forEach((doc) => { | |
| 328 | 328 | const req = store.get(doc.slug); |
| 329 | 329 | req.onsuccess = function () { |
| 330 | 330 | result[doc.slug] = req.result; |
| @@ -21,7 +21,7 @@ app.ServiceWorker = class ServiceWorker extends Events { · 20 unmodified lines | ||
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | this.notifyUpdate = true; |
| 24 | − return this.registration.update().catch(function () {}); | |
| 24 | + return this.registration.update().catch(() => {}); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | updateInBackground() { |
| @@ -29,7 +29,7 @@ app.ServiceWorker = class ServiceWorker extends Events { · 1 unmodified line | ||
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | this.notifyUpdate = false; |
| 32 | − return this.registration.update().catch(function () {}); | |
| 32 | + return this.registration.update().catch(() => {}); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | reload() { |
| @@ -13,7 +13,7 @@ app.collections.Docs = class Docs extends app.Collection { · 12 unmodified lines | ||
| 13 | 13 | ); |
| 14 | 14 | } |
| 15 | 15 | sort() { |
| 16 | − return this.models.sort(function (a, b) { | |
| 16 | + return this.models.sort((a, b) => { | |
| 17 | 17 | if (a.name === b.name) { |
| 18 | 18 | if ( |
| 19 | 19 | !a.version || |
| @@ -81,7 +81,7 @@ app.collections.Docs = class Docs extends app.Collection { · 61 unmodified lines | ||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | getInstallStatuses(callback) { |
| 84 | − app.db.versions(this.models, function (statuses) { | |
| 84 | + app.db.versions(this.models, (statuses) => { | |
| 85 | 85 | if (statuses) { |
| 86 | 86 | for (var key in statuses) { |
| 87 | 87 | var value = statuses[key]; |
| @@ -34,7 +34,7 @@ class Events { · 33 unmodified lines | ||
| 34 | 34 | this.eventInProgress = { name: event, args }; |
| 35 | 35 | const callbacks = this._callbacks?.[event]; |
| 36 | 36 | if (callbacks) { |
| 37 | − for (let callback of callbacks.slice(0)) { | |
| 37 | + for (const callback of callbacks.slice(0)) { | |
| 38 | 38 | if (typeof callback === "function") { |
| 39 | 39 | callback(...args); |
| 40 | 40 | } |
| @@ -215,7 +215,7 @@ var pathToRegexp = function (path, keys) { · 214 unmodified lines | ||
| 215 | 215 | .replace(/\/\(/g, "(?:/") |
| 216 | 216 | .replace( |
| 217 | 217 | /(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, |
| 218 | − function (_, slash, format, key, capture, optional) { | |
| 218 | + (_, slash, format, key, capture, optional) => { | |
| 219 | 219 | if (slash == null) { |
| 220 | 220 | slash = ""; |
| 221 | 221 | } |
| @@ -58,7 +58,7 @@ app.views.Document = class Document extends app.View { · 57 unmodified lines | ||
| 58 | 58 | if (this.el.visibilityState !== "visible") { |
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | − this.delay(function () { | |
| 61 | + this.delay(() => { | |
| 62 | 62 | if (app.isMobile() !== app.views.Mobile.detect()) { |
| 63 | 63 | location.reload(); |
| 64 | 64 | } |
| @@ -72,7 +72,7 @@ app.views.Settings = class Settings extends app.View { · 71 unmodified lines | ||
| 72 | 72 | return result; |
| 73 | 73 | })(), |
| 74 | 74 | ); |
| 75 | − disabledDocs.uninstall(function () { | |
| 75 | + disabledDocs.uninstall(() => { | |
| 76 | 76 | app.db.migrate(); |
| 77 | 77 | return app.reload(); |
| 78 | 78 | }); |
| @@ -18,7 +18,7 @@ app.views.News = class News extends app.views.Notif { · 17 unmodified lines | ||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | getUnreadNews() { |
| 21 | − let time = this.getLastReadTime(); | |
| 21 | + const time = this.getLastReadTime(); | |
| 22 | 22 | if (!time) { |
| 23 | 23 | return []; |
| 24 | 24 | } |
| @@ -207,7 +207,7 @@ app.views.Search = class Search extends app.View { · 206 unmodified lines | ||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | extractHashValue() { |
| 210 | − let value = this.getHashValue(); | |
| 210 | + const value = this.getHashValue(); | |
| 211 | 211 | if (value != null) { |
| 212 | 212 | app.router.replaceHash(); |
| 213 | 213 | return value; |