From f94db938970831680b8d05584fcd237fdea5c7db Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 10 Mar 2017 16:46:36 +0100 Subject: [PATCH] Improve the slides layout in print mode --- customize.dist/translations/messages.fr.js | 8 ++ customize.dist/translations/messages.js | 10 ++- www/slide/index.html | 12 +-- www/slide/main.js | 91 +++++++++++++++++++--- www/slide/slide.css | 75 +++++++++++++----- www/slide/slide.js | 6 +- www/slide/slide.less | 78 ++++++++++++++----- 7 files changed, 222 insertions(+), 58 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 03c459d47..7f2117c7d 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -77,6 +77,14 @@ define(function () { out.backgroundButtonTitle = 'Changer la couleur de fond de la présentation'; out.colorButtonTitle = 'Changer la couleur du texte en mode présentation'; + out.printButton = "Imprimer"; + out.printButtonTitle = "Imprimer votre présentation ou l'enregistrer au format PDF"; + out.printOptions = "Options d'impression"; + out.printSlideNumber = "Afficher le numéro des slides"; + out.printDate = "Afficher la date"; + out.printTitle = "Afficher le titre du pad"; + out.printCSS = "Personnaliser l'apparence (CSS):"; + out.editShare = "Lien d'édition"; out.editShareTitle = "Copier le lien d'édition dans le presse-papiers"; out.editOpen = "Éditer dans un nouvel onglet"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 59b6124a3..73c38d979 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -79,6 +79,14 @@ define(function () { out.backgroundButtonTitle = 'Change the background color in the presentation'; out.colorButtonTitle = 'Change the text color in presentation mode'; + out.printButton = "Print"; + out.printButtonTitle = "Print your slides or export them as a PDF file"; + out.printOptions = "Print options"; + out.printSlideNumber = "Display the slide number"; + out.printDate = "Display the date"; + out.printTitle = "Display the pad title"; + out.printCSS = "Custom style rules (CSS):"; + out.editShare = "Editing link"; out.editShareTitle = "Copy the editing link to clipboard"; out.editOpen = "Open editing link in a new tab"; @@ -94,7 +102,7 @@ define(function () { out.okButton = 'OK (enter)'; - out.cancel = "Cancel"; // Not used? + out.cancel = "Cancel"; out.cancelButton = 'Cancel (esc)'; // Polls diff --git a/www/slide/index.html b/www/slide/index.html index 15ccd6c6f..7c25c22b4 100644 --- a/www/slide/index.html +++ b/www/slide/index.html @@ -35,19 +35,21 @@ } /* We use !important here to override the 96% set to the element in DecorateToolbar.js when we enter fullscreen mode. It allows us to avoid changing the iframe's size in JS */ - #pad-iframe.fullscreen { + body #pad-iframe.fullscreen { top: 0px; - height: 100% !important; + height: 100%; } - #iframe-container.fullscreen { + body #iframe-container.fullscreen { top: 0px; - height: 100% !important; + height: 100%; } + +
- +
diff --git a/www/slide/main.js b/www/slide/main.js index 46908dfa3..e11250ae0 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -412,6 +412,80 @@ define([ onLocal(); }; + var createPrintDialog = function () { + var printOptions = { + title: true, + slide: true, + date: true + }; + + var $container = $('
'); + var $container2 = $('
').appendTo($container); + var $div = $('
').appendTo($container2); + var $p = $('

', {'class': 'msg'}).appendTo($div); + $('').text(Messages.printOptions).appendTo($p); + $p.append($('
')); + // Slide number + $('', {type: 'checkbox', id: 'checkNumber', checked: 'checked'}).on('change', function () { + var c = this.checked; + console.log(c); + printOptions.slide = c; + }).appendTo($p).css('width', 'auto'); + $('