'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabAutosave.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabBlock.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabButton.js?v={@LAST_UPDATE_TIME}',
+ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCaret.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}',
'WoltLabAlignment',
'WoltLabAttachment',
'WoltLabAutosave',
+ 'WoltLabCaret',
'WoltLabCode',
'WoltLabColor',
'WoltLabDropdown',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabAutosave.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabBlock.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabButton.js?v={@LAST_UPDATE_TIME}',
+ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCaret.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}',
'{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}',
'WoltLabAlignment',
'WoltLabAttachment',
'WoltLabAutosave',
+ 'WoltLabCaret',
'WoltLabCode',
'WoltLabColor',
'WoltLabDropdown',
--- /dev/null
+$.Redactor.prototype.WoltLabCaret = function() {
+ "use strict";
+
+ return {
+ init: function () {
+ var mpAfter = this.caret.after;
+ this.caret.after = (function (node) {
+ node = this.caret.prepare(node);
+
+ if (this.utils.isBlockTag(node.tagName)) {
+ this.WoltLabCaret._addParagraphAfterBlock(node);
+ }
+
+ mpAfter.call(this, node);
+ }).bind(this);
+ },
+
+ _addParagraphAfterBlock: function (block) {
+ var nextElement = block.nextElementSibling;
+ if (nextElement && (nextElement.nodeName === 'P' || this.utils.isBlockTag(nextElement.nodeName))) {
+ // valid target
+ return;
+ }
+
+ nextElement = elCreate('p');
+ nextElement.textContent = '\u200B';
+ block.parentNode.insertBefore(nextElement, block.nextSibling);
+ }
+ };
+};