Added option to force plain text pasting
authorAlexander Ebert <ebert@woltlab.com>
Fri, 21 Jul 2017 08:36:21 +0000 (10:36 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 21 Jul 2017 08:36:27 +0000 (10:36 +0200)
Closes #2343

com.woltlab.wcf/templates/wysiwyg.tpl
com.woltlab.wcf/userOption.xml
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 7c5e77fa0530ae14ff6ed052dff1399c3cf4274d..df8b7eac98370ade18b18d17dde6df01bbf10f9a 100644 (file)
                                linkSize: 0xBADC0DED, // some random value to disable truncating
                                minHeight: 200,
                                pasteImages: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
+                               pastePlainText: {if !$__wcf->user->userID || $__wcf->user->editorPastePreserveFormatting}true{else}false{/if},
                                plugins: [
                                        // Imperavi
                                        'alignment',
index 3c1d26973ee69f9be68f225d471335a3c8f26ce8..163f34219ace40377ce97a0d206c26e021436837 100644 (file)
                                <defaultvalue>1</defaultvalue>
                                <options>module_user_signature</options>
                        </option>
+                       <option name="editorPastePreserveFormatting">
+                               <categoryname>settings.general.interface</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <editable>3</editable>
+                               <defaultvalue>1</defaultvalue>
+                       </option>
                        
                        <!-- settings.privacy.content -->
                        <option name="canViewOnlineStatus">
index 8f21440e036bd5970c4432a4659c03516891878b..df8b7eac98370ade18b18d17dde6df01bbf10f9a 100644 (file)
@@ -24,6 +24,7 @@
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}',
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFont.js?v={@LAST_UPDATE_TIME}',
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFullscreen.js?v={@LAST_UPDATE_TIME}',
+                       '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabHtml.js?v={@LAST_UPDATE_TIME}',
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabImage.js?v={@LAST_UPDATE_TIME}',
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabInlineCode.js?v={@LAST_UPDATE_TIME}',
                        '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabInsert.js?v={@LAST_UPDATE_TIME}',
@@ -71,6 +72,9 @@
                                'wcf.editor.code.line.description': '{lang}wcf.editor.code.line.description{/lang}',
                                'wcf.editor.code.title': '{lang __literal=true}wcf.editor.code.title{/lang}',
                                
+                               'wcf.editor.html.description': '{lang}wcf.editor.html.description{/lang}',
+                               'wcf.editor.html.title': '{lang}wcf.editor.html.title{/lang}',
+                               
                                'wcf.editor.image.edit': '{lang}wcf.editor.image.edit{/lang}',
                                'wcf.editor.image.insert': '{lang}wcf.editor.image.insert{/lang}',
                                'wcf.editor.image.link': '{lang}wcf.editor.image.link{/lang}',
                                linkSize: 0xBADC0DED, // some random value to disable truncating
                                minHeight: 200,
                                pasteImages: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if},
+                               pastePlainText: {if !$__wcf->user->userID || $__wcf->user->editorPastePreserveFormatting}true{else}false{/if},
                                plugins: [
                                        // Imperavi
                                        'alignment',
                                        'WoltLabDropdown',
                                        {if $__wcf->getBBCodeHandler()->isAvailableBBCode('font')}'WoltLabFont',{/if}
                                        'WoltLabFullscreen',
+                                       {if $__wcf->getBBCodeHandler()->isAvailableBBCode('html')}'WoltLabHtml',{/if}
                                        'WoltLabImage',
                                        'WoltLabInlineCode',
                                        'WoltLabInsert',
index 26587081e391d178de9594d139204e43a76531f0..054557123a82ec086cc1df00952ce596d7a51934 100644 (file)
@@ -3986,6 +3986,8 @@ Benachrichtigungen auf <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language
                <item name="wcf.user.option.googlePlus"><![CDATA[Google+]]></item>
                <item name="wcf.user.option.googlePlus.description"><![CDATA[21-stellige Google-Plus-ID, Google-Plus Benutzername (+Benutzername) oder URL zum Google-Plus-Profil]]></item>
                <item name="wcf.user.option.canWriteProfileComments"><![CDATA[Kann Pinnwand-Kommentare schreiben]]></item>
+               <item name="wcf.user.option.editorPastePreserveFormatting"><![CDATA[Text-Formatierung beim Einfügen in den Editor übernehmen]]></item>
+               <item name="wcf.user.option.editorPastePreserveFormatting.description"><![CDATA[Die Deaktivierung dieser Option erzwingt das Einfügen aus der Zwischenablage in reiner Textform, Formatierungen werden dabei entfernt.]]></item>
                
                <item name="wcf.user.option.searchRadioButtonOption"><![CDATA[Auswahl des Benutzers bei „{lang}wcf.user.option.{$option->optionName}{/lang}“:]]></item>
                <item name="wcf.user.option.searchTextOption"><![CDATA[„{lang}wcf.user.option.{$option->optionName}{/lang}“ enthält:]]></item>
index 212d3b4b20d2bbdaf0a6bb8cd8c347f7a1869be8..093f6817f91a99edf7089f33a194d32e0ad1d62d 100644 (file)
@@ -3979,6 +3979,8 @@ your notifications on <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language}
                <item name="wcf.user.option.googlePlus"><![CDATA[Google+]]></item>
                <item name="wcf.user.option.googlePlus.description"><![CDATA[Enter the 21 digit Google Plus user ID, Google Plus username (+Username), or the URL of your Google Plus profile.]]></item>
                <item name="wcf.user.option.canWriteProfileComments"><![CDATA[Can Write Comments on My Wall]]></item>
+               <item name="wcf.user.option.editorPastePreserveFormatting"><![CDATA[Preserve text formatting when pasting into the editor]]></item>
+               <item name="wcf.user.option.editorPastePreserveFormatting.description"><![CDATA[Disabling this option will force any content to be pasted from clipboard as plain text, stripping all formatting.]]></item>
                
                <item name="wcf.user.option.searchRadioButtonOption"><![CDATA[User’s selection for “{lang}wcf.user.option.{$option->optionName}{/lang}”:]]></item>
                <item name="wcf.user.option.searchTextOption"><![CDATA[“{lang}wcf.user.option.{$option->optionName}{/lang}” contains:]]></item>