//>>built define(["dojo","dijit","dojox","./TablePlugins"],function(b,v,B,A){var q=b.declare("dojox.editor.plugins.ResizeTableColumn",A,{constructor:function(){this.isLtr=this.dir?"ltr"==this.dir:b._isBodyLtr();this.ruleDiv=b.create("div",{style:"top: -10000px; z-index: 10001"},b.body(),"last")},setEditor:function(m){function r(a,e){var c=b.query("\x3e td",a.parentNode);switch(e){case "first":return c[0]==a;case "last":return c[c.length-1]==a;default:return!1}}function q(a){for(a=a.nextSibling;a&&(!a.tagName|| "td"!=a.tagName.toLowerCase());)a=a.nextSibling;return a}function t(a){for(;(a=a.parentNode)&&"table"!=a.tagName.toLowerCase(););return a}function y(a){for(var e=b.query("td",t(a)),c=e.length,d=0;dd&&d>e||!g&&e+a>d&&d>f||g&&e+a>d&&d>k))&&b.style(h,{left:c+d+"px"})}else if(k=a.target,k.tagName&&"td"==k.tagName.toLowerCase()){l=b.position(k);a=l.x;g=l.w;c=c+l.x-2;if(this.isLtr){if(h.headerColumn=!0,!r(k,"first")||d>a+g/2)c+=g,h.headerColumn=!1}else h.headerColumn=!1, r(k,"first")&&d>a+g/2&&(c+=g,h.headerColumn=!0);b.style(h,{position:"absolute",cursor:"col-resize",display:"block",width:"4px",backgroundColor:"transparent",top:e.y+l.y+"px",left:c+"px",height:l.h+"px"});this.activeCell=k}else b.style(h,{display:"none",top:"-10000px"})});this.connect(h,"onmousedown",function(a){var e=b.position(m.iframe,!0),c=b.position(t(this.activeCell));this.isDragging=!0;b.style(m.editNode,{cursor:"col-resize"});b.style(h,{width:"1px",left:a.clientX+"px",top:e.y+c.y+"px",height:c.h+ "px",backgroundColor:"#777"})});this.connect(h,"onmouseup",function(a){var e=this.activeCell,c=b.position(e),d=c.w,f=c.x,c=q(e),g,l,k=b.position(m.iframe).x,n=t(e),v=b.position(n),p=n.getAttribute("cellspacing");a=a.clientX;var z=y(e),w,x;if(!p||0>(p=parseInt(p,10)))p=2;c&&(g=b.position(c),l=g.x,g=g.w,w=y(c));this.isLtr?h.headerColumn?f=k+f+d-a:(f=a-k-f,c&&(x=k+l+g-a-p)):h.headerColumn?f=a-k-f:(f=k+f+d-a,c&&(x=a-k-l-p));this.isDragging=!1;u(z,f);c&&(h.headerColumn||u(w,x));(h.headerColumn&&r(e,"first")|| r(e,"last"))&&b.marginBox(n,{w:v.w+f-d});u(z,b.position(e).w);c&&u(w,b.position(c).w);b.style(m.editNode,{cursor:"auto"});b.style(h,{display:"none",top:"-10000px"});this.activeCell=null})}))}});b.subscribe(v._scopeName+".Editor.getPlugin",null,function(b){if(!b.plugin&&b.args&&b.args.command){var m=b.args.command.charAt(0).toLowerCase()+b.args.command.substring(1,b.args.command.length);"resizeTableColumn"==m&&(b.plugin=new q({commandName:m}))}});return q});