diff --git a/bower.json b/bower.json index cb8d01f07..24461eae7 100644 --- a/bower.json +++ b/bower.json @@ -43,5 +43,8 @@ "nthen": "^0.1.5", "open-sans-fontface": "^1.4.2", "bootstrap-tokenfield": "^0.12.1" + }, + "resolutions": { + "bootstrap": "v4.0.0-alpha.6" } } diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index e2ea77a02..9cf29d565 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -49,7 +49,7 @@ define(function() { users. */ config.loginSalt = ''; - config.minimum_password_length = 8; + config.minimumPasswordLength = 8; config.badStateTimeout = 30000; diff --git a/customize.dist/src/less2/include/app-noscroll.less b/customize.dist/src/less2/include/app-noscroll.less index 81b1a725c..c66019d61 100644 --- a/customize.dist/src/less2/include/app-noscroll.less +++ b/customize.dist/src/less2/include/app-noscroll.less @@ -1,5 +1,5 @@ // html -.noscroll_main () { +.app-noscroll_main () { height: 100%; width: 100%; padding: 0px; diff --git a/customize.dist/src/less2/include/app-print.less b/customize.dist/src/less2/include/app-print.less new file mode 100644 index 000000000..d25110056 --- /dev/null +++ b/customize.dist/src/less2/include/app-print.less @@ -0,0 +1,46 @@ +.app-print_main () { + // Current scope is + @media print { + height: auto; + max-height: none; + overflow: visible; + display:block; + @page { + margin: 0; + size: landscape; + } + // Slide app + body.cp-app-slide { + display: block; + .CodeMirror, #cme_toolbox { + display: none; + } + * { + visibility: hidden; + height: auto; + max-height: none; + } + .cp-app-slide-viewer #cp-app-slide-print { + display: block; + visibility: visible; + * { + visibility: visible; + } + } + .cp-app-slide-viewer #cp-app-slide-modal { + display: none !important; + } + .cp-app-slide-viewer { + flex: 1 !important; + overflow: visible !important; + } + .cp-toolbar-userlist-drawer { + display: none !important; + } + #cp-app-slide-editor { + height: auto; + display: block; + } + } + } +} diff --git a/customize.dist/src/less2/include/infopages.less b/customize.dist/src/less2/include/infopages.less index 6d9b380ed..f37add54f 100644 --- a/customize.dist/src/less2/include/infopages.less +++ b/customize.dist/src/less2/include/infopages.less @@ -173,7 +173,8 @@ }; } .cp-register-btn { - border: 2px solid #4591C4; + border: 2px solid #4591C4; + display: inline-block; } button:focus { outline: none; @@ -192,21 +193,9 @@ } .cp-register-btn { margin-right: 13px; - margin-left: 83vw; text-align: center; } } -@media (max-width: 687px) { - .cp-register-btn { - margin-left: 75vw; - } -} -@media (max-width: 467px) { - .cp-register-btn { - margin-left: 63vw; - } -} - //footer general styles diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 3afe7a1a8..c623145f6 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -437,12 +437,15 @@ line-height: @toolbar_top-height; margin: 0 10px; .cp-toolbar-title-value { + border: 1px solid transparent; + padding: 5px; font-size: 25px; vertical-align: middle; line-height: 25px; white-space: nowrap; } .cp-toolbar-title-value-page { + border: 1px solid transparent; padding: 0 5px; } .cp-toolbar-title-edit, .cp-toolbar-title-save { @@ -485,8 +488,6 @@ .cp-toolbar-title-editable { overflow: hidden; text-overflow: ellipsis; - border: 1px solid transparent; - padding: 5px; border-collapse: collapse; } input { diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index 9b4f18ffe..7b7f8229a 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -14,10 +14,16 @@ body.cp-page-terms { @import "./pages/page-terms.less"; } // Set the HTML style for the apps which shouldn't have a body scrollbar html.cp-app-noscroll { @import "./include/app-noscroll.less"; - .noscroll_main(); + .app-noscroll_main(); +} +// Set the HTML style for printing slides +html.cp-app-print { + @import "./include/app-print.less"; + .app-print_main(); } body.cp-app-pad { @import "../../../pad/app-pad.less"; } body.cp-app-code { @import "../../../code/app-code.less"; } +body.cp-app-slide { @import "../../../slide/app-slide.less"; } body.cp-app-filepicker { @import "../../../filepicker/app-filepicker.less"; } diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 35beb1f02..faff1ac35 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -129,6 +129,7 @@ define(function () { out.saveTemplatePrompt = "Choisir un titre pour ce modèle"; out.templateSaved = "Modèle enregistré !"; out.selectTemplate = "Sélectionner un modèle ou appuyer sur Échap"; + out.useTemplate = "Vous posséder des modèles pour ce type de pad, souhaitez-vous en utiliser un?"; out.previewButtonTitle = "Afficher ou cacher la prévisualisation de Markdown"; @@ -299,6 +300,7 @@ define(function () { out.contacts_removeHistoryTitle = "Supprimer l'historique du chat"; out.contacts_confirmRemoveHistory = 'Êtes-vous sûr de vouloir supprimer définitivement l\'historique de votre chat ? Les messages ne pourront pas être restaurés.'; out.contacts_removeHistoryServerError = 'Une erreur est survenue lors de la supprimer de l\'historique du chat. Veuillez réessayer plus tard.'; + out.contacts_fetchHistory = "Récupérer l'historique plus ancien"; // File manager @@ -407,6 +409,8 @@ define(function () { out.register_importRecent = "Importer l'historique (Recommendé)"; out.register_acceptTerms = "J'accepte les conditions d'utilisation"; out.register_passwordsDontMatch = "Les mots de passe doivent être identiques!"; + out.register_passwordTooShort = "Les mots de passe doivent contenir au moins {0} caractères."; + out.register_mustAcceptTerms = "Vous devez accepter les conditions d'utilisation."; out.register_mustRememberPass = "Nous ne pouvons pas réinitialiser votre mot de passe si vous l'oubliez. C'est important que vous vous en souveniez! Veuillez cocher la case pour confirmer."; out.register_writtenPassword = "J'ai bien noté mon nom d'utilisateur et mon mot de passe, continuer"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index b72d58ce0..5415ae147 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -131,6 +131,7 @@ define(function () { out.saveTemplatePrompt = "Choose a title for the template"; out.templateSaved = "Template saved!"; out.selectTemplate = "Select a template or press escape"; + out.useTemplate = "You have available templates for that type of pad. Do you want to use one?"; out.previewButtonTitle = "Display or hide the Markdown preview mode"; diff --git a/www/code/app-code.less b/www/code/app-code.less index b3fab41b5..8772a2653 100644 --- a/www/code/app-code.less +++ b/www/code/app-code.less @@ -18,13 +18,14 @@ .CodeMirror { display: inline-block; height: 100%; + min-height: 100%; width: 50%; min-width: 20%; max-width: 80%; resize: horizontal; font-size: initial; } - .CodeMirror.fullPage { + .CodeMirror.cp-app-code-fullpage { //min-width: 100%; max-width: 100%; resize: none; diff --git a/www/code/inner.js b/www/code/inner.js index 721e162aa..488a084e4 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -86,6 +86,39 @@ define([ var isHistoryMode = false; + var setEditable = APP.setEditable = function (bool) { + if (readOnly && bool) { return; } + editor.setOption('readOnly', !bool); + }; + + var Title; + + var config = { + readOnly: readOnly, + transformFunction: JsonOT.validate, + // cryptpad debug logging (default is 1) + // logLevel: 0, + validateContent: function (content) { + try { + JSON.parse(content); + return true; + } catch (e) { + console.log("Failed to parse, rejecting patch"); + return false; + } + } + }; + + var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); }; + + var setHistory = function (bool, update) { + isHistoryMode = bool; + setEditable(!bool); + if (!bool && update) { + config.onRemote(); + } + }; + var $contentContainer = $('#cp-app-code-editor'); var $previewContainer = $('#cp-app-code-preview'); var $preview = $('#cp-app-code-preview-content'); @@ -120,39 +153,6 @@ define([ typeof(useTabs) === 'boolean'? useTabs: false); }; - var setEditable = APP.setEditable = function (bool) { - if (readOnly && bool) { return; } - editor.setOption('readOnly', !bool); - }; - - var Title; - - var config = { - readOnly: readOnly, - transformFunction: JsonOT.validate, - // cryptpad debug logging (default is 1) - // logLevel: 0, - validateContent: function (content) { - try { - JSON.parse(content); - return true; - } catch (e) { - console.log("Failed to parse, rejecting patch"); - return false; - } - } - }; - - var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); }; - - var setHistory = function (bool, update) { - isHistoryMode = bool; - setEditable(!bool); - if (!bool && update) { - config.onRemote(); - } - }; - CommonRealtime.onInfiniteSpinner(function () { setEditable(false); }); setEditable(false); @@ -228,8 +228,8 @@ define([ $codeMirror.removeClass('transition'); }, 500); if (mediaTagModes.indexOf(mode) !== -1) { - APP.$mediaTagButton.show(); - } else { APP.$mediaTagButton.hide(); } + $(APP.$mediaTagButton).show(); + } else { $(APP.$mediaTagButton).hide(); } if (mode === "markdown") { APP.$previewButton.show(); @@ -336,14 +336,14 @@ define([ $previewContainer.toggle(); if ($previewContainer.is(':visible')) { forceDrawPreview(); - $codeMirror.removeClass('fullPage'); - $previewButton.addClass('active'); + $codeMirror.removeClass('cp-ap-code-fullpage'); + $previewButton.addClass('cp-toolbar-button-active'); common.setPadAttribute('previewMode', true, function (e) { if (e) { return console.log(e); } }); } else { - $codeMirror.addClass('fullPage'); - $previewButton.removeClass('active'); + $codeMirror.addClass('cp-app-code-fullpage'); + $previewButton.removeClass('cp-toolbar-button-active'); common.setPadAttribute('previewMode', false, function (e) { if (e) { return console.log(e); } }); @@ -360,28 +360,29 @@ define([ CodeMirror.configureTheme(); } - var fileDialogCfg = { - onSelect: function (data) { - if (data.type === 'file') { - var mt = ''; - editor.replaceSelection(mt); - return; + if (!readOnly) { + var fileDialogCfg = { + onSelect: function (data) { + if (data.type === 'file') { + var mt = ''; + editor.replaceSelection(mt); + return; + } } - } - }; - common.initFilePicker(fileDialogCfg); - APP.$mediaTagButton = $('