Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sun, 12 Nov 2017 20:16:04 +0000 (21:16 +0100)
committerwoltlab.com <woltlab@woltlab.com>
Sun, 12 Nov 2017 20:16:04 +0000 (21:16 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/redactor.combined.min.js

index 7c9e96892ddcda45da29b164a6785187710f9061..d9c3b4bb4ce0c6a4e846e7f3da60193f39baa2c4 100644 (file)
@@ -63,7 +63,7 @@ i.append(t(this).attr("name"),t(this).val())}),i},appendForms:function(e,i){if(!
 (function (window, undefined) { $.Redactor.prototype.WoltLabInsert=function(){"use strict";return{init:function(){var e=this.opts.woltlab.placeholderCallback,t=this.insert.html;this.insert.html=function(o,r){e&&(e=e());var n=window.getSelection();if(n.rangeCount&&"IMG"===n.anchorNode.nodeName&&this.caret.after(n.anchorNode),this.placeholder.hide(),this.core.editor().focus(),this.detect.isFirefox()){var i=n.anchorNode.nodeType===Node.TEXT_NODE?n.anchorNode.parentNode:n.anchorNode;null===i.closest(".redactor-layer")&&(this.selection.restore(),i=n.anchorNode.nodeType===Node.TEXT_NODE?n.anchorNode.parentNode:n.anchorNode,null===i.closest(".redactor-layer")&&(this.WoltLabCaret.endOfEditor(),this.selection.save()))}var a=this.selection.block(),l=""===this.$editor[0].innerHTML.replace(/<\/?p>/g,"").replace(/<br>/g,"").replace(/\u200B/g,"").trim();if(t.call(this,o,r),l&&(a=this.$editor[0].firstElementChild),a&&"P"===a.nodeName&&a.nextElementSibling){var c=!1;0===a.childElementCount&&""===a.textContent.replace(/\u200B/g,"").trim()?c=!0:1===a.childElementCount&&"<br>"===a.innerHTML&&(c=!0),c&&elRemove(a)}n.rangeCount&&"IMG"===n.anchorNode.nodeName&&this.caret.after(n.anchorNode)}.bind(this);var o=this.insert.text;this.insert.text=function(t){e&&(e=e()),o.call(this,t)}.bind(this)}}}; })(this);
 
 // plugins/WoltLabKeydown.js
-(function (window, undefined) { $.Redactor.prototype.WoltLabKeydown=function(){"use strict";var e=[];return{init:function(){var e=window.getSelection(),t=this.keydown.init;this.keydown.init=function(i){var n;if(this.detect.isFirefox()&&e.isCollapsed&&i.which===this.keyCode.BACKSPACE&&(n=e.anchorNode,n.nodeType===Node.ELEMENT_NODE&&e.anchorOffset>0&&(n=n.childNodes[e.anchorOffset-1]),n.nodeType===Node.TEXT_NODE&&"​"===n.textContent)){for(var o=[],r=n;r=r.previousSibling;){if(r.nodeType===Node.ELEMENT_NODE){"IMG"!==r.nodeName&&(o=[]);break}if(r.nodeType===Node.TEXT_NODE){var s=r.textContent;if(""!==s&&"​"!==s){o=[];break}o.push(r)}}o.length&&o.forEach(elRemove)}if((i.originalEvent.which===this.keyCode.BACKSPACE||i.originalEvent.which===this.keyCode.DELETE)&&e.isCollapsed){var l=this.selection.block();if("P"===l.nodeName){if(this.list.combineAfterAndBefore(l))return void i.originalEvent.preventDefault();if(this.utils.isEmpty(l.innerHTML)&&l.previousElementSibling!==l.nextElementSibling){var a=null,d=null;return i.originalEvent.which===this.keyCode.BACKSPACE?null===l.previousElementSibling?d=l.nextElementSibling:a=l.previousElementSibling:null===l.nextElementSibling?a=l.previousElementSibling:d=l.nextElementSibling,elRemove(l),null===d?("OL"!==a.nodeName&&"UL"!==a.nodeName||(a=a.lastElementChild),this.caret.end(a)):("OL"!==d.nodeName&&"UL"!==d.nodeName||(d=d.firstElementChild),this.caret.start(d)),void i.originalEvent.preventDefault()}}}if(!(!1===t.call(this,i)||i.originalEvent.defaultPrevented||(i=i.originalEvent,39!==i.which||i.ctrlKey||i.shiftKey||i.metaKey||i.altKey))){if(!e.isCollapsed)return;var h=e.anchorNode;if(h.nodeType!==Node.TEXT_NODE||e.getRangeAt(0).startOffset!==h.textContent.length)return;var c=h.parentNode;if("KBD"!==c.nodeName)return;var f=!0;for(n=c;n&&n!==this.core.editor()[0];){if(null!==n.nextSibling){for(;n.nextSibling&&n.nextSibling.nodeType===Node.TEXT_NODE&&0===n.nextSibling.textContent.length;)n.parentNode.removeChild(n.nextSibling);if(n.nextSibling&&"BR"!==n.nextSibling.nodeName||null!==n.nextSibling.nextSibling){f=!1;break}}n=n.parentNode}f&&c.parentNode.insertBefore(document.createTextNode("​"),c.nextSibling)}}.bind(this);var i=window.navigator.userAgent.toLowerCase();-1!==i.indexOf("linux")&&-1!==i.indexOf("android")&&-1!==i.indexOf("chrome")&&(this.keydown.checkEvents=function(){this.core.addEvent(!1)}.bind(this)),this.core.editor().off("keydown.redactor"),this.core.editor().on("keydown.redactor",this.keydown.init.bind(this)),this.keydown.onArrowDown=function(){for(var e,t,i=this.WoltLabKeydown._getBlocks(),n=0;n<i.length;n++)if(t=i[n]){if(!this.utils.isEndOfElement(t))continue;if(null!==(e=t.nextElementSibling)&&"P"===e.nodeName)break;return void this.keydown.insertAfterLastElement(t)}}.bind(this),this.keydown.onArrowUp=function(){for(var e,t,i=this.WoltLabKeydown._getBlocks(),n=0;n<i.length;n++)if(t=i[n]){if(!this.utils.isStartOfElement())break;if(null!==(e=t.previousElementSibling)&&"P"!==e.nodeName){var o=$(this.opts.emptyHtml)[0];t.parentNode.insertBefore(o,t),this.caret.end(o);break}return void this.keydown.insertBeforeFirstElement(t)}}.bind(this);var n=function(e){if(!1===this.core.callback("enter",e))return e.preventDefault(),!1;if(this.keydown.blockquote&&!0===this.keydown.exitFromBlockquote(e))return!1;if(this.keydown.pre)return this.keydown.insertNewLine(e);if(this.keydown.blockquote||this.keydown.figcaption)return this.keydown.insertBreakLine(e);if(this.keydown.figure)setTimeout($.proxy(function(){this.keydown.replaceToParagraph("FIGURE")},this),1);else if(this.keydown.block){if(setTimeout($.proxy(function(){this.keydown.replaceToParagraph("DIV")},this),1),"LI"===this.keydown.block.tagName){var t=this.selection.current(),i=elClosest(t,"li");this.utils.isRedactorParent(i)&&this.utils.isEmpty(i.innerHTML)&&null===i.nextElementSibling&&(i.innerHTML="")}}else if(!this.keydown.block)return this.keydown.insertParagraph(e);return this.detect.isFirefox()&&this.utils.isInline(this.keydown.parent)?(this.keydown.insertBreakLine(e),void setTimeout(function(){for(var e=this.selection.block(),t=this.selection.inline();t&&t!==e;){if("A"===t.nodeName){var i=!1;if(0===t.childNodes.length?i=!0:""===t.textContent.replace(/\u200B/g,"").trim()&&(i=!0,elBySelAll("*",t,function(e){"SPAN"!==e.nodeName&&(i=!1)})),i){for(;t.childNodes.length;)t.parentNode.insertBefore(t.childNodes[0],t);elRemove(t);break}}t=t.parentNode}}.bind(this),1)):void 0}.bind(this);this.keydown.onEnter=function(e){var t=this.keydown.blockquote;t&&(this.keydown.blockquote=!1);var i=n.call(this,e);return t&&(this.keydown.blockquote=t),i}.bind(this),this.keydown.replaceToParagraph=function(e){var t=this.selection.block(),i=t.innerHTML.replace(/<br\s?\/?>/gi,"");if(t.tagName===e&&this.utils.isEmpty(i)&&!$(t).hasClass("redactor-in")){var n=document.createElement("p");$(t).replaceWith(n);var o=document.createRange();o.setStart(n,0);var r=document.createTextNode("​");o.insertNode(r),o.setStartAfter(r),o.collapse(!0);var s=window.getSelection();return s.removeAllRanges(),s.addRange(o),!1}"P"===t.tagName&&$(t).removeAttr("style")}.bind(this),this.keydown.onShiftEnter=function(e){return this.buffer.set(),this.keydown.pre?this.keydown.insertNewLine(e):this.insert.raw("<br>​")}.bind(this);var o=this.keydown.onTab;this.keydown.onTab=function(e,t){return!this.keydown.pre&&0===$(this.selection.current()).closest("ul, ol",this.core.editor()[0]).length||o.call(this,e,t)}.bind(this);var r=this.keydown.formatEmpty;this.keydown.formatEmpty=function(e){for(var t,i=this.$editor[0],n=0,o=i.childElementCount;n<o;n++)if(t=i.children[n],"P"!==t.nodeName&&this.utils.isBlockTag(t.nodeName))return;return r.call(this,e)}.bind(this),require(["Core","Environment"],function(e,t){if("desktop"===t.platform()){var i=this.$editor[0].closest("form, .message");if(null!==i){var n=elBySel(".formSubmit",i);if(null!==n){var o=elBySel('input[type="submit"], button[data-type="save"], button[accesskey="s"]',n);o&&(o.removeAttribute("accesskey"),this.WoltLabEvent.register("keydown",function(t){if(83===t.event.which){var i=!1;window.navigator.platform.match(/^Mac/)?t.event.ctrlKey&&t.event.altKey&&(i=!0):t.event.altKey&&!t.event.ctrlKey&&(i=!0),i&&(t.cancel=!0,"function"==typeof o.click?o.click():e.triggerEvent(o,WCF_CLICK_EVENT))}}.bind(this)))}}}}.bind(this)),this.WoltLabKeydown._handleBackspaceAndDelete()},register:function(t){-1===e.indexOf(t)&&e.push(t)},_getBlocks:function(){for(var t=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],i=0,n=e.length;i<n;i++)t.push(this.utils.isTag(this.keydown.current,e[i]));return t},_handleBackspaceAndDelete:function(){var e=function(e){return null===elBySel("img",e)&&""===e.textContent.replace(/\u200B/g,"").trim()},t=function(t){var i,n=this.selection.block();if(n)if("TD"===n.nodeName){var o=n.innerHTML;"​"===o?t.preventDefault():""===o&&(t.preventDefault(),n.innerHTML="​")}else if(-1!==n.nodeName.indexOf("-")&&e(n))i=n.parentNode,i.insertBefore(this.marker.get(),n.nextSibling),elRemove(n),this.selection.restore();else if((i=n&&"P"===n.nodeName?n.parentNode:null)&&-1!==i.nodeName.indexOf("-")){var r=window.getSelection().getRangeAt(0),s=document.createRange();s.setStartBefore(n),s.setEnd(r.startContainer,r.startOffset);var l=s.cloneContents(),a=elCreate("div");if(a.appendChild(l),e(a)){t.preventDefault();var d=n.previousElementSibling,h=null;if(d)h=e(d);else for(i=n;(i=i.parentNode)&&i!==this.$editor[0];)if(d=i.previousElementSibling){h=!1;break}if(h)elRemove(d);else if(null!==h){var c=n.parentNode;if("P"===d.nodeName){for(d.appendChild(this.marker.get());n.childNodes.length;)d.appendChild(n.childNodes[0]);elRemove(n),this.selection.restore()}else d.appendChild(n),n.insertBefore(this.marker.get(),n.firstChild),this.selection.restore();e(c)&&elRemove(c)}else null===h&&(i=n.parentNode,e(i)&&elRemove(i))}}}.bind(this),i=function(t){var i,n=this.selection.block();if(-1!==n.nodeName.indexOf("-")&&e(n))i=n.parentNode,i.insertBefore(this.marker.get(),n.nextSibling),elRemove(n),this.selection.restore();else if((i=n&&"P"===n.nodeName?n.parentNode:null)&&-1!==i.nodeName.indexOf("-")){var o=window.getSelection().getRangeAt(0),r=document.createRange();r.setStart(o.startContainer,o.startOffset),r.setEndAfter(n);var s=r.cloneContents(),l=elCreate("div");if(l.appendChild(s),e(l)){t.preventDefault();var a=n.nextElementSibling,d=null;if(a)d=e(a);else for(i=n;(i=i.parentNode)&&i!==this.$editor[0];)if(a=i.nextElementSibling){d=!1;break}if(d)elRemove(a);else if(null!==d){var h=a.parentNode;if("P"===a.nodeName){for(;a.childNodes.length;)n.appendChild(a.childNodes[0]);elRemove(a)}else{if(n.appendChild(this.marker.get()),i=n.parentNode,-1!==a.nodeName.indexOf("-")){var c=a.firstElementChild;if(c&&"P"===c.nodeName){for(;c.childNodes.length;)n.appendChild(c.childNodes[0]);a.removeChild(c),e(a)&&elRemove(a)}}else i.insertBefore(a,n.nextSibling);this.selection.restore()}e(h)&&elRemove(h)}else null===d&&(i=n.parentNode,e(i)&&elRemove(i))}}}.bind(this);this.keydown.onBackspaceAndDeleteAfter=function(e){this.detect.isFirefox()&&this.selection.isCollapsed()&&(e.which===this.keyCode.BACKSPACE?t(e):e.which===this.keyCode.DELETE&&i(e)),setTimeout($.proxy(function(){this.code.syncFire=!1,this.keydown.removeEmptyLists();var t="";0!==this.opts.keepStyleAttr.length&&(t=","+this.opts.keepStyleAttr.join(",")),this.core.editor().find("*[style]").not("span, img, figure, iframe, #redactor-image-box, #redactor-image-editter, [data-redactor-style-cache], [data-redactor-span]"+t).removeAttr("style"),this.keydown.formatEmpty(e);var i=this.selection.current();"KBD"===i.nodeName&&0===i.innerHTML.length&&elRemove(i),this.code.syncFire=!0},this),1)}.bind(this)}}}; })(this);
+(function (window, undefined) { $.Redactor.prototype.WoltLabKeydown=function(){"use strict";var e=[];return{init:function(){var e=window.getSelection(),t=this.keydown.init;this.keydown.init=function(n){var i;if(this.detect.isFirefox()&&e.isCollapsed&&n.which===this.keyCode.BACKSPACE&&(i=e.anchorNode,i.nodeType===Node.ELEMENT_NODE&&e.anchorOffset>0&&(i=i.childNodes[e.anchorOffset-1]),i.nodeType===Node.TEXT_NODE&&"​"===i.textContent)){for(var o=[],r=i;r=r.previousSibling;){if(r.nodeType===Node.ELEMENT_NODE){"IMG"!==r.nodeName&&(o=[]);break}if(r.nodeType===Node.TEXT_NODE){var l=r.textContent;if(""!==l&&"​"!==l){o=[];break}o.push(r)}}o.length&&o.forEach(elRemove)}if((n.originalEvent.which===this.keyCode.BACKSPACE||n.originalEvent.which===this.keyCode.DELETE)&&e.isCollapsed){var s=this.selection.block();if("P"===s.nodeName){if(this.list.combineAfterAndBefore(s))return void n.originalEvent.preventDefault();if(this.utils.isEmpty(s.innerHTML)&&s.previousElementSibling!==s.nextElementSibling){var a=null,d=null;return n.originalEvent.which===this.keyCode.BACKSPACE?null===s.previousElementSibling?d=s.nextElementSibling:a=s.previousElementSibling:null===s.nextElementSibling?a=s.previousElementSibling:d=s.nextElementSibling,elRemove(s),null===d?("OL"!==a.nodeName&&"UL"!==a.nodeName||(a=a.lastElementChild),this.caret.end(a)):("OL"!==d.nodeName&&"UL"!==d.nodeName||(d=d.firstElementChild),this.caret.start(d)),void n.originalEvent.preventDefault()}}}if(!(!1===t.call(this,n)||n.originalEvent.defaultPrevented||(n=n.originalEvent,39!==n.which||n.ctrlKey||n.shiftKey||n.metaKey||n.altKey))){if(!e.isCollapsed)return;var h=e.anchorNode;if(h.nodeType!==Node.TEXT_NODE||e.getRangeAt(0).startOffset!==h.textContent.length)return;var c=h.parentNode;if("KBD"!==c.nodeName)return;var f=!0;for(i=c;i&&i!==this.core.editor()[0];){if(null!==i.nextSibling){for(;i.nextSibling&&i.nextSibling.nodeType===Node.TEXT_NODE&&0===i.nextSibling.textContent.length;)i.parentNode.removeChild(i.nextSibling);if(i.nextSibling&&"BR"!==i.nextSibling.nodeName||null!==i.nextSibling.nextSibling){f=!1;break}}i=i.parentNode}f&&c.parentNode.insertBefore(document.createTextNode("​"),c.nextSibling)}}.bind(this);var n=window.navigator.userAgent.toLowerCase();-1!==n.indexOf("linux")&&-1!==n.indexOf("android")&&-1!==n.indexOf("chrome")&&(this.keydown.checkEvents=function(){this.core.addEvent(!1)}.bind(this)),this.core.editor().off("keydown.redactor"),this.core.editor().on("keydown.redactor",this.keydown.init.bind(this)),this.keydown.onArrowDown=function(){for(var e,t,n=this.WoltLabKeydown._getBlocks(),i=0;i<n.length;i++)if(t=n[i]){if(!this.utils.isEndOfElement(t))continue;if(null!==(e=t.nextElementSibling)&&"P"===e.nodeName)break;return void this.keydown.insertAfterLastElement(t)}}.bind(this),this.keydown.onArrowUp=function(){for(var e,t,n=this.WoltLabKeydown._getBlocks(),i=0;i<n.length;i++)if(t=n[i]){if(!this.utils.isStartOfElement())break;if(null!==(e=t.previousElementSibling)&&"P"!==e.nodeName){var o=$(this.opts.emptyHtml)[0];t.parentNode.insertBefore(o,t),this.caret.end(o);break}return void this.keydown.insertBeforeFirstElement(t)}}.bind(this);var i=function(e){if(!1===this.core.callback("enter",e))return e.preventDefault(),!1;if(this.keydown.blockquote&&!0===this.keydown.exitFromBlockquote(e))return!1;if(this.keydown.pre)return this.keydown.insertNewLine(e);if(this.keydown.blockquote||this.keydown.figcaption)return this.keydown.insertBreakLine(e);if(this.keydown.figure)setTimeout($.proxy(function(){this.keydown.replaceToParagraph("FIGURE")},this),1);else if(this.keydown.block){if(setTimeout($.proxy(function(){this.keydown.replaceToParagraph("DIV")},this),1),"LI"===this.keydown.block.tagName){var t=this.selection.current(),n=elClosest(t,"li");this.utils.isRedactorParent(n)&&this.utils.isEmpty(n.innerHTML)&&null===n.nextElementSibling&&(n.innerHTML="")}}else if(!this.keydown.block)return this.keydown.insertParagraph(e);return this.detect.isFirefox()&&this.utils.isInline(this.keydown.parent)?(this.keydown.insertBreakLine(e),void setTimeout(function(){for(var e=this.selection.block(),t=this.selection.inline();t&&t!==e;){if("A"===t.nodeName){var n=!1;if(0===t.childNodes.length?n=!0:""===t.textContent.replace(/\u200B/g,"").trim()&&(n=!0,elBySelAll("*",t,function(e){"SPAN"!==e.nodeName&&(n=!1)})),n){for(;t.childNodes.length;)t.parentNode.insertBefore(t.childNodes[0],t);elRemove(t);break}}t=t.parentNode}}.bind(this),1)):void 0}.bind(this);this.keydown.onEnter=function(e){var t=this.keydown.blockquote;t&&(this.keydown.blockquote=!1);var n=i.call(this,e);return t&&(this.keydown.blockquote=t),n}.bind(this),this.keydown.replaceToParagraph=function(e){var t=this.selection.block(),n=t.innerHTML.replace(/<br\s?\/?>/gi,"");if(t.tagName===e&&this.utils.isEmpty(n)&&!$(t).hasClass("redactor-in")){var i=document.createElement("p");$(t).replaceWith(i);var o=document.createRange();o.setStart(i,0);var r=document.createTextNode("​");o.insertNode(r),o.setStartAfter(r),o.collapse(!0);var l=window.getSelection();return l.removeAllRanges(),l.addRange(o),!1}"P"===t.tagName&&$(t).removeAttr("style")}.bind(this),this.keydown.onShiftEnter=function(e){return this.buffer.set(),this.keydown.pre?this.keydown.insertNewLine(e):this.insert.raw("<br>​")}.bind(this);var o=this.keydown.onTab;this.keydown.onTab=function(t,n){if(!this.keydown.pre){var i=$(this.selection.current()).closest("ul, ol, td",this.core.editor()[0]);if(0===i.length)return!0;if(i=i[0],"TD"===i.nodeName){var r=null;if(t.originalEvent.shiftKey?null===(r=i.previousElementSibling)&&null!==(r=i.parentNode.previousElementSibling)&&(r=r.lastElementChild):null===(r=i.nextElementSibling)&&(r=i.parentNode.nextElementSibling,null===r&&(this.table.addRowBelow(),r=i.parentNode.nextElementSibling),r=r.firstElementChild),null!==r)if(this.utils.isEmpty(r.innerHTML))this.caret.end(r);else{var l=document.createRange();l.selectNodeContents(r),e.removeAllRanges(),e.addRange(l)}return t.originalEvent.preventDefault(),!1}}return o.call(this,t,n)}.bind(this);var r=this.keydown.formatEmpty;this.keydown.formatEmpty=function(e){for(var t,n=this.$editor[0],i=0,o=n.childElementCount;i<o;i++)if(t=n.children[i],"P"!==t.nodeName&&this.utils.isBlockTag(t.nodeName))return;return r.call(this,e)}.bind(this),require(["Core","Environment"],function(e,t){if("desktop"===t.platform()){var n=this.$editor[0].closest("form, .message");if(null!==n){var i=elBySel(".formSubmit",n);if(null!==i){var o=elBySel('input[type="submit"], button[data-type="save"], button[accesskey="s"]',i);o&&(o.removeAttribute("accesskey"),this.WoltLabEvent.register("keydown",function(t){if(83===t.event.which){var n=!1;window.navigator.platform.match(/^Mac/)?t.event.ctrlKey&&t.event.altKey&&(n=!0):t.event.altKey&&!t.event.ctrlKey&&(n=!0),n&&(t.cancel=!0,"function"==typeof o.click?o.click():e.triggerEvent(o,WCF_CLICK_EVENT))}}.bind(this)))}}}}.bind(this)),this.WoltLabKeydown._handleBackspaceAndDelete()},register:function(t){-1===e.indexOf(t)&&e.push(t)},_getBlocks:function(){for(var t=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],n=0,i=e.length;n<i;n++)t.push(this.utils.isTag(this.keydown.current,e[n]));return t},_handleBackspaceAndDelete:function(){var e=function(e){return null===elBySel("img",e)&&""===e.textContent.replace(/\u200B/g,"").trim()},t=function(t){var n,i=this.selection.block();if(i)if("TD"===i.nodeName){var o=i.innerHTML;"​"===o?t.preventDefault():""===o&&(t.preventDefault(),i.innerHTML="​")}else if(-1!==i.nodeName.indexOf("-")&&e(i))n=i.parentNode,n.insertBefore(this.marker.get(),i.nextSibling),elRemove(i),this.selection.restore();else if((n=i&&"P"===i.nodeName?i.parentNode:null)&&-1!==n.nodeName.indexOf("-")){var r=window.getSelection().getRangeAt(0),l=document.createRange();l.setStartBefore(i),l.setEnd(r.startContainer,r.startOffset);var s=l.cloneContents(),a=elCreate("div");if(a.appendChild(s),e(a)){t.preventDefault();var d=i.previousElementSibling,h=null;if(d)h=e(d);else for(n=i;(n=n.parentNode)&&n!==this.$editor[0];)if(d=n.previousElementSibling){h=!1;break}if(h)elRemove(d);else if(null!==h){var c=i.parentNode;if("P"===d.nodeName){for(d.appendChild(this.marker.get());i.childNodes.length;)d.appendChild(i.childNodes[0]);elRemove(i),this.selection.restore()}else d.appendChild(i),i.insertBefore(this.marker.get(),i.firstChild),this.selection.restore();e(c)&&elRemove(c)}else null===h&&(n=i.parentNode,e(n)&&elRemove(n))}}}.bind(this),n=function(t){var n,i=this.selection.block();if(-1!==i.nodeName.indexOf("-")&&e(i))n=i.parentNode,n.insertBefore(this.marker.get(),i.nextSibling),elRemove(i),this.selection.restore();else if((n=i&&"P"===i.nodeName?i.parentNode:null)&&-1!==n.nodeName.indexOf("-")){var o=window.getSelection().getRangeAt(0),r=document.createRange();r.setStart(o.startContainer,o.startOffset),r.setEndAfter(i);var l=r.cloneContents(),s=elCreate("div");if(s.appendChild(l),e(s)){t.preventDefault();var a=i.nextElementSibling,d=null;if(a)d=e(a);else for(n=i;(n=n.parentNode)&&n!==this.$editor[0];)if(a=n.nextElementSibling){d=!1;break}if(d)elRemove(a);else if(null!==d){var h=a.parentNode;if("P"===a.nodeName){for(;a.childNodes.length;)i.appendChild(a.childNodes[0]);elRemove(a)}else{if(i.appendChild(this.marker.get()),n=i.parentNode,-1!==a.nodeName.indexOf("-")){var c=a.firstElementChild;if(c&&"P"===c.nodeName){for(;c.childNodes.length;)i.appendChild(c.childNodes[0]);a.removeChild(c),e(a)&&elRemove(a)}}else n.insertBefore(a,i.nextSibling);this.selection.restore()}e(h)&&elRemove(h)}else null===d&&(n=i.parentNode,e(n)&&elRemove(n))}}}.bind(this);this.keydown.onBackspaceAndDeleteAfter=function(e){this.detect.isFirefox()&&this.selection.isCollapsed()&&(e.which===this.keyCode.BACKSPACE?t(e):e.which===this.keyCode.DELETE&&n(e)),setTimeout($.proxy(function(){this.code.syncFire=!1,this.keydown.removeEmptyLists();var t="";0!==this.opts.keepStyleAttr.length&&(t=","+this.opts.keepStyleAttr.join(",")),this.core.editor().find("*[style]").not("span, img, figure, iframe, #redactor-image-box, #redactor-image-editter, [data-redactor-style-cache], [data-redactor-span]"+t).removeAttr("style"),this.keydown.formatEmpty(e);var n=this.selection.current();"KBD"===n.nodeName&&0===n.innerHTML.length&&elRemove(n),this.code.syncFire=!0},this),1)}.bind(this)}}}; })(this);
 
 // plugins/WoltLabKeyup.js
 (function (window, undefined) { $.Redactor.prototype.WoltLabKeyup=function(){"use strict";return{init:function(){this.WoltLabEvent.register("keyup",function(e){e.event.originalEvent.which===this.keyCode.ENTER&&this.WoltLabKeyup._keyupEnter()}.bind(this))},_keyupEnter:function(){for(var e=this.$editor[0],t=window.getSelection(),n=t.anchorNode,r=null;n.parentNode;){if(n.parentNode===e){r=n;break}n=n.parentNode}null!==r&&"P"===r.nodeName&&(this.WoltLabKeyup._rebuildEmptyParagraph(r,!1),null!==(r=r.previousElementSibling)&&"P"===r.nodeName&&this.WoltLabKeyup._rebuildEmptyParagraph(r,!0))},_rebuildEmptyParagraph:function(e,t){if(!(e.textContent.replace(/\u200B/g,"").trim().length>0)){for(var n=e;n.nodeType===Node.ELEMENT_NODE&&0!==n.childNodes.length;){if(n.children.length>1)return;n=1===n.children.length?n.children[0]:n.childNodes[0]}if(n.nodeType===Node.TEXT_NODE){var r=elCreate("br");n.parentNode.appendChild(r),t&&elRemove(n)}}}}}; })(this);