diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 8ef04bea5..df9deb63c 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -70,6 +70,11 @@ define(function () { out.sourceButton = 'VOIR LA SOURCE'; out.sourceButtonTitle = "Quitter le mode présentation"; + out.backgroundButton = 'COULEUR DE FOND'; + out.backgroundButtonTitle = 'Changer la couleur de fond de la présentation'; + out.colorButton = 'COULEUR DU TEXTE'; + out.colorButtonTitle = 'Changer la couleur du texte en mode présentation'; + out.commitButton = 'VALIDER'; out.getViewButton = 'LECTURE SEULE'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 09c044481..d46fb6e5a 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -71,6 +71,11 @@ define(function () { out.sourceButton = 'VIEW SOURCE'; out.sourceButtonTitle = "Leave presentation mode"; + out.backgroundButton = 'BACKGROUND COLOR'; + out.backgroundButtonTitle = 'Change the background color in the presentation'; + out.colorButton = 'TEXT COLOR'; + out.colorButtonTitle = 'Change the text color in presentation mode'; + out.commitButton = 'COMMIT'; out.getViewButton = 'READ-ONLY URL'; diff --git a/www/slide/main.js b/www/slide/main.js index a03fcdf93..f31afc6d5 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -28,6 +28,8 @@ define([ }; var APP = window.APP; + var SLIDE_BACKCOLOR_ID = "cryptpad-backcolor"; + var SLIDE_COLOR_ID = "cryptpad-color"; Cryptpad.styleAlerts(); module.spinner.show(); @@ -156,6 +158,9 @@ define([ } }; + var textColor; + var backColor; + var myData = {}; var myUserName = ''; // My "pretty name" var myID; // My server ID @@ -187,23 +192,34 @@ define([ var initializing = true; + var stringifyInner = function (textValue) { + var obj = { + content: textValue, + metadata: { + users: userList + } + }; + if (!isDefaultTitle()) { + obj.metadata.title = APP.title; + } + if (textColor) { + obj.metadata.color = textColor; + } + if (backColor) { + obj.metadata.backColor = backColor; + } + // stringify the json and send it into chainpad + return stringify(obj); + }; + var onLocal = config.onLocal = function () { if (initializing) { return; } if (readOnly) { return; } editor.save(); - var textValue = canonicalize($textarea.val()); - var obj = {content: textValue}; - // append the userlist to the hyperjson structure - obj.metadata = { - users: userList - }; - if (!isDefaultTitle()) { - obj.metadata.title = APP.title; - } - // stringify the json and send it into chainpad - var shjson = stringify(obj); + var textValue = canonicalize($textarea.val()); + var shjson = stringifyInner(textValue); module.patchText(shjson); Slide.update(textValue); @@ -429,7 +445,41 @@ define([ }); }; + var configureColors = function () { + $back = $('