create threads

This commit is contained in:
James Campos 2011-09-05 19:02:43 -07:00
parent 934cc321ff
commit 5abf8531df
2 changed files with 18 additions and 11 deletions

View File

@ -1389,7 +1389,7 @@
},
cooldown: function() {
var b, n, now;
if (!QR.qr) {
if (!(g.REPLY && QR.qr)) {
return;
}
cooldown = $.get("cooldown/" + g.BOARD, 0);
@ -1417,13 +1417,11 @@
if (text == null) {
text = '';
}
if (tid == null) {
tid = g.THREAD_ID;
}
tid || (tid = g.THREAD_ID || '');
QR.qr = qr = ui.dialog('qr', {
top: '0',
left: '0'
}, " <a class=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <span class=click> <button>File</button> <input form=qr_form placeholder=Subject name=sub> <input form=qr_form placeholder=Name name=name> <input form=qr_form placeholder=Email name=email> <input form=qr_form placeholder=Password name=pwd type=password> </span> </div> <textarea form=qr_form placeholder=Comment name=com></textarea> <div id=files></div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <div hidden> <input name=resto value=" + tid + "> <input name=mode value=regist> <input name=recaptcha_challenge_field id=challenge> <input name=recaptcha_response_field id=response> </div> <div id=captcha> <div><img></div> <span id=cl>120 Captchas</span> <input id=recaptcha_response_field autocomplete=off> </div> <div> <button>Submit</button> <label>[<input type=checkbox id=autopost title=autopost> Autopost]</label> " + QR.spoiler + " </div> <a class=error></span> </form> ");
}, " <a class=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <span class=click> <button>File</button> <input form=qr_form placeholder=Subject name=sub> <input form=qr_form placeholder=Name name=name> <input form=qr_form placeholder=Email name=email> <input form=qr_form placeholder=Password name=pwd type=password> </span> </div> <textarea form=qr_form placeholder=Comment name=com></textarea> <div id=files></div> <form enctype=multipart/form-data method=post action=http://sys.4chan.org/" + g.BOARD + "/post target=iframe id=qr_form> <div hidden> <input name=mode value=regist> <input name=recaptcha_challenge_field id=challenge> <input name=recaptcha_response_field id=response> </div> <div id=captcha> <div><img></div> <span id=cl>120 Captchas</span> <input id=recaptcha_response_field autocomplete=off> </div> <div> <button>Submit</button> " + (g.REPLY ? "<label>[<input type=checkbox id=autopost title=autopost> Autopost]</label>" : '') + " <input form=qr_form placeholder=Thread name=resto value=" + tid + " " + (g.REPLY ? 'hidden' : '') + "> " + QR.spoiler + " </div> <a class=error></span> </form> ");
c = d.cookie;
$('[name=name]', qr).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
$('[name=email]', qr).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
@ -1457,7 +1455,7 @@
return QR.submit();
},
quote: function(e, blank) {
var i, id, qr, s, sel, ss, ta, text, tid, v, _ref, _ref2;
var i, id, qr, s, sel, ss, ta, text, tid, v, _base, _ref, _ref2;
if (e != null) {
e.preventDefault();
}
@ -1482,7 +1480,8 @@
ta.value = v.slice(0, ss) + text + v.slice(ss);
i = ss + text.length;
ta.setSelectionRange(i, i);
return ta.focus();
ta.focus();
return (_base = $('[name=resto]', qr)).value || (_base.value = tid);
},
receive: function(e) {
var data, qr, row, tc, _ref, _ref2;
@ -3523,6 +3522,9 @@
max-height: 250px;\
max-width: 250px;\
}\
#qr input[name=resto] {\
width: 80px;\
}\
'
};
main.init();

View File

@ -1051,7 +1051,7 @@ QR =
$.rm QR.qr
QR.qr = null
cooldown: ->
return unless QR.qr
return unless g.REPLY and QR.qr
cooldown = $.get "cooldown/#{g.BOARD}", 0
now = Date.now()
n = Math.ceil (cooldown - now) / 1000
@ -1066,7 +1066,8 @@ QR =
textContent: 'Submit'
disabled: false
QR.submit() if $('#autopost', QR.qr).checked
dialog: (text='', tid=g.THREAD_ID) ->
dialog: (text='', tid) ->
tid or= g.THREAD_ID or ''
QR.qr = qr = ui.dialog 'qr', top: '0', left: '0', "
<a class=close>X</a>
<input type=checkbox id=autohide title=autohide>
@ -1083,7 +1084,6 @@ QR =
<div id=files></div>
<form enctype=multipart/form-data method=post action=http://sys.4chan.org/#{g.BOARD}/post target=iframe id=qr_form>
<div hidden>
<input name=resto value=#{tid}>
<input name=mode value=regist>
<input name=recaptcha_challenge_field id=challenge>
<input name=recaptcha_response_field id=response>
@ -1095,7 +1095,8 @@ QR =
</div>
<div>
<button>Submit</button>
<label>[<input type=checkbox id=autopost title=autopost> Autopost]</label>
#{if g.REPLY then "<label>[<input type=checkbox id=autopost title=autopost> Autopost]</label>" else ''}
<input form=qr_form placeholder=Thread name=resto value=#{tid} #{if g.REPLY then 'hidden' else ''}>
#{QR.spoiler}
</div>
<a class=error></span>
@ -1148,6 +1149,7 @@ QR =
i = ss + text.length
ta.setSelectionRange i, i
ta.focus()
$('[name=resto]', qr).value or= tid
receive: (e) ->
$('iframe[name=iframe]').src = 'about:blank'
{qr} = QR
@ -2791,6 +2793,9 @@ main =
max-height: 250px;
max-width: 250px;
}
#qr input[name=resto] {
width: 80px;
}
'
main.init()