|
@@ -36,33 +36,9 @@ function showDocument() {
|
|
$('head link.custom').attr('href',ret);
|
|
$('head link.custom').attr('href',ret);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- /*
|
|
|
|
- $.ajax({
|
|
|
|
- type: "GET",
|
|
|
|
- url: 'info.json',
|
|
|
|
- success: function(ret) {
|
|
|
|
- makeGrid(ret.x_amount, ret.y_amount);
|
|
|
|
- //set name
|
|
|
|
- document.title = ret.document_name;
|
|
|
|
- $.ajax({
|
|
|
|
- type: "GET",
|
|
|
|
- url: 'frames.json',
|
|
|
|
- success: function(ret2) {
|
|
|
|
- for (i of ret2.data) {
|
|
|
|
- makeFrame(i.lx,i.ly,i.rx,i.ry, i.url, i.callback, i.default, i.showbutton, i.style);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- error: function() {
|
|
|
|
- reason = '';
|
|
|
|
- clearDocument();
|
|
|
|
- }
|
|
|
|
- });*/
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function clearDocument() {
|
|
function clearDocument() {
|
|
- console.log('rrrr');
|
|
|
|
$('#languages').addClass('hidden');
|
|
$('#languages').addClass('hidden');
|
|
$('#nope').removeClass('hidden');
|
|
$('#nope').removeClass('hidden');
|
|
$('#control .added').remove();
|
|
$('#control .added').remove();
|
|
@@ -75,7 +51,6 @@ function init() {
|
|
es = new EventSource('sse/');
|
|
es = new EventSource('sse/');
|
|
es.onopen = function() {
|
|
es.onopen = function() {
|
|
getAllData();
|
|
getAllData();
|
|
- // load
|
|
|
|
};
|
|
};
|
|
es.onmessage = function(e) {
|
|
es.onmessage = function(e) {
|
|
console.log("Got SSE");
|
|
console.log("Got SSE");
|
|
@@ -105,6 +80,7 @@ function init() {
|
|
es.onerror = function() {
|
|
es.onerror = function() {
|
|
reason = 'Server down.';
|
|
reason = 'Server down.';
|
|
clearDocument();
|
|
clearDocument();
|
|
|
|
+ es.close();
|
|
setTimeout(init, 10000);
|
|
setTimeout(init, 10000);
|
|
};
|
|
};
|
|
}
|
|
}
|