{html_head} {/html_head} {combine_script id='jquery.jcrop' load='footer' require='jquery' path='themes/default/js/plugins/jquery.Jcrop.min.js'}

{'Center of interest'|@translate}

{'Edit photo information'|@translate}
{$ALT} {$ALT}
{$ALT}

{footer_script} {literal} function from_coi(f, total) { return f*total; } function to_coi(v, total) { return v/total; } function jOnChange(sel) { var $img = jQuery("#jcrop"); jQuery("#l").val( to_coi(sel.x, $img.width()) ); jQuery("#t").val( to_coi(sel.y, $img.height()) ); jQuery("#r").val( to_coi(sel.x2, $img.width()) ); jQuery("#b").val( to_coi(sel.y2, $img.height()) ); } function jOnRelease() { jQuery("#l,#t,#r,#b").val(""); } {/literal} jQuery("#jcrop").Jcrop( {ldelim} boxWidth: 400, boxHeight: 400, onChange: jOnChange, onRelease: jOnRelease } {if isset($coi)} ,function() {ldelim} var $img = jQuery("#jcrop"); this.animateTo( [from_coi({$coi.l}, $img.width()), from_coi({$coi.t}, $img.height()), from_coi({$coi.r}, $img.width()), from_coi({$coi.b}, $img.height()) ] ); } {/if} ); {/footer_script}