From: Alexander Ebert Date: Tue, 25 Mar 2014 16:37:48 +0000 (+0100) Subject: Added a few helper methods for Redactor X-Git-Tag: 2.1.0_Alpha_1~968 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9200f04bc592bb656cef128f5d4b53e93ba1ddbf;p=GitHub%2FWoltLab%2FWCF.git Added a few helper methods for Redactor --- 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); } };