Hide the normal post form by default, optional. Close #173.

This commit is contained in:
Nicolas Stepien 2012-02-03 15:01:02 +01:00
parent ad3e363bf2
commit 6e06d6b945
3 changed files with 21 additions and 2 deletions

View File

@ -117,7 +117,8 @@
'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'],
'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'],
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
'Remember Spoiler': [false, 'Remember the spoiler state, 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.']
},
Quoting: {
'Quote Backlinks': [true, 'Add quote backlinks'],
@ -1200,8 +1201,17 @@
qr = {
init: function() {
var iframe, loadChecking;
var form, iframe, link, loadChecking;
if (!$.id('recaptcha_challenge_field_holder')) return;
if (conf['Hide Original Post Form']) {
link = $.el('h1', {
innerHTML: "<a href=javascript:;>" + (g.REPLY ? 'Open the Quick Reply' : 'Create a New Thread') + "</a>"
});
$.on($('a', link), 'click', qr.open);
form = d.forms[0];
form.hidden = true;
$.before(form, link);
}
g.callbacks.push(function(root) {
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
});

View File

@ -1,4 +1,6 @@
master
- Mayhem
Hide the normal post form by default, optional.
2.25.4
- Mayhem

View File

@ -38,6 +38,7 @@ config =
'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.']
'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.']
Quoting:
'Quote Backlinks': [true, 'Add quote backlinks']
'OP Backlinks': [false, 'Add backlinks to the OP']
@ -862,6 +863,12 @@ nav =
qr =
init: ->
return unless $.id 'recaptcha_challenge_field_holder'
if conf['Hide Original Post Form']
link = $.el 'h1', innerHTML: "<a href=javascript:;>#{if g.REPLY then 'Open the Quick Reply' else 'Create a New Thread'}</a>"
$.on $('a', link), 'click', qr.open
form = d.forms[0]
form.hidden = true
$.before form, link
g.callbacks.push (root) ->
$.on $('.quotejs + .quotejs', root), 'click', qr.quote