From 9d91bcf50588f7a8df2a7737defd69720b3ed326 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 18 May 2011 23:02:43 +0200 Subject: [PATCH] Fetch name, mail and pass in cookies at each qr opening. --- 4chan_x.js | 8 ++++---- script.coffee | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 48e6dfe29..aef6b17f0 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1139,14 +1139,14 @@ } }, dialog: function(link) { - var MAX_FILE_SIZE, THREAD_ID, challenge, dialog, html, mail, name, pass, spoiler, src; + var MAX_FILE_SIZE, THREAD_ID, challenge, dialog, html, m, mail, name, pass, spoiler, src; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; challenge = $('input[name=recaptcha_challenge_field]').value; src = "http://www.google.com/recaptcha/api/image?c=" + challenge; - name = $('input[name=name]').value; - mail = $('input[name=email]').value; - pass = $('input[name=pwd]').value; + name = (m = d.cookie.match(/4chan_name=([^;]+)/)) ? unescape(m[1]) : ''; + mail = (m = d.cookie.match(/4chan_email=([^;]+)/)) ? unescape(m[1]) : ''; + pass = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? unescape(m[1]) : $('input[name=pwd]').value; html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', diff --git a/script.coffee b/script.coffee index 4da2cbb1e..7a1995ee9 100644 --- a/script.coffee +++ b/script.coffee @@ -901,9 +901,9 @@ qr = THREAD_ID = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', link).id challenge = $('input[name=recaptcha_challenge_field]').value src = "http://www.google.com/recaptcha/api/image?c=#{challenge}" - name = $('input[name=name]').value - mail = $('input[name=email]').value - pass = $('input[name=pwd]').value + name = if m = d.cookie.match(/4chan_name=([^;]+)/) then unescape m[1] else '' + mail = if m = d.cookie.match(/4chan_email=([^;]+)/) then unescape m[1] else '' + pass = if m = d.cookie.match(/4chan_pass=([^;]+)/) then unescape m[1] else $('input[name=pwd]').value html = "