src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js
changeset 557 bca7a7e058a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/plugins/autolink/plugin.min.js	Thu Feb 13 11:43:31 2020 +0100
@@ -0,0 +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