1 | <div class="titrePage"> |
---|
2 | <h2>{$TITLE} › {'Edit photo'|@translate} {$TABSHEET_TITLE}</h2> |
---|
3 | </div> |
---|
4 | {if $IN_CROP} |
---|
5 | |
---|
6 | {combine_css path="themes/default/js/plugins/jquery.Jcrop.css"} |
---|
7 | {combine_script id='jquery.jcrop' load='footer' require='jquery' path='themes/default/js/plugins/jquery.Jcrop.min.js'} |
---|
8 | |
---|
9 | {footer_script require="jquery"} |
---|
10 | var jcrop_api; |
---|
11 | |
---|
12 | jQuery("#jcrop").Jcrop({ldelim} |
---|
13 | //boxWidth: {$crop.display_width}, |
---|
14 | //boxHeight: {$crop.display_height}, |
---|
15 | boxWidth: 500, boxHeight: 400, |
---|
16 | onChange: jOnChange, |
---|
17 | onRelease: jOnRelease |
---|
18 | }, |
---|
19 | function(){ldelim} |
---|
20 | jcrop_api = this; |
---|
21 | }); |
---|
22 | |
---|
23 | function jOnChange(sel) {ldelim} |
---|
24 | jQuery("input[name='x']").val(sel.x); |
---|
25 | jQuery("input[name='y']").val(sel.y); |
---|
26 | jQuery("input[name='x2']").val(sel.x2); |
---|
27 | jQuery("input[name='y2']").val(sel.y2); |
---|
28 | |
---|
29 | jQuery("input[name='w']").val(sel.w); |
---|
30 | jQuery("input[name='h']").val(sel.h); |
---|
31 | |
---|
32 | jQuery("#width").html(Math.round(sel.x2-sel.x).toFixed(0)); |
---|
33 | jQuery("#height").html(Math.round(sel.y2-sel.y).toFixed(0)); |
---|
34 | } |
---|
35 | function jOnRelease() {ldelim} |
---|
36 | |
---|
37 | } |
---|
38 | |
---|
39 | {/footer_script} |
---|
40 | |
---|
41 | <form method="post" action=""> |
---|
42 | <fieldset> |
---|
43 | <legend>{'Crop Photo'|@translate}</legend> |
---|
44 | {'Choose the part of the photo you want to keep'|@translate}<br> |
---|
45 | <img id="jcrop" src="{$picture.banner_src}?{1|rand:200}" width="{$crop.display_width}" height="{$crop.display_height}"> |
---|
46 | |
---|
47 | <ul> |
---|
48 | <li><b>{'Width'|@translate}:</b> <span id="width"></span>px</li> |
---|
49 | <li><b>{'Height'|@translate}:</b> <span id="height"></span>px</li> |
---|
50 | </ul> |
---|
51 | |
---|
52 | <input type="hidden" name="x"> |
---|
53 | <input type="hidden" name="y"> |
---|
54 | <input type="hidden" name="x2"> |
---|
55 | <input type="hidden" name="y2"> |
---|
56 | <input type="hidden" name="h"> |
---|
57 | <input type="hidden" name="w"> |
---|
58 | <input type="hidden" name="picture_file" value="{$picture.path}"> |
---|
59 | <input type="hidden" name="image_id" value="{$image_id}"> |
---|
60 | <input type="submit" name="submit_crop" value="{'Submit'|@translate}"> |
---|
61 | <input type="submit" name="cancel_crop" value="{'Cancel'|@translate}"> |
---|
62 | </fieldset> |
---|
63 | </form> |
---|
64 | {/if} |
---|