Suppress drag&drop indication if unsupported
authorAlexander Ebert <ebert@woltlab.com>
Sun, 25 Dec 2016 10:59:23 +0000 (11:59 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 25 Dec 2016 10:59:23 +0000 (11:59 +0100)
com.woltlab.wcf/templates/messageOptionType.tpl
com.woltlab.wcf/templates/signatureEdit.tpl
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/__boxAddContent.tpl
wcfsetup/install/files/acp/templates/__pageAddContent.tpl
wcfsetup/install/files/acp/templates/messageOptionType.tpl
wcfsetup/install/files/acp/templates/userAdd.tpl
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabAttachment.js
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDragAndDrop.js

index be3559d5a12a001b668294078bd5fd2da5edaf34..086bad30d94c5f67fa0420addc155350dcdacea3 100644 (file)
@@ -1,4 +1,4 @@
-<textarea id="{$option->optionName}" name="values[{$option->optionName}]" cols="40" rows="10"{if $option->required} required{/if}>{$value}</textarea>
+<textarea id="{$option->optionName}" name="values[{$option->optionName}]" cols="40" rows="10"{if $option->required} required{/if} class="wysiwygTextarea" data-disable-attachments="true">{$value}</textarea>
 {include file='wysiwyg' wysiwygSelector=$option->optionName}
 
 <script data-relocate="true">
index a37f96009fe068fd166e9c8aedb7ac80617fe829..91266dfca5e8eac32f307bf30ea69c5674bfebd6 100644 (file)
@@ -28,7 +28,7 @@
                        <dl class="wide{if $errorField == 'text'} formError{/if}">
                                <dt><label for="text">{lang}wcf.user.signature{/lang}</label></dt>
                                <dd>
-                                       <textarea id="text" class="wysiwygTextarea" name="text" rows="20" cols="40">{$text}</textarea>
+                                       <textarea id="text" class="wysiwygTextarea" name="text" rows="20" cols="40" data-disable-attachments="true">{$text}</textarea>
                                        {if $errorField == 'text'}
                                                <small class="innerError">
                                                        {if $errorType == 'empty'}
index 7aec555ddd1c44e87ba32124d30750a0b5f895aa..4b4190dc04693b11c947d4df61c04ae975cbad89 100644 (file)
                                ],
                                toolbarFixed: false,
                                woltlab: {
+                                       attachments: (elDataBool(element, 'disable-attachments') === false),
                                        autosave: autosave,
                                        allowedInlineStyles: allowedInlineStyles,
                                        buttons: buttonOptions,
index f9b79b4245cd42367182dbdac2e3f5b9a3083e15..65fce79177ad87934dfa2d12ab62c2bfc78f6805 100644 (file)
@@ -26,7 +26,7 @@
 {if $boxType == 'text'}
        <textarea name="content[{@$languageID}]" id="content{@$languageID}"
                {if $boxType == 'text'}
-                       class="wysiwygTextarea" data-autosave="com.woltlab.wcf.box{$action|ucfirst}-{if $action == 'edit'}{@$boxID}{else}0{/if}-{@$languageID}"
+                       class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.box{$action|ucfirst}-{if $action == 'edit'}{@$boxID}{else}0{/if}-{@$languageID}"
                {/if}
        >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea>
        {include file='wysiwyg' wysiwygSelector='content'|concat:$languageID}
@@ -34,7 +34,7 @@
        <div dir="ltr">
                <textarea name="content[{@$languageID}]" id="content{@$languageID}"
                        {if $boxType == 'text'}
-                               class="wysiwygTextarea" data-autosave="com.woltlab.wcf.box{$action|ucfirst}-{if $action == 'edit'}{@$boxID}{else}0{/if}-{@$languageID}"
+                               class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.box{$action|ucfirst}-{if $action == 'edit'}{@$boxID}{else}0{/if}-{@$languageID}"
                        {/if}
                >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea>
        </div>
index 15915f4aedb365458376deef74512752aa2f248b..ec596752f1a7f7114c8201157d37003983ccdfcc 100644 (file)
@@ -30,7 +30,7 @@
 {if $pageType == 'text'}
        <textarea name="content[{@$languageID}]" id="{@$__pageContentID}"
                {if $pageType == 'text'}
-                       class="wysiwygTextarea" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}"
+                       class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}"
                {/if}
        >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea>
        
