}
},
+ _delete: function (event) {
+ event.preventDefault();
+
+ var caretEnd = this._pre.nextElementSibling || this._pre.previousElementSibling;
+ if (caretEnd === null && this._pre.parentNode !== this._editor.core.editor()[0]) {
+ caretEnd = this._pre.parentNode;
+ }
+
+ if (caretEnd === null) {
+ this._editor.code.set('');
+ this._editor.focus.end();
+ }
+ else {
+ elRemove(this._pre);
+ this._editor.caret.end(caretEnd);
+ }
+
+ UiDialog.close(this);
+ },
+
_dialogSetup: function() {
var id = 'redactor-code-' + this._elementId,
+ idButtonDelete = id + '-button-delete',
idButtonSave = id + '-button-save',
idFile = id + '-file',
idHighlighter = id + '-highlighter',
onSetup: (function() {
elById(idButtonSave).addEventListener(WCF_CLICK_EVENT, this._save.bind(this));
+ elById(idButtonDelete).addEventListener(WCF_CLICK_EVENT, this._delete.bind(this));
// set highlighters
var highlighters = '<option value="">' + Language.get('wcf.editor.code.highlighter.detect') + '</option>';
+ '</div>'
+ '<div class="formSubmit">'
+ '<button id="' + idButtonSave + '" class="buttonPrimary">' + Language.get('wcf.global.button.save') + '</button>'
+ + '<button id="' + idButtonDelete + '">' + Language.get('wcf.global.button.delete') + '</button>'
+ '</div>'
};
}
}
},
+ _delete: function (event) {
+ event.preventDefault();
+
+ var caretEnd = this._quote.nextElementSibling || this._quote.previousElementSibling;
+ if (caretEnd === null && this._quote.parentNode !== this._editor.core.editor()[0]) {
+ caretEnd = this._quote.parentNode;
+ }
+
+ if (caretEnd === null) {
+ this._editor.code.set('');
+ this._editor.focus.end();
+ }
+ else {
+ elRemove(this._quote);
+ this._editor.caret.end(caretEnd);
+ }
+
+ UiDialog.close(this);
+ },
+
_dialogSetup: function() {
var id = 'redactor-quote-' + this._elementId,
idAuthor = id + '-author',
+ idButtonDelete = id + '-button-delete',
idButtonSave = id + '-button-save',
idUrl = id + '-url';
onSetup: (function() {
elById(idButtonSave).addEventListener(WCF_CLICK_EVENT, this._save.bind(this));
+ elById(idButtonDelete).addEventListener(WCF_CLICK_EVENT, this._delete.bind(this));
}).bind(this),
onShow: (function() {
+ '</div>'
+ '<div class="formSubmit">'
+ '<button id="' + idButtonSave + '" class="buttonPrimary">' + Language.get('wcf.global.button.save') + '</button>'
+ + '<button id="' + idButtonDelete + '">' + Language.get('wcf.global.button.delete') + '</button>'
+ '</div>'
};
}
}
},
+ _delete: function (event) {
+ event.preventDefault();
+
+ var caretEnd = this._spoiler.nextElementSibling || this._spoiler.previousElementSibling;
+ if (caretEnd === null && this._spoiler.parentNode !== this._editor.core.editor()[0]) {
+ caretEnd = this._spoiler.parentNode;
+ }
+
+ if (caretEnd === null) {
+ this._editor.code.set('');
+ this._editor.focus.end();
+ }
+ else {
+ elRemove(this._spoiler);
+ this._editor.caret.end(caretEnd);
+ }
+
+ UiDialog.close(this);
+ },
+
_dialogSetup: function() {
var id = 'redactor-spoiler-' + this._elementId,
+ idButtonDelete = id + '-button-delete',
idButtonSave = id + '-button-save',
idLabel = id + '-label';
onSetup: (function() {
elById(idButtonSave).addEventListener(WCF_CLICK_EVENT, this._save.bind(this));
+ elById(idButtonDelete).addEventListener(WCF_CLICK_EVENT, this._delete.bind(this));
}).bind(this),
onShow: (function() {
+ '</div>'
+ '<div class="formSubmit">'
+ '<button id="' + idButtonSave + '" class="buttonPrimary">' + Language.get('wcf.global.button.save') + '</button>'
+ + '<button id="' + idButtonDelete + '">' + Language.get('wcf.global.button.delete') + '</button>'
+ '</div>'
};
}