/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ (function(){function y(a){return CKEDITOR.env.ie?a.$.clientWidth:parseInt(a.getComputedStyle("width"),10)}function r(a,h){var b=a.getComputedStyle("border-"+h+"-width"),d={thin:"0px",medium:"1px",thick:"2px"};0>b.indexOf("px")&&(b=b in d&&"none"!=a.getComputedStyle("border-style")?d[b]:0);return parseInt(b,10)}function A(a){var h=[],b=-1,d="rtl"==a.getComputedStyle("direction"),f;f=a.$.rows;for(var m=0,g,c,e,k=0,t=f.length;km&&(m=g,c=e);f=c;m=new CKEDITOR.dom.element(a.$.tBodies[0]); g=m.getDocumentPosition();c=0;for(e=f.cells.length;cg.x+g.width))return g=null,k=n=0,c.removeListener("mouseup",f),e.removeListener("mousedown",d),e.removeListener("mousemove",m),c.getBody().setStyle("cursor", "auto"),x?e.remove():e.hide(),0;a-=Math.round(e.$.offsetWidth/2);if(k){if(a==C||a==D)return 1;a=Math.max(a,C);a=Math.min(a,D);n=a-t}e.setStyle("left",l(a));return 1}}function v(a){var h=a.data.getTarget();if("mouseout"==a.name){if(!h.is("table"))return;for(var b=new CKEDITOR.dom.element(a.data.$.relatedTarget||a.data.$.toElement);b&&b.$&&!b.equals(h)&&!b.is("body");)b=b.getParent();if(!b||b.equals(h))return}h.getAscendant("table",1).removeCustomData("_cke_table_pillars");a.removeListener()}var l= CKEDITOR.tools.cssLength,x=CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks);CKEDITOR.plugins.add("tableresize",{requires:"tabletools",init:function(a){a.on("contentDom",function(){var h,b=a.editable();b.attachListener(b.isInline()?b:a.document,"mousemove",function(d){d=d.data;var f=d.getTarget();if(f.type==CKEDITOR.NODE_ELEMENT){var b=d.getPageOffset().x;if(h&&h.move(b))z(d);else if(f.is("table")||f.getAscendant("tbody",1))if(f=f.getAscendant("table",1),a.editable().contains(f)){(d= f.getCustomData("_cke_table_pillars"))||(f.setCustomData("_cke_table_pillars",d=A(f)),f.on("mouseout",v),f.on("mousedown",v));a:{for(var f=0,g=d.length;f=c.x&&b<=c.x+c.width){b=c;break a}}b=null}b&&(!h&&(h=new E(a)),h.attachTo(b))}}})})}})})();