dom textarea, blank iframe on receipt, comments
This commit is contained in:
parent
bc62b6524c
commit
98a1f8a6f4
@ -1367,11 +1367,12 @@
|
|||||||
QR.qr = qr = ui.dialog('qr', {
|
QR.qr = qr = ui.dialog('qr', {
|
||||||
top: '0',
|
top: '0',
|
||||||
left: '0'
|
left: '0'
|
||||||
}, " <a class=close title=close>X</a><input type=checkbox id=autohide title=autohide> <div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <input type=hidden name=resto value=" + g.THREAD_ID + "> <input type=hidden name=mode value=regist> <input type=hidden name=recaptcha_challenge_field id=challenge> <input type=hidden name=recaptcha_response_field id=response> <div><input placeholder=Email name=email>" + QR.spoiler + "</div> <div><input placeholder=Subject name=sub><button>Submit</button><label>auto<input id=auto type=checkbox></label></div> <div><textarea placeholder=Comment name=com>" + text + "</textarea></div> <div><img src=http://www.google.com/recaptcha/api/image?c=" + QR.captcha.challenge + "></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input name=upfile type=file accept=" + QR.accept + "></div> </form> <div id=files></div> <div><input placeholder=Password name=pwd type=password><a id=attach>attach another file</a></div> <a class=error></a> ");
|
}, " <a class=close title=close>X</a><input type=checkbox id=autohide title=autohide> <div class=move><input placeholder=Name name=name form=qr_form>Quick Reply</div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <input type=hidden name=resto value=" + g.THREAD_ID + "> <input type=hidden name=mode value=regist> <input type=hidden name=recaptcha_challenge_field id=challenge> <input type=hidden name=recaptcha_response_field id=response> <div><input placeholder=Email name=email>" + QR.spoiler + "</div> <div><input placeholder=Subject name=sub><button>Submit</button><label>auto<input id=auto type=checkbox></label></div> <div><textarea placeholder=Comment name=com></textarea></div> <div><img src=http://www.google.com/recaptcha/api/image?c=" + QR.captcha.challenge + "></div> <div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input name=upfile type=file accept=" + QR.accept + "></div> </form> <div id=files></div> <div><input placeholder=Password name=pwd type=password><a id=attach>attach another file</a></div> <a class=error></a> ");
|
||||||
c = d.cookie;
|
c = d.cookie;
|
||||||
$('[name=name]', qr).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
|
$('[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=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;
|
$('[name=pwd]', qr).value = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value;
|
||||||
|
$('textarea', qr).value = text;
|
||||||
if (conf['Cooldown']) {
|
if (conf['Cooldown']) {
|
||||||
QR.cooldown;
|
QR.cooldown;
|
||||||
}
|
}
|
||||||
@ -1420,6 +1421,7 @@
|
|||||||
},
|
},
|
||||||
receive: function(e) {
|
receive: function(e) {
|
||||||
var data, tc, _ref;
|
var data, tc, _ref;
|
||||||
|
$('iframe[name=iframe]').src = 'about:blank';
|
||||||
data = e.data;
|
data = e.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -1503,8 +1505,7 @@
|
|||||||
href: href
|
href: href
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
parent.postMessage(data, '*');
|
return parent.postMessage(data, '*');
|
||||||
return window.location = 'about:blank';
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -962,6 +962,9 @@ cooldown =
|
|||||||
|
|
||||||
QR =
|
QR =
|
||||||
#FIXME DRY
|
#FIXME DRY
|
||||||
|
#index reply
|
||||||
|
#create new thread
|
||||||
|
#sys normal post form fallback
|
||||||
init: ->
|
init: ->
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
quote = $ 'a.quotejs + a', root
|
quote = $ 'a.quotejs + a', root
|
||||||
@ -1065,7 +1068,7 @@ QR =
|
|||||||
<input type=hidden name=recaptcha_response_field id=response>
|
<input type=hidden name=recaptcha_response_field id=response>
|
||||||
<div><input placeholder=Email name=email>#{QR.spoiler}</div>
|
<div><input placeholder=Email name=email>#{QR.spoiler}</div>
|
||||||
<div><input placeholder=Subject name=sub><button>Submit</button><label>auto<input id=auto type=checkbox></label></div>
|
<div><input placeholder=Subject name=sub><button>Submit</button><label>auto<input id=auto type=checkbox></label></div>
|
||||||
<div><textarea placeholder=Comment name=com>#{text}</textarea></div>
|
<div><textarea placeholder=Comment name=com></textarea></div>
|
||||||
<div><img src=http://www.google.com/recaptcha/api/image?c=#{QR.captcha.challenge}></div>
|
<div><img src=http://www.google.com/recaptcha/api/image?c=#{QR.captcha.challenge}></div>
|
||||||
<div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>#{$.get('captchas', []).length} captchas</span></div>
|
<div><input placeholder=Verification autocomplete=off id=recaptcha_response_field><span id=cl>#{$.get('captchas', []).length} captchas</span></div>
|
||||||
<div><input name=upfile type=file accept=#{QR.accept}></div>
|
<div><input name=upfile type=file accept=#{QR.accept}></div>
|
||||||
@ -1079,6 +1082,7 @@ QR =
|
|||||||
$('[name=name]', qr).value = if m = c.match(/4chan_name=([^;]+)/) then decodeURIComponent m[1] else ''
|
$('[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=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
|
$('[name=pwd]', qr).value = if m = c.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value
|
||||||
|
$('textarea', qr).value = text
|
||||||
QR.cooldown if conf['Cooldown']
|
QR.cooldown if conf['Cooldown']
|
||||||
$.bind $('.close', qr), 'click', QR.close
|
$.bind $('.close', qr), 'click', QR.close
|
||||||
$.bind $('form', qr), 'submit', QR.submit
|
$.bind $('form', qr), 'submit', QR.submit
|
||||||
@ -1115,6 +1119,7 @@ QR =
|
|||||||
ta.setSelectionRange i, i
|
ta.setSelectionRange i, i
|
||||||
ta.focus()
|
ta.focus()
|
||||||
receive: (e) ->
|
receive: (e) ->
|
||||||
|
$('iframe[name=iframe]').src = 'about:blank'
|
||||||
{data} = e
|
{data} = e
|
||||||
if data
|
if data
|
||||||
data = JSON.parse data
|
data = JSON.parse data
|
||||||
@ -1170,7 +1175,6 @@ QR =
|
|||||||
{textContent, href} = node
|
{textContent, href} = node
|
||||||
data = JSON.stringify {textContent, href}
|
data = JSON.stringify {textContent, href}
|
||||||
parent.postMessage data, '*'
|
parent.postMessage data, '*'
|
||||||
window.location = 'about:blank'
|
|
||||||
|
|
||||||
qr =
|
qr =
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user