]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/ui/theme.js
1 qwebirc
.ui
.themes
.ThemeControlCodeMap
= {
9 qwebirc
.ui
.themes
.Default
= {
10 "PREFIX": ["$C4==$O "],
11 "SIGNON": ["Signed on!", true],
12 "CONNECT": ["Connected to server.", true],
14 "DISCONNECT": ["Disconnected from server: $m", true],
15 "ERROR": ["ERROR: $m", true],
16 "SERVERNOTICE": ["$m", true],
17 "JOIN": ["$n [$h] has joined $c", true],
18 "OURJOIN": ["$n [$h] has joined $c", true],
19 "PART": ["$n [$h] has left $c [$m]", true],
20 "KICK": ["$v was kicked from $c by $n [$m]", true],
21 "MODE": ["mode/$c [$m] by $n", true],
22 "QUIT": ["$n [$h] has quit [$m]", true],
23 "NICK": ["$n has changed nick to $w", true],
24 "TOPIC": ["$n changed the topic of $c to: $m", true],
25 "UMODE": ["MODE $n $m", true],
26 "INVITE": ["$n invites you to join $c", true],
29 "CHANMSG": ["<$z$n$Z> $m"],
30 "PRIVMSG": ["<$z$n$Z> $m"],
31 "CHANNOTICE": ["-$z$n$Z:$c- $m"],
32 "PRIVNOTICE": ["-$z$n$Z- $m"],
33 "OURCHANMSG": ["<$z$n$Z> $m"],
34 "OURPRIVMSG": ["<$z$n$Z> $m"],
35 "OURTARGETEDMSG": ["*$z$t$Z* $m"],
36 "OURTARGETEDNOTICE": ["[notice($z$t$Z)] $m"],
37 "OURCHANNOTICE": ["-$z$n$Z:$t- $m"],
38 "OURPRIVNOTICE": ["-$z$n$Z- $m"],
39 "OURCHANACTION": [" * $z$n$Z $m"],
40 "OURPRIVACTION": [" * $z$n$Z $m"],
41 "CHANACTION": [" * $z$n$Z $m"],
42 "PRIVACTION": [" * $z$n$Z $m"],
43 "CHANCTCP": ["$n [$h] requested CTCP $x from $c: $m"],
44 "PRIVCTCP": ["$n [$h] requested CTCP $x from $-: $m"],
45 "CTCPREPLY": ["CTCP $x reply from $n: $m"],
46 "OURCHANCTCP": ["[ctcp($t)] $x $m"],
47 "OURPRIVCTCP": ["[ctcp($t)] $x $m"],
48 "OURTARGETEDCTCP": ["[ctcp($t)] $x $m"],
49 "WHOISUSER": ["$B$n$B [$h]", true],
50 "WHOISREALNAME": [" realname : $m", true],
51 "WHOISCHANNELS": [" channels : $m", true],
52 "WHOISSERVER": [" server : $x [$m]", true],
53 "WHOISACCOUNT": [" account : qwebirc://qwhois/$m", true],
54 "WHOISIDLE": [" idle : $x [connected: $m]", true],
55 "WHOISAWAY": [" away : $m", true],
56 "WHOISOPER": [" : $BIRC Operator$B", true],
57 "WHOISOPERNAME": [" operedas : $m", true],
58 "WHOISACTUALLY": [" realhost : $m [ip: $x]", true],
59 "WHOISEND": ["End of WHOIS", true],
60 "AWAY": ["$n is away: $m", true],
61 "GENERICERROR": ["$m: $t", true],
62 "GENERICMESSAGE": ["$m", true]
65 qwebirc
.ui
.Theme
= new Class({
66 initialize: function(themeDict
) {
67 this.__theme
= qwebirc
.util
.dictCopy(qwebirc
.ui
.themes
.Default
);
70 for(var k
in themeDict
)
71 this.__theme
[k
] = themeDict
[k
];
73 for(var k
in this.__theme
) {
77 var data
= this.__theme
[k
];
79 this.__theme
[k
] = this.__theme
["PREFIX"] + data
[0];
81 this.__theme
[k
] = data
[0];
85 this.__ccmap
= qwebirc
.util
.dictCopy(qwebirc
.ui
.themes
.ThemeControlCodeMap
);
86 this.__ccmaph
= qwebirc
.util
.dictCopy(this.__ccmap
);
88 this.__ccmap
["z"] = "";
89 this.__ccmap
["Z"] = "";
91 this.__ccmaph
["z"] = this.message("HILIGHT", {}, this.__ccmap
);
92 this.__ccmaph
["Z"] = this.message("HILIGHTEND", {}, this.__ccmap
);
94 __dollarSubstitute: function(x
, h
, mapper
) {
98 for(var i
=0;i
<n
.length
;i
++) {
100 if(c
== "$" && (i
<= n
.length
- 1)) {
115 message: function(type
, data
, hilight
) {
122 return this.__dollarSubstitute(this.__theme
[type
], data
, map
);