diff options
| author | Michael Walker <mike@barrucadu.co.uk> | 2016-03-05 04:16:46 +0000 |
|---|---|---|
| committer | Michael Walker <mike@barrucadu.co.uk> | 2016-03-05 04:16:46 +0000 |
| commit | 30d93e4971cf8dda132d10ddafa0ee9a6c93f534 (patch) | |
| tree | 70c00ba72d329b5186d4ffa66a33f1c265c18ec8 | |
| parent | ab22f78973f9162c1e068a733a984b7f495052d9 (diff) | |
| parent | 0bb214a3d1c00bee32179058b08d7dc3d5fbb16c (diff) | |
Merge pull request #41 from 0xjove/report405
Reports from the all board fix.
| -rw-r--r-- | js/quick-post-controls.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/js/quick-post-controls.js b/js/quick-post-controls.js index 10d74f98..62dfa1e0 100644 --- a/js/quick-post-controls.js +++ b/js/quick-post-controls.js @@ -39,10 +39,20 @@ $(document).ready(function(){ ' <input type="submit" name="report" value="'+_('Report')+'">' + '</div>' + '</form>'); - post_form + if($('form[name="post"]:first').size()){ + post_form .attr('action', $('form[name="post"]:first').attr('action')) - .append($('input[name=board]:first').clone()) - .find('input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) { + .append($('input[name=board]:first').clone()); + }else{ + var board=$(this).parent().parent().parent().attr("data-board"); + if(board){ + post_form.attr('action', '/post.php'); //doesn't respect $config["root"] but... + post_form.append('<input type="hidden" value="'+board+'" name="board" />'); + }else{ + return;//better not to show a form if it isn't going to work + } + } + post_form.find('input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) { if(e.which == 13) { e.preventDefault(); if($(this).attr('name') == 'password') { |
