From cac417c74bc6d5f528b356190561d244e9b4f93a Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 12 Jan 2012 21:37:28 +0000 Subject: feature 2548, multiple size: * adapt the upload script * remove the resize settings screen * add a new screen [Administration > Configuration > Options > Photo Sizes] with the ability to resize original after upload git-svn-id: http://piwigo.org/svn/trunk@12879 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/configuration.tpl | 48 +++++- .../default/template/photos_add_settings.tpl | 163 --------------------- 2 files changed, 47 insertions(+), 164 deletions(-) delete mode 100644 admin/themes/default/template/photos_add_settings.tpl (limited to 'admin/themes/default/template') diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index 59ab62006..008dfe4e0 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -247,6 +247,52 @@ jQuery(document).ready(function () { +{if isset($sizes)} + +{footer_script}{literal} +jQuery(document).ready(function(){ + function toggleResizeFields(prefix) { + var checkbox = jQuery("#"+prefix+"_resize"); + var needToggle = jQuery("input[name^="+prefix+"_]").not(checkbox).parents('tr'); + + if (jQuery(checkbox).is(':checked')) { + needToggle.show(); + } + else { + needToggle.hide(); + } + } + + toggleResizeFields("original"); + jQuery("#original_resize").click(function () {toggleResizeFields("original")}); +}); +{/literal}{/footer_script} + +
+ {'Original Size'|@translate} + + + + + + + + + + + + + + + + + + +
{'Maximum Width'|@translate} {'pixels'|@translate}
{'Maximum Height'|@translate} {'pixels'|@translate}
{'Image Quality'|@translate} %
+ +
+{/if} + {if isset($default)} {$PROFILE_CONTENT} {/if} @@ -445,7 +491,7 @@ jQuery(document).ready(function () { {if !isset($default)}

- +

diff --git a/admin/themes/default/template/photos_add_settings.tpl b/admin/themes/default/template/photos_add_settings.tpl deleted file mode 100644 index 3180ac024..000000000 --- a/admin/themes/default/template/photos_add_settings.tpl +++ /dev/null @@ -1,163 +0,0 @@ -{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(); - - if (prefix == "websize") { - jQuery("#hd_keep").parents("fieldset").show(); - } - } - else { - needToggle.hide(); - - if (prefix == "websize") { - jQuery("#hd_keep").parents("fieldset").hide(); - } - } - } - - 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'); - - if (jQuery(checkbox).is(':checked')) { - needToggle.show(); - toggleResizeFields("hd"); - } - else { - needToggle.hide(); - } - } - - toggleHdFields(); - jQuery("#hd_keep").click(function () {toggleHdFields()}); -}); -{/literal}{/footer_script} - -
-

{'Upload Photos'|@translate}

-
- -
- -
- -
- {'Web size photo'|@translate} - - - - - - - - - - - - - - - - - - -
{'Maximum Width'|@translate} {'pixels'|@translate}
{'Maximum Height'|@translate} {'pixels'|@translate}
{'Image Quality'|@translate} %
-
- -
- {'Thumbnail'|@translate} - - - - - - - - - - - - - - - - - - - - - - -
{'Maximum Width'|@translate} {'pixels'|@translate}
{'Maximum Height'|@translate} {'pixels'|@translate}
{'Image Quality'|@translate} %
-
- -{if $MANAGE_HD} -
- {'High definition'|@translate} - - - - - - - - - - - - - - - - - - - - - - -
{'Maximum Width'|@translate} {'pixels'|@translate}
{'Maximum Height'|@translate} {'pixels'|@translate}
{'Image Quality'|@translate} %
-
-{/if} - -

- -

- -
- -
-- cgit v1.2.3