Auto post.

This commit is contained in:
Nicolas Stepien 2011-06-04 02:18:55 +02:00
parent 77da6ef8a7
commit 04c09dc767
2 changed files with 8 additions and 2 deletions

View File

@ -1052,6 +1052,9 @@
} else { } else {
submit.disabled = false; submit.disabled = false;
submit.value = 'Submit'; submit.value = 'Submit';
if ($('#auto').checked) {
$('#qr_form').submit();
}
} }
} }
if (!cooldown.duration) { if (!cooldown.duration) {
@ -1186,7 +1189,7 @@
name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
mail = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; mail = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
pass = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; pass = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value;
html = " <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form value=\"" + name + "\"> Quick Reply <input type=checkbox id=autohide title=autohide> <a name=close title=close>X</a> </div> <form name=post action=http://sys.4chan.org/" + g.BOARD + "/post method=POST enctype=multipart/form-data target=iframe id=qr_form> <input type=hidden name=MAX_FILE_SIZE value=" + MAX_FILE_SIZE + "> <input type=hidden name=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field value=" + challenge + "> <div><input class=inputtext type=text name=email placeholder=E-mail value=\"" + mail + "\"></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=" + submitValue + " id=com_submit " + submitDisabled + "></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><img src=" + src + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off></div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password value=\"" + pass + "\"><input type=hidden name=mode value=regist></div> </form> <div id=error class=error></div> "; html = " <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form value=\"" + name + "\"> Quick Reply <input type=checkbox id=autohide title=autohide> <a name=close title=close>X</a> </div> <form name=post action=http://sys.4chan.org/" + g.BOARD + "/post method=POST enctype=multipart/form-data target=iframe id=qr_form> <input type=hidden name=MAX_FILE_SIZE value=" + MAX_FILE_SIZE + "> <input type=hidden name=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field value=" + challenge + "> <div><input class=inputtext type=text name=email placeholder=E-mail value=\"" + mail + "\"></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=" + submitValue + " id=com_submit " + submitDisabled + "><label><input type=checkbox id=auto>auto</label></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><img src=" + src + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off></div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password value=\"" + pass + "\"><input type=hidden name=mode value=regist></div> </form> <div id=error class=error></div> ";
dialog = ui.dialog('qr', { dialog = ui.dialog('qr', {
top: '0px', top: '0px',
left: '0px' left: '0px'
@ -1195,6 +1198,7 @@
return e.stopPropagation(); return e.stopPropagation();
}); });
$.bind($('#autohide', dialog), 'click', qr.cb.autohide); $.bind($('#autohide', dialog), 'click', qr.cb.autohide);
$.bind($('#auto', dialog), 'click', qr.autohide.set);
$.bind($('img', dialog), 'click', Recaptcha.reload); $.bind($('img', dialog), 'click', Recaptcha.reload);
if ($('.postarea label')) { if ($('.postarea label')) {
spoiler = $.el('label', { spoiler = $.el('label', {

View File

@ -799,6 +799,7 @@ cooldown =
else else
submit.disabled = false submit.disabled = false
submit.value = 'Submit' submit.value = 'Submit'
$('#qr_form').submit() if $('#auto').checked
window.clearInterval cooldown.interval unless cooldown.duration window.clearInterval cooldown.interval unless cooldown.duration
@ -926,7 +927,7 @@ qr =
<input type=hidden name=resto value=#{THREAD_ID}> <input type=hidden name=resto value=#{THREAD_ID}>
<input type=hidden name=recaptcha_challenge_field value=#{challenge}> <input type=hidden name=recaptcha_challenge_field value=#{challenge}>
<div><input class=inputtext type=text name=email placeholder=E-mail value=\"#{mail}\"></div> <div><input class=inputtext type=text name=email placeholder=E-mail value=\"#{mail}\"></div>
<div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=#{submitValue} id=com_submit #{submitDisabled}></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=#{submitValue} id=com_submit #{submitDisabled}><label><input type=checkbox id=auto>auto</label></div>
<div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div>
<div><img src=#{src}></div> <div><img src=#{src}></div>
<div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off></div>
@ -939,6 +940,7 @@ qr =
$.bind $('input[name=name]', dialog), 'mousedown', (e) -> e.stopPropagation() $.bind $('input[name=name]', dialog), 'mousedown', (e) -> e.stopPropagation()
$.bind $('#autohide', dialog), 'click', qr.cb.autohide $.bind $('#autohide', dialog), 'click', qr.cb.autohide
$.bind $('#auto', dialog), 'click', qr.autohide.set
$.bind $('img', dialog), 'click', Recaptcha.reload $.bind $('img', dialog), 'click', Recaptcha.reload
if $ '.postarea label' if $ '.postarea label'