diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 4cd4f49f4..bd7ff5317 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -92,16 +92,25 @@ define([ ]); } + var button = h('button.navbar-toggler', { + 'type':'button', + /*'data-toggle':'collapse', + 'data-target':'#menuCollapse', + 'aria-controls': 'menuCollapse', + 'aria-expanded':'false', + 'aria-label':'Toggle navigation'*/ + }, h('i.fa.fa-bars ')); + + $(button).click(function () { + if ($('#menuCollapse').is(':visible')) { + return void $('#menuCollapse').slideUp(); + } + $('#menuCollapse').slideDown(); + }); + return h('nav.navbar.navbar-expand-lg', h('a.navbar-brand', { href: '/index.html'}), - h('button.navbar-toggler', { - 'type':'button', - 'data-toggle':'collapse', - 'data-target':'#menuCollapse', - 'aria-controls': 'menuCollapse', - 'aria-expanded':'false', - 'aria-label':'Toggle navigation' - }, h('i.fa.fa-bars ')), + button, h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [ //h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.topbar_whatIsCryptpad), // Moved the FAQ h('a.nav-item.nav-link', { href: '/faq.html'}, Msg.faq_link), diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index 3cf32537e..0d3552450 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -55,9 +55,23 @@ user-select: none; float: none; text-align: left; - font: @dropdown_font; line-height: 1em; + align-items: center; + &:not(.fa) { + font: @dropdown_font; + } + &.fa { + font-size: 18px; + &::before { + width: 40px; + margin-left: -10px; + text-align: center; + } + * { + font: @dropdown_font; + } + } .fa { width: 20px; diff --git a/customize.dist/template.js b/customize.dist/template.js index 5a702a25d..0ee34d407 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -27,8 +27,7 @@ $(function () { window.Tether = function () {}; require([ 'less!/customize/src/less2/main.less', - 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', - '/bower_components/bootstrap/dist/js/bootstrap.bundle.min.js' + 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css' ], function () { $body.append($main); diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 47bce2af8..05845a83c 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -145,6 +145,8 @@ define(function () { out.useTemplate = "Commencer avec un modèle?"; out.useTemplateOK = 'Choisir un modèle (Entrée)'; out.useTemplateCancel = 'Document vierge (Échap)'; + out.template_import = "Importer un modèle"; + out.template_empty = "Aucun modèle disponible"; out.previewButtonTitle = "Afficher ou cacher la prévisualisation de Markdown"; @@ -611,9 +613,6 @@ define(function () { out.pad_showToolbar = "Afficher la barre d'outils"; out.pad_hideToolbar = "Cacher la barre d'outils"; - // general warnings - out.warn_notPinned = "Ce pad n'est stocké dans aucun CryptDrive. Il va expirer après 3 mois d'inactivité. En savoir plus..."; - // markdown toolbar out.mdToolbar_button = "Afficher ou cacher la barre d'outils Markdown"; out.mdToolbar_defaultText = "Votre texte ici"; @@ -952,8 +951,6 @@ define(function () { // Header.html - out.header_france = 'Fait avec amour en France par XWiki SAS'; - out.header_support = ' OpenPaaS-ng'; out.updated_0_header_logoTitle = 'Retourner vers votre CryptDrive'; out.header_logoTitle = out.updated_0_header_logoTitle; out.header_homeTitle = "Aller sur la page d'accueil"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 6ab51d35d..ce2868783 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -146,6 +146,8 @@ define(function () { out.useTemplate = "Start with a template?"; //Would you like to "You have available templates for this type of pad. Do you want to use one?"; out.useTemplateOK = 'Pick a template (Enter)'; out.useTemplateCancel = 'Start fresh (Esc)'; + out.template_import = "Import a template"; + out.template_empty = "No template available"; out.previewButtonTitle = "Display or hide the Markdown preview mode"; @@ -615,9 +617,6 @@ define(function () { out.pad_showToolbar = "Show toolbar"; out.pad_hideToolbar = "Hide toolbar"; - // general warnings - out.warn_notPinned = "This pad is not in anyone's CryptDrive. It will expire after 3 months. Learn more..."; - // markdown toolbar out.mdToolbar_button = "Show or hide the Markdown toolbar"; out.mdToolbar_defaultText = "Your text here"; @@ -996,9 +995,6 @@ define(function () { // Header.html - out.header_france = 'With love from France by XWiki SAS'; - - out.header_support = ' OpenPaaS-ng'; out.updated_0_header_logoTitle = 'Go to your CryptDrive'; out.header_logoTitle = out.updated_0_header_logoTitle; out.header_homeTitle = 'Go to CryptPad homepage'; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 10e00f27f..5383206e5 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -482,13 +482,44 @@ define([ 'class': 'fa fa-upload cp-toolbar-icon-import', title: Messages.importButtonTitle, }).append($('', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton)); - if (callback) { + /*if (data.types) { + // New import button in the toolbar + var importFunction = { + template: function () { + UIElements.openTemplatePicker(common, true); + }, + file: function (cb) { + importContent('text/plain', function (content, file) { + cb(content, file); + }, {accept: data ? data.accept : undefined}) + } + }; + var toImport = []; + Object.keys(data.types).forEach(function (importType) { + if (!importFunction[importType] || !data.types[importType]) { return; } + var option = h('button', importType); + $(option).click(function () { + importFunction[importType](data.types[importType]); + }); + toImport.push(options); + }); + + button.click(common.prepareFeedback(type)); + + if (toImport.length === 1) { + button.click(function () { $(toImport[0]).click(); }); + } else { + Cryptpad.alert(h('p.cp-import-container', toImport)); + } + } + else if (callback) {*/ + // Old import button, used in settings button .click(common.prepareFeedback(type)) .click(importContent('text/plain', function (content, file) { callback(content, file); }, {accept: data ? data.accept : undefined})); - } + //} break; case 'upload': button = $('