// wfontcolor.js
if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontcolor=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontcolor"));this.wfontcolor._createDropdown(a)},_createDropdown:function(h){var b=["#000000","#800000","#8B4513","#2F4F4F","#008080","#000080","#4B0082","#696969","#B22222","#A52A2A","#DAA520","#006400","#40E0D0","#0000CD","#800080","#808080","#FF0000","#FF8C00","#FFD700","#008000","#00FFFF","#0000FF","#EE82EE","#A9A9A9","#FFA07A","#FFA500","#FFFF00","#00FF00","#AFEEEE","#ADD8E6","#DDA0DD","#D3D3D3","#FFF0F5","#FAEBD7","#FFFFE0","#F0FFF0","#F0FFFF","#F0F8FF","#E6E6FA","#FFFFFF"];var e=$('<li class="redactorColorPallet" />');for(var g=0,d=b.length;g<d;g++){var f=b[g];var c=$('<a href="#" title="'+f+'" />').data("color",f).css("background-color",f);e.append(c);c.click($.proxy(this.wfontcolor._onColorPick,this))}var a=$('<a href="#" />').html(this.opts.curLang.none).data("color","none");a.click($.proxy(this.wfontcolor._onColorPick,this));e.appendTo(h);$('<li class="dropdownDivider" />').appendTo(h);a.appendTo(h);a.wrap("<li />")},_onColorPick:function(a){a.preventDefault();var b=$(a.currentTarget).data("color");if(b==="none"){this.inline.remoteStyleRule("color")}else{this.inline.format("span","style","color: "+b+";")}}}};
// wfontfamily.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontfamily=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontfamily"));this.wfontfamily._createDropdown(a)},_createDropdown:function(d){var c={Arial:"Arial, Helvetica, sans-serif","Comic Sans MS":"Comic Sans MS, cursive","Courier New":"Consolas, Courier New, Courier, monospace",Georgia:"Georgia, serif","Lucida Sans Unicode":"Lucida Sans Unicode, Lucida Grande, sans-serif",Tahoma:"Tahoma, Geneva, sans-serif","Times New Roman":"Times New Roman, Times, serif","Trebuchet MS":"Trebuchet MS, Helvetica, sans-serif",Verdana:"Verdana, Geneva, sans-serif"};var a=this;$.each(c,function(h,e){var g=$('<li><a href="#">'+h+"</a></li>").appendTo(d);var f=g.children("a").data("fontFamily",e).css("font-family",e);f.click(function(i){i.preventDefault();a.inline.format("span","style","font-family: "+$(this).data("fontFamily")+";")})});$('<li class="dropdownDivider" />').appendTo(d);var b=$('<li><a href="#">None</a></li>').appendTo(d);b.children("a").click(function(e){e.preventDefault();a.inline.removeStyleRule("font-family")})}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontfamily=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontfamily"));this.wfontfamily._createDropdown(a)},_createDropdown:function(d){var c={Arial:"Arial, Helvetica, sans-serif","Comic Sans MS":"Comic Sans MS, cursive","Courier New":"Consolas, Courier New, Courier, monospace",Georgia:"Georgia, serif","Lucida Sans Unicode":"Lucida Sans Unicode, Lucida Grande, sans-serif",Tahoma:"Tahoma, Geneva, sans-serif","Times New Roman":"Times New Roman, Times, serif","Trebuchet MS":"Trebuchet MS, Helvetica, sans-serif",Verdana:"Verdana, Geneva, sans-serif"};var a=this;$.each(c,function(h,e){var g=$('<li><a href="#">'+h+"</a></li>").appendTo(d);var f=g.children("a").data("fontFamily",e).css("font-family",e);f.click(function(i){i.preventDefault();a.inline.format("span","style","font-family: "+$(this).data("fontFamily")+";")})});$('<li class="dropdownDivider" />').appendTo(d);var b=$('<li><a href="#">'+this.opts.curLang.none+"</a></li>").appendTo(d);b.children("a").click(function(e){e.preventDefault();a.inline.removeStyleRule("font-family")})}}};
// wfontsize.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontsize"));this.wfontsize._createDropdown(a)},_createDropdown:function(g){var e=[8,10,12,14,18,24,36];var b=this;for(var f=0;f<e.length;f++){var c=e[f];var d=$('<li><a href="#">'+c+"</a></li>").appendTo(g);var a=d.children("a").data("fontSize",c).css("font-size",c+"pt");if(c>18){a.css("line-height","1em")}a.click(function(h){h.preventDefault();b.inline.format("span","style","font-size: "+$(this).data("fontSize")+"pt;")})}$('<li class="dropdownDivider" />').appendTo(g);var d=$('<li><a href="#">None</a></li>').appendTo(g);d.children("a").click(function(h){h.preventDefault();b.inline.removeStyleRule("font-size")})}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wfontsize=function(){return{init:function(){var a=this.button.addDropdown(this.button.get("fontsize"));this.wfontsize._createDropdown(a)},_createDropdown:function(g){var e=[8,10,12,14,18,24,36];var b=this;for(var f=0;f<e.length;f++){var c=e[f];var d=$('<li><a href="#">'+c+"</a></li>").appendTo(g);var a=d.children("a").data("fontSize",c).css("font-size",c+"pt");if(c>18){a.css("line-height","1em")}a.click(function(h){h.preventDefault();b.inline.format("span","style","font-size: "+$(this).data("fontSize")+"pt;")})}$('<li class="dropdownDivider" />').appendTo(g);var d=$('<li><a href="#">'+this.opts.curLang.none+"</a></li>").appendTo(g);d.children("a").click(function(h){h.preventDefault();b.inline.removeStyleRule("font-size")})}}};
// wmonkeypatch.js
if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch=function(){return{init:function(){this.wmonkeypatch.button();this.wmonkeypatch.clean();this.wmonkeypatch.dropdown();this.wmonkeypatch.image();this.wmonkeypatch.insert();this.wmonkeypatch.keydown();this.wmonkeypatch.link();this.wmonkeypatch.modal();this.wmonkeypatch.paste();this.wmonkeypatch.observe();this.wmonkeypatch.utils();this.wmonkeypatch.rebuildTemplates();this.wmonkeypatch.bindEvents()},bindEvents:function(){var a=this.$textarea.wcfIdentify();this.wutil.setOption("keydownCallback",function(c){var b={cancel:false,event:c};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keydown_"+a,b);return(b.cancel?false:true)});this.wutil.setOption("keyupCallback",function(c){var b={cancel:false,event:c};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keyup_"+a,b);return(b.cancel?false:true)});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))}this.$editor.on("blur.wredactor",(function(){this.selection.save()}).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)},clean:function(){var a=this.clean.onPaste;this.clean.onPaste=(function(c,b){this.opts.replaceDivs=true;c=a.call(this,c,b);this.opts.replaceDivs=false;return c}).bind(this);this.clean.setVerified=(function(d){if(this.utils.browser("msie")){return d}d=d.replace(new RegExp("<img(.*?[^>])>","gi"),'<img$1 data-verified="redactor">');d=d.replace(new RegExp("<span(.*?)>","gi"),'<span$1 data-verified="redactor">');var f=d.match(new RegExp('<(span|img)(.*?)style="(.*?)"(.*?[^>])>',"gi"));if(f){var b=f.length;for(var c=0;c<b;c++){var e=f[c].replace(/style="(.*?)"/i,'style="$1" rel="$1"');d=d.replace(new RegExp(WCF.String.escapeRegExp(f[c]),"gi"),e)}}return d}).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);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 a=this.image.setEditable;this.image.setEditable=(function(b){if(!b.hasClass("smiley")){a.call(this,b)}}).bind(this);this.image.show=(function(){this.modal.load("image",this.lang.get("image"),0);var b=this.modal.createActionButton(this.lang.get("insert"));b.click($.proxy(this.wbutton._insertImage,this));this.selection.save();this.modal.show()}).bind(this);this.image.showEdit=(function(b){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(b)}).bind(this));$("#redactor-image-link-source").val(b.attr("src"));$("#redactor-image-align").val(b.css("float"));this.modal.show()}).bind(this);this.image.update=(function(b){this.image.hideResize();this.buffer.set();b.attr("src",$("#redactor-image-link-source").val());this.image.setFloating(b);this.modal.close();this.observe.images()}).bind(this)},insert:function(){var a=(function(){var c=this.$editor.html();if(this.utils.isEmpty(c)){this.$editor.focus();this.caret.setEnd(this.$editor.children("p:eq(0)"))}else{if(document.activeElement!==this.$editor[0]){this.$editor.focus();this.selection.restore()}}}).bind(this);var b=this.insert.html;this.insert.html=(function(d,c){a();b.call(this,d,c)}).bind(this)},keydown:function(){this.keydown.enterWithinBlockquote=false;this.keydown.onTab=(function(c,b){c.preventDefault();if(c.metaKey&&b===219){this.indent.decrease()}else{if(c.metaKey&&b===221){this.indent.increase()}else{if(!c.shiftKey){this.indent.increase()}else{this.indent.decrease()}}}return false}).bind(this);var a=this.keydown.replaceDivToParagraph;this.keydown.replaceDivToParagraph=(function(){if(this.keydown.enterWithinBlockquote){this.keydown.enterWithinBlockquote=false}else{a.call(this)}}).bind(this)},link:function(){var a=this.link.insert;this.link.insert=(function(){a.call(this);this.selection.get();var b=this.selection.getCurrent();if(b.tagName==="A"){this.caret.setAfter(b)}}).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(){this.modal.dialog.wcfDialog("close");this.modal.dialog.remove()}).bind(this);this.modal.createCancelButton=function(){return $()};this.modal.createDeleteButton=function(){return $()}},observe:function(){var c=(function(i,d,g,e,h,j){var f=this.$toolbar.find(g);if(i&&i.closest(d,this.$editor[0]).length!=0){f[(e?"removeClass":"addClass")](h)}else{if(j&&!this.opts.visual){return}f[(e?"addClass":"removeClass")](h)}}).bind(this);var b=this.observe.buttons;this.observe.buttons=(function(f,g){b.call(this,f,g);var d=this.selection.getParent();d=(d===false)?null:$(d);c(d,"ul, ol","a.re-indent, a.re-outdent",true,"redactor-button-disabled");c(d,"blockquote.quoteBox","a.re-__wcf_quote",false,"redactor-button-disabled",true);c(d,"sub","a.re-subscript",false,"redactor-act");c(d,"sup","a.re-superscript",false,"redactor-act")}).bind(this);var a=this.observe.showTooltip;this.observe.showTooltip=(function(f){var d=$(f.target);if(!d.hasClass("redactorQuoteEdit")){a.call(this,f)}}).bind(this)},paste:function(){var b=(function(){var e=this.$editor[0].childNodes[0];var c=e;var d=null;while(c){e=c;c=e.nextSibling;if(e.nodeType===Element.ELEMENT_NODE){if(this.reIsBlock.test(e.tagName)){d=null}else{if(d===null){d=$("<p />").insertBefore(e)}d.append(e)}}else{if(e.nodeType===Element.TEXT_NODE){if(d===null){d=$("<p />").insertBefore(e)}d.append(e)}}}}).bind(this);var a=this.paste.insert;this.paste.insert=(function(c){a.call(this,c);setTimeout(b,20)}).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" /></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" /></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>';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>'}}};
// wupload.js