From d96f27f09c60b55af4383c86db472e1d7576f7c0 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 25 Sep 2011 23:33:04 -0700 Subject: [PATCH] opera --- 4chan_x.user.js | 18 +++++++++++++++--- script.coffee | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) 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
" + (g.REPLY ? "" : '') + " " + QR.spoiler + "
"); + QR.qr = qr = ui.dialog('qr', 'top: 0; right: 0;', " X
File
" + (g.REPLY ? "" : '') + " " + QR.spoiler + "
"); 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