From 3884ccb7f3bd0a1dbcc4cab1358a9e2e76d5eb8b Mon Sep 17 00:00:00 2001 From: ClemDee Date: Wed, 17 Jul 2019 12:15:14 +0200 Subject: [PATCH] Add upload-folder icon --- www/common/application_config_internal.js | 1 + www/common/common-interface.js | 1 + www/drive/inner.js | 9 ++++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index e4d5aa4f9..6a362b133 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -93,6 +93,7 @@ define(function() { config.applicationsIcon = { file: 'cptools-file', fileupload: 'cptools-file-upload', + folderupload: 'cptools-folder-upload', pad: 'cptools-pad', code: 'cptools-code', slide: 'cptools-slide', diff --git a/www/common/common-interface.js b/www/common/common-interface.js index e44a4ecff..6f70d15c3 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -773,6 +773,7 @@ define([ var icon = AppConfig.applicationsIcon[type]; var font = icon.indexOf('cptools') === 0 ? 'cptools' : 'fa'; if (type === 'fileupload') { type = 'file'; } + if (type === 'folderupload') { type = 'file'; } var appClass = ' cp-icon cp-icon-color-'+type; $icon = $('', {'class': font + ' ' + icon + appClass}); } diff --git a/www/drive/inner.js b/www/drive/inner.js index 9b43426ea..61d3ade27 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -45,6 +45,7 @@ define([ editable: false, mobile: function () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles isMac: navigator.platform === "MacIntel", + allowFolderUpload: true, }; var stringify = function (obj) { @@ -136,8 +137,6 @@ define([ var LS_SEARCHCURSOR = "app-drive-searchCursor"; var FOLDER_CONTENT_ID = "cp-app-drive-content-folder"; - var ALLOW_FOLDERUPLOAD = true; - var config = {}; var DEBUG = config.DEBUG = false; var debug = config.debug = DEBUG ? function () { @@ -991,7 +990,7 @@ define([ return manager.isInSharedFolder(currentPath) || APP.disableSF; } if (className === 'uploadfiles') { return; } - if (className === 'uploadfolder') { return !ALLOW_FOLDERUPLOAD; } + if (className === 'uploadfolder') { return !APP.allowFolderUpload; } if (className === 'newdoc') { return AppConfig.availablePadTypes.indexOf($el.attr('data-type')) === -1; } @@ -2201,7 +2200,7 @@ define([ attributes: {'class': 'cp-app-drive-new-fileupload'}, content: $('
').append(getIcon('fileupload')).html() + Messages.uploadButton }); - if (ALLOW_FOLDERUPLOAD) { + if (APP.allowFolderUpload) { options.push({ tag: 'a', attributes: {'class': 'cp-app-drive-new-folderupload'}, @@ -2497,7 +2496,7 @@ define([ $elementFileUpload.append($('', {'class': 'cp-app-drive-new-name'}) .text(Messages.uploadButton)); // Upload folder - if (ALLOW_FOLDERUPLOAD) { + if (APP.allowFolderUpload) { var $elementFolderUpload = $('
  • ', { 'class': 'cp-app-drive-new-folderupload cp-app-drive-element-row ' + 'cp-app-drive-element-grid'