WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Download Gallery
[resolved] Select All / Deselect All (6 posts)

  1. H R
    Member
    Posted 1 year ago #

    First of all.... awesome plugin!

    I know that new features will come when you time allows it, but i have a small problem! I'm doing a website with galleries with a lot of pictures, 30+, and in terms of usability, its a pain when you hit the 'Select All' button, and then you try to deselect most of them... it seems a small issue, but it happens. Is it possible to include a deselect all button?

    Thanks! :)

    http://wordpress.org/extend/plugins/nextgen-download-gallery/

  2. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    I won't be adding a deselect, but it is easy for you to add one yourself.

    • create a folder 'nggallery' in your theme's folder
    • copy the download template from the templates folder in the plugin into that new folder
    • duplicate the line with the selectall button and change 'ngg-download-selectall' to 'ngg-download-selectnone'
    • add the following code to the block of jQuery code:
    $("input.ngg-download-selectnone").show().click(function() {
        $(this).closest("form").find("input[name='pid[]']").prop({checked: false});
    });

    cheers,
    Ross

  3. H R
    Member
    Posted 1 year ago #

    Awesome help Ross.
    I've tried already and works just fine!

    Cheers,
    Hugo

  4. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    Excellent!

  5. windmark
    Member
    Posted 1 year ago #

    Thank you for this!
    I did it in my own way, creating one button with Select/Deselect and adding this code

    var $selected = 0;
    
    <?php /* reveal "select all" button and active it */ ?>
    	$("input.ngg-download-selectall").show().click(function() {
    		if ($selected == 0) {
    			$(this.form).find("input[name='pid[]']").prop({checked: true});
    			$selected = 1;
    		} else {
    			$(this).closest("form").find("input[name='pid[]']").prop({checked: false});
    			$selected = 0;
    		}
    	});

    I'm sure there's a more elegant way of doing this, but this was the most simple.

    By the way, why is not all buttons linked to the language files? I can't, for instance, find the select all text in the po-file.

  6. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    G'day Marcus,

    I recently added the "select all" text to the .po files (oops!) so the next release will have that. Of course, the text might be a bit funny because I used Google Translate to do it :) but at least it won't be English for every language. Translation fixes are always welcome!

    cheers,
    Ross

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.