From 502022f0d71cb8c34055e31e36929e3f6d1d6387 Mon Sep 17 00:00:00 2001 From: "woltlab.com" Date: Sat, 28 Feb 2015 19:21:47 +0100 Subject: [PATCH] Updating minified JavaScript files --- .../install/files/js/3rdParty/redactor/plugins/wcombined.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 50585ca048..ebb6e497b0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js @@ -1,7 +1,7 @@ // table.js if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.table=function(){return{getTemplate:function(){return String()+'
'},init:function(){var b={};b.insert_table={title:this.lang.get("insert_table"),func:this.table.show};b.insert_row_above={title:this.lang.get("insert_row_above"),func:this.table.addRowAbove};b.insert_row_below={title:this.lang.get("insert_row_below"),func:this.table.addRowBelow};b.insert_column_left={title:this.lang.get("insert_column_left"),func:this.table.addColumnLeft};b.insert_column_right={title:this.lang.get("insert_column_right"),func:this.table.addColumnRight};b.add_head={title:this.lang.get("add_head"),func:this.table.addHead};b.delete_head={title:this.lang.get("delete_head"),func:this.table.deleteHead};b.delete_column={title:this.lang.get("delete_column"),func:this.table.deleteColumn};b.delete_row={title:this.lang.get("delete_row"),func:this.table.deleteRow};b.delete_table={title:this.lang.get("delete_table"),func:this.table.deleteTable};this.observe.addButton("td","table");this.observe.addButton("th","table");var a=this.button.addBefore("link","table",this.lang.get("table"));this.button.addDropdown(a,b)},show:function(){this.modal.addTemplate("table",this.table.getTemplate());this.modal.load("table",this.lang.get("insert_table"),300);this.modal.createCancelButton();var a=this.modal.createActionButton(this.lang.get("insert"));a.on("click",this.table.insert);this.selection.save();this.modal.show();$("#redactor-table-rows").focus()},insert:function(){var n=$("#redactor-table-rows").val(),c=$("#redactor-table-columns").val(),a=$("
"),b=Math.floor(Math.random()*99999),l=$('
'),e,h,j,k;for(e=0;e");for(j=0;j"+this.opts.invisibleSpace+"");if(e===0&&j===0){k.append(this.selection.getMarker())}$(h).append(k)}l.append(h)}a.append(l);var f=a.html();this.modal.close();this.selection.restore();if(this.table.getTable()){return}this.buffer.set();var g=this.selection.getBlock()||this.selection.getCurrent();if(g&&g.tagName!="BODY"){if(g.tagName=="LI"){g=$(g).closest("ul, ol")}$(g).after(f)}else{this.insert.html(f)}this.selection.restore();var m=this.$editor.find("#table"+b);if(!this.opts.linebreaks&&(this.utils.browser("mozilla")||this.utils.browser("msie"))){var d=m.next();if(d.length===0){m.after(this.opts.emptyHtml)}}this.observe.buttons();m.find("span.redactor-selection-marker").remove();m.removeAttr("id");this.code.sync();this.core.setCallback("insertedTable",m)},getTable:function(){var a=$(this.selection.getParent()).closest("table");if(!this.utils.isRedactorParent(a)){return false}if(a.size()===0){return false}return a},restoreAfterDelete:function(a){this.selection.restore();a.find("span.redactor-selection-marker").remove();this.code.sync()},deleteTable:function(){var b=this.table.getTable();if(!b){return}this.buffer.set();var a=b.next();if(!this.opts.linebreaks&&a.length!==0){this.caret.setStart(a)}else{this.caret.setAfter(b)}b.remove();this.code.sync()},deleteRow:function(){var a=this.table.getTable();if(!a){return}var c=$(this.selection.getCurrent());this.buffer.set();var e=c.closest("tr");var b=e.prev().length?e.prev():e.next();if(b.length){var d=b.children("td, th").first();if(d.length){d.prepend(this.selection.getMarker())}}e.remove();this.table.restoreAfterDelete(a)},deleteColumn:function(){var c=this.table.getTable();if(!c){return}this.buffer.set();var d=$(this.selection.getCurrent());var a=d.closest("td, th");var b=a[0].cellIndex;c.find("tr").each($.proxy(function(f,g){var e=$(g);var h=b-1<0?b+1:b-1;if(f===0){e.find("td, th").eq(h).prepend(this.selection.getMarker())}e.find("td, th").eq(b).remove()},this));this.table.restoreAfterDelete(c)},addHead:function(){var a=this.table.getTable();if(!a){return}this.buffer.set();if(a.find("thead").size()!==0){this.table.deleteHead();return}var b=a.find("tr").first().clone();b.find("td").html(this.opts.invisibleSpace);$thead=$("").append(b);a.prepend($thead);this.code.sync()},deleteHead:function(){var a=this.table.getTable();if(!a){return}var b=a.find("thead");if(b.size()===0){return}this.buffer.set();b.remove();this.code.sync()},addRowAbove:function(){this.table.addRow("before")},addRowBelow:function(){this.table.addRow("after")},addColumnLeft:function(){this.table.addColumn("before")},addColumnRight:function(){this.table.addColumn("after")},addRow:function(c){var a=this.table.getTable();if(!a){return}this.buffer.set();var b=$(this.selection.getCurrent());var d=b.closest("tr");var e=d.clone();e.find("th").replaceWith(function(){var f=$("");f[0].attributes=this.attributes;return f.append($(this).contents())});e.find("td").html(this.opts.invisibleSpace);if(c=="after"){d.after(e)}else{d.before(e)}this.code.sync()},addColumn:function(d){var c=this.table.getTable();if(!c){return}var b=0;var e=$(this.selection.getCurrent());this.buffer.set();var f=e.closest("tr");var a=e.closest("td, th");f.find("td, th").each($.proxy(function(g,h){if($(h)[0]===a[0]){b=g}},this));c.find("tr").each($.proxy(function(g,j){var h=$(j).find("td, th").eq(b);var k=h.clone();k.html(this.opts.invisibleSpace);if(d=="after"){h.after(k)}else{h.before(k)}},this));this.code.sync()}}}; // wbbcode.js -if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wbbcode=function(){var a=false;return{init:function(){var e=this.$textarea.wcfIdentify();this.opts.initCallback=(function(){if($.browser.msie){this.$editor.addClass("msie")}var i=$.trim(this.wutil.getOption("woltlab.originalValue"));if(i.length){this.wutil.replaceText(i);this.wutil.selectionEndOfEditor()}delete this.opts.woltlab.originalValue;$(document).trigger("resize");this.wutil.saveSelection()}).bind(this);this.opts.pasteBeforeCallback=$.proxy(this.wbbcode._pasteBeforeCallback,this);this.opts.pasteCallback=$.proxy(this.wbbcode._pasteCallback,this);var d=this.clean.onSync;this.clean.onSync=(function(i){if(a===true){a=false}else{i=i.replace(/

]+)?><\/p>/g,"

