Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Wed, 17 Sep 2014 13:31:52 +0000 (15:31 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Wed, 17 Sep 2014 13:31:52 +0000 (15:31 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wcombined.min.js

index 0b864751180f685bd4eb7f86cd6a1c1cc64791b2..f05c7f990f8a1681fab0798e433156fcd5814e9a 100644 (file)
@@ -13,4 +13,4 @@ if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wmonkeypatch={init:f
 // wupload.js
 if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wupload={_boundGlobalUploadEvents:false,_wUploadDropArea:{},_timer:null,_isDragging:false,_isFile:false,init:function(){var a=".redactor_"+this.$source.wcfIdentify();$(document).on("dragover"+a,$.proxy(this._dragOver,this));$(document).on("dragleave"+a,$.proxy(this._dragLeave,this));$(document).on("drop"+a,$.proxy(function(b){b.preventDefault();this._revertDropArea(undefined,this.$source.wcfIdentify())},this));if(!this._boundGlobalUploadEvents){this._boundGlobalUploadEvents=true;$(document).on("dragend",function(b){b.preventDefault()})}WCF.System.Event.addListener("com.woltlab.wcf.attachment","autoInsert_"+this.$source.wcfIdentify(),$.proxy(this.insertPastedImageAttachment,this))},_dragOver:function(c){c=c.originalEvent;if(!c.dataTransfer||!c.dataTransfer.types){return}this._isFile=false;if(c.dataTransfer.types[0]==="application/x-moz-file"){this._isFile=true}else{for(var e=0;e<c.dataTransfer.types.length;e++){if(c.dataTransfer.types[e]==="Files"){this._isFile=true;break}}}if(!this._isFile){return}this._isFile=true;c.preventDefault();if(!this._isDragging){var b=this.$source.wcfIdentify();if(this._wUploadDropArea[b]===undefined){this._wUploadDropArea[b]=$('<div class="redactorDropArea">'+WCF.Language.get("wcf.attachment.dragAndDrop.dropHere")+"</div>").hide().appendTo(document.body);this._wUploadDropArea[b].on("dragover",$.proxy(this._hoverDropArea,this)).on("dragleave",$.proxy(this._revertDropArea,this)).on("drop",$.proxy(this._drop,this))}var a=(this.inWysiwygMode())?this.$editor.getDimensions("outer"):this.$source.getDimensions("outer");var d=(this.inWysiwygMode())?this.$editor.getOffsets("offset"):this.$source.getOffsets("offset");this._wUploadDropArea[b].css({height:a.height+"px",left:d.left+"px",lineHeight:a.height+"px",top:d.top+"px",width:a.width+"px"}).show();this._isDragging=true}c.preventDefault()},_hoverDropArea:function(a){this._wUploadDropArea[this.$source.wcfIdentify()].addClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropNow"))},_revertDropArea:function(c,a){if(!this._isFile){return}var b=a||this.$source.wcfIdentify();this._wUploadDropArea[b].removeClass("active").text(WCF.Language.get("wcf.attachment.dragAndDrop.dropHere"));if(a){this._wUploadDropArea[b].hide()}},_dragLeave:function(){if(!this._isDragging||!this._isFile){return}if(this._timer===null){var a=this;this._timer=new WCF.PeriodicalExecuter(function(b){b.stop();if(!a._isDragging){a._wUploadDropArea[a.$source.wcfIdentify()].hide()}},100)}else{this._timer.resume()}this._isDragging=false},_drop:function(c){if(!this._isFile){return}c=c.originalEvent||c;if(c.dataTransfer&&c.dataTransfer.files.length){c.preventDefault();var b=this.$source.wcfIdentify();this._revertDropArea(undefined,b);for(var d=0;d<c.dataTransfer.files.length;d++){var a=c.dataTransfer.files[d];if(a.type){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+b,{file:a})}}}},pasteClipboardUploadMozilla:function(){this.$editor.find("img[data-mozilla-paste-image]").each($.proxy(function(d,g){var f=$(g);var a=f.prop("src").split(",");var e=a[0].split(";")[0].split(":")[1];var c=a[1];var b={blob:WCF.base64toBlob(c,e),uploadID:null};WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","upload_"+this.$source.wcfIdentify(),b);f.replaceWith('<span class="redactor-pastedImageFromClipboard-'+b.uploadID+'" />')},this))},insertPastedImageAttachment:function(b){var a=this.$editor.find("span.redactor-pastedImageFromClipboard-"+b.uploadID);a.before(b.attachment);a.remove()}};
 // wutil.js
