diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index 151a8b7da..af2474775 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -4,7 +4,8 @@ define(function() { /* Select the buttons displayed on the main page to create new collaborative sessions * Existing types : pad, code, poll, slide */ - config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'whiteboard']; + config.availablePadTypes = ['drive', 'pad', 'code', 'slide', 'poll', 'whiteboard', 'file']; + config.registeredOnlyTypes = ['file']; /* Cryptpad apps use a common API to display notifications to users * by default, notifications are hidden after 5 seconds diff --git a/customize.dist/main.js b/customize.dist/main.js index a55bd7b44..72cfdd33c 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -57,6 +57,8 @@ define([ var $container = $('
', {'class': 'dropdown-bar'}).appendTo($parent); Config.availablePadTypes.forEach(function (el) { if (el === 'drive') { return; } + if (!Cryptpad.isLoggedIn() && Config.registeredOnlyTypes && + Config.registeredOnlyTypes.indexOf(el) !== -1) { return; } options.push({ tag: 'a', attributes: { diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js index af188f0e8..8740606ee 100644 --- a/www/common/toolbar2.js +++ b/www/common/toolbar2.js @@ -636,6 +636,8 @@ define([ var pads_options = []; Config.availablePadTypes.forEach(function (p) { if (p === 'drive') { return; } + if (!Cryptpad.isLoggedIn() && Config.registeredOnlyTypes && + Config.registeredOnlyTypes.indexOf(p) !== -1) { return; } pads_options.push({ tag: 'a', attributes: { diff --git a/www/drive/main.js b/www/drive/main.js index 03dcb7716..10d98e400 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1370,6 +1370,10 @@ define([ } AppConfig.availablePadTypes.forEach(function (type) { if (type === 'drive') { return; } + if (!Cryptpad.isLoggedIn() && AppConfig.registeredOnlyTypes && + AppConfig.registeredOnlyTypes.indexOf(type) !== -1) { + return; + } var attributes = { 'class': 'newdoc', 'data-type': type,