Changeset 10552 for trunk/admin/themes


Ignore:
Timestamp:
Apr 21, 2011, 11:55:20 PM (13 years ago)
Author:
patdenice
Message:

feature:2273
Ability to crop thumbnail (fixed size)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/photos_add_settings.tpl

    r9586 r10552  
    1 {footer_script}{literal}
     1{footer_script}
     2var width = '{'Width'|@translate}';
     3var height = '{'Height'|@translate}';
     4var max_width = '{'Maximum Width'|@translate}';
     5var max_height = '{'Maximum Height'|@translate}';
     6
     7{literal}
    28jQuery(document).ready(function(){
    39  function toggleResizeFields(prefix) {
    410    var checkbox = jQuery("#"+prefix+"_resize");
    511    var needToggle = jQuery("input[name^="+prefix+"_]").not(checkbox).not(jQuery("#hd_keep")).parents('tr');
    6 
    712
    813    if (jQuery(checkbox).is(':checked')) {
     
    2227  }
    2328
     29  function toggleCropFields(prefix) {
     30    if (jQuery("#"+prefix+"_crop").is(':checked')) {
     31      jQuery("#"+prefix+"_width_th").text(width);
     32      jQuery("#"+prefix+"_height_th").text(height);
     33      jQuery("#"+prefix+"_follow_orientation_tr").show();
     34    }
     35    else {
     36      jQuery("#"+prefix+"_width_th").text(max_width);
     37      jQuery("#"+prefix+"_height_th").text(max_height);
     38      jQuery("#"+prefix+"_follow_orientation_tr").hide();
     39    }
     40
     41  }
     42
    2443  toggleResizeFields("websize");
    2544  jQuery("#websize_resize").click(function () {toggleResizeFields("websize")});
     
    2746  toggleResizeFields("hd");
    2847  jQuery("#hd_resize").click(function () {toggleResizeFields("hd")});
     48
     49  toggleCropFields("thumb");
     50  jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")});
    2951
    3052  function toggleHdFields() {
     
    82104    <table>
    83105      <tr>
    84         <th>{'Maximum Width'|@translate}</th>
     106        <th><label for="thumb_crop">{'Crop'|@translate}</label></th>
     107        <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}></td>
     108      </tr>
     109      <tr id="thumb_follow_orientation_tr">
     110        <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th>
     111        <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}></td>
     112      </tr>
     113      <tr>
     114        <th id="thumb_width_th">{'Maximum Width'|@translate}</th>
    85115        <td><input type="text" name="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
    86116      </tr>
    87117      <tr>
    88         <th>{'Maximum Height'|@translate}</th>
     118        <th id="thumb_height_th">{'Maximum Height'|@translate}</th>
    89119        <td><input type="text" name="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
    90120      </tr>
Note: See TracChangeset for help on using the changeset viewer.