mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 235169 - ChatZilla's motifs should style the userlist and other UI elements
r=silver@warwickcompsoc.co.uk (James Ross) ChatZilla Only.
This commit is contained in:
parent
9298f7c632
commit
036e77af27
@ -1084,8 +1084,7 @@ function cmdSync(e)
|
||||
{
|
||||
if (view.prefs["displayHeader"])
|
||||
view.setHeaderState(false);
|
||||
view.changeCSS(view.getFontCSS("data"),
|
||||
"cz-fonts");
|
||||
view.changeCSS(view.getFontCSS("data"), "cz-fonts");
|
||||
if (view.prefs["displayHeader"])
|
||||
view.setHeaderState(true);
|
||||
};
|
||||
@ -1102,6 +1101,7 @@ function cmdSync(e)
|
||||
fun = function ()
|
||||
{
|
||||
view.changeCSS(view.prefs["motif.current"]);
|
||||
updateAppMotif(view.prefs["motif.current"]);
|
||||
// Refresh the motif settings.
|
||||
view.updateMotifSettings();
|
||||
};
|
||||
|
@ -2457,6 +2457,45 @@ function updateSecurityIcon()
|
||||
}
|
||||
}
|
||||
|
||||
function updateAppMotif(motifURL)
|
||||
{
|
||||
var node = document.firstChild;
|
||||
while (node && ((node.nodeType != node.PROCESSING_INSTRUCTION_NODE) ||
|
||||
!(/name="dyn-motif"/).test(node.data)))
|
||||
{
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
motifURL = motifURL.replace(/"/g, "%22");
|
||||
var dataStr = "href=\"" + motifURL + "\" name=\"dyn-motif\"";
|
||||
try
|
||||
{
|
||||
// No dynamic style node yet.
|
||||
if (!node)
|
||||
{
|
||||
node = document.createProcessingInstruction("xml-stylesheet", dataStr);
|
||||
document.insertBefore(node, document.firstChild);
|
||||
}
|
||||
else
|
||||
{
|
||||
node.data = dataStr;
|
||||
}
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd(formatException(ex));
|
||||
var err = ex.name;
|
||||
// Mozilla 1.0 doesn't like document.insertBefore(...,
|
||||
// document.firstChild); though it has a prototype for it -
|
||||
// check for the right error:
|
||||
if (err == "NS_ERROR_NOT_IMPLEMENTED")
|
||||
{
|
||||
display(MSG_NO_DYNAMIC_STYLE, MT_INFO);
|
||||
updateAppMotif = function() {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateNetwork()
|
||||
{
|
||||
var o = getObjectDetails (client.currentObject);
|
||||
@ -2816,6 +2855,9 @@ function setCurrentObject (obj)
|
||||
delete client.activityList[vk];
|
||||
client.deck.selectedIndex = vk;
|
||||
|
||||
// Style userlist and the like:
|
||||
updateAppMotif(obj.prefs["motif.current"]);
|
||||
|
||||
updateTitle();
|
||||
updateProgress();
|
||||
updateSecurityIcon();
|
||||
@ -3142,8 +3184,7 @@ function client_statechange (webProgress, request, stateFlags, status)
|
||||
{
|
||||
cwin.getMsg = getMsg;
|
||||
cwin.initOutputWindow(client, frame.source, onMessageViewClick);
|
||||
cwin.changeCSS(frame.source.getFontCSS("data"),
|
||||
"cz-fonts");
|
||||
cwin.changeCSS(frame.source.getFontCSS("data"), "cz-fonts");
|
||||
scrollDown(frame, true);
|
||||
|
||||
try
|
||||
|
@ -883,6 +883,7 @@ msg.current.css = Using <%S> as default motif.
|
||||
msg.current.css.net = Using <%S> as default motif for this network.
|
||||
msg.current.css.chan = Using <%S> as motif for this channel.
|
||||
msg.current.css.user = Using <%S> as motif for this user.
|
||||
msg.no.dynamic.style = Sorry, but your version of &brandShortName; doesn't support styling the entire application with a motif. This functionality will now be disabled.
|
||||
msg.subscript.loaded = Subscript <%1$S> loaded with result ``%2$S''.
|
||||
msg.user.info = Default nickname, ``%S'', username ``%S'', and description ``%S''.
|
||||
msg.connection.info = "%S: User %S connected via %S:%S (%S server).
|
||||
|
Loading…
Reference in New Issue
Block a user