(function(n){function i(n){var t=$e.getBookInfo(n,"info");if(!t||!t.id)return[];try{typeof t.readtime=="undefined"&&(t.readtime=t.time?t.time||0:0),typeof t.isover=="undefined"&&(t.isover=0)}catch(i){t.readtime=0}return t}var t=5280;n.editBook=function(n,r){var f=i(n),e,u;if(f&&(e=mzTpl("tpl_edit"),art.dialog({id:"editdialog",lock:!0,title:"编辑作品",opacity:.7,content:e(f),okVal:"编辑作品",ok:function(){var i=$.trim($("#edit_title").val()),u=$.trim($("#edit_author").val()),e=$("#edit_isover").is(":checked")?"1":"0",f;if(mzVersion>t&&$("#token-input-edit_tags").trigger("keyup"),i!=""&&u!=""){$e.setbookinfo(n,"title",i),$e.setbookinfo(n,"author",u),mzVersion>=5250&&$e.setbookinfo(n,"isover",e),mzVersion>t&&$e.setbookinfo(n,"tags",$("#edit_tags").val()),f=$e.getbookinfo(n),r(f);try{art.dialog.list.editdialog.close()}catch(o){}return!0}return alert("请输入完整信息"),!1},cancelVal:"取消",cancel:!0}),mzVersion>t)){u=$e.getbookinfo(n,"tags"),u&&u.length>0?(u=u.split(/,/ig),u=$.map(u,function(n){return{id:n,name:n}})):u=[],$("#edit_tags").tokenInput([{id:"玄幻",name:"玄幻"}],{prePopulate:u,hintText:"",noResultsText:"没有结果，请按回车继续",searchingText:"搜索中...",preventDuplicates:!0,minChars:0});$("#token-input-edit_tags").on("keyup",function(n){var i=n?n:event,t;i.keyCode==13&&(t=$.trim($(this).val()),$("#edit_tags").tokenInput("add",{id:t,name:t}))})}}})(window)