2024-07-22 18:17:27 +08:00
|
|
|
*/var _explorer={};function checkAll(e,r,t,o,a){o=o||"chkall";for(var l=0;l<r.elements.length;l++){var s=r.elements[l];"option"===e&&"radio"===s.type&&s.value===t&&!0!==s.disabled?s.checked=!0:"value"===e&&"checkbox"===s.type&&s.getAttribute("chkvalue")===t?s.checked=r.elements[o].checked:"prefix"===e&&s.name&&s.name!==o&&(!t||t&&s.name.match(t))&&(s.checked=r.elements[o].checked,a&&(s.parentNode&&"li"===s.parentNode.tagName.toLowerCase()&&(s.parentNode.className=s.checked?"checked":""),s.parentNode.parentNode&&"div"===s.parentNode.parentNode.tagName.toLowerCase()&&(s.parentNode.parentNode.className=s.checked?"item checked":"item")))}}function dfire(e){jQuery(document).trigger(e)}(_explorer=function(e){if(_explorer.space=e.space,_explorer.myuid=e.myuid,_explorer.formhash=e.formhash,_explorer.extopen=e.extopen||{},_explorer.sourcedata=e.sourcedata||[],_explorer.type=e.fileselectiontype||0,_explorer.defaultselect=e.defaultselect,_explorer.allowcreate=e.allowcreate,_explorer.mulitype=e.mulitype||0,_explorer.permfilter=e.permfilter||"",1==_explorer.type&&(_explorer.permfilter=e.permfilter?e.permfilter:"write"),2==_explorer.type?_explorer.allowselecttype={folder:["文件夹",["folder"],"selected"]}:_explorer.allowselecttype=e.allowselecttype||"",e.allowselecttype)for(var r in e.allowselecttype)"selected"==e.allowselecttype[r][2]&&(_explorer.defaultexttype=e.allowselecttype[r][1].join(",").toLowerCase());else _explorer.defaultexttype="";_explorer.defaultfilename=e.defaultfilename||"",_explorer.thame=e.thame||{},_explorer.infoRequest=0,_explorer.deletefinally=e.deletefinally||0,_explorer.cut=e.cut||{iscut:0,icos:[]}}).appUrl="index.php?mod=system&op=fileselection",_explorer.hash="",_explorer.getConfig=function(e,r){$.getJSON(e+"&t="+(new Date).getTime(),function(e){new _explorer(e),_explorer.hashHandler(),_explorer.initEvents(),"function"==typeof r&&r(e)})},_explorer.initEvents=function(){$(window).on("hashchange",function(){_explorer.hashHandler()}),$(document).off("click.document-data").on("click.document-data",".document-data",function(){location.hash=jQuery(this).data("hash")}),$(document).off("ajaxLoad.middleContent").on("ajaxLoad.middleContent",function(){location.hash.replace(/^#/i,"").replace(/&(.+?)$/gi,"");_explorer.topNav_init(),_explorer.address_resize(),_explorer.setHeight($(".height-100")),$(".scroll-100").length&&(_explorer.scroll_100=new PerfectScrollbar(".scroll-100"))})},_explorer.createMenuSwidth=function(e){var r=!1,t=!1;_explorer.allowcreate&&(_explorer.Permission_Container("upload",e)&&2!=_explorer.type?($("#createmenu").find("li").not(".folderPermMust").removeClass("hide"),r=!0):$("#createmenu").find("li").not(".folderPermMust").addClass("hide"),_explorer.Permission_Container("folder",e)?(jQuery("#createmenu").find("li.folderPermMust").removeClass("hide"),t=!0):jQuery("#createmenu").find("li.folderPermMust").addClass("hide"),r||t?($("#createmenu").removeClass("hide"),$("#exampleColorDropdown2").removeClass("hide")):($("#createmenu").addClass("hide"),$("#exampleColorDropdown2").addClass("hide")),$(".divider").each(function(){$(this).prev("li:visible").length<1&&$(this).remove()}))},_explorer.set_address=function(e){var r=e;$(".select-address input.inputaddress").val(r);var t=r.split("\\"),o="";for(var a in t)o+=' <li class="routes"> <a href="javascript:;">'+t[a]+'</a> <span class="dzz dzz-chevron-right"></span></li>';$(".select-address div.address-field").html(o)},_explorer.address_resize=function(e){var r=jQuery(".address-container"),t=jQuery(".address-field"),o=r.width(),a=o,l=0;t.find("li").each(function(){l+=jQuery(this).outerWidth(!0)});var s=isNaN(parseInt(t.css("left")))?o-l:parseInt(t.css("left"));"left"===e?((s+=a)>=0&&(s=0,r.removeClass("arrow-left")),s>o-l?r.addClass("arrow-right"):r.removeClass("arrow-right"),s<0?r.addClass("arrow-left"):r.removeClass("arrow-left"),t.animate({left:s,right:"auto"},500)):"right"===e?((s-=a)<=o-l&&(s=o-l,r.removeClass("arrow-right")),s>o-l?r.addClass("arrow-right"):r.removeClass("arrow-right"),s<0?r.addClass("arrow-left"):r.removeClass("arrow-left"),t.animate({l
|