diff --git a/4chan_x.user.js b/4chan_x.user.js
index e5726dccb..2ea3fdb0b 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -1371,30 +1371,51 @@
}
},
dialog: function(text, tid) {
- var c, l, m, qr, ta;
+ var l, qr, ta;
if (text == null) {
text = '';
}
QR.qr = qr = ui.dialog('qr', {
top: '0',
left: '0'
- }, " X
Quick Reply
");
- c = d.cookie;
- $('[name=name]', qr).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
- $('[name=email]', qr).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
- $('[name=pwd]', qr).value = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value;
- $('textarea', qr).value = text;
+ }, " X ", {
+ /*
+ "
+ X
+ Quick Reply
+
+
+
+
+ "
+ #XXX use dom methods to set values instead of injecting raw user input into your html -_-;
+ c = d.cookie
+ $('[name=name]', qr).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else ''
+ $('[name=email]', qr).value = if m = c.match(/4chan_email=([^;]+)/) then decodeURIComponent m[1] else ''
+ $('[name=pwd]', qr).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value
+ $('textarea', qr).value = text
+ QR.captchaLength()
+ QR.cooldown() if conf['Cooldown']
+ $.bind $('.close', qr), 'click', QR.close
+ $.bind $('form', qr), 'submit', QR.submit
+ $.bind $('#recaptcha_response_field', qr), 'keydown', QR.keydown
+ $.bind $('#recaptcha_response_field', qr), 'keydown', Recaptcha.listener
+ $.bind $('[type=file]', qr), 'change', QR.change
+ $.bind $('#attach', qr), 'click', QR.attach
+ */
+ });
QR.captchaImg();
- QR.captchaLength();
- if (conf['Cooldown']) {
- QR.cooldown();
- }
- $.bind($('.close', qr), 'click', QR.close);
- $.bind($('form', qr), 'submit', QR.submit);
- $.bind($('#recaptcha_response_field', qr), 'keydown', QR.keydown);
- $.bind($('#recaptcha_response_field', qr), 'keydown', Recaptcha.listener);
- $.bind($('[type=file]', qr), 'change', QR.change);
- $.bind($('#attach', qr), 'click', QR.attach);
$.append(d.body, qr);
ta = $('textarea', qr);
l = text.length;
@@ -3275,7 +3296,7 @@
div.dialog > div.move {\
cursor: move;\
}\
- label, a, .favicon, #qr img {\
+ label, a, .favicon {\
cursor: pointer;\
}\
\
@@ -3285,9 +3306,6 @@
.error {\
color: red;\
}\
- #qr .error:not([href]) {\
- cursor: default;\
- }\
td.replyhider {\
vertical-align: top;\
}\
@@ -3365,47 +3383,6 @@
margin: 0;\
width: 100%;\
}\
-\
- #qr {\
- position: fixed;\
- max-height: 100%;\
- overflow-x: hidden;\
- overflow-y: auto;\
- }\
- #qr > div.move {\
- text-align: right;\
- }\
- #qr input[name=name] {\
- float: left;\
- }\
- #qr_form {\
- clear: left;\
- }\
- #qr_form, #qr #com_submit, #qr input[name=upfile] {\
- margin: 0;\
- }\
- #qr textarea {\
- width: 100%;\
- height: 125px;\
- }\
- #qr .close, #qr #autohide {\
- float: right;\
- }\
- #qr:not(:hover) > #autohide:checked ~ form {\
- height: 0;\
- overflow: hidden;\
- }\
- /* 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 img {\
- border: 1px solid #AAA;\
- }\
\
#updater {\
position: fixed;\
@@ -3471,6 +3448,32 @@
#files > input {\
display: block;\
}\
+ #qr {\
+ position: fixed;\
+ }\
+ #qr #autohide, #qr .close {\
+ float: right;\
+ }\
+ #qr:not(:hover) #autohide:checked ~ .autohide {\
+ height: 0;\
+ overflow: hidden;\
+ }\
+ #qr textarea {\
+ border: 0;\
+ height: 125;\
+ width: 100%;\
+ }\
+ #qr #captcha {\
+ position: relative;\
+ }\
+ #qr #cl {\
+ right: 0;\
+ padding: 2px;\
+ position: absolute;\
+ }\
+ #qr #recaptcha_response_field {\
+ width: 100%;\
+ }\
'
};
main.init();
diff --git a/script.coffee b/script.coffee
index bfd3ee7c0..a14e8ce8a 100644
--- a/script.coffee
+++ b/script.coffee
@@ -1068,6 +1068,31 @@ QR =
QR.submit() if $('#auto', QR.qr).checked
dialog: (text='', tid) ->
QR.qr = qr = ui.dialog 'qr', top: '0', left: '0', "
+ X
+
+
+
+
+
+
+ 120 Captchas
+
+
+
+
+
+ Derp
+
+
+ "
+
+ ###
+ "
X
Quick Reply