From: woltlab.com Date: Wed, 1 Jul 2015 21:46:52 +0000 (+0200) Subject: Updating minified JavaScript files X-Git-Tag: 2.1.6~22 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a84d8e89e05bee94f58744c7e5b613a231ad3f3d;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 a795144cc9..5d277a1fd5 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js @@ -1,7 +1,7 @@ // table.js if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.table=function(){return{getTemplate:function(){return String()+'
'},init:function(){var b={};b.insert_table={title:this.lang.get("insert_table"),func:this.table.show};b.insert_row_above={title:this.lang.get("insert_row_above"),func:this.table.addRowAbove};b.insert_row_below={title:this.lang.get("insert_row_below"),func:this.table.addRowBelow};b.insert_column_left={title:this.lang.get("insert_column_left"),func:this.table.addColumnLeft};b.insert_column_right={title:this.lang.get("insert_column_right"),func:this.table.addColumnRight};b.add_head={title:this.lang.get("add_head"),func:this.table.addHead};b.delete_head={title:this.lang.get("delete_head"),func:this.table.deleteHead};b.delete_column={title:this.lang.get("delete_column"),func:this.table.deleteColumn};b.delete_row={title:this.lang.get("delete_row"),func:this.table.deleteRow};b.delete_table={title:this.lang.get("delete_table"),func:this.table.deleteTable};this.observe.addButton("td","table");this.observe.addButton("th","table");var a=this.button.addBefore("link","table",this.lang.get("table"));this.button.addDropdown(a,b)},show:function(){this.modal.addTemplate("table",this.table.getTemplate());this.modal.load("table",this.lang.get("insert_table"),300);this.modal.createCancelButton();var a=this.modal.createActionButton(this.lang.get("insert"));a.on("click",this.table.insert);this.selection.save();this.modal.show();$("#redactor-table-rows").focus()},insert:function(){var n=$("#redactor-table-rows").val(),c=$("#redactor-table-columns").val(),a=$("
"),b=Math.floor(Math.random()*99999),l=$('
'),e,h,j,k;for(e=0;e");for(j=0;j"+this.opts.invisibleSpace+"");if(e===0&&j===0){k.append(this.selection.getMarker())}$(h).append(k)}l.append(h)}a.append(l);var f=a.html();this.modal.close();this.selection.restore();if(this.table.getTable()){return}this.buffer.set();var g=this.selection.getBlock()||this.selection.getCurrent();if(g&&g.tagName!="BODY"){if(g.tagName=="LI"){g=$(g).closest("ul, ol")}$(g).after(f)}else{this.insert.html(f)}this.selection.restore();var m=this.$editor.find("#table"+b);if(!this.opts.linebreaks&&(this.utils.browser("mozilla")||this.utils.browser("msie"))){var d=m.next();if(d.length===0){m.after(this.opts.emptyHtml)}}this.observe.buttons();m.find("span.redactor-selection-marker").remove();m.removeAttr("id");this.code.sync();this.core.setCallback("insertedTable",m)},getTable:function(){var a=$(this.selection.getParent()).closest("table");if(!this.utils.isRedactorParent(a)){return false}if(a.size()===0){return false}return a},restoreAfterDelete:function(a){this.selection.restore();a.find("span.redactor-selection-marker").remove();this.code.sync()},deleteTable:function(){var b=this.table.getTable();if(!b){return}this.buffer.set();var a=b.next();if(!this.opts.linebreaks&&a.length!==0){this.caret.setStart(a)}else{this.caret.setAfter(b)}b.remove();this.code.sync()},deleteRow:function(){var a=this.table.getTable();if(!a){return}var c=$(this.selection.getCurrent());this.buffer.set();var e=c.closest("tr");var b=e.prev().length?e.prev():e.next();if(b.length){var d=b.children("td, th").first();if(d.length){d.prepend(this.selection.getMarker())}}e.remove();this.table.restoreAfterDelete(a)},deleteColumn:function(){var c=this.table.getTable();if(!c){return}this.buffer.set();var d=$(this.selection.getCurrent());var a=d.closest("td, th");var b=a[0].cellIndex;c.find("tr").each($.proxy(function(f,g){var e=$(g);var h=b-1<0?b+1:b-1;if(f===0){e.find("td, th").eq(h).prepend(this.selection.getMarker())}e.find("td, th").eq(b).remove()},this));this.table.restoreAfterDelete(c)},addHead:function(){var a=this.table.getTable();if(!a){return}this.buffer.set();if(a.find("thead").size()!==0){this.table.deleteHead();return}var b=a.find("tr").first().clone();b.find("td").html(this.opts.invisibleSpace);$thead=$("").append(b);a.prepend($thead);this.code.sync()},deleteHead:function(){var a=this.table.getTable();if(!a){return}var b=a.find("thead");if(b.size()===0){return}this.buffer.set();b.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(c){var a=this.table.getTable();if(!a){return}this.buffer.set();var b=$(this.selection.getCurrent());var d=b.closest("tr");var e=d.clone();e.find("th").replaceWith(function(){var f=$("");f[0].attributes=this.attributes;return f.append($(this).contents())});e.find("td").html(this.opts.invisibleSpace);if(c=="after"){d.after(e)}else{d.before(e)}this.code.sync()},addColumn:function(d){var c=this.table.getTable();if(!c){return}var b=0;var e=$(this.selection.getCurrent());this.buffer.set();var f=e.closest("tr");var a=e.closest("td, th");f.find("td, th").each($.proxy(function(g,h){if($(h)[0]===a[0]){b=g}},this));c.find("tr").each($.proxy(function(g,j){var h=$(j).find("td, th").eq(b);var k=h.clone();k.html(this.opts.invisibleSpace);if(d=="after"){h.after(k)}else{h.before(k)}},this));this.code.sync()}}}; // wbbcode.js -if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode=function(){var a=false;return{init:function(){var e=this.$textarea.wcfIdentify();this.opts.initCallback=(function(){window.addEventListener("unload",(function(j){this.code.startSync();this.$textarea.val(this.wbbcode.convertFromHtml(this.$textarea.val()))}).bind(this));if($.browser.msie){this.$editor.addClass("msie")}this.$textarea[0].setAttribute("data-is-dirty",true);var i=$.trim(this.wutil.getOption("woltlab.originalValue"));if(i.length){this.wutil.replaceText(i);this.wutil.selectionEndOfEditor()}delete this.opts.woltlab.originalValue;$(document).trigger("resize");this.wutil.saveSelection()}).bind(this);this.opts.pasteBeforeCallback=$.proxy(this.wbbcode._pasteBeforeCallback,this);this.opts.pasteCallback=$.proxy(this.wbbcode._pasteCallback,this);var d=this.clean.onSync;this.clean.onSync=(function(i){i=i.replace(/\u200C/g,"__wcf_zwnj__");i=i.replace(/\u200D/g,"__wcf_zwj__");if(a===true){a=false}else{i=i.replace(/

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