-if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wutil={_autosaveWorker:null,init:function(){this.$source.parents("form").submit($.proxy(this.submit,this));if(this.getOption("wautosave").active){this.autosaveEnable();if(this.getOption("wautosave").saveOnInit||this.$source.data("saveOnInit")){this.setOption("wAutosaveOnce",true)}else{this.autosaveRestore()}}this.setOption("autosave",false);var b=this.destroy;var a=this;this.destroy=function(){a.autosaveDisable();b.call(a)}},insertAtCaret:function(b){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$source.focus();var c=this.$source.getCaret();if(c==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var a=this.$source.val();a=a.substr(0,c)+b+a.substr(c);this.$source.val(a);return true},insertDynamic:function(a,b){if(this.inWysiwygMode()){this.insertHtml(a)}else{if(b===undefined||b===null){b=a}this.insertAtCaret(b)}},setOption:function(a,b){this.opts[a]=b},getOption:function(a){if(this.opts[a]){return this.opts[a]}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(a){getSelection().removeAllRanges();getSelection().addRange(a)},getText:function(){if(this.inWysiwygMode()){this.wSync()}return this.$source.val()},submit:function(){if(this.inWysiwygMode()){this.wSync()}this.autosavePurge()},reset:function(){if(this.inWysiwygMode()){this.$editor.html("<p>"+this.opts.invisibleSpace+"</p>");this.sync()}else{this.$source.val("")}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$source.wcfIdentify()})},autosaveEnable:function(a){if(!this.getOption("wautosave").active){this.setOption("wautosave",{active:true,key:a})}if(this._autosaveWorker===null){this._autosaveWorker=new WCF.PeriodicalExecuter($.proxy(this._saveTextToStorage,this),60*1000)}return true},_saveTextToStorage:function(){localStorage.setItem(this.getOption("wautosave").key,this.getText())},autosaveDisable:function(){if(!this.getOption("wautosave").active){return false}this._autosaveWorker.stop();this._autosaveWorker=null;this.setOption("wautosave",{active:false,key:""});return true},autosavePurge:function(){localStorage.removeItem(this.getOption("wautosave").key)},autosaveRestore:function(){var a=this.getOption("wautosave");var b=localStorage.getItem(a.key);if(b!==null){if(this.inWysiwygMode()){this.setOption("wOriginalValue",b)}else{this.$source.val(b)}return true}return false},buttonReplace:function(d,b,e,g,f){var a=this.buttonGet(d);var c=this.buttonAddAfter(d,b,e,g,f);if(a.parent().hasClass("separator")){c.parent().addClass("separator")}a.parent().remove();return c},removeZeroWidthSpace:function(a){var b="";for(var e=0,d=a.length;e<d;e++){var c=a.charCodeAt(e).toString(16);if(c!="200b"){b+=a[e]}}return b},wSync:function(){this.sync(undefined,true);this.$source.val(this.convertFromHtml(this.cleanHtml(this.$source.val())))},getSource:function(){return this.$source},getName:function(){return this.$source.wcfIdentify()},selectionEndOfEditor:function(){this.selectionEnd(this.$editor.children(":last")[0])},isCaret:function(a){var b=(a)?a:this.getRange();return b.collapsed},isEndOfElement:function(a){var c=this.getRange();if(!this.isCaret(c)){console.debug("case#1");return false}if(c.endContainer.nodeType===Element.TEXT_NODE){if(c.endOffset<c.endContainer.length){console.debug("case#2");return false}}if(!this.isNodeWithin(c.endContainer,a)){console.debug("case#3");return false}var b=c.endContainer;while(b!==a){if(b.nextSibling){console.debug("case#4");return false}b=b.parentNode}return true},isNodeWithin:function(c,b){var a=$(c);while(a[0]!==this.$editor[0]){if(a[0]===b){return true}a=a.parent()}return false},containsTag:function(b,a){switch(b.nodeType){case Element.ELEMENT_NODE:if(b.tagName===a){return true}case Element.DOCUMENT_FRAGMENT_NODE:for(var c=0;c<b.childNodes.length;c++){if(this.containsTag(b.childNodes[c],a)){return true}}return false;break;default:return false;break}},replaceText:function(b){var a=false;if(this.inWysiwygMode()){this.toggle();a=true}this.$source.val(b);if(a){this.toggle()}}};
+if(!RedactorPlugins){var RedactorPlugins={}}RedactorPlugins.wutil={_autosaveWorker:null,init:function(){this.$source.parents("form").submit($.proxy(this.submit,this));if(this.getOption("wautosave").active){this.autosaveEnable();if(this.getOption("wautosave").saveOnInit||this.$source.data("saveOnInit")){this.setOption("wAutosaveOnce",true)}else{this.autosaveRestore()}}this.setOption("autosave",false);var b=this.destroy;var a=this;this.destroy=function(){a.autosaveDisable();b.call(a)}},insertAtCaret:function(b){if(this.opts.visual){console.debug("insertAtCaret() failed: Editor is in WYSIWYG-mode.");return false}this.$source.focus();var c=this.$source.getCaret();if(c==-1){console.debug("insertAtCaret() failed: Source is not input[type=text], input[type=password] or textarea.")}var a=this.$source.val();a=a.substr(0,c)+b+a.substr(c);this.$source.val(a);return true},insertDynamic:function(a,b){if(this.inWysiwygMode()){this.insertHtml(a)}else{if(b===undefined||b===null){b=a}this.insertAtCaret(b)}},setOption:function(a,b){this.opts[a]=b},getOption:function(a){if(this.opts[a]){return this.opts[a]}return null},inPlainMode:function(){return !this.opts.visual},inWysiwygMode:function(){return(this.opts.visual)},replaceRangesWith:function(a){getSelection().removeAllRanges();getSelection().addRange(a)},getText:function(){if(this.inWysiwygMode()){this.wSync()}return this.$source.val()},submit:function(){if(this.inWysiwygMode()){this.wSync()}this.autosavePurge()},reset:function(){if(this.inWysiwygMode()){this.$editor.html("<p>"+this.opts.invisibleSpace+"</p>");this.sync()}else{this.$source.val("")}WCF.System.Event.fireEvent("com.woltlab.wcf.redactor","reset",{wysiwygContainerID:this.$source.wcfIdentify()})},autosaveEnable:function(a){if(!this.getOption("wautosave").active){this.setOption("wautosave",{active:true,key:a})}if(this._autosaveWorker===null){this._autosaveWorker=new WCF.PeriodicalExecuter($.proxy(this._saveTextToStorage,this),60*1000)}return true},_saveTextToStorage:function(){localStorage.setItem(this.getOption("wautosave").key,this.getText())},autosaveDisable:function(){if(!this.getOption("wautosave").active){return false}this._autosaveWorker.stop();this._autosaveWorker=null;this.setOption("wautosave",{active:false,key:""});return true},autosavePurge:function(){localStorage.removeItem(this.getOption("wautosave").key)},autosaveRestore:function(){var a=this.getOption("wautosave");var b=localStorage.getItem(a.key);if(b!==null){if(this.inWysiwygMode()){this.setOption("wOriginalValue",b)}else{this.$source.val(b)}return true}return false},buttonReplace:function(d,b,e,g,f){var a=this.buttonGet(d);var c=this.buttonAddAfter(d,b,e,g,f);if(a.parent().hasClass("separator")){c.parent().addClass("separator")}a.parent().remove();return c},removeZeroWidthSpace:function(a){var b="";for(var e=0,d=a.length;e<d;e++){var c=a.charCodeAt(e).toString(16);if(c!="200b"){b+=a[e]}}return b},wSync:function(){this.sync(undefined,true);this.$source.val(this.convertFromHtml(this.cleanHtml(this.$source.val())))},getSource:function(){return this.$source},getName:function(){return this.$source.wcfIdentify()},selectionEndOfEditor:function(){this.selectionEnd(this.$editor.children(":last")[0])},isCaret:function(a){var b=(a)?a:this.getRange();return b.collapsed},isEndOfElement:function(a){var c=this.getRange();if(!this.isCaret(c)){console.debug("case#1");return false}if(c.endContainer.nodeType===Element.TEXT_NODE){if(c.endOffset<c.endContainer.length){console.debug("case#2");return false}}if(!this.isNodeWithin(c.endContainer,a)){console.debug("case#3");return false}var b=c.endContainer;while(b!==a){if(b.nextSibling){console.debug("case#4");return false}b=b.parentNode}return true},isNodeWithin:function(c,b){var a=$(c);while(a[0]!==this.$editor[0]){if(a[0]===b){return true}a=a.parent()}return false},containsTag:function(b,a){switch(b.nodeType){case Element.ELEMENT_NODE:if(b.tagName===a){return true}case Element.DOCUMENT_FRAGMENT_NODE:for(var c=0;c<b.childNodes.length;c++){if(this.containsTag(b.childNodes[c],a)){return true}}return false;break;default:return false;break}},replaceText:function(c){var b=false;var a=$(document).scrollTop();if(this.inWysiwygMode()){this.toggle();b=true}this.$source.val(c);if(b){this.toggle();$(document).scrollTop(a)}}};