PageSourceSearch

https://cdnres.115.com/site/static/js/wl_disk2014/min/core-min.js?v=1788400779021

js 115.com collected 2026-09-24 08:39:03 UTC 310,862 bytes, 1 lines download raw bytes

1if(!window.PAGE_PATHS){(function(){var domainStr=document.location.host.replace(/.*115/g,"115");window.PAGE_PATHS={MY:"//my."+domainStr,MY_OS:"//my."+domainStr,PASSPORT_N:"//passport."+domainStr,PASSPORT:"//passport."+domainStr,WAN:"//wan."+domainStr,Q:"//q."+domainStr,MSG:"//msg."+domainStr,U:"//"+domainStr,VIP:"//vip."+domainStr,UAPI:"//webapi."+domainStr,PAY:"//pay."+domainStr,STATIC:"//static."+domainStr,APS:"//aps."+domainStr};var _isHTTPS=false;var thisURL=window.location.href;if(/^https:\/\/.*$/.test(thisURL)){_isHTTPS=true}if(_isHTTPS){window.PAGE_PATHS.UAPI="//webapi."+domainStr}})()}var Core=window.Core||{};Core.ACTIVE={AcDesk:0,GetMain:function(){return $(document)}};Core.Plugs=(function(){var _cache={};return{AddButton:function(key,fun){if(!_cache.float_menu_btn){_cache.float_menu_btn={}}_cache.float_menu_btn[key]=fun},DoButton:function(key){if(_cache.float_menu_btn&&_cache.float_menu_btn[key]){var arg=arguments;var params=[];if(arg.length>1){for(var i=1,len=arg.length;i<len;i++){params.push("arg["+i+"]")}}try{eval("var res = _cache['float_menu_btn'][key]("+params.join(",")+")");return true}catch(e){return false}}return false},Add:function(key,type,mod){if(!_cache[type]){_cache[type]={}}_cache[type][key]=mod},Check:function(key,type){if(_cache[type]){return(_cache[type][key]?true:false)}return false},Cmd:function(key,type,funName){if(Core.Plugs.Check(key,type)){var arg=arguments;var params=[];if(arg.length>3){for(var i=3,len=arg.length;i<len;i++){params.push("arg["+i+"]")}}if(_cache[type][key][funName]){eval("var res = _cache[type][key]."+funName+"("+params.join(",")+")")}return res}}}})();Core.Html={GetShadow:function(){return"";return'<div class="shadow-cor cor-tl"></div><div class="shadow-cor cor-tr"></div><div class="shadow-cor cor-br"></div><div class="shadow-cor cor-bl"></div><div class="shadow-cor cor-t"></div><div class="shadow-cor cor-r"></div><div class="shadow-cor cor-b"></div><div class="shadow-cor cor-l"></div>'},StopPropagation:function(e){Util.Html.StopPropagation(e)},GetFullIFrame:function(){return""}};Core.getFileDataApiCheck=function(key){return(!Core.FileInFrame?Core.FileConfig.DataAPI:Core.FileConfig.FileFrameDataAPI)[key]};Util.CopyMsg=function(result){if(result){Core.MinMessage.Show({text:"内容已复制至剪贴板",type:"suc",timeout:2000})}else{Core.MinMessage.Show({text:"复制失败! 你使用的浏览器不支持复制功能",type:"war",timeout:2000})}};Core.Debug=(function(){var _content,_model;var _class=function(content,callback){var _self=this;Core.WindowBase.call(this,{content:content,title:"调试",min_title:"调试"});var oldclose=_self.Close;this.Close=function(){oldclose();callback&&callback()}};return{write:function(msg){if(!Core.CONFIG.TUpDebugKey){return}if(!_model){_content=$(document.createElement("textarea"));_content.css({width:"100%",height:"100%"});_model=new _class(_content,function(){_model=false});_model.Open()}_content.val(_content.val()+msg+"\n")}}})();Core.HAS_TALK=1;if(!window.STATIC_DIR){STATIC_DIR=PAGE_PATHS.U+"/static"}Core.Update115=null;Core.Update115Browser=null;try{if(!window.useFUpload){if(window.uploadInterface){var is_MAC=((navigator.platform=="Mac68K")||(navigator.platform=="MacPPC")||(navigator.platform=="Macintosh")||(navigator.platform=="MacIntel"))?true:false;if(uploadInterface.uploadBySelecting){window.UPDATE115_STATE=function(data){if(!data){Core.Update115=uploadInterface;Core.Update115Browser=true}else{Core.Update115=false}};Util.log("隐身状态");window.browserInterface&&browserInterface.ChromeGetIncognitoState&&browserInterface.ChromeGetIncognitoState("UPDATE115_STATE")}}}}catch(e){}Core.CONFIG={TwinkTime:70,TwinkCount:3,MsgTimeout:2000,ActiveClass:"window-current",WindowMinWidth:400,WindowMinHeight:300,Path:{My:PAGE_PATHS.MY,MyAjax:PAGE_PATHS.MY,HOME:PAGE_PATHS.HOME+"/",G:PAGE_PATHS.Q+"/",GAJAX:PAGE_PATHS.Q+"/",U:PAGE_PATHS.U+"/",PASS:PAGE_PATHS.PASSPORT+"/",Msg:PAGE_PATHS.MSG+"/",OS:PAGE_PATHS.U+"/",VIP:PAGE_PATHS.VIP,VIP_ORDER:PAGE_PATHS.VIP+"/vip",UAPI:PAGE_PATHS.UAPI,APP:PAGE_PATHS.APP,WENKU:PAGE_PATHS.WENKU,APS:PAGE_PATHS.APS},JSPath:{FUp:STATIC_DIR+"/swfup/swfup_min.js?v=99",JPlayer:STATIC_DIR+"/js/jquery.jplayer.min.js?v=2015",JPProxy:STATIC_DIR+"/js/jplayer_proxy.js?v=2015"},FUpSWF:PAGE_PATHS.U+"/static/swfup/swfup.swf?v=5.0",FUpDebug:false,HTML5:(typeof(Worker)!=="undefined"),IsWindows:true,IsWindowNT:(navigator.userAgent.indexOf("Windows NT")!=-1),IsMac:(navigator.platform=="Mac68K")||(navigator.platform=="MacPPC")||(navigator.platform=="Macintosh")||(navigator.platform=="MacIntel"),IsMacOOF:window.uploadInterface,IsOOF:(function(){var res={state:false};
1if(/webkit/.test(navigator.userAgent.toLowerCase())){var nav=navigator.appVersion;var str=/115Chrome\/[^\s]*/.exec(nav);if(str){res.state=true;var arr=$.trim(str.join("")).split("/");if(arr.length>1){res.version=arr[1];if(arr[1]=="1.0.2"||arr[1]=="1.0.3"){res.is_first=true}}}}return res})(),BaseDir:[1,2,3,4,5,9],WinRightPX:12,DABridgeURL:PAGE_PATHS.UAPI+"/bridge.html",DABridgeURL_NEW:PAGE_PATHS.UAPI+"/bridge_2.0.html",DAAppBridgeURL:PAGE_PATHS.APP+"/bridge_new.html",DAUserBridgeURL:PAGE_PATHS.MY+"/bridge.html",DAMsgBridgeURL:PAGE_PATHS.MSG+"/api/bridge.html",DAQBridgeURL:PAGE_PATHS.Q+"/static/bridge.html",DAUBridgeURL:PAGE_PATHS.U+"/ubridge.html",DASTBridgeURL:PAGE_PATHS.STATIC+"/bridge_2.0.html",APSBridgeURL:PAGE_PATHS.APS+"/bridge_2.0"+(document.domain!="115.com"?"_rc":"")+".html",DAPASBridgeURL:PAGE_PATHS.PASSPORT+"/bridge.html"};(function(config){for(var k in config){Core.CONFIG[k]=config[k]}})({DebugKey:false,TUpDebugKey:false,TUpDebugTime:0,SpaceTips:"#js_index_space_tips",ImterimShareKey:false,ImterimShareMsg:"",OpenMeituKey:false,QFileAPI:null,NotUpCanDo:["delete","q_delete","upload","adddir","reupload","fl_delete"],SpacilDir:[35,36,22,49,99],ChangeTopDir:[5],InDiskDir:[-4,-3,1,2,3,4,5,9,22,49,35,36],IsSeaDir:[-3,-4],ICOType:{"1_0":"i-file","2_0":"i-document","3_0":"i-photo","4_0":"i-music","9_0":"i-video","5_0":"i-file","21_0":"i-folder","22_0":"i-sync","-2_0":"i-transfer",share:"i-shared-folder",Default:"i-folder"},FileICOMod:0,FileListMod:"view",FileDownload:"#js_download_list_box",MusicPlay:"#js_jplay_box",CssPath:{},EditPath:"static_help/editor/editor.php?charset=utf-8&allowhtml=1&domain="+encodeURIComponent(window.PAGE_DOMAIN_ROOT),EditTextArea:"js_ttHtmlEditor",IsLogin:false,Main:"#main",DefaultTitle:"",CenterMain:"#js_center_main_box",ShowHideFileKey:false,ShowHideFileButton:"js_show_hide_btn_"+new Date().getTime()});Core.FloatMenuConfig={none_file_btn:{upload:{text:"上传文件",ico:"upload"},add_dir:{text:"新建文件夹",ico:"newdir"},copy_paste:{text:"粘贴文件"}},right_file:{hide_file:{text:"加密隐藏"},show_file:{text:"取消加密"},set_copy:{text:"复制"},copy_list:{text:"复制到..."},listen:{text:"添加到我听"},cover:{text:"修改封面"},del_cover:{text:"删除封面"},same:{text:"一键排重"},edit_name:{text:"重命名",ico:"rename"},edit:{text:"备注"},attribute:{text:"显示属性"}},more_btn:{view:{text:"打开",_icon_base:"icon-operate",ico:"open"},open_dir:{text:"打开",_icon_base:"icon-operate",ico:"open"},download:{text:"下载",_icon_base:"icon-operate",ico:"download"},download_dir:{text:"下载文件夹",_icon_base:"icon-operate",ico:"download"},bale_download:{text:"打包下载"},refresh:{text:"刷新",_icon_base:"icon-operate",ico:"refresh"},set_copy:{text:"复制",_icon_base:"icon-operate",ico:"copy"},copy_list:{text:"复制到...",_icon_base:"icon-operate",ico:"copyto"},hide_file:{text:"加密隐藏",_icon_base:"icon-operate",ico:"encrypt"},show_file:{text:"取消加密",_icon_base:"icon-operate",ico:"unencrypt"},show_play_long:{text:"显示时长",_icon_base:"icon-operate",ico:"video-duration"},hide_play_long:{text:"取消时长",_icon_base:"icon-operate",ico:"video-duration-hide"},file_score:{text:"评分",_icon_base:"icon-operate",ico:"score"},listen:{text:"添加到我听",_icon_base:"icon-operate",ico:"addtomusic"},cover:{text:"修改封面",_icon_base:"icon-operate",ico:"cover"},del_cover:{text:"删除封面",_icon_base:"icon-operate",ico:"delcover"},same:{text:"一键排重",_icon_base:"icon-operate",ico:"delsame"},move:{text:"移动",_icon_base:"icon-operate",ico:"move"},edit_name:{text:"重命名",_icon_base:"icon-operate",ico:"rename"},edit:{text:"备注",_icon_base:"icon-operate",ico:"edit"},attribute:{text:"显示属性",_icon_base:"icon-operate",ico:"prop"},"delete":{text:"删除",ico:"remove",_icon_base:"icon-operate"},player:{text:"播放器播放",_icon_base:"icon-operate",ico:"video-play"},trans_to_album:{text:"转存至相册",_icon_base:"icon-operate",ico:"tsfalbum"},report:{text:"举报",ico:"report",_icon_base:"icon-operate"}},up_setting:{flash:{text:"普通上传",ico:"done"},ocx1:{text:"电信极速上传",ico:"done"},ocx2:{text:"联通极速上传",ico:"done"},ocx3:{text:"移动极速上传",ico:"done"},ocx4:{text:"长宽极速上传",ico:"done"}}};Core.FileConfig={aid:-1,cid:-1,DataAPI:false,OPTPermission:{nonefile:["edit_file_label","refresh","upload","add_dir","copy_paste"],onemusic:["public_share","edit_file_label","refresh","star","gift","edit","listen","add_listen","edit_name","download","send","copy","move","delete","shareto","set_copy","copy_list","attribute","export_dir","file_score"],onephoto:["public_share","edit_file_label","refresh","star","gift","edit","edit_name","download","send","copy","move","delete","view","shareto","magic","set_copy","copy_list","attribute","export_dir","trans_to_album","file_score"],onemovie:["public_share","edit_file_label","refresh","star","gift","edit","edit_name","download","send","copy","move","delete","view","shareto","set_copy","copy_list","attribute","export_dir","trans_to_album","file_score"],onedocument:["public_share","edit_file_label","refresh","star","gift","edit_name","download","send","copy","move","delete","view","shareto","set_copy","copy_list","attribute","export_dir","file_score"],onefile:["public_share","edit_file_label","refresh","star","gift","edit","edit_name","download","send","copy","move","delete","view","shareto","set_copy","copy_list","attribute","export_dir","file_score"],onefolder:["public_share","edit_file_label","refresh","open_dir","edit","export","same","gift","move","delete","shareto","send","edit_name","set_copy","copy_list","attribute","export_dir","file_score"],onefolderSetShare:["public_share","edit_file_label","refresh","open_dir","edit","export","same","gift","move","delete","shareto","setShare","send","edit_name","set_copy","copy_list","attribute","export_dir","file_score"],onefolderCancelShare:["public_share","edit_file_label","refresh","open_dir","edit","export","same","gift","move","delete","shareto","setShare","cancelShare","send","edit_name","set_copy","copy_list","attribute","export_dir","file_score"],onefoldercover:["refresh","cover","set_copy","copy_list","attribute","file_score"],onefolderdelcover:["refresh","del_cover","set_copy","copy_list","attribute","file_score"],cancelshare:["refresh","shareto","share_file","set_copy","copy_list","attribute","file_score"],fewmusic:["refresh","star","gift","copy","listen","add_listen","send","move","delete","shareto","file_score"],fewphoto:["refresh","star","gift","copy","send","move","delete","shareto","set_copy","copy_list","trans_to_album","file_score"],fewmovie:["refresh","star","gift","copy","send","move","delete","shareto","set_copy","copy_list","trans_to_album","file_score"],fewfile:["refresh","star","gift","copy","send","move","delete","shareto","set_copy","copy_list","file_score"],fewfolder:["refresh","shareto","gift","delete","move","set_copy","copy_list","export_dir","file_score"],fewfandfl:["refresh","delete","move","gift","set_copy","copy_list","export_dir","trans_to_album","file_score"],rb:["refresh","remove","set_copy","copy_list"],rbfile:["refresh","rb_delete","restore","set_copy","copy_list"],hide_file:["refresh","show_file","set_copy","copy_list"],show_file:["refresh","hide_file","set_copy","copy_list"],hide_folder:["refresh","show_file","set_copy","copy_list"],show_folder:["refresh","hide_file","set_copy","copy_list"],hide_play_long:["refresh","show_play_long","set_copy","copy_list"],show_play_long:["refresh","hide_play_long","set_copy","copy_list"],set_category:["refresh","set_category","set_copy","copy_list"],unset_category:["refresh","unset_category","set_copy","copy_list"],illegalfile:["delete","attribute"],report:["report"],file_score:["file_score"]},Specil:{"-3":{edit:1,edit_name:1,"delete":1,download:1,copylink:1,
1cancelshare:1,renew:1,shareto:1,move:1,share_one:1,more_one:1,download_one:1,download_dir_one:1},"5":{edit:1,edit_name:1,"delete":1,download:1,share_one:1,more_one:1,download_one:1,download_dir_one:1},"99":{download_one:1,download_dir_one:1}}};Core.FileConfig.OPTPermission.fewmovie.push("import_movie");Core.FileConfig.OPTPermission.onemovie.push("edit_movie");if(/msie/.test(navigator.userAgent.toLowerCase())||Core.CONFIG.IsWindowNT||(Core.CONFIG.IsMacOOF&&Core.CONFIG.IsMac)){Core.FileConfig.OPTPermission.fewmusic.push("download");Core.FileConfig.OPTPermission.fewphoto.push("download");Core.FileConfig.OPTPermission.fewmovie.push("download");Core.FileConfig.OPTPermission.fewfile.push("download");Core.FileConfig.OPTPermission.fewfolder.push("download_dir");Core.FileConfig.OPTPermission.onefolder.push("download_dir")}Core.Setting={Change:function(r,callback){var data={};for(var k in r){data["key["+k+"]"]=r[k]}$.ajax({url:"?ct=ajax_user&ac=set_user_config",type:"POST",dataType:"json",data:data,success:function(res){if(res.state){if(Core.CONFIG.IsWindows){if(r.os_file_upload_type!=undefined){if(r.os_file_upload_type==0){Core.CONFIG.UpEngine=0}else{Core.CONFIG.UpEngine=1;if(r.os_file_upload_type==1){Core.CONFIG.TUpSp="0"}else{Core.CONFIG.TUpSp="1"}}}}else{Core.CONFIG.UpEngine=0}}if(callback){callback(res)}}})}};Core.NewSetting={Get:function(key){return USER_SETTING[key]},Change:function(setting,callback){$.ajax({url:"//115.com/?ac=setting&even=saveedit&is_wl_tpl=1",data:setting,type:"POST",dataType:"json",success:function(r){callback&&callback(r)}})}};Core.UserSetting=(function(){return{Change:function(params,callback){if(!params){params={}}UA$.ajax({url:"/files/order",type:"POST",data:params,success:function(r){(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state){callback&&callback(r)}else{Core.MinMessage.Show({text:r.error,type:"war",timeout:2000})}}catch(e){callback&&callback(r)}},error:function(e){(Core.MinMessage)&&Core.MinMessage.Hide();(Core.MinMessage)&&Core.MinMessage.Show({text:"网络异常,请重试",type:"err",timeout:2000})}})}}})();Core.LocalUserSetting=(function(){try{Util.Cookie.init(window.USER_ID)}catch(e){}return{Get:function(key){return Util.Cookie.get(key)},Set:function(key,val){Util.Cookie.set(key,val,999)}}})();Core.WinHistory=(function(){var _list={};var _random=0;var _zIndex=9999;var _old_active;var _bindState=false;var bindEvent=function(){if(!_bindState){$(window).bind("resize",function(){for(var k in _list){var win=_list[k];var h=win.Main.height();var w=win.Main.width();var wH=win.warp.height();var wW=win.warp.width();var wT=win.warp.offset().top;var wL=win.warp.offset().left;var mL=win.Main.offset().left;if(win.Setting.is_right){win.warp.height(h-wT-5);win.warp.offset({left:mL+w-wW-Core.CONFIG.WinRightPX})}else{if((wL+wW)>w){var newL=w-wW-5;if(newL<0){wW=wW+newL;newL=0}if(!win.Setting.is_not_resize){if(wW<win.Setting.min_width){wW=win.Setting.min_width}win.warp.width(wW)}win.warp.offset({left:newL})}if((wT+wH)>h){var newT=h-wH-5;if(newT<0){wH=wH+newT;newT=0}if(!win.Setting.is_not_resize){if(wH<win.Setting.min_height){wH=win.Setting.min_height}win.warp.height(wH)}win.warp.offset({top:newT})}}}});_bindState=true}};var windowStatusChange=function(){for(var k in Core.WinHistory.ChangeDelegate){try{if(Core.WinHistory.ChangeDelegate[k]){Core.WinHistory.ChangeDelegate[k](_list)}}catch(e){Core.WinHistory.ChangeDelegate[k]=null;delete Core.WinHistory.ChangeDelegate[k]}}};return{ChangeDelegate:{},GetList:function(){return _list},Add:function(win){bindEvent();win.Key=win.Type+"_"+_random;_random++;_list[win.Key]=win;windowStatusChange()},Del:function(key){if(_list[key]){_list[key]=null;delete _list[key];windowStatusChange()}},GetIndex:function(){return _zIndex++},LessIndex:function(){_zIndex--},Active:function(win){if(_old_active&&_old_active==win.Key){return}_zIndex++;win.Active(_zIndex);win.IsActive=true;if(_old_active&&_list[_old_active]){_list[_old_active].DeActive();_list[_old_active].IsActive=false}_old_active=win.Key;windowStatusChange()},Alarm:function(win){},DeOldActive:function(){if(_old_active&&_list[_old_active]){_list[_old_active].DeActive();_list[_old_active].IsActive=false;_old_active=false}},DeActiveStatus:function(win){Core.WinHistory.DeOldActive();_old_active=false;windowStatusChange()}}})();Core.WinTitle=(function(){var _temp='<h2 class="dialog-title" rel="base_title"><span>{title}</span><div class="dialog-handle">{button}</div></h2>';var _btns=['<a href="javascript:;" class="diag-minimize" btn="hide">最小化</a>','<a href="javascript:;" class="diag-maximize" btn="max">最大化</a><a href="javascript:;" class="diag-return" style="display:none" btn="revert">还原</a>','<a href="javascript:;" class="diag-close" btn="close">关闭</a>'];var bindEvents=function(box,win){box.find("[btn]").mousedown(function(e){Core.Html.StopPropagation(e);Core.WinHistory.Active(win)}).click(function(e){win.SetButtonHandler($(this).attr("btn"));return false})};return{Get:function(win){var html=_btns.join("");var box=$(String.formatmodel(_temp,{title:win.Setting.title,button:html}));bindEvents(box,win);return box}}})();Core.WindowBase=function(setting){var _temp='<div class="dialog-box" style="display:none;" id="{key}_warp">'+Core.Html.GetShadow()+'<div id="{key}_inner" style="height:100%;"></div>'+Core.Html.GetFullIFrame()+"</div>";var _resizeTemp='<div resize="{resize_type}" style="position: absolute; overflow: hidden; background: url('+STATIC_DIR+'/js/transparent.gif) repeat scroll 0% 0% transparent; {css}"></div>';var _self=this;var _cache={resize:{t:"left: 0; top: -3px; width: 100%; height: 5px; z-index: 1;",r:"right: -3px; top: 0; width: 5px; height: 100%; z-index: 1;",b:"left: 0; bottom: -3px; width: 100%; height: 5px; z-index: 1;",l:"left: -3px; top: 0; width: 5px; height: 100%; z-index: 1;",rt:"right: -3px; top: -3px; width: 10px; height: 10px; z-index: 2",rb:"right: -3px; bottom: -3px; width: 10px; height: 10px; z-index: 2",lt:"left: -3px; top: -3px; width: 10px; height: 10px; z-index: 2",lb:"left: -3px; bottom: -3px; width: 10px; height: 10px; z-index: 2"}};if(!setting){setting={}}if(!setting.content){setting.content=""}if(!setting.title){setting.title=""}
1if(!setting.min_title){setting.min_title="窗口"}this.warp;this.Type="window";this.IsActive=false;this.StatusType=0;if(setting.Status!=undefined){this.StatusType=setting.Status}this.Setting=setting;this.Main;var bindResize=function(resizeType,ele){var rt="";switch(resizeType){case"t":rt="n-resize";break;case"r":rt="e-resize";break;case"b":rt="s-resize";break;case"l":rt="w-resize";break;case"rt":rt="ne-resize";break;case"rb":rt="se-resize";break;case"lb":rt="sw-resize";break;case"lt":rt="nw-resize";break}Util.Mouse.MoveLine(ele,rt,function(line){var xLess=line.eX-line.x;var yLess=line.eY-line.y;var w=_cache.resize_width;var h=_cache.resize_height;var t=_cache.resize_top;var l=_cache.resize_left;if(/l/.test(resizeType)){w=w-xLess;if(w<_cache.resize.min_width){l=_cache.resize_maxL}else{l=l+xLess}}if(/r/.test(resizeType)){w=w+xLess}if(/b/.test(resizeType)){h=h+yLess}if(/t/.test(resizeType)){h=h-yLess;if(h<_cache.resize.min_height){t=_cache.resize_maxT}else{t=t+yLess}}if(w<_cache.resize.min_width){w=_cache.resize.min_width}if(h<_cache.resize.min_height){h=_cache.resize.min_height}if(t<_cache.resize_mt){h=h-Math.abs(_cache.resize_mt-t);t=_cache.resize_mt}if((t+h)>_cache.resize_mb){h=_cache.resize_mb-t}if(l<_cache.resize_ml){w=w-Math.abs(_cache.resize_ml-l);l=_cache.resize_ml}if((l+w)>_cache.resize_mr){w=_cache.resize_mr+l}_self.warp.css({width:w+"px",height:h+"px",top:t+"px",left:l+"px"});if(_self.Setting.is_right){_self.Setting.is_right=false}},function(){var mainBox=_self.Main;_cache.resize_mt=mainBox.offset().top;_cache.resize_ml=mainBox.offset().left;_cache.resize_mr=_cache.resize_ml+mainBox.width();_cache.resize_mb=_cache.resize_mt+mainBox.height();_cache.resize_width=_self.warp.width();_cache.resize_height=_self.warp.height();_cache.resize_top=_self.warp.offset().top;_cache.resize_left=_self.warp.offset().left;_cache.resize_maxL=_cache.resize_left+_cache.resize_width-_cache.resize.min_width;_cache.resize_maxT=_cache.resize_top+_cache.resize_height-_cache.resize.min_height})};var create=function(){if(!_cache.initState){_self.Main=$(document.body);_cache.initState=true;Core.WinHistory.Add(_self);_cache.resize.min_width=_self.Setting.min_width=_self.Setting.min_width?_self.Setting.min_width:Core.CONFIG.WindowMinWidth;_cache.resize.min_height=_self.Setting.min_height=_self.Setting.min_height?_self.Setting.min_height:Core.CONFIG.WindowMinHeight;if(!_self.warp){_self.warp=$(String.formatmodel(_temp,{key:_self.Key}));var inner=_self.warp.find("#"+_self.Key+"_inner");if(!_self.Setting.is_not_resize){_cache.resize_list=[];for(var k in _cache.resize){var ele=$(String.formatmodel(_resizeTemp,{resize_type:k,css:_cache.resize[k]}));bindResize(k,ele);_self.warp.append(ele);_cache.resize_list.push(ele)}}if(!_self.Setting.is_not_title){_cache.title=Core.WinTitle.Get(_self);inner.append(_cache.title)}inner.append(_self.Setting.content);if(_self.Setting.width!=undefined){_self.warp.width(_self.Setting.width)}if(_self.Setting.height!=undefined){_self.warp.height(_self.Setting.height)}var mainBox=_self.Main;mainBox.append(_self.warp);if(_self.warp.height()>mainBox.height()){_self.warp.height(mainBox.height())}if(_self.Setting.position){_self.warp.css(_self.Setting.position)}else{Util.Layer.Center(_self.warp,{NoAddScrollTop:true});_self.warp.css({position:"fixed"})}var st={ClickBox:_cache.title?_cache.title:_self.warp,Box:_self.warp,Outer:mainBox,Callback:function(){Core.WinHistory.Active(_self)},MoveCallback:function(){if(_self.Setting.is_right){_self.Setting.is_right=false}}};var oh=document.documentElement.scrollHeight>document.documentElement.clientHeight?document.documentElement.scrollHeight:document.documentElement.clientHeight;if(oh<=mainBox.height()){st.Outer=mainBox}Util.Mouse.MoveBox(st);if(!_self.Setting.is_not_resize){_cache.title.bind("dblclick",function(){if(!_self.MaxState){_self.Max()}else{_self.Revert()}})}else{_cache.title&&_cache.title.find("[btn='max']").empty().remove();_cache.title&&_cache.title.find("[btn='revert']").empty().remove()}if(_self.Setting.is_not_min_title){_cache.title&&_cache.title.find(".win-minsize").empty().remove()}_self.warp.bind("mousedown",function(e){Core.WinHistory.Active(_self)});if(_self.Setting.is_max_window){_self.Max()}}if(_self.Initial){_self.Initial()}}};this.Max=function(){var mainBox=_self.Main;var w=mainBox.width(),h=mainBox.height();var oh=document.documentElement.scrollHeight>document.documentElement.clientHeight?document.documentElement.scrollHeight:document.documentElement.clientHeight;h=oh;_self.MaxState=true;
1_cache.old_sq={w:_self.warp.width(),h:_self.warp.height(),t:_self.warp.offset().top,l:_self.warp.offset().left};_self.warp.width(w).height(h).css({top:0,left:0});setTitleBtn();_self.Open()};this.Revert=function(){_self.MaxState=false;var w=_cache.resize.min_width,h=_cache.resize.min_height,t=0,l=0;if(_cache.old_sq){w=_cache.old_sq.w;h=_cache.old_sq.h;t=_cache.old_sq.t;l=_cache.old_sq.l}_self.warp.width(w).height(h).css({top:t,left:l});setTitleBtn()};this.CreateDom=function(){create()};this.Hide=function(){_self.warp.hide();_self.DeActive();Core.WinHistory.DeActiveStatus(_self);_self.IsActive=false};this.Open=function(){create();_self.warp.show();Core.WinHistory.Active(_self)};var setTitleBtn=function(){if(_self.MaxState){_cache.title.find("[btn='max']").hide();_cache.title.find("[btn='revert']").show();if(_cache.resize_list){for(var i=0,len=_cache.resize_list.length;i<len;i++){_cache.resize_list[i].hide()}}}else{_cache.title.find("[btn='revert']").hide();_cache.title.find("[btn='max']").show();if(_cache.resize_list){for(var i=0,len=_cache.resize_list.length;i<len;i++){_cache.resize_list[i].show()}}}};this.SetButtonHandler=function(type){switch(type){case"hide":_self.Hide();break;case"max":_self.Max();break;case"revert":_self.Revert();break;case"close":_self.Close();break}};this.Close=function(){Core.WinHistory.Del(_self.Key);_cache.initState=false;_self.warp&&_self.warp.hide();_self.MaxState=false};this.Active=function(zIndex){_self.warp.css({zIndex:zIndex}).addClass(Core.CONFIG.ActiveClass)};this.DeActive=function(){_self.warp.removeClass(Core.CONFIG.ActiveClass)}};(function(){var _coverIndex=1000000003;Core.DialogBaseHandler={};Core.DialogBase=function(settings){var _temp='<div class="dialog-box dialog-mini" style="display:none;z-index:1000000002">'+Core.Html.GetShadow()+'<div class="dialog-header" rel="title_box"><h3 rel="base_title"></h3></div><div class="dialog-handle"><a href="javascript:;" class="close" btn="close">关闭</a></div><div rel="base_content"></div></div>';var _box,_cover,_timer,_self=this,_notShowCover=false;var _settings=!settings?{}:settings;this.Main=Core.ACTIVE.GetMain();settings.CloseHandler&&(Core.DialogBaseHandler.CloseHandler=settings.CloseHandler);var create=function(win){if(!_self.warp){_self.warp=$(settings.warpHtml||_temp);if(_settings.width){_self.warp.width(_settings.width)}$(document.body).append(_self.warp);_self.warp.find("[btn]").mousedown(function(e){Core.Html.StopPropagation(e);return true});_self.warp.find("[btn]").click(function(e){switch($(this).attr("btn")){case"close":_self.Close();break}return false});if(_settings.title){_self.warp.find("[rel='base_title']").html(_settings.title)}if(_settings.content){_self.warp.find("[rel='base_content']").append(_settings.content)}if(!Core.CONFIG.DialogNotMove){var mset={ClickBox:_self.warp.find("[rel='title_box']"),Box:_self.warp,Outer:_self.Main};Util.Mouse.MoveBox(mset)}if(_self.Initial){_self.Initial()}_self.warp.css({position:"fixed"})}if(!_cover){_cover=$('<div class="dialog-back-mask" style="z-index: 1000000001; display: none;background: none repeat scroll 0 0 #000;_padding-top:40px;height: 100%;left: 0;position: absolute;top: 0;width: 100%;filter:alpha(opacity=40);-moz-opacity:0.4;opacity:0.4;"><div style="height:100%;width:100%;"></div></div>');var oldCover=$(".dialog-back-mask");if(oldCover.length&&!oldCover.is(":hidden")){_notShowCover=true;_cover.hide()}else{_notShowCover=false}$(document.body).append(_cover);_cover.css({position:"fixed"});_cover.bind("mousedown",function(){if(_timer){window.clearInterval(_timer)}_timer=window.setInterval(function(){if(_timer_index%2){_self.warp&&_self.warp.addClass(Core.CONFIG.ActiveClass)}else{_self.warp&&_self.warp.removeClass(Core.CONFIG.ActiveClass)}_timer_index++;if(_timer_index>(Core.CONFIG.TwinkCount*2+1)){_timer_index=1;if(_timer){window.clearInterval(_timer)}}},Core.CONFIG.TwinkTime)});$(document).on("keydown",function(e){if(e.keyCode==27){if(_cover){_self.Close();return false}}})}
1Util.Layer.Center(_self.warp,{Main:false,NoAddScrollTop:true})};var _timer_index=1;this.Open=function(calback,win){create(win);if(calback){calback()}_cover.show().css({"z-index":_coverIndex++,"background-color":"rgba(0,0,0,"+(_notShowCover?"0":"0.4")+")"});_self.warp.css({"z-index":_coverIndex++});if(_notShowCover){_notShowCover=false}Core.DialogBase.acIndex=_coverIndex;_self.warp.addClass(Core.CONFIG.ActiveClass).show();_self.warp.find('[btn="close"]').focus().blur();if(!Core.DialogBase.History){Core.DialogBase.History=0}Core.DialogBase.History++;Core.DialogBaseHandler.ShowHandler&&Core.DialogBaseHandler.ShowHandler()};this.Close=function(){_cover&&_cover.hide().remove();_self.warp&&_self.warp.hide().remove();_cover=false;_self.warp=false;if(Core.DialogBase.History){Core.DialogBase.History--}if(Core.DialogBase.History<0){Core.DialogBase.History=0}Core.DialogBaseHandler.CloseHandler&&Core.DialogBaseHandler.CloseHandler()}};Core.DialogBase.acIndex=_coverIndex})();Core.DataAccess={};Core.DataAccess.DataAPI=null;Core.DataAccess.UDataAPI=null;Core.DataAccess.ScurityKey="";Core.DataAccess.DataAppAPI=null;Core.DataAccess.DataUserAPI=null;Core.DataAccess.DataMsgAPI=null;Core.DataAccess.DataStaicAPI=null;Core.DataAccess.DataAPSAPI=null;Core.DataAccess.DataPASAPI=null;Core.DataAccess.DataQAPI=null;Core.DataAccess.Bridge=(function(){var _doms={},_callbacks={},_bridge={file:Core.CONFIG.DABridgeURL,file_new:Core.CONFIG.DABridgeURL_NEW,app:Core.CONFIG.DAAppBridgeURL,user:Core.CONFIG.DAUserBridgeURL,im:Core.CONFIG.DAIMBridgeURL,msg:Core.CONFIG.DAMsgBridgeURL,q:Core.CONFIG.DAQBridgeURL,u:Core.CONFIG.DAUBridgeURL,"static":Core.CONFIG.DASTBridgeURL,pass:Core.CONFIG.DAPASBridgeURL,aps:Core.CONFIG.APSBridgeURL},_par;return{ChangeBridge:function(type,url){_bridge[type]=url},RemoveBridge:function(key){if(_doms[key]){$(_doms[key]).find("iframe").attr("src","");$(_doms[key]).empty().remove();_doms[key]=null;delete _doms[key]}},Load:function(complete,key,namespace,api){if(!_par){_par=$('<div style="height:1px;overflow:hidden;position:absolute;width:1px;"></div>');$(document.body).append(_par)}var dom=_doms[key];(_callbacks[key]||(_callbacks[key]=[])).push(complete||function(){});if(!dom){dom=document.createElement("iframe");var onload=function(){var cbs=_callbacks[key],c;dom.loaded=true;while(c=cbs.shift()){try{c(dom)}catch(e){window.console&&window.console.log(e)}}};$(dom).on("readystatechange",function(){if(this.readyState=="complete"){if(dom.doload){return}dom.doload=true;window.setTimeout(function(){onload()},10)}});$(dom).on("load",function(){if(dom.doload){return}dom.doload=true;window.setTimeout(function(){onload()},10)});dom.src=_bridge[key]+"?namespace="+namespace+"&api="+api+"&_t=v5";_par.append(dom);_doms[key]=dom}else{if(dom.loaded){_callbacks[key]=[];if(complete){try{complete(dom)}catch(e){window.console&&window.console.log(e)}}}}}}})();Core.DataAccess.Ajax=Core.DataAccess.UAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(){window.setTimeout(function(){if(setting.dataType=="json"){setting.dataType=false;delete setting.dataType;var callback=setting.success;setting.success=function(r){if(r){r=eval("("+r+")");callback&&callback(r)}}}if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}Core.DataAccess.UDataAPI.ajax(setting)},10)},"file_new","Core.DataAccess","UDataAPI")}}})();Core.DataAccess.APSAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(){window.setTimeout(function(){if(setting.dataType=="json"){setting.dataType=false;delete setting.dataType;var callback=setting.success;setting.success=function(r){r=eval("("+r+")");callback&&callback(r)}}if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}Core.DataAccess.DataAPSAPI.ajax(setting)},10)},"aps","Core.DataAccess","DataAPSAPI")}}})();window["APS$"]={ajax:Core.DataAccess.APSAjax.Send};window["UA$"]={ajax:Core.DataAccess.UAjax.Send};Core.DataAccess.DiskAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(ifr){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}ifr.contentWindow.$.ajax(setting)},"u","Core.DataAccess","DataDiskAPI")}}})();window["U$"]={ajax:Core.DataAccess.DiskAjax.Send};Core.DataAccess.StaticAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(ifr){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}ifr.contentWindow.$.ajax(setting)},"static","Core.DataAccess","DataStaticAPI")}}})();window["ST$"]={ajax:Core.DataAccess.StaticAjax.Send};Core.DataAccess.QAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(ifr){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}ifr.contentWindow.$.ajax(setting)},"q","Core.DataAccess","DataQAPI")}}})();window["Q$"]={ajax:Core.DataAccess.QAjax.Send};Core.DataAccess.PassportAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(ifr){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}ifr.contentWindow.$.ajax(setting)},"pass","Core.DataAccess","DataPASAPI")}}})();window["PAS$"]={ajax:Core.DataAccess.PassportAjax.Send};Core.DataAccess.MsgAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}Core.DataAccess.DataMsgAPI.ajax(setting)},"msg","Core.DataAccess","DataMsgAPI")}}})();Core.DataAccess.AppAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}Core.DataAccess.DataAppAPI&&Core.DataAccess.DataAppAPI.ajax(setting)},"app","Core.DataAccess","DataAppAPI")}}})();Core.DataAccess.UserAjax=(function(){return{Send:function(setting){Core.DataAccess.Bridge.Load(function(){if(window.oofUtil&&oofUtil.autoToken){setting.data=oofUtil.autoToken.setRequestToken(setting.data)}Core.DataAccess.DataUserAPI.ajax(setting)},"user","Core.DataAccess","DataUserAPI")}}})();Core.DataAccess.Error=(function(){return{Throw:function(e){(Core.MinMessage)&&Core.MinMessage.Show({text:e.message,type:"war",timeout:Core.CONFIG.MsgTimeout})}}})();Core.DataAccess.FileRead=(function(){var IS_115DOMAIN=/115(rc)?\.com/.test(location.href);var WEB_API_URL=IS_115DOMAIN?"//webapi.115.com":"/webapi";
1var APS_URL=IS_115DOMAIN?"//aps.115.com":"/aps";var _errObj={message:"网络异常,请刷新页面重试"},_isLoadingList=false;var GetFileListLoadingTimeout,getListLoadingTimeout;var getList=function(url,data,callback,type){if(!data.offset){data.offset=0}if(!data.limit){data.limit=30}if(!data.source){data.source=""}if(!data.format){data.format="json"}getListLoadingTimeout&&clearTimeout(getListLoadingTimeout);getListLoadingTimeout=setTimeout(function(){(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取文件...",type:"load",timeout:10000})},1000);$.ajax({url:WEB_API_URL+url,type:type?type:"GET",data:data,xhrFields:{withCredentials:true},success:function(r){getListLoadingTimeout&&clearTimeout(getListLoadingTimeout);(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state===false&&r.errNo!=20130827){Core.DataAccess.Error.Throw({message:r.error});return}top.window._SORTTIMETYPE=r.order;callback&&callback(r)}catch(e){callback&&callback(r);return;Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})};return{GetClassList:function(data,callback){getList("/lists",data,callback)},IsLoadingList:function(){return _isLoadingList},GetQFileList:function(data,callback){_isLoadingList=true;getList("/qfiles",data,function(r){_isLoadingList=false;if(!r.path){r.path=[{name:"圈子共享",aid:999,qid:0,cid:0}]}callback&&callback(r)},"POST")},SearchQFile:function(data,callback){_isLoadingList=true;getList("/files/qsearch",data,function(r){_isLoadingList=false;callback&&callback(r)},"POST")},GetFileList:function(data,callback){_isLoadingList=true;var obj={n:"共享给我的文件夹",ns:"共享给我的文件夹",p:0,pid:"0",sh:"1",t:"1614599408",te:"1614599408",tp:"1604979524",u:"",style:"display:none"};getList("/files",data,function(r){if(r.state){for(var i=0;i<r.data.length;i++){r.data[i]["sourceData"]=r.data[i]}_isLoadingList=false;if(!r.path){r.path=[{name:"文件",aid:1,cid:0,pid:0}];r.aid=1;r.cid=0;data.aid=1;data.cid=0}callback&&callback(r)}else{GetFileListLoadingTimeout&&clearTimeout(GetFileListLoadingTimeout);GetFileListLoadingTimeout=setTimeout(function(){(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取文件...",type:"load",timeout:10000})},1000);if(r.order!=undefined){data.o=r.order}if(r.is_asc!=undefined){data.asc=r.is_asc}if(r.fc_mix!==undefined){data.fc_mix=r.fc_mix}$.ajax({url:APS_URL+"/natsort/files.php",data:data,type:"GET",dataType:"json",xhrFields:{withCredentials:true},success:function(res){GetFileListLoadingTimeout&&clearTimeout(GetFileListLoadingTimeout);(Core.MinMessage)&&Core.MinMessage.Hide();r=res;_isLoadingList=false;if(r.state){if(!r.path){r.path=[{name:"文件",aid:1,cid:0,pid:0}];r.aid=1;r.cid=0;data.aid=1;data.cid=0}r.aps=1;callback&&callback(r)}else{Core.DataAccess.Error.Throw({message:r.error})}}})}})},GetTargetRecord:function(data,callback){_isLoadingList=true;getList("/history/move_target_list",data,function(r){_isLoadingList=false;if(r.state){r.path=[{name:"文件",aid:1,cid:0,pid:0},{name:"最近移动记录",aid:-3,cid:0,pid:0}];r.aid=1;r.cid=0;r.count=r.data.total;r.data=r.data.list}callback&&callback(r)})},GetQRBList:function(data,callback){_isLoadingList=true;getList("/files/qrb",data,function(r){_isLoadingList=false;callback&&callback(r)})},GetQFileDetail:function(file_id,qid,callback){Core.DataAccess.Ajax.Send({url:"/files/qdesc",type:"GET",data:{file_id:file_id,qid:qid,format:"json"},success:function(r){try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetFileDetail:function(file_id,callback){$.ajax({url:WEB_API_URL+"/files/desc",type:"GET",data:{file_id:file_id,format:"json",compat:1,new_html:1},success:function(r){try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}if(r.desc==="<p></p>"){r.desc=""}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetFilePass:function(file_id,callback){Core.DataAccess.Ajax.Send({url:"/files/desc",type:"GET",data:{file_id:file_id,field:"pass",format:"json"},success:function(r){try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}if(r.desc==="<p></p>"){r.desc=""}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},Search:function(data,callback){getList("/files/search",data,callback)},CheckSame:function(data,callback){var url=APS_URL+"/repeat/show.php";$.ajax({url:url,type:"GET",data:data,success:function(r){try{r=eval("("+r+")");callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},Same:function(data,callback){if(!data.offset){data.offset=0}if(!data.limit){data.limit=30}if(!data.source){data.source=""}if(!data.format){data.format="json"}(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取文件...",type:"load",timeout:10000});var url=APS_URL+"/repeat/show.php";$.ajax({url:url,type:"GET",data:data,success:function(r){(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetActiveDate:function(y,m,callback){Core.DataAccess.Ajax.Send({url:"/files/curmonth",type:"GET",data:{month:y+"-"+m},success:function(r){try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(y,m,r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetReport:function(data,callback){if(!data.offset){data.offset=0}if(!data.limit){data.limit=30}(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取文件...",type:"load",timeout:10000});var url=APS_URL+"/repeat/show.php";$.ajax({url:url,type:"GET",data:data,success:function(r){(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},RB:function(data,callback){getList("/rb",data,callback)},GetSHA1RepeatList:function(data,callback){getList("/files/get_repeat_sha",data,callback)},GetInfoBySha1:function(sha1,callback){Core.DataAccess.Ajax.Send({url:"/files/shasearch",type:"GET",data:{sha1:sha1},success:function(r){try{r=eval("("+r+")");callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetQFiles:function(data,callback){(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取文件...",type:"load",timeout:10000});Core.DataAccess.Ajax.Send({url:"/qfiles",type:"POST",data:data,success:function(r){(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetOtherImg:function(data,callback){(Core.MinMessage)&&Core.MinMessage.Show({text:"正在读取图片...",type:"load",timeout:10000});if(data.filter_type){var f_type=data.filter_type;Core.FileConfig.DataAPI.ReInstance({type:f_type,next_page:true,callback:function(r){if(r.state){r.data=[""].concat(r.data);callback&&callback(r)}else{callback&&callback({state:false});Core.Debug.write("msg:"+r+" error:"+r.message)}}});return}Core.DataAccess.Ajax.Send({url:"/files/imglist",type:"GET",data:data,success:function(r){(Core.MinMessage)&&Core.MinMessage.Hide();try{r=eval("("+r+")");if(r.state===false){Core.DataAccess.Error.Throw({message:r.error});return}callback&&callback(r)}catch(e){callback&&callback({state:false});Core.Debug.write("msg:"+r+" error:"+e.message)}}})}}})();Core.DataAccess.Dir=(function(){var _errObj={message:"网络异常,请刷新页面重试"};return{GetAll:function(callback){Core.DataAccess.Ajax.Send({url:"/category",type:"GET",success:function(r){try{r=eval("("+r+")");callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetQDetail:function(aid,cid,qid,callback){if(Core.DataAccess.FileRead.IsLoadingList(
1)){return}if(cid==undefined){cid=0}Core.DataAccess.Ajax.Send({url:"/category/qget",type:"GET",data:{aid:aid,cid:cid,qid:qid},success:function(r){try{r=eval("("+r+")");callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},GetDetail:function(aid,cid,callback){if(Core.DataAccess.FileRead.IsLoadingList()){return}if(cid==undefined){cid=0}Core.DataAccess.Ajax.Send({url:"/category/get",type:"GET",data:{aid:aid,cid:cid},success:function(r){try{r=eval("("+r+")");if(r.desc==="<p></p>"){r.desc=""}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})},Stat:function(callback){Core.DataAccess.Ajax.Send({url:"/stat",type:"GET",success:function(r){try{r=eval("("+r+")");callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r+" error:"+e.message)}}})}}})();Core.DataAccess.App=(function(){var _MyApps={},_clientList={},_isLoadAll=false;var doChange=function(position){var list=_MyApps[Number(position)];if(list){for(var k in _clientList){try{var item=_clientList[k];item&&item.Change(list,position)}catch(e){_clientList[k]=false}}}};var delUi=function(appids){var changeList={};for(var k in _MyApps){var item=_MyApps[k];var newArr=[];for(var i=0,len=item.length;i<len;i++){var node=item[i];if($.inArray(Number(node.app_id),appids)==-1){newArr.push(node)}else{changeList[k]=1}}if(changeList[k]){_MyApps[k]=newArr}}for(var k in changeList){doChange(k)}};return{GetPutApp:function(callback){var url="/?ct=new_app&ac=ajax_get_put_app";Core.DataAccess.AppAjax.Send({url:url,type:"GET",success:function(r){r=eval("("+r+")");callback&&callback(r)}})},AddClient:function(key,delegate){_clientList[key]=delegate},Search:function(v){var reg=new RegExp(v);var res=[];for(var k in _MyApps){var item=_MyApps[k];for(var i=0,len=item.length;i<len;i++){var node=item[i];if(reg.test(node.name)){res.push(node)}}}return res},GetMyApps:function(position,callback,is_update){},DeleteUI:function(appids){delUi(appids)},DeleteApps:function(appids,callback){if(typeof appids!="object"){appids=[appids]}if(appids.length){var url="/?ct=new_app&ac=ajax_remove_app&app_id="+appids.join(",");Core.DataAccess.AppAjax.Send({url:url,type:"GET",success:function(r){try{r=eval("("+r+")");if(r.state){delUi(appids);callback&&callback(r)}else{Core.MinMessage.Show({text:"卸载失败",type:"err",timeout:Core.CONFIG.MsgTimeout})}}catch(e){}}})}},MoveApp:function(appid,old_position,new_position,callback){var url="/?ct=new_app&ac=ajax_app2desktop&app_id="+appid+"&dotype="+new_position;Core.DataAccess.AppAjax.Send({url:url,type:"GET",success:function(r){try{r=eval("("+r+")");if(r.state){var oldInd=-1;new_position=new_position-4;var oldData=_MyApps[Number(old_position)],newData=_MyApps[Number(new_position)];if(oldData&&oldData.length){for(var i=0,len=oldData.length;i<len;i++){var item=oldData[i];if(Number(item.app_id)==Number(appid)){oldInd=i;break}}}if(oldInd!=-1){_MyApps[Number(new_position)].push(oldData[oldInd]);_MyApps[Number(old_position)].splice(oldInd,1)}doChange(Number(old_position));doChange(Number(new_position))}callback&&callback(r)}catch(e){Core.DataAccess.Error.Throw(e)}}})}}})();(function(){Core.DataAccess.IMAPI=null;var imif=Core.DataAccess.IMIF=(function(){return{Run:function(funName){var arg=arguments;var params=[];if(arg.length>1){for(var i=1,len=arg.length;i<len;i++){params.push("arg["+i+"]")}}Core.DataAccess.Bridge.Load(function(){if(Core.DataAccess.IMAPI&&Core.DataAccess.IMAPI[funName]){if(imif.SuccessCallback){imif.SuccessCallback()}try{eval("var res = Core.DataAccess.IMAPI."+funName+"("+params.join(",")+")")}catch(e){var msg="网络异常,请稍候重试";if(imif.ErrorCallback){imif.ErrorCallback(msg)}else{Core.DataAccess.Error.Throw({message:msg})}}}else{var msg="网络异常,请稍候重试";if(imif.ErrorCallback){imif.ErrorCallback(msg)}else{Core.DataAccess.Error.Throw({message:msg})}}},"im","Core.DataAccess","IMAPI")},Kill:function(){Core.DataAccess.IMAPI=null}}})()})();Core.API={};(function(){var im=Core.API.IM=(function(){var _cache={clients:{},is_connect:false,recon_count:0,recon_times:3};var reconnect=function(msg){_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false;
1if(_cache.recon_count<_cache.recon_times){_cache.recon_count++;if(_cache.is_signin_again){return}window.setTimeout(function(){connect()},100)}else{if(!msg){msg="网络异常,暂无法建立通信连接"}Core.Message.Confirm({text:msg,type:"war",confirm_text:"马上重连",callback:function(r){if(r){_cache.recon_count=0;connect()}}})}};var tryConnect=function(msg){if(_cache.recon_count<_cache.recon_times){_cache.recon_count++;if(_cache.is_signin_again){return}var timeOut=1000;if(_cache.recon_count<2){timeOut=3000}window.setTimeout(function(){_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false;connect()},timeOut)}else{_cache.recon_count=0;Core.MinMessage.Show({text:msg,type:"war",timeout:2000})}};var sucConnect=function(){_cache.recon_count=0};var msgDeal=(function(){var notiStruct={"2t":"signin_again","2u":"signout","5m":"add_friend","5n":"del_friend","5o":"friend_status","8e":"group_add_friend","8f":"group_del_friend","8g":"group_friend_status",dx:"reconnect",dy:"notify"};var getT=function(id){var spec_sign=["Q","G","T"];var new_id=String(id);var sign=new_id.substr(0,1);var ind=$.inArray(sign,spec_sign);if(ind!=-1){return spec_sign[ind]}else{return -1}};return{compress_id:function(id){var spec_sign=["Q","G","T"];var new_id=String(id);var sign=new_id.substr(0,1);if($.inArray(sign,spec_sign)!=-1){var new_id=Number(new_id.substr(1));return isNaN(new_id)?id:sign+new_id.toString(36)}else{var new_id=Number(new_id);return isNaN(new_id)?id:new_id.toString(36)}},decompress_id:function(id){var spec_sign=["Q","G","T"];var new_id=String(id);var sign=new_id.substr(0,1);if($.inArray(sign,spec_sign)!=-1){var new_id=parseInt(new_id.substr(1),36);return isNaN(new_id)?id:sign+new_id}else{var new_id=parseInt(new_id,36);return isNaN(new_id)?id:new_id}},ex_noti:function(item){if(item.mt=="n"&&notiStruct[item.t]){item.t=notiStruct[item.t];if(item.fr&&!item.friends){var arr=item.fr.split(",");if(arr.length){item.friends=[];for(var i=0,len=arr.length;i<len;i++){var fid=arr[i];item.friends.push(msgDeal.decompress_id(fid))}}}if(item.id){if(getT(item.id)=="Q"){item.qid=msgDeal.decompress_id(item.id)}else{item.id=msgDeal.decompress_id(item.id)}}}}}})();var recv=function(){if(_cache.clients){var item={mt:"n",t:"open"};for(var k in _cache.clients){try{var clients=_cache.clients[k];clients.Receive(item)}catch(e){}}}Core.DataAccess.IMIF.Run("Recv",_cache.session_id,function(data){for(var i=0,len=data.length;i<len;i++){var item=data[i];switch(item.mt){case"t":if(item.fid&&item.fid.toString().charAt(0)=="A"){var fArr=item.fid.split(".");item.fid=msgDeal.decompress_id(fArr[1]);item.qid=msgDeal.decompress_id(fArr[0].substring(1,fArr[0].length))}else{item.fid=msgDeal.decompress_id(item.fid)}item.tid=msgDeal.decompress_id(item.tid);item.ft=parseInt(item.ft,36);var clients=_cache.clients[item.tt];if(clients){try{clients.Receive(item)}catch(e){}}break;case"n":msgDeal.ex_noti(item);switch(item.t){case"signin_again":_cache.is_signin_again=true;_cache.recon_count=_cache.recon_times;try{Core.DataAccess.IMIF.Run("Kill")}catch(e){}_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false;if(_cache.clients){for(var k in _cache.clients){try{var clients=_cache.clients[k];clients.Receive(item)}catch(e){}}}return;case"notify":item.tt=1;var clients=_cache.clients[item.tt];if(clients){try{clients.Receive(item)}catch(e){}}break;case"del_friend":case"add_friend":item.tt=1;var clients=_cache.clients[item.tt];if(clients){try{clients.Receive(item)}catch(e){alert(e)}}break;case"friend_status":item.tt=1;var clients=_cache.clients[item.tt];if(clients){try{clients.Receive(item)}catch(e){}}break;case"group_friend_status":case"group_add_friend":case"group_del_friend":item.tt=2;var clients=_cache.clients[item.tt];if(clients){try{clients.Receive(item)}catch(e){}}break;case"reconnect":try{Core.DataAccess.IMIF.Run("Kill")}catch(e){}_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false;connect();break;default:break}break}}},function(status){if(status==408){reconnect()}else{tryConnect("网络异常,暂无法建立通信连接")}})};var _cache_callback=[];var connect=function(callback){if((!_cache.is_connect&&!Core.CONFIG.DAIMBridgeURL)||_cache.is_signin_again){callback&&_cache_callback.push(callback);Core.DataAccess.IMIF.ErrorCallback=tryConnect;Core.DataAccess.IMIF.SuccessCallback=sucConnect;
1if(_cache.is_signin_again){_cache.is_signin_again=false;_cache.recon_count=0;try{Core.DataAccess.IMIF.Run("Kill")}catch(e){}_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false}_cache.is_connect=true;Core.DataAccess.MsgAjax.Send({url:"/proapi/im.php?ac=signin",type:"GET",success:function(r){r=eval("("+r+")");if(r.session_id){window.onbeforeunload=function(){Core.DataAccess.MsgAjax.Send({url:"/proapi/im.php?ac=signout",type:"GET",sync:false,success:function(r){}})};_cache.session_id=r.session_id;var url="//"+r.server+"/chat/bridge";Core.CONFIG.DAIMBridgeURL=url;Core.DataAccess.Bridge.ChangeBridge("im",url);Core.DataAccess.Bridge.RemoveBridge("im");recv();window.setTimeout(function(){for(var i=0,len=_cache_callback.length;i<len;i++){_cache_callback[i]&&_cache_callback[i]()}_cache_callback=[]},10)}else{tryConnect("网络异常,暂无法建立通信连接")}},error:function(){try{Core.DataAccess.IMIF.Run("Kill")}catch(e){}_cache.is_connect=false;Core.CONFIG.DAIMBridgeURL=false;connect()}})}else{callback&&callback()}};var addClient=function(type,opt){_cache.clients[type]=opt;connect(function(){})};return{Client:function(opt){addClient(opt.type,opt)},RemoveClient:function(type){if(_cache.clients[type]){_cache.clients[type]=null;delete _cache.clients[type]}},Reconnect:function(callback){_cache.is_signin_again=true;connect(callback)},GetSession:function(callback){connect(function(){callback&&callback(_cache.session_id)})},MsgDeal:msgDeal}})()})();Core.API.Ajax=(function(){return{MoveQ:function(qid,pick_codes,is_talk,callback){var data={};data.qid=qid;data.type=is_talk?is_talk:0;for(var i=0,len=pick_codes.length;i<len;i++){data["pickcodes["+i+"]"]=pick_codes[i]}$.ajax({url:"?ct=q&ac=move_q",data:data,type:"POST",dataType:"json",success:function(r){if(r.state){callback&&callback(r.data)}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000});callback&&callback(false,r.msg)}}})},QCollect:function(opt){var data={qid:opt.qid,cid:opt.cid,aid:opt.aid,tid:opt.tid?opt.tid:"",token:opt.token?opt.token:"",time:opt.time?opt.time:""};if(!opt.pick_codes.length){Core.MinMessage.Show({text:"请先选择文件",type:"err",timeout:2000});opt.callback&&opt.callback({state:false,msg:"请先选择文件"});return}for(var i=0,len=opt.pick_codes.length;i<len;i++){data["pickcodes["+i+"]"]=opt.pick_codes[i]}$.ajax({url:"?ct=ajax&ac=collect",type:"POST",data:data,dataType:"json",success:function(r){if(!r.state){Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000})}else{Core.FileResultDG.Show(r.data,{aid:data.aid,cid:data.cid})}opt.callback&&opt.callback(r)}})}}})();Core.API.Document=(function(){function createDocument(type){var nameMap={1:"新建文档",2:"新建表格",3:"新建文稿"};if(Core.FilePermission.Vip()){var pid=Core.FileConfig&&Core.FileConfig.cid;$.ajax({url:"//webapi.115.com/files/blank_document",type:"post",data:{pid:pid&&pid!=-1?pid:0,file_name:nameMap[type],type:type},async:false,dataType:"json",xhrFields:{withCredentials:true},success:function(json){if(json.state){window.open("//115.com/?ct=preview&ac=location&pickcode="+json.data.pick_code+"&ico=docx&from=fileEdit")}else{Core.MinMessage.Show({text:json.message||json.msg||json.error||"网络异常,请稍后再试",type:"war",timeout:2000})}}})}else{Core.FilePermission.UpgradeVip("使用该功能,请升级VIP会员","购买VIP","//vip.115.com/?p=file_sorting")}}return{createDocument:createDocument}})();Core.MinMessage=(function(){var _dom,_timer;var _temp='<div class="popup-hint" style="z-index:9999999999;"><i class="" rel="type"></i><em class="sl"><b></b></em><span rel="con"></span><em class="sr"><b></b></em></div>';var _temp='<div class="ex-popoup-hint " style="z-index:9999999999;"><s></s><span rel="con">操作成功提示!</span></div>';var _cache={Type:{suc:"exph-suc",war:"exph-war",err:"exph-err",load:"exph-loader",inf:"exph-war"}};var create=function(text,type){if(!_dom){_dom=$(String.format(_temp,text));$(document.body).append(_dom);_dom.css({position:"fixed"})}_dom.find("[rel='con']").html(text);var icon=_dom;for(var k in _cache.Type){icon.removeClass(_cache.Type[k])}icon.addClass(_cache.Type[type])};var hide=function(){if(_timer){window.clearTimeout(_timer)}if(_dom){_dom.hide()}};
1return{Show:function(obj){if(!obj.type){obj.type="war"}create(obj.text,obj.type);var NoAddScrollTop=true;Util.Layer.Center(_dom,{NoAddScrollTop:NoAddScrollTop});var st=($(window).height()-_dom.outerHeight())/4.5;if(st<50){st=50}var srt=0;if(!NoAddScrollTop){srt=$(window).scrollTop()}if(st){st+=srt}_dom.css("top",st);_dom.show();if(_timer){window.clearTimeout(_timer)}if(obj.timeout){_timer=window.setTimeout(hide,obj.timeout)}},Hide:function(){hide()}}})();Core.Message=(function(){var _dialog;var _MessageModel=function(){var _self=this,_initState=false,_callback,_openStatus=false,_dialog_type;var _content=$('<div><div class="dialog-msg" rel="content"></div><div class="dialog-action"><a href="javascript:;" class="dgac-cancel"  style="display:none;" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');Core.DialogBase.call(this,{content:_content,title:"信息提示"});var setTitle=function(title){title&&_self.warp.find("[rel='base_title']").html(title)};this.Initial=function(){if(!_initState){$(document).bind("keyup",function(e){if(_openStatus){if(e.keyCode==13||e.keyCode==32){_content.find("[btn='confirm']").click()}else{if(e.keyCode==27){switch(_dialog_type){case 0:_content.find("[btn='confirm']").click();break;case 1:_content.find("[btn='cancel']").click();break}}}}})}};var _closeFun=this.Close;this.Close=function(){_closeFun();_openStatus=false};this.Show=function(obj){_callback=false;_self.Open(function(){var cancelBtn=_content.find("[btn='cancel']");var confirmBtn=_content.find("[btn='confirm']");if(obj.confirm_link){confirmBtn.unbind("click").bind("click",function(){if(_callback){_callback(true)}_self.Close();return true});confirmBtn.attr("href",obj.confirm_link).attr("target","_blank");cancelBtn.unbind("click").bind("click",function(){var r=true;if(_callback){r=_callback(false)}if(r===false){return false}_self.Close();return false})}else{if(confirmBtn.attr("target")){confirmBtn.removeAttr("target");confirmBtn.attr("href","javascript:;")}_self.warp.find("[btn]").unbind("click").bind("click",function(){var r=true;if(_callback){r=_callback($(this).attr("btn")=="confirm")}if(r===false){return false}_self.Close();return false})}if(obj.confirm_text){confirmBtn.html(obj.confirm_text)}else{confirmBtn.html("确定")}if(obj.cancel_text){cancelBtn.html(obj.cancel_text)}else{cancelBtn.html("取消")}_callback=obj.callback;setTitle(obj.title);if(obj.dialog_type==undefined){obj.dialog_type=0}if(!obj.type){obj.type="war"}var html_temp='<h3 rel="text"><i class="hint-icon hint-{type}"></i><span>{text}</span></h3>'+(obj.content?'<div class="dialog-msg-text" rel="text_content">{content}</div>':"");var con=_content.find("[rel='content']");con.html(String.formatmodel(html_temp,obj));confirmBtn.removeClass("btn-orange");switch(obj.dialog_type){case 0:cancelBtn.hide();break;case 1:cancelBtn.show();break}_dialog_type=obj.dialog_type;_openStatus=true;if(!obj.con_style){obj.con_style={}}var conStyle=obj.con_style;if(conStyle.warp){conStyle.warp(con)}else{var styleTxt=con.attr("style");if(styleTxt){var arr=styleTxt.split(";");if(arr&&arr.length){for(var i=0,len=arr.length;i<len;i++){var item=arr[i];var iitem=item.split(":");if(iitem.length){con.css(iitem[0],"")}}}}con.removeAttr("style")}if(conStyle.title){conStyle.title(con.find('[rel="text"]'))}if(conStyle.content){conStyle.content(con.find('[rel="text_content"]'))}},obj.win)}};var init=function(){if(!_dialog){_dialog=new _MessageModel()}};var _alertTimer;return{Confirm:function(obj){init();obj.dialog_type=1;_dialog.Show(obj)},Alert:function(obj){init();obj.dialog_type=0;_dialog.Show(obj);if(obj.timeout){_alertTimer=window.setTimeout(function(){Core.Message.Hide()},obj.timeout)}},Hide:function(){if(_alertTimer){window.clearTimeout(_alertTimer)}if(_dialog){_dialog.Close()}}}})();(function(){Core.WriteInput=(function(){var activeBox;return{Open:function(callback,config){if(!config){config={}}var editCon=$('<div class="dialog-input">'+(!config.ext?'<input type="text" rel="txt" class="text" '+(config.placeholder?'placeholder="'+config.placeholder+'"':"")+"/>":'<input type="text" rel="txt" class="text" style="width:362px;" '+(config.placeholder?'placeholder="'+config.placeholder+'"':"")+'/><span class="file-ext-name" rel="ext_name" style="top:30px;border: 1px solid;border-color: #CECECF;box-shadow: inset 0px 0px 0px rgba(0,0,0,0.1);">'+config.ext+"</span>")+'</div><div class="dialog-action"><a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');var editBox=new Core.DialogBase({title:config.title||"请输入内容",content:editCon});activeBox=editBox;editBox.Open();var docallback=function(){if(callback){var isClose=callback(editCon.find("[rel='txt']").val());if(isClose){editBox.Close();activeBox=false;return}else{editCon.find("[rel='txt']").focus()}}};if(config.maxlength){editCon.find("[rel='txt']").attr("maxlength",config.maxlength)}editCon.find("[rel='txt']").val(config.text||"");editCon.find("[rel='txt']").on("keydown",function(e){if(e.keyCode==13){docallback()}else{if(e.keyCode==27){editBox.Close();activeBox=false}}});editCon.find("[btn]").on("click",function(e){switch($(this).attr("btn")){case"confirm":docallback();break;case"cancel":editBox.Close();activeBox=false;break}return false});editCon.find("[rel='txt']")[0].focus();window.setTimeout(function(){editCon.find("[rel='txt']")[0].select();if(config.ext){window.setTimeout(function(){editCon.find("[rel='txt']").width(420-editCon.find("[rel='ext_name']").width()-20)},10)}},20)},Close:function(){activeBox.Close();activeBox=false}}})()})();Core.Dir=(function(){var IS_115DOMAIN=/115(rc)?\.com/.test(location.href);var WebApi=IS_115DOMAIN?"//webapi.115.com":"/webapi";var checkHasUtil=function(){if(!window.Util){window.Util={}}if(!Util.Validate){Util.Validate={}}if(!Util.Validate.CategoryName){Util.Validate={CategoryName:function(category_name){category_name=category_name.replace(" ","");if(category_name.length<1){return"文件夹名不能为空。"}if(category_name.length>255){return"文件夹名称不能超过255个字。"}return true;var regular=/^[^\\/:*?<>\|\\\\\"]*$/;if(!regular.test(category_name)){return'文件夹名称不能包含下列任意字符之一\n \\ / : * ? "  < > |'}return true}}}};var createNode=function(aid,pid,floderName,callback){checkHasUtil();var r=Util.Validate.CategoryName($.trim(floderName));if(r!==true){if(callback){callback({state:false,message:r})}return}var data={pid:pid,cname:floderName};$.ajax({url:WebApi+"/files/add",type:"POST",dataType:"json",xhrFields:{withCredentials:true},data:data,success:function(result){if(callback){callback(result)}}})};return{Rename:function(aid,cid,oldName,shareId){var editCon=$('<div class="file-rename"><ul><li><a href="javascript:;" class="btn-clear" rel="clear"><s>清空</s></a><div class="rename-new new-editing"><!-- 编辑文本时添加类名 new-editing,编辑时需要js动态调整高度,幅度是30px --><p rel="name_cover"></p><textarea rel="txt"></textarea></div></li><li rel="show_old_name" style="display:none;"><a href="javascript:;" class="btn-origan" rel="old_name_btn" status="1"><span>原文件名</span></a><div class="rename-origan"><p rel="old_name"></p></div></li></ul></div><div class="dialog-action"><div class="left-side"><a href="javascript:;" btn="advance" class="button btn-line btn-large"><span>高级模式</span></a></div><a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');var editBox=new Core.DialogBase({title:"重命名文件夹",content:editCon,width:550});editBox.Open();
1var fileName=editCon.find("[rel='txt']"),cover=editCon.find('[rel="name_cover"]'),oldNameWarp=editCon.find('[rel="show_old_name"]'),oldNameBtn=editCon.find('[rel="old_name_btn"]'),oldNameShow=editCon.find('[rel="old_name"]'),clear=editCon.find('[rel="clear"]');fileName.val(oldName);cover.text(oldName);oldNameShow.text(oldName);var renameFolderFun=function(e){var cid=e.data.cid;var data={fid:cid,file_name:editCon.find("[rel='txt']").val(),files_new_name:{}};data.files_new_name[cid]=data.file_name;checkHasUtil();var r=Util.Validate.CategoryName($.trim(data.file_name));if(r!==true){Core.MinMessage.Show({text:r,type:"err",timeout:Core.CONFIG.MsgTimeout,window:editBox});editCon.find("[rel='txt']")[0].focus();return}shareId&&(data.share_id=shareId);UA$.ajax({url:"/files/batch_rename",type:"POST",dataType:"json",data:data,success:function(r){if(r.state){editBox.Close();Core.MinMessage.Show({text:"重命名成功",type:"suc",timeout:Core.CONFIG.MsgTimeout});setTimeout(function(){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.UpdateDir({cid:data.fid,dir_name:data.file_name})}},1000)}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout,window:editBox});editCon.find("[rel='txt']")[0].focus()}}})};fileName.on("keydown",{aid:aid,cid:cid},function(e){if(e.keyCode==13){renameFolderFun(e)}else{if(e.keyCode==27){editBox.Close()}}oldNameWarp.show()}).on("input",function(){if(!fileName.val()){clear.hide()}else{clear.show()}cover.text(fileName.val())});oldNameBtn.on("click",function(){var status=$(this).attr("status");if(status==1){oldNameWarp.addClass("rename-origan-fold");$(this).attr("status",0)}else{oldNameWarp.removeClass("rename-origan-fold");$(this).attr("status",1)}return false});clear.on("click",function(){fileName.val("");cover.text("");clear.hide();oldNameWarp.show();return false});editCon.find("[btn]").bind("click",{aid:aid,cid:cid},function(e){switch($(this).attr("btn")){case"confirm":renameFolderFun(e);break;case"cancel":editBox.Close();break;case"advance":function getAttr($el){var obj={file_id:$el.attr("file_id")||$el.attr("cate_id"),file_name:$el.attr("title"),file_new_name:$el.attr("title"),file_type:$el.attr("file_type"),ico:$el.attr("ico"),iv:$el.attr("iv")||"",vdi:$el.attr("vdi")||"",path:$el.attr("path")||"",sha1:$el.attr("sha1")||""};if(!obj.ico&&obj.file_type=="0"){obj.ico="folder"}obj.file_category=obj.file_type=="0"?"0":"1";var vidConfig={1:"tp-video-sd",2:"tp-video-hd",3:"tp-video-fhd",4:"tp-video-1080p",5:"tp-video-4k",100:"tp-video-origin"};if(obj.iv==1){obj.ico=obj.ico+" "+(vidConfig[obj.vdi]||"")}return obj}editBox.Close();var getOne=Core.getFileDataApiCheck("getOne");var node=getOne(cid);var data=[];data.push(getAttr(node));Core.ReNameMultiDG.Show(data,function(r){if(r){var updateDir=Core.getFileDataApiCheck("UpdateDir");updateDir({cid:cid,dir_name:r.data[cid]})}else{}});break}return false});fileName.focus();window.setTimeout(function(){fileName.select()},20)},Create:function(aid,cid,callback){if(!callback){callback=function(node){if(Ext.CACHE&&Ext.CACHE.FileMain){Core.MinMessage.Show({text:"新建成功",timeout:2000,type:"suc"});window.setTimeout(function(){Ext.CACHE.FileMain.GotoDir(node.aid,node.cid)},500)}}}var addCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" /></div><div class="dialog-action"><a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');var createBox=new Core.DialogBase({title:"新建文件夹",content:addCon,width:550});createBox.Open(null);var addFolderFun=function(e){var aid=e.data.aid;var cid=e.data.cid;var value=addCon.find("[rel='txt']").val();checkHasUtil();if(top.window.Util.Validate.CategoryName(value)!=true){Core.MinMessage.Show({text:top.window.Util.Validate.CategoryName(value),type:"war",timeout:Core.CONFIG.MsgTimeout});addCon.find("[rel='txt']").focus();return false}createNode(aid,cid,addCon.find("[rel='txt']").val(),function(r){if(r.state){Core.MinMessage.Show({text:"新建成功",type:"suc",timeout:Core.CONFIG.MsgTimeout,window:createBox});callback&&callback(r);createBox.Close()}else{Core.MinMessage.Show({text:r.error,type:"war",timeout:Core.CONFIG.MsgTimeout,window:createBox});addCon.find("[rel='txt']")[0].focus()}})};addCon.find("[rel='txt']").bind("keydown",{aid:aid,cid:cid},function(e){if(e.keyCode==13){Util.Html.StopPropagation(e);addFolderFun(e)}else{if(e.keyCode==27){createBox.Close()}}});addCon.find("[btn]").bind("click",{aid:aid,cid:cid},function(e){switch($(this).attr("btn")){case"confirm":addFolderFun(e);break;case"cancel":createBox.Close();break}return false});addCon.find("[rel='txt']")[0].focus()}}})();Core.SpaceData=(function(){var _data;var _OberverData=[];
1var changeData=function(changeType,aid,iByte,isdel){var result=true;var key=-1;switch(Number(aid)){case 0:key=0;break;default:key=1;break}if(!_data[key.toString()]){_data[key.toString()]={}}var obj=_data[key.toString()];if(obj){switch(isdel){case 0:obj[changeType]=Number(obj[changeType])-Number(iByte);break;case 1:if(changeType=="used"){var use=Number(obj[changeType])+Number(iByte);if(use>obj.total){result=false}else{obj[changeType]=use}}else{obj[changeType]=Number(obj[changeType])+Number(iByte)}break;case 2:obj[changeType]=Number(iByte);break}doClient()}else{result=false}return result};var translation=function(d){for(var k in d){var item=d[k];d[k]["total"]=item.total?item.total:item.size_total;d[k]["used"]=item.used!=undefined?item.used:item.size_used;d[k]["size_remain"]=Number(item.size_remain)}};var doClient=function(){if(_OberverData.length){var delKeys=[];var newList=[];for(var i=0,len=_OberverData.length;i<len;i++){try{if(_OberverData[i]){_OberverData[i].Do(_data);newList.push(_OberverData[i])}else{delKeys.push(i)}}catch(e){delKeys.push(i)}}if(delKeys.length){_OberverData=newList}}};var syncMethod=function(callback){var url="//115.com/index.php?ct=ajax&ac=get_storage_info";$.ajax({url:url,method:"GET",dataType:"json",cache:false,success:function(result){if(_data){translation(result);for(var key in result){_data[key]=result[key]}doClient()}if(callback){callback()}}});try{top.window.GETLEFTMODEDATAT&&top.GETLEFTMODEDATAT()}catch(e){}};return{AddClient:function(key,fun){if(fun){var addRes=true;for(var i=0,len=_OberverData.length;i<len;i++){var obj=_OberverData[i];if(obj.Key==key){obj.Do=fun;addRes=false}}if(addRes){_OberverData.push({Key:key,Do:fun})}doClient()}},ChangeUse:function(aid,iByte,isdel){if(iByte==""){iByte=0}return changeData("used",aid,iByte,isdel)},ChangeTotal:function(aid,iByte,isdel){if(iByte==""){iByte=0}return changeData("total",aid,iByte,isdel)},GetData:function(){return _data},SetData:function(data){translation(data);_data=data},IsNoSpace:function(type){if(type==undefined){type="1"}if(_data[type]){return(_data[type]["size_remain"]<0)}return false},Sync:function(callback){syncMethod(callback)}}})();(function(){Core.SpaceTips=(function(){var _tipsNode,_dt=2000,_timeout=_dt,_timer;var check=function(){if(_timer){window.clearTimeout(_timer)}_timer=window.setTimeout(function(){UA$.ajax({url:"/rb/status",type:"GET",cache:false,dataType:"json",success:function(r){if(r.state){if(_timeout==_dt){_timeout=_timeout*5}else{if(_timeout==_dt*5){_timeout=_timeout*3}else{_timeout=_timeout*30}}check()}else{window.setTimeout(function(){Core.SpaceData.Sync();_tipsNode.hide()},3000)}}})},_timeout)};return{Show:function(type){if(!type){type=1}if(!_tipsNode){_tipsNode=$(Core.CONFIG.SpaceTips)}_tipsNode.show();_timeout=2000;check()}}})()})();Core.FloatMenu=(function(){var _menuData=Core.FloatMenuConfig;var _cacheDom={};var _old_show_dom;var getMenu=function(obj,isFrame){var dom=$('<div id="js_float_content" class="context-menu menu-upward" style="z-index:9999999; display:none;"></div>');var ul=$(document.createElement("ul"));for(var k in obj){if(obj[k]){if(obj[k].isline){dom.append(ul);ul=$(document.createElement("ul"));continue}var item=obj[k];var overflow="";if(item.text&&item.text.length>=9){overflow=' style="overflow:hidden"'}if(!item._icon_base){item._icon_base="icon-operate"}var liTemp='<li val="'+k+'"><a href="javascript:;" '+overflow+'><i class="{_icon_base} {type}"></i><span>{text}</span></a></li>';var type;if(item.ico){}else{liTemp='<li val="'+k+'"><a href="javascript:;" '+overflow+">{text}</a></li>"}if(item.ico==undefined){type="ifo-"+k}else{if(item.ico==""){liTemp='<li val="'+k+'"><a href="javascript:;" '+overflow+">{text}</a></li>"}else{type="ifo-"+item.ico}}var type=(item.ico==undefined)?("ifo-"+k):(item.ico==""?"":"ifo-"+item.ico);if(item._icon_base=="icon-operate"){type="ifo-"+item.ico}var li=$(String.formatmodel(liTemp,{type:type,text:item.text,_icon_base:item._icon_base}));if(item.ischild||item.childs){li.find("a").append($('<b class="arrow">&raquo;</b>'))}if(item.childs){var childDom=getMenu(item.childs);
1li.bind("mouseover",{dom:li,childDom:childDom},function(e){if(_old_show_dom){_old_show_dom.hide();_old_show_dom=false}var childDom=e.data.childDom;childDom.css({left:""});childDom.show();var l=childDom.offset().left;if((l+childDom.width())>$(window).width()){childDom.css({left:-(childDom.width())})}_old_show_dom=childDom;$(this).attr("hide_state","0")}).bind("mouseout",{childDom:childDom},function(e){var ele=$(this);ele.attr("hide_state","1");var childDom=e.data.childDom;window.setTimeout(function(){if(ele.attr("hide_state")=="1"){childDom.hide()}},400)});childDom.bind("mouseover",{dom:li},function(e){e.data.dom.attr("hide_state","0")}).bind("mouseout",{dom:li},function(e){var ele=e.data.dom;ele.attr("hide_state","1");var childDom=$(this);window.setTimeout(function(){if(ele.attr("hide_state")=="1"){childDom.hide()}},400)});li.append(childDom)}ul.append(li)}}if(isFrame){var cell=$('<div class="cell-icon"></div>');dom.append(cell);cell.append(ul)}else{dom.append(ul)}dom.bind("contextmenu",function(e){return false});return dom};var showTimer;return{GetMenuHtml:function(obj,isFrame){var dom=getMenu(obj,isFrame);return'<div class="context-menu" style="z-index:9999999; display:none;"><em class="arrow-position" style="left: 28px;" rel="js_float_arrow"><i class="arrow"></i><s class="arrow"></s></em>'+dom.html()+"</div>"},GetMenu:function(obj,isFrame){return getMenu(obj,isFrame)},Show:function(key,pos,setting){if(!_cacheDom[key]&&_menuData[key]){_cacheDom[key]=getMenu(_menuData[key],setting&&setting.isFrame);$(document.body).append(_cacheDom[key])}if(_cacheDom[key]){if(pos){_cacheDom[key].css(pos)}_cacheDom[key].show();if(setting){var box=_cacheDom[key];if(setting.callback){box.find("[val]").bind("click",function(){setting.callback($(this).attr("val"));$(this).parent().find("i.i-done").hide();$(this).find("i.i-done").show();return false}).find("i.i-done").hide()}if(setting.select){var li=box.find("[val='"+setting.select+"']");if(li.find("i").hasClass("i-done")){li.find("i").show()}}}return _cacheDom[key]}return false},SetPosition:function(key,pos){if(_cacheDom[key]){if(pos){_cacheDom[key].css(pos)}}},SetRightBtnPos:function(dom,type,x,y,cutX,cutY){if(cutX==undefined){cutX=0}if(cutY==undefined){cutY=0}var desk=Core.ACTIVE.GetMain();if(x+dom.width()>desk.width()){x=x-dom.width()+cutX}if(y+dom.height()+5>$(window).height()+$(window).scrollTop()){y=y-dom.height()+cutY}var pos={top:y,left:x};if(y<5){pos.top=5;pos["max-height"]=dom.height()+y-5;pos.overflow="auto"}Core.FloatMenu.SetPosition(type,pos);if(showTimer){window.clearTimeout(showTimer)}showTimer=window.setTimeout(function(){dom.show()},100)},Hide:function(key){if(showTimer){window.clearTimeout(showTimer)}if(!_cacheDom[key]){_cacheDom[key].hide()}}}})();Core.Permission=Core.FilePermission=(function(){var _per;return{ShowUpgrade:function(){Core.Message.Alert({text:'抱歉,请<a href="http://115.com/?nav=safe&child=user&mode=my_set" target="_blank">绑定手机</a> 或 <a style="color:#f60;" href="http://vip.115.com" target="_blank">升级VIP</a>方可使用。',type:"inf"})},Set:function(data){_per=data},Shared:function(aid){aid=Number(aid);if(!_per){return false}return true},SharedDir:function(aid){aid=Number(aid);if(!_per){return false}var txt=aid+"|";return _per.share_dir.indexOf(txt)!=-1},Vip:function(){return(_per&&_per.is_vip)||(top.COMMONHEADERUSERINFO&&top.COMMONHEADERUSERINFO.vip)},VipExp:function(){if(!_per){return false}return _per&&_per.is_vip_exp},UpgradeVip:function(title,confirm_text,confirm_link){var setting={title:title||"由于该功能会产生高昂硬件成本,升级VIP才可使用",text:"",confirm_link:confirm_link||("//vip.115.com/?p=file_sorting"),confirm_text:confirm_text||"升级VIP会员",confirm_cls:"btn"};if(top.window._SHOWVIPDIALOG_){top.window._SHOWVIPDIALOG_.Show(setting)}else{top.$.getScript(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js"),function(){top.window._SHOWVIPDIALOG_.Show(setting)})}},VipExpLimit:function(){if(!_per){return false}return _per.is_vip_exp_limit},LockFile:function(aid){aid=Number(aid);if(!_per){return false}return _per.lock_file},LockDir:function(aid){aid=Number(aid);if(!_per){return false}return _per.lock_dir},CanPlayer:function(arr,flag){switch(Number(flag)){case 9:for(var i=0,len=arr.length;i<len;i++){var fileDom=arr[i];var suffix="";if(fileDom.attr("file_type")=="1"){var fileName=fileDom.find("[field='file_name']").attr("title");if(fileName&&fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}if(UPLOAD_CONFIG&&UPLOAD_CONFIG["9"]&&$.inArray(suffix,UPLOAD_CONFIG["9"]["upload_type_limit"])!=-1){}else{return false}}else{return false}}return true;break;case 4:var newArr=[],pcs=[];for(var i=0,len=arr.length;i<len;i++){var fileDom=arr[i];if(fileDom.attr("file_type")=="1"){var suffix="";var fileName=fileDom.find("[field='file_name']").attr("title");if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}var musicType=["mp3","ape","flac","wav","m4a"],suffixType=suffix.toLowerCase();
1if($.inArray(suffixType,musicType)!=-1){newArr.push(fileDom);pcs.push(fileDom.attr("pick_code"))}}}if(newArr.length){return{list:newArr.length,pick_codes:pcs}}else{return false}break}return false}}})();(function(){var mod=function(actions){var _content=$('<div class="dialog-frame"><iframe frameborder=0 src=""></iframe></div>'),_self=this;if(!actions){actions={}}var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){if(/firefox/.test(navigator.userAgent.toLowerCase())){_content.find("iframe").on("load",function(){try{var win=$(this.contentWindow);$(win).on("keydown",function(e){if(e.keyCode==27){return false}})}catch(e){}})}},GetIframe:function(){return _content.find("iframe")[0]},Show:function(url){_top.Open(function(){_content.find("iframe").off("load").on("load",function(){if(actions&&actions.ready){var ifr=this;window.setTimeout(function(){actions.ready(ifr.contentWindow)},10)}})});_content.find("iframe").attr("src",url)},Reset:function(width,height,notcenter){if(width){_self.warp.width(width)}if(height){_content.find("iframe").height(height)}if(!notcenter){Util.Layer.Center(_self.warp,{Main:false,NoAddScrollTop:true})}},Close:function(doHide){actions&&actions.close&&actions.close(doHide);window.setTimeout(function(){_content.find("iframe").attr("src","");_top.Close()},10)},ResetTitle:function(title){_self.warp.find('[rel="base_title"]').html(title)}},{content:_content,title:"新窗口",warpHtml:actions.warpHtml})};Core.FrameBaseDG=mod;Core.SimpleFrameDG=(function(){var _cache={},_ready=false,_ackey,_hideBack={},_doHandler={},_hideBackData={};return{Open:function(key,url,setting){if(!setting){setting={}}if(setting.callback){_doHandler[key]=setting.callback}else{_doHandler[key]=false}if(!setting.width){setting.width=320}_ready=false;if(setting){_ready=setting.ready}if(!_cache[key]){_cache[key]=new mod({ready:function(win){_ready&&_ready(win)},close:function(doHide){if(!doHide){if(_hideBack[key]){_doHandler[key]&&_doHandler[key](_hideBackData[key])}}},warpHtml:setting.warpHtml})}_hideBackData[key]=null;_hideBackData[key]=setting.hide_data;_hideBack[key]=setting.is_hide_back;_cache[key].Show(url);_ackey=key;if(setting){_cache[key].Reset(setting.width,setting.height);_cache[key].ResetTitle(setting.title?setting.title:"新窗口")}return _cache[key]},Close:function(key,data){if(!key){key=_ackey}if(_cache[key]){if(_doHandler[key]){_doHandler[key](data)}_cache[key].Close(true)}},Reset:function(key,setting){if(_cache[key]){_cache[key].Reset(setting.width,setting.height,setting.notcenter)}}}})();Core.FrameDG=(function(){var _mod,_doHandler,_hideBack=false,_hideBackData,_ready;return{IsOpen:function(){if(_mod){return _mod.warp.length}return false},GetIframe:function(){if(_mod){return _mod.GetIframe()}else{return false}},Reset:function(width,height,notcenter){if(_mod){_mod.Reset(width,height,notcenter)}},ResetTitle:function(title){if(_mod){_mod.ResetTitle(title)}},Open:function(url,setting){if(setting.callback){_doHandler=setting.callback}else{_doHandler=false}if(setting.ready){_ready=setting.ready}else{_ready=false}if(!_mod){_mod=new mod({ready:function(win){_ready&&_ready(win)},close:function(doHide){if(!doHide){if(_hideBack){_doHandler&&_doHandler(_hideBackData)}}}})}_hideBackData=null;_hideBackData=setting.hide_data;_hideBack=setting.is_hide_back;_mod.Show(url);if(setting){_mod.Reset(setting.width,setting.height);_mod.ResetTitle(setting.title?setting.title:"新窗口")}return _mod},Close:function(data){if(_mod){if(_doHandler){_doHandler(data)}_mod.Close(true)}},Hide:function(){if(_mod){_mod.Close()}}}})()})();Core.OnlyFrame=(function(){var _cache={},_defautWidth=960;var disInstance=function(){if(_cache.iframe){_cache.iframe.attr("src","");_cache.iframe.empty().remove();_cache.iframe=false}if(_cache.box){_cache.box.empty().remove();_cache.box=false}_cache.resizeCallback=false;if(_cache.closeCallback){_cache.closeCallback(_cache.hideBackData);_cache.closeCallback=false}};var init=function(){if(!_cache.box){_cache.box=$('<div class="popup-window-wrap" is_over="1"><div class="popup-window"><iframe src="" frameborder=0></iframe><div class="popup-window-handle"><a href="javascript:;" class="close" btn="close">关闭</a></div></div></div>');
1$(document.body).append(_cache.box);_cache.iframe=_cache.box.find("iframe");if(/firefox/.test(navigator.userAgent.toLowerCase())){_cache.iframe.on("load",function(){try{var win=$(this.contentWindow);$(win).on("keydown",function(e){if(e.keyCode==27){return false}})}catch(e){alert(e)}})}_cache.box.on("mouseenter",function(){_cache.box.attr("is_over","1")}).on("mouseleave",function(){_cache.box.attr("is_over","0")});_cache.box.find("[btn='close']").on("click",function(){disInstance();return false})}if(!_cache.bind_reset){_cache.bind_reset=true;$(window).on("resize",function(){if(_cache.resizeCallback){_cache.resizeCallback($(document).width(),$(document).height())}});$(document).on("keydown",function(e){if(e.keyCode==27){if(_cache.box&&_cache.box.attr("is_over")=="1"){disInstance();return false}}})}};var _openTimer;return{Resize:function(width,height){if(_cache.box){var l=0;if(width){l=-width/2}_cache.box.find(".popup-window").width(width).css("margin-left",l+"px")}},Open:function(url,setting){if(_openTimer){window.clearTimeout(_openTimer)}init();if(!setting){setting={}}if(!setting.width){setting.width=960}if(!setting.height){setting.height=500}if(setting.resizeCallback){_cache.resizeCallback=setting.resizeCallback}else{_cache.resizeCallback=false}_cache.hideBackData=null;_cache.hideBackData=setting.hide_data;if(setting.hideCallback){_cache.closeCallback=setting.hideCallback}else{_cache.closeCallback=false}_cache.iframe.attr("src",url);_cache.box.find(".popup-window").width(setting.width).css("margin-left",(-setting.width/2)+"px");_openTimer=window.setTimeout(function(){try{_cache.box&&_cache.box.show()}catch(e){}},20)},Close:function(data){if(data!=undefined){_cache.hideBackData=data}disInstance()}}})();Core.TabFrame=(function(){var _tabList,_mod;var mod=function(){var _content=$('<div class="dialog-frame"><iframe style="height: 510px;" frameborder=0 src=""></iframe></div>'),_self=this,_titleTab;var focusLi=function(type){_titleTab.find(".focus").removeClass("focus");var el=_titleTab.find("li")[type];if(el){$(el).addClass("focus")}};var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){var html=[];html.push('<ul class="dialog-tab">');for(var i=0,len=_tabList.length;i<len;i++){var item=_tabList[i];html.push('<li key="'+i+'"><span>'+item.text+"</span></li>")}html.push("</ul>");_titleTab=$(html.join(""));_titleTab.find("li").on("click",function(){var el=$(this);var ind=Number(el.attr("key"));_content.find("iframe").attr("src",_tabList[ind].url);focusLi(ind);return false}).on("mousedown",function(e){e.stopPropagation()});var title=_self.warp.find('[rel="base_title"]');title.before(_titleTab);title.hide()},Reset:function(width,height,notcenter){if(width){_self.warp.width(width)}if(height){_content.find("iframe").height(height)}if(!notcenter){Util.Layer.Center(_self.warp,{Main:false,NoAddScrollTop:true})}},Show:function(type){_top.Open(function(){_content.find("iframe").off("load").on("load",function(){var ifr=this;window.setTimeout(function(){$(ifr.contentWindow.document).on("keydown",function(e){if(e.keyCode==27){_self.Close()}})},100)});focusLi(type)});_content.find("iframe").attr("src",_tabList[type].url)},Close:function(){window.setTimeout(function(){_content.find("iframe").attr("src","");_top.Close()},10)}},{content:_content,title:"",width:700})};return{Open:function(list,opt,setting){_tabList=list;if(!_tabList){return}if(!_mod){_mod=new mod()}if(!opt){opt={}}if(opt.type==undefined){opt.type=0}_mod.Show(opt.type);if(setting){_mod.Reset(setting.width,setting.height)}},Close:function(){if(_mod){_mod.Close()}}}})();Core.LineTabFrame=(function(){var _tabList,_mod,_title;var mod=function(){var _self=this,_titleTab,_iframe;var _content=$('<div class="dg-sub-tab"></div><div class="dg-sub-frame"><iframe src="setting_common.html" frameborder="0"></iframe></div>');var focusLi=function(type){_titleTab.find(".focus").removeClass("focus");var el=_titleTab.find("li")[type];if(el){$(el).find("a").addClass("focus")}};var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){_self.warp.height(500);_iframe=_self.warp.find("iframe");var html=[];html.push("<ul>");for(var i=0,len=_tabList.length;i<len;i++){var item=_tabList[i];html.push('<li key="'+i+'"><a href="javascript:;">'+item.text+"</a></li>")}html.push("</ul>");_titleTab=$(html.join(""));_titleTab.find("li").on("click",function(){var el=$(this);var ind=Number(el.attr("key"));_iframe.attr("src",_tabList[ind].url);focusLi(ind);return false});var tabBox=_self.warp.find(".dg-sub-tab");tabBox.html("").append(_titleTab)},Show:function(type){_top.Open(function(){_iframe.off("load").on("load",function(){var ifr=this;window.setTimeout(function(){$(ifr.contentWindow.document).on("keydown",function(e){if(e.keyCode==27){_self.Close()}})},100)});
1focusLi(type)});_iframe.attr("src",_tabList[type].url)},Close:function(){window.setTimeout(function(){_iframe&&_iframe.attr("src","");_top.Close()},10)}},{content:_content,title:_title,width:700,height:500})};return{Open:function(list,opt){_title=opt.title?opt.title:"";_tabList=list;if(!_tabList){return}if(!_mod){_mod=new mod()}if(!opt){opt={}}if(opt.type==undefined){opt.type=0}_mod.Show(opt.type);_mod.warp.find('[rel="base_title"]').html(_title)},Close:function(){if(_mod){_mod.Close()}}}})();Core.Frame=function(url,obj){var _self=this;if(!obj){obj={}}if(!obj.title){obj.title="新窗口"}var _content=$('<div class="window-frame"><iframe src="" frameborder="0" rel="content"></iframe>'+(obj.is_has_flash?'<div class="app-back" rel="flash_op" style="display:none;"></div>':"")+"</div>");var _opcBoxTemp='<div style="z-index: 9000000;background: none repeat scroll 0 0 black;height: 100%;left: 0;position: absolute;top: 0;width: 100%;filter:alpha(opacity=0.15);-moz-opacity:0;opacity:0;"></div>';var _opcBox;obj.content=_content;Core.WindowBase.call(this,obj);var parentClose=_self.Close;var parentOpen=_self.Open;var parentHide=_self.Hide;var parentActive=_self.Active;var parentDeActive=_self.DeActive;var _isClose=true;this.FrameSetting=obj;this.IsHide=false;if(this.FrameSetting.is_has_flash!=undefined&&typeof this.FrameSetting.is_has_flash=="string"){this.FrameSetting.is_has_flash=Number(this.FrameSetting.is_has_flash)}this.Initial=function(){_self.warp.addClass("window-box")};this.Open=function(newUrl){parentOpen();if(_isClose){_content.find("[rel='content']").attr("src",newUrl?newUrl:url);_isClose=false}else{if(newUrl){_content.find("[rel='content']").attr("src",newUrl)}}_self.IsHide=false};this.Hide=function(){parentHide();_self.IsHide=true};this.Close=function(){parentClose();_content.find("[rel='content']").attr("src","");if(_opcBox){_opcBox.remove();_opcBox=false}_content.find("iframe").attr("src","");_content.html("");_self.warp&&_self.warp.remove();_self.warp=false;_isClose=true;_self.IsHide=false};this.Active=function(zIndex){if(_opcBox){_opcBox.hide()}parentActive(zIndex);if(_self.FrameSetting.is_has_flash){_content.find("[rel='content']").css({height:"",width:""});_content.find("[rel='flash_op']").hide()}};this.DeActive=function(zIndex){if(!_opcBox){_opcBox=$(_opcBoxTemp);_content.find("[rel='content']").before(_opcBox)}_opcBox.show();parentDeActive(zIndex);if(_self.FrameSetting.is_has_flash){_content.find("[rel='content']").css({height:"1px",width:"1px"});_content.find("[rel='flash_op']").show()}}};Core.AppFrame=function(url,obj){var _self=this;Core.Frame.call(this,url,obj);var _oldHide=_self.Hide;this.Hide=function(){if(obj.HideCallBack){obj.HideCallBack()}_oldHide()}};(function(){var music=Core.CloudMusic=(function(){var _cache={},_ind=0,_client;return{AddClient:function(api){if(!_client){_client={}}_client["k_"+new Date().getTime()+"_"+_ind]=api;_ind++},GetCate:function(callback){if(!_cache.cates){$.ajax({url:"/?ct=umusic&ac=topics",type:"GET",cache:false,dataType:"json",success:function(r){_cache.cates={};if(r.state&&r.data){for(var k in r.data){var item=r.data[k];_cache.cates[item.topic_id]=item}}callback&&callback(_cache.cates)}})}else{callback&&callback(_cache.cates)}},DelCate:function(tid,callback){Core.Message.Confirm({text:"是否要删除该云专辑?",type:"war",content:"删除后将无法恢复",callback:function(r){if(r){$.ajax({url:"/?ct=umusic&ac=delete_topic&topic_id="+tid,dataType:"json",type:"GET",cache:false,success:function(r){if(r.state){if(_cache.cates[tid]){_cache.cates[tid]=null;delete _cache.cates[tid]}callback&&callback(true)}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000});callback&&callback(false)}}})}}})},EditCate:function(tid,callback){if(!_cache.cates||!_cache.cates[tid]){Core.MinMessage.Show({text:"没有对应的云专辑",type:"war",timeout:2000});return false}var info=_cache.cates[tid];var editCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var editBox=new Core.DialogBase({title:"重命名云专辑",content:editCon});editBox.Open(null);editCon.find("[rel='txt']").val(info.topic_name);var renameFun=function(){var cateName=$.trim(editCon.find('[rel="txt"]').val());if(cateName==""){Core.MinMessage.Show({text:"请输入专辑名称",type:"war",timeout:2000});callback&&callback(false);return}$.ajax({url:"/?ct=umusic&ac=edit_topic",type:"POST",dataType:"json",data:{topic_id:tid,topic_name:cateName},success:function(r){if(r.state){_cache.cates[tid].topic_name=cateName;if(_client){for(var k in _client){var c=_client[k];if(c.RenameCate){c.RenameCate(_cache.cates[tid],_cache.cates)}}}callback&&callback(_cache.cates[tid]);editBox.Close()}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000});callback&&callback(false)}}})};editCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){renameFun()}else{if(e.keyCode==27){editBox.Close()}}});editCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":renameFun();break;case"cancel":editBox.Close();break}return false});editCon.find("[rel='txt']")[0].focus();window.setTimeout(function(){editCon.find("[rel='txt']")[0].select()},20)},AddCate:function(callback){var addCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var addBox=new Core.DialogBase({title:"添加云专辑",content:addCon});addBox.Open(null);var addCateFun=function(){var cateName=$.trim(addCon.find('[rel="txt"]').val());if(cateName==""){Core.MinMessage.Show({text:"请输入专辑名称",type:"war",timeout:2000});callback&&callback(false);return}music.GetCate(function(data){$.ajax({url:"/?ct=umusic&ac=add_topic",data:{topic_name:cateName},type:"POST",dataType:"json",success:function(r){if(r.state){_cache.cates[r.topic_id]={topic_id:r.topic_id,user_id:USER_ID,topic_name:r.topic_name};if(_client){for(var k in _client){var c=_client[k];if(c.AddCate){c.AddCate(_cache.cates[r.topic_id],_cache.cates)}}}callback&&callback(_cache.cates[r.topic_id]);addBox.Close()}else{if(r.msg_code==88807&&!Core.FilePermission.Vip()){Core.Message.Confirm({text:"你不可以再添加云专辑了",content:"升级VIP后可添加<b>115张</b>云专辑!",confirm_text:"马上升级",confirm_link:Core.CONFIG.Path.VIP+"?p=cloud_music"})}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000})}callback&&callback(false)}}})})};addCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){Util.Html.StopPropagation(e);addCateFun(e)}else{if(e.keyCode==27){addBox.Close()}}});addCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":addCateFun(e);break;case"cancel":addBox.Close();break}return false});addCon.find("[rel='txt']")[0].focus()},DelFile:function(topic_id,music_id,callback){$.ajax({url:"/?ct=umusic&ac=delete_music&music_id="+music_id,cache:false,type:"GET",dataType:"json",success:function(r){if(r.state){var list=_cache.list[topic_id];if(list){var ind=false;for(var i=0,len=list.length;i<len;i++){var item=list[i];if(item.id==music_id){ind=i}}if(ind!==false){_cache.list[topic_id].splice(ind,1)}}callback&&callback(_cache.list[topic_id])}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000});callback&&callback(false)}}})},AddFileList:function(tid,fids,callback){$.ajax({url:"/?ct=umusic&ac=add_music",data:{topic_id:tid,file_id:fids.join(",")},type:"POST",dataType:"json",success:function(r){if(r.state){if(!_cache.list){_cache.list={}}
1_cache.list[tid]=r.data;callback&&callback(_cache.list[tid])}else{if(r.msg_code==88807&&!Core.FilePermission.Vip()){Core.Message.Confirm({text:"该云专辑不能再添加文件了",content:"升级VIP后可添加<b>1150首</b>歌曲!",confirm_text:"马上升级",confirm_link:Core.CONFIG.Path.VIP+"?p=cloud_music"})}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:2000})}callback&&callback(false)}}})},GetFileList:function(topic_id,callback){if(!_cache.list){_cache.list={}}if(!_cache.list[topic_id]){$.ajax({url:"/?ct=umusic&ac=musics&topic_id="+topic_id,type:"GET",cache:false,dataType:"json",success:function(r){if(r.state){_cache.list[topic_id]=r.data;callback&&callback(_cache.list[topic_id])}else{callback&&callback(false)}}})}else{callback&&callback(_cache.list[topic_id])}}}})()})();Core.FileAjax=(function(){var IS_115DOMAIN=/115(rc)?\.com/.test(location.href);var WebApi=IS_115DOMAIN?"//webapi.115.com":"/webapi";function refreshFileMiniFrame(win){if(win&&win.Main&&win.Main.ReInstance){if(!win.Main.ReInstance()){win.location.reload()}}}return{Star:function(tid,is_star,callback){var data={};data.file_id=tid;data.star=is_star;UA$.ajax({url:WebApi+"/files/star",data:data,dataType:"json",type:"POST",xhrFields:{withCredentials:true},success:function(r){if(r.state){if(callback){callback(tid,is_star)}}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}})},_rbPassWord:function(callback,tids,body){var rbSetting=Core.FileAjax.RBPassWordSet();if(rbSetting){if(rbSetting.HasPass){function _(){var $dom,dg;if(body){$dom=$('<div style="position: fixed;top: 0;right: 0; left: 0;bottom: 0; z-index: 100"><iframe frameborder="0" src="" style="height: 100%; width: 100%; background: #fff"></iframe></div>');$(body).append($dom);dg={Close:function(type){$dom.remove()}}}else{$dom=$('<div class="dialog-frame"><iframe frameborder="0" src="" style="height: 380px;border-radius:5px;"></iframe></div>');dg=new Core.DialogBase({title:"安全密钥",content:$dom,width:500});dg.Open(function(){dg.warp.find('[rel="title_box"],.dialog-handle').remove();dg.warp.css({border:"none"})})}$dom.find("iframe").on("load",function(){var win=this.contentWindow;var $body=$(win.document.body);var reg=/^\d*$/,$code=$body.find("#js_old_code");$body.find('[rel-btn="close"]').on("click",function(){dg&&dg.Close();return false});$code.on("keyup",function(e){var val=$(this).val();if(!reg.test(val)){$(this).val(val.replace(/\D/gi,""));$.alertTip("请输入6位数字安全密钥")}});$body.find("#js-post_submit").on("click",function(){var code=$.trim($code.val());if(!code.length){$.alertTip("请输入安全密钥");return false}callback&&callback(code,function(){dg.Close()});dg&&dg.Close();return false});$(win).on("keydown",function(e){if(e.keyCode==27){dg&&dg.Close();return false}else{if(e.keyCode==13){$body.find("#js-post_submit").click();return false}}});try{setTimeout(function(){$code.focus()},300)}catch(e){}});if(body){$dom.find("iframe").attr("src","//cdnres.115.com/q/static/static_v9.0/resource/superpwd.page.html?v="+VIEWER_VERSION)}else{$dom.find("iframe").attr("src","//cdnres.115.com/q/static/static_v9.0/resource/superpwd.common.html?v="+VIEWER_VERSION)}}$.ajax({url:"//passportapi.115.com/app/1.0/web/8.2/user/security_key_status",dataType:"json",xhrFields:{withCredentials:true},success:function(json){if(json.state&&json.data){if(json.data.is_new){_()}else{try{top.$.alertTip("安全升级,请先重置安全密钥,再进行操作")}catch(e){}setTimeout(function(){if(json.data.is_set){function loadCallback(){top.oofUtil.SuperPasswordDG.showDialog({callback:function(data){if((data&&data.reload)||(data&&data.success)){if(data.success){_()}}else{}}})}if(!top.window.oofUtil.SuperPasswordDG){top.$.getScript("//aq.115.com/m_r/static/super_password/ChangeOldSuperPasswordDG.js",loadCallback)}else{loadCallback()}return false}top.location.href="//"+document.domain+"/?nav=safe&mode=my_set&open=forgot_superpwd"},1000)}}else{try{top.$.alertTip(json.message||json.error||"网络异常,请刷新再试")}catch(e){alert(json.message||json.error||"网络异常,请刷新再试")}}}})}else{top.Core.Message.Confirm({text:"你还没有设置安全密钥。",content:"安全密钥是账号枫币支出、回收站、空间卡等关键操作的重要操作凭证。",type:"inf",confirm_link:top.Core.CONFIG.Path.U+"/?nav=safe&child=user&mode=my_set&type=superpwd",confirm_text:"立即设置"});return false}}return true},RBPassWordSet:false,ClearRB:function(aid,cid,win){Core.Message.Confirm({text:"确认要清空回收站所有的文件吗?",content:"文件将被彻底删除且不可恢复",type:"inf",callback:function(r){if(r){var ret=Core.FileAjax._rbPassWord(function(input,hideFun){UA$.ajax({url:"/rb/clean",type:"POST",dataType:"json",data:{password:input},success:function(r){if(r.state){window.setTimeout(function(){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(7,0)}refreshFileMiniFrame(win)},2000);if(hideFun){hideFun()}Core.MinMessage.Show({text:"成功清空回收站",type:"suc",timeout:Core.CONFIG.MsgTimeout});Core.CountSync.Sync();window.GETLEFTMODEDATAT()}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}})},null,win&&win.document.body)}return ret}})},DeleteRB:function(tids,win){Core.Message.Confirm({text:"确认要删除所选中的文件吗?",content:"文件将被彻底删除且不可恢复",type:"inf",callback:function(r){if(r){var ret=Core.FileAjax._rbPassWord(function(input,hideFun){var data={};for(var i=0,len=tids.length;i<len;i++){data["rid["+i+"]"]=tids[i]}data.password=input;UA$.ajax({url:"/rb/clean",type:"POST",dataType:"json",data:data,success:function(r){if(r.state){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(7,0)}refreshFileMiniFrame(win);window.setTimeout(function(){Core.MinMessage.Show({text:"成功删除回收站文件",type:"suc",timeout:Core.CONFIG.MsgTimeout})},500);Core.CountSync.Sync();window.GETLEFTMODEDATAT();if(hideFun){hideFun()}}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}})},tids,win&&win.document.body)}return ret}})},RestoreRB:function(tids,win){Core.Message.Confirm({text:"确认要还原选中的文件吗?",type:"inf",callback:function(r){if(r){var data={};for(var i=0,len=tids.length;i<len;i++){data["rid["+i+"]"]=tids[i]}UA$.ajax({url:"/rb/revert",type:"POST",dataType:"json",data:data,success:function(result){if(result.state){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(7,0)}refreshFileMiniFrame(win);Core.CountSync.Sync();setTimeout(function(){Core.MinMessage.Show({text:"还原成功",type:"suc",timeout:Core.CONFIG.MsgTimeout})},500)}else{if(result.errno===4500032){Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){to
1p.window._SHOWVIPDIALOG_.Show({title:"升级VIP,可共享更多文件",btns:1,text:result.error,confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}else{if(result.errno==300001){Core.Message.Confirm({text:"抱歉,还原失败!网盘空间不足!",content:"请释放适量的空间或扩容你的网盘,以便文件顺利还原。",type:"war",confirm_link:Core.CONFIG.Path.VIP+"/?p=rb_revert",confirm_text:"扩容空间"});return}Core.MinMessage.Show({text:result.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}}})}},win:win})},EditCover:function(aid,cid,tid,callback){UA$.ajax({url:"/files/edit",type:"POST",dataType:"json",data:{fid:cid,fid_cover:tid},success:function(result){if(result.state){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload()}}if(callback){callback(result)}}})},DeleteCover:function(aid,cid,callback){UA$.ajax({url:"/files/edit",type:"POST",dataType:"json",data:{fid:cid,fid_cover:0},success:function(result){if(result.state){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload()}}if(callback){callback(result)}}})},EditShowPlayLong:function(cids,spl,callback){UA$.ajax({url:"/files/edit",type:"POST",dataType:"json",data:{fid:cids,show_play_long:spl},success:function(r){if(r.state){if(callback){callback(r)}}else{Core.MinMessage.Show({text:r.error||"开启失败",type:"err",timeout:Core.CONFIG.MsgTimeout})}}})},BatchEditShowPlayLong:function(cids,callback){UA$.ajax({url:"/files/batch_edit",type:"POST",dataType:"json",data:{show_play_long:cids},success:function(r){if(r.state){if(callback){callback(r)}}else{Core.MinMessage.Show({text:r.error||"开启失败",type:"err",timeout:Core.CONFIG.MsgTimeout})}}})},GetFolderPlaylong:function(cids,callback){$.ajax({url:"//aps.115.com/getFolderPlaylong",dataType:"json",type:"post",data:{user_id:window.USER_ID,folder_ids:cids.join(",")},success:function(json){callback&&callback(json.data,json.audiodata)}})},BatchSetFilesScore:function(ids,score,callback){UA$.ajax({url:"/files/score",type:"POST",dataType:"json",data:{file_id:ids,score:score},success:function(r){if(r.state){if(callback){callback(r)}}else{Core.MinMessage.Show({text:r.error||"设置失败",type:"err",timeout:Core.CONFIG.MsgTimeout})}}})}}})();Core.FileAPI=(function(){var IS_115DOMAIN=/115(rc)?\.com/.test(location.href);var WebApi=IS_115DOMAIN?"//webapi.115.com":"/webapi";var _giftCache={};var attrHtml="";var getFileMsg=function(list){var arr=list;var txt="";var _loadDetailTimer=null;if(_loadDetailTimer){window.clearTimeout(_loadDetailTimer)}if(arr&&arr.length){if(arr.length==1){var item=arr[0];switch(item.attr("file_type")){case"1":txt="已选中1个文件,大小:"+Util.File.ShowSize(OOF_NUMBER(item.attr("file_size")));if(false&&checkHasDesc()){var desc=item.find("[field='desc']").val();if(desc!=""){desc=desc.replace(/<.*?>/g,"");desc=Util.Text.Cut(desc.replace(/\[.*?\]/g,""),50)}else{if(item.attr("has_desc")!="1"){item.attr("load_data","1");desc=""}else{if(item.attr("load_data")=="1"){desc=""}else{desc=""}}}txt+=(desc?",文件描述:"+desc:"");if(item.attr("load_data")!="1"){_loadDetailTimer=window.setTimeout(function(){if(_loadDetailTimer){window.clearTimeout(_loadDetailTimer)}var backFun=function(data){item.attr("load_data","1");var desc=data.state?data.desc:"";item.find("[field='desc']").val(desc?desc:"");if(data.count!=undefined){item.attr("dc",data.count)}if(_btn_warp&&_btn_warp.length){desc=desc.replace(/<.*?>/g,"");desc=Util.Text.Cut(desc.replace(/\[.*?\]/g,""),50);var con="已选中1个文件,大小:"+Util.File.ShowSize(OOF_NUMBER(item.attr("file_size")))+(desc?",文件描述:"+desc:"");_btn_warp.find(".file-info-text").html(con)}};Core.DataAccess.FileRead.GetFileDetail(item.attr("file_id"),backFun)},2000)}}break;case"0":txt="已选中1项";if(item.attr("load_data")=="1"){var countTxt=[];if(Number(item.attr("category_file_count"))){countTxt.push(item.attr("category_file_count")+"个文件")}if(Number(item.attr("cate_folder_count"))){countTxt.push(item.attr("cate_folder_count")+"个文件夹")}if(item.attr("cate_size")){countTxt.push("共"+item.attr("cate_size"))}if(countTxt.length){txt+=",含"+countTxt.join(",")}}else{if(item.attr("load_data")!="1"){_loadDetailTimer=window.setTimeout(function(){if(_loadDetailTimer){window.clearTimeout(_loadDetailTimer)}Core.DataAccess.Dir.GetDetail(item.attr("area_id"),item.attr("cate_id"),function(data){item.attr("category_file_count",data.count);item.attr("cate_folder_count",data.folder_count);item.attr("cate_size",data.size);item.attr("load_data","1");item.attr("ptime",data.ptime);item.attr("pick_code",data.pick_code);
1if(data.desc){item.find("[field=desc]").val(data.desc)}if(item.attr("is_share")=="1"){if(data.password!=""){item.attr("has_pass","1");item.attr("file_pwd",data.password);item.find("[field='ext3']").val(data.question)}}var ntxt="已选中1项";if(item.attr("load_data")=="1"){var countTxt=[];if(Number(item.attr("category_file_count"))){countTxt.push(item.attr("category_file_count")+"个文件")}if(Number(item.attr("cate_folder_count"))){countTxt.push(item.attr("cate_folder_count")+"个文件夹")}if(item.attr("cate_size")){countTxt.push("共"+item.attr("cate_size"))}if(countTxt.length){ntxt+=",含"+countTxt.join(",")}}txt=ntxt;$(".desc").html('<div class="operate-desc" rel="desc" title="'+txt+'">'+txt+"</div>")})},200)}}break}}else{var fileCount=0;var folderCount=0;var fileSize=0;for(var i=0,len=arr.length;i<len;i++){var item=arr[i];if(item.attr("file_type")=="1"){fileCount++;fileSize+=OOF_NUMBER(item.attr("file_size"))}else{if(item.attr("file_type")=="0"){folderCount++}}}if(fileCount){txt="已选中"+fileCount+"个文件";if(!folderCount){txt+=",共"+Util.File.ShowSize(fileSize)}}if(folderCount){if(fileCount){txt+=","}else{txt+="已选中"}txt+=folderCount+"个文件夹"}}if(txt){txt='<div  class="operate-desc" rel="desc" title="'+txt+'">'+txt+"</div>"}}return txt};var htmlToText=function(html){html=html.replace(/<!doctype[^>]*>/i,"");html=html.replace(/<head>[\w\W]*?<\/head>/i,"");html=html.replace(/<style.*>[\w\W]*?<\/style>/gi,"");html=html.replace(/<script.*>[\w\W]*?<\/script>/gi,"");html=html.replace(/\n|\r/g," ");html=html.replace(/\<\/p\>/gi,"\n");html=html.replace(/\<\/li\>/gi," ");html=html.replace(/\<br\s*?\/?\>/gi,"\n");html=strip_tags(html);html=html_entity_decode(html,"HTML_ENTITIES");html=html.replace(/([ \t])+/g," ");html=html.replace(/\n /g,"\n");return html};var html_entity_decode=function(string,quote_style){var hash_map={},symbol="",tmp_str="",entity="";tmp_str=string.toString();if(false===(hash_map=get_html_translation_table("HTML_ENTITIES",quote_style))){return false}delete (hash_map["&"]);hash_map["&"]="&amp;";for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(entity).join(symbol)}
1tmp_str=tmp_str.split("&#039;").join("'");return tmp_str};var strip_tags=function(input,allowed){allowed=(((allowed||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,commentsAndPhpTags=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return input.replace(commentsAndPhpTags,"").replace(tags,function($0,$1){return allowed.indexOf("<"+$1.toLowerCase()+">")>-1?$0:""})};var get_html_translation_table=function(table,quote_style){var entities={},hash_map={},decimal;var constMappingTable={},constMappingQuoteStyle={};var useTable={},useQuoteStyle={};constMappingTable[0]="HTML_SPECIALCHARS";constMappingTable[1]="HTML_ENTITIES";constMappingQuoteStyle[0]="ENT_NOQUOTES";constMappingQuoteStyle[2]="ENT_COMPAT";constMappingQuoteStyle[3]="ENT_QUOTES";useTable=!isNaN(table)?constMappingTable[table]:table?table.toUpperCase():"HTML_SPECIALCHARS";useQuoteStyle=!isNaN(quote_style)?constMappingQuoteStyle[quote_style]:quote_style?quote_style.toUpperCase():"ENT_COMPAT";if(useTable!=="HTML_SPECIALCHARS"&&useTable!=="HTML_ENTITIES"){throw new Error("Table: "+useTable+" not supported")}if(useTable==="HTML_ENTITIES"){entities["160"]="&nbsp;";entities["161"]="&iexcl;";entities["162"]="&cent;";entities["163"]="&pound;";entities["164"]="&curren;";entities["165"]="&yen;";entities["166"]="&brvbar;";entities["167"]="&sect;";entities["168"]="&uml;";entities["169"]="&copy;";entities["170"]="&ordf;";entities["171"]="&laquo;";entities["172"]="&not;";entities["173"]="&shy;";entities["174"]="&reg;";entities["175"]="&macr;";entities["176"]="&deg;";entities["177"]="&plusmn;";entities["178"]="&sup2;";entities["179"]="&sup3;";entities["180"]="&acute;";entities["181"]="&micro;";entities["182"]="&para;";entities["183"]="&middot;";entities["184"]="&cedil;";entities["185"]="&sup1;";entities["186"]="&ordm;";entities["187"]="&raquo;";entities["188"]="&frac14;";entities["189"]="&frac12;";entities["190"]="&frac34;";entities["191"]="&iquest;";entities["192"]="&Agrave;";entities["193"]="&Aacute;";entities["194"]="&Acirc;";entities["195"]="&Atilde;";entities["196"]="&Auml;";entities["197"]="&Aring;";entities["198"]="&AElig;";entities["199"]="&Ccedil;";entities["200"]="&Egrave;";entities["201"]="&Eacute;";entities["202"]="&Ecirc;";entities["203"]="&Euml;";entities["204"]="&Igrave;";entities["205"]="&Iacute;";entities["206"]="&Icirc;";entities["207"]="&Iuml;";entities["208"]="&ETH;";entities["209"]="&Ntilde;";entities["210"]="&Ograve;";entities["211"]="&Oacute;";entities["212"]="&Ocirc;";entities["213"]="&Otilde;";entities["214"]="&Ouml;";entities["215"]="&times;";entities["216"]="&Oslash;";entities["217"]="&Ugrave;";entities["218"]="&Uacute;";entities["219"]="&Ucirc;";entities["220"]="&Uuml;";entities["221"]="&Yacute;";entities["222"]="&THORN;";entities["223"]="&szlig;";entities["224"]="&agrave;";entities["225"]="&aacute;";entities["226"]="&acirc;";entities["227"]="&atilde;";entities["228"]="&auml;";entities["229"]="&aring;";entities["230"]="&aelig;";entities["231"]="&ccedil;";entities["232"]="&egrave;";entities["233"]="&eacute;";entities["234"]="&ecirc;";entities["235"]="&euml;";entities["236"]="&igrave;";entities["237"]="&iacute;";entities["238"]="&icirc;";entities["239"]="&iuml;";entities["240"]="&eth;";entities["241"]="&ntilde;";entities["242"]="&ograve;";entities["243"]="&oacute;";entities["244"]="&ocirc;";entities["245"]="&otilde;";entities["246"]="&ouml;";entities["247"]="&divide;";entities["248"]="&oslash;";entities["249"]="&ugrave;";entities["250"]="&uacute;";entities["251"]="&ucirc;";entities["252"]="&uuml;";entities["253"]="&yacute;";entities["254"]="&thorn;";entities["255"]="&yuml;"}if(useQuoteStyle!=="ENT_NOQUOTES"){entities["34"]="&quot;"}if(useQuoteStyle==="ENT_QUOTES"){entities["39"]="&#39;"}entities["60"]="&lt;";entities["62"]="&gt;";for(decimal in entities){if(entities.hasOwnProperty(decimal)){hash_map[String.fromCharCode(decimal)]=entities[decimal]}}return hash_map};function getGUID(){if(!getGUID._index){getGUID._index=1}else{getGUID._index++}return"_"+(+new Date())+"_"+getGUID._index}var _userInfo={};var getVipDate=function(){if(!top.USER_ID){return}$.ajax({url:WebApi+"/user/vip_limit?feature=2",type:"GET",xhrFields:{withCredentials:true},success:function(r){if(r.state){_userInfo=r.data}else{top.window.Core.MinMessage.Show({text:r.msg,type:"err",timeout:2000})}},dataType:"json"})};getVipDate();return{MoveFile:function(pcid,list,callback,is_copy){if(list.length){var data={pid:pcid};if(is_copy){data.copy=1}var ind=0;for(var i=0,len=list.length;i<len;i++){var item=list[i];if(item.attr("file_type")=="1"){data["fid["+ind+"]"]=list[i].attr("file_id")}else{data["fid["+ind+"]"]=list[i].attr("cate_id")}ind++}Core.MinMessage.Show({text:"正在"+(!is_copy?"转移":"复制")+"文件....",type:"load",timeout:10000});UA$.ajax({url:"/files/move",type:"POST",data:data,dataType:"json",success:function(r){if(r.state){if(!is_copy){try{if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Del(Core.FileConfig.aid,Core.FileConfig.cid,list)}window.setTimeout(function(){Core.MinMessage.Show({text:"成功转移文件",type:"suc",timeout:Core.CONFIG.MsgTimeout})},500)}catch(e){}}else{try{if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(Core.FileConfig.aid,Core.FileConfig.cid)}window.setTimeout(function(){Core.MinMessage.Show({text:"成功复制文件",type:"suc",timeout:Core.CONFIG.MsgTimeout})},500)}catch(e){}}}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}callback&&callback(r.state)}})}},DeleteGift:function(list){if(!list.length){Core.MinMessage.Show({text:"请选择礼包",type:"war",timeout:2000});return true}Core.Message.Confirm({text:"确认要删除选中的网盘礼包?",content:"请放心,删除礼包并不会删除原始文件。",type:"inf",callback:function(r){if(r){var giftCodes=[];for(var i=0,len=list.length;i<len;i++){var item=list[i];giftCodes.push(item.attr("code"))}$.ajax({url:"/?ct=filegift&ac=delete",type:"POST",data:{gift_code:giftCodes},dataType:"json",success:function(res){if(res.state){Ext.CACHE.FileMain&&Ext.CACHE.FileMain.ReInstance();window.setTimeout(function(){Core.MinMessage.Show({text:"删除成功",type:"suc",timeout:2000})},500)}else{Core.MinMessage.Show({text:res.message,type:res.errtype||"err",timeout:2000})}}})}}})},DeleteFile:function(list,callback,delInCallback,forceDell,extraParam,hasHide){var userinfo=top.COMMONHEADERUSERINFO;var isvip=userinfo.vip==1;var delcon=false;var fileMsg="";fileMsg=getFileMsg(list);delcon="删除的文件可在"+_userInfo.user_limit.limit_numbers+"天内从回收站还原,回收站仍占用网盘的空间容量哦,请及时清理。";for(var i=0;i<list.length;i++){if(+list[i].attr("shared")===1||+list[i].attr("shared")===2){delcon="文件内含共享文件,删除后成员将无法查看"}}if(Core.FileConfig.aid==0){delcon=""}var msg="<span>
1"+(hasHide?"文件夹内含有隐藏文件,是否确定删除?":"确认要删除选中的文件到回收站?")+'</span><div class="desc">'+fileMsg+"</div>";var $content=$('<div class="dialog-msg">             <h3><i class="hint-icon hint-war"></i><div class="dialog-msg-content dmc-multi">'+msg+'</div></h3>\n            <div class="dialog-msg-text">'+delcon+'</div>            <div class="dialog-action">                <a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a>\n                <a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a>            </div>           </div>           <div class="not-vip-msgtips" rel="up_vip"  style="display: none;">\n            <div class="cont" >升级VIP,立享回收站文件30天保存期限</div>\n            <a href="//vip.115.com/?vip_type=year" target="_blank" class="button btn-red" style="display:;"><span>升级VIP</span></a>\n           </div></div>');var confirmDG=new Core.DialogBase({title:"信息提示",content:$content});function confirmDel(){var url="/rb/delete";var data=Core.FileAPI.GetSelFilesData(list);if(extraParam){for(var i in extraParam){data[i]=extraParam[i]}}data&&(data.ignore_warn=1);UA$.ajax({url:url,type:"POST",data:data,dataType:"json",success:function(r){var arr=list;var dellist=[];if(r.state){dellist=arr;Core.MinMessage.Show({text:"删除成功",timeout:Core.CONFIG.MsgTimeout,type:"suc"});Core.SpaceTips.Show(1);if(Core.FileConfig.DataAPI&&!delInCallback){Core.FileConfig.DataAPI.Del(Core.FileConfig.aid,Core.FileConfig.cid,dellist)}confirmDG.Close();callback&&callback();Core.SpaceData.Sync()}else{if(r.errno=="800007"){confirmDG.Close();extraParam=extraParam||{};extraParam.ignore_warn=1;Core.FileAPI.DeleteFile(list,callback,delInCallback,forceDell,extraParam,true);return}Core.MinMessage.Show({text:r.error,timeout:Core.CONFIG.MsgTimeout,type:"err"})}}})}if(forceDell){confirmDel();return false}confirmDG.Open(function(){var $warp=confirmDG.warp;if(!isvip){$warp.find("[rel=up_vip]").show()}$warp.on("click","[btn]",function(){var btn=$(this).attr("btn");if(btn=="cancel"){confirmDG.Close()}else{confirmDel()}});$(window).keydown(function(e){if(e.keyCode==13&&confirmDG&&confirmDG.warp){confirmDel()}})})},ShowQCode:function(url){if(!_giftCache.dom){_giftCache.dom=$('<div class="qcode-popup" style="position: fixed;_position: absolute;z-index:9000002;"><img src="" alt="" /></div>');_giftCache.dom.find("img").on("load",function(){if($(this).attr("src")){Util.Layer.Center(_giftCache.dom,{NoAddScrollTop:true});_giftCache.dom.fadeIn()}});_giftCache.cover=$('<div style="z-index: 9000001;background: none repeat scroll 0 0 black;height: 100%;left: 0;position: absolute;top: 0;width: 100%;filter:alpha(opacity=0.15);-moz-opacity:0;opacity:0;" onselectstart="return false;"></div>');$(document.body).append(_giftCache.dom);_giftCache.dom.hide();$(document.body).append(_giftCache.cover);$(window).on("keyup",function(e){if(e.keyCode==27&&!_giftCache.cover.is(":hidden")){_giftCache.dom.hide();_giftCache.cover.hide();return false}});_giftCache.cover.add(_giftCache.dom).on("click",function(){_giftCache.dom.hide();_giftCache.cover.hide();return false})}var img=_giftCache.dom.find("img");img.attr("src","");_giftCache.cover.show();window.setTimeout(function(){img.attr("src",url)},1);Util.Layer.Center(_giftCache.dom,{NoAddScrollTop:true})},ShowGiftCode:function(code){this.ShowQCode("//115.com/?ct=filegift&ac=qrcode&gift_code="+code)},OpenMusic:function(){Core.FileAPI._MusicWin=window.open("//115.com/?ct=music#","OOF_MUSIC","height=680,width=920,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no");if(Core.FileAPI._MusicWin){Core.FileAPI._MusicWin.focus()}},CheckFileType:function(fileDom){var type="";var suffix="";var fileName=fileDom.find("[field='file_name']").attr("title");if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}for(var k in window.UPLOAD_CONFIG){var item=window.UPLOAD_CONFIG[k];if(typeof item.upload_type_limit=="object"&&$.inArray(suffix.toLowerCase(),item.upload_type_limit)!=-1){type=k;break}}if($.inArray(suffix.toLowerCase(),["rar","tar","gz","7z","zip","part"])!=-1){type=11}return type},OpenRAR:function(obj,win){if(/\.(rar|zip|7z)$/i.test(obj.file_name)){Core.YunUnzipDG.Open(obj,win)}else{$.alertTip("暂不支持此类压缩包")}},OpenVideo:function(pick_code,obj){var that=this;var share_id="";if(obj&&obj.shareId){share_id="&share_id="+obj.shareId}var url="//115.com/?ct=play&ac=location&pickcode="+pick_code+share_id;if((window.USER_PERMISSION&&USER_PERMISSION.is_vip==1)||window.IS_PREVIEW_CARD||window.COMMONHEADERUSERINFO.vip){this.OpenNewWindow(url)}else{var _=function(){var setting={title:"使用该功能,请升级至VIP进行体验",btns:1,text:'在线预览视频时,可能需要进行视频转码,根据VIP等级享受不同级别的转码速度,购买/升级前请详细阅读<a href="//vip.115.com/?ct=info&ac=information&tab=review" style="color:#2777F8;" target="_blank">《在线预览视频特权》</a>介绍',confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"};$.ajax({url:"//webapi.115.com/user/user_rights",data:{type:2,is_use:-1},dataType:"JSON",type:"GET",success:function(r){if(r.state){if(r.data.list.length){var list=r.data.list,noUseCount=0,isUsed=false;$.each(list,function(index,item){if(pick_code==item.pick_code){isUsed=true}if(!(item.is_use*1)){noUseCount++}});if(isUsed){return that.OpenNewWindow(url)}else{if(noUseCount){setting={title:"使用该功能,请升级VIP会员<br/>或使用单文件在线播放券",confirm_text:"使用兑换券("+noUseCount+")",confirm_link:"javascript:;
1",confirm_text2:"升级VIP会员",confirm_link2:"//vip.115.com/?vip_type=year",btns:2,params:{pick_code:pick_code},confirm_callback:function(_this,params){$.ajax({url:"//webapi.115.com/user/user_rights",data:{pick_code:pick_code,type:2},type:"POST",dataType:"JSON",success:function(r){if(r.state){$.successTip("使用成功");top.window._SHOWVIPDIALOG_.Hide();that.OpenNewWindow(url)}else{$.errorTip("使用失败")}}})}}}}}top.window._SHOWVIPDIALOG_.Show(setting)}else{$.alertTip(r.message||"网络错误,请刷新重试")}}})};if(!top.window._SHOWVIPDIALOG_){top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),_)}else{_()}return false;var setting={title:"由于该功能会产生高昂带宽与硬件成本,升级VIP才可使用",text:"",confirm_link:"//vip.115.com",confirm_text:"马上升级",confirm_cls:"btn"};if(window._SHOWVIPDIALOG_){window._SHOWVIPDIALOG_.Show(setting)}else{$.getScript(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js"),function(){window._SHOWVIPDIALOG_.Show(setting)})}}},OpenSWF:function(pick_code,obj){var share_id="";if(obj&&obj.shareId){share_id="&share_id="+obj.shareId}var url="/?ct=play&ac=location&ext=swf&pickcode="+pick_code+share_id;this.OpenNewWindow(url)},OpenDoc:function(pick_code,ico,obj,not_win){var share_id="";var sha1="";var _from="";if(obj){share_id=obj.shareId?"&share_id="+obj.shareId:"";sha1=obj.sha1?obj.sha1:"";_from=obj.from?"&from="+obj.from:""}var url="//115.com/?ct=preview&ac=location&pickcode="+pick_code+(ico=="txt"?"&t=1":"")+share_id+"&ico="+ico+"&sha1="+sha1+_from;if(!not_win){window.open(url)}else{this.OpenNewWindow(url)}},DownloadDir:function(list,ele){ele.attr("target","");ele.attr("href","javascript:;");if(list.length){var item=list[0];if(item.attr("file_type")=="0"&&item.attr("pick_code")){var url=Core.CONFIG.Path.U+"?ct=browser&ac=download_folder&pickcode="+item.attr("pick_code");ele.attr("href",url)}}},GetSelFilesData:function(arr){var data={pid:Core.FileConfig.cid};for(var i=0,len=arr.length;i<len;i++){var item=arr[i];if(item.attr("file_type")=="1"){data["fid["+i+"]"]=item.attr("file_id")}else{if(item.attr("file_type")=="0"){data["fid["+i+"]"]=item.attr("cate_id")}}}return data},_DownloadWin:false,RenewAll:function(callback){},ShareTO:function(list){Core.ShareDG.Open(list)},Download:function(pick_code,win){if(Core.FilePermission.Vip()&&window.uploadInterface){var _=function(){UA$.ajax({url:"files/download?pickcode="+pick_code,type:"GET",dataType:"json",cache:false,success:function(r){if(!r.state&&(r.errcode==911||r.code==911||r.msg_code==911)){if(!window._SHOW911_){Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/show911/show911.js?v=2"),function(){window._SHOW911_(function(){_()},r.data.url||null)})}else{window._SHOW911_(function(){_()},r.data.url||null)}return}if(r.state){var page_file_info={pick_code:r.pickcode,file_id:r.file_id,file_name:r.file_name,file_size:Util.File.ShowSize(r.file_size)};Core.DownFile.Go([$('<div file_type="1" pick_code="'+page_file_info.pick_code+'"><a href="javascript:;" field="file_name" title="'+page_file_info.file_name+'"></a></div>')])}else{Core.MinMessage.Show({text:r.msg,type:"war",timeout:2000})}}})};_();return}var url=Core.CONFIG.Path.OS+"?ct=download&ac=index&pickcode="+pick_code+"&_t="+new Date().getTime();var con=$('<div class="dialog-frame" style="height:240px"><iframe style="height: 240px;" frameborder=0 src="'+url+'"></iframe></div>');Core.FileAPI._DownloadWin=new Core.DialogBase({title:"文件快速下载",content:con,width:530});Core.FileAPI._DownloadWin.Open(function(){Core.FileAPI._DownloadWin.warp.addClass("easy-download")},win)},DownloadURI:function(url,win){var con=$('<div class="dialog-frame" style="height:240px"><iframe style="height: 240px;" frameborder=0 src="'+url+'"></iframe></div>');Core.FileAPI._DownloadWin=new Core.DialogBase({title:"文件快速下载",content:con,width:530});Core.FileAPI._DownloadWin.Open(function(){Core.FileAPI._DownloadWin.warp.addClass("easy-download")},win)},OpenNewWindow:function(url){if(window.browserInterface&&window.browserInterface.openURL){if(url.indexOf("http")>-1){window.browserInterface.openURL(url)}else{if(/^\/\//.test(url)){url=(location.href.indexOf("115rc")!=-1?"http:":"https:")+url}else{url=location.origin+url}window.browserInterface.openURL(url)}}else{var form=document.createElement("form");form.action=url;form.target="_blank";form.method="post";document.body.appendChild(form);form.submit();window.setTimeout(function(){document.body.removeChild(form)},30)}},GetDownPlugs:function(isWrite){return false;if(!isWrite){return document.getElementById("OOF_DOWN_PLUGS_EX1_0")}if(Core.CONFIG.IsWindowNT&&$.support.leadingWhitespace){if(navigator.plugins&&navigator.plugins.length>0){var p=navigator.plugins["115 Check Plugin Ex"];
1if(p){var object=$('<embed id="OOF_DOWN_PLUGS_EX1_0" type="application/x-115checkpluginex" width="0" height="0" style="position:absolute; top:-99999px;" />');$(document.body).append(object)}}}},DownloadSomeFile:function(list,options){if(!list.length){Core.MinMessage.Show({text:"请选择文件",type:"war",timeout:2000});return}if("DownFile" in Core){Core.DownFile.Go(list,options);return false}},EditSyncFileName:function(obj){if(obj.type=="f"){if(obj.fileName.lastIndexOf(".")==-1){obj.suffix=""}else{var name=obj.fileName.substring(0,obj.fileName.lastIndexOf("."));obj.suffix=obj.fileName.substring(obj.fileName.lastIndexOf("."));obj.fileName=name}}else{obj.suffix=""}var editCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" value="'+obj.fileName+'" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a></div></div>');var editBox=new Core.DialogBase({title:"重命名",content:editCon});editBox.Open(null);editCon.find("[rel='txt']").val(obj.fileName);var renameFolderFun=function(e){var model=e.data.model;var input=editCon.find("[rel='txt']");var vals=$.trim(input.val());if(vals==""){Core.MinMessage.Show({text:"请输入内容",timeout:Core.CONFIG.MsgTimeout,type:"err"});input.focus();return}model.fileName=vals+model.suffix;var newPath=model.path+model.fileName;if(model.callback){model.callback(model.key,newPath,function(){editBox.Close()})}};editCon.find("[rel='txt']").bind("keyup",{model:obj},function(e){if(e.keyCode==13){renameFolderFun(e)}else{if(e.keyCode==27){editBox.Close()}}});editCon.find("[btn]").bind("click",{model:obj},function(e){switch($(this).attr("btn")){case"confirm":renameFolderFun(e);break;case"cancel":editBox.Close();break}return false});editCon.find("[rel='txt']")[0].select()},MoveSyncFile:function(list,callback){var id=list.find("input:checkbox").val();$.ajax({url:"?ct=file&ac=move_box",data:{aid:1,cid:0,id:id},type:"POST",success:function(r){if(callback){callback()}}})},GetCopyText:function(list){var strArr=[];for(var i=0,len=list.length;i<len;i++){var item=list[i];var url=Core.CONFIG.Path.OS+((item.attr("file_type")=="1")?"file/":"folder/")+item.attr("pick_code");var file_name;if(item.attr("file_type")=="1"){file_name=item.find('[field="file_name"]').attr("title")}else{file_name=item.attr("cate_name")}strArr.push(url+"#\r\n"+file_name)}return strArr.join("\r\n")},BaleDownload:function(list){if(!Core.FilePermission.Vip()){Core.Message.Confirm({text:"升级VIP贵宾,马上享受文件打包下载服务",confirm_text:"马上升级",confirm_link:PAGE_PATHS.VIP+"/?p=batchdown"});return false}var strArr=[];for(var i=0;i<list.length;i++){var item=list[i];if(item.attr("file_type")=="0"){strArr.push(item.attr("cate_id"))}else{strArr.push(item.attr("file_id"))}}$.ajax({url:"?ct=batchdown&ac=create",data:{file_ids:strArr.join(",")},dataType:"json",type:"POST",success:function(r){if(r.state){Core.FrameDG.Open("static/plug/bale_download/unpack.html?key="+r.task_id,{title:"打包下载",width:500,height:250})}else{Core.MinMessage.Show({text:r.err_msg,type:r.errtype||"err",timeout:Core.CONFIG.MsgTimeout})}}})},getAttributeHtml:function(item,options,cb){var main=window.Ext&&Ext.CACHE.FileMain;var fid=item.attr("cate_id")||item.attr("file_id");options=options||{};var getInfoData=function(_callback){$.ajax({url:WebApi+((options&&options.url)||"/category/get"),type:"GET",xhrFields:{withCredentials:true},data:{cid:fid,rid:item.attr("rid")},success:function(r_data){try{r_data=eval("("+r_data+")");var count_text=[];if(r_data.folder_count*1){count_text.push("文件夹"+r_data.folder_count)}if(r_data.count*1){count_text.push("文件"+r_data.count)}r_data.count_text=count_text.join(",");if(r_data.desc==="<p></p>"){r_data.desc=""}_callback&&_callback(r_data)}catch(e){var _errObj={message:"网络异常,请刷新页面重试"};Core.DataAccess.Error.Throw(_errObj);Core.Debug.write("msg:"+r_data+" error:"+e.message)}}})};getInfoData(function(_data){var rootName="根目录";var _data=_data.data?_data.data:_data;if(!IS_115DOMAIN){_data.desc=""}attrHtml=_data.desc;var paths=_data.paths||[{file_id:0,file_name:rootName}],path_arr=[];var last=0;for(var k=0;k<paths.length;k++){var _path=paths[k];path_arr.push('<a href="javascript:;" menu="open" style="color:#2b91e3" aid="1" cid="'+_path.file_id+'">'+_path.file_name+"</a>");if(k>=paths.length-1){last=_path.file_id}}var diffArr=[["y",31536000000],["M",2592000000],["d",86400000],["h",3600000],["m",60000],["s",1000]];var fix=function(date,m,up){var i,c,d,res=+date-+new Date("Thu Jan 01 1970 00:00:00 GMT+0800");
1for(i=0,c=diffArr.length;i<c;i++){d=diffArr[i];if(m==d[0]){m=res%d[1];res=(res-m)/d[1];if(up){res++}return res}}return 0};var getMinDate=function(phptime){var date=new Date(phptime*1000);var curr2=new Date(+new Date()+(window.DIFF_TIME||0)),t=fix(date,"s"),t1=fix(curr2,"s"),diff=t1-t;if(diff<0){return"1秒前"}if(diff<60&&diff>-60){if(diff>-5&&diff<5){return Math.abs(diff)+"秒前"}if(diff<0){return -diff+"秒后"}return diff+"秒前"}};var formatTimeStr=function(timeStr,timestamp){var tempTimeStr=timeStr;if(tempTimeStr=="刚刚"){tempTimeStr=getMinDate(timestamp)}if(tempTimeStr.indexOf("昨天")!=-1){tempTimeStr=oofUtil.date.format(new Date(timestamp*1000),"MM-dd HH:mm")}if(tempTimeStr.split("-").length>2){tempTimeStr=oofUtil.date.format(new Date(timestamp*1000),"yyyy-MM-dd HH:mm")}return tempTimeStr};var ptime_str=oofUtil.date.formatPhpTimespan(_data.ptime*1,"yyyy-MM-dd HH:mm"),utime_str=oofUtil.date.formatPhpTimespan(_data.utime*1,"yyyy-MM-dd HH:mm");if(_data.open_time>0){var openTimeStr=oofUtil.date.formatPhpTimespan(_data.open_time*1,false,true);openTimeStr=formatTimeStr(openTimeStr,_data.open_time)}_data.play_long_text="";var guid=getGUID();var doHtml="<dl><dt>"+(options?options.type?options.type:"类型":"类型")+":</dt><dd>"+(+_data.file_category==1?(item.attr("ico")||"")+"文件":"文件夹")+"</dd></dl><dl><dt>"+(options?options.size?options.size:"大小":"大小")+":</dt><dd>"+(_data.size||Util.File.ShowSize(_data.file_size,2))+((_data.sha1||_data.sha)?'<a href="javascript:;" class="button btn-stroke" menu="check_repeat_sha1" sha1="'+(_data.sha1||_data.sha)+'" file_id="'+(item.attr("cate_id")||item.attr("file_id"))+'"><span>SHA1</span></a>':"")+" </dd></dl>"+(_data.count_text?"<dl><dt>"+(options&&options.contains?options.contains:"包含")+":</dt><dd><p>"+_data.count_text+'</p><div><span rel="play_long_help" class="helptips" style="display: none;top:36px;">   <i class="icon-help"></i>   <div class="common-little-pop">统计根目录下文件的视频/音频时长和文件夹名称显示的视频/音频时长</div></span><span rel="play_long_text">'+_data.play_long_text+'</span></div><div class="row-option">\n    <label class="title-rcs" for="js-duration-switch'+guid+'">文件名称显示时长:</label>\n    <div class="option-switch option-mini">\n        <input type="checkbox" show_play_long="1" '+(_data.show_play_long&1?' checked="checked" ':"")+' id="js-duration-switch'+guid+'">\n        <label for=""><i>开启</i><s>关闭</s><b>切换</b></label>\n    </div>\n</div>\n</dd></dl>':"")+'<dl rel="create_time_dl" ><dt>'+(options?options.ctime?options.ctime:"创建时间":"创建时间")+":</dt><dd>"+ptime_str+"</dd></dl>"+(_data.ptime!=_data.utime?"<dl><dt>"+(options?options.utime?options.utime:"修改时间":"修改时间")+":</dt><dd>"+utime_str+"</dd></dl>":"")+(_data.open_time>0?"<dl><dt>"+(options?options.otime?options.otime:"上次打开时间":"上次打开时间")+":</dt><dd>"+openTimeStr+"</dd></dl>":"")+"<dl><dt>"+(options?options.location?options.location:"位置":"位置")+':</dt><dd class="path">'+path_arr.join(" > ")+'</dd></dl><dl><dt rel="remark_title" style="display: '+(_data.desc?"block":"none")+'">备注:</dt><dd rel="remark_btn" class="remarks" style="display: '+(_data.desc?"block":"none")+'"><a href="javascript:;" class="btn-link" menu="previewNote" file_type="" title style="padding-left:0px"><span>预览</span></a><a href="javascript:;" class="btn-link" menu="edit"><span>编辑</span></a><a href="javascript:;" class="btn-link" menu="copyNote" ><span>复制</span></a></dd></dl>';cb(doHtml,_data)})},getAttribute:function(item,options,cb,source,remarkCallback){var main=window.Ext&&Ext.CACHE.FileMain;var fid=item.attr("cate_id")||item.attr("file_id");options=options||{};Core.FileAPI.getAttributeHtml(item,options,function(doHtml,_data){setTimeout(function(){cb&&cb()},500);function GetPlayLongText(play_long,audio_play_long,show_play_long){if(play_long==-1){return["统计中...","(统计中...)"]}var counted_play_long=play_long*1000;var counted_audio_play_long=audio_play_long*1000;var play_long_text="";var aplay_long_text="";play_long_text=top.oofUtil.date.numFormat(counted_play_long,"h小时mm分钟ss秒").replace(/^0+小时|00(分钟|秒)/g,"").replace(/^0+/,"");aplay_long_text=top.oofUtil.date.numFormat(counted_audio_play_long,"h小时mm分钟ss秒").replace(/^0+小时|00(分钟|秒)/g,"").replace(/^0+/,"");if(play_long_text||aplay_long_text){return"("+(play_long_text?"视频:"+play_long_text:"")+(aplay_long_text?(play_long_text?",":"")+"音频:"+aplay_long_text:"")+")"}else{return""}}function ResetPlayLongText(){function _(plong,aplong){if(plong||aplong){_data.play_long_text=GetPlayLongText(plong||0,aplong||0,_data.show_play_long)}else{_data.play_long_text=""}dg.warp.find("[rel=base_title]").next(".txt-secondary").remove();if(_data.show_play_long&1&&_data.play_long_text){dg.warp.find("[rel=base_title]").after('<span class="txt-secondary"> '+_data.play_long_text+"</span>")}doHtml.find("[rel=play_long_text]").text(_data.play_long_text);doHtml.find("[rel=play_long_help]")[_data.play_long_text?"show":"hide"]()}Core.FileAjax.GetFolderPlaylong([fid],function(data,audiodata){_(data&&data[fid],audiodata&&audiodata[fid]);options.showPlayLongChange&&options.showPlayLongChange([fid],data,audiodata)})}doHtml=$('<div class="file-detail" style="overflow-y: auto;max-height: 360px; position: relative;">'+doHtml+"</div>");var dg=new Core.DialogBase({title:_data.file_name,content:doHtml,width:720,callback:function(r){}});doHtml.on("click","[menu]",function(){var menu=$(this).attr("menu");switch(menu){case"edit":Core.DataAccess.FileRead.GetFileDetail(fid,function(data){Core.MinMessage.Hide();var desc=data.state?data.desc:"";Core.FileDescDG.Show({aid:Core.FileConfig.aid,file_id:fid,is_dir:_data.file_category,title:_data.file_name,value:desc,noReload:true,callback:function(e){attrHtml=e;if(e){$(item[0]).find('[menu="remark"]').show();$(item[0]).attr("has_desc",1)}else{$(item[0]).find('[menu="remark"]').hide();$(item[0]).attr("has_desc",0)}!e&&doHtml.find('[rel="remark_title"]').hide();!e&&doHtml.find('[rel="remark_btn"]').hide();remarkCallback&&remarkCallback(e)}})});break;case"previewNote":Core.DataAccess.FileRead.GetFileDetail(fid,function(data){Core.MinMessage.Hide();var desc=data.state?data.desc:"";var dg=new Core.DialogBase({title:"预览备注",content:'<div class="review-remarks-dialog" style="min-height: 200px;"><div style="overflow-y: auto;" class="article-content" rel="contentHtml">'+desc+"</div></div>",width:720});dg.Open(function(){var modalBtn='       <div class="header-side" btn="toEdit">            <a href="javascript:;" class="button btn-line"><i class="icon-operate ifo-edit"></i><span>编辑</span></a>        </div>';dg.warp.find('[rel="contentHtml"] a[href^=http]').attr("target","_blank");dg.warp.find("[rel=title_box]").append(modalBtn);dg.warp.find('[btn="toEdit"]').on("click",function(){Core.FileDescDG.Show({aid:Core.FileConfig.aid,file_id:fid,is_dir:_data.file_category,title:_data.file_name,value:desc,noReload:true,callback:function(e){attrHtml=e;desc=e;e&&dg.warp.find('[rel="contentHtml"]').html(e).find('a[href^="http"]').attr("target","_blank");if(e){$(item[0]).find('[menu="remark"]').show();$(item[0]).attr("has_desc",1)}else{$(item[0]).find('[menu="remark"]').hide();$(item[0]).attr("has_desc",0)}!e&&doHtml.find('[rel="remark_title"]').hide();!e&&doHtml.find('[rel="remark_btn"]').hide();!e&&dg.Close();remarkCallback&&remarkCallback(e)}})})})});break;case"copyNote":var remark=attrHtml;Core.FileAPI.setClipboardData(remark,true);break;case"check_repeat_sha1":dg.Close();Core.FileAPI.sha1Dialog(item,true,source);break;default:dg.Close();if(menu==="open"){window.open("//115.com/storage/netdisk?cid="+$(this).attr("cid"))}else{if(main&&main.Events){main.Events.Do($(this),null)}}break}return false});doHtml.on("change","[show_play_long]",function(){var $t=$(this);var spl=$t.attr("show_play_long");var checked=this.checked;if(checked){spl=_data.show_play_long|spl}else{if(_data.show_play_long&spl){spl=spl^_data.show_play_long}}Core.FileAjax.EditShowPlayLong([fid],spl,function(rs){item.attr("ispl",spl);_data.show_play_long=spl;Core.MinMessage.Show({text:checked?"开启成功":"取消成功",type:"suc",timeout:2000});main&&main.SelectCommand.ToggleChange();ResetPlayLongText()});return false});dg.Open(function(){ResetPlayLongText()})})},setClipboardData:function(str,is_html){window.document.oncopy=function(event){if(is_html){event.clipboardData.setData("text/plain",htmlToText(str));event.clipboardData.setData("text/html",str)}else{event.clipboardData.setData("text/plain",str)}event.preventDefault();$.successTip("复制成功")};return window.document.execCommand("Copy",false,null)},sha1Dialog:function(el,backAttr,source){var sha1=el.attr("sha1");var file_id=el.attr("file_id");var $dom=$('<div class="dialog-msg">\n            <h3 style="padding:10px 0 10px 0px;"><span>'+sha1+'</span></h3>\n            <div class="dialog-msg-text">SHA1即是安全哈希算法,可以用来验证数据的完整性,也可以通过SHA1来查找重复文件!</div><n></n>            <div class="btn-wrap">\n                <a href="javascript:;" class="button btn-large" sha1btn="copySHA1" text="'+sha1+'"><span>复制SHA1</span></a>\n                <a href="javascript:;" class="button btn-large" sha1btn="check_repeat" text="'+sha1+'"><span>查找重复文件</span></a>\n            </div>        </div>');var ddg=new Core.DialogBase({title:"SHA1",content:$dom,width:600});var _Close=ddg.Close;ddg.Close=function(notReopenAttr){if(!notReopenAttr&&backAttr){Core.FileAPI.getAttribute(el)}_Close()};function loadTopCopy(cb){if(oofUtil.plug&&oofUtil.plug.copy){cb();return}$.getScript("//cdnassets.115.com/plug/copy/copy.js",function(){cb()})}ddg.Open(function(){loadTopCopy(function(){var $this=ddg.warp.find("[sha1btn=copy]");var $node=oofUtil.plug.copy.initNewCopy({btn_parent:$this,txt:function(){return sha1},suc:function(){Core.MinMessage.Show({text:"复制成功",type:"suc",timeout:2000});ddg.Close(true);return false}});if($node){$node=$($node);$node.css({position:"absolute",top:"0",left:"0"});$this.append($node)}$this.on("click",function(){return false})})});ddg.warp.on("click","[sha1btn]",function(){var type=$(this).attr("sha1btn");switch(type){case"copySHA1":var text=$(this).attr("text");Core.FileAPI.setClipboardData(text,true);break;case"check_repeat":Core.MinMessage.Show({text:"正在查找",type:"load",timeout:20000});$.ajax({url:WebApi+"/files/get_repeat_sha",data:{file_id:file_id},xhrFields:{withCredentials:true},dataType:"json",async:IS_115DOMAIN,type:"GET",success:function(r){Core.MinMessage.Hide();if(r.state){if(r.data.length>1){Core.MinMessage.Show({text:"查找成功",type:"suc",timeout:2000});ddg.Close(true);if(source&&source==="repeatFile"){window.open("//115.com/?mode=wangpan&tab=sha1_repeat&select=1&file_id="+file_id)}else{if(/\/\/115(rc)?\.com/i.test(location.href)){location.href="//115.com/?mode=wangpan&tab=sha1_repeat&select=1&file_id="+file_id}else{window.open("//115.com/?mode=wangpan&tab=sha1_repeat&select=1&file_id="+file_id)}}}else{Core.MinMessage.Show({text:"没有重复文件",type:"war",timeout:2000});ddg.Close()}}}});break}})}}})();$(function(){Core.FileAPI.GetDownPlugs(true)});Core.CountSync=(function(){var _rbDom,_count=0;return{Get:function(){return _count},Bind:function(rbDom){_rbDom=rbDom},Sync:function(){if(_rbDom){$.ajax({url:"?ct=rb&ac=get_num",type:"GET",cac
1he:false,dataType:"json",success:function(r){try{_count=r.count;_rbDom.html(Number(r.count)?r.count:"")}catch(e){}}})}}}})();var editorCallBack=function(content){var box=document.getElementById(Core.CONFIG.EditTextArea);if(box){box.value=content}};Core.FileDescDG=(function(){var _model=function(obj){var _self=this;var _cache_obj=obj;var _cache={};var oldDesc;var _content=$('<div class="editor-contents"><textarea id="'+Core.CONFIG.EditTextArea+'" style="display: none;" name=""></textarea><iframe id="js_ifrHtmlEditor" scrolling="no" style="position:relative;top:0;right:0;bottom:0;left:0;width:100%;height:100%;overflow:hidden;border-bottom:1px #eee solid;border-top:1px #eee solid;" frameborder="0" border="0" name="ifrHtmlEditor" src=""></iframe></div><div class="dialog-action"><div class="left-side"><div class="remarks-opt"><a href="javascript:;" class="btn-link"><span class="txt-blue" btn="copyNote">复制</span></a></div></div><a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');Core.DialogBase.call(this,{content:_content,title:_cache_obj.boxTitle||"文件备注",width:700});var _editorControl=(function(){var initState=false;var init=function(){if(!initState){initState=true;document.getElementById("js_ifrHtmlEditor").src="//115.com/"+Core.CONFIG.EditPath+"&bind="+Core.CONFIG.EditTextArea+"&_t="+new Date().getTime()}};return{Get:function(){var _ifrWin=document.getElementById("js_ifrHtmlEditor").contentWindow;if(_ifrWin){var _html=_ifrWin.UE_Editor.Get()||"";document.getElementById(Core.CONFIG.EditTextArea).value=_html}return document.getElementById(Core.CONFIG.EditTextArea).value},Set:function(content){init();document.getElementById(Core.CONFIG.EditTextArea).value=content;window.setTimeout(function(){document.getElementById("js_ifrHtmlEditor").src="//115.com/"+Core.CONFIG.EditPath+"&bind="+Core.CONFIG.EditTextArea+"&_t="+new Date().getTime()},10)},Height:function(value){if(value!=undefined){$("#js_ifrHtmlEditor").height(value)}else{return $("#js_ifrHtmlEditor").height()}}}})();var editRemark=function(params){var desc=params==="self"?"":_editorControl.Get();var data={fid:_cache_obj.file_id,file_desc:desc};UA$.ajax({url:"/files/edit",data:data,dataType:"json",type:"POST",success:function(r){if(params!=="self"){if(r.state){oldDesc=desc;Core.MinMessage.Show({text:"编辑成功",type:"suc",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow});if(!_cache_obj.noReload){if(_cache_obj.is_dir){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.UpdateDir({cid:data.fid,desc:data.file_desc})}}else{if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.UpdateFile({file_id:data.fid,desc:data.file_desc})}}}if(r.file_description==="<p></p>"){r.file_description="";editRemark("self")}_successCallback&&_successCallback(r.file_description);_self.Close({source:"edit"})}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow})}}}})};var closeFn=function(){$("#js_ifrHtmlEditor").attr("src","");_closeEvent();_cache_obj=false};this.Initial=function(){_editorControl.Height(310);_editDG.warp.addClass("property-editor");_content.find("[btn]").unbind("click").bind("click",function(){switch($(this).attr("btn")){case"confirm":editRemark();break;case"cancel":_self.Close();break;case"previewNote":break;case"copyNote":var text=_editorControl.Get();if(text){Core.FileAPI.setClipboardData(text,true)}else{Core.MinMessage.Show({text:"内容为空",type:"war",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow})}break}return false})};var _closeEvent=_self.Close;this.Close=function(params){var tem=$("<div></div>");tem.html(oldDesc);var activeHtml=_editorControl.Get().replace(/class=" /g,'class="');var oldHtml=tem[0].innerHTML.replace(/class=" /g,'class="');if(oldHtml!=activeHtml){setTimeout(function(){Core.Message.Confirm({title:"信息提示",text:"备注内容有变动,是否保存修改?",type:"war",callback:function(t){if(t){editRemark()}else{closeFn()}}})},500)}else{closeFn()}};this.SetValue=function(obj){_cache_obj=obj;oldDesc=obj.value;_editorControl.Set(obj.value)}};var _editDG;var _successCallback;return{Show:function(obj){console.log(112233);_successCallback=obj.callback;_editDG=new _model(obj);_editDG.Open(function(){_editDG.SetValue(obj)})},Close:function(){_editDG&&_editDG.Close()}}})();Core.FileReNameDG=(function(){var _mod,_callback;var _model=function(){var _self=this,_cache={};var _content=$('<div class="file-rename"><ul><li><div class="rename-ext"><input type="text" class="text" placeholder="输入名称" rel="file_name"><a href="javascript:;" class="btn-clear" rel="clear_name"><s>清空</s></a><span class="ext-name" rel="ext_name"></span></div></li><li rel="show_old_name" style="display:none;" class=""><a href="javascript:;" class="btn-origan" rel="old_name_btn" status="1"><span>原文件名</span></a><div class="rename-origan"><p rel="old_name"></p></div></li></ul></div><div class="dialog-action"><div class="left-side"><a href="javascript:;" btn="advance" class="button btn-line btn-large"><span>高级模式</span></a></div><a href="javascript:;" class="dgac-cancel" btn="cancel">取消</a><a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div>');Core.DialogBase.call(this,{content:_content,title:"重命名文件",width:500});var renameFun=function(){var title=$.trim(_content.find('[rel="file_name"]').val());if(title==""){Core.MinMessage.Show({text:"请输入文件名",type:"war",timeout:Core.CONFIG.MsgTimeout,window:_self});_content.find('[rel="file_name"]').focus();return false}var data={files_new_name:{}};var file_name=title+_cache.suffix;data.files_new_name[_cache.file_id]=file_name;var r=Util.Validate.FileName($.trim(file_name),_cache.suffix);if(r!==true){Core.MinMessage.Show({text:r,type:"err",timeout:Core.CONFIG.MsgTimeout});_content.find('[rel="file_name"]')[0].focus();return}_cache.shareId&&(data.share_id=_cache.shareId);UA$.ajax({url:"/files/batch_rename",type:"POST",data:data,dataType:"json",xhrFields:{withCredentials:true},success:function(r){if(r.state){Core.MinMessage.Show({text:"重命名成功",type:"suc",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow});var file_name=r.data[_cache.file_id];
1if(Core.FileConfig.DataAPI){var Nocheck=Core.getFileDataApiCheck("Nocheck");var UpdateFile=Core.getFileDataApiCheck("UpdateFile");Nocheck();var obj={file_id:_cache.file_id,file_name:file_name};if(UpdateFile!==Core.FileConfig.DataAPI.UpdateFile){try{Core.FileConfig.DataAPI.UpdateFile(obj)}catch(e){console.log(e,"UpdateFile error")}}UpdateFile(obj);setTimeout(function(){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.UpdateDir()}},1000)}if(_callback){_callback(r)}}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow})}}});_self.Close()};this.Initial=function(){var fileName=_content.find('[rel="file_name"]'),showOldName=_content.find('[rel="old_name_btn"]'),oldNameWarp=_content.find('[rel="show_old_name"]'),clear=_content.find('[rel="clear_name"]');fileName.on("keydown",function(e){if(e.keyCode==13){renameFun()}else{if(e.keyCode==27){_self.Close()}}oldNameWarp.show()}).on("input",function(){if(!fileName.val()){clear.hide()}else{if(clear.is(":hidden")){clear.show()}}});_content.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":renameFun();break;case"cancel":_self.Close();break;case"advance":if(_cache.seniorData){_self.Close();Core.ReNameMultiDG.Show(_cache.seniorData,function(r){if(_callback){_callback(r)}})}else{function getAttr($el){var obj={file_id:$el.attr("file_id")||$el.attr("cate_id"),file_name:$el.attr("title"),file_new_name:$el.attr("title"),file_type:$el.attr("file_type"),ico:$el.attr("ico"),iv:$el.attr("iv")||"",vdi:$el.attr("vdi")||"",path:$el.attr("path")||"",sha1:$el.attr("sha1")||""};if(!obj.ico&&obj.file_type=="0"){obj.ico="folder"}obj.file_category=obj.file_type=="0"?"0":"1";var vidConfig={1:"tp-video-sd",2:"tp-video-hd",3:"tp-video-fhd",4:"tp-video-1080p",5:"tp-video-4k",100:"tp-video-origin"};if(obj.iv==1){obj.ico=obj.ico+" "+(vidConfig[obj.vdi]||"")}return obj}_self.Close();var getOne=Core.getFileDataApiCheck("getOne");var node=getOne("",_cache.file_id);var data=[];data.push(getAttr(node));Core.ReNameMultiDG.Show(data,function(r){if(Core.FileConfig.DataAPI&&r){var UpdateFile=Core.getFileDataApiCheck("UpdateFile");UpdateFile({file_id:_cache.file_id,file_name:r.data[_cache.file_id]})}else{}})}break}return false});clear.on("click",function(){fileName.val("");oldNameWarp.show();clear.hide();return false}).show();showOldName.on("click",function(){var status=$(this).attr("status");if(status==1){oldNameWarp.addClass("rename-origan-fold");$(this).attr("status",0)}else{oldNameWarp.removeClass("rename-origan-fold");$(this).attr("status",1)}return false});oldNameWarp.hide().removeClass("rename-origan-fold")};this.SetValue=function(file_id,file_name,callback,shareId,seniorData){_cache.file_id=file_id;_cache.shareId=shareId;_cache.seniorData=seniorData;_callback=callback;var title=file_name;if(title.indexOf(".")!=-1){_cache.suffix=title.substring(title.lastIndexOf("."),title.length);title=title.substring(0,title.lastIndexOf("."))}else{_cache.suffix=""}var fileName=_content.find('[rel="file_name"]');var oldName=_content.find('[rel="old_name"]');var extName=_content.find('[rel="ext_name"]');if(_cache.suffix){extName.html(_cache.suffix).show()}else{extName.hide()}fileName.val(title);oldName.text(title||" ");window.setTimeout(function(){fileName.select()},20)}};return{Show:function(file_id,file_name,callback,shareId,seniorData){if(!_mod){_mod=new _model()}_mod.Open(function(){_mod.SetValue(file_id,file_name,callback,shareId,seniorData)})}}})();Core.ReNameMultiDG=(function(){var _mod,_callback;var _model=function(data,cb){_callback=cb;var html_url=__uri("//cdnassets.115.com/plug/batchRename/index.html?v=1785999762149");var $dom=$('<div class="header-side">\n                <a href="javascript:;" class="button btn-line"><span>历史记录</span></a>\n            </div>');var $btn=$('<div class="dialog-back" style="display: none;">\n                <a href="javascript:;" class="button btn-light"><i class="ibco-back"></i><s>按钮</s></a>\n            </div>');var dg=Core.FrameDG.Open(html_url,{title:"批量重命名",width:1000,height:600,ready:function(win){win.batchRenameInit(setting);dg.warp.find("[rel=title_box]").append($dom);
1dg.warp.find("[rel=title_box]").prepend($btn);$dom.on("click",function(){$dom.hide();win.changeBatchStep&&win.changeBatchStep("batchRenameHistory")});$btn.on("click",function(){win.changeBatchStep&&win.changeBatchStep("batchRename")})},is_hide_back:true,callback:function(){if(Core.FileConfig.DataAPI&&setting.shouldReload){if(_callback){_callback(setting.editResult)}else{var Refresh=Core.getFileDataApiCheck("Refresh");Refresh()}}else{_callback&&_callback(setting.editResult)}}});var setting={data:data,successCallback:function(json){setting.editResult=json;dg.Close()},errorCallback:function(){},changeTitle:function(step,text){if(step=="batchRename"){$dom.show();$btn.hide()}else{$dom.hide();$btn.show()}dg.warp.find("[rel=base_title]").text(text)},DialogClose:dg.Close,shouldReload:false};return;var renameFun=function(){var title=$.trim(_content.find('[rel="file_name"]').val());var start_value=$.trim(_content.find('[rel="start_value"]').val());if(title==""){Core.MinMessage.Show({text:"请输入文件名",type:"war",timeout:Core.CONFIG.MsgTimeout,window:_self});_content.find('[rel="file_name"]').focus();return false}var data={ids:_cache.file_id,file_rename:title};if(start_value){if(!/^\d+$/.test(start_value)){Core.MinMessage.Show({text:"起始数字只能为纯数字",type:"war",timeout:Core.CONFIG.MsgTimeout,window:_self});return false}else{data.start_value=start_value}}var r=Util.Validate.FileName($.trim(data.file_rename));if(r!==true){Core.MinMessage.Show({text:r,type:"err",timeout:Core.CONFIG.MsgTimeout});_content.find('[rel="file_name"]')[0].focus();return}var Numtrans=function(val,i){if(!val){return i+1}else{var strNum=val.toString();var Zero=strNum.match(/^0+/);if(Zero){Zero=Zero[0]}else{Zero=""}return Zero+(Number(data.start_value)+i)}};UA$.ajax({url:"//webapi."+document.domain+"/files/batch_rename",data:data,dataType:"JSON",type:"POST",xhrFields:{withCredentials:true},success:function(r){if(r.state){Core.MinMessage.Show({text:"重命名成功",type:"suc",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow});if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Refresh()}}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout,window:Core.CONFIG.FileWindow})}}});_self.Close()};this.Initial=function(){var fileName=_content.find('[rel="file_name"]'),cover=_content.find('[rel="b_text"]'),startValue=_content.find("[rel='start_value']"),clear=_content.find("#js_clear");fileName.on("keydown",function(e){if(e.keyCode==13){renameFun()}else{if(e.keyCode==27){_self.Close()}}});startValue.on("keydown",function(e){if(e.keyCode==13){renameFun()}else{if(e.keyCode==27){_self.Close()}}});_content.find("[btn]").on("click",function(e){switch($(this).attr("btn")){case"confirm":renameFun();break;case"cancel":_self.Close();break}return false});clear.on("click",function(){fileName.val("");cover.text("");clear.hide();return false}).hide();fileName.on("input",function(){var text=$(this).val();cover.text(text);if(!text){clear.hide()}else{clear.show()}})};this.SetValue=function(file_id){var fileName=_content.find('[rel="file_name"]');_cache.file_id=file_id;_cache.fid_arr=file_id.split(",");_content.find(":input").val("");_content.find('[rel="b_text"]').text("");window.setTimeout(function(){fileName.select()},20)}};return{Show:function(data,callback){_model(data,callback)}}})();Core.FileDialogApi=(function(){var fileDG,transDG,currentDialogType="upload";var CoreFrameFileMain;function bindKeydownEvent(win){$(win.document).on("keydown",function(e){if(e.keyCode==27){fileDG&&fileDG.Close();transDG&&transDG.Close();return false}})}return{OpenFileListDialog:function(type,setting){if(!type){type="star"}var baseHtml='<div class="wrap-vflow">    <div class="main-vflow" warp="frame">        <iframe rel="iframe" src="" frameborder="0"></iframe>    </div></div>';var $dom=$(baseHtml);var $allTitle=$dom.find("[tab]"),$iframe=$dom.find("iframe"),$listMenu=$dom.find("[rel=task_list_tvf]"),$moreMenu=$dom.find("[rel=more_menu]"),timerFrame;function setIframeUrl(url,callback){timerFrame&&clearTimeout(timerFrame);$listMenu.off("click mouseenter mouseleave");$iframe.off("load").on("load",function(win){var win=this.contentWindow;var doc=this.contentDocument;bindKeydownEvent(win);timerFrame&&clearTimeout(timerFrame);timerFrame=setTimeout(function(){callback&&callback(win,doc)},50)}).attr("src",url+"&iframe=1");$iframe.off("unload").on("unload",function(e){console.log("frameUnload")})}switch(type){case"star":setIframeUrl("/?ct=file&ac=userfile&tpl=view_large&s=0&is_wl_tpl=1&aid=1&cid=0&tab=star",function(win,doc){win.MainFileWindowGoToDir=function(){CoreFrameFileMain.GotoDir.apply(null,arguments);fileDG.Close()}});break;
1case"recent_view":setIframeUrl("//115.com/?ct=file&ac=userfile&is_wl_tpl=1&show_looked=1");break;case"shared_list":setIframeUrl("//115.com/?ct=public_share&ac=my");break;case"rb":setIframeUrl("//115.com/?ct=rb&is_wl_tpl=1&from="+(setting&&setting.from),function(win,doc){win.MainFileWindowGoToDir=function(){CoreFrameFileMain.GotoDir.apply(null,arguments);fileDG.Close()}});break;default:break}fileDG&&fileDG.Close();fileDG=new Core.DialogBase({content:$dom});fileDG.Open(function(){fileDG.warp.removeClass().addClass("dialog-box dialog-arena").css({top:"",left:""});fileDG.warp.find("[rel=title_box]").remove();setTimeout(function(){fileDG.warp.css({"z-index":"999999"});fileDG.warp.parent().find(".dialog-back-mask").css({"z-index":"999998"})},20)})},OpenTransferTabDialog:function(type){if(!type){type="receive"}var baseHtml='<div class="wrap-vflow">    <div class="top-vflow with-btmline in-dialog" id="fileDialogWrap">        <div class="left-tvf">            <div class="navigation-sup">                <a href="javascript:;" tab="upload" ><span>上传</span></a>                <a href="javascript:;" tab="save"><span>接收</span></a>                <a href="javascript:;" tab="offline_task" ><span>云下载</span></a>            </div>        </div>        <div class="right-tvf" style="display: none;" rel="upload_list_tvf"><div class="operate-uploadlink">                            <a href="javascript:;" menu="refurbish"><i class="icon-upload-refresh"></i><span>刷新</span></a>                            <a href="javascript:;" menu="clean"><i class="icon-upload-clean"></i><span>清空所有任务</span></a>                        </div>         <a href="javascript:;" class="button" menu="upload"><i class="icon-operate ifo-upload"></i><span>上传</span></a>       </div>        <div class="right-tvf" style="display: none;" rel="receive_list_tvf">                        <div class="operate-uploadlink">                            <a href="javascript:;" menu="receiveClear" style="display: none;"><i class="icon-upload-clean"></i><span>清空</span></a>                            <a href="javascript:;" menu="receiveRefurbish"><i class="icon-upload-refresh"></i><span>刷新</span></a>                        </div>                    </div>        <div class="right-tvf" style="display: none;" rel="receive_list_del">                        <div class="operate-uploadlink">                            <a href="javascript:;" menu="receiveDelete"><i class="icon-upload-clean"></i><span>删除</span></a>                            <a href="javascript:;" menu="receiveCancel"><i class="icon-upload-cancel"></i><span>取消</span></a>                        </div>                    </div>        <div class="right-tvf" style="display: none;" rel="task_list_tvf">                        <a href="javascript:;" class="button btn-line btn-upload" menu="add_offline_link" style="/* display: none; */"><i class="icon-operate ifo-linktask"></i><span>云下载</span></a>                        <div class="operate-uploadlink">                            <a href="/?ct=report&rules=1&gift_code=yundown" target="_blank" ><i class="icon-upload-report"></i><span>举报</span></a>                            <a href="javascript:;" menu="refurbish"><i class="icon-upload-refresh"></i><span>刷新</span></a>                            <a href="javascript:;" menu="clear"><i class="icon-upload-clean"></i><span>清空</span><i class="icon-upload-arrow"></i></a>                        </div>                    </div>    </div>    <div class="main-vflow" warp="frame">        <iframe rel="iframe" src="" frameborder="0"></iframe>    </div> <div class="context-menu menu-upward" style="display: none;"  rel="more_menu">        <div class="cell-icon">            <ul rel="list">                <li>                    <a menu="clear_done" index="0" href="javascript:;">                        <span>清空已完成</span>                    </a>                </li>                <li>                    <a menu="clear_fail" index="1" href="javascript:;">                        <span>清空已失败</span>                    </a>                </li>                <li>                    <a menu="clear_ing" index="2" href="javascript:;">
1                        <span>清空进行中</span>                    </a>                </li>                <li>                    <a menu="clear_all" index="3" href="javascript:;">                        <span>清空全部</span>                    </a>                </li>            </ul>        </div>    </div></div>';var $dom=$(baseHtml);var $allTitle=$dom.find("[tab]"),$iframe=$dom.find("iframe"),$listMenu=$dom.find("[rel=task_list_tvf]"),$receiveListMenu=$dom.find("[rel=receive_list_tvf]"),$receiveListDel=$dom.find("[rel=receive_list_del]"),$uploadMenu=$dom.find("[rel=upload_list_tvf]"),$moreMenu=$dom.find("[rel=more_menu]"),timerFrame;function setIframeUrl(url,callback){timerFrame&&clearTimeout(timerFrame);$listMenu.off("click mouseenter mouseleave");$receiveListMenu.off("click mouseenter mouseleave");$receiveListDel.off("click mouseenter mouseleave");$iframe.off("load").on("load",function(win){var win=this.contentWindow;var doc=this.contentDocument;bindKeydownEvent(win);timerFrame&&clearTimeout(timerFrame);timerFrame=setTimeout(function(){callback&&callback(win,doc)},50)}).attr("src",url+"&file_dialog_iframe=1");$iframe.off("unload").on("unload",function(win){Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Refresh&&Core.FileConfig.DataAPI.Refresh()})}var isGet=false,reciveCid;function getReciveCid(callback){if(isGet){return}isGet=true;if(!reciveCid){$.ajax({url:"//webapi.115.com/files/getid?path=我的接收",type:"GET",dataType:"json",xhrFields:{withCredentials:true},success:function(r){reciveCid=r.id+""},error:function(){reciveCid="0"},complete:function(){isGet=false;setTimeout(function(){callback()},100)}})}else{isGet=false;callback()}}function bindEvent(){$dom.on("click","[tab]",function(e){var $title=$(this);var key=$title.attr("tab");$allTitle.removeClass("current");$title.addClass("current");$listMenu.hide();$receiveListMenu.hide();$receiveListDel.hide();$uploadMenu.hide();currentDialogType=key;switch(key){case"receive":getReciveCid(function(){setIframeUrl("/?ct=file&ac=userfile&tpl=view_large&is_wl_tpl=1&tab=recive&cid="+reciveCid)});break;case"save":$receiveListMenu.show();setIframeUrl("/?ct=public_share&ac=save",function(win,doc){$receiveListMenu.on("click","[menu]",function(){var menu=$(this).attr("menu");
1switch(menu){case"receiveClear":Core.Message.Confirm({type:"war",text:"确定要清空所有记录",content:"仅删除记录,不会删除云端文件",callback:function(r){if(r){$('[rel="base_content"]').find('[rel="iframe"]')[0].contentWindow.methods.cleanList()}}});break;case"receiveRefurbish":$('[rel="base_content"]').find('[rel="iframe"]')[0].contentWindow.methods.updateList();break}});$receiveListDel.on("click","[menu]",function(){var menu=$(this).attr("menu");switch(menu){case"receiveDelete":Core.Message.Confirm({type:"war",text:"确定要删除选中的接收记录",content:"仅删除记录,不会删除云端文件",callback:function(r){if(r){$('[rel="base_content"]').find('[rel="iframe"]')[0].contentWindow.methods.batchDel()}}});break;case"receiveCancel":$('[rel="base_content"]').find('[rel="iframe"]')[0].contentWindow.methods.cancelDel();break}})});break;case"offline_task":$listMenu.show();setIframeUrl("//115.com/?ct=index&ac=offline_new_tpl&offline=1",function(win,doc){$listMenu.add($moreMenu).off("click").on("click","[menu]",function(){var $this=$(this),menu=$this.attr("menu");switch(menu){case"add_offline_link":if(top.window.Core.OFFL5Plug){top.window.Core.OFFL5Plug.OpenLink()}else{top.$.getScript(__uri("//cdnres.115.com/site/static/plug/offline_wl/offline5.0.js"),function(){top.Core.OFFL5Plug.AddClient({});top.window.Core.OFFL5Plug.OpenLink(null,"/?tab=offline&mode=wangpan")})}break;case"clear":break;default:$('[menu="'+menu+'"]',doc)[0].click();break}return false})});break;case"upload":$uploadMenu.show();setIframeUrl("//115.com/?ct=index&ac=offline_new_tpl&offline=0",function(win,doc){$dom.find('[rel="upload_list_tvf"]').find("[menu=clean],[menu=refurbish]").off("click").on("click",function(){var $this=$(this),menu=$this.attr("menu");switch(menu){case"clean":win.CleanAllTask&&win.CleanAllTask();break;case"refurbish":win.RefreshPage&&win.RefreshPage();break}return false})});break;default:break}});$dom.on("click","[menu=upload]",function(){Ext.Common.Upload()})}bindEvent();$dom.find("[tab="+type+"]").click();transDG=new Core.DialogBase({content:$dom});transDG.Open(function(){transDG.warp.removeClass().addClass("dialog-box dialog-arena").css({top:"",left:""});transDG.warp.find("[rel=title_box]").remove();var zindex=Core.WinHistory.GetIndex();setTimeout(function(){transDG.warp.css({"z-index":zindex});transDG.warp.parent().find(".dialog-back-mask").css({"z-index":zindex-1})},20);Util.DropDown.Bind({Title:$listMenu.find('[menu="clear"]'),Content:$moreMenu,IsOverShow:true,ShowHandler:function(){var offset=this.Title.offset();offset.left-=$dom.offset().left;this.Content.css(offset)}})})},Bind:function(box,winmain){if(winmain){CoreFrameFileMain=winmain}box.off("click","[file_dialog_menu]").on("click","[file_dialog_menu]",function(e){var type=$(this).attr("file_dialog_menu");switch(type){case"upload":var status=$(this).find('[task_popup="red_dot"]').attr("status");var success=$(this).find('[task_popup="red_dot"]').attr("success");if(status==-1||status==0||status==1||status==2&&+success!==1){currentDialogType="offline_task"}else{currentDialogType="upload"}if(+success===1&&status!=-1||status!=0||status!=1||status!=2){$(this).find('[task_popup="red_dot"]').removeAttr("success");$(this).find('[task_popup="red_dot"]').hide()}Core.FileDialogApi.OpenTransferTabDialog("upload");break;case"shared_list":case"recent_view":case"star":case"rb":Core.FileDialogApi.OpenFileListDialog(type);break}return false})},CloseFileListDialog:function(flag){fileDG&&fileDG.Close()},CloseTransferTabDialog:function(){transDG&&transDG.Close()},fileDG:fileDG,transDG:transDG}})();Core.FileSelectDG=(function(){var _dirCacheAid,_dirCacheCid,_dirCacheCname,_dirCachePath,_paths,_api=false;var _DG;var IS_115DOMAIN=/115(rc)?\.com/.test(location.href);var SITE_URL=IS_115DOMAIN?"//115.com":"/site";var _model=function(){var _self=this,_cache={disClass:"btn-disabled"};var _content=$('<div><div class="dialog-frame"><iframe src="" frameborder="0" rel="js_iframe" style="height: 100%;"></iframe></div><div class="select-footer" rel="check_save_path_warp" style="display: none;">\n        <div class="path-select">\n            <label class="sel-label" for="js_check_save_file_path" rel="check_save_path_warp"><input type="checkbox" id="js_check_save_file_path" rel="check_save_path" style="display: ;"><span>最近保存路径:<em></em></span></label>\n        </div>\n</div><div class="dialog-action"><div class="left-side">'+(Core.Dir?'<a href="javascript:;"  class="button btn-large btn-line" btn="add_dir"><i class="icon-operate ifo-newdir"></i><span>新建文件夹</span></a> ':"")+'<a href="javascript:;" class="button btn-large btn-line" btn="dir_record"><i class="icon-operate ifo-recently"></i><span>最近移动记录</span></a></div><span id="js_selec_file_check_count" style="float: none;font-size: 14px;padding-right: 25px;text-align: center;line-height: 38px;display:none;">选中0个文件(夹)</span>
1<label for="js_selec_file_check_all" is_all="1" rel="check_all" style="color:#00a8ff;cursor:pointer;font-size:14px;padding-right:20px;line-height:38px;">全选</label> <a href="javascript:;" class="dgac-confirm" btn="confirm">确定</a></div></div>');Core.DialogBase.call(this,{title:"请选择文件",content:_content,width:700});var _frame=_content.find("[rel='js_iframe']");var changeURL=function(aid,cid,opt){var select=0,filter="",nf="",select_dir="",not_select_file="";if(opt){select=opt.select_one?1:0;filter=opt.filter?opt.filter:"";nf=opt.nf?opt.nf:"";max_size=opt.max_size?opt.max_size:"";select_dir=opt.select_dir?1:0;not_select_file=opt.not_select_file?opt.not_select_file:""}_api=false;var url=SITE_URL+"/?ct=file&ac=userfile&ajax=1&select="+select+"&nf="+nf+"&filter="+filter+"&select_dir="+select_dir+"&aid="+aid+"&cid="+cid+"&max_size="+max_size+"&nsf="+not_select_file+"&_t="+new Date().getTime()+(opt&&opt.order?"&o="+opt.order:"");_frame.attr("src","");_frame.attr("src",url)};this.Initial=function(){_self.warp.addClass("file-select");var _tipTop="";if(_cache.showTopTip){_tipTop='<div class="promptbar-caution promptbar-invflow" style="float: left;background: none;padding: 0;font-size: 12px;line-height: 32px;"><p>请遵循<a href="//cdnres.115.com/site/static/plug/public_share/protocol_share.html" target="_blank">服务协议</a>!严禁存储、传播违法违规信息!</p></div>'}var $head=$('<div class="header-side">'+_tipTop+'    <!-- !文件搜索 -->    <div class="search-box" rel="search_box" style="overflow: hidden;">        <form>            <input type="text" rel="search_input"  autocomplete="off" placeholder="搜索文件夹">            <button type="submit"><i>搜索</i></button>        </form>    </div>    <!-- !文件筛选 -->    <div class="search-file-filter" rel="filter_box" style="display: none">        <a href="javascript:;" class="ff-select" rel="tab"><i class="icon-filter if-all"></i><span>全部</span><s></s></a>        <div class="ff-list" style="display: none;" rel="con">            <ul>                <li><a href="javascript:;" val="0"><i class="icon-filter if-all"></i><span>全部</span></a></li>                <li><a href="javascript:;" val="star"><i class="icon-filter if-star"></i><span>星标</span></a></li>                <li><a href="javascript:;" val="4"><i class="icon-filter if-video"></i><span>视频</span></a></li>                <li><a href="javascript:;" val="2"><i class="icon-filter if-photo"></i><span>图片</span></a></li>                <li><a href="javascript:;" val="3"><i class="icon-filter if-music"></i><span>音频</span></a></li>                <li><a href="javascript:;" val="1"><i class="icon-filter if-document"></i><span>文档</span></a></li>                <li><a href="javascript:;" val="6"><i class="icon-filter if-application"></i><span>应用</span></a></li>                <li><a href="javascript:;" val="5"><i class="icon-filter if-archive"></i><span>压缩包</span></a></li>            </ul>        </div>    </div>    <!-- !列表模式 -->    <div class="search-file-mode" rel="view_type_box" style="display: none">        <a href="javascript:;" rel="list" class="button btn-light" ><i class="icon-fsd-list"></i><span>列表</span></a>        <a href="javascript:;" rel="view" class="button btn-light" style="display:none;"><i class="icon-fsd-thumb"></i><span>图标</span></a>    </div></div>');_self.warp.find("[rel=title_box]").append($head);function getApi(){var api=(_frame[0].contentWindow||_frame[0].window);return api&&api.FS_PAGE_API}function checkSetCallback(){var api=getApi();checkSetCallback.timer&&clearTimeout(checkSetCallback.timer);if(api){api.SetCallback(function(type,arg){if(type=="SELECT_DIR"){var path=arg[4][arg[4].length-1];if(path.aid!=-3||path.name!="搜索结果"){$head.find("[rel=search_input]").val("")}if(path.aid!=-3||path.name!="最近移动记录"){_self.warp.find("[btn=confirm]").removeClass("btn-disabled")}}if(type=="CHANGE_TYPE"){$head.find('[rel="filter_box"]').find('[rel="tab"]').html($head.find('[rel="filter_box"]').find('[val="'+arg[0]+'"]').html()+"<s></s>")}if(type=="CHANGE_VIEW"){$head.find("[rel=view_type_box]").find("[rel]").show().filter("[rel="+arg[0]+"]").hide()}});$head.find("[rel=view_type_box]").show().find("[rel]").show().filter("[rel="+api.GetCurrListView()+"]").hide()}else{checkSetCallback.timer=setTimeout(function(){checkSetCallback()},16)}}_frame.on("load",function(){checkSetCallback()});$head.mousedown(function(e){e.stopPropagation()});$head.find("form").on("submit",function(){var api=getApi();if(api){api.Search($head.find("[rel=search_input]").val())}return false});$head.find("[rel=view_type_box]").on("click","[rel]",function(){var rel=$(this).attr("rel");var api=getApi();if(api){api.ChangeListView(rel);$head.find("[rel=view_type_box]").find("[rel]").show();$(this).hide()}return false});Util.DropDown.Bind({Title:$head.find('[rel="filter_box"] [rel="tab"]'),Content:$head.find('[rel="filter_box"] [rel="con"]'),IsOverShow:true});$head.find('[rel="filter_box"] [val]').on("click",function(){var el=$(this);var val=el.attr("val");var api=getApi();if(api){api.ChangeType(val)}$head.find('[rel="filter_box"] [rel="con"]').hide();return false});window.DBLClick_BACK=function(node){_cache.list=[node];_content.find("[btn='confirm']").click()};_self.warp.find('[for="js_selec_file_check_all"]').on("click",function(){if(_api.SelectAll){if($(this).attr("is_all")==1){var arr=_api.SelectAll();_DG&&_DG.ListCheck(_self.warp,arr)}else{_api.CancelSelect();_DG&&_DG.CancelCheck(_self.warp)}}});
1_content.find("[btn]").off("click").on("click",function(){if($(this).is(".btn-disabled")){return false}switch($(this).attr("btn")){case"add_dir":if(_dirCacheAid){Core.Dir.Create(_dirCacheAid,_dirCacheCid,function(r){if(r.state){Core.MinMessage.Show({text:"新建成功",type:"suc",timeout:2000});window.setTimeout(function(){changeURL(_dirCacheAid,r.cid,{select_one:_cache.select_one,filter:_cache.filter,nf:_cache.nf,max_size:_cache.max_size,order:_cache.order||null})},500)}})}break;case"confirm":var $saveFileCheck=_self.warp.find("#js_check_save_file_path");var checkDefaultSaveFilePath=_cache.saveFilePathData&&_cache.saveFilePathData.cid&&$saveFileCheck.prop("checked")&&_cache.select_one;if(_cache.nf){if(_dirCacheAid===false){Core.MinMessage.Show({text:"请等待进入文件夹",timeout:Core.CONFIG.MsgTimeout,window:_self});return}}else{if(!_cache.not_select_file){if(!_cache.list||!_cache.list.length&&!checkDefaultSaveFilePath){Core.MinMessage.Show({text:"请选择文件",timeout:Core.CONFIG.MsgTimeout,window:_self});return}}}switch(_cache.type){case"cover":Core.FileAjax.EditCover(_cache.cover_aid,_cache.cover_cid,_cache.list[0].attr("file_id"),function(r){if(r.state){Core.MinMessage.Show({text:"修改成功",type:"suc",timeout:Core.CONFIG.MsgTimeout});if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.EditCover({cate_id:_cache.cover_cid,img_url:r.img_url})}}else{Core.MinMessage.Show({text:r.msg,type:r.errtype||"err",timeout:Core.CONFIG.MsgTimeout})}_self.Close()});break;case"msg":var arr=[];if(_cache.nf){arr.push({aid:_dirCacheAid,cid:_dirCacheCid,cname:_dirCacheCname,path:_dirCachePath})}else{if(_cache.list&&_cache.list.length){for(var i=0,len=_cache.list.length;i<len;i++){var item=_cache.list[i];if(item.attr("file_type")=="1"){arr.push({file_id:item.attr("file_id"),file_size:item.attr("file_size"),file_name:item.find('[field="file_name"]').attr("title"),aid:item.attr("area_id"),cid:item.attr("p_id"),ico:item.attr("ico"),sha1:item.attr("sha1"),pick_code:item.attr("pick_code"),path:item.attr("path")})}else{if(_cache.select_dir){arr.push({aid:item.attr("area_id"),cid:item.attr("cate_id"),cate_name:item.attr("cate_name"),pick_code:item.attr("pick_code"),is_dir:1})}else{arr.push({aid:item.attr("area_id"),cid:item.attr("cate_id")})}}}}else{arr.push({aid:_dirCacheAid,cid:_dirCacheCid,cname:_dirCacheCname,path:_dirCachePath})}}var list=checkDefaultSaveFilePath?[{cid:_cache.saveFilePathData.cid}]:arr;if(arr.length==1&&arr[0].cid=="0"&&(arr[0].cname=="搜索结果"||arr[0].cname=="最近移动记录")){Core.MinMessage.Show({text:"请选择文件夹",timeout:Core.CONFIG.MsgTimeout,window:_self});return}_self.Callback&&_self.Callback(list,false);window.setTimeout(function(){_self.Close()},10);break;default:var list=checkDefaultSaveFilePath?[{cid:_cache.saveFilePathData.cid}]:_cache.list;_self.Callback&&_self.Callback(list,false);window.setTimeout(function(){_self.Close()},10);break}break;case"cancel":_self.Close();break;case"dir_record":var api=getApi();if(api){api.ShowDirRecord()}break}return false});var oldAid=1,oldCid=0;var oldCookie=Util.Cookie.get("SEL_F_DIR");if(_cache.init_cid){oldCid=_cache.init_cid}else{if(oldCookie){var oldArr=oldCookie.split("|");if(oldArr.length==2){oldAid=Number(oldArr[0]);oldCid=Number(oldArr[1])}}}if(_cache.nf){_self.warp.find("[btn='add_dir']").show()}else{_self.warp.find("[btn='add_dir']").hide()}if(_cache.saveFilePathData&&_cache.saveFilePathData.cid){_self.warp.find("[rel=check_save_path_warp]").show();_self.warp.find("[rel=check_save_path_warp] em").text((_cache.saveFilePathData.cid=="0"?"":"/")+_cache.saveFilePathData.file_name)}else{_self.warp.find("[rel=check_save_path_warp]").hide()}var copyInput=_self.warp.find("input[rel='copy']");copyInput.prop("checked",false);if(_cache.show_copy){_self.warp.find("[rel='copy']").show()}else{_self.warp.find("[rel='copy']").hide()}if(_cache.nf||_cache.filter){$head.find('[rel="filter_box"]').hide()}else{$head.find('[rel="filter_box"]').show()}changeURL(oldAid,oldCid,{select_one:_cache.select_one,filter:_cache.filter,nf:_cache.nf,max_size:_cache.max_size,select_dir:_cache.select_dir,not_select_file:_cache.not_select_file,order:_cache.order||null})};this.Setting=function(obj){_cache.saveFilePathData=obj.saveFilePathData;_cache.init_cid=obj.init_cid;_cache.list=false;_cache.users=obj.users;_cache.type=obj.type;_cache.cover_cid=obj.cover_cid;_cache.cover_aid=obj.cover_aid;_cache.hide_aids=obj.hide_aids;_cache.select_one=obj.select_one;_cache.filter=obj.filter;_cache.nf=obj.nf;_cache.max_size=obj.max_size;_cache.select_dir=obj.select_dir;_cache.show_copy=obj.show_copy;_cache.show_record=obj.show_record;_cache.is_talk=obj.is_talk;_cache.qcid=obj.qcid;_cache.btn_txt=obj.btn_txt;_cache.select_txt=obj.select_txt;_cache.title=obj.title;
1_cache.showTopTip=obj.showTopTip;_cache.not_select_file=obj.not_select_file;if(obj.order){_cache.order=obj.order}};var _closeEvent=_self.Close;this.Close=function(){_frame.attr("src","");_closeEvent();_self.Callback=false};var _openEvent=_self.Open;this.ListCheck=function(_content,arr){var $this=_self.warp.find('[for="js_selec_file_check_all"]');var $count=_content.find("#js_selec_file_check_count");var maxCount=$this.attr("total")*1;var ma=0;for(var i=0;i<arr.length;i++){var item=arr[i];if(item.attr("file_id")&&item.attr("file_id")!=0){ma++}}$count.text("已选中"+arr.length+"个文件"+(ma<arr.length?"(夹)":""));if(arr.length){$count.show();if(arr.length>=maxCount){$this.text("全不选");$this.removeAttr("is_all")}else{$this.text("全选");$this.attr("is_all",1)}}else{$count.hide();$this.text("全选");$this.attr("is_all",1)}};this.CancelCheck=function(_content){_content.find('[for="js_selec_file_check_all"]').attr("is_all",1).text("全选");_content.find("#js_selec_file_check_count").hide().text("已选中0个文件(夹)")};this.Open=function(){_dirCacheAid=false;_dirCacheCid=false;_openEvent();if(_cache.nf){_self.warp.find('[rel="base_title"]').html("打开要"+_cache.select_txt+"的目标文件夹");_self.warp.find('[btn="confirm"]').html(_cache.btn_txt)}else{_self.warp.find('[rel="base_title"]').html("请选择文件");_self.warp.find('[btn="confirm"]').html("确定")}if(_cache.title){_self.warp.find('[rel="base_title"]').html(_cache.title)}if(_cache.select_one||_cache.nf){_self.warp.find("[rel='check_all']").hide()}else{_self.warp.find("[rel='check_all']").show()}if(_cache.show_record){_self.warp.find("[btn='dir_record']").show()}else{_self.warp.find("[btn='dir_record']").hide()}};this.Set=function(arr){_cache.list=arr;this.ListCheck(_self.warp,arr)};this.Callback=false};return{OpenByMsg:function(callback,opt){if(!_DG){_DG=new _model()}var setting={type:"msg"};if(opt){setting.select=opt.select?1:0;setting.filter=opt.filter?opt.filter:"";setting.select_dir=opt.select_dir?1:0}_DG.Setting(setting);_DG.Open();_DG.Callback=callback},Open:function(callback,opt){if(!_DG){_DG=new _model()}var setting={type:"msg"};if(opt){setting.select=opt.select?1:0;setting.filter=opt.filter?opt.filter:"";setting.nf=opt.nf?opt.nf:"";setting.max_size=opt.max_size?opt.max_size:"";setting.select_dir=opt.select_dir?1:0;setting.select_one=opt.select_one?1:0;setting.saveFilePathData=opt.saveFilePathData;setting.init_cid=opt.init_cid||"";setting.btn_txt=opt.btn_txt?opt.btn_txt:"移动到这里";setting.select_txt=opt.select_txt?opt.select_txt:"移动";setting.title=opt.title?opt.title:"";setting.not_select_file=opt.not_select_file?opt.not_select_file:"";if(opt.order){setting.order=opt.order}setting.show_copy=opt.show_copy;setting.show_record=opt.show_record;setting.showTopTip=opt.showTopTip||0}_DG.Setting(setting);_DG.Open();try{_DG.CancelCheck(_DG.warp)}catch(e){}_DG.Callback=callback;return _DG},Show:function(users,callback){if(!_DG){_DG=new _model()}_DG.Setting({users:users,type:"send"});_DG.Open();_DG.Callback=callback},EditCover:function(aid,cid){if(!_DG){_DG=new _model()}var setting={type:"cover",select:1,filter:2,cover_aid:aid,cover_cid:cid};if(Number(aid)!=999){Util.Cookie.set("SEL_F_DIR",aid+"|"+cid,24)}_DG.Setting(setting);_DG.Open()},Select:function(arr){if(_DG){_DG.Set(arr)}},MarkDir:function(aid,cid){if(Number(aid)!=999){Util.Cookie.set("SEL_F_DIR",aid+"|"+cid,24)}},SelectDir:function(aid,cid,cname,path){_dirCacheAid=aid;_dirCacheCid=cid;_dirCacheCname=cname;_dirCachePath=path;if(_DG){_DG.CancelCheck(_DG.warp)}},BackPaths:function(paths){_paths=paths},MainAPI:function(api){_api=api;if(_DG){_DG.CancelCheck(_DG.warp)}},GetBackPaths:function(){return _paths},Close:function(){if(_DG){_DG.Close()}}}})();Core.QFileSelectDG=(function(){var _dirCacheCid,_dirCacheCname,_dirCachePath,_paths,_api=false,_qid;var _model=function(){var _self=this,_cache={disClass:"btn-disabled"};var _content=$('<div><div class="dialog-frame"><iframe src="" frameborder="0" rel="js_iframe"></iframe></div><div class="dialog-bottom"><div class="con"><input type="checkbox" id="js_selec_qfile_check_all" rel="check_all"><label for="js_selec_qfile_check_all" rel="check_all">全选</label> <a href="javascript:;" class="button" btn="confirm">确定</a></div></div></div>');Core.DialogBase.call(this,{title:"请选择圈子文件",content:_content});var _frame=_content.find("[rel='js_iframe']");var changeURL=function(cid,opt){var select=0,filter="",nf="",select_dir="",not_select_file="";if(opt){select=opt.select_one?1:0;filter=opt.filter?opt.filter:"";nf=opt.nf?opt.nf:"";select_dir=opt.select_dir?1:0;not_select_file=opt.not_select_file?opt.not_select_file:""}
1_api=false;var url=Core.CONFIG.Path.G+"/"+_qid+"/space?is_sel=1&select="+select+"&nf="+nf+"&filter="+filter+"&select_dir="+select_dir+"&cid="+cid+"&nsf="+not_select_file+"&_t="+new Date().getTime();_frame.attr("src","");_frame.attr("src",url)};this.Initial=function(){_self.warp.addClass("file-select");window.DBLClick_BACK_Q=function(node){_cache.list=[node];_content.find("[btn='confirm']").click()};_self.warp.find("[rel='check_all']").on("click",function(){if(_api.SelectAll){$(this).attr("checked")?_api.SelectAll():_api.CancelSelect()}});_content.find("[btn]").off("click").on("click",function(){switch($(this).attr("btn")){case"confirm":if(_cache.nf){if(_dirCacheCid===false){Core.MinMessage.Show({text:"请等待进入文件夹",timeout:Core.CONFIG.MsgTimeout,window:_self});return}}else{if(!_cache.not_select_file){if(!_cache.list||!_cache.list.length){Core.MinMessage.Show({text:"请选择圈子文件",timeout:Core.CONFIG.MsgTimeout,window:_self});return}}}var arr=[];if(_cache.nf){arr.push({cid:_dirCacheCid,cname:_dirCacheCname,path:_dirCachePath})}else{if(_cache.list&&_cache.list.length){for(var i=0,len=_cache.list.length;i<len;i++){var item=_cache.list[i];if(item.attr("file_type")=="1"){arr.push({file_id:item.attr("file_id"),file_size:item.attr("file_size"),file_name:item.find('[field="file_name"]').attr("title"),cid:item.attr("p_id"),ico:item.attr("ico"),sha1:item.attr("sha1"),pick_code:item.attr("pick_code"),path:item.attr("path")})}else{if(_cache.select_dir){arr.push({cid:item.attr("cate_id"),cate_name:item.attr("cate_name"),pick_code:item.attr("pick_code"),is_dir:1})}else{arr.push({cid:item.attr("cate_id")})}}}}else{arr.push({cid:_dirCacheCid,cname:_dirCacheCname,path:_dirCachePath})}}_self.Callback&&_self.Callback(arr,false);window.setTimeout(function(){_self.Close()},10);break;case"cancel":_self.Close();break}return false});var oldCid=0;var oldCookie=Util.Cookie.get("SEL_QF_DIR");if(oldCookie){oldCid=Number(oldCookie)}if(_cache.nf){_self.warp.find("[btn='add_dir']").show()}else{_self.warp.find("[btn='add_dir']").hide()}changeURL(oldCid,{select_one:_cache.select_one,filter:_cache.filter,nf:_cache.nf,select_dir:_cache.select_dir,not_select_file:_cache.not_select_file})};this.Setting=function(obj){_cache.list=false;_cache.select_one=obj.select;_cache.filter=obj.filter;_cache.nf=obj.nf;_cache.select_dir=obj.select_dir;_cache.btn_txt=obj.btn_txt;_cache.select_txt=obj.select_txt;_cache.title=obj.title;_cache.not_select_file=obj.not_select_file};var _closeEvent=_self.Close;this.Close=function(){_frame.attr("src","");_closeEvent();_self.Callback=false};var _openEvent=_self.Open;this.CancelCheck=function(){_content.find("#js_selec_qfile_check_all").attr("checked",false)};this.Open=function(){_dirCacheCid=false;_openEvent();if(_cache.nf){_self.warp.find('[rel="base_title"]').html("打开要"+_cache.select_txt+"的目标文件夹");_self.warp.find('[btn="confirm"]').html(_cache.btn_txt);_self.warp.find("[rel='check_all']").hide()}else{_self.warp.find("[rel='check_all']").show();_self.warp.find('[rel="base_title"]').html("请选择圈子文件");_self.warp.find('[btn="confirm"]').html("确定")}if(_cache.title){_self.warp.find('[rel="base_title"]').html(_cache.title)}if(_cache.select_one){_self.warp.find("[rel='check_all']").hide()}else{_self.warp.find("[rel='check_all']").show()}};this.Set=function(arr){_cache.list=arr};this.Callback=false};var _DG;return{Open:function(qid,callback,opt){_qid=qid;if(!_DG){_DG=new _model()}var setting={};if(opt){setting.select=opt.select?1:0;setting.filter=opt.filter?opt.filter:"";setting.nf=opt.nf?opt.nf:"";setting.select_dir=opt.select_dir?1:0;setting.btn_txt=opt.btn_txt?opt.btn_txt:"移动到这里";setting.select_txt=opt.select_txt?opt.select_txt:"移动";setting.title=opt.title?opt.title:"";setting.not_select_file=opt.not_select_file?opt.not_select_file:""}_DG.Setting(setting);_DG.Open();_DG.Callback=callback},Select:function(arr){if(_DG){_DG.Set(arr)}},MarkDir:function(cid){Util.Cookie.set("SEL_QF_DIR",cid,24)},SelectDir:function(cid,cname,path){_dirCacheCid=cid;_dirCacheCname=cname;_dirCachePath=path;if(_DG){_DG.CancelCheck()}},BackPaths:function(paths){_paths=paths},MainAPI:function(api){_api=api;if(_DG){_DG.warp.find("input[rel='check_all']").attr("checked",false)}},GetBackPaths:function(){return _paths},Close:function(){if(_DG){_DG.Close()}}}})();Core.FileMenu=(function(){var _cache={specil:Core.FileConfig.Specil,setting:Core.FileConfig.OPTPermission},_main_top=85,_opBox;var _opcBoxTemp='<div style="z-index: 9000000;background: none repeat scroll 0 0 black;height: 100%;left: 0;position: absolute;top: 0;width: 100%;filter:alpha(opacity=0.15);-moz-opacity:0;opacity:0;display:none;" onselectstart="return false;"></div>';var pageData={attrTurnOff:true};var showopbox=function(hideFun,arr){_cache.hideMenuFun=hideFun;if(!_opBox){_opBox=$(_opcBoxTemp);$(document.body).append(_opBox);$(window).on("scroll",function(){if(_opBox&&!_opBox.is(":hidden")){hideopbox();if(_cache.hideMenuFun){_cache.hideMenuFun()}}})}_opBox.css({position:"fixed"});_opBox.show();
1_opBox.unbind("mousedown").bind("mousedown",function(e){hideFun&&hideFun(e);$(this).hide();if(arr&&arr.length){$('[rel="wangpan"]').contents().find("#js_operate_box").show()}})};var hideopbox=function(){if(_opBox){_opBox.hide().css({"max-height":"",overflow:""})}};var getSelFilesData=function(arr,opt){return Core.FileAPI.GetSelFilesData(arr)};var isTypeQ=function(arr,opt){var item;var result={};if(arr.length==1){item=arr[0];var file_type=item.attr("file_type");var per=item.attr("per");if(file_type=="1"){if(Core.FilePermission.CanPlayer(arr,4)){result.q_onemusic=true}else{result.q_onefile=true}if(opt.download){result.q_download=true}if(opt.edit_file){result.q_edit_file=true}if(opt.del_file){result.q_delete_file=true}if(opt.save_file){result.q_save_file=true}if(opt.move_file){result.q_move_file=true}if(per=="1"||per=="2"){result.q_edit_file=true;result.q_delete_file=true;result.q_move_file=true}}else{if(per=="1"){result.q_manager=true;result.q_edit_dir=true;result.q_delete_folder=true}else{if(per=="2"){result.q_edit_dir=true;result.q_delete_folder=true}}result.q_onefolder=true;if(opt.move_file){result.q_move_file=true}if(opt.save_file){result.q_save_file=true}}}else{var fileCount=0,folderCount=0,shareCount=0;var musicCount=0;var managerCount=0;var editCount=0;for(var i=0,len=arr.length;i<len;i++){item=arr[i];file_type=item.attr("file_type");if(file_type=="1"){if(Core.FilePermission.CanPlayer([item],4)){musicCount++}fileCount++;if(item.attr("per")=="1"){managerCount++}else{if(item.attr("per")=="2"){editCount++}}}else{if(file_type=="0"){folderCount++;if(item.attr("per")=="1"){managerCount++}else{if(item.attr("per")=="2"){editCount++}}}}}if(opt.manager){result.q_delete_file=true}if(fileCount&&folderCount){var res=false;if(opt.del_dir){res=true}if(opt.del_file){res=true}if(res){result.q_delete_file=true}if((managerCount+editCount)==(fileCount+folderCount)){result.q_delete_file=true}if(opt.move_file){result.q_move_file=true}if(opt.save_file){result.q_save_file=true}}else{if(fileCount&&!folderCount){if(opt.del_file){result.q_delete_file=true}if(opt.save_file){result.q_save_file=true}if(opt.move_file){result.q_move_file=true}if((managerCount+editCount)==fileCount){result.q_delete_file=true;result.q_save_file=true;result.q_move_file=true}if(musicCount==fileCount){result.q_moremusic=true}result.q_morefile=true}else{if(!fileCount&&folderCount){if(managerCount==folderCount){result.q_manager=true;result.q_delete_folder=true}if(editCount==folderCount){result.q_delete_folder=true}if(opt.move_file){result.q_move_file=true}if(opt.save_file){result.q_save_file=true}}}}}return result};var isType=function(arr,opt){var uid=top.USER_INFO&&top.USER_INFO.USER_ID;if(opt){if(opt.is_special){if(Core.Plugs.Check(opt.check_key,"menu_type")){var result=Core.Plugs.Cmd(opt.check_key,"menu_type","Check",arr,opt);return result}}switch(Number(opt.aid)){case 999:var result=isTypeQ(arr,opt);return result;break}}var result={},file_type,isSetShare,item;if(Core.FileConfig.aid==7){if(arr.length){result.rbfile=true}result.rb=true;return result}if(arr&&arr.length==1){item=arr[0];file_type=item.attr("file_type");isSetShare=false;if(+item.attr("shared")>0&&item.attr("fuuid")!=uid){result.report=true}if(file_type=="1"){if(item.attr("c")==1||item.attr("c")==2){result.illegalfile=true;return result}var fileName=item.find("[field='file_name']").attr("title");var suffix="";if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}suffix=suffix.toLowerCase();if(Core.FilePermission.CanPlayer(arr,4)){result.onemusic=true}else{if(UPLOAD_CONFIG&&UPLOAD_CONFIG["3"]&&$.inArray(suffix,UPLOAD_CONFIG["3"]["upload_type_limit"])!=-1){result.onephoto=true}else{if(UPLOAD_CONFIG&&UPLOAD_CONFIG["9"]&&$.inArray(suffix,UPLOAD_CONFIG["9"]["upload_type_limit"])!=-1){result.onemovie=true}else{result.onefile=true}}}if(item.attr("hdf")=="1"){result.hide_file=true}else{result.show_file=true}}else{if(file_type=="0"){if(+item.attr("shared")===1){result.onefolderCancelShare=true}else{if(+item.attr("shared")===0||+item.attr("shared")!==2){result.onefolderSetShare=true}else{result.onefolder=true}}if($.inArray(Number(_cache.aid),Core.CONFIG.BaseDir)!=-1){result.onefoldercover=true;if(arr[0].attr("img_url")){result.onefolderdelcover=true}}if(item.attr("hdf")=="1"){result.hide_folder=true}else{result.show_folder=true}if(item.attr("ispl")&1){result.show_play_long=true}else{result.hide_play_long=true}if(item.attr("issct")==1){result.unset_category=true}else{result.set_category=true}}}}else{if(arr){var fileCount=0,folderCount=0;for(var i=0,len=arr.length;i<len;i++){item=arr[i];if(item.attr("c")==1||item.attr("c")==2){result.illegalfile=true;continue}file_type=item.attr("file_type");var _suffix="";if(file_type=="1"){fileCount++;var fileName=item.find("[field='file_name']").attr("title");if(fileName.lastIndexOf(".")!=-1){_suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}_suffix=_suffix.toLowerCase()}else{if(file_type=="0"){folderCount++;
1if(item.attr("ispl")&1){result.show_play_long=true}else{result.hide_play_long=true}}}if(item.attr("hdf")=="1"){result.hide_file=true}else{result.show_file=true}if(Core.FilePermission.CanPlayer([arr[i]],4)){result.has_music=true}if(UPLOAD_CONFIG&&UPLOAD_CONFIG["3"]&&$.inArray(_suffix,UPLOAD_CONFIG["3"]["upload_type_limit"])!=-1){result.has_photo=true}if(UPLOAD_CONFIG&&UPLOAD_CONFIG["9"]&&$.inArray(_suffix,UPLOAD_CONFIG["9"]["upload_type_limit"])!=-1){result.has_movie=true}if(+item.attr("shared")>0&&item.attr("fuuid")!=uid){result.has_report=true}}if(fileCount&&folderCount){result.fewfandfl=true;result.cancelshare=true}else{if(fileCount&&!folderCount){if(Core.FilePermission.CanPlayer(arr,4)){result.fewmusic=true}if(Core.FilePermission.CanPlayer(arr,9)){result.fewmovie=true}else{result.fewfile=true}}else{if(!fileCount&&folderCount){result.fewfolder=true}}}}else{result.nonefile=true}}return result};var changeShareData=function(is_share,list,r,callback){var arr=list;var dellist=[];if(r.state){dellist=arr}else{if(r.data){for(var i=0,len=arr.length;i<len;i++){var item=arr[i];if(item.attr("file_type")=="1"&&r.data["f"]&&r.data["f"]["state"]){dellist.push(item)}else{if(item.attr("file_type")=="0"&&r.data["c"]&&r.data["c"]["state"]){dellist.push(item)}}}}Core.MinMessage.Show({text:"推送失败",type:"err",timeout:2000})}if(dellist.length){if(r.state&&Number(is_share)==1){for(var i=0,len=list.length;i<len;i++){var item=list[i];if(item.attr("file_type")=="0"){var dc=item.attr("cate_id");if(r.dir_pickcode[dc]){item.attr("pick_code",r.dir_pickcode[dc])}}}if(callback){callback(r)}}var msg="已推送至分享";switch(Number(is_share)){case 0:msg="成功从分享空间取出";break;case 2:msg="续期成功";break}Core.MinMessage.Show({text:msg,timeout:Core.CONFIG.MsgTimeout,window:_cache.win,type:"suc"});window.console&&console.log([Core.FileConfig.aid,Core.FileConfig.cid,is_share,dellist]);if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Share(Core.FileConfig.aid,Core.FileConfig.cid,is_share,dellist)}if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Recheck(Core.FileConfig.aid,Core.FileConfig.cid,dellist)}}};var buttonAction={del:function(list,callback){Core.FileAPI.DeleteFile(list,callback,callback?true:false)},share:function(list,btnType){if(btnType=="share"){Core.SendFileDG.Open(list,"file")}else{buttonAction.share_dataaccess(list,btnType)}},share_dataaccess:function(list,btnType,sharecallback){var url="?ct=file&ac=share";var data=getSelFilesData(list);data.is_share=1;switch(btnType){case"cancelshare":data.is_share=0;break;case"renew":data.is_share=2;break}$.ajax({url:url,type:"POST",data:data,dataType:"json",success:function(r){changeShareData(data.is_share,list,r,sharecallback)}})},set_copydata:function(data){var uid=top.USER_INFO&&top.USER_INFO.USER_ID;var key="FILE_LIST_COPY_DATA_"+uid;data=JSON.stringify(data);localStorage.setItem(key,data);if(top.im&&top.im.connPage){top.im.connPage.trigger(key+"_CHANGE",data)}Core.MinMessage.Show({text:"复制成功<br/>可粘贴到其他目录",type:"suc",timeout:Core.CONFIG.MsgTimeout});Core.FileConfig.DataAPI.Nocheck()},get_copydata:function(){return null}};var _pdfDg=null;var _turnOff=true;var changePdfDo=function(e){if(!_turnOff){return}_turnOff=false;$.ajax({url:"//webapi.115.com/files/doc_to",type:"POST",data:e,dataType:"json",success:function(r){if(r.state){if(r.code===0){$.successTip("正在转换请稍候,转换后将保存在原文件所在的目录");_pdfDg.Close()}else{$.alertTip(r.msg||"请求失败")}}else{$.alertTip(r.msg||"请求失败")}_turnOff=true}})};var doEvent=function(btnType,callback){var cRes=Core.FileMenu.CheckButtonIsDo(_cache.dataList,btnType);if(!cRes){return false}else{if(typeof cRes=="object"){_cache.dataList=cRes}}switch(btnType){case"change_pdf":$.ajax({url:"//webapi.115.com/files/doc_to?act=doc_before",type:"POST",data:{pickcode:_cache.dataList[0].attr("pick_code")},dataType:"json",success:function(r){if(r.state){if(r.data.vip_level==="normal"){top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){to
1p.window._SHOWVIPDIALOG_.Show({title:"使用该功能,请先升级至VIP",btns:1,text:"开通VIP即可将PDF转成其他文档格式",confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}else{_pdfDg=top.window.changePdf(r.data);_pdfDg.Open(function(){_pdfDg.warp.find("li").on("click",function(){var _obj={sha1:$(this).attr("sha1"),file_id:$(this).attr("file_id"),file_name:$(this).attr("file_name"),file_type:$(this).attr("file_type"),type:$(this).attr("type"),file_size:$(this).attr("file_size"),parent_id:$(this).attr("parent_id"),sign:$(this).attr("sign")};changePdfDo(_obj)})})}}else{$.alertTip(r.msg||"请求失败")}}});break;case"delete":buttonAction.del(_cache.dataList,callback);break;case"move":var hasFolder=false;if(_cache.dataList.length){for(var i=0,len=_cache.dataList.length;i<len;i++){if(_cache.dataList[i].attr("file_type")=="0"){hasFolder=true}}}Core.TreeDG.Show({list:_cache.dataList,win:_cache.win,has_dir:hasFolder,type:"move",callback:callback});break;case"copy":Core.TreeDG.Show({list:_cache.dataList,win:_cache.win,type:"copy",callback:callback});break;case"set_copy":if(!_cache.dataList||!_cache.dataList.length){Core.MinMessage.Show({text:"请选择文件",timeout:Core.CONFIG.MsgTimeout});return}var data={};for(var i=0,len=_cache.dataList.length;i<len;i++){var $node=_cache.dataList[i];if($node.attr("file_type")=="1"){data["fid["+i+"]"]=$node.attr("file_id")}else{data["fid["+i+"]"]=$node.attr("cate_id")}}data.pid=Core.FileConfig.cid;buttonAction.set_copydata(data);break;case"copy_paste":var uid=top.USER_INFO&&top.USER_INFO.USER_ID;var key="FILE_LIST_COPY_DATA_"+uid;var data=localStorage.getItem(key);var targetUrl="";if(data){data=JSON.parse(data)}if(!data){Core.MinMessage.Show({text:"没有可以粘贴的文件",timeout:Core.CONFIG.MsgTimeout});return}var timer=setTimeout(function(){Core.MinMessage.Show({text:"粘贴中...",type:"load"})},200);if(data.share_id){data.to_cid=Core.FileConfig.cid;data.copy_type=0;targetUrl="/usershare/copy"}else{data.pid=Core.FileConfig.cid;targetUrl="/files/copy"}UA$.ajax({url:targetUrl,type:"POST",data:data,dataType:"json",error:function(){Core.MinMessage.Show({text:"网络异常,请稍后再试",type:"war",timeout:Core.CONFIG.MsgTimeout})},success:function(r){clearTimeout(timer);if(r.state){localStorage.removeItem(key);top.im&&top.im.connPage&&top.im.connPage.trigger(key+"_CHANGE",null);Core.FileConfig.DataAPI.Reload();window.setTimeout(function(){Core.MinMessage.Show({text:"成功粘贴文件",type:"suc",timeout:Core.CONFIG.MsgTimeout});Core.SpaceData.Sync()},500)}else{if(r.errno===4500032){Core.MinMessage.Hide();Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){top.window._SHOWVIPDIALOG_.Show({title:"升级VIP,可共享更多文件",btns:1,text:r.error,confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout});var uid=top.USER_INFO&&top.USER_INFO.USER_ID;var key="FILE_LIST_COPY_DATA_"+uid;localStorage.removeItem(key);top.im&&top.im.connPage&&top.im.connPage.trigger(key+"_CHANGE",null)}}}});break;case"copy_list":if(!_cache.dataList||!_cache.dataList.length){Core.MinMessage.Show({text:"请选择文件",timeout:Core.CONFIG.MsgTimeout});return}var data={};for(var i=0,len=_cache.dataList.length;i<len;i++){var $node=_cache.dataList[i];if($node.attr("file_type")=="1"){data["fid["+i+"]"]=$node.attr("file_id")}else{data["fid["+i+"]"]=$node.attr("cate_id")}}Core.FileSelectDG.Open(function(list){if(list.length){var item=list[0];var aid=item.aid,cid=item.cid;data.pid=cid;UA$.ajax({url:"/files/copy",type:"POST",data:data,dataType:"json",success:function(r){if(r.state){window.setTimeout(function(){Core.FileConfig.DataAPI.Nocheck();Core.MinMessage.Show({text:"成功复制文件",type:"suc",timeout:Core.CONFIG.MsgTimeout});Core.SpaceData.Sync()},500)}else{if(r.errno===4500032){Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){top.window._SHOWVIPDIALOG_.Show({title:"升级VIP,可共享更多文件",btns:1,text:r.error,confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}}})}},{title:"打开要复制的目标文件夹",select:1,nf:1,show_copy:1,btn_txt:"复制到这里"});break;case"edit_name":console.log("edit_name");if(_cache.dataList&&_cache.dataList.length){var node=_cache.dataList[0];if(node.attr("shared")==="0"){if(node.attr("file_type")=="1"){Core.FileReNameDG.Show(node.attr("file_id"),node.find('[field="file_name"]').attr("title"))}else{var cid=node.attr("cate_id");Core.Dir.Rename(Core.FileConfig.aid,cid,node.attr("cate_name"))}}else{var fileId=node.attr("file_id")||node.attr("cate_id");getShareInfo(fileId,function(res){if(node.attr("file_type")=="1"){Core.FileReNameDG.Show(node.attr("file_id"),node.find('[field="file_name"]').attr("title"),false,res.data.share_id)}else{var cid=node.attr("cate_id");Core.Dir.Rename(Core.FileConfig.aid,cid,node.attr("cate_name"),res.data.share_id)}})}}break;case"cover":if(_cache.dataList&&_cache.dataList.length){var cid=_cache.dataList[0].attr("cate_id");var aid=_cache.dataList[0].attr("area_id");Core.FileSelectDG.EditCover(aid,cid)}break;case"del_cover":if(_cache.dataList&&_cache.dataList.length){var cid=_cache.dataList[0].attr("cate_id");Core.FileAjax.DeleteCover(Core.FileConfig.aid,cid,function(r){if(r.state){Core.MinMessage.Show({text:"成功删除封面",type:"suc",timeout:Core.CONFIG.MsgTimeout});if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.EditCover({cate_id:cid,img_url:""})}}else{Core.MinMessage.Show({text:r.msg,type:"err",timeout:Core.CONFIG.MsgTimeout})}})}break;case"shareto":Core.FileAPI.ShareTO(_cache.dataList,{});break;case"share_file":case"cancelshare":case"renew":buttonAction.share(_cache.dataList,btnType);break;case"exp_delete":Core.FileAjax.DeleteExpMsg(Core.FileConfig.cid,_cache.dataList,_cache.win);break;case"exp_recv":Core.FileAPI.RecvExp(_cache.dataList,_cache.win);break;case"restore":var tids=[];for(var i=0,len=_cache.dataList.length;i<len;i++){var item=_cache.dataList[i];tids.push(item.attr("tid"))}Core.FileAjax.RestoreRB(tids,_cache.win);break;case"refresh":Core.FileConfig.DataAPI.Refresh();try{Core.FileConfig.FileFrameDataAPI.Refresh()}catch(e){}break;case"rb_delete":var tids=[];for(var i=0,len=_cache.dataList.length;i<len;i++){var item=_cache.dataList[i];tids.push(item.attr("tid"))}Core.FileAjax.DeleteRB(tids,_cache.win);break;case"download_dir":case"download":Core.FileAPI.DownloadSomeFile(_cache.dataList);break;case"copylink":var str=Core.FileAPI.GetCopyText(_cache.dataList);Util.Copy(str);break;case"edit":if(_cache.dataList&&_cache.dataList.length&&_cache.dataList.length===1){var item=_cache.dataList[0];var fid=item.attr("file_id")?item.attr("file_id"):item.attr("cate_id");var timer;var getBack=function(callback){if(item.attr("load_data")!="1"){timer=setTimeout(function(){Core.MinMessage.Show({text:"读取描述...",type:"load",timeout:2000})},1000);Core.DataAccess.FileRead.GetFileDetail(fid,function(data){timer&&clearTimeout(timer);Core.MinMessage.Hide();item.attr("load_data","1");var desc=data.state?data.desc:"";item.find("[field='desc']").val(desc?desc:"");if(data.count!=undefined){item.attr("dc",data.count)}callback&&callback()})}else{callback&&callback()}};getBack(function(desc){var oldRemark=item.find("[field='desc']").val();Core.FileDescDG.Show({aid:Core.FileConfig.aid,file_id:fid,is_dir:item.attr("file_type")=="0",title:item.find('[field="file_name"]').attr("title"),value:oldRemark,noReload:true,callback:function(e){item.find("[field='desc']").val(e);if(e){$(item[0]).find('[menu="remark"]').show();$(item[0]).attr("has_desc",1)}else{$(item[0]).find('[menu="remark"]').hide();$(item[0]).attr("has_desc",0)}e!=oldRemark&&item.attr("load_data",0);callback&&callback()}})})}else{var fidArr=[];for(var i=0;i<_cache.dataList.length;
1i++){fidArr.push(_cache.dataList[i].attr("file_id")||_cache.dataList[i].attr("cate_id"))}Core.FileDescDG.Show({aid:Core.FileConfig.aid,file_id:fidArr,value:"",boxTitle:"批量备注",callback:function(e){for(var i=0;i<_cache.dataList.length;i++){e&&$(_cache.dataList[i]).find('[menu="remark"]').show();!e&&$(_cache.dataList[i]).find('[menu="remark"]').hide()}callback&&callback()}})}break;case"sync_delete":if(_cache.dataList&&_cache.dataList.length){if(Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.DeleteSync){Core.Message.Confirm({text:"确认要删除选中的文件或文件夹吗?",type:"war",callback:function(r){if(r){Core.FileConfig.DataAPI.DeleteSync(_cache.dataList)}}})}}break;case"privacy":Core.PrivacyDG.File(_cache.dataList[0]);break;case"unloading":Core.FileAjax.AllowCollect(_cache.dataList,1);break;case"cancelunloading":Core.FileAjax.AllowCollect(_cache.dataList,0);break;case"read":window.Main.Core.ViewFile.Run(_cache.dataList[0]);break;case"view":window.Main.Core.ViewFile.Run(_cache.dataList[0]);break;case"listen":case"add_listen":Core.ViewFile.AddMusic(_cache.dataList,btnType=="listen");break;case"open_listen":Core.ViewFile.ListMusic(_cache.dataList);break;case"star":var tids=[];for(var i=0,len=_cache.dataList.length;i<len;i++){var item=_cache.dataList[i];tids.push(item.attr("file_id"))}if(tids.length){Core.FileAjax.Star(tids.join(","),1,function(ids,star){Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Star(Core.FileConfig.aid,Core.FileConfig.cid,_cache.dataList,star)})}break;case"magic":var file_id=_cache.dataList[0].attr("file_id");var url="?ct=meitu&file_id="+file_id;Core.FileAPI.OpenNewWindow(url);break;case"open_dir":var item=_cache.dataList[0];var aid=item.attr("area_id"),cid=item.attr("cate_id");if(Ext.CACHE&&Ext.CACHE.FileMain){var li=item;if(li.length&&li.attr("hdf")=="1"&&!Number(Core.NewSetting.Get("show"))){Core.HideFile.SettingStatus(1,function(){Ext.CACHE.FileMain.GotoDir(aid,cid)})}else{Ext.CACHE.FileMain.GotoDir(aid,cid)}}break;case"gift":Core.Gift.Add(_cache.dataList);break;case"attribute":if(pageData.attrTurnOff){pageData.attrTurnOff=false;Core.FileAPI.getAttribute(_cache.dataList[0],{showPlayLongChange:function(cids,data,adata){Ext.CACHE.FileMain.List.ResetPlayLongText(cids,data,adata)}},function(){pageData.attrTurnOff=true},null,callback)}break;case"offline_task":if(top.window.Core.OFFL5Plug){top.window.Core.OFFL5Plug.OpenLink()}else{top.$.getScript(__uri("//cdnres.115.com/site/static/plug/offline_wl/offline5.0.js"),function(){top.Core.OFFL5Plug.AddClient({});top.window.Core.OFFL5Plug.OpenLink(null,"/?tab=offline&mode=wangpan")})}break;case"player":if(!top.Core.FilePermission.Vip()&&!window.IS_PREVIEW_CARD){var _=function(){top.oofUtil.vipDialog.Show({win:top.window,vip:true,notVip:true,user_info:{mark1:0,user_id:window.USER_ID||"",user_name:window.USER_NAME||""}})};if(!top.oofUtil||!top.oofUtil.vipDialog){top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_dialog/vip.dialog.js?v=1785999762149"),_)}else{_()}return false}else{var pc=_cache.dataList[0].attr("pick_code");window.browserInterface&&window.browserInterface.OpenYywPlayer(pc)}break;case"batch_edit_file_label":break;case"trans_to_album":var item=_cache.dataList[0];var html_url=__uri("//cdnassets.115.com/plug/albumSelect/index.html?v="+oofUtil.getGUID("album_frame_dg_"));var dg=Core.FrameDG.Open(html_url,{title:"选择转存的相册",width:670,height:420,ready:function(win){win.albumSelectInit(setting)},is_hide_back:true,callback:function(){}});var setting={confirmCallback:function(album){function submit(){Core.MinMessage.Show({text:"正在转存",type:"load",timeout:99999999});UA$.ajax({url:"/photo/photo",data:{to_album_id:album.album_id,file_ids:item.attr("file_id"),action:"addtoalbum"},dataType:"json",type:"POST",success:function(r){if(r.state){setTimeout(function(){Core.MinMessage.Show({text:"转存成功",type:"suc",timeout:2000})},1000);dg.Close()}else{setTimeout(function(){Core.MinMessage.Show({text:r.err_msg,type:"war",timeout:2000})},1000)}},complete:function(){Core.MinMessage.Hide()}})}submit()},cancelCallback:function(){dg.Close()}};break;case"remark":var item=_cache.dataList[0];var fid=_cache.dataList[0].attr("file_id")||_cache.dataList[0].attr("cate_id");Core.DataAccess.FileRead.GetFileDetail(fid,function(data){Core.MinMessage.Hide();var desc=data.state?data.desc:"";var dg=new Core.DialogBase({title:"预览备注",content:'<div class="review-remarks-dialog" style="min-height: 200px;"><div style="overflow-y: auto;" class="article-content" rel="contentHtml">'+desc+"</div></div>",width:720});dg.Open(function(){var modalBtn='       <div class="header-side" btn="toEdit">            <a href="javascript:;" class="button btn-line"><i class="icon-operate ifo-edit"></i><span>编辑</span></a>        </div>';dg.warp.find('[rel="contentHtml"] a[href^=http]').attr("target","_blank");dg.warp.find("[rel=title_box]").append(modalBtn);dg.warp.find('[btn="toEdit"]').on("click",function(){Core.FileDescDG.Show({aid:Core.FileConfig.aid,file_id:fid,is_dir:_cache.dataList[0].attr("file_type"),title:_cache.dataList[0].attr("title"),value:desc,noReload:true,callback:function(e){desc=e;dg.warp.find("[rel=contentHtml]").html(e).find('a[href^="http"]').attr("target","_blank");item.find("[field='desc']").val(e);if(e){$(item[0]).find('[menu="remark"]').show();$(item[0]).attr("has_desc",1)}else{$(item[0]).find('[menu="remark"]').hide();$(item[0]).attr("has_desc",0)}if(!e){item.attr("load_data",0);dg.Close()}callback&&callback()}})})})});break;case"setShare":if(top.COMMONHEADERUSERINFO.vip){setSharedFolder({item:_cache.dataList[0],status:1,callback:function(){}})}else{top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){to
1p.window._SHOWVIPDIALOG_.Show({title:"使用该功能,请升级至VIP进行体验",btns:1,text:"创建共享文件夹,跟老乡一起分享、管理文件",confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}break;case"cancelShare":Core.Message.Confirm({text:"确定要取消共享文件夹吗?",content:"取消共享后,成员将无法查看",type:"war",callback:function(r){if(r){setSharedFolder({item:_cache.dataList[0],status:2,tipText:"此共享文件夹已被取消共享",callback:function(){}})}}});break;case"setTop":var _ids=[];var _btn=$(this);for(var i=0;i<_cache.dataList.length;i++){var _fid=$(_cache.dataList[i]).attr("file_id")||$(_cache.dataList[i]).attr("cate_id");_ids.push(_fid)}$.ajax({url:"//webapi.115.com/files/top",type:"POST",data:{top:1,file_id:_ids.join(",")},dataType:"json",success:function(r){if(r.state){$.successTip("置顶成功");top.Core.FileConfig.DataAPI&&top.Core.FileConfig.DataAPI.Reload()}else{$.alertTip(r.msg||"请求失败")}_turnOff=true}});break;case"calcelSetTop":var _ids=[];for(var i=0;i<_cache.dataList.length;i++){var _fid=$(_cache.dataList[i]).attr("file_id")||$(_cache.dataList[i]).attr("cate_id");_ids.push(_fid)}$.ajax({url:"//webapi.115.com/files/top",type:"POST",data:{top:0,file_id:_ids.join(",")},dataType:"json",success:function(r){if(r.state){$.successTip("取消置顶成功");top.Core.FileConfig.DataAPI&&top.Core.FileConfig.DataAPI.Reload()}else{$.alertTip(r.msg||"请求失败")}_turnOff=true}});break;default:console.log(btnType);if(!Core.Plugs.DoButton(btnType,_cache.dataList)){Core.MinMessage.Show({text:" 操作数量:"+_cache.dataList.length,type:"suc",timeout:Core.CONFIG.MsgTimeout,window:_cache.win})}break}};var hideRightMenu=function(type){if(_cache[type]){_cache[type].find("[val]").hide();_cache[type].hide();if(type=="more_btn"){_cache[type].css({"max-height":"",overflow:""})}}};var showRightMenu=function(type,aid,cid,arr,x,y,opt,InMiniFrame){_cache.aid=aid;_cache.cid=cid;_cache.dataList=arr;var isShow=false;if(arr&&arr.length){isShow=true}else{if(aid==1){isShow=true}}if(isShow){if(!_cache[type]){_cache[type]=Core.FloatMenu.Show(type,false,{isFrame:1});_cache[type].find("[val]").each(function(i){if(!_cache[type+"_btn_list"]){_cache[type+"_btn_list"]={}}var val=$(this).attr("val");_cache[type+"_btn_list"][val]=$(this);$(this).bind("click",function(e){Core.Html.StopPropagation(e);var btnType=$(this).attr("val");if($(this).find(".arrow").length){return false}doEvent(btnType);hideopbox();hideRightMenu(type);return false})});Core.FileMenu.BindAlbum(_cache[type],type)}if(Core.CONFIG.IsOOF.state){var ddA=_cache[type].find('[val="download_dir"] a');if(ddA.length){Core.FileAPI.DownloadDir(arr,ddA);ddA.parent().off("click")}}var showCount=0;if(_cache[type+"_btn_list"]){for(var k in _cache[type+"_btn_list"]){_cache[type+"_btn_list"][k].hide()}if(!opt){opt={}}opt.aid=aid;var r=isType(arr,opt);var specilobj=_cache.specil[_cache.aid];for(var k in r){if(r[k]){var ablelist=_cache.setting[k];if(specilobj){for(var i=0,len=ablelist.length;i<len;i++){if(specilobj[ablelist[i]]&&_cache[type+"_btn_list"][ablelist[i]]){_cache[type+"_btn_list"][ablelist[i]].show();showCount++}}}else{if(ablelist){for(var i=0,len=ablelist.length;i<len;i++){if(_cache[type+"_btn_list"][ablelist[i]]&&!(InMiniFrame&&["upload","add_dir"].indexOf(ablelist[i])>-1)){_cache[type+"_btn_list"][ablelist[i]].show();showCount++}}}}}}}if(!showCount){_cache[type]&&_cache[type].hide();return}var l=x,t=y;if($(Core.CONFIG.CenterMain).is(":visible")){t+=_main_top;l+=$(Core.CONFIG.CenterMain).offset().left}else{if($('iframe[rel="other"]').is(":visible")){_main_top=130;l+=$('iframe[rel="other"]').offset().left;t+=_main_top}}showopbox(function(){hideRightMenu(type)},arr);if(type=="none_file_btn"&&!localStorage.getItem("FILE_LIST_COPY_DATA_"+top.USER_INFO.USER_ID)){_cache[type].find("li[val=copy_paste]").hide()}Core.FloatMenu.SetRightBtnPos(_cache[type],type,l,t);if(!showCount){hideRightMenu(type)}}};var turnOff=true;var setSharedFolder=function(e,igNore,pwd){if(e.status===1&&+e.item.attr("shared")===1){getShareInfo(e.item.attr("cate_id"),function(r){showSetSharedDialog({title:e.item.attr("title"),status:e.status,item:e.item,shareId:r.data.share_id})});return}if(turnOff){turnOff=false;var timer;timer=setTimeout(function(){Core.MinMessage.Show({text:"加载中...",type:"load"})},1000);UA$.ajax({url:"/usershare/share",type:"POST",data:{file_id:e.item.attr("cate_id"),share_opt:e.status,ignore_warn:igNore||0,safe_pwd:pwd||""},dataType:"json",success:function(r){timer&&clearTimeout(timer);Core.MinMessage.Hide();Core.HideFile.SettingStatus(0);turnOff=true;if(r.state){e.tipText&&Core.MinMessage.Show({text:e.tipText,type:"suc",timeout:Core.CONFIG.MsgTimeout});updateDom(e.status,e.item);if(e.status===1){showSetSharedDialog({title:e.item.attr("title"),status:e.status,item:e.item,shareId:r.data.share_id})}else{e.callback&&e.callback({res:r,params:e})}}else{if(r.errno===4500010){Core.Message.Confirm({text:"此文件夹内已有共享文件夹,确定是否继续?",content:"继续设置,将
1先取消已共享的子文件夹",type:"war",callback:function(r){if(r){setSharedFolder(e,1)}}})}else{if(r.errno===4500026){Core.Message.Confirm({text:"确定开启共享此文件夹?",content:"文件夹内含有加密文件,开启共享后成员有权查看此类文件",type:"war",callback:function(r){if(r){Core.HideFile.SettingStatus(1,function(pwd){setSharedFolder(e,1,pwd)},false,function(){},function(){})}}})}else{if(r.errno===4500032){top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js?v=1785999762149"),function(){top.window._SHOWVIPDIALOG_.Show({title:"升级VIP,可共享更多文件",btns:1,text:r.error,confirm_text:"升级VIP会员",confirm_link:"//vip.115.com/?vip_type=year"})})}else{Core.MinMessage.Show({text:r.error,type:"war",timeout:Core.CONFIG.MsgTimeout})}}}}}})}};var getShareInfo=function(fid,callback){UA$.ajax({url:"/usershare/shareinfo",type:"GET",data:{file_id:fid},dataType:"json",success:function(r){if(r.state){callback&&callback(r)}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}})};var showSetSharedDialog=function(e){var setting={data:{shareId:e.shareId},callback:function(){},DialogClose:function(){dg&&dg.Close()}};var html_url=__uri("//cdnassets.115.com/plug/setShared/index.html?v=1785999762149");var dg=top.Core.SimpleFrameDG.Open("shareFolder1",html_url,{title:"共享文件夹:"+e.title,width:600,height:500,ready:function(win){setting.data.dg=dg;win.setSharedInit(setting)},is_hide_back:true})};var updateDom=function(status,dom){var floderIcoDom=dom.find('[folder-type="shared"]');if(status===1){dom.attr("shared",1);dom.find('[menu="cancelShare"]').show();dom.parents(".wrap-vflow").find('[id="js_operate_box"]').find('[menu="cancelShare"]').show();$(dom.parents("body").find('[class="context-menu"]')[2]).find('[menu="cancelShare"]').show()}else{dom.attr("shared",0);dom.find('[menu="cancelShare"]').hide();dom.parents(".wrap-vflow").find('[id="js_operate_box"]').find('[menu="cancelShare"]').hide();$(dom.parents("body").find('[class="context-menu"]')[2]).find('[menu="cancelShare"]').hide()}var floderIco=getFolderIco(dom);if(floderIcoDom.attr("rel")==="view_folder"){floderIcoDom.attr("class","file-thumb tb-"+floderIco+"")}else{floderIcoDom.attr("class","file-type tp-"+floderIco+"")}};var getFolderIco=function(item){var ico="folder";if(+item.attr("shared")===1||+item.attr("shared")===2){ico="folder-shared"}else{switch(item.attr("cate_name")){case"我的接收":ico="folder-receive";break;case"自动备份":ico="folder-backup";break;case"云下载":ico="folder-offline";break;case"手机相册":ico="folder-photo";break;case"我的时光记录":ico="folder-favorite";break;case"我的留恋":ico="folder-favorite";break;case"云收藏":ico="folder-collect";break}}return ico};return{CheckButtonIsDo:function(list,type){if($.inArray(type,Core.CONFIG.NotUpCanDo)==-1){if(list.length==1){if(list[0].attr("file_status")=="0"){Core.MinMessage.Show({text:"文件需续传完成后再操作。",type:"war",timeout:Core.CONFIG.MsgTimeout});return false}}else{if(list.length>1){var arr=[],isReupload=false;for(var i=0,len=list.length;i<len;i++){var node=list[i];if(node.attr("file_status")=="0"){isReupload=true;continue}arr.push(node)}if(arr.length==0){if(isReupload){Core.MinMessage.Show({text:"文件需续传完成后再操作。",type:"war",timeout:Core.CONFIG.MsgTimeout})}return false}else{return arr}}}}return true},CheckType:function(aid,cid,arr,opt){_cache.aid=aid;_cache.cid=cid;var result=[];if(!opt){opt={}}opt.aid=aid;var r=isType(arr,opt);for(var k in r){if(r[k]){var ablelist=_cache.setting[k];for(var i=0,len=ablelist.length;i<len;i++){result.push(ablelist[i])}}}return result},CheckDisplayResult:function(aid,cid,arr,opt){if(!opt){opt={}}opt.aid=aid;var r=isType(arr,opt);return r},GetSetting:function(){return _cache.setting},Action:function(type){return buttonAction[type]},DoEvent:function(arr,btnType,callback){_cache.dataList=arr;doEvent(btnType,callback)},FileRight:function(aid,cid,arr,x,y,opt,InMiniFrame){var type="more_btn";if(!arr){type="none_file_btn"}switch(Number(aid)){case 999:var type="right_q_file";break;default:if(opt&&opt.is_special){if(opt.menu_key){type="right_"+opt.menu_key+"_file"}}break}showRightMenu(type,aid,cid,arr,x,y,opt,InMiniFrame)},HideRight:function(type){hideopbox();hideRightMenu(type)},BindAlbum:function(dom,type){var listenBtn=dom.find('[val="add_listen"]');if(listenBtn.length){listenBtn.find("a").append("<em>&raquo;</em>");var menu;var hideState=true;var timer;var getPos=function(dom,li){var x=li.offset().left+li.width();var y=li.offset().top;if(x+dom.width()>$(document).width()){x=x-dom.width()-li.width()}if(y+dom.height()+5>$(document).height()){y=$(document).height()-dom.height()-5}var pos={top:y,left:x};return pos};var isload=false;var hideFun=function(){hideState=true;timer=window.setTimeout(function(){if(hideState&&menu){menu.hide();hideState=true;menu.empty().remove();menu=false;isload=false}},200)};listenBtn.off("click").on("mouseover",function(){if(isload){return}if(timer){window.clearTimeout(timer)}hideState=false;if(!menu){isload=true;Core.CloudMusic.GetCate(function(r){if(hideState){return}isload=false;var arr={};for(var k in r){var item=r[k];
1arr["al_"+item.topic_id]={text:item.topic_name}}arr.br1={isline:true};arr.create_al={text:"添加专辑"};menu=Core.FloatMenu.GetMenu(arr);menu.hide();menu.on("mouseover",function(){if(timer){window.clearTimeout(timer)}hideState=false}).on("mouseleave",function(){hideFun()});menu.find("[val] a").on("click",function(){var el=$(this).parent();if(el.attr("val").indexOf("al_")!=-1){var tid=el.attr("val").replace("al_","");var list=_cache.dataList;var fids=Core.ViewFile.AddMusic(list,true,true,tid);if(fids){Core.CloudMusic.AddFileList(tid,fids,function(mlist){Util.Cookie.set("OOF_MPLAY_UPDATE_T",tid)})}hideopbox();hideRightMenu(type)}else{if(el.attr("val")=="create_al"){Core.CloudMusic.AddCate(function(r){Core.MinMessage.Show({text:"成功添加专辑",type:"suc",timeout:2000})})}}menu.empty().remove();menu=false;return false});$(document.body).append(menu);window.setTimeout(function(){menu.css(getPos(menu,listenBtn)).show()},10)})}else{menu.css(getPos(menu,listenBtn)).show()}}).on("mouseleave",function(){hideFun()})}},setSharedFolder:function(e){setSharedFolder(e)},GetShareInfo:function(e,callback){getShareInfo(e,callback)}}})();Core.SendFileDG=(function(){var _mod,_api,_list,_defaultType="friend",_permission,_share_cache;var _model=function(){var _self=this,_cache={};var _content=$('<div><div style="width:700px; height:355px;"><iframe src="" frameborder="0" rel="frame" style="width:700px; height:355px;"></iframe></div><div class="dialog-bottom" rel="bottom"><div class="con"><a href="javascript:;" class="button" style="display:none;" btn="confirm">立即分享</a></div><div class="dialog-status" style="float:left;" rel="dialog_status"></div></div></div>');Core.DialogBase.call(this,{title:"分享给老乡",content:_content,width:700});this.SetDialogText=function(text){};var _closeFun=_self.Close;this.IsOpen=false;this.Close=function(){_content.find("[rel='frame']").attr("src","");_self.IsOpen=false;_closeFun();_permission=false};this.IsAllShare=function(){var len=_list.length;var shareCount=0;for(var k in _list){if(Number(_list[k].attr("is_share"))){shareCount++}}return(shareCount==len)};this.Initial=function(){var url,ac="share_friend";_self.IsOpen=true;var h=355;var params="";if(_defaultType){switch(_defaultType){case"q":case"mail":case"mobile":case"friend":ac="share_friend";break;case"weibo":case"file":ac="share_file";if(_self.IsAllShare()){ac="share_file";params="&is_result=1";Core.SendFileDG.ClearShareCache()}else{if(Core.CONFIG.ImterimShareKey){ac="imterim_share";params="&share_type=file";break}}break}}url="?ct=share&ac="+ac+params+"&_t="+new Date().getTime();var ifrm=_content.find("[rel='frame']");ifrm.attr("src",url);ifrm.height(h).parent().height(h);_content.find("[btn]").unbind("click").bind("click",function(){var btnType=$(this).attr("btn");switch(btnType){case"confirm":if(_api){_api&&_api.Confirm(function(){window.setTimeout(function(){_self.Close()},0)})}else{_self.Close()}break;case"cancel":_self.Close();break}return false})};this.SetButtonValue=function(){var confirmBtn=_content.find("[btn='confirm']");if(_api){if(_api.DialogText){_content.find('[rel="dialog_status"]').html(_api.DialogText)}else{_content.find('[rel="dialog_status"]').html("")}if(_api.Type){_defaultType=_api.Type;Util.Cookie.set("JS_SD_KEY",_api.Type,24*30*3)}if(_api.ButtonText){confirmBtn.html(_api.ButtonText)}else{confirmBtn.html("立即分享")}if(_api.Confirm){confirmBtn.show()}else{confirmBtn.hide()}}}};return{CheckPermission:function(type){return true},Open:function(list,type){if(!_mod){_mod=new _model()}_api=false;_list=list;if(_mod.IsOpen){_mod.Close()}switch(Core.FileConfig.aid){case 1:case 2:case 3:case 4:case 5:case 9:_permission=Core.FileMenu.CheckType(Core.FileConfig.aid,Core.FileConfig.cid,list);if(Core.FilePermission.VipExp()&&Core.SpaceData.IsNoSpace()){var arr=[];for(var i=0,len=_permission.length;i<len;i++){if(_permission[i]!="q"&&_permission[i]!="weibo"){arr.push(_permission[i])}}_permission=arr}break;default:_permission=[];if(type=="file"||type=="file_result"){_permission.push("share")}if(Core.FilePermission.VipExp()&&Core.SpaceData.IsNoSpace()){_permission.push("send")}else{_permission.push("send");_permission.push("q")}break}if(Util.Cookie.get("JS_SD_KEY")){_defaultType=Util.Cookie.get("JS_SD_KEY");if(_defaultType!="file"&&_defaultType!="friend"){if($.inArray(_defaultType,_permission)==-1){_defaultType="file"}}}if(_defaultType=="friend"){if(list&&list.length==1){var item=list[0];if(item.attr("file_type")=="0"&&!Core.FilePermission.Vip()){_defaultType="file"}}}_mod.Open()},Close:function(){if(_mod){_mod.Close()}},GetFileList:function(){return _list},GetPermission:function(){return _permission},SetAPI:function(api){_api=api;if(_mod){_mod.SetButtonValue()}},GetShareCache:function(){return _share_cache},ClearShareCache:function(){_share_cache=false},IsAllShare:function(){if(_mod){return _mod.IsAllShare()}return false}}})();Core.SendFileResult=(function(){var _mod,_doHandler;var mod=function(){var _content=$('<div class="share-result"><dl></dl></div>'),_self=this;var _top=Util.Override(Core.DialogBase,_self,{Show:function(arr){_top.Open();var dl=_content.find("dl");dl.html("");var html=[];html.push("<dt><span>老乡</span><em>操作结果</em></dt>");for(var i=0,len=arr.length;i<len;i++){var item=arr[i];html.push("<dd><span>"+item.text+"</span>"+item.result+"</dd>")}dl.html(html.join(""))}},{content:_content,title:"分享结果"})};return{Open:function(arr){if(!_mod){_mod=new mod()}_mod.Show(arr)}}})();Core.FriendDG=(function(){return{Add:function(){Core.FrameDG.Open(Core.CONFIG.Path.My+"/?ct=friend&ac=search&v=2.0",{title:"添加老乡",height:90,ready:function(win){win.SET_HEIGHT=function(h){Core.FrameDG.Reset(false,h)}}})}}})();Core.FileResultDG=(function(){var _model;var showBtn=function(opt){var gotoBtn=_model.warp.find("[btn='goto']");if(opt.aid){gotoBtn.show();if(opt.cid==undefined){opt.cid=0}gotoBtn.off("click").on("click",function(){if(window.PageCTL&&window.location.host==document.domain){PageCTL.GOTO(opt.aid,opt.cid);window.setTimeout(function(){_model.Close();Core.OnlyFrame.Close()},1);return false}else{$(this).attr("href",PAGE_PATHS.U+"?ac=goto_dir&aid="+opt.aid+"&cid="+opt.cid).attr("target","_blank");
1window.setTimeout(function(){_model.Close();Core.OnlyFrame.Close()},1);return true}});window.setTimeout(function(){gotoBtn.focus();Core.FileConfig&&Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Reload(opt.aid,opt.cid)},800)}else{gotoBtn.hide();if(opt.is_msg){var key="API_GET_MSG_ID_"+new Date().getTime();$.getScript(PAGE_PATHS.U+"/?ct=msg&ac=get_id&js_return="+key,function(){var r=window[key];if(r){opt.aid=1;opt.cid=r.cid;showBtn(opt)}})}}};return{Show:function(list,opt){if(!_model){var _content=$('<dl class="file-copy" rel="con"></dl><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="goto" style="display:none;">打开文件目录</a></div></div>');_model=new Core.DialogBase({title:"结果",content:_content})}if(!opt){opt={}}if(!opt.name){opt.name="file_name"}if(!opt.msg){opt.msg="msg"}_model.Open(function(){var closeBtn=_model.warp.find("[btn='close_btn']");closeBtn.off("click").on("click",function(){_model.Close();return false});var html=[];for(var k in list){var item=list[k];var fileName=item[opt.name];var result=item.state?"<em>成功</em>":item[opt.msg];html.push("<dd "+(!item.state?'class="err" title="'+item[opt.msg]+'"':"")+'><ul><li class="file-name" style="width:310px;">'+fileName+'</li><li class="file-rate" style="width:170px;">'+result+"</li></ul></dd>")}_model.warp.find("[rel='con']").html('<dt><ul><li class="file-name" style="width:310px;">文件名</li><li class="file-rate" style="width:170px;">操作结果</li></ul></dt>'+html.join(""));_model.warp.find("[btn='cancel']").off("click").on("click",function(){_model.Close();return false});showBtn(opt)})}}})();Core.TreeWin=(function(){return{Show:function(callback){Core.FileSelectDG.Open(function(list){if(list.length){var item=list[0];var aid=item.aid,cid=item.cid;callback&&callback(aid,cid)}},{select:1,nf:1,btn_txt:"接收到这里",select_txt:"接收"})},Hide:function(){Core.FileSelectDG.Close()}}})();Core.TreeDG=(function(){var _cache={};var _pro_local_key="__MOVE_PRO_ID_"+(window.USER_ID||window.user_id)+"_";function createProId(){if(!_cache.pro_key){_cache.pro_key=~(100*Math.random());_cache.pro_index=0}return(+new Date())+"_"+_cache.pro_key+"_"+_cache.pro_index++}function showDoing(type,progress){if(!showDoing.$hint){showDoing.$hint=top.$('<div class="btn-hint-wrap" style="display: none;">\n        <a href="javascript:;" class="button btn-hint-load"><i class="icon-load"></i><span>正在移动文件,请稍后…</span></a>\n    </div>');showDoing.$hint.appendTo(top.document.body)}showDoing.timer&&clearTimeout(showDoing.timer);showDoing.$hint.show();if(type=="success"){showDoing.$hint.html('<a href="javascript:;" class="button btn-hint-suc"><i class="icon-suc"></i><span>文件移动成功</span></a>');showDoing.timer=setTimeout(function(){stop()},2000)}else{showDoing.$hint.html('<a href="javascript:;" class="button btn-hint-load"><i class="icon-load"></i><span>'+(progress!=-1&&(new Date-_cache.pro_id_time>2000)?"正在移动"+progress+"%":"正在移动文件,请稍后...")+"</span></a>")}}function stop(){localStorage.removeItem(_pro_local_key);showDoing.$hint&&showDoing.$hint.hide()}function start(pro_id,aid,cid){if(!pro_id){try{pro_id=localStorage.getItem(_pro_local_key);if(!pro_id){return}pro_id=JSON.parse(pro_id);_cache.pro_id_time=pro_id.time;_cache.pro_id_aid=pro_id.aid;_cache.pro_id_cid=pro_id.cid;pro_id=pro_id.pro_id}catch(e){}}else{_cache.pro_id_time=+new Date;_cache.pro_id_aid=aid;_cache.pro_id_cid=cid;localStorage.setItem(_pro_local_key,JSON.stringify({time:_cache.pro_id_time,aid:aid,cid:cid,pro_id:pro_id}))}wait(pro_id)}function wait(pro_id){wait.timer&&clearTimeout(wait.timer);$.ajax({url:"//webapi.115.com/files/move_progress",data:{move_proid:pro_id},xhrFields:{withCredentials:true},dataType:"json",success:function(json){if(json.state){if(json.progress==100){if(Core.FileConfig.DataAPI){if(Core.FileConfig.aid==_cache.pro_id_aid&&Core.FileConfig.cid==_cache.pro_id_cid){Core.FileConfig.DataAPI.Reload(Core.FileConfig.aid,Core.FileConfig.cid)}}showDoing("success");localStorage.removeItem(_pro_local_key)}else{showDoing("doing",json.progress);wait.timer=setTimeout(function(){wait(pro_id)},500)}}else{if(json.errno=="990003"){}else{Core.MinMessage.Show({text:json.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}stop()}},error:function(){Core.MinMessage.Show({text:"网络异常请刷新重试",type:"err",timeout:Core.CONFIG.MsgTimeout});stop()}})}start();
1return{Show:function(obj){if(!obj.list||!obj.list.length){Core.MinMessage.Show({text:"请选择文件",timeout:Core.CONFIG.MsgTimeout});return}_cache.setting=obj;var type=_cache.setting.type;var arr=obj.list;var isDir=obj.has_dir;var tid=[];var dir=[];for(var i=0,len=arr.length;i<len;i++){if(arr[i].attr("file_type")=="1"){tid.push(arr[i].attr("file_id"))}else{dir.push(arr[i].attr("cate_id"))}}_cache.list=tid;_cache.dir_list=dir;_cache.doms=arr;Core.FileSelectDG.Open(function(list,is_copy){if(list.length){var item=list[0];var aid=item.aid,cid=item.cid;_cache.aid=aid;_cache.cid=cid;if(is_copy==undefined){is_copy=false}_cache.is_copy=is_copy;var data={pid:_cache.cid};if(_cache.is_copy){data.copy=1}else{data.move_proid=createProId()}var ind=0;for(var i=0,len=_cache.list.length;i<len;i++){data["fid["+ind+"]"]=_cache.list[i];ind++}for(var i=0,len=_cache.dir_list.length;i<len;i++){data["fid["+ind+"]"]=_cache.dir_list[i];ind++}if(isDir){var paths=Core.FileSelectDG.GetBackPaths();if(paths){var res=true;for(var i=0,len=paths.length;i<len;i++){var item=paths[i];for(var j=0,jlen=_cache.doms.length;j<jlen;j++){var node=_cache.doms[j];if(node.attr("file_type")=="0"){var form_aid=node.attr("area_id");var form_cid=node.attr("cate_id");if(Number(form_aid)==Number(item.aid)&&form_cid==item.cid){res=false}}}}if(!res){Core.MinMessage.Show({text:"文件夹不能移动到子目录里",type:"war",timeout:Core.CONFIG.MsgTimeout});return false}}}if(!_cache.is_copy){showDoing("loading",-1)}UA$.ajax({url:"/files/move",type:"POST",data:data,dataType:"json",success:function(r){if(r.state){if(!_cache.is_copy){try{setTimeout(function(){start(data.move_proid,Core.FileConfig.aid,Core.FileConfig.cid)},200);if(obj.callback){obj.callback()}else{if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(Core.FileConfig.aid,Core.FileConfig.cid)}}}catch(e){}}else{try{if(obj.callback){obj.callback()}else{if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload(Core.FileConfig.aid,Core.FileConfig.cid)}}window.setTimeout(function(){Core.MinMessage.Show({text:"成功复制文件",type:"suc",timeout:Core.CONFIG.MsgTimeout})},500)}catch(e){}}_cache.setting.callback&&_cache.setting.callback(r)}else{stop();Core.MinMessage.Show({text:r.error,type:"err",timeout:Core.CONFIG.MsgTimeout})}}})}},{select:1,nf:1,show_record:type=="move"?1:0,show_copy:!isDir?1:0})}}})();Core.RBSettingDG=(function(){var _mod;var mod=function(){var _self=this,_active=false;var _content=$('<div class="hint-box" rel="msg_box">此项功能是115公司为你的网盘数据安全做的特别保障,我们不建议你关闭!</div><dl class="offline-download-link" style="width:400px;padding-top:20px;"><dd style="height:50px;"><input type="radio" name="p" id="js_rb_set_1" value="1" checked /><label for="js_rb_set_1" style="cursor:pointer;position:static;color:#000;">高级保护</label><span style="color:#999999">(永久删除文件操作需要验证安全密钥)</span></dd><dd style="height:80px;"><em style="display:inline-block;text-align:right;width:62px;">安全密钥:</em><input type="password" rel="pwd" class="text" style="position:static;width: 220px;" /></dd></dl><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');this.RBSetting=false;this.Questions=false;var changeQues=function(){if(_active===false){_active=0}else{_active++;
1if(_active>=_self.Questions.length){_active=0}}var ques=_self.Questions[_active];var txt=_self.warp.find('[rel="ques_text"]');txt.html(ques);window.setTimeout(function(){_self.warp.find("[rel='ques_text_box']").focus()},100)};var save=function(){var pwd=_self.warp.find('[rel="pwd"]');var _safe_mode=_self.RBSetting.SafeMode?0:1;var data={recycle_pass:pwd.val(),safe_mode:_safe_mode};if(!data.recycle_pass){Core.MinMessage.Show({text:"请输入安全密钥",type:"war",timeout:2000});pwd.focus();return false}$.ajax({url:"?ct=rb&ac=safe_mode",data:data,type:"POST",dataType:"json",success:function(r){if(r.state){pwd.val("");_self.Close();if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Refresh()}if(_safe_mode==1){Core.Message.Alert({text:"设置成功!",content:"你设置了高级保护模式,删除文件后到回收站操作均需验证安全密钥,全方位防止误删。",type:"suc",confirm_text:"确定"})}else{Core.Message.Alert({text:"设置成功!",content:"你关闭了高级保护模式,删除文件后到回收站操作无需验证安全密钥。",type:"suc",confirm_text:"确定"})}}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000});pwd.focus()}}})};var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){_self.warp.find('[rel="pwd"]').on("keyup",function(e){if(e.keyCode==13){save();return false}});_self.warp.find("[btn='confirm']").on("click",function(){save();return false});_self.warp.find("[btn='cancel']").on("click",function(){_self.Close();return false});_self.warp.find('[rel="change_link"]').on("click",function(){changeQues();return})},Open:function(){if(_self.RBSetting){_self.Questions=_self.RBSetting.SafeAQ;_top.Open(function(){var val=_self.RBSetting.SafeMode?1:0;var label=_self.warp.find('label[for="js_rb_set_1"]');if(val){label.html("关闭高级保护");label.next().html("(请三思而后行:一旦关闭,今后你的回收站内容在操作删除或清空时将不再接受安全验证!)")}else{label.html("开启高级保护");label.next().html("(强烈建议开启:一旦开启,今后你的回收站内容在操作删除或清空时将要安全验证!)")}_content.find("#js_rb_set_1").attr("checked",val)})}else{Core.Minmessage.Show({text:"保护设置暂停使用",type:"war",timeout:2000})}},Close:function(){_self.RBSetting=false;_self.warp.find('[rel="ques_text_box"]').val("");_top.Close()}},{content:_content,title:"保护设置",width:450})};return{Show:function(setting){if(!setting.HasPass){Core.Message.Confirm({text:"你没有设置安全密钥!",type:"war",confirm_text:"马上设置",confirm_link:Core.CONFIG.Path.U+"/?nav=safe&child=user&mode=my_set&type=superpwd"});return}if(!_mod){_mod=new mod()}_mod.RBSetting=setting;_mod.Open()}}})();(function(){var gift=Core.Gift=(function(){var modifyCate=function(mod,callback){var editCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" maxlength="15" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var editBox=new Core.DialogBase({title:"重命名礼包分类",content:editCon});editBox.Open();editCon.find("[rel='txt']").val(mod.name);var renameFolderFun=function(){var val=$.trim(editCon.find('[rel="txt"]').val());if(!val){Core.MinMessage.Show({text:"请输入分类名称",type:"war",timeout:2000});return false}else{if(val.length>15){Core.MinMessage.Show({text:"分类名称不能大于15个字符",type:"war",timeout:2000});return false}}$.ajax({url:"/?ct=filegift&ac=category_modify",type:"POST",dataType:"json",data:{name:val,cid:mod.cid},success:function(r){if(r.state){Core.MinMessage.Show({text:"重命名礼包分类",type:"suc",timeout:2000});callback&&callback(val);editBox.Close()}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000})}}})};editCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){renameFolderFun(e);return false}else{if(e.keyCode==27){editBox.Close();return false}}});editCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":renameFolderFun(e);break;case"cancel":editBox.Close();break}return false});editCon.find("[rel='txt']")[0].focus();window.setTimeout(function(){editCon.find("[rel='txt']")[0].select()},20)};var addCate=function(callback){var addCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" maxlength="15" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var createBox=new Core.DialogBase({title:"新建礼包分类",content:addCon});createBox.Open(null);var addCateFun=function(e){var val=$.trim(addCon.find('[rel="txt"]').val());if(!val){Core.MinMessage.Show({text:"请输入分类名称",type:"war",timeout:2000});return false}else{if(val.length>15){Core.MinMessage.Show({text:"分类名称不能大于15个字符",type:"war",timeout:2000});return false}}$.ajax({url:"/?ct=filegift&ac=category_add",type:"POST",dataType:"json",data:{name:val},success:function(r){if(r.state){Core.MinMessage.Show({text:"成功创建礼包分类",type:"suc",timeout:2000});callback&&callback(r);createBox.Close()}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000})}}})};addCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){Util.Html.StopPropagation(e);addCateFun(e);return false}else{if(e.keyCode==27){createBox.Close();return false}}});addCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":addCateFun(e);break;case"cancel":createBox.Close();break}return false});addCon.find("[rel='txt']")[0].focus()};var _cateBox,_cateList,_mcateBox;
1var getList=function(callback,notAdd){if(!_cateList){$.ajax({url:"/?ct=filegift&ac=category_ls",type:"GET",dataType:"json",success:function(r){_cateList=r.data;if(!_cateList){if(!notAdd){addCate(function(){getList(callback)})}else{callback&&callback(_cateList)}}else{callback&&callback(_cateList)}}})}else{callback&&callback(_cateList)}};var delCate=function(cate_id,callback){$.ajax({url:"/?ct=filegift&ac=category_delete",data:{cids:cate_id},type:"POST",dataType:"json",success:function(r){if(r.state){if(Core.FileConfig.aid==91){Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Reload()}callback&&callback();_cateList=false;getList(function(){},true)}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000})}}})};var mcateBox=function(){var _self=this,_content=$('<div class="dg-sort"><ul rel="list_box"></ul></div><div class="dialog-bottom"><div class="dialog-status"><a href="javascript:;" class="dgsort-add" btn="add"><s></s><span>添加分类</span></a></div><div class="con"><a href="javascript:;" class="button btn-gray" btn="cancel">关闭</a></div></div>');var showList=function(){var listBox=_self.warp.find('[rel="list_box"]');listBox.html("");if(_cateList&&_cateList.length){var html=[];for(var i=0,len=_cateList.length;i<len;i++){var item=_cateList[i];if($.inArray(Number(item.cid),[1,2])==-1){html.push(String.formatmodel('<li cate_id="{cid}"><span>{name}</span> <em><a btn="modify" href="javascript:;" class="icon isort-rename"></a><a btn="del" href="javascript:;" class="icon isort-remove"></a></em></li>',item))}}listBox.html(html.join(""))}};var t=Util.Override(Core.DialogBase,_self,{Initial:function(){_self.warp.delegate("[btn]","click",function(){var el=$(this);switch(el.attr("btn")){case"add":addCate(function(){_cateList=false;getList(function(){showList()})});break;case"cancel":_self.Close();break}return false});_self.warp.find('[rel="list_box"]').delegate("li","click",function(){var el=$(this);selCate(el.attr("cate_id"));return false}).delegate("[btn]","click",function(){var el=$(this);switch(el.attr("btn")){case"modify":var li=el.parents("[cate_id]");var cid=li.attr("cate_id");modifyCate({cid:cid,name:li.find("span").html()},function(val){li.find("span").html(val);_cateList=false;getList(function(){})});break;case"del":var li=el.parents("[cate_id]");var cid=li.attr("cate_id");delCate(cid,function(){if(li.parent().children().length==1){_self.Close()}else{li.empty().remove()}});break}return false})},Show:function(){getList(function(){t.Open(function(){showList()})})}},{content:_content,title:"管理礼包分类"})};var cateBox=function(){var _self=this,_cacheList,_oldSelCid,_content=$('<div class="dg-sort"><ul rel="list_box"></ul></div><div class="dialog-bottom"><div class="dialog-status"><a href="javascript:;
1" class="dgsort-add" btn="add"><s></s><span>添加分类</span></a></div><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var showList=function(){var listBox=_self.warp.find('[rel="list_box"]');listBox.html("");if(_cateList&&_cateList.length){var html=[];for(var i=0,len=_cateList.length;i<len;i++){var item=_cateList[i];if($.inArray(Number(item.cid),[1,2])==-1){html.push(String.formatmodel('<li cate_id="{cid}"><span>{name}</span> <em><a btn="modify" href="javascript:;" class="icon isort-rename"></a><a btn="del" href="javascript:;" class="icon isort-remove"></a></em></li>',item))}}listBox.html(html.join(""))}};var selCate=function(cid){_oldSelCid=cid;var listBox=_self.warp.find('[rel="list_box"]');listBox.find(".selected").removeClass("selected");listBox.find('[cate_id="'+cid+'"]').addClass("selected")};var t=Util.Override(Core.DialogBase,_self,{Initial:function(){_self.warp.on("click",function(){return false});_self.warp.delegate("[btn]","click",function(){var el=$(this);switch(el.attr("btn")){case"add":addCate(function(r){Util.log(r);_cateList=false;getList(function(){showList();if(r.state&&r.cid){selCate(r.cid)}})});break;case"confirm":var listBox=_self.warp.find('[rel="list_box"]');var li=listBox.find(".selected");if(li.length){var cid=li.attr("cate_id");if(_cacheList){var giftCode=[];for(var i=0,len=_cacheList.length;i<len;i++){var item=_cacheList[i];giftCode.push(item.attr("code"))}$.ajax({url:"/?ct=filegift&ac=gift_add_category",data:{cid:cid,gift_code:giftCode.join(",")},type:"POST",success:function(r){if(r.state){Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Reload();_self.Close()}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000})}}})}else{Core.MinMessage.Show({text:"请选择礼包",type:"war",timeout:2000})}}else{Core.MinMessage.Show({text:"请选择礼包分类",type:"war",timeout:2000})}break;case"cancel":_self.Close();break}return false});_self.warp.find('[rel="list_box"]').delegate("li","click",function(){var el=$(this);selCate(el.attr("cate_id"));return false}).delegate("[btn]","click",function(){var el=$(this);switch(el.attr("btn")){case"modify":var li=el.parents("[cate_id]");var cid=li.attr("cate_id");modifyCate({cid:cid,name:li.find("span").html()},function(val){li.find("span").html(val);_cateList=false;getList(function(){})});break;case"del":var li=el.parents("[cate_id]");var cid=li.attr("cate_id");delCate(cid,function(){if(li.parent().children().length==1){_self.Close()}else{li.empty().remove()}});break}return false})},Show:function(list){_cacheList=list;getList(function(){t.Open(function(){showList();var listBox=_self.warp.find('[rel="list_box"]');selCate(_oldSelCid);if(!listBox.find(".selected").length){selCate(listBox.find("li:first").attr("cate_id"))}})})}},{content:_content,title:"选择礼包分类"})};var _detailBox;var detailBox=function(){var _self=this,_content=$('<div class="bt-file-list pickcode-file" style="margin-bottom:30px;"><div class="bt-file-title"><div class="file-name">文件名称 / 文件夹名称</div><div class="file-size">类型</div></div><ul rel="list"></ul></div>');var t=Util.Override(Core.DialogBase,_self,{Show:function(list){t.Open(function(){var html=[];for(var i=0,len=list.length;i<len;i++){var item=list[i];if(item.file_id){item.file_size=Util.File.ShowSize(item.file_size,1);html.push(String.formatmodel('<li><div class="file-name">{file_name}</div><div class="file-size" style="width:120px;">文件 ({file_size})</div></li>',item))}else{html.push(String.formatmodel('<li><div class="file-name">{name}</div><div class="file-size">文件夹</div></li>',item))}}_content.find('[rel="list"]').html(html.join(""))})}},{content:_content,title:"礼包内容"})};var changeDescData=function(code,desc,callback){$.ajax({url:"/?ct=filegift&ac=update_remark",type:"POST",dataType:"json",data:{gift_code:code,remark:desc},success:function(r){callback&&callback(r)}})};var editDesc=function(code,oldRmark,callback){if(!oldRmark){oldRmark=""}var editCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" maxlength="50" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a><a href="javascript:;" class="btn-link" btn="cancel">取消</a></div></div>');var editBox=new Core.DialogBase({title:"重命名礼包",content:editCon});editBox.Open();var textBox=editCon.find("[rel='txt']");textBox.val(oldRmark);var renameFolderFun=function(e){var desc=$.trim(textBox.val());if(desc!=""){if(desc.length>
150){Core.MinMessage.Show({text:"礼包备注最多只能包含50个字",type:"war",timeout:2000});textBox.focus();return false}Core.MinMessage.Show({text:"正在修改重命名礼包...",type:"load",timeout:10000});changeDescData(code,desc,function(r){if(r.state){desc=Util.Text.htmlspecialchars(desc);callback&&callback(code,desc);editBox.Close();Core.MinMessage.Show({text:"重命名成功",type:"suc",timeout:2000})}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000});textBox.focus()}})}else{callback&&callback(code,desc)}};editCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){renameFolderFun(e)}else{if(e.keyCode==27){editBox.Close()}}});editCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":renameFolderFun(e);break;case"cancel":editBox.Close();break}return false});textBox.focus();window.setTimeout(function(){textBox.select()},20)};var _cateMenuBox;return{EditDesc:function(code,oldRmark,callback){editDesc(code,oldRmark,callback)},GotoGift:function(win){win.location.href="/?ct=filegift&ac=manage"},GetList:function(callback,notAdd){getList(callback,notAdd)},Show:function(code){if(code){$.ajax({url:"/?ct=filegift&ac=show_files&gift_code="+code,cache:false,dataType:"json",type:"GET",success:function(r){if(r.state&&r.data&&r.data.length){if(!_detailBox){_detailBox=new detailBox()}_detailBox.Show(r.data)}else{Core.MinMessage.Show({text:"礼包内没有文件",type:"war",timeout:2000})}}})}},ManageCate:function(){if(!_mcateBox){_mcateBox=new mcateBox()}_mcateBox.Show()},SelectCate:function(list){if(!_cateBox){_cateBox=new cateBox()}_cateBox.Show(list)},BindMenu:function(ele,category){var timer;if(category){getList(function(list){var cateName="全部礼包";for(var k in list){if(list[k]["cid"]==category){cateName=list[k]["name"];break}}ele.html("<span>"+cateName+"</span><s></s>")})}if(_cateMenuBox){_cateMenuBox.hide()}ele.on("mouseleave",function(){if(timer){window.clearTimeout(timer)}}).on("mouseover",function(){if(timer){window.clearTimeout(timer)}timer=window.setTimeout(function(){ele.attr("hide_status","0");var st={Title:ele,IsOverShow:true,ShowHandler:function(){var t=this.Title.offset().top+this.Title.height()+3;var l=this.Title.offset().left;_cateMenuBox&&_cateMenuBox.css({top:t,left:l});getList(function(list){var html=[];html.push("<ul>");html.push('<li><a style="padding-left: 10px;" menu="gift_category" href="javascript:;" category=""><span>全部礼包</span></a></li>');if(list&&list.length){for(var i=0,len=list.length;i<len;i++){var item=list[i];html.push(String.formatmodel('<li><a style="padding-left: 10px;overflow:hidden;" menu="gift_category" href="javascript:;" category="{cid}" ><span>{name}</span></a></li>',item))}}html.push("</ul>");_cateMenuBox.html("");_cateMenuBox.html(html.join(""));_cateMenuBox.append('<ul><li><a style="padding-left: 10px;" menu="gift_category_manage" href="javascript:;" category=""><span>管理礼包分类</span></a></li></ul>')},true)}};if(!_cateMenuBox){_cateMenuBox=$('<div class="context-menu" style="z-index:99999;"></div>');$(document.body).append(_cateMenuBox);Ext.CACHE.FileMain.Events.Bind(_cateMenuBox)}st.ShowHandler();st.Content=_cateMenuBox;ele.off("mouseover");ele.off("mouseleave");Util.DropDown.Bind(st);st.Content.show()},200)})}}})()})();(function(){var FontCheck=function(textArea,fontCount){var _textArea=textArea,_self=this,_maxCount=300,_fontCount=fontCount;this.GetCount=function(){var val=_textArea.val();val=val.replace(/[^\x00-\xff]/ig,"xx");var count=val.length;var lesscount=Math.floor((_maxCount-count)/2);return lesscount};this.CheckCount=function(){var lesscount=_self.GetCount();var fontCount=_fontCount;if(lesscount>=0){fontCount.html("还可以输入"+lesscount+"字");fontCount.css({width:"34px"})}else{fontCount.css({width:"90px"});fontCount.html("<b>已超出 "+Math.abs(lesscount)+" 字</b>")}}};var _list;var dipan=Core.ShareDipan=(function(){var mod=function(){var _content=$('<div class="dialog-input"><label for="">发言请遵守115服务协议,<span rel="font_count">还可以输入150字</span></label><textarea name="" id=""></textarea></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a></div><div class="dialog-file-info" style="display:none;"><i class="file-type tp-folder"></i><span>XXXX等4个文件夹和1个文件 共15G</span></div></div>');var _self=this,_textArea,_fontCount,_check;var postFeed=function(data,callback){$.ajax({url:"/zone/feed/?ct=feed&ac=add",data:data,dataType:"json",type:"POST",success:function(r){callback&&callback(r)}})};var postData=function(){var textArea=_textArea;var msg="";var data={};var isPic=false;if(_list.length==1){var itemNode=_list[0];if(itemNode.attr("file_type")=="1"&&Number(Core.FileAPI.CheckFileType(itemNode)==3)){isPic=true;var pics=[];pics.push({n:itemNode.find('[field="file_name"]').attr("title"),p:itemNode.attr("pick_code"),s:itemNode.attr("file_size"),sh:itemNode.attr("sha1")});if(pics.length){data.i=pics}msg="分享照片"}}if(!isPic){var files=[];for(var i=0,len=_list.length;i<len;i++){var item=_list[i];if(item.attr("file_type")=="1"){files.push({n:item.find('[field="file_name"]').attr("title"),p:item.attr("pick_code"),s:item.attr("file_size"),is_f:0})}else{files.push({n:item.attr("cate_name"),p:item.attr("pick_code"),s:"",is_f:1})}msg="分享文件"}if(files.length){data.f=files}}var val=$.trim(textArea.val());data.c=Util.Text.htmlspecialchars(val);if(data.c==""){data.c=msg}if(!_list||!_list.length){Core.MinMessage.Show({text:"请选择文件",type:"war",timeout:2000});return false}postFeed(data,function(r){if(r.state){_textArea.val("");Core.MinMessage.Show({text:"成功分享到朋友们",type:"suc",timeout:2000});_mod.Close()}else{_textArea.focus();Core.MinMessage.Show({text:r.err_msg,type:"err",timeout:2000})}})};var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){_textArea=_content.find("textarea");_fontCount=_content.find('[rel="font_count"]');_check=new FontCheck(_textArea,_fontCount);_textArea.on("keydown",function(e){if(e.ctrlKey&&e.keyCode==13){return false}}).on("keyup",function(e){_check.CheckCount();if(e.ctrlKey&&e.keyCode==13){postData()}});_content.find('[btn="confirm"]').on("click",function(){postData()})},Show:function(list){_top.Open(function(){_check.CheckCount()})}},{content:_content,title:"分享到朋友们"})};var _mod;return{Open:function(list){_list=list;if(!_mod){_mod=new mod()}_mod.Show(list)}}})()})();Core.ViewFile=(function(){var changeData=function(condition,item){for(var k in item){if(condition[k]){if
1(k=="n"&&!item[k]){item[k]=""}var val=item[k];item[k]=null;delete item[k];if(k=="n"&&typeof val=="string"){val=val.replace(/`/g,"-").replace(/\$/g,"-").replace(/\^/g,"-")}item[condition[k]]=val}}};var getFileAttrII=function(item){var main=Ext.CACHE.FileMain?Ext.CACHE.FileMain:{};var ac=main.Setting.GetActive();var str=' rel="item" file_type="1" cid="{category_id}" file_mode="{file_mode}" user_ptime="{user_ptime}" is_share="{is_share}" pick_expire="{pick_expire}" file_size="{file_size}" file_id="{file_id}" file_status="{file_status}" area_id="{area_id}" p_id="'+ac.cid+'" ico="{ico}" pick_code="{pick_code}" is_collect="{is_collect}" has_desc="{has_desc}" is_q="{q}"';if(item.path){str+=(item.path?' path="{path}" ':"")}str+=(item.sha1?' sha1="{sha1}"':"");return str};var getDom=function(item){changeData({n:"file_name",aid:"area_id",cid:"category_id",s:"file_size",sta:"file_status",pt:"pick_time",pc:"pick_code",p:"has_pass",m:"is_mark",t:"user_ptime",d:"has_desc",c:"is_collect",sh:"is_share",e:"pick_expire",fid:"file_id",ico:"ico",dp:"dir_path",ns:"file_name_show",u:"path",sha:"sha1"},item);return $(String.formatmodel("<li "+getFileAttrII(item)+'><span field="file_name" title="{file_name}">{file_name}</span></li>',item))};var setApi=function(){VW.Screen.Actions={next:function(info,callback){var main=Ext.CACHE.FileMain;var ac=main?main.Setting.GetActive():{};var data={file_id:info.file_id,next:1,order:ac.order,is_asc:ac.is_asc,cid:ac.cid||"",limit:Number(USER_SETTING.page_num)||30,offset:0};if(oofUtil.getQueryParamByKey("offset")){data.offset=Number(oofUtil.getQueryParamByKey("offset"))+Number(USER_SETTING.page_num||30)}if(ac.type){data.filter_type=ac.type}Core.DataAccess.FileRead.GetOtherImg(data,function(r){var doms=[];if(r.state){for(var k in r.data){var item=r.data[k];var itemNode=getDom(item);doms.push({pick_code:itemNode.attr("pick_code"),file_id:itemNode.attr("file_id"),min_pic:itemNode.attr("path"),file_size:itemNode.attr("file_size"),file_name:itemNode.find("[field='file_name']").attr("title"),sha1:itemNode.attr("sha1"),jdom:itemNode})}}if(doms.length){callback&&callback(doms)}else{callback&&callback(false)}})},star:function(info,callback){var file_id=info.jdom.attr("file_id");var star=1;if(info.is_star){star=0}Core.FileAjax.Star(file_id,star,function(ids,star){Core.FileConfig.DataAPI&&Core.FileConfig.DataAPI.Star(Core.FileConfig.aid,Core.FileConfig.cid,[info.jdom],star);callback&&callback(star);info.is_star=star;if(star){Core.MinMessage.Show({text:"成功设置星标",type:"suc",timeout:2000})}else{Core.MinMessage.Show({text:"成功取消星标",type:"suc",timeout:2000})}})},download:function(info){if(info.jdom){var pick_code=info.jdom.attr("pick_code");Core.FileAPI.Download(pick_code)}else{Core.MinMessage.Show({text:"文件正在进入云端,请稍候重试",type:"inf",timeout:2000})}},del:function(info,callback){var list=[info.jdom];Core.FileAPI.DeleteFile(list,callback)},share:function(info){var Main=Ext.CACHE.FileMain;if(info.jdom){var list=[info.file_id];Main.ShareMApi.Share(list,info.ico,0,[info.jdom])}else{Core.MinMessage.Show({text:"文件正在进入云端,请稍候重试",type:"inf",timeout:2000})}},magic:function(info){if(!info||!info.file_id){return false}window.open("/?ct=meitu&file_id="+info.file_id)},prev:function(info,callback){var ac=Ext.CACHE.FileMain?Ext.CACHE.FileMain.Setting.GetActive():{},f_type;if(ac.type){f_type=ac.type}else{callback&&callback(false);return}Core.FileConfig.DataAPI.ReInstance({type:f_type,prev_page:true,callback:function(r){var doms=[];if(r.state){r.data=[""].concat(r.data);for(var k in r.data){var item=r.data[k];var itemNode=getDom(item);doms.push({pick_code:itemNode.attr("pick_code"),file_id:itemNode.attr("file_id"),min_pic:itemNode.attr("path"),file_size:itemNode.attr("file_size"),file_name:itemNode.find("[field='file_name']").attr("title"),sha1:itemNode.attr("sha1"),jdom:itemNode})}}if(doms.length){callback&&callback(doms)}else{callback&&callback(false)}}})}}};var loadJs=function(callback){Util.Load.JS(top.STATIC_DIR+"/plug/viewer/Viewer.js?v="+top.VIEWER_VERSION,callback)};var getFileAttr=function(){var str=' file_type="1" is_share="{is_share}" file_size="{file_size}" file_id="{file_id}" area_id="{area_id}
1" p_id="{category_id}" ico="{ico}" pick_code="{pick_code}" ';return str};return{AddMusic:function(arr,isplay,is_album,tid,fidsArr,shareId){var fids=[];var res=false;if(fidsArr&&fidsArr.length){fids=fidsArr;res=true}else{for(var i=0,len=arr.length;i<len;i++){var item=arr[i];var fileName=item.find('[field="file_name"]').attr("title");var suffix="";var fileName=item.find("[field='file_name']").attr("title");if(!fileName){continue}if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}var musicType=["mp3","ape","flac","wav","m4a","wma"],suffixType=suffix.toLowerCase();if($.inArray(suffixType,musicType)!=-1){res=true;var fid=item.attr("file_id");if(item.attr("area_id")==99){fid=item.attr("pick_code")}fids.push(fid)}}}if(!res){Core.MinMessage.Show({text:"音频播放器只支持mp3、ape、flac、wav、m4a、wma文件播放",type:"war",timeout:2000});return false}if(!tid){Util.Cookie.set("OOF_MPLAY_LIST_SHARE_ID",shareId||"",1);Util.Cookie.set("OOF_MPLAY_LIST",fids.join(","),1)}Core.FileAPI.OpenMusic();return fids},ListMusic:function(dataList){var TOP=top.window;TOP.Core.CloudMusic.GetCate(function(r){var arr={};for(var k in r){var item=r[k];arr["al_"+item.topic_id]={text:item.topic_name}}arr.br1={isline:true};arr.create_al={text:"添加专辑"};menu=$(TOP.Core.FloatMenu.GetMenuHtml(arr));window.console&&console.log(menu)})},Run:function(fileDom){console.log("item_fileName_Click");if(!window.UPLOAD_CONFIG["3"]["upload_type_limit"].includes("dng")){window.UPLOAD_CONFIG["3"]["upload_type_limit"].push("dng")}if(!window.UPLOAD_CONFIG["3"]["upload_type_limit"].includes("webp")){window.UPLOAD_CONFIG["3"]["upload_type_limit"].push("webp")}var type="";var suffix="";var fileName=fileDom.find("[field='file_name']").attr("title");var downAction=fileDom.attr("down_action");if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}for(var k in window.UPLOAD_CONFIG){var item=window.UPLOAD_CONFIG[k];if(typeof item.upload_type_limit=="object"&&$.inArray(suffix.toLowerCase(),item.upload_type_limit)!=-1){type=k;break}}var isArchive=["rar","zip","7z","tar"];if($.inArray(fileDom.attr("ico"),isArchive)!=-1){Core.FileAPI.OpenRAR(fileDom.attr("pick_code"));return false}if(fileDom.attr("iv")==1){if(Core.FilePermission.Vip()||window.IS_PREVIEW_CARD){if(fileDom.attr("ico").toLowerCase()=="swf"){Core.FileAPI.OpenSWF(fileDom.attr("pick_code"))}else{Core.FileAPI.OpenVideo(fileDom.attr("pick_code"))}}else{var _=function(){top.oofUtil.vipDialog.Show({win:top.window,vip:true,notVip:true,user_info:{mark1:0,user_id:window.USER_ID||"",user_name:window.USER_NAME||""}})};if(!top.oofUtil||!top.oofUtil.vipDialog){top.Util.Load.JS(__uri("//cdnres.115.com/site/static/plug/vip_dialog/vip.dialog.js?v=1785999762149"),_)}else{_()}return false;var setting={title:"由于该功能会产生高昂带宽与硬件成本,升级VIP才可使用",text:"",confirm_link:"//vip.115.com",confirm_text:"马上升级",confirm_cls:"btn"};if(window._SHOWVIPDIALOG_){window._SHOWVIPDIALOG_.Show(setting)}else{$.getScript(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js"),function(){window._SHOWVIPDIALOG_.Show(setting)})}}return false}switch(Number(type)){case 2:Core.FileAPI.OpenDoc(fileDom.attr("pick_code"),fileDom.attr("ico"));break;case 3:var info={pick_code:fileDom.attr("pick_code"),file_id:fileDom.attr("file_id"),min_pic:fileDom.attr("path"),sha1:fileDom.attr("sha1")};var picList=[];var listBox=fileDom.parents('[rel="list"]');listBox.find('[rel="item"][path]').each(function(){var itemNode=$(this);var suffix="";var fileName=itemNode.find("[field='file_name']").attr("title");if(fileName.lastIndexOf(".")!=-1){suffix=fileName.substring(fileName.lastIndexOf("."),fileName.length).replace(".","")}var item=window.UPLOAD_CONFIG["3"];if(typeof item.upload_type_limit=="object"&&$.inArray(suffix.toLowerCase(),item.upload_type_limit)!=-1){var obj={pick_code:itemNode.attr("pick_code"),file_id:itemNode.attr("file_id"),min_pic:itemNode.attr("path"),file_size:itemNode.attr("file_size"),file_name:itemNode.find("[field='file_name']").attr("title"),sha1:itemNode.attr("sha1"),is_star:Number(itemNode.find('[menu="star"]').attr("is_star"))?1:0,jdom:itemNode};if(suffix.toLowerCase()=="svg"){obj.is_svg=1}var ind=picList.push(obj);obj.ind=ind-1;if(info.pick_code==obj.pick_code){info=obj}}});if(!window.VW){loadJs(function(){VW.Initial();setApi();if(fileDom.attr("area_id")=="99"){VW.Screen.Actions.star=false;VW.Screen.Actions.share=false;VW.Screen.Actions.magic=false}VW.Screen.Open(info,picList)})}else{setApi();if(fileDom.attr("area_id")=="99"){VW.Screen.Actions.star=false;VW.Screen.Actions.share=false;VW.Screen.Actions.magic=false}VW.Screen.Open(info,picList)}break;default:if(suffix.toLowerCase()=="torrent"){Ext.OffLine.AddTask(fileDom.attr("sha1"));return false;if(Core.FilePermission.Vip()){Ext.OffLine.AddTask(fileDom.attr("sha1"))}else{var setting={title:"由于该功能会产生高昂带宽成本,升级VIP才可使用",text:"",confirm_link:PAGE_PATHS.VIP+"/order/buy/?p=offline_down",confirm_text:"马上下载",confirm_cls:"bt
1n"};if(window._SHOWVIPDIALOG_){window._SHOWVIPDIALOG_.Show(setting)}else{$.getScript(__uri("//cdnres.115.com/site/static/plug/vip_pay/vip.pay.js"),function(){window._SHOWVIPDIALOG_.Show(setting)})}}return}if(downAction){top.window[downAction]&&top.window[downAction](fileDom)}else{Core.FileAPI.DownloadSomeFile([fileDom])}break}},Show:function(type,data){if(data&&data.sha1){Core.DataAccess.FileRead.GetInfoBySha1(data.sha1,function(r){if(r.state){if(r.data&&r.data.all_url){var postData={};postData.url=r.data.img_url;postData.all_url=r.data.all_url;postData.source_url=r.data.url;var itemNode=$(String.formatmodel("<div "+getFileAttr()+'><span field="file_name" title="{file_name}"></span></div>',r.data));var info={pick_code:itemNode.attr("pick_code"),file_id:itemNode.attr("file_id"),min_pic:postData.all_url&&postData.all_url.length?postData.all_url[0]:false,file_size:itemNode.attr("file_size"),file_name:itemNode.find("[field='file_name']").attr("title"),jdom:false,ind:0,source:postData};if(type==3){delete info.source}var picList=[info];if(!window.VW){loadJs(function(){VW.Initial();VW.Screen.Actions=false;VW.Screen.Open(info,picList)})}else{VW.Screen.Actions=false;VW.Screen.Open(info,picList)}return false}}Core.MinMessage.Show({text:"文件暂不能预览",type:"war",timeout:2000})})}},Close:function(){},LoadJs:loadJs,SetApi:setApi}})();(function(){Core.ShareDG=(function(){var _cache={};var model=function(){var _content=$('<iframe style="width:100%; display:block;border-radius:0 0 5px 5px; height: 237px;" frameborder=0 src=""></iframe>'),_self=this;var _top=Util.Override(Core.DialogBase,_self,{Initial:function(){if(/firefox/.test(navigator.userAgent.toLowerCase())){_content.on("load",function(){try{var win=$(this.contentWindow);$(win).on("keydown",function(e){if(e.keyCode==27){return false}})}catch(e){}})}},Title:function(t){_self.warp.find('[rel="base_title"]').html(t?t:"分享文件")},Open:function(){_top.Open(function(){_content.attr("src","/?ct=share&ac=share_new")})},Reset:function(width,height,notcenter){if(width){_self.warp.width(width)}if(height){_content.height(height)}if(!notcenter){Util.Layer.Center(_self.warp)}},Close:function(){window.setTimeout(function(){_content.attr("src","");_top.Close()},10)}},{content:_content,title:"分享文件",width:468})};var editDesc=function(code,oldRmark,callback){if(!oldRmark){oldRmark=""}var editCon=$('<div class="dialog-input"><input type="text" rel="txt" class="text" maxlength="50" /></div><div class="dialog-bottom"><div class="con"><a href="javascript:;" class="button" btn="confirm">确定</a></div></div>');var editBox=new Core.DialogBase({title:oldRmark?"修改礼包备注":"添加礼包备注",content:editCon});editBox.Open();var textBox=editCon.find("[rel='txt']");textBox.val(oldRmark);var renameFolderFun=function(e){var desc=$.trim(textBox.val());if(desc!=""){if(desc.length>50){Core.MinMessage.Show({text:"礼包备注最多只能包含50个字",type:"war",timeout:2000});textBox.focus();return false}Core.MinMessage.Show({text:"正在修改礼包备注...",type:"load",timeout:10000});changeDescData(code,desc,function(r){if(r.state){desc=Util.Text.htmlspecialchars(desc);callback&&callback(code,desc);editBox.Close();Core.MinMessage.Show({text:oldRmark?"成功修改礼包备注":"成功添加礼包备注",type:"suc",timeout:2000})}else{Core.MinMessage.Show({text:r.message,type:r.errtype||"err",timeout:2000});textBox.focus()}})}else{callback&&callback(code,desc)}};editCon.find("[rel='txt']").bind("keydown",function(e){if(e.keyCode==13){renameFolderFun(e)}else{if(e.keyCode==27){editBox.Close()}}});editCon.find("[btn]").bind("click",function(e){switch($(this).attr("btn")){case"confirm":renameFolderFun(e);break;case"cancel":editBox.Close();break}return false});textBox.focus();window.setTimeout(function(){textBox.select()},20)};var changeDescData=function(code,desc,callback){$.ajax({url:"/?ct=filegift&ac=update_remark",type:"POST",dataType:"json",data:{gift_code:code,remark:desc},success:function(r){callback&&callback(r)}})};return{ShareFriend:function(file_list){if(!Core.FilePermission.Vip()){Core.Message.Confirm({text:"此功能升级VIP方可使用!",type:"war",confirm_link:"https://vip.115.com/?p=do_friend",confirm_text:"升级VIP"});return}Core.Message.Confirm({text:"",type:"war",content:'<b style="color: #F55F5F;">
1警告!严禁上传包括反动、暴力、色情、违法及侵权内容的文件;严格遵守保密法律法规,任何危害国家秘密的行为,都必须受到法律追究。</b>',confirm_text:"继续发送",callback:function(res){if(res){var back=function(){Core.ShareDG.Close();var sending=false;window.oofUtil.memberSelector.show({max_count:15,callback:function(data){var user_ids=data.selectMembers;var fdata={};for(var i=0,len=file_list.length,tmp;i<len;i++){var $item=file_list[i];if($item.attr("file_type")=="0"){fdata[$item.attr("pick_code")]={t:"folder",n:$item.attr("cate_name"),s:0,sha1:"",folder:1}}else{fdata[$item.attr("pick_code")]={t:$item.attr("ico"),n:$item.find("[field='file_name']").attr("title"),s:$item.attr("file_size"),sha1:$item.attr("sha1")}}}function sendMsg(users,fdata){var msg=JSON.stringify({b:"",a:fdata});function _(i,s){var u=users[i];if(!u){Core.FrameDG.Close();Core.MinMessage.Show({text:"发送成功",type:"suc",timeout:2000});return}Core.MinMessage.Show({text:"正在发送("+(i+1)+"/"+users.length+")",type:"load",timeout:100000});oofUtil.bridge.msg({url:"/?ac=send_m",data:{fn:"",tid:Number(u).toString(36),tt:1,m:msg,tn:null,q_anonymous:0},dataType:"json",type:"post",success:function(json){try{if(json.state){setTimeout(function(){_(i+1)},200)}else{if(i==0||(s&&s>5)){Core.MinMessage.Show({text:json.message||"网络异常",type:"err",timeout:2000});sending=false}else{setTimeout(function(){_(i,(s||0)+1)},1000)}}}catch(e){}},error:function(){if(i==0){Core.MinMessage.Show({text:"网络异常",type:"err",timeout:2000});sending=false}else{setTimeout(function(){_(i)},1000)}}})}_(0)}sendMsg(user_ids,fdata)}})};if(window.oofUtil&&window.oofUtil.memberSelector){back()}else{$.getScript("//cdnassets.115.com/??/libs/json2.js,ajax/bridge.js,oofUtil/template.js,plug/memberSelector/memberSelector.js?v=1",function(){back()})}}}})},SetHeight:function(h){if(_cache.box){_cache.box.Reset(false,h,false)}},SetWidth:function(w){if(_cache.box){_cache.box.Reset(w,false,false)}},Title:function(t){if(_cache.box){_cache.box.Title(t)}},Open:function(list){this.ShareFriend(list);return;_cache.list=list;if(!_cache.box){_cache.box=new model()}_cache.gift_object=false;_cache.box.Open()},GetFileList:function(){return _cache.list},Close:function(){if(_cache.box){_cache.box.Close()}},GetGift:function(){return _cache.gift_object},MarkGift:function(obj){_cache.gift_object=obj},EditGiftDesc:function(code,oldRmark,callback){editDesc(code,oldRmark,callback)},ChangeGiftDescData:function(code,desc,callback){changeDescData(code,desc,callback)}}})()})();(function(){Core.HideFile=(function(){var _selectDG;var pwd;var saveVaildType=function(t,pwd,callback){if(!pwd){pwd=""}$.ajax({url:"/?ct=hiddenfiles&ac=open",type:"POST",data:{valid_type:t,pwd:pwd},dataType:"json",cache:false,success:function(r){if(r.state){USER_SETTING.valid_type=Number(t)}callback&&callback(r)}})};var showSelectDG=function(callback,notCheck){if(!_selectDG){_selectDG=new Core.FrameBaseDG({ready:function(win){win.CALL_BACK=function(type){if(!notCheck){check(type,callback)}else{callback&&callback(type)}window.setTimeout(function(){_selectDG.Close()},10)};win.Reset=_selectDG.Reset}})}_selectDG.Show(STATIC_DIR+"/"+PLUG_PATH+"/hidefile/select.html?v="+VIEWER_VERSION);_selectDG.Reset(620,160);_selectDG.ResetTitle("选择校验方式")};var openCheckFrame=function(type,callback,hash,failCallback,body){function _(){var $dom,dg;if(body){$dom=$('<div style="position: fixed;top: 0;right: 0; left: 0;bottom: 0; z-index: 100"><iframe frameborder="0" src="" style="height: 100%; width: 100%; background: #fff"></iframe></div>');$(body).append($dom);dg={Close:function(type){$dom.remove();if(type!="confirm"){failCallback&&failCallback()}}}}else{$dom=$('<div class="dialog-frame"><iframe frameborder="0" src="" style="height: 380px;border-radius:5px;"></iframe></div>');dg=new Core.DialogBase({title:"安全密钥",content:$dom,width:500});var _Close=dg.Close;dg.Close=function(type){_Close();if(type!="confirm"){failCallback&&failCallback()}};dg.Open(function(){dg.warp.find('[rel="title_box"],.dialog-handle').remove();dg.warp.css({border:"none"})})}$dom.find("iframe").on("load",function(){var win=this.contentWindow;var $body=$(win.document.body);var reg=/^\d*$/,$code=$body.find("#js_old_code");$body.find('[rel-btn="close"]').on("click",function(){dg&&dg.Close();return false});$code.on("keyup",function(e){var val=$(this).val();if(!reg.test(val)){$(this).val(val.replace(/\D/gi,""));$.alertTip("请输入6位数字安全密钥")}});$body.find("#js-post_submit").on("click",function(){var code=$.trim($code.val());if(!code.length){$.alertTip("请输入安全密钥");return false}callback&&callback(type,code);dg&&dg.Close("confirm");return false});$(win).on("keydown",function(e){if(e.keyCode==27){dg&&dg.Close();return false}else{if(e.keyCode==13){$body.find("#js-post_submit").click();return false}}});try{setTimeout(function(){$code.focus()},300)}catch(e){}});if(body){$dom.find("iframe").attr("src","//cdnres.115.com/q/static/static_v9.0/resource/superpwd.page.html?v="+VIEWER_VERSION)}else{$dom.find("iframe").attr("src","//cdnres.115.com/q/static/static_v9.0/resource/superpwd.common.html?v="+VIEWER_VERSION)}}$.ajax({url:"//passportapi.115.com/app/1.0/web/8.2/user/security_key_status",dataType:"json",xhrFields:{withCredentials:true},success:function(json){if(json.state&&json.data){if(json.data.is_new){_()}else{try{top.$.alertTip(json.data.is_set?"安全升级,请先重置安全密钥,再进行操作":"请先设置安全密钥,再进行操作")}catch(e){}setTimeout(function(){if(json.data.is_set){function loadCallback(){top.oofUtil.SuperPasswordDG.showDialog({callback:function(data){if((data&&data.reload)||(data&&data.success)){if
1(data.success){_()}}else{}}})}if(!top.window.oofUtil.SuperPasswordDG){top.$.getScript("//aq.115.com/m_r/static/super_password/ChangeOldSuperPasswordDG.js",loadCallback)}else{loadCallback()}return false}top.location.href="//"+document.domain+"/?nav=safe&mode=my_set&open="+(json.data.is_set?"forgot_superpwd":"superpwd")},1000)}}else{try{top.$.alertTip(json.message||json.error||"网络异常,请刷新再试")}catch(e){alert(json.message||json.error||"网络异常,请刷新再试")}}}});return;var url=STATIC_DIR+"/"+PLUG_PATH+"/hidefile/";if(type==1){url+="safe_password.html"}else{if(type==2){url+="safe_mobile.html"}}url+="?v="+VIEWER_VERSION;if(hash){url+="#"+hash}Core.FrameDG.Open(url,{title:"安全验证",width:700,height:365,ready:function(win){win.CALL_BACK=function(type,val){callback&&callback(type,val)}}})};var checkUInfo=function(callback){$.ajax({url:"/?ct=hiddenfiles&ac=uinfo",cache:false,dataType:"json",type:"GET",success:function(r){if(r.state){callback&&callback(r.data)}else{Core.MinMessage.Show({text:r.error,type:"war",timeout:2000})}}})};var check=function(type,callback,notAlert,failCallback,body){checkUInfo(function(data){if(!data.super_passwd){Core.Message.Confirm({text:"你还没有设置安全密钥。",content:"安全密钥是账号枫币支出、回收站、空间卡等关键操作的重要操作凭证。",type:"inf",confirm_link:"//"+document.domain+"/?nav=safe&mode=my_set&open=superpwd",confirm_text:"立即设置"})}else{openCheckFrame(type,callback,null,failCallback,body)}})};var setHideList=function(val,arr,callback){var data={};for(var i=0,len=arr.length;i<len;i++){var item=arr[i];if(item.attr("file_type")=="1"){data["fid["+i+"]"]=item.attr("file_id")}else{if(item.attr("file_type")=="0"){data["fid["+i+"]"]=item.attr("cate_id")}}}data.hidden=val;UA$.ajax({url:"/files/hiddenfiles",data:data,type:"POST",dataType:"json",success:function(r){if(r.state){callback&&callback();var show_state=Number(Core.NewSetting.Get("show"));if(show_state){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.UpdateHide(data.hidden,arr)}}else{Core.MinMessage.Show({text:val=="1"?"成功加密隐藏文件":"成功取消加密文件",timeout:Core.CONFIG.MsgTimeout,type:"suc"});if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Del(Core.FileConfig.aid,Core.FileConfig.cid,arr)}}try{Core.FileConfig.DataAPI.Nocheck()}catch(e){}}else{Core.MinMessage.Show({text:r.error,timeout:Core.CONFIG.MsgTimeout,type:"err"})}}})};var showFirst=function(callback){Core.FrameDG.Open(STATIC_DIR+"/"+PLUG_PATH+"/hidefile/first.html?v="+VIEWER_VERSION,{title:"开启文件加密隐藏功能",width:700,height:365,ready:function(win){win.CALL_BACK=function(){callback&&callback()}}})};var showErrMsg=function(r,callback){setTimeout(function(){if(callback){if(callback(r)){return false}}if(r.errno==320005){Core.Message.Confirm({text:"你还没有设置安全密钥。",content:"安全密钥是账号枫币支出、回收站、空间卡等关键操作的重要操作凭证。",type:"inf",confirm_link:"//115.com/?nav=safe&mode=my_set&open=superpwd",confirm_text:"立即设置"})}else{if(r.errno==320006){Core.Message.Confirm({text:"请先绑定手机。",type:"inf",confirm_link:"//115.com/?nav=safe&mode=my_set&open=bind_mobile",confirm_text:"立即绑定"})}else{if(r.errno==40107016){$.confirm({text:r.error,confirm_link:"//115.com/?nav=safe&open=forgot_superpwd&mode=my_set",confirm_text:"忘记密钥"})}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:2000})}}}},50)};return{OpenSelectDG:function(){showSelectDG(function(type){var oldType=Number(Core.NewSetting.Get("valid_type"));if(oldType!=0&&oldType!=Number(type)){openCheckFrame(oldType,function(otype,pwd){saveVaildType(type,pwd,function(r){if(r.state){Core.MinMessage.Show({text:"成功修改验证方式",type:"suc",timeout:2000});Core.FrameDG.Close()}else{showErrMsg(r)}})},encodeURIComponent("修改验证方式需要进行"+(type==2?"安全密钥验证":"短信验证")))}},true)},SetFile:function(val,list,cb){var valid_type=Number(Core.NewSetting.Get("valid_type"));if(val==1&&valid_type==0){showFirst(function(r){showSelectDG(function(type){openCheckFrame(type,function(type,pwd){saveVaildType(type,pwd,function(r){if(r.state){Core.MinMessage.Show({text:"成功修改验证方式",type:"suc",timeout:2000});setHideList(val,list,cb);Core.FrameDG.Close()}else{Core.MinMessage.Show({text:r.error,type:"err",timeout:2000})}})},encodeURIComponent("修改验证方式需要进行"+(type==2?"安全密钥验证":"短信验证")))},true)})}else{Core.Message.Confirm({text:val==1?"确认要加密隐藏吗?":"确认要取消加密吗?",type:"inf",callback:function(res){if(res){setHideList(val,list,cb)}
1}})}},SettingStatus:function(status,callback,notAlert,failCallback,errorCallback,body){var oldVal=Number(Core.NewSetting.Get("show"));var valid_type=Number(Core.NewSetting.Get("valid_type"));var val=status;if(oldVal==val){if(notAlert){callback&&callback(pwd)}return}var postFun=function(type,pwd){$.ajax({url:"/?ct=hiddenfiles&ac=switching",data:{show:val,valid_type:type,safe_pwd:pwd},type:"POST",cache:false,dataType:"json",success:function(r){if(r.state){USER_SETTING.show=Number(val);USER_SETTING.valid_type=Number(type);if(Number(Core.NewSetting.Get("show"))==1){Core.FrameDG.Close()}if(callback){callback(pwd)}else{if(val){if(Core.FileConfig.DataAPI){Core.FileConfig.DataAPI.Reload()}}else{window.wangpan&&window.wangpan.Main.GotoDir(0,0,0)}}}else{if(valid_type==0&&notAlert&&callback){callback(pwd);return}showErrMsg(r,errorCallback)}}})};if(val==0){postFun(valid_type,"")}else{check(valid_type,function(type,pwd){postFun(type,pwd)},notAlert,failCallback,body)}}}})()})();Core.YunUnzipDG=(function(){var _cache={};var tpl={unzip_file_list:'<div class="unzip-file-wrap"><div class="file-path"></div><div class="headline"><label class="sel-label"><input type="checkbox"></label><span class="desc">文件</span><div class="side" style="display: none;"><a href="javascript:;" btn="choose_file" class="button btn-line"><span>解压到</span></a><a href="javascript:;" btn="download" class="button btn-line"><span>下载</span></a></div></div><div class="list"><ul></ul></div><div id="js-loading" ><div style="display:flex; justify-content: center; align-items: flex-end"><div class="ex-popoup-hint exph-loader"><s></s><span>正在加载</span></div></div></div></div><div class="dialog-action"><a href="javascript:;" class="dgac-confirm">全部解压</a><a href="javascript:;" class="dgac-cancel">关闭</a></div>',unzip_file_item_folder:'<li file_category={file_category} file_name={file_name} cate_name={file_name} item={itemStr} file_size={size} file_type={file_category}><label class="sel-label"><input type="checkbox"></label><i class="file-type tp-folder"></i><div class="file-name" style="cursor: pointer"><span>{file_name}</span></div><div class="side"><a btn="choose_file" href="javascript:;" class="button btn-line"><span>解压到</span></a><a btn="download" href="javascript:;" class="button btn-line"><span>下载</span></a></div></li>',unzip_file_item:'<li file_category={file_category} file_name={file_name} item={itemStr} file_size={size} file_type={file_category}><label class="sel-label"><input type="checkbox"></label><i class="file-type tp-{ico}"></i><div class="file-name"><span class="name" field="file_name" title={file_name}>{file_name}</span><span class="info"><em>{file_size}</em><em>{file_time}</em></span></div><div class="side"><a btn="choose_file" href="javascript:;" class="button btn-line"><span>解压到</span></a><a btn="download" href="javascript:;" class="button btn-line"><span>下载</span></a></div></li>'};function getFilePath(paths){return paths.map(function(path,index){return'<a href="javascript:;">'+path+"</a>"+(index!==paths.length-1?"<i>›</i>":"")})}var html_911='<div style="z-index: 10000000001; height: 100%; left: 0px; position: fixed; top: 0px; width: 100%; opacity: 0.8; background: none 0px 0px repeat scroll rgb(0, 0, 0);"><div style="height:100%;width:100%;"></div></div><div style="position: fixed; top: 50%; left: 50%; z-index: 10000000002; width: 360px; height: 500px; margin: -250px 0 0 -180px;"><iframe src="//captchaapi.115.com/?ac=security_code&type=web&cb={guid}" frameborder="0" style="width: 100%; height: 100%;"></div>';function show911(callback){if(show911.$dom){return}var cb="Close911_"+(+new Date);show911.$dom=$dom=top.$(html_911.replace("{guid}",cb)).appendTo(top.document.body);top[cb]=function(){show911.$dom=null;$dom.remove();callback&&callback()}}function downloadFiles(pickCode,dirs,files){if(dirs&&dirs.length>0){dirs.forEach(function(item){$.ajax({url:"//webapi.115.com/files/extract_folders",type:"get",dataType:"json",data:{pick_code:pickCode,full_dir_name:item},success:function(rs){if(rs.state){$.alertTip("已添加到下载列表");var fileArr=[];rs.data.forEach(function(dataItem){fileArr.push(dataItem.pt+"/"+dataItem.fn)});downloadFiles(pickCode,null,fileArr)}else{$.alertTip(rs.message)}}})})}if(files&&files.length>
10){files.forEach(function(item){function _(){function dodata(rs){if(rs.state){var newWindow=window.open("","_blank");newWindow.location.href=rs.data.url}else{if(rs.code==911){show911(function(){_()});return}else{$.alertTip(rs.message||rs.error)}}}$.ajax({url:"//webapi.115.com/files/extract_down_file",type:"get",data:{dl:1,pick_code:pickCode,full_name:item},dataType:"JSON",success:function(rs){if(rs.data&&rs.data.file_url_302){$.ajax({url:rs.data.file_url_302,type:"GET",dataType:"json",cache:false,xhrFields:{withCredentials:true},success:function(rs){dodata(rs)}})}else{dodata(rs)}}})}_()})}}function showSelectFileDesc(dg){var count=0;dg.warp.find("ul li input").each(function(){if($(this).prop("checked")){count++}});if(count==dg.warp.find("ul li input").length){dg.warp.find(".headline input").prop("checked",true)}else{dg.warp.find(".headline input").prop("checked",false)}if(count==0){dg.warp.find(".headline .desc").text("文件");dg.warp.find(".headline .side").hide()}else{dg.warp.find(".headline .desc").text("已选中"+count+"个文件/文件夹");dg.warp.find(".headline .side").show()}}function verfiyFileCount(pickCode,dirs,files){$.ajax({url:"//webapi.115.com/files/extract_folders",type:"post",dataType:"json",data:{pick_code:pickCode,full_dir_name:dirs.join(","),full_file_name:files.join(",")},success:function(rs){if(rs.state&&rs.data.limit_state){downloadFiles(pickCode,dirs,files)}else{if(rs.code===51008){$.alertTip("最高支持1万的文件操作数量,请减少选择的文件")}else{$.alertTip(rs.message)}}}})}var checkOpenBrowser=function(list,downInfo,options,dirs,files){function getToken(cb,tf){$.ajax({url:"//qrcodeapi.115.com/api/1.0/web/1.0/token",dataType:"json",success:function(json){if(json.state){cb(json.data)}else{if(tf){cb(null)}else{getToken(cb,true)}}},error:function(){if(tf){cb(null)}else{getToken(cb,true)}}})}function check(cb,data){$.ajax({url:"//qrcodeapi.115.com/get/status/",dataType:"json",data:data,timeout:11000,success:function(json){if(json.state&&json.data&&json.data.status==24){cb(true)}else{cb(false)}},error:function(){cb(false)}})}function wait(data,cb){var start=+new Date;wait.start=start;wait.timer&&clearTimeout(wait.timer);function n(){check(function(tf){if(tf){cb(true)}else{if(new Date-start<10000){if(wait.start!=start){return}wait.timer=setTimeout(function(){n()},200)}else{cb(false)}}},data)}wait.timer=setTimeout(function(){n()},30)}function versionCompare(stra,strb){var straArr=stra.split(".");var strbArr=strb.split(".");var maxLen=Math.max(straArr.length,strbArr.length);var result,sa,sb;for(var i=0;i<maxLen;i++){sa=~~straArr[i];sb=~~strbArr[i];if(sa>sb){result=1}else{if(sa<sb){result=-1}else{result=0}}if(result!==0){return result}}return result}function getDownInfo(){var _browserList=[];for(var i=0;i<list.length;i++){_browserList.push({is_dir:+list[i].attr("file_type")?false:true,n:list[i].attr("file_name"),pc:_cache.data.pick_code})}var postObj={list:_browserList,count:_browserList.length,ref_url:window.location.href};return encodeURIComponent(window.JSON.stringify(postObj))}function openBrowser(href){var a=document.createElement("a"),event=null;if("function"==typeof MouseEvent){event=new MouseEvent("click",{bubbles:!0,cancelable:!1})}else{event=document.createEvent("MouseEvents");event.initEvent("click",true,false)}a.href=href;a.dispatchEvent(event)}if(window.browserInterface){if(versionCompare(browserInterface.GetBrowserVersion()||"","23.9.3")>=0){var postObj=getDownInfo();window.browserInterface.CreateDownloadTask(postObj)}else{showDownLoadBox(list,options)}}else{loadTip("正在启动115浏览器,请稍等…",20000);getToken(function(data){var uid=window.USER_ID||window.user_id;var key=data&&data.uid;openBrowser("browser115://download?uid="+uid+"&key="+key+"&param="+downInfo+"&type=1");wait(data,function(tf){closeTip();if(!tf){showDownLoadBox(list,options)}})})}};function closeTip(){closeTip.timer&&clearTimeout(closeTip.timer);top.window.Core&&top.window.Core.MinMessage.Hide()}function loadTip(text,container,timer){if($.isNumeric(container)){timer=container;container=null}if(top.window.Core&&top.window.Core.MinMessage){closeTip.timer&&clearTimeout(closeTip.timer);
1closeTip.timer=setTimeout(function(){top.window.Core.MinMessage.Show({text:text,type:"load",window:container?{warp:container}:null,timeout:timer||10000})},30)}else{alert(text)}}var hasFolder=function(list){var bol=false;for(var i=0;i<list.length;i++){if(+$(list[i]).attr("file_category")===0){bol=true}}return bol};var showDownLoadBox=function(list,options){var hasFol=false;var title="";hasFol=list&&hasFolder(list)||false;if(window.browserInterface){title="当前版本过低,请升级到最新版本下载。"}else{if(options&&options.isWarning){title="当前浏览器不支持极速下载,请使用最新115浏览器下载"}else{if(hasFol){title="你下载的内容包含文件夹,请使用最新115浏览器下载"}else{if(list&&list.length>1){title="不支持多文件批量下载,请使用最新115浏览器下载"}else{title="你下载的文件大小超出限制,请使用最新115浏览器下载"}}}}Core.Message.Confirm({text:'<span style="font-weight:bold;">'+title+"</span>",content:'<span style="color:#999">使用最新115浏览器享受更多特权</span><br/>1. 多线程下载快;<br/>2. 断点续传,掉线也不怕;<br/>3. 支持直接下载文件夹。<br/>4.支持多文件批量下载。',type:"war",confirm_link:"https://pc.115.com/browser.html",confirm_text:"点击下载115浏览器"})};function getDownInfo(list){var postObj={list:list,count:list.length,ref_url:window.location.href};return encodeURIComponent(window.JSON.stringify(postObj))}function openDownLoadModal(_item,filePaths,dirs,files){var con=$('<div class="downloadeasy-dialog"><div class="container"><div class="file-name"><span rel="file_name"></span></div><div class="banner-top"><a href="https://115.com/hd/618?ad4"><img src="//cdnres.115.com/site/static/style_v10.0/act_banner/banner_2021618_download.png"></a></div><div class="download-box"><ul><li><a href="javascript:;" class="button btn-orange" rel="vip_download"><i class="icon ico-fast"></i><em>VIP下载</em></a><span><i></i>VIP专享百G高速线路</span></li><li style=""><a href="javascript:;" class="button" rel="fast_download"><i class="icon ico-udown"></i><em>极速下载</em></a><span><i></i>多线程 加速稳定下载</span></li></ul></div></div></div>');var modalDown=new Core.DialogBase({title:"文件快速下载",content:con,width:530});modalDown.Open(function(){modalDown.warp.find('[rel="file_name"]').text(_item.attr("file_name"));modalDown.warp.find('[rel="vip_download"]').on("click",function(param){var dirs=[],files=[];var paths=filePaths.join("/").replace(/^文件\/?/,"");var item=JSON.parse(decodeURIComponent(_item.attr("item")));var fileName=item.file_name;var fullName=paths+(paths?"/":"")+fileName;if(_item.attr("file_category")==0){dirs.push(fullName)}else{files.push(fullName)}verfiyFileCount(_cache.data.pick_code,dirs,files)});modalDown.warp.find('[rel="fast_download"]').on("click",function(param){checkOpenBrowser([_item],getDownInfo([_item]),{isWarning:true},dirs,files)})},window)}function showUnzipFilesDG(param,arr,nextMarker){$.showContentDG(tpl.unzip_file_list,{title:"云解压",loaded:function(){var dg=this;dg.warp.find(".dialog-action").hide();dg.warp.find("#js-loading").show();$.ajax({url:"//webapi.115.com/files/extract_info",type:"get",data:{pick_code:_cache.data.pick_code,file_name:param.file_name,paths:param.paths,next_marker:param.next_marker,page_count:999},dataType:"JSON",success:function(rs){dg.warp.find("#js-loading").hide();if(rs.state){var list=rs.data.list;if(param.list){list=param.list.concat(list)}if(rs.data.has_file=="true"){dg.Close();param.list=list;param.next_marker=rs.data.next_marker;showUnzipFilesDG(param);return}dg.warp.find(".dialog-action").show();var htmlArr=[];var filePaths=param.paths==""?["文件"]:param.paths.split("/");if(param.file_name){filePaths.push(param.file_name)}dg.warp.find(".file-path").empty().append(getFilePath(filePaths).join(""));dg.warp.find(".file-path a").click(function(){dg.Close();var fileName;var paths;var index=filePaths.indexOf($(this).text());if(index>0){fileName=filePaths[index];paths=filePaths.slice(0,index).join("/")}else{fileName="";paths=""}showUnzipFilesDG({file_name:fileName,paths:paths,win:param.win})});list.forEach(function(item){if(item.file_category==0){item.itemStr=encodeURIComponent(JSON.stringify(item));htmlArr.push(oofUtil.template.format(tpl.unzip_file_item_folder,item))}else{item.file_size=Util.File.ShowSize(item.size);item.file_time=oofUtil.date.formatPhpTimespan(item.time);item.itemStr=encodeURIComponent(JSON.stringify(item));htmlArr.push(oofUtil.template.format(tpl.unzip_file_item,item))}});dg.warp.find("ul").empty().append(htmlArr.join(""));dg.warp.find("ul li label").on("click",function(){showSelectFileDesc(dg)});dg.warp.find(".headline input").on("click",function(){dg.warp.find("ul li input").prop("checked",$(this).prop("checked"));showSelectFileDesc(dg)});dg.warp.find(".headline .side [btn=choose_file]").on("click",function(){var extractFiles=[];var extractDirs=[];dg.warp.find("ul li input").each(function(){if($(this).prop("checked")){var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));var extract_file=item.file_name;if($(this).parents("li").attr("file_category")==0){extractDirs.push(extract_file)}else{extractFiles.push(extract_file)}}});showDestFileDG({pick_code:_cache.data.pick_code,extract_file:extractFiles,extract_dir:extractDirs,paths:filePaths.join("/")},param.win)});dg.warp.find(".headline .side [btn=download]").on("click",function(){var dirs=[],files=[],allList=[];
1dg.warp.find("ul li input").each(function(){if($(this).prop("checked")){var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));var extract_file=item.file_name;var paths=filePaths.join("/").replace(/^文件\/?/,"");var fullName=paths+(paths?"/":"")+extract_file;if($(this).parents("li").attr("file_category")==0){dirs.push(fullName)}else{files.push(fullName)}allList.push($(this).parents("li"))}});var size=top.BROWSER_DOWN_LIMIT||120586240;var _fsize=+$(allList[0]).attr("file_size");var _fileType=+$(allList[0]).attr("file_category");if(allList.length===1&&_fileType===1&&_fsize<size){openDownLoadModal($(allList[0]),filePaths,dirs,files)}else{checkOpenBrowser(allList,getDownInfo(allList),{},dirs,files)}});dg.warp.find("ul li [btn=choose_file]").on("click",function(){var extract_file,extract_dir;var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));if($(this).parents("li").attr("file_category")==0){extract_dir=[];extract_dir.push(item.file_name)}else{extract_file=[];extract_file.push(item.file_name)}showDestFileDG({pick_code:_cache.data.pick_code,extract_file:extract_file,extract_dir:extract_dir,paths:filePaths.join("/")},param.win)});dg.warp.find(".dgac-confirm").on("click",function(){var extractFiles=[];var extractDirs=[];dg.warp.find("ul li input").each(function(){var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));var extract_file=item.file_name;if($(this).parents("li").attr("file_category")==0){extractDirs.push(extract_file)}else{extractFiles.push(extract_file)}});showDestFileDG({pick_code:_cache.data.pick_code,extract_file:extractFiles,extract_dir:extractDirs,paths:filePaths.join("/")},param.win)});dg.warp.find(".dgac-cancel").on("click",function(){dg.Close()});dg.warp.find("ul li .file-name").on("click",function(){if($(this).parents("li").attr("file_category")==0){dg.Close();var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));var fileName=item.file_name;showUnzipFilesDG({file_name:fileName,paths:filePaths.join("/"),win:param.win})}});dg.warp.find("ul li [btn=download]").on("click",function(){var dirs=[],files=[];var list=[$(this).parents("li")];$(list[0]).attr("pick_code",_cache.data.pick_code);var size=top.BROWSER_DOWN_LIMIT||120586240;var _fileType=+$(this).parents("li").attr("file_category");var _fsize=+$(this).parents("li").attr("file_size");var item=JSON.parse(decodeURIComponent($(this).parents("li").attr("item")));var extract_file=item.file_name;var paths=filePaths.join("/").replace(/^文件\/?/,"");var fullName=paths+(paths?"/":"")+extract_file;if($(this).parents("li").attr("file_category")==0){dirs.push(fullName)}else{files.push(fullName)}if(_fileType===1&&_fsize<size){openDownLoadModal($(list[0]),filePaths,dirs,files)}else{checkOpenBrowser(list,getDownInfo(list),{},dirs,files);return false}})}else{$.alertTip(rs.message)}}})}})}function showComplainModal(item,checkData){var addDomplantDG;var resultTip="";if(checkData.status===1){resultTip="恭喜!你申诉的内容已解封!<br>(重新上传文件即可成功)"}else{if(checkData.status===2){resultTip="你申诉的内容未通过,请共同维护清朗的网络环境。"}}var settingObj={data:{sourceData:{complaintStatus:checkData.is_appeal==1,resultTip:resultTip,postParams:{sha1:item.sha1,content:item.content,file_name:item.file_name,appeal_type:item.appeal_type,file_type:item.file_type,extract_id:checkData.extract_id},postUrl:"/files/extract_appeal",img_url:item.img_url,file_name:item.file_name}},closeBtnClick:function(){item.is_appeal=1},dialogClose:function(){addDomplantDG&&addDomplantDG.Close()}};var html_url=__uri("//cdnres.115.com/site/static/components_vue/common/AddFileComplant.html");addDomplantDG=top.Core.SimpleFrameDG.Open("add-Complant",html_url,{title:"申诉",width:700,height:609,ready:function(win){win.addFileComplainInit(settingObj)}})}function showDestFileDG(param,win){Core.FileSelectDG.Open(function(list){var cid=(list&&list.length>0)?list[0].cid:"";$.ajax({url:"//webapi.115.com/files/add_extract_file",type:"post",data:{pick_code:param.pick_code,extract_file:param.extract_file,extract_dir:param.extract_dir,to_pid:cid,paths:param.paths}
1,dataType:"JSON",success:function(rs){if(rs.state){var extract_id=rs.data.extract_id;win=win||window;_cache.win=win;var worker=new win.Worker("/static/plug/main_2014_wl/bg_unzip.js");worker.postMessage({type:"unZip",data:{extract_id:rs.data.extract_id}});worker.onmessage=function(e){if(e.data.type==="update"){if(e.data.data.percent<100){var sucTip='<div class="topfloat-cell"><div class="unzip-suc"><i class="icon-crown"></i><div class="cont">尊贵的VIP会员,文件解压中...('+e.data.data.percent+"%)</div></div></div>";$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(sucTip);setTimeout(function(){worker.postMessage({type:"unZip",data:{extract_id:rs.data.extract_id}})},1000)}else{worker.terminate();var sucTip='<div class="topfloat-cell"><div class="unzip-suc"><i class="icon-crown"></i><div class="cont">尊贵的VIP会员,已为你成功解压文件,<a href="javascript:;">点击查看</a></div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(sucTip);$("body",top.document).find(".topfloat-cell").css("z-index",top.Core.DialogBase.acIndex+1);$("body",top.document).find(".topfloat-cell .close").on("click",function(){$("body",top.document).find(".topfloat-cell").remove()});$("body",top.document).find(".topfloat-cell .cont a").on("click",function(){$("body",top.document).find(".topfloat-cell").remove();window.location.href="//115.com/?cid="+cid+"&offset=0&mode=wangpan"})}}else{if(e.data.type==="error"){$("body",top.document).find(".topfloat-cell").remove();worker.terminate();if(e.data.data&&(e.data.data.code==51017||e.data.data.code==51018)){if(e.data.data.code==51017){$.errorTip("解压失败,含违规内容")}else{Core.Message.Confirm({text:"部分文件解压失败,含违规内容",content:"检测正常的文件可解压成功。",confirm_text:"查看",callback:function(r){if(r){var setting={data:{sid:extract_id,showType:"yunUnzip"},methods:{handleItemClick:function(item){$.ajax({url:"//webapi.115.com/files/extract_appeal_check",type:"post",data:{sha1:item.sha1,content:item.content},dataType:"JSON",success:function(rs){if(rs.state){let data=rs.data;data.extract_id=extract_id;showComplainModal(item,data)}}})}}};var html_url=__uri("//cdnres.115.com/site/static/components_vue/common/FileComplaintListModal.html");top.Core.SimpleFrameDG.Open("complaint-list",html_url,{title:"申诉列表",width:700,height:609,ready:function(win){win.fileComplainListInit(setting)},is_hide_back:true})}}})}return}var errTip='<div class="topfloat-cell"><div class="unzip-error"><i class="icon-warn"></i><div class="cont">网络异常,文件解压进度丢失请重试</div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(errTip);$("body",top.document).find(".topfloat-cell").css("z-index",top.Core.DialogBase.acIndex+1);$("body",top.document).find(".topfloat-cell .close").on("click",function(){$("body",top.document).find(".topfloat-cell").remove()})}}}}else{if(rs.code==990028){var wrapHtml='<div class="dialog-box" style="width: 500px;"><div class="dialog-handle"><a href="javascript:;" class="close hover" btn="close">关闭</a></div><div rel="base_content"><div class="newviptip-dialog"><div class="newviptip-header"><div class="center-vip-icon"><s>VIP</s></div></div><div class="newviptip-wrap"><div class="title">存储空间不足</div><div class="title">升级为铂金VIP或者首充黄金VIP可获得额外赠送存储空间,也可以购买空间进行扩容。</div><div class="btn-wrap"><a href="javascript:;" btn="upgrade" class="button btn-upgrade"><span>升级VIP</span></a><a href="javascript:;" btn="buy_space" class="button"><span>购买空间</span></a></div></div></div></div></div>';$.showContentDG("",{warpHtml:wrapHtml,width:500,loaded:function(){var dg=this;dg.warp.find("[btn=upgrade]").on("click",function(){window.open("//vip.115.com/?p=index_info_vip")});dg.warp.find("[btn=buy_space]").on("click",function(){window.open("//vip.115.com/order/mycoupon/?t=space&is_force_spswd=1")})}})}else{$.alertTip(rs.message)}}}})},{nf:1,select_one:true,btn_txt:"解压到这里",select:1,title:"è
1§£åŽ‹åˆ°"})}function showErrorTip(info){var errTip='<div class="topfloat-cell"><div class="unzip-error"><i class="icon-warn"></i><div class="cont">'+info+'</div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(errTip);$("body",top.document).find(".topfloat-cell .close").on("click",function(){$("body",top.document).find(".topfloat-cell").remove()})}function showYunUnzipDG(win){var html='<div class="unzip-dialog"><div class="pic"><i class="icon-unzip"></i></div><div class="title"><span>'+Util.Text.htmlspecialchars(_cache.data.file_name)+'</span></div><div class="bar-wrap"><b><i style="width: 0%;"></i></b></div><div class="info">正在为你进行云解压,请稍等...(<em>0%</em>)</div><div class="action"><a href="javascript:;" btn="background-run" class="button btn-large"><span>后台解压</span></a><a href="javascript:;" btn="cancel" class="button btn-large btn-line"><span>取消</span></a></div></div>';var dg;$.showContentDG(html,{title:"云解压",closeed:function(){dg=null},loaded:function(){dg=this;var showBgProgress=true;win=win||window;_cache.win=win;var worker=new win.Worker("/static/plug/main_2014_wl/bg_unzip.js");worker.postMessage({type:"start",data:{pick_code:_cache.data.pick_code}});worker.onmessage=function(e){if(e.data.type==="update"){var data=e.data.data;var unzipStatus=data.unzip_status;if(unzipStatus==1){if(dg){dg.warp.find(".info em").text(data.progress+"%");dg.warp.find(".bar-wrap i").css("width",data.progress+"%")}else{if(!showBgProgress){return}var sucTip='<div class="topfloat-cell"><div class="unzip-suc"><i class="icon-crown"></i><div class="cont">尊贵的VIP会员,正在为你进行云解压,请稍等...('+data.progress+'%)</div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(sucTip);$("body",top.document).find(".topfloat-cell .close").on("click",function(){showBgProgress=false;$("body",top.document).find(".topfloat-cell").remove()})}setTimeout(function(){worker.postMessage({type:"start",data:{pick_code:_cache.data.pick_code}})},1000)}else{if(unzipStatus==2){worker.terminate();if(dg){var $info=dg.warp.find(".info");$info.addClass("info-error").removeClass("info");$info.text("云解压失败,请确认压缩包是否正常");dg.warp.find("[btn=background-run]").hide()}else{showErrorTip("云解压失败,请确认压缩包是否正常")}}else{if(unzipStatus==3){worker.terminate();if(dg){var $info=dg.warp.find(".info");$info.addClass("info-error").removeClass("info");$info.text("云解压失败,请重试");dg.warp.find("[btn=background-run] span").text("重试").click(function(){dg.Close();_this.Open(_cache.data)})}else{showErrorTip("云解压失败,请重试")}}else{if(unzipStatus==6){worker.terminate();dg&&dg.Close();if(_cache.data.secret){$.alertTip("密码错误,请重新输入")}showEncrptDG()}else{if(unzipStatus==7){worker.terminate();dg&&dg.Close();showErrorTip("云解压失败,暂不支持该后缀文件解压")}else{worker.terminate();if(dg){dg.Close();showUnzipFilesDG({file_name:"",paths:"文件",win:win})}else{var sucTip='<div class="topfloat-cell"><div class="unzip-suc"><i class="icon-crown"></i><div class="cont">尊贵的VIP会员,已为你成功云解压文件,<a href="javascript:;">点击查看</a></div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(sucTip);$("body",top.document).find(".topfloat-cell .close").on("click",function(){$("body",top.document).find(".topfloat-cell").remove()});$("body",top.document).find(".topfloat-cell .cont a").on("click",function(){$("body",top.document).find(".topfloat-cell").remove();showUnzipFilesDG({file_name:"",paths:"文件",win:win})})}}}}}}}else{if(e.data.type==="error"){worker.terminate();if(dg){var data=e.data.data||{};var $info=dg.warp.find(".info");$info.addClass("info-error").removeClass("info");$info.text(data.message||"网络异常,请重试");
1dg.warp.find(".bar-wrap").hide();dg.warp.find(".action").hide();dg.warp.find("[btn=background-run] span").text("重试").click(function(){dg.Close();_this.Open(_cache.data)})}else{var errTip='<div class="topfloat-cell"><div class="unzip-error"><i class="icon-warn"></i><div class="cont">解压失败,压缩包内文件超过500G</div><a href="javascript:;" class="close"></a></div></div>';$("body",top.document).find(".topfloat-cell").remove();$("body",top.document).append(errTip);$("body",top.document).find(".topfloat-cell .close").on("click",function(){showBgProgress=false;$("body",top.document).find(".topfloat-cell").remove()});showErrorTip(data.message||"网络异常,请重试")}}}};dg.warp.find("[btn=background-run]").on("click",function(){dg.Close()});dg.warp.find("[btn=cancel]").on("click",function(){dg.Close()})}})}function showEncrptDG(){var html='<div class="unzip-dialog"><div class="pic"><i class="icon-unzip"></i></div><div class="title"><span>'+Util.Text.htmlspecialchars(_cache.data.file_name)+'</span></div><div class="pwd"><input type="password" class="text" id="password" autofocus placeholder="请输入密码" ><a href="javascript:;" style="display:none" class="clean" btn="clear"><s>清空</s></a></div><div class="info">该压缩包已设置密码保护,输入密码后才能进行云解压</div><div class="action"><a href="javascript:;" class="button btn-large" btn="confirm"><span>确定</span></a><a href="javascript:;" class="button btn-large btn-line" btn="cancel"><span>取消</span></a></div></div>';var dg;$.showContentDG(html,{title:"云解压",closeed:function(){dg=null},loaded:function(){dg=this;var $clearBtn=dg.warp.find("[btn=clear]");var passwordIpt=dg.warp.find("#password");var _=function(){var passwordTxt=passwordIpt.val();if(passwordTxt.length==0){$.alertTip("请输入密码");return}$.loadTip("正在加载...");$.ajax({url:"//webapi.115.com/files/push_extract",type:"post",data:{pick_code:_cache.data.pick_code,secret:passwordTxt},dataType:"JSON",success:function(rs){$.closeTip();if(rs.state){_cache.data.secret=passwordTxt;showYunUnzipDG(_cache.win)}else{$.alertTip(rs.message)}dg.Close()},error:function(){$.closeTip();$.alertTip("网络异常,请重试")}})};setTimeout(function(){passwordIpt.focus()},0);passwordIpt.on("input",function(){var passwordTxt=$(this).val();if(passwordTxt.length>0){$clearBtn.show()}else{$clearBtn.hide()}});$clearBtn.on("click",function(){passwordIpt.val("");$clearBtn.hide()});passwordIpt.on("keyup",function(e){if(e.keyCode==13){_()}});dg.warp.find("[btn=confirm]").on("click",function(){_()});dg.warp.find("[btn=cancel]").on("click",function(){dg.Close()})}})}return{Open:function(data,win){$.loadTip("正在加载...");_this=this;_cache.data=data;$.ajax({url:"//webapi.115.com/files/push_extract",type:"get",data:{pick_code:data.pick_code},dataType:"JSON",success:function(rs){$.closeTip();if(rs.state){var status=rs.data.extract_status.unzip_status;switch(status){case 0:$.ajax({url:"//webapi.115.com/files/push_extract",type:"post",data:{pick_code:data.pick_code},dataType:"JSON",success:function(rs){if(rs.state){showYunUnzipDG(win)}else{$.alertTip(rs.message)}}});break;case 1:showYunUnzipDG(win);break;case 4:showUnzipFilesDG({file_name:"",paths:"文件",win:win});break;default:$.ajax({url:"//webapi.115.com/files/push_extract",type:"post",data:{pick_code:data.pick_code},dataType:"JSON",success:function(rs){if(rs.state){showYunUnzipDG(win)}else{$.alertTip(rs.message)}}});break}}else{switch(rs.code){case 51001:Core.YunUnzipDG.ShowNoVipUnzip();break;default:$.alertTip(rs.message);break}}}})},ShowNoVipUnzip:function(){function _(couponCount){var actionHtm,title;if(couponCount>0){title="使用在线解压预览压缩包功能,请升级VIP会员或使用“在线解压”兑换券";actionHtm='<div class="btn-wrap"><a class="button js_btn-coupont" style="cursor: pointer"><span>使用兑换券('+couponCount+')</span></a><a class="button btn-upgrade" style="cursor: pointer"><span>升级VIP</span></a></div>'}else{title="升级月费或以上VIP,可享在线预览解压20GB内压缩包";actionHtm='<div class="btn-single"><a class="button btn-upgrade" style="cursor: pointer"><span>升级VIP会员</span></a></div>'}var wrapHtm='<div class="dialog-box" style="width: 500px;"><div class="dialog-handle"><a href="javascript:;" class="close hover" btn="close">关闭</a></div><div rel="base_content"><div class="newviptip-dialog"><div class="newviptip-header"><div class="center-vip-icon"><s>VIP</s></div></div><div class="newviptip-wrap"><div class="title">'+title+"</div>"+actionHtm+"</div></div></div></div>";$.showContentDG("",{warpHtml:wrapHtm,width:500,loaded:function(){var dg=this;dg.warp.find(".btn-upgrade").on("click",function(){dg.Close();window.open("//vip.115.com")});if(couponCount>0){dg.warp.find(".js_btn-coupont").on("click",function(){$.ajax({url:"//webapi.115.com/user/user_rights",type:"post",data:{type:3,pick_code:_cache.data.pick_code}
1,dataType:"JSON",success:function(rs){if(rs.state){$.successTip("已使用兑换券");dg.Close();Core.YunUnzipDG.Open(_cache.data)}else{$.alertTip(rs.message)}}})})}}})}$.ajax({url:"//webapi.115.com/user/user_rights",type:"get",data:{type:3,is_use:0},dataType:"JSON",success:function(rs){if(rs.state){_(rs.data.count)}else{_(0)}}})}}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.