Ignore:
Timestamp:
Aug 18, 2010, 2:11:28 AM (14 years ago)
Author:
plg
Message:

feature 1803 added: single click to select all photos of the current set.

Next to the "select actions", always displays either "no photo selected" or
"23 of 41 photos selected" or "All 41 photos selected".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/bulk_manager/element_set_global.tpl

    r6772 r6773  
    1313var nb_thumbs_set = {$nb_thumbs_set};
    1414var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}";
     15
     16var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}";
     17var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}";
     18var selectedMessage_all = "{'All %d photos are selected'|@translate}";
    1519{literal}
    1620function str_repeat(i, m) {
     
    9094      )
    9195    );
     96
     97    // display the number of currently selected photos in the "Selection" fieldset
     98    if (nbSelected == 0) {
     99      $("#selectedMessage").text(
     100        sprintf(
     101          selectedMessage_none,
     102          nb_thumbs_set
     103        )
     104      );
     105    }
     106    else if (nbSelected == nb_thumbs_set) {
     107      $("#selectedMessage").text(
     108        sprintf(
     109          selectedMessage_all,
     110          nb_thumbs_set
     111        )
     112      );
     113    }
     114    else {
     115      $("#selectedMessage").text(
     116        sprintf(
     117          selectedMessage_pattern,
     118          nbSelected,
     119          nb_thumbs_set
     120        )
     121      );
     122    }
    92123  }
    93124
     
    118149
    119150  $(".wrap1 label").click(function () {
    120     $("#selectSetMessage").hide();
    121     $("#setSelected").hide();
    122151    $("input[name=setSelected]").attr('checked', false);
    123152
     
    154183
    155184  $("#selectNone").click(function () {
    156     $("#selectSetMessage").hide();
    157     $("#setSelected").hide();
    158185    $("input[name=setSelected]").attr('checked', false);
    159186
     
    171198  $("#selectInvert").click(function () {
    172199    $("#selectSetMessage").hide();
    173     $("#setSelected").hide();
    174200    $("input[name=setSelected]").attr('checked', false);
    175201
     
    192218
    193219  $("#selectSet").click(function () {
    194     $("#selectSetMessage").hide();
    195     $("#setSelected").show();
    196220    $("input[name=setSelected]").attr('checked', true);
    197221    checkPermitAction();
     
    293317.thumbSelected {background-color:#C2F5C2 !important}
    294318
    295 #selectSetMessage, #setSelected {background-color:#C2F5C2; padding:5px; -moz-border-radius:5px; display:none;}
     319#selectedMessage {background-color:#C2F5C2; padding:5px; -moz-border-radius:5px;}
    296320#selectSet a {border-bottom:1px dotted}
    297321#applyOnDetails {font-style:italic;}
     
    376400  <p id="checkActions">
    377401    {'Select:'|@translate}
    378     <a href="#" id="selectAll">{'All'|@translate}</a>,
     402    <a href="#" id="selectAll">{'All'|@translate}</a>
     403    (<a href="#" id="selectSet">or the whole set</a>),
    379404    <a href="#" id="selectNone">{'None'|@translate}</a>,
    380405    <a href="#" id="selectInvert">{'Invert'|@translate}</a>
    381     <span id="selectSetMessage" {if count($selection) == $nb_thumbs_page}style="display:inline"{/if}>
    382       {'All %u photos of this page are selected.'|@translate|@sprintf:$nb_thumbs_page}
    383       <a href="#" id="selectSet">{'Select all %d photos of the current set.'|@translate|@sprintf:$nb_thumbs_set}</a>
    384     </span>
    385     <span id="setSelected" {if count($selection) == $nb_thumbs_set}style="display:inline"{/if}>
    386       {'All %u photos of the current are selected.'|@translate|@sprintf:$nb_thumbs_set}
    387       <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}>
    388     </span>
     406
     407    <span id="selectedMessage"></span>
     408
     409    <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}>
    389410  </p>
    390411
Note: See TracChangeset for help on using the changeset viewer.