Changeset 24055 for extensions
- Timestamp:
- Jul 29, 2013, 8:26:31 PM (11 years ago)
- Location:
- extensions/Crop_Image
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Crop_Image/admin.php
r22941 r24055 139 139 $picture['banner_src'] = PHPWG_ROOT_PATH . $picture['path']; 140 140 141 list($RatioWidth, $RatioHeight) = getimagesize($picture['path']); 142 141 143 $template->assign(array( 142 144 'TITLE' => render_element_name($picture), … … 145 147 'crop' => get_crop_display($picture), 146 148 'image_id' => (int)@$_GET['image_id'], 149 'image_ratio' => $RatioWidth/$RatioHeight, 147 150 )); 148 151 } -
extensions/Crop_Image/crop_image.tpl
r22941 r24055 20 20 jcrop_api = this; 21 21 }); 22 23 $("input[name='ratio']").change(function(e) {ldelim} 24 if ($("input[name='ratio']:checked").val() == '1/1') 25 {ldelim} 26 jcrop_api.setOptions({ldelim} aspectRatio: 1/1 }); 27 document.getElementById('ratioC').disabled = true; 28 document.getElementById('ratioC').value = ''; 29 } 30 else if ($("input[name='ratio']:checked").val() == '4/5') 31 {ldelim} 32 jcrop_api.setOptions({ldelim} aspectRatio: 4/5 }); 33 document.getElementById('ratioC').disabled = true; 34 document.getElementById('ratioC').value = ''; 35 } 36 else if ($("input[name='ratio']:checked").val() == '4/3') 37 {ldelim} 38 jcrop_api.setOptions({ldelim} aspectRatio: 4/3 }); 39 document.getElementById('ratioC').disabled = true; 40 document.getElementById('ratioC').value = ''; 41 } 42 else if ($("input[name='ratio']:checked").val() == '5/7') 43 {ldelim} 44 jcrop_api.setOptions({ldelim} aspectRatio: 5/7 }); 45 document.getElementById('ratioC').disabled = true; 46 document.getElementById('ratioC').value = ''; 47 } 48 else if ($("input[name='ratio']:checked").val() == '16/9') 49 {ldelim} 50 jcrop_api.setOptions({ldelim} aspectRatio: 16/9 }); 51 document.getElementById('ratioC').disabled = true; 52 document.getElementById('ratioC').value = ''; 53 } 54 else if ($("input[name='ratio']:checked").val() == '2.35/1') 55 {ldelim} 56 jcrop_api.setOptions({ldelim} aspectRatio: 2.35/1 }); 57 document.getElementById('ratioC').disabled = true; 58 document.getElementById('ratioC').value = ''; 59 } 60 else if ($("input[name='ratio']:checked").val() == 'original') 61 {ldelim} 62 jcrop_api.setOptions({ldelim} aspectRatio: eval($('#image_ratio').val()) }); 63 document.getElementById('ratioC').disabled = true; 64 document.getElementById('ratioC').value = ''; 65 } 66 else if ($("input[name='ratio']:checked").val() == 'C') 67 {ldelim} 68 document.getElementById('ratioC').disabled = false; 69 if ( eval($('#ratioC').val()) > 0 ) 70 jcrop_api.setOptions({ldelim} aspectRatio: eval($('#ratioC').val()) }); 71 } 72 else 73 {ldelim} 74 jcrop_api.setOptions({ldelim} aspectRatio: 0 }); 75 document.getElementById('ratioC').disabled = true; 76 document.getElementById('ratioC').value = ''; 77 } 78 jcrop_api.focus(); 79 }); 80 $("input[name='ratioC']").change(function(e) {ldelim} 81 if (($("input[name='ratio']:checked").val() == 'C') && eval($('#ratioC').val()) > 0) 82 jcrop_api.setOptions({ldelim} aspectRatio: eval($('#ratioC').val()) }); 83 jcrop_api.focus(); 84 }); 22 85 23 86 function jOnChange(sel) {ldelim} … … 57 120 <input type="hidden" name="w"> 58 121 <input type="hidden" name="picture_file" value="{$picture.path}"> 122 <input type="hidden" name="image_ratio" id="image_ratio" value="{$image_ratio}"> 59 123 <input type="hidden" name="image_id" value="{$image_id}"> 124 <fieldset> 125 <legend>{'Aspect Ratio'|@translate}</legend> 126 {'Square'|@translate}<input type="radio" value="1/1" name="ratio"> 4:5<input type="radio" value="4/5" name="ratio"> 4:3<input type="radio" value="4/3" name="ratio"> 5:7<input type="radio" value="5/7" name="ratio"> 16:9<input type="radio" value="16/9" name="ratio"> 2.35:1<input type="radio" value="2.35/1" name="ratio"> 127 {'None'|@translate}<input type="radio" value="0" checked name="ratio"> {'Original'|@translate}<input type="radio" value="original" name="ratio"> {'Custom'|@translate}<input type="radio" value="C" name="ratio"> <input type="text" name="ratioC" id="ratioC" value="" size="5" disabled/> 128 </fieldset> 60 129 <input type="submit" name="submit_crop" value="{'Submit'|@translate}"> 61 130 <input type="submit" name="cancel_crop" value="{'Cancel'|@translate}"> -
extensions/Crop_Image/language/en_UK/plugin.lang.php
r22941 r24055 5 5 $lang['Unknown Photo ID'] = 'Unknown Photo ID'; 6 6 $lang['Choose the part of the photo you want to keep'] = 'Choose the part of the photo you want to keep.'; 7 $lang['Aspect Ratio'] = 'Aspect Ratio'; 8 $lang['Square'] = 'Square'; 9 $lang['None'] = 'None'; 10 $lang['Original'] = 'Original'; 11 $lang['Custom'] = 'Custom'; 7 12 ?>
Note: See TracChangeset
for help on using the changeset viewer.