forked from peng4740/goindex-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ document.write('<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/d | |
// markdown支持 | ||
document.write('<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it.min.js"></script>'); | ||
document.write('<style>.mdui-appbar .mdui-toolbar{height:56px;font-size:1pc}.mdui-toolbar>*{padding:0 6px;margin:0 2px}.mdui-toolbar>i{opacity:.5}.mdui-toolbar>.mdui-typo-headline{padding:0 1pc 0 0}.mdui-toolbar>i{padding:0}.mdui-toolbar>a:hover,a.active,a.mdui-typo-headline{opacity:1}.mdui-container{max-width:980px}.mdui-list-item{transition:none}.mdui-list>.th{background-color:initial}.mdui-list-item>a{width:100%;line-height:3pc}.mdui-list-item{margin:2px 0;padding:0}.mdui-toolbar>a:last-child{opacity:1}@media screen and (max-width:980px){.mdui-list-item .mdui-text-right{display:none}.mdui-container{width:100%!important;margin:0}.mdui-toolbar>.mdui-typo-headline,.mdui-toolbar>a:last-child,.mdui-toolbar>i:first-child{display:block}}</style>'); | ||
|
||
// 初始化页面,并载入必要资源 | ||
function init(){ | ||
document.siteName = $('title').html(); | ||
|
@@ -144,7 +145,7 @@ function list_files(path,files){ | |
}); | ||
} | ||
var ext = p.split('.').pop(); | ||
if("|html|php|css|go|java|js|json|txt|sh|md|mp4|bmp|jpg|jpeg|png|gif|m4a|mp3|wav|ogg|webm|avi|".indexOf(`|${ext}|`) >= 0){ | ||
if("|html|php|css|go|java|js|json|txt|sh|md|mp4|webm|avi|bmp|jpg|jpeg|png|gif|m4a|mp3|wav|ogg|mpg|mpeg|mkv|rm|rmvb|mov|wmv|asf|ts|flv|".indexOf(`|${ext}|`) >= 0){ | ||
p += "?a=view"; | ||
c += " view"; | ||
} | ||
|
@@ -189,6 +190,10 @@ function file(path){ | |
if("|mp4|webm|avi|".indexOf(`|${ext}|`) >= 0){ | ||
return file_video(path); | ||
} | ||
|
||
if("|mpg|mpeg|mkv|rm|rmvb|mov|wmv|asf|ts|flv|".indexOf(`|${ext}|`) >= 0){ | ||
return file_video(path); | ||
} | ||
|
||
if("|mp3|wav|ogg|m4a|".indexOf(`|${ext}|`) >= 0){ | ||
return file_audio(path); | ||
|
@@ -255,13 +260,17 @@ function file_code(path){ | |
// 文件展示 视频 |mp4|webm|avi| | ||
function file_video(path){ | ||
var url = window.location.origin + path; | ||
var playBtn = `<a class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" href="potplayer://${url}"><i class="mdui-icon material-icons"></i>在 potplayer 中播放</a>`; | ||
if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端 | ||
playBtn = ` <a class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" href="intent:${url}#Intent;package=com.mxtech.videoplayer.ad;S.title=${path};end"><i class="mdui-icon material-icons"></i>在mxplayer中播放</a>`; | ||
} | ||
var content = ` | ||
<div class="mdui-container-fluid"> | ||
<br> | ||
<video class="mdui-video-fluid mdui-center" preload controls> | ||
<source src="${url}" type="video/mp4"> | ||
</video> | ||
<br> | ||
<br>${playBtn} | ||
<!-- 固定标签 --> | ||
<div class="mdui-textfield"> | ||
<label class="mdui-textfield-label">下载地址</label> | ||
|