From: woltlab.com Date: Mon, 23 May 2016 16:35:49 +0000 (+0200) Subject: Updating minified JavaScript files X-Git-Tag: 2.1.11~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ea94e0ea5b42b681e8bf11bf1a99dad556e3dff;p=GitHub%2FWoltLab%2FWCF.git Updating minified JavaScript files --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js index a3ed0c0c4c..6ce89644a4 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js @@ -1,8 +1,9 @@ // table.js if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.table=function(){return{getTemplate:function(){return String()+'
'},init:function(){var t={};t.insert_table={title:this.lang.get("insert_table"),func:this.table.show},t.insert_row_above={title:this.lang.get("insert_row_above"),func:this.table.addRowAbove},t.insert_row_below={title:this.lang.get("insert_row_below"),func:this.table.addRowBelow},t.insert_column_left={title:this.lang.get("insert_column_left"),func:this.table.addColumnLeft},t.insert_column_right={title:this.lang.get("insert_column_right"),func:this.table.addColumnRight},t.add_head={title:this.lang.get("add_head"),func:this.table.addHead},t.delete_head={title:this.lang.get("delete_head"),func:this.table.deleteHead},t.delete_column={title:this.lang.get("delete_column"),func:this.table.deleteColumn},t.delete_row={title:this.lang.get("delete_row"),func:this.table.deleteRow},t.delete_table={title:this.lang.get("delete_table"),func:this.table.deleteTable},this.observe.addButton("td","table"),this.observe.addButton("th","table");var e=this.button.addBefore("link","table",this.lang.get("table"));this.button.addDropdown(e,t)},show:function(){this.modal.addTemplate("table",this.table.getTemplate()),this.modal.load("table",this.lang.get("insert_table"),300),this.modal.createCancelButton();var t=this.modal.createActionButton(this.lang.get("insert"));t.on("click",this.table.insert),this.selection.save(),this.modal.show(),$("#redactor-table-rows").focus()},insert:function(){var t,e,i,a,s=$("#redactor-table-rows").val(),l=$("#redactor-table-columns").val(),n=$("
"),r=Math.floor(99999*Math.random()),o=$('
');for(t=0;s>t;t++){for(e=$(""),i=0;l>i;i++)a=$(""+this.opts.invisibleSpace+""),0===t&&0===i&&a.append(this.selection.getMarker()),$(e).append(a);o.append(e)}n.append(o);var d=n.html();if(this.modal.close(),this.selection.restore(),!this.table.getTable()){this.buffer.set();var h=this.selection.getBlock()||this.selection.getCurrent();h&&"BODY"!=h.tagName?("LI"==h.tagName&&(h=$(h).closest("ul, ol")),$(h).after(d)):this.insert.html(d),this.selection.restore();var c=this.$editor.find("#table"+r);if(!this.opts.linebreaks&&(this.utils.browser("mozilla")||this.utils.browser("msie"))){var b=c.next();0===b.length&&c.after(this.opts.emptyHtml)}this.observe.buttons(),c.find("span.redactor-selection-marker").remove(),c.removeAttr("id"),this.code.sync(),this.core.setCallback("insertedTable",c)}},getTable:function(){var t=$(this.selection.getParent()).closest("table");return this.utils.isRedactorParent(t)?0===t.size()?!1:t:!1},restoreAfterDelete:function(t){this.selection.restore(),t.find("span.redactor-selection-marker").remove(),this.code.sync()},deleteTable:function(){var t=this.table.getTable();if(t){this.buffer.set();var e=t.next();this.opts.linebreaks||0===e.length?this.caret.setAfter(t):this.caret.setStart(e),t.remove(),this.code.sync()}},deleteRow:function(){var t=this.table.getTable();if(t){var e=$(this.selection.getCurrent());this.buffer.set();var i=e.closest("tr"),a=i.prev().length?i.prev():i.next();if(a.length){var s=a.children("td, th").first();s.length&&s.prepend(this.selection.getMarker())}i.remove(),this.table.restoreAfterDelete(t)}},deleteColumn:function(){var t=this.table.getTable();if(t){this.buffer.set();var e=$(this.selection.getCurrent()),i=e.closest("td, th"),a=i[0].cellIndex;t.find("tr").each($.proxy(function(t,e){var i=$(e),s=0>a-1?a+1:a-1;0===t&&i.find("td, th").eq(s).prepend(this.selection.getMarker()),i.find("td, th").eq(a).remove()},this)),this.table.restoreAfterDelete(t)}},addHead:function(){var t=this.table.getTable();if(t){if(this.buffer.set(),0!==t.find("thead").size())return void this.table.deleteHead();var e=t.find("tr").first().clone();e.find("td").html(this.opts.invisibleSpace),$thead=$("").append(e),t.prepend($thead),this.code.sync()}},deleteHead:function(){var t=this.table.getTable();if(t){var e=t.find("thead");0!==e.size()&&(this.buffer.set(),e.remove(),this.code.sync())}},addRowAbove:function(){this.table.addRow("before")},addRowBelow:function(){this.table.addRow("after")},addColumnLeft:function(){this.table.addColumn("before")},addColumnRight:function(){this.table.addColumn("after")},addRow:function(t){var e=this.table.getTable();if(e){this.buffer.set();var i=$(this.selection.getCurrent()),a=i.closest("tr"),s=a.clone();s.find("th").replaceWith(function(){var t=$("");return t[0].attributes=this.attributes,t.append($(this).contents())}),s.find("td").html(this.opts.invisibleSpace),"after"==t?a.after(s):a.before(s),this.code.sync()}},addColumn:function(t){var e=this.table.getTable();if(e){var i=0,a=$(this.selection.getCurrent());this.buffer.set();var s=a.closest("tr"),l=a.closest("td, th");s.find("td, th").each($.proxy(function(t,e){$(e)[0]===l[0]&&(i=t)},this)),e.find("tr").each($.proxy(function(e,a){var s=$(a).find("td, th").eq(i),l=s.clone();l.html(this.opts.invisibleSpace),"after"==t?s.after(l):s.before(l)},this)),this.code.sync()}}}}; // wbbcode.js -if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.wbbcode=function(){"use strict";var e=!1;return{init:function(){var t=this.$textarea.wcfIdentify();this.opts.initCallback=function(){window.addEventListener("unload",function(){this.code.startSync(),this.$textarea.val(this.wbbcode.convertFromHtml(this.$textarea.val()))}.bind(this)),$.browser.msie&&this.$editor.addClass("msie"),this.$textarea[0].setAttribute("data-is-dirty",!0);var e=$.trim(this.wutil.getOption("woltlab.originalValue"));e.length&&(this.wutil.replaceText(e),this.wutil.selectionEndOfEditor()),delete this.opts.woltlab.originalValue,$(document).trigger("resize"),this.wutil.saveSelection();var t=this.$editor[0],i=this.$textarea[0];setTimeout(function(){$.browser.iOS&&0===t.scrollHeight&&(document.activeElement===t||document.activeElement===i)&&document.activeElement.blur()},10)}.bind(this),this.opts.pasteBeforeCallback=$.proxy(this.wbbcode._pasteBeforeCallback,this),this.opts.pasteCallback=$.proxy(this.wbbcode._pasteCallback,this);var i=this.clean.onSync;this.clean.onSync=function(t){return t=t.replace(/\u200C/g,"__wcf_zwnj__"),t=t.replace(/\u200D/g,"__wcf_zwj__"),e===!0?e=!1:t=t.replace(/

]+)?><\/p>/g,"

@@@wcf_empty_line@@@

