From 17d1e8c06bd27761200ad784c6b6df2e77009b77 Mon Sep 17 00:00:00 2001 From: "woltlab.com" Date: Fri, 22 May 2015 20:51:46 +0200 Subject: [PATCH] Updating minified JavaScript files --- .../js/3rdParty/redactor/plugins/wcombined.min.js | 13 ------------- 1 file changed, 13 deletions(-) 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 d8d396c5f2..f6308db1a2 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js @@ -16,16 +16,3 @@ if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch=functio 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(!this.$editor.is(":visible")){return}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'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"").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')},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 c="";var d=null;var a=false;var b=false;var e=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 f=this.core.destroy;this.core.destroy=(function(){this.wutil.autosaveDisable();f.call(this)}).bind(this)},saveSelection:function(g){var f=getSelection();if(f.rangeCount){this.wutil._range=f.getRangeAt(0)}else{if(g){this.wutil._range=null}}},restoreSelection:function(){if(document.activeElement!==this.$editor[0]){this.$editor.focus()}if(this.wutil._range!==null){var f=window.getSelection();f.removeAllRanges();f.addRange(this.wutil._range);this.wutil._range=null}},clearSelection:function(){this.wutil._range=null},getSelection:function(){return this.wutil._range},insertAtCaret:function(g){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$textarea.focus();var h=this.$textarea.getCaret();if(h==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var f=this.$textarea.val();f=f.substr(0,h)+g+f.substr(h);this.$textarea.val(f);return true},insertDynamic:function(f,g){if(this.wutil.inWysiwygMode()){this.insert.html(f,false)}else{if(g===undefined||g===null){g=f}this.wutil.insertAtCaret(g)}},setOption:function(f,g){if(f.indexOf(".")!==-1){f=f.split(".",2);this.opts[f[0]][f[1]]=g}else{this.opts[f]=g}},getOption:function(f){if(f.indexOf(".")!==-1){f=f.split(".",2);if(this.opts[f[0]][f[1]]){return this.opts[f[0]][f[1]]}}else{if(this.opts[f]){return this.opts[f]}}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(f){getSelection().removeAllRanges();getSelection().addRange(f)},getText:function(){if(this.wutil.inWysiwygMode()){this.code.startSync();var f=this.$textarea.val();this.$textarea.val($.trim(this.wbbcode.convertFromHtml(f)))}var g=$.trim(this.$textarea.val());g=this.wutil._removeSuperfluousNewlines(g);return g},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();var f=$.trim(this.wbbcode.convertFromHtml(this.$textarea.val()));f=this.wutil._removeSuperfluousNewlines(f);this.$textarea.val(f)}this.wutil.autosavePurge()},_removeSuperfluousNewlines:function(g){g=g.replace(/(\[\/(?:align|code|quote)\])\n/g,"$1");var f={text:g};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_removeSuperfluousNewlines",f);return f.text},addNewlines:function(g){g=g.replace(/(\[\/(?:align|code|quote)\])/g,"$1\n");var f={text:g};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","wutil_addNewlines",f);return f.text},reset:function(){if(this.opts.visual){this.$editor.html("

"+this.opts.invisibleSpace+"

");this.wutil.saveSelection()}this.$textarea.val("");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$textarea.wcfIdentify()})},autosaveEnable:function(f){if(!this.wutil.getOption("woltlab.autosave").active){this.wutil.setOption("woltlab.autosave",{active:true,key:f})}if(this.wutil._autosaveWorker===null){this.wutil.autosavePurgeOutdated();this.wutil._autosaveWorker=new WCF.PeriodicalExecuter((function(g){this.wutil.saveTextToStorage(false)}).bind(this),15*1000)}return true},saveTextToStorage:function(g){var f=this.wutil.getText();if(c==f&&!g){return}try{localStorage.setItem(this.wutil.getOption("woltlab.autosave").key,JSON.stringify({content:f,timestamp:Date.now()}));c=f;a=true;if(e===null){e=new WCF.PeriodicalExecuter((function(i){if(b===true){return}if(a===false){i.stop();e=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(j,l){if(d===null){d=$('
');d.appendTo(this.$box);var h=(function(m){if(m!==null&&m.originalEvent.propertyName!=="opacity"){return}if(d.hasClass("open")&&m!==null){if(d.data("callbackOpen")){d.data("callbackOpen")()}}else{if(d.data("callbackClose")){d.data("callbackClose")()}d.removeData("callbackClose");d.removeData("callbackOpen");d.removeClass("redactorAutosaveNoticeIcons");d.empty();$('').appendTo(d)}}).bind(this);d.on("transitionend webkitTransitionEnd",h)}var i="";switch(j){case"prompt":$('').prependTo(d);var k=$('').appendTo(d);var f=$('').appendTo(d);k.click((function(){this.wutil.replaceText(l.content);h(null);this.wutil.autosaveShowNotice("restored",l)}).bind(this));f.click((function(){this.wutil.autosavePurge();d.removeClass("open")}).bind(this));i=WCF.Language.get("wcf.message.autosave.prompt");d.addClass("redactorAutosaveNoticeIcons");var g="";g=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),(function(m){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),g);setTimeout(function(){d.removeClass("open")},3000)}).bind(this));break;case"restored":$('').prependTo(d);var k=$('').appendTo(d);var f=$('').appendTo(d);k.click(function(){d.removeClass("open")});f.click((function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.message.autosave.restored.revert.confirmMessage"),(function(m){if(m==="confirm"){this.wutil.reset();this.wutil.autosavePurge();d.removeClass("open")}}).bind(this))}).bind(this));i=WCF.Language.get("wcf.message.autosave.restored");d.addClass("redactorAutosaveNoticeIcons");var g="";g=WCF.System.Event.addListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),(function(m){WCF.System.Event.removeListener("com.woltlab.wcf.redactor","keydown_"+this.$textarea.wcfIdentify(),g);setTimeout(function(){k.trigger("click")},3000)}).bind(this));break;case"saved":if(d.hasClass("open")){return}setTimeout(function(){d.removeClass("open")},2000);i=WCF.Language.get("wcf.message.autosave.saved");break}d.children("span.redactorAutosaveMessage").text(i);d.addClass("open");if(j!=="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"+this.opts.invisibleSpace+"")}else{f=$("

"+this.opts.invisibleSpace+"

")}f[(h?"insertBefore":"insertAfter")](g);this.caret.setEnd(f[0])},fixDOM:function(){var f=this.$editor[0].childNodes[0];var j=f;var m=null;while(j){f=j;j=f.nextSibling;if(f.nodeType===Element.ELEMENT_NODE){if(this.reIsBlock.test(f.tagName)){m=null}else{if(m===null){m=$("

").insertBefore(f)}m.append(f)}}else{if(f.nodeType===Element.TEXT_NODE){if(m===null){if(j){if(j.nodeType===Element.ELEMENT_NODE&&j.tagName==="P"&&j.innerHTML==="\u200B"){var l=j.nextSibling;this.$editor[0].removeChild(j);j=l}}m=$("

").insertBefore(f)}m.append(f)}}}var i=this.$editor[0].getElementsByTagName("li");for(var p=0,o=i.length;p1){n.parentElement.removeChild(n);p--;o--}}}for(var p=0,o=this.$editor[0].children.length;p0){continue}if(h.children.length>1||(h.children.length===1&&h.children[0].tagName==="BR")){continue}while(h.children.length===1){h=h.children[0]}if(h.childNodes.length===0&&h.tagName!=="BR"){var g=document.createTextNode("\u200b");h.appendChild(g)}}}}}; - -// 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=$('

  • ');for(var g=0,d=b.length;g').data("color",f).css("background-color",f);e.append(c);c.click($.proxy(this.wfontcolor._onColorPick,this))}var a=$('').html(this.lang.get("none")).data("color","none");a.click($.proxy(this.wfontcolor._onColorPick,this));e.appendTo(h);$('
  • ")},_onColorPick:function(a){a.preventDefault();var b=$(a.currentTarget).data("color");if(b==="none"){this.inline.removeStyleRule("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=$('
  • '+h+"
  • ").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")+";")})});$('
  • '+this.lang.get("none")+"
  • ").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'+c+"").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;")})}$('
  • '+this.opts.curLang.none+"
  • ").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.alignment();this.wmonkeypatch.button();this.wmonkeypatch.caret();this.wmonkeypatch.clean();this.wmonkeypatch.code();this.wmonkeypatch.dropdown();this.wmonkeypatch.image();this.wmonkeypatch.indent();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(f){var e={cancel:false,event:f};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keydown_"+a,e);return(e.cancel?false:true)});this.wutil.setOption("keyupCallback",(function(f){this.wutil.saveSelection();var e={cancel:false,event:f};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","keyup_"+a,e);return(e.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 c=false;this.$editor.on("mousedown.wmonkeypatch",(function(){c=true}).bind(this));$(document).on("mouseup.wmonkeypatch",(function(){if(c){c=false;this.wutil.saveSelection()}}).bind(this));var b=(function(e,f){if(f){if(e.previousElementSibling&&(e.previousElementSibling.tagName==="P"||e.previousElementSibling.tagName==="DIV")){this.caret.setEnd(e.previousElementSibling)}else{this.wutil.setCaretBefore(e)}}else{if(e.nextElementSibling&&(e.nextElementSibling.tagName==="P"||e.nextElementSibling.tagName==="DIV")){this.caret.setEnd(e.nextElementSibling)}else{this.wutil.setCaretAfter(e)}}}).bind(this);var d=null;this.$editor.on("click.wmonkeypatch",(function(f){if(f.target===this.$editor[0]){var k=(window.getSelection().rangeCount)?window.getSelection().getRangeAt(0):null;if(k&&k.collapsed){var g=k.startContainer;var m=this.$editor.offset();if(d===null){d={left:this.$editor.cssAsNumber("padding-left"),top:this.$editor.cssAsNumber("padding-top")}}if(f.pageY<=m.top+d.top){var j=this.$editor[0].children[0];if(j.tagName!=="BLOCKQUOTE"&&(j.tagName!=="DIV"||!/\bcodeBox\b/.test(j.className))){return}}else{if(f.pageX<=m.left+d.left){return}else{if(f.pageX>m.left+this.$editor.width()){return}}}while(g&&g!==this.$editor[0]){if(g.nodeType===Node.ELEMENT_NODE){if(g.tagName==="BLOCKQUOTE"||(g.tagName==="DIV"&&/\bcodeBox\b/.test(g.className))){var n=$(g).offset();if(f.pageY<=n.top){b(g,true)}else{b(g,false)}return false}}g=g.parentElement}}var l=this.$editor.children("blockquote, div.codeBox");l.each(function(r,s){var p=$(s);var o=p.offset();if(f.pageY<=o.top){b(s,true);return false}else{var q=p.outerHeight()+(parseInt(p.css("margin-bottom"),10)||0);if(f.pageY<=o.top+q){b(s,false);return false}}});return false}else{if(f.target.tagName==="LI"){var k=(window.getSelection().rangeCount)?window.getSelection().getRangeAt(0):null;var e=false;if(k!==null){if(!k.collapsed){return}var g=k.startContainer;while(g!==null&&g!==this.$editor[0]){if(g.tagName==="LI"){e=true;break}g=g.parentElement}}if(!e||k===null){var h=document.createTextNode("\u200b");var j=f.target.children[0];j.appendChild(h);this.caret.setEnd(j)}}else{if(f.target.tagName==="BLOCKQUOTE"){var k=(window.getSelection().rangeCount)?window.getSelection().getRangeAt(0):null;if(k!==null&&k.collapsed){var i=null;var g=(k.startContainer.nodeType===Node.TEXT_NODE)?k.startContainer.parentElement:k.startContainer;while(g!==null&&g!==this.$editor[0]){if(g.tagName==="BLOCKQUOTE"){i=g;break}g=g.parentElement}if(i!==null&&i!==f.target){if(f.pageY<=$(i).offset().top){b(i,true)}else{b(i,false)}}}}}}}).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(/$/i,"")};var a=this.clean.onSet;this.clean.onSet=(function(e){e=c(e);e=a.call(this,e);return b(e)}).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"){$('
  • ");var f=$(''+h.title+"");f.on("click",$.proxy(function(k){k.preventDefault();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.dropdown.hideAll()},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").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)},indent:function(){var a=this.indent.increase;this.indent.increase=(function(){var b=this.selection.getBlock();if(b&&b.tagName==="LI"){if(b.parentElement.firstChild!==b){a.call(this)}}}).bind(this)},inline:function(){var c=(function(e,d){var f=e.parent();while(f[0]!==this.$editor[0]){if(f.children(":not(.redactor-selection-marker)").length>1){break}if(f[0].tagName==="SPAN"&&f[0].style.getPropertyValue(d)){f.contents().unwrap();break}f=f.parent()}}).bind(this);var b=this.inline.format;this.inline.format=(function(d,e,f){if($.browser.iOS){this.wutil.restoreSelection()}b.call(this,d,e,f)}).bind(this);var a=this.inline.removeStyleRule;this.inline.removeStyleRule=(function(d){if($.browser.iOS){this.wuil.restoreSelection()}a.call(this,d)}).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("
    "))}}}}).bind(this);var b=(function(){var f=false;this.$editor.find("span").each(function(){var g=$(this);if(g.data("verified")!=="redactor"){var h=$("helper").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 a=this.link.insert;this.link.insert=(function(){a.call(this);this.selection.get();var b=this.selection.getCurrent();if(b.nodeType===Node.TEXT_NODE){b=b.parentElement}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=$("
    ").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=$('
    ').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")}catch(c){}finally{if(this.modal.dialog){var d=this.modal.dialog.parents(".dialogContainer:eq(0)");if(d.length){setTimeout(function(){d.remove()},500)}}}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.createPasteBox;this.paste.createPasteBox=(function(){if($.browser.iOS){var e=0;if(window.getSelection().rangeCount){var d=window.getSelection().getRangeAt(0).endContainer;if(d.nodeType!==Node.ELEMENT_NODE){d=d.parentElement}d=$(d);e=$(d).offset().top}else{e=$(window).scrollTop()}this.$pasteBox=$("
    ").html("").attr("contenteditable","true").css({position:"fixed",top:e+"px",fontSize:"16px"});this.$box.parent().append(this.$pasteBox);this.$pasteBox.focus()}else{a.call(this)}}).bind(this);var c=function(){var d=window.getSelection();if(!d.rangeCount){return}var i=d.getRangeAt(0);if(!i.collapsed){return}var f=i.startContainer;if(f.nodeType===Node.ELEMENT_NODE&&f.tagName==="DIV"){var h=f.parentNode;if(h!==null&&h.tagName==="BLOCKQUOTE"&&h.classList.contains("quoteBox")){var g=i.startContainer.childNodes[i.startContainer.childNodes.length-1];var e=document.createRange();e.setStart(i.startContainer.childNodes[0],0);e.setEnd(g,g.length);e.collapse(false);d.removeAllRanges();d.addRange(e)}}};var b=this.paste.insert;this.paste.insert=(function(d){c();b.call(this,d);setTimeout((function(){this.wutil.fixDOM();if($.browser.msie){getSelection().getRangeAt(0).collapse(false)}else{if($.browser.mozilla){var e=getSelection().getRangeAt(0);if(e.startContainer===this.$editor[0]&&e.endContainer===this.$editor[0]){this.wutil.selectionEndOfEditor()}}}this.wutil.saveSelection()}).bind(this),20)}).bind(this)},selection:function(){this.selection.implicitRange=null;var a=(function(e,c){var b=c.nextSibling;if(b!==null&&b.nodeType===Node.TEXT_NODE&&b.length===0){$(b).remove()}var d=null;if((c.id==="selection-marker-1"&&!this.$editor.find("#selection-marker-2").length)||c.id==="nodes-marker-1"&&!this.$editor.find("#nodes-marker-2").length){d=c.previousSibling}$(c).remove();if(d!==null){this.selection.implicitRange=document.createRange();this.selection.implicitRange.setStart(d,d.length);this.selection.implicitRange.setEnd(d,d.length)}else{this.selection.implicitRange=null}}).bind(this);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='
    ";this.opts.modal.imageEdit=this.opts.modal.image;this.opts.modal.link='';this.opts.modal.quote='
    ';var a="";$.each(__REDACTOR_CODE_HIGHLIGHTERS,function(c,b){if(c==="plain"){return true}a+='"});this.opts.modal.code="
    "+WCF.Language.get("wcf.bbcode.code.settings")+'
    "+WCF.Language.get("wcf.bbcode.code.highlighter.description")+'
    '+WCF.Language.get("wcf.bbcode.code.lineNumber.description")+'
    '+WCF.Language.get("wcf.bbcode.code.filename.description")+"
    "+WCF.Language.get("wcf.bbcode.code")+'