From ee44097eec6a2b2835de4d1270f12a55c9729d00 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 2 May 2011 22:28:11 -0700 Subject: [PATCH 01/18] @include file://* --- 4chan_x.js | 1 + header | 1 + 2 files changed, 2 insertions(+) diff --git a/4chan_x.js b/4chan_x.js index 0b6473fe6..32f3b7ac5 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -7,6 +7,7 @@ // @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== diff --git a/header b/header index 7600ae860..8ba4abddb 100644 --- a/header +++ b/header @@ -7,6 +7,7 @@ // @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== From 179c846d1631eda99eea0c8c9c38ef1a033081f5 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 00:05:13 -0700 Subject: [PATCH 02/18] qr remix --- 4chan_x.js | 21 +++++++++++++++++---- script.coffee | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index bb45f30b4..62138fa3a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1142,13 +1142,18 @@ }, dialog: function(link) { var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' }, html); el = $('input[title=autohide]', dialog); $.bind(el, 'click', qr.cb.autohide); + clone = $('#recaptcha_widget_div').cloneNode(true); + $.append($('#qr_captcha', dialog), clone); + $('input[name=recaptcha_response_field]', clone).placeholder = 'verification'; + $.append(d.body, dialog); + return; clone = $('form[name=post]').cloneNode(true); _ref = $$('script', clone); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -2278,11 +2283,19 @@ #qr > div.move {\ text-align: right;\ }\ - #qr > form > div, /* ad */\ - #qr #recaptcha_table td:nth-of-type(3), /* captcha logos */\ - #qr td.rules {\ + #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ display: none;\ }\ + #qr textarea {\ + width: 300px;\ + height: 100px;\ + }\ + #qr form {\ + margin: 0px;\ + }\ + #qr * {\ + padding: 0px !important;\ + }\ #qr.auto:not(:hover) form {\ display: none;\ }\ diff --git a/script.coffee b/script.coffee index d9669e50f..a1dc8b46a 100644 --- a/script.coffee +++ b/script.coffee @@ -875,11 +875,29 @@ qr = clearInterval qr.cooldownIntervalID dialog: (link) -> - html = "
Quick Reply X
" + html = " +
Quick Reply X
+
+
+
+
+
+
+
+
+
+ " dialog = ui.dialog 'qr', top: '0px', left: '0px', html el = $ 'input[title=autohide]', dialog $.bind el, 'click', qr.cb.autohide + clone = $('#recaptcha_widget_div').cloneNode(true) + $.append $('#qr_captcha', dialog), clone + $('input[name=recaptcha_response_field]', clone).placeholder = 'verification' + + $.append d.body, dialog + return + clone = $('form[name=post]').cloneNode(true) for script in $$ 'script', clone $.remove script @@ -1789,11 +1807,19 @@ main = #qr > div.move { text-align: right; } - #qr > form > div, /* ad */ - #qr #recaptcha_table td:nth-of-type(3), /* captcha logos */ - #qr td.rules { + #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ display: none; } + #qr textarea { + width: 300px; + height: 100px; + } + #qr form { + margin: 0px; + } + #qr * { + padding: 0px !important; + } #qr.auto:not(:hover) form { display: none; } From b6e3d1f0ecaea64bf94fc6527955e1cb019a3a2b Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 21:02:47 +0200 Subject: [PATCH 03/18] Start qr remix. --- 4chan_x.js | 6 +++--- script.coffee | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 865eca94d..16f8dd746 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1142,16 +1142,16 @@ }, dialog: function(link) { var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' }, html); - el = $('input[title=autohide]', dialog); + el = $('#autohide', dialog); $.bind(el, 'click', qr.cb.autohide); clone = $('#recaptcha_widget_div').cloneNode(true); $.append($('#qr_captcha', dialog), clone); - $('input[name=recaptcha_response_field]', clone).placeholder = 'verification'; + $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification'; $.append(d.body, dialog); return; clone = $('form[name=post]').cloneNode(true); diff --git a/script.coffee b/script.coffee index 78e559597..3ffdfbaa6 100644 --- a/script.coffee +++ b/script.coffee @@ -876,24 +876,25 @@ qr = dialog: (link) -> html = " -
Quick Reply X
+
Quick Reply X
-
-
-
-
+ +
+
+
+
-
-
+
+
" dialog = ui.dialog 'qr', top: '0px', left: '0px', html - el = $ 'input[title=autohide]', dialog + el = $ '#autohide', dialog $.bind el, 'click', qr.cb.autohide clone = $('#recaptcha_widget_div').cloneNode(true) $.append $('#qr_captcha', dialog), clone - $('input[name=recaptcha_response_field]', clone).placeholder = 'verification' + $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification' $.append d.body, dialog return From fa5e083cbc11ef1559c3c293efc3e0fed896a5bb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 21:26:48 +0200 Subject: [PATCH 04/18] How dare you forget that part? --- 4chan_x.js | 2 +- script.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 16f8dd746..9cc6f1b72 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1142,7 +1142,7 @@ }, dialog: function(link) { var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index 3ffdfbaa6..dce7f4763 100644 --- a/script.coffee +++ b/script.coffee @@ -877,10 +877,10 @@ qr = dialog: (link) -> html = "
Quick Reply X
-
+
-
+
From f0ca6782b2c031745381e902641f232f325f637b Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 23:04:09 +0200 Subject: [PATCH 05/18] qr remix: Captcha-tan styling --- 4chan_x.js | 34 +++++++++++++++++++++++++++++----- script.coffee | 34 +++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 9cc6f1b72..f24f3d493 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2299,14 +2299,14 @@ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ display: none;\ }\ - #qr textarea {\ - width: 300px;\ - height: 100px;\ - }\ #qr form {\ margin: 0px;\ }\ - #qr * {\ + #qr textarea {\ + width: 300px;\ + height: 80px;\ + }\ + #qr *:not(input):not(textarea) {\ padding: 0px !important;\ }\ #qr.auto:not(:hover) form {\ @@ -2317,6 +2317,30 @@ bottom: 0;\ left: 0;\ }\ + /* qr reCAPTCHA */\ + #qr_captcha input {\ + margin-top: 3px;\ + padding: 2px 4px 3px;\ + }\ + #qr tr {\ + height: auto;\ + }\ + #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {\ + height: 0;\ + width: 0;\ + padding: 9px 6px !important;\ + margin-left: -16px;\ + position: relative;\ + }\ + #qr_captcha #recaptcha_reload {\ + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center;\ +}\ + #qr_captcha #recaptcha_switch_audio {\ + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center;\ + }\ + #qr_captcha #recaptcha_whatsthis {\ + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAk0lEQVQYV3WMsQ3CMBBFf0ECmYDJqIkFk0TpkcgEUCeegWzADoi0yQbm3cUFBeifrX/vWZZ2f+K4UlDURCKtcua4VfpK64oJDg/a66zFe1hFpN7AHWvnIprY8nPSk9zpVxcTLYukmXZynEWp3peXLpxV9CrF1L6OtDGL2kTB1QBmPTj2pIEUJkwdNehNBpphxOZ3PgIeQ0jaC7S6AAAAAElFTkSuQmCC) no-repeat center;\ + }\ \ #updater {\ position: fixed;\ diff --git a/script.coffee b/script.coffee index dce7f4763..735af9e00 100644 --- a/script.coffee +++ b/script.coffee @@ -1813,14 +1813,14 @@ main = #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ display: none; } - #qr textarea { - width: 300px; - height: 100px; - } #qr form { margin: 0px; } - #qr * { + #qr textarea { + width: 300px; + height: 80px; + } + #qr *:not(input):not(textarea) { padding: 0px !important; } #qr.auto:not(:hover) form { @@ -1831,6 +1831,30 @@ main = bottom: 0; left: 0; } + /* qr reCAPTCHA */ + #qr_captcha input { + margin-top: 3px; + padding: 2px 4px 3px; + } + #qr tr { + height: auto; + } + #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis { + height: 0; + width: 0; + padding: 9px 6px !important; + margin-left: -16px; + position: relative; + } + #qr_captcha #recaptcha_reload { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center; +} + #qr_captcha #recaptcha_switch_audio { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center; + } + #qr_captcha #recaptcha_whatsthis { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAk0lEQVQYV3WMsQ3CMBBFf0ECmYDJqIkFk0TpkcgEUCeegWzADoi0yQbm3cUFBeifrX/vWZZ2f+K4UlDURCKtcua4VfpK64oJDg/a66zFe1hFpN7AHWvnIprY8nPSk9zpVxcTLYukmXZynEWp3peXLpxV9CrF1L6OtDGL2kTB1QBmPTj2pIEUJkwdNehNBpphxOZ3PgIeQ0jaC7S6AAAAAElFTkSuQmCC) no-repeat center; + } #updater { position: fixed; From f0951b66ad51d2a6a5f3a7f246a2bd2a1e2a34b3 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 23:09:03 +0200 Subject: [PATCH 06/18] Less is more. --- 4chan_x.js | 6 +++--- script.coffee | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index f24f3d493..7399cbc7a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2332,13 +2332,13 @@ margin-left: -16px;\ position: relative;\ }\ - #qr_captcha #recaptcha_reload {\ + #recaptcha_reload {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center;\ }\ - #qr_captcha #recaptcha_switch_audio {\ + #recaptcha_switch_audio {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center;\ }\ - #qr_captcha #recaptcha_whatsthis {\ + #recaptcha_whatsthis {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAk0lEQVQYV3WMsQ3CMBBFf0ECmYDJqIkFk0TpkcgEUCeegWzADoi0yQbm3cUFBeifrX/vWZZ2f+K4UlDURCKtcua4VfpK64oJDg/a66zFe1hFpN7AHWvnIprY8nPSk9zpVxcTLYukmXZynEWp3peXLpxV9CrF1L6OtDGL2kTB1QBmPTj2pIEUJkwdNehNBpphxOZ3PgIeQ0jaC7S6AAAAAElFTkSuQmCC) no-repeat center;\ }\ \ diff --git a/script.coffee b/script.coffee index 735af9e00..e52384c01 100644 --- a/script.coffee +++ b/script.coffee @@ -1846,13 +1846,13 @@ main = margin-left: -16px; position: relative; } - #qr_captcha #recaptcha_reload { + #recaptcha_reload { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center; } - #qr_captcha #recaptcha_switch_audio { + #recaptcha_switch_audio { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center; } - #qr_captcha #recaptcha_whatsthis { + #recaptcha_whatsthis { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAk0lEQVQYV3WMsQ3CMBBFf0ECmYDJqIkFk0TpkcgEUCeegWzADoi0yQbm3cUFBeifrX/vWZZ2f+K4UlDURCKtcua4VfpK64oJDg/a66zFe1hFpN7AHWvnIprY8nPSk9zpVxcTLYukmXZynEWp3peXLpxV9CrF1L6OtDGL2kTB1QBmPTj2pIEUJkwdNehNBpphxOZ3PgIeQ0jaC7S6AAAAAElFTkSuQmCC) no-repeat center; } From 20ecad055d60e47d5818ce4ac5542d5a9ba1d7a6 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 23:17:54 +0200 Subject: [PATCH 07/18] qr remix: Fix form action link. --- 4chan_x.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 7399cbc7a..c485bbfe0 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1142,7 +1142,7 @@ }, dialog: function(link) { var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index e52384c01..1c2d74c5d 100644 --- a/script.coffee +++ b/script.coffee @@ -877,7 +877,7 @@ qr = dialog: (link) -> html = "
Quick Reply X
-
+
From 5fcc459ca26f1dcdacbc19ae624ffc385ebf5540 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 5 May 2011 00:30:35 +0200 Subject: [PATCH 08/18] qr remix: Fix spoiler only on spoiler powered boards. Fix max file input size. More styling. --- 4chan_x.js | 28 ++++++++++++++++++++-------- script.coffee | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index c485bbfe0..5ae82e68a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1141,17 +1141,25 @@ } }, dialog: function(link) { - var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + var clone, dialog, el, html, resto, script, spoiler, xpath, _i, _len, _ref; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' }, html); el = $('#autohide', dialog); $.bind(el, 'click', qr.cb.autohide); + $('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value; + if ($('.postarea label')) { + spoiler = $.el('label', { + innerHTML: " [Spoiler Image?]" + }); + $.append($('div:nth-of-type(2)', dialog), spoiler); + } clone = $('#recaptcha_widget_div').cloneNode(true); $.append($('#qr_captcha', dialog), clone); $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification'; + $('input[name=recaptcha_response_field]', clone).className = 'inputtext'; $.append(d.body, dialog); return; clone = $('form[name=post]').cloneNode(true); @@ -2299,32 +2307,36 @@ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ display: none;\ }\ - #qr form {\ - margin: 0px;\ + #qr form, #qr #com_submit, #qr input[type="file"] {\ + margin: 0;\ }\ #qr textarea {\ - width: 300px;\ + width: 302px;\ height: 80px;\ }\ #qr *:not(input):not(textarea) {\ - padding: 0px !important;\ + padding: 0 !important;\ }\ #qr.auto:not(:hover) form {\ display: none;\ }\ #qr span.error {\ position: absolute;\ - bottom: 0;\ + top: 0;\ left: 0;\ }\ /* qr reCAPTCHA */\ #qr_captcha input {\ - margin-top: 3px;\ + border: 1px solid #AAA !important;\ + margin-top: 2px;\ padding: 2px 4px 3px;\ }\ #qr tr {\ height: auto;\ }\ + #qr .recaptchatable #recaptcha_image {\ + border: 1px solid #AAA !important;\ + }\ #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {\ height: 0;\ width: 0;\ diff --git a/script.coffee b/script.coffee index 1c2d74c5d..a2857e6be 100644 --- a/script.coffee +++ b/script.coffee @@ -878,23 +878,31 @@ qr = html = "
Quick Reply X
- -
-
-
-
-
-
-
+ +
+
+
+
+
+
+
" dialog = ui.dialog 'qr', top: '0px', left: '0px', html el = $ '#autohide', dialog $.bind el, 'click', qr.cb.autohide + $('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value + + if $ '.postarea label' + spoiler = $.el 'label', + innerHTML: " [Spoiler Image?]" + $.append $('div:nth-of-type(2)', dialog), spoiler + clone = $('#recaptcha_widget_div').cloneNode(true) $.append $('#qr_captcha', dialog), clone $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification' + $('input[name=recaptcha_response_field]', clone).className = 'inputtext' $.append d.body, dialog return @@ -1813,32 +1821,36 @@ main = #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ display: none; } - #qr form { - margin: 0px; + #qr form, #qr #com_submit, #qr input[type="file"] { + margin: 0; } #qr textarea { - width: 300px; + width: 302px; height: 80px; } #qr *:not(input):not(textarea) { - padding: 0px !important; + padding: 0 !important; } #qr.auto:not(:hover) form { display: none; } #qr span.error { position: absolute; - bottom: 0; + top: 0; left: 0; } /* qr reCAPTCHA */ #qr_captcha input { - margin-top: 3px; + border: 1px solid #AAA !important; + margin-top: 2px; padding: 2px 4px 3px; } #qr tr { height: auto; } + #qr .recaptchatable #recaptcha_image { + border: 1px solid #AAA !important; + } #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis { height: 0; width: 0; From 7b5d5b04cc718ff7e5db97dfe1a41b5eb78de524 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 5 May 2011 00:56:17 +0200 Subject: [PATCH 09/18] Flushy flushy --- 4chan_x.js | 5 ++++- script.coffee | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 5ae82e68a..761528791 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2307,6 +2307,9 @@ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ display: none;\ }\ + #qr form {\ + width: 302px;\ + }\ #qr form, #qr #com_submit, #qr input[type="file"] {\ margin: 0;\ }\ @@ -2340,7 +2343,7 @@ #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {\ height: 0;\ width: 0;\ - padding: 9px 6px !important;\ + padding: 10px 6px !important;\ margin-left: -16px;\ position: relative;\ }\ diff --git a/script.coffee b/script.coffee index a2857e6be..ead516f75 100644 --- a/script.coffee +++ b/script.coffee @@ -1821,6 +1821,9 @@ main = #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ display: none; } + #qr form { + width: 302px; + } #qr form, #qr #com_submit, #qr input[type="file"] { margin: 0; } @@ -1854,7 +1857,7 @@ main = #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis { height: 0; width: 0; - padding: 9px 6px !important; + padding: 10px 6px !important; margin-left: -16px; position: relative; } From 1261b4bf1a186f4bad2a1b5728c9950c4fca6444 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 18:48:13 -0700 Subject: [PATCH 10/18] cakefile: ok, interval does make a difference --- Cakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cakefile b/Cakefile index f02647b2c..96e71dc1c 100644 --- a/Cakefile +++ b/Cakefile @@ -18,6 +18,6 @@ build = -> task 'dev', -> build() - fs.watchFile INFILE, (curr, prev) -> + fs.watchFile INFILE, interval: 250, (curr, prev) -> if curr.mtime > prev.mtime build() From 61a155bef9bb89e0213d242d6c057c50be7cc582 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 19:54:26 -0700 Subject: [PATCH 11/18] tweaks --- 4chan_x.js | 38 +++++++++++--------------------------- script.coffee | 43 ++++++++++++++----------------------------- 2 files changed, 25 insertions(+), 56 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 761528791..d0ad53521 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1141,48 +1141,32 @@ } }, dialog: function(link) { - var clone, dialog, el, html, resto, script, spoiler, xpath, _i, _len, _ref; - html = "
Quick Reply X
"; + var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, form, html, spoiler; + MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; + THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' }, html); el = $('#autohide', dialog); $.bind(el, 'click', qr.cb.autohide); - $('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value; if ($('.postarea label')) { spoiler = $.el('label', { innerHTML: " [Spoiler Image?]" }); - $.append($('div:nth-of-type(2)', dialog), spoiler); + $.after($('input[name=email]', dialog), spoiler); } clone = $('#recaptcha_widget_div').cloneNode(true); $.append($('#qr_captcha', dialog), clone); - $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification'; - $('input[name=recaptcha_response_field]', clone).className = 'inputtext'; - $.append(d.body, dialog); - return; - clone = $('form[name=post]').cloneNode(true); - _ref = $$('script', clone); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - script = _ref[_i]; - $.remove(script); - } - clone.target = 'iframe'; - $.bind(clone, 'submit', qr.cb.submit); + $.extend($('input[name=recaptcha_response_field]', clone), { + placeholder: 'Verification', + className: 'inputtext' + }); + form = dialog.lastChild; + $.bind(form, 'submit', qr.cb.submit); $.bind($('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener); - if (!g.REPLY) { - xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]'; - resto = $.el('input', { - type: 'hidden', - name: 'resto', - value: $.x(xpath, link).name - }); - $.before(clone.lastChild, resto); - } - $.append(dialog, clone); $.append(d.body, dialog); - dialog.style.width = dialog.offsetWidth; return dialog; }, persist: function() { diff --git a/script.coffee b/script.coffee index ead516f75..b97a7fb5a 100644 --- a/script.coffee +++ b/script.coffee @@ -875,10 +875,14 @@ qr = clearInterval qr.cooldownIntervalID dialog: (link) -> + #maybe should be global + MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value + THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop() html = " -
Quick Reply X
-
- +
Quick Reply X
+ + +
@@ -892,42 +896,23 @@ qr = el = $ '#autohide', dialog $.bind el, 'click', qr.cb.autohide - $('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value - if $ '.postarea label' spoiler = $.el 'label', innerHTML: " [Spoiler Image?]" - $.append $('div:nth-of-type(2)', dialog), spoiler + $.after $('input[name=email]', dialog), spoiler + # TODO try w/o cloning clone = $('#recaptcha_widget_div').cloneNode(true) $.append $('#qr_captcha', dialog), clone - $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification' - $('input[name=recaptcha_response_field]', clone).className = 'inputtext' + $.extend $('input[name=recaptcha_response_field]', clone), + placeholder: 'Verification' + className: 'inputtext' - $.append d.body, dialog - return - - clone = $('form[name=post]').cloneNode(true) - for script in $$ 'script', clone - $.remove script - clone.target = 'iframe' - $.bind clone, 'submit', qr.cb.submit + form = dialog.lastChild + $.bind form, 'submit', qr.cb.submit $.bind $('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener - if not g.REPLY - #figure out which thread we're replying to - xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]' - resto = $.el 'input', - type: 'hidden' - name: 'resto' - value: $.x(xpath, link).name - - # place resto before table to let userstyles know we're responding to a thread - $.before clone.lastChild, resto - - $.append dialog, clone $.append d.body, dialog - dialog.style.width = dialog.offsetWidth # lock dialog From 4d3c5e9ea6187e1293321dccf817ded7f11694a2 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 21:09:32 -0700 Subject: [PATCH 12/18] error in titlebar (sux) --- 4chan_x.js | 35 ++++++++--------------------------- script.coffee | 27 ++++++--------------------- 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index d0ad53521..38eb97e62 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -987,15 +987,11 @@ } }, message: function(e) { - var data, dialog, error; + var data, dialog; data = e.data; dialog = $('#qr'); if (data) { - error = $.el('span', { - className: 'error', - textContent: data - }); - $.append(dialog, error); + $('#error').textContent = data; qr.autohide.unset(); } else { if (dialog) { @@ -1023,24 +1019,18 @@ return _results; }, submit: function(e) { - var form, isQR, recaptcha, span; + var form, isQR, recaptcha; form = e.target; isQR = form.parentNode.id === 'qr'; if (isQR) { - if (span = this.nextSibling) { - $.remove(span); - } + $('#error').textContent = ''; } if ($.config('Cooldown')) { if (qr.cooldown()) { e.preventDefault(); alert('Stop posting so often!'); if (isQR) { - span = $.el('span', { - className: 'error', - textContent: 'Stop posting so often!' - }); - $.append(this.parentNode, span); + $('#error').textContent = 'Stop posting so often!'; } return; } @@ -1056,11 +1046,7 @@ alert('You forgot to type in the verification.'); recaptcha.focus(); if (isQR) { - span = $.el('span', { - className: 'error', - textContent: 'You forgot to type in the verification.' - }); - return $.append(this.parentNode, span); + return $('#error').textContent = 'You forgot to type in the verification.'; } } }, @@ -1144,7 +1130,7 @@ var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, form, html, spoiler; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); - html = "
Quick Reply X
"; + html = "
X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' @@ -1163,7 +1149,7 @@ placeholder: 'Verification', className: 'inputtext' }); - form = dialog.lastChild; + form = dialog.lastElementChild; $.bind(form, 'submit', qr.cb.submit); $.bind($('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener); $.append(d.body, dialog); @@ -2307,11 +2293,6 @@ #qr.auto:not(:hover) form {\ display: none;\ }\ - #qr span.error {\ - position: absolute;\ - top: 0;\ - left: 0;\ - }\ /* qr reCAPTCHA */\ #qr_captcha input {\ border: 1px solid #AAA !important;\ diff --git a/script.coffee b/script.coffee index b97a7fb5a..64ea32092 100644 --- a/script.coffee +++ b/script.coffee @@ -747,10 +747,7 @@ qr = {data} = e dialog = $ '#qr' if data # error message - error = $.el 'span', - className: 'error' - textContent: data - $.append dialog, error + $('#error').textContent = data qr.autohide.unset() else # success if dialog @@ -774,8 +771,7 @@ qr = isQR = form.parentNode.id == 'qr' if isQR - if span = @nextSibling - $.remove span + $('#error').textContent = '' if $.config 'Cooldown' # check if we've posted on this board in another tab @@ -784,10 +780,7 @@ qr = alert 'Stop posting so often!' if isQR - span = $.el 'span', - className: 'error' - textContent: 'Stop posting so often!' - $.append @parentNode, span + $('#error').textContent = 'Stop posting so often!' return @@ -802,10 +795,7 @@ qr = recaptcha.focus() if isQR - span = $.el 'span', - className: 'error' - textContent: 'You forgot to type in the verification.' - $.append @parentNode, span + $('#error').textContent = 'You forgot to type in the verification.' quote: (e) -> e.preventDefault() @@ -879,7 +869,7 @@ qr = MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop() html = " -
Quick Reply X
+
X
@@ -908,7 +898,7 @@ qr = placeholder: 'Verification' className: 'inputtext' - form = dialog.lastChild + form = dialog.lastElementChild $.bind form, 'submit', qr.cb.submit $.bind $('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener @@ -1822,11 +1812,6 @@ main = #qr.auto:not(:hover) form { display: none; } - #qr span.error { - position: absolute; - top: 0; - left: 0; - } /* qr reCAPTCHA */ #qr_captcha input { border: 1px solid #AAA !important; From 33c12e20d530be5f86c406e0da9067ed123dbec0 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 21:41:14 -0700 Subject: [PATCH 13/18] placeholder styling --- 4chan_x.js | 9 ++++++++- script.coffee | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 38eb97e62..a18fb286e 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2293,6 +2293,13 @@ #qr.auto:not(:hover) form {\ display: none;\ }\ + /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */\ + #qr input:-webkit-input-placeholder {\ + color: grey;\ + }\ + #qr input:-moz-placeholder {\ + color: grey;\ + }\ /* qr reCAPTCHA */\ #qr_captcha input {\ border: 1px solid #AAA !important;\ @@ -2314,7 +2321,7 @@ }\ #recaptcha_reload {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center;\ -}\ + }\ #recaptcha_switch_audio {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center;\ }\ diff --git a/script.coffee b/script.coffee index 64ea32092..236875a47 100644 --- a/script.coffee +++ b/script.coffee @@ -1812,6 +1812,13 @@ main = #qr.auto:not(:hover) form { display: none; } + /* http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */ + #qr input:-webkit-input-placeholder { + color: grey; + } + #qr input:-moz-placeholder { + color: grey; + } /* qr reCAPTCHA */ #qr_captcha input { border: 1px solid #AAA !important; @@ -1833,7 +1840,7 @@ main = } #recaptcha_reload { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAcUlEQVQY02P4z4AKGYKhNJQKYzgIZjxn+I8kwdCGrAkuwRAOZrUwhKBL7GP4ziCPYg8jROI/wzQ0B1yBSXiiCKeBjAMbhab+P0gExFCHu3o3QxzIwSC/MCC5+hPDezDdjOzB/ww/wYw9DCGoPt+CHjQAYxCCmpNUoxoAAAAASUVORK5CYII=) no-repeat center; -} + } #recaptcha_switch_audio { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAQAAAD8fJRsAAAAVUlEQVQYV42NMQ6AMAwDPbTQjQEE//8OPCqkhgZXMJBTJMc3BCjBJrlA6uNL1Np6MTordq+N+cLAotHKlxhk/4lMjMu43M9z4CKRmSoJEarqxDOTHidPWTEdrdlTpwAAAABJRU5ErkJggg==) no-repeat center; } From fe06a6fccad6110b8b9ab2311b60a8c9953a54dc Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 4 May 2011 21:45:36 -0700 Subject: [PATCH 14/18] fuck yeah html5 --- 4chan_x.js | 21 ++++++--------------- script.coffee | 16 ++++------------ 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index a18fb286e..dd6fe4949 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1019,7 +1019,7 @@ return _results; }, submit: function(e) { - var form, isQR, recaptcha; + var form, isQR; form = e.target; isQR = form.parentNode.id === 'qr'; if (isQR) { @@ -1035,19 +1035,9 @@ return; } } - recaptcha = $('input[name=recaptcha_response_field]', this); - if (recaptcha.value) { - qr.sage = $('input[name=email]', form).value === 'sage'; - if (isQR) { - return qr.autohide.set(); - } - } else { - e.preventDefault(); - alert('You forgot to type in the verification.'); - recaptcha.focus(); - if (isQR) { - return $('#error').textContent = 'You forgot to type in the verification.'; - } + qr.sage = $('input[name=email]', form).value === 'sage'; + if (isQR) { + return qr.autohide.set(); } }, quote: function(e) { @@ -1147,7 +1137,8 @@ $.append($('#qr_captcha', dialog), clone); $.extend($('input[name=recaptcha_response_field]', clone), { placeholder: 'Verification', - className: 'inputtext' + className: 'inputtext', + required: true }); form = dialog.lastElementChild; $.bind(form, 'submit', qr.cb.submit); diff --git a/script.coffee b/script.coffee index 236875a47..0a7036ad4 100644 --- a/script.coffee +++ b/script.coffee @@ -784,18 +784,9 @@ qr = return - recaptcha = $('input[name=recaptcha_response_field]', this) - if recaptcha.value - qr.sage = $('input[name=email]', form).value == 'sage' - if isQR - qr.autohide.set() - else - e.preventDefault() - alert 'You forgot to type in the verification.' - recaptcha.focus() - - if isQR - $('#error').textContent = 'You forgot to type in the verification.' + qr.sage = $('input[name=email]', form).value == 'sage' + if isQR + qr.autohide.set() quote: (e) -> e.preventDefault() @@ -897,6 +888,7 @@ qr = $.extend $('input[name=recaptcha_response_field]', clone), placeholder: 'Verification' className: 'inputtext' + required: true form = dialog.lastElementChild $.bind form, 'submit', qr.cb.submit From eb59ecd63dd941c5bb30566f0718e593ec62ec50 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 7 May 2011 14:56:42 -0700 Subject: [PATCH 15/18] tweak auto watch reply --- 4chan_x.js | 19 ++++++++----------- script.coffee | 13 ++++++------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index edc3e6582..63842c7b6 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -71,6 +71,7 @@ '404 Redirect': [true, 'Redirect dead threads'], 'Anonymize': [false, 'Make everybody anonymous'], 'Auto Watch': [true, 'Automatically watch threads that you start'], + 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'], 'Comment Expansion': [true, 'Expand too long comments'], 'Cooldown': [false, 'Prevent \'flood detected\' errors (buggy)'], 'Image Auto-Gif': [false, 'Animate gif thumbnails'], @@ -91,8 +92,7 @@ 'Thread Navigation': [true, 'Navigate to previous / next thread'], 'Thread Updater': [true, 'Update threads'], 'Thread Watcher': [true, 'Bookmark threads'], - 'Unread Count': [true, 'Show unread post count in tab title'], - 'Watch on Reply': [false, 'Automatically watch threads you reply to'] + 'Unread Count': [true, 'Show unread post count in tab title'] }, textarea: { flavors: ['http://regex.info/exif.cgi?url=', 'http://iqdb.org/?url=', 'http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url='].join('\n') @@ -1023,20 +1023,17 @@ return _results; }, submit: function(e) { - var form, isQR, recaptcha, span, thread, threads, value, _i, _len; + var form, id, isQR, op, recaptcha, span; form = e.target; isQR = form.parentNode.id === 'qr'; - if ($.config('Watch on Reply') && $.config('Thread Watcher')) { + if ($.config('Auto Watch Reply') && $.config('Thread Watcher')) { if (g.REPLY && $('img.favicon').src === Favicon.empty) { watcher.watch(null, g.THREAD_ID); } else { - value = $('input[name=resto]').value; - threads = $$('div.op'); - for (_i = 0, _len = threads.length; _i < _len; _i++) { - thread = threads[_i]; - if (thread.id === value && $('img.favicon', thread).src === Favicon.empty) { - watcher.watch(thread, value); - } + id = $('input[name=resto]').value; + op = d.getElementById(id); + if ($('img.favicon', op).src === Favicon.empty) { + watcher.watch(op, id); } } } diff --git a/script.coffee b/script.coffee index 892b2e7e8..c50272e40 100644 --- a/script.coffee +++ b/script.coffee @@ -15,6 +15,7 @@ config = '404 Redirect': [true, 'Redirect dead threads'] 'Anonymize': [false, 'Make everybody anonymous'] 'Auto Watch': [true, 'Automatically watch threads that you start'] + 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] 'Comment Expansion': [true, 'Expand too long comments'] 'Cooldown': [false, 'Prevent \'flood detected\' errors (buggy)'] 'Image Auto-Gif': [false, 'Animate gif thumbnails'] @@ -36,7 +37,6 @@ config = 'Thread Updater': [true, 'Update threads'] 'Thread Watcher': [true, 'Bookmark threads'] 'Unread Count': [true, 'Show unread post count in tab title'] - 'Watch on Reply': [false, 'Automatically watch threads you reply to'] textarea: flavors: [ 'http://regex.info/exif.cgi?url=' @@ -776,15 +776,14 @@ qr = form = e.target isQR = form.parentNode.id == 'qr' - if $.config('Watch on Reply') and $.config('Thread Watcher') + if $.config('Auto Watch Reply') and $.config('Thread Watcher') if g.REPLY and $('img.favicon').src is Favicon.empty watcher.watch null, g.THREAD_ID else - value = $('input[name=resto]').value - threads = $$ 'div.op' - for thread in threads - if thread.id is value and $('img.favicon', thread).src is Favicon.empty - watcher.watch thread, value + id = $('input[name=resto]').value + op = d.getElementById id + if $('img.favicon', op).src is Favicon.empty + watcher.watch op, id if isQR if span = @nextSibling From bba678a8b1955b53e99b55d5025360c5c8c5b6b5 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 7 May 2011 15:55:59 -0700 Subject: [PATCH 16/18] push titlebar down --- 4chan_x.js | 12 +++++++++--- script.coffee | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index ba90d4612..b381115ef 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -171,7 +171,7 @@ } else { el.style.bottom = '0px'; } - el.querySelector('div.move').addEventListener('mousedown', ui.dragstart, true); + el.querySelector('div.move').addEventListener('mousedown', ui.dragstart, false); if ((_ref3 = el.querySelector('div.move a[name=close]')) != null) { _ref3.addEventListener('click', (function() { return el.parentNode.removeChild(el); @@ -1132,11 +1132,14 @@ var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, form, html, spoiler; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); - html = "
X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' }, html); + $.bind($('input[name=name]', dialog), 'mousedown', function(e) { + return e.stopPropagation(); + }); el = $('#autohide', dialog); $.bind(el, 'click', qr.cb.autohide); if ($('.postarea label')) { @@ -2274,10 +2277,13 @@ #qr > div.move {\ text-align: right;\ }\ + #qr > div.move > input[name=name] {\ + float: left;\ + }\ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ display: none;\ }\ - #qr form {\ + #qr {\ width: 302px;\ }\ #qr form, #qr #com_submit, #qr input[type="file"] {\ diff --git a/script.coffee b/script.coffee index 4f9194936..117e47d4e 100644 --- a/script.coffee +++ b/script.coffee @@ -95,7 +95,7 @@ ui = top = localStorage["#{id}Top"] ? top if left then el.style.left = left else el.style.right = '0px' if top then el.style.top = top else el.style.bottom = '0px' - el.querySelector('div.move').addEventListener 'mousedown', ui.dragstart, true + el.querySelector('div.move').addEventListener 'mousedown', ui.dragstart, false el.querySelector('div.move a[name=close]')?.addEventListener 'click', (-> el.parentNode.removeChild(el)), true el @@ -872,11 +872,15 @@ qr = MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop() html = " -
X
-
+
+ + Quick Reply + + X +
+ -
@@ -886,6 +890,8 @@ qr =
" dialog = ui.dialog 'qr', top: '0px', left: '0px', html + + $.bind $('input[name=name]', dialog), 'mousedown', (e) -> e.stopPropagation() el = $ '#autohide', dialog $.bind el, 'click', qr.cb.autohide @@ -1792,10 +1798,13 @@ main = #qr > div.move { text-align: right; } + #qr > div.move > input[name=name] { + float: left; + } #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ display: none; } - #qr form { + #qr { width: 302px; } #qr form, #qr #com_submit, #qr input[type="file"] { From 511d774c7a8bba1aceda44bfdc1ab213f3113870 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 7 May 2011 16:16:47 -0700 Subject: [PATCH 17/18] fix submit cb, error notifications --- 4chan_x.js | 7 +++---- script.coffee | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index b381115ef..d29a6b5db 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1129,10 +1129,10 @@ } }, dialog: function(link) { - var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, form, html, spoiler; + var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, html, spoiler; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); - html = "
Quick Reply X
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' @@ -1155,8 +1155,7 @@ className: 'inputtext', required: true }); - form = dialog.lastElementChild; - $.bind(form, 'submit', qr.cb.submit); + $.bind($('form', dialog), 'submit', qr.cb.submit); $.bind($('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener); $.append(d.body, dialog); return dialog; diff --git a/script.coffee b/script.coffee index 117e47d4e..c6a368a00 100644 --- a/script.coffee +++ b/script.coffee @@ -888,6 +888,7 @@ qr =
+
" dialog = ui.dialog 'qr', top: '0px', left: '0px', html @@ -908,8 +909,7 @@ qr = className: 'inputtext' required: true - form = dialog.lastElementChild - $.bind form, 'submit', qr.cb.submit + $.bind $('form', dialog), 'submit', qr.cb.submit $.bind $('input[name=recaptcha_response_field]', clone), 'keydown', Recaptcha.listener $.append d.body, dialog From 1b7d35cb043f03f4ceff1cb136e4296f18b04b7b Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 7 May 2011 16:18:09 -0700 Subject: [PATCH 18/18] rm file://* --- header | 1 - 1 file changed, 1 deletion(-) diff --git a/header b/header index 74b4d032e..1e96c45ad 100644 --- a/header +++ b/header @@ -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==