Make the pad types displayed on the front page configurable
This commit is contained in:
10
customize.dist/application_config.js
Normal file
10
customize.dist/application_config.js
Normal file
@@ -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;
|
||||||
|
});
|
||||||
@@ -82,6 +82,7 @@
|
|||||||
<a id="create-pad" class="button create" href="/pad/">CREATE NEW WYSIWYG PAD</a>
|
<a id="create-pad" class="button create" href="/pad/">CREATE NEW WYSIWYG PAD</a>
|
||||||
<a id="create-code" class="button create" href="/code/">CREATE NEW CODE PAD</a>
|
<a id="create-code" class="button create" href="/code/">CREATE NEW CODE PAD</a>
|
||||||
<a id="create-poll" class="button create" href="/poll/">CREATE NEW POLL</a>
|
<a id="create-poll" class="button create" href="/poll/">CREATE NEW POLL</a>
|
||||||
|
<a id="create-slide" class="button create" href="/slide/">CREATE NEW PRESENTATION</a>
|
||||||
</div>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ tr {
|
|||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: none;
|
||||||
}
|
}
|
||||||
/* Tables */
|
/* Tables */
|
||||||
table {
|
table {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
define([
|
define([
|
||||||
'/customize/messages.js',
|
'/customize/messages.js',
|
||||||
'/customize/DecorateToolbar.js',
|
'/customize/DecorateToolbar.js',
|
||||||
|
'/customize/application_config.js',
|
||||||
'/common/cryptpad-common.js',
|
'/common/cryptpad-common.js',
|
||||||
'/bower_components/lil-uri/uri.min.js',
|
'/bower_components/lil-uri/uri.min.js',
|
||||||
'/customize/email.js',
|
'/customize/email.js',
|
||||||
'/bower_components/jquery/dist/jquery.min.js',
|
'/bower_components/jquery/dist/jquery.min.js',
|
||||||
], function (Messages, DecorateToolbar, Cryptpad, LilUri, Email) {
|
], function (Messages, DecorateToolbar, Config, Cryptpad, LilUri, Email) {
|
||||||
var $ = window.$;
|
var $ = window.$;
|
||||||
|
|
||||||
var APP = window.APP = {
|
var APP = window.APP = {
|
||||||
@@ -41,6 +42,12 @@ define([
|
|||||||
|
|
||||||
var forgetPad = Cryptpad.forgetPad;
|
var forgetPad = Cryptpad.forgetPad;
|
||||||
|
|
||||||
|
var displayCreateButtons = function () {
|
||||||
|
Config.availablePadTypes.forEach(function (el) {
|
||||||
|
$('#create-' + el).show();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var makeRecentPadsTable = function (recentPads) {
|
var makeRecentPadsTable = function (recentPads) {
|
||||||
if (!recentPads.length) { return; }
|
if (!recentPads.length) { return; }
|
||||||
|
|
||||||
@@ -132,6 +139,7 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
displayCreateButtons();
|
||||||
Cryptpad.ready(function () {
|
Cryptpad.ready(function () {
|
||||||
console.log("ready");
|
console.log("ready");
|
||||||
refreshTable();
|
refreshTable();
|
||||||
|
|||||||
Reference in New Issue
Block a user