autosave: false,
buttons: $buttons,
buttonSource: true,
- imageResizable: false,
- removeEmpty: false,
- replaceDivs: false,
- tabifier: false,
-
- {* TODO: possible outdated/deprecated options below *}
- convertDivs: false,
convertImageLinks: false,
- convertLinks: false,
+ convertUrlLinks: false,
convertVideoLinks: false,
direction: '{lang}wcf.global.pageDirection{/lang}',
+ imageResizable: false,
lang: '{@$__wcf->getLanguage()->getFixedLanguageCode()}',
+ maxHeight: 500,
minHeight: 200,
plugins: [ 'wutil', 'wmonkeypatch', 'table', 'wbutton', 'wbbcode', 'wfontcolor', 'wfontfamily', 'wfontsize', 'wupload' ],
- wautosave: {
- active: (/* DEBUG ONLY $autosave*/false) ? true : false,
- key: ($autosave) ? '{@$__wcf->getAutosavePrefix()}_' + $autosave : '',
- saveOnInit: {if !$errorField|empty}true{else}false{/if}
- },
- wOriginalValue: $textarea.val()
+ removeEmpty: false,
+ replaceDivs: false,
+ tabifier: false,
+ woltlab: {
+ autosave: {
+ active: ($autosave) ? true : false,
+ key: ($autosave) ? '{@$__wcf->getAutosavePrefix()}_' + $autosave : '',
+ saveOnInit: {if !$errorField|empty}true{else}false{/if}
+ },
+ originalValue: $textarea.val()
+ }
};
{if MODULE_ATTACHMENT && !$attachmentHandler|empty && $attachmentHandler->canUpload()}
$config.plugins.push('wupload');
- $config.wAttachmentUrl = '{link controller='Attachment' id=987654321}thumbnail=1{/link}';
+ $config.woltlab.attachmentUrl = '{link controller='Attachment' id=987654321}thumbnail=1{/link}';
{/if}
{event name='javascriptInit'}
this.opts.initCallback = $.proxy(function() {
// use stored editor contents
- var $content = $.trim(this.wutil.getOption('wOriginalValue'));
+ var $content = $.trim(this.wutil.getOption('woltlab.originalValue'));
if ($content.length) {
this.wutil.replaceText($content);
}
- delete this.opts.wOriginalValue;
+ delete this.opts.woltlab.originalValue;
$(document).trigger('resize');
}, this);
return $mpCleanOnSync.call(self, html);
};
- if (this.wutil.getOption('wAutosaveOnce')) {
+ if (this.wutil.getOption('woltlab.autosaveOnce')) {
this.wutil._saveTextToStorage();
- delete this.opts.wAutosaveOnce;
+ delete this.opts.woltlab.autosaveOnce;
}
// we do not support table heads
});
// attachments
- var $attachmentUrl = this.wutil.getOption('wAttachmentUrl');
+ var $attachmentUrl = this.wutil.getOption('woltlab.attachmentUrl');
if ($attachmentUrl) {
var $imageAttachmentIDs = this.wbbcode._getImageAttachmentIDs();
*/
insertAttachment: function(attachmentID) {
attachmentID = parseInt(attachmentID);
- var $attachmentUrl = this.getOption('wAttachmentUrl');
+ var $attachmentUrl = this.getOption('woltlab.attachmentUrl');
var $bbcode = '[attach=' + attachmentID + '][/attach]';
var $imageAttachmentIDs = this.wbbcode._getImageAttachmentIDs();
*/
_getImageAttachmentIDs: function() {
// WCF.Attachment.Upload may have no been initialized yet, fallback to static data
- var $imageAttachmentIDs = this.wutil.getOption('wAttachmentImageIDs') || [ ];
+ var $imageAttachmentIDs = this.wutil.getOption('woltlab.attachmentImageIDs') || [ ];
if ($imageAttachmentIDs.length) {
delete this.opts.wAttachmentImageIDs;
// convert HTML to BBCode upon submit
this.$textarea.parents('form').submit($.proxy(this.wutil.submit, this));
- if (this.wutil.getOption('wautosave').active) {
+ if (this.wutil.getOption('woltlab.autosave').active) {
this.wutil.autosaveEnable();
- if (this.wutil.getOption('wautosave').saveOnInit || this.$textarea.data('saveOnInit')) {
- this.wutil.setOption('wAutosaveOnce', true);
+ if (this.wutil.getOption('woltlab.autosave').saveOnInit || this.$textarea.data('saveOnInit')) {
+ this.wutil.setOption('woltlab.autosaveOnce', true);
}
else {
this.wutil.autosaveRestore();
* @param mixed value
*/
setOption: function(key, value) {
- this.opts[key] = value;
+ if (key.indexOf('.') !== -1) {
+ key = key.split('.', 2);
+ this.opts[key[0]][key[1]] = value;
+ }
+ else {
+ this.opts[key] = value;
+ }
},
/**
* @return mixed
*/
getOption: function(key) {
- if (this.opts[key]) {
+ if (key.indexOf('.') !== -1) {
+ key = key.split('.', 2);
+ if (this.opts[key[0]][key[1]]) {
+ return this.opts[key[0]][key[1]];
+ }
+ }
+ else if (this.opts[key]) {
return this.opts[key];
}
* @param string key
*/
autosaveEnable: function(key) {
- if (!this.wutil.getOption('wautosave').active) {
- this.wutil.setOption('wautosave', {
+ if (!this.wutil.getOption('woltlab.autosave').active) {
+ this.wutil.setOption('woltlab.autosave', {
active: true,
key: key
});
}
- if (this._autosaveWorker === null) {
- this._autosaveWorker = new WCF.PeriodicalExecuter($.proxy(this._saveTextToStorage, this), 60 * 1000);
+ if (this.wutil._autosaveWorker === null) {
+ this.wutil._autosaveWorker = new WCF.PeriodicalExecuter($.proxy(this.wutil._saveTextToStorage, this), 60 * 1000);
}
return true;
* Saves current editor text to local browser storage.
*/
_saveTextToStorage: function() {
- localStorage.setItem(this.getOption('wautosave').key, this.getText());
+ localStorage.setItem(this.wutil.getOption('woltlab.autosave').key, this.wutil.getText());
},
/**
* Disables automatic saving.
*/
autosaveDisable: function() {
- if (!this.getOption('wautosave').active) {
+ if (!this.getOption('woltlab.autosave').active) {
return false;
}
- this._autosaveWorker.stop();
- this._autosaveWorker = null;
+ this.wutil._autosaveWorker.stop();
+ this.wutil._autosaveWorker = null;
- this.setOption('wautosave', {
+ this.wutil.setOption('woltlab.autosave', {
active: false,
key: ''
});
* @param string key
*/
autosavePurge: function() {
- localStorage.removeItem(this.getOption('wautosave').key);
+ localStorage.removeItem(this.wutil.getOption('woltlab.autosave').key);
},
/**
* Attempts to restore a saved text.
*/
autosaveRestore: function() {
- var $options = this.wutil.getOption('wautosave');
+ var $options = this.wutil.getOption('woltlab.autosave');
var $text = localStorage.getItem($options.key);
if ($text !== null) {
if (this.wutil.inWysiwygMode()) {
- this.wutil.setOption('wOriginalValue', $text);
+ this.wutil.setOption('woltlab.originalValue', $text);
}
else {
this.$textarea.val($text);