- 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/
This commit is contained in:
Alex Ling
2020-02-16 03:19:29 +00:00
parent 08a1052ca4
commit 93e6d7cae6
9 changed files with 176 additions and 78 deletions
+1 -27
View File
@@ -14,31 +14,5 @@
<a class="uk-button uk-button-danger" href="/logout">Log Out</a>
<% content_for "script" do %>
<script>
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)
}
});
});
</script>
<script src="/js/admin.js"></script>
<% end %>