From c6c30725b844a1c3bfda2fbb10b9ad05e264abef Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 30 Aug 2016 13:21:00 +0200 Subject: [PATCH] Adjust default content of empty editor for iOS --- com.woltlab.wcf/templates/wysiwyg.tpl | 6 +++++- wcfsetup/install/files/acp/templates/wysiwyg.tpl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index b4a15e2d09..b8a52b2ad4 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -46,7 +46,7 @@ {event name='redactorJavaScript'} ], function () { - require(['Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Language, UiRedactorAutosave, UiRedactorMetacode) { + require(['Environment', 'Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Environment, Language, UiRedactorAutosave, UiRedactorMetacode) { Language.addObject({ 'wcf.editor.code.edit': '{lang}wcf.editor.code.edit{/lang}', 'wcf.editor.code.file': '{lang}wcf.editor.code.file{/lang}', @@ -223,6 +223,10 @@ config.callbacks.init = function() { // slight delay to allow Redactor to initialize itself window.setTimeout(function() { + if (content === '' && Environment.platform() === 'ios') { + content = '


'; + } + $(element).redactor('code.set', content); }, 10); }; diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index b4a15e2d09..b8a52b2ad4 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -46,7 +46,7 @@ {event name='redactorJavaScript'} ], function () { - require(['Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Language, UiRedactorAutosave, UiRedactorMetacode) { + require(['Environment', 'Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Environment, Language, UiRedactorAutosave, UiRedactorMetacode) { Language.addObject({ 'wcf.editor.code.edit': '{lang}wcf.editor.code.edit{/lang}', 'wcf.editor.code.file': '{lang}wcf.editor.code.file{/lang}', @@ -223,6 +223,10 @@ config.callbacks.init = function() { // slight delay to allow Redactor to initialize itself window.setTimeout(function() { + if (content === '' && Environment.platform() === 'ios') { + content = '


'; + } + $(element).redactor('code.set', content); }, 10); }; -- 2.20.1