From 40a2071e539824c1ef551844565197c73a884c62 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 27 Aug 2014 15:46:27 +0200 Subject: [PATCH] Fixed some minor issues --- .../js/3rdParty/redactor/plugins/wbbcode.js | 4 ++++ .../js/3rdParty/redactor/plugins/wupload.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 984eb850b4..1332c35a64 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -627,6 +627,10 @@ RedactorPlugins.wbbcode = { if ($line.indexOf('<') === 0) { data += $line; + + if (!$line.match(/>$/)) { + data += '
'; + } } else { if (!$line) { diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js index 5cfeb54810..3a80b6acc0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js @@ -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) { -- 2.20.1