Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sun, 25 Sep 2016 15:50:36 +0000 (17:50 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Sun, 25 Sep 2016 15:50:36 +0000 (17:50 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js

index 5b431d5f75782637cfd4fb24fdb3ec160939ccaf..7760ae5f6bf176f37bfbe54d46c5e6e511871587 100644 (file)
@@ -15,7 +15,7 @@ $.Redactor.prototype.WoltLabBlock=function(){"use strict";return{init:function()
 // WoltLabButton.js
 $.Redactor.prototype.WoltLabButton=function(){"use strict";var t;return{init:function(){var t,e,o,n;for(o=0,n=this.opts.woltlab.customButtons.length;n>o;o++)e=this.opts.woltlab.customButtons[o],t=this.button.add(e,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var s;for(o=0,n=this.opts.buttons.length;n>o;o++)if(e=this.opts.buttons[o],"wcfSeparator"!==e){if(!this.opts.woltlab.buttons.hasOwnProperty(e))throw new Error("Missing button definition for '"+e+"'.");switch(s=this.opts.woltlab.buttons[e],"underline"===e&&(this.opts.activeButtonsStates.u="underline"),e){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.setEvent(t,e,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===e?"sub":"sup"]=e;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.addCallback(t,this.buffer[e]);break;default:t=this.button.get(e)}if(this.button.setIcon(t,'<span class="icon icon16 '+s.icon+'"></span>'),!t[0])throw new Error("Missing button element for '"+e+"'.");elAttr(t[0],"title",s.title),t[0].classList.add("jsTooltip")}for(var i,a={},l=[],r=this.core.toolbar()[0];r.childElementCount;)i=r.removeChild(r.children[0]),e=elAttr(i.children[0],"rel"),a[e]=i,l.push(e);var c=!1;for(o=0,n=this.opts.buttons.length;n>o;o++)e=this.opts.buttons[o],"wcfSeparator"!==e?(i=a[e],r.appendChild(i),l.splice(l.indexOf(e),1),c&&(i.classList.add("redactor-toolbar-separator"),c=!1)):c=!0;for(o=0,n=r.childElementCount;n>o;o++)i=r.children[o],t=i.children[0],elData(i,"show-on-mobile",-1!==this.opts.woltlab.buttonMobile.indexOf(t.rel));l.forEach(function(t){r.appendChild(a[t])}),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(t){t.on("screen-xs",{match:this.WoltLabButton._enableToggleButton.bind(this),unmatch:this.WoltLabButton._disableToggleButton.bind(this),setup:this.WoltLabButton._setupToggleButton.bind(this)})}.bind(this))},_handleCustomButton:function(t){var e={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,e),e.cancel!==!0){this.buffer.set();var o="["+t+"]"+this.selection.html()+(this.selection.is()?"":this.marker.html())+"[/"+t+"]";this.insert.html(o),this.selection.restore()}window.setTimeout(function(){document.activeElement!==this.$editor[0]&&this.$editor[0].focus()}.bind(this),10)},_enableToggleButton:function(){null===t.parentNode&&this.$toolbar[0].appendChild(t)},_disableToggleButton:function(){null!==t.parentNode&&this.$toolbar[0].removeChild(t)},_setupToggleButton:function(){t=elCreate("li"),t.className="redactorToolbarToggle",t.innerHTML='<a href="#"><span class="icon icon16 fa-caret-down"></span></a>',elData(t,"show-on-mobile",!0);var e=t.children[0].children[0],o=function(t){t instanceof Event&&t.preventDefault(),this.$toolbar[0].classList.toggle("redactorToolbarOverride")&&document.activeElement&&document.activeElement!==this.$editor[0]&&document.activeElement.blur(),e.classList.toggle("fa-caret-down"),e.classList.toggle("fa-caret-up")}.bind(this);t.children[0].addEventListener("mousedown",o),this.$toolbar[0].appendChild(t),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+this.$element[0].id,function(){this.$toolbar[0].classList.contains("redactorToolbarOverride")&&o()}.bind(this))}}};
 // 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){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.clientY<o.top)r=!0,t=a;else{if(!(e.clientY>o.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))}}};
+$.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.clientY<o.top)r=!0,t=a;else{if(!(e.clientY>o.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){return e.call(this,t.replace(/\u200B/g,""))}.bind(this);var t=this.clean.onSync;this.clean.onSync=function(e){var n=elCreate("div"),r={};return-1!==e.indexOf("<pre")&&(n.innerHTML=e,elBySelAll("pre",n,function(e){var t=WCF.getUUID();r[t]=e.textContent,e.textContent=t}),e=n.innerHTML),e=e.replace(/<p>\u200B<\/p>/g,"<p><br></p>"),e=t.call(this,e),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}}};
 // WoltLabCode.js