| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/autolink.tar |
plugin.min.js 0000604 00000004014 15245611100 0007150 0 ustar 00 tinymce.PluginManager.add("autolink",function(e){function t(e){i(e,-1,"(",!0)}function n(e){i(e,0,"",!0)}function r(e){i(e,-1,"",!1)}function i(e,t,n){function r(e,t){if(t<0&&(t=0),3==e.nodeType){var n=e.data.length;t>n&&(t=n)}return t}function i(e,t){1!=e.nodeType||e.hasChildNodes()?s.setStart(e,r(e,t)):s.setStartBefore(e)}function o(e,t){1!=e.nodeType||e.hasChildNodes()?s.setEnd(e,r(e,t)):s.setEndAfter(e)}var s,l,c,u,d,f,p,m,g,h;if("A"!=e.selection.getNode().tagName){if(s=e.selection.getRng(!0).cloneRange(),s.startOffset<5){if(m=s.endContainer.previousSibling,!m){if(!s.endContainer.firstChild||!s.endContainer.firstChild.nextSibling)return;m=s.endContainer.firstChild.nextSibling}if(g=m.length,i(m,g),o(m,g),s.endOffset<5)return;l=s.endOffset,u=m}else{if(u=s.endContainer,3!=u.nodeType&&u.firstChild){for(;3!=u.nodeType&&u.firstChild;)u=u.firstChild;3==u.nodeType&&(i(u,0),o(u,u.nodeValue.length))}l=1==s.endOffset?2:s.endOffset-1-t}c=l;do i(u,l>=2?l-2:0),o(u,l>=1?l-1:0),l-=1,h=s.toString();while(" "!=h&&""!==h&&160!=h.charCodeAt(0)&&l-2>=0&&h!=n);s.toString()==n||160==s.toString().charCodeAt(0)?(i(u,l),o(u,c),l+=1):0===s.startOffset?(i(u,0),o(u,c)):(i(u,l),o(u,c)),f=s.toString(),"."==f.charAt(f.length-1)&&o(u,c-1),f=s.toString(),p=f.match(a),p&&("www."==p[1]?p[1]="http://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),d=e.selection.getBookmark(),e.selection.setRng(s),e.execCommand("createlink",!1,p[1]+p[2]),e.settings.default_link_target&&e.dom.setAttrib(e.selection.getNode(),"target",e.settings.default_link_target),e.selection.moveToBookmark(d),e.nodeChanged())}}var o,a=/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;return e.settings.autolink_pattern&&(a=e.settings.autolink_pattern),e.on("keydown",function(t){if(13==t.keyCode)return r(e)}),tinymce.Env.ie?void e.on("focus",function(){if(!o){o=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(e.on("keypress",function(n){if(41==n.keyCode)return t(e)}),void e.on("keyup",function(t){if(32==t.keyCode)return n(e)}))}); plugin.js 0000604 00000011141 15246310506 0006374 0 ustar 00 /* jce - 2.9.99.2 | 2026-04-22 | https://www.joomlacontenteditor.net | Source: https://github.com/widgetfactory/jce | Copyright (C) 2006 - 2026 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */
!function() {
var AutoLinkPattern = /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;
tinymce.PluginManager.add("autolink", function(ed, url) {
function parseCurrentLine(editor, endOffset, delimiter) {
var rng, end, endContainer, len, rngText, prev;
function scopeIndex(container, index) {
return index < 0 && (index = 0), index = 3 == container.nodeType && (container = container.data.length) < index ? container : index;
}
function setStart(container, offset) {
1 != container.nodeType || container.hasChildNodes() ? rng.setStart(container, scopeIndex(container, offset)) : rng.setStartBefore(container);
}
function setEnd(container, offset) {
1 != container.nodeType || container.hasChildNodes() ? rng.setEnd(container, scopeIndex(container, offset)) : rng.setEndAfter(container);
}
if ("A" != editor.selection.getNode().tagName) {
if ((rng = editor.selection.getRng(!0).cloneRange()).startOffset < 5) {
if (!(prev = rng.endContainer.previousSibling)) {
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) return;
prev = rng.endContainer.firstChild.nextSibling;
}
if (setStart(prev, len = prev.length), setEnd(prev, len), rng.endOffset < 5) return;
end = rng.endOffset, endContainer = prev;
} else {
if (3 != (endContainer = rng.endContainer).nodeType && endContainer.firstChild) {
for (;3 != endContainer.nodeType && endContainer.firstChild; ) endContainer = endContainer.firstChild;
3 == endContainer.nodeType && (setStart(endContainer, 0),
setEnd(endContainer, endContainer.nodeValue.length));
}
end = 1 == rng.endOffset ? 2 : rng.endOffset - 1 - endOffset;
}
for (len = end; setStart(endContainer, 2 <= end ? end - 2 : 0),
setEnd(endContainer, 1 <= end ? end - 1 : 0), --end, " " != (rngText = rng.toString()) && "" !== rngText && 160 != rngText.charCodeAt(0) && 0 <= end - 2 && rngText != delimiter; );
rng.toString() == delimiter || 160 == rng.toString().charCodeAt(0) ? (setStart(endContainer, end),
setEnd(endContainer, len), end += 1) : (0 === rng.startOffset ? setStart(endContainer, 0) : setStart(endContainer, end),
setEnd(endContainer, len)), "." == (prev = rng.toString()).charAt(prev.length - 1) && setEnd(endContainer, len - 1),
(endOffset = (prev = rng.toString()).match(AutoLinkPattern)) && ("www." == endOffset[1] ? endOffset[1] = "https://www." : /@$/.test(endOffset[1]) && !/^mailto:/.test(endOffset[1]) && (endOffset[1] = "mailto:" + endOffset[1]),
-1 !== endOffset[1].indexOf("http") && !editor.getParam("autolink_url", !0) || -1 !== endOffset[1].indexOf("mailto:") && !editor.getParam("autolink_email", !0) || (len = editor.selection.getBookmark(),
editor.selection.setRng(rng), editor.execCommand("createlink", !1, endOffset[1] + endOffset[2]),
prev = editor.selection.getNode(), editor.settings.default_link_target && editor.dom.setAttrib(prev, "target", editor.settings.default_link_target),
editor.onAutoLink.dispatch(editor, {
node: prev
}), editor.selection.moveToBookmark(len), editor.nodeChanged()));
}
}
(ed.getParam("autolink_url", !0) || ed.getParam("autolink_email", !0)) && (ed.settings.autolink_pattern && (AutoLinkPattern = ed.settings.autolink_pattern),
ed.onAutoLink = new tinymce.util.Dispatcher(this), ed.onKeyDown.addToTop(function(ed, e) {
if (13 == e.keyCode) return function(ed) {
parseCurrentLine(ed, -1, "");
}(ed);
}), tinymce.isIE || (ed.onKeyPress.add(function(ed, e) {
if (41 == e.which) return function(ed) {
parseCurrentLine(ed, -1, "(");
}(ed);
}), ed.onKeyUp.add(function(ed, e) {
if (32 == e.keyCode) return function(ed) {
parseCurrentLine(ed, 0, "");
}(ed);
})));
});
}();