зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
1c4ebade4c
Коммит
30293e00ad
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче