Mango/public/js/admin.js
Alex Ling 93e6d7cae6 - option to resume/start from beginning at the title view
- option to toggle read/unread status at the title view
- move all embeded JS to public/
2020-02-16 03:19:29 +00:00

26 lines
701 B
JavaScript

var scanning = false;
function scan() {
scanning = true;
$('#scan-status > div').removeAttr('hidden');
$('#scan-status > span').attr('hidden', '');
var color = $('#scan').css('color');
$('#scan').css('color', 'gray');
$.post('/api/admin/scan', function (data) {
var ms = data.milliseconds;
var titles = data.titles;
$('#scan-status > span').text('Scanned ' + titles + ' titles in ' + ms + 'ms');
$('#scan-status > span').removeAttr('hidden');
$('#scan').css('color', color);
$('#scan-status > div').attr('hidden', '');
scanning = false;
});
}
$(function() {
$('li').click(function() {
url = $(this).attr('data-url');
if (url) {
$(location).attr('href', url);
}
});
});