From 88c1bfb74e5edb95b9ebeba929c947632ee4464a Mon Sep 17 00:00:00 2001 From: "woltlab.com" Date: Tue, 25 Oct 2016 16:31:48 +0200 Subject: [PATCH] Updating minified JavaScript files --- .../files/js/3rdParty/redactor2/plugins/combined.min.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 d92ffdbcdb..69e24b5ff5 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js @@ -17,7 +17,7 @@ $.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(){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("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.onPaste;this.clean.onPaste=function(e,t,n){if(t.pre)return r.call(this,e,t,n);var l=elCreate("div");l.innerHTML=e;for(var i,a,o,s=elBySelAll("[style]",l),c=0,h=s.length;h>c;c++){i=s[c],o=[];for(var d=0,f=i.style.length;f>d;d++)a=i.style[d],-1===this.opts.woltlab.allowedInlineStyles.indexOf(a)&&o.push(a);o.forEach(function(e){i.style.removeProperty(e)})}return elBySelAll("span",l,function(e){if(!e.style.length||!e.hasAttribute("style")){for(;e.childNodes.length;)e.parentNode.insertBefore(e.childNodes[0],e);elRemove(e)}}),elBySelAll("br",l,function(e){e.parentNode.insertBefore(document.createTextNode("@@@WOLTLAB-BR-MARKER@@@"),e)}),e=r.call(this,l.innerHTML,t,n),e=e.replace(/@@@WOLTLAB-BR-MARKER@@@/g,""),l.innerHTML=e,elBySelAll("woltlab-br-marker",l,function(e){var t=e.parentNode;if("P"===t.nodeName){for(var n=elCreate("p");e.nextSibling;)n.appendChild(e.nextSibling);n.appendChild(elCreate("br")),t.parentNode.insertBefore(n,t.nextSibling);var r=e.previousElementSibling;r&&"BR"===r.nodeName&&elRemove(r)}else t.insertBefore(elCreate("br"),e);elRemove(e)}),l.innerHTML}.bind(this);var l=[],i=function(e,t){for(var n,r,i={},a=0,o=t.length;o>a;a++)n=t[a],r=elAttr(e,n),"style"===n&&0===e.style.length&&0===r.indexOf("font-family")&&(r=r.replace(/"/g,"")),i[n]=r;l.push({element:e,attributes:i})},a=this.clean.convertTags;this.clean.convertTags=function(e,t){var n=elCreate("div");return n.innerHTML=e,l=[],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"])}),l.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(l.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(l[t]){var n=l[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}if(t.links){t.links=!1;for(var r,i,a=e.split(/(###\/a###)/gi).reverse(),s=1,c=a.length;c>s&&s+1!==c;s++){r=a[s],i=a[s+1];for(var h,d=i.split(/(###a)/gi).reverse(),f=1,v=d.length;v>f&&f+1!==v;f++)if(h=d[f]+d[f-1],h.match(/###a(.*?)href="(.*?)"(.*?)###(.*?)/i)){d[f]="",d[f-1]=h.replace(/###a(.*?)href="(.*?)"(.*?)###(.*?)/i,'$4'),a[s]="",a[s+1]=d.reverse().join("");break}}e=a.reverse().join("")}return o.call(this,e,t)}.bind(this),this.clean.removeSpans=function(e){return e}}}}; +$.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 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("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.onPaste;this.clean.onPaste=function(e,t,n){if(t.pre)return r.call(this,e,t,n);var l=elCreate("div");l.innerHTML=e;for(var i,a,o,s=elBySelAll("[style]",l),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",l,function(e){if(!e.style.length||!e.hasAttribute("style")){for(;e.childNodes.length;)e.parentNode.insertBefore(e.childNodes[0],e);elRemove(e)}}),elBySelAll("br",l,function(e){e.parentNode.insertBefore(document.createTextNode("@@@WOLTLAB-BR-MARKER@@@"),e)}),e=r.call(this,l.innerHTML,t,n),e=e.replace(/@@@WOLTLAB-BR-MARKER@@@/g,""),l.innerHTML=e,elBySelAll("woltlab-br-marker",l,function(e){var t=e.parentNode;if("P"===t.nodeName){for(var n=elCreate("p");e.nextSibling;)n.appendChild(e.nextSibling);n.appendChild(elCreate("br")),t.parentNode.insertBefore(n,t.nextSibling);var r=e.previousElementSibling;r&&"BR"===r.nodeName&&elRemove(r)}else t.insertBefore(elCreate("br"),e);elRemove(e)}),l.innerHTML}.bind(this);var l=[],i=function(e,t){for(var n,r,i={},a=0,o=t.length;o>a;a++)n=t[a],r=elAttr(e,n),"style"===n&&0===e.style.length&&0===r.indexOf("font-family")&&(r=r.replace(/"/g,"")),i[n]=r;l.push({element:e,attributes:i})},a=this.clean.convertTags;this.clean.convertTags=function(e,t){var n=elCreate("div");n.innerHTML=e,l=[],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"])}),l.forEach(function(e,t){e.element.outerHTML="###custom"+t+"###"+e.element.innerHTML+"###/custom"+t+"###"});var r=!1;t.links&&this.opts.pasteLinks&&(elBySelAll("a",n,function(e){e.href&&(e.outerHTML='##%a href="'+e.href+'"%##'+e.innerHTML+"##%/a%##")}),r=!0,t.links=!1);var o=!1;return t.images&&this.opts.pasteImages&&(elBySelAll("img",n,function(e){if(e.src){for(var t,n='##%img src="'+e.src+'"',r=0,l=e.attributes.length;l>r;r++)t=e.attributes.item(r),"src"!==t.name&&(n+=" "+t.name+'="'+t.value+'"');e.outerHTML=n+"%##"}}),o=!0,t.images=!1),e=a.call(this,n.innerHTML,t),o&&(t.images=!0),r&&(t.links=!0),e}.bind(this);var o=this.clean.reconvertTags;this.clean.reconvertTags=function(e,t){if(l.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(l[t]){var n=l[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),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 @@ -40,8 +40,6 @@ $.Redactor.prototype.WoltLabInsert=function(){"use strict";return{init:function( $.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 -$.Redactor.prototype.WoltLabList=function(){"use strict";return{init:function(){this.list.combineAfterAndBefore=function(t){var e=$(t).prev(),n=$(t).next(),i=t&&"P"===t.tagName&&("
"===t.innerHTML||""===t.innerHTML),r=1===e.closest("ol, ul",this.core.editor()[0]).length&&1===n.closest("ol, ul",this.core.editor()[0]).length;return i&&r?(e.children("li").last().append(this.marker.get()),e.append(n.contents()),this.selection.restore(),!0):!1}.bind(this)}}}; // WoltLabMedia.js $.Redactor.prototype.WoltLabMedia=function(){"use strict";return{init:function(){var t=this.button.add("woltlabMedia","");$(t).addClass("jsMediaEditorButton");var e=WCF.System.Event.addListener("com.woltlab.wcf.redactor2","metacode_wsm_"+this.$element[0].id,function(t){if(1!==t.attributes.length){var e="";3===t.attributes&&("left"===t.attributes[2]?e=" messageFloatObjectLeft":"right"===t.attributes[2]&&(e=" messageFloatObjectRight"));var a=elCreate("img");a.className="woltlabSuiteMedia"+e,a.src=this.opts.woltlab.mediaUrl.replace("-123456789",t.attributes[0]).replace("thumbnail=void","thumbnail="+t.attributes[1]),elData(a,"media-id",t.attributes[0]),elData(a,"media-size",t.attributes[1]);var i=t.metacode;i.parentNode.insertBefore(a,i),elRemove(i),t.cancel=!0}}.bind(this));WCF.System.Event.addListener("com.woltlab.wcf.redactor2","destroy_"+this.$element[0].id,function(){WCF.System.Event.removeListener("com.woltlab.wcf.redactor2","metacode_wsm_"+this.$element[0].id,e)}.bind(this)),require(["WoltLabSuite/Core/Media/Manager/Editor"],function(t){new t({editor:this})}.bind(this))}}}; // WoltLabMention.js -- 2.20.1