Add the file app in the 'new' dropdown menus

This commit is contained in:
yflory 2017-06-06 11:52:47 +02:00
parent ac91d2f413
commit 5641a4a839
4 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,8 @@ define(function() {
/* Select the buttons displayed on the main page to create new collaborative sessions /* Select the buttons displayed on the main page to create new collaborative sessions
* Existing types : pad, code, poll, slide * 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 /* Cryptpad apps use a common API to display notifications to users
* by default, notifications are hidden after 5 seconds * by default, notifications are hidden after 5 seconds

View File

@ -57,6 +57,8 @@ define([
var $container = $('<div>', {'class': 'dropdown-bar'}).appendTo($parent); var $container = $('<div>', {'class': 'dropdown-bar'}).appendTo($parent);
Config.availablePadTypes.forEach(function (el) { Config.availablePadTypes.forEach(function (el) {
if (el === 'drive') { return; } if (el === 'drive') { return; }
if (!Cryptpad.isLoggedIn() && Config.registeredOnlyTypes &&
Config.registeredOnlyTypes.indexOf(el) !== -1) { return; }
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: { attributes: {

View File

@ -636,6 +636,8 @@ define([
var pads_options = []; var pads_options = [];
Config.availablePadTypes.forEach(function (p) { Config.availablePadTypes.forEach(function (p) {
if (p === 'drive') { return; } if (p === 'drive') { return; }
if (!Cryptpad.isLoggedIn() && Config.registeredOnlyTypes &&
Config.registeredOnlyTypes.indexOf(p) !== -1) { return; }
pads_options.push({ pads_options.push({
tag: 'a', tag: 'a',
attributes: { attributes: {

View File

@ -1370,6 +1370,10 @@ define([
} }
AppConfig.availablePadTypes.forEach(function (type) { AppConfig.availablePadTypes.forEach(function (type) {
if (type === 'drive') { return; } if (type === 'drive') { return; }
if (!Cryptpad.isLoggedIn() && AppConfig.registeredOnlyTypes &&
AppConfig.registeredOnlyTypes.indexOf(type) !== -1) {
return;
}
var attributes = { var attributes = {
'class': 'newdoc', 'class': 'newdoc',
'data-type': type, 'data-type': type,