qr remix: Fix spoiler only on spoiler powered boards. Fix max file input size. More styling.

This commit is contained in:
Nicolas Stepien 2011-05-05 00:30:35 +02:00
parent 20ecad055d
commit 5fcc459ca2
2 changed files with 46 additions and 22 deletions

View File

@ -1141,17 +1141,25 @@
} }
}, },
dialog: function(link) { dialog: function(link) {
var clone, dialog, el, html, resto, script, xpath, _i, _len, _ref; var clone, dialog, el, html, resto, script, spoiler, xpath, _i, _len, _ref;
html = " <div class=move>Quick Reply <input type=checkbox id=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> <input type=hidden name=MAX_FILE_SIZE value=3145728> <div><input class=inputtext type=text name=name placeholder=Name></div> <div><input class=inputtext type=text name=email placeholder=E-mail> <label>[<input type=checkbox name=spoiler>Spoiler Image?]</label></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=Submit id=com_submit></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div id=qr_captcha></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></div> </form> "; html = " <div class=move>Quick Reply <input type=checkbox id=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> <input type=hidden name=MAX_FILE_SIZE> <div><input class=inputtext type=text name=name placeholder=Name></div> <div><input class=inputtext type=text name=email placeholder=E-mail></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=Submit id=com_submit></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div id=qr_captcha></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></div> </form> ";
dialog = ui.dialog('qr', { dialog = ui.dialog('qr', {
top: '0px', top: '0px',
left: '0px' left: '0px'
}, html); }, html);
el = $('#autohide', dialog); el = $('#autohide', dialog);
$.bind(el, 'click', qr.cb.autohide); $.bind(el, 'click', qr.cb.autohide);
$('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value;
if ($('.postarea label')) {
spoiler = $.el('label', {
innerHTML: " [<input type=checkbox name=spoiler>Spoiler Image?]"
});
$.append($('div:nth-of-type(2)', dialog), spoiler);
}
clone = $('#recaptcha_widget_div').cloneNode(true); clone = $('#recaptcha_widget_div').cloneNode(true);
$.append($('#qr_captcha', dialog), clone); $.append($('#qr_captcha', dialog), clone);
$('input[name=recaptcha_response_field]', clone).placeholder = 'Verification'; $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification';
$('input[name=recaptcha_response_field]', clone).className = 'inputtext';
$.append(d.body, dialog); $.append(d.body, dialog);
return; return;
clone = $('form[name=post]').cloneNode(true); clone = $('form[name=post]').cloneNode(true);
@ -2299,32 +2307,36 @@
#qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */\
display: none;\ display: none;\
}\ }\
#qr form {\ #qr form, #qr #com_submit, #qr input[type="file"] {\
margin: 0px;\ margin: 0;\
}\ }\
#qr textarea {\ #qr textarea {\
width: 300px;\ width: 302px;\
height: 80px;\ height: 80px;\
}\ }\
#qr *:not(input):not(textarea) {\ #qr *:not(input):not(textarea) {\
padding: 0px !important;\ padding: 0 !important;\
}\ }\
#qr.auto:not(:hover) form {\ #qr.auto:not(:hover) form {\
display: none;\ display: none;\
}\ }\
#qr span.error {\ #qr span.error {\
position: absolute;\ position: absolute;\
bottom: 0;\ top: 0;\
left: 0;\ left: 0;\
}\ }\
/* qr reCAPTCHA */\ /* qr reCAPTCHA */\
#qr_captcha input {\ #qr_captcha input {\
margin-top: 3px;\ border: 1px solid #AAA !important;\
margin-top: 2px;\
padding: 2px 4px 3px;\ padding: 2px 4px 3px;\
}\ }\
#qr tr {\ #qr tr {\
height: auto;\ height: auto;\
}\ }\
#qr .recaptchatable #recaptcha_image {\
border: 1px solid #AAA !important;\
}\
#qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {\ #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {\
height: 0;\ height: 0;\
width: 0;\ width: 0;\

View File

@ -878,23 +878,31 @@ qr =
html = " html = "
<div class=move>Quick Reply <input type=checkbox id=autohide> <a name=close title=close>X</a></div> <div class=move>Quick Reply <input type=checkbox id=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> <form name=post action=http://sys.4chan.org/#{g.BOARD}/post method=POST enctype=multipart/form-data>
<input type=hidden name=MAX_FILE_SIZE value=3145728> <input type=hidden name=MAX_FILE_SIZE>
<div><input class=inputtext type=text name=name placeholder=Name></div> <div><input class=inputtext type=text name=name placeholder=Name></div>
<div><input class=inputtext type=text name=email placeholder=E-mail> <label>[<input type=checkbox name=spoiler>Spoiler Image?]</label></div> <div><input class=inputtext type=text name=email placeholder=E-mail></div>
<div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=Submit id=com_submit></div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=Submit id=com_submit></div>
<div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div>
<div id=qr_captcha></div> <div id=qr_captcha></div>
<div><input type=file name=upfile></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></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist></div>
</form> </form>
" "
dialog = ui.dialog 'qr', top: '0px', left: '0px', html dialog = ui.dialog 'qr', top: '0px', left: '0px', html
el = $ '#autohide', dialog el = $ '#autohide', dialog
$.bind el, 'click', qr.cb.autohide $.bind el, 'click', qr.cb.autohide
$('input[name="MAX_FILE_SIZE"]', dialog).value = $('.postarea input[name="MAX_FILE_SIZE"]').value
if $ '.postarea label'
spoiler = $.el 'label',
innerHTML: " [<input type=checkbox name=spoiler>Spoiler Image?]"
$.append $('div:nth-of-type(2)', dialog), spoiler
clone = $('#recaptcha_widget_div').cloneNode(true) clone = $('#recaptcha_widget_div').cloneNode(true)
$.append $('#qr_captcha', dialog), clone $.append $('#qr_captcha', dialog), clone
$('input[name=recaptcha_response_field]', clone).placeholder = 'Verification' $('input[name=recaptcha_response_field]', clone).placeholder = 'Verification'
$('input[name=recaptcha_response_field]', clone).className = 'inputtext'
$.append d.body, dialog $.append d.body, dialog
return return
@ -1813,32 +1821,36 @@ main =
#qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */ #qr #recaptcha_table td:nth-of-type(3) {/* captcha logos */
display: none; display: none;
} }
#qr form { #qr form, #qr #com_submit, #qr input[type="file"] {
margin: 0px; margin: 0;
} }
#qr textarea { #qr textarea {
width: 300px; width: 302px;
height: 80px; height: 80px;
} }
#qr *:not(input):not(textarea) { #qr *:not(input):not(textarea) {
padding: 0px !important; padding: 0 !important;
} }
#qr.auto:not(:hover) form { #qr.auto:not(:hover) form {
display: none; display: none;
} }
#qr span.error { #qr span.error {
position: absolute; position: absolute;
bottom: 0; top: 0;
left: 0; left: 0;
} }
/* qr reCAPTCHA */ /* qr reCAPTCHA */
#qr_captcha input { #qr_captcha input {
margin-top: 3px; border: 1px solid #AAA !important;
margin-top: 2px;
padding: 2px 4px 3px; padding: 2px 4px 3px;
} }
#qr tr { #qr tr {
height: auto; height: auto;
} }
#qr .recaptchatable #recaptcha_image {
border: 1px solid #AAA !important;
}
#qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis { #qr #recaptcha_reload, #qr #recaptcha_switch_audio, #qr #recaptcha_whatsthis {
height: 0; height: 0;
width: 0; width: 0;