Feat: Single file share

pull/141/head
HFO4 7 years ago
parent 41d1294ebf
commit 53c79bfa65

@ -47,8 +47,9 @@ class Share extends Controller{
'fileData' => $shareObj->fileData, 'fileData' => $shareObj->fileData,
'shareData' => $shareObj->shareData, 'shareData' => $shareObj->shareData,
'loginStatus' => $this->userObj->loginStatus, 'loginStatus' => $this->userObj->loginStatus,
'userData' => $this->userObj->userSQLData, 'userData' => $this->userObj->getInfo(),
'allowPreview' => Option::getValue("allowdVisitorDownload"), 'allowPreview' => Option::getValue("allowdVisitorDownload"),
'path' => empty(input("get.path"))?"/":input("get.path"),
]); ]);
} }
}else{ }else{
@ -67,7 +68,7 @@ class Share extends Controller{
public function getDownloadUrl(){ public function getDownloadUrl(){
$shareId = input('key'); $shareId = input('key');
$shareObj = new ShareHandler($shareId,false); $shareObj = new ShareHandler($shareId,false);
return $shareObj->getDownloadUrl($this->userObj); return json($shareObj->getDownloadUrl($this->userObj));
} }
public function Download(){ public function Download(){
@ -91,9 +92,9 @@ class Share extends Controller{
$filePath = input('get.path'); $filePath = input('get.path');
$shareObj = new ShareHandler($shareId,false); $shareObj = new ShareHandler($shareId,false);
if(empty($filePath)){ if(empty($filePath)){
//todo 单文件时 $contentHandller = $shareObj->getContent($this->userObj,$filePath,false);
}else{ }else{
$contentHandller = $shareObj->getContent($this->userObj,$filePath); $contentHandller = $shareObj->getContent($this->userObj,$filePath,true);
} }
if(!$contentHandller[0]){ if(!$contentHandller[0]){
return json(["result"=>["success"=>false,"error"=>$contentHandller[1]]]); return json(["result"=>["success"=>false,"error"=>$contentHandller[1]]]);
@ -167,9 +168,9 @@ class Share extends Controller{
$filePath = urldecode(input('get.path')); $filePath = urldecode(input('get.path'));
$shareObj = new ShareHandler($shareId,false); $shareObj = new ShareHandler($shareId,false);
if(empty($filePath)){ if(empty($filePath)){
//TODO 单文件时 $Redirect = $shareObj->getDocPreview($this->userObj,$filePath,false);
}else{ }else{
$Redirect = $shareObj->getDocPreview($this->userObj,$filePath); $Redirect = $shareObj->getDocPreview($this->userObj,$filePath,true);
} }
if($Redirect[0]){ if($Redirect[0]){

@ -30,6 +30,8 @@ class Viewer extends Controller{
$url = "/File/Preview?action=preview&path=".$path; $url = "/File/Preview?action=preview&path=".$path;
if(input("get.share")==true){ if(input("get.share")==true){
$url = "/Share/Preview/".input("get.shareKey")."/?path=".$path; $url = "/Share/Preview/".input("get.shareKey")."/?path=".$path;
}else if(input("get.single")==true){
$url = "/Share/Preview/".input("get.shareKey");
} }
return view('video', [ return view('video', [
'options' => Option::getValues(['basic']), 'options' => Option::getValues(['basic']),
@ -49,6 +51,8 @@ class Viewer extends Controller{
$url = "/File/Content?action=preview&path=".$path; $url = "/File/Content?action=preview&path=".$path;
if(input("get.share")==true){ if(input("get.share")==true){
$url = "/Share/Content/".input("get.shareKey")."/?path=".$path; $url = "/Share/Content/".input("get.shareKey")."/?path=".$path;
}else if(input("get.single")==true){
$url = "/Share/Content/".input("get.shareKey");
} }
return view('markdown', [ return view('markdown', [
'options' => Option::getValues(['basic']), 'options' => Option::getValues(['basic']),

@ -95,24 +95,44 @@ class ShareHandler extends Model{
return $fileObj->getThumb(); return $fileObj->getThumb();
} }
public function getDocPreview($user,$path){ public function getDocPreview($user,$path,$inFolder){
$checkStatus = $this->checkSession($user); $checkStatus = $this->checkSession($user);
if(!$checkStatus[0]){ if(!$checkStatus[0]){
return [$checkStatus[0],$checkStatus[1]]; return [$checkStatus[0],$checkStatus[1]];
} }
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find(); if($inFolder){
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]); $reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]);
}else{
$reqPath = Db::name('files')->where('id',$this->shareData["source_name"])->find();
if($reqPath["dir"] == "/"){
$reqPath["dir"] = $reqPath["dir"].$reqPath["orign_name"];
}else{
$reqPath["dir"] = $reqPath["dir"]."/".$reqPath["orign_name"];
}
$fileObj = new FileManage($reqPath["dir"],$this->shareData["owner"]);
}
$tmpUrl = $fileObj->signTmpUrl(); $tmpUrl = $fileObj->signTmpUrl();
return[true,"http://view.officeapps.live.com/op/view.aspx?src=".urlencode($tmpUrl)]; return[true,"http://view.officeapps.live.com/op/view.aspx?src=".urlencode($tmpUrl)];
} }
public function getContent($user,$path=null){ public function getContent($user,$path=null,$inFolder){
$checkStatus = $this->checkSession($user); $checkStatus = $this->checkSession($user);
if(!$checkStatus[0]){ if(!$checkStatus[0]){
return [$checkStatus[0],$checkStatus[1]]; return [$checkStatus[0],$checkStatus[1]];
} }
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find(); if($inFolder){
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]); $reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]);
}else{
$reqPath = Db::name('files')->where('id',$this->shareData["source_name"])->find();
if($reqPath["dir"] == "/"){
$reqPath["dir"] = $reqPath["dir"].$reqPath["orign_name"];
}else{
$reqPath["dir"] = $reqPath["dir"]."/".$reqPath["orign_name"];
}
$fileObj = new FileManage($reqPath["dir"],$this->shareData["owner"]);
}
$fileObj->getContent(); $fileObj->getContent();
exit(); exit();
} }

@ -64,6 +64,7 @@
} }
}; };
isHomePage = true; isHomePage = true;
pageId="";
isSharePage = false; isSharePage = false;
uploadConfig = { uploadConfig = {
saveType: "{$policyData.policy_type}", saveType: "{$policyData.policy_type}",
@ -118,10 +119,11 @@
</body> </body>
<script src="http://192.168.123.19:3000/static/js/runtime~index.bundle.js"></script> <script src="http://192.168.123.19:3000/static/js/runtime~index.bundle.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/5.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/2.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/6.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/index.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/index.chunk.js"></script>
</html> </html>

@ -65,6 +65,7 @@
}; };
isHomePage = false; isHomePage = false;
isSharePage = true; isSharePage = true;
pageId="";
apiURL = { apiURL = {
imgThumb: "/Share/Thumb/{$shareData.share_key}", imgThumb: "/Share/Thumb/{$shareData.share_key}",
preview: "/Share/Preview/{$shareData.share_key}", preview: "/Share/Preview/{$shareData.share_key}",
@ -129,13 +130,12 @@
--> -->
</body> </body>
<script src="http://192.168.123.19:3000/static/js/runtime~folderShare.bundle.js"></script> <script src="http://192.168.123.19:3000/static/js/runtime~folderShare.bundle.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/6.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/2.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/10.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/12.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/9.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/11.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/13.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/folderShare.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/folderShare.chunk.js"></script>
</html> </html>

@ -1,131 +1,96 @@
{extend name="header_public" /} <!DOCTYPE html>
{block name="title"}{$fileData.orign_name} - {$options.siteName}{/block} <html lang="zh-cn">
{block name="content"}
<link rel="stylesheet" href="/static/css/share.css" />
<link rel="stylesheet" href="/static/css/photoswipe.css">
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
<script src="/static/js/jquery.color.js"></script>
</head>
<body data-ma-header="teal">
<div class="modal fade" id="previewModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" onclick="audioPause()" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only ng-binding">关闭</span>
</button>
<h4 class="modal-title">视频预览</h4>
</div>
<div class="modal-body">
<div class="text-center previewContent">
</div>
</div>
</div>
</div>
</div>
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element, as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
<div class="pswp__container">
<!-- don't modify these 3 pswp__item elements, data is added later on -->
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-inverse" >
<div class="container-fluid">
<div class="container" >
{include file="navbar_public" /}
<div class="header-panel shadow-z-2">
<div class="container-fluid">
<div class="row">
</div> <head>
</div> <meta charset="utf-8">
</div> <link rel="shortcut icon" href="/favicon.ico">
<div class="container main" > <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<div class="col-md-3"></div> <!--
<div class="col-md-6"> manifest.json provides metadata used when your web app is added to the
<div class="jumbotron" > homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
<div class="card_top"> -->
<div class="row top-color"> <link rel="manifest" href="/manifest.json">
<div class="card-top-row"> <!--
<div class="file-sign col-xs-2"> Notice the use of %PUBLIC_URL% in the tags above.
<i class="fa fa-file-image-o" aria-hidden="true"></i> It will be replaced with the URL of the `public` folder during the build.
</div> Only files inside the `public` folder can be referenced from the HTML.
<div class="file_title col-xs-10">
<div class="file_title_inside str_wrap">
{$fileData.orign_name|htmlspecialchars=ENT_NOQUOTES}&nbsp;&nbsp;
</div>
<div class="file_info"><span id="size"></span>&nbsp;&nbsp;<span><i class="fa fa-cloud-download" aria-hidden="true"></i> <span id="down_num"></span></span>&nbsp;&nbsp;<span><i class="fa fa-eye" aria-hidden="true"></i> <span id="view_num"></span></span></div>
</div>
</div>
</div>
<div class="card-middle">
<button class="btn btn-info btn-fab" id="previewButton"><i class="material-icons fa fa-eye"></i><div class="ripple-container"></div></button>
<button class="btn btn-primary btn-fab" id="download"><i class="material-icons fa fa-download"></i><div class="ripple-container"></div></button>
</div>
</div>
<div class="card_botom"> Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
<div class="row bottom-width"> work correctly both with client-side routing and a non-root public URL.
<div class="avatar "> Learn how to configure a non-root public URL by running `npm run build`.
<img src="/Member/Avatar/{$userInfo.id}/s" class="img-circle animated rotateIn"> -->
<div class="nick"> <title>{$fileData.orign_name} - {$options.siteName}</title>
<span class="nickname"><a class="notWave" href="/Profile/{$userInfo.id}">{$userInfo.user_nick}</a></span> <script type="text/javascript">
<br> colorTheme = {
<span class="share_time">分享于<span id="share_time"></span></span> "palette": {
"common": {
</div> "black": "#000",
</div> "white": "#fff"
</div> },
</div> "background": {
</div></div> "paper": "#fff",
<div class="col-md-3"></div> "default": "#fafafa"
</div> },
</div> "primary": {
</body> "light": "#7986cb",
<script src="/static/js/jquery.liMarquee.js"></script> "main": "#3f51b5",
<script type="text/javascript"> "dark": "#303f9f",
"contrastText": "#fff"
},
"secondary": {
"light": "#ff4081",
"main": "#f50057",
"dark": "#c51162",
"contrastText": "#fff"
},
"error": {
"light": "#e57373",
"main": "#f44336",
"dark": "#d32f2f",
"contrastText": "#fff"
},
"text": {
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)"
},
"explorer": {
"filename": "#474849",
"icon": "#8f8f8f",
"bgSelected": "#D5DAF0",
"emptyIcon": "#e8e8e8",
}
}
};
isHomePage = false;
isSharePage = true;
pageId="fileShare";
apiURL = {
imgThumb: "/Share/Thumb/{$shareData.share_key}",
preview: "/Share/Preview/{$shareData.share_key}",
download: "/Share/Download/{$shareData.share_key}",
docPreiview: '/Share/DocPreview/{$shareData.share_key}',
listFile:'/Share/ListFile/{$shareData.share_key}'
};
userInfo = {
uid: {$userData.uid},
nick: "{$userData.userNick}",
email: "{$userData.userMail}",
group: "{$userData.groupData.group_name}",
groupId: {$userData.groupData.id},
groupColor: "{$userData.groupData.color}",
};
siteInfo = {
mainTitle: "{$fileData.orign_name}",
};
path = "{$path}";
uploadConfig = {
allowSource: false,
allowShare: false,
allowRemoteDownload: "0",
allowTorrentDownload: "0",
};
shareInfo={ shareInfo={
fileSize : "{$fileData.size}", fileSize : "{$fileData.size}",
shareDate : "{$shareData.share_time}", shareDate : "{$shareData.share_time}",
@ -142,7 +107,33 @@
allowPreview:{$allowPreview}, allowPreview:{$allowPreview},
{/eq} {/eq}
}; };
</script> mediaType = {},
<script src="/static/js/share_single.js"> </script> isMobile = window.innerWidth < 600;
{$options.js_code} </script>
{/block} </head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script src="http://192.168.123.19:3000/static/js/runtime~fileShare.bundle.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/fileShare.chunk.js"></script>
</html>

@ -1,9 +1,10 @@
{extend name="header_dir_share" /} {extend name="header_public" /}
{block name="title"}{$dirData.folder_name} - {$options.siteName}{/block} {block name="title"}{$fileData.orign_name} - {$options.siteName}{/block}
{block name="content"} {block name="content"}
<link rel="stylesheet" href="/static/css/share_dir.css" /> <link rel="stylesheet" href="/static/css/share.css" />
<link rel="stylesheet" href="/static/css/photoswipe.css"> <link rel="stylesheet" href="/static/css/photoswipe.css">
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css"> <link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
<script src="/static/js/jquery.color.js"></script>
</head> </head>
<body data-ma-header="teal"> <body data-ma-header="teal">
<div class="modal fade" id="previewModal" role="dialog"> <div class="modal fade" id="previewModal" role="dialog">
@ -70,21 +71,71 @@
</div> </div>
</div> </div>
</div> </div>
<angular-filemanager></angular-filemanager> <nav class="navbar navbar-inverse" >
<div class="container-fluid">
<div class="container" >
{include file="navbar_public" /}
<div class="header-panel shadow-z-2">
<div class="container-fluid">
<div class="row">
</div>
</div>
</div>
<div class="container main" >
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="jumbotron" >
<div class="card_top">
<div class="row top-color">
<div class="card-top-row">
<div class="file-sign col-xs-2">
<i class="fa fa-file-image-o" aria-hidden="true"></i>
</div>
<div class="file_title col-xs-10">
<div class="file_title_inside str_wrap">
{$fileData.orign_name|htmlspecialchars=ENT_NOQUOTES}&nbsp;&nbsp;
</div>
<div class="file_info"><span id="size"></span>&nbsp;&nbsp;<span><i class="fa fa-cloud-download" aria-hidden="true"></i> <span id="down_num"></span></span>&nbsp;&nbsp;<span><i class="fa fa-eye" aria-hidden="true"></i> <span id="view_num"></span></span></div>
</div>
</div>
</div>
<div class="card-middle">
<button class="btn btn-info btn-fab" id="previewButton"><i class="material-icons fa fa-eye"></i><div class="ripple-container"></div></button>
<button class="btn btn-primary btn-fab" id="download"><i class="material-icons fa fa-download"></i><div class="ripple-container"></div></button>
</div>
</div>
<div class="card_botom">
<div class="row bottom-width">
<div class="avatar ">
<img src="/Member/Avatar/{$userInfo.id}/s" class="img-circle animated rotateIn">
<div class="nick">
<span class="nickname"><a class="notWave" href="/Profile/{$userInfo.id}">{$userInfo.user_nick}</a></span>
<br>
<span class="share_time">分享于<span id="share_time"></span></span>
</div>
</div>
</div>
</div>
</div></div>
<div class="col-md-3"></div>
</div>
</div>
</body> </body>
<script src="/static/js/jquery.liMarquee.js"></script>
<script type="text/javascript"> <script type="text/javascript">
shareInfo={ shareInfo={
fileSize : "{$fileData.size}",
shareDate : "{$shareData.share_time}", shareDate : "{$shareData.share_time}",
ownerUid:"{$userInfo.id}", ownerUid:"{$userInfo.id}",
ownerNick:"{$userInfo.user_nick}", ownerNick:"{$userInfo.user_nick}",
downloadNum:"{$shareData.download_num}", downloadNum:"{$shareData.download_num}",
ViewNum:"{$shareData.view_num}", ViewNum:"{$shareData.view_num}",
shareId:"{$shareData.share_key}", shareId:"{$shareData.share_key}",
dirName:"{$dirData.folder_name}", fileName:"{$fileData.orign_name}",
groupName:"{$groupData.group_name}", picSize:"{$fileData.pic_info}",
color:"{$groupData.color}",
{eq name="$loginStatus" value="1"} {eq name="$loginStatus" value="1"}
allowPreview:true, allowPreview:true,
{else/} {else/}
@ -92,14 +143,6 @@
{/eq} {/eq}
}; };
</script> </script>
<script src="/static/js/angular.min.js"></script> <script src="/static/js/share_single.js"> </script>
<script src="/static/js/angular-translate.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/material.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/toastr.min.js"></script>
<script src="/static/js/filemanager_share.js"></script>
<script src="/static/js/share_dir.js"> </script>
{$options.js_code} {$options.js_code}
{/block} {/block}

@ -65,6 +65,7 @@
}; };
isHomePage = false; isHomePage = false;
isSharePage = false; isSharePage = false;
pageId="";
apiURL={ apiURL={
imgThumb:"/File/Thumb", imgThumb:"/File/Thumb",
preview:"/File/Preview", preview:"/File/Preview",

@ -64,6 +64,7 @@
}; };
isHomePage = false; isHomePage = false;
isSharePage = false; isSharePage = false;
pageId="";
apiURL={ apiURL={
imgThumb:"/File/Thumb", imgThumb:"/File/Thumb",
preview:"/File/Preview", preview:"/File/Preview",
@ -108,8 +109,8 @@
</body> </body>
<script src="http://192.168.123.19:3000/static/js/runtime~video.bundle.js"></script><script src="http://192.168.123.19:3000/static/js/5.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/runtime~video.bundle.js"></script><script src="http://192.168.123.19:3000/static/js/5.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/2.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/15.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/6.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/video.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/video.chunk.js"></script>
</html> </html>

File diff suppressed because one or more lines are too long

@ -1,119 +0,0 @@
$.material.init();
angular.module('FileManagerApp').config(['fileManagerConfigProvider', function(config) {
var defaults = config.$get();
config.set({
appName: 'angular-filemanager',
defaultLang: 'zh_cn',
sidebar: true,
pickCallback: function(item) {
var msg = 'Picked %s "%s" for external use'
.replace('%s', item.type)
.replace('%s', item.fullPath());
window.alert(msg);
},
allowedActions: angular.extend(defaults.allowedActions, {
pickFiles: false,
pickFolders: false,
changePermissions: false,
upload: false,
shareFile: false,
shareFile: false,
}),
});
}]);
function includeCss(filename) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.href = filename;
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link)
}
previewLoad = 0;
var openPhotoSwipe = function(items) {
var pswpElement = document.querySelectorAll('.pswp')[0];
var options = {
history: false,
focus: false,
showAnimationDuration: 5,
hideAnimationDuration: 0,
bgOpacity: 0.8,
closeOnScroll: 0,
};
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
};
jQuery.ajaxSetup({
cache: true
});
var loadPreview = function(t) {
if (!previewLoad) {
toastr["info"]("加载预览组件...");
$.getScript("/static/js/photoswipe.min.js").done(function() {
$.getScript("/static/js/photoswipe-ui-default.js").done(function() {
openPhotoSwipe(t);
toastr.clear();
previewLoad = 1;
})
})
} else {
openPhotoSwipe(t);
}
}
vplayderLoad = false;
var loadDPlayer = function(url){
if (!vplayderLoad) {
toastr["info"]("加载预览组件...");
includeCss("/static/css/DPlayer.min.css");
$.getScript("/static/js/DPlayer.min.js").done(function() {
toastr.clear();
vplayderLoad = 1;
playVideo(url);
});
}else{
playVideo(url);
}
}
var playVideo = function(url){
dp = new DPlayer({
container: document.getElementById("videopreview-target"),
screenshot: true,
video: {
url: url
},
});
dp.on("fullscreen", function(){
$(".modal-backdrop").hide();
$("#side").hide();
return false;
});
dp.on("fullscreen_cancel", function(){
$(".modal-backdrop").show();
$("#side").show();
return false;
})
}
function mobileBind(){
if($(window).width()<768){
$('a[ng-click|="selectOrUnselect(item, $event)"]').click(function(event){
var menu = $("#context-menu");
if (event.pageX >= window.innerWidth - menu.width()) {
event.pageX -= menu.width();
}
if (event.pageY >= window.innerHeight - menu.height()) {
event.pageY -= menu.height();
}
$("#context-menu").css({
"left": event.pageX,
"top": event.pageY
});
  $(this).contextmenu();
return false;
})
}
}
Loading…
Cancel
Save