@@@wcf_empty_line@@@

")}i=d.call(this,i);i=i.replace(/__wcf_zwnj__/g,"\u200C");return i.replace(/__wcf_zwj__/g,"\u200D")}).bind(this);if(this.wutil.getOption("woltlab.autosaveOnce")){this.wutil.saveTextToStorage();delete this.opts.woltlab.autosaveOnce}var c=this.button.get("table");if(c.length){var h=c.data("dropdown");h.find(".redactor-dropdown-add_head").parent().remove();h.find(".redactor-dropdown-delete_head").parent().remove();$('"}return'

"+__REDACTOR_CODE_HIGHLIGHTERS[N]+(Q?": "+WCF.String.escapeHTML(Q):"")+'

    '+V+"
"}).bind(this));I=I.replace(z,i)}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:I});return I},_expandFormatting:function(e,c,f){if(!e.length){return c+this.opts.invisibleSpace+f}var b=e.indexOf("[/td]");if(b!==-1){var d=e.substring(0,b);if(d.indexOf("[td]")===-1){return c+d+f+e.substring(b)}}var d=e.split("\n");e="";for(var i=0,h=d.length;i]*)>/g,function(g,j,i){if(i&&i.match(/style="([^"]+?)"/)){if(/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var d=$('
').appendTo(document.body);var f=parseInt(d[0].clientWidth);d.remove();var e=-1;var h=false;$.each(c,function(m,l){if(e===-1){e=m}else{if(Math.abs(f-l)/g,"[/size]");b=b.replace(/<(article|header)[^>]+>/g,"
");b=b.replace(/<\/(article|header)>/g,"
");b=b.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

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

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

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

");b=b.replace(/style="([^"]+)"/,function(c,e){var d=e.split(";");var g=[];for(var i=0,f=d.length;i]+)>/g,function(c,d){c=c.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return c});return b},insertAttachment:function(f,d){f=parseInt(f);var b=this.wutil.getOption("woltlab.attachment"+(!d?"Thumbnail":"")+"Url");var e=this.wbbcode._getImageAttachments();if(b&&e[f]!==undefined){var c="";if(d){c=' style="width: '+e[f].width+"px; max-height: "+e[f].height+"px; max-width: "+e[f].width+'px;"'}this.wutil.insertDynamic('","[attach="+f+(d?",none,"+e[f].width:"")+"][/attach]")}else{this.wutil.insertDynamic("[attach="+f+"][/attach]")}},removeAttachment:function(b){if(!this.opts.visual){return}this.$editor.find("img.redactorEmbeddedAttachment").each(function(c,e){var d=$(e);if(d.data("attachmentID")==b){d.remove()}})},_getImageAttachments:function(){var c=this.wutil.getOption("woltlab.attachmentImages")||[];if(c.length){delete this.opts.attachmentImages;return c}var b={imageAttachments:{}};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),b);return b.imageAttachments},_keydownCallback:function(x){switch(x.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;break}this.selection.get();var p=this.selection.getCurrent();var n=this.selection.getParent();n=(n)?$(n):n;var j=(n)?n.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(x.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var h=false;if(j.length){var k=true;for(var b=0;b0){continue}if(c.children.length>1||c.children[0].tagName==="BR"){continue}c=c.children[0];while(c.children.length===1){c=c.children[0]}if(c.children.length===0&&c.tagName==="BR"){var e=c.parentNode;var b=document.createTextNode("\u200b");e.appendChild(b);e.removeChild(c)}}break}},observeQuotes:function(){this.$editor.find(".redactorQuoteEdit").off("click.wbbcode").on("click.wbbcode",$.proxy(this.wbbcode._observeQuotesClick,this))},_observeQuotesClick:function(e){var c=$(e.currentTarget).closest("header");var d=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").click($.proxy(function(f){f.preventDefault();this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(d);var b=c.offset();d.css({left:b.left+"px",top:(b.top+20)+"px"});$(".redactor-link-tooltip").remove();d.appendTo(document.body);this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each((function(b,e){var c=$(e);var d=c.find(".redactorEditCodeBox");if(!d.length){d=$('
'+WCF.Language.get("wcf.bbcode.code.edit")+"
").insertAfter(c.find("> div > div > h3"))}d.off("click.wbbcode").on("click.wbbcode",(function(){this.wbbcode._handleInsertCode(c,false)}).bind(this))}).bind(this))},_openQuoteEditOverlay:function(b,d){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(d?"insert":"edit")),400);var c=this.modal.createActionButton(this.lang.get("save"));if(d){this.selection.save();c.click($.proxy(function(){var g=$("#redactorQuoteAuthor").val();var f=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore();a=true;var e=this.selection.getHtml();if(this.utils.isEmpty(e)){e=""}var h=this.wbbcode.insertQuoteBBCode(g,f,e);if(h!==null){if(!e.length){if($.browser.mozilla){h.children("br[type=_moz]").replaceWith("
"+this.opts.invisibleSpace+"
")}this.caret.setStart(h.children("div")[0])}}this.modal.close()},this))}else{$("#redactorQuoteAuthor").val(b.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(b.attr("cite")));c.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();b.data("author",e);b.attr("data-author",e);b.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this.wbbcode._updateQuoteHeader(b);this.modal.close()},this))}this.modal.show()},_updateQuoteHeader:function(c){var d=c.data("author");var b=c.attr("cite");if(b){b=WCF.String.escapeHTML(b)}c.find("> header > h3").empty().append(this.wbbcode._buildQuoteHeader(d,b))},insertQuoteBBCode:function(g,l,i,j){var k="[quote]";var c="[/quote]";if(g){if(l){k="[quote='"+g+"','"+l+"']"}else{k="[quote='"+g+"']"}}var p=null;if(this.wutil.inWysiwygMode()){var o=WCF.getUUID();var e="";if(j){e=this.wbbcode.convertToHtml(k+j+c)}else{e=this.wbbcode.convertToHtml(k+o+c);e=e.replace(o,i.replace(/^

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

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

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

@@@wcf_empty_line@@@

")}i=d.call(this,i);i=i.replace(/__wcf_zwnj__/g,"\u200C");return i.replace(/__wcf_zwj__/g,"\u200D")}).bind(this);if(this.wutil.getOption("woltlab.autosaveOnce")){this.wutil.saveTextToStorage();delete this.opts.woltlab.autosaveOnce}var c=this.button.get("table");if(c.length){var h=c.data("dropdown");h.find(".redactor-dropdown-add_head").parent().remove();h.find(".redactor-dropdown-delete_head").parent().remove();$('
";return U})};for(var b=B.length-1;b>=0;b--){var v=B[b];var z=new RegExp("@@"+v.hashCode+"@@","g");I=I.replace(z,q(v.content))}}I=I.replace(/<(?:div|p)><(blockquote|div)/g,"<$1");I=I.replace(/<\/(blockquote|div)><\/(?:div|p)>/g,"");if(u.length){for(var b=u.length-1;b>=0;b--){var A=u[b];var z=new RegExp("@@"+A.key+"@@","g");var i=A.value;i=i.replace(/^\[tt\]([\s\S]+)\[\/tt\]/,(function(J,L){var K=L.split("\n");L="";for(var O=0,N=K.length;O

"}L+="[tt]"+M+"[/tt]"}else{if(O===0||(O+1)===N){continue}if(L.match(/\[\/tt\]$/)){L+="

"+this.opts.invisibleSpace+""}else{L+="


"}}}return L}).bind(this));i=i.replace(/^\[code([^\]]*)\]([\S\s]*)\[\/code\]$/,(function(M,U,O){var N="plain";var S=0;var Q="";if(U){U=U.substring(1);U=U.split(",");var P=function(W){return W.match(/^\d+$/)};var L=function(W){return(W.indexOf(".")!==-1)||(W.match(/^(["']).*\1$/))};var K=function(W){return(__REDACTOR_CODE_HIGHLIGHTERS[W]!==undefined)};var J=function(W){return W.replace(/^(["'])(.*)\1$/,"$2")};switch(U.length){case 1:if(P(U[0])){S=(parseInt(U[0])>1)?U[0]:0}else{if(L(U[0])){Q=J(U[0])}else{if(K(U[0])){N=U[0]}}}break;case 2:if(P(U[0])){S=(parseInt(U[0])>1)?U[0]:0;if(K(U[1])){N=U[1]}else{if(L(U[1])){Q=J(U[1])}}}else{if(K(U[0])){N=U[0]}if(L(U[1])){Q=J(U[1])}}break;case 3:if(K(U[0])){N=U[0]}if(P(U[1])){S=U[1]}if(L(U[2])){Q=J(U[2])}break}}O=O.replace(/^\n+/,"").replace(/\n+$/,"").split(/\n/);var V="";for(var T=0;T"+R+""}return'

"+__REDACTOR_CODE_HIGHLIGHTERS[N]+(Q?": "+WCF.String.escapeHTML(Q):"")+'

    '+V+"
"}).bind(this));I=I.replace(z,i)}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:I});return I},_expandFormatting:function(e,c,f){if(!e.length){return c+this.opts.invisibleSpace+f}var b=e.indexOf("[/td]");if(b!==-1){var d=e.substring(0,b);if(d.indexOf("[td]")===-1){return c+d+f+e.substring(b)}}var d=e.split("\n");e="";for(var i=0,h=d.length;i]*)>/g,function(g,j,i){if(i&&i.match(/style="([^"]+?)"/)){if(/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var d=$('
').appendTo(document.body);var f=parseInt(d[0].clientWidth);d.remove();var e=-1;var h=false;$.each(c,function(m,l){if(e===-1){e=m}else{if(Math.abs(f-l)/g,"[/size]");b=b.replace(/<(article|header)[^>]+>/g,"
");b=b.replace(/<\/(article|header)>/g,"
");b=b.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

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

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

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

");b=b.replace(/style="([^"]+)"/,function(c,e){var d=e.split(";");var g=[];for(var i=0,f=d.length;i]+)>/g,function(c,d){c=c.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return c});return b},insertAttachment:function(f,d){f=parseInt(f);var b=this.wutil.getOption("woltlab.attachment"+(!d?"Thumbnail":"")+"Url");var e=this.wbbcode._getImageAttachments();if(b&&e[f]!==undefined){var c="";if(d){c=' style="width: '+e[f].width+"px; max-height: "+e[f].height+"px; max-width: "+e[f].width+'px;"'}this.wutil.insertDynamic('","[attach="+f+(d?",none,"+e[f].width:"")+"][/attach]")}else{this.wutil.insertDynamic("[attach="+f+"][/attach]")}},removeAttachment:function(b){if(!this.opts.visual){return}this.$editor.find("img.redactorEmbeddedAttachment").each(function(c,e){var d=$(e);if(d.data("attachmentID")==b){d.remove()}})},_getImageAttachments:function(){var c=this.wutil.getOption("woltlab.attachmentImages")||[];if(c.length){delete this.opts.attachmentImages;return c}var b={imageAttachments:{}};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),b);return b.imageAttachments},_keydownCallback:function(x){switch(x.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;break}this.selection.get();var p=this.selection.getCurrent();var n=this.selection.getParent();n=(n)?$(n):n;var j=(n)?n.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(x.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var h=false;if(j.length){var k=true;for(var b=0;b0){continue}if(c.children.length>1||c.children[0].tagName==="BR"){continue}c=c.children[0];while(c.children.length===1){c=c.children[0]}if(c.children.length===0&&c.tagName==="BR"){var e=c.parentNode;var b=document.createTextNode("\u200b");e.appendChild(b);e.removeChild(c)}}break}},observeQuotes:function(){this.$editor.find(".redactorQuoteEdit").off("click.wbbcode").on("click.wbbcode",$.proxy(this.wbbcode._observeQuotesClick,this))},_observeQuotesClick:function(e){var c=$(e.currentTarget).closest("header");var d=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").click($.proxy(function(f){f.preventDefault();this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(d);var b=c.offset();d.css({left:b.left+"px",top:(b.top+20)+"px"});$(".redactor-link-tooltip").remove();d.appendTo(document.body);this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each((function(b,e){var c=$(e);var d=c.find(".redactorEditCodeBox");if(!d.length){d=$('
'+WCF.Language.get("wcf.bbcode.code.edit")+"
").insertAfter(c.find("> div > div > h3"))}d.off("click.wbbcode").on("click.wbbcode",(function(){this.wbbcode._handleInsertCode(c,false)}).bind(this))}).bind(this))},_openQuoteEditOverlay:function(b,d){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(d?"insert":"edit")),400);var c=this.modal.createActionButton(this.lang.get("save"));if(d){this.selection.save();c.click($.proxy(function(){var g=$("#redactorQuoteAuthor").val();var f=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore();a=true;var e=this.selection.getHtml();if(this.utils.isEmpty(e)){e=""}var h=this.wbbcode.insertQuoteBBCode(g,f,e);if(h!==null){if(!e.length){if($.browser.mozilla){h.children("br[type=_moz]").replaceWith("
"+this.opts.invisibleSpace+"
")}this.caret.setStart(h.children("div")[0])}}this.modal.close()},this))}else{$("#redactorQuoteAuthor").val(b.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(b.attr("cite")));c.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();b.data("author",e);b.attr("data-author",e);b.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this.wbbcode._updateQuoteHeader(b);this.modal.close()},this))}this.modal.show()},_updateQuoteHeader:function(c){var d=c.data("author");var b=c.attr("cite");if(b){b=WCF.String.escapeHTML(b)}c.find("> header > h3").empty().append(this.wbbcode._buildQuoteHeader(d,b))},insertQuoteBBCode:function(g,l,i,j){var k="[quote]";var c="[/quote]";if(g){if(l){k="[quote='"+g+"','"+l+"']"}else{k="[quote='"+g+"']"}}var p=null;if(this.wutil.inWysiwygMode()){var o=WCF.getUUID();var e="";if(j){e=this.wbbcode.convertToHtml(k+j+c)}else{e=this.wbbcode.convertToHtml(k+o+c);e=e.replace(o,i.replace(/^

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

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

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

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


");if(false&&d==="tt"){var e=(this.selection.getParent())?$(this.selection.getParent()):null;if(e&&e.closest("inline.inlineCode",this.$editor.get()[0]).length){this.inline.toggleClass("inlineCode")}else{this.inline.toggleClass("inlineCode")}}else{this.buffer.set();if(this.utils.browser("mozilla")&&!c.length){var f=getSelection().getRangeAt(0).startContainer;if(f.nodeType===Node.ELEMENT_NODE&&f.tagName==="P"&&f.innerHTML==="
"){f.removeChild(f.children[0])}}if(this._bbcodes[a].voidElement){this.insert.html(c+this.selection.getMarkerAsHtml()+"["+d+"]",false)}else{this.insert.html("["+d+"]"+c+this.selection.getMarkerAsHtml()+"[/"+d+"]",false)}this.selection.restore()}}},insertImage:function(){this.image.show()},_insertImage:function(){var d=$("#redactor-image-link-source");var b=d.val().trim();if(b.length){this.buffer.set();var c=$("#redactor-image-align").val();var a="";if(c==="left"||c==="right"){a=' style="float: '+c+'"'}this.insert.html('",false);this.modal.close();this.observe.images()}else{if(!d.next("small.innerError")){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(d)}}}}}; // wfontcolor.js