From ee0cf73865bacc3ec29ebd5f86e6307c397cb986 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 30 Mar 2014 19:04:52 +0200 Subject: [PATCH] Improved image handling in Redactor, disabled image resize --- .../js/3rdParty/redactor/plugins/wbbcode.js | 2 +- .../3rdParty/redactor/plugins/wmonkeypatch.js | 77 ++++++++++--------- 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 9f639705a9..7c9365165e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -181,7 +181,7 @@ RedactorPlugins.wbbcode = { html = html.replace(/]*?class="smiley" alt="([^"]+?)".*?>/gi, '$1'); // chrome, ie // [img] - html = html.replace(/]*?src=(["'])([^"']+?)\1 style="float: (left|right)".*?>/gi, "[img='$2',$3][/img]"); + html = html.replace(/]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi, "[img='$2',$3][/img]"); html = html.replace(/]*?src=(["'])([^"']+?)\1.*?>/gi, '[img]$2[/img]'); // [quote] diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 67e166d1d9..cc1678d936 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -50,6 +50,11 @@ RedactorPlugins.wmonkeypatch = { $mpModalInit.call(self, title, content, width, callback); }; + var $mpImageResizeControls = this.imageResizeControls; + this.imageResizeControls = function(image) { + return $mpImageResizeControls.call(self, image).hide(); + }; + this.setOption('modalOpenedCallback', $.proxy(this.modalOpenedCallback, this)); this.modalTemplatesInit(); @@ -114,12 +119,43 @@ RedactorPlugins.wmonkeypatch = { + '
' + '
' + '' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + '' + '
' + '' + '
' ); + this.setOption('modal_image_edit', this.getOption('modal_image').replace( + '', + '' + )); + + this.setOption('modal_link', + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + ); + this.setOption('modal_table', '
' + '
' @@ -148,42 +184,13 @@ RedactorPlugins.wmonkeypatch = { + '' + '' + '', - - modal_image_edit: String() - + '
' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '
' - + '
' - + '' - + '' - + '' - + '
', - + // img edit + // img - modal_link: String() - + '' - + '
' - + '' - + '' - + '
', + // link + + // table modal_video: String() + '
' @@ -274,5 +281,5 @@ RedactorPlugins.wmonkeypatch = { callback.call(this, node); }, this ) ); - }, + } } \ No newline at end of file -- 2.20.1