From c0815ea25aab780402546d04a44f4b3f0dcf2f3a Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 14:42:48 +1000 Subject: Bugfix: When you hovered over a >>X link, then hid and unhid a thread (js/hide-threads.js) it would fuck up --- js/post-hover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/post-hover.js b/js/post-hover.js index f4dc9909..263dc9ae 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -73,7 +73,7 @@ onready(function(){ $(document).trigger('new_post', this); if($('#' + $(this).attr('id')).length == 0) - $('div.post:first').prepend($(this).css('display', 'none').addClass('hidden')); + $('body').prepend($(this).css('display', 'none').addClass('hidden')); }); $post = $('div.post#reply_' + id); -- cgit v1.3 From cd3e2ef45849af8f3c38397977d3fe9e81c45b34 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 14:54:41 +1000 Subject: js/expand-all-images.js --- js/expand-all-images.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 js/expand-all-images.js (limited to 'js') diff --git a/js/expand-all-images.js b/js/expand-all-images.js new file mode 100644 index 00000000..6cca09c8 --- /dev/null +++ b/js/expand-all-images.js @@ -0,0 +1,28 @@ +/* + * expand-all-images.js + * https://github.com/savetheinternet/Tinyboard/blob/master/js/expand-all-images.js + * + * Adds an "Expand all images" button to the top of the page. + * + * Released under the MIT license + * Copyright (c) 2012-2013 Michael Save + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/inline-expanding.js'; + * $config['additional_javascript'][] = 'js/expand-all-images.js'; + * + */ + +onready(function(){ + $('hr:first').before('
'); + $('div#expand-all-images a') + .text(_('Expand all images')) + .click(function() { + $('a img.post-image').each(function() { + if (!$(this).parent()[0].dataset.expanded) + $(this).parent().click(); + }); + $(this).parent().remove(); + }); +}); -- cgit v1.3