From 9200f04bc592bb656cef128f5d4b53e93ba1ddbf Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 25 Mar 2014 17:37:48 +0100 Subject: [PATCH] Added a few helper methods for Redactor --- .../js/3rdParty/redactor/plugins/wutil.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 8ac2ef4fb0..a3aface7a7 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -31,5 +31,30 @@ RedactorPlugins.wutil = { this.$source.val($content); return true; + }, + + /** + * Sets an option value after initialization. + */ + setOption: function(key, value) { + this.opts[key] = value; + }, + + /** + * Returns true if editor is in source mode. + * + * @return boolean + */ + inPlainMode: function() { + return !this.opts.visual; + }, + + /** + * Returns true if editor is in WYSIWYG mode. + * + * @return boolean + */ + inWysiwygMode: function() { + return (this.opts.visual); } }; -- 2.20.1