From 1e02e7b45bba24006d990fa4fa4323ac893a4c06 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 13 Sep 2016 11:01:10 +0200 Subject: [PATCH] Make the pad types displayed on the front page configurable --- customize.dist/application_config.js | 10 ++++++++++ customize.dist/index.html | 1 + customize.dist/main.css | 2 +- customize.dist/main.js | 10 +++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 customize.dist/application_config.js diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js new file mode 100644 index 000000000..058d2c1d9 --- /dev/null +++ b/customize.dist/application_config.js @@ -0,0 +1,10 @@ +define(function() { + var config = {}; + + /* Select the buttons displayed on the main page to create new collaborative sessions + * Existing types : pad, code, poll, slide + */ + config.availablePadTypes = ['pad', 'code', 'poll']; + + return config; +}); diff --git a/customize.dist/index.html b/customize.dist/index.html index 2e2eb28bb..54bceb35d 100644 --- a/customize.dist/index.html +++ b/customize.dist/index.html @@ -82,6 +82,7 @@ CREATE NEW WYSIWYG PAD CREATE NEW CODE PAD CREATE NEW POLL + CREATE NEW PRESENTATION diff --git a/customize.dist/main.css b/customize.dist/main.css index 43169841c..5511f5ae2 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -147,7 +147,7 @@ tr { margin-top: 12px; margin-bottom: 12px; white-space: nowrap; - display: inline-block; + display: none; } /* Tables */ table { diff --git a/customize.dist/main.js b/customize.dist/main.js index 2f0e70017..d51f5b26f 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -1,11 +1,12 @@ define([ '/customize/messages.js', '/customize/DecorateToolbar.js', + '/customize/application_config.js', '/common/cryptpad-common.js', '/bower_components/lil-uri/uri.min.js', '/customize/email.js', '/bower_components/jquery/dist/jquery.min.js', -], function (Messages, DecorateToolbar, Cryptpad, LilUri, Email) { +], function (Messages, DecorateToolbar, Config, Cryptpad, LilUri, Email) { var $ = window.$; var APP = window.APP = { @@ -41,6 +42,12 @@ define([ var forgetPad = Cryptpad.forgetPad; + var displayCreateButtons = function () { + Config.availablePadTypes.forEach(function (el) { + $('#create-' + el).show(); + }); + }; + var makeRecentPadsTable = function (recentPads) { if (!recentPads.length) { return; } @@ -132,6 +139,7 @@ define([ }); }; + displayCreateButtons(); Cryptpad.ready(function () { console.log("ready"); refreshTable();