diff --git a/4chan_x.user.js b/4chan_x.user.js index 2a88e5d3a..ed8bb0977 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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;', '\
\ Quick Reply \ @@ -1586,6 +1587,12 @@ \
\ '); + 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': diff --git a/changelog b/changelog index de1e73209..48ae74871 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- desuwa + New option: remember the size of the QR on Firefox. - aeosynth prevent post form flicker - Mayhem diff --git a/script.coffee b/script.coffee index cbf62db6b..0602c234b 100644 --- a/script.coffee +++ b/script.coffee @@ -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 =
' + 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