// 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)},_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>/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)}};
+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}};
// 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
// wfontsize.js
if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize={init:function(){var d=[8,10,12,14,18,24,36];var e={};var a=this;for(var g=0,f=d.length;g<f;g++){var b=d[g];e["fontSize"+g]={title:b,className:"wfontsize-"+b,callback:function(){a.inlineSetStyle("font-size",b+"pt")}}}e.separator={name:"separator"};e.remove={title:"remove font size",callback:function(){this.inlineRemoveStyle("font-size")}};this.buttonReplace("fontsize","wfontsize","Change font size",false,e);this.buttonGet("wfontsize").addClass("re-fontsize");e=this.$toolbar.find(".redactor_dropdown_box_wfontsize");for(var g=0,f=d.length;g<f;g++){var b=d[g];var c=e.children("a.wfontsize-"+b).removeClass("wfontsize-"+d).css("font-size",b+"pt");if(b>18){c.css("line-height","1em")}}}};
// wmonkeypatch.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch={init:function(){var d=this;var c=this.indentingStart;this.indentingStart=function(g){c.call(d,g);d.mpIndentingStart(g)};var b=this.buildEventKeydown;this.buildEventKeydown=function(g){if(d.callback("wkeydown",g)!==false){b.call(d,g)}};var f=this.toggleCode;this.toggleCode=function(h){var g=d.normalize(d.$editor.css("height"));f.call(d,h);d.$source.height(g)};var e=this.modalInit;this.modalInit=function(i,h,g,j){d.mpModalInit();e.call(d,i,h,g,j)};var a=this.imageResizeControls;this.imageResizeControls=function(g){return a.call(d,g).hide()};this.setOption("modalOpenedCallback",$.proxy(this.modalOpenedCallback,this));this.modalTemplatesInit()},cleanRemoveSpaces:function(b,a){return b},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()},mpIndentingStart:function(a){if(a==="indent"){var b=this.getBlock();if(b.tagName==="DIV"&&b.getAttribute("data-tagblock")!==null){this.selectionSave();b=$(b);b.replaceWith(b.html());this.selectionRestore();this.sync()}}},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_file_link" id="redactor_file_link" 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>");$.extend(this.opts,{modal_file:String()+'<section id="redactor-modal-file-insert"><div id="redactor-progress" class="redactor-progress-inline" style="display: none;"><span></span></div><form id="redactorUploadFileForm" method="post" action="" enctype="multipart/form-data"><label>'+this.opts.curLang.filename+'</label><input type="text" id="redactor_filename" class="redactor_input" /><div style="margin-top: 7px;"><input type="file" id="redactor_file" name="'+this.opts.fileUploadParam+'" /></div></form></section>',modal_video:String()+'<section id="redactor-modal-video-insert"><form id="redactorInsertVideoForm"><label>'+this.opts.curLang.video_html_code+'</label><textarea id="redactor_insert_video_area" style="width: 99%; height: 160px;"></textarea></form></section><footer><button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button><button id="redactor_insert_video_btn" class="redactor_modal_btn redactor_modal_action_btn">'+this.opts.curLang.insert+"</button></footer>"})},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"})}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"})},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))}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch={init:function(){var c=this;var b=this.indentingStart;this.indentingStart=function(f){if(c.mpIndentingStart(f)){b.call(c,f)}};var a=this.buildEventKeydown;this.buildEventKeydown=function(f){if(c.callback("wkeydown",f)!==false){a.call(c,f)}};var e=this.toggleCode;this.toggleCode=function(g){var f=c.normalize(c.$editor.css("height"));e.call(c,g);c.$source.height(f)};var d=this.modalInit;this.modalInit=function(h,g,f,i){c.mpModalInit();d.call(c,h,g,f,i)};this.setOption("modalOpenedCallback",$.proxy(this.modalOpenedCallback,this));this.modalTemplatesInit()},cleanRemoveSpaces:function(b,a){return b},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()},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_file_link" id="redactor_file_link" 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>");$.extend(this.opts,{modal_file:String()+'<section id="redactor-modal-file-insert"><div id="redactor-progress" class="redactor-progress-inline" style="display: none;"><span></span></div><form id="redactorUploadFileForm" method="post" action="" enctype="multipart/form-data"><label>'+this.opts.curLang.filename+'</label><input type="text" id="redactor_filename" class="redactor_input" /><div style="margin-top: 7px;"><input type="file" id="redactor_file" name="'+this.opts.fileUploadParam+'" /></div></form></section>',modal_video:String()+'<section id="redactor-modal-video-insert"><form id="redactorInsertVideoForm"><label>'+this.opts.curLang.video_html_code+'</label><textarea id="redactor_insert_video_area" style="width: 99%; height: 160px;"></textarea></form></section><footer><button class="redactor_modal_btn redactor_btn_modal_close">'+this.opts.curLang.cancel+'</button><button id="redactor_insert_video_btn" class="redactor_modal_btn redactor_modal_action_btn">'+this.opts.curLang.insert+"</button></footer>"})},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"})}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"})},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))}};
// wupload.js
if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload={_attachmentsContainer:null,init:function(){var a=this;this.buttonReplace("upload","upload","Upload",function(){a._attachmentsContainer.toggle()});this.buttonAwesome("upload","fa-upload");this._initAttachments()},_initAttachments:function(){this._attachmentsContainer=$('<div class="redactorAttachmentContainer" />').hide().appendTo(this.$box);var f=$('<ul class="formAttachmentList clearfix" />').hide().appendTo(this._attachmentsContainer);$('<dl class="wide"><dt></dt><dd><div data-max-size="{@$attachmentHandler->getMaxSize()}"></div><small>'+WCF.String.unescapeHTML(WCF.Language.get("wcf.attachment.upload.limits"))+"</small></dd></dl>").appendTo(this._attachmentsContainer);var a=this.getOption("wattachment");if(a.attachments.length){for(var g=0;g<a.attachments.length;g++){var e=a.attachments[g];var d=$('<li class="box48" />').data("objectID",e.attachmentID);if(e.tinyThumbnailUrl){$('<img src="'+e.tinyThumbnailUrl+'" alt="" class="attachmentTinyThumbnail" />').appendTo(d)}else{$('<span class="icon icon48 icon-paper-clip" />').appendTo(d)}var b=$("<div />").appendTo(d);$('<div><p><a href="'+e.url+'"'+(e.isImage?' title="'+e.filename+'" class="jsImageViewer"':"")+">"+e.filename+"</a></p></div>").appendTo(b);var c=$("<ul />").appendTo(b);$('<li><span class="icon icon16 icon-remove pointer jsTooltip jsDeleteButton " title="'+WCF.Language.get("wcf.global.button.delete")+'" data-object-id="'+e.attachmentID+'" data-confirm-message="'+WCF.Language.get("wcf.attachment.delete.sure")+'"></span></li>').appendTo(c);$('<li><span class="icon icon16 icon-paste pointer jsTooltip jsButtonInsertAttachment" title="'+WCF.Language.get("wcf.attachment.insert")+'" data-object-id="'+e.attachmentID+'"></span></li>').appendTo(c);d.appendTo(f);this._attachmentsContainer.show();f.show()}}new WCF.Attachment.Upload(this._attachmentsContainer.find("> dl > dd > div"),this._attachmentsContainer.children("ul"),a.objectType,a.objectID,a.tmpHash,a.parentObjectID,a.maxCount,this.$source.wcfIdentify());new WCF.Action.Delete("wcf\\data\\attachment\\AttachmentAction",".formAttachmentList > li")}};
// wutil.js