Bug 237473 - Add linking-fu for Bugzilla alias names.

ChatZilla only.
r=samuel
p=gijskruitbosch+bugs@gmail.com (Gijs Kruitbosch)
This commit is contained in:
silver%warwickcompsoc.co.uk 2005-11-19 22:39:21 +00:00
parent b968683bbd
commit 3cb5daa002
2 changed files with 4 additions and 3 deletions

View File

@ -861,7 +861,7 @@ function insertChannelLink (matchText, containerTag, eventData)
function insertBugzillaLink (matchText, containerTag, eventData)
{
var number = matchText.match (/(\d+)/)[1];
var idOrAlias = matchText.match(/bug\s+#?(\d{3,6}|[^\s,]{1,20})/)[1];
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
"html:a");
@ -874,7 +874,7 @@ function insertBugzillaLink (matchText, containerTag, eventData)
else
bugURL = client.prefs["bugURL"];
anchor.setAttribute ("href", bugURL.replace("%s", number));
anchor.setAttribute ("href", bugURL.replace("%s", idOrAlias));
anchor.setAttribute ("class", "chatzilla-link");
anchor.setAttribute ("target", "_content");
insertHyphenatedWord (matchText, anchor);

View File

@ -78,7 +78,8 @@ function initMunger()
munger.addRule ("mailto",
/(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s\u201d]+@[^.<>\[\]()\'\"\s\u201d]+\.[^<>\[\]()\'\"\s\u201d]+)/i,
insertMailToLink);
munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+#?\d{3,6})/i,
munger.addRule ("bugzilla-link",
/(?:\s|\W|^)(bug\s+(?:#?\d{3,6}|#[^\s,]{1,20}))/i,
insertBugzillaLink);
munger.addRule ("channel-link",
/(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i,