function finder(name,path,appObject){$.ajax({url:"json/sidebar.json",type:"GET",async:!0,dataType:"json",success:function(data,textStatus,jqXHR){favoritesTitle=data.data.favoritesTitle,favorites=data.data.favorites,devicesTitle=data.data.devicesTitle,devices=data.data.devices,delimiter="
",favoritesHeaderHtml="- "+favoritesTitle+"
",favoritesBodyHtml="",$.each(favorites,(function(key,value){name||(name=value.name),path||(path=value.path),favoritesBodyHtml=favoritesBodyHtml+"- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"+value.title+"\t\t\t\t\t\t\t\t\t
"})),favoritesFooterHtml="
",favoritesHtml=favoritesHeaderHtml+favoritesBodyHtml+favoritesFooterHtml,devicesHeaderHtml="",devicesHtml=devicesHeaderHtml+devicesBodyHtml+devicesFooterHtml,$(".finder-wrapper .sidebar").html(favoritesHtml+delimiter+devicesHtml),path?($(".finder-wrapper .pathHistory").val(path),$(".finder-wrapper .content").attr(path)):$(".finder-wrapper .content").attr("current-path","public/user/administrator/home/"),finderOpenApp(name,path,appObject)},error:function(xhr,textStatus){console.log("错误")}}),$(".sidebar").niceScroll({cursorcolor:"#bebebe"})}function finderOpenApp(name,path,appObject){pathHistory=$(".finder-wrapper .pathHistory").val(),pathArray=new Array,pathArray=pathHistory.split("|"),key=$.inArray(path,pathArray),-1==key?path&&(lastPath=pathArray[pathArray.length-1],"root"!=lastPath?path.indexOf(lastPath)>-1?(pathHistory=pathHistory+"|"+path,$(".finder-wrapper .pathHistory").val(pathHistory),$(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path)):(pathHistory=pathHistory.replace(lastPath,path),$(".finder-wrapper .pathHistory").val(pathHistory),$(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path)):(pathHistory=pathHistory+"|"+path,$(".finder-wrapper .pathHistory").val(pathHistory),$(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path))):($(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path)),$.ajax({url:"json/openPath.json",type:"GET",async:!0,data:{path:path},dataType:"json",success:function(data,textStatus,jqXHR){"success"==data.status?(html="",data.data&&$.each(data.data,(function(key,value){void 0===value.path&&(value.path=""),html=html+"\t\t\t\t\t\t

\t\t\t\t\t\t
"+value.title+"\t\t\t\t\t\t
\t\t\t\t\t\t
"})),$(".finder-wrapper .app-list").html(html)):layer.msg(data.msg,{zIndex:layer.zIndex,success:function(layero){layer.setTop(layero)}})},error:function(xhr,textStatus){console.log("错误")}})}function next(){pathHistory=$(".finder-wrapper .pathHistory").val(),currentPath=$(".finder-wrapper .currentPath").val(),pathArray=new Array,pathArray=pathHistory.split("|"),key=$.inArray(currentPath,pathArray),path=pathArray[key+1],path&&(finderOpenApp("finder",path),$(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path))}function prev(){pathHistory=$(".finder-wrapper .pathHistory").val(),currentPath=$(".finder-wrapper .currentPath").val(),pathArray=new Array,pathArray=pathHistory.split("|"),key=$.inArray(currentPath,pathArray),path=pathArray[key-1],path&&("root"==path?finderOpenApp("finder",""):finderOpenApp("finder",path),$(".finder-wrapper .currentPath").val(path),$(".finder-wrapper .content").attr("current-path",path))}$(document).on("dblclick",".finder-wrapper .app-box",(function(event){finderOpenApp($(this).attr("app-name"),$(this).attr("app-path"),$(this))})),$(document).on("mouseover",".finder-wrapper .app-box",(function(event){$(this).addClass("hover")})),$(document).on("mouseout",".finder-wrapper .app-box",(function(event){$(this).removeClass("hover")})),$(document).on("mousedown",".finder-wrapper .app-box",(function(event){return $(".finder-wrapper .app-box").removeClass("active"),$(this).addClass("active"),!1})),$(document).on("mousedown",".finder-wrapper .content",(function(event){$(".finder-wrapper .app-box").removeClass("active")})),$(document).on("mousedown",".finder-wrapper .sidebar ul li a",(function(event){$(".finder-wrapper .sidebar ul li a").removeClass("on"),$(this).addClass("on")})),finder();