js/expand-all-images.js
This commit is contained in:
parent
c0815ea25a
commit
cd3e2ef458
28
js/expand-all-images.js
Normal file
28
js/expand-all-images.js
Normal file
@ -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();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user