Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sat, 4 Oct 2014 13:51:53 +0000 (15:51 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Sat, 4 Oct 2014 13:51:53 +0000 (15:51 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js

index 99ad9c18f11708ec73012bb9b5bcd5e3615ea491..2e22b566f0de7b39c57627d6d3818246a68f14b5 100644 (file)
@@ -1,16 +1,18 @@
+// table.js
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.table=function(){return{getTemplate:function(){return String()+'<section id="redactor-modal-table-insert"><label>'+this.lang.get("rows")+'</label><input type="text" size="5" value="2" id="redactor-table-rows" /><label>'+this.lang.get("columns")+'</label><input type="text" size="5" value="3" id="redactor-table-columns" /></section>'},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=$("<div>"),b=Math.floor(Math.random()*99999),l=$('<table id="table'+b+'"><tbody></tbody></table>'),e,h,j,k;for(e=0;e<n;e++){h=$("<tr>");for(j=0;j<c;j++){k=$("<td>"+this.opts.invisibleSpace+"</td>");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=$("<thead></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=$("<td>");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={init:function(){var c=this.$source.wcfIdentify();this.opts.initCallback=$.proxy(function(){var f=$.trim(this.getOption("wOriginalValue"));if(f.length){this.toggle();this.$source.val(f);this.toggle()}delete this.opts.wOriginalValue},this);this.opts.pasteBeforeCallback=$.proxy(this._wPasteBeforeCallback,this);this.opts.pasteAfterCallback=$.proxy(this._wPasteAfterCallback,this);var e=this.syncClean;var b=this;this.syncClean=function(f){f=f.replace(/<p><br([^>]+)?><\/p>/g,"<p>@@@wcf_empty_line@@@</p>");return e.call(b,f)};if(this.getOption("wAutosaveOnce")){this._saveTextToStorage();delete this.opts.wAutosaveOnce}var a=this.buttonGet("table");if(a.length){var d=a.data("dropdown").children("a.redactor_dropdown_add_head");d.prev().remove();d.next().remove();d.remove();a.click($.proxy(this._tableButtonClick,this))}WCF.System.Event.addListener("com.woltlab.wcf.redactor","insertBBCode_quote_"+c,$.proxy(function(f){f.cancel=true;this._handleInsertQuote()},this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+c,$.proxy(this._wKeydownCallback,this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","keyup_"+c,$.proxy(this._wKeyupCallback,this))},_tableButtonClick:function(b){var c=$(b.currentTarget);if(!c.hasClass("dropact")){return}var a=this.getBlock()||this.getCurrent();var d=c.data("dropdown");d.children("li").show();var e=d.find("> li > .redactor_dropdown_insert_table").parent();if(a.tagName=="TD"){e.hide().next().hide()}else{e.nextAll().hide()}},insertSmiley:function(a,b,c){if(c){this.registerSmiley(a,b)}if(this.opts.visual){this.bufferSet();this.$editor.focus();this.insertHtml('&nbsp;<img src="'+b+'" class="smiley" alt="'+a+'" />&nbsp;');if(this.opts.air){this.$air.fadeOut(100)}this.sync()}else{this.insertAtCaret(" "+a+" ")}},registerSmiley:function(a,b){if(__REDACTOR_SMILIES[a]){return false}__REDACTOR_SMILIES[a]=b;return true},toggle:function(a){if(this.opts.visual){this.sync(undefined,true);this.toggleCode(a);this.$source.val(this.convertFromHtml(this.$source.val()));this.buttonGet("html").children("i").removeClass("fa-square-o").addClass("fa-square")}else{this.$source.val(this.convertToHtml(this.$source.val()));this.toggleVisual();this._observeQuotes();this.buttonGet("html").children("i").removeClass("fa-square").addClass("fa-square-o")}},convertFromHtml:function(m){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforeConvertFromHtml",{html:m});m=m.replace(/&trade;/gi,"\u2122");m=m.replace(/&copy;/gi,"\u00a9");m=m.replace(/&hellip;/gi,"\u2026");m=m.replace(/&mdash;/gi,"\u2014");m=m.replace(/&dash;/gi,"\u2010");m=m.replace(/\r?\n/g,"");var f=m.split(/(<\/?(?:div|p)>)/);var g="";var x="";for(var a=0;a<f.length;a++){var y=f[a];if(y=="<p>"||y=="<div>"){continue}else{if(y=="</p>"||y=="</div>"){x=$.trim(x);if(x!="@@@wcf_empty_line@@@"){x+="\n"}g+=x;x=""}else{if(a==0||a+1==f.length){g+=y}else{x+=y}}}}if(x){g+=x;x=""}m=g;m=m.replace(/@@@wcf_empty_line@@@/g,"\n");m=m.replace(/\n\n$/,"\n");m=m.replace(/<br>$/,"");m=m.replace(/<br>/g,"\n");m=m.replace(/<br>/g,"");m=m.replace(/&nbsp;/gi," ");m=m.replace(/<blockquote class="quoteBox" cite="([^"]+)?" data-author="([^"]+)?">\n?<div[^>]+>\n?<header(?:[^>]*?)>[\s\S]*?<\/header>/gi,function(z,B,A,C){var D;if(A){A=WCF.String.unescapeHTML(A)}if(B){B=WCF.String.unescapeHTML(B)}if(B){D="[quote='"+A+"','"+B+"']"}else{if(A){D="[quote='"+A+"']"}else{D="[quote]"}}return D});m=m.replace(/(?:\n*)<\/blockquote>\n?/gi,"[/quote]\n");m=m.replace(/<a [^>]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi,"[email=$2]$3[/email]");m=m.replace(/<a [^>]*?href=(["'])(.+?)\1.*?>([\s\S]+?)<\/a>/gi,function(B,z,A,C){if(A==C){return"[url]"+A+"[/url]"}return"[url='"+A+"']"+C+"[/url]"});m=m.replace(/<(?:b|strong)>/gi,"[b]");m=m.replace(/<\/(?:b|strong)>/gi,"[/b]");m=m.replace(/<(?:i|em)>/gi,"[i]");m=m.replace(/<\/(?:i|em)>/gi,"[/i]");m=m.replace(/<u>/gi,"[u]");m=m.replace(/<\/u>/gi,"[/u]");m=m.replace(/<(?:s(trike)?|del)>/gi,"[s]");m=m.replace(/<\/(?:s(trike)?|del)>/gi,"[/s]");m=m.replace(/<sub>/gi,"[sub]");m=m.replace(/<\/sub>/gi,"[/sub]");m=m.replace(/<sup>/gi,"[sup]");m=m.replace(/<\/sup>/gi,"[/sup]");m=m.replace(/<img [^>]*?alt="([^"]+?)" class="smiley".*?> ?/gi,"$1 ");m=m.replace(/<img [^>]*?class="smiley" alt="([^"]+?)".*?> ?/gi,"$1 ");m=m.replace(/<img [^>]*?class="redactorEmbeddedAttachment" data-attachment-id="(\d+)"( style="float: (left|right)")?>/gi,function(A,B,z,C){if(C){return"[attach="+B+","+C+"][/attach]"}return"[attach="+B+"][/attach]"});m=m.replace(/<img [^>]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi,"[img='$2',$3][/img]");m=m.replace(/<img [^>]*?src=(["'])([^"']+?)\1.*?>/gi,"[img]$2[/img]");var d=m.split(/(<\/?span[^>]*>)/);var x=[];var p=[];var q="";for(var a=0;a<d.length;a++){var h=d[a];if(h=="</span>"){var c=p.pop();var g=c.start+x.pop()+c.end;if(x.length){x[x.length-1]+=g}else{q+=g}}else{if(h.match(/^<span style="([^"]+)">/)){var k=RegExp.$1;var v;var n;if(k.match(/^color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?$/i)){var u=RegExp.$1;var b=RegExp.$2;var e=RegExp.$3;var s=("0123456789ABCDEF".charAt((u-u%16)/16)+""+"0123456789ABCDEF".charAt(u%16))+""+("0123456789ABCDEF".charAt((b-b%16)/16)+""+"0123456789ABCDEF".charAt(b%16))+""+("0123456789ABCDEF".charAt((e-e%16)/16)+""+"0123456789ABCDEF".charAt(e%16));v="[color=#"+s+"]";n="[/color]"}else{if(k.match(/^color: ?(.*?);?$/i)){v="[color="+RegExp.$1+"]";n="[/color]"}else{if(k.match(/^font-size: ?(\d+)pt;?$/i)){v="[size="+RegExp.$1+"]";n="[/size]"}else{if(k.match(/^font-family: ?(.*?);?$/)){v="[font="+RegExp.$1.replace(/'/g,"")+"]";n="[/font]"}else{v='<span style="'+k+'">';n="</span>"}}}}x[x.length]="";p[x.length]={start:v,end:n}}else{if(h.match(/^<span class="inlineCode">/)){x[x.length]="";p[x.length]={start:"[tt]",end:"[/tt]"}}else{if(x.length){x[x.length-1]+=h}else{q+=h}}}}}m=q;m=m.replace(/<(div|p) style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)\n/gi,function(A,z,C,B){return"[align="+C+"]"+$.trim(B)+"[/align]"});m=m.replace(/<li>/gi,"[*]");m=m.replace(/<\/li>/gi,"");m=m.replace(/<ul>/gi,"[list]");m=m.replace(/<(ol|ul style="list-style-type: decimal")>/gi,"[list=1]");m=m.replace(/<ul style="list-style-type: (none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)">/gi,"[list=$1]");m=m.replace(/<\/(ul|ol)>/gi,"[/list]");m=m.replace(/<table[^>]*>/gi,"[table]\n");m=m.replace(/<\/table>/gi,"[/table]\n");m=m.replace(/<tbody>([\s\S]*?)<\/tbody>/,function(z,A){return $.trim(A)});m=m.replace(/<tr><\/tr>/gi,"");m=m.replace(/<tr>/gi,"[tr]\n");m=m.replace(/<\/tr>/gi,"[/tr]\n");m=m.replace(/<td style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");m=m.replace(/(\t)*<td>(\t)*/gi,"[td]");m=m.replace(/(\t)*<\/td>/gi,"[/td]\n");var w={};m.replace(/<span id="selection-marker-\d+" class="redactor-selection-marker"><\/span>/,function(z){var A=z.hashCode();w[A]=z.replace(/\$/g,"$$$$");return"@@"+A+"@@"});WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","convertFromHtml",{html:m});m=m.replace(/<[^(<|>)]+>/g,"");if($.getLength(w)){for(var j in w){var t=new RegExp("@@"+j+"@@","g");data=data.replace(t,w[j])}}m=m.replace(/&lt;/g,"<");m=m.replace(/&gt;/g,">");m=m.replace(/&amp;/g,"&");m=m.replace(/%28/g,"(");m=m.replace(/%29/g,")");var r={};for(var a=0,i=__REDACTOR_SOURCE_BBCODES.length;a<i;a++){var o=__REDACTOR_SOURCE_BBCODES[a];var l=new RegExp("\\["+o+"([\\S\\s]+?)\\[\\/"+o+"\\]","gi");m=m.replace(l,function(z){var A=z.hashCode();r[A]=z.replace(/\$/g,"$$$$");return"@@"+A+"@@"})}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertFromHtml",{html:m});if($.getLength(r)){for(var j in r){var t=new RegExp("@@"+j+"@@","g");m=m.replace(t,r[j])}}m=$.trim(m);m+="\n";return m},convertToHtml:function(u){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforeConvertToHtml",{data:u});u=this.removeZeroWidthSpace(u);u=u.replace(/&/g,"&amp;");u=u.replace(/</g,"&lt;");u=u.replace(/>/g,"&gt;");var m={};for(var a=0,f=__REDACTOR_SOURCE_BBCODES.length;a<f;a++){var k=__REDACTOR_SOURCE_BBCODES[a];var h=new RegExp("\\["+k+"([\\S\\s]+?)\\[\\/"+k+"\\]","gi");u=u.replace(h,function(v){var w=v.hashCode();m[w]=v.replace(/\$/g,"$$$$");return"@@"+w+"@@"})}u=u.replace(/\[url\]([^"]+?)\[\/url]/gi,'<a href="$1">$1</a>');u=u.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'<a href="$1">$2</a>');u=u.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'<a href="$1">$2</a>');u=u.replace(/\[email\]([^"]+?)\[\/email]/gi,'<a href="mailto:$1">$1</a>');u=u.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'<a href="mailto:$1">$2</a>');u=u.replace(/\[b\](.*?)\[\/b]/gi,"<b>$1</b>");u=u.replace(/\[i\](.*?)\[\/i]/gi,"<i>$1</i>");u=u.replace(/\[u\](.*?)\[\/u]/gi,"<u>$1</u>");u=u.replace(/\[s\](.*?)\[\/s]/gi,"<strike>$1</strike>");u=u.replace(/\[sub\](.*?)\[\/sub]/gi,"<sub>$1</sub>");u=u.replace(/\[sup\](.*?)\[\/sup]/gi,"<sup>$1</sup>");u=u.replace(/\[img\]([^"]+?)\[\/img\]/gi,'<img src="$1" />');u=u.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'<img src="$1" style="float: $2" />');u=u.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'<img src="$1" />');u=u.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'<span style="font-size: $1pt">$2</span>');u=u.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'<span style="color: $1">$2</span>');u=u.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'<span style="font-family: $1">$2</span>');u=u.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'<div style="text-align: $1">$2</div>');u=u.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"<li>$1</li>");u=u.replace(/\[list\]/gi,"<ul>");u=u.replace(/\[list=1\]/gi,'<ul style="list-style-type: decimal">');u=u.replace(/\[list=a\]/gi,'<ul style="list-style-type: lower-latin">');u=u.replace(/\[list=(none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)\]/gi,'<ul style="list-style-type: $1">');u=u.replace(/\[\/list]/gi,"</ul>");u=u.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(v,w){return"[table]"+$.trim(w)+"[/table]"});u=u.replace(/\[table\]/gi,'<table border="1" cellspacing="1" cellpadding="1" style="width: 500px;">');u=u.replace(/\[\/table\]/gi,"</table>");u=u.replace(/\[tr\]/gi,"<tr>");u=u.replace(/\[\/tr\]/gi,"</tr>");u=u.replace(/\[td\]/gi,"<td>");u=u.replace(/\[\/td\]/gi,"</td>");u=u.replace(/<td>([\S\s]*?)<\/td>/gi,function(v,x){var w=$.trim(x);if(!w.length){w="&#8203;"}return"<td>"+w+"</td>"});var b=this.getOption("wAttachmentUrl");if(b){var c=this._getImageAttachmentIDs();u=u.replace(/\[attach=(\d+)(,[^\]]*)?\]\[\/attach\]/g,function(w,x,y){x=parseInt(x);if(WCF.inArray(x,c)){var v="";if(y){if(y.match(/^,'?(left|right)'?/)){v=' style="float: '+RegExp.$1+'"'}}return'<img src="'+b.replace(/987654321/,x)+'" class="redactorEmbeddedAttachment" data-attachment-id="'+x+'"'+v+" />"}return w})}for(var o in __REDACTOR_SMILIES){$smileyCode=o.replace(/</g,"&lt;").replace(/>/g,"&gt;");var e=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");u=u.replace(e,'$1<img src="'+__REDACTOR_SMILIES[o]+'" class="smiley" alt="'+$smileyCode+'" />')}u=u.replace(/(javascript):/gi,"$1<span></span>:");u=u.replace(/(\r|\r\n)/g,"\n");var q=[];var r=[];for(var a=0;a<5;a++){var t=false;u=u.replace(/\[quote.*?\]((?!\[quote)[\s\S])*?\[\/quote\]/gi,function(v){var w=v.hashCode();q.push({hashCode:w,content:v.replace(/\$/g,"$$$$")});r.push(w.toString());t=true;return"@@"+w+"@@"});if(!t){break}}u=u.replace(/(\[quote.*?\])/gi,"$1\n");u=u.replace(/(\[\/quote\])/gi,"\n$1");u=u.replace(/\n*$/,"");var d=u.split("\n");u="";for(var a=0,f=d.length;a<f;a++){var l=$.trim(d[a]);if(l.match(/^<([a-z]+)/)){u+=l;if(!this.opts.rBlockTest.test(RegExp.$1.toUpperCase())){u+="<br>"}}else{if(!l){l="<br>"}else{if(l.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,r)){u+=l;continue}}}u+="<p>"+l+"</p>"}}if($.getLength(m)){for(var g in m){var p=new RegExp("@@"+g+"@@","g");u=u.replace(p,m[g])}u=u.replace(/\[tt\](.*?)\[\/tt\]/gi,'<span class="inlineCode">$1</span>')}u=u.replace(/\[code\][\S\s]*?\[\/code\]/,"<pre>$&</pre>");if(q.length){var s=function(v){return v.replace(/^['"]/,"").replace(/['"]$/,"")};var j=this;var i=function(v){return v.replace(/\[quote([^\]]+)?\]([\S\s]*)\[\/quote\]?/gi,$.proxy(function(y,x,A){var E="";var z="";if(x){x=x.substr(1);x=x.split(",");switch(x.length){case 1:E=x[0];break;case 2:E=x[0];z=x[1];break}E=WCF.String.escapeHTML(s($.trim(E)));z=WCF.String.escapeHTML(s($.trim(z)))}var F='<blockquote class="quoteBox" cite="'+z+'" data-author="'+E+'"><div class="container containerPadding"><header contenteditable="false"><h3>'+j._buildQuoteHeader(E,z)+'</h3><a class="redactorQuoteEdit"></a></header>';A=$.trim(A);var w="";if(A.length){var D=A.split("\n");for(var C=0;C<D.length;C++){var B=D[C];if(B.length===0){B=j.opts.invisibleSpace}else{if(B.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,r)){w+=B;continue}}}w+="<div>"+B+"</div>"}}else{w="<div>"+j.opts.invisibleSpace+"</div>"}F+=w;F+="</blockquote>";return F},this))};for(var a=q.length-1;a>=0;a--){var n=q[a];var p=new RegExp("@@"+n.hashCode+"@@","g");u=u.replace(p,i(n.content))}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:u});return u},_wPasteBeforeCallback:function(a){var b={1:24,2:22,3:18,4:14,5:12,6:10};a=a.replace(/<h([1-6])[^>]+>/g,function(c,d){return"[size="+b[d]+"]"});a=a.replace(/<\/h[1-6]>/g,"[/size]");a=a.replace(/<(article|header)[^>]+>/g,"<div>");a=a.replace(/<\/(article|header)>/g,"</div>");a=a.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"<p>");a=a.replace(/<\/(div|p)><\/(div|p)>/g,"</p>@@@wcf_break@@@");a=a.replace(/<(div|p)><br><\/(div|p)>/g,"@@@wcf_break@@@");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:a});return a},_wPasteAfterCallback:function(a){a=a.replace(/<p>([\s\S]*?)<\/p>/g,"<p>$1<br></p>");a=a.replace(/<header[^>]*>/g,"");a=a.replace(/<\/header>/g,"");a=a.replace(/<div>(.*?)<\/div>/g,"<p>$1</p>");a=a.replace(/<\/?div>/g,"");a=a.replace(/@@@wcf_break@@@/g,"<p><br></p>");a=a.replace(/<p><p>/g,"<p>");a=a.replace(/\[size=(\d+)\]/g,'<p><br></p><p><inline style="font-size: $1pt">');a=a.replace(/\[\/size\]/g,"</inline></p><p><br></p>");a=a.replace(/<img([^>]+)>/g,function(b,c){b=b.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return b});WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:a});return a},insertAttachment:function(d){d=parseInt(d);var b=this.getOption("wAttachmentUrl");var c="[attach="+d+"][/attach]";var a=this._getImageAttachmentIDs();if(b&&WCF.inArray(d,a)){this.insertDynamic('<img src="'+b.replace(/987654321/,d)+'" class="redactorEmbeddedAttachment" data-attachment-id="'+d+'" />',c)}else{this.insertDynamic(c)}},_getImageAttachmentIDs:function(){var a=this.getOption("wAttachmentImageIDs")||[];if(a.length){delete this.opts.wAttachmentImageIDs;return a}var b={imageAttachmentIDs:[]};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$source.wcfIdentify(),b);return b.imageAttachmentIDs},_wKeydownCallback:function(f){switch(f.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.UP:break;default:return;break}var a=$(this.getCurrent());var e=this.getParent();e=(e)?$(e):e;var l=(e)?e.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(f.event.which){case $.ui.keyCode.BACKSPACE:if(this.isCaret()){if(l.length){var d=true;l.find("div > div").each(function(){if($(this).text().replace(/\u200B/,"").length){d=false;return false}});if(d){var g=window.getSelection();if(g.rangeCount){g.removeAllRanges()}var h=document.createRange();h.selectNode(l[0]);g.addRange(h);f.cancel=true}}}else{var i=this.getRange().cloneContents();if(this.containsTag(i,"BLOCKQUOTE")){this.bufferSet()}}break;case $.ui.keyCode.DELETE:if(this.isCaret()){if(this.isEndOfElement(a[0])&&a.next("blockquote").length){var g=window.getSelection();if(g.rangeCount){g.removeAllRanges()}var h=document.createRange();h.selectNode(a.next()[0]);g.addRange(h);f.cancel=true}}else{var i=this.getRange().cloneContents();if(this.containsTag(i,"BLOCKQUOTE")){this.bufferSet()}}break;case $.ui.keyCode.DOWN:if(a.next("blockquote.quoteBox").length){this.selectionStart(a.next().find("> div > div:first"));f.cancel=true}else{if(e){if(e.next("blockquote.quoteBox").length){this.selectionStart(e.next().find("> div > div:first"));f.cancel=true}else{if(l.length){var k=a.closest("div",l[0]);if(!k.next().length){if(l.next().length){this.setSelectionStart(l.next())}else{this.insertingAfterLastElement(l)}f.cancel=true}}}}}break;case $.ui.keyCode.UP:if(!e||!l.length){return}var k=a.closest("div",l[0]);var c=k.prev();if(c[0].tagName==="DIV"){return}else{if(c[0].tagName==="BLOCKQUOTE"){return}}var j=l.prev();if(j.length===0){var b=$(this.opts.emptyHtml);b.insertBefore(l);this.selectionStart(b)}else{if(j[0].tagName==="BLOCKQUOTE"){this.selectionEnd(j.find("> div > div:last"))}else{if($.trim(j.html())==""){j.html(this.opts.invisibleSpace)}this.selectionEnd(j)}}f.cancel=true;break}},_wKeyupCallback:function(a){if(a.event.which!==$.ui.keyCode.BACKSPACE&&a.event.which!==$.ui.keyCode.DELETE){return}this.$editor.find("blockquote").each(function(b,d){var c=$(d);if(!c.find("> div > header").length){c.remove()}})},_observeQuotes:function(){this.$editor.find(".redactorQuoteEdit:not(.jsRedactorQuoteEdit)").addClass("jsRedactorQuoteEdit").click($.proxy(this._observeQuotesClick,this))},_observeQuotesClick:function(d){var b=$(d.currentTarget).closest("header");var c=$('<span class="redactor-link-tooltip" />');$('<a href="#">'+WCF.Language.get("wcf.bbcode.quote.edit")+"</a>").click($.proxy(function(f){f.preventDefault();this._openQuoteEditOverlay($(d.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(c);var a=b.offset();c.css({left:a.left+"px",top:(a.top+20)+"px"});$(".redactor-link-tooltip").remove();c.appendTo(document.body)},_openQuoteEditOverlay:function(a,b){if(b){this.modalInit(WCF.Language.get("wcf.bbcode.quote.insert"),this.opts.modal_quote,300,$.proxy(function(){$("#redactorEditQuote").click($.proxy(function(){var d=$("#redactorQuoteAuthor").val();var c=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.insertQuoteBBCode(d,c);this.modalClose()},this))},this))}else{this.modalInit(WCF.Language.get("wcf.bbcode.quote.edit"),this.opts.modal_quote,300,$.proxy(function(){if(!b){$("#redactorQuoteAuthor").val(a.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(a.attr("cite")))}$("#redactorEditQuote").click($.proxy(function(){var c=$("#redactorQuoteAuthor").val();a.data("author",c);a.attr("data-author",c);a.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this._updateQuoteHeader(a);this.modalClose()},this))},this))}},_updateQuoteHeader:function(b){var c=b.data("author");var a=b.attr("cite");if(a){a=WCF.String.escapeHTML(a)}b.find("> div > header > h3").empty().append(this._buildQuoteHeader(c,a))},insertQuoteBBCode:function(c,e,b,a){var d="[quote]";if(c){if(e){d="[quote='"+c+"','"+e+"']"}else{d="[quote='"+c+"']"}}if(a){d+=a}d+="[/quote]";if(this.inWysiwygMode()){d=this.convertToHtml(d);this.insertHtml(d);this._observeQuotes();this.$toolbar.find("a.re-__wcf_quote").addClass("redactor_button_disabled")}else{this.insertAtCaret(d)}},_buildQuoteHeader:function(b,c){var a="";if(!b&&c){b=c;c=""}if(b){if(c){a+='<a href="'+c+'">'}a+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(b)});if(c){a+="</a>"}}else{a="<small>"+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+"</small>"}return a},_handleInsertQuote:function(){this._openQuoteEditOverlay(null,true)}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode=function(){return{init:function(){var c=this.$textarea.wcfIdentify();this.opts.initCallback=$.proxy(function(){var e=$.trim(this.wutil.getOption("wOriginalValue"));if(e.length){this.toggle();this.$textarea.val(e);this.toggle()}delete this.opts.wOriginalValue},this);this.opts.pasteBeforeCallback=$.proxy(this.wbbcode._pasteBeforeCallback,this);this.opts.pasteCallback=$.proxy(this.wbbcode._pasteCallback,this);var b=this.clean.onSync;this.clean.onSync=function(e){e=e.replace(/<p><br([^>]+)?><\/p>/g,"<p>@@@wcf_empty_line@@@</p>");return b.call(self,e)};if(this.wutil.getOption("wAutosaveOnce")){this.wutil._saveTextToStorage();delete this.opts.wAutosaveOnce}var a=this.button.get("table");if(a.length){var d=a.data("dropdown");d.find(".redactor-dropdown-add_head").parent().remove();d.find(".redactor-dropdown-delete_head").parent().remove();$('<li class="dropdownDivider" />').insertBefore(d.find(".redactor-dropdown-delete_table").parent());a.click($.proxy(this.wbbcode._tableButtonClick,this))}WCF.System.Event.addListener("com.woltlab.wcf.redactor","insertBBCode_quote_"+c,$.proxy(function(e){e.cancel=true;this.wbbcode._handleInsertQuote()},this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+c,$.proxy(this.wbbcode._keydownCallback,this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","keyup_"+c,$.proxy(this.wbbcode._keyupCallback,this));this.code.sync=function(){};this.code.toggle=(function(){if(this.opts.visual){this.code.startSync();this.code.showCode();this.$textarea.val(this.wbbcode.convertFromHtml(this.$textarea.val()));this.button.get("html").children("i").removeClass("fa-square-o").addClass("fa-square")}else{this.$textarea.val(this.wbbcode.convertToHtml(this.$textarea.val()));this.code.showVisual();this.wbbcode._observeQuotes();this.button.get("html").children("i").removeClass("fa-square").addClass("fa-square-o")}}).bind(this)},_tableButtonClick:function(b){var c=$(b.currentTarget);if(!c.hasClass("dropact")){return}var a=this.selection.getBlock()||this.selection.getCurrent();var d=c.data("dropdown");d.children("li").show();var e=d.find("> li > .redactor-dropdown-insert_table").parent();if(a.tagName=="TD"){e.hide()}else{e.nextAll().hide()}},insertSmiley:function(a,b,c){if(c){this.registerSmiley(a,b)}if(this.opts.visual){this.bufferSet();this.$editor.focus();this.insertHtml('&nbsp;<img src="'+b+'" class="smiley" alt="'+a+'" />&nbsp;')}else{this.insertAtCaret(" "+a+" ")}},registerSmiley:function(a,b){if(__REDACTOR_SMILIES[a]){return false}__REDACTOR_SMILIES[a]=b;return true},convertFromHtml:function(n){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforeConvertFromHtml",{html:n});n=n.replace(/&trade;/gi,"\u2122");n=n.replace(/&copy;/gi,"\u00a9");n=n.replace(/&hellip;/gi,"\u2026");n=n.replace(/&mdash;/gi,"\u2014");n=n.replace(/&dash;/gi,"\u2010");n=n.replace(/\r?\n/g,"");n=n.replace(/<a[^>]*?><\/a>/g,"");n=n.replace(/<p><\/p>/g,"");n=n.replace(/<br( \/)?><\/p>/g,"");var g=n.split(/(<\/?(?:div|p)>)/);var h="";var y="";for(var a=0;a<g.length;a++){var z=g[a];if(z=="<p>"||z=="<div>"){continue}else{if(z=="</p>"||z=="</div>"){y=$.trim(y);if(y!="@@@wcf_empty_line@@@"){y+="\n"}h+=y;y=""}else{if(a==0||a+1==g.length){h+=z}else{y+=z}}}}if(y){h+=y;y=""}n=h;n=n.replace(/@@@wcf_empty_line@@@/g,"\n");n=n.replace(/\n\n$/,"\n");n=n.replace(/<br>$/,"");n=n.replace(/<br>/g,"\n");n=n.replace(/<br>/g,"");n=n.replace(/&nbsp;/gi," ");n=n.replace(/<blockquote class="quoteBox" cite="([^"]+)?" data-author="([^"]+)?">\n?<div[^>]+>\n?<header(?:[^>]*?)>[\s\S]*?<\/header>/gi,function(A,C,B,D){var E;if(B){B=WCF.String.unescapeHTML(B)}if(C){C=WCF.String.unescapeHTML(C)}if(C){E="[quote='"+B+"','"+C+"']"}else{if(B){E="[quote='"+B+"']"}else{E="[quote]"}}return E});n=n.replace(/(?:\n*)<\/blockquote>\n?/gi,"[/quote]\n");n=n.replace(/<a [^>]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi,"[email=$2]$3[/email]");n=n.replace(/<a[^>]+><\/a>/,"");n=n.replace(/<a [^>]*?href=(["'])(.+?)\1.*?>([\s\S]+?)<\/a>/gi,function(C,A,B,D){if(B==D){return"[url]"+B+"[/url]"}return"[url='"+B+"']"+D+"[/url]"});n=n.replace(/<(?:b|strong)>/gi,"[b]");n=n.replace(/<\/(?:b|strong)>/gi,"[/b]");n=n.replace(/<(?:i|em)>/gi,"[i]");n=n.replace(/<\/(?:i|em)>/gi,"[/i]");n=n.replace(/<u>/gi,"[u]");n=n.replace(/<\/u>/gi,"[/u]");n=n.replace(/<(?:s(trike)?|del)>/gi,"[s]");n=n.replace(/<\/(?:s(trike)?|del)>/gi,"[/s]");n=n.replace(/<sub>/gi,"[sub]");n=n.replace(/<\/sub>/gi,"[/sub]");n=n.replace(/<sup>/gi,"[sup]");n=n.replace(/<\/sup>/gi,"[/sup]");n=n.replace(/<img [^>]*?alt="([^"]+?)" class="smiley".*?> ?/gi,"$1 ");n=n.replace(/<img [^>]*?class="smiley" alt="([^"]+?)".*?> ?/gi,"$1 ");n=n.replace(/<img [^>]*?class="redactorEmbeddedAttachment" data-attachment-id="(\d+)"( style="float: (left|right)")?>/gi,function(B,C,A,D){if(D){return"[attach="+C+","+D+"][/attach]"}return"[attach="+C+"][/attach]"});n=n.replace(/<img [^>]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi,"[img='$2',$3][/img]");n=n.replace(/<img [^>]*?src=(["'])([^"']+?)\1.*?>/gi,"[img]$2[/img]");var e=n.split(/(<\/?span[^>]*>)/);var y=[];var q=[];var r="";var c={11:8,13:10,16:12,19:14,24:18,29:22,32:24,48:36};for(var a=0;a<e.length;a++){var i=e[a];if(i=="</span>"){var d=q.pop();var h=d.start+y.pop()+d.end;if(y.length){y[y.length-1]+=h}else{r+=h}}else{if(i.match(/^<span/)){if(i.match(/^<span(?:.*?)style="([^"]+)"(?:[^>]*?)>/)){var l=RegExp.$1;var w;var o;if(l.match(/color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?/i)){var v=RegExp.$1;var b=RegExp.$2;var f=RegExp.$3;var t=("0123456789ABCDEF".charAt((v-v%16)/16)+""+"0123456789ABCDEF".charAt(v%16))+""+("0123456789ABCDEF".charAt((b-b%16)/16)+""+"0123456789ABCDEF".charAt(b%16))+""+("0123456789ABCDEF".charAt((f-f%16)/16)+""+"0123456789ABCDEF".charAt(f%16));w="[color=#"+t+"]";o="[/color]"}else{if(l.match(/color: ?(.*?);?/i)){w="[color="+RegExp.$1+"]";o="[/color]"}else{if(l.match(/font-size: ?(\d+)(pt|px);?/i)){if(RegExp.$2=="pt"){w="[size="+RegExp.$1+"]";o="[/size]"}else{if(c[RegExp.$1]){w="[size="+c[RegExp.$1]+"]";o="[/size]"}else{w="";o=""}}}else{if(l.match(/font-family: ?(.*?);?/)){w="[font="+RegExp.$1.replace(/'/g,"")+"]";o="[/font]"}else{w='<span style="'+l+'">';o="</span>"}}}}y[y.length]="";q[y.length]={start:w,end:o}}else{if(i.match(/^<span class="inlineCode">/)){y[y.length]="";q[y.length]={start:"[tt]",end:"[/tt]"}}else{y[y.length]="";q[y.length]={start:"",end:""}}}}else{if(y.length){y[y.length-1]+=i}else{r+=i}}}}n=r;n=n.replace(/<(div|p) style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)\n/gi,function(B,A,D,C){return"[align="+D+"]"+$.trim(C)+"[/align]"});n=n.replace(/<li>/gi,"[*]");n=n.replace(/<\/li>/gi,"");n=n.replace(/<ul>/gi,"[list]");n=n.replace(/<(ol|ul style="list-style-type: decimal")>/gi,"[list=1]");n=n.replace(/<ul style="list-style-type: (none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)">/gi,"[list=$1]");n=n.replace(/<\/(ul|ol)>/gi,"[/list]");n=n.replace(/<table[^>]*>/gi,"[table]\n");n=n.replace(/<\/table>/gi,"[/table]\n");n=n.replace(/<tbody>([\s\S]*?)<\/tbody>/,function(A,B){return $.trim(B)});n=n.replace(/<tr><\/tr>/gi,"");n=n.replace(/<tr>/gi,"[tr]\n");n=n.replace(/<\/tr>/gi,"[/tr]\n");n=n.replace(/<td style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");n=n.replace(/(\t)*<td>(\t)*/gi,"[td]");n=n.replace(/(\t)*<\/td>/gi,"[/td]\n");var x={};n.replace(/<span id="selection-marker-\d+" class="redactor-selection-marker"><\/span>/,function(A){var B=A.hashCode();x[B]=A.replace(/\$/g,"$$$$");return"@@"+B+"@@"});WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","convertFromHtml",{html:n});n=n.replace(/<[^(<|>)]+>/g,"");if($.getLength(x)){for(var k in x){var u=new RegExp("@@"+k+"@@","g");data=data.replace(u,x[k])}}n=n.replace(/&lt;/g,"<");n=n.replace(/&gt;/g,">");n=n.replace(/&amp;/g,"&");n=n.replace(/%28/g,"(");n=n.replace(/%29/g,")");var s={};for(var a=0,j=__REDACTOR_SOURCE_BBCODES.length;a<j;a++){var p=__REDACTOR_SOURCE_BBCODES[a];var m=new RegExp("\\["+p+"([\\S\\s]+?)\\[\\/"+p+"\\]","gi");n=n.replace(m,function(A){var B=A.hashCode();s[B]=A.replace(/\$/g,"$$$$");return"@@"+B+"@@"})}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertFromHtml",{html:n});if($.getLength(s)){for(var k in s){var u=new RegExp("@@"+k+"@@","g");n=n.replace(u,s[k])}}n=$.trim(n);n+="\n";return n},convertToHtml:function(v){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforeConvertToHtml",{data:v});v=this.wutil.removeZeroWidthSpace(v);v=v.replace(/&/g,"&amp;");v=v.replace(/</g,"&lt;");v=v.replace(/>/g,"&gt;");var n={};for(var a=0,g=__REDACTOR_SOURCE_BBCODES.length;a<g;a++){var l=__REDACTOR_SOURCE_BBCODES[a];var i=new RegExp("\\["+l+"([\\S\\s]+?)\\[\\/"+l+"\\]","gi");v=v.replace(i,function(w){var x=w.hashCode();n[x]=w.replace(/\$/g,"$$$$");return"@@"+x+"@@"})}v=v.replace(/\[url\]([^"]+?)\[\/url]/gi,'<a href="$1">$1</a>');v=v.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'<a href="$1">$2</a>');v=v.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'<a href="$1">$2</a>');v=v.replace(/\[email\]([^"]+?)\[\/email]/gi,'<a href="mailto:$1">$1</a>');v=v.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'<a href="mailto:$1">$2</a>');v=v.replace(/\[b\](.*?)\[\/b]/gi,"<b>$1</b>");v=v.replace(/\[i\](.*?)\[\/i]/gi,"<i>$1</i>");v=v.replace(/\[u\](.*?)\[\/u]/gi,"<u>$1</u>");v=v.replace(/\[s\](.*?)\[\/s]/gi,"<strike>$1</strike>");v=v.replace(/\[sub\](.*?)\[\/sub]/gi,"<sub>$1</sub>");v=v.replace(/\[sup\](.*?)\[\/sup]/gi,"<sup>$1</sup>");v=v.replace(/\[img\]([^"]+?)\[\/img\]/gi,'<img src="$1" />');v=v.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'<img src="$1" style="float: $2" />');v=v.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'<img src="$1" />');v=v.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'<span style="font-size: $1pt">$2</span>');v=v.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'<span style="color: $1">$2</span>');v=v.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'<span style="font-family: $1">$2</span>');v=v.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'<div style="text-align: $1">$2</div>');v=v.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"<li>$1</li>");v=v.replace(/\[list\]/gi,"<ul>");v=v.replace(/\[list=1\]/gi,'<ul style="list-style-type: decimal">');v=v.replace(/\[list=a\]/gi,'<ul style="list-style-type: lower-latin">');v=v.replace(/\[list=(none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)\]/gi,'<ul style="list-style-type: $1">');v=v.replace(/\[\/list]/gi,"</ul>");v=v.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(w,x){return"[table]"+$.trim(x)+"[/table]"});v=v.replace(/\[table\]/gi,'<table border="1" cellspacing="1" cellpadding="1" style="width: 500px;">');v=v.replace(/\[\/table\]/gi,"</table>");v=v.replace(/\[tr\]/gi,"<tr>");v=v.replace(/\[\/tr\]/gi,"</tr>");v=v.replace(/\[td\]/gi,"<td>");v=v.replace(/\[\/td\]/gi,"</td>");v=v.replace(/<td>([\S\s]*?)<\/td>/gi,function(w,y){var x=$.trim(y);if(!x.length){x="&#8203;"}return"<td>"+x+"</td>"});var b=this.wutil.getOption("wAttachmentUrl");if(b){var c=this.wbbcode._getImageAttachmentIDs();v=v.replace(/\[attach=(\d+)(,[^\]]*)?\]\[\/attach\]/g,function(x,y,z){y=parseInt(y);if(WCF.inArray(y,c)){var w="";if(z){if(z.match(/^,'?(left|right)'?/)){w=' style="float: '+RegExp.$1+'"'}}return'<img src="'+b.replace(/987654321/,y)+'" class="redactorEmbeddedAttachment" data-attachment-id="'+y+'"'+w+" />"}return x})}for(var p in __REDACTOR_SMILIES){var f=p.replace(/</g,"&lt;").replace(/>/g,"&gt;");var e=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp(f)+"(?=\\s|<|$)","gi");v=v.replace(e,'$1<img src="'+__REDACTOR_SMILIES[p]+'" class="smiley" alt="'+f+'" />')}v=v.replace(/(javascript):/gi,"$1<span></span>:");v=v.replace(/(\r|\r\n)/g,"\n");var r=[];var s=[];for(var a=0;a<5;a++){var u=false;v=v.replace(/\[quote.*?\]((?!\[quote)[\s\S])*?\[\/quote\]/gi,function(w){var x=w.hashCode();r.push({hashCode:x,content:w.replace(/\$/g,"$$$$")});s.push(x.toString());u=true;return"@@"+x+"@@"});if(!u){break}}v=v.replace(/(\[quote.*?\])/gi,"$1\n");v=v.replace(/(\[\/quote\])/gi,"\n$1");v=v.replace(/\n*$/,"");var d=v.split("\n");console.debug(d);v="";for(var a=0,g=d.length;a<g;a++){var m=$.trim(d[a]);if(m.match(/^<([a-z]+)/)){if(!this.reIsBlock.test(RegExp.$1.toUpperCase())){m="<p>"+m+"</p>"}v+=m}else{if(!m){m="<br>"}else{if(m.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,s)){v+=m;continue}}}v+="<p>"+m+"</p>"}}console.debug(v);if($.getLength(n)){for(var h in n){var q=new RegExp("@@"+h+"@@","g");v=v.replace(q,n[h])}v=v.replace(/\[tt\](.*?)\[\/tt\]/gi,'<span class="inlineCode">$1</span>')}v=v.replace(/\[code\][\S\s]*?\[\/code\]/,"<pre>$&</pre>");if(r.length){var t=function(w){return w.replace(/^['"]/,"").replace(/['"]$/,"")};var k=this;var j=function(w){return w.replace(/\[quote([^\]]+)?\]([\S\s]*)\[\/quote\]?/gi,function(z,y,B){var F="";var A="";if(y){y=y.substr(1);y=y.split(",");switch(y.length){case 1:F=y[0];break;case 2:F=y[0];A=y[1];break}F=WCF.String.escapeHTML(t($.trim(F)));A=WCF.String.escapeHTML(t($.trim(A)))}var G='<blockquote class="quoteBox" cite="'+A+'" data-author="'+F+'"><div class="container containerPadding"><header contenteditable="false"><h3>'+k.wbbcode._buildQuoteHeader(F,A)+'</h3><a class="redactorQuoteEdit"></a></header>';B=$.trim(B);var x="";if(B.length){var E=B.split("\n");for(var D=0;D<E.length;D++){var C=E[D];if(C.length===0){C=k.opts.invisibleSpace}else{if(C.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,s)){x+=C;continue}}}x+="<div>"+C+"</div>"}}else{x="<div>wcf"+k.opts.invisibleSpace+"</div>"}G+=x;G+="</div></blockquote>";return G})};for(var a=r.length-1;a>=0;a--){var o=r[a];var q=new RegExp("@@"+o.hashCode+"@@","g");v=v.replace(q,j(o.content))}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:v});return v},_pasteBeforeCallback:function(a){var b={1:24,2:22,3:18,4:14,5:12,6:10};a=a.replace(/<h([1-6])[^>]+>/g,function(c,d){return"[size="+b[d]+"]"});a=a.replace(/<\/h[1-6]>/g,"[/size]");a=a.replace(/<(article|header)[^>]+>/g,"<div>");a=a.replace(/<\/(article|header)>/g,"</div>");a=a.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"<p>");a=a.replace(/<\/(div|p)><\/(div|p)>/g,"</p>");a=a.replace(/<(div|p)><br><\/(div|p)>/g,"<p>");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:a});return a},_pasteCallback:function(a){a=a.replace(/<p>([\s\S]*?)<\/p>/g,function(b,c){if(c.match(/<br( \/)?>$/)){return b}return"<p>"+c+"</p><p><br></p>"});a=a.replace(/\[size=(\d+)\]/g,'<p><span style="font-size: $1pt">');a=a.replace(/\[\/size\]/g,"</span></p>");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:a});return a;a=a.replace(/<img([^>]+)>/g,function(b,c){b=b.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return b});return a},insertAttachment:function(d){d=parseInt(d);var b=this.getOption("wAttachmentUrl");var c="[attach="+d+"][/attach]";var a=this.wbbcode._getImageAttachmentIDs();if(b&&WCF.inArray(d,a)){this.insertDynamic('<img src="'+b.replace(/987654321/,d)+'" class="redactorEmbeddedAttachment" data-attachment-id="'+d+'" />',c)}else{this.insertDynamic(c)}},_getImageAttachmentIDs:function(){var a=this.wutil.getOption("wAttachmentImageIDs")||[];if(a.length){delete this.opts.wAttachmentImageIDs;return a}var b={imageAttachmentIDs:[]};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),b);return b.imageAttachmentIDs},_keydownCallback:function(f){switch(f.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.ENTER:case $.ui.keyCode.TAB:case $.ui.keyCode.UP:break;default:return;break}this.selection.get();var a=$(this.selection.getCurrent());var e=this.selection.getParent();e=(e)?$(e):e;var k=(e)?e.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(f.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){if(k.length){var c=true;k.find("div > div").each(function(){if($(this).text().replace(/\u200B/,"").length){c=false;return false}});if(c){var g=window.getSelection();if(g.rangeCount){g.removeAllRanges()}var h=document.createRange();h.selectNode(k[0]);g.addRange(h);f.cancel=true}}}break;case $.ui.keyCode.DELETE:if(this.wutil.isCaret()){if(this.wutil.isEndOfElement(a[0])&&a.next("blockquote").length){var g=window.getSelection();if(g.rangeCount){g.removeAllRanges()}var h=document.createRange();h.selectNode(a.next()[0]);g.addRange(h);f.cancel=true}}break;case $.ui.keyCode.DOWN:if(a.next("blockquote").length){this.caret.setStart(a.next().find("> div > div:first"));f.cancel=true}else{if(e){if(e.next("blockquote").length){this.caret.setStart(e.next().find("> div > div:first"));f.cancel=true}else{if(k.length){var j=a.closest("div",k[0]);if(!j.next().length){if(k.next().length){this.caret.setStart(k.next())}else{this.wutil.setCaretAfter(k)}f.cancel=true}}}}}break;case $.ui.keyCode.ENTER:if(k.length){this.keydown.blockquote=false;this.keydown.enterWithinBlockquote=true}break;case $.ui.keyCode.TAB:var d=this.selection.getBlock();if(!d||d.tagName!=="LI"){f.cancel=true}break;case $.ui.keyCode.UP:if(!e||!k.length){return}var j=a.closest("div",k[0]);var b=j.prev();if(b[0].tagName==="DIV"){return}else{if(b[0].tagName==="BLOCKQUOTE"){return}}var i=k.prev();if(i.length===0){this.wutil.setCaretBefore(k)}else{if(i[0].tagName==="BLOCKQUOTE"){this.caret.sendEnd(i.find("> div > div:last"))}else{if($.trim(i.html())==""){i.html(this.opts.invisibleSpace)}this.caret.setEnd(i)}}f.cancel=true;break}},_keyupCallback:function(a){if(a.event.which!==$.ui.keyCode.BACKSPACE&&a.event.which!==$.ui.keyCode.DELETE){return}this.$editor.find("blockquote").each(function(b,d){var c=$(d);if(!c.find("> div > header").length){c.remove()}})},_observeQuotes:function(){this.$editor.find(".redactorQuoteEdit:not(.jsRedactorQuoteEdit)").addClass("jsRedactorQuoteEdit").click($.proxy(this.wbbcode._observeQuotesClick,this))},_observeQuotesClick:function(d){var b=$(d.currentTarget).closest("header");var c=$('<span class="redactor-link-tooltip" />');$('<a href="#">'+WCF.Language.get("wcf.bbcode.quote.edit")+"</a>").click($.proxy(function(f){f.preventDefault();this._openQuoteEditOverlay($(d.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(c);var a=b.offset();c.css({left:a.left+"px",top:(a.top+20)+"px"});$(".redactor-link-tooltip").remove();c.appendTo(document.body);$('<div contenteditable="true" />').appendTo(document.body).focus().remove()},_openQuoteEditOverlay:function(a,c){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(c?"insert":"edit")),400);var b=this.modal.createActionButton(this.lang.get("save"));if(c){b.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();var d=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.wbbcode.insertQuoteBBCode(e,d);this.modal.close()},this))}else{$("#redactorQuoteAuthor").val(a.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(a.attr("cite")));b.click($.proxy(function(){var d=$("#redactorQuoteAuthor").val();a.data("author",d);a.attr("data-author",d);a.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this.wbbcode._updateQuoteHeader(a);this.modalClose()},this))}this.modal.show()},_updateQuoteHeader:function(b){var c=b.data("author");var a=b.attr("cite");if(a){a=WCF.String.escapeHTML(a)}b.find("> div > header > h3").empty().append(this.wbbcode._buildQuoteHeader(c,a))},insertQuoteBBCode:function(c,e,b,a){var d="[quote]";if(c){if(e){d="[quote='"+c+"','"+e+"']"}else{d="[quote='"+c+"']"}}if(a){d+=a}d+="[/quote]";if(this.wutil.inWysiwygMode()){d=this.wbbcode.convertToHtml(d);this.insert.html(d,false);this.wbbcode._observeQuotes();this.$toolbar.find("a.re-__wcf_quote").addClass("redactor-button-disabled")}else{this.wutil.insertAtCaret(d)}},_buildQuoteHeader:function(b,c){var a="";if(!b&&c){b=c;c=""}if(b){if(c){a+='<a href="'+c+'">'}a+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(b)});if(c){a+="</a>"}}else{a="<small>"+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+"</small>"}return a},_handleInsertQuote:function(){this.wbbcode._openQuoteEditOverlay(null,true)}}};
 // wbutton.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbutton={_bbcodes:{},init:function(){this._bbcodes={};for(var g=0,d=__REDACTOR_BUTTONS.length;g<d;g++){this._addBBCodeButton(__REDACTOR_BUTTONS[g])}var a={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"};var b=this.getOption("buttons");var f="";for(var g=0,d=b.length;g<d;g++){var c=b[g];if(c=="separator"){this.buttonGet(f).parent().addClass("separator");continue}var e=this.buttonGet(c);if(e.length){if(a[c]){this.buttonAwesome(c,a[c])}}else{this._addCoreButton(c,(a[c]?a[c]:null),f)}f=c}},_addCoreButton:function(b,a,c){var d=this.buttonBuild(b,{title:b,exec:b},false);$("<li />").append(d).insertAfter(this.buttonGet(c).parent());if(a!==null){this.buttonAwesome(b,a)}},_addBBCodeButton:function(b){var c="__wcf_"+b.name;var a=this.buttonAdd(c,b.label,this._insertBBCode);this._bbcodes[c]=b.name;if(b.icon.match(/^fa\-[a-z\-]+$/)){this.buttonAwesome(c,b.icon)}else{a.css("background-image","url("+__REDACTOR_ICON_PATH+b.icon+")")}},_insertBBCode:function(a,g,c,f){var e=this._bbcodes[a];var b={buttonName:a,buttonDOM:g,buttonObj:c,event:f,cancel:false};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","insertBBCode_"+e+"_"+this.$source.wcfIdentify(),b);if(b.cancel===false){var d=this.getSelectionHtml();if(e==="tt"){var h=(this.getParent())?$(this.getParent()):null;if(h&&h.closest("inline.inlineCode",this.$editor.get()[0]).length){this.inlineRemoveClass("inlineCode")}else{this.inlineSetClass("inlineCode")}}else{this.insertHtml("["+e+"]"+d+"[/"+e+"]")}}f.preventDefault();return false}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbutton=function(){return{_bbcodes:{},init:function(){this._bbcodes={};for(var g=0,d=__REDACTOR_BUTTONS.length;g<d;g++){this.wbutton._addBBCodeButton(__REDACTOR_BUTTONS[g])}var a={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"};var b=this.wutil.getOption("buttons");var f="";for(var g=0,d=b.length;g<d;g++){var c=b[g];if(c=="separator"){this.button.get(f).parent().addClass("separator");continue}var e=this.button.get(c);if(e.length){if(a[c]){this.button.setAwesome(c,a[c])}}else{this.wbutton._addCoreButton(c,(a[c]?a[c]:null),f)}f=c}this.button.addCallback(this.button.get("image"),$.proxy(this.wbutton.insertImage,this))},_addCoreButton:function(b,a,c){var e={title:b};if(b==="subscript"||b==="superscript"){e.command=b}var d=this.button.build(b,e);$("<li />").append(d).insertAfter(this.button.get(c).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]=b.name;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];var b={buttonName:a,cancel:false};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","insertBBCode_"+d+"_"+this.$textarea.wcfIdentify(),b);if(b.cancel===false){var c=this.selection.getHtml();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.insert.html("["+d+"]"+c+"[/"+d+"]")}}event.preventDefault();return false},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('<img src="'+b+'"'+a+">",false);this.modal.close();this.observe.images()}else{if(!d.next("small.innerError")){$('<small class="innerError">'+WCF.Language.get("wcf.global.form.error.empty")+"</small>").insertAfter(d)}}}}};
 // wfontcolor.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontcolor={init:function(){var a=this._createFontColorDropdown();this.buttonReplace("fontcolor","fontcolor",this.opts.curLang.fontcolor,$.proxy(function(f,c,b,d){this.dropdownShow(d,f)},this));this.buttonGet("fontcolor").data("dropdown",a)},_createFontColorDropdown:function(){var d=$('<div class="redactor_dropdown redactor_dropdown_box_fontcolor dropdownMenu" style="display: none;">');var b=["#000000","#800000","#8B4513","#2F4F4F","#008080","#000080","#4B0082","#696969","#B22222","#A52A2A","#DAA520","#006400","#40E0D0","#0000CD","#800080","#808080","#FF0000","#FF8C00","#FFD700","#008000","#00FFFF","#0000FF","#EE82EE","#A9A9A9","#FFA07A","#FFA500","#FFFF00","#00FF00","#AFEEEE","#ADD8E6","#DDA0DD","#D3D3D3","#FFF0F5","#FAEBD7","#FFFFE0","#F0FFF0","#F0FFFF","#F0F8FF","#E6E6FA","#FFFFFF"];var f=$('<li class="redactorColorPallet" />');for(var h=0,e=b.length;h<e;h++){var g=b[h];var c=$('<a href="#" />').data("color",g).css("background-color",g);f.append(c);c.click($.proxy(this._onColorPick,this))}var a=$('<a href="#" />').html(this.opts.curLang.none).data("color","none");a.click($.proxy(this._onColorPick,this));d.append(f);d.append($('<li class="dropdownDivider" />'));d.append(a);a.wrap("<li />");$(this.$toolbar).append(d);return d},_onColorPick:function(a){a.preventDefault();var b=$(a.currentTarget).data("color");if(b==="none"){this.inlineRemoveStyle("color")}else{this.inlineSetStyle("color",b)}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontcolor=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontcolor"));this.wfontcolor._createDropdown(a)},_createDropdown:function(h){var b=["#000000","#800000","#8B4513","#2F4F4F","#008080","#000080","#4B0082","#696969","#B22222","#A52A2A","#DAA520","#006400","#40E0D0","#0000CD","#800080","#808080","#FF0000","#FF8C00","#FFD700","#008000","#00FFFF","#0000FF","#EE82EE","#A9A9A9","#FFA07A","#FFA500","#FFFF00","#00FF00","#AFEEEE","#ADD8E6","#DDA0DD","#D3D3D3","#FFF0F5","#FAEBD7","#FFFFE0","#F0FFF0","#F0FFFF","#F0F8FF","#E6E6FA","#FFFFFF"];var e=$('<li class="redactorColorPallet" />');for(var g=0,d=b.length;g<d;g++){var f=b[g];var c=$('<a href="#" title="'+f+'" />').data("color",f).css("background-color",f);e.append(c);c.click($.proxy(this.wfontcolor._onColorPick,this))}var a=$('<a href="#" />').html(this.opts.curLang.none).data("color","none");a.click($.proxy(this.wfontcolor._onColorPick,this));e.appendTo(h);$('<li class="dropdownDivider" />').appendTo(h);a.appendTo(h);a.wrap("<li />")},_onColorPick:function(a){a.preventDefault();var b=$(a.currentTarget).data("color");if(b==="none"){this.inline.remoteStyleRule("color")}else{this.inline.format("span","style","color: "+b+";")}}}};
 // wfontfamily.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontfamily={init:function(){var a=this._createFontFamilyDropdown();this.buttonReplace("fontfamily","wfontfamily",WCF.Language.get("wcf.bbcode.button.fontFamily"),$.proxy(function(f,c,b,d){this.dropdownShow(d,f)},this));this.buttonGet("wfontfamily").addClass("re-fontfamily").data("dropdown",a)},_createFontFamilyDropdown:function(){var d=$('<div class="redactor_dropdown redactor_dropdown_box_wfontfamily dropdownMenu" style="display: none;">');var c={Arial:"Arial, Helvetica, sans-serif","Comic Sans MS":"Comic Sans MS, cursive","Courier New":"Consolas, Courier New, Courier, monospace",Georgia:"Georgia, serif","Lucida Sans Unicode":"Lucida Sans Unicode, Lucida Grande, sans-serif",Tahoma:"Tahoma, Geneva, sans-serif","Times New Roman":"Times New Roman, Times, serif","Trebuchet MS":"Trebuchet MS, Helvetica, sans-serif",Verdana:"Verdana, Geneva, sans-serif"};var a=this;$.each(c,function(h,e){var g=$('<li><a href="#">'+h+"</a></li>").appendTo(d);var f=g.children("a").data("fontFamily",e).css("font-family",e);f.click(function(){event.preventDefault();a.inlineSetStyle("font-family",$(this).data("fontFamily"))})});$('<li class="dropdownDivider" />').appendTo(d);var b=$('<li><a href="#">None</a></li>').appendTo(d);b.children("a").click(function(){event.preventDefault();a.inlineRemoveStyle("font-family")});$(this.$toolbar).append(d);return d}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontfamily=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontfamily"));this.wfontfamily._createDropdown(a)},_createDropdown:function(d){var c={Arial:"Arial, Helvetica, sans-serif","Comic Sans MS":"Comic Sans MS, cursive","Courier New":"Consolas, Courier New, Courier, monospace",Georgia:"Georgia, serif","Lucida Sans Unicode":"Lucida Sans Unicode, Lucida Grande, sans-serif",Tahoma:"Tahoma, Geneva, sans-serif","Times New Roman":"Times New Roman, Times, serif","Trebuchet MS":"Trebuchet MS, Helvetica, sans-serif",Verdana:"Verdana, Geneva, sans-serif"};var a=this;$.each(c,function(h,e){var g=$('<li><a href="#">'+h+"</a></li>").appendTo(d);var f=g.children("a").data("fontFamily",e).css("font-family",e);f.click(function(){event.preventDefault();a.inline.format("span","style","font-family: "+$(this).data("fontFamily")+";")})});$('<li class="dropdownDivider" />').appendTo(d);var b=$('<li><a href="#">None</a></li>').appendTo(d);b.children("a").click(function(){event.preventDefault();a.inline.removeStyleRule("font-family")})}}};
 // wfontsize.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize={init:function(){var a=this._createFontSizeDropdown();this.buttonReplace("fontsize","wfontsize",WCF.Language.get("wcf.bbcode.button.fontSize"),$.proxy(function(f,c,b,d){this.dropdownShow(d,f)},this));this.buttonGet("wfontsize").addClass("re-fontsize").data("dropdown",a)},_createFontSizeDropdown:function(){var f=$('<div class="redactor_dropdown redactor_dropdown_box_wfontsize dropdownMenu" style="display: none;">');var e=[8,10,12,14,18,24,36];var b=this;for(var g=0;g<e.length;g++){var c=e[g];var d=$('<li><a href="#">'+c+"</a></li>").appendTo(f);var a=d.children("a").data("fontSize",c).css("font-size",c+"pt");if(c>18){a.css("line-height","1em")}a.click(function(){event.preventDefault();b.inlineSetStyle("font-size",$(this).data("fontSize")+"pt")})}$('<li class="dropdownDivider" />').appendTo(f);var d=$('<li><a href="#">None</a></li>').appendTo(f);d.children("a").click(function(){event.preventDefault();b.inlineRemoveStyle("font-size")});$(this.$toolbar).append(f);return f}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontsize"));this.wfontsize._createDropdown(a)},_createDropdown:function(g){var e=[8,10,12,14,18,24,36];var b=this;for(var f=0;f<e.length;f++){var c=e[f];var d=$('<li><a href="#">'+c+"</a></li>").appendTo(g);var a=d.children("a").data("fontSize",c).css("font-size",c+"pt");if(c>18){a.css("line-height","1em")}a.click(function(){event.preventDefault();b.inline.format("span","style","font-size: "+$(this).data("fontSize")+"pt;")})}$('<li class="dropdownDivider" />').appendTo(g);var d=$('<li><a href="#">None</a></li>').appendTo(g);d.children("a").click(function(){event.preventDefault();b.inline.removeStyleRule("font-size")})}}};
 // wmonkeypatch.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch={init:function(){var n=this;var e=this.$source.wcfIdentify();var b=this.indentingStart;this.indentingStart=function(p){if(n.mpIndentingStart(p)){b.call(n,p)}};var o=this.buildEventKeydown;this.buildEventKeydown=function(q){var p={cancel:false,event:q};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keydown_"+e,p);if(p.cancel!==true){return o.call(n,q)}return false};var m=this.buildEventKeyup;this.buildEventKeyup=function(q){var p={cancel:false,event:q};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keyup_"+e,p);if(p.cancel!==true){return m.call(n,q)}return false};var l=this.toggleCode;this.toggleCode=function(q){var p=n.normalize(n.$editor.css("height"));l.call(n,q);n.$source.height(p)};var i=this.modalInit;this.modalInit=function(r,q,p,s){n.mpModalInit();i.call(n,r,q,p,s)};var j=this.modalShowOnDesktop;this.modalShowOnDesktop=function(){j.call(n);$(document.body).css("overflow",false)};var g=this.destroy;this.destroy=function(){n.callback("destroy",false,{});g.call(n)};var f=this.sync;this.sync=function(q,p){if(p===true){f.call(n,q)}};var h=this.buttonActiveObserver;this.buttonActiveObserver=function(p,q){h.call(n,p,q);n.mpButtonActiveObserver(p,q)};if(this.opts.activeButtons){this.$editor.off("mouseup.redactor keyup.redactor").on("mouseup.redactor keyup.redactor",$.proxy(this.buttonActiveObserver,this))}this.$toolbar.find("a.re-indent, a.re-outdent").addClass("redactor_button_disabled");var d=this.imageResizeControls;this.imageResizeControls=function(p){if(!p.data("attachmentID")){d.call(n,p)}return false};var a=this.imageEdit;this.imageEdit=function(p){a.call(n,p);$("#redactor_image_source").val($(p).prop("src"))};var k=this.imageSave;this.imageSave=function(p){$(p).prop("src",$("#redactor_image_source").val());k.call(n,p)};var c=this.buildEventKeydownBackspace;this.buildEventKeydownBackspace=function(r,q,p){if(c.call(n,r,q,p)!==false){return n.mpBuildEventKeydownBackspace(r,q,p)}return false};this.setOption("modalOpenedCallback",$.proxy(this.modalOpenedCallback,this));this.setOption("dropdownShowCallback",$.proxy(this.dropdownShowCallback,this));this.modalTemplatesInit()},cleanRemoveSpaces:function(b,a){return b},mpButtonActiveObserver:function(d,g){var b=this.getParent();b=(b===false)?null:$(b);var a=this;var c=this.$editor.get()[0];var f=function(e,j,h,k,l){var i=a.$toolbar.find(j);if(b&&b.closest(e,c).length!=0){i[(h?"removeClass":"addClass")](k)}else{if(l&&!a.opts.visual){return}i[(h?"addClass":"removeClass")](k)}};f("ul","a.re-indent, a.re-outdent",true,"redactor_button_disabled");f("inline.inlineCode","a.re-__wcf_tt",false,"redactor_act");f("blockquote.quoteBox","a.re-__wcf_quote",false,"redactor_button_disabled",true);f("sub","a.re-subscript",false,"redactor_act");f("sup","a.re-superscript",false,"redactor_act")},inlineRemoveStyle:function(a){this.selectionSave();this.inlineEachNodes(function(b){$(b).css(a,"");this.removeEmptyAttr(b,"style")});this.$editor.find("inline").each(function(c,d){if(!d.attributes.length){var b=$(d);b.replaceWith(b.html())}});this.selectionRestore();this.sync()},inlineMethods:function(e,b,g){this.bufferSet();this.selectionSave();var c=this.getRange();var d=this.getElement();if((c.collapsed||c.startContainer===c.endContainer)&&d&&!this.nodeTestBlocks(d)){$(d)[e](b,g)}else{var f,a=g;switch(b){case"font-size":f="fontSize";a=4;break;case"font-family":f="fontName";break;case"color":f="foreColor";break;case"background-color":f="backColor";break}if(e==="addClass"){f="fontSize";a=4}this.document.execCommand(f,false,a);var h=this.$editor.find("font");$.each(h,$.proxy(function(j,k){this.inlineSetMethods(e,k,b,g)},this))}this.selectionRestore();this.sync()},mpIndentingStart:function(a){if(this.getBlock().tagName=="LI"){return true}return false},modalTemplatesInit:function(){this.setOption("modal_image",'<fieldset><dl><dt><label for="redactor_file_link">'+this.opts.curLang.image_web_link+'</label></dt><dd><input type="text" name="redactor_image_source" id="redactor_image_source" class="long"  /></dd></dl><dl><dt><label for="redactor_form_image_align">'+this.opts.curLang.image_position+'</label></dt><dd><select id="redactor_form_image_align"><option value="none">'+this.opts.curLang.none+'</option><option value="left">'+this.opts.curLang.left+'</option><option value="right">'+this.opts.curLang.right+'</option></select></dd></dl></fieldset><div class="formSubmit"><button id="redactor_upload_btn">'+this.opts.curLang.insert+"</button></div>");this.setOption("modal_image_edit",this.getOption("modal_image").replace('<button id="redactor_upload_btn">'+this.opts.curLang.insert+"</button>",'<button id="redactorSaveBtn">'+this.opts.curLang.save+"</button>"));this.setOption("modal_link",'<fieldset><dl><dt><label for="redactor_link_url">URL</label></dt><dd><input type="text" id="redactor_link_url" class="long" /></dd></dl><dl><dt><label for="redactor_link_url_text">'+this.opts.curLang.text+'</label></dt><dd><input type="text" id="redactor_link_url_text" class="long" /></dd></dl></fieldset><div class="formSubmit"><button id="redactor_insert_link_btn">'+this.opts.curLang.insert+"</button></div>");this.setOption("modal_table",'<fieldset><dl><dt><label for="redactor_table_rows">'+this.opts.curLang.rows+'</label></dt><dd><input type="number" size="5" value="2" min="0" id="redactor_table_rows" class="tiny" /></dd></dl><dl><dt><label for="redactor_table_columns">'+this.opts.curLang.columns+'</label></dt><dd><input type="number" size="5" value="3" min="0" id="redactor_table_columns" class="tiny" /></dd></dl></fieldset><div class="formSubmit"><button id="redactor_insert_table_btn">'+this.opts.curLang.insert+"</button></div>");this.setOption("modal_quote",'<fieldset><dl><dt><label for="redactorQuoteAuthor">'+WCF.Language.get("wcf.bbcode.quote.edit.author")+'</label></dt><dd><input type="text" id="redactorQuoteAuthor" class="long" /></dd></dl><dl><dt><label for="redactorQuoteLink">'+WCF.Language.get("wcf.bbcode.quote.edit.link")+'</label></dt><dd><input type="text" id="redactorQuoteLink" class="long" /></dd></dl></fieldset><div class="formSubmit"><button id="redactorEditQuote">'+this.opts.curLang.save+"</button></div>")},mpModalInit:function(){if(!$("#redactor_modal_overlay").length){this.$overlay=$('<div id="redactor_modal_overlay" class="dialogOverlay" />').css({height:"100%",zIndex:50000}).hide().appendTo(document.body)}if(!$("#redactor_modal").length){this.$modal=$('<div id="redactor_modal" class="dialogContainer" />').css({display:"none",zIndex:50001}).appendTo(document.body);$('<header class="dialogTitlebar"><span id="redactor_modal_header" class="dialogTitle" /><a id="redactor_modal_close" class="dialogCloseButton" /></header>').appendTo(this.$modal);$('<div class="dialogContent"><div id="redactor_modal_inner" /></div>').appendTo(this.$modal)}this.$modal.children(".dialogContent").removeClass("dialogForm")},modalOpenedCallback:function(){var a=0;if(this.$modal.find(".formSubmit").length){a=this.$modal.find(".formSubmit").outerHeight();this.$modal.children(".dialogContent").addClass("dialogForm").css({marginBottom:a+"px"})}else{this.$modal.children(".dialogContent").removeClass("dialogForm").css({marginBottom:"0px"})}if(!this.isMobile()){var b=this.$modal.getDimensions("outer");this.$modal.css({marginLeft:-1*Math.round(b.width/2)+"px",marginTop:-1*Math.round(b.height/2)+"px"})}},dropdownShowCallback:function(a){if(!a.dropdown.hasClass("dropdownMenu")){a.dropdown.addClass("dropdownMenu");a.dropdown.children(".redactor_separator_drop").replaceWith('<li class="dropdownDivider" />');a.dropdown.children("a").wrap("<li />")}},inlineEachNodes:function(e){var b=this.getRange(),c=this.getElement(),a=this.getNodes(),d;if(b.collapsed||b.startContainer===b.endContainer&&c){a=$(c);d=true}$.each(a,$.proxy(function(g,j){if(!d&&j.tagName!=="INLINE"){var f=this.getSelectionText();var k=$(j).parent().text();var h=this.removeZeroWidthSpace(f)==this.removeZeroWidthSpace(k);if(h&&j.parentNode.tagName==="INLINE"&&!$(j.parentNode).hasClass("redactor_editor")){j=j.parentNode}else{return}}e.call(this,j)},this))},imageCallbackLink:function(){var a=$.trim($("#redactor_image_source").val());if(a.length){var c="";var d=$("#redactor_form_image_align").val();switch(d){case"left":c=' style="float: left;"';break;case"right":c=' style="float: right;"';break}var b='<img id="image-marker" src="'+a+'"'+c+" />";this.imageInsert(b,true)}else{this.modalClose()}},observeLinks:function(){this.$editor.find("a:not(.redactorQuoteEdit)").on("click",$.proxy(this.linkObserver,this));this.$editor.on("click.redactor",$.proxy(function(a){this.linkObserverTooltipClose(a)},this));$(document).on("click.redactor",$.proxy(function(a){this.linkObserverTooltipClose(a)},this))},observeImages:function(){if(this.opts.observeImages===false){return false}this.$editor.find("img:not(.smiley)").each($.proxy(function(a,c){if(this.browser("msie")){$(c).attr("unselectable","on")}var b=$(c).parent();if(!b.hasClass("royalSlider")&&!b.hasClass("fotorama")){this.imageResize(c)}},this));this.$editor.find(".fotorama, .royalSlider").on("click",$.proxy(this.editGallery,this))},mpBuildEventKeydownBackspace:function(c,d,b){var a=$.trim((d.textContent)?d.textContent:d.innerText);if(a==""&&b.parentNode&&b.parentNode.tagName=="BLOCKQUOTE"){var e=b.parentNode.parentNode;$(b.parentNode).remove();this.selectionStart(e);return false}},cleanGetTabs:function(){return""},cleanRemoveEmptyTags:function(a){return a}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch=function(){return{init:function(){this.wmonkeypatch.button();this.wmonkeypatch.clean();this.wmonkeypatch.dropdown();this.wmonkeypatch.image();this.wmonkeypatch.insert();this.wmonkeypatch.keydown();this.wmonkeypatch.modal();this.wmonkeypatch.paste();this.wmonkeypatch.observe();this.wmonkeypatch.utils();this.wmonkeypatch.rebuildTemplates();this.wmonkeypatch.bindEvents()},bindEvents:function(){var a=this.$textarea.wcfIdentify();this.wutil.setOption("keydownCallback",function(c){var b={cancel:false,event:c};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keydown_"+a,b);return(b.cancel?false:true)});this.wutil.setOption("keyupCallback",function(c){var b={cancel:false,event:c};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keyup_"+a,b);return(b.cancel?false:true)});if(this.opts.activeButtons){this.$editor.off("mouseup.redactor keyup.redactor focus.redactor");this.$editor.on("mouseup.redactor keyup.redactor focus.redactor",$.proxy(this.observe.buttons,this))}},button:function(){var a=this.button.addDropdown;this.button.addDropdown=(function(b,d){var c=a.call(this,b,d);if(!d){c.addClass("dropdownMenu")}return c}).bind(this)},clean:function(){var a=this.clean.onPaste;this.clean.onPaste=(function(c,b){this.opts.replaceDivs=true;c=a.call(this,c,b);this.opts.replaceDivs=false;return c}).bind(this)},dropdown:function(){this.dropdown.build=(function(b,d,c){d.addClass("dropdownMenu");$.each(c,(function(h,g){if(h=="dropdownDivider"){$('<li class="dropdownDivider" />').appendTo(d)}else{var f=$("<li />");var e=$('<a href="#" class="redactor-dropdown-'+h+'">'+g.title+"</a>");e.on("click",$.proxy(function(j){var i="func";var k=g.func;if(g.command){i="command";k=g.command}else{if(g.dropdown){i="dropdown";k=g.dropdown}}this.button.onClick(j,h,i,k)},this));e.appendTo(f);f.appendTo(d)}}).bind(this))}).bind(this);var a=this.dropdown.show;this.dropdown.show=$.proxy(function(c,b){a.call(this,c,b);this.button.get(b).data("dropdown").off("mouseover mouseout")},this)},image:function(){this.image.setEditable=(function(a){if(!this.opts.imageEditable){return}a.on("dragstart",$.proxy(this.image.onDrag,this));a.on("mousedown",$.proxy(this.image.hideResize,this));a.on("click touchstart",$.proxy(function(b){this.observe.image=a;if(this.$editor.find("#redactor-image-box").size()!==0){return false}if(!this.opts.imageEditable&&!this.opts.imageResizable){return}this.image.resizer=this.image.loadEditableControls(a);if(this.image.resizer===false){this.image.resizer=$()}else{this.image.resizer.on("mousedown.redactor touchstart.redactor",$.proxy(function(c){c.preventDefault();this.image.resizeHandle={x:c.pageX,y:c.pageY,el:a,ratio:a.width()/a.height(),h:a.height()};c=c.originalEvent||c;if(c.targetTouches){this.image.resizeHandle.x=c.targetTouches[0].pageX;this.image.resizeHandle.y=c.targetTouches[0].pageY}this.image.startResize()},this))}$(document).on("click.redactor-image-resize-hide",$.proxy(this.image.hideResize,this));this.$editor.on("click.redactor-image-resize-hide",$.proxy(this.image.hideResize,this))},this))}).bind(this);this.image.show=(function(){this.modal.load("image",this.lang.get("image"),0);var a=this.modal.createActionButton(this.lang.get("insert"));a.click($.proxy(this.wbutton._insertImage,this));this.selection.save();this.modal.show()}).bind(this);this.image.showEdit=(function(a){this.modal.load("imageEdit",this.lang.get("edit"),0);this.image.buttonSave=this.modal.createActionButton(this.lang.get("save"));this.image.buttonSave.click((function(){this.image.update(a)}).bind(this));$("#redactor-image-link-source").val(a.attr("src"));$("#redactor-image-align").val(a.css("float"));this.modal.show()}).bind(this);this.image.update=(function(a){this.image.hideResize();this.buffer.set();a.attr("src",$("#redactor-image-link-source").val());this.image.setFloating(a);this.modal.close();this.observe.images()}).bind(this)},insert:function(){var a=(function(){var c=this.$editor.html();if(this.utils.isEmpty(c)){this.$editor.focus();this.caret.setEnd(this.$editor.children("p:eq(0)"))}}).bind(this);var b=this.insert.html;this.insert.html=(function(d,c){a();b.call(this,d,c)}).bind(this)},keydown:function(){this.keydown.enterWithinBlockquote=false;this.keydown.onTab=(function(c,b){c.preventDefault();if(c.metaKey&&b===219){this.indent.decrease()}else{if(c.metaKey&&b===221){this.indent.increase()}else{if(!c.shiftKey){this.indent.increase()}else{this.indent.decrease()}}}return false}).bind(this);var a=this.keydown.replaceDivToParagraph;this.keydown.replaceDivToParagraph=(function(){if(this.keydown.enterWithinBlockquote){this.keydown.enterWithinBlockquote=false}else{a.call(this)}}).bind(this)},modal:function(){this.modal.dialog=null;var b=this.modal.addTemplate;this.modal.addTemplate=(function(c,d){if(c!=="table"){b.call(this,c,d)}}).bind(this);this.modal.build=function(){};this.modal.load=(function(c,e,d){this.modal.templateName=c;this.modal.title=e;this.modal.dialog=$("<div />").hide().appendTo(document.body);this.modal.dialog.html(this.modal.getTemplate(this.modal.templateName));this.$modalFooter=null}).bind(this);this.modal.show=(function(){this.modal.dialog.wcfDialog({onClose:$.proxy(this.modal.close,this),title:this.modal.title})}).bind(this);var a=this.modal.createButton;this.modal.createButton=(function(c,d){if(this.$modalFooter===null){this.$modalFooter=$('<div class="formSubmit" />').appendTo(this.modal.dialog);this.modal.dialog.addClass("dialogForm")}return a.call(this,c,d)}).bind(this);this.modal.close=(function(){this.modal.dialog.wcfDialog("close");this.modal.dialog.remove()}).bind(this);this.modal.createCancelButton=function(){return $()};this.modal.createDeleteButton=function(){return $()}},paste:function(){var b=(function(){var e=this.$editor[0].childNodes[0];var c=e;var d=null;while(c){e=c;c=e.nextSibling;if(e.nodeType===Element.ELEMENT_NODE){if(this.reIsBlock.test(e.tagName)){d=null}else{if(d===null){d=$("<p />").insertBefore(e)}d.append(e)}}else{if(e.nodeType===Element.TEXT_NODE){if(d===null){d=$("<p />").insertBefore(e)}d.append(e)}}}}).bind(this);var a=this.paste.insert;this.paste.insert=(function(c){a.call(this,c);setTimeout(b,20)}).bind(this)},observe:function(){var b=(function(h,c,f,d,g,i){var e=this.$toolbar.find(f);if(h&&h.closest(c,this.$editor[0]).length!=0){e[(d?"removeClass":"addClass")](g)}else{if(i&&!this.opts.visual){return}e[(d?"addClass":"removeClass")](g)}}).bind(this);var a=this.observe.buttons;this.observe.buttons=(function(d,f){a.call(this,d,f);var c=this.selection.getParent();c=(c===false)?null:$(c);b(c,"ul, ol","a.re-indent, a.re-outdent",true,"redactor-button-disabled");b(c,"blockquote.quoteBox","a.re-__wcf_quote",false,"redactor-button-disabled",true);b(c,"sub","a.re-subscript",false,"redactor-act");b(c,"sup","a.re-superscript",false,"redactor-act")}).bind(this)},utils:function(){this.utils.removeEmpty=function(a,b){}},rebuildTemplates:function(){this.opts.modal.image='<fieldset id="redactor-modal-image-edit"><dl><dt><label for="redactor-image-link-source">'+this.lang.get("link")+'</label></dt><dd><input type="text" id="redactor-image-link-source" class="long"  /></dd></dl><dl><dt><label for="redactor-image-align">'+this.opts.curLang.image_position+'</label></dt><dd><select id="redactor-image-align"><option value="none">'+this.lang.get("none")+'</option><option value="left">'+this.lang.get("left")+'</option><option value="right">'+this.lang.get("right")+"</option></select></dd></dl></fieldset>";this.opts.modal.imageEdit=this.opts.modal.image;this.opts.modal.quote='<fieldset><dl><dt><label for="redactorQuoteAuthor">'+WCF.Language.get("wcf.bbcode.quote.edit.author")+'</label></dt><dd><input type="text" id="redactorQuoteAuthor" class="long" /></dd></dl><dl><dt><label for="redactorQuoteLink">'+WCF.Language.get("wcf.bbcode.quote.edit.link")+'</label></dt><dd><input type="text" id="redactorQuoteLink" class="long" /></dd></dl></fieldset>';this.opts.modal.table='<fieldset id="redactor-modal-table-insert"><dl><dt><label for="redactor-table-rows">'+this.lang.get("rows")+'</label></dt><dd><input type="number" size="5" value="2" min="1" id="redactor-table-rows" class="tiny" /></dd></dl><dl><dt><label for="redactor-table-columns">'+this.lang.get("columns")+'</label></dt><dd><input type="number" size="5" value="3" min="1" id="redactor-table-columns" class="tiny" /></dd></dl></fieldset>'}}};
 // wupload.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload={_boundGlobalUploadEvents:false,_wUploadDropArea:{},_timer:null,_isDragging:false,_isFile:false,init:function(){var a=".redactor_"+this.$source.wcfIdentify();$(document).on("dragover"+a,$.proxy(this._dragOver,this));$(document).on("dragleave"+a,$.proxy(this._dragLeave,this));$(document).on("drop"+a,$.proxy(function(b){b.preventDefault();this._revertDropArea(undefined,this.$source.wcfIdentify())},this));if(!this._boundGlobalUploadEvents){this._boundGlobalUploadEvents=true;$(document).on("dragend",function(b){b.preventDefault()})}WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$source.wcfIdentify(),$.proxy(this.insertPastedImageAttachment,this))},_dragOver:function(c){c=c.originalEvent;if(!c.dataTransfer||!c.dataTransfer.types){return}this._isFile=false;if(c.dataTransfer.types[0]==="application/x-moz-file"){this._isFile=true}else{for(var e=0;e<c.dataTransfer.types.length;e++){if(c.dataTransfer.types[e]==="Files"){this._isFile=true;break}}}if(!this._isFile){return}this._isFile=true;c.preventDefault();if(!this._isDragging){var b=this.$source.wcfIdentify();if(this._wUploadDropArea[b]===undefined){this._wUploadDropArea[b]=$('<div class="redactorDropArea">'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"</div>").hide().appendTo(document.body);this._wUploadDropArea[b].on("dragover",$.proxy(this._hoverDropArea,this)).on("dragleave",$.proxy(this._revertDropArea,this)).on("drop",$.proxy(this._drop,this))}var a=(this.inWysiwygMode())?this.$editor.getDimensions("outer"):this.$source.getDimensions("outer");var d=(this.inWysiwygMode())?this.$editor.getOffsets("offset"):this.$source.getOffsets("offset");this._wUploadDropArea[b].css({height:a.height+"px",left:d.left+"px",lineHeight:a.height+"px",top:d.top+"px",width:a.width+"px"}).show();this._isDragging=true}c.preventDefault()},_hoverDropArea:function(a){this._wUploadDropArea[this.$source.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(c,a){if(!this._isFile){return}var b=a||this.$source.wcfIdentify();this._wUploadDropArea[b].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere"));if(a){this._wUploadDropArea[b].hide()}},_dragLeave:function(){if(!this._isDragging||!this._isFile){return}if(this._timer===null){var a=this;this._timer=new WCF.PeriodicalExecuter(function(b){b.stop();if(!a._isDragging){a._wUploadDropArea[a.$source.wcfIdentify()].hide()}},100)}else{this._timer.resume()}this._isDragging=false},_drop:function(c){if(!this._isFile){return}c=c.originalEvent||c;if(c.dataTransfer&&c.dataTransfer.files.length){c.preventDefault();var b=this.$source.wcfIdentify();this._revertDropArea(undefined,b);for(var d=0;d<c.dataTransfer.files.length;d++){var a=c.dataTransfer.files[d];if(a.type){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+b,{file:a})}}}},pasteClipboardUploadMozilla:function(){this.$editor.find("img[data-mozilla-paste-image]").each($.proxy(function(d,g){var f=$(g);var a=f.prop("src").split(",");var e=a[0].split(";")[0].split(":")[1];var c=a[1];var b={blob:WCF.base64toBlob(c,e),uploadID:null};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+this.$source.wcfIdentify(),b);f.replaceWith('<span class="redactor-pastedImageFromClipboard-'+b.uploadID+'" />')},this))},insertPastedImageAttachment:function(b){var a=this.$editor.find("span.redactor-pastedImageFromClipboard-"+b.uploadID);a.before(b.attachment);a.remove()}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload=function(){return{_boundGlobalUploadEvents:false,_wUploadDropArea:{},_timer:null,_isDragging:false,_isFile:false,init:function(){var a=".redactor_"+this.$textarea.wcfIdentify();$(document).on("dragover"+a,$.proxy(this._dragOver,this));$(document).on("dragleave"+a,$.proxy(this._dragLeave,this));$(document).on("drop"+a,$.proxy(function(b){b.preventDefault();this._revertDropArea(undefined,this.$textarea.wcfIdentify())},this));if(!this._boundGlobalUploadEvents){this._boundGlobalUploadEvents=true;$(document).on("dragend",function(b){b.preventDefault()})}WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$textarea.wcfIdentify(),$.proxy(this.insertPastedImageAttachment,this))},_dragOver:function(c){c=c.originalEvent;if(!c.dataTransfer||!c.dataTransfer.types){return}this._isFile=false;if(c.dataTransfer.types[0]==="application/x-moz-file"){this._isFile=true}else{for(var e=0;e<c.dataTransfer.types.length;e++){if(c.dataTransfer.types[e]==="Files"){this._isFile=true;break}}}if(!this._isFile){return}this._isFile=true;c.preventDefault();if(!this._isDragging){var b=this.$textarea.wcfIdentify();if(this._wUploadDropArea[b]===undefined){this._wUploadDropArea[b]=$('<div class="redactorDropArea">'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"</div>").hide().appendTo(document.body);this._wUploadDropArea[b].on("dragover",$.proxy(this._hoverDropArea,this)).on("dragleave",$.proxy(this._revertDropArea,this)).on("drop",$.proxy(this._drop,this))}var a=(this.inWysiwygMode())?this.$editor.getDimensions("outer"):this.$textarea.getDimensions("outer");var d=(this.inWysiwygMode())?this.$editor.getOffsets("offset"):this.$textarea.getOffsets("offset");this._wUploadDropArea[b].css({height:a.height+"px",left:d.left+"px",lineHeight:a.height+"px",top:d.top+"px",width:a.width+"px"}).show();this._isDragging=true}c.preventDefault()},_hoverDropArea:function(a){this._wUploadDropArea[this.$textarea.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(c,a){if(!this._isFile){return}var b=a||this.$textarea.wcfIdentify();this._wUploadDropArea[b].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere"));if(a){this._wUploadDropArea[b].hide()}},_dragLeave:function(){if(!this._isDragging||!this._isFile){return}if(this._timer===null){var a=this;this._timer=new WCF.PeriodicalExecuter(function(b){b.stop();if(!a._isDragging){a._wUploadDropArea[a.$source.wcfIdentify()].hide()}},100)}else{this._timer.resume()}this._isDragging=false},_drop:function(c){if(!this._isFile){return}c=c.originalEvent||c;if(c.dataTransfer&&c.dataTransfer.files.length){c.preventDefault();var b=this.$textarea.wcfIdentify();this._revertDropArea(undefined,b);for(var d=0;d<c.dataTransfer.files.length;d++){var a=c.dataTransfer.files[d];if(a.type){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+b,{file:a})}}}},pasteClipboardUploadMozilla:function(){this.$editor.find("img[data-mozilla-paste-image]").each($.proxy(function(d,g){var f=$(g);var a=f.prop("src").split(",");var e=a[0].split(";")[0].split(":")[1];var c=a[1];var b={blob:WCF.base64toBlob(c,e),uploadID:null};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+this.$textarea.wcfIdentify(),b);f.replaceWith('<span class="redactor-pastedImageFromClipboard-'+b.uploadID+'" />')},this))},insertPastedImageAttachment:function(b){var a=this.$editor.find("span.redactor-pastedImageFromClipboard-"+b.uploadID);a.before(b.attachment);a.remove()}}};
 // wutil.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wutil={_autosaveWorker:null,init:function(){this.$source.parents("form").submit($.proxy(this.submit,this));if(this.getOption("wautosave").active){this.autosaveEnable();if(this.getOption("wautosave").saveOnInit||this.$source.data("saveOnInit")){this.setOption("wAutosaveOnce",true)}else{this.autosaveRestore()}}this.setOption("autosave",false);var b=this.destroy;var a=this;this.destroy=function(){a.autosaveDisable();b.call(a)}},insertAtCaret:function(b){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$source.focus();var c=this.$source.getCaret();if(c==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var a=this.$source.val();a=a.substr(0,c)+b+a.substr(c);this.$source.val(a);return true},insertDynamic:function(a,b){if(this.inWysiwygMode()){this.insertHtml(a)}else{if(b===undefined||b===null){b=a}this.insertAtCaret(b)}},setOption:function(a,b){this.opts[a]=b},getOption:function(a){if(this.opts[a]){return this.opts[a]}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(a){getSelection().removeAllRanges();getSelection().addRange(a)},getText:function(){if(this.inWysiwygMode()){this.wSync()}return this.$source.val()},submit:function(){if(this.inWysiwygMode()){this.wSync()}this.autosavePurge()},reset:function(){if(this.inWysiwygMode()){this.$editor.html("<p>"+this.opts.invisibleSpace+"</p>");this.sync()}else{this.$source.val("")}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$source.wcfIdentify()})},autosaveEnable:function(a){if(!this.getOption("wautosave").active){this.setOption("wautosave",{active:true,key:a})}if(this._autosaveWorker===null){this._autosaveWorker=new WCF.PeriodicalExecuter($.proxy(this._saveTextToStorage,this),60*1000)}return true},_saveTextToStorage:function(){localStorage.setItem(this.getOption("wautosave").key,this.getText())},autosaveDisable:function(){if(!this.getOption("wautosave").active){return false}this._autosaveWorker.stop();this._autosaveWorker=null;this.setOption("wautosave",{active:false,key:""});return true},autosavePurge:function(){localStorage.removeItem(this.getOption("wautosave").key)},autosaveRestore:function(){var a=this.getOption("wautosave");var b=localStorage.getItem(a.key);if(b!==null){if(this.inWysiwygMode()){this.setOption("wOriginalValue",b)}else{this.$source.val(b)}return true}return false},buttonReplace:function(d,b,e,g,f){var a=this.buttonGet(d);var c=this.buttonAddAfter(d,b,e,g,f);if(a.parent().hasClass("separator")){c.parent().addClass("separator")}a.parent().remove();return c},removeZeroWidthSpace:function(a){var b="";for(var e=0,d=a.length;e<d;e++){var c=a.charCodeAt(e).toString(16);if(c!="200b"){b+=a[e]}}return b},wSync:function(){this.sync(undefined,true);this.$source.val(this.convertFromHtml(this.cleanHtml(this.$source.val())))},getSource:function(){return this.$source},getName:function(){return this.$source.wcfIdentify()},selectionEndOfEditor:function(){this.selectionEnd(this.$editor.children(":last")[0])},isCaret:function(a){var b=(a)?a:this.getRange();return b.collapsed},isEndOfElement:function(a){var c=this.getRange();if(!this.isCaret(c)){console.debug("case#1");return false}if(c.endContainer.nodeType===Element.TEXT_NODE){if(c.endOffset<c.endContainer.length){console.debug("case#2");return false}}if(!this.isNodeWithin(c.endContainer,a)){console.debug("case#3");return false}var b=c.endContainer;while(b!==a){if(b.nextSibling){console.debug("case#4");return false}b=b.parentNode}return true},isNodeWithin:function(c,b){var a=$(c);while(a[0]!==this.$editor[0]){if(a[0]===b){return true}a=a.parent()}return false},containsTag:function(b,a){switch(b.nodeType){case Element.ELEMENT_NODE:if(b.tagName===a){return true}case Element.DOCUMENT_FRAGMENT_NODE:for(var c=0;c<b.childNodes.length;c++){if(this.containsTag(b.childNodes[c],a)){return true}}return false;break;default:return false;break}},replaceText:function(c){var b=false;var a=$(document).scrollTop();if(this.inWysiwygMode()){this.toggle();b=true}this.$source.val(c);if(b){this.toggle();$(document).scrollTop(a)}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wutil=function(){return{_autosaveWorker:null,init:function(){this.$textarea.parents("form").submit($.proxy(this.submit,this));if(this.wutil.getOption("wautosave").active){this.wutil.autosaveEnable();if(this.wutil.getOption("wautosave").saveOnInit||this.$textarea.data("saveOnInit")){this.wutil.setOption("wAutosaveOnce",true)}else{this.wutil.autosaveRestore()}}this.wutil.setOption("autosave",false);var b=this.destroy;var a=this;this.destroy=function(){a.autosaveDisable();b.call(a)}},insertAtCaret:function(b){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$textarea.focus();var c=this.$textarea.getCaret();if(c==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var a=this.$textarea.val();a=a.substr(0,c)+b+a.substr(c);this.$textarea.val(a);return true},insertDynamic:function(a,b){if(this.inWysiwygMode()){this.insertHtml(a)}else{if(b===undefined||b===null){b=a}this.insertAtCaret(b)}},setOption:function(a,b){this.opts[a]=b},getOption:function(a){if(this.opts[a]){return this.opts[a]}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(a){getSelection().removeAllRanges();getSelection().addRange(a)},getText:function(){if(this.inWysiwygMode()){this.wSync()}return this.$textarea.val()},submit:function(){if(this.inWysiwygMode()){this.wSync()}this.autosavePurge()},reset:function(){if(this.inWysiwygMode()){this.$editor.html("<p>"+this.opts.invisibleSpace+"</p>");this.sync()}else{this.$textarea.val("")}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$textarea.wcfIdentify()})},autosaveEnable:function(a){if(!this.wutil.getOption("wautosave").active){this.wutil.setOption("wautosave",{active:true,key:a})}if(this._autosaveWorker===null){this._autosaveWorker=new WCF.PeriodicalExecuter($.proxy(this._saveTextToStorage,this),60*1000)}return true},_saveTextToStorage:function(){localStorage.setItem(this.getOption("wautosave").key,this.getText())},autosaveDisable:function(){if(!this.getOption("wautosave").active){return false}this._autosaveWorker.stop();this._autosaveWorker=null;this.setOption("wautosave",{active:false,key:""});return true},autosavePurge:function(){localStorage.removeItem(this.getOption("wautosave").key)},autosaveRestore:function(){var a=this.wutil.getOption("wautosave");var b=localStorage.getItem(a.key);if(b!==null){if(this.wutil.inWysiwygMode()){this.wutil.setOption("wOriginalValue",b)}else{this.$textarea.val(b)}return true}return false},buttonReplace:function(d,b,e,g,f){var a=this.buttonGet(d);var c=this.buttonAddAfter(d,b,e,g,f);if(a.parent().hasClass("separator")){c.parent().addClass("separator")}a.parent().remove();return c},removeZeroWidthSpace:function(a){var b="";for(var e=0,d=a.length;e<d;e++){var c=a.charCodeAt(e).toString(16);if(c!="200b"){b+=a[e]}}return b},wSync:function(){this.sync(undefined,true);this.$textarea.val(this.convertFromHtml(this.cleanHtml(this.$textarea.val())))},getSource:function(){return this.$textarea},getName:function(){return this.$textarea.wcfIdentify()},selectionEndOfEditor:function(){this.selectionEnd(this.$editor.children(":last")[0])},isCaret:function(){this.selection.get();return this.range.collapsed},isEndOfElement:function(a){this.selection.get();if(!this.wutil.isCaret()){return false}if(this.range.endContainer.nodeType===Element.TEXT_NODE){if(this.range.endOffset<this.range.endContainer.length){return false}}if(!this.wutil.isNodeWithin(this.range.endContainer,a)){return false}var b=this.range.endContainer;while(b!==a){if(b.nextSibling){return false}b=b.parentNode}return true},isNodeWithin:function(c,b){var a=$(c);while(a[0]!==this.$editor[0]){if(a[0]===b){return true}a=a.parent()}return false},containsTag:function(b,a){switch(b.nodeType){case Element.ELEMENT_NODE:if(b.tagName===a){return true}case Element.DOCUMENT_FRAGMENT_NODE:for(var c=0;c<b.childNodes.length;c++){if(this.wutil.containsTag(b.childNodes[c],a)){return true}}return false;break;default:return false;break}},replaceText:function(c){var b=false;var a=$(document).scrollTop();if(this.inWysiwygMode()){this.toggle();b=true}this.$textarea.val(c);if(b){this.toggle();$(document).scrollTop(a)}},setCaretBefore:function(a){this.wutil._setCaret(a,true)},setCaretAfter:function(a){this.wutil._setCaret(a,false)},_setCaret:function(b,c){var a=$(this.opts.emptyHtml);a[(c?"insertBefore":"insertAfter")](b);this.caret.setStart(a[0])}}};