From d1eb25df099fa74e725692f3d6335b5d35abfc4b Mon Sep 17 00:00:00 2001 From: patdenice Date: Thu, 21 Apr 2011 21:55:20 +0000 Subject: feature:2273 Ability to crop thumbnail (fixed size) git-svn-id: http://piwigo.org/svn/trunk@10552 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../default/template/photos_add_settings.tpl | 38 +++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'admin/themes/default/template') diff --git a/admin/themes/default/template/photos_add_settings.tpl b/admin/themes/default/template/photos_add_settings.tpl index c8cc19b84..3180ac024 100644 --- a/admin/themes/default/template/photos_add_settings.tpl +++ b/admin/themes/default/template/photos_add_settings.tpl @@ -1,10 +1,15 @@ -{footer_script}{literal} +{footer_script} +var width = '{'Width'|@translate}'; +var height = '{'Height'|@translate}'; +var max_width = '{'Maximum Width'|@translate}'; +var max_height = '{'Maximum Height'|@translate}'; + +{literal} jQuery(document).ready(function(){ function toggleResizeFields(prefix) { var checkbox = jQuery("#"+prefix+"_resize"); var needToggle = jQuery("input[name^="+prefix+"_]").not(checkbox).not(jQuery("#hd_keep")).parents('tr'); - if (jQuery(checkbox).is(':checked')) { needToggle.show(); @@ -21,12 +26,29 @@ jQuery(document).ready(function(){ } } + function toggleCropFields(prefix) { + if (jQuery("#"+prefix+"_crop").is(':checked')) { + jQuery("#"+prefix+"_width_th").text(width); + jQuery("#"+prefix+"_height_th").text(height); + jQuery("#"+prefix+"_follow_orientation_tr").show(); + } + else { + jQuery("#"+prefix+"_width_th").text(max_width); + jQuery("#"+prefix+"_height_th").text(max_height); + jQuery("#"+prefix+"_follow_orientation_tr").hide(); + } + + } + toggleResizeFields("websize"); jQuery("#websize_resize").click(function () {toggleResizeFields("websize")}); toggleResizeFields("hd"); jQuery("#hd_resize").click(function () {toggleResizeFields("hd")}); + toggleCropFields("thumb"); + jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")}); + function toggleHdFields() { var checkbox = jQuery("#hd_keep"); var needToggle = jQuery("input[name^=hd_]").not(checkbox).parents('tr'); @@ -81,11 +103,19 @@ jQuery(document).ready(function(){ - + + + + + + + + + - + -- cgit v1.2.3
{'Maximum Width'|@translate}
{'Maximum Width'|@translate} {'pixels'|@translate}
{'Maximum Height'|@translate}{'Maximum Height'|@translate} {'pixels'|@translate}