From: Alexander Ebert Date: Wed, 19 Nov 2014 20:12:49 +0000 (+0100) Subject: Upgraded to Redactor 10.0.5 X-Git-Tag: 2.1.0_Beta_1~222 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ffc1162006f4b0eb32c238bf1cd7b6d6d8e426c7;p=GitHub%2FWoltLab%2FWCF.git Upgraded to Redactor 10.0.5 --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/redactor.js b/wcfsetup/install/files/js/3rdParty/redactor/redactor.js index 4a4d7949a3..41fae965f8 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/redactor.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/redactor.js @@ -1,6 +1,6 @@ /* - Redactor v10.0.4 - Updated: November 10, 2014 + Redactor v10.0.5 + Updated: November 18, 2014 http://imperavi.com/redactor/ @@ -94,7 +94,7 @@ // Functionality $.Redactor = Redactor; - $.Redactor.VERSION = '10.0.4'; + $.Redactor.VERSION = '10.0.5'; $.Redactor.modules = ['alignment', 'autosave', 'block', 'buffer', 'build', 'button', 'caret', 'clean', 'code', 'core', 'dropdown', 'file', 'focus', 'image', 'indent', 'inline', 'insert', 'keydown', 'keyup', @@ -794,7 +794,7 @@ { if (toggleType == 'toggle') this.block.toggle($formatted); else if (toggleType == 'remove') this.block.remove($formatted); - else if (toggleType == 'set') this.block.set2($formatted); + else if (toggleType == 'set') this.block.setForce($formatted); } else this.block.toggle($formatted); @@ -807,6 +807,19 @@ } } }, + setForce: function($el) + { + if (this.block.type == 'class') + { + $el.addClass(this.block.value); + return; + } + else if (this.block.type == 'attr' || this.block.type == 'data') + { + $el.attr(this.block.value.name, this.block.value.value); + return; + } + }, toggle: function($el) { if (this.block.type == 'class') @@ -1435,6 +1448,8 @@ }, onClick: function(e, btnName, type, callback) { + this.button.caretOffset = this.caret.getOffset(); + e.preventDefault(); if (this.utils.browser('msie')) e.returnValue = false; @@ -1470,7 +1485,6 @@ this.observe.buttons(e, btnName); } } - }, get: function(key) { @@ -1793,6 +1807,9 @@ { html = this.clean.savePreCode(html); + // convert script tag + html = html.replace(/]?)>([\w\W]*?)<\/script>/gi, ''); + // replace dollar sign to entity html = html.replace(/\$/g, '$'); html = html.replace(/”/g, '"'); @@ -1814,7 +1831,7 @@ fonts.replaceWith(function() { var $el = $(this); - var span = $('').attr('style', $el.attr('style')); + var $span = $('').attr('style', $el.attr('style')); return $span.append($el.contents()); }); @@ -1852,6 +1869,9 @@ return ''; } + // reconvert script tag + html = html.replace(/