Merge branch 'v3' into Av2

Conflicts:
	builds/4chan-X.js
	builds/appchan-x.user.js
	builds/crx/script.js
	src/General/Config.coffee
	src/Monitoring/ThreadWatcher.coffee
This commit is contained in:
Zixaphir 2013-05-07 21:09:24 -07:00
commit 7396b327c8
8 changed files with 58 additions and 46 deletions

View File

@ -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

View File

@ -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'
}));

View File

@ -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'
}));

View File

@ -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'
}));

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -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;
}