src/myams/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js
changeset 5 c9c69b13d884
parent 0 f05d7aea098a
--- a/src/myams/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js	Wed Jul 15 15:04:38 2020 +0200
+++ b/src/myams/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js	Wed Jul 15 15:39:56 2020 +0200
@@ -1,1 +1,1 @@
-tinymce.PluginManager.add("autolink",function(d){var a;d.on("keydown",function(g){if(g.keyCode==13){return c(d)}});if(tinymce.Env.ie){d.on("focus",function(){if(!a){a=true;try{d.execCommand("AutoUrlDetect",false,true)}catch(g){}}});return}d.on("keypress",function(g){if(g.keyCode==41){return e(d)}});d.on("keyup",function(g){if(g.keyCode==32){return b(d)}});function e(g){f(g,-1,"(",true)}function b(g){f(g,0,"",true)}function c(g){f(g,-1,"",false)}function f(p,k,h){var g,m,j,v,s,u,n,l,o,t;function i(x,y){if(y<0){y=0}if(x.nodeType==3){var w=x.data.length;if(y>w){y=w}}return y}function r(w,x){if(w.nodeType!=1||w.hasChildNodes()){g.setStart(w,i(w,x))}else{g.setStartBefore(w)}}function q(w,x){if(w.nodeType!=1||w.hasChildNodes()){g.setEnd(w,i(w,x))}else{g.setEndAfter(w)}}g=p.selection.getRng(true).cloneRange();if(g.startOffset<5){l=g.endContainer.previousSibling;if(!l){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling){return}l=g.endContainer.firstChild.nextSibling}o=l.length;r(l,o);q(l,o);if(g.endOffset<5){return}m=g.endOffset;v=l}else{v=g.endContainer;if(v.nodeType!=3&&v.firstChild){while(v.nodeType!=3&&v.firstChild){v=v.firstChild}if(v.nodeType==3){r(v,0);q(v,v.nodeValue.length)}}if(g.endOffset==1){m=2}else{m=g.endOffset-1-k}}j=m;do{r(v,m>=2?m-2:0);q(v,m>=1?m-1:0);m-=1;t=g.toString()}while(t!=" "&&t!==""&&t.charCodeAt(0)!=160&&(m-2)>=0&&t!=h);if(g.toString()==h||g.toString().charCodeAt(0)==160){r(v,m);q(v,j);m+=1}else{if(g.startOffset===0){r(v,0);q(v,j)}else{r(v,m);q(v,j)}}u=g.toString();if(u.charAt(u.length-1)=="."){q(v,j-1)}u=g.toString();n=u.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);if(n){if(n[1]=="www."){n[1]="http://www."}else{if(/@$/.test(n[1])&&!/^mailto:/.test(n[1])){n[1]="mailto:"+n[1]}}s=p.selection.getBookmark();p.selection.setRng(g);p.execCommand("createlink",false,n[1]+n[2]);p.selection.moveToBookmark(s);p.nodeChanged()}}});
\ No newline at end of file
+tinymce.PluginManager.add("autolink",(function(e){var t;function n(e,t,n){var i,o,r,f,d,s,a,l,c,u;function h(e,t){if(t<0&&(t=0),3==e.nodeType){var n=e.data.length;t>n&&(t=n)}return t}function C(e,t){1!=e.nodeType||e.hasChildNodes()?i.setStart(e,h(e,t)):i.setStartBefore(e)}function g(e,t){1!=e.nodeType||e.hasChildNodes()?i.setEnd(e,h(e,t)):i.setEndAfter(e)}if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(C(l,c=l.length),g(l,c),i.endOffset<5)return;o=i.endOffset,f=l}else{if(3!=(f=i.endContainer).nodeType&&f.firstChild){for(;3!=f.nodeType&&f.firstChild;)f=f.firstChild;3==f.nodeType&&(C(f,0),g(f,f.nodeValue.length))}o=1==i.endOffset?2:i.endOffset-1-t}r=o;do{C(f,o>=2?o-2:0),g(f,o>=1?o-1:0),o-=1,u=i.toString()}while(" "!=u&&""!==u&&160!=u.charCodeAt(0)&&o-2>=0&&u!=n);i.toString()==n||160==i.toString().charCodeAt(0)?(C(f,o),g(f,r),o+=1):0===i.startOffset?(C(f,0),g(f,r)):(C(f,o),g(f,r)),"."==(s=i.toString()).charAt(s.length-1)&&g(f,r-1),(a=(s=i.toString()).match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i))&&("www."==a[1]?a[1]="http://www.":/@$/.test(a[1])&&!/^mailto:/.test(a[1])&&(a[1]="mailto:"+a[1]),d=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,a[1]+a[2]),e.selection.moveToBookmark(d),e.nodeChanged())}e.on("keydown",(function(t){if(13==t.keyCode)return function(e){n(e,-1,"")}(e)})),tinymce.Env.ie?e.on("focus",(function(){if(!t){t=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}})):(e.on("keypress",(function(t){if(41==t.keyCode)return function(e){n(e,-1,"(")}(e)})),e.on("keyup",(function(t){if(32==t.keyCode)return function(e){n(e,0,"")}(e)})))}));