KISSY.Editor.add("video",function(e){function h(b){for(var a=0;a<i.length;a++){var d=i[a];if(d.reg.test(b))return d}}var f=KISSY.Editor,g=e.htmlDataProcessor,j=g&&g.dataFilter,i=[],c=e.cfg.pluginConfig;c.video=c.video||{};c=c.video;c.providers&&i.push.apply(i,c.providers);c.getProvider=h;j&&j.addRules({elements:{object:function(b){var a=b.attributes;if(!(a.classid&&String(a.classid).toLowerCase())){for(a=0;a<b.children.length;a++)if(b.children[a].name=="embed"){if(!f.Utils.isFlashEmbed(b.children[a]))break;
if(h(b.children[a].attributes.src))return g.createFakeParserElement(b,"ke_video","video",true)}return null}for(a=0;a<b.children.length;a++){var d=b.children[a];if(d.name=="param"&&d.attributes.name.toLowerCase()=="movie")if(h(d.attributes.value))return g.createFakeParserElement(b,"ke_video","video",true)}},embed:function(b){if(!f.Utils.isFlashEmbed(b))return null;if(h(b.attributes.src))return g.createFakeParserElement(b,"ke_video","video",true)}}},4);e.addPlugin("video",function(){var b=e.addButton("video",
{contentCls:"ke-toolbar-video",title:"\u63d2\u5165\u89c6\u9891",mode:f.WYSIWYG_MODE,loading:true});f.use("video/support",function(){var a=new f.Video(e);b.reload({offClick:function(){a.show()},destroy:function(){a.destroy()}})});this.destroy=function(){b.destroy()}})},{attach:false,requires:["fakeobjects"]});
