From 01b26a08c7587045e99ba8d627188eec4a7935d7 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 2 Apr 2011 06:57:50 -0700 Subject: [PATCH 1/9] remove logging to fix imageHover --- 4chan_x.js | 1 - script.coffee | 1 - 2 files changed, 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 7034ca9f5..8ea4d85d7 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -542,7 +542,6 @@ imgHeight = img.offsetHeight; top = clientY + imageHover.offset.y; bot = top + imgHeight; - log(bot, imageHover.winHeight); img.style.top = imageHover.winHeight < imgHeight || top < 0 ? '0px' : bot > imageHover.winHeight ? imageHover.winHeight - imgHeight + 'px' : top + 'px'; return img.style.left = clientX + imageHover.offset.x; }, diff --git a/script.coffee b/script.coffee index 8c906fcc8..0927090af 100644 --- a/script.coffee +++ b/script.coffee @@ -373,7 +373,6 @@ imageHover = top = clientY + imageHover.offset.y bot = top + imgHeight - log bot, imageHover.winHeight img.style.top = if imageHover.winHeight < imgHeight or top < 0 '0px' From 6d549d9ce3129cbdc0999c218b194cfc13b2d403 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 2 Apr 2011 06:59:54 -0700 Subject: [PATCH 2/9] 1.27.4 --- 4chan_x.js | 2 +- changelog | 3 +++ header | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 8ea4d85d7..403af9afa 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.3 +// @version 1.27.4 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* diff --git a/changelog b/changelog index 1ed9c0233..3d7744108 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +1.27.4 +- fix imageHover on chrome + 1.27.3 - fix regression - movement diff --git a/header b/header index fa79c2745..3eaeedc96 100644 --- a/header +++ b/header @@ -2,7 +2,7 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.3 +// @version 1.27.4 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* From cb966b9b60bcf3fbfb0ccca143dd3dec67522e93 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 2 Apr 2011 07:03:04 -0700 Subject: [PATCH 3/9] FUCKING CHROME --- script.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/script.coffee b/script.coffee index 0927090af..e6fe70894 100644 --- a/script.coffee +++ b/script.coffee @@ -1,3 +1,4 @@ +# XXX error on FUCKING CHROME {log} = console if console? config = From 3ef9107232c995245819840672b55f59bee16761 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 3 Apr 2011 13:04:58 -0700 Subject: [PATCH 4/9] try to fix qr image posting --- 4chan_x.js | 20 ++++++++++---------- script.coffee | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 403af9afa..9d8e2914c 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -971,8 +971,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'; }, @@ -980,7 +980,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); @@ -988,13 +995,6 @@ $.remove(dialog); } } - } else { - error = $.el('span', { - className: 'error', - textContent: data - }); - $.append(dialog, error); - qr.autohide.unset(); } return recaptchaReload(); }, diff --git a/script.coffee b/script.coffee index e6fe70894..236c24b16 100644 --- a/script.coffee +++ b/script.coffee @@ -717,25 +717,25 @@ qr = recaptchaReload() 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 - 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 recaptchaReload() From 527182f724e90858d771a7dd9958f8d777224035 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 3 Apr 2011 18:40:08 -0700 Subject: [PATCH 5/9] Revert "try to fix qr image posting" This reverts commit 3ef9107232c995245819840672b55f59bee16761. Can't push untested shit to master, fix added to qr topic branch. --- 4chan_x.js | 20 ++++++++++---------- script.coffee | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 9d8e2914c..403af9afa 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -971,8 +971,8 @@ } }, messageIframe: function(e) { - var message, _ref; - message = ((_ref = $('table font b')) != null ? _ref.firstChild.textContent : void 0) || ''; + var message; + message = $('table b').firstChild.textContent; e.source.postMessage(message, '*'); return window.location = 'about:blank'; }, @@ -980,14 +980,7 @@ var data, dialog, error; data = e.data; dialog = $('#qr'); - if (data) { - error = $.el('span', { - className: 'error', - textContent: data - }); - $.append(dialog, error); - qr.autohide.unset(); - } else { + if (data === 'Post successful!') { if (dialog) { if ($.config('Persistent QR')) { qr.refresh(dialog); @@ -995,6 +988,13 @@ $.remove(dialog); } } + } else { + error = $.el('span', { + className: 'error', + textContent: data + }); + $.append(dialog, error); + qr.autohide.unset(); } return recaptchaReload(); }, diff --git a/script.coffee b/script.coffee index 236c24b16..e6fe70894 100644 --- a/script.coffee +++ b/script.coffee @@ -717,25 +717,25 @@ qr = recaptchaReload() messageIframe: (e) -> - message = $('table font b')?.firstChild.textContent or '' + message = $('table b').firstChild.textContent e.source.postMessage message, '*' window.location = 'about:blank' messageTop: (e) -> {data} = e dialog = $ '#qr' - if data # error message - error = $.el 'span', - className: 'error' - textContent: data - $.append dialog, error - qr.autohide.unset() - else + if data is 'Post successful!' if dialog if $.config 'Persistent QR' qr.refresh dialog else $.remove dialog + else + error = $.el 'span', + className: 'error' + textContent: data + $.append dialog, error + qr.autohide.unset() recaptchaReload() From 6d1d7128f92c4f357e0407f12b4b34d5a99cdfde Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 3 Apr 2011 18:44:46 -0700 Subject: [PATCH 6/9] move recaptcha reload out of catch block --- 4chan_x.js | 6 +++--- script.coffee | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 403af9afa..0211eff75 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -958,16 +958,16 @@ }, load: function(e) { var dialog; + recaptchaReload(); try { return e.target.contentWindow.postMessage('', '*'); } catch (err) { dialog = $('#qr'); if (g.REPLY && $.config('Persistent QR')) { - qr.refresh(dialog); + return qr.refresh(dialog); } else { - $.remove(dialog); + return $.remove(dialog); } - return recaptchaReload(); } }, messageIframe: function(e) { diff --git a/script.coffee b/script.coffee index e6fe70894..68571ccc5 100644 --- a/script.coffee +++ b/script.coffee @@ -704,6 +704,7 @@ qr = $.removeClass dialog, 'auto' load: (e) -> + recaptchaReload() try e.target.contentWindow.postMessage '', '*' catch err @@ -714,8 +715,6 @@ qr = else $.remove dialog - recaptchaReload() - messageIframe: (e) -> message = $('table b').firstChild.textContent e.source.postMessage message, '*' From 90f32b1b38f590afbf25d7a77d445eced8848891 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 3 Apr 2011 18:46:10 -0700 Subject: [PATCH 7/9] 1.27.5 --- 4chan_x.js | 2 +- changelog | 3 +++ header | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 0211eff75..5e068f262 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.4 +// @version 1.27.5 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* diff --git a/changelog b/changelog index 3d7744108..072cb321c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +1.27.5 +- fix regression - reload captcha after posting + 1.27.4 - fix imageHover on chrome diff --git a/header b/header index 3eaeedc96..10b70d484 100644 --- a/header +++ b/header @@ -2,7 +2,7 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.4 +// @version 1.27.5 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* From e8e1fddef14d4401dc935f0b0662eb49384cc20b Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 6 Apr 2011 04:11:00 -0700 Subject: [PATCH 8/9] 1.27.6 - fix "update now" --- 4chan_x.js | 5 +++-- changelog | 3 +++ header | 2 +- script.coffee | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 5e068f262..e28f2867e 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2,11 +2,12 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.5 +// @version 1.27.6 // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* // @include http://sys.4chan.org/* +// @include file://* // @updateURL http://userscripts.org/scripts/source/51412.meta.js // ==/UserScript== @@ -1469,7 +1470,7 @@ interval = $('input[name=interval]', div); interval.value = GM_getValue('Interval', 10); $.bind(interval, 'change', updateInterval); - $.bind($('input[type=button]'), 'click', updateNow); + $.bind($('input[type=button]', div), 'click', updateNow); d.body.appendChild(div); if (GM_getValue('autoG')) { return updateAuto.call($("input[name=autoL]", div)); diff --git a/changelog b/changelog index 072cb321c..93a043f1e 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +1.27.6 +- fix 'update now' button + 1.27.5 - fix regression - reload captcha after posting diff --git a/header b/header index 10b70d484..b082da2de 100644 --- a/header +++ b/header @@ -2,7 +2,7 @@ // @name 4chan x // @namespace aeosynth // @description Adds various features. -// @version 1.27.5 +// @version 1.27.6 // @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 68571ccc5..04e36f258 100644 --- a/script.coffee +++ b/script.coffee @@ -1111,7 +1111,7 @@ updaterMake = -> interval.value = GM_getValue 'Interval', 10 $.bind interval, 'change', updateInterval - $.bind $('input[type=button]'), 'click', updateNow + $.bind $('input[type=button]', div), 'click', updateNow d.body.appendChild div From 95788c0f2523392aac085bba7aa9ed1606bbe0b3 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 6 Apr 2011 04:27:07 -0700 Subject: [PATCH 9/9] remove @include file://* --- 4chan_x.js | 1 - 1 file changed, 1 deletion(-) diff --git a/4chan_x.js b/4chan_x.js index e28f2867e..8ac18ac4e 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -7,7 +7,6 @@ // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* // @include http://sys.4chan.org/* -// @include file://* // @updateURL http://userscripts.org/scripts/source/51412.meta.js // ==/UserScript==