KISSY.Editor.add("music",function(e){e.addPlugin("music",function(){function f(a){a=a||"";return a.indexOf(j)!=-1}var c=KISSY.Editor,j="niftyplayer.swf",d=e.htmlDataProcessor,h=d&&d.dataFilter;h&&h.addRules({elements:{object:function(a){var b=a.attributes;if(!(b.classid&&String(b.classid).toLowerCase())){for(b=0;b<a.children.length;b++)if(a.children[b].name=="embed"){if(!c.Utils.isFlashEmbed(a.children[b]))break;if(f(a.children[b].attributes.src))return d.createFakeParserElement(a,"ke_music","music",
true)}return null}for(b=0;b<a.children.length;b++){var g=a.children[b];if(g.name=="param"&&g.attributes.name.toLowerCase()=="movie")if(f(g.attributes.value))return d.createFakeParserElement(a,"ke_music","music",true)}},embed:function(a){if(!c.Utils.isFlashEmbed(a))return null;if(f(a.attributes.src))return d.createFakeParserElement(a,"ke_music","music",true)}}},4);var i=e.addButton("music",{contentCls:"ke-toolbar-music",title:"\u63d2\u5165\u97f3\u4e50",mode:c.WYSIWYG_MODE,loading:true});c.use("music/support",function(){var a=
new c.MusicInserter(e);i.reload({offClick:function(){a.show()},destroy:function(){a.destroy()}})});this.destroy=function(){i.destroy()}})},{attach:false,requires:["fakeobjects"]});
