Bring back auto post. Close #231

This commit is contained in:
Nicolas Stepien 2011-08-23 06:14:29 +02:00
parent 450dfe5daa
commit fbdc956a9f
2 changed files with 10 additions and 7 deletions

View File

@ -1216,7 +1216,7 @@
submit.disabled = false;
submit.value = 'Submit';
}
if (!qr.postInvalid()) {
if (qr.el && $('#auto', qr.el).checked || !qr.postInvalid()) {
return qr.submit.call($('form', qr.el));
}
}
@ -1296,7 +1296,7 @@
THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id;
spoiler = $('.postarea label') ? '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' : '';
challenge = $('#recaptcha_challenge_field').value;
html = " <a id=close title=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply </div> <div class=autohide> <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=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=" + challenge + "> <input type=hidden name=mode value=regist> <div><input class=inputtext type=text name=email placeholder=E-mail>" + spoiler + "</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=http://www.google.com/recaptcha/api/image?c=" + challenge + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification autocomplete=off id=recaptcha_response_field><span class=captcha>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input type=file name=upfile></div> </form> <div id=files></div> <div><input class=inputtext type=password name=pwd placeholder=Password form=qr_form maxlength=8><a name=attach>attach another file</a></div> </div> <a id=error class=error></a> ";
html = " <a id=close title=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply </div> <div class=autohide> <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=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=" + challenge + "> <input type=hidden name=mode value=regist> <div><input class=inputtext type=text name=email placeholder=E-mail>" + spoiler + "</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=http://www.google.com/recaptcha/api/image?c=" + challenge + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification autocomplete=off id=recaptcha_response_field><span class=captcha>" + ($.get('captchas', []).length) + " captchas</span></div> <div><input type=file name=upfile></div> </form> <div id=files></div> <div><input class=inputtext type=password name=pwd placeholder=Password form=qr_form maxlength=8><a name=attach>attach another file</a></div> </div> <a id=error class=error></a> ";
qr.el = ui.dialog('qr', {
top: '0px',
left: '0px'
@ -1875,9 +1875,11 @@
return watcher.refresh();
},
watch: function(thread, id) {
var el, watched, _name;
var el, props, watched, _name;
el = $('span.filetitle', thread);
props.href = "/" + g.BOARD + "/res/" + id;
props = {
href: "/" + g.BOARD + "/res/" + id
};
if (!el.textContent) {
el = $('blockquote', thread);
if (el.textContent) {

View File

@ -958,7 +958,7 @@ cooldown =
for submit in submits
submit.disabled = false
submit.value = 'Submit'
unless qr.postInvalid()
if qr.el and $('#auto', qr.el).checked or not qr.postInvalid()
qr.submit.call $ 'form', qr.el
qr =
@ -1042,7 +1042,7 @@ qr =
<input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=#{challenge}>
<input type=hidden name=mode value=regist>
<div><input class=inputtext type=text name=email placeholder=E-mail>#{spoiler}</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><img src=http://www.google.com/recaptcha/api/image?c=#{challenge}></div>
<div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification autocomplete=off id=recaptcha_response_field><span class=captcha>#{$.get('captchas', []).length} captchas</span></div>
@ -1539,7 +1539,8 @@ watcher =
watch: (thread, id) ->
el = $ 'span.filetitle', thread
props.href = "/#{g.BOARD}/res/#{id}"
props =
href: "/#{g.BOARD}/res/#{id}"
if not el.textContent
el = $ 'blockquote', thread
if el.textContent