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:
@@ -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}
|
||||
|
Reference in New Issue
Block a user