From 552cdea1cf99f3a962e242fe49a70a6de41397c2 Mon Sep 17 00:00:00 2001
From: Brian Ronald <b.ronald@connexions-tw.co.uk>
Date: Wed, 09 May 2012 05:31:47 -0400
Subject: [PATCH] Change version text to reflect new versioning system

---
 program/js/tiny_mce/plugins/autolink/editor_plugin_src.js |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
index 604da8b..2dd4c69 100644
--- a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
@@ -22,15 +22,15 @@
 	init : function(ed, url) {
 		var t = this;
 
-		// Internet Explorer has built-in automatic linking
-		if (tinyMCE.isIE)
-			return;
-
 		// Add a key down handler
-		ed.onKeyDown.add(function(ed, e) {
+		ed.onKeyDown.addToTop(function(ed, e) {
 			if (e.keyCode == 13)
 				return t.handleEnter(ed);
-			});
+		});
+
+		// Internet Explorer has built-in automatic linking for most cases
+		if (tinyMCE.isIE)
+			return;
 
 		ed.onKeyPress.add(function(ed, e) {
 			if (e.which == 41)
@@ -125,11 +125,13 @@
 			}
 
 			text = r.toString();
-			matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i);
+			matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);
 
 			if (matches) {
 				if (matches[1] == 'www.') {
 					matches[1] = 'http://www.';
+				} else if (/@$/.test(matches[1])) {
+					matches[1] = 'mailto:' + matches[1];
 				}
 
 				bookmark = ed.selection.getBookmark();

--
Gitblit v1.9.1