-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathlg_update.js
More file actions
34 lines (28 loc) · 957 Bytes
/
lg_update.js
File metadata and controls
34 lines (28 loc) · 957 Bytes
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
(function () {
'use strict';
function startPlugin() {
window.lg_update_plugin = true;
var src = 'http://lampa.mx/';
var network = new Lampa.Reguest();
network.clear();
network.timeout(1000 * 30);
network.silent(src + 'app.min.js?v=lg_update', function (app) {
var old = window.localStorage.getItem('app.js');
if (old != app) {
window.localStorage.setItem('app.js', app);
Lampa.Noty.show('LG Update: OK. Reboot Lampa');
}
var old_css = $('link[href="css/app.css"]');
if (old_css.length) {
Lampa.Utils.putStyle([src + 'css/app.css?v=lg_update'], function () {
old_css.remove();
}, function () {});
}
}, function (a, c) {
Lampa.Noty.show('LG Update: ' + network.errorDecode(a, c));
}, false, {
dataType: 'text'
});
}
if (!window.lg_update_plugin) startPlugin();
})();