@@ -47,8 +47,8 @@
 {else}
        <div dir="ltr">
                <textarea name="content[{@$languageID}]" id="{@$__pageContentID}"
-                       {if $pageType == 'text'}
-                               class="wysiwygTextarea" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}"
+                       {if $pageType == 'text'}
+                               class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}"
                        {/if}
                >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea>
        </div>
index 4c314f0ca722e66742617bf8c4701d175e4273e0..b81e0bb4f2ba26cf293680cd8c52c5a083736ee8 100644 (file)
@@ -1,2 +1,2 @@
-<textarea id="{$option->optionName}" name="values[{$option->optionName}]" cols="40" rows="10">{$value}</textarea>
+<textarea id="{$option->optionName}" name="values[{$option->optionName}]" cols="40" rows="10" class="wysiwygTextarea" data-disable-attachments="true">{$value}</textarea>
 {include file='wysiwyg' wysiwygSelector=$option->optionName}
index 7148f0b6d3fcee5097a1d99ed56eaa03ac1656cf..3951ea4ea8256c501a2d3ac2d7f2d800a1ce3e98 100644 (file)
                                        <dl>
                                                <dt><label for="signature">{lang}wcf.user.signature{/lang}</label></dt>
                                                <dd>
-                                                       <textarea name="signature" id="signature" cols="40" rows="10">{$signature}</textarea>
+                                                       <textarea name="signature" id="signature" cols="40" rows="10" class="wysiwygTextarea" data-disable-attachments="true">{$signature}</textarea>
                                                        {include file='wysiwyg' wysiwygSelector='signature'}
                                                </dd>
                                        </dl>
index 7aec555ddd1c44e87ba32124d30750a0b5f895aa..4b4190dc04693b11c947d4df61c04ae975cbad89 100644 (file)
                                ],
                                toolbarFixed: false,
                                woltlab: {
+                                       attachments: (elDataBool(element, 'disable-attachments') === false),
                                        autosave: autosave,
                                        allowedInlineStyles: allowedInlineStyles,
                                        buttons: buttonOptions,
index e3833dd8c023d7d7f208fdafd0afcb03ac32a228..3cab79e2b2c8ba249634b83dabb8a69931d03b23 100644 (file)
@@ -3,6 +3,10 @@ $.Redactor.prototype.WoltLabAttachment = function() {
        
        return {
                init: function() {
+                       if (!this.opts.woltlab.attachments) {
+                               return;
+                       }
+                       
                        require(['EventHandler'], (function(EventHandler) {
                                EventHandler.add('com.woltlab.wcf.redactor2', 'insertAttachment_' + this.$element[0].id, this.WoltLabAttachment._insert.bind(this));
                                EventHandler.add('com.woltlab.wcf.redactor2', 'deleteAttachment_' + this.$element[0].id, this.WoltLabAttachment._delete.bind(this));
index 384923ce0a69f7df18fb4795ce2a9a00a4bb9d1f..0410d7da9d5f71c73fbe2d3cadd75d0530feb563 100644 (file)
@@ -3,6 +3,10 @@ $.Redactor.prototype.WoltLabDragAndDrop = function() {
        
        return {
                init: function() {
+                       if (!this.opts.woltlab.attachments) {
+                               return;
+                       }
+                       
                        require(['WoltLabSuite/Core/Ui/Redactor/DragAndDrop'], (function (UiRedactorDragAndDrop) {
                                UiRedactorDragAndDrop.init(this);
                        }).bind(this));