Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Thu, 1 Sep 2016 09:32:23 +0000 (11:32 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Thu, 1 Sep 2016 09:32:23 +0000 (11:32 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js

index e43607cf6969e1a16bf461b624c42d0000c13630..1d500670ce2eb165ebbcaf2f6625d67714832815 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,s,o,e;for(o=0,e=this.opts.woltlab.customButtons.length;e>o;o++)s=this.opts.woltlab.customButtons[o],t=this.button.add(s,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var n;for(o=0,e=this.opts.buttons.length;e>o;o++)if(s=this.opts.buttons[o],"wcfSeparator"!==s){if(!this.opts.woltlab.buttons.hasOwnProperty(s))throw new Error("Missing button definition for '"+s+"'.");switch(n=this.opts.woltlab.buttons[s],"underline"===s&&(this.opts.activeButtonsStates.u="underline"),s){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[o-1],s,""),this.button.setEvent(t,s,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===s?"sub":"sup"]=s;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[o-1],s,""),this.button.addCallback(t,this.buffer[s]);break;default:t=this.button.get(s)}if(this.button.setIcon(t,'<span class="icon icon16 '+n.icon+'"></span>'),!t[0])throw new Error("Missing button element for '"+s+"'.");elAttr(t[0],"title",n.title),t[0].classList.add("jsTooltip")}for(var i,r={},a=[],l=this.core.toolbar()[0];l.childElementCount;)i=l.removeChild(l.children[0]),s=elAttr(i.children[0],"rel"),r[s]=i,a.push(s);var h=!1;for(o=0,e=this.opts.buttons.length;e>o;o++)s=this.opts.buttons[o],"wcfSeparator"!==s?(i=r[s],l.appendChild(i),a.splice(a.indexOf(s),1),h&&(i.classList.add("redactor-toolbar-separator"),h=!1)):h=!0;for(o=0,e=l.childElementCount;e>o;o++)i=l.children[o],t=i.children[0],elData(i,"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 s={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,s),s.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()}}}};
+$.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)}}};
 // WoltLabCaret.js
 $.Redactor.prototype.WoltLabCaret=function(){"use strict";return{init:function(){var t=this.caret.after;this.caret.after=function(e){e=this.caret.prepare(e),this.utils.isBlockTag(e.tagName)&&this.WoltLabCaret._addParagraphAfterBlock(e),t.call(this,e)}.bind(this),this.$editor[0].addEventListener("mouseup",this.WoltLabCaret._handleEditorClick.bind(this)),this.WoltLabCaret._initInternalRange()},endOfEditor:function(){var t=this.core.editor()[0];document.activeElement!==t&&t.focus();var e=t.lastElementChild;"P"===e.nodeName?this.caret.end(e):this.caret.after(e)},_initInternalRange:function(){var t=this.core.editor()[0],e=null,n=window.getSelection(),i=function(){e=n.rangeCount?n.getRangeAt(0).cloneRange():null},r=function(){if(null!==e){if(document.activeElement===t){var i=n.getRangeAt(0);if(0!==i.startOffset)return;for(var r=i.startContainer;r;){if(r.parentNode===t){if(r.previousSibling)return;break}if(r.previousSibling)return;r=r.parentNode}if(!r)return}t.focus(),n.removeAllRanges(),n.addRange(e),e=null}};t.addEventListener("keyup",i),t.addEventListener("mouseup",function(){n.rangeCount&&i()});var a=this.selection.save;this.selection.save=function(){e=null,a.call(this)}.bind(this);var o=this.selection.restore;this.selection.restore=function(){e&&(r(),n.rangeCount&&this.utils.isRedactorParent(n.getRangeAt(0).commonAncestorContainer))||o.call(this)}.bind(this);var s=this.buffer.set;this.buffer.set=function(e){document.activeElement!==t&&r(),s.call(this,e),i()}.bind(this);var l=this.insert.html;this.insert.html=function(t,e){l.call(this,t,e),i()}.bind(this),require(["Environment"],function(e){"ios"===e.platform()&&(t.addEventListener("focus",function(){document.addEventListener("selectionchange",i)}),t.addEventListener("blur",function(){document.removeEventListener("selectionchange",i)}))}.bind(this))},_handleEditorClick:function(t){if(t.target===this.$editor[0]&&this.selection.get().isCollapsed){var e=this.selection.block();if(e!==!1&&("P"!==e.nodeName||(e=e.parentNode,e!==this.$editor[0]&&this.utils.isBlockTag(e.nodeName)))){if("TD"===e.nodeName)for(;"TABLE"!==e.nodeName;)e=e.parentNode;if(!e.nodeName.match(/^H\d$/)){this.buffer.set();var n=t.clientY<e.getBoundingClientRect().top,i=elCreate("p");i.textContent="​",e.parentNode.insertBefore(i,n?e:e.nextSibling),this.caret.end(i)}}}},_addParagraphAfterBlock:function(t){var e=t.nextElementSibling;(!e||"P"!==e.nodeName&&!this.utils.isBlockTag(e.nodeName))&&(e=elCreate("p"),e.textContent="​",t.parentNode.insertBefore(e,t.nextSibling))}}};
 // WoltLabClean.js