in blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/xinha/plugins/ExtendedFileManager/assets/EditorContent.js [511:600]
function showStatus(){
if(ant==null||ant.style==null){
return false;
}
if(mode=="measure"){
mx1=x-pic_x;
my1=y-pic_y;
mw=mx2-x;
mh=my2-y;
md=parseInt(Math.sqrt(mw*mw+mh*mh)*100)/100;
ma=(Math.atan(-1*mh/mw)/Math.PI)*180;
if(mw<0&&mh<0){
ma=ma+180;
}
if(mw<0&&mh>0){
ma=ma-180;
}
ma=parseInt(ma*100)/100;
if(m_sx!=null&&!isNaN(mx1)){
m_sx.value=mx1+"px";
}
if(m_sy!=null&&!isNaN(my1)){
m_sy.value=my1+"px";
}
if(m_w!=null&&!isNaN(mw)){
m_w.value=mw+"px";
}
if(m_h!=null&&!isNaN(mh)){
m_h.value=mh+"px";
}
if(m_d!=null&&!isNaN(md)){
m_d.value=md+"px";
}
if(m_a!=null&&!isNaN(ma)){
m_a.value=ma+"";
}
if(r_ra!=null&&!isNaN(ma)){
r_ra.value=ma;
}
return false;
}
var ah=parseInt(ant.style.height);
var aw=parseInt(ant.style.width);
var ax=parseInt(ant.style.left);
var ay=parseInt(ant.style.top);
var cx=ax-pic_x<0?0:ax-pic_x;
var cy=ay-pic_y<0?0:ay-pic_y;
cx=cx>pic_width?pic_width:cx;
cy=cy>pic_height?pic_height:cy;
var cw=ax-pic_x>0?aw:aw-(pic_x-ax);
var ch=ay-pic_y>0?ah:ah-(pic_y-ay);
ch=ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height);
cw=ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width);
ch=ch<0?0:ch;
cw=cw<0?0:cw;
if(ant.style.visibility=="hidden"){
cx="";
cy="";
cw="";
ch="";
}
if(mode=="crop"){
if(t_cx!=null){
t_cx.value=cx;
}
if(t_cy!=null){
t_cy.value=cy;
}
if(t_cw!=null){
t_cw.value=cw;
}
if(t_ch!=null){
t_ch.value=ch;
}
}else{
if(mode=="scale"){
var sw=aw,sh=ah;
if(s_sw.value.indexOf("%")>0&&s_sh.value.indexOf("%")>0){
sw=cw/pic_width;
sh=ch/pic_height;
}
if(s_sw!=null){
s_sw.value=sw;
}
if(s_sh!=null){
s_sh.value=sh;
}
}
}
}