Commit 0e8c4f82 by Robb Hamilton

Decoration links with a target with fa-external-link

parent 0bb95e29
...@@ -2217,7 +2217,7 @@ angular.module("openshiftCommonUI") ...@@ -2217,7 +2217,7 @@ angular.module("openshiftCommonUI")
// Replace any URLs with links. // Replace any URLs with links.
return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) { return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) {
if (target) { if (target) {
return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + "</a>"; return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + " <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>";
} }
return "<a href=\"" + str + "\">" + str + "</a>"; return "<a href=\"" + str + "\">" + str + "</a>";
......
...@@ -5920,7 +5920,7 @@ angular.module("openshiftCommonUI") ...@@ -5920,7 +5920,7 @@ angular.module("openshiftCommonUI")
// Replace any URLs with links. // Replace any URLs with links.
return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) { return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) {
if (target) { if (target) {
return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + "</a>"; return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + " <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>";
} }
return "<a href=\"" + str + "\">" + str + "</a>"; return "<a href=\"" + str + "\">" + str + "</a>";
......
...@@ -2631,7 +2631,7 @@ return !0; ...@@ -2631,7 +2631,7 @@ return !0;
}, },
linkify:function(text, target, alreadyEscaped) { linkify:function(text, target, alreadyEscaped) {
return text ? (alreadyEscaped || (text = _.escape(text)), text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) { return text ? (alreadyEscaped || (text = _.escape(text)), text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) {
return target ? '<a href="' + str + '" target="' + target + '">' + str + "</a>" :'<a href="' + str + '">' + str + "</a>"; return target ? '<a href="' + str + '" target="' + target + '">' + str + ' <i class="fa fa-external-link" aria-hidden="true"></i></a>' :'<a href="' + str + '">' + str + "</a>";
})) :text; })) :text;
} }
}; };
......
...@@ -102,7 +102,7 @@ angular.module("openshiftCommonUI") ...@@ -102,7 +102,7 @@ angular.module("openshiftCommonUI")
// Replace any URLs with links. // Replace any URLs with links.
return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) { return text.replace(/https?:\/\/[A-Za-z0-9._%+-]+\S*[^\s.;,(){}<>"\u201d\u2019]/gm, function(str) {
if (target) { if (target) {
return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + "</a>"; return "<a href=\"" + str + "\" target=\"" + target + "\">" + str + " <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>";
} }
return "<a href=\"" + str + "\">" + str + "</a>"; return "<a href=\"" + str + "\">" + str + "</a>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment