varplugins={};admin.plugin={plugins:[],add:function(t){t.isInit=!1,t.hash=t.path.replace("/","#")+"/"+t.id,this.plugins.push(t);vara=this._analysePath(t.path);t.index&&a.length<2&&this._addNew(t,a)},setCurByHash:function(t){for(vara=this.plugins,e=0;e<a.length;e++){varn=a[e],i=this._analysePath(n.path),s=!1;n.index&&-1<window.location.hash.indexOf(n.hash)?s=!0:(n.path.replace("/","#")===window.location.hash||"#main"===window.location.hash&&-1<n.path.indexOf("/main/panel"))&&(s=!0),s&&(n.isInit?plugins[n.id].refresh&&plugins[n.id].refresh(t.page):(n.index?2===i.length&&this._addNew(n,i):this._addToExist(n,i),plugins[n.id].init(t.page),n.isInit=!0))}},_analysePath:function(t){vara=t.split("/");returna.splice(0,1),a},_addNew:function(t,a){if(2===a.length)returnt.target=$("#tabPreference li").get(t.index-1),void$("#tabPreference").tabs("add",t);""===a[0]?t.target=$("#tabs>ul>li").get(t.index-1):"article"===a[0]?t.target=$("#tabArticleMgt>li").get(t.index-1):"tools"===a[0]&&(admin.tools.push("#"+t.id),t.target=$("#tabTools>li").get(t.index-1)),t.target||alert("data.index is error!"),$("#tabs").tabs("add",t)},_addToExist:function(t,a){switch(a[0]){case"main":$("#mainPanel"+a[1].charAt(5)).append(t.content);break;case"tools":case"article":2===a.length?$("#tabsPanel_"+a[1]).append(t.content):$("#tabPreferencePanel_"+a[2]).append(t.content);break;case"comment-list":$("#tabsPanel_comment-list").append(t.content)}}};
varplugins={};admin.plugin={plugins:[],add:function(t){t.isInit=!1,t.hash=t.path.replace("/","#")+"/"+t.id,this.plugins.push(t);vara=this._analysePath(t.path);t.index&&a.length<2&&this._addNew(t,a)},setCurByHash:function(t){for(vara=this.plugins,e=0;e<a.length;e++){varn=a[e],i=this._analysePath(n.path),s=!1;n.index&&-1<window.location.hash.indexOf(n.hash)?s=!0:(n.path.replace("/","#")===window.location.hash||"#main"===window.location.hash&&-1<n.path.indexOf("/main/panel"))&&(s=!0),s&&(n.isInit?plugins[n.id].refresh&&plugins[n.id].refresh(t.page):(n.index?2===i.length&&this._addNew(n,i):this._addToExist(n,i),plugins[n.id].init(t.page),n.isInit=!0))}},_analysePath:function(t){vara=t.split("/");returna.splice(0,1),a},_addNew:function(t,a){if(2===a.length)returnt.target=$("#tabPreference li").get(t.index-1),void$("#tabPreference").tabs("add",t);""===a[0]?t.target=$("#tabs>ul>li").get(t.index-1):"article"===a[0]?t.target=$("#tabArticleMgt>li").get(t.index-1):"tools"===a[0]&&(admin.tools.push("#"+t.id),t.target=$("#tabTools>li").get(t.index-1)),t.target||alert("data.index is error!"),$("#tabs").tabs("add",t)},_addToExist:function(t,a){switch(a[0]){case"main":$("#mainPanel"+a[1].charAt(5)).append(t.content);break;case"tools":case"article":2===a.length?$("#tabsPanel_"+a[1]).append(t.content):$("#tabPreferencePanel_"+a[2]).append(t.content);break;case"comment-list":$("#tabsPanel_comment-list").append(t.content)}}};