From c932738ce3a3830da03426173cd006c6c1f3992b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 17 Mar 2015 16:07:12 +0100 Subject: [PATCH] Upgraded to Redactor 10.0.9 --- .../files/js/3rdParty/redactor/redactor.js | 237 ++++++++++++++---- .../js/3rdParty/redactor/redactor.min.js | 6 +- 2 files changed, 187 insertions(+), 56 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/redactor.js b/wcfsetup/install/files/js/3rdParty/redactor/redactor.js index ff7dd5e9a4..99e89a5b98 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.8 - Updated: March 10, 2015 + Redactor v10.0.9 + Updated: March 16, 2015 http://imperavi.com/redactor/ @@ -94,7 +94,7 @@ // Functionality $.Redactor = Redactor; - $.Redactor.VERSION = '10.0.8'; + $.Redactor.VERSION = '10.0.9'; $.Redactor.modules = ['alignment', 'autosave', 'block', 'buffer', 'build', 'button', 'caret', 'clean', 'code', 'core', 'dropdown', 'file', 'focus', 'image', 'indent', 'inline', 'insert', 'keydown', 'keyup', @@ -135,6 +135,7 @@ autosaveName: false, autosaveInterval: 60, // seconds autosaveOnChange: false, + autosaveFields: false, linkTooltip: true, linkProtocol: 'http', @@ -323,7 +324,9 @@ underline: 'Underline', alignment: 'Alignment', filename: 'Name (optional)', - edit: 'Edit' + edit: 'Edit', + upload_label: 'Drop file here or ' + } } }; @@ -552,6 +555,7 @@ var data = {}; data['name'] = this.autosave.name; data[this.autosave.name] = this.autosave.source; + data = this.autosave.getHiddenFields(data); // ajax var jsxhr = $.ajax({ @@ -562,6 +566,23 @@ jsxhr.done(this.autosave.success); }, + getHiddenFields: function(data) + { + if (this.opts.autosaveFields === false || typeof this.opts.autosaveFields !== 'object') + { + return data; + } + + $.each(this.opts.autosaveFields, $.proxy(function(k, v) + { + if (v !== null && v.toString().indexOf('#') === 0) v = $(v).val(); + data[k] = v; + + }, this)); + + return data; + + }, success: function(data) { var json; @@ -596,7 +617,7 @@ if (typeof this.formatting[name].data != 'undefined') type = 'data'; else if (typeof this.formatting[name].attr != 'undefined') type = 'attr'; - else if (typeof this.formatting[name].class != 'undefined') type = 'class'; + else if (typeof this.formatting[name]['class'] != 'undefined') type = 'class'; if (typeof this.formatting[name].clear != 'undefined') { @@ -1448,7 +1469,7 @@ // dropdown if (btnObject.dropdown) { - var $dropdown = $('