From: woltlab.com Date: Fri, 19 Sep 2014 15:36:52 +0000 (+0200) Subject: Updating minified JavaScript files X-Git-Tag: 2.1.0_Alpha_1~311^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=56c84f07b697340ef59012df54f05e20dca5b871;p=GitHub%2FWoltLab%2FWCF.git Updating minified JavaScript files --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js index 32c0f3f239..99ad9c18f1 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js @@ -1,5 +1,5 @@ // 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>/g,"

@@@wcf_empty_line@@@

");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(' '+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.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(/™/gi,"\u2122");m=m.replace(/©/gi,"\u00a9");m=m.replace(/…/gi,"\u2026");m=m.replace(/—/gi,"\u2014");m=m.replace(/‐/gi,"\u2010");m=m.replace(/\r?\n/g,"");var f=m.split(/(<\/?(?:div|p)>)/);var g="";var x="";for(var a=0;a"||y=="
"){continue}else{if(y=="

"||y=="
"){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(/
$/,"");m=m.replace(/
/g,"\n");m=m.replace(/
/g,"");m=m.replace(/ /gi," ");m=m.replace(/
\n?]+>\n?]*?)>[\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(/]*?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+)"( style="float: (left|right)")?>/gi,function(A,B,z,C){if(C){return"[attach="+B+","+C+"][/attach]"}return"[attach="+B+"][/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(h.match(/^/)){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(/
  • /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+"@@"});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(/</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 m={};for(var a=0,f=__REDACTOR_SOURCE_BBCODES.length;a$1');u=u.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'$2');u=u.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'$2');u=u.replace(/\[email\]([^"]+?)\[\/email]/gi,'$1');u=u.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'$2');u=u.replace(/\[b\](.*?)\[\/b]/gi,"$1");u=u.replace(/\[i\](.*?)\[\/i]/gi,"$1");u=u.replace(/\[u\](.*?)\[\/u]/gi,"$1");u=u.replace(/\[s\](.*?)\[\/s]/gi,"$1");u=u.replace(/\[sub\](.*?)\[\/sub]/gi,"$1");u=u.replace(/\[sup\](.*?)\[\/sup]/gi,"$1");u=u.replace(/\[img\]([^"]+?)\[\/img\]/gi,'');u=u.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'');u=u.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'');u=u.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'$2');u=u.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'$2');u=u.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'$2');u=u.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'
        $2
        ');u=u.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"
      • $1
      • ");u=u.replace(/\[list\]/gi,"
          ");u=u.replace(/\[list=1\]/gi,'
            ');u=u.replace(/\[list=a\]/gi,'
              ');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,'
                ');u=u.replace(/\[\/list]/gi,"
              ");u=u.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(v,w){return"[table]"+$.trim(w)+"[/table]"});u=u.replace(/\[table\]/gi,'');u=u.replace(/\[\/table\]/gi,"
              ");u=u.replace(/\[tr\]/gi,"");u=u.replace(/\[\/tr\]/gi,"");u=u.replace(/\[td\]/gi,"");u=u.replace(/\[\/td\]/gi,"");u=u.replace(/([\S\s]*?)<\/td>/gi,function(v,x){var w=$.trim(x);if(!w.length){w="​"}return""+w+""});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'"}return w})}for(var o in __REDACTOR_SMILIES){$smileyCode=o.replace(//g,">");var e=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");u=u.replace(e,'$1'+$smileyCode+'')}u=u.replace(/(javascript):/gi,"$1:");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"}}else{if(!l){l="
              "}else{if(l.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,r)){u+=l;continue}}}u+="

              "+l+"

              "}}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,'$1')}u=u.replace(/\[code\][\S\s]*?\[\/code\]/,"
              $&
              ");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='

              '+j._buildQuoteHeader(E,z)+'

              ';A=$.trim(A);var w="";if(A.length){var D=A.split("\n");for(var C=0;C"+B+"
              "}}else{w="
              "+j.opts.invisibleSpace+"
              "}F+=w;F+="
              ";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(/]+>/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@@@");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:a});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});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('',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=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").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+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(b)});if(c){a+=""}}else{a=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+""}return a},_handleInsertQuote:function(){this._openQuoteEditOverlay(null,true)}}; +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>/g,"

              @@@wcf_empty_line@@@

              ");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(' '+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.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(/™/gi,"\u2122");m=m.replace(/©/gi,"\u00a9");m=m.replace(/…/gi,"\u2026");m=m.replace(/—/gi,"\u2014");m=m.replace(/‐/gi,"\u2010");m=m.replace(/\r?\n/g,"");var f=m.split(/(<\/?(?:div|p)>)/);var g="";var x="";for(var a=0;a"||y=="
              "){continue}else{if(y=="

              "||y=="
              "){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(/
              $/,"");m=m.replace(/
              /g,"\n");m=m.replace(/
              /g,"");m=m.replace(/ /gi," ");m=m.replace(/
              \n?]+>\n?]*?)>[\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(/]*?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+)"( style="float: (left|right)")?>/gi,function(A,B,z,C){if(C){return"[attach="+B+","+C+"][/attach]"}return"[attach="+B+"][/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(h.match(/^/)){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(/
            • /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+"@@"});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(/</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 m={};for(var a=0,f=__REDACTOR_SOURCE_BBCODES.length;a$1');u=u.replace(/\[url\='([^'"]+)'](.+?)\[\/url]/gi,'$2');u=u.replace(/\[url\=([^'"\]]+)](.+?)\[\/url]/gi,'$2');u=u.replace(/\[email\]([^"]+?)\[\/email]/gi,'$1');u=u.replace(/\[email\=([^"\]]+)](.+?)\[\/email]/gi,'$2');u=u.replace(/\[b\](.*?)\[\/b]/gi,"$1");u=u.replace(/\[i\](.*?)\[\/i]/gi,"$1");u=u.replace(/\[u\](.*?)\[\/u]/gi,"$1");u=u.replace(/\[s\](.*?)\[\/s]/gi,"$1");u=u.replace(/\[sub\](.*?)\[\/sub]/gi,"$1");u=u.replace(/\[sup\](.*?)\[\/sup]/gi,"$1");u=u.replace(/\[img\]([^"]+?)\[\/img\]/gi,'');u=u.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi,'');u=u.replace(/\[img='?([^"]*?)'?\]\[\/img\]/gi,'');u=u.replace(/\[size=(\d+)\](.*?)\[\/size\]/gi,'$2');u=u.replace(/\[color=([#a-z0-9]*?)\](.*?)\[\/color\]/gi,'$2');u=u.replace(/\[font='?([a-z,\- ]*?)'?\](.*?)\[\/font\]/gi,'$2');u=u.replace(/\[align=(left|right|center|justify)\](.*?)\[\/align\]/gi,'
                  $2
                  ');u=u.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,"
                • $1
                • ");u=u.replace(/\[list\]/gi,"
                    ");u=u.replace(/\[list=1\]/gi,'
                      ');u=u.replace(/\[list=a\]/gi,'
                        ');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,'
                          ');u=u.replace(/\[\/list]/gi,"
                        ");u=u.replace(/\[table\]([\S\s]*?)\[\/table\]/gi,function(v,w){return"[table]"+$.trim(w)+"[/table]"});u=u.replace(/\[table\]/gi,'');u=u.replace(/\[\/table\]/gi,"
                        ");u=u.replace(/\[tr\]/gi,"");u=u.replace(/\[\/tr\]/gi,"");u=u.replace(/\[td\]/gi,"");u=u.replace(/\[\/td\]/gi,"");u=u.replace(/([\S\s]*?)<\/td>/gi,function(v,x){var w=$.trim(x);if(!w.length){w="​"}return""+w+""});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'"}return w})}for(var o in __REDACTOR_SMILIES){$smileyCode=o.replace(//g,">");var e=new RegExp("(\\s|>|^)"+WCF.String.escapeRegExp($smileyCode)+"(?=\\s|<|$)","gi");u=u.replace(e,'$1'+$smileyCode+'')}u=u.replace(/(javascript):/gi,"$1:");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"}}else{if(!l){l="
                        "}else{if(l.match(/^@@([0-9\-]+)@@$/)){if(WCF.inArray(RegExp.$1,r)){u+=l;continue}}}u+="

                        "+l+"

                        "}}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,'$1')}u=u.replace(/\[code\][\S\s]*?\[\/code\]/,"
                        $&
                        ");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='

                        '+j._buildQuoteHeader(E,z)+'

                        ';A=$.trim(A);var w="";if(A.length){var D=A.split("\n");for(var C=0;C"+B+"
                        "}}else{w="
                        "+j.opts.invisibleSpace+"
                        "}F+=w;F+="
                        ";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(/]+>/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@@@");a=a.replace(/<(div|p)>
                        <\/(div|p)>/g,"@@@wcf_break@@@");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:a});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});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('',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=$('');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").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+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(b)});if(c){a+=""}}else{a=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+""}return a},_handleInsertQuote:function(){this._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").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}}; // wfontcolor.js