-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOnedrive-dev.html
572 lines (565 loc) · 20.9 KB
/
Onedrive-dev.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
<!DOCTYPE html>
<html lang="<!--constStr@language-->">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><!--Title--></title>
<link rel="shortcut icon" href="<!--base_path-->favicon.ico" type="image/x-icon">
<!--https://p.sfx.ms/images/favicon.ico-->
<style>
/* 通用样式 */
/* 用于消除默认自带样式 */
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
color: #333;
font-family: "Segoe UI", Tahoma, Arial, sans-serif;
overflow: hidden;
}
a {
text-decoration: none;
}
ul {
list-style: none;
}
input[type="radio"] {
margin: 0;
outline: none;
}
/* 兼容样式 */
body {
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
/* 自定义样式 */
.container {
margin-left: auto;
margin-right: auto;
max-width: 1100px;
}
.pull-left {
float: left;
}
.pull-right {
float: right;
}
/* 字体外部引用 */
@font-face {
font-family: 'iconfont'; /* project id 1634400 */
src: url('//at.alicdn.com/t/font_1634400_9yg8f5s278.eot');
src: url('//at.alicdn.com/t/font_1634400_9yg8f5s278.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_1634400_9yg8f5s278.woff2') format('woff2'),
url('//at.alicdn.com/t/font_1634400_9yg8f5s278.woff') format('woff'),
url('//at.alicdn.com/t/font_1634400_9yg8f5s278.ttf') format('truetype'),
url('//at.alicdn.com/t/font_1634400_9yg8f5s278.svg#iconfont') format('svg');
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
/* header */
header {
width: 100%;
/*height: 88px;*/
line-height: 48px;
font-size: 16px;
background-color: #0078D4;
}
header nav {
margin: 0 auto;
padding: 0 10px;
height: 48px;
color: #FFF;
box-sizing: border-box;
}
header nav a {
color: #FFF;
font-weight: 600;
}
header nav .lang .language { outline: none; }
header .control {
height: 40px;
line-height: 40px;
background-color: #f4f4f4;
}
header .control .control-item {
padding-left: 10px;
padding-right: 10px;
}
/* main */
main {
position: relative;
height: 100%;
}
main .scroll {
overflow-y: scroll;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
main .main-item-list {
padding-left: 32px;
padding-right: 32px;
height: 32px;
line-height: 32px;
font-size: 12px;
box-sizing: border-box;
}
main .main-title h1 {
margin: 0;
padding: 32px;
font-size: 20px;
font-weight: 100;
}
main .main-items:hover {
background-color: #F4F4F4;
}
main .main-items:hover .main-items-radio {
display: inline-block!important;
}
main .main-item-list .inner-container {
display: flex;
justify-content: flex-start;
width: 100%;
height: 32px;
border-bottom: 1px solid #FFF;
box-sizing: border-box;
}
main .main-item-list .inner-container > div {
padding-left: 12px;
padding-right: 8px;
box-sizing: border-box;
}
main .main-item-list .main-item-title {
border-bottom: 1px solid #EAEAEA;
}
main .main-item-list .main-items-radio-box {
width: 48px;
height: 32px;
line-height: 40px;
text-align: center;
}
main .main-item-list .main-items-radio-box .main-items-radio {
display: none;
width: 18px;
height: 18px;
}
main .main-item-list .main-items-radio-box .main-items-radio[currstatus=true] {
display: block;
}
main .main-item-list .main-items-icon {
min-width: 38px;
height: 32px;
line-height: 32px;
text-align: center;
}
main .main-item-title .main-items-icon {
height: 32px!important;
line-height: 9px!important;
}
main .main-item-title .main-items-icon:hover,
main .main-item-list .main-items-displayName:hover,
main .main-item-list .main-items-dateModified:hover,
main .main-item-list .main-items-size:hover {
background-color: #EAEAEA;
}
main .main-item-list .main-items-icon .iconfont {
font-size: 20px;
}
main .main-item-list .main-items-icon img {
display: inline-block;
width: 20px;
height: 20px;
}
main .main-items {
display: flex;
justify-content: flex-start;
border-bottom: 1px solid #F4F4F4;
box-sizing: border-box;
}
main .main-item-list .main-items-displayName,
main .main-item-list .main-items-fileName {
width: 520px;
}
main .main-item-list .main-items-dateModified,
main .main-item-list .main-items-dateTime {
width: 250px;
}
main .main-item-list .main-items-size,
main .main-item-list .main-items-fileSize {
width: 180px;
}
main .main-item-list .main-items-radio-box,
main .main-item-list .main-items-icon,
main .main-item-list .main-items-fileName,
main .main-item-list .main-items-dateTime,
main .main-item-list .main-items-fileSize {
padding: 11px 8px 11px 12px;
height: 42px;
line-height: 22px;
font-family: "Microsoft Yahei UI", Verdana, Simsun, "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
white-space: nowrap;
text-overflow: ellipsis;
box-sizing: border-box;
/*overflow: hidden;*/
}
main .main-item-list .main-items-fileName a {
color: inherit;
}
main .main-item-list .main-items-fileName a:hover {
text-decoration: underline;
}
.more-disk{
vertical-align: middle;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
display: inline-block;
max-width: 100px;
}
.more-disk div{
list-style:none;
position:absolute;
display:none;background:#ffffff;border-radius:5px;margin:0 0 0 -10px;/*padding:0 7px;*/color:#205D67;z-index:1;
box-shadow: 0 0.5em 3em rgba(161,177,204,.4);
}
.more-disk:hover div{display:block}
.more-disk div li{line-height:normal;padding: 3px 10px;}
.more-disk div li a{text-decoration: none; color:rgba(0,0,0,.3);}
.more-disk div li a:hover{color:rgba(0,0,0,.87);}
.more-disk div li a[now]{color:rgba(0,0,0,1);}
</style>
</head>
<body>
<header>
<nav class="container">
<div class="title pull-left">
<a href="<!--base_path-->"><!--Sitename--></a>
</div>
<div class="pull-right">
<!--LoginStart-->
<a class="pull-left" onclick="/*login();*/"><!--constStr@Login--></a>
<!--LoginEnd-->
<!--AdminStart-->
<a class="pull-left" onclick="logout();"><!--constStr@Logout--></a>
<!--AdminEnd-->
|
<div class="pull-right lang">
<select name="language" id="language" class="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
<option value="">Language</option>
<!--SelectLanguageStart-->
<option value="<!--SelectLanguageKey-->" <!--SelectLanguageSelected-->><!--SelectLanguageValue--></option>
<!--SelectLanguageEnd-->
</select>
</div>
</div>
</nav>
<!--AdminStart-->
<div class="control">
<div class="container">
<div class="control-item">
<button class="control-items">
<i class="iconfont control-items-icon"></i>
<span class="control-items-content"><!--constStr@Create--></span>
</button>
</div>
</div>
</div>
<!--AdminEnd-->
</header>
<main>
<!--ListStart-->
<div class="scroll">
<div class="container">
<div class="main-title">
<h1 class="main-title-path">
<a href="<!--base_path-->"><!--constStr@Home--></a>
<!--DiskPathArrayStart-->
>
<a href="<!--PathArrayLink-->"><!--PathArrayName--></a>
<!--DiskPathArrayEnd-->
</h1>
</div>
<!--IsFileStart-->
<div class="main-item-list">
<div class="main-items main-item-title">
<div class="inner-container">
<div>
<div style="margin: 24px">
<textarea id="url" title="url" rows="1" style="width: 100%; margin-top: 2px;" readonly><!--FileEncodeUrl--></textarea>
<a href="<!--FileUrl-->"><ion-icon name="download" style="line-height: 16px;vertical-align: middle;"></ion-icon> <!--constStr@Download--></a>
</div>
</div>
<div>
<!--IsimgFileStart-->
<img src="<!--FileDownUrl-->" alt="<!--FileName-->" onload="if (this.offsetWidth>document.getElementById('url').offsetWidth) this.style.width='100%';" />
<!--IsimgFileEnd-->
<!--IsvideoFileStart-->
<div id="video-a0"></div>
<!--IsvideoFileEnd-->
</div>
</div>
</div>
</div>
<!--IsFileEnd-->
<!--IsFolderStart-->
<div class="main-item-list">
<div class="main-items main-item-title">
<div class="inner-container">
<!--AdminStart-->
<div class="main-items-radio-box">
<!-- <input class="main-items-radio main-items-check-all" type="radio" name="" id=""> -->
</div>
<!--AdminEnd-->
<div class="main-items-icon">
<i class="iconfont"></i>
</div>
<div class="main-items-displayName"><!--constStr@File--></div>
<div class="main-items-dateModified"><!--constStr@EditTime--></div>
<div class="main-items-size"><!--constStr@Size--></div>
</div>
</div>
<!--FolderListStart-->
<div class="main-items">
<!--AdminStart-->
<div class="main-items-radio-box">
<input class="main-items-radio" type="radio" checked name="file" id="">
</div>
<!--AdminEnd-->
<div class="main-items-icon">
<img src="https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/folder.svg" alt="folder icon">
</div>
<div class="main-items-fileName">
<a href="<!--FileEncodeReplaceUrl-->/"><!--FileEncodeReplaceName--></a>
</div>
<div class="main-items-dateTime" ><!--lastModifiedDateTime--></div>
<div class="main-items-fileSize" ><!--size--></div>
</div>
<!--FolderListEnd-->
<!--FileListStart-->
<div class="main-items">
<!--AdminStart-->
<div class="main-items-radio-box">
<input class="main-items-radio" type="radio" checked name="file" id="">
</div>
<!--AdminEnd-->
<div class="main-items-icon">
<i class="iconfont"></i>
</div>
<div class="main-items-fileName">
<a href="<!--FileEncodeReplaceUrl-->?preview" target="_blank"><!--FileEncodeReplaceName--></a>
</div>
<div class="main-items-dateTime" ><!--lastModifiedDateTime--></div>
<div class="main-items-fileSize" ><!--size--></div>
</div>
<!--FileListEnd-->
</div>
<!--IsFolderEnd-->
</div>
</div>
<!--ListEnd-->
</main>
<footer>
<!-- OneDrive程序 -->
</footer>
<div id="mask" class="mask" style="display:none;"></div>
<!--LoginStart-->
<div id="login_div" class="operatediv" style="display:none">
<div style="margin:50px">
<a onclick="operatediv_close('login')" class="operatediv_close"><!--constStr@Close--></a>
<center>
<form action="<!--IsPreview?-->admin" method="post">
<input id="login_input" name="password1" type="password" placeholder="<!--constStr@InputPassword-->">
<input type="submit" value="<!--constStr@Login-->">
</form>
</center>
</div>
</div>
<!--LoginEnd-->
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script>
window.onload = function ()
{
// 获取所有radios元素
var allRadios = document.getElementsByClassName("main-items-radio");
RegisterRadioClick(allRadios);
}
// 为所有radio注册点击事件
function RegisterRadioClick(radios)
{
if (radios != null)
{
var radio;
for (var i = 0; i < radios.length ; i++)
{
// 获取单个radio元素
radio = radios[i];
// 为每个radio元素设置当前状态为:False
//radio.setAttribute("currStatus", "false");
// 页面刚加载后,取消因缓存的checked属性
radio.checked = false;
// 为页面中每个radio元素注册点击事件
radio.onclick = function()
{
// 获取当前点击对象的自定义属性
var currStatus = this.getAttribute("currStatus");
AllRadioCurrentStatus2False(radios);
if (currStatus === "true")
{
AllRadioCurrentStatus2False(radios);
this.setAttribute("currStatus", false);
this.checked = false;
}
else
{
this.setAttribute("currStatus", true);
this.checked = true;
}
}
}
}
}
// 把页面里所有radio元素自定义属性变成为false
// 不然会出现需要点击两次才会被选中
function AllRadioCurrentStatus2False(radios)
{
for (var i = 0; i < radios.length; i++)
{
radios[i].setAttribute("currStatus", false);
}
}
function changelanguage(str)
{
if (str=='Language') str = '';
document.cookie='language='+str+'; path=/';
location.href = location.href;
}
<!--ListStart-->
/*var root = '<!--base_disk_path-->';
function path_format(path) {
path = '/' + path + '/';
while (path.indexOf('//') !== -1) {
path = path.replace('//', '/')
}
return path
}
document.querySelectorAll('.main-title-path').forEach(function (e) {
var path = e.innerText;
if (path.substr(path.length-1)=='/') path = path.substr(0, path.length-1);
var paths = path.split('/');
e.innerHTML = '<a href="' + root + '"><!--constStr@Home--></a> > ';
if (paths <= 2) return;
for (var i = 1; i < paths.length - 1; i++) {
var to = path_format(root + paths.slice(0, i + 1).join('/'));
e.innerHTML += '<a href="' + to + '">' + paths[i] + '</a> > '
}
e.innerHTML += paths[paths.length - 1];
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
});*/
<!--IsFileStart-->
var $url = document.getElementById('url');
if ($url) {
$url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML;
$url.style.height = $url.scrollHeight + 'px';
}
<!--IsvideoFileStart-->
function loadResources(type, src, callback) {
let script = document.createElement(type);
let loaded = false;
if (typeof callback === 'function') {
script.onload = script.onreadystatechange = () => {
if (!loaded && (!script.readyState || /loaded|complete/.test(script.readyState))) {
script.onload = script.onreadystatechange = null;
loaded = true;
callback();
}
}
}
if (type === 'link') {
script.href = src;
script.rel = 'stylesheet';
} else {
script.src = src;
}
document.getElementsByTagName('head')[0].appendChild(script);
}
function addVideos(videos) {
let host = 'https://s0.pstatp.com/cdn/expire-1-M';
let unloadedResourceCount = 4;
let callback = (() => {
return () => {
if (!--unloadedResourceCount) {
createDplayers(videos);
}
};
})(unloadedResourceCount, videos);
loadResources(
'link',
host + '/dplayer/1.25.0/DPlayer.min.css',
callback
);
loadResources(
'script',
host + '/dplayer/1.25.0/DPlayer.min.js',
callback
);
loadResources(
'script',
host + '/hls.js/0.12.4/hls.light.min.js',
callback
);
loadResources(
'script',
host + '/flv.js/1.5.0/flv.min.js',
callback
);
}
function createDplayers(videos) {
for (i = 0; i < videos.length; i++) {
console.log(videos[i]);
new DPlayer({
container: document.getElementById('video-a' + i),
screenshot: true,
video: {
url: videos[i]
}
});
}
}
addVideos(['<!--FileDownUrl-->']);
<!--IsvideoFileEnd-->
<!--IsFileEnd-->
<!--ListEnd-->
<!--AdminStart-->
function logout() {
document.cookie = "admin=; path=/";
location.href = location.href;
}
<!--AdminEnd-->
<!--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();
}
<!--LoginEnd-->
</script>
</body>
</html>