12345678910111213141516171819202122232425 |
- /*
- Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- For licensing, see LICENSE.md or http://ckeditor.com/license
- */
- (function(){function b(a,b,e){var m=n[this.id];if(m)for(var k=this instanceof CKEDITOR.ui.dialog.checkbox,f=0;f<m.length;f++){var d=m[f];switch(d.type){case 1:if(!a)continue;if(null!==a.getAttribute(d.name)){a=a.getAttribute(d.name);k?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}k&&this.setValue(!!d["default"]);break;case 2:if(!a)continue;if(d.name in e){a=e[d.name];k?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}k&&this.setValue(!!d["default"]);break;case 4:if(!b)continue;
- if(b.getAttribute(d.name)){a=b.getAttribute(d.name);k?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}k&&this.setValue(!!d["default"])}}}function e(a,b,e){var m=n[this.id];if(m)for(var k=""===this.getValue(),f=this instanceof CKEDITOR.ui.dialog.checkbox,d=0;d<m.length;d++){var g=m[d];switch(g.type){case 1:if(!a||"data"==g.name&&b&&!a.hasAttribute("data"))continue;var c=this.getValue();k||f&&c===g["default"]?a.removeAttribute(g.name):a.setAttribute(g.name,c);break;case 2:if(!a)continue;
- c=this.getValue();if(k||f&&c===g["default"])g.name in e&&e[g.name].remove();else if(g.name in e)e[g.name].setAttribute("value",c);else{var p=CKEDITOR.dom.element.createFromHtml("\x3ccke:param\x3e\x3c/cke:param\x3e",a.getDocument());p.setAttributes({name:g.name,value:c});1>a.getChildCount()?p.appendTo(a):p.insertBefore(a.getFirst())}break;case 4:if(!b)continue;c=this.getValue();k||f&&c===g["default"]?b.removeAttribute(g.name):"src"===g.name&&/\.flv(?:$|\?)/i.test(c)?(b.setAttribute(g.name,q.flash_flvPlayer),
- b.setAttribute("flashvars","file\x3d"+c+"\x26link\x3d"+c)):b.setAttribute(g.name,c)}}}for(var q={},n={id:[{type:1,name:"id"}],classid:[{type:1,name:"classid"}],codebase:[{type:1,name:"codebase"}],pluginspage:[{type:4,name:"pluginspage"}],src:[{type:2,name:"movie"},{type:4,name:"src"},{type:1,name:"data"}],name:[{type:4,name:"name"}],align:[{type:1,name:"align"}],"class":[{type:1,name:"class"},{type:4,name:"class"}],width:[{type:1,name:"width"},{type:4,name:"width"}],height:[{type:1,name:"height"},
- {type:4,name:"height"}],hSpace:[{type:1,name:"hSpace"},{type:4,name:"hSpace"}],vSpace:[{type:1,name:"vSpace"},{type:4,name:"vSpace"}],style:[{type:1,name:"style"},{type:4,name:"style"}],type:[{type:4,name:"type"}]},l="play loop menu quality scale salign wmode bgcolor base flashvars allowScriptAccess allowFullScreen".split(" "),h=0;h<l.length;h++)n[l[h]]=[{type:4,name:l[h]},{type:2,name:l[h]}];l=["play","loop","menu"];for(h=0;h<l.length;h++)n[l[h]][0]["default"]=n[l[h]][1]["default"]=!0;CKEDITOR.dialog.add("flash",
- function(a){var h=!a.config.flashEmbedTagOnly,l=a.config.flashAddEmbedTag||a.config.flashEmbedTagOnly;q=a.config;var m,k="\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(a.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"cke_FlashPreviewLoader'+CKEDITOR.tools.getNextNumber()+'" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"cke_FlashPreviewBox'+CKEDITOR.tools.getNextNumber()+'" class\x3d"FlashPreviewBox"\x3e\x3c/div\x3e\x3c/div\x3e';return{title:a.lang.flash.title,
- minWidth:420,minHeight:310,onShow:function(){this.fakeImage=this.objectNode=this.embedNode=null;m=new CKEDITOR.dom.element("embed",a.document);var f=this.getSelectedElement();if(f&&f.data("cke-real-element-type")&&"flash"==f.data("cke-real-element-type")){this.fakeImage=f;var d=a.restoreRealElement(f),g=null,c=null,b={};if("cke:object"==d.getName()){g=d;d=g.getElementsByTag("embed","cke");0<d.count()&&(c=d.getItem(0));for(var d=g.getElementsByTag("param","cke"),e=0,k=d.count();e<k;e++){var h=d.getItem(e),
- l=h.getAttribute("name"),h=h.getAttribute("value");b[l]=h}}else"cke:embed"==d.getName()&&(c=d);this.objectNode=g;this.embedNode=c;this.setupContent(g,c,b,f)}},onOk:function(){var f=null,d=null,g=null;this.fakeImage?(f=this.objectNode,d=this.embedNode):(h&&(f=CKEDITOR.dom.element.createFromHtml("\x3ccke:object\x3e\x3c/cke:object\x3e",a.document),f.setAttributes({classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version\x3d6,0,40,0"})),
- l&&(d=CKEDITOR.dom.element.createFromHtml("\x3ccke:embed\x3e\x3c/cke:embed\x3e",a.document),d.setAttributes({type:"application/x-shockwave-flash",pluginspage:"http://www.macromedia.com/go/getflashplayer"}),f&&d.appendTo(f)));if(f)for(var g={},c=f.getElementsByTag("param","cke"),b=0,e=c.count();b<e;b++)g[c.getItem(b).getAttribute("name")]=c.getItem(b);c={};b={};this.commitContent(f,d,g,c,b);f=a.createFakeElement(f||d,"cke_flash","flash",!0);f.setAttributes(b);f.setStyles(c);this.fakeImage?(f.replace(this.fakeImage),
- a.getSelection().selectElement(f)):a.insertElement(f)},onHide:function(){this.preview&&this.preview.setHtml("")},contents:[{id:"info",label:a.lang.common.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",children:[{id:"src",type:"text",label:a.lang.common.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(a.lang.flash.validateSrc),setup:b,commit:e,onLoad:function(){var a=this.getDialog(),b=function(b){m.setAttribute("src",
- b);var c=document.createElement("embed");c.setAttribute("allowfullscreen","true");c.setAttribute("type","application/x-shockwave-flash");c.setAttribute("quality","high");c.setAttribute("height","100%");c.setAttribute("width","100%");/\.flv(?:$|\?)/i.test(b)?(c.setAttribute("flashvars",CKEDITOR.tools.htmlEncode("file\x3d"+b+"\x26link\x3d"+b+"\x26height\x3d100%\x26width\x3d100%")),c.setAttribute("src",CKEDITOR.tools.htmlEncode(q.flash_flvPlayer))):c.setAttribute("src",CKEDITOR.tools.htmlEncode(m.getAttribute("src")));
- a.preview.setHtml(c.outerHTML)};a.preview=a.getContentElement("info","preview").getElement().getChild(3);this.on("change",function(a){a.data&&a.data.value&&b(a.data.value)});this.getInputElement().on("change",function(){b(this.getValue())},this)}},{type:"button",id:"browse",filebrowser:"info:src",hidden:!0,style:"display:inline-block;margin-top:14px;",label:a.lang.common.browseServer}]}]},{type:"hbox",widths:["25%","25%","25%","25%","25%"],children:[{type:"text",id:"width",requiredContent:"embed[width]",
- style:"width:95px",label:a.lang.common.width,validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.width)),setup:b,commit:e},{type:"text",id:"height",requiredContent:"embed[height]",style:"width:95px",label:a.lang.common.height,validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.height)),setup:b,commit:e},{type:"text",id:"hSpace",requiredContent:"embed[hspace]",style:"width:95px",label:a.lang.flash.hSpace,
- validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateHSpace),setup:b,commit:e},{type:"text",id:"vSpace",requiredContent:"embed[vspace]",style:"width:95px",label:a.lang.flash.vSpace,validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateVSpace),setup:b,commit:e}]},{type:"vbox",children:[{type:"html",id:"preview",style:"width:95%;",html:k}]}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:a.lang.common.upload,elements:[{type:"file",id:"upload",label:a.lang.common.upload,
- size:38},{type:"fileButton",id:"uploadButton",label:a.lang.common.uploadSubmit,filebrowser:"info:src","for":["Upload","upload"]}]},{id:"properties",label:a.lang.flash.propertiesTab,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"scale",type:"select",requiredContent:"embed[scale]",label:a.lang.flash.scale,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.scaleAll,"showall"],[a.lang.flash.scaleNoBorder,"noborder"],[a.lang.flash.scaleFit,"exactfit"]],setup:b,
- commit:e},{id:"allowScriptAccess",type:"select",requiredContent:"embed[allowscriptaccess]",label:a.lang.flash.access,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.accessAlways,"always"],[a.lang.flash.accessSameDomain,"samedomain"],[a.lang.flash.accessNever,"never"]],setup:b,commit:e}]},{type:"hbox",widths:["50%","50%"],children:[{id:"wmode",type:"select",requiredContent:"embed[wmode]",label:a.lang.flash.windowMode,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,
- ""],[a.lang.flash.windowModeWindow,"window"],[a.lang.flash.windowModeOpaque,"opaque"],[a.lang.flash.windowModeTransparent,"transparent"]],setup:b,commit:e},{id:"quality",type:"select",requiredContent:"embed[quality]",label:a.lang.flash.quality,"default":"high",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.qualityBest,"best"],[a.lang.flash.qualityHigh,"high"],[a.lang.flash.qualityAutoHigh,"autohigh"],[a.lang.flash.qualityMedium,"medium"],[a.lang.flash.qualityAutoLow,"autolow"],
- [a.lang.flash.qualityLow,"low"]],setup:b,commit:e}]},{type:"hbox",widths:["50%","50%"],children:[{id:"align",type:"select",requiredContent:"object[align]",label:a.lang.common.align,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.common.alignLeft,"left"],[a.lang.flash.alignAbsBottom,"absBottom"],[a.lang.flash.alignAbsMiddle,"absMiddle"],[a.lang.flash.alignBaseline,"baseline"],[a.lang.common.alignBottom,"bottom"],[a.lang.common.alignMiddle,"middle"],[a.lang.common.alignRight,
- "right"],[a.lang.flash.alignTextTop,"textTop"],[a.lang.common.alignTop,"top"]],setup:b,commit:function(a,b,g,c,h){var k=this.getValue();e.apply(this,arguments);k&&(h.align=k)}},{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e"}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.lang.flash.flashvars),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"menu",label:a.lang.flash.chkMenu,"default":!0,setup:b,commit:e},{type:"checkbox",id:"play",label:a.lang.flash.chkPlay,"default":!0,setup:b,commit:e},
- {type:"checkbox",id:"loop",label:a.lang.flash.chkLoop,"default":!0,setup:b,commit:e},{type:"checkbox",id:"allowFullScreen",label:a.lang.flash.chkFull,"default":!0,setup:b,commit:e}]}]}]},{id:"advanced",label:a.lang.common.advancedTab,elements:[{type:"hbox",children:[{type:"text",id:"id",requiredContent:"object[id]",label:a.lang.common.id,setup:b,commit:e}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",id:"bgcolor",requiredContent:"embed[bgcolor]",label:a.lang.flash.bgcolor,setup:b,commit:e},
- {type:"text",id:"class",requiredContent:"embed(cke-xyz)",label:a.lang.common.cssClass,setup:b,commit:e}]},{type:"text",id:"style",requiredContent:"embed{cke-xyz}",validate:CKEDITOR.dialog.validate.inlineStyle(a.lang.common.invalidInlineStyle),label:a.lang.common.cssStyle,setup:b,commit:e}]}]}})})();
|