Fixed inserting attachments
authorAlexander Ebert <ebert@woltlab.com>
Sun, 26 Oct 2014 18:35:47 +0000 (19:35 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 26 Oct 2014 18:35:47 +0000 (19:35 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js
wcfsetup/install/files/js/WCF.Attachment.js

index 8694994bd16ab3ce5b077ab4ccea4197b2dd6609..c52fbdcc378cc6e9bcecc0ed75bbd872a3810ab2 100644 (file)
@@ -912,19 +912,19 @@ RedactorPlugins.wbbcode = function() {
                 */
                insertAttachment: function(attachmentID) {
                        attachmentID = parseInt(attachmentID);
-                       var $attachmentUrl = this.getOption('woltlab.attachmentUrl');
+                       var $attachmentUrl = this.wutil.getOption('woltlab.attachmentUrl');
                        var $bbcode = '[attach=' + attachmentID + '][/attach]';
                        
                        var $imageAttachmentIDs = this.wbbcode._getImageAttachmentIDs();
                        
                        if ($attachmentUrl && WCF.inArray(attachmentID, $imageAttachmentIDs)) {
-                               this.insertDynamic(
+                               this.wutil.insertDynamic(
                                        '<img src="' + $attachmentUrl.replace(/987654321/, attachmentID) + '" class="redactorEmbeddedAttachment" data-attachment-id="' + attachmentID + '" />',
                                        $bbcode
                                );
                        }
                        else {
-                               this.insertDynamic($bbcode);
+                               this.wutil.insertDynamic($bbcode);
                        }
                },
                
index 236c5b46170b98f464d8864d8e24c29e8f87b793..13ac4a604828095dac70634e9f3215030704fe5a 100644 (file)
@@ -358,7 +358,7 @@ WCF.Attachment.Upload = WCF.Upload.extend({
                var $attachmentID = (event === null) ? attachmentID : $(event.currentTarget).data('objectID');
                
                if ($.browser.redactor) {
-                       $('#' + this._wysiwygContainerID).redactor('insertAttachment', $attachmentID);
+                       $('#' + this._wysiwygContainerID).redactor('wbbcode.insertAttachment', $attachmentID);
                }
        },