Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Wed, 14 Sep 2016 16:48:55 +0000 (18:48 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Wed, 14 Sep 2016 16:48:55 +0000 (18:48 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js

index e4cb473c9561320928fb652a318bdc96a5ecdead..2fa2994bda5e67f5babd46dfd1330f2b57dc152b 100644 (file)
@@ -13,7 +13,7 @@ $.Redactor.prototype.WoltLabAutosave=function(){"use strict";return{init:functio
 // WoltLabBlock.js
 $.Redactor.prototype.WoltLabBlock=function(){"use strict";return{init:function(){this.block.tags=["p","blockquote","pre","h1","h2","h3","h4","h5","h6","div","figure"],this.block.format=function(t,o,i,e){return t="quote"===t?"blockquote":t,-1!==$.inArray(t,this.block.tags)?("p"===t&&"undefined"==typeof o&&(o="class"),this.placeholder.hide(),this.buffer.set(),this.utils.isCollapsed()?this.block.formatCollapsed(t,o,i,e):this.block.formatUncollapsed(t,o,i,e)):void 0}.bind(this);var t=this.block.formatCollapsed;this.block.formatCollapsed=function(o,i,e,s){for(var l=t.call(this,o,i,e,s),h=0,a=l.length;a>h;h++)this.WoltLabBlock._paragraphize(l[h]);return l}.bind(this);var o=this.block.formatUncollapsed;this.block.formatUncollapsed=function(t,i,e,s){for(var l,h=o.call(this,t,i,e,s),a=null,r=0,n=h.length;n>r;r++)if(l=h[r][0],this.WoltLabBlock._paragraphize(l),0===r)a=l;else{for(;l.childNodes.length;)a.appendChild(l.childNodes[0]);elRemove(l)}return $(a)}.bind(this)},register:function(t,o){-1===this.block.tags.indexOf(t)&&(this.block.tags.push(t),this.opts.paragraphizeBlocks.push(t),-1===this.opts.blockTags.indexOf(t)&&(this.opts.blockTags.push(t),this.reIsBlock=new RegExp("^("+this.opts.blockTags.join("|").toUpperCase()+")$","i")),o&&this.WoltLabKeydown.register(t))},_paragraphize:function(t){if(-1===["p","pre","h1","h2","h3","h4","h5","h6","div","figure"].indexOf(t.nodeName.toLowerCase())){for(var o=elCreate("p");t.childNodes.length;)o.appendChild(t.childNodes[0]);t.appendChild(o)}}}};
 // WoltLabButton.js
-$.Redactor.prototype.WoltLabButton=function(){"use strict";return{init:function(){var t,o,s,e;for(s=0,e=this.opts.woltlab.customButtons.length;e>s;s++)o=this.opts.woltlab.customButtons[s],t=this.button.add(o,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var i;for(s=0,e=this.opts.buttons.length;e>s;s++)if(o=this.opts.buttons[s],"wcfSeparator"!==o){if(!this.opts.woltlab.buttons.hasOwnProperty(o))throw new Error("Missing button definition for '"+o+"'.");switch(i=this.opts.woltlab.buttons[o],"underline"===o&&(this.opts.activeButtonsStates.u="underline"),o){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[s-1],o,""),this.button.setEvent(t,o,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===o?"sub":"sup"]=o;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[s-1],o,""),this.button.addCallback(t,this.buffer[o]);break;default:t=this.button.get(o)}if(this.button.setIcon(t,'<span class="icon icon16 '+i.icon+'"></span>'),!t[0])throw new Error("Missing button element for '"+o+"'.");elAttr(t[0],"title",i.title),t[0].classList.add("jsTooltip")}for(var n,r={},a=[],l=this.core.toolbar()[0];l.childElementCount;)n=l.removeChild(l.children[0]),o=elAttr(n.children[0],"rel"),r[o]=n,a.push(o);var h=!1;for(s=0,e=this.opts.buttons.length;e>s;s++)o=this.opts.buttons[s],"wcfSeparator"!==o?(n=r[o],l.appendChild(n),a.splice(a.indexOf(o),1),h&&(n.classList.add("redactor-toolbar-separator"),h=!1)):h=!0;for(s=0,e=l.childElementCount;e>s;s++)n=l.children[s],t=n.children[0],elData(n,"show-on-mobile",-1!==this.opts.woltlab.buttonMobile.indexOf(t.rel));a.forEach(function(t){l.appendChild(r[t])}),WCF.DOMNodeInsertedHandler.execute()},_handleCustomButton:function(t){var o={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,o),o.cancel!==!0){this.buffer.set();var s="["+t+"]"+this.selection.html()+(this.selection.is()?"":this.marker.html())+"[/"+t+"]";this.insert.html(s),this.selection.restore()}window.setTimeout(function(){document.activeElement!==this.$editor[0]&&this.$editor[0].focus()}.bind(this),10)}}};
+$.Redactor.prototype.WoltLabButton=function(){"use strict";var t;return{init:function(){var t,o,e,s;for(e=0,s=this.opts.woltlab.customButtons.length;s>e;e++)o=this.opts.woltlab.customButtons[e],t=this.button.add(o,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var n;for(e=0,s=this.opts.buttons.length;s>e;e++)if(o=this.opts.buttons[e],"wcfSeparator"!==o){if(!this.opts.woltlab.buttons.hasOwnProperty(o))throw new Error("Missing button definition for '"+o+"'.");switch(n=this.opts.woltlab.buttons[o],"underline"===o&&(this.opts.activeButtonsStates.u="underline"),o){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[e-1],o,""),this.button.setEvent(t,o,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===o?"sub":"sup"]=o;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[e-1],o,""),this.button.addCallback(t,this.buffer[o]);break;default:t=this.button.get(o)}if(this.button.setIcon(t,'<span class="icon icon16 '+n.icon+'"></span>'),!t[0])throw new Error("Missing button element for '"+o+"'.");elAttr(t[0],"title",n.title),t[0].classList.add("jsTooltip")}for(var i,a={},l=[],r=this.core.toolbar()[0];r.childElementCount;)i=r.removeChild(r.children[0]),o=elAttr(i.children[0],"rel"),a[o]=i,l.push(o);var u=!1;for(e=0,s=this.opts.buttons.length;s>e;e++)o=this.opts.buttons[e],"wcfSeparator"!==o?(i=a[o],r.appendChild(i),l.splice(l.indexOf(o),1),u&&(i.classList.add("redactor-toolbar-separator"),u=!1)):u=!0;for(e=0,s=r.childElementCount;s>e;e++)i=r.children[e],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 o={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,o),o.cancel!==!0){this.buffer.set();var e="["+t+"]"+this.selection.html()+(this.selection.is()?"":this.marker.html())+"[/"+t+"]";this.insert.html(e),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 o=t.children[0].children[0];t.children[0].addEventListener("mousedown",function(t){t.preventDefault(),this.$toolbar[0].classList.toggle("redactorToolbarOverride"),o.classList.toggle("fa-caret-down"),o.classList.toggle("fa-caret-up")}.bind(this)),this.$toolbar[0].appendChild(t)}}};
 // 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),this.$editor[0].addEventListener(WCF_CLICK_EVENT,this.WoltLabCaret._handleEditorClick.bind(this)),this.WoltLabCaret._initInternalRange()},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 a=this.selection.save;this.selection.save=function(){t=null,a.call(this)}.bind(this);var o=this.selection.restore;this.selection.restore=function(){t&&(r(),n.rangeCount&&this.utils.isRedactorParent(n.getRangeAt(0).commonAncestorContainer))||o.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,a,o=t;o;){if(a=o.getBoundingClientRect(),e.clientY<a.top)r=!0,t=o;else{if(!(e.clientY>a.bottom))break;r=!1,t=o}if(!o.parentNode||o.parentNode===this.$editor[0])break;o=o.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