// wbbcode.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode={init:function(){this._createSmileyDropdown();this.buttonReplace("smiley","wsmiley","Smiley",$.proxy(function(d,b,a,c){this.dropdownShow(c,d)},this));this.buttonAwesome("wsmiley","fa-smile-o");this.opts.initCallback=$.proxy(function(){if(this.$source.val().length){this.toggle();this.toggle()}},this);this.opts.pasteBeforeCallback=$.proxy(this._wPasteBeforeCallback,this);this.opts.pasteAfterCallback=$.proxy(this._wPasteAfterCallback,this)},_createSmileyDropdown:function(){var d=$('<div class="redactor_dropdown redactor_dropdown_box_wsmiley" style="display: none; width: 195px;" />');var c=$('<ul class="smileyList" />').appendTo(d);for(var a in __REDACTOR_SMILIES){var b=$('<li><img src="'+__REDACTOR_SMILIES[a]+'" class="smiley" /></li>').data("smileyCode",a);b.appendTo(c).click($.proxy(this._onSmileyPick,this))}$(this.$toolbar).append(d)},_onSmileyPick:function(b){var a=$(b.currentTarget).data("smileyCode");this.insertSmiley(a,__REDACTOR_SMILIES[a],false)},insertSmiley:function(a,b,c){if(c){this.registerSmiley(a,b)}if(this.opts.visual){this.bufferSet();this.$editor.focus();this.insertHtml(' <img src="'+b+'" class="smiley" alt="'+a+'" /> ');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._convertParagraphs();this.toggleCode(a);this._convertFromHtml();this.buttonGet("html").children("i").removeClass("fa-square-o").addClass("fa-square")}else{this._convertToHtml();this.toggleVisual();this.buttonGet("html").children("i").removeClass("fa-square").addClass("fa-square-o")}},_convertParagraphs:function(){this.$editor.find("p").replaceWith(function(){var a=$(this).html();if(a=="<br>"){return a}return a+"<br>"});this.sync()},_convertFromHtml:function(){var l=this.$source.val();l=l.replace(/<br>\n<pre>\n/g,"");l=l.replace(/<\/pre>\n<br>\n/g,"");l=l.replace(/<br>(?:\n<br>)+/g,function(y){var x=y.match(/<br>/g);return"@@@"+x.length+"@@@"});l=l.replace(/\n@@@/g,"@@@");l=l.replace(/@@@(\d+)@@@/g,function(x,z){var y="<br>";for(var A=1;A<z;A++){y+="\n<br>"}return y});l=l.replace(/<br>/g,"");l=l.replace(/ /gi," ");l=l.replace(/<a [^>]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi,"[email=$2]$3[/email]");l=l.replace(/<a [^>]*?href=(["'])(.+?)\1.*?>([\s\S]+?)<\/a>/gi,function(A,y,z,B){if(z==B){return"[url]"+z+"[/url]"}return"[url='"+z+"']"+B+"[/url]"});l=l.replace(/<(?:b|strong)>/gi,"[b]");l=l.replace(/<\/(?:b|strong)>/gi,"[/b]");l=l.replace(/<(?:i|em)>/gi,"[i]");l=l.replace(/<\/(?:i|em)>/gi,"[/i]");l=l.replace(/<u>/gi,"[u]");l=l.replace(/<\/u>/gi,"[/u]");l=l.replace(/<(?:s(trike)?|del)>/gi,"[s]");l=l.replace(/<\/(?:s(trike)?|del)>/gi,"[/s]");l=l.replace(/<sub>/gi,"[sub]");l=l.replace(/<\/sub>/gi,"[/sub]");l=l.replace(/<sup>/gi,"[sup]");l=l.replace(/<\/sup>/gi,"[/sup]");l=l.replace(/<img [^>]*?alt="([^"]+?)" class="smiley".*?>/gi,"$1");l=l.replace(/<img [^>]*?class="smiley" alt="([^"]+?)".*?>/gi,"$1");l=l.replace(/<img [^>]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi,"[img='$2',$3][/img]");l=l.replace(/<img [^>]*?src=(["'])([^"']+?)\1.*?>/gi,"[img]$2[/img]");var d=l.split(/(<\/?span[^>]*>)/);var v=[];var o=[];var p="";for(var a=0;a<d.length;a++){var g=d[a];if(g=="</span>"){var c=o.pop();var f=c.start+v.pop()+c.end;if(v.length){v[v.length-1]+=f}else{p+=f}}else{if(g.match(/^<span style="([^"]+)">/)){var j=RegExp.$1;var u;var m;if(j.match(/^color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?$/i)){var t=RegExp.$1;var b=RegExp.$2;var e=RegExp.$3;var r=("0123456789ABCDEF".charAt((t-t%16)/16)+""+"0123456789ABCDEF".charAt(t%16))+""+("0123456789ABCDEF".charAt((b-b%16)/16)+""+"0123456789ABCDEF".charAt(b%16))+""+("0123456789ABCDEF".charAt((e-e%16)/16)+""+"0123456789ABCDEF".charAt(e%16));u="[color=#"+r+"]";m="[/color]"}else{if(j.match(/^color: ?(.*?);?$/i)){u="[color="+RegExp.$1+"]";m="[/color]"}else{if(j.match(/^font-size: ?(\d+)pt;?$/i)){u="[size="+RegExp.$1+"]";m="[/size]"}else{if(j.match(/^font-family: ?(.*?);?$/)){u="[font="+RegExp.$1.replace(/'/g,"")+"]";m="[/font]"}else{u='<span style="'+j+'">';m="</span>"}}}}v[v.length]="";o[v.length]={start:u,end:m}}else{if(v.length){v[v.length-1]+=g}else{p+=g}}}}l=p;l=l.replace(/<div style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/div>/gi,"[align=$1]$2[/align]");l=l.replace(/<li>/gi,"[*]");l=l.replace(/<\/li>/gi,"");l=l.replace(/<ul>/gi,"[list]");l=l.replace(/<(ol|ul style="list-style-type: decimal")>/gi,"[list=1]");l=l.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]");l=l.replace(/<\/(ul|ol)>/gi,"[/list]");l=l.replace(/<table[^>]*>/gi,"[table]");l=l.replace(/<\/table>/gi,"[/table]");l=l.replace(/<tbody>([\s\S]*?)<\/tbody>/,function(x,y){return $.trim(y)});l=l.replace(/<tr><\/tr>/gi,"");l=l.replace(/<tr>/gi,"[tr]");l=l.replace(/<\/tr>/gi,"[/tr]");l=l.replace(/<td style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");l=l.replace(/<td>/gi,"[td]");l=l.replace(/<\/td>/gi,"[/td]");var w={};l.replace(/<span id="selection-marker-\d+" class="redactor-selection-marker"><\/span>/,function(x){var y=x.hashCode();w[y]=x.replace(/\$/g,"$$$$");return"@@"+y+"@@"});l=l.replace(/<[^>]+>/g,"");if($.getLength(w)){for(var i in w){var s=new RegExp("@@"+i+"@@","g");data=data.replace(s,w[i])}}l=l.replace(/</g,"<");l=l.replace(/>/g,">");l=l.replace(/&/g,"&");l=l.replace(/%28/g,"(");l=l.replace(/%29/g,")");l=l.replace(/%20/g," ");var q={};for(var a=0,h=__REDACTOR_SOURCE_BBCODES.length;a<h;a++){var n=__REDACTOR_SOURCE_BBCODES[a];var k=new RegExp("\\["+n+"([\\S\\s]+?)\\[\\/"+n+"\\]","gi");l=l.replace(k,function(x){var y=x.hashCode();q[y]=x.replace(/\$/g,"$$$$");return"@@"+y+"@@"})}var f=l.split("\n");for(var a=0,h=f.length;a<h;a++){f[a]=f[a].replace(/^\s*/,"")}l=f.join("\n");if($.getLength(q)){for(var i in q){var s=new RegExp("@@"+i+"@@","g");l=l.replace(s,q[i])}}this.$source.val(l)},_convertToHtml:function(){var e=this.$source.val();e=this.removeZeroWidthSpace(e);e=e.replace(/&/g,"&");e=e.replace(/</g,"<");e=e.replace(/>/g,">");var b={};for(var k=0,i=__REDACTOR_SOURCE_BBCODES.length;k<i;k++){var c=__REDACTOR_SOURCE_BBCODES[k];var d=new RegExp("\\["+c+"([\\S\\s]+?)\\[\\/"+c+"\\]","gi");e=e.replace(d,function(m){var n=m.hashCode();b[n]=m.replace(/\$/g,"$$$$");return"@@"+n+"@@"})}e=e.replace(/\[url\]([^"]+?)\[\/url]/gi,'<a href="$1">$1</a>');e=e.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'<a href="$1">$2</a>');e=e.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'<a href="$1">$2</a>');e=e.replace(/\[email\]([^"]+?)\[\/email]/gi,'<a href="mailto:$1">$1</a>');e=e.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'<a href="mailto:$1">$2</a>');e=e.replace(/\[b\](.*?)\[\/b]/gi,"<b>$1</b>");e=e.replace(/\[i\](.*?)\[\/i]/gi,"<i>$1</i>");e=e.replace(/\[u\](.*?)\[\/u]/gi,"<u>$1</u>");e=e.replace(/\[s\](.*?)\[\/s]/gi,"<strike>$1</strike>");e=e.replace(/\[sub\](.*?)\[\/sub]/gi,"<sub>$1</sub>");e=e.replace(/\[sup\](.*?)\[\/sup]/gi,"<sup>$1</sup>");e=e.replace(/\[img\]([^"]+?)\[\/img\]/gi,'<img src="$1" />');e=e.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'<img src="$1" style="float: $2" />');e=e.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'<img src="$1" />');e=e.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'<span style="font-size: $1pt">$2</span>');e=e.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'<span style="color: $1">$2</span>');e=e.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'<span style="font-family: $1">$2</span>');e=e.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'<div style="text-align: $1">$2</div>');e=e.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"<li>$1</li>");e=e.replace(/\[list\]/gi,"<ul>");e=e.replace(/\[list=1\]/gi,'<ul style="list-style-type: decimal">');e=e.replace(/\[list=a\]/gi,'<ul style="list-style-type: lower-latin">');e=e.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">');e=e.replace(/\[\/list]/gi,"</ul>");e=e.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(m,n){return"[table]"+$.trim(n)+"[/table]"});e=e.replace(/\[table\]/gi,'<table border="1" cellspacing="1" cellpadding="1" style="width: 500px;">');e=e.replace(/\[\/table\]/gi,"</table>");e=e.replace(/\[tr\]/gi,"<tr>");e=e.replace(/\[\/tr\]/gi,"</tr>");e=e.replace(/\[td\]/gi,"<td>");e=e.replace(/\[\/td\]/gi,"</td>");e=e.replace(/<td>([\S\s]*?)<\/td>/gi,function(m,n){return"<td>"+$.trim(n)+"</td>"});for(var l in __REDACTOR_SMILIES){$smileyCode=l.replace(/</g,"<").replace(/>/g,">");var g=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");e=e.replace(g,'$1<img src="'+__REDACTOR_SMILIES[l]+'" class="smiley" alt="'+$smileyCode+'" />')}e=e.replace(/(javascript):/gi,"$1<span></span>:");e=e.replace(/(\r|\r\n)/,"\n");var a=e.split("\n");e="";for(var k=0,i=a.length;k<i;k++){var j=$.trim(a[k]);if(j.indexOf("<")===0){e+=j}else{if(!j){j="<br>"}e+="<p>"+j+"</p>"}}if($.getLength(b)){for(var f in b){var h=new RegExp("@@"+f+"@@","g");e=e.replace(h,b[f])}}e=e.replace(/\[code\][\S\s]*?\[\/code\]/,"<pre>$&</pre>");this.$source.val(e)},_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]");return a},_wPasteAfterCallback:function(a){a=a.replace(/\[size=(\d+)\]/g,'<p><inline style="font-size: $1pt">');a=a.replace(/\[\/size\]/g,"</inline></p>");a=a.replace(/<p>([\s\S]*?)<\/p>/g,"<p>$1<br><br></p>");a=a.replace(/<header[^>]*>/g,"");a=a.replace(/<\/header>/g,"");a=a.replace(/<div>.*?<\/div>/g,"<p>$1<br></p>");a=a.replace(/<\/?div>/g,"");return a}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode={init:function(){this._createSmileyDropdown();this.buttonReplace("smiley","wsmiley","Smiley",$.proxy(function(d,b,a,c){this.dropdownShow(c,d)},this));this.buttonAwesome("wsmiley","fa-smile-o");this.opts.initCallback=$.proxy(function(){if(this.$source.val().length){this.toggle();this.toggle()}},this);this.opts.pasteBeforeCallback=$.proxy(this._wPasteBeforeCallback,this);this.opts.pasteAfterCallback=$.proxy(this._wPasteAfterCallback,this)},_createSmileyDropdown:function(){var d=$('<div class="redactor_dropdown redactor_dropdown_box_wsmiley" style="display: none; width: 195px;" />');var c=$('<ul class="smileyList" />').appendTo(d);for(var a in __REDACTOR_SMILIES){var b=$('<li><img src="'+__REDACTOR_SMILIES[a]+'" class="smiley" /></li>').data("smileyCode",a);b.appendTo(c).click($.proxy(this._onSmileyPick,this))}$(this.$toolbar).append(d)},_onSmileyPick:function(b){var a=$(b.currentTarget).data("smileyCode");this.insertSmiley(a,__REDACTOR_SMILIES[a],false)},insertSmiley:function(a,b,c){if(c){this.registerSmiley(a,b)}if(this.opts.visual){this.bufferSet();this.$editor.focus();this.insertHtml(' <img src="'+b+'" class="smiley" alt="'+a+'" /> ');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._convertParagraphs();this.toggleCode(a);this._convertFromHtml();this.buttonGet("html").children("i").removeClass("fa-square-o").addClass("fa-square")}else{this._convertToHtml();this.toggleVisual();this.buttonGet("html").children("i").removeClass("fa-square").addClass("fa-square-o")}},_convertParagraphs:function(){this.$editor.find("p").replaceWith(function(){var a=$(this).html();if(a=="<br>"){return a}return a+"<br>"});this.sync()},_convertFromHtml:function(){var l=this.$source.val();l=l.replace(/<br>\n<pre>\n/g,"");l=l.replace(/<\/pre>\n<br>\n/g,"");l=l.replace(/<br>(?:\n<br>)+/g,function(y){var x=y.match(/<br>/g);return"@@@"+x.length+"@@@"});l=l.replace(/\n@@@/g,"@@@");l=l.replace(/@@@(\d+)@@@/g,function(x,z){var y="<br>";for(var A=1;A<z;A++){y+="\n<br>"}return y});l=l.replace(/<br>/g,"");l=l.replace(/ /gi," ");l=l.replace(/<a [^>]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi,"[email=$2]$3[/email]");l=l.replace(/<a [^>]*?href=(["'])(.+?)\1.*?>([\s\S]+?)<\/a>/gi,function(A,y,z,B){if(z==B){return"[url]"+z+"[/url]"}return"[url='"+z+"']"+B+"[/url]"});l=l.replace(/<(?:b|strong)>/gi,"[b]");l=l.replace(/<\/(?:b|strong)>/gi,"[/b]");l=l.replace(/<(?:i|em)>/gi,"[i]");l=l.replace(/<\/(?:i|em)>/gi,"[/i]");l=l.replace(/<u>/gi,"[u]");l=l.replace(/<\/u>/gi,"[/u]");l=l.replace(/<(?:s(trike)?|del)>/gi,"[s]");l=l.replace(/<\/(?:s(trike)?|del)>/gi,"[/s]");l=l.replace(/<sub>/gi,"[sub]");l=l.replace(/<\/sub>/gi,"[/sub]");l=l.replace(/<sup>/gi,"[sup]");l=l.replace(/<\/sup>/gi,"[/sup]");l=l.replace(/<img [^>]*?alt="([^"]+?)" class="smiley".*?>/gi,"$1");l=l.replace(/<img [^>]*?class="smiley" alt="([^"]+?)".*?>/gi,"$1");l=l.replace(/<img [^>]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi,"[img='$2',$3][/img]");l=l.replace(/<img [^>]*?src=(["'])([^"']+?)\1.*?>/gi,"[img]$2[/img]");var d=l.split(/(<\/?span[^>]*>)/);var v=[];var o=[];var p="";for(var a=0;a<d.length;a++){var g=d[a];if(g=="</span>"){var c=o.pop();var f=c.start+v.pop()+c.end;if(v.length){v[v.length-1]+=f}else{p+=f}}else{if(g.match(/^<span style="([^"]+)">/)){var j=RegExp.$1;var u;var m;if(j.match(/^color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?$/i)){var t=RegExp.$1;var b=RegExp.$2;var e=RegExp.$3;var r=("0123456789ABCDEF".charAt((t-t%16)/16)+""+"0123456789ABCDEF".charAt(t%16))+""+("0123456789ABCDEF".charAt((b-b%16)/16)+""+"0123456789ABCDEF".charAt(b%16))+""+("0123456789ABCDEF".charAt((e-e%16)/16)+""+"0123456789ABCDEF".charAt(e%16));u="[color=#"+r+"]";m="[/color]"}else{if(j.match(/^color: ?(.*?);?$/i)){u="[color="+RegExp.$1+"]";m="[/color]"}else{if(j.match(/^font-size: ?(\d+)pt;?$/i)){u="[size="+RegExp.$1+"]";m="[/size]"}else{if(j.match(/^font-family: ?(.*?);?$/)){u="[font="+RegExp.$1.replace(/'/g,"")+"]";m="[/font]"}else{u='<span style="'+j+'">';m="</span>"}}}}v[v.length]="";o[v.length]={start:u,end:m}}else{if(v.length){v[v.length-1]+=g}else{p+=g}}}}l=p;l=l.replace(/<div style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/div>/gi,"[align=$1]$2[/align]");l=l.replace(/<li>/gi,"[*]");l=l.replace(/<\/li>/gi,"");l=l.replace(/<ul>/gi,"[list]");l=l.replace(/<(ol|ul style="list-style-type: decimal")>/gi,"[list=1]");l=l.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]");l=l.replace(/<\/(ul|ol)>/gi,"[/list]");l=l.replace(/<table[^>]*>/gi,"[table]");l=l.replace(/<\/table>/gi,"[/table]");l=l.replace(/<tbody>([\s\S]*?)<\/tbody>/,function(x,y){return $.trim(y)});l=l.replace(/<tr><\/tr>/gi,"");l=l.replace(/<tr>/gi,"[tr]");l=l.replace(/<\/tr>/gi,"[/tr]");l=l.replace(/<td style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");l=l.replace(/<td>/gi,"[td]");l=l.replace(/<\/td>/gi,"[/td]");var w={};l.replace(/<span id="selection-marker-\d+" class="redactor-selection-marker"><\/span>/,function(x){var y=x.hashCode();w[y]=x.replace(/\$/g,"$$$$");return"@@"+y+"@@"});l=l.replace(/<[^>]+>/g,"");if($.getLength(w)){for(var i in w){var s=new RegExp("@@"+i+"@@","g");data=data.replace(s,w[i])}}l=l.replace(/</g,"<");l=l.replace(/>/g,">");l=l.replace(/&/g,"&");l=l.replace(/%28/g,"(");l=l.replace(/%29/g,")");var q={};for(var a=0,h=__REDACTOR_SOURCE_BBCODES.length;a<h;a++){var n=__REDACTOR_SOURCE_BBCODES[a];var k=new RegExp("\\["+n+"([\\S\\s]+?)\\[\\/"+n+"\\]","gi");l=l.replace(k,function(x){var y=x.hashCode();q[y]=x.replace(/\$/g,"$$$$");return"@@"+y+"@@"})}var f=l.split("\n");for(var a=0,h=f.length;a<h;a++){f[a]=f[a].replace(/^\s*/,"")}l=f.join("\n");if($.getLength(q)){for(var i in q){var s=new RegExp("@@"+i+"@@","g");l=l.replace(s,q[i])}}this.$source.val(l)},_convertToHtml:function(){var e=this.$source.val();e=this.removeZeroWidthSpace(e);e=e.replace(/&/g,"&");e=e.replace(/</g,"<");e=e.replace(/>/g,">");var b={};for(var k=0,i=__REDACTOR_SOURCE_BBCODES.length;k<i;k++){var c=__REDACTOR_SOURCE_BBCODES[k];var d=new RegExp("\\["+c+"([\\S\\s]+?)\\[\\/"+c+"\\]","gi");e=e.replace(d,function(m){var n=m.hashCode();b[n]=m.replace(/\$/g,"$$$$");return"@@"+n+"@@"})}e=e.replace(/\[url\]([^"]+?)\[\/url]/gi,'<a href="$1">$1</a>');e=e.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'<a href="$1">$2</a>');e=e.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'<a href="$1">$2</a>');e=e.replace(/\[email\]([^"]+?)\[\/email]/gi,'<a href="mailto:$1">$1</a>');e=e.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'<a href="mailto:$1">$2</a>');e=e.replace(/\[b\](.*?)\[\/b]/gi,"<b>$1</b>");e=e.replace(/\[i\](.*?)\[\/i]/gi,"<i>$1</i>");e=e.replace(/\[u\](.*?)\[\/u]/gi,"<u>$1</u>");e=e.replace(/\[s\](.*?)\[\/s]/gi,"<strike>$1</strike>");e=e.replace(/\[sub\](.*?)\[\/sub]/gi,"<sub>$1</sub>");e=e.replace(/\[sup\](.*?)\[\/sup]/gi,"<sup>$1</sup>");e=e.replace(/\[img\]([^"]+?)\[\/img\]/gi,'<img src="$1" />');e=e.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'<img src="$1" style="float: $2" />');e=e.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'<img src="$1" />');e=e.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'<span style="font-size: $1pt">$2</span>');e=e.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'<span style="color: $1">$2</span>');e=e.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'<span style="font-family: $1">$2</span>');e=e.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'<div style="text-align: $1">$2</div>');e=e.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"<li>$1</li>");e=e.replace(/\[list\]/gi,"<ul>");e=e.replace(/\[list=1\]/gi,'<ul style="list-style-type: decimal">');e=e.replace(/\[list=a\]/gi,'<ul style="list-style-type: lower-latin">');e=e.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">');e=e.replace(/\[\/list]/gi,"</ul>");e=e.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(m,n){return"[table]"+$.trim(n)+"[/table]"});e=e.replace(/\[table\]/gi,'<table border="1" cellspacing="1" cellpadding="1" style="width: 500px;">');e=e.replace(/\[\/table\]/gi,"</table>");e=e.replace(/\[tr\]/gi,"<tr>");e=e.replace(/\[\/tr\]/gi,"</tr>");e=e.replace(/\[td\]/gi,"<td>");e=e.replace(/\[\/td\]/gi,"</td>");e=e.replace(/<td>([\S\s]*?)<\/td>/gi,function(m,n){return"<td>"+$.trim(n)+"</td>"});for(var l in __REDACTOR_SMILIES){$smileyCode=l.replace(/</g,"<").replace(/>/g,">");var g=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");e=e.replace(g,'$1<img src="'+__REDACTOR_SMILIES[l]+'" class="smiley" alt="'+$smileyCode+'" />')}e=e.replace(/(javascript):/gi,"$1<span></span>:");e=e.replace(/(\r|\r\n)/,"\n");var a=e.split("\n");e="";for(var k=0,i=a.length;k<i;k++){var j=$.trim(a[k]);if(j.indexOf("<")===0){e+=j}else{if(!j){j="<br>"}e+="<p>"+j+"</p>"}}if($.getLength(b)){for(var f in b){var h=new RegExp("@@"+f+"@@","g");e=e.replace(h,b[f])}}e=e.replace(/\[code\][\S\s]*?\[\/code\]/,"<pre>$&</pre>");this.$source.val(e)},_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]");return a},_wPasteAfterCallback:function(a){a=a.replace(/\[size=(\d+)\]/g,'<p><inline style="font-size: $1pt">');a=a.replace(/\[\/size\]/g,"</inline></p>");a=a.replace(/<p>([\s\S]*?)<\/p>/g,"<p>$1<br><br></p>");a=a.replace(/<header[^>]*>/g,"");a=a.replace(/<\/header>/g,"");a=a.replace(/<div>.*?<\/div>/g,"<p>$1<br></p>");a=a.replace(/<\/?div>/g,"");return a}};
// 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,f,b,e){var d=this._bbcodes[a];var c=this.getSelectionHtml();this.insertHtml("["+d+"]"+c+"[/"+d+"]");this.sync()}};
// wfontcolor.js