(function(){var a=/\.swf(?:$|\?)/i,b=CKEDITOR.tools.cssLength;function c(e){var f=e.attributes;return f.type=='application/x-shockwave-flash'||a.test(f.src||'');};function d(e,f){var g=e.createFakeParserElement(f,'cke_flash','flash',true),h=g.attributes.style||'',i=f.attributes.width,j=f.attributes.height;if(typeof i!='undefined')h=g.attributes.style=h+'width:'+b(i)+';';if(typeof j!='undefined')h=g.attributes.style=h+'height:'+b(j)+';';return g;};CKEDITOR.plugins.add('flash',{init:function(e){e.addCommand('flash',new CKEDITOR.dialogCommand('flash'));e.ui.addButton('Flash',{label:e.lang.common.flash,command:'flash'});CKEDITOR.dialog.add('flash',this.path+'dialogs/flash.js');e.addCss('img.cke_flash{background-image: url('+CKEDITOR.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');if(e.addMenuItems)e.addMenuItems({flash:{label:e.lang.flash.properties,command:'flash',group:'flash'}});e.on('doubleclick',function(f){var g=f.data.element;if(g.is('img')&&g.data('cke-real-element-type')=='flash')f.data.dialog='flash';});if(e.contextMenu)e.contextMenu.addListener(function(f,g){if(f&&f.is('img')&&!f.isReadOnly()&&f.data('cke-real-element-type')=='flash')return{flash:CKEDITOR.TRISTATE_OFF};});},afterInit:function(e){var f=e.dataProcessor,g=f&&f.dataFilter;if(g)g.addRules({elements:{'cke:object':function(h){var i=h.attributes,j=i.classid&&String(i.classid).toLowerCase();if(!j&&!c(h)){for(var k=0;k<h.children.length;k++){if(h.children[k].name=='cke:embed'){if(!c(h.children[k]))return null;return d(e,h);}}return null;}return d(e,h);},'cke:embed':function(h){if(!c(h))return null;return d(e,h);}}},5);},requires:['fakeobjects']});})();CKEDITOR.tools.extend(CKEDITOR.config,{flashEmbedTagOnly:false,flashAddEmbedTag:true,flashConvertOnEdit:false});
