rm qr.cb.autohide
This commit is contained in:
parent
4bb6b4cf88
commit
20242869eb
@ -1230,15 +1230,15 @@
|
|||||||
qr = {
|
qr = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var iframe;
|
var iframe;
|
||||||
|
g.callbacks.push(qr.node);
|
||||||
|
$.bind(window, 'message', qr.message);
|
||||||
|
$.bind($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode);
|
||||||
|
qr.captcha = [];
|
||||||
iframe = $.el('iframe', {
|
iframe = $.el('iframe', {
|
||||||
name: 'iframe',
|
name: 'iframe',
|
||||||
hidden: true
|
hidden: true
|
||||||
});
|
});
|
||||||
$.append(d.body, iframe);
|
$.append(d.body, iframe);
|
||||||
g.callbacks.push(qr.node);
|
|
||||||
$.bind(window, 'message', qr.message);
|
|
||||||
$.bind($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode);
|
|
||||||
qr.captcha = [];
|
|
||||||
return $('#recaptcha_response_field').id = '';
|
return $('#recaptcha_response_field').id = '';
|
||||||
},
|
},
|
||||||
attach: function() {
|
attach: function() {
|
||||||
@ -1263,12 +1263,10 @@
|
|||||||
},
|
},
|
||||||
autohide: {
|
autohide: {
|
||||||
set: function() {
|
set: function() {
|
||||||
var _ref;
|
return $('#autohide').checked = true;
|
||||||
return (_ref = $('#autohide:not(:checked)', qr.el)) != null ? _ref.click() : void 0;
|
|
||||||
},
|
},
|
||||||
unset: function() {
|
unset: function() {
|
||||||
var _ref;
|
return $('#autohide').checked = false;
|
||||||
return (_ref = $('#autohide:checked', qr.el)) != null ? _ref.click() : void 0;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
captchaNode: function(e) {
|
captchaNode: function(e) {
|
||||||
@ -1290,13 +1288,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cb: {
|
cb: {
|
||||||
autohide: function(e) {
|
|
||||||
if (this.checked) {
|
|
||||||
return $.addClass(qr.el, 'auto');
|
|
||||||
} else {
|
|
||||||
return $.removeClass(qr.el, 'auto');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
quote: function(e) {
|
quote: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return qr.quote(this);
|
return qr.quote(this);
|
||||||
@ -1313,7 +1304,7 @@
|
|||||||
THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id;
|
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>' : '';
|
spoiler = $('.postarea label') ? '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' : '';
|
||||||
challenge = $('#recaptcha_challenge_field').value;
|
challenge = $('#recaptcha_challenge_field').value;
|
||||||
html = " <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> 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=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=" + challenge + "> <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 required autocomplete=off id=recaptcha_response_field><a name=captcha title='captcha cached'>0</a></div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist><a name=attach>attach another file</a></div> </form> <div id=files></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> <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 + "> <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 required autocomplete=off id=recaptcha_response_field><a name=captcha title='captcha cached'>0</a></div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist><a name=attach>attach another file</a></div> </form> <div id=files></div> <a id=error class=error></a> ";
|
||||||
qr.el = ui.dialog('qr', {
|
qr.el = ui.dialog('qr', {
|
||||||
top: '0px',
|
top: '0px',
|
||||||
left: '0px'
|
left: '0px'
|
||||||
@ -1323,8 +1314,7 @@
|
|||||||
$.bind($('input[name=name]', qr.el), 'mousedown', function(e) {
|
$.bind($('input[name=name]', qr.el), 'mousedown', function(e) {
|
||||||
return e.stopPropagation();
|
return e.stopPropagation();
|
||||||
});
|
});
|
||||||
$.bind($('#autohide', qr.el), 'click', qr.cb.autohide);
|
$.bind($('#close', qr.el), 'click', qr.close);
|
||||||
$.bind($('a[name=close]', qr.el), 'click', qr.close);
|
|
||||||
$.bind($('form', qr.el), 'submit', qr.submit);
|
$.bind($('form', qr.el), 'submit', qr.submit);
|
||||||
$.bind($('a[name=attach]', qr.el), 'click', qr.attach);
|
$.bind($('a[name=attach]', qr.el), 'click', qr.attach);
|
||||||
$.bind($('img', qr.el), 'click', Recaptcha.reload);
|
$.bind($('img', qr.el), 'click', Recaptcha.reload);
|
||||||
@ -3002,7 +2992,10 @@
|
|||||||
width: 100%;\
|
width: 100%;\
|
||||||
height: 120px;\
|
height: 120px;\
|
||||||
}\
|
}\
|
||||||
#qr.auto:not(:hover) > form {\
|
#qr #close, #qr #autohide {\
|
||||||
|
float: right;\
|
||||||
|
}\
|
||||||
|
#qr:not(:hover) > #autohide:checked ~ form {\
|
||||||
height: 0;\
|
height: 0;\
|
||||||
overflow: hidden;\
|
overflow: hidden;\
|
||||||
}\
|
}\
|
||||||
|
|||||||
@ -1000,9 +1000,9 @@ qr =
|
|||||||
|
|
||||||
autohide:
|
autohide:
|
||||||
set: ->
|
set: ->
|
||||||
$('#autohide:not(:checked)', qr.el)?.click()
|
$('#autohide').checked = true
|
||||||
unset: ->
|
unset: ->
|
||||||
$('#autohide:checked', qr.el)?.click()
|
$('#autohide').checked = false
|
||||||
|
|
||||||
captchaNode: (e) ->
|
captchaNode: (e) ->
|
||||||
return unless qr.el
|
return unless qr.el
|
||||||
@ -1017,12 +1017,6 @@ qr =
|
|||||||
qr.push.call this
|
qr.push.call this
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
autohide: (e) ->
|
|
||||||
if @checked
|
|
||||||
$.addClass qr.el, 'auto'
|
|
||||||
else
|
|
||||||
$.removeClass qr.el, 'auto'
|
|
||||||
|
|
||||||
quote: (e) ->
|
quote: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
qr.quote @
|
qr.quote @
|
||||||
@ -1039,11 +1033,11 @@ qr =
|
|||||||
spoiler = if $('.postarea label') then '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' else ''
|
spoiler = if $('.postarea label') then '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' else ''
|
||||||
challenge = $('#recaptcha_challenge_field').value
|
challenge = $('#recaptcha_challenge_field').value
|
||||||
html = "
|
html = "
|
||||||
|
<a id=close title=close>X</a>
|
||||||
|
<input type=checkbox id=autohide title=autohide>
|
||||||
<div class=move>
|
<div class=move>
|
||||||
<input class=inputtext type=text name=name placeholder=Name form=qr_form>
|
<input class=inputtext type=text name=name placeholder=Name form=qr_form>
|
||||||
Quick Reply
|
Quick Reply
|
||||||
<input type=checkbox id=autohide title=autohide>
|
|
||||||
<a name=close title=close>X</a>
|
|
||||||
</div>
|
</div>
|
||||||
<form name=post action=http://sys.4chan.org/#{g.BOARD}/post method=POST enctype=multipart/form-data target=iframe id=qr_form>
|
<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=resto value=#{THREAD_ID}>
|
||||||
@ -1065,8 +1059,7 @@ qr =
|
|||||||
$('textarea', qr.el).value = $('textarea').value
|
$('textarea', qr.el).value = $('textarea').value
|
||||||
|
|
||||||
$.bind $('input[name=name]', qr.el), 'mousedown', (e) -> e.stopPropagation()
|
$.bind $('input[name=name]', qr.el), 'mousedown', (e) -> e.stopPropagation()
|
||||||
$.bind $('#autohide', qr.el), 'click', qr.cb.autohide
|
$.bind $('#close', qr.el), 'click', qr.close
|
||||||
$.bind $('a[name=close]', qr.el), 'click', qr.close
|
|
||||||
$.bind $('form', qr.el), 'submit', qr.submit
|
$.bind $('form', qr.el), 'submit', qr.submit
|
||||||
$.bind $('a[name=attach]', qr.el), 'click', qr.attach
|
$.bind $('a[name=attach]', qr.el), 'click', qr.attach
|
||||||
$.bind $('img', qr.el), 'click', Recaptcha.reload
|
$.bind $('img', qr.el), 'click', Recaptcha.reload
|
||||||
@ -2392,7 +2385,10 @@ main =
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
}
|
}
|
||||||
#qr.auto:not(:hover) > form {
|
#qr #close, #qr #autohide {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#qr:not(:hover) > #autohide:checked ~ form {
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user