From c3b748ecbfd1a359f6e95e7fd691ac5c11c3c4de Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 7 Dec 2015 10:54:18 +0100 Subject: feature #379 multiple format, step 2: download formats * if formats are available, replace the download link on picture.php by a switchBox with all formats * register format in the history table for future statistics --- themes/default/template/picture.tpl | 32 +++++++++++++++++++++++++++++++- themes/default/theme.css | 6 ++++++ 2 files changed, 37 insertions(+), 1 deletion(-) (limited to 'themes/default') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 733cefcf8..331de8384 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -65,9 +65,39 @@ function changeImgSrc(url,typeSave,typeMap) {/if}{/strip} {strip}{if isset($current.U_DOWNLOAD)} - + {'Download'|@translate} + +{if !empty($current.formats)} +{footer_script require='jquery'}{literal} +jQuery().ready(function() { + jQuery("#downloadSwitchLink").click(function() { + var elt = jQuery("#downloadSwitchBox"); + + elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) + .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) + .toggle(); + + return false; + }); + + jQuery("#downloadSwitchBox").on("mouseleave click", function() { + jQuery(this).hide(); + }); +}); +{/literal}{/footer_script} + +
+
{'Download'|translate} - {'Formats'|translate}
+ +
+{/if} {* has formats *} {/if}{/strip} {if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if} {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if} diff --git a/themes/default/theme.css b/themes/default/theme.css index 3a68f1577..5a438be9c 100644 --- a/themes/default/theme.css +++ b/themes/default/theme.css @@ -363,6 +363,12 @@ TD.calDayCellFull, TD.calDayCellEmpty { margin-bottom:5px; } +#downloadSwitchBox ul { + margin:0; + padding:0; + list-style-type:none; +} + #theImage { text-align: center; } -- cgit v1.2.3