Merge pull request #182 from desuwa/qrsize

Remember the size of the QR on Firefox
This commit is contained in:
Mayhem 2012-02-09 16:16:13 -08:00
commit 1e30d8af6c
3 changed files with 16 additions and 1 deletions

View File

@ -118,6 +118,7 @@
'Cooldown': [true, 'Prevent "flood detected" errors.'],
'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'],
'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'],
'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).'],
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR.']
@ -1570,7 +1571,7 @@
}
},
dialog: function() {
var e, fileInput, input, mimeTypes, name, spoiler, thread, threads, _i, _j, _len, _len2, _ref, _ref2;
var e, fileInput, input, mimeTypes, name, spoiler, ta, thread, threads, _i, _j, _len, _len2, _ref, _ref2;
qr.el = ui.dialog('qr', 'top:0;right:0;', '\
<div class=move>\
Quick Reply <input type=checkbox id=autohide title=Auto-hide>\
@ -1586,6 +1587,12 @@
<label id=spoilerLabel><input type=checkbox id=spoiler> Spoiler Image</label>\
<div class=warning></div>\
</form>');
if (conf['Remember QR size'] && engine === 'gecko') {
$.on(ta = $('textarea', qr.el), 'mouseup', function() {
return $.set('qr.size', this.style.cssText);
});
ta.style.cssText = $.get('qr.size', '');
}
mimeTypes = $('.rules').textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) {
switch (type) {
case 'jpg':

View File

@ -1,4 +1,6 @@
master
- desuwa
New option: remember the size of the QR on Firefox.
- aeosynth
prevent post form flicker
- Mayhem

View File

@ -38,6 +38,7 @@ config =
'Cooldown': [true, 'Prevent "flood detected" errors.']
'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.']
'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.']
'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).']
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.']
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.']
'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR.']
@ -1189,6 +1190,11 @@ qr =
<div class=warning></div>
</form>'
if conf['Remember QR size'] and engine is 'gecko'
$.on ta = $('textarea', qr.el), 'mouseup', ->
$.set 'qr.size', @style.cssText
ta.style.cssText = $.get 'qr.size', ''
# Allow only this board's supported files.
mimeTypes = $('.rules').textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) ->
switch type