CKEDITOR.dialog.add("link",function(e){function r(e){return e.replace(/'/g,"\\$&")}function i(e){var i,s=t,o,u;i=[n,"("];for(var a=0;a0?this.getElement().show():this.getElement().hide()},children:[{type:"hbox",id:"selectAnchor",children:[{type:"select",id:"anchorName","default":"",label:k.anchorName,style:"width: 100%;",items:[[""]],setup:function(e){this.clear();this.add("");for(var t=0;t0?this.getElement().show():this.getElement().hide()}}]},{type:"html",id:"noAnchors",style:"text-align: center;",html:'
'+CKEDITOR.tools.htmlEncode(k.noAnchors)+"
",focus:!0,setup:function(e){e.anchors.length<1?this.getElement().show():this.getElement().hide()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",id:"emailAddress",label:k.emailAddress,required:!0,validate:function(){var e=this.getDialog();return!e.getContentElement("info","linkType")||e.getValueOf("info","linkType")!="email"?true:CKEDITOR.dialog.validate.notEmpty(k.noEmail).apply(this)},setup:function(e){e.email&&this.setValue(e.email.address);(e=this.getDialog().getContentElement("info","linkType"))&&e.getValue()=="email"&&this.select()},commit:function(e){if(!e.email)e.email={};e.email.address=this.getValue()}},{type:"text",id:"emailSubject",label:k.emailSubject,setup:function(e){e.email&&this.setValue(e.email.subject)},commit:function(e){if(!e.email)e.email={};e.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:k.emailBody,rows:3,"default":"",setup:function(e){e.email&&this.setValue(e.email.body)},commit:function(e){if(!e.email)e.email={};e.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}}]},{id:"target",label:k.target,title:k.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:C.target,"default":"notSet",style:"width : 100%;",items:[[C.notSet,"notSet"],[k.targetFrame,"frame"],[k.targetPopup,"popup"],[C.targetNew,"_blank"],[C.targetTop,"_top"],[C.targetSelf,"_self"],[C.targetParent,"_parent"]],onChange:a,setup:function(e){e.target&&this.setValue(e.target.type||"notSet");a.call(this)},commit:function(e){if(!e.target)e.target={};e.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:k.targetFrameName,"default":"",setup:function(e){e.target&&this.setValue(e.target.name)},commit:function(e){if(!e.target)e.target={};e.target.name=this.getValue().replace(/\W/gi,"")}}]},{type:"vbox",width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:k.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",label:k.popupResizable,setup:E,commit:x},{type:"checkbox",id:"status",label:k.popupStatusBar,setup:E,commit:x}]},{type:"hbox",children:[{type:"checkbox",id:"location",label:k.popupLocationBar,setup:E,commit:x},{type:"checkbox",id:"toolbar",label:k.popupToolbar,setup:E,commit:x}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",label:k.popupMenuBar,setup:E,commit:x},{type:"checkbox",id:"fullscreen",label:k.popupFullScreen,setup:E,commit:x}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",label:k.popupScrollBars,setup:E,commit:x},{type:"checkbox",id:"dependent",label:k.popupDependent,setup:E,commit:x}]},{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:C.width,id:"width",setup:E,commit:x},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:k.popupLeft,id:"left",setup:E,commit:x}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:C.height,id:"height",setup:E,commit:x},{type:"text",labelLayout:"horizontal",label:k.popupTop,widths:["50%","50%"],id:"top",setup:E,commit:x}]}]}]}]},{id:"upload",label:k.upload,title:k.upload,hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:C.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:C.uploadSubmit,filebrowser:"info:url","for":["upload","upload"]}]},{id:"advanced",label:k.advanced,title:k.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",label:k.id,setup:S,commit:T},{type:"select",id:"advLangDir",label:k.langDir,"default":"",style:"width:110px",items:[[C.notSet,""],[k.langDirLTR,"ltr"],[k.langDirRTL,"rtl"]],setup:S,commit:T},{type:"text",id:"advAccessKey",width:"80px",label:k.acccessKey,maxLength:1,setup:S,commit:T}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:k.name,id:"advName",setup:S,commit:T},{type:"text",label:k.langCode,id:"advLangCode",width:"110px","default":"",setup:S,commit:T},{type:"text",label:k.tabIndex,id:"advTabIndex",width:"80px",maxLength:5,setup:S,commit:T}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:k.advisoryTitle,"default":"",id:"advTitle",setup:S,commit:T},{type:"text",label:k.advisoryContentType,"default":"",id:"advContentType",setup:S,commit:T}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:k.cssClasses,"default":"",id:"advCSSClasses",setup:S,commit:T},{type:"text",label:k.charset,"default":"",id:"advCharset",setup:S,commit:T}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:k.rel,"default":"",id:"advRel",setup:S,commit:T},{type:"text",label:k.styles,"default":"",id:"advStyles",validate:CKEDITOR.dialog.validate.inlineStyle(e.lang.common.invalidInlineStyle),setup:S,commit:T}]}]}]}],onShow:function(){var e=this.getParentEditor(),t=e.getSelection(),n=null;(n=u.getSelectedLink(e))&&n.hasAttribute("href")?t.selectElement(n):n=null;this.setupContent(w.apply(this,[e,n]))},onOk:function(){var e={},t=[],n={},o=this.getParentEditor();this.commitContent(n);switch(n.type||"url"){case"url":var u=n.url&&n.url.protocol!=void 0?n.url.protocol:"http://",a=n.url&&CKEDITOR.tools.trim(n.url.url)||"";e["data-cke-saved-href"]=a.indexOf("/")===0?a:u+a;break;case"anchor":u=n.anchor&&n.anchor.id;e["data-cke-saved-href"]="#"+(n.anchor&&n.anchor.name||u||"");break;case"email":var f=n.email,u=f.address;switch(N){case"":case"encode":var a=encodeURIComponent(f.subject||""),l=encodeURIComponent(f.body||""),f=[];a&&f.push("subject="+a);l&&f.push("body="+l);f=f.length?"?"+f.join("&"):"";if(N=="encode"){u=["javascript:void(location.href='mailto:'+",s(u)];f&&u.push("+'",r(f),"'");u.push(")")}else u=["mailto:",u,f];break;default:u=u.split("@",2);f.name=u[0];f.domain=u[1];u=["javascript:",i(f)]}e["data-cke-saved-href"]=u.join("")}if(n.target)if(n.target.type=="popup"){for(var u=["window.open(this.href, '",n.target.name||"","', '"],c=["resizable","status","location","toolbar","menubar","fullscreen","scrollbars","dependent"],a=c.length,f=function(e){n.target[e]&&c.push(e+"="+n.target[e])},l=0;l