]>
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],
27 "CHANMSG": ["<$n> $m"],
28 "PRIVMSG": ["<$n> $m"],
29 "CHANNOTICE": ["-$n:$c- $m"],
30 "PRIVNOTICE": ["-$n- $m"],
31 "OURCHANMSG": ["<$n> $m"],
32 "OURPRIVMSG": ["<$n> $m"],
33 "OURTARGETEDMSG": ["*$t* $m"],
34 "OURTARGETEDNOTICE": ["[notice($t)] $m"],
35 "OURCHANNOTICE": ["-$n:$t- $m"],
36 "OURPRIVNOTICE": ["-$n- $m"],
37 "OURCHANACTION": [" * $n $m"],
38 "OURPRIVACTION": [" * $n $m"],
39 "CHANACTION": [" * $n $m"],
40 "PRIVACTION": [" * $n $m"],
41 "CHANCTCP": ["$n [$h] requested CTCP $x from $c: $m"],
42 "PRIVCTCP": ["$n [$h] requested CTCP $x from $-: $m"],
43 "CTCPREPLY": ["CTCP $x reply from $n: $m"],
44 "OURCHANCTCP": ["[ctcp($t)] $x $m"],
45 "OURPRIVCTCP": ["[ctcp($t)] $x $m"],
46 "OURTARGETEDCTCP": ["[ctcp($t)] $x $m"],
47 "WHOISUSER": ["$B$n$B [$h]", true],
48 "WHOISREALNAME": [" realname : $m", true],
49 "WHOISCHANNELS": [" channels : $m", true],
50 "WHOISSERVER": [" server : $x [$m]", true],
51 "WHOISACCOUNT": [" account : qwebirc://qwhois/$m", true],
52 "WHOISIDLE": [" idle : $x [connected: $m]", true],
53 "WHOISAWAY": [" away : $m", true],
54 "WHOISOPER": [" : $BIRC Operator$B", true],
55 "WHOISOPERNAME": [" operedas : $m", true],
56 "WHOISACTUALLY": [" realhost : $m [ip: $x]", true],
57 "WHOISEND": ["End of WHOIS", true],
58 "AWAY": ["$n is away: $m", true],
59 "WHOISNOSUCHNICK": ["No such nick: $n", true]
62 qwebirc
.ui
.Theme
= new Class({
63 initialize: function(themeDict
) {
66 for(var k
in qwebirc
.ui
.themes
.Default
)
67 this.__theme
[k
] = qwebirc
.ui
.themes
.Default
[k
];
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 __dollarSubstitute: function(x
, h
) {
89 for(var i
=0;i
<n
.length
;i
++) {
91 if(c
== "$" && (i
<= n
.length
- 1)) {
94 var o
= qwebirc
.ui
.themes
.ThemeControlCodeMap
[c2
];
106 message: function(type
, data
) {
107 var msg
= this.__theme
[type
];
109 msg
= this.__dollarSubstitute(msg
, data
);