From ccbb6c7778754a16f80b996b33083f0e2fb718a0 Mon Sep 17 00:00:00 2001
From: HFO4 <912394456@qq.com>
Date: Tue, 10 Apr 2018 22:28:17 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=8D=E5=AD=90=E7=A6=BB=E7=BA=BF=E4=B8=8B?=
=?UTF-8?q?=E8=BD=BD=E5=89=8D=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
static/js/angular-filemanager.min.js | 46 +++++++++++++++++++++++++---
1 file changed, 41 insertions(+), 5 deletions(-)
diff --git a/static/js/angular-filemanager.min.js b/static/js/angular-filemanager.min.js
index bb1c720d..69c7a44e 100644
--- a/static/js/angular-filemanager.min.js
+++ b/static/js/angular-filemanager.min.js
@@ -332,8 +332,18 @@ function(e, r) {
e.modal("remoteDownload", !0);
toastr["success"]("离线下载任务已创建");
})
- }
- }
+ }
+ },
+ e.startTorrentDownload = function(){
+ var r = e.singleSelection();
+ console.log(r);
+ e.apiMiddleware.apiHandler.error = !1;
+ return void e.apiMiddleware.startTorrentDownload(r,n.selectedModalPath).then(function() {
+ e.modal("torrentDownload", !0);
+ toastr["success"]("离线下载任务已创建");
+ })
+
+ },
e.rename = function() {
var r = e.singleSelection(),
n = r.tempModel.name,
@@ -655,6 +665,9 @@ function(e) {
},
i.prototype.isImage = function() {
return r.isImageFilePattern.test(this.model.name)
+ },
+ i.prototype.isTorrent = function() {
+ return r.isTorrentFilePattern.test(this.model.name)
},
i.prototype.isVideo = function() {
return r.isVideoFilePattern.test(this.model.name)
@@ -812,6 +825,7 @@ function(e) {
pickCallback: false,
isEditableFilePattern: /\.(txt|diff?|patch|svg|asc|cnf|cfg|conf|html?|.html|cfm|cgi|aspx?|ini|pl|py|css|cs|js|jsp|log|htaccess|htpasswd|gitignore|gitattributes|env|json|atom|eml|rss|markdown|sql|xml|xslt?|sh|rb|as|bat|cmd|cob|for|ftn|frm|frx|inc|lisp|scm|coffee|php[3-6]?|java|c|cbl|go|h|scala|vb|tmpl|lock|go|yml|yaml|tsv|lst)$/i,
isImageFilePattern: /\.(jpe?g|gif|bmp|png|tiff?)$/i,
+ isTorrentFilePattern: /\.(torrent)$/i,
isVideoFilePattern:/\.(mp4|flv|avi|tff?)$/i,
isAudioFilePattern:/\.(mp3|wav|ogg?)$/i,
isMdFilePattern:/\.(md?)$/i,
@@ -1032,6 +1046,25 @@ function(e, r) {
}),
s.promise
},
+ o.prototype.startTorrentDownload = function(api,fileId,path) {
+ var o = this,
+ s = n.defer(),
+ l = {
+ action: "torrentDownload",
+ path: path,
+ id:fileId
+ };
+ return o.inprocess = !0,
+ o.error = "",
+ e.post(api, l).success(function(e, r) {
+ o.deferredHandler(e, s, r)
+ }).error(function(e, r) {
+ o.deferredHandler(e, s, r, a.instant("error_moving"))
+ })["finally"](function() {
+ o.inprocess = !1
+ }),
+ s.promise
+ },
o.prototype.remove = function(r, i,dir) {
var t = this,
o = n.defer(),
@@ -1348,6 +1381,9 @@ function(e) {
i.prototype.startRemoteDownload = function(url,path) {
return this.apiHandler.startRemoteDownload(r.remoteDownloadUrl,url ,this.getPath(path))
},
+ i.prototype.startTorrentDownload = function(torrent,path) {
+ return this.apiHandler.startTorrentDownload(r.torrentDownloadUrl,torrent.model.fileId ,this.getPath(path))
+ },
i.prototype.remove = function(e,dir) {
var n = this.getFileList(e);
var dirList = this.getFileList(dir);
@@ -1552,12 +1588,12 @@ function(e) {
angular.module("FileManagerApp").run(["$templateCache",
function(e) {
e.put("src/templates/current-folder-breadcrumb.html", '
\r\n - \r\n \r\n {{"filemanager" | translate}}\r\n \r\n
\r\n - \r\n \r\n {{dir | strLimit : 8}}\r\n \r\n \r\n {{dir | strLimit : 12}}\r\n \r\n
\r\n
'),
- e.put("src/templates/item-context-menu.html", ''),
- e.put("src/templates/main-icons.html", '\r\n
\r\n\r\n
\r\n\r\n
\r\n {{"no_files_in_folder" | translate}}...\r\n
\r\n \r\n
\r\n {{ fileNavigator.error }}\r\n
\r\n
'),
+ e.put("src/templates/item-context-menu.html", ''),
+ e.put("src/templates/main-icons.html", '\r\n
\r\n\r\n
\r\n\r\n
\r\n {{"no_files_in_folder" | translate}}...\r\n
\r\n \r\n
\r\n {{ fileNavigator.error }}\r\n
\r\n
'),
e.put("src/templates/main-table-modal.html", ''),
e.put("src/templates/main-table.html", '\r\n'),
e.put("src/templates/main.html", '\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n'),
- e.put("src/templates/modals.html", '\r\n
\r\n
\r\n \r\n
\r\n
\r\n
![{{singleSelection().model.name}}]()
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
{{singleSelection() && singleSelection().model.name}} 的源文件地址: \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
的分享地址: \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),
+ e.put("src/templates/modals.html", '\r\n
\r\n
\r\n \r\n
\r\n
\r\n
![{{singleSelection().model.name}}]()
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
{{singleSelection() && singleSelection().model.name}} 的源文件地址: \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
{{\'loading\' | translate}} ...\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
的分享地址: \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),
e.put("src/templates/navbar.html", '