mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
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:
parent
b968683bbd
commit
3cb5daa002
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user