pull/216/head
BingoKingo 2020-05-02 16:07:17 +08:00
parent f208faebb4
commit 1f7970a02d
4 changed files with 248 additions and 248 deletions

View File

@ -7,7 +7,7 @@ UpdateAddress [heroku.php](/platform/heroku.php "heroku.php"),[scf.php](/platfor
Theme Theme
Material Design for Classic Series(对默认主题的MD风格小优化有对响应式、按钮外观等的适配调整): [tfo_mdtr.php](/theme/tfo_mdtr.php "tfo_mdtr.php")(Transparent Material Design), [tfo_md.php](/theme/tfo_md.php "tfo_md.php")(Material Design), [tfo_mdtr_baw.php](/theme/tfo_mdtr_baw.php "tfo_mdtr_baw.php")(Black & White Material Design for Tomb-Sweeping Day) (All based on classic.php,latest at 2020.5.1) Material Design for Classic Series(对默认主题的MD风格小优化有对响应式、按钮外观、上传界面等的适配调整): [tfo_mdtr.php](/theme/tfo_mdtr.php "tfo_mdtr.php")(Transparent Material Design), [tfo_md.php](/theme/tfo_md.php "tfo_md.php")(Material Design), [tfo_mdtr_baw.php](/theme/tfo_mdtr_baw.php "tfo_mdtr_baw.php")(Black & White Material Design for Tomb-Sweeping Day) (All based on classic.php,latest at 2020.5.1)
具体地,您可以下载/复制体验一下或参考示例中运用tfo_mdtr.php的[Li Share Storage Mini](https://tfo.herokuapp.com/ "Li Share Storage Mini")。需要注意:以上系列主题**默认隐藏多盘和右上角语言框**,请谨慎使用!若强迫开启多盘,可以自行定位修改#L107左右more-disk前几行位置去掉display:none !important字符。目前主题仍存在诸多问题请谅解。PS:主题**将要实现**的功能有背景模糊等,敬请期待... 具体地,您可以下载/复制体验一下或参考示例中运用tfo_mdtr.php的[Li Share Storage Mini](https://tfo.herokuapp.com/ "Li Share Storage Mini")。需要注意:以上系列主题**默认隐藏多盘和右上角语言框**,请谨慎使用!若强迫开启多盘,可以自行定位修改#L107左右more-disk前几行位置去掉display:none !important字符。目前主题仍存在诸多问题请谅解。PS:主题**将要实现**的功能有背景模糊等,敬请期待...

View File

@ -54,14 +54,6 @@
.operatediv div{margin:16px} .operatediv div{margin:16px}
.operatediv_close{position:absolute;right:3px;top:3px;} .operatediv_close{position:absolute;right:3px;top:3px;}
.readme{padding:8px;background-color:rgb(245,245,245);} .readme{padding:8px;background-color:rgb(245,245,245);}
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
@media only screen and (max-width:1152px){ @media only screen and (max-width:1152px){
.list-table td.file,.list-table th.file{width:calc(95% - 220px)} .list-table td.file,.list-table th.file{width:calc(95% - 220px)}
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
@ -92,6 +84,14 @@
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
.list-table td.updated_at,.list-table th.updated_at{width:140px !important} .list-table td.updated_at,.list-table th.updated_at{width:140px !important}
} }
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
</style> </style>
</head> </head>
<body> <body>
@ -894,7 +894,7 @@ echo '</script>';
tr1.appendChild(td1); tr1.appendChild(td1);
td1.setAttribute('style','width:30%'); td1.setAttribute('style','width:30%');
td1.setAttribute('id','upfile_td1_'+timea+'_'+i); td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
td1.innerHTML=file.name+'<br>'+size_format(file.size); td1.innerHTML=file.name+'&nbsp;'+size_format(file.size);
var td2=document.createElement('td'); var td2=document.createElement('td');
tr1.appendChild(td2); tr1.appendChild(td2);
td2.setAttribute('id','upfile_td2_'+timea+'_'+i); td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
@ -967,13 +967,13 @@ echo '</script>';
var a = html['nextExpectedRanges'][0]; var a = html['nextExpectedRanges'][0];
newstartsize = Number( a.slice(0,a.indexOf("-")) ); newstartsize = Number( a.slice(0,a.indexOf("-")) );
StartTime = new Date(); StartTime = new Date();
<?php if ($_SERVER['admin']) { ?> <?php if ($_SERVER['admin']) { ?>
asize = newstartsize; asize = newstartsize;
<?php } ?> <?php } ?>
if (newstartsize==0) { if (newstartsize==0) {
StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} else { } else {
StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '<br><?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '&nbsp;<?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} }
var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M
if (totalsize>200*1024*1024) chunksize=10*1024*1024; if (totalsize>200*1024*1024) chunksize=10*1024*1024;
@ -983,19 +983,19 @@ echo '</script>';
reader.readAsArrayBuffer(blob); reader.readAsArrayBuffer(blob);
} }
readblob(asize); readblob(asize);
<?php if (!$_SERVER['admin']) { ?> <?php if (!$_SERVER['admin']) { ?>
var spark = new SparkMD5.ArrayBuffer(); var spark = new SparkMD5.ArrayBuffer();
<?php } ?> <?php } ?>
reader.onload = function(e){ reader.onload = function(e){
var binary = this.result; var binary = this.result;
<?php if (!$_SERVER['admin']) { ?> <?php if (!$_SERVER['admin']) { ?>
spark.append(binary); spark.append(binary);
if (asize < newstartsize) { if (asize < newstartsize) {
asize += chunksize; asize += chunksize;
readblob(asize); readblob(asize);
return; return;
} }
<?php } ?> <?php } ?>
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("PUT", url, true); xhr.open("PUT", url, true);
//xhr.setRequestHeader('x-requested-with','XMLHttpRequest'); //xhr.setRequestHeader('x-requested-with','XMLHttpRequest');
@ -1006,7 +1006,7 @@ echo '</script>';
var tmptime = new Date(); var tmptime = new Date();
var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime()); var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
var remaintime = (totalsize-asize-e.loaded)/tmpspeed; var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s<br><?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s'; label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s&nbsp;<?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s';
} }
} }
var C_starttime = new Date(); var C_starttime = new Date();
@ -1022,7 +1022,7 @@ echo '</script>';
xhr3.onload = function(e){ xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status); console.log(xhr3.responseText+','+xhr3.status);
} }
<?php if (!$_SERVER['admin']) { ?> <?php if (!$_SERVER['admin']) { ?>
var filemd5 = spark.end(); var filemd5 = spark.end();
var xhr4 = new XMLHttpRequest(); var xhr4 = new XMLHttpRequest();
xhr4.open("GET", '?action=uploaded_rename&filename='+encodeURIComponent(file.name)+'&filemd5='+filemd5); xhr4.open("GET", '?action=uploaded_rename&filename='+encodeURIComponent(file.name)+'&filemd5='+filemd5);
@ -1047,23 +1047,23 @@ echo '</script>';
document.getElementById('upfile_a1_'+tdnum).href = filename; document.getElementById('upfile_a1_'+tdnum).href = filename;
document.getElementById('upfile_cpbt_'+tdnum).style.display = ""; document.getElementById('upfile_cpbt_'+tdnum).style.display = "";
} }
<?php } ?> <?php } ?>
EndTime=new Date(); EndTime=new Date();
MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'<br>'; MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'&nbsp;';
if (newstartsize==0) { if (newstartsize==0) {
MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} else { } else {
MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} }
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>'; document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a>&nbsp;<a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>';
label.innerHTML=StartStr+MiddleStr; label.innerHTML=StartStr+MiddleStr;
uploadbuttonshow(); uploadbuttonshow();
<?php if ($_SERVER['admin']) { ?> <?php if ($_SERVER['admin']) { ?>
addelement(response); addelement(response);
<?php } ?> <?php } ?>
} else { } else {
if (!response['nextExpectedRanges']) { if (!response['nextExpectedRanges']) {
label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>'; label.innerHTML='<font color="red">'+xhr.responseText+'</font>&nbsp;';
} else { } else {
var a=response['nextExpectedRanges'][0]; var a=response['nextExpectedRanges'][0];
asize=Number( a.slice(0,a.indexOf("-")) ); asize=Number( a.slice(0,a.indexOf("-")) );

View File

@ -54,14 +54,6 @@
.operatediv_close{position:absolute;right:3px;top:3px;} .operatediv_close{position:absolute;right:3px;top:3px;}
.readme{padding:8px;background-color:rgba(245,245,245,0.3);} .readme{padding:8px;background-color:rgba(245,245,245,0.3);}
.markdown-body{padding:20px;text-align:left;font-size:14px !important} .markdown-body{padding:20px;text-align:left;font-size:14px !important}
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
@media only screen and (max-width:1152px){ @media only screen and (max-width:1152px){
.list-table td.file,.list-table th.file{width:calc(95% - 220px)} .list-table td.file,.list-table th.file{width:calc(95% - 220px)}
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
@ -92,6 +84,14 @@
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
.list-table td.updated_at,.list-table th.updated_at{width:140px !important} .list-table td.updated_at,.list-table th.updated_at{width:140px !important}
} }
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
</style> </style>
</head> </head>
<body> <body>
@ -894,7 +894,7 @@ echo '</script>';
tr1.appendChild(td1); tr1.appendChild(td1);
td1.setAttribute('style','width:30%'); td1.setAttribute('style','width:30%');
td1.setAttribute('id','upfile_td1_'+timea+'_'+i); td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
td1.innerHTML=file.name+'<br>'+size_format(file.size); td1.innerHTML=file.name+'&nbsp;'+size_format(file.size);
var td2=document.createElement('td'); var td2=document.createElement('td');
tr1.appendChild(td2); tr1.appendChild(td2);
td2.setAttribute('id','upfile_td2_'+timea+'_'+i); td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
@ -971,9 +971,9 @@ echo '</script>';
asize = newstartsize; asize = newstartsize;
<?php } ?> <?php } ?>
if (newstartsize==0) { if (newstartsize==0) {
StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} else { } else {
StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '<br><?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '&nbsp;<?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} }
var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M
if (totalsize>200*1024*1024) chunksize=10*1024*1024; if (totalsize>200*1024*1024) chunksize=10*1024*1024;
@ -1006,7 +1006,7 @@ echo '</script>';
var tmptime = new Date(); var tmptime = new Date();
var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime()); var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
var remaintime = (totalsize-asize-e.loaded)/tmpspeed; var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s<br><?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s'; label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s&nbsp;<?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s';
} }
} }
var C_starttime = new Date(); var C_starttime = new Date();
@ -1049,13 +1049,13 @@ echo '</script>';
} }
<?php } ?> <?php } ?>
EndTime=new Date(); EndTime=new Date();
MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'<br>'; MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'&nbsp;';
if (newstartsize==0) { if (newstartsize==0) {
MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} else { } else {
MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} }
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>'; document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a>&nbsp;<a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>';
label.innerHTML=StartStr+MiddleStr; label.innerHTML=StartStr+MiddleStr;
uploadbuttonshow(); uploadbuttonshow();
<?php if ($_SERVER['admin']) { ?> <?php if ($_SERVER['admin']) { ?>
@ -1063,7 +1063,7 @@ echo '</script>';
<?php } ?> <?php } ?>
} else { } else {
if (!response['nextExpectedRanges']) { if (!response['nextExpectedRanges']) {
label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>'; label.innerHTML='<font color="red">'+xhr.responseText+'</font>&nbsp;';
} else { } else {
var a=response['nextExpectedRanges'][0]; var a=response['nextExpectedRanges'][0];
asize=Number( a.slice(0,a.indexOf("-")) ); asize=Number( a.slice(0,a.indexOf("-")) );

View File

@ -54,14 +54,6 @@
.operatediv_close{position:absolute;right:3px;top:3px;} .operatediv_close{position:absolute;right:3px;top:3px;}
.readme{padding:8px;background-color:rgba(245,245,245,0.3);} .readme{padding:8px;background-color:rgba(245,245,245,0.3);}
.markdown-body{padding:20px;text-align:left;font-size:14px !important} .markdown-body{padding:20px;text-align:left;font-size:14px !important}
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
@media only screen and (max-width:1152px){ @media only screen and (max-width:1152px){
.list-table td.file,.list-table th.file{width:calc(95% - 220px)} .list-table td.file,.list-table th.file{width:calc(95% - 220px)}
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
@ -92,6 +84,14 @@
.list-table td.size,.list-table th.size{width:70px !important} .list-table td.size,.list-table th.size{width:70px !important}
.list-table td.updated_at,.list-table th.updated_at{width:140px !important} .list-table td.updated_at,.list-table th.updated_at{width:140px !important}
} }
@media only screen and (max-width:495px){
.title{margin-bottom:24px}
.list-wrapper{width:96%; margin:0 auto 10px;}
.list-table {padding:8px}
.list-table td.file,.list-table th.file{width:95%;}
.size, .updated_at{display:none}
.list-table td,.list-table th{overflow:auto;text-overflow:unset}
}
</style> </style>
</head> </head>
<body> <body>
@ -894,7 +894,7 @@ echo '</script>';
tr1.appendChild(td1); tr1.appendChild(td1);
td1.setAttribute('style','width:30%'); td1.setAttribute('style','width:30%');
td1.setAttribute('id','upfile_td1_'+timea+'_'+i); td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
td1.innerHTML=file.name+'<br>'+size_format(file.size); td1.innerHTML=file.name+'&nbsp;'+size_format(file.size);
var td2=document.createElement('td'); var td2=document.createElement('td');
tr1.appendChild(td2); tr1.appendChild(td2);
td2.setAttribute('id','upfile_td2_'+timea+'_'+i); td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
@ -971,9 +971,9 @@ echo '</script>';
asize = newstartsize; asize = newstartsize;
<?php } ?> <?php } ?>
if (newstartsize==0) { if (newstartsize==0) {
StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} else { } else {
StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '<br><?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'<br>' ; StartStr='<?php echo getconstStr('LastUpload'); ?>'+size_format(newstartsize)+ '&nbsp;<?php echo getconstStr('ThisTime').getconstStr('UploadStartAt'); ?>:' +StartTime.toLocaleString()+'&nbsp;' ;
} }
var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小最大60M微软建议10M
if (totalsize>200*1024*1024) chunksize=10*1024*1024; if (totalsize>200*1024*1024) chunksize=10*1024*1024;
@ -1006,7 +1006,7 @@ echo '</script>';
var tmptime = new Date(); var tmptime = new Date();
var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime()); var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
var remaintime = (totalsize-asize-e.loaded)/tmpspeed; var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s<br><?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s'; label.innerHTML=StartStr+'<?php echo getconstStr('Upload'); ?> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <?php echo getconstStr('AverageSpeed'); ?>:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s&nbsp;<?php echo getconstStr('CurrentSpeed'); ?> '+size_format(tmpspeed)+'/s <?php echo getconstStr('Expect'); ?> '+remaintime.toFixed(1)+'s';
} }
} }
var C_starttime = new Date(); var C_starttime = new Date();
@ -1049,13 +1049,13 @@ echo '</script>';
} }
<?php } ?> <?php } ?>
EndTime=new Date(); EndTime=new Date();
MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'<br>'; MiddleStr = '<?php echo getconstStr('EndAt'); ?>:'+EndTime.toLocaleString()+'&nbsp;';
if (newstartsize==0) { if (newstartsize==0) {
MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('AverageSpeed'); ?>:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} else { } else {
MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>'; MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s&nbsp;';
} }
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>'; document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a>&nbsp;<a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>';
label.innerHTML=StartStr+MiddleStr; label.innerHTML=StartStr+MiddleStr;
uploadbuttonshow(); uploadbuttonshow();
<?php if ($_SERVER['admin']) { ?> <?php if ($_SERVER['admin']) { ?>
@ -1063,7 +1063,7 @@ echo '</script>';
<?php } ?> <?php } ?>
} else { } else {
if (!response['nextExpectedRanges']) { if (!response['nextExpectedRanges']) {
label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>'; label.innerHTML='<font color="red">'+xhr.responseText+'</font>&nbsp;';
} else { } else {
var a=response['nextExpectedRanges'][0]; var a=response['nextExpectedRanges'][0];
asize=Number( a.slice(0,a.indexOf("-")) ); asize=Number( a.slice(0,a.indexOf("-")) );