From 1ec41f4e097908ff6ecfc59de6577693cfee2161 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 4 Jan 2018 17:22:01 +0100 Subject: [PATCH] Ability to pick a background image in slides --- customize.dist/translations/messages.fr.js | 5 ++ customize.dist/translations/messages.js | 5 ++ www/common/sframe-app-framework.js | 4 +- www/filepicker/inner.js | 8 ++- www/slide/app-slide.less | 65 ++++++++++++++++++++ www/slide/inner.js | 70 +++++++++++++++++++++- www/slide/slide.js | 6 +- 7 files changed, 154 insertions(+), 9 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 58babab3f..a79cb382f 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -153,6 +153,11 @@ define(function () { out.printTitle = "Afficher le titre du pad"; out.printCSS = "Personnaliser l'apparence (CSS):"; out.printTransition = "Activer les animations de transition"; + out.printBackground = "Utiliser une image d'arrière-plan"; + out.printBackgroundButton = "Choisir une image"; + out.printBackgroundValue = "Arrière-plan actuel: {0}"; + out.printBackgroundNoValue = "Aucun arrière-plan affiché"; + out.printBackgroundRemove = "Supprimer cet arrière-plan"; out.filePickerButton = "Intégrer un fichier stocké dans CryptDrive"; out.filePicker_close = "Fermer"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index ecc4060ec..1d7fd8b15 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -156,6 +156,11 @@ define(function () { out.printTitle = "Display the pad title"; out.printCSS = "Custom style rules (CSS):"; out.printTransition = "Enable transition animations"; + out.printBackground = "Use a background image"; + out.printBackgroundButton = "Pick an image"; + out.printBackgroundValue = "Current background: {0}"; + out.printBackgroundNoValue = "No background image displayed"; + out.printBackgroundRemove = "Remove this background image"; out.filePickerButton = "Embed a file stored in CryptDrive"; out.filePicker_close = "Close"; diff --git a/www/common/sframe-app-framework.js b/www/common/sframe-app-framework.js index cfb3462c3..9c6f7e4c9 100644 --- a/www/common/sframe-app-framework.js +++ b/www/common/sframe-app-framework.js @@ -368,9 +368,9 @@ define([ if (data.type !== 'file') { console.log('unhandled embed type ' + data.type); return; } var privateDat = cpNfInner.metadataMgr.getPrivateData(); var origin = privateDat.fileHost || privateDat.origin; - var src = origin + data.src; + var src = data.src = origin + data.src; mediaTagEmbedder($('')); + '" data-crypto-key="cryptpad:' + data.key + '">'), data); } }); $embedButton = $('