Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sun, 11 Jan 2015 21:36:44 +0000 (22:36 +0100)
committerwoltlab.com <woltlab@woltlab.com>
Sun, 11 Jan 2015 21:36:44 +0000 (22:36 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js

index 8ba09a12402711e8a04a2cd878139ea76d3980c8..07022529c661165a030b90a996fabf12e2da7718 100644 (file)
@@ -13,6 +13,6 @@ if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize=function()
 // wmonkeypatch.js
 if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch=function(){return{init:function(){this.wmonkeypatch.alignment();this.wmonkeypatch.button();this.wmonkeypatch.caret();this.wmonkeypatch.clean();this.wmonkeypatch.code();this.wmonkeypatch.dropdown();this.wmonkeypatch.image();this.wmonkeypatch.inline();this.wmonkeypatch.insert();this.wmonkeypatch.keydown();this.wmonkeypatch.keyup();this.wmonkeypatch.link();this.wmonkeypatch.modal();this.wmonkeypatch.paste();this.wmonkeypatch.observe();this.wmonkeypatch.selection();this.wmonkeypatch.utils();this.wmonkeypatch.rebuildTemplates();this.wmonkeypatch.bindEvents();this.wmonkeypatch.fixWebKit()},bindEvents:function(){var a=this.$textarea.wcfIdentify();this.wutil.setOption("keydownCallback",function(d){var c={cancel:false,event:d};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keydown_"+a,c);return(c.cancel?false:true)});this.wutil.setOption("keyupCallback",(function(d){this.wutil.saveSelection();var c={cancel:false,event:d};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keyup_"+a,c);return(c.cancel?false:true)}).bind(this));if(this.opts.activeButtons){this.$editor.off("mouseup.redactor keyup.redactor focus.redactor");this.$editor.on("mouseup.redactor keyup.redactor focus.redactor",$.proxy(this.observe.buttons,this));this.$editor.on("keyup.redactor",$.proxy(this.keyup.init,this))}var b=false;this.$editor.on("mousedown.wmonkeypatch",(function(){b=true}).bind(this));$(document).on("mouseup.wmonkeypatch",(function(){if(b){b=false;this.wutil.saveSelection()}}).bind(this))},alignment:function(){var a=this.alignment.setBlocks;this.alignment.setBlocks=(function(b){a.call(this,b);WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","fixFormatting_"+this.$textarea.wcfIdentify())}).bind(this)},button:function(){var a=this.button.addDropdown;this.button.addDropdown=(function(b,d){var c=a.call(this,b,d);if(!d){c.addClass("dropdownMenu")}return c}).bind(this)},caret:function(){this.caret.set=(function(g,f,d,b){if(!this.utils.browser("msie")){if(this.utils.isMobile()&&this.utils.browser("webkit")&&navigator.userAgent.match(/(iPad|iPhone|iPod)/i)){if(document.activeElement!==this.$editor[0]){this.$editor.focus()}}else{this.$editor.focus()}}g=g[0]||g;d=d[0]||d;if(this.utils.isBlockTag(g.tagName)&&g.innerHTML===""){g.innerHTML=this.opts.invisibleSpace}if(g.tagName=="BR"&&this.opts.linebreaks===false){var a=$(this.opts.emptyHtml)[0];$(g).replaceWith(a);g=a;d=g}this.selection.get();try{this.range.setStart(g,f);this.range.setEnd(d,b)}catch(c){}this.selection.addRange()}).bind(this);this.caret.setOffset=(function(g,a){if(typeof a=="undefined"){a=g}if(!this.focus.isFocused()){this.focus.setStart()}var b=document.createRange();var d=document.getSelection();var c,f=0;var e=document.createTreeWalker(this.$editor[0],NodeFilter.SHOW_TEXT,null,null);while(c=e.nextNode()){f+=c.nodeValue.length;if(f>g||(g===a&&f===g)){b.setStart(c,c.nodeValue.length+g-f);g=Infinity}if(f>=a){b.setEnd(c,c.nodeValue.length+a-f);break}}d.removeAllRanges();d.addRange(b)}).bind(this)},clean:function(){var c=function(e){e=e.replace(/\u201D/g,"__wcf_preserve_character_1__");e=e.replace(/\u201C/g,"__wcf_preserve_character_2__");e=e.replace(/\u2018/g,"__wcf_preserve_character_3__");e=e.replace(/\u2019/g,"__wcf_preserve_character_4__");return e};var b=function(e){e=e.replace(/__wcf_preserve_character_1__/g,"\u201D");e=e.replace(/__wcf_preserve_character_2__/g,"\u201C");e=e.replace(/__wcf_preserve_character_3__/g,"\u2018");e=e.replace(/__wcf_preserve_character_4__/g,"\u2019");return e};var d=this.clean.onPaste;this.clean.onPaste=(function(f,e){this.opts.replaceDivs=true;f=c(f);f=d.call(this,f,e);this.opts.replaceDivs=false;return b(f)}).bind(this);this.clean.onPasteRemoveEmpty=function(e){return e.replace(/<br\s?\/?>$/i,"")};var a=this.clean.onSet;this.clean.onSet=(function(e){e=c(e);e=a.call(this,e);return b(e)}).bind(this);this.clean.setVerified=(function(g){if(this.utils.browser("msie")){return g}g=g.replace(new RegExp("<img(.*?[^>])>","gi"),'<img$1 data-verified="redactor">');g=g.replace(new RegExp("<span(.*?)>","gi"),'<span$1 data-verified="redactor">');var j=g.match(new RegExp('<(span|img)(.*?)style="(.*?)"(.*?[^>])>',"gi"));if(j){var e=j.length;for(var f=0;f<e;f++){var h=j[f].replace(/style="(.*?)"/i,'style="$1" rel="$1"');g=g.replace(new RegExp(WCF.String.escapeRegExp(j[f]),"gi"),h)}}return g}).bind(this)},code:function(){var c=this.code.startSync;this.code.startSync=(function(){this.code.syncCode=undefined;c.call(this)}).bind(this);var b=this.code.textareaIndenting;this.code.textareaIndenting=(function(d){if(d.keyCode!==9||d.ctrlKey){return true}return b.call(this,d)}).bind(this);var a=this.code.showCode;this.code.showCode=(function(){var d=null;if(!this.$textarea.is(":visible")){d=this.$textarea.parentsUntil(":visible").last();d.show()}a.call(this);if(d!==null){d.hide()}}).bind(this)},dropdown:function(){this.dropdown.build=(function(c,e,d){e.addClass("dropdownMenu");$.each(d,(function(i,h){if(i=="dropdownDivider"){$('<li class="dropdownDivider" />').appendTo(e)}else{var g=$("<li />");var f=$('<a href="#" class="redactor-dropdown-'+i+'">'+h.title+"</a>");f.on("click",$.proxy(function(k){var j="func";var l=h.func;if(h.command){j="command";l=h.command}else{if(h.dropdown){j="dropdown";l=h.dropdown}}this.button.onClick(k,i,j,l)},this));f.appendTo(g);g.appendTo(e)}}).bind(this))}).bind(this);var a=this.dropdown.show;this.dropdown.show=$.proxy(function(f,c){var d=this.button.get(c).data("dropdown");b(d);if($.browser.iOS){this.wutil.saveSelection()}a.call(this,f,c);d.off("mouseover mouseout")},this);var b=function(f){if(f.hasClass("dropdownMenu")){return}f.addClass("dropdownMenu");var e=f.children("a").detach();for(var d=0;d<e.length;d++){var c=$("<li />").appendTo(f);c.append(e[d])}}},image:function(){var c=this.image.setEditable;this.image.setEditable=(function(d){if(!d.hasClass("smiley")){c.call(this,d)}}).bind(this);var b=this.image.loadEditableControls;this.image.loadEditableControls=(function(d){var e=b.call(this,d);if(d.hasClass("redactorDisableResize")&&e!==false){e.hide()}return e}).bind(this);this.image.show=(function(){this.modal.load("image",this.lang.get("image"),0);var d=this.modal.createActionButton(this.lang.get("insert"));d.click($.proxy(this.wbutton._insertImage,this));this.selection.save();this.modal.show()}).bind(this);this.image.showEdit=(function(d){this.modal.load("imageEdit",this.lang.get("edit"),0);this.image.buttonSave=this.modal.createActionButton(this.lang.get("save"));this.image.buttonSave.click((function(){this.image.update(d)}).bind(this));$("#redactor-image-link-source").val(d.attr("src"));$("#redactor-image-align").val(d.css("float"));this.modal.show()}).bind(this);var a=(function(e){var d=e.parent();e=e.detach();e.prependTo(d);this.caret.setAfter(e)}).bind(this);this.image.update=(function(d){this.image.hideResize();this.buffer.set();d.attr("src",$("#redactor-image-link-source").val());this.image.setFloating(d);a(d);this.modal.close();this.observe.images()}).bind(this)},inline:function(){var b=this.inline.format;this.inline.format=(function(c,d,e){if($.browser.iOS){this.wutil.restoreSelection()}b.call(this,c,d,e)}).bind(this);var a=this.inline.removeStyleRule;this.inline.removeStyleRule=(function(c){if($.browser.iOS){this.wuil.restoreSelection()}a.call(this,c)}).bind(this)},insert:function(){var c=($.browser.webkit||document.documentElement.style.hasOwnProperty("WebkitAppearance")||window.hasOwnProperty("chrome"));var a=(function(g){var f=this.$editor.html();if(this.utils.isEmpty(f)){var i=false;if(g.match(/^<(blockquote|div|p)/i)){this.$editor.empty();i=true}this.$editor.focus();if(!i){this.caret.setEnd(this.$editor.children("p:eq(0)"))}}else{if(document.activeElement!==this.$editor[0]){this.wutil.restoreSelection()}if(g.match(/^<(blockquote|div|p)/i)&&getSelection().getRangeAt(0).collapsed){var h=getSelection().getRangeAt(0).startContainer;if(h.nodeType===Node.TEXT_NODE&&h.textContent==="\u200b"){this.caret.setEnd($(h.parentElement).html("<br />"))}}}}).bind(this);var b=(function(){var f=false;this.$editor.find("span").each(function(){var g=$(this);if(g.data("verified")!=="redactor"){var h=$("<b>helper</b>").insertBefore(g);h.after(g.contents());h.remove();g.remove();f=true}});if(f){this.wutil.saveSelection()}}).bind(this);var e=this.insert.html;this.insert.html=(function(g,f){a(g);e.call(this,g,f);this.wutil.saveSelection();if(c){setTimeout(function(){b()},10)}}).bind(this);if(navigator.userAgent.match(/safari/i)){var d=this.insert.execHtml;this.insert.execHtml=(function(f){try{d.call(this,f)}catch(g){console.debug("[Redactor.wmonkeypatch] Suppressed error in Safari: "+g.message)}}).bind(this)}},keydown:function(){this.keydown.enterWithinBlockquote=false;var c=this.keydown.onTab;this.keydown.onTab=(function(g,d){var f=this.selection.getBlock();if(f&&f.tagName==="LI"){return c.call(this,g,d)}return true}).bind(this);var b=this.keydown.replaceDivToParagraph;this.keydown.replaceDivToParagraph=(function(){if(this.keydown.enterWithinBlockquote){this.keydown.enterWithinBlockquote=false}else{b.call(this)}}).bind(this);var a=this.keydown.setupBuffer;this.keydown.setupBuffer=(function(f,d){if(this.keydown.ctrl&&d===89&&!f.shiftKey&&!f.altKey&&this.opts.rebuffer.length!==0){f.preventDefault();this.buffer.redo();return}a.call(this,f,d)}).bind(this)},keyup:function(){var a=this.keyup.replaceToParagraph;this.keyup.replaceToParagraph=(function(b){if(this.keyup.current.tagName!=="DIV"||this.keyup.current.parentElement.tagName!=="BLOCKQUOTE"){a.call(this,b)}}).bind(this)},link:function(){var b=this.link.insert;this.link.insert=(function(){b.call(this);this.selection.get();var c=this.selection.getCurrent();if(c.nodeType===Node.TEXT_NODE){c=c.parentElement}if(c.tagName==="A"){this.caret.setAfter(c)}}).bind(this);var a=this.link.set;this.link.set=(function(f,d,e){a.call(this,f,d,e);if(f.length&&this.link.text!==f){this.selection.get();var c=this.selection.getCurrent();if(c.nodeType===Node.TEXT_NODE){c=c.parentElement}if(c.tagName==="A"){$(c).text(f)}}}).bind(this)},modal:function(){this.modal.dialog=null;var b=this.modal.addTemplate;this.modal.addTemplate=(function(c,d){if(c!=="table"){b.call(this,c,d)}}).bind(this);this.modal.build=function(){};this.modal.load=(function(c,e,d){this.modal.templateName=c;this.modal.title=e;this.modal.dialog=$("<div />").hide().appendTo(document.body);this.modal.dialog.html(this.modal.getTemplate(this.modal.templateName));this.$modalFooter=null}).bind(this);this.modal.show=(function(){this.modal.dialog.wcfDialog({onClose:$.proxy(this.modal.close,this),title:this.modal.title});this.modal.dialog.find("input:first").focus()}).bind(this);var a=this.modal.createButton;this.modal.createButton=(function(c,d){if(this.$modalFooter===null){this.$modalFooter=$('<div class="formSubmit" />').appendTo(this.modal.dialog);this.modal.dialog.addClass("dialogForm")}return a.call(this,c,d)}).bind(this);this.modal.close=(function(){if(this.modal.dialog===null){return}try{this.modal.dialog.wcfDialog("close");this.modal.dialog.remove()}catch(c){}this.modal.dialog=null}).bind(this);this.modal.createCancelButton=function(){return $()};this.modal.createDeleteButton=function(){return $()}},observe:function(){var d=(function(j,e,h,f,i,k){var g=this.$toolbar.find(h);if(j&&j.closest(e,this.$editor[0]).length!=0){g[(f?"removeClass":"addClass")](i)}else{if(k&&!this.opts.visual){return}g[(f?"addClass":"removeClass")](i)}}).bind(this);var c=this.observe.buttons;this.observe.buttons=(function(g,h){c.call(this,g,h);var f=this.selection.getParent();f=(f===false)?null:$(f);d(f,"ul, ol","a.re-indent, a.re-outdent",true,"redactor-button-disabled");d(f,"blockquote.quoteBox","a.re-__wcf_quote",false,"redactor-button-disabled",true);d(f,"sub","a.re-subscript",false,"redactor-act");d(f,"sup","a.re-superscript",false,"redactor-act")}).bind(this);var a=this.observe.load;this.observe.load=(function(){a.call(this);WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","observe_load_"+this.$textarea.wcfIdentify())}).bind(this);var b=this.observe.showTooltip;this.observe.showTooltip=(function(g){var f=$(g.target);if(!f.hasClass("redactorQuoteEdit")){b.call(this,g)}}).bind(this)},paste:function(){var a=this.paste.insert;this.paste.insert=(function(b){a.call(this,b);setTimeout((function(){this.wutil.fixDOM();if($.browser.msie){getSelection().getRangeAt(0).collapse(false)}this.wutil.saveSelection()}).bind(this),20)}).bind(this)},selection:function(){var a=function(d,c){var b=c.nextSibling;if(b!==null&&b.nodeType===Node.TEXT_NODE&&b.length===0){$(b).remove()}$(c).remove()};this.selection.removeMarkers=(function(){this.$editor.find("span.redactor-selection-marker").each(a)}).bind(this);this.selection.removeNodesMarkers=(function(){$(document).find("span.redactor-nodes-marker").each(a);this.$editor.find("span.redactor-nodes-marker").each(a)}).bind(this)},utils:function(){this.utils.removeEmpty=function(a,b){}},rebuildTemplates:function(){this.opts.modal.image='<fieldset id="redactor-modal-image-edit"><dl><dt><label for="redactor-image-link-source">'+this.lang.get("link")+'</label></dt><dd><input type="text" id="redactor-image-link-source" class="long"  /></dd></dl><dl><dt><label for="redactor-image-align">'+this.opts.curLang.image_position+'</label></dt><dd><select id="redactor-image-align"><option value="none">'+WCF.Language.get("wcf.global.noSelection")+'</option><option value="left">'+this.lang.get("left")+'</option><option value="right">'+this.lang.get("right")+"</option></select></dd></dl></fieldset>";this.opts.modal.imageEdit=this.opts.modal.image;this.opts.modal.link='<fieldset id="redactor-modal-link"><dl><dt><label for="redactor-link-url" />URL</label></dt><dd><input type="url" id="redactor-link-url" class="long" /></dd></dl><dl><dt><label for="redactor-link-url-text">'+this.lang.get("text")+'</label></dt><dd><input type="text" id="redactor-link-url-text" class="long" /></dd></dl></fieldset>';this.opts.modal.quote='<fieldset><dl><dt><label for="redactorQuoteAuthor">'+WCF.Language.get("wcf.bbcode.quote.edit.author")+'</label></dt><dd><input type="text" id="redactorQuoteAuthor" class="long" /></dd></dl><dl><dt><label for="redactorQuoteLink">'+WCF.Language.get("wcf.bbcode.quote.edit.link")+'</label></dt><dd><input type="text" id="redactorQuoteLink" class="long" /></dd></dl></fieldset>';var a="";$.each(__REDACTOR_CODE_HIGHLIGHTERS,function(c,b){if(c==="plain"){return true}a+='<option value="'+c+'">'+b+"</option>"});this.opts.modal.code="<fieldset><legend>"+WCF.Language.get("wcf.bbcode.code.settings")+'</legend><dl><dt><label for="redactorCodeHighlighter">'+WCF.Language.get("wcf.bbcode.code.highlighter")+'</label></dt><dd><select id="redactorCodeHighlighter"><option value="plain">'+WCF.Language.get("wcf.bbcode.code.highlighter.none")+"</option>"+a+"</select><small>"+WCF.Language.get("wcf.bbcode.code.highlighter.description")+'</small></dd></dl><dl><dt><label for="redactorCodeLineNumber">'+WCF.Language.get("wcf.bbcode.code.lineNumber")+'</label></dt><dd><input type="number" id="redactorCodeLineNumber" min="1" max="99999" value="1" /><small>'+WCF.Language.get("wcf.bbcode.code.lineNumber.description")+'</small></dd></dl><dl><dt><label for="redactorCodeFilename">'+WCF.Language.get("wcf.bbcode.code.filename")+'</label></dt><dd><input type="text" id="redactorCodeFilename" value="" class="long" /><small>'+WCF.Language.get("wcf.bbcode.code.filename.description")+"</small></dd></dl></fieldset><fieldset><legend>"+WCF.Language.get("wcf.bbcode.code")+'</legend><dl class="wide"><dt></dt><dd><textarea id="redactorCodeBox" class="long" rows="12" /></dd></dl></fieldset>';this.opts.modal.table='<fieldset id="redactor-modal-table-insert"><dl><dt><label for="redactor-table-rows">'+this.lang.get("rows")+'</label></dt><dd><input type="number" size="5" value="2" min="1" id="redactor-table-rows" class="tiny" /></dd></dl><dl><dt><label for="redactor-table-columns">'+this.lang.get("columns")+'</label></dt><dd><input type="number" size="5" value="3" min="1" id="redactor-table-columns" class="tiny" /></dd></dl></fieldset>'},fixWebKit:function(){return;if(!$.browser.webkit&&!document.documentElement.style.hasOwnProperty("WebkitAppearance")&&!window.hasOwnProperty("chrome")){return}var a={fontSize:this.$editor.css("font-size"),lineHeight:this.$editor.css("line-height")};var c=this.$editor.wcfIdentify();var b=document.createElement("style");b.type="text/css";b.innerHTML="#"+c+" span { font-size: "+a.fontSize+"; line-height: "+a.lineHeight+" }";document.head.appendChild(b)}}};
 // wupload.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload=function(){return{_boundGlobalUploadEvents:false,_dropArea:{},_timer:null,_isDragging:false,_isFile:false,init:function(){var a=".redactor_"+this.$textarea.wcfIdentify();$(document).on("dragover"+a,$.proxy(this.wupload._dragOver,this));$(document).on("dragleave"+a,$.proxy(this.wupload._dragLeave,this));$(document).on("drop"+a,(function(b){b.preventDefault();this.wupload._revertDropArea(undefined,this.$textarea.wcfIdentify())}).bind(this));if(!this.wupload._boundGlobalUploadEvents){this.wupload._boundGlobalUploadEvents=true;$(document).on("dragend",function(b){b.preventDefault()})}WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$textarea.wcfIdentify(),$.proxy(this.wupload.insertPastedImageAttachment,this))},_dragOver:function(d){d=d.originalEvent;if(!d.dataTransfer||!d.dataTransfer.types){return}var e=false;for(var c in d.dataTransfer){if(/^moz/.test(c)){e=true;break}}this.wupload._isFile=false;if(e){if(d.dataTransfer.types[0]==="application/x-moz-file"){this.wupload._isFile=true}}else{for(var g=0;g<d.dataTransfer.types.length;g++){if(d.dataTransfer.types[g]==="Files"){this.wupload._isFile=true;break}}}if(!this.wupload._isFile){return}this.wupload._isFile=true;d.preventDefault();if(!this.wupload._isDragging){var b=this.$textarea.wcfIdentify();if(this.wupload._dropArea[b]===undefined){this.wupload._dropArea[b]=$('<div class="redactorDropArea">'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"</div>").hide().appendTo(document.body);this.wupload._dropArea[b].on("dragover",$.proxy(this.wupload._hoverDropArea,this)).on("dragleave",$.proxy(this.wupload._revertDropArea,this)).on("drop",$.proxy(this.wupload._drop,this))}var a=(this.wutil.inWysiwygMode())?this.$editor.getDimensions("outer"):this.$textarea.getDimensions("outer");var f=(this.wutil.inWysiwygMode())?this.$editor.getOffsets("offset"):this.$textarea.getOffsets("offset");this.wupload._dropArea[b].css({height:a.height+"px",left:f.left+"px",lineHeight:a.height+"px",top:f.top+"px",width:a.width+"px"}).show();this.wupload._isDragging=true}d.preventDefault()},_hoverDropArea:function(a){this.wupload._dropArea[this.$textarea.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(c,a){if(!this.wupload._isFile){return}var b=a||this.$textarea.wcfIdentify();this.wupload._dropArea[b].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere"));if(a){this.wupload._dropArea[b].hide()}},_dragLeave:function(){if(!this.wupload._isDragging||!this.wupload._isFile){return}if(this.wupload._timer===null){this.wupload._timer=new WCF.PeriodicalExecuter((function(a){a.stop();if(!this.wupload._isDragging){this.wupload._dropArea[this.$textarea.wcfIdentify()].hide()}}).bind(this),100)}else{this.wupload._timer.resume()}this.wupload._isDragging=false},_drop:function(c){if(!this.wupload._isFile){return}c=c.originalEvent||c;if(c.dataTransfer&&c.dataTransfer.files.length){c.preventDefault();var b=this.$textarea.wcfIdentify();this.wupload._revertDropArea(undefined,b);for(var d=0;d<c.dataTransfer.files.length;d++){var a=c.dataTransfer.files[d];if(a.type){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+b,{file:a})}}}},pasteClipboardUploadMozilla:function(){this.$editor.find("img[data-mozilla-paste-image]").each($.proxy(function(d,g){var f=$(g);var a=f.prop("src").split(",");var e=a[0].split(";")[0].split(":")[1];var c=a[1];var b={blob:WCF.base64toBlob(c,e),uploadID:null};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+this.$textarea.wcfIdentify(),b);f.replaceWith('<span class="redactor-pastedImageFromClipboard-'+b.uploadID+'" />')},this))},insertPastedImageAttachment:function(b){var a=this.$editor.find("span.redactor-pastedImageFromClipboard-"+b.uploadID);a.before(b.attachment);a.remove()}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload=function(){return{_boundGlobalUploadEvents:false,_dropArea:{},_timer:null,_isDragging:false,_isFile:false,init:function(){var a=".redactor_"+this.$textarea.wcfIdentify();$(document).on("dragover"+a,$.proxy(this.wupload._dragOver,this));$(document).on("dragleave"+a,$.proxy(this.wupload._dragLeave,this));$(document).on("drop"+a,(function(b){b.preventDefault();this.wupload._revertDropArea(undefined,this.$textarea.wcfIdentify())}).bind(this));if(!this.wupload._boundGlobalUploadEvents){this.wupload._boundGlobalUploadEvents=true;$(document).on("dragend",function(b){b.preventDefault()})}WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$textarea.wcfIdentify(),$.proxy(this.wupload.insertPastedImageAttachment,this))},_dragOver:function(d){d=d.originalEvent;if(!d.dataTransfer||!d.dataTransfer.types){return}var e=false;for(var c in d.dataTransfer){if(/^moz/.test(c)){e=true;break}}this.wupload._isFile=false;if(e){if(d.dataTransfer.types[0]==="application/x-moz-file"){this.wupload._isFile=true}}else{for(var g=0;g<d.dataTransfer.types.length;g++){if(d.dataTransfer.types[g]==="Files"){this.wupload._isFile=true;break}}}if(!this.wupload._isFile){return}this.wupload._isFile=true;d.preventDefault();if(!this.wupload._isDragging){var b=this.$textarea.wcfIdentify();if(this.wupload._dropArea[b]===undefined){this.wupload._dropArea[b]=$('<div class="redactorDropArea">'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"</div>").hide().appendTo(document.body);this.wupload._dropArea[b].on("dragover",$.proxy(this.wupload._hoverDropArea,this)).on("dragleave",$.proxy(this.wupload._revertDropArea,this)).on("drop",$.proxy(this.wupload._drop,this))}var a=(this.wutil.inWysiwygMode())?this.$editor.getDimensions("outer"):this.$textarea.getDimensions("outer");var f=(this.wutil.inWysiwygMode())?this.$editor.getOffsets("offset"):this.$textarea.getOffsets("offset");this.wupload._dropArea[b].css({height:a.height+"px",left:f.left+"px",lineHeight:a.height+"px",top:f.top+"px",width:a.width+"px"}).show();this.wupload._isDragging=true}d.preventDefault()},_hoverDropArea:function(a){this.wupload._dropArea[this.$textarea.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(c,a){if(!this.wupload._isFile){return}var b=a||this.$textarea.wcfIdentify();this.wupload._dropArea[b].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere"));if(a){this.wupload._dropArea[b].hide()}},_dragLeave:function(){if(!this.wupload._isDragging||!this.wupload._isFile){return}if(this.wupload._timer===null){this.wupload._timer=new WCF.PeriodicalExecuter((function(a){a.stop();if(!this.wupload._isDragging){this.wupload._dropArea[this.$textarea.wcfIdentify()].hide()}}).bind(this),100)}else{this.wupload._timer.resume()}this.wupload._isDragging=false},_drop:function(b){if(!this.wupload._isFile){return}b=b.originalEvent||b;if(b.dataTransfer&&b.dataTransfer.files.length){b.preventDefault();var a=this.$textarea.wcfIdentify();this.wupload._revertDropArea(undefined,a);for(var c=0;c<b.dataTransfer.files.length;c++){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+a,{file:b.dataTransfer.files[c]})}}},pasteClipboardUploadMozilla:function(){this.$editor.find("img[data-mozilla-paste-image]").each($.proxy(function(d,g){var f=$(g);var a=f.prop("src").split(",");var e=a[0].split(";")[0].split(":")[1];var c=a[1];var b={blob:WCF.base64toBlob(c,e),uploadID:null};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+this.$textarea.wcfIdentify(),b);f.replaceWith('<span class="redactor-pastedImageFromClipboard-'+b.uploadID+'" />')},this))},insertPastedImageAttachment:function(b){var a=this.$editor.find("span.redactor-pastedImageFromClipboard-"+b.uploadID);a.before(b.attachment);a.remove()}}};
 // wutil.js
 if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wutil=function(){var b="";var c=null;var a=false;var d=null;return{_autosaveWorker:null,_range:null,init:function(){this.$textarea.parents("form").submit($.proxy(this.wutil.submit,this));if(this.wutil.getOption("woltlab.autosave").active){this.wutil.autosaveEnable();if(this.wutil.getOption("woltlab.autosave").saveOnInit||this.$textarea.data("saveOnInit")){this.wutil.setOption("woltlab.autosaveOnce",true)}else{this.wutil.autosaveRestore()}}this.wutil.setOption("autosave",false);var e=this.core.destroy;this.core.destroy=(function(){this.wutil.autosaveDisable();e.call(this)}).bind(this)},saveSelection:function(){var e=getSelection();if(e.rangeCount){this.wutil._range=e.getRangeAt(0)}},restoreSelection:function(){if(document.activeElement!==this.$editor[0]){this.$editor.focus()}if(this.wutil._range!==null){var e=window.getSelection();e.removeAllRanges();e.addRange(this.wutil._range);this.wutil._range=null}},clearSelection:function(){this._wutil.range=null},insertAtCaret:function(f){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$textarea.focus();var g=this.$textarea.getCaret();if(g==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var e=this.$textarea.val();e=e.substr(0,g)+f+e.substr(g);this.$textarea.val(e);return true},insertDynamic:function(e,f){if(this.wutil.inWysiwygMode()){this.insert.html(e,false)}else{if(f===undefined||f===null){f=e}this.wutil.insertAtCaret(f)}},setOption:function(e,f){if(e.indexOf(".")!==-1){e=e.split(".",2);this.opts[e[0]][e[1]]=f}else{this.opts[e]=f}},getOption:function(e){if(e.indexOf(".")!==-1){e=e.split(".",2);if(this.opts[e[0]][e[1]]){return this.opts[e[0]][e[1]]}}else{if(this.opts[e]){return this.opts[e]}}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(e){getSelection().removeAllRanges();getSelection().addRange(e)},getText:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var e=this.$textarea.val();this.$textarea.val($.trim(this.wbbcode.convertFromHtml(e)))}var f=$.trim(this.$textarea.val());f=f.replace(/\[\/quote\]\n/g,"[/quote]");return f},isEmptyEditor:function(){if(this.opts.visual){return this.utils.isEmpty(this.$editor.html())}return(!$.trim(this.$textarea.val()))},submit:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();this.$textarea.val($.trim(this.wbbcode.convertFromHtml(this.$textarea.val())))}this.wutil.autosavePurge()},reset:function(){if(this.opts.visual){this.$editor.html("<p>"+this.opts.invisibleSpace+"</p>");this.wutil.saveSelection()}this.$textarea.val("");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$textarea.wcfIdentify()})},autosaveEnable:function(e){if(!this.wutil.getOption("woltlab.autosave").active){this.wutil.setOption("woltlab.autosave",{active:true,key:e})}if(this.wutil._autosaveWorker===null){this.wutil.autosavePurgeOutdated();this.wutil._autosaveWorker=new WCF.PeriodicalExecuter((function(f){this.wutil.saveTextToStorage(false)}).bind(this),15*1000)}return true},saveTextToStorage:function(g){var f=this.wutil.getText();if(b==f&&!g){return}try{localStorage.setItem(this.wutil.getOption("woltlab.autosave").key,JSON.stringify({content:f,timestamp:Date.now()}));b=f;a=true;if(d===null){d=new WCF.PeriodicalExecuter((function(e){if(a===false){e.stop();d=null;return}this.wutil.autosaveShowNotice("saved");a=false}).bind(this),120*1000)}}catch(h){console.debug("[wutil.saveTextToStorage] Unable to access local storage: "+h.message)}},autosaveDisable:function(){if(!this.wutil.getOption("woltlab.autosave").active){return false}this.wutil._autosaveWorker.stop();this.wutil._autosaveWorker=null;this.wutil.setOption("woltlab.autosave",{active:false,key:""});return true},autosavePurge:function(){try{localStorage.removeItem(this.wutil.getOption("woltlab.autosave").key)}catch(f){console.debug("[wutil.autosavePurge] Unable to access local storage: "+f.message)}},autosaveRestore:function(){var f=this.wutil.getOption("woltlab.autosave");var g=null;try{g=localStorage.getItem(f.key)}catch(h){console.debug("[wutil.autosaveRestore] Unable to access local storage: "+h.message)}try{g=(g===null)?null:JSON.parse(g)}catch(h){g=null}if(g===null||!g.content){return false}if(f.lastEditTime&&(f.lastEditTime*1000)>g.timestamp){this.wutil.autosavePurge();return false}if(f.prompt){this.wutil.autosaveShowNotice("prompt",g);return false}if(this.wutil.inWysiwygMode()){this.wutil.setOption("woltlab.originalValue",g.content)}else{this.$textarea.val(g.content)}this.wutil.autosaveShowNotice("restored",{timestamp:g.timestamp});return true},autosaveShowNotice:function(i,k){if(c===null){c=$('<div class="redactorAutosaveNotice"><span class="redactorAutosaveMessage" /></div>');c.appendTo(this.$box);var g=(function(l){if(l!==null&&l.originalEvent.propertyName!=="opacity"){return}if(c.hasClass("open")&&l!==null){if(c.data("callbackOpen")){c.data("callbackOpen")()}}else{if(c.data("callbackClose")){c.data("callbackClose")()}c.removeData("callbackClose");c.removeData("callbackOpen");c.removeClass("redactorAutosaveNoticeIcons");c.empty();$('<span class="redactorAutosaveMessage" />').appendTo(c)}}).bind(this);c.on("transitionend webkitTransitionEnd",g)}var h="";switch(i){case"prompt":$('<span class="icon icon16 fa-info blue jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.restored.version",{date:new Date(k.timestamp).toLocaleString()})+'"></span>').prependTo(c);var j=$('<span class="icon icon16 fa-check green pointer jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.prompt.confirm")+'"></span>').appendTo(c);var e=$('<span class="icon icon16 fa-times red pointer jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.prompt.discard")+'"></span>').appendTo(c);j.click((function(){this.wutil.replaceText(k.content);g(null);this.wutil.autosaveShowNotice("restored",k)}).bind(this));e.click((function(){this.wutil.autosavePurge();c.removeClass("open")}).bind(this));h=WCF.Language.get("wcf.message.autosave.prompt");c.addClass("redactorAutosaveNoticeIcons");var f="";f=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),(function(l){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),f);setTimeout(function(){c.removeClass("open")},3000)}).bind(this));break;case"restored":$('<span class="icon icon16 fa-info blue jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.restored.version",{date:new Date(k.timestamp).toLocaleString()})+'"></span>').prependTo(c);var j=$('<span class="icon icon16 fa-check green pointer jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.restored.confirm")+'"></span>').appendTo(c);var e=$('<span class="icon icon16 fa-times red pointer jsTooltip" title="'+WCF.Language.get("wcf.message.autosave.restored.revert")+'"></span>').appendTo(c);j.click(function(){c.removeClass("open")});e.click((function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.message.autosave.restored.revert.confirmMessage"),(function(l){if(l==="confirm"){this.wutil.reset();this.wutil.autosavePurge();c.removeClass("open")}}).bind(this))}).bind(this));h=WCF.Language.get("wcf.message.autosave.restored");c.addClass("redactorAutosaveNoticeIcons");var f="";f=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),(function(l){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),f);setTimeout(function(){j.trigger("click")},3000)}).bind(this));break;case"saved":if(c.hasClass("open")){return}setTimeout(function(){c.removeClass("open")},2000);h=WCF.Language.get("wcf.message.autosave.saved");break}c.children("span.redactorAutosaveMessage").text(h);c.addClass("open");if(i!=="saved"){WCF.DOMNodeInsertedHandler.execute()}},autosavePurgeOutdated:function(){var j=0;var m=this.wutil.getOption("woltlab.autosave").prefix;var l=m+"_wcf_master";try{j=localStorage.getItem(l)}catch(k){console.debug("[wutil.autosavePurgeOutdated] Unable to access local storage: "+k.message)}if(j===0){return}var f=Date.now()-(7*24*3600*1000);if(j===null||j<f){var i=new RegExp("^"+m+"_");for(var h in localStorage){if(h.match(i)&&h!==l){var g=localStorage.getItem(h);try{g=JSON.parse(g)}catch(k){g={timestamp:0}}if(g===null||!g.timestamp||g.timestamp<f){try{localStorage.removeItem(h)}catch(k){console.debug("[wutil.autosavePurgeOutdated] Unable to access local storage: "+k.message)}}}}try{localStorage.setItem(l,Date.now())}catch(k){console.debug("[wutil.autosavePurgeOutdated] Unable to access local storage: "+k.message)}}},buttonReplace:function(h,f,i,k,j){var e=this.buttonGet(h);var g=this.buttonAddAfter(h,f,i,k,j);if(e.parent().hasClass("separator")){g.parent().addClass("separator")}e.parent().remove();return g},removeZeroWidthSpace:function(e){var f="";for(var i=0,h=e.length;i<h;i++){var g=e.charCodeAt(i).toString(16);if(g!="200b"){f+=e[i]}}return f},getSource:function(){return this.$textarea},getName:function(){return this.$textarea.wcfIdentify()},selectionEndOfEditor:function(){this.focus.setEnd();var e=this.$editor.children(":last")[0];if(e.tagName==="P"){if(e.innerHTML===""){e.remove();e=$(this.opts.emptyHtml).appendTo(this.$editor)[0]}if(e.lastChild.nodeType===Element.TEXT_NODE){this.caret.set(e.lastChild,e.lastChild.length,e.lastChild,e.lastChild.length)}else{this.caret.setEnd(e)}}else{this.wutil.setCaretAfter(e)}this.wutil.saveSelection()},adjustSelectionForBlockElement:function(){if(document.activeElement!==this.$editor[0]){this.wutil.restoreSelection()}if(getSelection().getRangeAt(0).collapsed){var g=getSelection().getRangeAt(0).startContainer;if(g.nodeType===Node.TEXT_NODE&&g.textContent==="\u200b"&&g.parentElement.tagName==="P"&&g.parentElement.parentElement===this.$editor[0]){return}else{var e=$(g).parentsUntil(this.$editor[0]).last();if(e[0]===document.body.parentElement){this.wutil.selectionEndOfEditor()}else{var f=$("<p><br></p>").insertAfter(e);this.caret.setEnd(f)}}}},isCaret:function(){this.selection.get();return this.range.collapsed},isEndOfElement:function(e){this.selection.get();if(!this.wutil.isCaret()){return false}if(this.range.endContainer.nodeType===Element.TEXT_NODE){if(this.range.endOffset<this.range.endContainer.length){return false}}if(!this.wutil.isNodeWithin(this.range.endContainer,e)){return false}var f=this.range.endContainer;while(f!==e){if(f.nextSibling){return false}f=f.parentNode}return true},isNodeWithin:function(g,f){var e=$(g);while(e[0]!==this.$editor[0]){if(e[0]===f){return true}e=e.parent()}return false},containsTag:function(f,e){switch(f.nodeType){case Element.ELEMENT_NODE:if(f.tagName===e){return true}case Element.DOCUMENT_FRAGMENT_NODE:for(var g=0;g<f.childNodes.length;g++){if(this.wutil.containsTag(f.childNodes[g],e)){return true}}return false;break;default:return false;break}},replaceText:function(g){var h=$(document);var e=h.scrollTop();var f=false;if(this.wutil.inWysiwygMode()){this.code.toggle();f=true}this.$textarea.val(g);if(f){this.code.toggle();h.scrollTop(e)}h.trigger("resize")},setCaretBefore:function(e){this.wutil._setCaret(e,true)},setCaretAfter:function(e){this.wutil._setCaret(e,false)},_setCaret:function(f,g){var e=$(this.opts.emptyHtml);e[(g?"insertBefore":"insertAfter")](f);this.caret.setEnd(e[0])},fixDOM:function(){var h=this.$editor[0].childNodes[0];var e=h;var f=null;while(e){h=e;e=h.nextSibling;if(h.nodeType===Element.ELEMENT_NODE){if(this.reIsBlock.test(h.tagName)){f=null}else{if(f===null){f=$("<p />").insertBefore(h)}f.append(h)}}else{if(h.nodeType===Element.TEXT_NODE){if(f===null){if(e){if(e.nodeType===Element.ELEMENT_NODE&&e.tagName==="P"&&e.innerHTML==="\u200B"){var g=e.nextSibling;this.$editor[0].removeChild(e);e=g}}f=$("<p />").insertBefore(h)}f.append(h)}}}}}};