(function(){var a=function(b,c){var d=1,e=2,f=4,g=8,h=/^\s*(\d+)((px)|\%)?\s*$/i,i=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,j=/^\d+px$/,k=function(){var B=this.getValue(),C=this.getDialog(),D=B.match(h);if(D){if(D[2]=='%')p(C,false);B=D[1];}if(C.lockRatio){var E=C.originalElement;if(E.getCustomData('isReady')=='true')if(this.id=='txtHeight'){if(B&&B!='0')B=Math.round(E.$.width*(B/E.$.height));if(!isNaN(B))C.setValueOf('info','txtWidth',B);}else{if(B&&B!='0')B=Math.round(E.$.height*(B/E.$.width));if(!isNaN(B))C.setValueOf('info','txtHeight',B);}}l(C);},l=function(B){if(!B.originalElement||!B.preview)return 1;B.commitContent(f,B.preview);return 0;};function m(){var B=arguments,C=this.getContentElement('advanced','txtdlgGenStyle');C&&C.commit.apply(C,B);this.foreach(function(D){if(D.commit&&D.id!='txtdlgGenStyle')D.commit.apply(D,B);});};var n;function o(B){if(n)return;n=1;var C=this.getDialog(),D=C.imageElement;if(D){this.commit(d,D);B=[].concat(B);var E=B.length,F;for(var G=0;G0){B=this.getDialog();var D=B.originalElement;B.preview.removeStyle('display');D.setCustomData('isReady','false');var E=CKEDITOR.document.getById(y);if(E)E.setStyle('display','');D.on('load',t,B);D.on('error',u,B);D.on('abort',u,B);D.setAttribute('src',C);s.setAttribute('src',C);B.preview.setAttribute('src',s.$.src);l(B);}else if(B.preview){B.preview.removeAttribute('src');B.preview.setStyle('display','none');}},setup:function(B,C){if(B==d){var D=C.data('cke-saved-src')||C.getAttribute('src'),E=this;this.getDialog().dontResetSize=true;E.setValue(D);E.setInitValue();}},commit:function(B,C){var D=this;if(B==d&&(D.getValue()||D.isChanged())){C.data('cke-saved-src',D.getValue()); C.setAttribute('src',D.getValue());}else if(B==g){C.setAttribute('src','');C.removeAttribute('src');}},validate:CKEDITOR.dialog.validate.notEmpty(b.lang.image.urlMissing)},{type:'button',id:'browse',style:'display:inline-block;margin-top:10px;',align:'center',label:b.lang.common.browseServer,hidden:true,filebrowser:'info:txtUrl'}]}]},{id:'txtAlt',type:'text',label:b.lang.image.alt,accessKey:'T','default':'',onChange:function(){l(this.getDialog());},setup:function(B,C){if(B==d)this.setValue(C.getAttribute('alt'));},commit:function(B,C){var D=this;if(B==d){if(D.getValue()||D.isChanged())C.setAttribute('alt',D.getValue());}else if(B==f)C.setAttribute('alt',D.getValue());else if(B==g)C.removeAttribute('alt');}},{type:'hbox',children:[{id:'basic',type:'vbox',children:[{type:'hbox',widths:['50%','50%'],children:[{type:'vbox',padding:1,children:[{type:'text',width:'40px',id:'txtWidth',label:b.lang.common.width,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var B=this.getValue().match(i),C=!!(B&&parseInt(B[1],10)!==0);if(!C)alert(b.lang.common.invalidWidth);return C;},setup:r,commit:function(B,C,D){var E=this.getValue();if(B==d){if(E)C.setStyle('width',CKEDITOR.tools.cssLength(E));else C.removeStyle('width');!D&&C.removeAttribute('width');}else if(B==f){var F=E.match(h);if(!F){var G=this.getDialog().originalElement;if(G.getCustomData('isReady')=='true')C.setStyle('width',G.$.width+'px');}else C.setStyle('width',CKEDITOR.tools.cssLength(E));}else if(B==g){C.removeAttribute('width');C.removeStyle('width');}}},{type:'text',id:'txtHeight',width:'40px',label:b.lang.common.height,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var B=this.getValue().match(i),C=!!(B&&parseInt(B[1],10)!==0);if(!C)alert(b.lang.common.invalidHeight);return C;},setup:r,commit:function(B,C,D){var E=this.getValue();if(B==d){if(E)C.setStyle('height',CKEDITOR.tools.cssLength(E));else C.removeStyle('height');!D&&C.removeAttribute('height');}else if(B==f){var F=E.match(h);if(!F){var G=this.getDialog().originalElement;if(G.getCustomData('isReady')=='true')C.setStyle('height',G.$.height+'px');}else C.setStyle('height',CKEDITOR.tools.cssLength(E));}else if(B==g){C.removeAttribute('height');C.removeStyle('height');}}}]},{id:'ratioLock',type:'html',style:'margin-top:30px;width:40px;height:40px;',onLoad:function(){var B=CKEDITOR.document.getById(x),C=CKEDITOR.document.getById(w);if(B){B.on('click',function(D){q(this);D.data&&D.data.preventDefault(); },this.getDialog());B.on('mouseover',function(){this.addClass('cke_btn_over');},B);B.on('mouseout',function(){this.removeClass('cke_btn_over');},B);}if(C){C.on('click',function(D){var I=this;var E=p(I),F=I.originalElement,G=I.getValueOf('info','txtWidth');if(F.getCustomData('isReady')=='true'&&G){var H=F.$.height/F.$.width*G;if(!isNaN(H)){I.setValueOf('info','txtHeight',Math.round(H));l(I);}}D.data&&D.data.preventDefault();},this.getDialog());C.on('mouseover',function(){this.addClass('cke_btn_over');},C);C.on('mouseout',function(){this.removeClass('cke_btn_over');},C);}},html:'
'+b.lang.image.lockRatio+''+''+b.lang.image.resetSize+''+'
'}]},{type:'vbox',padding:1,children:[{type:'text',id:'txtBorder',width:'60px',label:b.lang.image.border,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateBorder),setup:function(B,C){if(B==d){var D,E=C.getStyle('border-width');E=E&&E.match(/^(\d+px)(?: \1 \1 \1)?$/);D=E&&parseInt(E[1],10);isNaN(parseInt(D,10))&&(D=C.getAttribute('border'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);if(B==d||B==f){if(!isNaN(E)){C.setStyle('border-width',CKEDITOR.tools.cssLength(E));C.setStyle('border-style','solid');}else if(!E&&this.isChanged())C.removeStyle('border');if(!D&&B==d)C.removeAttribute('border');}else if(B==g){C.removeAttribute('border');C.removeStyle('border-width');C.removeStyle('border-style');C.removeStyle('border-color');}}},{type:'text',id:'txtHSpace',width:'60px',label:b.lang.image.hSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateHSpace),setup:function(B,C){if(B==d){var D,E,F,G=C.getStyle('margin-left'),H=C.getStyle('margin-right');G=G&&G.match(j);H=H&&H.match(j);E=parseInt(G,10);F=parseInt(H,10);D=E==F&&E;isNaN(parseInt(D,10))&&(D=C.getAttribute('hspace'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);if(B==d||B==f){if(!isNaN(E)){C.setStyle('margin-left',CKEDITOR.tools.cssLength(E)); C.setStyle('margin-right',CKEDITOR.tools.cssLength(E));}else if(!E&&this.isChanged()){C.removeStyle('margin-left');C.removeStyle('margin-right');}if(!D&&B==d)C.removeAttribute('hspace');}else if(B==g){C.removeAttribute('hspace');C.removeStyle('margin-left');C.removeStyle('margin-right');}}},{type:'text',id:'txtVSpace',width:'60px',label:b.lang.image.vSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateVSpace),setup:function(B,C){if(B==d){var D,E,F,G=C.getStyle('margin-top'),H=C.getStyle('margin-bottom');G=G&&G.match(j);H=H&&H.match(j);E=parseInt(G,10);F=parseInt(H,10);D=E==F&&E;isNaN(parseInt(D,10))&&(D=C.getAttribute('vspace'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);if(B==d||B==f){if(!isNaN(E)){C.setStyle('margin-top',CKEDITOR.tools.cssLength(E));C.setStyle('margin-bottom',CKEDITOR.tools.cssLength(E));}else if(!E&&this.isChanged()){C.removeStyle('margin-top');C.removeStyle('margin-bottom');}if(!D&&B==d)C.removeAttribute('vspace');}else if(B==g){C.removeAttribute('vspace');C.removeStyle('margin-top');C.removeStyle('margin-bottom');}}},{id:'cmbAlign',type:'select',widths:['35%','65%'],style:'width:90px',label:b.lang.common.align,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.alignLeft,'left'],[b.lang.common.alignRight,'right']],onChange:function(){l(this.getDialog());o.call(this,'advanced:txtdlgGenStyle');},setup:function(B,C){if(B==d){var D=C.getStyle('float');switch(D){case 'inherit':case 'none':D='';}!D&&(D=(C.getAttribute('align')||'').toLowerCase());this.setValue(D);}},commit:function(B,C,D){var E=this.getValue();if(B==d||B==f){if(E)C.setStyle('float',E);else C.removeStyle('float');if(!D&&B==d){E=(C.getAttribute('align')||'').toLowerCase();switch(E){case 'left':case 'right':C.removeAttribute('align');}}}else if(B==g)C.removeStyle('float');}}]}]},{type:'vbox',height:'250px',children:[{type:'html',id:'htmlPreview',style:'width:95%;',html:'
'+CKEDITOR.tools.htmlEncode(b.lang.common.preview)+'
'+''+'
'+''+''+(b.config.image_previewText||'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.')+'
'}]}]}]},{id:'Link',hidden:true,label:b.lang.link.title,padding:0,elements:[{id:'txtUrl',type:'text',label:b.lang.common.url,style:'width: 100%','default':'',setup:function(B,C){if(B==e){var D=C.data('cke-saved-href'); if(!D)D=C.getAttribute('href');this.setValue(D);}},commit:function(B,C){var E=this;if(B==e)if(E.getValue()||E.isChanged()){var D=decodeURI(E.getValue());C.data('cke-saved-href',D);C.setAttribute('href',D);if(E.getValue()||!b.config.image_removeLinkByEmptyURL)E.getDialog().addLink=true;}}},{type:'button',id:'browse',filebrowser:{action:'Browse',target:'Link:txtUrl',url:b.config.filebrowserImageBrowseLinkUrl},style:'float:right',hidden:true,label:b.lang.common.browseServer},{id:'cmbTarget',type:'select',label:b.lang.common.target,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.targetNew,'_blank'],[b.lang.common.targetTop,'_top'],[b.lang.common.targetSelf,'_self'],[b.lang.common.targetParent,'_parent']],setup:function(B,C){if(B==e)this.setValue(C.getAttribute('target')||'');},commit:function(B,C){if(B==e)if(this.getValue()||this.isChanged())C.setAttribute('target',this.getValue());}}]},{id:'Upload',hidden:true,filebrowser:'uploadButton',label:b.lang.image.upload,elements:[{type:'file',id:'upload',label:b.lang.image.btnUpload,style:'height:40px',size:38},{type:'fileButton',id:'uploadButton',filebrowser:'info:txtUrl',label:b.lang.image.btnUpload,'for':['Upload','upload']}]},{id:'advanced',hidden:true,label:b.lang.common.advancedTab,elements:[{type:'hbox',widths:['50%','25%','25%'],children:[{type:'text',id:'linkId',label:b.lang.common.id,setup:function(B,C){if(B==d)this.setValue(C.getAttribute('id'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('id',this.getValue());}},{id:'cmbLangDir',type:'select',style:'width : 100px;',label:b.lang.common.langDir,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.langDirLtr,'ltr'],[b.lang.common.langDirRtl,'rtl']],setup:function(B,C){if(B==d)this.setValue(C.getAttribute('dir'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('dir',this.getValue());}},{type:'text',id:'txtLangCode',label:b.lang.common.langCode,'default':'',setup:function(B,C){if(B==d)this.setValue(C.getAttribute('lang'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('lang',this.getValue());}}]},{type:'text',id:'txtGenLongDescr',label:b.lang.common.longDescr,setup:function(B,C){if(B==d)this.setValue(C.getAttribute('longDesc'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('longDesc',this.getValue());}},{type:'hbox',widths:['50%','50%'],children:[{type:'text',id:'txtGenClass',label:b.lang.common.cssClass,'default':'',setup:function(B,C){if(B==d)this.setValue(C.getAttribute('class')); },commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('class',this.getValue());}},{type:'text',id:'txtGenTitle',label:b.lang.common.advisoryTitle,'default':'',onChange:function(){l(this.getDialog());},setup:function(B,C){if(B==d)this.setValue(C.getAttribute('title'));},commit:function(B,C){var D=this;if(B==d){if(D.getValue()||D.isChanged())C.setAttribute('title',D.getValue());}else if(B==f)C.setAttribute('title',D.getValue());else if(B==g)C.removeAttribute('title');}}]},{type:'text',id:'txtdlgGenStyle',label:b.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(b.lang.common.invalidInlineStyle),'default':'',setup:function(B,C){if(B==d){var D=C.getAttribute('style');if(!D&&C.$.style.cssText)D=C.$.style.cssText;this.setValue(D);var E=C.$.style.height,F=C.$.style.width,G=(E?E:'').match(h),H=(F?F:'').match(h);this.attributesInStyle={height:!!G,width:!!H};}},onChange:function(){o.call(this,['info:cmbFloat','info:cmbAlign','info:txtVSpace','info:txtHSpace','info:txtBorder','info:txtWidth','info:txtHeight']);l(this);},commit:function(B,C){if(B==d&&(this.getValue()||this.isChanged()))C.setAttribute('style',this.getValue());}}]}]};};CKEDITOR.dialog.add('image',function(b){return a(b,'image');});CKEDITOR.dialog.add('imagebutton',function(b){return a(b,'imagebutton');});})(); /*****个性化代码******/ function uploadPicFunc($thisDialog){ var $urlInputBox=$thisDialog.find(".cke_dialog_ui_input_text").eq(0); $urlInputBox.after('
').parent().attr("style","position:relative;"); var $ImagePreviewBox=$(".ImagePreviewBox"), $upImg=$ImagePreviewBox.find("a").eq(0).clone(); $ImagePreviewBox.empty(); $upImg.appendTo($ImagePreviewBox); upLoadUtil(".ImagePreviewBox a img","",{id:"upLoadBox",bgIcon:"/images/upload_pic.gif"},function(file, serverData){ var url = $.parseJSON(serverData).savename; $urlInputBox.find("input").val(getImageURL(url)); }); }; (function(){ var startTime=+new Date(); (function(){ if($(".cke_editor_content_dialog").length>0){ (function(){ var showFlag=0, subStartTime=+new Date(); (function(){ for(var i=0,len=$(".cke_editor_content_dialog").length;i0){ (function(){ var showFlag=0, subStartTime=+new Date(); (function(){ for(var i=0,len=$(".cke_editor_specialTipComm_dialog").length;i0){ }else{ if($(".cke_editor_content_dialog").length>0){ (function(){ var showFlag=0, subStartTime=+new Date(); (function(){ for(var i=0,len=$(".cke_editor_content_dialog").length;i0){ }else{ if($(".cke_editor_specialTipComm_dialog").length>0){ (function(){ var showFlag=0, subStartTime=+new Date(); (function(){ for(var i=0,len=$(".cke_editor_specialTipComm_dialog").length;i