/gi,"[tr]\n");m=m.replace(/<\/tr>/gi,"[/tr]\n");m=m.replace(/([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");m=m.replace(/(\t)* | (\t)*/gi,"[td]");m=m.replace(/(\t)*<\/td>/gi,"[/td]\n");var w={};m.replace(/<\/span>/,function(z){var A=z.hashCode();w[A]=z.replace(/\$/g,"$$$$");return"@@"+A+"@@"});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(/</g,"<");m=m.replace(/>/g,">");m=m.replace(/&/g,"&");m=m.replace(/%28/g,"(");m=m.replace(/%29/g,")");var r={};for(var a=0,i=__REDACTOR_SOURCE_BBCODES.length;a/g,">");var b={};for(var m=0,j=__REDACTOR_SOURCE_BBCODES.length;m$1');e=e.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'$2');e=e.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'$2');e=e.replace(/\[email\]([^"]+?)\[\/email]/gi,'$1');e=e.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'$2');e=e.replace(/\[b\](.*?)\[\/b]/gi,"$1");e=e.replace(/\[i\](.*?)\[\/i]/gi,"$1");e=e.replace(/\[u\](.*?)\[\/u]/gi,"$1");e=e.replace(/\[s\](.*?)\[\/s]/gi,"$1");e=e.replace(/\[sub\](.*?)\[\/sub]/gi,"$1");e=e.replace(/\[sup\](.*?)\[\/sup]/gi,"$1");e=e.replace(/\[img\]([^"]+?)\[\/img\]/gi,'');e=e.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'');e=e.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'');e=e.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'$2');e=e.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'$2');e=e.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'$2');e=e.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'$2 ');e=e.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"$1");e=e.replace(/\[list\]/gi,"");e=e.replace(/\[list=1\]/gi,'');e=e.replace(/\[list=a\]/gi,'');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,'');e=e.replace(/\[\/list]/gi," ");e=e.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(o,p){return"[table]"+$.trim(p)+"[/table]"});e=e.replace(/\[table\]/gi,'');e=e.replace(/\[\/table\]/gi," ");e=e.replace(/\[tr\]/gi,"");e=e.replace(/\[\/tr\]/gi," ");e=e.replace(/\[td\]/gi,"");e=e.replace(/\[\/td\]/gi," | ");e=e.replace(/([\S\s]*?)<\/td>/gi,function(o,q){var p=$.trim(q);if(!p.length){p=""}return" | "+p+" | "});var g=this.getOption("wAttachmentUrl");if(g){var k=this._getImageAttachmentIDs();e=e.replace(/\[attach=(\d+)\]\[\/attach\]/g,function(o,p){p=parseInt(p);if(WCF.inArray(p,k)){return''}return o})}for(var n in __REDACTOR_SMILIES){$smileyCode=n.replace(//g,">");var h=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");e=e.replace(h,'$1')}e=e.replace(/(javascript):/gi,"$1:");e=e.replace(/(\r|\r\n)/,"\n");var a=e.split("\n");e="";for(var m=0,j=a.length;m"}e+=""+l+" "}}if($.getLength(b)){for(var f in b){var i=new RegExp("@@"+f+"@@","g");e=e.replace(i,b[f])}}e=e.replace(/\[code\][\S\s]*?\[\/code\]/,"$& ");this.$source.val(e)},_wPasteBeforeCallback:function(a){var b={1:24,2:22,3:18,4:14,5:12,6:10};a=a.replace(/]+>/g,function(c,d){return"[size="+b[d]+"]"});a=a.replace(/<\/h[1-6]>/g,"[/size]");a=a.replace(/<(article|header)[^>]+>/g,"");a=a.replace(/<\/(article|header)>/g," ");a=a.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"");a=a.replace(/<\/(div|p)><\/(div|p)>/g," @@@wcf_break@@@");return a},_wPasteAfterCallback:function(a){a=a.replace(/([\s\S]*?)<\/p>/g," $1
");a=a.replace(/]*>/g,"");a=a.replace(/<\/header>/g,"");a=a.replace(/.*?<\/div>/g," $1 ");a=a.replace(/<\/?div>/g,"");a=a.replace(/@@@wcf_break@@@/g,"
");a=a.replace(/ /g," ");a=a.replace(/\[size=(\d+)\]/g,'
');a=a.replace(/\[\/size\]/g,"
");a=a.replace(/ ]+)>/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._getImageAttachmentIDs();if(b&&WCF.inArray(d,a)){this.insertDynamic(' ',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}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode={init:function(){this.opts.initCallback=$.proxy(function(){var e=$.trim(this.getOption("wOriginalValue"));if(e.length){this.toggle();this.$source.val(e);this.toggle()}delete this.opts.wOriginalValue},this);this.opts.pasteBeforeCallback=$.proxy(this._wPasteBeforeCallback,this);this.opts.pasteAfterCallback=$.proxy(this._wPasteAfterCallback,this);var d=this.syncClean;var b=this;this.syncClean=function(e){e=e.replace(/ ]+)?><\/p>/g,"
@@@wcf_empty_line@@@ ");return d.call(b,e)};if(this.getOption("wAutosaveOnce")){this._saveTextToStorage();delete this.opts.wAutosaveOnce}var a=this.buttonGet("table");if(a.length){var c=a.data("dropdown").children("a.redactor_dropdown_add_head");c.prev().remove();c.next().remove();c.remove();a.click($.proxy(this._tableButtonClick,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(' ');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.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")}},_convertFromHtml:function(){var m=this.$source.val();m=m.replace(/\r?\n/g,"");var f=m.split(/(<\/?p>)/);var g="";var x="";for(var a=0;a "){continue}else{if(y==""){x=$.trim(x);if(x!="@@@wcf_empty_line@@@"){x+="\n"}g+=x;x=""}else{if(a==0){g+=y}else{x+=y}}}}m=g;m=m.replace(/@@@wcf_empty_line@@@/g,"\n");m=m.replace(/\n\n$/,"\n");m=m.replace(/ $/,"");m=m.replace(/ /g,"\n");m=m.replace(/ /g,"");m=m.replace(/ /gi," ");m=m.replace(/]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi,"[email=$2]$3[/email]");m=m.replace(/]*?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(//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(//gi,"[sub]");m=m.replace(/<\/sub>/gi,"[/sub]");m=m.replace(//gi,"[sup]");m=m.replace(/<\/sup>/gi,"[/sup]");m=m.replace(/]*?alt="([^"]+?)" class="smiley".*?>/gi,"$1");m=m.replace(/]*?class="smiley" alt="([^"]+?)".*?>/gi,"$1");m=m.replace(/]*?class="redactorEmbeddedAttachment" data-attachment-id="(\d+)".*?>/gi,"[attach=$1][/attach]");m=m.replace(/]*?src=(["'])([^"']+?)\1 style="float: (left|right)[^"]*".*?>/gi,"[img='$2',$3][/img]");m=m.replace(/]*?src=(["'])([^"']+?)\1.*?>/gi,"[img]$2[/img]");var d=m.split(/(<\/?span[^>]*>)/);var x=[];var p=[];var q="";for(var a=0;a"){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(/^/)){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='';n=""}}}}x[x.length]="";p[x.length]={start:v,end:n}}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(/- /gi,"[*]");m=m.replace(/<\/li>/gi,"");m=m.replace(/
/gi,"[list]");m=m.replace(/<(ol|ul style="list-style-type: decimal")>/gi,"[list=1]");m=m.replace(//gi,"[list=$1]");m=m.replace(/<\/(ul|ol)>/gi,"[/list]");m=m.replace(/]*>/gi,"[table]\n");m=m.replace(/<\/table>/gi,"[/table]\n");m=m.replace(/([\s\S]*?)<\/tbody>/,function(z,A){return $.trim(A)});m=m.replace(/<\/tr>/gi,"");m=m.replace(/ /gi,"[tr]\n");m=m.replace(/<\/tr>/gi,"[/tr]\n");m=m.replace(/([\s\S]*?)<\/td>/gi,"[td][align=$1]$2[/align][/td]");m=m.replace(/(\t)* | (\t)*/gi,"[td]");m=m.replace(/(\t)*<\/td>/gi,"[/td]\n");var w={};m.replace(/<\/span>/,function(z){var A=z.hashCode();w[A]=z.replace(/\$/g,"$$$$");return"@@"+A+"@@"});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(/</g,"<");m=m.replace(/>/g,">");m=m.replace(/&/g,"&");m=m.replace(/%28/g,"(");m=m.replace(/%29/g,")");var r={};for(var a=0,i=__REDACTOR_SOURCE_BBCODES.length;a/g,">");var b={};for(var m=0,j=__REDACTOR_SOURCE_BBCODES.length;m$1');e=e.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'$2');e=e.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'$2');e=e.replace(/\[email\]([^"]+?)\[\/email]/gi,'$1');e=e.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'$2');e=e.replace(/\[b\](.*?)\[\/b]/gi,"$1");e=e.replace(/\[i\](.*?)\[\/i]/gi,"$1");e=e.replace(/\[u\](.*?)\[\/u]/gi,"$1");e=e.replace(/\[s\](.*?)\[\/s]/gi,"$1");e=e.replace(/\[sub\](.*?)\[\/sub]/gi,"$1");e=e.replace(/\[sup\](.*?)\[\/sup]/gi,"$1");e=e.replace(/\[img\]([^"]+?)\[\/img\]/gi,'');e=e.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'');e=e.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'');e=e.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'$2');e=e.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'$2');e=e.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'$2');e=e.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'$2 ');e=e.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"- $1
");e=e.replace(/\[list\]/gi,"");e=e.replace(/\[list=1\]/gi,'');e=e.replace(/\[list=a\]/gi,'');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,'');e=e.replace(/\[\/list]/gi," ");e=e.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(o,p){return"[table]"+$.trim(p)+"[/table]"});e=e.replace(/\[table\]/gi,'');e=e.replace(/\[\/table\]/gi," ");e=e.replace(/\[tr\]/gi,"");e=e.replace(/\[\/tr\]/gi," ");e=e.replace(/\[td\]/gi,"");e=e.replace(/\[\/td\]/gi," | ");e=e.replace(/([\S\s]*?)<\/td>/gi,function(o,q){var p=$.trim(q);if(!p.length){p=""}return" | "+p+" | "});var g=this.getOption("wAttachmentUrl");if(g){var k=this._getImageAttachmentIDs();e=e.replace(/\[attach=(\d+)\]\[\/attach\]/g,function(o,p){p=parseInt(p);if(WCF.inArray(p,k)){return''}return o})}for(var n in __REDACTOR_SMILIES){$smileyCode=n.replace(//g,">");var h=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");e=e.replace(h,'$1')}e=e.replace(/(javascript):/gi,"$1:");e=e.replace(/(\r|\r\n)/,"\n");var a=e.split("\n");e="";for(var m=0,j=a.length;m"}e+=""+l+" "}}if($.getLength(b)){for(var f in b){var i=new RegExp("@@"+f+"@@","g");e=e.replace(i,b[f])}}e=e.replace(/\[code\][\S\s]*?\[\/code\]/,"$& ");this.$source.val(e)},_wPasteBeforeCallback:function(a){var b={1:24,2:22,3:18,4:14,5:12,6:10};a=a.replace(/]+>/g,function(c,d){return"[size="+b[d]+"]"});a=a.replace(/<\/h[1-6]>/g,"[/size]");a=a.replace(/<(article|header)[^>]+>/g,"");a=a.replace(/<\/(article|header)>/g," ");a=a.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"");a=a.replace(/<\/(div|p)><\/(div|p)>/g," @@@wcf_break@@@");return a},_wPasteAfterCallback:function(a){a=a.replace(/([\s\S]*?)<\/p>/g," $1
");a=a.replace(/]*>/g,"");a=a.replace(/<\/header>/g,"");a=a.replace(/.*?<\/div>/g," $1 ");a=a.replace(/<\/?div>/g,"");a=a.replace(/@@@wcf_break@@@/g,"
");a=a.replace(/ /g," ");a=a.replace(/\[size=(\d+)\]/g,'
');a=a.replace(/\[\/size\]/g,"
");a=a.replace(/ ]+)>/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._getImageAttachmentIDs();if(b&&WCF.inArray(d,a)){this.insertDynamic(' ',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}};
// wbutton.js
if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbutton={_bbcodes:{},init:function(){this._bbcodes={};for(var g=0,d=__REDACTOR_BUTTONS.length;g ").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
| |