Bug 319628 - Talkback IDs should be linked, munger prefs should apply without restart.

ChatZilla only.
r=silver
This commit is contained in:
gijskruitbosch%gmail.com 2006-02-03 18:51:24 +00:00
parent c9662bfe8c
commit d7e1c742f8
4 changed files with 27 additions and 0 deletions

View File

@ -185,6 +185,7 @@ function initPrefs()
["munger.mailto", true, "munger"],
["munger.quote", true, "munger"],
["munger.rheet", true, "munger"],
["munger.talkback-link", true, "munger"],
["munger.teletype", true, "munger"],
["munger.underline", true, "munger"],
["munger.word-hyphenator", true, "munger"],
@ -738,6 +739,14 @@ function onPrefChanged(prefName, newValue, oldValue)
case "aliases":
initAliases();
break;
default:
// Make munger prefs apply without a restart
if ((m = prefName.match(/^munger\.(\S+)$/))
&& (m[1] in client.munger.entries))
{
client.munger.entries[m[1]].enabled = newValue;
}
}
}

View File

@ -1025,6 +1025,19 @@ function insertChannelLink (matchText, containerTag, eventData)
containerTag.appendChild (anchor);
}
function insertTalkbackLink(matchText, containerTag, eventData)
{
var anchor = document.createElementNS("http://www.w3.org/1999/xhtml",
"html:a");
anchor.setAttribute("href", "http://talkback-public.mozilla.org/" +
"talkback/fastfind.jsp?search=2&type=iid&id=" +
matchText);
anchor.setAttribute("class", "chatzilla-link");
insertHyphenatedWord(matchText, anchor);
containerTag.appendChild(anchor);
}
function insertBugzillaLink (matchText, containerTag, eventData)
{
var idOrAlias = matchText.match(/bug\s+#?(\d{3,6}|[^\s,]{1,20})/i)[1];

View File

@ -84,6 +84,8 @@ function initMunger()
munger.addRule ("channel-link",
/(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i,
insertChannelLink);
munger.addRule("talkback-link", /(?:\W|^)(TB\d+[A-Z]?)(?:\W|$)/,
insertTalkbackLink);
munger.addRule ("face",
/((^|\s)(?:[>]?[B8=:;(xX][~']?[-^v"]?(?:[)|(PpSs0oO\?\[\]\/\\]|D+)|>[-^v]?\)|[oO9][._][oO9])(\s|$))/,

View File

@ -1220,6 +1220,7 @@ munger.quote=Double Quotes
munger.rheet=Rheet
munger.bold=Bold
munger.italic=Italic
munger.talkback-link=Talkback link
munger.teletype=Teletype
munger.underline=Underline
munger.ctrl-char=Control Chars
@ -1373,6 +1374,8 @@ pref.munger.quote.label = Neater quotes
pref.munger.quote.help = Makes Chatzilla replace `` with \u201C and '' with \u201D.
pref.munger.rheet.label = Rheet
pref.munger.rheet.help = Makes Chatzilla hyperlink "rheet": a very Mozilla.org-centric feature.
pref.munger.talkback-link.label = Talkback links
pref.munger.talkback-link.help = Makes Chatzilla hyperlink "TB<numbers><character>" to the specified talkback stack trace.
pref.munger.teletype.label = Teletype
pref.munger.teletype.help = Makes Chatzilla display |teletype| actually in teletype (a fixed-width font).
pref.munger.underline.label = Underline