diff --git a/4chan_x.user.js b/4chan_x.user.js
index b85d0cf1d..7aa5cb875 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -1398,7 +1398,7 @@
QR.foo(this);
return;
}
- if (this.previousSibling.nodeName === 'BUTTON') {
+ if (this.parentNode.className === 'wat') {
QR.attach(this);
}
fr = new FileReader();
@@ -1448,7 +1448,7 @@
if (old) {
return $.replace(old, file);
} else {
- return $.after($('button', QR.qr), input);
+ return $.add($('.wat', QR.qr), input);
}
},
dialog: function(text, tid) {
@@ -1457,7 +1457,7 @@
text = '';
}
tid || (tid = g.THREAD_ID || '');
- QR.qr = qr = ui.dialog('qr', 'top: 0; right: 0;', " X
");
+ QR.qr = qr = ui.dialog('qr', 'top: 0; right: 0;', " X
");
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]) : '';
@@ -3287,6 +3287,18 @@
opacity: 0;\
pointer-events: none;\
}\
+ #qr .wat {\
+ display: inline-block;\
+ width: 30px;\
+ overflow: hidden;\
+ background: #FFF;\
+ position: relative;\
+ }\
+ #qr .wat input {\
+ opacity: 0;\
+ position: absolute;\
+ left: 0;\
+ }\
'
};
if (d.body) {
diff --git a/script.coffee b/script.coffee
index 38b43d422..e492d9166 100644
--- a/script.coffee
+++ b/script.coffee
@@ -1029,7 +1029,7 @@ QR =
alert 'Error: File too large.'
QR.foo @
return
- if @previousSibling.nodeName is 'BUTTON'
+ if @parentNode.className is 'wat'
QR.attach @
fr = new FileReader()
img = $ 'img', @parentNode
@@ -1064,7 +1064,7 @@ QR =
if old
$.replace old, file
else
- $.after $('button', QR.qr), input
+ $.add $('.wat', QR.qr), input
dialog: (text='', tid) ->
tid or= g.THREAD_ID or ''
QR.qr = qr = ui.dialog 'qr', 'top: 0; right: 0;', "
@@ -1074,7 +1074,7 @@ QR =
-
+ File
@@ -2540,6 +2540,18 @@ Main =
opacity: 0;
pointer-events: none;
}
+ #qr .wat {
+ display: inline-block;
+ width: 30px;
+ overflow: hidden;
+ background: #FFF;
+ position: relative;
+ }
+ #qr .wat input {
+ opacity: 0;
+ position: absolute;
+ left: 0;
+ }
'
if d.body