From: woltlab.com Date: Sat, 15 Oct 2016 14:31:47 +0000 (+0200) Subject: Updating minified JavaScript files X-Git-Tag: 3.0.0_Beta_3~35 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a4a272522b0915e7a35ce3c926a5d9366c8f5b11;p=GitHub%2FWoltLab%2FWCF.git Updating minified JavaScript files --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js index 3fc99e0bf2..6807f5f37e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js @@ -17,11 +17,11 @@ $.Redactor.prototype.WoltLabButton=function(){"use strict";var t;return{init:fun // WoltLabCaret.js $.Redactor.prototype.WoltLabCaret=function(){"use strict";return{init:function(){var e=this.caret.after;this.caret.after=function(t){t=this.caret.prepare(t),this.utils.isBlockTag(t.tagName)&&this.WoltLabCaret._addParagraphAfterBlock(t),e.call(this,t)}.bind(this);var t=this.caret.end;this.caret.end=function(e){if(e=this.caret.prepare(e),e.nodeType===Node.ELEMENT_NODE&&e.lastChild&&"P"===e.lastChild.nodeName){var n=window.getSelection(),i=document.createRange();return i.selectNodeContents(e.lastChild),i.collapse(!1),n.removeAllRanges(),void n.addRange(i)}return t.call(this,e)}.bind(this),this.$editor[0].addEventListener(WCF_CLICK_EVENT,this.WoltLabCaret._handleEditorClick.bind(this)),this.WoltLabCaret._initInternalRange(),require(["Environment"],function(e){"chrome"===e.browser()&&"android"===e.platform()&&elAttr(this.$editor[0],"autocomplete","off")}.bind(this))},paragraphAfterBlock:function(e){var t=e.nextElementSibling;t&&"P"!==t.nodeName&&(t=elCreate("p"),t.textContent="​",e.parentNode.insertBefore(t,e.nextSibling)),this.caret.after(e)},endOfEditor:function(){var e=this.core.editor()[0];document.activeElement!==e&&e.focus();var t=e.lastElementChild;"P"===t.nodeName?this.caret.end(t):this.caret.after(t)},_initInternalRange:function(){var e=this.core.editor()[0],t=null,n=window.getSelection(),i=function(){t=n.rangeCount?n.getRangeAt(0).cloneRange():null},r=function(){if(null!==t){if(document.activeElement===e){var i=n.getRangeAt(0);if(0!==i.startOffset)return;for(var r=i.startContainer;r;){if(r.parentNode===e){if(r.previousSibling)return;break}if(r.previousSibling)return;r=r.parentNode}if(!r)return}e.focus(),n.removeAllRanges(),n.addRange(t),t=null}};e.addEventListener("keyup",i),e.addEventListener("mouseup",function(){n.rangeCount&&i()});var o=this.selection.save;this.selection.save=function(){t=null,o.call(this)}.bind(this);var a=this.selection.restore;this.selection.restore=function(){t&&null===elBySel(".redactor-selection-marker",this.$editor[0])&&(r(),n.rangeCount&&this.utils.isRedactorParent(n.getRangeAt(0).commonAncestorContainer))||a.call(this)}.bind(this);var s=this.buffer.set;this.buffer.set=function(t){document.activeElement!==e&&r(),s.call(this,t),i()}.bind(this);var l=this.insert.html;this.insert.html=function(e,t){var n=elBySel(".redactor-selection-marker",this.$editor[0]);l.call(this,e,t),(n||null===elBySel(".redactor-selection-marker",this.$editor[0]))&&i()}.bind(this),require(["Environment"],function(t){"ios"===t.platform()&&(e.addEventListener("focus",function(){document.addEventListener("selectionchange",i)}),e.addEventListener("blur",function(){document.removeEventListener("selectionchange",i)}))}.bind(this))},_handleEditorClick:function(e){if(this.selection.get().isCollapsed){var t=this.selection.block();if(t===!1){if(this.selection.current()===this.$editor[0]){var n=this.$editor[0].childNodes[this.selection.get().anchorOffset];n.nodeType===Node.ELEMENT_NODE&&"TABLE"===n.nodeName&&(t=n)}if(t===!1)return}for(var i=e.target;i&&!this.utils.isBlockTag(i.nodeName);)i=i.parentNode;if(i&&i!==t&&("P"!==t.nodeName||(t=t.parentNode,t!==this.$editor[0]&&this.utils.isBlockTag(t.nodeName)))){if("TD"===t.nodeName)for(;"TABLE"!==t.nodeName;)t=t.parentNode;if(!t.nodeName.match(/^H\d$/)&&!$(t).closest("ol, ul",this.$editor[0]).length){for(var r,o,a=t;a;){if(o=a.getBoundingClientRect(),e.clientYo.bottom))break;r=!1,t=a}if(!a.parentNode||a.parentNode===this.$editor[0])break;a=a.parentNode}var s=t[(r?"previous":"next")+"ElementSibling"];if(s&&"P"===s.nodeName)return void this.caret.end(s);this.buffer.set();var l=elCreate("p");l.textContent="​",t.parentNode.insertBefore(l,r?t:t.nextSibling),this.caret.end(l)}}}},_addParagraphAfterBlock:function(e){var t=e.nextElementSibling;(!t||"P"!==t.nodeName&&!this.utils.isBlockTag(t.nodeName))&&(t=elCreate("p"),t.textContent="​",e.parentNode.insertBefore(t,e.nextSibling))}}}; // WoltLabClean.js -$.Redactor.prototype.WoltLabClean=function(){"use strict";return{init:function(){this.opts.pasteInlineTags=this.opts.pasteInlineTags.filter(function(e){return"span"!==e});var e=this.clean.onSet;this.clean.onSet=function(t){t=t.replace(/\u200B/g,""),t=t.replace(/&/g,"@@@WCF_AMPERSAND@@@"),t=e.call(this,t),t=t.replace(/@@@WCF_AMPERSAND@@@/g,"&");var n=elCreate("div");return n.innerHTML=t,elBySelAll("iframe",n,elRemove),t=n.innerHTML}.bind(this);var t=this.clean.onSync;this.clean.onSync=function(e){var n=elCreate("div");n.innerHTML=e;var r={};return elBySelAll("pre",n,function(e){var t=WCF.getUUID();r[t]=e.textContent,e.textContent=t}),elBySelAll("p",n,function(e){var t=e.lastElementChild;if(t&&"BR"===t.nodeName&&t.nextSibling&&t.nextSibling.textContent.match(/^[\s\u200B]+$/)){var n=elCreate("p");n.innerHTML="
",e.parentNode.insertBefore(n,e.nextSibling),e.removeChild(t.nextSibling),e.removeChild(t)}}),e=n.innerHTML,e=e.replace(/

\u200B<\/p>/g,"


"),e=e.replace(/&/g,"@@@WCF_AMPERSAND@@@"),e=t.call(this,e),e=e.replace(/@@@WCF_AMPERSAND@@@/g,"&"),n.innerHTML=e,elBySelAll("span",n,function(e){e.outerHTML=e.innerHTML}),elBySelAll("pre",n,function(e){r.hasOwnProperty(e.textContent)&&(e.textContent=r[e.textContent])}),e=n.innerHTML}.bind(this);var n=this.clean.savePreFormatting;this.clean.savePreFormatting=function(e){var t=this.clean.encodeEntities;return this.clean.encodeEntities=function(e){return WCF.String.escapeHTML(e)},e=n.call(this,e),this.clean.encodeEntities=t,e}.bind(this);var r=this.clean.stripTags;this.clean.stripTags=function(e,t){return Array.isArray(t)&&t.push("span"),r.call(this,e,t)}.bind(this);var i=this.clean.onPaste;this.clean.onPaste=function(e,t,n){if(t.pre)return i.call(this,e,t,n);var r=elCreate("div");r.innerHTML=e;for(var a,l,s,o=elBySelAll("[style]",r),c=0,h=o.length;h>c;c++){a=o[c],s=[];for(var u=0,p=a.style.length;p>u;u++)l=a.style[u],this.WoltLabClean._applyInlineStyle(a,l,a.style.getPropertyValue(l))&&s.push(l);s.forEach(function(e){a.style.removeProperty(e)})}return i.call(this,r.innerHTML,t,n)}.bind(this);var a=[],l=function(e,t){for(var n={},r=0,i=t.length;i>r;r++)n[t[r]]=elAttr(e,t[r]);a.push({element:e,attributes:n})},s=this.clean.convertTags;this.clean.convertTags=function(e,t){var n=elCreate("div");return n.innerHTML=e,a=[],WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","convertTags_"+this.$element[0].id,{addToStorage:l,div:n}),a.forEach(function(e,t){e.element.outerHTML="###custom"+t+"###"+e.element.innerHTML+"###/custom"+t+"###"}),s.call(this,n.innerHTML,t)}.bind(this);var o=this.clean.reconvertTags;this.clean.reconvertTags=function(e,t){if(a.length){e=e.replace(/###(\/?)custom(\d+)###/g,'<$1woltlab-custom-tag data-index="$2">');var n=elCreate("div");n.innerHTML=e,elBySelAll("woltlab-custom-tag",n,function(e){var t=~~elData(e,"index");if(a[t]){var n=a[t],r=elCreate(n.element.nodeName);for(var i in n.attributes)n.attributes.hasOwnProperty(i)&&elAttr(r,i,n.attributes[i]);for(e.parentNode.insertBefore(r,e);e.childNodes.length;)r.appendChild(e.childNodes[0])}elRemove(e)}),e=n.innerHTML}return o.call(this,e,t)}.bind(this)},_applyInlineStyle:function(e,t,n){var r="",i="";switch(t){case"font-weight":600==n&&null===e.closest("strong")&&(i="strong")}if(i){var a=elCreate(i);return r&&(a.className=r),e.parentNode.insertBefore(a,e),a.appendChild(e),!0}return!1}}}; +$.Redactor.prototype.WoltLabClean=function(){"use strict";return{init:function(){var e=this.clean.onSet;this.clean.onSet=function(t){t=t.replace(/\u200B/g,""),t=t.replace(/&/g,"@@@WCF_AMPERSAND@@@"),t=e.call(this,t),t=t.replace(/@@@WCF_AMPERSAND@@@/g,"&");var n=elCreate("div");return n.innerHTML=t,elBySelAll("iframe",n,elRemove),t=n.innerHTML}.bind(this);var t=this.clean.onSync;this.clean.onSync=function(e){var n=elCreate("div");n.innerHTML=e;var l={};return elBySelAll("pre",n,function(e){var t=WCF.getUUID();l[t]=e.textContent,e.textContent=t}),elBySelAll("p",n,function(e){var t=e.lastElementChild;if(t&&"BR"===t.nodeName&&t.nextSibling&&t.nextSibling.textContent.match(/^[\s\u200B]+$/)){var n=elCreate("p");n.innerHTML="
",e.parentNode.insertBefore(n,e.nextSibling),e.removeChild(t.nextSibling),e.removeChild(t)}}),e=n.innerHTML,e=e.replace(/

\u200B<\/p>/g,"


"),e=e.replace(/&/g,"@@@WCF_AMPERSAND@@@"),e=t.call(this,e),e=e.replace(/@@@WCF_AMPERSAND@@@/g,"&"),n.innerHTML=e,elBySelAll("pre",n,function(e){l.hasOwnProperty(e.textContent)&&(e.textContent=l[e.textContent])}),e=n.innerHTML}.bind(this);var n=this.clean.savePreFormatting;this.clean.savePreFormatting=function(e){var t=this.clean.encodeEntities;return this.clean.encodeEntities=function(e){return WCF.String.escapeHTML(e)},e=n.call(this,e),this.clean.encodeEntities=t,e}.bind(this);var l=this.clean.onPaste;this.clean.onPaste=function(e,t,n){if(t.pre)return l.call(this,e,t,n);var r=elCreate("div");r.innerHTML=e;for(var i,a,o,s=elBySelAll("[style]",r),c=0,h=s.length;h>c;c++){i=s[c],o=[];for(var u=0,d=i.style.length;d>u;u++)a=i.style[u],-1===this.opts.woltlab.allowedInlineStyles.indexOf(a)&&o.push(a);o.forEach(function(e){i.style.removeProperty(e)})}return elBySelAll("span",r,function(e){if(!e.style.length||!e.hasAttribute("style")){for(;e.childNodes.length;)e.parentNode.insertBefore(e.childNodes[0],e);elRemove(e)}}),l.call(this,r.innerHTML,t,n)}.bind(this);var r=[],i=function(e,t){for(var n,l,i={},a=0,o=t.length;o>a;a++)n=t[a],l=elAttr(e,n),"style"===n&&0===e.style.length&&0===l.indexOf("font-family")&&(l=l.replace(/"/g,"")),i[n]=l;r.push({element:e,attributes:i})},a=this.clean.convertTags;this.clean.convertTags=function(e,t){var n=elCreate("div");return n.innerHTML=e,console.debug(e),r=[],WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","convertTags_"+this.$element[0].id,{addToStorage:i,div:n}),elBySelAll("span",n,function(e){i(e,["style"])}),r.forEach(function(e,t){e.element.outerHTML="###custom"+t+"###"+e.element.innerHTML+"###/custom"+t+"###"}),a.call(this,n.innerHTML,t)}.bind(this);var o=this.clean.reconvertTags;this.clean.reconvertTags=function(e,t){if(r.length){e=e.replace(/###(\/?)custom(\d+)###/g,'<$1woltlab-custom-tag data-index="$2">');var n=elCreate("div");n.innerHTML=e,elBySelAll("woltlab-custom-tag",n,function(e){var t=~~elData(e,"index");if(r[t]){var n=r[t],l=elCreate(n.element.nodeName);for(var i in n.attributes)n.attributes.hasOwnProperty(i)&&elAttr(l,i,n.attributes[i]);for(e.parentNode.insertBefore(l,e);e.childNodes.length;)l.appendChild(e.childNodes[0])}elRemove(e)}),e=n.innerHTML}return o.call(this,e,t)}.bind(this),this.clean.removeSpans=function(e){return e}}}}; // WoltLabCode.js $.Redactor.prototype.WoltLabCode=function(){"use strict";return{init:function(){require(["WoltLabSuite/Core/Ui/Redactor/Code"],function(t){new t(this)}.bind(this));var t=this.code.start;this.code.start=function(e){t.call(this,e),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","codeStart_"+this.$element[0].id)}.bind(this)}}}; // WoltLabColor.js -$.Redactor.prototype.WoltLabColor=function(){"use strict";var o=["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"];return{init:function(){for(var t,e=this.WoltLabColor.setColor.bind(this),r={removeColor:{title:this.lang.get("remove-color"),func:this.WoltLabColor.removeColor.bind(this)}},l=0,i=o.length;i>l;l++)t=o[l],r["color_"+t]={title:"#"+t,func:e};var s=this.button.add("woltlabColor","");this.button.addDropdown(s,r),s.data("dropdown").find("a").each(function(o,t){t.className.match(/redactor-dropdown-color_([A-F0-9]{6})/)&&(t.parentNode.classList.add("woltlab-color-"+RegExp.$1),t.parentNode.classList.add("woltlab-color-selection"))}),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","convertTags_"+this.$element[0].id,function(o){elBySelAll("woltlab-color",o.div,function(t){o.addToStorage(t,["class"])})}),this.WoltLabColor.registerColors(),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","codeStart_"+this.$element[0].id,this.WoltLabColor.registerColors.bind(this))},setColor:function(o){o=o.replace(/^color_/,""),this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.format(this.$editor[0],"woltlab-color","woltlab-color-"+o),this.buffer.set()}.bind(this))},removeColor:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(o){this.buffer.set(),o.removeFormat(this.$editor[0],"woltlab-color"),this.buffer.set()}.bind(this))},registerColors:function(){require(["WoltLabSuite/Core/Ui/Redactor/RuntimeStyle"],function(t){elBySelAll("woltlab-color",this.$editor[0],function(e){if(e.className.match(/woltlab-color-([a-z0-9]{3}(?:[a-z0-9]{3})?)/i)){var r=RegExp.$1;3===r.length&&(r=r.substr(0,1)+r.substr(0,1)+r.substr(1,1)+r.substr(1,1)+r.substr(2,1)+r.substr(2,1)),r=r.toUpperCase(),-1===o.indexOf(r)&&t.add("woltlab-color-"+r,"color: #"+r+";")}}.bind(this))}.bind(this))}}}; +$.Redactor.prototype.WoltLabColor=function(){"use strict";var o=["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"];return{init:function(){for(var t,e=this.WoltLabColor.setColor.bind(this),r={},F=0,i=o.length;i>F;F++)t=o[F],r["color_"+t]={title:"#"+t,func:e};r.removeColor={title:this.lang.get("remove-color"),func:this.WoltLabColor.removeColor.bind(this)};var l=this.button.add("woltlabColor","");this.button.addDropdown(l,r);var s=l.data("dropdown");s.find("a").each(function(o,t){t.className.match(/redactor-dropdown-color_([A-F0-9]{6})/)&&(t.style.setProperty("color","#"+RegExp.$1,""),t.parentNode.classList.add("woltlab-color-selection"))}),$('').insertBefore(s.children("li").last())},setColor:function(o){o=o.replace(/^color_/,""),this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.format(this.$editor[0],"color","#"+o),this.buffer.set()}.bind(this))},removeColor:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(o){this.buffer.set(),o.removeFormat(this.$editor[0],"color"),this.buffer.set()}.bind(this))}}}; // WoltLabDragAndDrop.js $.Redactor.prototype.WoltLabDragAndDrop=function(){"use strict";return{init:function(){require(["WoltLabSuite/Core/Ui/Redactor/DragAndDrop"],function(t){t.init(this)}.bind(this))}}}; // WoltLabDropdown.js @@ -29,7 +29,7 @@ $.Redactor.prototype.WoltLabDropdown=function(){"use strict";return{init:functio // WoltLabEvent.js $.Redactor.prototype.WoltLabEvent=function(){"use strict";var t=0;return{init:function(){this._callbacks=[],this._elementId=this.$element[0].id,elData(this.$editor[0],"element-id",this._elementId),require(["EventHandler"],function(t){this.WoltLabEvent._setEvents(t),t.add("com.woltlab.wcf.redactor2","destroy_"+this._elementId,function(){t.removeAllBySuffix("com.woltlab.wcf.redactor2",this._elementId)}.bind(this))}.bind(this)),this.$editor[0].addEventListener("focus",function(){t++,document.documentElement.classList.add("redactorActive")}),this.$editor[0].addEventListener("blur",function(){t--,window.setTimeout(function(){0===t&&document.documentElement.classList.remove("redactorActive")},100)})},_setEvents:function(t){var e=this.$element[0].id,i=this.observe.load;this.observe.load=function(){i.call(this),t.fire("com.woltlab.wcf.redactor2","observe_load_"+e,{editor:this.$editor[0]})}.bind(this),this.opts.callbacks.keyup=function(i){var n={cancel:!1,event:i};return t.fire("com.woltlab.wcf.redactor","keyup_"+e,n),n.cancel===!1},t.add("com.woltlab.wcf.redactor2","getText_"+e,function(t){t.message=this.code.get()}.bind(this)),t.add("com.woltlab.wcf.redactor2","reset_"+e,function(){this.code.set("")}.bind(this))},register:function(t,e){require(["EventHandler"],function(i){var n=this.uuid;-1===this._callbacks.indexOf(t)&&(this.opts.callbacks[t]=function(e){var c={cancel:!1,event:e,redactor:this};return i.fire("com.woltlab.wcf.redactor2",t+"_"+n+"_"+this.WoltLabEvent._elementId,c),c.cancel===!1}.bind(this),this._callbacks.push(t)),require(["EventHandler"],function(i){i.add("com.woltlab.wcf.redactor2",t+"_"+n+"_"+this.WoltLabEvent._elementId,e)}.bind(this))}.bind(this))}}}; // WoltLabFont.js -$.Redactor.prototype.WoltLabFont=function(){"use strict";return{init:function(){var t=["arial","comicSansMs","courierNew","georgia","lucidaSansUnicode","tahoma","timesNewRoman","trebuchetMs","verdana"],o=["Arial","Comic Sans MS","Courier New","Georgia","Lucida Sans Unicode","Tahoma","Times New Roman","Trebuchet MS","Verdana"],e=this.WoltLabFont.setFont.bind(this),a={};t.forEach(function(t,n){a[t]={title:o[n],func:e}}),a.removeFont={title:this.lang.get("remove-font"),func:this.WoltLabFont.removeFont.bind(this)};var n=this.button.add("woltlabFont","");this.button.addDropdown(n,a),n.data("dropdown").find("a").each(function(t,o){o.className&&"redactor-dropdown-removeFont"!==o.className&&(o.parentNode.classList.add("woltlab-font-"+o.className.replace(/^redactor-dropdown-/,"")),o.parentNode.classList.add("woltlab-font-selection"))}),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","convertTags_"+this.$element[0].id,function(o){elBySelAll("woltlab-font",o.div,function(e){e.className.match(/^woltlab-font-([a-zA-Z]+)$/)&&-1!==t.indexOf(RegExp.$1)&&o.addToStorage(e,["class"])})})},setFont:function(t){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(o){this.buffer.set(),o.format(this.$editor[0],"woltlab-font","woltlab-font-"+t),this.buffer.set()}.bind(this))},removeFont:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.removeFormat(this.$editor[0],"woltlab-font"),this.buffer.set()}.bind(this))}}}; +$.Redactor.prototype.WoltLabFont=function(){"use strict";return{_fonts:["Arial, Helvetica, sans-serif","Comic Sans MS, Marker Felt, cursive","Consolas, Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif",'Trebuchet MS", Helvetica, sans-serif',"Verdana, Geneva, sans-serif"],init:function(){var t=this.WoltLabFont.setFont.bind(this),e={};this.WoltLabFont._fonts.forEach(function(o,i){e["fontFamily_"+i]={title:o.split(",")[0].replace(/['"]/g,""),func:t}}),e.removeFont={title:this.lang.get("remove-font"),func:this.WoltLabFont.removeFont.bind(this)};var o=this.button.add("woltlabFont","");this.button.addDropdown(o,e);var i=o.data("dropdown");i.find("a").each(function(t,e){e.className.match(/^redactor-dropdown-fontFamily_(\d+)$/)&&e.style.setProperty("font-family",this.WoltLabFont._fonts[RegExp.$1],"")}.bind(this)),$('').insertBefore(i.children("li").last())},setFont:function(t){t=t.replace(/^fontFamily_/,""),this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(e){this.buffer.set(),e.format(this.$editor[0],"font-family",this.WoltLabFont._fonts[t]),this.buffer.set()}.bind(this))},removeFont:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.removeFormat(this.$editor[0],"font-family"),this.buffer.set()}.bind(this))}}}; // WoltLabImage.js $.Redactor.prototype.WoltLabImage=function(){"use strict";return{init:function(){var t=this.button.add("woltlabImage","");this.button.addCallback(t,this.WoltLabImage.add);var e=this.image.showEdit;this.image.showEdit=function(t){var a=t[0];if(!a.classList.contains("smiley")){e(t),this.modal.setTitle(WCF.Language.get("wcf.editor.image.edit")),this.modal.getActionButton().text(WCF.Language.get("wcf.global.button.save")),this.modal.getDeleteButton().text(WCF.Language.get("wcf.global.button.delete")),elById("redactor-image-source").value=a.src;var i=elById("redactor-image-float");a.classList.contains("messageFloatObjectLeft")?i.value="left":a.classList.contains("messageFloatObjectRight")&&(i.value="right"),a.classList.contains("woltlabAttachment")&&elRemove(elById("redactor-image-source-container"))}}.bind(this);var a=this.image.update;this.image.update=function(){var t=this.observe.image[0],e=elById("redactor-image-source"),i=function(t,e){$('').text(e).insertAfter(t)};if(!t.classList.contains("woltlabAttachment")){var o=e.value.trim();if(""===o)return i(e,WCF.Language.get("wcf.global.form.error.empty"));if(!o.match(this.opts.regexps.url))return i(e,WCF.Language.get("wcf.editor.image.source.error.invalid"));t.src=o}t.classList.remove("messageFloatObjectLeft"),t.classList.remove("messageFloatObjectRight");var r=elById("redactor-image-float").value;("left"===r||"right"===r)&&t.classList.add("messageFloatObject"+WCF.String.ucfirst(r)),a.call(this),t.removeAttribute("alt"),t.removeAttribute("title"),this.caret.after(t)}.bind(this),this.opts.modal["image-edit"]='
'},add:function(){this.modal.load("image-edit",WCF.Language.get("wcf.editor.image.insert")),this.modal.show(),this.modal.getDeleteButton().hide();var t=this.modal.getActionButton()[0];t.addEventListener(WCF_CLICK_EVENT,this.WoltLabImage.insert),t.textContent=WCF.Language.get("wcf.global.button.insert"),this.WoltLabModal.rebuild()},insert:function(t){t.preventDefault(),this.modal.getModal().find(".innerError").remove();var e=elById("redactor-image-source"),a=function(t,e){$('').text(e).insertAfter(t)},i=e.value.trim();if(""===i)return a(e,WCF.Language.get("wcf.global.form.error.empty"));if(!i.match(this.opts.regexps.url))return a(e,WCF.Language.get("wcf.editor.image.source.error.invalid"));var o=elById("redactor-image-link"),r=o.value.trim();if(""!==r&&!r.match(this.opts.regexps.url))return a(o,WCF.Language.get("wcf.editor.image.link.error.invalid"));var l=elById("redactor-image-float").value,s="";("left"===l||"right"===l)&&(s="messageFloatObject"+WCF.String.ucfirst(l));var n='";r&&(n=''+n+""),this.modal.close(),this.buffer.set(),this.insert.html(n)}}}; // WoltLabInlineCode.js @@ -37,7 +37,7 @@ $.Redactor.prototype.WoltLabInlineCode=function(){"use strict";return{init:funct // WoltLabInsert.js $.Redactor.prototype.WoltLabInsert=function(){"use strict";return{init:function(){var t=this.opts.woltlab.placeholderCallback,e=this.insert.html;this.insert.html=function(i,n){t&&(t=t()),this.placeholder.hide(),this.core.editor().focus();var r=this.selection.block(),l=""===this.$editor[0].innerHTML.replace(/<\/?p>/g,"").replace(/
/g,"").replace(/\u200B/g,"").trim();if(e.call(this,i,n),l&&(r=this.$editor[0].firstElementChild),r&&"P"===r.nodeName&&r.nextElementSibling){var s=!1;0===r.childElementCount&&""===r.textContent.replace(/\u200B/g,"").trim()?s=!0:1===r.childElementCount&&"
"===r.innerHTML&&(s=!0),s&&elRemove(r)}}.bind(this);var i=this.insert.text;this.insert.text=function(e){t&&(t=t()),i.call(this,e)}.bind(this)}}}; // WoltLabKeydown.js -$.Redactor.prototype.WoltLabKeydown=function(){"use strict";var t=[];return{init:function(){this.keydown.onArrowDown=function(){for(var t=this.WoltLabKeydown._getBlocks(),e=0;e/gi,"");if(e.tagName===t&&this.utils.isEmpty(i)&&!$(e).hasClass("redactor-in")){var n=document.createElement("p");$(e).replaceWith(n);var r=document.createRange();r.setStart(n,0);var o=document.createTextNode("​");r.insertNode(o),r.setStartAfter(o),r.collapse(!0);var s=window.getSelection();return s.removeAllRanges(),s.addRange(r),!1}"P"===e.tagName&&$(e).removeAttr("style")}.bind(this),this.keydown.onShiftEnter=function(t){return this.buffer.set(),this.keydown.pre?this.keydown.insertNewLine(t):this.insert.raw("
​")}.bind(this);var e=this.keydown.onTab;this.keydown.onTab=function(t,i){return this.keydown.pre||0!==$(this.selection.current()).closest("ul, ol",this.core.editor()[0]).length?e.call(this,t,i):!0}.bind(this);var i=this.keydown.formatEmpty;this.keydown.formatEmpty=function(t){for(var e,n=this.$editor[0],r=0,o=n.childElementCount;o>r;r++)if(e=n.children[r],"P"!==e.nodeName&&this.utils.isBlockTag(e.nodeName))return;return i.call(this,t)}.bind(this),require(["Core","Environment"],function(t,e){if("desktop"===e.platform()){var i=this.$editor[0].closest("form, .message");if(null!==i){var n=elBySel(".formSubmit",i);if(null!==n){var r=elBySel('input[type="submit"], button[data-type="save"], button[accesskey="s"]',n);r&&(r.removeAttribute("accesskey"),this.WoltLabEvent.register("keydown",function(e){if(83===e.event.which){var i=!1;window.navigator.platform.match(/^Mac/)?e.event.ctrlKey&&e.event.altKey&&(i=!0):e.event.altKey&&!e.event.ctrlKey&&(i=!0),i&&(e.cancel=!0,"function"==typeof r.click?r.click():t.triggerEvent(r,WCF_CLICK_EVENT))}}.bind(this)))}}}}.bind(this))},register:function(e){-1===t.indexOf(e)&&t.push(e)},_getBlocks:function(){for(var e=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],i=0,n=t.length;n>i;i++)e.push(this.utils.isTag(this.keydown.current,t[i]));return e}}}; +$.Redactor.prototype.WoltLabKeydown=function(){"use strict";var t=[];return{init:function(){this.keydown.onArrowDown=function(){for(var t=this.WoltLabKeydown._getBlocks(),e=0;e/gi,"");if(e.tagName===t&&this.utils.isEmpty(i)&&!$(e).hasClass("redactor-in")){var n=document.createElement("p");$(e).replaceWith(n);var o=document.createRange();o.setStart(n,0);var r=document.createTextNode("​");o.insertNode(r),o.setStartAfter(r),o.collapse(!0);var s=window.getSelection();return s.removeAllRanges(),s.addRange(o),!1}"P"===e.tagName&&$(e).removeAttr("style")}.bind(this),this.keydown.onShiftEnter=function(t){return this.buffer.set(),this.keydown.pre?this.keydown.insertNewLine(t):this.insert.raw("
​")}.bind(this);var e=this.keydown.onTab;this.keydown.onTab=function(t,i){return this.keydown.pre||0!==$(this.selection.current()).closest("ul, ol",this.core.editor()[0]).length?e.call(this,t,i):!0}.bind(this);var i=this.keydown.formatEmpty;this.keydown.formatEmpty=function(t){for(var e,n=this.$editor[0],o=0,r=n.childElementCount;r>o;o++)if(e=n.children[o],"P"!==e.nodeName&&this.utils.isBlockTag(e.nodeName))return;return i.call(this,t)}.bind(this),require(["Core","Environment"],function(t,e){if("desktop"===e.platform()){var i=this.$editor[0].closest("form, .message");if(null!==i){var n=elBySel(".formSubmit",i);if(null!==n){var o=elBySel('input[type="submit"], button[data-type="save"], button[accesskey="s"]',n);o&&(o.removeAttribute("accesskey"),this.WoltLabEvent.register("keydown",function(e){if(83===e.event.which){var i=!1;window.navigator.platform.match(/^Mac/)?e.event.ctrlKey&&e.event.altKey&&(i=!0):e.event.altKey&&!e.event.ctrlKey&&(i=!0),i&&(e.cancel=!0,"function"==typeof o.click?o.click():t.triggerEvent(o,WCF_CLICK_EVENT))}}.bind(this)))}}}}.bind(this))},register:function(e){-1===t.indexOf(e)&&t.push(e)},_getBlocks:function(){for(var e=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],i=0,n=t.length;n>i;i++)e.push(this.utils.isTag(this.keydown.current,t[i]));return e}}}; // WoltLabLink.js $.Redactor.prototype.WoltLabLink=function(){"use strict";var i=null;return{init:function(){this.link.show=this.WoltLabLink.show.bind(this),require(["WoltLabSuite/Core/Ui/Redactor/Link"],function(t){i=t})},show:function(t){"undefined"!=typeof t&&t.preventDefault&&t.preventDefault(),this.selection.save(),this.observe.closeAllTooltip();var e=this.link.is();i.showDialog({insert:e===!1,submitCallback:function(){var i=this.link.buildLinkFromModal();return i===!1?!1:(this.selection.restore(),this.link.insert(i,!0),!0)}.bind(this)});var n=this.link.buildLinkFromElement(e);n.url=this.link.removeSelfHostFromUrl(n.url),this.link.setModalValues(n),this.detect.isDesktop()&&$("#redactor-link-url").focus()}}}; // WoltLabList.js @@ -59,7 +59,7 @@ $.Redactor.prototype.WoltLabQuote=function(){"use strict";return{init:function() // WoltLabReply.js $.Redactor.prototype.WoltLabReply=function(){"use strict";var t=null,e=null,s=null;return{init:function(){var i=this.$editor[0].closest(".messageContent"),o=elById("messageQuickReply");i&&i.classList.contains("messageQuickReplyContent")&&o&&o.classList.contains("messageQuickReplyCollapsed")&&(t=this.WoltLabReply._click.bind(this),e=i,s=o,WCF.System.Event.addListener("com.woltlab.wcf.redactor2","showEditor",this.WoltLabReply.showEditor.bind(this)),e.addEventListener(WCF_CLICK_EVENT,t))},showEditor:function(){return s?void(s.classList.contains("messageQuickReplyCollapsed")&&(s.classList.remove("messageQuickReplyCollapsed"),e.removeEventListener(WCF_CLICK_EVENT,t),this.WoltLabCaret.endOfEditor())):void this.WoltLabCaret.endOfEditor()},_click:function(t){t.preventDefault(),WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","showEditor")}}}; // WoltLabSize.js -$.Redactor.prototype.WoltLabSize=function(){"use strict";return{init:function(){for(var e,t=[8,10,12,14,18,24,36],i=this.WoltLabSize.setSize.bind(this),o={},s=0,a=t.length;a>s;s++)e=t[s],o["size_"+e]={title:e,func:i};o.removeSize={title:this.lang.get("remove-size"),func:this.WoltLabSize.removeSize.bind(this)};var n=this.button.add("woltlabSize","");this.button.addDropdown(n,o),n.data("dropdown").find("a").each(function(e,t){t.className.match(/redactor-dropdown-size_(\d{1,2})/)&&(t.parentNode.classList.add("woltlab-size-"+RegExp.$1),t.parentNode.classList.add("woltlab-size-selection"))}),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","convertTags_"+this.$element[0].id,function(e){elBySelAll("woltlab-size",e.div,function(i){i.className.match(/^woltlab-size-(\d{1,2})$/)&&-1!==t.indexOf(~~RegExp.$1)&&e.addToStorage(i,["class"])})})},setSize:function(e){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.format(this.$editor[0],"woltlab-size","woltlab-size-"+e.replace(/^size_/,"")),this.buffer.set()}.bind(this))},removeSize:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(e){this.buffer.set(),e.removeFormat(this.$editor[0],"woltlab-size"),this.buffer.set()}.bind(this))}}}; +$.Redactor.prototype.WoltLabSize=function(){"use strict";return{init:function(){for(var t,e=[8,10,12,14,18,24,36],i=this.WoltLabSize.setSize.bind(this),o={},s=0,r=e.length;r>s;s++)t=e[s],o["size_"+t]={title:t,func:i};o.removeSize={title:this.lang.get("remove-size"),func:this.WoltLabSize.removeSize.bind(this)};var n=this.button.add("woltlabSize","");this.button.addDropdown(n,o);var a=n.data("dropdown");a.find("a").each(function(t,e){e.className.match(/redactor-dropdown-size_(\d{1,2})/)&&(e.style.setProperty("font-size",RegExp.$1+"pt",""),e.parentNode.classList.add("woltlab-size-selection"))}),$('').insertBefore(a.children("li").last())},setSize:function(t){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(e){this.buffer.set(),e.format(this.$editor[0],"font-size",t.replace(/^size_/,"")+"pt"),this.buffer.set()}.bind(this))},removeSize:function(){this.selection.save(),require(["WoltLabSuite/Core/Ui/Redactor/Format"],function(t){this.buffer.set(),t.removeFormat(this.$editor[0],"font-size"),this.buffer.set()}.bind(this))}}}; // WoltLabSmiley.js $.Redactor.prototype.WoltLabSmiley=function(){"use strict";var t=0;return{init:function(){require(["EventHandler"],function(t){t.add("com.woltlab.wcf.redactor2","insertSmiley_"+this.$element[0].id,this.WoltLabSmiley._insert.bind(this))}.bind(this))},_insert:function(i){if(!this.WoltLabSource.isActive()){this.buffer.set();var e="wscSmiley_"+this.uuid+"_"+t++,r=i.img.cloneNode();r.id=e,this.insert.html(r.outerHTML),r=elById(e),r.outerHTML=r.outerHTML}}}}; // WoltLabSource.js diff --git a/wcfsetup/install/files/js/WCF.Combined.min.js b/wcfsetup/install/files/js/WCF.Combined.min.js index 88fd5af015..6c37b976f8 100755 --- a/wcfsetup/install/files/js/WCF.Combined.min.js +++ b/wcfsetup/install/files/js/WCF.Combined.min.js @@ -104,7 +104,7 @@ void 0!==n&&i.children(this._options.items).each($.proxy(function(e,t){var i=$(t (function (window, undefined) {"use strict";WCF.Search.Message={},WCF.Search.Message.KeywordList=WCF.Search.Base.extend({_className:"wcf\\data\\search\\keyword\\SearchKeywordAction",_divider:null,_forceSubmit:!1,init:function(e,i,s){if(!$.isFunction(i))return void console.debug("[WCF.Search.Message.KeywordList] The given callback is invalid, aborting.");this._callback=i,this._excludedSearchValues=[],s&&(this._excludedSearchValues=s),this._searchInput=$(e).keyup($.proxy(this._keyUp,this)).keydown($.proxy(function(e){13===e.which&&this._itemCount&&-1!==this._itemIndex&&e.preventDefault()},this));var t=WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()),r=t.find("li.dropdownDivider").last();this._divider=$('