Fixed some minor issues
authorAlexander Ebert <ebert@woltlab.com>
Wed, 27 Aug 2014 13:46:27 +0000 (15:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 27 Aug 2014 13:46:27 +0000 (15:46 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js

index 984eb850b4c9c605733c07acc9e3fe39f75b4c32..1332c35a640381e0f51eb17f0db331225a633970 100644 (file)
@@ -627,6 +627,10 @@ RedactorPlugins.wbbcode = {
                        
                        if ($line.indexOf('<') === 0) {
                                data += $line;
+                               
+                               if (!$line.match(/>$/)) {
+                                       data += '<br>';
+                               }
                        }
                        else {
                                if (!$line) {
index 5cfeb54810ddb528225a91de5321e6e58a7efeaa..3a80b6acc07bd2813e237fe08f595c25c001d80a 100644 (file)
@@ -12,6 +12,7 @@ RedactorPlugins.wupload = {
        _wUploadDropArea: { },
        _timer: null,
        _isDragging: false,
+       _isFile: false,
        
        /**
         * Initializes the RedactorPlugins.wupload plugin.
@@ -49,9 +50,12 @@ RedactorPlugins.wupload = {
                
                // IE and WebKit set 'Files', Firefox sets 'application/x-moz-file' for files being dragged
                if (event.dataTransfer.types[0] !== 'Files' && event.dataTransfer.types[0] !== 'application/x-moz-file') {
+                       this._isFile = false;
+                       
                        return;
                }
                
+               this._isFile = true;
                event.preventDefault();
                
                if (!this._isDragging) {
@@ -96,6 +100,10 @@ RedactorPlugins.wupload = {
         * @param       string          containerID
         */
        _revertDropArea: function(event, containerID) {
+               if (!this._isFile) {
+                       return;
+               }
+               
                var $containerID = containerID || this.$source.wcfIdentify();
                this._wUploadDropArea[$containerID].removeClass('active').text(WCF.Language.get('wcf.attachment.dragAndDrop.dropHere'));
                
@@ -111,6 +119,10 @@ RedactorPlugins.wupload = {
         * a delay of 100ms before the dragging will be checked again to prevent flicker.
         */
        _dragLeave: function() {
+               if (!this._isDragging || !this._isFile) {
+                       return;
+               }
+               
                if (this._timer === null) {
                        var self = this;
                        this._timer = new WCF.PeriodicalExecuter(function(pe) {
@@ -134,6 +146,10 @@ RedactorPlugins.wupload = {
         * @param       object          event
         */
        _drop: function(event) {
+               if (!this._isFile) {
+                       return;
+               }
+               
                event = event.originalEvent || event;
                
                if (event.dataTransfer && event.dataTransfer.files.length == 1) {