Ignore:
Timestamp:
Dec 12, 2013, 2:12:13 PM (10 years ago)
Author:
mistic100
Message:

allow to configure only one downloadable size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/template/download_button.tpl

    r23359 r25931  
    1 {footer_script require='jquery'}
    2 var batchdown_count = {$BATCH_DWN_COUNT};
    3 var batchdown_string = "{'Confirm the download of %d pictures?'|@translate}";
    4 {literal}
    5 jQuery().ready(function() {
    6   jQuery("#batchDownloadLink").click(function() {
    7           var elt = jQuery("#batchDownloadBox");
     1<a href="{$BATCH_DWN_URL}{$BATCH_DWN_SIZE}" id="batchDownloadLink" title="{'Download all pictures of this selection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
     2  <span class="pwg-icon batch-downloader-icon" style="background:url('{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/zip.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Download'|@translate}</span>
     3</a>
    84
    9     elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
    10       .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true))
    11       .toggle();
    12 
    13     return false;
    14   });
    15 
    16   jQuery("#batchDownloadBox").on("mouseleave click", function() {
    17     jQuery(this).hide();
    18   });
    19  
    20   jQuery("#batchDownloadBox a").click(function() {
    21     return confirm(batchdown_string.replace('%d', batchdown_count));
    22   });
    23 });
    24 {/literal}{/footer_script}
    25 
    26 {html_style}{literal}
    27 .downloadSizeDetails {font-style:italic; font-size:80%;}
    28 {/literal}{/html_style}
    29 
    30 <li><a href="{$BATCH_DWN_URL}" id="batchDownloadLink" title="{'Download all pictures of this selection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
    31   <span class="pwg-icon batch-downloader-icon" style="background:url('{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/zip.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Download'|@translate}</span>
    32 </a></li>
     5{if isset($BATCH_DWN_SIZES)}
     6{combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'}
    337
    348<div id="batchDownloadBox" class="switchBox" style="display:none">
    359  <div class="switchBoxTitle">{'Download'|@translate} - {'Photo sizes'|@translate}</div>
    36   {foreach from=$BATCH_DOWNLOAD_SIZES item=size name=loop}{if !$smarty.foreach.loop.first}<br>{/if}
     10  {foreach from=$BATCH_DWN_SIZES item=size name=loop}{if !$smarty.foreach.loop.first}<br>{/if}
    3711  <a href="{$BATCH_DWN_URL}{$size.TYPE}" rel="nofollow">
    3812    {$size.DISPLAY} {if $size.SIZE}<span class="downloadSizeDetails">({$size.SIZE})</span>{/if}
     
    4014  {/foreach}
    4115</div>
     16{/if}
     17
     18{footer_script require='jquery'}
     19var batchdown_count = {$BATCH_DWN_COUNT};
     20var batchdown_string = "{'Confirm the download of %d pictures?'|@translate}";
     21
     22{if isset($BATCH_DWN_SIZES)}
     23  (SwitchBox=window.SwitchBox||[]).push("#batchDownloadLink", "#batchDownloadBox");
     24 
     25  jQuery("#batchDownloadBox a").click(function() {
     26    return confirm(batchdown_string.replace('%d', batchdown_count));
     27  });
     28{else}
     29  jQuery("#batchDownloadLink").click(function() {
     30    return confirm(batchdown_string.replace('%d', batchdown_count));
     31  });
     32{/if}
     33{/footer_script}
     34
     35{html_style}{literal}
     36.downloadSizeDetails {font-style:italic; font-size:80%;}
     37{/literal}{/html_style}
Note: See TracChangeset for help on using the changeset viewer.