diff --git a/4chan_x.js b/4chan_x.js index 230b9e641..bc9f5c621 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2,7 +2,7 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.6 +// @version 1.27.8.2 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* @@ -974,8 +974,8 @@ } }, messageIframe: function(e) { - var message; - message = $('table b').firstChild.textContent; + var message, _ref; + message = ((_ref = $('table font b')) != null ? _ref.firstChild.textContent : void 0) || ''; e.source.postMessage(message, '*'); return window.location = 'about:blank'; }, @@ -983,7 +983,14 @@ var data, dialog, error; data = e.data; 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 ($.config('Persistent QR')) { qr.refresh(dialog); @@ -991,15 +998,6 @@ $.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(); }, @@ -1708,7 +1706,6 @@ case 'tv': url = "http://green-oval.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID; break; - case 'cgl': case 'jp': case 'm': case 'tg': @@ -2022,7 +2019,7 @@ /* lastChecked = Number GM_getValue('lastChecked', '0') now = Date.now() - DAY = 24 * 60 * 60 + DAY = 1000 * 60 * 60 * 24 if lastChecked < now - 1*DAY cutoff = now - 7*DAY while g.hiddenThreads.length diff --git a/README.md b/README.md new file mode 100644 index 000000000..0b548fc4c --- /dev/null +++ b/README.md @@ -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`. diff --git a/changelog b/changelog index 93a043f1e..6e50ada6f 100644 --- a/changelog +++ b/changelog @@ -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 - fix 'update now' button diff --git a/header b/header index 3d218c0d5..275d939ce 100644 --- a/header +++ b/header @@ -2,7 +2,7 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.6 +// @version 1.27.8.2 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* diff --git a/script.coffee b/script.coffee index 15381fc62..bb307e3bc 100644 --- a/script.coffee +++ b/script.coffee @@ -733,27 +733,25 @@ qr = $.remove dialog messageIframe: (e) -> - message = $('table b').firstChild.textContent + message = $('table font b')?.firstChild.textContent or '' e.source.postMessage message, '*' window.location = 'about:blank' messageTop: (e) -> {data} = e dialog = $ '#qr' - if data is 'Post successful!' - if dialog - if $.config 'Persistent QR' - qr.refresh dialog - else - $.remove dialog - g.seconds = if g.sage then 60 else 30 - qr.cooldownStart() - else + if data # error message error = $.el 'span', className: 'error' textContent: data $.append dialog, error qr.autohide.unset() + else + if dialog + if $.config 'Persistent QR' + qr.refresh dialog + else + $.remove dialog recaptcha.reload() @@ -1326,7 +1324,7 @@ redirect = -> switch g.BOARD when 'a', 'g', 'lit', 'sci', 'tv' 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}" 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}" @@ -1558,7 +1556,7 @@ if $.isDST() then g.chanOffset -= 1 ### lastChecked = Number GM_getValue('lastChecked', '0') now = Date.now() -DAY = 24 * 60 * 60 +DAY = 1000 * 60 * 60 * 24 if lastChecked < now - 1*DAY cutoff = now - 7*DAY while g.hiddenThreads.length