ACC SHELL

Path : /srv/www/vhosts/calyx/admin/ckeditor/plugins/image2/dialogs/
File Upload :
Current File : //srv/www/vhosts/calyx/admin/ckeditor/plugins/image2/dialogs/image2.js

/*
 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add("image2",function(q){function w(){var a=this.getValue().match(x);(a=!!(a&&0!==parseInt(a[1],10)))||alert(i["invalid"+CKEDITOR.tools.capitalize(this.id)]);return a}function C(){function a(a,b){d.push(c.once(a,function(a){for(var c;c=d.pop();)c.removeListener();b(a)}))}var c=r.createElement("img"),d=[];return function(d,b,f){a("load",function(){b.call(f,c,c.$.width,c.$.height)});a("error",function(){b(null)});a("abort",function(){b(null)});c.setAttribute("src",d+"?"+Math.random().toString(16).substring(2))}}
function y(){if(b){var a=this.getValue();if(a&&(a.match(x)||j(!1),"0"!==a)){var c="width"==this.id,d=k||l,e=m||n,a=c?Math.round(e*(a/d)):Math.round(d*(a/e));isNaN(a)||(c?f:h).setValue(a)}}}function j(a){if(e){var c;if("check"==a&&!t){a=h.getValue();c=f.getValue();var d=1E3*l/n,g=1E3*a/c;b=!1;!a&&!c?b=!0:!isNaN(d+g)&&Math.round(d)==Math.round(g)&&(b=!0)}else"boolean"==typeof a?b=a:(t=!0,b=!b,a=h.getValue(),b&&a&&(c=m/k*a,isNaN(c)||f.setValue(Math.round(c))));e[b?"removeClass":"addClass"]("cke_btn_unlocked");
e.setAttribute("aria-checked",b);CKEDITOR.env.hc&&e.getChild(0).setHtml(b?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢")}}function s(a){a=a?"enable":"disable";h[a]();f[a]()}var x=/(^\s*(\d+)(px)?\s*$)|^$/i,z=CKEDITOR.tools.getNextId(),A=CKEDITOR.tools.getNextId(),g=q.lang.image2,i=q.lang.common,q=(new CKEDITOR.template('<div><a href="javascript:void(0)" tabindex="-1" title="'+g.lockRatio+'" class="cke_btn_locked" id="{lockButtonId}" role="checkbox"><span class="cke_icon"></span><span class="cke_label">'+
g.lockRatio+'</span></a><a href="javascript:void(0)" tabindex="-1" title="'+g.resetSize+'" class="cke_btn_reset" id="{resetButtonId}" role="button"><span class="cke_label">'+g.resetSize+"</span></a></div>")).output({lockButtonId:z,resetButtonId:A}),r,u,v,B,k,m,l,n,o,b,t,e,p,h,f;return{title:g.title,minWidth:250,minHeight:100,onLoad:function(){r=this._.element.getDocument();B=C()},onShow:function(){u=this._.widget;v=u.parts.image;l=n=o=t=b=!1;k=v.$.naturalWidth;m=v.$.naturalHeight;setTimeout(function(){j("check")})},
contents:[{id:"info",elements:[{id:"src",type:"text",label:i.url,onKeyup:function(){var a=this.getValue();s(!1);a!==u.data.src?(B(a,function(a,d,b){s(!0);if(!a)return j(!1);h.setValue(d);f.setValue(b);l=d;n=b;j("check")}),o=!0):o?(s(!0),h.setValue(k),f.setValue(m),o=!1):s(!0)},setup:function(a){this.setValue(a.data.src)},commit:function(a){a.setData("src",this.getValue())},validate:CKEDITOR.dialog.validate.notEmpty(g.urlMissing)},{id:"alt",type:"text",label:g.alt,setup:function(a){this.setValue(a.data.alt)},
commit:function(a){a.setData("alt",this.getValue())}},{type:"hbox",widths:["25%","25%","50%"],requiredContent:"img[width,height]",children:[{type:"text",width:"45px",id:"width",label:i.width,validate:w,onKeyUp:y,onLoad:function(){h=this},setup:function(a){this.setValue(a.data.width)},commit:function(a){a.setData("width",this.getValue())}},{type:"text",id:"height",width:"45px",label:i.height,validate:w,onKeyUp:y,onLoad:function(){f=this},setup:function(a){this.setValue(a.data.height)},commit:function(a){a.setData("height",
this.getValue())}},{id:"lock",type:"html",style:"margin-top:18px;width:40px;height:20px;",onLoad:function(){function a(a){a.on("mouseover",function(){this.addClass("cke_btn_over")},a);a.on("mouseout",function(){this.removeClass("cke_btn_over")},a)}var b=this.getDialog();e=r.getById(z);p=r.getById(A);e&&(b.addFocusable(e,4),e.on("click",function(a){j();a.data&&a.data.preventDefault()},this.getDialog()),a(e));p&&(b.addFocusable(p,5),p.on("click",function(a){if(o){h.setValue(l);f.setValue(n)}else{h.setValue(k);
f.setValue(m)}a.data&&a.data.preventDefault()},this),a(p))},html:q}]},{type:"hbox",id:"alignment",children:[{id:"align",type:"radio",items:[["None","none"],["Left","left"],["Center","center"],["Right","right"]],label:i.align,setup:function(a){this.setValue(a.data.align)},commit:function(a){a.setData("align",this.getValue())}}]},{id:"hasCaption",type:"checkbox",label:g.captioned,setup:function(a){this.setValue(a.data.hasCaption)},commit:function(a){a.setData("hasCaption",this.getValue())}}]}]}});

ACC SHELL 2018