diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-17 14:54:41 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-17 14:54:41 +1000 |
| commit | cd3e2ef45849af8f3c38397977d3fe9e81c45b34 (patch) | |
| tree | 5ddeba8a565c6c63226b6bc448281fe069ddc7a5 /js/expand-all-images.js | |
| parent | c0815ea25aab780402546d04a44f4b3f0dcf2f3a (diff) | |
js/expand-all-images.js
Diffstat (limited to 'js/expand-all-images.js')
| -rw-r--r-- | js/expand-all-images.js | 28 |
1 files changed, 28 insertions, 0 deletions
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 <savetheinternet@tinyboard.org> + * + * 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 id="expand-all-images" style="text-align:right"><a class="unimportant" href="javascript:void(0)"></a></div>'); + $('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(); + }); +}); |
