From b0c837ce9369b932cecff91966dacdaef4a96952 Mon Sep 17 00:00:00 2001 From: sinuca <55vitaminado@gmail.com> Date: Tue, 25 Mar 2014 11:41:20 +0100 Subject: [PATCH] expand-images.js: shrink all images functionality --- js/expand-all-images.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 * Copyright (c) 2013-2014 Marcin Ɓabanowski + * 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#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(); + }); }); });