]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/ui/theme.js
1 qwebirc
.ui
.themes
.ThemeControlCodeMap
= {
8 "[": "qwebirc://whois/",
13 qwebirc
.ui
.themes
.Default
= {
14 "PREFIX": ["$C4==$O "],
15 "SIGNON": ["Signed on!", true],
16 "CONNECTING": ["Connecting to server, please wait...", true],
17 "CONNECT": ["Logging in, please wait...", true],
18 "CONNECTED": ["Connected and logged in -- ready to go!", true],
20 "DISCONNECT": ["Disconnected from server: $m", true],
21 "ERROR": ["ERROR: $m", true],
22 "SERVERNOTICE": ["$m", true],
23 "JOIN": ["${$N$} [$h] has joined $c", true],
24 "OURJOIN": ["${$N$} [$h] has joined $c", true],
25 "PART": ["${$N$} [$h] has left $c [$m]", true],
26 "KICK": ["${$v$} was kicked from $c by ${$N$} [$m]", true],
27 "MODE": ["mode/$c [$m] by ${$N$}", true],
28 "QUIT": ["${$N$} [$h] has quit [$m]", true],
29 "NICK": ["${$n$} has changed nick to ${$[$w$]$}", true],
30 "TOPIC": ["${$N$} changed the topic of $c to: $m", true],
31 "UMODE": ["Usermode change: $m", true],
32 "INVITE": ["$N invites you to join $c", true],
35 "CHANMSG": ["<$C14$@$O${$($N$)$}> $m"],
36 "PRIVMSG": ["<$($N$)> $m"],
37 "CHANNOTICE": ["-${$($N$)$}:$c- $m"],
38 "PRIVNOTICE": ["-$($N$)- $m"],
39 "OURCHANMSG": ["<$C14$@$O$U$N$O> $m"],
40 "OURPRIVMSG": ["<$U$N$O> $m"],
41 "OURTARGETEDMSG": ["*$[$t$]* $m"],
42 "OURTARGETEDNOTICE": ["[notice($[$t$])] $m"],
43 "OURCHANNOTICE": ["-$N:$t- $m"],
44 "OURPRIVNOTICE": ["-$N- $m"],
45 "OURCHANACTION": [" * $U$N$O $m"],
46 "OURPRIVACTION": [" * $U$N$O $m"],
47 "CHANACTION": [" * ${$($N$)$} $m"],
48 "PRIVACTION": [" * $($N$) $m"],
49 "CHANCTCP": ["$N [$h] requested CTCP $x from $c: $m"],
50 "PRIVCTCP": ["$N [$h] requested CTCP $x from $-: $m"],
51 "CTCPREPLY": ["CTCP $x reply from $N: $m"],
52 "OURCHANCTCP": ["[ctcp($t)] $x $m"],
53 "OURPRIVCTCP": ["[ctcp($t)] $x $m"],
54 "OURTARGETEDCTCP": ["[ctcp($t)] $x $m"],
55 "WHOISUSER": ["$B$N$B [$h]", true],
56 "WHOISREALNAME": [" realname : $m", true],
57 "WHOISCHANNELS": [" channels : $m", true],
58 "WHOISSERVER": [" server : $x [$m]", true],
59 "WHOISACCOUNT": [" account : qwebirc://qwhois/$m", true],
60 "WHOISIDLE": [" idle : $x [connected: $m]", true],
61 "WHOISAWAY": [" away : $m", true],
62 "WHOISOPER": [" : $BIRC Operator$B", true],
63 "WHOISOPERNAME": [" operedas : $m", true],
64 "WHOISACTUALLY": [" realhost : $m [ip: $x]", true],
65 "WHOISGENERICTEXT": [" : $m", true],
66 "WHOISEND": ["End of WHOIS", true],
67 "AWAY": ["$N is away: $m", true],
68 "GENERICERROR": ["$m: $t", true],
69 "GENERICMESSAGE": ["$m", true],
70 "WALLOPS": ["WALLOP $n: $t", true],
71 "CHANNELCREATIONTIME": ["Channel $c was created at: $m", true],
72 "CHANNELMODEIS": ["Channel modes on $c are: $m", true],
73 "IGNORED": ["Ignored $n, to unignore type: /UNIGNORE $n", false],
74 "UNIGNORED": ["Unignored $n.", false],
75 "IGNOREHEADER": ["Ignore list:", false],
76 "IGNOREENTRY": ["- $h", false],
77 "IGNOREEMPTY": ["Ignore list is empty.", false],
78 "SILENCE": ["Silenced: $h", false],
80 "NOTIFYCHANMSGTITLE": ["Mentioned on $c:", false],
81 "NOTIFYCHANMSGBODY": ["<$@$n> $m", false],
82 "NOTIFYCHANACTIONTITLE": ["Mentioned on $c:", false],
83 "NOTIFYCHANACTIONBODY": [" * $n $m", false],
84 "NOTIFYPRIVMSGTITLE": ["Private message from $n:", false],
85 "NOTIFYPRIVMSGBODY": ["$m", false],
86 "NOTIFYPRIVACTIONTITLE": ["Private message from $n:", false],
87 "NOTIFYPRIVACTIONBODY": [" * $n $m", false],
88 "NOTIFYCHANNOTICETITLE": ["Mentioned on $c:", false],
89 "NOTIFYCHANNOTICEBODY": ["-$n- $m", false],
90 "NOTIFYPRIVNOTICETITLE": ["Private notice from $n:", false],
91 "NOTIFYPRIVNOTICEBODY": ["$m", false]
94 qwebirc
.ui
.Theme
= new Class({
95 initialize: function(themeDict
) {
96 this.__theme
= qwebirc
.util
.dictCopy(qwebirc
.ui
.themes
.Default
);
99 for(var k
in themeDict
)
100 this.__theme
[k
] = themeDict
[k
];
102 for(var k
in this.__theme
) {
106 var data
= this.__theme
[k
];
108 this.__theme
[k
] = this.__theme
["PREFIX"] + data
[0];
110 this.__theme
[k
] = data
[0];
114 this.__ccmap
= qwebirc
.util
.dictCopy(qwebirc
.ui
.themes
.ThemeControlCodeMap
);
115 this.__ccmaph
= qwebirc
.util
.dictCopy(this.__ccmap
);
117 this.__ccmaph
["("] = this.message("HILIGHT", {}, this.__ccmap
);
118 this.__ccmaph
[")"] = this.message("HILIGHTEND", {}, this.__ccmap
);
119 this.__ccmaph
["{"] = this.__ccmaph
["}"] = "";
121 __dollarSubstitute: function(x
, h
, mapper
) {
125 for(var i
=0;i
<n
.length
;i
++) {
127 if(c
== "$" && (i
<= n
.length
- 1)) {
142 message: function(type
, data
, hilight
) {
150 if(data
&& data
["n"])
151 data
["N"] = "qwebirc://whois/" + data
.n
+ "/";
152 return this.__dollarSubstitute(this.__theme
[type
], data
, map
);