-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupup.min.js
42 lines (42 loc) · 1.44 KB
/
upup.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! UpUp
//! version : 0.3.0
//! author : Tal Ater @TalAter
//! license : MIT
//! https://github.com/TalAter/UpUp
(function(a) {
"use strict";
var b = this,
c = navigator.serviceWorker;
if (!c) return b.UpUp = null, a;
var d = {
"service-worker-url": "./upup.sw.min.js"
},
e = true;
b.UpUp = {
start: function(a) {
this.addSettings(a), c.register(d["service-worker-url"], {
scope: "./"
}).then(function(a) {
e && console.log("Service worker registration successful with scope: %c" + a.scope, "font-weight: bold; color: #00f;"), (a.installing || c.controller).postMessage({
action: "set-settings",
settings: d
})
swRegistration = a;
initialiseUI();
}).catch(function(a) {
e && console.log("Service worker registration failed: %c" + a, "font-weight: bold; color: #00f;")
})
},
addSettings: function(b) {
b = b || {}, "string" == typeof b && (b = {
content: b
}), ["content", "content-url", "assets", "service-worker-url", "cache-version"].forEach(function(c) {
b[c] !== a && (d[c] = b[c])
})
},
debug: function(a) {
e = !(arguments.length > 0) || !!a
}
}
}).call(this);
//# sourceMappingURL=upup.min.js.map