1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

[share admin] share links: added support for mobile; bugfix & improvement (#4004)

* and bugfix for 'generate share link'
This commit is contained in:
llj
2019-08-20 12:00:58 +08:00
committed by Daniel Pan
parent d15a089bc3
commit 2e1fc1110f
6 changed files with 280 additions and 92 deletions

View File

@@ -108,13 +108,13 @@ export const Utils = {
}
},
isOfficeFile: function(filename) {
isEditableOfficeFile: function(filename) {
// no file ext
if (filename.lastIndexOf('.') == -1) {
return false;
}
var file_ext = filename.substr(filename.lastIndexOf('.') + 1).toLowerCase();
var exts = ['doc', 'ppt', 'xls', 'docx', 'pptx', 'xlsx'];
var exts = ['docx', 'pptx', 'xlsx'];
if (exts.indexOf(file_ext) != -1) {
return true;
} else {
@@ -421,6 +421,38 @@ export const Utils = {
return title;
},
getShareLinkPermissionObject: function(permission) {
switch (permission) {
case 'preview_download':
return {
value: permission,
text: gettext('Preview and download'),
permissionDetails: {
'can_edit': false,
"can_download": true
}
};
case 'preview_only':
return {
value: permission,
text: gettext('Preview only'),
permissionDetails: {
'can_edit': false,
"can_download": false
}
};
case 'edit_download':
return {
value: permission,
text: gettext('Edit on cloud and download'),
permissionDetails: {
'can_edit': true,
"can_download": true
}
};
}
},
formatSize: function(options) {
/*
* param: {bytes, precision}