From 1521e0d7a36b9d21aa99e705b1174c6c47e40e55 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 8 May 2011 19:46:51 +0200 Subject: [PATCH 1/2] Fix qr inputs values if they have a space in it. Apply mail and password too. --- 4chan_x.js | 6 ++++-- script.coffee | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 1e7e0939d..c16f579fe 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1135,11 +1135,13 @@ } }, dialog: function(link) { - var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, html, name, spoiler; + var MAX_FILE_SIZE, THREAD_ID, clone, dialog, el, html, mail, name, pass, spoiler; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); name = $('input[name=name]').value; - html = "
Quick Reply X
"; + mail = $('input[name=email]').value; + pass = $('input[name=pwd]').value; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index 26ee06243..a6ac999de 100644 --- a/script.coffee +++ b/script.coffee @@ -889,9 +889,11 @@ qr = MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop() name = $('input[name=name]').value + mail = $('input[name=email]').value + pass = $('input[name=pwd]').value html = "
- + Quick Reply X @@ -899,12 +901,12 @@ qr =
-
+
-
+
" From c5aef27248608cc10a975a46c241dbf7728b7223 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 8 May 2011 23:22:57 +0200 Subject: [PATCH 2/2] Fix quote preview overflowing in some cases, remove unnecessary stuff. --- 4chan_x.js | 8 ++++---- script.coffee | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index c16f579fe..ebc555e6f 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -232,7 +232,7 @@ height = el.offsetHeight; top = clientY - 120; bot = top + height; - el.style.top = ui.winHeight < height || top < 0 ? '0px' : bot > ui.winHeight ? ui.winHeight - height + 'px' : top + 'px'; + el.style.top = ui.winHeight < height || top < 0 ? 0 : bot > ui.winHeight ? ui.winHeight - height : top; return el.style.left = clientX + 45; }, hoverend: function(e) { @@ -1714,7 +1714,8 @@ } } $.show(qp); - return ui.el = qp; + ui.el = qp; + return ui.winHeight = d.body.clientHeight; }, parse: function(req, id, threadID) { var body, html, qp, reply, _i, _len, _ref; @@ -1953,8 +1954,7 @@ el.src = this.parentNode.href; $.show(el); ui.el = el; - ui.winHeight = d.body.clientHeight; - return ui.winWidth = d.body.clientWidth; + return ui.winHeight = d.body.clientHeight; } } }; diff --git a/script.coffee b/script.coffee index a6ac999de..e05693295 100644 --- a/script.coffee +++ b/script.coffee @@ -150,11 +150,11 @@ ui = bot = top + height el.style.top = if ui.winHeight < height or top < 0 - '0px' + 0 else if bot > ui.winHeight - ui.winHeight - height + 'px' + ui.winHeight - height else - top + 'px' + top el.style.left = clientX + 45 hoverend: (e) -> $.hide ui.el @@ -1366,6 +1366,7 @@ quotePreview = g.requests[threadID] = $.get @href, (-> quotePreview.parse this, id, threadID) $.show qp ui.el = qp + ui.winHeight = d.body.clientHeight parse: (req, id, threadID) -> qp = $ '#qp' return unless qp.innerHTML is "Loading #{id}..." @@ -1516,7 +1517,6 @@ imageHover = $.show el ui.el = el ui.winHeight = d.body.clientHeight - ui.winWidth = d.body.clientWidth imgPreloading = init: ->