diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-15 10:16:33 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-15 10:16:33 +1000 |
| commit | 91e973fd6e63cf2a81ec8618f360a79d56ee99b3 (patch) | |
| tree | dd3127874f3573db90b04795ef4930b86efa911e /js | |
| parent | 260908025c6f0dc751f90a86cc6714fc6f34b5ca (diff) | |
allow quick-reply to work with image spoilers
Diffstat (limited to 'js')
| -rw-r--r-- | js/quick-reply.js | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js index a5371587..db0903f7 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -21,7 +21,7 @@ var show_quick_reply = function(){ #quick-reply {\ position: fixed;\ right: 0;\ - top: 10%;\ + top: 5%;\ float: right;\ background: #D6DAF0;\ display: block;\ @@ -33,6 +33,14 @@ var show_quick_reply = function(){ margin: 0;\ width: 100%;\ }\ + #quick-reply tr td:nth-child(2) {\ + white-space: nowrap;\ + text-align: right;\ + padding-right: 4px;\ + }\ + #quick-reply tr td:nth-child(2) input[type="submit"] {\ + width: 100%;\ + }\ #quick-reply th, #quick-reply td {\ margin: 0;\ padding: 0;\ @@ -45,7 +53,6 @@ var show_quick_reply = function(){ #quick-reply input[type="text"] {\ width: 100%;\ padding: 2px;\ - margin: 0 0 1px 0;\ font-size: 10pt;\ box-sizing: border-box;\ -webkit-box-sizing:border-box;\ @@ -58,8 +65,11 @@ var show_quick_reply = function(){ -moz-box-sizing: border-box;\ font-size: 10pt;\ }\ + #quick-reply input, #quick-reply select, #quick-reply textarea {\ + margin: 0 0 1px 0;\ + }\ #quick-reply input[type="file"] {\ - padding: 5px 0;\ + padding: 5px 2px;\ }\ #quick-reply .nonsense {\ display: none;\ @@ -81,8 +91,8 @@ var show_quick_reply = function(){ $dummyStuff = $('<div class="nonsense"></div>').appendTo($postForm); $postForm.find('table tr').each(function() { - var $th = $(this).children('th'); - var $td = $(this).children('td'); + var $th = $(this).children('th:first'); + var $td = $(this).children('td:first'); if ($th.length && $td.length) { $td.attr('colspan', 2); @@ -126,11 +136,26 @@ var show_quick_reply = function(){ }).remove(); $td.find('input[name="file_url"]').removeAttr('id'); } + + if ($(this).find('input[name="spoiler"]').length) { + $td.removeAttr('colspan'); + } } // Remove mod controls, because it looks shit. if ($td.find('input[type="checkbox"]').length) { - $(this).remove(); + var tr = this; + $td.find('input[type="checkbox"]').each(function() { + if ($(this).attr('name') == 'spoiler') { + $td.find('label').remove(); + $(this).attr('id', 'q-spoiler-image'); + $postForm.find('input[type="file"]').parent() + .removeAttr('colspan') + .after($('<td class="spoiler"></td>').append(this, ' ', $('<label for="q-spoiler-image">').text(_('Spoiler Image')))); + } else { + $(tr).remove(); + } + }); } } }); |
