From 2ad9debe580dd61cfb12b22c60d6c73724b132d7 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 27 Feb 2017 11:45:23 +0100 Subject: [PATCH 1/5] Remove the placeholders in /code and /slide --- www/code/main.js | 9 +++++---- www/slide/main.js | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/www/code/main.js b/www/code/main.js index dff4be7dc..5ece7a208 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -52,6 +52,7 @@ define([ var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); var parsedHash = Cryptpad.parsePadUrl(window.location.href); var defaultName = Cryptpad.getDefaultName(parsedHash); + var initialState = Messages.codeInitialState; var editor = module.editor = CMeditor.fromTextArea($textarea[0], { lineNumbers: true, @@ -68,7 +69,7 @@ define([ mode: "javascript", readOnly: true }); - editor.setOption('placeholder', Messages.codeInitialState); + editor.setValue(Messages.codeInitialState); var setMode = module.setMode = function (mode, $select) { module.highlightMode = mode; @@ -84,8 +85,6 @@ define([ } }; - editor.setValue(''); - var setTheme = module.setTheme = (function () { var path = '/common/theme/'; @@ -562,7 +561,9 @@ define([ // Update the user list (metadata) from the hyperjson updateMetadata(userDoc); - editor.setValue(newDoc || ''); + if (newDoc) { + editor.setValue(newDoc); + } if (Cryptpad.initialName && document.title === defaultName) { updateTitle(Cryptpad.initialName); diff --git a/www/slide/main.js b/www/slide/main.js index cefcf0f26..86486227d 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -72,6 +72,7 @@ define([ var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); var parsedHash = Cryptpad.parsePadUrl(window.location.href); var defaultName = Cryptpad.getDefaultName(parsedHash); + var initialState = Messages.slideInitialState; var editor = module.editor = CMeditor.fromTextArea($textarea[0], { lineNumbers: true, @@ -88,7 +89,7 @@ define([ mode: "javascript", readOnly: true }); - editor.setOption('placeholder', Messages.slideInitialState); + editor.setValue(initialState); var setMode = module.setMode = function (mode, $select) { module.highlightMode = mode; @@ -102,8 +103,6 @@ define([ }; setMode('markdown'); - editor.setValue(''); - var setTheme = module.setTheme = (function () { var path = '/common/theme/'; @@ -136,7 +135,7 @@ define([ var $modal = $pad.contents().find('#modal'); var $content = $pad.contents().find('#content'); - Slide.setModal($modal, $content, $pad, ifrw, Messages.slideInitialState); + Slide.setModal($modal, $content, $pad, ifrw, initialState); var enterPresentationMode = function (shouldLog) { Slide.show(true, $textarea.val()); @@ -634,7 +633,7 @@ define([ // Update the user list (metadata) from the hyperjson updateMetadata(userDoc); - editor.setValue(newDoc || ''); + editor.setValue(newDoc || initialState); Slide.update(newDoc); if (Cryptpad.initialName && APP.title === defaultName) { From fadddb297cced2abe65685a588bb01367ec9640e Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 27 Feb 2017 12:41:29 +0100 Subject: [PATCH 2/5] Readonly mode in /pad had contenteditable set to true --- www/pad/inner.html | 1 - www/pad/main.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/www/pad/inner.html b/www/pad/inner.html index 557e813ab..9d649f85e 100644 --- a/www/pad/inner.html +++ b/www/pad/inner.html @@ -4,7 +4,6 @@ -