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 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'themes/default/template/picture.tpl') 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} -- cgit v1.2.3 From b1b91992581b769fba5dae51aa5fb17b155516ba Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 17 Dec 2015 14:06:04 +0100 Subject: feature #379, multiple format, hide url on download link --- themes/default/template/picture.tpl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'themes/default/template/picture.tpl') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 331de8384..c576748fb 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -72,6 +72,8 @@ function changeImgSrc(url,typeSave,typeMap) {if !empty($current.formats)} {footer_script require='jquery'}{literal} jQuery().ready(function() { + jQuery("#downloadSwitchLink").removeAttr("href"); + jQuery("#downloadSwitchLink").click(function() { var elt = jQuery("#downloadSwitchBox"); -- cgit v1.2.3 From 89bc74b3f30e169ab51e5b2728767f02a94a991c Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 20 Dec 2015 15:44:01 +0100 Subject: feature #379, multiple format, labels Ability to customize, with $lang['format CR2'] = 'RAW Canon' (in LocalFiles Editor) for example --- themes/default/template/picture.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/default/template/picture.tpl') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index c576748fb..f18fdd615 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -95,7 +95,7 @@ jQuery().ready(function() { -- cgit v1.2.3 From e7183e91d9c7fd84ae21a7f59926824ec6c78d9e Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 20 Dec 2015 20:38:30 +0100 Subject: use window.SwitchBox instead of duplicating code --- themes/default/template/picture.tpl | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'themes/default/template/picture.tpl') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index f18fdd615..3cccf6b29 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -74,19 +74,7 @@ function changeImgSrc(url,typeSave,typeMap) jQuery().ready(function() { jQuery("#downloadSwitchLink").removeAttr("href"); - 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(); - }); + (window.SwitchBox=window.SwitchBox||[]).push("#downloadSwitchLink", "#downloadSwitchBox"); }); {/literal}{/footer_script} -- cgit v1.2.3 From e439de1612eb471571c5a1503fba7f6531a90c08 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 22 Dec 2015 19:04:00 +0100 Subject: feature #379, multiple format, consider the original as a format --- themes/default/template/picture.tpl | 1 - 1 file changed, 1 deletion(-) (limited to 'themes/default/template/picture.tpl') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 3cccf6b29..bfc0c2498 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -81,7 +81,6 @@ jQuery().ready(function() {
{'Download'|translate} - {'Formats'|translate}