diff options
| -rw-r--r-- | js/expand-all-images.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/expand-all-images.js b/js/expand-all-images.js index 6ef58ca9..fc273e5e 100644 --- a/js/expand-all-images.js +++ b/js/expand-all-images.js @@ -7,6 +7,7 @@ * Released under the MIT license * Copyright (c) 2012-2013 Michael Save <savetheinternet@tinyboard.org> * Copyright (c) 2013-2014 Marcin Ćabanowski <marcin@6irc.net> + * Copyright (c) 2014 sinuca <#55ch@rizon.net> * * Usage: * $config['additional_javascript'][] = 'js/jquery.min.js'; @@ -25,6 +26,16 @@ onready(function(){ if (!$(this).parent()[0].dataset.expanded) $(this).parent().click(); }); - $(this).parent().remove(); + + $('hr:first').before('<div id="shrink-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>'); + $('div#shrink-all-images a') + .text(_('Shrink all images')) + .click(function(){ + $('a img.post-image').each(function() { + if ($(this).parent()[0].dataset.expanded) + $(this).parent().click(); + }); + $(this).parent().remove(); + }); }); }); |
