Remove the placeholders in /code and /slide

pull/1/head
yflory 8 years ago
parent 38893fb8e5
commit 2ad9debe58

@ -52,6 +52,7 @@ define([
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
var parsedHash = Cryptpad.parsePadUrl(window.location.href); var parsedHash = Cryptpad.parsePadUrl(window.location.href);
var defaultName = Cryptpad.getDefaultName(parsedHash); var defaultName = Cryptpad.getDefaultName(parsedHash);
var initialState = Messages.codeInitialState;
var editor = module.editor = CMeditor.fromTextArea($textarea[0], { var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
lineNumbers: true, lineNumbers: true,
@ -68,7 +69,7 @@ define([
mode: "javascript", mode: "javascript",
readOnly: true readOnly: true
}); });
editor.setOption('placeholder', Messages.codeInitialState); editor.setValue(Messages.codeInitialState);
var setMode = module.setMode = function (mode, $select) { var setMode = module.setMode = function (mode, $select) {
module.highlightMode = mode; module.highlightMode = mode;
@ -84,8 +85,6 @@ define([
} }
}; };
editor.setValue('');
var setTheme = module.setTheme = (function () { var setTheme = module.setTheme = (function () {
var path = '/common/theme/'; var path = '/common/theme/';
@ -562,7 +561,9 @@ define([
// Update the user list (metadata) from the hyperjson // Update the user list (metadata) from the hyperjson
updateMetadata(userDoc); updateMetadata(userDoc);
editor.setValue(newDoc || ''); if (newDoc) {
editor.setValue(newDoc);
}
if (Cryptpad.initialName && document.title === defaultName) { if (Cryptpad.initialName && document.title === defaultName) {
updateTitle(Cryptpad.initialName); updateTitle(Cryptpad.initialName);

@ -72,6 +72,7 @@ define([
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
var parsedHash = Cryptpad.parsePadUrl(window.location.href); var parsedHash = Cryptpad.parsePadUrl(window.location.href);
var defaultName = Cryptpad.getDefaultName(parsedHash); var defaultName = Cryptpad.getDefaultName(parsedHash);
var initialState = Messages.slideInitialState;
var editor = module.editor = CMeditor.fromTextArea($textarea[0], { var editor = module.editor = CMeditor.fromTextArea($textarea[0], {
lineNumbers: true, lineNumbers: true,
@ -88,7 +89,7 @@ define([
mode: "javascript", mode: "javascript",
readOnly: true readOnly: true
}); });
editor.setOption('placeholder', Messages.slideInitialState); editor.setValue(initialState);
var setMode = module.setMode = function (mode, $select) { var setMode = module.setMode = function (mode, $select) {
module.highlightMode = mode; module.highlightMode = mode;
@ -102,8 +103,6 @@ define([
}; };
setMode('markdown'); setMode('markdown');
editor.setValue('');
var setTheme = module.setTheme = (function () { var setTheme = module.setTheme = (function () {
var path = '/common/theme/'; var path = '/common/theme/';
@ -136,7 +135,7 @@ define([
var $modal = $pad.contents().find('#modal'); var $modal = $pad.contents().find('#modal');
var $content = $pad.contents().find('#content'); 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) { var enterPresentationMode = function (shouldLog) {
Slide.show(true, $textarea.val()); Slide.show(true, $textarea.val());
@ -634,7 +633,7 @@ define([
// Update the user list (metadata) from the hyperjson // Update the user list (metadata) from the hyperjson
updateMetadata(userDoc); updateMetadata(userDoc);
editor.setValue(newDoc || ''); editor.setValue(newDoc || initialState);
Slide.update(newDoc); Slide.update(newDoc);
if (Cryptpad.initialName && APP.title === defaultName) { if (Cryptpad.initialName && APP.title === defaultName) {

Loading…
Cancel
Save