Add upload-folder icon

pull/1/head
ClemDee 5 years ago
parent 1bb47e28ef
commit 3884ccb7f3

@ -93,6 +93,7 @@ define(function() {
config.applicationsIcon = { config.applicationsIcon = {
file: 'cptools-file', file: 'cptools-file',
fileupload: 'cptools-file-upload', fileupload: 'cptools-file-upload',
folderupload: 'cptools-folder-upload',
pad: 'cptools-pad', pad: 'cptools-pad',
code: 'cptools-code', code: 'cptools-code',
slide: 'cptools-slide', slide: 'cptools-slide',

@ -773,6 +773,7 @@ define([
var icon = AppConfig.applicationsIcon[type]; var icon = AppConfig.applicationsIcon[type];
var font = icon.indexOf('cptools') === 0 ? 'cptools' : 'fa'; var font = icon.indexOf('cptools') === 0 ? 'cptools' : 'fa';
if (type === 'fileupload') { type = 'file'; } if (type === 'fileupload') { type = 'file'; }
if (type === 'folderupload') { type = 'file'; }
var appClass = ' cp-icon cp-icon-color-'+type; var appClass = ' cp-icon cp-icon-color-'+type;
$icon = $('<span>', {'class': font + ' ' + icon + appClass}); $icon = $('<span>', {'class': font + ' ' + icon + appClass});
} }

@ -45,6 +45,7 @@ define([
editable: false, editable: false,
mobile: function () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles mobile: function () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles
isMac: navigator.platform === "MacIntel", isMac: navigator.platform === "MacIntel",
allowFolderUpload: true,
}; };
var stringify = function (obj) { var stringify = function (obj) {
@ -136,8 +137,6 @@ define([
var LS_SEARCHCURSOR = "app-drive-searchCursor"; var LS_SEARCHCURSOR = "app-drive-searchCursor";
var FOLDER_CONTENT_ID = "cp-app-drive-content-folder"; var FOLDER_CONTENT_ID = "cp-app-drive-content-folder";
var ALLOW_FOLDERUPLOAD = true;
var config = {}; var config = {};
var DEBUG = config.DEBUG = false; var DEBUG = config.DEBUG = false;
var debug = config.debug = DEBUG ? function () { var debug = config.debug = DEBUG ? function () {
@ -991,7 +990,7 @@ define([
return manager.isInSharedFolder(currentPath) || APP.disableSF; return manager.isInSharedFolder(currentPath) || APP.disableSF;
} }
if (className === 'uploadfiles') { return; } if (className === 'uploadfiles') { return; }
if (className === 'uploadfolder') { return !ALLOW_FOLDERUPLOAD; } if (className === 'uploadfolder') { return !APP.allowFolderUpload; }
if (className === 'newdoc') { if (className === 'newdoc') {
return AppConfig.availablePadTypes.indexOf($el.attr('data-type')) === -1; return AppConfig.availablePadTypes.indexOf($el.attr('data-type')) === -1;
} }
@ -2201,7 +2200,7 @@ define([
attributes: {'class': 'cp-app-drive-new-fileupload'}, attributes: {'class': 'cp-app-drive-new-fileupload'},
content: $('<div>').append(getIcon('fileupload')).html() + Messages.uploadButton content: $('<div>').append(getIcon('fileupload')).html() + Messages.uploadButton
}); });
if (ALLOW_FOLDERUPLOAD) { if (APP.allowFolderUpload) {
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-app-drive-new-folderupload'}, attributes: {'class': 'cp-app-drive-new-folderupload'},
@ -2497,7 +2496,7 @@ define([
$elementFileUpload.append($('<span>', {'class': 'cp-app-drive-new-name'}) $elementFileUpload.append($('<span>', {'class': 'cp-app-drive-new-name'})
.text(Messages.uploadButton)); .text(Messages.uploadButton));
// Upload folder // Upload folder
if (ALLOW_FOLDERUPLOAD) { if (APP.allowFolderUpload) {
var $elementFolderUpload = $('<li>', { var $elementFolderUpload = $('<li>', {
'class': 'cp-app-drive-new-folderupload cp-app-drive-element-row ' + 'class': 'cp-app-drive-new-folderupload cp-app-drive-element-row ' +
'cp-app-drive-element-grid' 'cp-app-drive-element-grid'

Loading…
Cancel
Save