aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes/default/template/photos_add_settings.tpl
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-04-21 21:55:20 +0000
committerpatdenice <patdenice@piwigo.org>2011-04-21 21:55:20 +0000
commitd1eb25df099fa74e725692f3d6335b5d35abfc4b (patch)
tree1edbc89a9973448bfd8e02f2c6b4169190d92540 /admin/themes/default/template/photos_add_settings.tpl
parentf5ef4fddd7ce277f27ef4face7933fe5a7406200 (diff)
feature:2273
Ability to crop thumbnail (fixed size) git-svn-id: http://piwigo.org/svn/trunk@10552 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/template/photos_add_settings.tpl')
-rw-r--r--admin/themes/default/template/photos_add_settings.tpl38
1 files changed, 34 insertions, 4 deletions
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(){
<table>
<tr>
- <th>{'Maximum Width'|@translate}</th>
+ <th><label for="thumb_crop">{'Crop'|@translate}</label></th>
+ <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}></td>
+ </tr>
+ <tr id="thumb_follow_orientation_tr">
+ <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th>
+ <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}></td>
+ </tr>
+ <tr>
+ <th id="thumb_width_th">{'Maximum Width'|@translate}</th>
<td><input type="text" name="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
</tr>
<tr>
- <th>{'Maximum Height'|@translate}</th>
+ <th id="thumb_height_th">{'Maximum Height'|@translate}</th>
<td><input type="text" name="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
</tr>
<tr>