@@@wcf_empty_line@@@

")}return d.call(this,i)}).bind(this);if(this.wutil.getOption("woltlab.autosaveOnce")){this.wutil.saveTextToStorage();delete this.opts.woltlab.autosaveOnce}var c=this.button.get("table");if(c.length){var h=c.data("dropdown");h.find(".redactor-dropdown-add_head").parent().remove();h.find(".redactor-dropdown-delete_head").parent().remove();$('"}return'

"+__REDACTOR_CODE_HIGHLIGHTERS[N]+(Q?": "+WCF.String.escapeHTML(Q):"")+'

    '+U+"
"});I=I.replace(z,i)}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:I});return I},_pasteBeforeCallback:function(b){var c={1:24,2:22,3:18,4:14,5:12,6:10};b=b.replace(/]*)>/g,function(g,j,i){if(i&&i.match(/style="([^"]+?)"/)){if(/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var d=$('
').appendTo(document.body);var f=parseInt(d[0].clientWidth);d.remove();var e=-1;var h=false;$.each(c,function(m,l){if(e===-1){e=m}else{if(Math.abs(f-l)/g,"[/size]");b=b.replace(/<(article|header)[^>]+>/g,"
");b=b.replace(/<\/(article|header)>/g,"
");b=b.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

");b=b.replace(/<\/(div|p)><\/(div|p)>/g,"

");b=b.replace(/<\/?wbr[^>]*>/g,"");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:b});return b},_pasteCallback:function(b){b=b.replace(/\[size=(\d+)\]/g,'

');b=b.replace(/\[\/size\]/g,"

");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:b});return b;b=b.replace(/]+)>/g,function(c,d){c=c.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return c});return b},insertAttachment:function(f,d){f=parseInt(f);var b=this.wutil.getOption("woltlab.attachment"+(!d?"Thumbnail":"")+"Url");var e=this.wbbcode._getImageAttachments();if(b&&e[f]!==undefined){var c="";if(d){c=' style="width: '+e[f].width+"px; max-height: "+e[f].height+"px; max-width: "+e[f].width+'px;"'}this.wutil.insertDynamic('","[attach="+f+(d?",none,"+e[f].width:"")+"][/attach]")}else{this.wutil.insertDynamic("[attach="+f+"][/attach]")}},removeAttachment:function(b){if(!this.opts.visual){return}this.$editor.find("img.redactorEmbeddedAttachment").each(function(c,e){var d=$(e);if(d.data("attachmentID")==b){d.remove()}})},_getImageAttachments:function(){var c=this.wutil.getOption("woltlab.attachmentImages")||[];if(c.length){delete this.opts.attachmentImages;return c}var b={imageAttachments:{}};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),b);return b.imageAttachments},_keydownCallback:function(u){switch(u.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.ENTER:case $.ui.keyCode.UP:case 83:break;default:return;break}this.selection.get();var m=this.selection.getCurrent();var l=this.selection.getParent();l=(l)?$(l):l;var i=(l)?l.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(u.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var g=false;if(i.length){var j=true;for(var b=0;b');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").click($.proxy(function(f){f.preventDefault();this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(d);var b=c.offset();d.css({left:b.left+"px",top:(b.top+20)+"px"});$(".redactor-link-tooltip").remove();d.appendTo(document.body);this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each((function(b,e){var c=$(e);var d=c.find(".redactorEditCodeBox");if(!d.length){d=$('
'+WCF.Language.get("wcf.bbcode.code.edit")+"
").insertAfter(c.find("> div > div > h3"))}d.off("click.wbbcode").on("click.wbbcode",(function(){this.wbbcode._handleInsertCode(c,false)}).bind(this))}).bind(this))},_openQuoteEditOverlay:function(b,d){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(d?"insert":"edit")),400);var c=this.modal.createActionButton(this.lang.get("save"));if(d){this.selection.save();c.click($.proxy(function(){var g=$("#redactorQuoteAuthor").val();var f=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore();a=true;var e=this.selection.getHtml();if(this.utils.isEmpty(e)){e=""}var h=this.wbbcode.insertQuoteBBCode(g,f,e);if(h!==null){if(!e.length){if($.browser.mozilla){h.children("br[type=_moz]").replaceWith("
"+this.opts.invisibleSpace+"
")}this.caret.setStart(h.children("div")[0])}}this.modal.close()},this))}else{$("#redactorQuoteAuthor").val(b.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(b.attr("cite")));c.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();b.data("author",e);b.attr("data-author",e);b.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this.wbbcode._updateQuoteHeader(b);this.modal.close()},this))}this.modal.show()},_updateQuoteHeader:function(c){var d=c.data("author");var b=c.attr("cite");if(b){b=WCF.String.escapeHTML(b)}c.find("> div > header > h3").empty().append(this.wbbcode._buildQuoteHeader(d,b))},insertQuoteBBCode:function(d,i,e,f){var h="[quote]";var b="[/quote]";if(d){if(i){h="[quote='"+d+"','"+i+"']"}else{h="[quote='"+d+"']"}}var m=null;if(this.wutil.inWysiwygMode()){var g=(f)?this.wbbcode.convertToHtml(f):e;var l=WCF.getUUID();var c=this.wbbcode.convertToHtml(h+l+b);c=c.replace(l,g.replace(/^

/,"").replace(/<\/p>$/,""));c=c.replace(/^

/,"").replace(/<\/p>$/,"");c=c.replace(/

div");if(k.length==1){if(k[0].innerHTML===""){k[0].innerHTML=this.opts.invisibleSpace}}else{if($.browser.mozilla){var j=m.find("> div > br[type=_moz]");if(j.length){$("
"+this.opts.invisibleSpace+"
").insertBefore(j);j.remove()}}}m.removeAttr("id");this.wutil.setCaretAfter(m[0])}this.wbbcode.observeQuotes();this.wbbcode.fixBlockLevelElements();this.$toolbar.find("a.re-__wcf_quote").removeClass("redactor-button-disabled")}else{this.wutil.insertAtCaret(h+f+b)}this.wutil.saveSelection();return m},_buildQuoteHeader:function(c,d){var b="";if(!c&&d){c=d;d=""}if(c){if(d){b+=''}b+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(c)});if(d){b+=""}}else{b=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+""}return b},_handleInsertQuote:function(){this.wbbcode._openQuoteEditOverlay(null,true)},_handleInsertCode:function(d,f){this.modal.load("code",WCF.Language.get("wcf.bbcode.code."+(f?"insert":"edit")),400);var b=this.modal.createActionButton(this.lang.get("save")).addClass("buttonPrimary");if(f){this.selection.get();var c=this.selection.getText();this.selection.save();this.modal.show();var j=$("#redactorCodeBox").focus();j.val(c);b.click($.proxy(function(){var q=$("#redactorCodeBox");var n=$("#redactorCodeFilename");var s=$("#redactorCodeHighlighter");var t=$("#redactorCodeLineNumber");var p=q.val().replace(/^\n+/,"").replace(/\n+$/,"");if($.trim(p).length===0){if(!q.next("small.innerError").length){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(q)}return}var o=$.trim(n.val().replace(/['"]/g,""));var r="[code="+s.val()+","+t.val()+(o.length?",'"+o+"'":"")+"]";r+=p;r+="[/code]";this.wutil.adjustSelectionForBlockElement();this.wutil.saveSelection();var m=this.wbbcode.convertToHtml(r);this.buffer.set();this.insert.html(m,false);var q=this.$editor.find(".codeBox:not(.jsRedactorCodeBox)");this.wbbcode.observeCodeListings();this.wbbcode.fixBlockLevelElements();q.attr("contenteditable","false");this.wutil.setCaretAfter(q[0]);this.modal.close()},this))}else{var h=this.modal.createActionButton(WCF.Language.get("wcf.global.button.delete"));h.click((function(){this.buffer.set();d.remove();this.modal.close()}).bind(this));this.modal.show();var j=$("#redactorCodeBox").focus();var i=$("#redactorCodeFilename");var g=$("#redactorCodeHighlighter");var k=$("#redactorCodeLineNumber");g.val(d.data("highlighter"));i.val(d.data("filename")||"");var e=d.find("> div > ol");k.val(parseInt(e.prop("start")));var l="";e.children("li").each(function(m,n){l+=$(n).text()+"\n"});j.val(l.replace(/^\n+/,"").replace(/\n+$/,""));b.click($.proxy(function(){var n=j.val().replace(/^\n+/,"").replace(/\n+$/,"");if($.trim(n).length===0){if(!j.next("small.innerError").length){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(j)}return}var r=g.val();d.data("highlighter",r);d.attr("data-highlighter",r);var o=__REDACTOR_CODE_HIGHLIGHTERS[r];var m=$.trim(i.val().replace(/['"]/g,""));if(m){o+=": "+WCF.String.escapeHTML(m);d.data("filename",m);d.attr("data-filename",m)}else{d.removeAttr("data-filename");d.removeData("filename")}d.data("highlighter",g.val());d.find("> div > div > h3").html(o);var p=d.find("> div > ol").empty();var s=parseInt(k.val());p.prop("start",(s>1?s:1));n=n.split("\n");var q="";for(var t=0;t"+WCF.String.escapeHTML(n[t])+""}p.append($(q));this.modal.close()},this))}},fixBlockLevelElements:function(){return;var b=(function(e,d){var c="P";if(e.parentElement.tagName==="DIV"&&e.parentElement!==this.$editor[0]){e=e.parentElement;c="DIV"}if(e[d]===null||e[d].tagName!==c){$("<"+c+">"+this.opts.invisibleSpace+"")[(d==="previousElementSibling"?"insertBefore":"insertAfter")](e)}else{if(e.previousElementSibling.tagName===c){if(!e[d].innerHTML.length||e[d].innerHTML.toLowerCase()==="

"){$(e[d]).html(this.opts.invisibleSpace)}}}}).bind(this);this.$editor.find("blockquote, .codeBox").each((function(c,d){b(d,"previousElementSibling");b(d,"nextElementSibling")}).bind(this))},fixFormatting:function(d){var b=function(f){f.style.removeProperty("text-align");for(var g=0;g]+)?><\/p>/g,"

@@@wcf_empty_line@@@

")}return d.call(this,i)}).bind(this);if(this.wutil.getOption("woltlab.autosaveOnce")){this.wutil.saveTextToStorage();delete this.opts.woltlab.autosaveOnce}var c=this.button.get("table");if(c.length){var h=c.data("dropdown");h.find(".redactor-dropdown-add_head").parent().remove();h.find(".redactor-dropdown-delete_head").parent().remove();$('
";return T})};for(var b=B.length-1;b>=0;b--){var v=B[b];var z=new RegExp("@@"+v.hashCode+"@@","g");I=I.replace(z,q(v.content))}}I=I.replace(/<(?:div|p)><(blockquote|div)/g,"<$1");I=I.replace(/<\/(blockquote|div)><\/(?:div|p)>/g,"");if(u.length){for(var b=u.length-1;b>=0;b--){var A=u[b];var z=new RegExp("@@"+A.key+"@@","g");var i=A.value;i=i.replace(/^\[code([^\]]*)\]([\S\s]*)\[\/code\]$/,function(M,T,O){var N="plain";var R=0;var Q="";if(T){T=T.substring(1);T=T.split(",");var P=function(V){return V.match(/^\d+$/)};var L=function(V){return(V.indexOf(".")!==-1)};var K=function(V){return(__REDACTOR_CODE_HIGHLIGHTERS[T[0]]!==undefined)};var J=function(V){return V.replace(/^(["'])(.*)\1$/,"$2")};switch(T.length){case 1:if(P(T[0])){R=(parseInt(T[0])>1)?T[0]:0}else{if(L(T[0])){Q=J(T[0])}else{if(K(T[0])){N=T[0]}}}break;case 2:if(P(T[0])){R=(parseInt(T[0])>1)?T[0]:0;if(L(T[1])){Q=J(T[1])}else{if(K(T[1])){N=T[1]}}}else{if(K(T[0])){N=T[0]}if(L(T[1])){Q=J(T[1])}}break;case 3:if(K(T[0])){N=T[0]}if(P(T[1])){R=T[1]}if(L(T[2])){Q=J(T[2])}break}}O=O.replace(/^\n+/,"").replace(/\n+$/,"").split(/\n/);var U="";for(var S=0;S"+O[S]+""}return'

"+__REDACTOR_CODE_HIGHLIGHTERS[N]+(Q?": "+WCF.String.escapeHTML(Q):"")+'

    '+U+"
"});I=I.replace(z,i)}}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterConvertToHtml",{data:I});return I},_pasteBeforeCallback:function(b){var c={1:24,2:22,3:18,4:14,5:12,6:10};b=b.replace(/]*)>/g,function(g,j,i){if(i&&i.match(/style="([^"]+?)"/)){if(/font-size: ?(\d+|\d+\.\d+)(px|pt|em|rem|%)/.test(RegExp.$1)){var d=$('
').appendTo(document.body);var f=parseInt(d[0].clientWidth);d.remove();var e=-1;var h=false;$.each(c,function(m,l){if(e===-1){e=m}else{if(Math.abs(f-l)/g,"[/size]");b=b.replace(/<(article|header)[^>]+>/g,"
");b=b.replace(/<\/(article|header)>/g,"
");b=b.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g,"

");b=b.replace(/<\/(div|p)><\/(div|p)>/g,"

");b=b.replace(/<\/?wbr[^>]*>/g,"");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","beforePaste",{html:b});return b},_pasteCallback:function(b){b=b.replace(/\[size=(\d+)\]/g,'

');b=b.replace(/\[\/size\]/g,"

");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","afterPaste",{html:b});return b;b=b.replace(/]+)>/g,function(c,d){c=c.replace(/data-mozilla-paste-image="0"/,'data-mozilla-paste-image="0" style="display:none"');return c});return b},insertAttachment:function(f,d){f=parseInt(f);var b=this.wutil.getOption("woltlab.attachment"+(!d?"Thumbnail":"")+"Url");var e=this.wbbcode._getImageAttachments();if(b&&e[f]!==undefined){var c="";if(d){c=' style="width: '+e[f].width+"px; max-height: "+e[f].height+"px; max-width: "+e[f].width+'px;"'}this.wutil.insertDynamic('","[attach="+f+(d?",none,"+e[f].width:"")+"][/attach]")}else{this.wutil.insertDynamic("[attach="+f+"][/attach]")}},removeAttachment:function(b){if(!this.opts.visual){return}this.$editor.find("img.redactorEmbeddedAttachment").each(function(c,e){var d=$(e);if(d.data("attachmentID")==b){d.remove()}})},_getImageAttachments:function(){var c=this.wutil.getOption("woltlab.attachmentImages")||[];if(c.length){delete this.opts.attachmentImages;return c}var b={imageAttachments:{}};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","getImageAttachments_"+this.$textarea.wcfIdentify(),b);return b.imageAttachments},_keydownCallback:function(u){switch(u.event.which){case $.ui.keyCode.BACKSPACE:case $.ui.keyCode.DELETE:case $.ui.keyCode.DOWN:case $.ui.keyCode.ENTER:case $.ui.keyCode.UP:case 83:break;default:return;break}this.selection.get();var m=this.selection.getCurrent();var l=this.selection.getParent();l=(l)?$(l):l;var i=(l)?l.closest("blockquote.quoteBox",this.$editor.get()[0]):{length:0};switch(u.event.which){case $.ui.keyCode.BACKSPACE:if(this.wutil.isCaret()){var g=false;if(i.length){var j=true;for(var b=0;b');$(''+WCF.Language.get("wcf.bbcode.quote.edit")+"").click($.proxy(function(f){f.preventDefault();this.wbbcode._openQuoteEditOverlay($(e.currentTarget).closest("blockquote.quoteBox"),false);$(".redactor-link-tooltip").remove()},this)).appendTo(d);var b=c.offset();d.css({left:b.left+"px",top:(b.top+20)+"px"});$(".redactor-link-tooltip").remove();d.appendTo(document.body);this.selection.remove()},observeCodeListings:function(){this.$editor.find(".codeBox").each((function(b,e){var c=$(e);var d=c.find(".redactorEditCodeBox");if(!d.length){d=$('
'+WCF.Language.get("wcf.bbcode.code.edit")+"
").insertAfter(c.find("> div > div > h3"))}d.off("click.wbbcode").on("click.wbbcode",(function(){this.wbbcode._handleInsertCode(c,false)}).bind(this))}).bind(this))},_openQuoteEditOverlay:function(b,d){this.modal.load("quote",WCF.Language.get("wcf.bbcode.quote."+(d?"insert":"edit")),400);var c=this.modal.createActionButton(this.lang.get("save"));if(d){this.selection.save();c.click($.proxy(function(){var g=$("#redactorQuoteAuthor").val();var f=WCF.String.escapeHTML($("#redactorQuoteLink").val());this.selection.restore();a=true;var e=this.selection.getHtml();if(this.utils.isEmpty(e)){e=""}var h=this.wbbcode.insertQuoteBBCode(g,f,e);if(h!==null){if(!e.length){if($.browser.mozilla){h.children("br[type=_moz]").replaceWith("
"+this.opts.invisibleSpace+"
")}this.caret.setStart(h.children("div")[0])}}this.modal.close()},this))}else{$("#redactorQuoteAuthor").val(b.data("author"));$("#redactorQuoteLink").val(WCF.String.unescapeHTML(b.attr("cite")));c.click($.proxy(function(){var e=$("#redactorQuoteAuthor").val();b.data("author",e);b.attr("data-author",e);b.prop("cite",WCF.String.escapeHTML($("#redactorQuoteLink").val()));this.wbbcode._updateQuoteHeader(b);this.modal.close()},this))}this.modal.show()},_updateQuoteHeader:function(c){var d=c.data("author");var b=c.attr("cite");if(b){b=WCF.String.escapeHTML(b)}c.find("> div > header > h3").empty().append(this.wbbcode._buildQuoteHeader(d,b))},insertQuoteBBCode:function(d,i,e,f){var h="[quote]";var b="[/quote]";if(d){if(i){h="[quote='"+d+"','"+i+"']"}else{h="[quote='"+d+"']"}}var m=null;if(this.wutil.inWysiwygMode()){var g=(f)?this.wbbcode.convertToHtml(f):e;var l=WCF.getUUID();var c=this.wbbcode.convertToHtml(h+l+b);c=c.replace(l,g.replace(/^

/,"").replace(/<\/p>$/,""));c=c.replace(/^

/,"").replace(/<\/p>$/,"");c=c.replace(/

div");if(k.length==1){if(k[0].innerHTML===""){k[0].innerHTML=this.opts.invisibleSpace}}else{if($.browser.mozilla){var j=m.find("> div > br[type=_moz]");if(j.length){$("
"+this.opts.invisibleSpace+"
").insertBefore(j);j.remove()}}}m.removeAttr("id");this.wutil.setCaretAfter(m[0])}this.wbbcode.observeQuotes();this.wbbcode.fixBlockLevelElements();this.$toolbar.find("a.re-__wcf_quote").removeClass("redactor-button-disabled")}else{this.wutil.insertAtCaret(h+f+b)}this.wutil.saveSelection();return m},_buildQuoteHeader:function(c,d){var b="";if(!c&&d){c=d;d=""}if(c){if(d){b+=''}b+=WCF.Language.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:WCF.String.unescapeHTML(c)});if(d){b+=""}}else{b=""+WCF.Language.get("wcf.bbcode.quote.title.clickToSet")+""}return b},_handleInsertQuote:function(){this.wbbcode._openQuoteEditOverlay(null,true)},_handleInsertCode:function(d,f){this.modal.load("code",WCF.Language.get("wcf.bbcode.code."+(f?"insert":"edit")),400);var b=this.modal.createActionButton(this.lang.get("save")).addClass("buttonPrimary");if(f){this.selection.get();var c=this.selection.getText();this.selection.save();this.modal.show();var j=$("#redactorCodeBox").focus();j.val(c);b.click($.proxy(function(){var q=$("#redactorCodeBox");var n=$("#redactorCodeFilename");var s=$("#redactorCodeHighlighter");var t=$("#redactorCodeLineNumber");var p=q.val().replace(/^\n+/,"").replace(/\n+$/,"");if($.trim(p).length===0){if(!q.next("small.innerError").length){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(q)}return}var o=$.trim(n.val().replace(/['"]/g,""));var r="[code="+s.val()+","+t.val()+(o.length?",'"+o+"'":"")+"]";r+=p;r+="[/code]";this.wutil.adjustSelectionForBlockElement();this.wutil.saveSelection();var m=this.wbbcode.convertToHtml(r);this.buffer.set();this.insert.html(m,false);var q=this.$editor.find(".codeBox:not(.jsRedactorCodeBox)");this.wbbcode.observeCodeListings();this.wbbcode.fixBlockLevelElements();q.attr("contenteditable","false");this.wutil.setCaretAfter(q[0]);this.modal.close()},this))}else{var h=this.modal.createActionButton(WCF.Language.get("wcf.global.button.delete"));h.click((function(){this.buffer.set();d.remove();this.modal.close()}).bind(this));this.modal.show();var j=$("#redactorCodeBox").focus();var i=$("#redactorCodeFilename");var g=$("#redactorCodeHighlighter");var k=$("#redactorCodeLineNumber");g.val(d.data("highlighter"));i.val(d.data("filename")||"");var e=d.find("> div > ol");k.val(parseInt(e.prop("start")));var l="";e.children("li").each(function(m,n){l+=$(n).text()+"\n"});j.val(l.replace(/^\n+/,"").replace(/\n+$/,""));b.click($.proxy(function(){var n=j.val().replace(/^\n+/,"").replace(/\n+$/,"");if($.trim(n).length===0){if(!j.next("small.innerError").length){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(j)}return}var r=g.val();d.data("highlighter",r);d.attr("data-highlighter",r);var o=__REDACTOR_CODE_HIGHLIGHTERS[r];var m=$.trim(i.val().replace(/['"]/g,""));if(m){o+=": "+WCF.String.escapeHTML(m);d.data("filename",m);d.attr("data-filename",m)}else{d.removeAttr("data-filename");d.removeData("filename")}d.data("highlighter",g.val());d.find("> div > div > h3").html(o);var p=d.find("> div > ol").empty();var s=parseInt(k.val());p.prop("start",(s>1?s:1));n=n.split("\n");var q="";for(var t=0;t"+WCF.String.escapeHTML(n[t])+""}p.append($(q));this.modal.close()},this))}},fixBlockLevelElements:function(){return;var b=(function(e,d){var c="P";if(e.parentElement.tagName==="DIV"&&e.parentElement!==this.$editor[0]){e=e.parentElement;c="DIV"}if(e[d]===null||e[d].tagName!==c){$("<"+c+">"+this.opts.invisibleSpace+"")[(d==="previousElementSibling"?"insertBefore":"insertAfter")](e)}else{if(e.previousElementSibling.tagName===c){if(!e[d].innerHTML.length||e[d].innerHTML.toLowerCase()==="

"){$(e[d]).html(this.opts.invisibleSpace)}}}}).bind(this);this.$editor.find("blockquote, .codeBox").each((function(c,d){b(d,"previousElementSibling");b(d,"nextElementSibling")}).bind(this))},fixFormatting:function(d){var b=function(f){f.style.removeProperty("text-align");for(var g=0;g").append(e).insertAfter(this.button.get(d).parent());if(a!==null){this.button.setAwesome(b,a)}},_addBBCodeButton:function(b){var c="__wcf_"+b.name;var a=this.button.add(c,b.label);this.button.addCallback(a,this.wbutton._insertBBCode);this._bbcodes[c]={name:b.name,voidElement:(b.voidElement===true)};if(b.icon.match(/^fa\-[a-z\-]+$/)){this.button.setAwesome(c,b.icon)}else{a.css("background-image","url("+__REDACTOR_ICON_PATH+b.icon+")")}},_insertBBCode:function(a){var d=this._bbcodes[a].name;var b={buttonName:a,cancel:false,redactor:this};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","insertBBCode_"+d+"_"+this.$textarea.wcfIdentify(),b);if(b.cancel===false){var c=this.selection.getHtml();if(false&&d==="tt"){var e=(this.selection.getParent())?$(this.selection.getParent()):null;if(e&&e.closest("inline.inlineCode",this.$editor.get()[0]).length){this.inline.toggleClass("inlineCode")}else{this.inline.toggleClass("inlineCode")}}else{this.buffer.set();if(this.utils.browser("mozilla")&&!c.length){var f=getSelection().getRangeAt(0).startContainer;if(f.nodeType===Node.ELEMENT_NODE&&f.tagName==="P"&&f.innerHTML==="
"){f.removeChild(f.children[0])}}if(this._bbcodes[a].voidElement){this.insert.html(c+this.selection.getMarkerAsHtml()+"["+d+"]",false)}else{this.insert.html("["+d+"]"+c+this.selection.getMarkerAsHtml()+"[/"+d+"]",false)}this.selection.restore()}}},insertImage:function(){this.image.show()},_insertImage:function(){var d=$("#redactor-image-link-source");var b=d.val().trim();if(b.length){this.buffer.set();var c=$("#redactor-image-align").val();var a="";if(c==="left"||c==="right"){a=' style="float: '+c+'"'}this.insert.html('",false);this.modal.close();this.observe.images()}else{if(!d.next("small.innerError")){$(''+WCF.Language.get("wcf.global.form.error.empty")+"").insertAfter(d)}}}}}; // wfontcolor.js -- 2.20.1