From 46b5b8766d32021b04d103aefcccf646a96fd5cf Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 31 Jan 2017 18:16:35 +0100 Subject: [PATCH 1/2] Dropdown button to make a pad from homepage --- customize.dist/index.html | 4 ++-- customize.dist/main.css | 3 ++- customize.dist/main.js | 18 +++++++++++++++++- customize.dist/src/fragments/index.html | 4 ++-- customize.dist/src/less/cryptpad.less | 1 + customize.dist/src/less/dropdown.less | 2 +- customize.dist/toolbar.css | 2 +- customize.dist/translations/messages.fr.js | 1 + customize.dist/translations/messages.js | 1 + 9 files changed, 28 insertions(+), 8 deletions(-) diff --git a/customize.dist/index.html b/customize.dist/index.html index 65652f020..a317333d5 100644 --- a/customize.dist/index.html +++ b/customize.dist/index.html @@ -76,9 +76,9 @@ - + -

+ diff --git a/customize.dist/main.css b/customize.dist/main.css index 7a709f5e9..fed721f3f 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -347,7 +347,7 @@ display: none; position: absolute; background-color: #f9f9f9; - min-width: 200px; + min-width: 250px; box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2); z-index: 1000; max-height: 300px; @@ -735,6 +735,7 @@ html.cp, height: calc(100vh - 150px); min-height: 450px; margin: auto; + z-index: 1; font-size: medium; } .cp #main #main-container, diff --git a/customize.dist/main.js b/customize.dist/main.js index 2e2ccc9be..5606b1960 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -35,9 +35,25 @@ define([ var displayCreateButtons = function () { var $parent = $('#buttons'); + var options = []; Config.availablePadTypes.forEach(function (el) { - $('#create-' + el).attr('target', '_blank').show(); + options.push({ + tag: 'a', + attributes: { + 'class': 'newdoc', + 'href': '/' + el, + 'target': '_blank' + }, + content: Messages['button_new' + el] // Pretty name of the language value + }); }); + var dropdownConfig = { + text: Messages.makeAPad, // Button initial text + options: options, // Entries displayed in the menu + }; + var $block = Cryptpad.createDropdown(dropdownConfig); + $block.find('button').addClass('btn').addClass('btn-success'); + $block.appendTo($parent); }; // Language selector diff --git a/customize.dist/src/fragments/index.html b/customize.dist/src/fragments/index.html index ae3f81b31..0618e3b52 100644 --- a/customize.dist/src/fragments/index.html +++ b/customize.dist/src/fragments/index.html @@ -10,9 +10,9 @@ - + -

+ diff --git a/customize.dist/src/less/cryptpad.less b/customize.dist/src/less/cryptpad.less index 81a1092c9..6ff1d8eb0 100644 --- a/customize.dist/src/less/cryptpad.less +++ b/customize.dist/src/less/cryptpad.less @@ -297,6 +297,7 @@ body.html { min-height: 450px; margin: auto; //margin-top: 100px; + z-index: 1; font-size: medium; diff --git a/customize.dist/src/less/dropdown.less b/customize.dist/src/less/dropdown.less index 35714a50c..67612cd19 100644 --- a/customize.dist/src/less/dropdown.less +++ b/customize.dist/src/less/dropdown.less @@ -26,7 +26,7 @@ display: none; position: absolute; background-color: #f9f9f9; - min-width: 200px; + min-width: 250px; box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2); z-index: 1000; max-height: 300px; diff --git a/customize.dist/toolbar.css b/customize.dist/toolbar.css index f2caf1d80..eec35777d 100644 --- a/customize.dist/toolbar.css +++ b/customize.dist/toolbar.css @@ -13,7 +13,7 @@ display: none; position: absolute; background-color: #f9f9f9; - min-width: 200px; + min-width: 250px; box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2); z-index: 1000; max-height: 300px; diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 337573e34..059a315cd 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -296,6 +296,7 @@ define(function () { out.table_created = 'Créé le'; out.table_last = 'Dernier accès'; + out.makeAPad = 'Créer un document'; out.button_newpad = 'Nouveau document texte'; out.button_newcode = 'Nouvelle page de code'; out.button_newpoll = 'Nouveau sondage'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 2b7980472..1f81836dc 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -294,6 +294,7 @@ define(function () { out.table_created = 'Created'; out.table_last = 'Last Accessed'; + out.makeAPad = 'Make a pad right now'; out.button_newpad = 'New Rich Text pad'; out.button_newcode = 'New Code pad'; out.button_newpoll = 'New Poll'; From 599e00be21c240cf1965189b545279db63e0318b Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 31 Jan 2017 18:19:34 +0100 Subject: [PATCH 2/2] Remove unused code --- customize.dist/main.css | 8 -------- customize.dist/src/less/topbar.less | 8 -------- 2 files changed, 16 deletions(-) diff --git a/customize.dist/main.css b/customize.dist/main.css index fed721f3f..23f3d0e10 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -450,14 +450,6 @@ font-weight: 500; font-size: 0.75em; color: #558; - /* text-align: center; - min-width: 100px; - font-weight: bold; - height: 70px; - padding: 0 10px; - line-height: 70px; - display: inline-block; - color: @topbar-button-color;*/ } #cryptpadTopBar .right a:hover { text-decoration: none; diff --git a/customize.dist/src/less/topbar.less b/customize.dist/src/less/topbar.less index b08f2ec41..6caf0881c 100644 --- a/customize.dist/src/less/topbar.less +++ b/customize.dist/src/less/topbar.less @@ -54,14 +54,6 @@ text-decoration: none; color: #000; } -/* text-align: center; - min-width: 100px; - font-weight: bold; - height: 70px; - padding: 0 10px; - line-height: 70px; - display: inline-block; - color: @topbar-button-color;*/ } } }