/*!
* froala_editor v1.2.8 (https://www.froala.com/wysiwyg-editor)
* License https://www.froala.com/wysiwyg-editor/terms
* Copyright 2014-2015 Froala Labs
*/
!function(a){a.Editable.URLRegEx=/(\s|^|>)((http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+(\.[a-zA-Z]{2,3})?(:\d*)?(\/[^\s<]*)?)(\s|$|<)/gi,a.Editable.prototype.convertURLs=function(b){var c=this;b.each(function(){if("IFRAME"!=this.tagName)if(3==this.nodeType){var b=this.textContent.replace(/ /gi,"");a.Editable.URLRegEx.test(b)&&(a(this).before(b.replace(a.Editable.URLRegEx,'$1$2$7')),a(this).remove())}else 1==this.nodeType&&["A","BUTTON","TEXTAREA"].indexOf(this.tagName)<0&&c.convertURLs(a(this).contents())})},a.Editable.prototype.processURLs=function(){this.$original_element.on("editable.afterPasteCleanup",function(b,c,d){return a.Editable.URLRegEx.test(d)?d.replace(a.Editable.URLRegEx,'$1$2$7'):void 0}),this.$original_element.on("editable.keyup",function(a,b,c){var d=c.which;(32==d||13==d)&&b.convertURLs(b.$element.contents())}),this.$original_element.on("editable.keydown",function(b,c,d){var e=d.which;if(32==e){var f=c.getSelectionElement();if(("A"==f.tagName||a(f).parents("a").length)&&c.getSelectionTextInfo(f).atEnd)return b.stopImmediatePropagation(),"A"!==f.tagName&&(f=a(f).parents("a")[0]),a(f).after(' '),c.restoreSelectionByMarkers(),!1}})},a.Editable.initializers.push(a.Editable.prototype.processURLs)}(jQuery);