diff --git a/CHANGELOG.md b/CHANGELOG.md index 2796a4f8f..23daac585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +seaweedchan: +- Add `Centered links` option for header +- Add `Persistent Thread Watcher` option + ### 1.1.15 - 2013-05-07 seaweedchan: - Fix update and download urls for Greasemonkey diff --git a/builds/appchan-x.js b/builds/appchan-x.js index d8da9312a..4b54f9337 100644 --- a/builds/appchan-x.js +++ b/builds/appchan-x.js @@ -186,6 +186,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], + 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -332,7 +333,6 @@ 'Fixed Header': true, 'Header auto-hide': false, 'Bottom Header': false, - 'Hide Header': false, 'Header catalog links': false, 'Bottom Board List': true, 'Custom Board Navigation': true @@ -3674,21 +3674,24 @@ }); this.barFixedToggler = barFixedToggler.firstElementChild; this.barPositionToggler = barPositionToggler.firstElementChild; + this.linkJustifyToggler = linkJustifyToggler.firstElementChild; this.headerToggler = headerToggler.firstElementChild; this.footerToggler = footerToggler.firstElementChild; this.customNavToggler = customNavToggler.firstElementChild; $.on(this.menuButton, 'click', this.menuToggle); $.on(this.barFixedToggler, 'change', this.toggleBarFixed); $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.headerToggler, 'change', this.toggleBarVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); + this.setLinkJustify(Conf['Centered links']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); - $.sync('Header auto-hide', Header.setBarVisibility); + $.sync('Centered links', Header.setLinkJustify); $.event('AddMenuEntry', { type: 'header', el: $.el('span', { @@ -14470,24 +14473,22 @@ } }, checkUpdate: function() { - var freq, items, now; + var now; if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { return; } now = Date.now(); - freq = 6 * $.HOUR; - items = { - lastupdate: 0, - lastchecked: 0 - }; - return $.get(items, function(items) { - if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) { + return $.get('lastchecked', 0, function(_arg) { + var lastchecked; + + lastchecked = _arg.lastchecked; + if (lastchecked > now - $.DAY) { return; } return $.ready(function() { $.on(window, 'message', Main.message); - $.set('lastUpdate', now); + $.set('lastchecked', now); return $.add(d.head, $.el('script', { src: 'https://github.com/zixaphir/appchan-x/raw/Av2/latest.js' })); diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 12cb66527..a805ad29b 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -186,6 +186,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], + 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -333,7 +334,6 @@ 'Fixed Header': true, 'Header auto-hide': false, 'Bottom Header': false, - 'Hide Header': false, 'Header catalog links': false, 'Bottom Board List': true, 'Custom Board Navigation': true @@ -3670,21 +3670,24 @@ }); this.barFixedToggler = barFixedToggler.firstElementChild; this.barPositionToggler = barPositionToggler.firstElementChild; + this.linkJustifyToggler = linkJustifyToggler.firstElementChild; this.headerToggler = headerToggler.firstElementChild; this.footerToggler = footerToggler.firstElementChild; this.customNavToggler = customNavToggler.firstElementChild; $.on(this.menuButton, 'click', this.menuToggle); $.on(this.barFixedToggler, 'change', this.toggleBarFixed); $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.headerToggler, 'change', this.toggleBarVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); + this.setLinkJustify(Conf['Centered links']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); - $.sync('Header auto-hide', Header.setBarVisibility); + $.sync('Centered links', Header.setLinkJustify); $.event('AddMenuEntry', { type: 'header', el: $.el('span', { @@ -14489,24 +14492,22 @@ } }, checkUpdate: function() { - var freq, items, now; + var now; if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { return; } now = Date.now(); - freq = 7 * $.DAY; - items = { - lastupdate: 0, - lastchecked: 0 - }; - return $.get(items, function(items) { - if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) { + return $.get('lastchecked', 0, function(_arg) { + var lastchecked; + + lastchecked = _arg.lastchecked; + if (lastchecked > now - $.DAY) { return; } return $.ready(function() { $.on(window, 'message', Main.message); - $.set('lastUpdate', now); + $.set('lastchecked', now); return $.add(d.head, $.el('script', { src: 'https://github.com/zixaphir/appchan-x/raw/Av2/latest.js' })); diff --git a/builds/crx/script.js b/builds/crx/script.js index 2c14a9ebb..ca9c5c410 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -168,6 +168,7 @@ 'Thread Stats': [true, 'Display reply and image count.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], + 'Persistent Thread Watcher': [false, 'Opens the thread watcher by default.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, @@ -314,7 +315,6 @@ 'Fixed Header': true, 'Header auto-hide': false, 'Bottom Header': false, - 'Hide Header': false, 'Header catalog links': false, 'Bottom Board List': true, 'Custom Board Navigation': true @@ -3672,21 +3672,24 @@ }); this.barFixedToggler = barFixedToggler.firstElementChild; this.barPositionToggler = barPositionToggler.firstElementChild; + this.linkJustifyToggler = linkJustifyToggler.firstElementChild; this.headerToggler = headerToggler.firstElementChild; this.footerToggler = footerToggler.firstElementChild; this.customNavToggler = customNavToggler.firstElementChild; $.on(this.menuButton, 'click', this.menuToggle); $.on(this.barFixedToggler, 'change', this.toggleBarFixed); $.on(this.barPositionToggler, 'change', this.toggleBarPosition); + $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); $.on(this.headerToggler, 'change', this.toggleBarVisibility); $.on(this.footerToggler, 'change', this.toggleFooterVisibility); $.on(this.customNavToggler, 'change', this.toggleCustomNav); $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); + this.setLinkJustify(Conf['Centered links']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); - $.sync('Header auto-hide', Header.setBarVisibility); + $.sync('Centered links', Header.setLinkJustify); $.event('AddMenuEntry', { type: 'header', el: $.el('span', { @@ -14474,24 +14477,22 @@ } }, checkUpdate: function() { - var freq, items, now; + var now; if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { return; } now = Date.now(); - freq = 7 * $.DAY; - items = { - lastupdate: 0, - lastchecked: 0 - }; - return $.get(items, function(items) { - if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) { + return $.get('lastchecked', 0, function(_arg) { + var lastchecked; + + lastchecked = _arg.lastchecked; + if (lastchecked > now - $.DAY) { return; } return $.ready(function() { $.on(window, 'message', Main.message); - $.set('lastUpdate', now); + $.set('lastchecked', now); return $.add(d.head, $.el('script', { src: 'https://github.com/zixaphir/appchan-x/raw/Av2/latest.js' })); diff --git a/src/General/Config.coffee b/src/General/Config.coffee index a6e71cf6a..67c8078be 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -229,6 +229,10 @@ Config = true 'Bookmark threads.' ] + 'Persistent Thread Watcher': [ + false + 'Opens the thread watcher by default.' + ] 'Auto Watch': [ true 'Automatically watch threads you start.' @@ -771,7 +775,6 @@ http://iqdb.org/?url=%TURL 'Fixed Header': true 'Header auto-hide': false 'Bottom Header': false - 'Hide Header': false 'Header catalog links': false 'Bottom Board List': true 'Custom Board Navigation': true diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 2ce7ad7c3..b210b55dd 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -21,6 +21,7 @@ Header = @barFixedToggler = barFixedToggler.firstElementChild @barPositionToggler = barPositionToggler.firstElementChild + @linkJustifyToggler = linkJustifyToggler.firstElementChild @headerToggler = headerToggler.firstElementChild @footerToggler = footerToggler.firstElementChild @customNavToggler = customNavToggler.firstElementChild @@ -28,6 +29,7 @@ Header = $.on @menuButton, 'click', @menuToggle $.on @barFixedToggler, 'change', @toggleBarFixed $.on @barPositionToggler, 'change', @toggleBarPosition + $.on @linkJustifyToggler, 'change', @toggleLinkJustify $.on @headerToggler, 'change', @toggleBarVisibility $.on @footerToggler, 'change', @toggleFooterVisibility $.on @customNavToggler, 'change', @toggleCustomNav @@ -35,10 +37,11 @@ Header = @setBarFixed Conf['Fixed Header'] @setBarVisibility Conf['Header auto-hide'] + @setLinkJustify Conf['Centered links'] $.sync 'Fixed Header', Header.setBarFixed $.sync 'Bottom Header', Header.setBarPosition - $.sync 'Header auto-hide', Header.setBarVisibility + $.sync 'Centered links', Header.setLinkJustify $.event 'AddMenuEntry', type: 'header' diff --git a/src/General/Main.coffee b/src/General/Main.coffee index f34f13c73..3df2d039a 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -289,21 +289,13 @@ Main = checkUpdate: -> return unless Conf['Check for Updates'] and Main.isThisPageLegit() - # Check for updates after: - # - 6 hours since the last update on Opera because it lacks auto-updating. - # - 7 days since the last update on Chrome/Firefox. - # After that, check for updates every day if we still haven't updated. now = Date.now() - freq = <% if (type === 'userjs') { %>6 * $.HOUR<% } else { %>7 * $.DAY<% } %> - items = - lastupdate: 0 - lastchecked: 0 - $.get items, (items) -> - if items.lastupdate > now - freq or items.lastchecked > now - $.DAY + $.get 'lastchecked', 0, ({lastchecked}) -> + if (lastchecked > now - $.DAY) return $.ready -> $.on window, 'message', Main.message - $.set 'lastUpdate', now + $.set 'lastchecked', now $.add d.head, $.el 'script', src: '<%= meta.repo %>raw/<%= meta.mainBranch %>/latest.js' diff --git a/src/General/css/style.css b/src/General/css/style.css index 9efa4daae..b061c7497 100644 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -126,6 +126,13 @@ a { border-width: 0; transition: all .1s .05s ease-in-out; } +:root.centered-links #header-bar { + text-align: center; +} +:root.centered-links #custom-board-list { + position: relative; + left: 80px; +} .fixed.top #header-bar { border-bottom-width: 1px; }