forked from joni2back/angular-filemanager
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
94 lines (87 loc) · 3.18 KB
/
config.js
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
app.provider('fileManagerConfig', function () {
var bridgePath = 'bridges/php/handler.php';
var values = {
appName: 'AngularJS File Manager',
defaultLang: 'en',
multiLang: true,
bridgePath: bridgePath,
listUrl: bridgePath,
uploadUrl: bridgePath,
renameUrl: bridgePath,
copyUrl: bridgePath,
moveUrl: bridgePath,
removeUrl: bridgePath,
editUrl: bridgePath,
getContentUrl: bridgePath,
createFolderUrl: bridgePath,
downloadFileUrl: bridgePath,
downloadMultipleUrl: bridgePath,
compressUrl: bridgePath,
extractUrl: bridgePath,
permissionsUrl: bridgePath,
basePath: '/',
serverUrl: '', // leading string in building public path for files (e.g. https://example.com/uploads)
searchForm: true,
sidebar: true,
breadcrumb: true,
allowedActions: {
upload: true,
rename: true,
move: true,
copy: true,
edit: true,
changePermissions: true,
compress: true,
compressChooseName: true,
extract: true,
download: true,
downloadMultiple: true,
preview: true,
remove: true,
createFolder: true,
pickFiles: false,
pickFolders: false
},
multipleDownloadFileName: 'angularjs-filemanager.zip',
filterFileExtensions: [],
showExtensionIcons: true,
showSizeForDirectories: false,
useBinarySizePrefixes: false,
downloadFilesByAjax: true,
previewImagesInModal: true,
enablePermissionsRecursive: true,
compressAsync: false,
extractAsync: false,
pickCallback: null,
isEditableFilePattern: /\.(txt|diff?|patch|svg|asc|cnf|cfg|conf|html?|.html|cfm|cgi|aspx?|ini|pl|py|md|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|svg|tiff?)$/i,
isExtractableFilePattern: /\.(gz|tar|rar|g?zip)$/i,
tplPath: 'src/templates'
};
return {
$get: function () {
return values;
},
set: function (constants) {
angular.extend(values, constants);
},
setBridge: function (path) {
bridgePath = path;
values.bridgePath = path;
values.listUrl = path;
values.uploadUrl = bridgePath;
values.renameUrl = bridgePath;
values.copyUrl = bridgePath;
values.moveUrl = bridgePath;
values.removeUrl = bridgePath;
values.editUrl = bridgePath;
values.getContentUrl = bridgePath;
values.createFolderUrl = bridgePath;
values.downloadFileUrl = bridgePath;
values.downloadMultipleUrl = bridgePath;
values.compressUrl = bridgePath;
values.extractUrl = bridgePath;
values.permissionsUrl = bridgePath;
}
};
});