This commit is contained in:
James Campos 2011-06-25 11:17:41 -07:00
commit 389c8b2af4
3 changed files with 32 additions and 16 deletions

View File

@ -1366,7 +1366,7 @@
return qr.autohide.set(); return qr.autohide.set();
}, },
sys: function() { sys: function() {
var c, id, recaptcha, thread, _, _ref; var c, id, otoNoko, recaptcha, thread, _, _ref;
if (recaptcha = $('#recaptcha_response_field')) { if (recaptcha = $('#recaptcha_response_field')) {
$.bind(recaptcha, 'keydown', Recaptcha.listener); $.bind(recaptcha, 'keydown', Recaptcha.listener);
return; return;
@ -1386,9 +1386,14 @@
c = $('b').lastChild; c = $('b').lastChild;
if (c.nodeType === 8) { if (c.nodeType === 8) {
_ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2]; _ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2];
otoNoko = /AEOS.4chan_x.auto_noko=true/.test(d.cookie);
if (thread === '0') { if (thread === '0') {
return window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + id + "#watch"; if (/AEOS.4chan_x.auto_watch=true/.test(d.cookie)) {
} else if (d.cookie.indexOf("" + NAMESPACE + "auto_noko") > -1) { return window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + id + "#watch";
} else if (otoNoko) {
return window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + id;
}
} else if (otoNoko) {
return window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + id; return window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + id;
} }
} }
@ -2740,6 +2745,14 @@
keybinds.init(); keybinds.init();
} }
threading.init(); threading.init();
if ($.config('Auto Watch') && $.config('Thread Watcher')) {
d.cookie = "" + NAMESPACE + "auto_watch=true;path=/;domain=.4chan.org";
if (g.REPLY && location.hash === '#watch' && $('img.favicon').src === Favicon.empty) {
watcher.watch(null, g.THREAD_ID);
}
} else {
d.cookie = "" + NAMESPACE + "auto_watch=false;path=/;domain=.4chan.org";
}
if (g.REPLY) { if (g.REPLY) {
if ($.config('Thread Updater')) { if ($.config('Thread Updater')) {
updater.init(); updater.init();
@ -2759,9 +2772,6 @@
if ($.config('Unread Count')) { if ($.config('Unread Count')) {
unread.init(); unread.init();
} }
if ($.config('Auto Watch') && $.config('Thread Watcher') && location.hash === '#watch' && $('img.favicon').src === Favicon.empty) {
watcher.watch(null, g.THREAD_ID);
}
if ($.config('Reply Navigation')) { if ($.config('Reply Navigation')) {
nav.init(); nav.init();
} }
@ -2918,8 +2928,7 @@
height: 120px;\ height: 120px;\
}\ }\
#qr.auto:not(:hover) > form {\ #qr.auto:not(:hover) > form {\
height: 0;\ display: none;\
overflow: hidden;\
}\ }\
/* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */\ /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */\
#qr input::-webkit-input-placeholder {\ #qr input::-webkit-input-placeholder {\

View File

@ -3,6 +3,7 @@
- image spoiler revealer - image spoiler revealer
- optional auto noko - optional auto noko
- fix options centering on Opera - fix options centering on Opera
- fix append '#watch' only when auto watch is enabled
- aeosynth: - aeosynth:
- keep options dialog at constant size - keep options dialog at constant size
- drop firefox 3.6 support (again...) - drop firefox 3.6 support (again...)

View File

@ -1127,9 +1127,13 @@ qr =
c = $('b').lastChild c = $('b').lastChild
if c.nodeType is 8 #comment node if c.nodeType is 8 #comment node
[_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/) [_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/)
otoNoko = /AEOS.4chan_x.auto_noko=true/.test d.cookie
if thread is '0' if thread is '0'
window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{id}#watch" if /AEOS.4chan_x.auto_watch=true/.test d.cookie
else if d.cookie.indexOf("#{NAMESPACE}auto_noko") > -1 window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{id}#watch"
else if otoNoko
window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{id}"
else if otoNoko
window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{thread}##{id}" window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{thread}##{id}"
threading = threading =
@ -2154,6 +2158,13 @@ main =
threading.init() threading.init()
if $.config('Auto Watch') and $.config('Thread Watcher')
d.cookie = "#{NAMESPACE}auto_watch=true;path=/;domain=.4chan.org"
if g.REPLY and location.hash is '#watch' and $('img.favicon').src is Favicon.empty
watcher.watch null, g.THREAD_ID
else
d.cookie = "#{NAMESPACE}auto_watch=false;path=/;domain=.4chan.org"
if g.REPLY if g.REPLY
if $.config 'Thread Updater' if $.config 'Thread Updater'
updater.init() updater.init()
@ -2173,10 +2184,6 @@ main =
if $.config 'Unread Count' if $.config 'Unread Count'
unread.init() unread.init()
if $.config('Auto Watch') and $.config('Thread Watcher') and
location.hash is '#watch' and $('img.favicon').src is Favicon.empty
watcher.watch null, g.THREAD_ID
if $.config 'Reply Navigation' if $.config 'Reply Navigation'
nav.init() nav.init()
@ -2320,8 +2327,7 @@ main =
height: 120px; height: 120px;
} }
#qr.auto:not(:hover) > form { #qr.auto:not(:hover) > form {
height: 0; display: none;
overflow: hidden;
} }
/* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */ /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */
#qr input::-webkit-input-placeholder { #qr input::-webkit-input-placeholder {