'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSource.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}',
+ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabTable.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabUtils.js?v={@LAST_UPDATE_TIME}'
{else}
'{@$__wcf->getPath()}js/3rdParty/redactor2/redactor.min.js?v={@LAST_UPDATE_TIME}',
'WoltLabSmiley',
'WoltLabSource',
'WoltLabSpoiler',
+ 'WoltLabTable',
'WoltLabUtils'
],
toolbarFixed: false,
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSource.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}',
+ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabTable.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabUtils.js?v={@LAST_UPDATE_TIME}'
{else}
'{@$__wcf->getPath()}js/3rdParty/redactor2/redactor.min.js?v={@LAST_UPDATE_TIME}',
'WoltLabSmiley',
'WoltLabSource',
'WoltLabSpoiler',
+ 'WoltLabTable',
'WoltLabUtils'
],
toolbarFixed: false,
var mpFormatCollapsed = this.block.formatCollapsed;
this.block.formatCollapsed = (function(tag, attr, value, type) {
var block = this.selection.block();
- if (block && block.nodeName === 'LI') {
- // lists cannot contain other block elements
+ if (block && (block.nodeName === 'LI' || block.nodeName === 'TD')) {
+ // tables/lists cannot contain other block elements
return;
}
--- /dev/null
+$.Redactor.prototype.WoltLabTable = function() {
+ "use strict";
+
+ return {
+ init: function() {
+ this.WoltLabEvent.register('insertedTable', (function() {
+ window.setTimeout((function () {
+ var node = this.selection.block() || this.selection.current();
+ if (node.nodeName === 'TBODY') {
+ // find first <td> and set the caret inside it
+ var td = elBySel('td', node);
+ if (td) {
+ this.caret.end(td);
+ }
+ }
+ }).bind(this), 10);
+ }).bind(this));
+ }
+ }
+};