"),t=i.call(this,t),t=t.replace(/__wcf_zwnj__/g,"‌"),t.replace(/__wcf_zwj__/g,"‍")}.bind(this),this.wutil.getOption("woltlab.autosaveOnce")&&(this.wutil.saveTextToStorage(),delete this.opts.woltlab.autosaveOnce);var a=this.button.get("table");if(a.length){var r=a.data("dropdown");r.find(".redactor-dropdown-add_head").parent().remove(),r.find(".redactor-dropdown-delete_head").parent().remove(),$('
  • [\s\S]*?<\/li>)/g,function(e){return $.trim(e).replace(/\n/g,"
    ")}),o=o.replace(new RegExp("@@"+c[d].hash+"@@"),u)}}else o="
    "+T.opts.invisibleSpace+"
    ";return l+=o,l+=""})},v=p.length-1;v>=0;v--){var F=p[v],A=new RegExp("@@"+F.hashCode+"@@","g");e=e.replace(A,L(F.content))}if(e=e.replace(/<(?:div|p)><(blockquote|div)/g,"<$1"),e=e.replace(/<\/(blockquote|div)><\/(?:div|p)>/g,""),t.length)for(var v=t.length-1;v>=0;v--){var O=t[v],A=new RegExp("@@"+O.key+"@@","g"),B=O.value;B=B.replace(/^\[tt\]([\s\S]+)\[\/tt\]/,function(e,t){var i=t.split("\n");t="";for(var a=0,r=i.length;r>a;a++){var n=i[a];if(n.length)t.length&&(t+="

    "),t+="[tt]"+n+"[/tt]";else{if(0===a||a+1===r)continue;t+=t.match(/\[\/tt\]$/)?"

    "+this.opts.invisibleSpace:"


    "}}return t}.bind(this)),B=B.replace(/^\[code([^\]]*)\]([\S\s]*)\[\/code\]$/,function(e,t,i){var a="plain",r=0,n="";if(t){t=t.substring(1),t=t.split(",");var l=function(e){return e.match(/^\d+$/)},o=function(e){return-1!==e.indexOf(".")||e.match(/^(["']).*\1$/)},c=function(e){return void 0!==__REDACTOR_CODE_HIGHLIGHTERS[e]},s=function(e){return e.replace(/^(["'])(.*)\1$/,"$2")};switch(t.length){case 1:l(t[0])?r=parseInt(t[0])>1?t[0]:0:o(t[0])?n=s(t[0]):c(t[0])&&(a=t[0]);break;case 2:l(t[0])?(r=parseInt(t[0])>1?t[0]:0,c(t[1])?a=t[1]:o(t[1])&&(n=s(t[1]))):(c(t[0])&&(a=t[0]),o(t[1])&&(n=s(t[1])));break;case 3:c(t[0])&&(a=t[0]),l(t[1])&&(r=t[1]),o(t[2])&&(n=s(t[2]))}}i=i.replace(/^\n+/,"").replace(/\n+$/,"").split(/\n/);for(var d="",h=0;h"+p+"

  • "}return'

    "+__REDACTOR_CODE_HIGHLIGHTERS[a]+(n?": "+WCF.String.escapeHTML(n):"")+'

      '+d+"
    "}.bind(this)),e=e.replace(A,B)}return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:e}),e=e.replace(/&nbsp;/g,"&amp;nbsp;")},_expandFormatting:function(e,t,i){if(!e.length)return t+this.opts.invisibleSpace+i;var a=e.indexOf("[/td]");if(-1!==a){var r=e.substring(0,a);if(-1===r.indexOf("[td]"))return t+r+i+e.substring(a)}var r=e.split("\n");e="";for(var n=0,l=r.length;l>n;n++){var o=r[n];0===o.length&&(o=this.opts.invisibleSpace),e.length&&(e+="\n"),e+=t+o+i}return e},_pasteBeforeCallback:function(e){var t={1:24,2:22,3:18,4:14,5:12,6:10};return e=e.replace(/]*)>/g,function(e,i,a){if(a&&a.match(/style="([^"]+?)"/)&&/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var r=$('
    ').appendTo(document.body),n=parseInt(r[0].clientWidth);r.remove();var l=-1,o=!1;$.each(t,function(e,i){-1===l?l=e:Math.abs(n-i)l?parseInt(l)+1:l),i=l}return"[size="+t[i]+"]"}),e=e.replace(/<\/h[1-6]>/g,"[/size]"),(/

    /g,"")),e=e.replace(/ <\/o:p>/g,"
    "),e=e.replace(/<(article|header)[^>]+>/g,"

    "),e=e.replace(/<\/(article|header)>/g,"
    "),e=e.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

    "),e=e.replace(/<\/(div|p)><\/(div|p)>/g,"

    "),e=e.replace(/<(?:div|p|span)[^>]+>/gi,function(e){return e.replace(/ class="[^"]+"/,"")}),e=e.replace(/<\/?wbr[^>]*>/g,""),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:e}),e},_pasteCallback:function(e){return e=e.replace(/\[size=(\d+)\]/g,'

    '),e=e.replace(/\[\/size\]/g,"

    "),e=e.replace(/style="([^"]+)"/,function(e,t){for(var i=t.split(";"),a=[],r=0,n=i.length;n>r;r++){var l=i[r];l.match(/^\s*background-color/)||a.push(l)}return'style="'+a.join(";")+'"'}),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:e}),e},insertAttachment:function(e,t){e=parseInt(e);var i=this.wutil.getOption("woltlab.attachment"+(t?"":"Thumbnail")+"Url"),a=this.wbbcode._getImageAttachments();if(i&&void 0!==a[e]){var r="";t&&(r=' style="width: '+a[e].width+"px; max-height: "+a[e].height+"px; max-width: "+a[e].width+'px;"'),this.wutil.insertDynamic('","[attach="+e+(t?",none,"+a[e].width:"")+"][/attach]")}else this.wutil.insertDynamic("[attach="+e+"][/attach]")},removeAttachment:function(e){this.opts.visual&&this.$editor.find("img.redactorEmbeddedAttachment").each(function(t,i){var a=$(i);a.data("attachmentID")==e&&a.remove()})},_getImageAttachments:function(){var e=this.wutil.getOption("woltlab.attachmentImages")||[];if(e.length)return delete this.opts.attachmentImages,e;var t={imageAttachments:{}};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),t),t.imageAttachments},_keydownCallback:function(e){switch(e.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.ENTER:case $.ui.keyCode.UP:case 83:break;default:return}this.selection.get();var t=this.selection.getCurrent(),i=this.selection.getParent();i=i?$(i):i;var a=i?i.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(e.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var r=!1;if(a.length){for(var n=!0,l=0;lt;t++){var a=this.$editor[0].children[t];if(a.nodeType===Node.ELEMENT_NODE&&"P"===a.tagName&&!(a.textContent.length>0||a.children.length>1||"BR"===a.children[0].tagName)){for(a=a.children[0];1===a.children.length;)a=a.children[0];if(0===a.children.length&&"BR"===a.tagName){var r=a.parentNode,n=document.createTextNode("​");r.appendChild(n),r.removeChild(a)}}}}},observeQuotes:function(){this.$editor.find(".redactorQuoteEdit").off("click.wbbcode").on("click.wbbcode",$.proxy(this.wbbcode._observeQuotesClick,this))},_observeQuotesClick:function(e){var t=$(e.currentTarget).closest("header"),i=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").click($.proxy(function(t){t.preventDefault(),this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),!1),$(".redactor-link-tooltip").remove()},this)).appendTo(i),$(''+WCF.Language.get("wcf.bbcode.quote.delete")+"").click(function(e){e.preventDefault();var i=t.parent(),a=i.parent();i.remove(),$(".redactor-link-tooltip").remove(),"BLOCKQUOTE"===a[0].nodeName&&0===a.children("div").length&&$("
    ​
    ").appendTo(a)}).appendTo(i);var a=t.offset();i.css({left:a.left+"px",top:a.top+20+"px"}),$(".redactor-link-tooltip").remove(),i.appendTo(document.body),this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each(function(e,t){var i=$(t),a=i.find(".redactorEditCodeBox");a.length||(a=$('
    '+WCF.Language.get("wcf.bbcode.code.edit")+"
    ").insertAfter(i.find("> div > div > h3"))),a.off("click.wbbcode").on("click.wbbcode",function(){this.wbbcode._handleInsertCode(i,!1)}.bind(this))}.bind(this))},_openQuoteEditOverlay:function(t,i){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(i?"insert":"edit")),400);var a=this.modal.createActionButton(this.lang.get("save"));i?(this.selection.save(), -a.click($.proxy(function(){var t=$("#redactorQuoteAuthor").val(),i=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore(),e=!0;var a=this.selection.getHtml();this.utils.isEmpty(a)&&(a="");var r=this.wbbcode.insertQuoteBBCode(t,i,a);null!==r&&(a.length||($.browser.mozilla&&r.children("br[type=_moz]").replaceWith("
    "+this.opts.invisibleSpace+"
    "),this.caret.setStart(r.children("div")[0]))),this.modal.close()},this))):($("#redactorQuoteAuthor").val(t.data("author")),$("#redactorQuoteLink").val(WCF.String.unescapeHTML(t.attr("cite"))),a.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();t.data("author",e),t.attr("data-author",e),t.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val())),this.wbbcode._updateQuoteHeader(t),this.modal.close()},this))),this.modal.show()},_updateQuoteHeader:function(e){var t=e.data("author"),i=e.attr("cite");i&&(i=WCF.String.escapeHTML(i)),e.find("> header > h3").empty().append(this.wbbcode._buildQuoteHeader(t,i))},insertQuoteBBCode:function(e,t,i,a){var r="[quote]",n="[/quote]";e&&(r=t?"[quote='"+e+"','"+t+"']":"[quote='"+e+"']");var l=null;if(this.wutil.inWysiwygMode()){var o=WCF.getUUID(),c="";a?c=this.wbbcode.convertToHtml(r+a+n):(c=this.wbbcode.convertToHtml(r+o+n),c=c.replace(o,i.replace(/^

    /,"").replace(/<\/p>$/,""))),c=c.replace(/^

    /,"").replace(/<\/p>$/,""),c=c.replace(/

    div");if(1==p.length)""===p[0].innerHTML&&(p[0].innerHTML=this.opts.invisibleSpace);else if($.browser.mozilla){var g=l.find("> div > br[type=_moz]");g.length&&($("
    "+this.opts.invisibleSpace+"
    ").insertBefore(g),g.remove())}l.removeAttr("id"),this.wutil.setCaretAfter(l[0]);var u=l[0].previousElementSibling;null!==u&&"P"===u.nodeName&&"​"===u.innerHTML&&(u=u.previousElementSibling,null===u||"P"!==u.nodeName||"​"!==u.innerHTML&&"
    "!==u.innerHTML||u.parentNode.removeChild(u.nextElementSibling))}this.wbbcode.observeQuotes(),this.wbbcode.fixBlockLevelElements(),this.$toolbar.find("a.re-__wcf_quote").removeClass("redactor-button-disabled")}else this.wutil.insertAtCaret(r+a+n);return this.wutil.saveSelection(),l},_buildQuoteHeader:function(e,t){var i="";return!e&&t&&(e=t,t=""),e?(t&&(i+=''),i+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(e)}),t&&(i+="")):i=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+"",i},_handleInsertQuote:function(){this.wbbcode._openQuoteEditOverlay(null,!0)},_handleInsertCode:function(e,t){this.modal.load("code",WCF.Language.get("wcf.bbcode.code."+(t?"insert":"edit")),400);var i=this.modal.createActionButton(this.lang.get("save")).addClass("buttonPrimary");if(t){this.selection.get();var a=this.selection.getText();$.browser.mozilla&&(a=a.replace(/\r/g,"").replace(/\u200b/g,""),a=a.replace(/(\n+)/g,function(e,t){var i=t.match(/\n/g).length;for(i=~~(i/2),t="";i>0;)t+="\n",i--;return t})),this.selection.save(),this.modal.show();var r=$("#redactorCodeBox").focus();r.val(a),i.click($.proxy(function(){var e=$("#redactorCodeBox"),t=$("#redactorCodeFilename"),i=$("#redactorCodeHighlighter"),a=$("#redactorCodeLineNumber"),r=e.val().replace(/^\n+/,"").replace(/\n+$/,"");if(0===$.trim(r).length)return void(e.next("small.innerError").length||$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(e));var n=$.trim(t.val().replace(/['"]/g,"")),l="[code="+i.val()+","+a.val()+(n.length?",'"+n+"'":"")+"]";l.match(/\[code=([^,]+),(\d+)\]/)&&(l="[code="+RegExp.$2+","+RegExp.$1+"]"),l+=r,l+="[/code]",this.wutil.adjustSelectionForBlockElement(),this.wutil.saveSelection();var o=this.wbbcode.convertToHtml(l);this.buffer.set(),this.insert.html(o,!1);var e=this.$editor.find(".codeBox:not(.jsRedactorCodeBox)");this.wbbcode.observeCodeListings(),this.wbbcode.fixBlockLevelElements(),e.attr("contenteditable","false"),this.wutil.setCaretAfter(e[0]),this.modal.close()},this))}else{var n=this.modal.createActionButton(WCF.Language.get("wcf.global.button.delete"));n.click(function(){this.buffer.set(),e.remove(),this.modal.close()}.bind(this)),this.modal.show();var r=$("#redactorCodeBox").focus(),l=$("#redactorCodeFilename"),o=$("#redactorCodeHighlighter"),c=$("#redactorCodeLineNumber");o.val(e.data("highlighter")),l.val(e.data("filename")||"");var s=e.find("> div > ol");c.val(parseInt(s.prop("start")));var d="";s.children("li").each(function(e,t){d+=$(t).text().replace(/^\u200b$/,"")+"\n"}),r.val(d.replace(/^\n+/,"").replace(/\n+$/,"")),i.click($.proxy(function(){var t=r.val().replace(/^\n+/,"").replace(/\n+$/,"");if(0===$.trim(t).length)return void(r.next("small.innerError").length||$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(r));var i=o.val();e.data("highlighter",i),e.attr("data-highlighter",i);var a=__REDACTOR_CODE_HIGHLIGHTERS[i],n=$.trim(l.val().replace(/['"]/g,""));n?(a+=": "+WCF.String.escapeHTML(n),e.data("filename",n),e.attr("data-filename",n)):(e.removeAttr("data-filename"),e.removeData("filename")),e.data("highlighter",o.val()),e.find("> div > div > h3").html(a);var s=e.find("> div > ol").empty(),d=parseInt(c.val());s.prop("start",d>1?d:1),t=t.split("\n");for(var h="",p=0;p"+WCF.String.escapeHTML(t[p])+"";s.append($(h)),this.modal.close()},this))}},fixBlockLevelElements:function(){var e=function(e,t){var i=e[t];i&&i.nodeType===Node.ELEMENT_NODE&&"P"===i.tagName&&(i.innerHTML.length||i.parentElement.removeChild(i))}.bind(this);this.$editor.find("blockquote, .codeBox").each(function(){e(this,"previousElementSibling"),e(this,"nextElementSibling")})},fixFormatting:function(){for(var e=function(t){t.style.removeProperty("text-align");for(var i=0;i]+)?><\/p>/g,"

    @@@wcf_empty_line@@@

    "),t=i.call(this,t),t=t.replace(/__wcf_zwnj__/g,"‌"),t.replace(/__wcf_zwj__/g,"‍")}.bind(this),this.wutil.getOption("woltlab.autosaveOnce")&&(this.wutil.saveTextToStorage(),delete this.opts.woltlab.autosaveOnce);var a=this.button.get("table");if(a.length){var r=a.data("dropdown");r.find(".redactor-dropdown-add_head").parent().remove(),r.find(".redactor-dropdown-delete_head").parent().remove(),$('
  • [\s\S]*?<\/li>)/g,function(e){return $.trim(e).replace(/\n/g,"
    ")}),o=o.replace(new RegExp("@@"+c[d].hash+"@@"),u)}}else o="
    "+T.opts.invisibleSpace+"
    ";return l+=o,l+="
  • "})},b=p.length-1;b>=0;b--){var F=p[b],A=new RegExp("@@"+F.hashCode+"@@","g");e=e.replace(A,L(F.content))}if(e=e.replace(/<(?:div|p)><(blockquote|div)/g,"<$1"),e=e.replace(/<\/(blockquote|div)><\/(?:div|p)>/g,""),t.length)for(var b=t.length-1;b>=0;b--){var O=t[b],A=new RegExp("@@"+O.key+"@@","g"),B=O.value;B=B.replace(/^\[tt\]([\s\S]+)\[\/tt\]/,function(e,t){var i=t.split("\n");t="";for(var a=0,r=i.length;r>a;a++){var n=i[a];if(n.length)t.length&&(t+="

    "),t+="[tt]"+n+"[/tt]";else{if(0===a||a+1===r)continue;t+=t.match(/\[\/tt\]$/)?"

    "+this.opts.invisibleSpace:"


    "}}return t}.bind(this)),B=B.replace(/^\[code([^\]]*)\]([\S\s]*)\[\/code\]$/,function(e,t,i){var a="plain",r=0,n="";if(t){t=t.substring(1),t=t.split(",");var l=function(e){return e.match(/^\d+$/)},o=function(e){return-1!==e.indexOf(".")||e.match(/^(["']).*\1$/)},c=function(e){return void 0!==__REDACTOR_CODE_HIGHLIGHTERS[e]},s=function(e){return e.replace(/^(["'])(.*)\1$/,"$2")};switch(t.length){case 1:l(t[0])?r=parseInt(t[0])>1?t[0]:0:o(t[0])?n=s(t[0]):c(t[0])&&(a=t[0]);break;case 2:l(t[0])?(r=parseInt(t[0])>1?t[0]:0,c(t[1])?a=t[1]:o(t[1])&&(n=s(t[1]))):(c(t[0])&&(a=t[0]),o(t[1])&&(n=s(t[1])));break;case 3:c(t[0])&&(a=t[0]),l(t[1])&&(r=t[1]),o(t[2])&&(n=s(t[2]))}}i=i.replace(/^\n+/,"").replace(/\n+$/,"").split(/\n/);for(var d="",h=0;h"+p+""}return'

    "+__REDACTOR_CODE_HIGHLIGHTERS[a]+(n?": "+WCF.String.escapeHTML(n):"")+'

      '+d+"
    "}.bind(this)),e=e.replace(A,B)}return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:e}),e=e.replace(/&nbsp;/g,"&amp;nbsp;")},_expandFormatting:function(e,t,i){if(!e.length)return t+this.opts.invisibleSpace+i;var a=e.indexOf("[/td]");if(-1!==a){var r=e.substring(0,a);if(-1===r.indexOf("[td]"))return t+r+i+e.substring(a)}var r=e.split("\n");e="";for(var n=0,l=r.length;l>n;n++){var o=r[n];0===o.length&&(o=this.opts.invisibleSpace),e.length&&(e+="\n"),e+=t+o+i}return e},_pasteBeforeCallback:function(e){var t={1:24,2:22,3:18,4:14,5:12,6:10};return e=e.replace(/]*)>/g,function(e,i,a){if(a&&a.match(/style="([^"]+?)"/)&&/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var r=$('
    ').appendTo(document.body),n=parseInt(r[0].clientWidth);r.remove();var l=-1,o=!1;$.each(t,function(e,i){-1===l?l=e:Math.abs(n-i)l?parseInt(l)+1:l),i=l}return"[size="+t[i]+"]"}),e=e.replace(/<\/h[1-6]>/g,"[/size]"),(/

    /g,"")),e=e.replace(/ <\/o:p>/g,"
    "),e=e.replace(/<(article|header)[^>]+>/g,"

    "),e=e.replace(/<\/(article|header)>/g,"
    "),e=e.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

    "),e=e.replace(/<\/(div|p)><\/(div|p)>/g,"

    "),e=e.replace(/<(?:div|p|span)[^>]+>/gi,function(e){return e.replace(/ class="[^"]+"/,"")}),e=e.replace(/<\/?wbr[^>]*>/g,""),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:e}),e},_pasteCallback:function(e){return e=e.replace(/\[size=(\d+)\]/g,'

    '),e=e.replace(/\[\/size\]/g,"

    "),e=e.replace(/style="([^"]+)"/,function(e,t){for(var i=t.split(";"),a=[],r=0,n=i.length;n>r;r++){var l=i[r];l.match(/^\s*background-color/)||a.push(l)}return'style="'+a.join(";")+'"'}),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:e}),e},insertAttachment:function(e,t){e=parseInt(e);var i=this.wutil.getOption("woltlab.attachment"+(t?"":"Thumbnail")+"Url"),a=this.wbbcode._getImageAttachments();if(i&&void 0!==a[e]){var r="";t&&(r=' style="width: '+a[e].width+"px; max-height: "+a[e].height+"px; max-width: "+a[e].width+'px;"'),this.wutil.insertDynamic('","[attach="+e+(t?",none,"+a[e].width:"")+"][/attach]")}else this.wutil.insertDynamic("[attach="+e+"][/attach]")},removeAttachment:function(e){this.opts.visual&&this.$editor.find("img.redactorEmbeddedAttachment").each(function(t,i){var a=$(i);a.data("attachmentID")==e&&a.remove()})},_getImageAttachments:function(){var e=this.wutil.getOption("woltlab.attachmentImages")||[];if(e.length)return delete this.opts.attachmentImages,e;var t={imageAttachments:{}};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),t),t.imageAttachments},_keydownCallback:function(e){switch(e.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.ENTER:case $.ui.keyCode.UP:case 83:break;default:return}this.selection.get();var t=this.selection.getCurrent(),i=this.selection.getParent();i=i?$(i):i;var a=i?i.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(e.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var r=!1;if(a.length){for(var n=!0,l=0;lt;t++){var a=this.$editor[0].children[t];if(a.nodeType===Node.ELEMENT_NODE&&"P"===a.tagName&&!(a.textContent.length>0||a.children.length>1||"BR"===a.children[0].tagName)){for(a=a.children[0];1===a.children.length;)a=a.children[0];if(0===a.children.length&&"BR"===a.tagName){var r=a.parentNode,n=document.createTextNode("​");r.appendChild(n),r.removeChild(a)}}}}},observeQuotes:function(){this.$editor.find(".redactorQuoteEdit").off("click.wbbcode").on("click.wbbcode",$.proxy(this.wbbcode._observeQuotesClick,this))},_observeQuotesClick:function(e){var t=$(e.currentTarget).closest("header"),i=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").on("click touchstart",$.proxy(function(t){t.preventDefault(),t.stopPropagation(),this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),!1),$(".redactor-link-tooltip").remove()},this)).appendTo(i),$(''+WCF.Language.get("wcf.bbcode.quote.delete")+"").on("click touchstart",function(e){e.preventDefault(),e.stopPropagation();var i=t.parent(),a=i.parent();i.remove(),$(".redactor-link-tooltip").remove(),"BLOCKQUOTE"===a[0].nodeName&&0===a.children("div").length&&$("
    ​
    ").appendTo(a)}).appendTo(i);var a=t.offset();i.css({left:a.left+"px",top:a.top+20+"px"}),$(".redactor-link-tooltip").remove(),i.appendTo(document.body),this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each(function(e,t){var i=$(t),a=i.find(".redactorEditCodeBox");a.length||(a=$('
    '+WCF.Language.get("wcf.bbcode.code.edit")+"
    ").insertAfter(i.find("> div > div > h3"))),a.off("click.wbbcode").on("click.wbbcode",function(){this.wbbcode._handleInsertCode(i,!1)}.bind(this))}.bind(this))},_openQuoteEditOverlay:function(t,i){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(i?"insert":"edit")),400); + +var a=this.modal.createActionButton(this.lang.get("save"));i?(this.selection.save(),a.click($.proxy(function(){var t=$("#redactorQuoteAuthor").val(),i=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore(),e=!0;var a=this.selection.getHtml();this.utils.isEmpty(a)&&(a="");var r=this.wbbcode.insertQuoteBBCode(t,i,a);null!==r&&(a.length||($.browser.mozilla&&r.children("br[type=_moz]").replaceWith("
    "+this.opts.invisibleSpace+"
    "),this.caret.setStart(r.children("div")[0]))),this.modal.close()},this))):($("#redactorQuoteAuthor").val(t.data("author")),$("#redactorQuoteLink").val(WCF.String.unescapeHTML(t.attr("cite"))),a.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();t.data("author",e),t.attr("data-author",e),t.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val())),this.wbbcode._updateQuoteHeader(t),this.modal.close()},this))),this.modal.show()},_updateQuoteHeader:function(e){var t=e.data("author"),i=e.attr("cite");i&&(i=WCF.String.escapeHTML(i)),e.find("> header > h3").empty().append(this.wbbcode._buildQuoteHeader(t,i))},insertQuoteBBCode:function(e,t,i,a){var r="[quote]",n="[/quote]";e&&(r=t?"[quote='"+e+"','"+t+"']":"[quote='"+e+"']");var l=null;if(this.wutil.inWysiwygMode()){var o=WCF.getUUID(),c="";a?c=this.wbbcode.convertToHtml(r+a+n):(c=this.wbbcode.convertToHtml(r+o+n),c=c.replace(o,i.replace(/^

    /,"").replace(/<\/p>$/,""))),c=c.replace(/^

    /,"").replace(/<\/p>$/,""),c=c.replace(/

    div");if(1==p.length)""===p[0].innerHTML&&(p[0].innerHTML=this.opts.invisibleSpace);else if($.browser.mozilla){var g=l.find("> div > br[type=_moz]");g.length&&($("
    "+this.opts.invisibleSpace+"
    ").insertBefore(g),g.remove())}l.removeAttr("id"),this.wutil.setCaretAfter(l[0]);var u=l[0].previousElementSibling;null!==u&&"P"===u.nodeName&&"​"===u.innerHTML&&(u=u.previousElementSibling,null===u||"P"!==u.nodeName||"​"!==u.innerHTML&&"
    "!==u.innerHTML||u.parentNode.removeChild(u.nextElementSibling))}this.wbbcode.observeQuotes(),this.wbbcode.fixBlockLevelElements(),this.$toolbar.find("a.re-__wcf_quote").removeClass("redactor-button-disabled")}else this.wutil.insertAtCaret(r+a+n);return this.wutil.saveSelection(),l},_buildQuoteHeader:function(e,t){var i="";return!e&&t&&(e=t,t=""),e?(t&&(i+=''),i+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(e)}),t&&(i+="")):i=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+"",i},_handleInsertQuote:function(){this.wbbcode._openQuoteEditOverlay(null,!0)},_handleInsertCode:function(e,t){this.modal.load("code",WCF.Language.get("wcf.bbcode.code."+(t?"insert":"edit")),400);var i=this.modal.createActionButton(this.lang.get("save")).addClass("buttonPrimary");if(t){this.selection.get();var a=this.selection.getText();$.browser.mozilla&&(a=a.replace(/\r/g,"").replace(/\u200b/g,""),a=a.replace(/(\n+)/g,function(e,t){var i=t.match(/\n/g).length;for(i=~~(i/2),t="";i>0;)t+="\n",i--;return t})),this.selection.save(),this.modal.show();var r=$("#redactorCodeBox").focus();r.val(a),i.click($.proxy(function(){var e=$("#redactorCodeBox"),t=$("#redactorCodeFilename"),i=$("#redactorCodeHighlighter"),a=$("#redactorCodeLineNumber"),r=e.val().replace(/^\n+/,"").replace(/\n+$/,"");if(0===$.trim(r).length)return void(e.next("small.innerError").length||$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(e));var n=$.trim(t.val().replace(/['"]/g,"")),l="[code="+i.val()+","+a.val()+(n.length?",'"+n+"'":"")+"]";l.match(/\[code=([^,]+),(\d+)\]/)&&(l="[code="+RegExp.$2+","+RegExp.$1+"]"),l+=r,l+="[/code]",this.wutil.adjustSelectionForBlockElement(),this.wutil.saveSelection();var o=this.wbbcode.convertToHtml(l);this.buffer.set(),this.insert.html(o,!1);var e=this.$editor.find(".codeBox:not(.jsRedactorCodeBox)");this.wbbcode.observeCodeListings(),this.wbbcode.fixBlockLevelElements(),e.attr("contenteditable","false"),this.wutil.setCaretAfter(e[0]),this.modal.close()},this))}else{var n=this.modal.createActionButton(WCF.Language.get("wcf.global.button.delete"));n.click(function(){this.buffer.set(),e.remove(),this.modal.close()}.bind(this)),this.modal.show();var r=$("#redactorCodeBox").focus(),l=$("#redactorCodeFilename"),o=$("#redactorCodeHighlighter"),c=$("#redactorCodeLineNumber");o.val(e.data("highlighter")),l.val(e.data("filename")||"");var s=e.find("> div > ol");c.val(parseInt(s.prop("start")));var d="";s.children("li").each(function(e,t){d+=$(t).text().replace(/^\u200b$/,"")+"\n"}),r.val(d.replace(/^\n+/,"").replace(/\n+$/,"")),i.click($.proxy(function(){var t=r.val().replace(/^\n+/,"").replace(/\n+$/,"");if(0===$.trim(t).length)return void(r.next("small.innerError").length||$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(r));var i=o.val();e.data("highlighter",i),e.attr("data-highlighter",i);var a=__REDACTOR_CODE_HIGHLIGHTERS[i],n=$.trim(l.val().replace(/['"]/g,""));n?(a+=": "+WCF.String.escapeHTML(n),e.data("filename",n),e.attr("data-filename",n)):(e.removeAttr("data-filename"),e.removeData("filename")),e.data("highlighter",o.val()),e.find("> div > div > h3").html(a);var s=e.find("> div > ol").empty(),d=parseInt(c.val());s.prop("start",d>1?d:1),t=t.split("\n");for(var h="",p=0;p"+WCF.String.escapeHTML(t[p])+"";s.append($(h)),this.modal.close()},this))}},fixBlockLevelElements:function(){var e=function(e,t){var i=e[t];i&&i.nodeType===Node.ELEMENT_NODE&&"P"===i.tagName&&(i.innerHTML.length||i.parentElement.removeChild(i))}.bind(this);this.$editor.find("blockquote, .codeBox").each(function(){e(this,"previousElementSibling"),e(this,"nextElementSibling")})},fixFormatting:function(){for(var e=function(t){t.style.removeProperty("text-align");for(var i=0;it;t++)this.wbutton._addBBCodeButton(__REDACTOR_BUTTONS[t]);for(var n={html:"fa-square-o",bold:"fa-bold",italic:"fa-italic",underline:"fa-underline",deleted:"fa-strikethrough",subscript:"fa-subscript",superscript:"fa-superscript",orderedlist:"fa-list-ol",unorderedlist:"fa-list-ul",outdent:"fa-outdent",indent:"fa-indent",link:"fa-link",alignment:"fa-align-left",table:"fa-table"},i={fontcolor:WCF.Language.get("wcf.bbcode.button.fontColor"),fontfamily:WCF.Language.get("wcf.bbcode.button.fontFamily"),fontsize:WCF.Language.get("wcf.bbcode.button.fontSize"),image:WCF.Language.get("wcf.bbcode.button.image"),subscript:WCF.Language.get("wcf.bbcode.button.subscript"),superscript:WCF.Language.get("wcf.bbcode.button.superscript")},a=this.wutil.getOption("buttons"),o="",t=0,e=a.length;e>t;t++){var s=a[t];if("separator"!=s){var r=this.button.get(s);r.length?(n[s]&&this.button.setAwesome(s,n[s]),"table"===s&&o&&r.parent().insertAfter(this.button.get(o).parent())):this.wbutton._addCoreButton(s,i[s]?i[s]:null,n[s]?n[s]:null,o),o=s}else this.button.get(o).parent().addClass("separator")}if(this.button.addCallback(this.button.get("image"),$.proxy(this.wbutton.insertImage,this)),this.utils.isDesktop()){var l=this.button.addAfter("html","undo",WCF.Language.get("wcf.bbcode.button.undo")),u=this.button.addAfter("undo","redo",WCF.Language.get("wcf.bbcode.button.redo"));this.button.addCallback(l,this.buffer.undo),this.button.addCallback(u,this.buffer.redo),u.parent().addClass("separator")}},_addCoreButton:function(t,e,n,i){var a={title:null===e?t:e};("subscript"===t||"superscript"===t)&&(a.command=t);var o=this.button.build(t,a);$("
  • ").append(o).insertAfter(this.button.get(i).parent()),null!==n&&this.button.setAwesome(t,n)},_addBBCodeButton:function(t){var e="__wcf_"+t.name,n=this.button.add(e,t.label);this.button.addCallback(n,this.wbutton._insertBBCode),this._bbcodes[e]={name:t.name,voidElement:t.voidElement===!0},t.icon.match(/^fa\-[a-z\-]+$/)?this.button.setAwesome(e,t.icon):n.css("background-image","url("+__REDACTOR_ICON_PATH+t.icon+")")},_insertBBCode:function(t){var e=this._bbcodes[t].name,n={buttonName:t,cancel:!1,redactor:this};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","insertBBCode_"+e+"_"+this.$textarea.wcfIdentify(),n),n.cancel===!1){var i=this.selection.getHtml();i=i.replace(/

    @@@wcf_empty_line@@@<\/p>/g,"


    ");if(this.buffer.set(),this.utils.browser("mozilla")&&!i.length){var a=getSelection().getRangeAt(0).startContainer;a.nodeType===Node.ELEMENT_NODE&&"P"===a.tagName&&"
    "===a.innerHTML&&a.removeChild(a.children[0])}this._bbcodes[t].voidElement?this.insert.html(i+this.selection.getMarkerAsHtml()+"["+e+"]",!1):this.insert.html("["+e+"]"+i+this.selection.getMarkerAsHtml()+"[/"+e+"]",!1),this.selection.restore()}},insertImage:function(){this.image.show()},_insertImage:function(){var t=$("#redactor-image-link-source"),e=t.val().trim();if(e.length){this.buffer.set();var n=$("#redactor-image-align").val(),i="";("left"===n||"right"===n)&&(i=' style="float: '+n+'"'),this.insert.html('",!1),this.modal.close(),this.observe.images()}else t.next("small.innerError")||$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(t)}}}; // wfontcolor.js @@ -16,4 +17,4 @@ if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.wmonkeypatch=function // wupload.js if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.wupload=function(){"use strict";return{_boundGlobalUploadEvents:!1,_dropArea:{},_timer:null,_isDragging:!1,_isFile:!1,init:function(){var t=".redactor_"+this.$textarea.wcfIdentify();$(document).on("dragover"+t,$.proxy(this.wupload._dragOver,this)),$(document).on("dragleave"+t,$.proxy(this.wupload._dragLeave,this)),$(document).on("drop"+t,function(t){t.preventDefault(),this.wupload._revertDropArea(void 0,this.$textarea.wcfIdentify())}.bind(this)),this.wupload._boundGlobalUploadEvents||(this.wupload._boundGlobalUploadEvents=!0,$(document).on("dragend",function(t){t.preventDefault()})),WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$textarea.wcfIdentify(),$.proxy(this.wupload.insertPastedImageAttachment,this))},_dragOver:function(t){if(t=t.originalEvent,this.$editor.is(":visible")&&t.dataTransfer&&t.dataTransfer.types){var e=!1;for(var a in t.dataTransfer)if(/^moz/.test(a)){e=!0;break}if(this.wupload._isFile=!1,e)"application/x-moz-file"===t.dataTransfer.types[0]&&(this.wupload._isFile=!0);else for(var i=0;i'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"
  • ").hide().appendTo(document.body),this.wupload._dropArea[r].on("dragover",$.proxy(this.wupload._hoverDropArea,this)).on("dragleave",$.proxy(this.wupload._revertDropArea,this)).on("drop",$.proxy(this.wupload._drop,this)));var o=this.wutil.inWysiwygMode()?this.$editor.getDimensions("outer"):this.$textarea.getDimensions("outer"),s=this.wutil.inWysiwygMode()?this.$editor.getOffsets("offset"):this.$textarea.getOffsets("offset");this.wupload._dropArea[r].css({height:o.height+"px",left:s.left+"px",lineHeight:o.height+"px",top:s.top+"px",width:o.width+"px"}).show(),this.wupload._isDragging=!0}t.preventDefault()}}},_hoverDropArea:function(){this.wupload._dropArea[this.$textarea.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(t,e){if(this.wupload._isFile){var a=e||this.$textarea.wcfIdentify();this.wupload._dropArea[a].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")),e&&this.wupload._dropArea[a].hide()}},_dragLeave:function(){this.wupload._isDragging&&this.wupload._isFile&&(null===this.wupload._timer?this.wupload._timer=new WCF.PeriodicalExecuter(function(t){t.stop(),this.wupload._isDragging||this.wupload._dropArea[this.$textarea.wcfIdentify()].hide()}.bind(this),100):this.wupload._timer.resume(),this.wupload._isDragging=!1)},_drop:function(t){if(this.wupload._isFile&&(t=t.originalEvent||t,t.dataTransfer&&t.dataTransfer.files.length)){t.preventDefault();var e=this.$textarea.wcfIdentify();this.wupload._revertDropArea(void 0,e);for(var a=0;a')},this))},insertPastedImageAttachment:function(t){var e=this.$editor.find("span.redactor-pastedImageFromClipboard-"+t.uploadID);e.before(t.attachment),e.remove()}}}; // wutil.js -if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.wutil=function(){"use strict";var t="",e=null,a=!1,i=!1,n=null;return{_autosaveWorker:null,_range:null,init:function(){this.$textarea.parents("form").submit($.proxy(this.wutil.submit,this)),this.wutil.getOption("woltlab.autosave").active&&(this.wutil.autosaveEnable(),this.wutil.getOption("woltlab.autosave").saveOnInit||this.$textarea.data("saveOnInit")?this.wutil.setOption("woltlab.autosaveOnce",!0):this.wutil.autosaveRestore()),this.wutil.setOption("autosave",!1);var t=this.core.destroy;this.core.destroy=function(){this.wutil.autosaveDisable(),t.call(this)}.bind(this)},saveSelection:function(t){var e=getSelection();e.rangeCount?this.wutil._range=e.getRangeAt(0):t&&(this.wutil._range=null)},restoreSelection:function(){if(document.activeElement!==this.$editor[0]&&this.$editor.focus(),null!==this.wutil._range){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.wutil._range),this.wutil._range=null}},clearSelection:function(){this.wutil._range=null},getSelection:function(){return this.wutil._range},insertAtCaret:function(t){if(this.opts.visual)return console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode."),!1;this.$textarea.focus();var e=this.$textarea.getCaret();-1==e&&console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.");var a=this.$textarea.val();return a=a.substr(0,e)+t+a.substr(e),this.$textarea.val(a),!0},insertDynamic:function(t,e){this.wutil.inWysiwygMode()?this.insert.html(t,!1):((void 0===e||null===e)&&(e=t),this.wutil.insertAtCaret(e))},setOption:function(t,e){-1!==t.indexOf(".")?(t=t.split(".",2),this.opts[t[0]][t[1]]=e):this.opts[t]=e},getOption:function(t){if(-1!==t.indexOf(".")){if(t=t.split(".",2),this.opts[t[0]][t[1]])return this.opts[t[0]][t[1]]}else if(this.opts[t])return this.opts[t];return null},inPlainMode:function(){return!this.opts.visual},inWysiwygMode:function(){return this.opts.visual},replaceRangesWith:function(t){getSelection().removeAllRanges(),getSelection().addRange(t)},getText:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var t=this.$textarea.val();this.$textarea.val($.trim(this.wbbcode.convertFromHtml(t)))}var e=$.trim(this.$textarea.val());return e=this.wutil._removeSuperfluousNewlines(e)},isEmptyEditor:function(){return this.opts.visual?this.utils.isEmpty(this.$editor.html()):!$.trim(this.$textarea.val())},submit:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var t=$.trim(this.wbbcode.convertFromHtml(this.$textarea.val()));t=this.wutil._removeSuperfluousNewlines(t),this.$textarea.val(t)}this.wutil.autosavePurge()},_removeSuperfluousNewlines:function(t){t=t.replace(/(\[\/(?:align|code|quote)\])\n/g,"$1");var e={text:t};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_removeSuperfluousNewlines",e),e.text},addNewlines:function(t){t=t.replace(/(\[\/(?:align|code|quote)\])/g,"$1\n");var e={text:t};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_addNewlines",e),e.text},reset:function(){this.opts.visual&&(this.$editor.html("

    "+this.opts.invisibleSpace+"

    "),this.wutil.saveSelection()),this.$textarea.val(""),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$textarea.wcfIdentify()})},autosaveEnable:function(t){return this.wutil.getOption("woltlab.autosave").active||this.wutil.setOption("woltlab.autosave",{active:!0,key:t}),null===this.wutil._autosaveWorker&&(this.wutil.autosavePurgeOutdated(),this.wutil._autosaveWorker=new WCF.PeriodicalExecuter(function(){this.wutil.saveTextToStorage(!1)}.bind(this),15e3)),!0},saveTextToStorage:function(e){var s=this.wutil.getText();if(t!=s||e)try{localStorage.setItem(this.wutil.getOption("woltlab.autosave").key,JSON.stringify({content:s,timestamp:Date.now()})),t=s,a=!0,null===n&&(n=new WCF.PeriodicalExecuter(function(t){if(i!==!0){if(a===!1)return t.stop(),void(n=null);this.wutil.autosaveShowNotice("saved"),a=!1}}.bind(this),12e4))}catch(t){console.debug("[wutil.saveTextToStorage] Unable to access local storage: "+t.message)}},autosaveDisable:function(){return this.wutil.getOption("woltlab.autosave").active?(this.wutil._autosaveWorker.stop(),this.wutil._autosaveWorker=null,this.wutil.setOption("woltlab.autosave",{active:!1,key:""}),!0):!1},autosavePurge:function(){try{localStorage.removeItem(this.wutil.getOption("woltlab.autosave").key)}catch(t){console.debug("[wutil.autosavePurge] Unable to access local storage: "+t.message)}},autosaveRestore:function(){var t=this.wutil.getOption("woltlab.autosave"),e=null;try{e=localStorage.getItem(t.key)}catch(t){console.debug("[wutil.autosaveRestore] Unable to access local storage: "+t.message)}try{e=null===e?null:JSON.parse(e)}catch(t){e=null}return null!==e&&e.content?t.lastEditTime&&1e3*t.lastEditTime>e.timestamp?(this.wutil.autosavePurge(),!1):t.prompt?(this.wutil.autosaveShowNotice("prompt",e),!1):(this.wutil.inWysiwygMode()?this.wutil.setOption("woltlab.originalValue",e.content):this.$textarea.val(e.content),this.wutil.autosaveShowNotice("restored",{timestamp:e.timestamp}),!0):!1},autosaveShowNotice:function(t,a){if(null===e){e=$('
    '),e.appendTo(this.$box);var i=function(t){(null===t||"opacity"===t.originalEvent.propertyName)&&(e.hasClass("open")&&null!==t?e.data("callbackOpen")&&e.data("callbackOpen")():(e.data("callbackClose")&&e.data("callbackClose")(),e.removeData("callbackClose"),e.removeData("callbackOpen"),e.removeClass("redactorAutosaveNoticeIcons"),e.empty(),$('').appendTo(e)))}.bind(this);e.on("transitionend webkitTransitionEnd",i)}var n="";switch(t){case"prompt":$('').prependTo(e);var s=$('').appendTo(e),o=$('').appendTo(e);s.click(function(){this.wutil.replaceText(a.content),i(null),this.wutil.autosaveShowNotice("restored",a)}.bind(this)),o.click(function(){this.wutil.autosavePurge(),e.removeClass("open")}.bind(this)),n=WCF.Language.get("wcf.message.autosave.prompt"),e.addClass("redactorAutosaveNoticeIcons");var r="";r=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),function(){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),r),setTimeout(function(){e.removeClass("open")},3e3)}.bind(this));break;case"restored":$('').prependTo(e);var s=$('').appendTo(e),o=$('').appendTo(e);s.click(function(){e.removeClass("open")}),o.click(function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.message.autosave.restored.revert.confirmMessage"),function(t){"confirm"===t&&(this.wutil.reset(),this.wutil.autosavePurge(),e.removeClass("open"))}.bind(this))}.bind(this)),n=WCF.Language.get("wcf.message.autosave.restored"),e.addClass("redactorAutosaveNoticeIcons");var r="";r=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),function(){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),r),setTimeout(function(){s.trigger("click")},3e3)}.bind(this));break;case"saved":if(e.hasClass("open"))return;setTimeout(function(){e.removeClass("open")},2e3),n=WCF.Language.get("wcf.message.autosave.saved")}e.children("span.redactorAutosaveMessage").text(n),e.addClass("open"),"saved"!==t&&WCF.DOMNodeInsertedHandler.execute()},autosavePurgeOutdated:function(){var t=0,e=this.wutil.getOption("woltlab.autosave").prefix,a=e+"_wcf_master";try{t=localStorage.getItem(a)}catch(t){console.debug("[wutil.autosavePurgeOutdated] Unable to access local storage: "+t.message)}if(0!==t){var i=Date.now()-6048e5;if(null===t||i>t){var n=new RegExp("^"+e+"_");for(var s in localStorage)if(s.match(n)&&s!==a){var o=localStorage.getItem(s);try{o=JSON.parse(o)}catch(t){o={timestamp:0}}if(null===o||!o.timestamp||o.timestampa;a++){var n=t.charCodeAt(a).toString(16);"200b"!=n&&(e+=t[a])}return e},getSource:function(){return this.$textarea},getName:function(){return this.$textarea.wcfIdentify()},selectionEndOfEditor:function(){this.focus.setEnd();var t=this.$editor.children(":last")[0];"P"===t.tagName?(""===t.innerHTML&&(t.remove(),t=$(this.opts.emptyHtml).appendTo(this.$editor)[0]),t.lastChild.nodeType===Element.TEXT_NODE?this.caret.set(t.lastChild,t.lastChild.length,t.lastChild,t.lastChild.length):this.caret.setEnd(t)):this.wutil.setCaretAfter(t),this.wutil.saveSelection()},adjustSelectionForBlockElement:function(){if(document.activeElement!==this.$editor[0]&&this.wutil.restoreSelection(),getSelection().getRangeAt(0).collapsed){var t=getSelection().getRangeAt(0).startContainer;if(t.nodeType===Node.TEXT_NODE&&"​"===t.textContent&&t.parentElement&&"P"===t.parentElement.tagName&&t.parentElement.parentElement===this.$editor[0])return;var e=$(t).parentsUntil(this.$editor[0]).last();e[0]===document.body.parentElement?this.wutil.selectionEndOfEditor():this.caret.setAfter(e)}},isCaret:function(){return this.selection.get(),this.range.collapsed},isEndOfElement:function(t){var e=this.selection.implicitRange;if(null===e&&(this.selection.get(),e=this.range),!this.wutil.isCaret())return!1;if(e.endContainer.nodeType===Element.TEXT_NODE&&e.endOffset"+this.opts.invisibleSpace+"
    ":"

    "+this.opts.invisibleSpace+"

    "),a[e?"insertBefore":"insertAfter"](t),this.caret.setEnd(a[0])},fixDOM:function(){for(var t=this.$editor[0].childNodes[0],e=t,a=null;e;)if(t=e,e=t.nextSibling,t.nodeType===Element.ELEMENT_NODE)this.reIsBlock.test(t.tagName)?a=null:(null===a&&(a=$("

    ").insertBefore(t)),a.append(t));else if(t.nodeType===Element.TEXT_NODE){if(null===a){if(e&&e.nodeType===Element.ELEMENT_NODE&&"P"===e.tagName&&"​"===e.innerHTML){var i=e.nextSibling;this.$editor[0].removeChild(e),e=i}a=$("

    ").insertBefore(t)}a.append(t)}for(var n=this.$editor[0].getElementsByTagName("li"),s=0,o=n.length;o>s;s++){var r=n[s];if(!r.innerHTML.length){var l=r.parentElement;l.children.length>1&&(r.parentElement.removeChild(r),s--,o--)}}for(var s=0,o=this.$editor[0].children.length;o>s;s++){var u=this.$editor[0].children[s];if(u.nodeType===Node.ELEMENT_NODE&&"P"===u.tagName)if("\n"!==u.innerHTML){if(!(u.textContent.length>0||u.children.length>1||1===u.children.length&&"BR"===u.children[0].tagName)){for(;1===u.children.length;)u=u.children[0];if(0===u.childNodes.length&&"BR"!==u.tagName){var c=document.createTextNode("​");u.appendChild(c)}}}else u.parentElement.removeChild(u),s--,o--}for(var d=this.$editor[0].getElementsByTagName("INPUT");d.length;)d[0].parentNode.removeChild(d[0])}}}; +if(!RedactorPlugins)var RedactorPlugins={};RedactorPlugins.wutil=function(){"use strict";var t="",e=null,i=!1,a=!1,n=null;return{_autosaveWorker:null,_range:null,init:function(){this.$textarea.parents("form").submit($.proxy(this.wutil.submit,this)),this.wutil.getOption("woltlab.autosave").active&&(this.wutil.autosaveEnable(),this.wutil.getOption("woltlab.autosave").saveOnInit||this.$textarea.data("saveOnInit")?this.wutil.setOption("woltlab.autosaveOnce",!0):this.wutil.autosaveRestore()),this.wutil.setOption("autosave",!1);var t=this.core.destroy;this.core.destroy=function(){this.wutil.autosaveDisable(),t.call(this)}.bind(this)},saveSelection:function(t){var e=getSelection();e.rangeCount?this.wutil._range=e.getRangeAt(0):t&&(this.wutil._range=null)},restoreSelection:function(){if(document.activeElement!==this.$editor[0]&&this.$editor.focus(),null!==this.wutil._range){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.wutil._range),this.wutil._range=null}},clearSelection:function(){this.wutil._range=null},getSelection:function(){return this.wutil._range},insertAtCaret:function(t){if(this.opts.visual)return console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode."),!1;this.$textarea.focus();var e=this.$textarea.getCaret();-1==e&&console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.");var i=this.$textarea.val();return i=i.substr(0,e)+t+i.substr(e),this.$textarea.val(i),!0},insertDynamic:function(t,e){this.wutil.inWysiwygMode()?this.insert.html(t,!1):((void 0===e||null===e)&&(e=t),this.wutil.insertAtCaret(e))},setOption:function(t,e){-1!==t.indexOf(".")?(t=t.split(".",2),this.opts[t[0]][t[1]]=e):this.opts[t]=e},getOption:function(t){if(-1!==t.indexOf(".")){if(t=t.split(".",2),this.opts[t[0]][t[1]])return this.opts[t[0]][t[1]]}else if(this.opts[t])return this.opts[t];return null},inPlainMode:function(){return!this.opts.visual},inWysiwygMode:function(){return this.opts.visual},replaceRangesWith:function(t){getSelection().removeAllRanges(),getSelection().addRange(t)},getText:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var t=this.$textarea.val();this.$textarea.val($.trim(this.wbbcode.convertFromHtml(t)))}var e=$.trim(this.$textarea.val());return e=this.wutil._removeSuperfluousNewlines(e)},isEmptyEditor:function(){return this.opts.visual?this.utils.isEmpty(this.$editor.html()):!$.trim(this.$textarea.val())},submit:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var t=$.trim(this.wbbcode.convertFromHtml(this.$textarea.val()));t=this.wutil._removeSuperfluousNewlines(t),this.$textarea.val(t)}this.wutil.autosavePurge()},_removeSuperfluousNewlines:function(t){t=t.replace(/(\[\/(?:align|code|quote)\])\n/g,"$1");var e={text:t};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_removeSuperfluousNewlines",e),e.text},addNewlines:function(t){t=t.replace(/(\[\/(?:align|code|quote)\])/g,"$1\n");var e={text:t};return WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_addNewlines",e),e.text},reset:function(){this.opts.visual&&(this.$editor.html("

    "+this.opts.invisibleSpace+"

    "),this.wutil.saveSelection()),this.$textarea.val(""),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$textarea.wcfIdentify()})},autosaveEnable:function(t){return this.wutil.getOption("woltlab.autosave").active||this.wutil.setOption("woltlab.autosave",{active:!0,key:t}),null===this.wutil._autosaveWorker&&(this.wutil.autosavePurgeOutdated(),this.wutil._autosaveWorker=new WCF.PeriodicalExecuter(function(){this.wutil.saveTextToStorage(!1)}.bind(this),15e3)),!0},saveTextToStorage:function(e){var s=this.wutil.getText();if(t!=s||e)try{localStorage.setItem(this.wutil.getOption("woltlab.autosave").key,JSON.stringify({content:s,timestamp:Date.now()})),t=s,i=!0,null===n&&(n=new WCF.PeriodicalExecuter(function(t){if(a!==!0){if(i===!1)return t.stop(),void(n=null);this.wutil.autosaveShowNotice("saved"),i=!1}}.bind(this),12e4))}catch(t){console.debug("[wutil.saveTextToStorage] Unable to access local storage: "+t.message)}},autosaveDisable:function(){return this.wutil.getOption("woltlab.autosave").active?(this.wutil._autosaveWorker.stop(),this.wutil._autosaveWorker=null,this.wutil.setOption("woltlab.autosave",{active:!1,key:""}),!0):!1},autosavePurge:function(){try{localStorage.removeItem(this.wutil.getOption("woltlab.autosave").key)}catch(t){console.debug("[wutil.autosavePurge] Unable to access local storage: "+t.message)}},autosaveRestore:function(){var t=this.wutil.getOption("woltlab.autosave"),e=null;try{e=localStorage.getItem(t.key)}catch(t){console.debug("[wutil.autosaveRestore] Unable to access local storage: "+t.message)}try{e=null===e?null:JSON.parse(e)}catch(t){e=null}return null!==e&&e.content?t.lastEditTime&&1e3*t.lastEditTime>e.timestamp?(this.wutil.autosavePurge(),!1):t.prompt?(this.wutil.autosaveShowNotice("prompt",e),!1):(this.wutil.inWysiwygMode()?this.wutil.setOption("woltlab.originalValue",e.content):this.$textarea.val(e.content),this.wutil.autosaveShowNotice("restored",{timestamp:e.timestamp}),!0):!1},autosaveShowNotice:function(t,i){if(null===e){e=$('
    '),e.appendTo(this.$box);var a=function(t){(null===t||"opacity"===t.originalEvent.propertyName)&&(e.hasClass("open")&&null!==t?e.data("callbackOpen")&&e.data("callbackOpen")():(e.data("callbackClose")&&e.data("callbackClose")(),e.removeData("callbackClose"),e.removeData("callbackOpen"),e.removeClass("redactorAutosaveNoticeIcons"),e.empty(),$('').appendTo(e)))}.bind(this);e.on("transitionend webkitTransitionEnd",a)}var n="";switch(t){case"prompt":$('').prependTo(e);var s=$('').appendTo(e),o=$('').appendTo(e);s.click(function(){this.wutil.replaceText(i.content),a(null),this.wutil.autosaveShowNotice("restored",i)}.bind(this)),o.click(function(){this.wutil.autosavePurge(),e.removeClass("open")}.bind(this)),n=WCF.Language.get("wcf.message.autosave.prompt"),e.addClass("redactorAutosaveNoticeIcons");var r="";r=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),function(){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),r),setTimeout(function(){e.removeClass("open")},3e3)}.bind(this));break;case"restored":$('').prependTo(e);var s=$('').appendTo(e),o=$('').appendTo(e);s.click(function(){e.removeClass("open")}),o.click(function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.message.autosave.restored.revert.confirmMessage"),function(t){"confirm"===t&&(this.wutil.reset(),this.wutil.autosavePurge(),e.removeClass("open"))}.bind(this))}.bind(this)),n=WCF.Language.get("wcf.message.autosave.restored"),e.addClass("redactorAutosaveNoticeIcons");var r="";r=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),function(){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),r),setTimeout(function(){s.trigger("click")},3e3)}.bind(this));break;case"saved":if(e.hasClass("open"))return;setTimeout(function(){e.removeClass("open")},2e3),n=WCF.Language.get("wcf.message.autosave.saved")}e.children("span.redactorAutosaveMessage").text(n),e.addClass("open"),"saved"!==t&&WCF.DOMNodeInsertedHandler.execute()},autosavePurgeOutdated:function(){var t=0,e=this.wutil.getOption("woltlab.autosave").prefix,i=e+"_wcf_master";try{t=localStorage.getItem(i)}catch(t){console.debug("[wutil.autosavePurgeOutdated] Unable to access local storage: "+t.message)}if(0!==t){var a=Date.now()-6048e5;if(null===t||a>t){var n=new RegExp("^"+e+"_");for(var s in localStorage)if(s.match(n)&&s!==i){var o=localStorage.getItem(s);try{o=JSON.parse(o)}catch(t){o={timestamp:0}}if(null===o||!o.timestamp||o.timestampi;i++){var n=t.charCodeAt(i).toString(16);"200b"!=n&&(e+=t[i])}return e},getSource:function(){return this.$textarea},getName:function(){return this.$textarea.wcfIdentify()},selectionEndOfEditor:function(){this.focus.setEnd();var t=this.$editor.children(":last")[0];"P"===t.tagName?(""===t.innerHTML&&(t.remove(),t=$(this.opts.emptyHtml).appendTo(this.$editor)[0]),t.lastChild.nodeType===Element.TEXT_NODE?this.caret.set(t.lastChild,t.lastChild.length,t.lastChild,t.lastChild.length):this.caret.setEnd(t)):this.wutil.setCaretAfter(t),this.wutil.saveSelection()},adjustSelectionForBlockElement:function(){if(document.activeElement!==this.$editor[0]&&this.wutil.restoreSelection(),getSelection().getRangeAt(0).collapsed){var t=getSelection().getRangeAt(0).startContainer;if(t.nodeType===Node.TEXT_NODE&&"​"===t.textContent&&t.parentElement&&"P"===t.parentElement.tagName&&t.parentElement.parentElement===this.$editor[0])return;var e=t;e!==this.$editor[0]&&(t=$(t).parentsUntil(this.$editor[0]).last()),e[0]===document.body.parentElement?this.wutil.selectionEndOfEditor():this.caret.setAfter(e)}},isCaret:function(){return this.selection.get(),this.range.collapsed},isEndOfElement:function(t){var e=this.selection.implicitRange;if(null===e&&(this.selection.get(),e=this.range),!this.wutil.isCaret())return!1;if(e.endContainer.nodeType===Element.TEXT_NODE&&e.endOffset"+this.opts.invisibleSpace+"
    ":"

    "+this.opts.invisibleSpace+"

    "),i[e?"insertBefore":"insertAfter"](t),this.caret.setEnd(i[0])},fixDOM:function(){for(var t=this.$editor[0].childNodes[0],e=t,i=null;e;)if(t=e,e=t.nextSibling,t.nodeType===Element.ELEMENT_NODE)this.reIsBlock.test(t.tagName)?i=null:(null===i&&(i=$("

    ").insertBefore(t)),i.append(t));else if(t.nodeType===Element.TEXT_NODE){if(null===i){if(e&&e.nodeType===Element.ELEMENT_NODE&&"P"===e.tagName&&"​"===e.innerHTML){var a=e.nextSibling;this.$editor[0].removeChild(e),e=a}i=$("

    ").insertBefore(t)}i.append(t)}for(var n=this.$editor[0].getElementsByTagName("li"),s=0,o=n.length;o>s;s++){var r=n[s];if(!r.innerHTML.length){var l=r.parentElement;l.children.length>1&&(r.parentElement.removeChild(r),s--,o--)}}for(var s=0,o=this.$editor[0].children.length;o>s;s++){var u=this.$editor[0].children[s];if(u.nodeType===Node.ELEMENT_NODE&&"P"===u.tagName)if("\n"!==u.innerHTML){if(!(u.textContent.length>0||u.children.length>1||1===u.children.length&&"BR"===u.children[0].tagName)){for(;1===u.children.length;)u=u.children[0];if(0===u.childNodes.length&&"BR"!==u.tagName){var c=document.createTextNode("​");u.appendChild(c)}}}else u.parentElement.removeChild(u),s--,o--}for(var d=this.$editor[0].getElementsByTagName("INPUT");d.length;)d[0].parentNode.removeChild(d[0])}}};