|
@ -2,10 +2,10 @@ $.when( $.ready ).then(function() { |
|
|
|
|
|
|
|
|
if($('.message-container').length) { |
|
|
if($('.message-container').length) { |
|
|
setTimeout( |
|
|
setTimeout( |
|
|
function() |
|
|
function() |
|
|
{ |
|
|
{ |
|
|
$('.message-container').fadeOut(); |
|
|
$('.message-container').fadeOut(); |
|
|
}, 3500); |
|
|
}, 3500); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if($('.livestats-container').length) { |
|
|
if($('.livestats-container').length) { |
|
@ -18,21 +18,21 @@ $.when( $.ready ).then(function() { |
|
|
var timer = 5000; |
|
|
var timer = 5000; |
|
|
(function worker() { |
|
|
(function worker() { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: '/get_stats/'+id, |
|
|
url: '/get_stats/'+id, |
|
|
dataType: 'json', |
|
|
dataType: 'json', |
|
|
success: function(data) { |
|
|
success: function(data) { |
|
|
container.html(data.html); |
|
|
container.html(data.html); |
|
|
if(data.status == 'active') timer = increaseby; |
|
|
if(data.status == 'active') timer = increaseby; |
|
|
else { |
|
|
else { |
|
|
if(timer < max_timer) timer += 2000; |
|
|
if(timer < max_timer) timer += 2000; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
complete: function() { |
|
|
complete: function() { |
|
|
// Schedule the next request when the current one's complete
|
|
|
// Schedule the next request when the current one's complete
|
|
|
setTimeout(worker, timer); |
|
|
setTimeout(worker, timer); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
})(); |
|
|
})(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -40,20 +40,20 @@ $.when( $.ready ).then(function() { |
|
|
function readURL(input) { |
|
|
function readURL(input) { |
|
|
|
|
|
|
|
|
if (input.files && input.files[0]) { |
|
|
if (input.files && input.files[0]) { |
|
|
var reader = new FileReader(); |
|
|
var reader = new FileReader(); |
|
|
|
|
|
|
|
|
reader.onload = function(e) { |
|
|
reader.onload = function(e) { |
|
|
$('#appimage img').attr('src', e.target.result); |
|
|
$('#appimage img').attr('src', e.target.result); |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
reader.readAsDataURL(input.files[0]); |
|
|
reader.readAsDataURL(input.files[0]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$("#upload").change(function() { |
|
|
$('#upload').change(function() { |
|
|
readURL(this); |
|
|
readURL(this); |
|
|
}); |
|
|
}); |
|
|
/*$(".droppable").droppable({ |
|
|
/*$(".droppable").droppable({ |
|
|
tolerance: "intersect", |
|
|
tolerance: "intersect", |
|
|
drop: function( event, ui ) { |
|
|
drop: function( event, ui ) { |
|
|
var tag = $( this ).data('id'); |
|
|
var tag = $( this ).data('id'); |
|
@ -70,9 +70,9 @@ $.when( $.ready ).then(function() { |
|
|
} |
|
|
} |
|
|
});*/ |
|
|
});*/ |
|
|
|
|
|
|
|
|
$( "#sortable" ).sortable({ |
|
|
$( '#sortable' ).sortable({ |
|
|
stop: function (event, ui) { |
|
|
stop: function (event, ui) { |
|
|
var idsInOrder = $("#sortable").sortable('toArray', { |
|
|
var idsInOrder = $('#sortable').sortable('toArray', { |
|
|
attribute: 'data-id' |
|
|
attribute: 'data-id' |
|
|
}); |
|
|
}); |
|
|
$.post( |
|
|
$.post( |
|
@ -82,7 +82,7 @@ $.when( $.ready ).then(function() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
$("#sortable").sortable("disable"); |
|
|
$('#sortable').sortable('disable'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -95,15 +95,13 @@ $.when( $.ready ).then(function() { |
|
|
$('.add-item').hide(); |
|
|
$('.add-item').hide(); |
|
|
$('.item-edit').hide(); |
|
|
$('.item-edit').hide(); |
|
|
$('#app').removeClass('sidebar'); |
|
|
$('#app').removeClass('sidebar'); |
|
|
$("#sortable").sortable("disable") |
|
|
$('#sortable').sortable('disable'); |
|
|
} else { |
|
|
} else { |
|
|
$("#sortable").sortable("enable") |
|
|
$('#sortable').sortable('enable'); |
|
|
setTimeout( |
|
|
setTimeout(function() { |
|
|
function() |
|
|
$('.add-item').fadeIn(); |
|
|
{ |
|
|
$('.item-edit').fadeIn(); |
|
|
$('.add-item').fadeIn(); |
|
|
}, 350); |
|
|
$('.item-edit').fadeIn(); |
|
|
|
|
|
}, 350); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}).on('click', '#add-item, #pin-item', function(e) { |
|
|
}).on('click', '#add-item, #pin-item', function(e) { |
|
@ -121,24 +119,21 @@ $.when( $.ready ).then(function() { |
|
|
e.preventDefault(); |
|
|
e.preventDefault(); |
|
|
var apiurl = $('#create input[name=url]').val(); |
|
|
var apiurl = $('#create input[name=url]').val(); |
|
|
|
|
|
|
|
|
|
|
|
var override_url = $('#create input[name="config[override_url]"').val(); |
|
|
var override_url = $('#override_url'); |
|
|
if(override_url.length && override_url != '') { |
|
|
if(override_url.length && override_url.val() != '') { |
|
|
|
|
|
apiurl = override_url; |
|
|
apiurl = override_url; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var data = {}; |
|
|
var data = {}; |
|
|
data['url'] = apiurl; |
|
|
data['url'] = apiurl; |
|
|
$('input.config-item').each(function(index){ |
|
|
$('input.config-item').each(function(index){ |
|
|
var config = $(this).data('config'); |
|
|
var config = $(this).data('config'); |
|
|
data[config] = $(this).val(); |
|
|
data[config] = $(this).val(); |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
$.post( |
|
|
$.post('/test_config', { data }, function(data) { |
|
|
'/test_config', |
|
|
alert(data); |
|
|
{ data }, function(data) { |
|
|
}); |
|
|
alert(data); |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
$('#pinlist').on('click', 'a', function(e) { |
|
|
$('#pinlist').on('click', 'a', function(e) { |
|
|