1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 17:31:00 +01:00

Better organize auto-update options

This commit is contained in:
Fredrick Brennan 2015-03-15 17:40:27 +08:00
parent 8aad0dea98
commit aee9cd8455
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ $(document).ready(function(){
localStorage.auto_thread_update = 'true'; //default value
}
if (window.Options && Options.get_tab('general')) {
Options.extend_tab("general", "<fieldset><legend>"+_("Auto update")+"</legend>"
Options.extend_tab("general", "<fieldset id='auto-update-fs'><legend>"+_("Auto update")+"</legend>"
+ ('<label id="auto-thread-update"><input type="checkbox">' + _('Auto update thread') + '</label>')
+ ('<label id="auto_thread_desktop_notifications"><input type="checkbox">' + _('Show desktop notifications when users quote me') + '</label>')
+ ('<label id="auto_thread_desktop_notifications_all"><input type="checkbox">' + _('Show desktop notifications on all replies') + '</label>')

View File

@ -1,7 +1,7 @@
$('document').ready(function () {
var autoScroll = localStorage['autoScroll'] ? true : false;
if (window.Options && Options.get_tab('general')){
Options.extend_tab('general','<label id=\'autoScroll\'><input type=\'checkbox\' />' + ' Scroll to new posts' + '</label>');
$('#auto-update-fs').append('<label id=\'autoScroll\'><input type=\'checkbox\' />' + _('Scroll to new posts') + '</label>');
$('#autoScroll').find('input').prop('checked', autoScroll);
}
$('#autoScroll').on('change', function() {
@ -15,7 +15,7 @@ $('document').ready(function () {
$('input.auto-scroll').prop('checked', autoScroll);
});
if (active_page == 'thread') {
$('span[id="updater"]').children('a').after(' (<input class="auto-scroll" type="checkbox"></input> Scroll to New posts)');
$('span[id="updater"]').children('a').after(' (<input class="auto-scroll" type="checkbox"></input> '+_('Scroll to new posts')+')');
$('input.auto-scroll').prop('checked', autoScroll);
$(document).on('new_post', function (e, post) {
if ($('input.auto-scroll').prop('checked'))