2020-05-20 09:22:08 +00:00
<!-- IconValuesStart -->
{
"music":"musical-notes",
"video":"logo-youtube",
"img":"image",
"office":"paper",
"txt":"clipboard",
"zip":"filing",
"iso":"disc",
"apk":"logo-android",
"exe":"logo-windows",
"default":"document"
}
<!-- IconValuesEnd -->
<!DOCTYPE html>
< html lang = "<!--constStr@language-->" >
< head >
< title > <!-- Title --> < / title >
< meta charset = utf-8 >
< meta http-equiv = X-UA-Compatible content = "IE=edge" >
< meta name = viewport content = "width=device-width,initial-scale=1" >
< meta name = "keywords" content = "<!--Keywords-->" >
< meta name = "description" content = "<!--Description-->" >
2020-06-23 08:27:46 +00:00
< link rel = "icon" href = "<!--base_path-->favicon.ico" type = "image/x-icon" / >
< link rel = "shortcut icon" href = "<!--base_path-->favicon.ico" type = "image/x-icon" / >
2020-05-20 09:22:08 +00:00
< link href = "//cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel = "stylesheet" >
< script src = "//cdn.bootcdn.net/ajax/libs/jquery/2.0.2/jquery.min.js" > < / script >
< style >
a {
text-decoration: none;
color: dimgray;
}
.title{
text-align: center;
font-family: '-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif',Helvetica,Arial,sans-serif;
}
.btn-secondary[now]{
background-color: #545b62;
box-shadow: 0 0 0 0.2rem rgba(130,138,145,.5);
}
ion-icon{vertical-align: -0.1em;}
body {
<!-- BackgroundStart -->
background-image: url('<!-- BackgroundUrl --> ');
background-size: cover;
background-repeat: no-repeat;
2021-03-09 05:25:59 +00:00
background-attachment: fixed;
background-position: center;
height: 100vh;
2020-05-20 09:22:08 +00:00
<!-- BackgroundEnd -->
}
< / style >
<!-- customCss -->
< / head >
< body >
< div style = "backgroudn-color:#aaa; z-index:-999; height:100vh; width:100%; position:absolute;opacity:0.5;" > < / div >
< div id = "top-div" >
< / div >
<!-- NeedUpdateStart -->
< div style = 'position:absolute;' > < font color = 'red' > <!-- constStr@NeedUpdate --> < / font > < / div >
<!-- NeedUpdateEnd -->
< h1 class = "title" id = "title" >
< a href = "<!--base_path-->" class = "text-muted" > <!-- Sitename --> < / a >
< / h1 >
< div class = "list-wrapper" id = "more-disk-div" >
< div class = "" >
< div class = "list-header-container" >
< div class = "container text-center rounded my-3 py-3" >
< div class = "btn-group" role = "group" >
<!-- MultiDiskAreaStart -->
<!-- MultiDisksStart -->
< a href = "<!--MultiDisksUrl-->" class = "btn btn-secondary" < ! --MultiDisksNow-- > ><!-- MultiDisksName --> < / a >
<!-- MultiDisksEnd -->
<!-- MultiDiskAreaEnd -->
<!-- LoginStart -->
< button type = "button" class = "btn btn-secondary" data-toggle = "modal" data-target = "#exampleModal" >
<!-- constStr@Login -->
< / button >
< div class = "modal fade" id = "exampleModal" tabindex = "-1" role = "dialog" aria-labelledby = "exampleModalLabel" aria-hidden = "true" >
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "exampleModalLabel" > <!-- constStr@Login --> < / h5 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< form action = "?admin" method = "post" >
< div class = "modal-body" >
< input class = "form-control" id = "login_input" name = "password1" type = "password" placeholder = "<!--constStr@InputPassword-->" >
< / div >
< div class = "modal-footer" >
< input class = "btn btn-primary" type = "submit" value = "<!--constStr@Login-->" > < / button >
< / div >
< / form >
< / div >
< / div >
< / div >
<!-- LoginEnd -->
<!-- AdminStart -->
< div class = "dropdown btn-group" >
< a class = "btn btn-secondary dropdown-toggle" href = "#" type = "button" role = "button" id = "dropdownMenuLink" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
< ion-icon name = "construct" > < / ion-icon > <!-- constStr@Operate -->
< / a >
< div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" >
<!-- IsFolderStart -->
< a class = "dropdown-item" data-toggle = "modal" data-target = "#NewFileModal" > < ion-icon name = "create" > < / ion-icon > <!-- constStr@Create --> < / a >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#exampleencrypt" onclick = "document.getElementById('encrypt_hidden').value=''" > < ion-icon name = "lock" > < / ion-icon > <!-- constStr@Encrypt --> < / a >
< a class = "dropdown-item" href = "?RefreshCache" > < ion-icon name = "refresh" > < / ion-icon > <!-- constStr@RefreshCache --> < / a >
<!-- IsFolderEnd -->
< a class = "dropdown-item" href = "<!--IsPreview?-->setup" > < ion-icon name = "settings" > < / ion-icon > <!-- constStr@Setup --> < / a >
< a class = "dropdown-item" onclick = "logout();" > < ion-icon name = "log-out" > < / ion-icon > <!-- constStr@Logout --> < / a >
< / div >
< / div >
<!-- AdminEnd -->
< select class = "btn btn-secondary" name = "language" onchange = "changelanguage(this.options[this.options.selectedIndex].value)" >
<!-- SelectLanguageStart -->
< option value = "<!--SelectLanguageKey-->" < ! --SelectLanguageSelected-- > ><!-- SelectLanguageValue --> < / option >
<!-- SelectLanguageEnd -->
< / select >
< / div >
< / div >
< / div >
< / div >
<!-- ListStart -->
<!-- HeadomfStart -->
< div class = "container text-left rounded my-3 py-3 border" id = "head-om-div" >
< div class = "list-header-container" >
< div class = "readme" >
< div class = "customfile" id = "head-om" >
<!-- HeadomfContent -->
< / div >
< / div >
< / div >
< / div >
<!-- HeadomfEnd -->
<!-- HeadmdStart -->
< div class = "container text-left rounded my-3 py-3 border" id = "head-div" >
< div class = "list-header-container" >
< div class = "readme" >
< div class = "markdown-body" id = "head" >
< textarea id = "head-md" style = "display:none;" > <!-- HeadmdContent --> < / textarea >
< / div >
< / div >
< / div >
< / div >
<!-- HeadmdEnd -->
< div class = "container text-left rounded my-3 py-3 border" id = "list-div" >
< div class = "list-container" >
< div class = "list-header-container alert alert-secondary" >
< ul class = "nav nav-pills" >
2020-05-21 10:38:45 +00:00
<!-- BackArrowStart -->
2020-05-20 09:22:08 +00:00
< li class = "nav-item" >
< a href = "<!--BackArrowUrl-->" class = "nav-item active" >
< ion-icon name = "arrow-back" > < / ion-icon >
< / a >
< / li >
2020-05-21 10:38:45 +00:00
<!-- BackArrowEnd -->
2020-05-20 09:22:08 +00:00
< li class = "nav-item" id = "nav-path" >
<!-- Path -->
< / li >
< / ul >
< / div >
< div class = "list-body-container border" >
<!-- EncryptedStart -->
< div style = "padding:20px" >
< center >
< form action = "" method = "post" >
< input name = "password1" type = "password" placeholder = "<!--constStr@InputPassword-->" >
< input type = "submit" value = "<!--constStr@Submit-->" >
< / form >
< / center >
< / div >
<!-- EncryptedEnd -->
<!-- GuestUploadStart -->
< div id = "upload_div" class = "input-group p-3" >
< div id = "upload_btns" >
< select class = "form-control" onchange = "document.getElementById('upload_file').webkitdirectory=this.value;" >
< option value = "" > <!-- constStr@UploadFile --> < / option >
< option value = "1" > <!-- constStr@UploadFolder --> < / option >
< / select >
< / div >
< div class = "custom-file" >
< input onchange = "showFileName()" type = "file" class = "custom-file-input" id = "upload_file" aria-describedby = "upload_submit" multiple = "multiple" name = "upload_filename" >
< label id = "filename_label" class = "custom-file-label" for = "upload_file" > <!-- constStr@FileSelected --> < / label >
< / div >
< div class = "input-group-append" >
< button class = "btn btn-outline-secondary" onclick = "preup();" type = "button" id = "upload_submit" > <!-- constStr@Upload --> < / button >
< / div >
< / div >
< div id = "uploading_div" class = "input-group p-3" > < / div >
< script >
function showFileName(){
var file = document.getElementById("upload_file").files;
//取得file集合
var fileNameAll = "";
for(var i = 0; i < file.length ; i + + ) {
fileNameAll += file[i].name + ";";
}
fileNameAll = fileNameAll.substr(0, fileNameAll.length - 1);
$('#filename_label').html(fileNameAll);
}
< / script >
<!-- GuestUploadEnd -->
<!-- IsFileStart -->
< div style = "margin: 12px 4px 4px; text-align: center" >
< div style = "margin: 24px" >
< textarea id = "url" title = "url" rows = "1" style = "width: 100%; margin-top: 2px;" readonly > <!-- FileEncodeUrl --> < / textarea >
< a href = "<!--FileUrl-->" > < ion-icon name = "download" style = "line-height: 16px;vertical-align: middle;" > < / ion-icon > <!-- constStr@Download --> < / a >
< / div >
< div style = "margin: 24px" >
<!-- IsimgFileStart -->
< img src = "<!--FileDownUrl-->" alt = "<!--FileName-->" onload = "if (this.offsetWidth>document.getElementById('url').offsetWidth) this.style.width='100%';" / >
<!-- IsimgFileEnd -->
<!-- IsvideoFileStart -->
< div id = "video-a0" > < / div >
<!-- IsvideoFileEnd -->
<!-- IsmusicFileStart -->
< audio src = "<!--FileDownUrl-->" controls = "controls" style = "width: 100%" > < / audio >
<!-- IsmusicFileEnd -->
<!-- IspdfFileStart -->
< div id = "pdf-d" > < / div >
<!-- IspdfFileEnd -->
<!-- IsofficeFileStart -->
< iframe id = "office-a" src = "https://view.officeapps.live.com/op/view.aspx?src=<!--FileEncodeDownUrl-->" style = "width: 100%;height: 800px" frameborder = "0" > < / iframe >
<!-- IsofficeFileEnd -->
<!-- IstxtFileStart -->
< div id = "txt" >
<!-- AdminStart -->
< form id = "txt-form" action = "" method = "POST" >
< a onclick = "document.getElementById('txt-a').readOnly='';document.getElementById('txt-save').style.display='';document.getElementById('txt-editbutton').style.display='none';document.getElementById('txt-cancelbutton').style.display='';" id = "txt-editbutton" > < ion-icon name = "create" > < / ion-icon > <!-- constStr@ClicktoEdit --> < / a >
< a onclick = "document.getElementById('txt-a').readOnly='readonly';document.getElementById('txt-save').style.display='none';document.getElementById('txt-editbutton').style.display='';document.getElementById('txt-cancelbutton').style.display='none';" id = "txt-cancelbutton" style = "display:none" > < ion-icon name = "close" > < / ion-icon > <!-- constStr@CancelEdit --> < / a >
< a id = "txt-save" style = "display:none" > < ion-icon name = "save" > < / ion-icon > <!-- constStr@Save --> < / a >
<!-- AdminEnd -->
< textarea id = "txt-a" name = "editfile" readonly style = "width: 100%; margin-top: 2px;" < ! --AdminStart-- > onchange="document.getElementById('txt-save').onclick=function(){document.getElementById('txt-form').submit();}"<!-- AdminEnd --> ><!-- TxtContent --> < / textarea >
<!-- AdminStart -->
< / form >
<!-- AdminEnd -->
< / div >
<!-- IstxtFileEnd -->
<!-- IsOtherFileStart -->
< span > <!-- constStr@FileNotSupport --> < / span >
<!-- IsOtherFileEnd -->
< / div >
< / div >
<!-- IsFileEnd -->
<!-- IsFolderStart -->
< table class = "table table-hover" id = "list-table" >
< tr class = "thead-dark" id = "tr0" >
< th class = "file" >
< a onclick = "sortby('a');" > <!-- constStr@File --> < / a >
<!-- ShowThumbnailsStart -->
< button class = "btn btn-sm btn-secondary" onclick = "showthumbnails(this);" > <!-- constStr@ShowThumbnails --> < / button >
<!-- ShowThumbnailsEnd -->
< button class = "btn btn-sm btn-secondary" onclick = "CopyAllDownloadUrl('.download');" > <!-- constStr@CopyAllDownloadUrl --> < / button >
< / th >
< th class = "updated_at" > < a onclick = "sortby('time');" > <!-- constStr@EditTime --> < / a > < / th >
< th class = "size" > < a onclick = "sortby('size');" > <!-- constStr@Size --> < / a > < / th >
< / tr >
<!-- Dirs -->
<!-- FolderListStart -->
< tr data-to id = "tr<!--filenum-->" >
< td class = "file" >
<!-- AdminStart -->
< div class = "dropdown d-inline" >
< a class = "btn btn-secondary dropdown-toggle" href = "#" type = "button" role = "button" id = "dropdownMenuLink" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
< ion-icon name = "construct" > < / ion-icon >
< / a >
< div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#exampleencrypt" onclick = "document.getElementById('encrypt_hidden').value='<!--FileEncodeReplaceName-->'" > < ion-icon name = "lock" > < / ion-icon > <!-- constStr@Encrypt --> < / a >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#renameModal" onclick = "showdiv(event, 'rename',<!--filenum-->);" > < ion-icon name = "create" > < / ion-icon > <!-- constStr@Rename --> < / a >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#MoveModal" onclick = "showdiv(event, 'move',<!--filenum-->);" > < ion-icon name = "move" > < / ion-icon > <!-- constStr@Move --> < / a >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#CopyModal" onclick = "showdiv(event, 'copy',<!--filenum-->);" > < ion-icon name = "copy" > < / ion-icon > <!-- constStr@Copy --> < / a >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#DeleteModal" onclick = "showdiv(event, 'delete',<!--filenum-->);" > < ion-icon name = "trash" > < / ion-icon > <!-- constStr@Delete --> < / a >
< / div >
< / div >
<!-- AdminEnd -->
< ion-icon name = "folder" > < / ion-icon >
< a id = "file_a<!--filenum-->" name = "filelist" href = "<!--FileEncodeReplaceUrl-->/" > <!-- FileEncodeReplaceName --> < / a >
< / td >
< td class = "updated_at" id = "folder_time<!--filenum-->" > <!-- lastModifiedDateTime --> < / td >
< td class = "size" id = "folder_size<!--filenum-->" > <!-- size --> < / td >
< / tr >
<!-- FolderListEnd -->
<!-- FileListStart -->
< tr data-to id = "tr<!--filenum-->" >
< td class = "file" >
<!-- AdminStart -->
< div class = "dropdown d-inline" >
< a class = "btn btn-secondary dropdown-toggle" href = "#" type = "button" role = "button" id = "dropdownMenuLink" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
< ion-icon name = "construct" > < / ion-icon >
< / a >
< div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#renameModal" onclick = "showdiv(event, 'rename',<!--filenum-->);" > < ion-icon name = "create" > < / ion-icon > <!-- constStr@Rename --> < / a > < / li >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#MoveModal" onclick = "showdiv(event, 'move',<!--filenum-->);" > < ion-icon name = "move" > < / ion-icon > <!-- constStr@Move --> < / a > < / li >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#CopyModal" onclick = "showdiv(event, 'copy',<!--filenum-->);" > < ion-icon name = "copy" > < / ion-icon > <!-- constStr@Copy --> < / a > < / li >
< a class = "dropdown-item" data-toggle = "modal" data-target = "#DeleteModal" onclick = "showdiv(event, 'delete',<!--filenum-->);" > < ion-icon name = "trash" > < / ion-icon > <!-- constStr@Delete --> < / a > < / li >
< / div >
< / div >
<!-- AdminEnd -->
< ion-icon name = "<!--IconValue-->" > < / ion-icon >
< a id = "file_a<!--filenum-->" name = "filelist" href = "<!--FileEncodeReplaceUrl-->?preview" target = _blank > <!-- FileEncodeReplaceName --> < / a >
< a class = "download" href = "<!--FileEncodeReplaceUrl-->" > < ion-icon name = "download" > < / ion-icon > < / a >
< / td >
< td class = "updated_at" id = "file_time<!--filenum-->" > <!-- lastModifiedDateTime --> < / td >
< td class = "size" id = "file_size<!--filenum-->" > <!-- size --> < / td >
< / tr >
<!-- FileListEnd -->
< / table >
<!-- MorePageStart -->
< form action = "" method = "POST" id = "nextpageform" >
< input type = "hidden" id = "pagenum" name = "pagenum" value = "" >
< table width = 100% border = 0 >
< tr >
< td width = 60px align = center >
<!-- PrePageStart -->
< a onclick = "nextpage(<!--PrePageNum-->);" > <!-- constStr@PrePage --> < / a >
<!-- PrePageEnd -->
< / td >
< td class = "updated_at" >
<!-- MorePageListStart -->
< a onclick = "nextpage(<!--PageNum-->);" > <!-- PageNum --> < / a >
<!-- MorePageListEnd -->
<!-- MorePageListNowStart -->
< font color = red > <!-- PageNum --> < / font >
<!-- MorePageListNowEnd -->
< / td >
< td width = 60px align = center >
<!-- NextPageStart -->
< a onclick = "nextpage(<!--NextPageNum-->);" > <!-- constStr@NextPage --> < / a >
<!-- NextPageEnd -->
< / td >
< / tr >
< / table >
< / form >
<!-- MorePageEnd -->
<!-- AdminStart -->
< div id = "upload_div" class = "input-group p-3" >
< div id = "upload_btns" >
< select class = "form-control" onchange = "document.getElementById('upload_file').webkitdirectory=this.value;" >
< option value = "" > <!-- constStr@UploadFile --> < / option >
< option value = "1" > <!-- constStr@UploadFolder --> < / option >
< / select >
< / div >
< div class = "custom-file" >
< input onchange = "showFileName()" type = "file" class = "custom-file-input" id = "upload_file" aria-describedby = "upload_submit" multiple = "multiple" name = "upload_filename" >
< label id = "filename_label" class = "custom-file-label" for = "upload_file" > <!-- constStr@FileSelected --> < / label >
< / div >
< div class = "input-group-append" >
< button class = "btn btn-outline-secondary" onclick = "preup();" type = "button" id = "upload_submit" > <!-- constStr@Upload --> < / button >
< / div >
< / div >
< div id = "uploading_div" class = "input-group p-3" > < / div >
< script >
function showFileName(){
var file = document.getElementById("upload_file").files;
//取得file集合
var fileNameAll = "";
for(var i = 0; i < file.length ; i + + ) {
fileNameAll += file[i].name + ";";
}
fileNameAll = fileNameAll.substr(0, fileNameAll.length - 1);
$('#filename_label').html(fileNameAll);
}
< / script >
<!-- AdminEnd -->
<!-- IsFolderEnd -->
<!-- ListEnd -->
< / div >
< / div >
< / div >
<!-- ReadmemdStart -->
< div class = "container text-left rounded my-3 py-3 border" id = "readme-div" >
< div class = "list-container" >
< div class = "list-header-container" >
< div class = "readme" >
< div class = "markdown-body" id = "readme" >
< textarea id = "readme-md" style = "display:none;" > <!-- ReadmemdContent --> < / textarea >
< / div >
< / div >
< / div >
< / div >
< / div >
<!-- ReadmemdEnd -->
<!-- FootomfStart -->
< div class = "container text-left rounded my-3 py-3 border" id = "foot-om-div" >
< div class = "list-container" >
< div class = "list-header-container" >
< div class = "readme" >
< div class = "customfile" id = "foot-om" >
<!-- FootomfContent -->
< / div >
< / div >
< / div >
< / div >
< / div >
<!-- FootomfEnd -->
< div id = "mask" style = "display:none;" > < / div >
<!-- AdminStart -->
<!-- IsFolderStart -->
< div style = "" >
< div id = "rename_div" class = "operatediv" style = "" >
< div >
< label id = "rename_label" style = "display:none" > < / label >
< form id = "rename_form" onsubmit = "return submit_operate('rename');" >
< input id = "rename_sid" name = "rename_sid" type = "hidden" value = "" >
< input id = "rename_hidden" name = "rename_oldname" type = "hidden" value = "" >
<!-- RenameModal -->
< script type = "text/javascript" >
$(document).ready(function(){
$("#myrename").click(function(){
$("#renameModal").modal('hide');
window.location.reload();
});
});
< / script >
< div class = "modal fade" id = "renameModal" tabindex = "-1" role = "dialog" aria-labelledby = "renameModalLabel" aria-hidden = "true" >
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "renameModalLabel" > <!-- constStr@Rename --> < / h5 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< div class = "input-group mb-3" >
< input class = "form-control" id = "rename_input" name = "rename_newname" type = "text" value = "" >
< div class = "input-group-append" >
< input class = "input-group-text btn btn-outline-secondary" id = "myrename" name = "operate_action" type = "submit" value = "<!--constStr@Rename-->" >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / form >
< / div >
< / div >
< div class = "modal fade operatediv_close" id = "exampleencrypt" tabindex = "-1" role = "dialog" aria-labelledby = "exampleModalLabel" aria-hidden = "true" >
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "exampleModalLabel" > <!-- constStr@Encrypt --> < / h5 >
< button type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div id = "encrypt_div" class = "operatediv" >
< div class = "container text-center rounded my-3 py-3" >
< form id = "encrypt_form" onsubmit = "return submit_operate('encrypt');" >
< input id = "encrypt_sid" name = "encrypt_sid" type = "hidden" value = "" >
< input id = "encrypt_hidden" name = "encrypt_folder" type = "hidden" value = "" >
< input class = "form-control d-inline" id = "encrypt_input" name = "encrypt_newpass" type = "text" value = "" placeholder = "<!--constStr@InputPasswordUWant-->" >
<!-- EncryptBtnStart -->
< script type = "text/javascript" >
$(document).ready(function(){
$("#mymodal").click(function(){
$("#exampleencrypt").modal('hide');
window.location.reload();
});
});
< / script >
< input class = "btn btn-secondary input-group-append my-3 float-right" name = "operate_action" href = "" type = "submit" value = "<!--constStr@Encrypt-->" id = "mymodal" >
<!-- EncryptBtnEnd -->
<!-- EncryptAlertStart --> < br > < label > <!-- constStr@SetpassfileBfEncrypt --> < / label > <!-- EncryptAlertEnd -->
< / form >
< / div >
< / div >
< / div >
< / div >
< / div >
< div id = "delete_div" class = "operatediv" >
< form id = "delete_form" method = "get" onsubmit = "return submit_operate('delete');" >
< div class = "modal fade" id = "DeleteModal" tabindex = "-1" role = "dialog" aria-labelledby = "DeleteModalLabel"
aria-hidden="true">
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "DeleteModalLabel" > <!-- constStr@Delete --> < / h5 >
< button type = "button" type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< label id = "delete_label" > < / label >
< input id = "delete_sid" name = "delete_sid" type = "hidden" value = "" >
< input id = "delete_hidden" name = "delete_name" type = "hidden" value = "" >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-secondary" data-dismiss = "modal" > <!-- constStr@Close --> < / button >
< input class = "btn btn-danger" name = "operate_action" type = "submit" value = "<!--constStr@Delete-->" onclick = "$('#DeleteModal').modal('hide');
window.location.reload();">
< / div >
< / div >
< / div >
< / div >
< / form >
< div id = "copy_div" class = "operatediv" >
< form id = "copy_form" method = "get" onsubmit = "return submit_operate('copy');" >
< div class = "modal fade" id = "CopyModal" tabindex = "-1" role = "dialog" aria-labelledby = "CopyModalLabel"
aria-hidden="true">
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "CopyModalLabel" > <!-- constStr@Copy --> < / h5 >
< button type = "button" type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< label id = "copy_label" > < / label >
< input id = "copy_sid" name = "copy_sid" type = "hidden" value = "" >
< input id = "copy_hidden" name = "copy_name" type = "hidden" value = "" >
< input id = "copy_input" name = "copy_input" type = "hidden" value = "" >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-secondary" data-dismiss = "modal" > <!-- constStr@Close --> < / button >
< input class = "btn btn-primary" name = "operate_action" type = "submit" value = "<!--constStr@Copy-->" onclick = "$('#CopyModal').modal('hide');
window.location.reload();">
< / div >
< / div >
< / div >
< / div >
< / form >
< / div >
< div id = "move_div" class = "operatediv" >
< form id = "move_form" method = "get" onsubmit = "return submit_operate('move');" >
< div class = "modal fade" id = "MoveModal" tabindex = "-1" role = "dialog" aria-labelledby = "MoveModalLabel"
aria-hidden="true">
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "MoveModalLabel" > <!-- constStr@Move --> < / h5 >
< button type = "button" type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< div class = "input-group mb-3" >
< input id = "move_sid" name = "move_sid" type = "hidden" value = "" >
< input id = "move_hidden" name = "move_name" type = "hidden" value = "" >
< select id = "move_input" name = "move_folder" class = "form-control" >
<!-- MoveRootStart -->
< option value = "/../" > <!-- constStr@ParentDir --> < / option >
<!-- MoveRootEnd -->
<!-- MoveDirsStart -->
< option value = "<!--MoveDirsValue-->" > <!-- MoveDirsValue --> < / option >
<!-- MoveDirsEnd -->
< / select >
< / div >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-secondary" data-dismiss = "modal" > <!-- constStr@Close --> < / button >
< input class = "btn btn-primary" name = "operate_action" type = "submit" value = "<!--constStr@Move-->" onclick = "$('#MoveModal').modal('hide');
window.location.reload();">
< / div >
< / div >
< / div >
< / div >
< / form >
< script >
function saveReport() {
$("#showDataForm").ajaxSubmit(function(message) {
});
}
< / script >
< form id = "create_form" method = "get" onsubmit = "return submit_operate('create');" >
< div class = "modal fade" id = "NewFileModal" tabindex = "-1" role = "dialog" aria-labelledby = "CreateModalLabel"
aria-hidden="true">
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "CreateModalLabel" > <!-- constStr@Create --> <!-- constStr@File --> < / h5 >
< button type = "button" type = "button" class = "close" data-dismiss = "modal" aria-label = "Close" >
< span aria-hidden = "true" > × < / span >
< / button >
< / div >
< div class = "modal-body" >
< div class = "input-group mb-3" >
< input type = "text" id = "create_input" name = "create_name" class = "form-control" placeholder = "<!--constStr@Create--><!--constStr@Folder-->" >
< div class = "input-group-prepend" >
< input type = "hidden" id = "create_type_folder" name = "create_type" value = "folder" >
< input id = "create_sid" name = "create_sid" type = "hidden" value = "" >
< input id = "create_hidden" type = "hidden" value = "" >
< div type = "button" id = "create_type_folder_button" class = "btn btn-secondary" data-toggle = "collapse"
data-target="#collapseExample" onclick="if(document.getElementById('create_input').placeholder == '<!-- constStr@Create --> <!-- constStr@Folder --> '){
document.getElementById('create_input').placeholder='<!-- constStr@Create --> <!-- constStr@File --> ';document.getElementById('create_type_folder').value='file';
}else {
document.getElementById('create_input').placeholder='<!-- constStr@Create --> <!-- constStr@Folder --> ';document.getElementById('create_type_folder').value='folder';
}"><!-- constStr@File --> /<!-- constStr@Folder --> < / div >
<!-- $('#filetext').data('toggle') 获取 data - toggle 的值 -->
< / div >
< / div >
< div class = "input-group mb-3" >
< div class = "collapse w-100" id = "collapseExample" >
< textarea name = "create_text" id = "filetextarea" class = "form-control" aria-label = "With textarea"
placeholder="<!-- constStr@File --> <!-- constStr@Content --> ">< / textarea >
< / div >
< / div >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-secondary" data-dismiss = "modal" > <!-- constStr@Close --> < / button >
< input class = "btn btn-primary" name = "operate_action" type = "submit" value = "<!--constStr@Create-->" onclick = "$('#NewFileModal').modal('hide');
window.location.reload();">
< / div >
< / div >
< / div >
< / div >
< / form >
< script >
function saveReport() {
$("#showDataForm").ajaxSubmit(function(message) {
});
return false;
}
< / script >
< / div >
<!-- IsFolderEnd -->
<!-- AdminEnd -->
<!-- LoginStart -->
<!-- LoginEnd -->
< p class = "text-center text-muted" > < a href = "https://github.com/qkqpttgf/OneManager-php" class = "text-muted" > OneManager< / a > By 逸笙 Theme By Nchyn< / p >
< p class = "text-center" style = "color: rgba(247,247,249,0);" > <!-- FootStr --> < / p >
< / body >
<!-- ListStart -->
<!-- MdRequireStart --> < link rel = "stylesheet" href = "//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css" >
< script type = "text/javascript" src = "//unpkg.zhimg.com/marked@0.6.2/marked.min.js" > < / script > <!-- MdRequireEnd -->
<!-- GuestUploadStart --> < script type = "text/javascript" src = "//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js" > < / script > <!-- GuestUploadEnd -->
2021-03-04 07:15:34 +00:00
<!-- AliyundriveUploadJsStart --> < script src = "//cdn.bootcdn.net/ajax/libs/js-sha1/0.6.0/sha1.min.js" > < / script > <!-- AliyundriveUploadJsEnd -->
2020-05-20 09:22:08 +00:00
<!-- IsFileStart --> <!-- IspdfFileStart --> < script src = "//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js" > < / script > <!-- IspdfFileEnd --> <!-- IsFileEnd -->
<!-- ListEnd -->
< script type = "text/javascript" >
function changelanguage(str)
{
if (str=='Language') str = '';
2021-03-04 07:15:34 +00:00
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie='language='+str+'; path=/; '+expires;
2020-05-20 09:22:08 +00:00
location.href = location.href;
}
<!-- ListStart -->
var root = '<!-- base_disk_path --> ';
function path_format(path) {
path = '/' + path + '/';
while (path.indexOf('//') !== -1) {
path = path.replace('//', '/')
}
return path
}
document.querySelectorAll('#nav-path').forEach(function (e) {
var path = e.innerText;
if (path.substr(path.length-1)=='/') path = path.substr(0, path.length-1);
var paths = path.split('/');
e.innerHTML = '/ ';
if (paths < = 2) return;
for (var i = 1; i < paths.length - 1 ; i + + ) {
var to = path_format(root + paths.slice(0, i + 1).join('/'));
e.innerHTML += '< a href = "' + to + '" > ' + paths[i] + '< / a > / '
}
e.innerHTML += paths[paths.length - 1];
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
});
<!-- IsFileStart -->
var $url = document.getElementById('url');
if ($url) {
$url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML;
$url.style.height = $url.scrollHeight + 'px';
}
<!-- IsofficeFileStart -->
var $officearea=document.getElementById('office-a');
if ($officearea) {
$officearea.style.height = window.innerHeight + 'px';
}
<!-- IsofficeFileEnd -->
<!-- IstxtFileStart -->
var $textarea=document.getElementById('txt-a');
if ($textarea) {
$textarea.style.height = $textarea.scrollHeight + 'px';
}
<!-- IstxtFileEnd -->
<!-- IsvideoFileStart -->
function loadResources(type, src, callback) {
let script = document.createElement(type);
let loaded = false;
if (typeof callback === 'function') {
script.onload = script.onreadystatechange = () => {
if (!loaded & & (!script.readyState || /loaded|complete/.test(script.readyState))) {
script.onload = script.onreadystatechange = null;
loaded = true;
callback();
}
}
}
if (type === 'link') {
script.href = src;
script.rel = 'stylesheet';
} else {
script.src = src;
}
document.getElementsByTagName('head')[0].appendChild(script);
}
function addVideos(videos) {
let host = 'https://s0.pstatp.com/cdn/expire-1-M';
let unloadedResourceCount = 4;
let callback = (() => {
return () => {
if (!--unloadedResourceCount) {
createDplayers(videos);
}
};
})(unloadedResourceCount, videos);
loadResources(
'link',
host + '/dplayer/1.25.0/DPlayer.min.css',
callback
);
loadResources(
'script',
host + '/dplayer/1.25.0/DPlayer.min.js',
callback
);
loadResources(
'script',
host + '/hls.js/0.12.4/hls.light.min.js',
callback
);
loadResources(
'script',
host + '/flv.js/1.5.0/flv.min.js',
callback
);
}
function createDplayers(videos) {
for (i = 0; i < videos.length ; i + + ) {
console.log(videos[i]);
new DPlayer({
container: document.getElementById('video-a' + i),
screenshot: true,
video: {
url: videos[i]
}
});
}
}
2021-03-04 07:15:34 +00:00
addVideos(['<!-- FileEncodeUrl --> ']);
2020-05-20 09:22:08 +00:00
<!-- IsvideoFileEnd -->
<!-- IspdfFileStart -->
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
2021-03-04 07:15:34 +00:00
var loadingTask = pdfjsLib.getDocument({
url: '<!-- FileDownUrl --> ',
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
2020-05-20 09:22:08 +00:00
loadingTask.promise.then(function(pdf) {
var pagenum = pdf.numPages;
var pdfContainer = document.getElementById('pdf-d');
2021-03-04 07:15:34 +00:00
pdfContainer.innerHTML = '';
2020-05-20 09:22:08 +00:00
for (var i=1;i< =pagenum;i++) {
var canvasNew = document.createElement('canvas');
canvasNew.id = 'pdf-c'+i;
pdfContainer.appendChild(canvasNew);
renderpage(pdf,i);
}
});
function renderpage(pdf,i)
{
pdf.getPage(i).then(function(page) {
var scale = 1.5;
var viewport = page.getViewport({ scale: scale, });
var canvas = document.getElementById('pdf-c'+i);
var context = canvas.getContext("2d");
canvas.height = viewport.height;
canvas.width = viewport.width;
var renderContext = {
canvasContext: context,
viewport: viewport,
};
page.render(renderContext);
});
}
<!-- IspdfFileEnd -->
<!-- IsFileEnd -->
<!-- IsFolderStart -->
<!-- HeadmdStart -->
var $head = document.getElementById('head');
if ($head) {
//document.getElementById('head-div').parentNode.insertBefore(document.getElementById('head-div'),document.getElementById('list-div'));
$head.innerHTML = marked(document.getElementById('head-md').innerText);
}
<!-- HeadmdEnd -->
<!-- ReadmemdStart -->
var $readme = document.getElementById('readme');
if ($readme) {
$readme.innerHTML = marked(document.getElementById('readme-md').innerText);
}
<!-- ReadmemdEnd -->
<!-- ShowThumbnailsStart -->
function showthumbnails(obj) {
2021-03-04 07:15:34 +00:00
images = [<!-- ImgExts --> ];
2020-05-20 09:22:08 +00:00
var files=document.getElementsByName('filelist');
for ($i=0;$i< files.length ; $ i + + ) {
str=files[$i].innerText;
if (str.substr(-1)==' ') str=str.substr(0,str.length-1);
2021-03-04 07:15:34 +00:00
if (!str) continue;
2020-05-20 09:22:08 +00:00
strarry=str.split('.');
ext=strarry[strarry.length-1].toLowerCase();
2021-03-04 07:15:34 +00:00
if (images.indexOf(ext)>-1) {
var url=files[$i].href;
url=url.substr(0,url.length-8);
if (document.getElementById('originalpic').checked==true) {
files[$i].parentNode.parentNode.innerHTML='< td colspan = "3" > < img src = "'+url+'" alt = "'+str+'" onload = "if (this.offsetWidth>document.getElementById(\'list-div\').offsetWidth) this.style.width=\'100%\';" > < / td > ';
$i--;
} else {
url+='?thumbnails';
get_thumbnails_url(url, str, files[$i]);
}
}
2020-05-20 09:22:08 +00:00
}
obj.disabled='disabled';
}
2021-03-04 07:15:34 +00:00
function get_thumbnails_url(url, name, filea) {
2020-05-20 09:22:08 +00:00
var xhr = new XMLHttpRequest();
2021-03-04 07:15:34 +00:00
xhr.open("GET", url, true);
2020-05-20 09:22:08 +00:00
xhr.send('');
xhr.onload = function(e){
if (xhr.status==200) {
2021-03-04 07:15:34 +00:00
if (xhr.responseText!='') filea.innerHTML='< img src = "'+xhr.responseText+'" alt = "'+name+'" > ';
2020-05-20 09:22:08 +00:00
} else console.log(xhr.status+'\n'+xhr.responseText);
}
}
<!-- ShowThumbnailsEnd -->
<!-- MorePageStart -->
function nextpage(num) {
document.getElementById('pagenum').value=num;
document.getElementById('nextpageform').submit();
}
<!-- MorePageEnd -->
<!-- IsNotHiddenStart -->
var sort=0;
function sortby(string) {
if (string=='a') if (sort!=0) {
for (i = 1; i < = <!-- maxfilenum --> ; i++) document.getElementById('tr'+i).parentNode.insertBefore(document.getElementById('tr'+i),document.getElementById('tr'+(i-1)).nextSibling);
sort=0;
return;
} else return;
sort1=sort;
sortby('a');
sort=sort1;
var a=[];
for (i = 1; i < = <!-- maxfilenum --> ; i++) {
a[i]=i;
if (!!document.getElementById('folder_'+string+i)) {
var td1=document.getElementById('folder_'+string+i);
for (j = 1; j < i ; j + + ) {
if (!!document.getElementById('folder_'+string+a[j])) {
var c=false;
if (string=='time') if (sort==-1) {
c=(td1.innerText < document.getElementById ( ' folder_ ' + string + a [ j ] ) . innerText ) ;
} else {
c=(td1.innerText > document.getElementById('folder_'+string+a[j]).innerText);
}
if (string=='size') if (sort==2) {
c=(size_reformat(td1.innerText) < size_reformat ( document . getElementById ( ' folder_ ' + string + a [ j ] ) . innerText ) ) ;
} else {
c=(size_reformat(td1.innerText) > size_reformat(document.getElementById('folder_'+string+a[j]).innerText));
}
if (c) {
document.getElementById('tr'+i).parentNode.insertBefore(document.getElementById('tr'+i),document.getElementById('tr'+a[j]));
for (k = i; k > j; k--) {
a[k]=a[k-1];
}
a[j]=i;
break;
}
}
}
}
if (!!document.getElementById('file_'+string+i)) {
var td1=document.getElementById('file_'+string+i);
for (j = 1; j < i ; j + + ) {
if (!!document.getElementById('file_'+string+a[j])) {
var c=false;
if (string=='time') if (sort==-1) {
c=(td1.innerText < document.getElementById ( ' file_ ' + string + a [ j ] ) . innerText ) ;
} else {
c=(td1.innerText > document.getElementById('file_'+string+a[j]).innerText);
}
if (string=='size') if (sort==2) {
c=(size_reformat(td1.innerText) < size_reformat ( document . getElementById ( ' file_ ' + string + a [ j ] ) . innerText ) ) ;
} else {
c=(size_reformat(td1.innerText) > size_reformat(document.getElementById('file_'+string+a[j]).innerText));
}
if (c) {
document.getElementById('tr'+i).parentNode.insertBefore(document.getElementById('tr'+i),document.getElementById('tr'+a[j]));
for (k = i; k > j; k--) {
a[k]=a[k-1];
}
a[j]=i;
break;
}
}
}
}
}
if (string=='time') if (sort==-1) {
sort=1;
} else {
sort=-1;
}
if (string=='size') if (sort==2) {
sort=-2;
} else {
sort=2;
}
}
function size_reformat(str) {
if (str.substr(-1)==' ') str=str.substr(0,str.length-1);
if (str.substr(-2)=='GB') num=str.substr(0,str.length-3)*1024*1024*1024;
if (str.substr(-2)=='MB') num=str.substr(0,str.length-3)*1024*1024;
if (str.substr(-2)=='KB') num=str.substr(0,str.length-3)*1024;
if (str.substr(-2)==' B') num=str.substr(0,str.length-2);
return num;
}
<!-- IsNotHiddenEnd -->
<!-- IsFolderEnd -->
<!-- WriteTimezoneStart -->
var nowtime= new Date();
var timezone = 0-nowtime.getTimezoneOffset()/60;
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie="timezone="+timezone+"; path=/; "+expires;
if (timezone!=<!-- timezone --> ) {
alert('Your timezone is '+timezone+', reload local timezone.');
location.href=location.href;
}
<!-- WriteTimezoneEnd -->
function CopyAllDownloadUrl(str) {
var tmptextarea=document.createElement('textarea');
document.body.appendChild(tmptextarea);
tmptextarea.setAttribute('style','position:absolute;left:-100px;width:0px;height:0px;');
document.querySelectorAll(str).forEach(function (e) {
tmptextarea.innerHTML+=e.href+"\r\n";
});
tmptextarea.select();
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
document.execCommand("copy");
alert(tmptextarea.innerHTML+"<!-- constStr@Success --> ");
}
<!-- UploadJsStart -->
2021-03-04 07:15:34 +00:00
function size_format(num) {
if (num>1024) {
num=num/1024;
} else {
return num.toFixed(2) + ' B';
}
if (num>1024) {
num=num/1024;
} else {
return num.toFixed(2) + ' KB';
}
if (num>1024) {
num=num/1024;
} else {
return num.toFixed(2) + ' MB';
}
return num.toFixed(2) + ' GB';
}
2020-05-20 09:22:08 +00:00
function uploadbuttonhide() {
document.getElementById('upload_btns').style.display='none';
/*document.getElementById('upload_submit').disabled='disabled';
document.getElementById('upload_file').disabled='disabled';
document.getElementById('upload_submit').style.display='none';
document.getElementById('upload_file').style.display='none';*/
}
function uploadbuttonshow() {
document.getElementById('upload_btns').style.display='';
/*document.getElementById('upload_file').disabled='';
document.getElementById('upload_submit').disabled='';
document.getElementById('upload_submit').style.display='';
document.getElementById('upload_file').style.display='';*/
}
2021-03-04 07:15:34 +00:00
<!-- UploadJsEnd -->
<!-- OnedriveUploadJsStart -->
2020-05-20 09:22:08 +00:00
function preup() {
uploadbuttonhide();
var files=document.getElementById('upload_file').files;
if (files.length< 1 ) {
uploadbuttonshow();
return;
};
var table1=document.createElement('table');
2021-03-04 07:15:34 +00:00
document.getElementById('upload_div').appendChild(table1);
2020-05-20 09:22:08 +00:00
table1.setAttribute('class','list-table');
var timea=new Date().getTime();
var i=0;
getuplink(i);
2021-03-04 07:15:34 +00:00
function getuplink(i, r=0) {
2020-05-20 09:22:08 +00:00
var file=files[i];
2021-03-04 07:15:34 +00:00
var td1;
var td2;
if (r==0) {
var tr1=document.createElement('tr');
table1.appendChild(tr1);
tr1.setAttribute('data-to',1);
td1=document.createElement('td');
tr1.appendChild(td1);
td1.setAttribute('style','width:30%;word-break:break-word;');
td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
td1.innerHTML=(file.webkitRelativePath||file.name)+'< br > '+size_format(file.size);
td2=document.createElement('td');
tr1.appendChild(td2);
td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
}
var tdnum = timea+'_'+i;
td1=document.getElementById('upfile_td1_'+tdnum);
td2=document.getElementById('upfile_td2_'+tdnum);
2020-05-20 09:22:08 +00:00
if (file.size>100*1024*1024*1024) {
td2.innerHTML='< font color = "red" > <!-- constStr@UpFileTooLarge --> < / font > ';
uploadbuttonshow();
return;
}
2021-03-04 07:15:34 +00:00
var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
var filemd5='';
<!-- GuestStart -->
function getext(str) {
strarry=str.split('.');
if (strarry.length==1) return '';
ext=strarry[strarry.length-1].toLowerCase();
var reg = new RegExp(".","g");
var a = str.replace(reg,"");
if (a == ext) ext = "";
else ext = "." + ext;
return ext;
}
var ext = getext(file.webkitRelativePath||file.name);
var spark = new SparkMD5.ArrayBuffer();
var reader = new FileReader();
var chunksize=10*1024*1024;
var asize = 0;
function readblob(start) {
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
}
readblob(asize);
reader.onload = function(e){
td2.innerHTML='<!-- constStr@Calculate --> md5: '+(asize*100/file.size).toFixed(2)+'%';
var binary = this.result;
spark.append(binary);
asize += chunksize;
if (asize < file.size ) {
readblob(asize);
} else {
filemd5 = spark.end();
td2.innerHTML='md5: '+filemd5;
upbigfilename = filemd5+ext;
<!-- GuestEnd -->
td2.innerHTML='<!-- constStr@GetUploadLink --> ...';
2020-05-20 09:22:08 +00:00
var xhr1 = new XMLHttpRequest();
2021-01-26 01:14:58 +00:00
xhr1.open("POST", '?action=upbigfile');
2021-03-04 07:15:34 +00:00
xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
2020-05-20 09:22:08 +00:00
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
2021-03-04 07:15:34 +00:00
xhr1.onprogress = function(e){
td2.innerHTML+='.';
}
2020-05-20 09:22:08 +00:00
xhr1.onload = function(e){
2021-03-04 07:15:34 +00:00
//console.log(xhr1.status+xhr1.responseText);
2020-05-20 09:22:08 +00:00
td2.innerHTML='< font color = "red" > '+xhr1.responseText+'< / font > ';
2021-03-04 07:15:34 +00:00
if (xhr1.status==409) {
// td2.innerHTML='nameAlreadyExists';
var html=JSON.parse(xhr1.responseText);
td2.innerHTML=html['error']['code']+': '+html['error']['message'];
<!-- GuestStart -->
td2.innerHTML='md5: '+filemd5;
<!-- GuestEnd -->
td1.innerHTML='< div style = "color:green" > < a href = "<!--base_disk_path--><!--Path-->'+(file.webkitRelativePath||file.name)+'?preview" id = "upfile_a_'+tdnum+'" target = "_blank" > '+td1.innerHTML+'< / a > < br > < a href = "<!--base_disk_path--><!--Path-->'+(file.webkitRelativePath||file.name)+'" id = "upfile_a1_'+tdnum+'" > < / a > <!-- constStr@UploadComplete --> < button onclick = "CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id = "upfile_cpbt_'+tdnum+'" < ! --AdminStart-- > style="display:none"<!-- AdminEnd --> ><!-- constStr@CopyUrl --> < / button > < / div > ';
}
2020-05-20 09:22:08 +00:00
if (xhr1.status==200) {
2021-03-04 07:15:34 +00:00
if (xhr1.responseText=='') {
getuplink(i,1);
return;
}
2020-05-20 09:22:08 +00:00
var html=JSON.parse(xhr1.responseText);
if (!html['uploadUrl']) {
td2.innerHTML='< font color = "red" > '+xhr1.responseText+'< / font > < br > ';
} else {
td2.innerHTML='<!-- constStr@UploadStart --> ...';
2021-03-04 07:15:34 +00:00
binupfile(file,html['uploadUrl'],timea+'_'+i, upbigfilename);
2020-05-20 09:22:08 +00:00
}
}
if (i< files.length-1 ) {
i++;
getuplink(i);
}
}
2021-03-04 07:15:34 +00:00
xhr1.send('upbigfilename='+ encodeURIComponent(upbigfilename) +'& filesize='+ file.size +'& filelastModified='+ file.lastModified +'& filemd5='+ filemd5);
<!-- GuestStart -->
}
2020-05-20 09:22:08 +00:00
}
2021-03-04 07:15:34 +00:00
<!-- GuestEnd -->
2020-05-20 09:22:08 +00:00
}
2021-03-04 07:15:34 +00:00
uploadbuttonshow();
2020-05-20 09:22:08 +00:00
}
2021-03-04 07:15:34 +00:00
function binupfile(file,url,tdnum,filename){
2020-05-20 09:22:08 +00:00
var label=document.getElementById('upfile_td2_'+tdnum);
var reader = new FileReader();
var StartStr='';
var MiddleStr='';
var StartTime;
var EndTime;
var newstartsize = 0;
if(!!file){
var asize=0;
var totalsize=file.size;
var xhr2 = new XMLHttpRequest();
xhr2.open("GET", url);
//xhr2.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr2.send(null);
xhr2.onload = function(e){
if (xhr2.status==200) {
var html = JSON.parse(xhr2.responseText);
var a = html['nextExpectedRanges'][0];
newstartsize = Number( a.slice(0,a.indexOf("-")) );
StartTime = new Date();
asize = newstartsize;
if (newstartsize==0) {
StartStr='<!-- constStr@UploadStartAt --> :' +StartTime.toLocaleString()+'< br > ' ;
} else {
StartStr='<!-- constStr@LastUpload --> '+size_format(newstartsize)+ '< br > <!-- constStr@ThisTime --> <!-- constStr@UploadStartAt --> :' +StartTime.toLocaleString()+'< br > ' ;
}
var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小, 最大60M, 微软建议10M
if (totalsize>200*1024*1024) chunksize=10*1024*1024;
function readblob(start) {
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
}
readblob(asize);
2021-03-04 07:15:34 +00:00
2020-05-20 09:22:08 +00:00
reader.onload = function(e){
var binary = this.result;
var xhr = new XMLHttpRequest();
xhr.open("PUT", url, true);
//xhr.setRequestHeader('x-requested-with','XMLHttpRequest');
bsize=asize+e.loaded-1;
xhr.setRequestHeader('Content-Range', 'bytes ' + asize + '-' + bsize +'/'+ totalsize);
xhr.upload.onprogress = function(e){
if (e.lengthComputable) {
var tmptime = new Date();
var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
label.innerHTML=StartStr+'<!-- constStr@Upload --> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <!-- constStr@AverageSpeed --> :'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s< br > <!-- constStr@CurrentSpeed --> '+size_format(tmpspeed)+'/s <!-- constStr@Expect --> '+remaintime.toFixed(1)+'s';
}
}
var C_starttime = new Date();
xhr.onload = function(e){
if (xhr.status< 500 ) {
var response=JSON.parse(xhr.responseText);
if (response['size']>0) {
// contain size, upload finish. 有size说明是最终返回, 上传结束
2021-03-04 07:15:34 +00:00
if (totalsize>10*1024*1024) {
var xhr3 = new XMLHttpRequest();
xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr3.send(null);
xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status);
2020-05-20 09:22:08 +00:00
}
}
EndTime=new Date();
MiddleStr = '<!-- constStr@EndAt --> :'+EndTime.toLocaleString()+'< br > ';
if (newstartsize==0) {
MiddleStr += '<!-- constStr@AverageSpeed --> :'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
} else {
MiddleStr += '<!-- constStr@ThisTime --> <!-- constStr@AverageSpeed --> :'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
}
2021-03-04 07:15:34 +00:00
while (filename.indexOf('%2F')>0) filename = filename.replace('%2F', '/');
document.getElementById('upfile_td1_'+tdnum).innerHTML='< div style = "color:green" > < a href = "<!--base_disk_path--><!--Path-->'+filename+'?preview" id = "upfile_a_'+tdnum+'" target = "_blank" > '+document.getElementById('upfile_td1_'+tdnum).innerHTML+'< / a > < br > < a href = "<!--base_disk_path--><!--Path-->'+filename+'" id = "upfile_a1_'+tdnum+'" > < / a > <!-- constStr@UploadComplete --> < button onclick = "CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id = "upfile_cpbt_'+tdnum+'" < ! --AdminStart-- > style="display:none"<!-- AdminEnd --> ><!-- constStr@CopyUrl --> < / button > < / div > ';
2020-05-20 09:22:08 +00:00
label.innerHTML=StartStr+MiddleStr;
2021-03-04 07:15:34 +00:00
label.style.color='green';
// uploadbuttonshow();
2020-05-20 09:22:08 +00:00
<!-- AdminStart -->
2021-03-04 07:15:34 +00:00
response.name=file.webkitRelativePath||response.name;
2020-05-20 09:22:08 +00:00
addelement(response);
<!-- AdminEnd -->
} else {
if (!response['nextExpectedRanges']) {
label.innerHTML='< font color = "red" > '+xhr.responseText+'< / font > < br > ';
} else {
var a=response['nextExpectedRanges'][0];
asize=Number( a.slice(0,a.indexOf("-")) );
readblob(asize);
}
} } else readblob(asize);
}
xhr.send(binary);
}
} else {
2021-03-04 07:15:34 +00:00
if (window.location.pathname.indexOf('%23')>0||filename.indexOf('%23')>0) {
2020-05-20 09:22:08 +00:00
label.innerHTML='< font color = "red" > <!-- constStr@UploadFail23 --> < / font > ';
} else {
label.innerHTML='< font color = "red" > '+xhr2.responseText+'< / font > ';
}
2021-03-04 07:15:34 +00:00
// uploadbuttonshow();
2020-05-20 09:22:08 +00:00
}
}
}
}
2021-03-04 07:15:34 +00:00
<!-- OnedriveUploadJsEnd -->
<!-- AliyundriveUploadJsStart -->
function preup() {
uploadbuttonhide();
var files=document.getElementById('upload_file').files;
if (files.length< 1 ) {
uploadbuttonshow();
return;
};
var table1=document.createElement('table');
document.getElementById('upload_div').appendChild(table1);
table1.setAttribute('class','list-table');
var timea=new Date().getTime();
var i=0;
getuplink(i);
function getuplink(i, r=0) {
var file=files[i];
var td1;
var td2;
if (r==0) {
var tr1=document.createElement('tr');
table1.appendChild(tr1);
tr1.setAttribute('data-to',1);
td1=document.createElement('td');
tr1.appendChild(td1);
td1.setAttribute('style','width:30%;word-break:break-word;');
td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
td1.innerHTML=(file.webkitRelativePath||file.name)+'< br > '+size_format(file.size);
td2=document.createElement('td');
tr1.appendChild(td2);
td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
}
var tdnum = timea+'_'+i;
td1=document.getElementById('upfile_td1_'+tdnum);
td2=document.getElementById('upfile_td2_'+tdnum);
var chunksize=10*1024*1024; // 分块大小
//var chunksize=100*1024; // 测试小块
/*if (file.size>100*1024*1024*1024) {
td2.innerHTML='< font color = "red" > <!-- constStr@UpFileTooLarge --> < / font > ';
uploadbuttonshow();
return;
}*/
var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
var reader = new FileReader();
reader.onprogress = function(e) {
td2.innerText = '计算SHA1... ' + (e.loaded*100/file.size).toFixed(2) + " %";
}
reader.onload = function(e) {
var filesha1 = sha1(this.result);
<!-- GuestStart -->
function getext(str) {
let p = str.lastIndexOf('.');
if (p===-1) return '';
if (p===0) return '';
return str.substr(p);
}
var ext = getext(file.webkitRelativePath||file.name);
upbigfilename = filesha1 + ext;
<!-- GuestEnd -->
while (upbigfilename.indexOf('%2F')>0) upbigfilename = upbigfilename.replace('%2F', '/');
td2.innerHTML='<!-- constStr@GetUploadLink --> ...';
var html = JSON.parse(localStorage.getItem(filesha1));
//console.log(html);
if (html!==null & & ('part_info_list' in html)) {
td2.innerHTML='<!-- constStr@UploadStart --> ...';
binupfile(file, html, timea+'_'+i, upbigfilename, filesha1, chunksize);
} else {
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", '?action=upbigfile');
xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr1.onload = function(e){
//console.log(xhr1.status+xhr1.responseText);
td2.innerHTML='< font color = "red" > '+xhr1.responseText+'< / font > ';
if (xhr1.status==201) {
if (xhr1.responseText=='') {
getuplink(i,1);
return;
}
var html=JSON.parse(xhr1.responseText);
//console.log(html);
if (!html['part_info_list']) {
if (html.name!='') {
if (html.exist==true) td2.innerHTML=html.name+' 文件名已有';
else if (html.rapid_upload==true) td2.innerHTML=html.name+' 秒传';
else td2.innerHTML='< font color = "red" > '+xhr1.responseText+'< / font > < br > ';
td1.innerHTML='< div style = "color:green" > < a href = "<!--base_disk_path--><!--Path-->'+upbigfilename+'?preview" id = "upfile_a_'+tdnum+'" target = "_blank" > '+td1.innerHTML+'< / a > < br > < a href = "<!--base_disk_path--><!--Path-->'+upbigfilename+'" id = "upfile_a1_'+tdnum+'" > < / a > <!-- constStr@UploadComplete --> < button onclick = "CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id = "upfile_cpbt_'+tdnum+'" < ! --AdminStart-- > style="display:none"<!-- AdminEnd --> ><!-- constStr@CopyUrl --> < / button > < / div > ';
} else {
td2.innerHTML='< font color = "red" > '+xhr1.responseText+'< / font > < br > ';
}
} else {
td2.innerHTML='<!-- constStr@UploadStart --> ...';
//console.log(html);
localStorage.setItem(filesha1, JSON.stringify(html));
binupfile(file, html, timea+'_'+i, upbigfilename, filesha1, chunksize);
}
}
if (i< files.length-1 ) {
i++;
getuplink(i);
}
}
xhr1.send('upbigfilename='+ encodeURIComponent(upbigfilename) +'& filesize='+ file.size +'& filelastModified='+ file.lastModified + '& filesha1=' + filesha1 + '& chunksize=' + chunksize);
}
}
reader.readAsArrayBuffer(file);
}
uploadbuttonshow();
}
function binupfile(file, res, tdnum, filename, filesha1, chunksize) {
// xhr.getResponseHeader
if (!('ETag' in res)) res['ETag'] = new Array();
var fileid = res['file_id'];
var uploadid = res['upload_id'];
var label=document.getElementById('upfile_td2_'+tdnum);
var reader = new FileReader();
var StartStr='';
var MiddleStr='';
var StartTime;
var EndTime;
var newstartsize = 0;
if(!!file){
var chunknum = 0;
var chunknumtotal = res['part_info_list'].length;
var asize=0;
var totalsize=file.size;
var newstartsize=0;
while (res['ETag'][chunknum]!=null) {
chunknum++;
newstartsize += chunksize;
}
StartTime = new Date();
asize = newstartsize;
if (newstartsize==0) {
StartStr='<!-- constStr@UploadStartAt --> :' +StartTime.toLocaleString()+'< br > ' ;
} else {
StartStr='<!-- constStr@LastUpload --> '+size_format(newstartsize)+ '< br > <!-- constStr@ThisTime --> <!-- constStr@UploadStartAt --> :' +StartTime.toLocaleString()+'< br > ' ;
}
//var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小
//if (totalsize>200*1024*1024) chunksize=10*1024*1024;
function readblob(start) {
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
//reader.readAsArrayBuffer(file);
}
readblob(asize);
reader.onload = function(e){
if (asize>totalsize) {
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", '?action=upbigfile');
xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr1.onload = function(e){
console.log(xhr1.responseText+','+xhr1.status);
if (xhr1.status==200) {
localStorage.removeItem(filesha1);
<!-- AdminStart -->
var html=JSON.parse(xhr1.responseText);
//response.name=file.webkitRelativePath||response.name;
addelement(html);
<!-- AdminEnd -->
/*if (totalsize>10*1024*1024) {
var xhr3 = new XMLHttpRequest();
xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr3.send(null);
xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status);
}
}*/
EndTime=new Date();
MiddleStr = '<!-- constStr@EndAt --> :'+EndTime.toLocaleString()+'< br > ';
if (newstartsize==0) {
MiddleStr += '<!-- constStr@AverageSpeed --> :'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
} else {
MiddleStr += '<!-- constStr@ThisTime --> <!-- constStr@AverageSpeed --> :'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
}
document.getElementById('upfile_td1_'+tdnum).innerHTML='< div style = "color:green" > < a href = "<!--base_disk_path--><!--Path-->'+filename+'?preview" id = "upfile_a_'+tdnum+'" target = "_blank" > '+document.getElementById('upfile_td1_'+tdnum).innerHTML+'< / a > < br > < a href = "<!--base_disk_path--><!--Path-->'+filename+'" id = "upfile_a1_'+tdnum+'" > < / a > <!-- constStr@UploadComplete --> < button onclick = "CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id = "upfile_cpbt_'+tdnum+'" < ! --AdminStart-- > style="display:none"<!-- AdminEnd --> ><!-- constStr@CopyUrl --> < / button > < / div > ';
label.innerHTML=StartStr+MiddleStr;
label.style.color='green';
} else {
label.innerHTML= '< font color = "red" > ' + xhr1.status + ',' + xhr1.responseText + '< / font > ';
localStorage.removeItem(filesha1);
}
}
xhr1.send('uploadid=' + uploadid + '& fileid=' + fileid + '& etag=' + JSON.stringify(res['ETag']));
} else {
var binary = this.result;
var xhr = new XMLHttpRequest();
xhr.open("PUT", res['part_info_list'][chunknum]['upload_url'], true);
//xhr.setRequestHeader('x-requested-with','XMLHttpRequest');
bsize=asize+e.loaded-1;
xhr.setRequestHeader('Content-Range', 'bytes ' + asize + '-' + bsize +'/'+ totalsize);
xhr.upload.onprogress = function(e){
if (e.lengthComputable) {
var tmptime = new Date();
var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
label.innerHTML=StartStr+'<!-- constStr@Upload --> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <!-- constStr@AverageSpeed --> :'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s< br > <!-- constStr@CurrentSpeed --> '+size_format(tmpspeed)+'/s <!-- constStr@Expect --> '+remaintime.toFixed(1)+'s';
}
}
var C_starttime = new Date();
xhr.onload = function(e){
if (xhr.status< 500 ) {
//console.log(xhr.responseText);
//console.log(xhr.getResponseHeader('ETag'));
//var response=JSON.parse(xhr.responseText);
if (xhr.responseText==''& & xhr.getResponseHeader('ETag')!='') {
// 有ETag说明本段上传成功
let etag = xhr.getResponseHeader('ETag');
//if (etag.substr(0,1)=='"') etag = etag.substr(1);还就要引号!
//if (etag.substr(-1)=='"') etag = etag.substr(0, etag.length-1);
res['ETag'][chunknum] = etag;
localStorage.setItem(filesha1, JSON.stringify(res));
chunknum++;
asize = bsize + 1;
if (chunknum==chunknumtotal) {
// 上传结束
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", '?action=upbigfile');
xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr1.onload = function(e){
console.log(xhr1.responseText+','+xhr1.status);
if (xhr1.status==200) {
localStorage.removeItem(filesha1);
<!-- AdminStart -->
var html=JSON.parse(xhr1.responseText);
//response.name=file.webkitRelativePath||response.name;
addelement(html);
<!-- AdminEnd -->
/*if (totalsize>10*1024*1024) {
var xhr3 = new XMLHttpRequest();
xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr3.send(null);
xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status);
}
}*/
EndTime=new Date();
MiddleStr = '<!-- constStr@EndAt --> :'+EndTime.toLocaleString()+'< br > ';
if (newstartsize==0) {
MiddleStr += '<!-- constStr@AverageSpeed --> :'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
} else {
MiddleStr += '<!-- constStr@ThisTime --> <!-- constStr@AverageSpeed --> :'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s< br > ';
}
document.getElementById('upfile_td1_'+tdnum).innerHTML='< div style = "color:green" > < a href = "<!--base_disk_path--><!--Path-->'+filename+'?preview" id = "upfile_a_'+tdnum+'" target = "_blank" > '+document.getElementById('upfile_td1_'+tdnum).innerHTML+'< / a > < br > < a href = "<!--base_disk_path--><!--Path-->'+filename+'" id = "upfile_a1_'+tdnum+'" > < / a > <!-- constStr@UploadComplete --> < button onclick = "CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id = "upfile_cpbt_'+tdnum+'" < ! --AdminStart-- > style="display:none"<!-- AdminEnd --> ><!-- constStr@CopyUrl --> < / button > < / div > ';
label.innerHTML=StartStr+MiddleStr;
label.style.color='green';
} else {
label.innerHTML= '< font color = "red" > ' + xhr1.status + ',' + xhr1.responseText + '< / font > ';
localStorage.removeItem(filesha1);
}
}
xhr1.send('uploadid=' + uploadid + '& fileid=' + fileid + '& etag=' + JSON.stringify(res['ETag']));
// uploadbuttonshow();
} else {
readblob(asize);
}
} else {
console.log(xhr.status+xhr.responseText);//< PartEtag >
if (xhr.status==409) {
let str = xhr.responseText;
str = str.substr(str.indexOf('< PartEtag > ')+10);
str = str.substr(0, str.indexOf('< / PartEtag > '));
res['ETag'][chunknum] = str;
localStorage.setItem(filesha1, JSON.stringify(res));
chunknum++;
asize += chunksize;
readblob(asize);
}
//label.innerHTML='< font color = "red" > '+xhr.responseText+'< / font > < br > ';
} } else readblob(asize);
}
xhr.send(binary);
}
}
}
}
<!-- AliyundriveUploadJsEnd -->
2020-05-20 09:22:08 +00:00
<!-- ListEnd -->
function operatediv_close(operate) {
document.getElementById(operate+'_div').style.display='none';
document.getElementById('mask').style.display='none';
}
<!-- AdminStart -->
function logout() {
2021-03-04 07:15:34 +00:00
var expd = new Date();
expd.setTime(expd.getTime()+1000);
var expires = "expires="+expd.toGMTString();
document.cookie = "admin=; path=/; "+expires;
2020-05-20 09:22:08 +00:00
location.href = location.href;
}
<!-- IsFolderStart -->
function showdiv(event,action,num) {
var $operatediv=document.getElementsByName('operatediv');
for ($i=0;$i< $operatediv.length;$i++) {
$operatediv[$i].style.display='none';
}
2021-03-04 07:15:34 +00:00
document.getElementById('mask').style.display='';
2020-05-20 09:22:08 +00:00
//document.getElementById('mask').style.width=document.documentElement.scrollWidth+'px';
document.getElementById('mask').style.height=document.documentElement.scrollHeight< window.innerHeight ? window . innerHeight:document . documentElement . scrollHeight + ' px ' ;
if (num=='') {
var str='';
2021-03-04 07:15:34 +00:00
var fileid='';
2020-05-20 09:22:08 +00:00
} else {
2021-03-04 07:15:34 +00:00
var str=decodeURIComponent(document.getElementById('file_a'+num).href);
if (str.substr(-1)==' ') str=str.substr(0, str.length-1);
if (str.substr(-1)=='/') str=str.substr(0, str.length-1);
if (str.substr(-8)=='?preview') str=str.substr(0, str.length-8);
if (str.lastIndexOf('/')>-1) str=str.substr(str.lastIndexOf('/')+1);
var fileid=document.getElementById('file_a'+num).attributes['fileid'].nodeValue;
2020-05-20 09:22:08 +00:00
}
document.getElementById(action + '_div').style.display='';
document.getElementById(action + '_label').innerText=str;//.replace(/&/,'& ');
document.getElementById(action + '_sid').value=num;
2021-03-04 07:15:34 +00:00
document.getElementById(action + '_fileid').value=fileid;
2020-05-20 09:22:08 +00:00
document.getElementById(action + '_hidden').value=str;
if (action=='rename') document.getElementById(action + '_input').value=str;
var $e = event || window.event;
var $scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
var $scrollY = document.documentElement.scrollTop || document.body.scrollTop;
var $x = $e.pageX || $e.clientX + $scrollX;
var $y = $e.pageY || $e.clientY + $scrollY;
if (action=='create') {
document.getElementById(action + '_div').style.left=(document.body.clientWidth-document.getElementById(action + '_div').offsetWidth)/2 +'px';
document.getElementById(action + '_div').style.top=(window.innerHeight-document.getElementById(action + '_div').offsetHeight)/2+$scrollY +'px';
} else {
if ($x + document.getElementById(action + '_div').offsetWidth > document.body.clientWidth) {
if (document.getElementById(action + '_div').offsetWidth > document.body.clientWidth) {
document.getElementById(action + '_div').offsetWidth=document.body.clientWidth+'px';
document.getElementById(action + '_div').style.left='0px';
} else {
document.getElementById(action + '_div').style.left=document.body.clientWidth-document.getElementById(action + '_div').offsetWidth+'px';
}
} else {
document.getElementById(action + '_div').style.left=$x+'px';
}
document.getElementById(action + '_div').style.top=$y+'px';
}
document.getElementById(action + '_input').focus();
}
function submit_operate(str) {
var num=document.getElementById(str+'_sid').value;
var xhr = new XMLHttpRequest();
2021-03-04 07:15:34 +00:00
xhr.open("POST", '');
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
xhr.setRequestHeader('x-requested-with', 'XMLHttpRequest');
2020-05-20 09:22:08 +00:00
xhr.onload = function(e){
var html;
if (xhr.status< 300 ) {
console.log(xhr.status+','+xhr.responseText);
if (str=='rename') {
html=JSON.parse(xhr.responseText);
var file_a = document.getElementById('file_a'+num);
file_a.innerText=html.name;
file_a.href = (file_a.href.substr(-8)=='?preview')?(html.name.replace(/#/,'%23')+'?preview'):(html.name.replace(/#/,'%23')+'/');
}
if (str=='move'||str=='delete') document.getElementById('tr'+num).parentNode.removeChild(document.getElementById('tr'+num));
if (str=='create') {
html=JSON.parse(xhr.responseText);
addelement(html);
}
2021-03-04 07:15:34 +00:00
//alert('success');
2020-05-20 09:22:08 +00:00
} else alert(xhr.status+'\n'+xhr.responseText);
document.getElementById(str+'_div').style.display='none';
document.getElementById('mask').style.display='none';
}
2021-03-04 07:15:34 +00:00
xhr.send(serializeForm(str+'_form'));
2020-05-20 09:22:08 +00:00
return false;
}
function addelement(html) {
var tr1=document.createElement('tr');
tr1.setAttribute('data-to',1);
var td1=document.createElement('td');
td1.setAttribute('class','file');
var a1=document.createElement('a');
a1.href='<!-- base_disk_path --> <!-- Path --> '+html.name.replace(/#/,'%23');
a1.innerText=html.name;
a1.target='_blank';
var td2=document.createElement('td');
td2.setAttribute('class','updated_at');
2021-03-04 07:15:34 +00:00
if (!!html.time) td2.innerText=html.time.replace(/T/,' ').replace(/Z/,'');
2020-05-20 09:22:08 +00:00
var td3=document.createElement('td');
td3.setAttribute('class','size');
2021-03-04 07:15:34 +00:00
if (!!html.size) td3.innerText=size_format(html.size);
else td3.innerText='0 B';
if (html.type=='folder') {
2020-05-20 09:22:08 +00:00
a1.href+='/';
document.getElementById('tr0').parentNode.insertBefore(tr1,document.getElementById('tr0').nextSibling);
}
2021-03-04 07:15:34 +00:00
if (html.type=='file') {
2020-05-20 09:22:08 +00:00
a1.href+='?preview';
a1.name='filelist';
document.getElementById('tr0').parentNode.appendChild(tr1);
}
tr1.appendChild(td1);
td1.appendChild(a1);
tr1.appendChild(td2);
tr1.appendChild(td3);
}
function getElements(formId) {
var form = document.getElementById(formId);
var elements = new Array();
var tagElements = form.getElementsByTagName('input');
for (var j = 0; j < tagElements.length ; j + + ) {
elements.push(tagElements[j]);
}
var tagElements = form.getElementsByTagName('select');
for (var j = 0; j < tagElements.length ; j + + ) {
elements.push(tagElements[j]);
}
var tagElements = form.getElementsByTagName('textarea');
for (var j = 0; j < tagElements.length ; j + + ) {
elements.push(tagElements[j]);
}
return elements;
}
function serializeElement(element) {
var method = element.tagName.toLowerCase();
var parameter;
if (method == 'select') {
parameter = [element.name, element.value];
}
switch (element.type.toLowerCase()) {
case 'submit':
case 'hidden':
case 'password':
case 'text':
case 'date':
case 'textarea':
parameter = [element.name, element.value];
break;
case 'checkbox':
case 'radio':
if (element.checked){
parameter = [element.name, element.value];
}
break;
}
if (parameter) {
var key = encodeURIComponent(parameter[0]);
if (key.length == 0) return;
if (parameter[1].constructor != Array) parameter[1] = [parameter[1]];
var values = parameter[1];
var results = [];
for (var i = 0; i < values.length ; i + + ) {
results.push(key + '=' + encodeURIComponent(values[i]));
}
return results.join('&');
}
}
function serializeForm(formId) {
var elements = getElements(formId);
var queryComponents = new Array();
for (var i = 0; i < elements.length ; i + + ) {
var queryComponent = serializeElement(elements[i]);
if (queryComponent) {
queryComponents.push(queryComponent);
}
}
return queryComponents.join('&');
}
<!-- IsFolderEnd -->
<!-- AdminEnd -->
<!-- LoginStart -->
function login() {
2021-03-04 07:15:34 +00:00
document.getElementById('mask').style.display='';
2020-05-20 09:22:08 +00:00
//document.getElementById('mask').style.width=document.documentElement.scrollWidth+'px';
document.getElementById('mask').style.height=document.documentElement.scrollHeight< window.innerHeight ? window . innerHeight:document . documentElement . scrollHeight + ' px ' ;
document.getElementById('login_div').style.display='';
document.getElementById('login_div').style.left=(document.body.clientWidth-document.getElementById('login_div').offsetWidth)/2 +'px';
document.getElementById('login_div').style.top=(window.innerHeight-document.getElementById('login_div').offsetHeight)/2+document.body.scrollTop +'px';
document.getElementById('login_input').focus();
}
<!-- LoginEnd -->
2021-03-04 07:15:34 +00:00
<!-- EncryptedStart -->
document.getElementById('password1').focus();
<!-- EncryptedEnd -->
2020-05-20 09:22:08 +00:00
< / script >
< script src = "//unpkg.zhimg.com/ionicons@4.4.4/dist/ionicons.js" > < / script >
< script src = "//cdn.bootcdn.net/ajax/libs/jquery/3.3.1/jquery.slim.min.js" integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin = "anonymous" > < / script >
< script src = "//cdn.bootcdn.net/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity = "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin = "anonymous" > < / script >
< script src = "//cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.1.1/js/bootstrap.min.js" integrity = "sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin = "anonymous" > < / script >
<!-- customScript -->
< / html >