OneManager-php/theme/classic.html

1722 lines
87 KiB
HTML
Raw Permalink Normal View History

2020-05-03 10:25:39 +00:00
<!--IconValuesStart-->
{
"music":"musical-notes",
"video":"logo-youtube",
"img":"image",
2021-07-26 02:23:03 +00:00
"office":"newspaper",
2020-05-03 10:25:39 +00:00
"txt":"clipboard",
2021-07-26 02:23:03 +00:00
"zip":"file-tray-full",
2020-05-03 10:25:39 +00:00
"iso":"disc",
"apk":"logo-android",
"exe":"logo-windows",
"default":"document"
}
<!--IconValuesEnd-->
2020-01-18 12:12:21 +00:00
<!DOCTYPE html>
2020-05-03 10:25:39 +00:00
<html lang="<!--constStr@language-->">
2020-01-18 12:12:21 +00:00
<head>
2020-05-03 10:25:39 +00:00
<title><!--Title--></title>
2020-01-18 12:12:21 +00:00
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
2020-05-03 10:25:39 +00:00
<meta name="keywords" content="<!--Keywords-->">
<meta name="description" content="<!--Description-->">
2020-05-20 09:21:10 +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-01-18 12:12:21 +00:00
<style type="text/css">
2020-05-03 10:25:39 +00:00
body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:1em;color:#000;background-color:#f7f7f9;<!--BackgroundStart-->background-repeat:no-repeat;background-size:cover;background-attachment:fixed;background-image:url("<!--BackgroundUrl-->");<!--BackgroundEnd-->}
2020-01-18 12:12:21 +00:00
a{color:#24292e;cursor:pointer;text-decoration:none}
2020-02-24 06:14:26 +00:00
ion-icon{font-size:15px;vertical-align:bottom}
2020-01-18 12:12:21 +00:00
.changelanguage{position:absolute;right:5px;}
.title{text-align:center;margin-top:1rem;letter-spacing:2px;margin-bottom:2rem}
.title a{color:#333;text-decoration:none}
2020-02-15 10:50:23 +00:00
.list-wrapper{width:80%;margin:0 auto 30px;position:relative;box-shadow:0 0 32px 0 rgb(128,128,128);border-radius:15px;}
2021-04-19 11:42:27 +00:00
.list-container{position:relative;/*overflow:hidden;*/border-radius:15px;background-color:rgba(245,245,245,0.5);}
2021-04-19 11:35:54 +00:00
.list-container,.list-header-container,.list-wrapper,a.back-link:hover,body{color:#24292e}
2020-01-18 12:12:21 +00:00
.list-header-container{position:relative}
.list-header-container a.back-link{color:#000;display:inline-block;position:absolute;font-size:16px;margin:20px 10px;padding:10px 10px;vertical-align:middle;text-decoration:none}
2021-04-19 11:42:27 +00:00
.table-header{margin:0;border:0 none;padding:30px 30px;text-align:left;font-weight:400;color:#000;word-break: break-all;word-wrap: break-word;}
2021-04-19 11:35:54 +00:00
.list-body-container{position:relative;left:0;box-sizing:border-box;/*overflow-x:hidden;overflow-y:auto;background:rgba(245,245,245,0.5)*/}
2021-04-19 11:42:27 +00:00
.more-disk{margin:0;border:0 none;padding:30px 30px;text-align:left;font-weight:400;color:#000;white-space:nowrap;overflow:auto;}
2020-03-02 09:10:00 +00:00
.more-disk a{margin:0 10px;padding:5px;transition-duration: 0.4s;border-radius: 12px; background-color: white; color: black; border: 2px solid rgba(85,85,85,0.7); }
.more-disk a:hover, .more-disk a[now]{ background-color: rgba(85,85,85,0.7); color: white; }
2020-02-15 11:06:29 +00:00
.list-table{width:100%;padding:0 20px 20px 20px;border-spacing:0}
2020-01-18 12:12:21 +00:00
.list-table tr{height:40px}
2020-02-23 09:33:26 +00:00
.list-table tr[data-to]:hover{background:rgba(85,85,85,0.7);color:white;}
2020-02-24 01:19:00 +00:00
.list-table tr[data-to]:hover a{color:white}
2020-02-22 13:24:53 +00:00
.list-table tr:first-child{background:rgba(245,245,245,0)}
2020-01-18 12:12:21 +00:00
.list-table td,.list-table th{padding:0 10px;text-align:left}
.list-table .size,.list-table .updated_at{text-align:right}
2020-05-03 10:25:39 +00:00
.updated_at{width:25%}
.size{width:15%}
2020-01-18 12:12:21 +00:00
.mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=50);opacity:0.5;z-index:2;}
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
2020-02-24 06:14:26 +00:00
.operate{display:inline-table;margin:0;margin-right:5px;list-style:none}
2020-01-18 12:12:21 +00:00
.operate ul{position:absolute;display:none;background:#fffaaa;border:0px #f7f7f7 solid;border-radius:5px;margin:-7px 0 0 0;padding:0 7px;color:#205D67;z-index:1;}
.operate:hover ul{position:absolute;display:inline-table;}
2021-04-11 13:33:35 +00:00
body .active ul{position:absolute;display:inline-table;} /*for some mobile browser */
2020-02-24 06:14:26 +00:00
.operate ul li{padding:7px;list-style:none;display:block;}
.list-table tr[data-to]:hover .operate ul li a{color:black}
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
2020-01-18 12:12:21 +00:00
.operatediv{position:absolute;border:1px #CCCCCC;background-color:#FFFFCC;z-index:2;}
.operatediv div{margin:16px}
.operatediv_close{position:absolute;right:3px;top:3px;}
2021-04-19 11:42:27 +00:00
.readme{padding:8px;}
2020-05-03 10:25:39 +00:00
.markdown-body, .customfile{padding:20px;text-align:left}
@media only screen and (orientation: portrait){
2020-08-16 04:04:07 +00:00
<!--BackgroundMStart-->
body{background-repeat:no-repeat;background-size:cover;background-attachment:fixed;background-image:url("<!--BackgroundMUrl-->");}
<!--BackgroundMEnd-->
2020-01-18 12:12:21 +00:00
.title{margin-bottom:24px}
.list-wrapper{width:95%; margin-bottom:24px;}
.list-table {padding:8px}
2020-02-23 04:47:26 +00:00
.list-table td, .list-table th{white-space:nowrap;overflow:auto;max-width:80px}
2020-03-11 13:40:01 +00:00
.size, .updated_at{display:none}
2020-01-18 12:12:21 +00:00
}
</style>
2020-05-03 10:25:39 +00:00
<!--customCss-->
2020-01-18 12:12:21 +00:00
</head>
<body>
2020-05-03 10:25:39 +00:00
<div style="padding:1px" id="top-div">
<!--LoginStart-->
<a class="login" onclick="login();"><ion-icon name="log-in"></ion-icon><!--constStr@Login--></a>
<!--LoginEnd-->
<!--AdminStart-->
<li class="operate"><ion-icon name="construct"></ion-icon><!--constStr@Operate--><ul>
<!--IsFolderStart-->
<li><a onclick="showdiv(event,'create','');"><ion-icon name="add-circle"></ion-icon><!--constStr@Create--></a></li>
2021-07-26 02:23:03 +00:00
<li><a onclick="showdiv(event,'encrypt','');"><ion-icon name="lock-closed"></ion-icon><!--constStr@Encrypt--></a></li>
2020-05-03 10:25:39 +00:00
<li><a href="?RefreshCache"><ion-icon name="refresh"></ion-icon><!--constStr@RefreshCache--></a></li>
<!--IsFolderEnd-->
<li><a href="<!--IsPreview?-->setup"><ion-icon name="settings"></ion-icon><!--constStr@Setup--></a></li>
<li><a onclick="logout();"><ion-icon name="log-out"></ion-icon><!--constStr@Logout--></a></li>
2020-02-03 12:08:21 +00:00
</ul></li>
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
2020-02-03 12:08:21 +00:00
&nbsp;
2021-10-06 08:01:31 +00:00
<!--<select class="changelanguage" name="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
2020-02-03 12:08:21 +00:00
<option value="">Language</option>
2020-05-03 10:25:39 +00:00
<!--SelectLanguageStart-->
<option value="<!--SelectLanguageKey-->" <!--SelectLanguageSelected-->><!--SelectLanguageValue--></option>
<!--SelectLanguageEnd-->
2021-10-06 08:01:31 +00:00
</select>-->
2020-02-03 12:08:21 +00:00
</div>
2020-05-03 10:25:39 +00:00
<!--NeedUpdateStart-->
<div style='position:absolute;'><font color='red'><!--constStr@NeedUpdate--></font></div>
<!--NeedUpdateEnd-->
<h1 class="title" id="title">
<a href="<!--base_path-->"><!--Sitename--></a>
2020-01-18 12:12:21 +00:00
</h1>
2020-05-03 10:25:39 +00:00
<!--MultiDiskAreaStart-->
<div class="list-wrapper" id="more-disk-div">
2020-02-20 04:05:01 +00:00
<div class="list-container">
<div class="list-header-container">
<div class="more-disk">
2020-05-03 10:25:39 +00:00
<!--MultiDisksStart-->
<a href="<!--MultiDisksUrl-->" <!--MultiDisksNow-->><!--MultiDisksName--></a>
<!--MultiDisksEnd-->
2020-02-20 04:05:01 +00:00
</div>
</div>
</div>
</div>
2020-05-03 10:25:39 +00:00
<!--MultiDiskAreaEnd-->
<!--HeadomfStart-->
<div class="list-wrapper" id="head-om-div">
<div class="list-container">
<div class="list-header-container">
<div class="readme">
<div class="customfile" id="head-om">
<!--HeadomfContent-->
</div>
</div>
</div>
</div>
</div>
<!--HeadomfEnd-->
<!--HeadmdStart-->
2020-03-21 06:24:07 +00:00
<div class="list-wrapper" id="head-div">
<div class="list-container">
<div class="list-header-container">
<div class="readme">
<div class="markdown-body" id="head">
2020-05-03 10:25:39 +00:00
<textarea id="head-md" style="display:none;"><!--HeadmdContent--></textarea>
2020-03-21 06:24:07 +00:00
</div>
</div>
</div>
</div>
</div>
2020-05-03 10:25:39 +00:00
<!--HeadmdEnd-->
<!--ListStart-->
2020-02-15 08:58:25 +00:00
<div class="list-wrapper" id="list-div">
2020-01-18 12:12:21 +00:00
<div class="list-container">
<div class="list-header-container">
<h3 class="table-header"><a href="<!--base_path-->"><!--constStr@Home--></a><!--DiskPathArrayStart--> / <a href="<!--PathArrayLink-->"><!--PathArrayName--></a><!--DiskPathArrayEnd--></h3>
2020-01-18 12:12:21 +00:00
</div>
<div class="list-body-container">
2020-05-03 10:25:39 +00:00
<!--EncryptedStart-->
<div style="padding:20px">
<center>
<form action="" method="post">
2020-09-18 05:44:59 +00:00
<input id="password1" name="password1" type="password" placeholder="<!--constStr@InputPassword-->">
2020-05-03 10:25:39 +00:00
<input type="submit" value="<!--constStr@Submit-->">
</form>
</center>
</div>
<!--EncryptedEnd-->
<!--GuestUploadStart-->
<div id="upload_div" style="padding:0 0 16px 0">
2020-10-01 04:16:47 +00:00
<div id="upload_btns" align="center">
<select onchange="document.getElementById('upload_file').webkitdirectory=this.value;">
<option value=""><!--constStr@UploadFile--></option>
<option value="1"><!--constStr@UploadFolder--></option>
</select>
<input id="upload_file" type="file" name="upload_filename" multiple="multiple">
2020-05-03 10:25:39 +00:00
<input id="upload_submit" onclick="preup();" value="<!--constStr@Upload-->" type="button">
2020-10-01 04:16:47 +00:00
</div>
2020-01-18 12:12:21 +00:00
</div>
2020-05-03 10:25:39 +00:00
<!--GuestUploadEnd-->
<!--IsFileStart-->
2021-05-14 06:41:16 +00:00
<div style="padding: 12px 4px 4px; text-align: center">
2020-01-18 12:12:21 +00:00
<div style="margin: 24px">
2020-05-03 10:25:39 +00:00
<textarea id="url" title="url" rows="1" style="width: 100%; margin-top: 2px;" readonly><!--FileEncodeUrl--></textarea>
2021-03-07 15:07:12 +00:00
<a href="<!--FileEncodeUrl-->"><ion-icon name="download" style="line-height: 16px;vertical-align: middle;"></ion-icon>&nbsp;<!--constStr@Download--></a>
2020-01-18 12:12:21 +00:00
</div>
<div style="margin: 24px">
2020-05-03 10:25:39 +00:00
<!--IsimgFileStart-->
2021-05-28 05:27:13 +00:00
<img src="<!--FileEncodeUrl-->" alt="<!--FileName-->" onload="if (this.offsetWidth>document.getElementById('url').offsetWidth) this.style.width='100%';if (this.offsetHeight>document.documentElement.clientHeight) this.style.height=document.documentElement.clientHeight + 'px';" />
2020-05-03 10:25:39 +00:00
<!--IsimgFileEnd-->
<!--IsvideoFileStart-->
2022-01-01 12:05:00 +00:00
<div id="video-a0" class="artplayerdiv"></div>
2021-12-30 14:13:52 +00:00
<!--<script src="https://artplayer.org/uncompiled/artplayer.js"></script>-->
2022-01-01 12:05:00 +00:00
<script src="https://cdn.jsdelivr.net/npm/artplayer@4.1.0/dist/artplayer.min.js"></script>
<!--<script src="https://unpkg.com/artplayer@4.1.0/dist/artplayer.js"></script>-->
2020-05-03 10:25:39 +00:00
<!--IsvideoFileEnd-->
<!--IsmusicFileStart-->
<audio src="<!--FileDownUrl-->" controls="controls" style="width: 100%"></audio>
<!--IsmusicFileEnd-->
<!--IspdfFileStart-->
2020-08-03 05:47:27 +00:00
<div id="pdf-d">Loading PDF</div>
2020-05-03 10:25:39 +00:00
<!--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-->
2020-01-18 12:12:21 +00:00
<div id="txt">
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
2020-01-18 12:12:21 +00:00
<form id="txt-form" action="" method="POST">
2021-10-06 08:01:31 +00:00
<input name="_admin" type="hidden" value="">
2020-05-03 10:25:39 +00:00
<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>&nbsp;&nbsp;&nbsp;
<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>
2021-10-06 08:01:31 +00:00
<script>
var inputAdminStorage = document.getElementsByName("_admin");
for (i=0;i<inputAdminStorage.length;i++) {
inputAdminStorage[i].value = localStorage.getItem("admin");
}
</script>
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
2020-01-18 12:12:21 +00:00
</div>
2020-05-03 10:25:39 +00:00
<!--IstxtFileEnd-->
<!--IsOtherFileStart-->
<span><!--constStr@FileNotSupport--></span>
<!--IsOtherFileEnd-->
2020-01-18 12:12:21 +00:00
</div>
</div>
2020-05-03 10:25:39 +00:00
<!--IsFileEnd-->
<!--IsFolderStart-->
2020-01-18 12:12:21 +00:00
<table class="list-table" id="list-table">
<tr id="tr0">
2020-05-03 10:25:39 +00:00
<th class="file">
<a id="file_a0" fileid="<!--FolderId-->" onclick="sortby('a');"><!--constStr@File--></a>
2020-05-03 10:25:39 +00:00
<!--ShowThumbnailsStart-->
&nbsp;&nbsp;&nbsp;
2020-05-20 12:23:19 +00:00
<label><input type="checkbox" id="originalpic"><!--constStr@OriginalPic--></label>
2020-05-03 10:25:39 +00:00
<button onclick="showthumbnails(this);"><!--constStr@ShowThumbnails--></button>
<!--ShowThumbnailsEnd-->
&nbsp;
<button 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>
2020-01-18 12:12:21 +00:00
</tr>
<!-- Dirs -->
2020-05-03 10:25:39 +00:00
<!--FolderListStart-->
<tr data-to id="tr<!--filenum-->">
2020-01-18 12:12:21 +00:00
<td class="file">
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
<li class="operate"><ion-icon name="construct"></ion-icon><a><!--constStr@Operate--></a>
2020-01-18 12:12:21 +00:00
<ul>
2021-07-26 02:23:03 +00:00
<li><a onclick="showdiv(event,'encrypt',<!--filenum-->);"><ion-icon name="lock-closed"></ion-icon><!--constStr@Encrypt--></a></li>
2020-05-03 10:25:39 +00:00
<li><a onclick="showdiv(event, 'rename',<!--filenum-->);"><ion-icon name="create"></ion-icon><!--constStr@Rename--></a></li>
<li><a onclick="showdiv(event, 'move',<!--filenum-->);"><ion-icon name="move"></ion-icon><!--constStr@Move--></a></li>
<li><a onclick="showdiv(event, 'copy',<!--filenum-->);"><ion-icon name="copy"></ion-icon><!--constStr@Copy--></a></li>
<li><a onclick="showdiv(event, 'delete',<!--filenum-->);"><ion-icon name="trash"></ion-icon><!--constStr@Delete--></a></li>
2020-01-18 12:12:21 +00:00
</ul>
2020-02-24 06:14:26 +00:00
</li>
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
2020-01-18 12:12:21 +00:00
<ion-icon name="folder"></ion-icon>
2021-01-15 03:10:08 +00:00
<a id="file_a<!--filenum-->" name="folderlist" href="<!--FileEncodeReplaceUrl-->/" fileid="<!--FileId-->"><!--FileEncodeReplaceName--></a>
2020-01-18 12:12:21 +00:00
</td>
2020-05-03 10:25:39 +00:00
<td class="updated_at" id="folder_time<!--filenum-->"><!--lastModifiedDateTime--></td>
<td class="size" id="folder_size<!--filenum-->"><!--size--></td>
2020-01-18 12:12:21 +00:00
</tr>
2020-05-03 10:25:39 +00:00
<!--FolderListEnd-->
<!--FileListStart-->
<tr data-to id="tr<!--filenum-->">
2020-01-18 12:12:21 +00:00
<td class="file">
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
<li class="operate"><ion-icon name="construct"></ion-icon><a><!--constStr@Operate--></a>
2020-01-18 12:12:21 +00:00
<ul>
2020-05-03 10:25:39 +00:00
<li><a onclick="showdiv(event, 'rename',<!--filenum-->);"><ion-icon name="create"></ion-icon><!--constStr@Rename--></a></li>
<li><a onclick="showdiv(event, 'move',<!--filenum-->);"><ion-icon name="move"></ion-icon><!--constStr@Move--></a></li>
<li><a onclick="showdiv(event, 'copy',<!--filenum-->);"><ion-icon name="copy"></ion-icon><!--constStr@Copy--></a></li>
<li><a onclick="showdiv(event, 'delete',<!--filenum-->);"><ion-icon name="trash"></ion-icon><!--constStr@Delete--></a></li>
2020-01-18 12:12:21 +00:00
</ul>
2020-02-24 06:14:26 +00:00
</li>
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
<ion-icon name="<!--IconValue-->"></ion-icon>
2021-01-15 03:10:08 +00:00
<a id="file_a<!--filenum-->" name="filelist" href="<!--FileEncodeReplaceUrl-->?preview" fileid="<!--FileId-->" target=_blank><!--FileEncodeReplaceName--></a>
2020-05-03 10:25:39 +00:00
<a class="download" href="<!--FileEncodeReplaceUrl-->"><ion-icon name="download"></ion-icon></a>
2020-01-18 12:12:21 +00:00
</td>
2020-05-03 10:25:39 +00:00
<td class="updated_at" id="file_time<!--filenum-->"><!--lastModifiedDateTime--></td>
<td class="size" id="file_size<!--filenum-->"><!--size--></td>
2020-01-18 12:12:21 +00:00
</tr>
2020-05-03 10:25:39 +00:00
<!--FileListEnd-->
2020-01-18 12:12:21 +00:00
</table>
2020-05-03 10:25:39 +00:00
<!--MorePageStart-->
2020-01-18 12:12:21 +00:00
<form action="" method="POST" id="nextpageform">
2020-05-03 10:25:39 +00:00
<input type="hidden" id="pagenum" name="pagenum" value="">
2020-01-18 12:12:21 +00:00
<table width=100% border=0>
<tr>
2020-05-03 10:25:39 +00:00
<td width=60px align=center>
<!--PrePageStart-->
<a onclick="nextpage(<!--PrePageNum-->);"><!--constStr@PrePage--></a>
<!--PrePageEnd-->
2020-01-18 12:12:21 +00:00
</td>
2020-05-03 10:25:39 +00:00
<td class="updated_at">
<!--MorePageListStart-->
<a onclick="nextpage(<!--PageNum-->);"><!--PageNum--></a>
<!--MorePageListEnd-->
<!--MorePageListNowStart-->
<font color=red><!--PageNum--></font>
<!--MorePageListNowEnd-->
2020-01-18 12:12:21 +00:00
</td>
2020-05-03 10:25:39 +00:00
<td width=60px align=center>
<!--NextPageStart-->
<a onclick="nextpage(<!--NextPageNum-->);"><!--constStr@NextPage--></a>
<!--NextPageEnd-->
2020-01-18 12:12:21 +00:00
</td>
</tr>
</table>
2020-05-03 10:25:39 +00:00
</form>
<!--MorePageEnd-->
<!--AdminStart-->
<div id="upload_div" style="padding:0 0 16px 0">
2020-05-03 10:25:39 +00:00
<div id="upload_btns" align="center">
<select onchange="document.getElementById('upload_file').webkitdirectory=this.value;">
<option value=""><!--constStr@UploadFile--></option>
<option value="1"><!--constStr@UploadFolder--></option>
</select>
2020-01-18 12:12:21 +00:00
<input id="upload_file" type="file" name="upload_filename" multiple="multiple">
2020-05-03 10:25:39 +00:00
<input id="upload_submit" onclick="preup();" value="<!--constStr@Upload-->" type="button">
2020-01-18 12:12:21 +00:00
</div>
2020-05-03 10:25:39 +00:00
</div>
<!--AdminEnd-->
<!--IsFolderEnd-->
2020-01-18 12:12:21 +00:00
</div>
</div>
</div>
2020-08-31 02:04:21 +00:00
<!--ListEnd-->
2020-05-03 10:25:39 +00:00
<!--ReadmemdStart-->
<div class="list-wrapper" id="readme-div">
2020-01-18 12:12:21 +00:00
<div class="list-container">
<div class="list-header-container">
<div class="readme">
<div class="markdown-body" id="readme">
2020-05-03 10:25:39 +00:00
<textarea id="readme-md" style="display:none;"><!--ReadmemdContent--></textarea>
2020-01-18 12:12:21 +00:00
</div>
</div>
</div>
</div>
</div>
2020-05-03 10:25:39 +00:00
<!--ReadmemdEnd-->
<!--FootomfStart-->
<div class="list-wrapper" 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-->
2020-01-18 12:12:21 +00:00
<div id="mask" class="mask" style="display:none;"></div>
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
<!--IsFolderStart-->
<div style="word-break: break-all;word-wrap: break-word;">
2020-01-18 12:12:21 +00:00
<div id="rename_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<label id="rename_label"></label><br><br><a onclick="operatediv_close('rename')" class="operatediv_close"><!--constStr@Close--></a>
2020-01-18 12:12:21 +00:00
<form id="rename_form" onsubmit="return submit_operate('rename');">
<input id="rename_sid" name="rename_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="rename_fileid" name="rename_fileid" type="hidden" value="">
2020-01-18 12:12:21 +00:00
<input id="rename_hidden" name="rename_oldname" type="hidden" value="">
<input id="rename_input" name="rename_newname" type="text" value="">
2020-05-03 10:25:39 +00:00
<input name="operate_action" type="submit" value="<!--constStr@Rename-->">
2020-01-18 12:12:21 +00:00
</form>
</div>
</div>
<div id="delete_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<br><a onclick="operatediv_close('delete')" class="operatediv_close"><!--constStr@Close--></a>
2020-01-18 12:12:21 +00:00
<label id="delete_label"></label>
<form id="delete_form" onsubmit="return submit_operate('delete');">
2020-05-03 10:25:39 +00:00
<label id="delete_input"><!--constStr@Delete-->?</label>
2020-01-18 12:12:21 +00:00
<input id="delete_sid" name="delete_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="delete_fileid" name="delete_fileid" type="hidden" value="">
2020-01-18 12:12:21 +00:00
<input id="delete_hidden" name="delete_name" type="hidden" value="">
2020-05-03 10:25:39 +00:00
<input name="operate_action" type="submit" value="<!--constStr@Submit-->">
2020-01-18 12:12:21 +00:00
</form>
</div>
</div>
<div id="encrypt_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<label id="encrypt_label"></label><br><br><a onclick="operatediv_close('encrypt')" class="operatediv_close"><!--constStr@Close--></a>
2020-01-18 12:12:21 +00:00
<form id="encrypt_form" onsubmit="return submit_operate('encrypt');">
<input id="encrypt_sid" name="encrypt_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="encrypt_fileid" name="encrypt_fileid" type="hidden" value="">
2020-01-18 12:12:21 +00:00
<input id="encrypt_hidden" name="encrypt_folder" type="hidden" value="">
2020-05-03 10:25:39 +00:00
<input id="encrypt_input" name="encrypt_newpass" type="text" value="" placeholder="<!--constStr@InputPasswordUWant-->">
<!--EncryptBtnStart--><input name="operate_action" type="submit" value="<!--constStr@Encrypt-->"><!--EncryptBtnEnd--><!--EncryptAlertStart--><br><label><!--constStr@SetpassfileBfEncrypt--></label><!--EncryptAlertEnd-->
2020-01-18 12:12:21 +00:00
</form>
</div>
</div>
2020-02-22 08:48:10 +00:00
<div id="copy_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<label id="copy_label"></label><br><br><a onclick="operatediv_close('copy')" class="operatediv_close"><!--constStr@Close--></a>
2020-02-22 08:48:10 +00:00
<form id="copy_form" onsubmit="return submit_operate('copy');">
<input id="copy_sid" name="copy_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="copy_fileid" name="copy_fileid" type="hidden" value="">
2020-02-22 08:48:10 +00:00
<input id="copy_hidden" name="copy_name" type="hidden" value="">
<input id="copy_input" name="copy_input" type="hidden" value="">
2020-05-03 10:25:39 +00:00
<input name="operate_action" type="submit" value="<!--constStr@Copy-->">
2020-02-22 08:48:10 +00:00
</form>
</div>
</div>
2020-01-18 12:12:21 +00:00
<div id="move_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<label id="move_label"></label><br><br><a onclick="operatediv_close('move')" class="operatediv_close"><!--constStr@Close--></a>
2020-01-18 12:12:21 +00:00
<form id="move_form" onsubmit="return submit_operate('move');">
<input id="move_sid" name="move_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="move_fileid" name="move_fileid" type="hidden" value="">
2020-01-18 12:12:21 +00:00
<input id="move_hidden" name="move_name" type="hidden" value="">
<select id="move_input" name="move_folder">
2020-05-03 10:25:39 +00:00
<!--MoveRootStart-->
<option value="/../"><!--constStr@ParentDir--></option>
<!--MoveRootEnd-->
<!--MoveDirsStart-->
<option value="<!--MoveDirsValue-->"><!--MoveDirsValue--></option>
<!--MoveDirsEnd-->
2020-01-18 12:12:21 +00:00
</select>
2020-05-03 10:25:39 +00:00
<input name="operate_action" type="submit" value="<!--constStr@Move-->">
2020-01-18 12:12:21 +00:00
</form>
</div>
</div>
<div id="create_div" class="operatediv" style="display:none">
<div>
2020-05-03 10:25:39 +00:00
<a onclick="operatediv_close('create')" class="operatediv_close"><!--constStr@Close--></a>
2020-01-18 12:12:21 +00:00
<form id="create_form" onsubmit="return submit_operate('create');">
<input id="create_sid" name="create_sid" type="hidden" value="">
2021-01-15 03:10:08 +00:00
<input id="create_fileid" name="create_fileid" type="hidden" value="">
2020-01-18 12:12:21 +00:00
<input id="create_hidden" type="hidden" value="">
<table>
<tr>
<td></td>
<td><label id="create_label"></label></td>
</tr>
<tr>
<td>   </td>
<td>
2020-05-03 10:25:39 +00:00
<label><input id="create_type_folder" name="create_type" type="radio" value="folder" onclick="document.getElementById('create_text_div').style.display='none';"><!--constStr@Folder--></label>
<label><input id="create_type_file" name="create_type" type="radio" value="file" onclick="document.getElementById('create_text_div').style.display='';" checked><!--constStr@File--></label>
2020-01-18 12:12:21 +00:00
<td>
</tr>
<tr>
2020-05-03 10:25:39 +00:00
<td><!--constStr@Name--></td>
2020-01-18 12:12:21 +00:00
<td><input id="create_input" name="create_name" type="text" value=""></td>
</tr>
<tr id="create_text_div">
2020-05-03 10:25:39 +00:00
<td><!--constStr@Content--></td>
2020-01-18 12:12:21 +00:00
<td><textarea id="create_text" name="create_text" rows="6" cols="40"></textarea></td>
</tr>
<tr>
<td>   </td>
2020-05-03 10:25:39 +00:00
<td><input name="operate_action" type="submit" value="<!--constStr@Create-->"></td>
2020-01-18 12:12:21 +00:00
</tr>
</table>
</form>
</div>
</div>
</div>
2020-05-03 10:25:39 +00:00
<!--IsFolderEnd-->
<!--AdminEnd-->
<!--LoginStart-->
2020-01-18 12:12:21 +00:00
<div id="login_div" class="operatediv" style="display:none">
<div style="margin:50px">
2020-05-03 10:25:39 +00:00
<a onclick="operatediv_close('login')" class="operatediv_close"><!--constStr@Close--></a>
2021-03-09 07:51:23 +00:00
<center>
<form action="<!--IsPreview?-->admin" method="post" onsubmit="return sha1loginpass(this);">
<input id="login_input" name="password1" type="password" placeholder="<!--constStr@InputPassword-->">
<input name="timestamp" type="hidden" value="">
<input type="submit" value="<!--constStr@Login-->">
</form>
2020-01-18 12:12:21 +00:00
</center>
</div>
2021-03-09 07:51:23 +00:00
</div>
2020-05-03 10:25:39 +00:00
<!--LoginEnd-->
<div style="color: rgba(247,247,249,0);"><!--FootStr--></div>
2020-01-18 12:12:21 +00:00
</body>
2020-05-03 10:25:39 +00:00
<!--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-12-14 10:58:35 +00:00
<!--AliyundriveUploadJsStart--><script src="https://cdn.jsdelivr.net/npm/js-sha1@0.6.0/src/sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
2020-05-03 10:25:39 +00:00
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
<!--ListEnd-->
2020-01-18 12:12:21 +00:00
<script type="text/javascript">
2020-03-25 02:19:28 +00:00
function changelanguage(str)
{
if (str=='Language') str = '';
2020-06-23 08:06:44 +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-03-25 02:19:28 +00:00
location.href = location.href;
}
2021-03-11 11:59:58 +00:00
<!--LoginStart-->
function login() {
document.getElementById('mask').style.display='';
//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();
}
function sha1loginpass(f) {
if (f.password1.value=="") return false;
try {
timestamp = new Date().getTime() + "";
timestamp = timestamp.substr(0, timestamp.length-3);
f.timestamp.value = timestamp;
f.password1.value = sha1(timestamp + "" + f.password1.value);
return true;
} catch {
alert("sha1.js not loaded.");
return false;
}
}
<!--LoginEnd-->
2020-05-03 10:25:39 +00:00
<!--ListStart-->
2021-01-15 03:10:08 +00:00
2020-05-03 10:25:39 +00:00
<!--IsFileStart-->
2020-01-18 12:12:21 +00:00
var $url = document.getElementById('url');
if ($url) {
2021-10-20 03:34:14 +00:00
//$url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML;
let url = location.href;
url = url.substr(0, url.length-8);
$url.innerHTML = url.replace(/&amp;/g, '&amp;amp;');
2020-01-18 12:12:21 +00:00
$url.style.height = $url.scrollHeight + 'px';
}
2020-05-03 10:25:39 +00:00
<!--IsofficeFileStart-->
2020-01-18 12:12:21 +00:00
var $officearea=document.getElementById('office-a');
if ($officearea) {
$officearea.style.height = window.innerHeight + 'px';
}
2020-05-03 10:25:39 +00:00
<!--IsofficeFileEnd-->
<!--IstxtFileStart-->
2020-01-18 12:12:21 +00:00
var $textarea=document.getElementById('txt-a');
if ($textarea) {
$textarea.style.height = $textarea.scrollHeight + 'px';
}
2020-05-03 10:25:39 +00:00
<!--IstxtFileEnd-->
<!--IsvideoFileStart-->
2022-01-01 12:05:00 +00:00
//document.getElementById('video-a0').style.height = window.innerHeight + 'px';
2021-12-30 14:13:52 +00:00
var fileurl = "<!--FileEncodeUrl-->";
var filename1 = fileurl.substr(0, fileurl.lastIndexOf('.'));
var art = new Artplayer({
//container: '#video-a0',
container: '.artplayerdiv',
url: fileurl,
title: fileurl,
2022-01-01 12:05:00 +00:00
autoHeight: true,
//autoplay: true,
2021-12-30 14:13:52 +00:00
pip: true,
autoSize: true,
autoMini: true,
//loop: true,
fullscreen: true,
fullscreenWeb: true,
subtitleOffset: true,
miniProgressBar: true,
//localVideo: true,
//localSubtitle: true,
mutex: true,
//backdrop: true,
theme: '#23ade5',
lang: navigator.language.toLowerCase(),
/*moreVideoAttr: {
crossOrigin: 'anonymous',
},
settings: [
{
index: 1,
html: 'Custom setting',
click: function (setting) {
console.info('You clicked on the custom setting');
setting.show = false;
},
},
],
contextmenu: [
{
html: 'Custom menu',
click: function (contextmenu) {
console.info('You clicked on the custom menu');
contextmenu.show = false;
},
},
],
layers: [
{
html: '<img style="width: 100px" src="/assets/sample/layer.png">',
click: function () {
console.info('You clicked on the custom layer');
},
style: {
position: 'absolute',
top: '20px',
right: '20px',
opacity: '.9',
},
},
],
quality: [
{
default: true,
html: 'SD 480P',
url: '/assets/sample/video.mp4',
},
{
html: 'HD 720P',
url: '/assets/sample/video.mp4',
},
],
thumbnails: {
url: '/assets/sample/thumbnails.png',
number: 100,
width: 160,
height: 90,
column: 10,
},*/
subtitle: {
url: filename1+'.srt',
type: 'srt',
style: {
color: '#03A9F4',
},
encoding: 'utf-8',
bilingual: true,
},/*
highlight: [
{
time: 60,
text: 'One more chance',
},
{
time: 120,
text: '谁でもいいはずなのに',
},
{
time: 180,
text: '夏の想い出がまわる',
},
{
time: 240,
text: 'こんなとこにあるはずもないのに',
},
{
time: 300,
text: '终わり',
},
],
controls: [
{
position: 'right',
html: 'localsubtitle',
mounted: ($preview) => {
art.plugins.localSubtitle.attach($preview);
},
},
],
icons: {
indicator: '<img width="16" heigth="16" src="/assets/img/indicator.svg">',
loading: '<img src="/assets/img/ploading.gif">',
state: '<img width="150" heigth="150" src="/assets/img/state.svg">',
},*/
});
2022-01-01 12:05:00 +00:00
art.on('ready', (...agrs) => {
console.log(document.getElementById('video-a0').style.height);
//if (document.getElementById('video-a0').style.height == window.innerHeight+'px') document.getElementById('video-a0').style.height = (art.rect.height+3) + 'px';
//console.log(document.getElementById('video-a0').style.height);
//art.play();
})
2020-05-03 10:25:39 +00:00
<!--IsvideoFileEnd-->
<!--IspdfFileStart-->
2020-01-18 19:02:33 +00:00
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
2020-08-03 05:47:27 +00:00
var loadingTask = pdfjsLib.getDocument({
2021-09-06 12:21:18 +00:00
url: "<!--FileDownUrl-->",
2020-08-03 05:47:27 +00:00
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
cMapPacked: true,
rangeChunkSize: 65535
});
2020-01-18 19:02:33 +00:00
loadingTask.promise.then(function(pdf) {
var pagenum = pdf.numPages;
var pdfContainer = document.getElementById('pdf-d');
2020-08-03 05:47:27 +00:00
pdfContainer.innerHTML = '';
2020-01-18 19:02:33 +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);
});
}
2020-05-03 10:25:39 +00:00
<!--IspdfFileEnd-->
<!--IsFileEnd-->
<!--IsFolderStart-->
<!--HeadmdStart-->
2020-03-21 06:24:07 +00:00
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);
}
2020-05-03 10:25:39 +00:00
<!--HeadmdEnd-->
<!--ReadmemdStart-->
2020-03-21 06:24:07 +00:00
var $readme = document.getElementById('readme');
if ($readme) {
$readme.innerHTML = marked(document.getElementById('readme-md').innerText);
}
2020-05-03 10:25:39 +00:00
<!--ReadmemdEnd-->
<!--ShowThumbnailsStart-->
2020-01-18 12:12:21 +00:00
function showthumbnails(obj) {
2020-05-21 03:00:58 +00:00
images = [<!--ImgExts-->];
2020-01-18 12:12:21 +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);
2020-05-21 03:00:58 +00:00
if (!str) continue;
2020-01-18 12:12:21 +00:00
strarry=str.split('.');
ext=strarry[strarry.length-1].toLowerCase();
2020-05-20 09:21:10 +00:00
if (images.indexOf(ext)>-1) {
2020-08-31 05:37:52 +00:00
var url=files[$i].href;
url=url.substr(0,url.length-8);
2020-05-20 09:21:10 +00:00
if (document.getElementById('originalpic').checked==true) {
2020-05-21 03:00:58 +00:00
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--;
2020-05-20 09:21:10 +00:00
} else {
2020-08-31 05:37:52 +00:00
url+='?thumbnails';
2020-05-21 03:00:58 +00:00
get_thumbnails_url(url, str, files[$i]);
2020-05-20 09:21:10 +00:00
}
}
2020-01-18 12:12:21 +00:00
}
obj.disabled='disabled';
}
2020-05-21 03:00:58 +00:00
function get_thumbnails_url(url, name, filea) {
2020-05-20 09:21:10 +00:00
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.send('');
xhr.onload = function(e){
if (xhr.status==200) {
if (xhr.responseText!='') filea.innerHTML='<img src="'+xhr.responseText+'" alt="'+name+'">';
} else console.log(xhr.status+'\n'+xhr.responseText);
}
2020-01-18 12:12:21 +00:00
}
2020-05-03 10:25:39 +00:00
<!--ShowThumbnailsEnd-->
<!--MorePageStart-->
function nextpage(num) {
document.getElementById('pagenum').value=num;
document.getElementById('nextpageform').submit();
}
2020-05-03 10:25:39 +00:00
<!--MorePageEnd-->
<!--IsNotHiddenStart-->
var sort=0;
2020-01-18 12:12:21 +00:00
function sortby(string) {
if (string=='a') if (sort!=0) {
2020-05-03 10:25:39 +00:00
for (i = 1; i <= <!--maxfilenum-->; i++) document.getElementById('tr'+i).parentNode.insertBefore(document.getElementById('tr'+i),document.getElementById('tr'+(i-1)).nextSibling);
2020-01-18 12:12:21 +00:00
sort=0;
return;
} else return;
sort1=sort;
sortby('a');
sort=sort1;
var a=[];
2020-05-03 10:25:39 +00:00
for (i = 1; i <= <!--maxfilenum-->; i++) {
2020-01-18 12:12:21 +00:00
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);
2021-11-23 12:07:55 +00:00
if (str.substr(-2)=='TB') num=str.substr(0,str.length-3)*1024*1024*1024*1024;
2020-01-18 12:12:21 +00:00
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;
}
2020-05-03 10:25:39 +00:00
<!--IsNotHiddenEnd-->
<!--IsFolderEnd-->
<!--WriteTimezoneStart-->
2020-01-18 12:12:21 +00:00
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;
2020-05-03 10:25:39 +00:00
if (timezone!=<!--timezone-->) {
2020-01-18 12:12:21 +00:00
alert('Your timezone is '+timezone+', reload local timezone.');
2020-05-03 10:25:39 +00:00
location.href=location.href;
2020-01-18 12:12:21 +00:00
}
2020-05-03 10:25:39 +00:00
<!--WriteTimezoneEnd-->
2020-05-04 05:32:48 +00:00
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-->");
}
2020-05-03 10:25:39 +00:00
<!--UploadJsStart-->
2021-01-15 03:10:08 +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';
}
2021-03-27 06:34:58 +00:00
function seconds2hour(seconds) {
let h, m, s;
if (parseFloat(seconds)<60) {
return seconds + 's';
} else {
s = (seconds % 60).toFixed(0);
m = parseInt(seconds / 60);
if (parseInt(m)<60) {
return m + 'm' + s + 's';
} else {
h = parseInt(m / 60);
m = m % 60;
return h + 'h' + m + 'm' + s + 's';
}
}
}
2020-01-18 12:12:21 +00:00
function uploadbuttonhide() {
2020-05-03 10:25:39 +00:00
document.getElementById('upload_btns').style.display='none';
/*document.getElementById('upload_submit').disabled='disabled';
2020-01-18 12:12:21 +00:00
document.getElementById('upload_file').disabled='disabled';
document.getElementById('upload_submit').style.display='none';
2020-05-03 10:25:39 +00:00
document.getElementById('upload_file').style.display='none';*/
2020-01-18 12:12:21 +00:00
}
function uploadbuttonshow() {
2020-05-03 10:25:39 +00:00
document.getElementById('upload_btns').style.display='';
/*document.getElementById('upload_file').disabled='';
2020-01-18 12:12:21 +00:00
document.getElementById('upload_submit').disabled='';
document.getElementById('upload_submit').style.display='';
2020-05-03 10:25:39 +00:00
document.getElementById('upload_file').style.display='';*/
2020-01-18 12:12:21 +00:00
}
2021-03-16 06:17:37 +00:00
var uploading = new Object();
2021-01-15 03:10:08 +00:00
<!--UploadJsEnd-->
<!--OnedriveUploadJsStart-->
2020-01-18 12:12:21 +00:00
function preup() {
uploadbuttonhide();
var files=document.getElementById('upload_file').files;
2020-05-03 10:25:39 +00:00
if (files.length<1) {
2020-01-18 12:12:21 +00:00
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;
2021-03-16 06:17:37 +00:00
var uploadList = setInterval(function(){
if (i<files.length) {
if (Object.keys(uploading).length<5) {
getuplink(i);
i++;
2021-03-27 06:34:58 +00:00
}// else console.log(Object.keys(uploading).length);
2021-03-16 06:17:37 +00:00
} else clearInterval(uploadList);
}, 1000);
//getuplink(i);
function getuplink(i, r=0) {
2020-01-18 12:12:21 +00:00
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);
2021-03-27 06:34:58 +00:00
td1.innerHTML=(file.webkitRelativePath||file.name)+'<br>'+size_format(file.size)+' ('+(i+1)+'/'+files.length+')';
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-01-18 12:12:21 +00:00
if (file.size>100*1024*1024*1024) {
2020-05-03 10:25:39 +00:00
td2.innerHTML='<font color="red"><!--constStr@UpFileTooLarge--></font>';
2020-01-18 12:12:21 +00:00
uploadbuttonshow();
return;
}
var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
2021-03-16 06:17:37 +00:00
uploading[upbigfilename] = i;
2021-01-15 03:10:08 +00:00
var filemd5='';
2020-05-30 07:00:13 +00:00
<!--GuestStart-->
function getext(str) {
strarry=str.split('.');
if (strarry.length==1) return '';
2020-05-30 07:00:13 +00:00
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 {
2021-01-15 03:10:08 +00:00
filemd5 = spark.end();
2020-05-30 07:00:13 +00:00
td2.innerHTML='md5: '+filemd5;
delete uploading[upbigfilename];
2020-05-30 07:00:13 +00:00
upbigfilename = filemd5+ext;
uploading[upbigfilename] = i;
2020-05-30 07:00:13 +00:00
<!--GuestEnd-->
td2.innerHTML='<!--constStr@GetUploadLink--> ...';
2020-01-18 12:12:21 +00:00
var xhr1 = new XMLHttpRequest();
2021-01-15 03:10:08 +00:00
xhr1.open("POST", '?action=upbigfile');
2021-03-08 05:14:02 +00:00
//xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
2020-01-18 12:12:21 +00:00
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr1.onprogress = function(e){
td2.innerHTML+='.';
}
2020-01-18 12:12:21 +00:00
xhr1.onload = function(e){
2020-10-01 04:16:47 +00:00
//console.log(xhr1.status+xhr1.responseText);
2020-01-18 12:12:21 +00:00
td2.innerHTML='<font color="red">'+xhr1.responseText+'</font>';
if (xhr1.status==200) {
if (xhr1.responseText=='') {
getuplink(i,1);
return;
}
2020-01-18 12:12:21 +00:00
var html=JSON.parse(xhr1.responseText);
if (!html['uploadUrl']) {
td2.innerHTML='<font color="red">'+xhr1.responseText+'</font><br>';
} else {
2020-05-03 10:25:39 +00:00
td2.innerHTML='<!--constStr@UploadStart--> ...';
2020-05-30 07:00:13 +00:00
binupfile(file,html['uploadUrl'],timea+'_'+i, upbigfilename);
2020-01-18 12:12:21 +00:00
}
2021-03-16 06:17:37 +00:00
} else {
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;
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+'"><!--constStr@CopyUrl--></button></div>';
2021-03-16 06:17:37 +00:00
<!--GuestEnd-->
<!--AdminStart-->
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+'" style="display:none"><!--constStr@CopyUrl--></button></div>';
<!--AdminEnd-->
2021-03-16 06:17:37 +00:00
}
/*if (i<files.length-1) {
2020-01-18 12:12:21 +00:00
i++;
getuplink(i);
2021-03-16 06:17:37 +00:00
}*/
delete uploading[upbigfilename];
2020-01-18 12:12:21 +00:00
}
}
2021-10-06 08:01:31 +00:00
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5 + '&_admin=' + localStorage.getItem("admin"));
2020-05-30 07:00:13 +00:00
<!--GuestStart-->
}
}
<!--GuestEnd-->
2020-01-18 12:12:21 +00:00
}
uploadbuttonshow();
2020-01-18 12:12:21 +00:00
}
2021-01-15 03:10:08 +00:00
2020-05-30 07:00:13 +00:00
function binupfile(file,url,tdnum,filename){
2020-01-18 12:12:21 +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 chunksize=10*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M
2020-01-18 12:12:21 +00:00
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) {
2020-05-03 10:25:39 +00:00
StartStr='<!--constStr@UploadStartAt-->:' +StartTime.toLocaleString()+'<br>' ;
2020-01-18 12:12:21 +00:00
} else {
2020-05-03 10:25:39 +00:00
StartStr='<!--constStr@LastUpload-->'+size_format(newstartsize)+ '<br><!--constStr@ThisTime--><!--constStr@UploadStartAt-->:' +StartTime.toLocaleString()+'<br>' ;
2020-01-18 12:12:21 +00:00
}
function readblob(start) {
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
}
readblob(asize);
2020-05-30 07:00:13 +00:00
2020-01-18 12:12:21 +00:00
reader.onload = function(e){
var binary = this.result;
var lastCurrentSpeed;
2020-01-18 12:12:21 +00:00
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) {
let tmptime = new Date();
let tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
lastCurrentSpeed = tmpspeed;
let remaintime = (totalsize-asize-e.loaded)/tmpspeed;
2021-03-27 06:34:58 +00:00
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--> '+seconds2hour(remaintime.toFixed(1));
2020-01-18 12:12:21 +00:00
}
}
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说明是最终返回上传结束
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-01-18 12:12:21 +00:00
}
EndTime=new Date();
2020-05-03 10:25:39 +00:00
MiddleStr = '<!--constStr@EndAt-->:'+EndTime.toLocaleString()+'<br>';
2020-01-18 12:12:21 +00:00
if (newstartsize==0) {
2020-05-03 10:25:39 +00:00
MiddleStr += '<!--constStr@AverageSpeed-->:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
2020-01-18 12:12:21 +00:00
} else {
2020-05-03 10:25:39 +00:00
MiddleStr += '<!--constStr@ThisTime--><!--constStr@AverageSpeed-->:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
2020-01-18 12:12:21 +00:00
}
2021-03-16 06:17:37 +00:00
delete uploading[filename];
2020-10-01 04:16:47 +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-01-18 12:12:21 +00:00
label.innerHTML=StartStr+MiddleStr;
label.style.color='green';
2021-03-16 06:17:37 +00:00
// uploadbuttonshow();
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
response.name=file.webkitRelativePath||response.name;
2020-01-18 12:12:21 +00:00
addelement(response);
2020-05-03 10:25:39 +00:00
<!--AdminEnd-->
2020-01-18 12:12:21 +00:00
} else {
if (!response['nextExpectedRanges']) {
label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>';
2021-03-16 06:17:37 +00:00
delete uploading[filename];
2020-01-18 12:12:21 +00:00
} else {
var a=response['nextExpectedRanges'][0];
asize=Number( a.slice(0,a.indexOf("-")) );
chunksize = 10*1024*1024;
if (lastCurrentSpeed>5*1024*1024) chunksize = 20*1024*1024;
if (lastCurrentSpeed>10*1024*1024) chunksize = 50*1024*1024;
2020-01-18 12:12:21 +00:00
readblob(asize);
}
} } else readblob(asize);
}
xhr.send(binary);
}
} else {
2020-05-30 07:00:13 +00:00
if (window.location.pathname.indexOf('%23')>0||filename.indexOf('%23')>0) {
2020-05-03 10:25:39 +00:00
label.innerHTML='<font color="red"><!--constStr@UploadFail23--></font>';
2020-01-18 12:12:21 +00:00
} else {
label.innerHTML='<font color="red">'+xhr2.responseText+'</font>';
}
2021-03-16 06:17:37 +00:00
delete uploading[filename];
// uploadbuttonshow();
2020-01-18 12:12:21 +00:00
}
}
}
}
2021-01-15 03:10:08 +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;
2021-03-16 06:17:37 +00:00
var uploadList = setInterval(function(){
if (i<files.length) {
if (Object.keys(uploading).length<5) {
getuplink(i);
i++;
2021-03-27 06:34:58 +00:00
}// else console.log(Object.keys(uploading).length);
2021-03-16 06:17:37 +00:00
} else clearInterval(uploadList);
}, 1000);
//getuplink(i);
2021-01-15 03:10:08 +00:00
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);
2021-03-27 06:34:58 +00:00
td1.innerHTML=(file.webkitRelativePath||file.name)+'<br>'+size_format(file.size)+' ('+(i+1)+'/'+files.length+')';
2021-01-15 03:10:08 +00:00
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);
2021-02-07 03:58:17 +00:00
var chunksize=10*1024*1024; // 分块大小
//var chunksize=100*1024; // 测试小块
/*if (file.size>100*1024*1024*1024) {
2021-01-15 03:10:08 +00:00
td2.innerHTML='<font color="red"><!--constStr@UpFileTooLarge--></font>';
uploadbuttonshow();
return;
2021-02-07 03:58:17 +00:00
}*/
var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
2021-03-16 06:17:37 +00:00
uploading[upbigfilename] = [i];
var spark = sha1.create();
2021-01-15 03:10:08 +00:00
var reader = new FileReader();
var asize = 0;
var filesha1;
function readblob(start) {
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
2021-02-25 10:33:26 +00:00
}
readblob(asize);
reader.onload = function(e){
td2.innerHTML='<!--constStr@Calculate--> SHA1: '+(asize*100/file.size).toFixed(2)+'%';
var binary = this.result;
spark.update(binary);
asize += chunksize;
if (asize < file.size) {
readblob(asize);
} else {
filesha1 = spark.hex();
td2.innerHTML='SHA1: ' + filesha1;
<!--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-->
2021-03-16 06:17:37 +00:00
//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;
2021-02-07 03:58:17 +00:00
}
var html=JSON.parse(xhr1.responseText);
2021-02-07 03:58:17 +00:00
//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>';
}
2021-03-16 06:17:37 +00:00
delete uploading[upbigfilename];
} else {
td2.innerHTML='<!--constStr@UploadStart--> ...';
//console.log(html);
localStorage.setItem(filesha1, JSON.stringify(html));
binupfile(file, html, timea+'_'+i, upbigfilename, filesha1, chunksize);
}
2021-03-16 06:17:37 +00:00
} else {
delete uploading[upbigfilename];
}
2021-03-16 06:17:37 +00:00
/*if (i<files.length-1) {
i++;
getuplink(i);
2021-03-16 06:17:37 +00:00
}*/
2021-02-07 03:58:17 +00:00
}
2021-10-06 08:01:31 +00:00
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1 + '&chunksize=' + chunksize + '&_admin=' + localStorage.getItem("admin"));
2021-01-15 03:10:08 +00:00
}
}
}
}
uploadbuttonshow();
}
2021-02-07 03:58:17 +00:00
function binupfile(file, res, tdnum, filename, filesha1, chunksize) {
2021-01-15 03:10:08 +00:00
// xhr.getResponseHeader
2021-02-07 03:58:17 +00:00
if (!('ETag' in res)) res['ETag'] = new Array();
var fileid = res['file_id'];
var uploadid = res['upload_id'];
2021-01-15 03:10: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){
2021-02-07 03:58:17 +00:00
var chunknum = 0;
var chunknumtotal = res['part_info_list'].length;
2021-01-15 03:10:08 +00:00
var asize=0;
var totalsize=file.size;
var newstartsize=0;
2021-02-07 03:58:17 +00:00
while (res['ETag'][chunknum]!=null) {
chunknum++;
newstartsize += chunksize;
}
2021-01-15 03:10:08 +00:00
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) {
2021-02-07 03:58:17 +00:00
var end=start+chunksize;
var blob = file.slice(start,end);
reader.readAsArrayBuffer(blob);
//reader.readAsArrayBuffer(file);
2021-01-15 03:10:08 +00:00
}
readblob(asize);
reader.onload = function(e){
2021-02-07 03:58:17 +00:00
if (asize>totalsize) {
var xhr1 = new XMLHttpRequest();
xhr1.open("POST", '?action=upbigfile');
2021-03-08 05:14:02 +00:00
//xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
2021-02-07 03:58:17 +00:00
xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr1.onload = function(e){
console.log(xhr1.responseText+','+xhr1.status);
if (xhr1.status==200) {
localStorage.removeItem(filesha1);
2021-01-15 03:10:08 +00:00
<!--AdminStart-->
var html=JSON.parse(xhr1.responseText);
//response.name=file.webkitRelativePath||response.name;
addelement(html);
<!--AdminEnd-->
2021-02-07 03:58:17 +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);
}
}*/
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-01-15 03:10:08 +00:00
}
2021-02-07 03:58:17 +00:00
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';
2021-01-15 03:10:08 +00:00
} else {
2021-02-07 03:58:17 +00:00
label.innerHTML= '<font color="red">' + xhr1.status + ',' + xhr1.responseText + '</font>';
localStorage.removeItem(filesha1);
2021-01-15 03:10:08 +00:00
}
2021-03-16 06:17:37 +00:00
delete uploading[filename];
2021-02-07 03:58:17 +00:00
}
2021-10-06 08:01:31 +00:00
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']) + '&_admin=' + localStorage.getItem("admin"));
2021-02-07 03:58:17 +00:00
} 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;
2021-03-27 06:34:58 +00:00
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--> '+seconds2hour(remaintime.toFixed(1));
2021-01-15 03:10:08 +00:00
}
2021-02-07 03:58:17 +00:00
}
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');
2021-03-08 05:14:02 +00:00
//xhr1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
2021-02-07 03:58:17 +00:00
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);
}
2021-03-16 06:17:37 +00:00
delete uploading[filename];
2021-02-07 03:58:17 +00:00
}
2021-10-06 08:01:31 +00:00
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']) + '&_admin=' + localStorage.getItem("admin"));
2021-02-07 03:58:17 +00:00
// 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);
2021-03-16 06:17:37 +00:00
} else {
delete uploading[filename];
2021-02-07 03:58:17 +00:00
}
//label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>';
} } else readblob(asize);
}
xhr.send(binary);
2021-01-15 03:10:08 +00:00
}
}
}
}
<!--AliyundriveUploadJsEnd-->
<!--GoogledriveUploadJsStart-->
function preup() {
alert("Stop!\nCan not upload form explorer without token.");
}
<!--GoogledriveUploadJsEnd-->
2020-05-03 10:25:39 +00:00
<!--ListEnd-->
2020-02-20 04:05:01 +00:00
function operatediv_close(operate) {
document.getElementById(operate+'_div').style.display='none';
document.getElementById('mask').style.display='none';
}
2020-05-03 10:25:39 +00:00
<!--AdminStart-->
2020-01-18 12:12:21 +00:00
function logout() {
2021-01-15 03:10:08 +00:00
var expd = new Date();
expd.setTime(expd.getTime()+1000);
var expires = "expires="+expd.toGMTString();
2021-10-06 08:01:31 +00:00
document.cookie = "admin=; path=<!--base_path-->; "+expires;
2020-01-18 12:12:21 +00:00
location.href = location.href;
}
2021-04-11 13:33:35 +00:00
/*for some mobile browser*/
function menu_click(e){
var ee=document.getElementsByClassName("active");
for(var i=0;i<ee.length;i++){
ee[i].classList.remove("active");
}
if(e.type!="mouseout")this.classList.add("active");
}
(function(){
var e=document.getElementsByClassName("operate");
document.body.addEventListener("touchstart", menu_click);
for(var i=0;i<e.length;i++){
e[i].addEventListener("touchstart", menu_click);
e[i].addEventListener("mouseout", menu_click);
}
})();
2020-05-03 10:25:39 +00:00
<!--IsFolderStart-->
2020-01-18 12:12:21 +00:00
function showdiv(event,action,num) {
var $operatediv=document.getElementsByName('operatediv');
for ($i=0;$i<$operatediv.length;$i++) {
$operatediv[$i].style.display='none';
}
document.getElementById('mask').style.display='';
//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';
var str;
2020-01-18 12:12:21 +00:00
if (num=='') {
str = '';
num = 0;
2020-01-18 12:12:21 +00:00
} else {
str = decodeURIComponent(document.getElementById('file_a'+num).href);
2020-11-27 05:37:58 +00:00
if (str.substr(-1)==' ') str=str.substr(0, str.length-1);
2020-11-28 13:23:15 +00:00
if (str.substr(-1)=='/') str=str.substr(0, str.length-1);
2020-11-27 05:37:58 +00:00
if (str.substr(-8)=='?preview') str=str.substr(0, str.length-8);
if (str.lastIndexOf('/')>-1) str=str.substr(str.lastIndexOf('/')+1);
2020-01-18 12:12:21 +00:00
}
var fileid = document.getElementById('file_a'+num).attributes['fileid'].nodeValue;
2020-01-18 12:12:21 +00:00
document.getElementById(action + '_div').style.display='';
document.getElementById(action + '_label').innerText=str;//.replace(/&/,'&amp;');
document.getElementById(action + '_sid').value=num;
2021-01-15 03:10:08 +00:00
document.getElementById(action + '_fileid').value=fileid;
2020-01-18 12:12:21 +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;*/
2020-01-18 12:12:21 +00:00
var $scrollY = document.documentElement.scrollTop || document.body.scrollTop;
/*var $x = $e.pageX || $e.clientX + $scrollX;
2020-01-18 12:12:21 +00:00
var $y = $e.pageY || $e.clientY + $scrollY;
if (action=='create') {*/
2020-01-18 12:12:21 +00:00
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 {
2020-01-18 12:12:21 +00:00
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';
}
2020-01-18 12:12:21 +00:00
} else {
document.getElementById(action + '_div').style.left=$x+'px';
}
document.getElementById(action + '_div').style.top=$y+'px';
}*/
2020-01-18 12:12:21 +00:00
document.getElementById(action + '_input').focus();
}
function submit_operate(str) {
var num=document.getElementById(str+'_sid').value;
var xhr = new XMLHttpRequest();
2020-12-15 04:52:03 +00:00
xhr.open("POST", '');
2021-03-06 08:05:17 +00:00
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
2020-12-15 04:52:03 +00:00
xhr.setRequestHeader('x-requested-with', 'XMLHttpRequest');
2020-01-18 12:12:21 +00:00
xhr.onload = function(e){
var html;
if (xhr.status<300) {
2020-02-22 08:48:10 +00:00
console.log(xhr.status+','+xhr.responseText);
2020-01-18 12:12:21 +00:00
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-01-15 03:10:08 +00:00
//alert('success');
2020-01-18 12:12:21 +00:00
} else alert(xhr.status+'\n'+xhr.responseText);
document.getElementById(str+'_div').style.display='none';
document.getElementById('mask').style.display='none';
}
2021-10-06 08:01:31 +00:00
xhr.send(serializeForm(str+'_form') + '&_admin=' + localStorage.getItem("admin"));
2020-01-18 12:12:21 +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');
2020-01-18 12:12:21 +00:00
a1.innerText=html.name;
a1.target='_blank';
var td2=document.createElement('td');
td2.setAttribute('class','updated_at');
2021-01-15 03:10:08 +00:00
if (!!html.time) td2.innerText=html.time.replace(/T/,' ').replace(/Z/,'');
2020-01-18 12:12:21 +00:00
var td3=document.createElement('td');
td3.setAttribute('class','size');
2021-01-15 03:10:08 +00:00
if (!!html.size) td3.innerText=size_format(html.size);
else td3.innerText='0 B';
if (html.type=='folder') {
2020-01-18 12:12:21 +00:00
a1.href+='/';
document.getElementById('tr0').parentNode.insertBefore(tr1,document.getElementById('tr0').nextSibling);
}
2021-01-15 03:10:08 +00:00
if (html.type=='file') {
2020-01-18 12:12:21 +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('&');
}
2020-05-03 10:25:39 +00:00
<!--IsFolderEnd-->
<!--AdminEnd-->
2020-09-18 05:44:59 +00:00
<!--EncryptedStart-->
document.getElementById('password1').focus();
<!--EncryptedEnd-->
2020-01-18 12:12:21 +00:00
</script>
2021-07-26 02:23:03 +00:00
<script src="https://cdn.jsdelivr.net/npm/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
2021-12-14 10:58:35 +00:00
<!--LoginStart--><script src="https://cdn.jsdelivr.net/npm/js-sha1@0.6.0/src/sha1.min.js"></script><!--LoginEnd-->
2020-05-03 10:25:39 +00:00
<!--customScript-->
2020-01-18 12:12:21 +00:00
</html>