merge master

This commit is contained in:
James Campos 2011-04-17 12:46:04 -07:00
commit 282c3ff9ca
5 changed files with 38 additions and 28 deletions

View File

@ -2,7 +2,7 @@
// @name 4chan x // @name 4chan x
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @version 1.27.6 // @version 1.27.8.2
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license // @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/* // @include http://boards.4chan.org/*
@ -974,8 +974,8 @@
} }
}, },
messageIframe: function(e) { messageIframe: function(e) {
var message; var message, _ref;
message = $('table b').firstChild.textContent; message = ((_ref = $('table font b')) != null ? _ref.firstChild.textContent : void 0) || '';
e.source.postMessage(message, '*'); e.source.postMessage(message, '*');
return window.location = 'about:blank'; return window.location = 'about:blank';
}, },
@ -983,7 +983,14 @@
var data, dialog, error; var data, dialog, error;
data = e.data; data = e.data;
dialog = $('#qr'); dialog = $('#qr');
if (data === 'Post successful!') { if (data) {
error = $.el('span', {
className: 'error',
textContent: data
});
$.append(dialog, error);
qr.autohide.unset();
} else {
if (dialog) { if (dialog) {
if ($.config('Persistent QR')) { if ($.config('Persistent QR')) {
qr.refresh(dialog); qr.refresh(dialog);
@ -991,15 +998,6 @@
$.remove(dialog); $.remove(dialog);
} }
} }
g.seconds = g.sage ? 60 : 30;
qr.cooldownStart();
} else {
error = $.el('span', {
className: 'error',
textContent: data
});
$.append(dialog, error);
qr.autohide.unset();
} }
return recaptcha.reload(); return recaptcha.reload();
}, },
@ -1708,7 +1706,6 @@
case 'tv': case 'tv':
url = "http://green-oval.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID; url = "http://green-oval.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID;
break; break;
case 'cgl':
case 'jp': case 'jp':
case 'm': case 'm':
case 'tg': case 'tg':
@ -2022,7 +2019,7 @@
/* /*
lastChecked = Number GM_getValue('lastChecked', '0') lastChecked = Number GM_getValue('lastChecked', '0')
now = Date.now() now = Date.now()
DAY = 24 * 60 * 60 DAY = 1000 * 60 * 60 * 24
if lastChecked < now - 1*DAY if lastChecked < now - 1*DAY
cutoff = now - 7*DAY cutoff = now - 7*DAY
while g.hiddenThreads.length while g.hiddenThreads.length

6
README.md Normal file
View File

@ -0,0 +1,6 @@
# Building
[install nodejs and npm](https://github.com/joyent/node/wiki/Installation),
clone [coffee-script](https://github.com/jashkenas/coffee-script/),
cd into it and run `npm link`, clone 4chan x, cd into it and run `cake dev &`.
kill the process with `killall node`.

View File

@ -1,3 +1,12 @@
1.27.8
- fix qr image posting
- fix thread hiding
- fix movement
1.27.7
- fix qr persist
- fix updater defaults
1.27.6 1.27.6
- fix 'update now' button - fix 'update now' button

2
header
View File

@ -2,7 +2,7 @@
// @name 4chan x // @name 4chan x
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @version 1.27.6 // @version 1.27.8.2
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
// @license MIT; http://en.wikipedia.org/wiki/Mit_license // @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/* // @include http://boards.4chan.org/*

View File

@ -733,27 +733,25 @@ qr =
$.remove dialog $.remove dialog
messageIframe: (e) -> messageIframe: (e) ->
message = $('table b').firstChild.textContent message = $('table font b')?.firstChild.textContent or ''
e.source.postMessage message, '*' e.source.postMessage message, '*'
window.location = 'about:blank' window.location = 'about:blank'
messageTop: (e) -> messageTop: (e) ->
{data} = e {data} = e
dialog = $ '#qr' dialog = $ '#qr'
if data is 'Post successful!' if data # error message
if dialog
if $.config 'Persistent QR'
qr.refresh dialog
else
$.remove dialog
g.seconds = if g.sage then 60 else 30
qr.cooldownStart()
else
error = $.el 'span', error = $.el 'span',
className: 'error' className: 'error'
textContent: data textContent: data
$.append dialog, error $.append dialog, error
qr.autohide.unset() qr.autohide.unset()
else
if dialog
if $.config 'Persistent QR'
qr.refresh dialog
else
$.remove dialog
recaptcha.reload() recaptcha.reload()
@ -1326,7 +1324,7 @@ redirect = ->
switch g.BOARD switch g.BOARD
when 'a', 'g', 'lit', 'sci', 'tv' when 'a', 'g', 'lit', 'sci', 'tv'
url = "http://green-oval.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}" url = "http://green-oval.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
when 'cgl', 'jp', 'm', 'tg' when 'jp', 'm', 'tg'
url = "http://archive.easymodo.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}" url = "http://archive.easymodo.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
when '3', 'adv', 'an', 'c', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' when '3', 'adv', 'an', 'c', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x'
url = "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}" url = "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}"
@ -1558,7 +1556,7 @@ if $.isDST() then g.chanOffset -= 1
### ###
lastChecked = Number GM_getValue('lastChecked', '0') lastChecked = Number GM_getValue('lastChecked', '0')
now = Date.now() now = Date.now()
DAY = 24 * 60 * 60 DAY = 1000 * 60 * 60 * 24
if lastChecked < now - 1*DAY if lastChecked < now - 1*DAY
cutoff = now - 7*DAY cutoff = now - 7*DAY
while g.hiddenThreads.length while g.hiddenThreads.length