Skip to content

TagSpaces is an offline, open source, document manager with tagging support

update

kristiyandd04ca743b7842
diff --git a/data/web/web.api.js b/data/web/web.api.js
index 4713fb1a7..e88e8541d 100644
--- a/data/web/web.api.js
+++ b/data/web/web.api.js
@@ -47,33 +47,33 @@ define(function(require, exports, module) {
// });
//});
- //var run = function() {
- //
- // //var req = new XMLHttpRequest();
- // //req.timeout = 5000;
- // //req.open('GET', 'http://localhost:8001', true);
- // //req.send();
- //
- // if (Offline.state === 'up') {
- // Offline.check();
- // Offline.on('up', function() {
- // //connection is back!
- // $online.fadeOut(function() {
- // $offline.fadeIn();
- // });
- // });
- // } else if (Offline.state === 'down') {
- // Offline.on('down', function() {
- // Offline.getOption("checkOnLoad") ? Offline.check() : void 0;
- // //connection went down
- // $offline.fadeOut(function() {
- // $online.fadeIn();
- // });
- // });
- // console.log("offline state is down");
- // }
- //};
- //setInterval(run, 3000);
+ var run = function() {
+
+ var req = new XMLHttpRequest();
+ req.timeout = 5000;
+ req.open('GET', 'http://localhost:8001', true);
+ req.send();
+
+ if (Offline.state === 'up') {
+ Offline.check();
+ Offline.on('up', function() {
+ //connection is back!
+ $online.fadeOut(function() {
+ $offline.fadeIn();
+ });
+ });
+ } else if (Offline.state === 'down') {
+ Offline.on('down', function() {
+ Offline.getOption("checkOnLoad") ? Offline.check() : void 0;
+ //connection went down
+ $offline.fadeOut(function() {
+ $online.fadeIn();
+ });
+ });
+ console.log("offline state is down");
+ }
+ };
+ setInterval(run, 3000);
Offline.on('down', function() {
//connection went down