Merge branch 'master' of github.com:aeosynth/4chan-x
This commit is contained in:
commit
1a4c0429a3
@ -1183,7 +1183,9 @@
|
||||
return cooldown.start();
|
||||
}
|
||||
});
|
||||
return $('.postarea form').action += '?cooldown';
|
||||
if (g.REPLY) {
|
||||
return $('.postarea form').action += '?cooldown';
|
||||
}
|
||||
},
|
||||
start: function() {
|
||||
var submit, _i, _len, _ref;
|
||||
@ -1216,7 +1218,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 +1298,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'
|
||||
@ -1876,17 +1878,20 @@
|
||||
},
|
||||
watch: function(thread, id) {
|
||||
var el, props, watched, _name;
|
||||
el = $('span.filetitle');
|
||||
if (!el.textContent) {
|
||||
el = $('blockquote');
|
||||
if (!el.textContent) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
el = $('span.filetitle', thread);
|
||||
props = {
|
||||
textContent: "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25)),
|
||||
href: "/" + g.BOARD + "/res/" + id
|
||||
};
|
||||
if (!el.textContent) {
|
||||
el = $('blockquote', thread);
|
||||
if (el.textContent) {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
} else {
|
||||
props.textContent = d.title;
|
||||
}
|
||||
} else {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
}
|
||||
watched = $.get('watched', {});
|
||||
watched[_name = g.BOARD] || (watched[_name] = {});
|
||||
watched[g.BOARD][id] = props;
|
||||
@ -2283,9 +2288,10 @@
|
||||
} else {
|
||||
qp.innerHTML = "Loading " + id + "...";
|
||||
threadID = this.pathname.split('/').pop() || $.x('ancestor::div[@class="thread"]/div', this).id;
|
||||
return $.cache(this.pathname, (function() {
|
||||
$.cache(this.pathname, (function() {
|
||||
return quotePreview.parse(this, id, threadID);
|
||||
}));
|
||||
return ui.hover();
|
||||
}
|
||||
},
|
||||
mouseout: function() {
|
||||
|
||||
@ -1,3 +1,10 @@
|
||||
GitHub
|
||||
- mayhem:
|
||||
bring back auto posting
|
||||
don't start the cooldown on thread creation
|
||||
- aeosynth:
|
||||
show linebreaks as spaces in title & watcher
|
||||
|
||||
11.8.15
|
||||
- aeosynth:
|
||||
convert qr from hidden iframes to ajax
|
||||
|
||||
@ -938,7 +938,7 @@ cooldown =
|
||||
$.set g.BOARD+'/cooldown', time if $.get(g.BOARD+'/cooldown', 0) < time
|
||||
cooldown.start() if Date.now() < $.get g.BOARD+'/cooldown', 0
|
||||
$.bind window, 'storage', (e) -> cooldown.start() if e.key is "#{NAMESPACE}#{g.BOARD}/cooldown"
|
||||
$('.postarea form').action += '?cooldown'
|
||||
$('.postarea form').action += '?cooldown' if g.REPLY
|
||||
|
||||
start: ->
|
||||
cooldown.duration = Math.ceil ($.get(g.BOARD+'/cooldown', 0) - Date.now()) / 1000
|
||||
@ -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>
|
||||
@ -1538,14 +1538,17 @@ watcher =
|
||||
watcher.refresh()
|
||||
|
||||
watch: (thread, id) ->
|
||||
el = $ 'span.filetitle'
|
||||
if not el.textContent
|
||||
el = $ 'blockquote'
|
||||
if not el.textContent
|
||||
return
|
||||
el = $ 'span.filetitle', thread
|
||||
props =
|
||||
textContent: "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
href: "/#{g.BOARD}/res/#{id}"
|
||||
if not el.textContent
|
||||
el = $ 'blockquote', thread
|
||||
if el.textContent
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
else
|
||||
props.textContent = d.title
|
||||
else
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
|
||||
watched = $.get 'watched', {}
|
||||
watched[g.BOARD] or= {}
|
||||
@ -1788,6 +1791,7 @@ quotePreview =
|
||||
qp.innerHTML = "Loading #{id}..."
|
||||
threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id
|
||||
$.cache @pathname, (-> quotePreview.parse @, id, threadID)
|
||||
ui.hover()
|
||||
mouseout: ->
|
||||
$.removeClass el, 'qphl' if el = $.id @hash[1..]
|
||||
ui.hoverend()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user