CKEDITOR.plugins.add('resize',{init:function(a){var b=a.config,c=a.element.getDirection(1);!b.resize_dir&&(b.resize_dir='both');b.resize_maxWidth==undefined&&(b.resize_maxWidth=3000);b.resize_maxHeight==undefined&&(b.resize_maxHeight=3000);b.resize_minWidth==undefined&&(b.resize_minWidth=750);b.resize_minHeight==undefined&&(b.resize_minHeight=250);if(b.resize_enabled!==false){var d=null,e,f,g=(b.resize_dir=='both'||b.resize_dir=='horizontal')&&b.resize_minWidth!=b.resize_maxWidth,h=(b.resize_dir=='both'||b.resize_dir=='vertical')&&b.resize_minHeight!=b.resize_maxHeight;function i(l){var m=l.data.$.screenX-e.x,n=l.data.$.screenY-e.y,o=f.width,p=f.height,q=o+m*(c=='rtl'?-1:1),r=p+n;if(g)o=Math.max(b.resize_minWidth,Math.min(q,b.resize_maxWidth));if(h)p=Math.max(b.resize_minHeight,Math.min(r,b.resize_maxHeight));a.resize(o,p);};function j(l){CKEDITOR.document.removeListener('mousemove',i);CKEDITOR.document.removeListener('mouseup',j);if(a.document){a.document.removeListener('mousemove',i);a.document.removeListener('mouseup',j);}};var k=CKEDITOR.tools.addFunction(function(l){if(!d)d=a.getResizable();f={width:d.$.offsetWidth||0,height:d.$.offsetHeight||0};e={x:l.screenX,y:l.screenY};b.resize_minWidth>f.width&&(b.resize_minWidth=f.width);b.resize_minHeight>f.height&&(b.resize_minHeight=f.height);CKEDITOR.document.on('mousemove',i);CKEDITOR.document.on('mouseup',j);if(a.document){a.document.on('mousemove',i);a.document.on('mouseup',j);}});a.on('destroy',function(){CKEDITOR.tools.removeFunction(k);});a.on('themeSpace',function(l){if(l.data.space=='bottom'){var m='';if(g&&!h)m=' cke_resizer_horizontal';if(!g&&h)m=' cke_resizer_vertical';var n='<div class="cke_resizer'+m+' cke_resizer_'+c+'"'+' title="'+CKEDITOR.tools.htmlEncode(a.lang.resize)+'"'+' onmousedown="CKEDITOR.tools.callFunction('+k+', event)"'+'></div>';c=='ltr'&&m=='ltr'?l.data.html+=n:l.data.html=n+l.data.html;}},a,null,100);}}});
