Compare commits
1393 Commits
CHATZILLA_
...
NETSCAPE_7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c148d97e6a | ||
|
|
384b279496 | ||
|
|
1811c2387a | ||
|
|
e6ae73f9f0 | ||
|
|
d5031a8aef | ||
|
|
95d0d37196 | ||
|
|
74cab2329e | ||
|
|
0dedc35ab2 | ||
|
|
f2278f43c8 | ||
|
|
a3ec84f29e | ||
|
|
272f0cdff1 | ||
|
|
4e45b1229b | ||
|
|
677515217e | ||
|
|
b024b7b966 | ||
|
|
e426696a61 | ||
|
|
353c943969 | ||
|
|
c7f4d2143b | ||
|
|
ae544884a8 | ||
|
|
bac8a2e954 | ||
|
|
264bed2362 | ||
|
|
8aa8ecf518 | ||
|
|
771dce7edb | ||
|
|
349f4a6b8d | ||
|
|
9dabd83bf4 | ||
|
|
45a622cb72 | ||
|
|
ca8249f841 | ||
|
|
00ce8402e3 | ||
|
|
66342c6a59 | ||
|
|
5d25e03a26 | ||
|
|
69b31d008b | ||
|
|
d59df3769a | ||
|
|
4f6ada6fdd | ||
|
|
e3de493e7f | ||
|
|
79e2c79078 | ||
|
|
353ffb4a99 | ||
|
|
4b444ea78d | ||
|
|
2c47e8bf69 | ||
|
|
68d49e4a49 | ||
|
|
148c6b76df | ||
|
|
241692a655 | ||
|
|
43be988a2e | ||
|
|
d95ca38926 | ||
|
|
59ad949615 | ||
|
|
e1d31b52f2 | ||
|
|
122962f241 | ||
|
|
ec4d65f5e9 | ||
|
|
3a35be5840 | ||
|
|
918de790d5 | ||
|
|
b588ad7abb | ||
|
|
6d2beab5f0 | ||
|
|
484c0bffbf | ||
|
|
d093302786 | ||
|
|
454a094105 | ||
|
|
3dd881e4eb | ||
|
|
e9685da5ad | ||
|
|
d550f7da85 | ||
|
|
b18105a673 | ||
|
|
b8e0da4c99 | ||
|
|
cebbf97ddf | ||
|
|
c3e6ac982b | ||
|
|
4d3789a510 | ||
|
|
cac9370e7e | ||
|
|
7e6052e43a | ||
|
|
5c9f6ba852 | ||
|
|
adc5ea66d1 | ||
|
|
f6a2d615ee | ||
|
|
935bccd809 | ||
|
|
11fe7c9c82 | ||
|
|
8dc8007734 | ||
|
|
52510b1a61 | ||
|
|
4136782b8e | ||
|
|
16bf0837e9 | ||
|
|
ee1c750ef3 | ||
|
|
24582d244c | ||
|
|
15600e9cc9 | ||
|
|
e2be3f623e | ||
|
|
360da12882 | ||
|
|
45232b694d | ||
|
|
11557cd4cd | ||
|
|
af1ab5cd9a | ||
|
|
1b3ae36bfa | ||
|
|
8b33852684 | ||
|
|
e695b6ea1b | ||
|
|
bd34e4a9a6 | ||
|
|
902c609a39 | ||
|
|
e6ce4cecd3 | ||
|
|
1dd6ca0bf2 | ||
|
|
38307cf9a3 | ||
|
|
2dbf05edde | ||
|
|
dc7f020878 | ||
|
|
ef3496fef8 | ||
|
|
f2b5f60354 | ||
|
|
6d7c54437c | ||
|
|
640a950f34 | ||
|
|
5cec851236 | ||
|
|
26c36cf57f | ||
|
|
f2042f5fed | ||
|
|
411f2bcd84 | ||
|
|
7dbf267463 | ||
|
|
384e1cac18 | ||
|
|
2aed97ba78 | ||
|
|
193e733bfc | ||
|
|
fa426c3455 | ||
|
|
72e5b38215 | ||
|
|
3a8a360848 | ||
|
|
73fe2c170b | ||
|
|
1500211a00 | ||
|
|
f510f3c40f | ||
|
|
79241cbf70 | ||
|
|
4722528d28 | ||
|
|
ad609ac775 | ||
|
|
854492cb27 | ||
|
|
bc9da123c9 | ||
|
|
57c1713df6 | ||
|
|
f7e01beec6 | ||
|
|
fdeb12057d | ||
|
|
8622949487 | ||
|
|
c8a3883144 | ||
|
|
615ded5cba | ||
|
|
53fbb8a4ab | ||
|
|
dd4a48af0d | ||
|
|
334bb84b34 | ||
|
|
6ea542727d | ||
|
|
2c819ea8fa | ||
|
|
8276dd65a0 | ||
|
|
f59687321c | ||
|
|
51cafd0876 | ||
|
|
b200f2abe5 | ||
|
|
99cd8efa51 | ||
|
|
71a1b018b2 | ||
|
|
3adbf31222 | ||
|
|
79c43413c5 | ||
|
|
234d339b8f | ||
|
|
1ea10514a6 | ||
|
|
1377350cdc | ||
|
|
a07b2410b5 | ||
|
|
66b816aec1 | ||
|
|
a5499898ab | ||
|
|
fb6cf5001c | ||
|
|
c06c1c81c1 | ||
|
|
7379db6d0f | ||
|
|
8dfd0be2f4 | ||
|
|
d31db38e1b | ||
|
|
c7e7547ac6 | ||
|
|
07cd809b3c | ||
|
|
c63941f459 | ||
|
|
447244b1b8 | ||
|
|
da5dcb0a53 | ||
|
|
5381e01d9e | ||
|
|
9a8046b3bc | ||
|
|
6c82147405 | ||
|
|
723215b09c | ||
|
|
bbb08f932f | ||
|
|
aaccceee2b | ||
|
|
ba88c2a01f | ||
|
|
f8ecb38366 | ||
|
|
8f768a393f | ||
|
|
b41feead2f | ||
|
|
0c65f033df | ||
|
|
fb016f49df | ||
|
|
c8176f72e4 | ||
|
|
4ac1389355 | ||
|
|
82aaad64fd | ||
|
|
27b63a8651 | ||
|
|
3c9a1c48a9 | ||
|
|
9e81647dfb | ||
|
|
c02c587d59 | ||
|
|
59abfcd74a | ||
|
|
8a9fe70b5f | ||
|
|
287eecfb21 | ||
|
|
47ab7a80c9 | ||
|
|
8210c82fbf | ||
|
|
ccfd0b4ed3 | ||
|
|
9f7559c26f | ||
|
|
96af7cd26d | ||
|
|
365c00df70 | ||
|
|
ff19348c83 | ||
|
|
3dcf34cddb | ||
|
|
461e0fabb2 | ||
|
|
ab6df0d151 | ||
|
|
bfb453b032 | ||
|
|
96d04c8a88 | ||
|
|
8138f9f75d | ||
|
|
253808b572 | ||
|
|
838efbaffc | ||
|
|
d0dc76f1cd | ||
|
|
d784760253 | ||
|
|
4ecba27f46 | ||
|
|
737a2983d9 | ||
|
|
8988f6da45 | ||
|
|
f21b437b1c | ||
|
|
d3e6e4734a | ||
|
|
66853862b5 | ||
|
|
3b36f91f6d | ||
|
|
8a6110386c | ||
|
|
9c664d18c0 | ||
|
|
9d6f298def | ||
|
|
3555d6cf63 | ||
|
|
9148e88703 | ||
|
|
29313725bb | ||
|
|
1ca5f2df20 | ||
|
|
c103108810 | ||
|
|
5ca9ccb8b5 | ||
|
|
05118109bc | ||
|
|
ee2f062637 | ||
|
|
6fb5cd2313 | ||
|
|
cf00b52da2 | ||
|
|
8023d5b6a3 | ||
|
|
3caa15fea0 | ||
|
|
51a8ec8ac7 | ||
|
|
2a8076c485 | ||
|
|
90d90b777c | ||
|
|
d027b325ef | ||
|
|
148c919829 | ||
|
|
17ce578faa | ||
|
|
654d90b6b8 | ||
|
|
92f366df0e | ||
|
|
859b9bf284 | ||
|
|
ce0af0ef4e | ||
|
|
8bbe93efd9 | ||
|
|
25b4c3389a | ||
|
|
06d700b8d4 | ||
|
|
639474a89e | ||
|
|
ce1e3c03b5 | ||
|
|
239db03a1d | ||
|
|
9dcf945f94 | ||
|
|
098a6b94b7 | ||
|
|
fb6cc8e082 | ||
|
|
b3b11437a8 | ||
|
|
306252b88f | ||
|
|
3e3feeebb2 | ||
|
|
ef5e271ffd | ||
|
|
71eb38c4d9 | ||
|
|
e23dff8f91 | ||
|
|
3d08029c45 | ||
|
|
6a02131f6c | ||
|
|
4df00a3088 | ||
|
|
e6af590601 | ||
|
|
44d41aa222 | ||
|
|
93b7ef8f0c | ||
|
|
5ada44a604 | ||
|
|
f1e23fb653 | ||
|
|
10ecd2cb1c | ||
|
|
62eda89c24 | ||
|
|
c1df55f01b | ||
|
|
8ee6840c00 | ||
|
|
1fdfd53ba4 | ||
|
|
4cc53df442 | ||
|
|
3e06338d30 | ||
|
|
5ec9d0dafa | ||
|
|
6c54fb56fc | ||
|
|
608973612d | ||
|
|
10ce09d738 | ||
|
|
a92f30d9c3 | ||
|
|
88346339f0 | ||
|
|
77698771ed | ||
|
|
ff93b8dcda | ||
|
|
be0bcee8f3 | ||
|
|
f5057e6483 | ||
|
|
09049016ea | ||
|
|
eafd14d1f0 | ||
|
|
6033805e92 | ||
|
|
2b5c8e9cbd | ||
|
|
58e659e1e9 | ||
|
|
46d05f5f74 | ||
|
|
f3996f782c | ||
|
|
2d45da0f14 | ||
|
|
8c8adeec08 | ||
|
|
9371bccc37 | ||
|
|
a1f63a989a | ||
|
|
49ac50f0c2 | ||
|
|
e1b79228fa | ||
|
|
d9a050b6c1 | ||
|
|
0335eb8910 | ||
|
|
204e2b5863 | ||
|
|
a0bc28a6f0 | ||
|
|
20f52a464a | ||
|
|
99e1cc2ee7 | ||
|
|
7a453fda9c | ||
|
|
42936b4b40 | ||
|
|
ff1b8f2964 | ||
|
|
15ab5b9a2e | ||
|
|
c374ea8952 | ||
|
|
f97c54d160 | ||
|
|
f07bfa94eb | ||
|
|
c64b227676 | ||
|
|
8176e540c2 | ||
|
|
a025d90adb | ||
|
|
48933113ab | ||
|
|
99dd57db43 | ||
|
|
4656a50b00 | ||
|
|
27d41038fa | ||
|
|
08fcc4efa9 | ||
|
|
1c43d58ca0 | ||
|
|
d35f1c396d | ||
|
|
6798a8a496 | ||
|
|
073f0dcac1 | ||
|
|
e54f9a1948 | ||
|
|
ad7d6a84eb | ||
|
|
2607c79153 | ||
|
|
498e49324c | ||
|
|
ac467dfb2f | ||
|
|
f12373b8d5 | ||
|
|
0a50be934d | ||
|
|
f9c5aa5879 | ||
|
|
205be5ebc7 | ||
|
|
3f782d2982 | ||
|
|
dedb6e44a9 | ||
|
|
01d73157aa | ||
|
|
9bcf6107c1 | ||
|
|
b0100e4d87 | ||
|
|
75a1d85212 | ||
|
|
6b3f3a6e88 | ||
|
|
9f5554c942 | ||
|
|
7a969df31e | ||
|
|
73e99cd734 | ||
|
|
48b621a0d7 | ||
|
|
034c7403c1 | ||
|
|
8a24b2305c | ||
|
|
8f8d06a1fe | ||
|
|
463bf075db | ||
|
|
418629f9d5 | ||
|
|
b5d5402be6 | ||
|
|
b4a2bbf3f2 | ||
|
|
f28341d7b8 | ||
|
|
f565d2710a | ||
|
|
1ab282c09c | ||
|
|
b413625b22 | ||
|
|
6dd25d57b7 | ||
|
|
7ca15ca9f9 | ||
|
|
d8d51f3fc0 | ||
|
|
c30c45478b | ||
|
|
b473eb7b46 | ||
|
|
c94b3e468f | ||
|
|
dd891e72f6 | ||
|
|
7bba6c9005 | ||
|
|
6ae72b82cb | ||
|
|
99beaa40ee | ||
|
|
09abd13db8 | ||
|
|
96e7c17494 | ||
|
|
a401e3ecba | ||
|
|
6c0f61c5a2 | ||
|
|
170660efc8 | ||
|
|
d56b6fd084 | ||
|
|
18f184a211 | ||
|
|
150f8f03e3 | ||
|
|
8ed155c7ba | ||
|
|
cc36111653 | ||
|
|
a66b9d84db | ||
|
|
57d568048a | ||
|
|
9a471b1f2f | ||
|
|
106d1530e9 | ||
|
|
4cf91c1b48 | ||
|
|
15c656b10b | ||
|
|
7cb24c9de3 | ||
|
|
527788efa4 | ||
|
|
cac2e2c5d4 | ||
|
|
0865ca0b65 | ||
|
|
168b1d9d62 | ||
|
|
87c57eb05c | ||
|
|
88dbfb8ef3 | ||
|
|
2b4245627a | ||
|
|
d3b53fc01e | ||
|
|
b8d2b60148 | ||
|
|
e974827d29 | ||
|
|
8d58c6c22a | ||
|
|
812ae457cb | ||
|
|
e5ed010bad | ||
|
|
b091abdb95 | ||
|
|
d8344db317 | ||
|
|
a3b6cbfd26 | ||
|
|
2639e2de42 | ||
|
|
148b9b56d7 | ||
|
|
30aaf9a866 | ||
|
|
d03db64f78 | ||
|
|
162e114cdd | ||
|
|
50e9a1cd12 | ||
|
|
aad7e440e1 | ||
|
|
485d22cd1c | ||
|
|
27b1c3bc88 | ||
|
|
c95102f0f0 | ||
|
|
70385b3718 | ||
|
|
e0192c396e | ||
|
|
8fb90c754e | ||
|
|
9a512b60f0 | ||
|
|
fff521cbd6 | ||
|
|
39375575a6 | ||
|
|
d23a86c5c3 | ||
|
|
087a8d3d50 | ||
|
|
246c3064c1 | ||
|
|
2ea2d4de49 | ||
|
|
0e2ab4c13f | ||
|
|
5cb1e89f42 | ||
|
|
7d244ddadf | ||
|
|
f7aa411272 | ||
|
|
b6f33143fe | ||
|
|
23938e1717 | ||
|
|
ed6d2aba83 | ||
|
|
1170c07f03 | ||
|
|
15f32e23c9 | ||
|
|
284c90077f | ||
|
|
53e7ffd9da | ||
|
|
fc905321c3 | ||
|
|
364c30f59a | ||
|
|
bece21038b | ||
|
|
88de7c2871 | ||
|
|
3d229b7740 | ||
|
|
cbc343bcad | ||
|
|
f8110798ca | ||
|
|
0a0fbe2b15 | ||
|
|
55a8e79021 | ||
|
|
7cb0d3f5dc | ||
|
|
6204f58f95 | ||
|
|
7a35619362 | ||
|
|
69fdcdef0c | ||
|
|
3afe010889 | ||
|
|
d8d07f6235 | ||
|
|
642c729f4e | ||
|
|
2ff622ca46 | ||
|
|
a733dd87e2 | ||
|
|
843fa93fba | ||
|
|
93ea8d41f1 | ||
|
|
ebadae9792 | ||
|
|
2637ca49a6 | ||
|
|
22b4aee6eb | ||
|
|
0b3c166594 | ||
|
|
ff060bf719 | ||
|
|
2ff8ef790d | ||
|
|
b903fd496a | ||
|
|
e497d8f399 | ||
|
|
d717db1875 | ||
|
|
4fcf400300 | ||
|
|
295383061e | ||
|
|
d0f40241a4 | ||
|
|
dfd5d6c9ec | ||
|
|
e6ddc2474b | ||
|
|
93cdc87a79 | ||
|
|
12ecf6bcb0 | ||
|
|
b4d784f8d8 | ||
|
|
0a404730ea | ||
|
|
9f22569679 | ||
|
|
3aadc3f62c | ||
|
|
b3565ee5a2 | ||
|
|
685a627533 | ||
|
|
cca1a6a27b | ||
|
|
8c1ce051a9 | ||
|
|
3cf2173b4a | ||
|
|
529f8521a0 | ||
|
|
b3362334e8 | ||
|
|
f8dc8bd65b | ||
|
|
8f7826ad96 | ||
|
|
c1c82a4bf0 | ||
|
|
754ab85e59 | ||
|
|
9165c56436 | ||
|
|
ae6ef0fdcb | ||
|
|
f9a16cd243 | ||
|
|
fa11ccfde9 | ||
|
|
86f432ff5d | ||
|
|
3f7e61ce94 | ||
|
|
71868732bb | ||
|
|
d392c2ff2f | ||
|
|
625fbbe83b | ||
|
|
c1f2efd43e | ||
|
|
0ef43da159 | ||
|
|
3b19241611 | ||
|
|
66b707f9ce | ||
|
|
2ffecc5625 | ||
|
|
9d6c62d59b | ||
|
|
b7b4b2f45b | ||
|
|
8d3089dd17 | ||
|
|
256d2ce004 | ||
|
|
780d805419 | ||
|
|
c469567b9a | ||
|
|
a4de0a2603 | ||
|
|
36574a7556 | ||
|
|
be6ce362bd | ||
|
|
bc06dc9fd9 | ||
|
|
b0d670a1bc | ||
|
|
ccf19469e2 | ||
|
|
809492f2af | ||
|
|
baf10331b3 | ||
|
|
1bca56362e | ||
|
|
ea000b5701 | ||
|
|
ab1fa0d555 | ||
|
|
0d09ea3339 | ||
|
|
37ec5826d5 | ||
|
|
e25c13eb4a | ||
|
|
bd61327cdd | ||
|
|
71c13892eb | ||
|
|
8a3ae50022 | ||
|
|
5e7a7f7db5 | ||
|
|
1e502bbf38 | ||
|
|
fd8db7de55 | ||
|
|
641c28f51e | ||
|
|
71fb0333e3 | ||
|
|
46fdd2e57c | ||
|
|
73b3c9ec10 | ||
|
|
e772c6a373 | ||
|
|
d49716cc16 | ||
|
|
bfd72020ce | ||
|
|
45d310c534 | ||
|
|
443455d190 | ||
|
|
6b7774434c | ||
|
|
afd9eb05a3 | ||
|
|
79b9d48b8a | ||
|
|
da914522df | ||
|
|
31126db321 | ||
|
|
4a14b96c8e | ||
|
|
f2462d5e0b | ||
|
|
61eb91d637 | ||
|
|
faa2be8068 | ||
|
|
4811d76344 | ||
|
|
0489976ef5 | ||
|
|
80b1c385f2 | ||
|
|
694206f300 | ||
|
|
5ff90e973b | ||
|
|
128e42c9dd | ||
|
|
641f4eb20b | ||
|
|
a14d66bb1f | ||
|
|
a8bcd7ecec | ||
|
|
bd5650ab43 | ||
|
|
79ac763969 | ||
|
|
6218a087c3 | ||
|
|
6c076d2bd5 | ||
|
|
0fe0c70ad3 | ||
|
|
2aa0bfec52 | ||
|
|
77f1f8f1df | ||
|
|
3f71f67714 | ||
|
|
6122646715 | ||
|
|
27640dbd20 | ||
|
|
06234068c2 | ||
|
|
09df9a43cd | ||
|
|
4f01124326 | ||
|
|
9ab4d01371 | ||
|
|
8556706ac2 | ||
|
|
113fc7d204 | ||
|
|
6b608c92ae | ||
|
|
b2b18152d1 | ||
|
|
dbd893968e | ||
|
|
1c3f5eac5b | ||
|
|
70ff3fdd2c | ||
|
|
2f7cfac5a6 | ||
|
|
ed50252be8 | ||
|
|
7d6679d157 | ||
|
|
6f8c6a62b9 | ||
|
|
e2747f8c64 | ||
|
|
f25a0d5a5c | ||
|
|
70a1b8abe7 | ||
|
|
8af267ad6a | ||
|
|
a6b0dcd241 | ||
|
|
623e2a09c2 | ||
|
|
c8f1a5e385 | ||
|
|
f699f6b31d | ||
|
|
4a62f540f1 | ||
|
|
70eae9b6d2 | ||
|
|
af3c3a24e3 | ||
|
|
0db2ffc3af | ||
|
|
b440081fa2 | ||
|
|
1f286b0218 | ||
|
|
ef3972ac83 | ||
|
|
8394ac5fb2 | ||
|
|
db5ef2f455 | ||
|
|
b7e98f8495 | ||
|
|
60b9930469 | ||
|
|
eac3e2e9aa | ||
|
|
1acf8aa761 | ||
|
|
5d51407505 | ||
|
|
e63bb9d794 | ||
|
|
eb15ad393e | ||
|
|
8232e89286 | ||
|
|
c698a87201 | ||
|
|
619380c3c0 | ||
|
|
231f605b15 | ||
|
|
f715a3b168 | ||
|
|
2b3cc7e607 | ||
|
|
a0b5cde66a | ||
|
|
20cb6cb693 | ||
|
|
168886b9ad | ||
|
|
0399e58fdf | ||
|
|
06d29ea249 | ||
|
|
7e5c288be8 | ||
|
|
6fb3b48978 | ||
|
|
61e874fa84 | ||
|
|
7d78857470 | ||
|
|
619bc7e159 | ||
|
|
69e6810d1e | ||
|
|
75ba7f14e5 | ||
|
|
cce7fdff34 | ||
|
|
bf6cc01b52 | ||
|
|
bcb095f8a9 | ||
|
|
bd7dff22a8 | ||
|
|
972cceb99c | ||
|
|
7e1e6c7215 | ||
|
|
4b60d7372d | ||
|
|
57052515de | ||
|
|
dff5676e1b | ||
|
|
8b6b478b81 | ||
|
|
6756ed03f7 | ||
|
|
b762f8fe07 | ||
|
|
3a341d46ca | ||
|
|
106518fe50 | ||
|
|
cc7cfafe27 | ||
|
|
8503fd95ac | ||
|
|
d7c55ba002 | ||
|
|
3c981d26f8 | ||
|
|
d6ac34c459 | ||
|
|
8bff0a3a2c | ||
|
|
ad80341982 | ||
|
|
5729030ee1 | ||
|
|
d314cdc629 | ||
|
|
a22348496f | ||
|
|
a46e91bf0d | ||
|
|
4f992a26fb | ||
|
|
eaa2ea31bd | ||
|
|
12293d26da | ||
|
|
a1a530fb8d | ||
|
|
f93de378fe | ||
|
|
84f47ba861 | ||
|
|
c0b0d51402 | ||
|
|
b8e76d926a | ||
|
|
92d7706b2f | ||
|
|
cae49d7651 | ||
|
|
ff07968863 | ||
|
|
0aa9d241d4 | ||
|
|
2a7aacb79b | ||
|
|
1122710c52 | ||
|
|
964142a3a3 | ||
|
|
eb31acfa17 | ||
|
|
58f9ceadcb | ||
|
|
b82e3dd3d7 | ||
|
|
9a2febfed4 | ||
|
|
963096e847 | ||
|
|
d0734c2a24 | ||
|
|
7d08b37835 | ||
|
|
eddc65a611 | ||
|
|
2deeb9d762 | ||
|
|
b904c4673f | ||
|
|
28dc3cc184 | ||
|
|
968f595848 | ||
|
|
c25de96b99 | ||
|
|
1ad8ee4834 | ||
|
|
dd826b760f | ||
|
|
8c45a0d797 | ||
|
|
c3218394e4 | ||
|
|
4a8b42df43 | ||
|
|
cdae846961 | ||
|
|
01f6ba274d | ||
|
|
1361e7e34c | ||
|
|
5b3948723c | ||
|
|
7359ab3a7a | ||
|
|
27f4fc61c4 | ||
|
|
00521a78a1 | ||
|
|
c058e66325 | ||
|
|
f2d72b7f87 | ||
|
|
978551c1f7 | ||
|
|
de87376b96 | ||
|
|
c57068e4c1 | ||
|
|
a623ac4e0e | ||
|
|
9afb0e7d74 | ||
|
|
e0b2480d0e | ||
|
|
b5bebe6668 | ||
|
|
d945ef7ecf | ||
|
|
225f0aa962 | ||
|
|
e43da87623 | ||
|
|
dfab04f55c | ||
|
|
458ff6f480 | ||
|
|
3c64131dd8 | ||
|
|
a1f4627d40 | ||
|
|
17138832e5 | ||
|
|
17531efb1a | ||
|
|
41e6f47bfa | ||
|
|
2c9614fb10 | ||
|
|
6afd739cf1 | ||
|
|
2457823369 | ||
|
|
aeaefb716d | ||
|
|
d4beef1773 | ||
|
|
928f583b71 | ||
|
|
0282fc286e | ||
|
|
04cc039c07 | ||
|
|
7f1f83e834 | ||
|
|
b423f4baff | ||
|
|
4a96596e09 | ||
|
|
ad33f31373 | ||
|
|
080e80a637 | ||
|
|
53d656a9a1 | ||
|
|
89b0d7af2c | ||
|
|
1c4cdfade6 | ||
|
|
63f6028c4e | ||
|
|
246b3f7e9f | ||
|
|
e45a686be7 | ||
|
|
1dce744290 | ||
|
|
5df1afe6e6 | ||
|
|
da482534b3 | ||
|
|
be64be1dfd | ||
|
|
afe8df3d75 | ||
|
|
3ee011d02b | ||
|
|
bd5ddb70ea | ||
|
|
d6c39cca3a | ||
|
|
2fe6680b3f | ||
|
|
1347bd1e96 | ||
|
|
b9c5c653e6 | ||
|
|
d6b4715e32 | ||
|
|
ecbe515d79 | ||
|
|
44cab4adea | ||
|
|
a2dc91d683 | ||
|
|
9607a311ed | ||
|
|
804ae553c3 | ||
|
|
be7d4fdde0 | ||
|
|
6aed6f697f | ||
|
|
624fe1566b | ||
|
|
ec1577308a | ||
|
|
e3aa3a71cb | ||
|
|
90dcf11081 | ||
|
|
132e190048 | ||
|
|
dc9928eb7c | ||
|
|
428ff1c549 | ||
|
|
c61baaa999 | ||
|
|
edee1b6680 | ||
|
|
885c533ef0 | ||
|
|
de0519cd67 | ||
|
|
c5ac50d5e2 | ||
|
|
4cb5382fca | ||
|
|
0bc0799597 | ||
|
|
9e0f7ffb8a | ||
|
|
cfa280641e | ||
|
|
a911b0b748 | ||
|
|
be9c8fa239 | ||
|
|
0d32d05921 | ||
|
|
bf7b44d54f | ||
|
|
a2b5d31397 | ||
|
|
6d0476c328 | ||
|
|
2cd31bb596 | ||
|
|
637548fb10 | ||
|
|
26949a54c9 | ||
|
|
3c7053730f | ||
|
|
ee3c3f96d7 | ||
|
|
9039f3c7b0 | ||
|
|
a000b7234a | ||
|
|
218651a65b | ||
|
|
423460521b | ||
|
|
732eb22602 | ||
|
|
28a1c909e4 | ||
|
|
da24b92c2a | ||
|
|
204f826da0 | ||
|
|
4516f9102e | ||
|
|
ab56848021 | ||
|
|
69d2a48ff1 | ||
|
|
c5b72f03a1 | ||
|
|
d455161f02 | ||
|
|
764bd4bf65 | ||
|
|
5a4cd2828d | ||
|
|
303b3fe0e3 | ||
|
|
cb4a0b5b63 | ||
|
|
80b989b275 | ||
|
|
5dbd73bf67 | ||
|
|
0481dc4c6e | ||
|
|
d525363520 | ||
|
|
748665aa52 | ||
|
|
c4da75c128 | ||
|
|
2795a668d6 | ||
|
|
1b6ec3d818 | ||
|
|
83d6027167 | ||
|
|
5c6d280101 | ||
|
|
3528882472 | ||
|
|
d630028f35 | ||
|
|
3b629c5fe4 | ||
|
|
21346b8835 | ||
|
|
cdca1f405a | ||
|
|
ce1fd5d84c | ||
|
|
5f87a200ec | ||
|
|
66d54a8b6d | ||
|
|
5f02b8269b | ||
|
|
b4fff11fed | ||
|
|
3243c72cb2 | ||
|
|
0c5d530ffc | ||
|
|
2fcaf0e746 | ||
|
|
2f87640ce4 | ||
|
|
be372b62a6 | ||
|
|
76c08bd2ed | ||
|
|
da5d212dfc | ||
|
|
5c41eb1716 | ||
|
|
91b9b7e794 | ||
|
|
4da30258e7 | ||
|
|
295058cc41 | ||
|
|
7774ce5dcf | ||
|
|
5f60368f08 | ||
|
|
ca60e23706 | ||
|
|
bf883ac38d | ||
|
|
cfa1d71b55 | ||
|
|
3a72186992 | ||
|
|
af6aa2ea05 | ||
|
|
114aae699d | ||
|
|
f9848fb7b1 | ||
|
|
856aebbbd6 | ||
|
|
526ec82985 | ||
|
|
67a384bafa | ||
|
|
d7a3ed9aa3 | ||
|
|
77a9c7a763 | ||
|
|
9065957d3d | ||
|
|
9188b6c365 | ||
|
|
fe32f8706e | ||
|
|
e79695d563 | ||
|
|
ed20e5e6fd | ||
|
|
612499e4d0 | ||
|
|
d41a137af5 | ||
|
|
6692771666 | ||
|
|
5f0ca989b0 | ||
|
|
cbc76df7dc | ||
|
|
68df67103c | ||
|
|
5980efcab5 | ||
|
|
7452c85b9c | ||
|
|
1e1f13f227 | ||
|
|
1bfdcafcb0 | ||
|
|
b78558faa1 | ||
|
|
9861f30e1d | ||
|
|
ed501b059e | ||
|
|
5204f1360e | ||
|
|
b07b40ca0e | ||
|
|
4ad7f1e776 | ||
|
|
f2459da232 | ||
|
|
55b08dd44e | ||
|
|
ffbc7660a6 | ||
|
|
cf51d1ad90 | ||
|
|
fe7fca9da1 | ||
|
|
cd24c92cb2 | ||
|
|
be65bb26c2 | ||
|
|
90ddac64b6 | ||
|
|
e6f6feeecc | ||
|
|
b4e1ea9f95 | ||
|
|
2c7a49f756 | ||
|
|
f6370ccef4 | ||
|
|
8fb0709493 | ||
|
|
07160b3d82 | ||
|
|
dda6dbadfe | ||
|
|
26aaabc693 | ||
|
|
52844744bf | ||
|
|
006631235e | ||
|
|
678f5fafba | ||
|
|
e20087bf71 | ||
|
|
7d4fc36816 | ||
|
|
8a4bb68747 | ||
|
|
4e211fa8a0 | ||
|
|
4618d9b438 | ||
|
|
c0a5bc3dda | ||
|
|
a02f3f6976 | ||
|
|
6cd2d41b36 | ||
|
|
93608b2018 | ||
|
|
fab25ee31b | ||
|
|
d8ef8c6365 | ||
|
|
cb972e1f0e | ||
|
|
af14ded3fc | ||
|
|
6aa16322cb | ||
|
|
5a0d585550 | ||
|
|
447d10c73f | ||
|
|
a514b9a490 | ||
|
|
2dac4a584c | ||
|
|
2d65aaeb5c | ||
|
|
81cfb6b041 | ||
|
|
658d17a08a | ||
|
|
7ed400413d | ||
|
|
8f84341661 | ||
|
|
f4b6547ce1 | ||
|
|
fba63e7c60 | ||
|
|
8514da82d2 | ||
|
|
2e5b4e7927 | ||
|
|
47d9eca542 | ||
|
|
eaeb0298a2 | ||
|
|
327ecc2f83 | ||
|
|
63384d1830 | ||
|
|
9349315a9a | ||
|
|
6927396daf | ||
|
|
072579ba85 | ||
|
|
a76e8d6662 | ||
|
|
0810edec5f | ||
|
|
e952bcd424 | ||
|
|
6884165424 | ||
|
|
a521a1b0e2 | ||
|
|
72a95558c8 | ||
|
|
050a707758 | ||
|
|
052d83d570 | ||
|
|
682e0c7c38 | ||
|
|
c399a0d6b1 | ||
|
|
213e72aaf3 | ||
|
|
919dac4da6 | ||
|
|
022fbb7508 | ||
|
|
5e3510d4b1 | ||
|
|
ae1a1cd55d | ||
|
|
d44e782fba | ||
|
|
21b640baee | ||
|
|
aa9bee63fc | ||
|
|
35b56c75c2 | ||
|
|
6991439448 | ||
|
|
7bee723d56 | ||
|
|
df2a5275d4 | ||
|
|
aff4e0bb2f | ||
|
|
b81d803390 | ||
|
|
ab6ac0a31d | ||
|
|
472d6e0cfb | ||
|
|
d0c0a6a921 | ||
|
|
72900e0edb | ||
|
|
cbe2249b39 | ||
|
|
ab0aa7118c | ||
|
|
a4c3785f50 | ||
|
|
28fea7fe7d | ||
|
|
ba98c54594 | ||
|
|
2250ff40dc | ||
|
|
e2b8fd356a | ||
|
|
a33ccabd1e | ||
|
|
3c96562702 | ||
|
|
80bafa48f9 | ||
|
|
ef779b7b11 | ||
|
|
b1ac5dd228 | ||
|
|
db876e378d | ||
|
|
ea4c27d979 | ||
|
|
9bed9c8290 | ||
|
|
6d752f5d9b | ||
|
|
8fc073e52b | ||
|
|
5a31496eb0 | ||
|
|
3519bd22cf | ||
|
|
cb38baf4c8 | ||
|
|
dd53284abb | ||
|
|
0b3df0b317 | ||
|
|
fd5e4b32c1 | ||
|
|
b8ed7d5184 | ||
|
|
6c88206d50 | ||
|
|
6300150636 | ||
|
|
fa48dfcca2 | ||
|
|
8ae38475b0 | ||
|
|
d8b7e7f848 | ||
|
|
89fbc40586 | ||
|
|
3fca8a4975 | ||
|
|
e9031b6800 | ||
|
|
efbd75a0b3 | ||
|
|
cb74781241 | ||
|
|
62ca5a2c59 | ||
|
|
bb399b0937 | ||
|
|
1bff3d0f84 | ||
|
|
a672bca9fe | ||
|
|
8b85480c73 | ||
|
|
c22abfef1a | ||
|
|
a65215f7d3 | ||
|
|
4c2e366f9b | ||
|
|
fcc1b296a8 | ||
|
|
954a04b866 | ||
|
|
2b62bd490c | ||
|
|
969733934b | ||
|
|
92504d633b | ||
|
|
6345f05f54 | ||
|
|
aaef08a0d4 | ||
|
|
bc513f36aa | ||
|
|
344a2a950f | ||
|
|
afd9deff38 | ||
|
|
21c1975abf | ||
|
|
f01bb5c354 | ||
|
|
5738f2de70 | ||
|
|
b1bcc03db3 | ||
|
|
f57bfe8089 | ||
|
|
9696b2257b | ||
|
|
6308211d36 | ||
|
|
087b513af8 | ||
|
|
55781765c2 | ||
|
|
0b880c3f33 | ||
|
|
07c3528f53 | ||
|
|
433f63c85f | ||
|
|
2c9d5ffb80 | ||
|
|
57359a5752 | ||
|
|
dd0a7ce7ea | ||
|
|
0d02bd205a | ||
|
|
8cf733bbc1 | ||
|
|
b5cb98b819 | ||
|
|
90402b9a8c | ||
|
|
6423619c8f | ||
|
|
9209ff62fe | ||
|
|
a0d1145f8e | ||
|
|
74e73e10f3 | ||
|
|
238feddbd6 | ||
|
|
a978be0193 | ||
|
|
cb5b4b1b01 | ||
|
|
3ec439a1fd | ||
|
|
c16ff0faf0 | ||
|
|
506b99572b | ||
|
|
4679a340c1 | ||
|
|
9bc7ddddf4 | ||
|
|
a9d5b91669 | ||
|
|
64a4b4e041 | ||
|
|
bb57de0d36 | ||
|
|
ade3fc802f | ||
|
|
c478573816 | ||
|
|
6d80075884 | ||
|
|
3eb34b884b | ||
|
|
4353adcf44 | ||
|
|
8ce8efd86e | ||
|
|
22af3d19b0 | ||
|
|
3e667aeba3 | ||
|
|
9717ee655a | ||
|
|
8bf0331753 | ||
|
|
131bb3f6bb | ||
|
|
b0533dc7a4 | ||
|
|
2464767a0e | ||
|
|
b3ff479e57 | ||
|
|
8edc1bfe80 | ||
|
|
9151441b62 | ||
|
|
e90f36f1ba | ||
|
|
b085bafb64 | ||
|
|
ab66163d40 | ||
|
|
f72164b69a | ||
|
|
0a3fb441b8 | ||
|
|
ace6774c42 | ||
|
|
90cc2ae2ad | ||
|
|
486c6118e2 | ||
|
|
84438fad56 | ||
|
|
c9db4ed2fd | ||
|
|
0dd4d12051 | ||
|
|
584cad73f4 | ||
|
|
e851fcf629 | ||
|
|
c8cd4c0142 | ||
|
|
eed8ea112d | ||
|
|
0cdefef72b | ||
|
|
7bc93da4c9 | ||
|
|
6505f6ae3f | ||
|
|
327e48530d | ||
|
|
ecc5bf01f7 | ||
|
|
56e1aee489 | ||
|
|
01f4d66b6b | ||
|
|
e5e4f0b26c | ||
|
|
a792c0ba44 | ||
|
|
9f7c157dc0 | ||
|
|
a1c5d620cf | ||
|
|
647489f91d | ||
|
|
79017aee7c | ||
|
|
7093aeefa2 | ||
|
|
9187ea31c1 | ||
|
|
959b0bd890 | ||
|
|
e9b4d1c37e | ||
|
|
4de9db38fa | ||
|
|
95537ada6b | ||
|
|
c7287e9c01 | ||
|
|
d096ea5ef8 | ||
|
|
5cff0b49e8 | ||
|
|
1986167e81 | ||
|
|
16c69a134c | ||
|
|
1baf46f180 | ||
|
|
9e403beae8 | ||
|
|
888df6e957 | ||
|
|
05920ee992 | ||
|
|
0194225d8b | ||
|
|
97c9c1ece8 | ||
|
|
50d2799bf8 | ||
|
|
509866e746 | ||
|
|
11f00a6636 | ||
|
|
00c4fb82f8 | ||
|
|
b73ef7a9df | ||
|
|
484eac2e03 | ||
|
|
edc01d68be | ||
|
|
c863d44ace | ||
|
|
e418971eda | ||
|
|
dd7b6b45f5 | ||
|
|
a1721de603 | ||
|
|
a696f04d4d | ||
|
|
c3af0047a7 | ||
|
|
f4637ef0de | ||
|
|
cb3a2e0996 | ||
|
|
a5212f8062 | ||
|
|
9c851a6d41 | ||
|
|
9ff0d77979 | ||
|
|
72108100e8 | ||
|
|
e3a4480ddc | ||
|
|
4a76d52d77 | ||
|
|
256c0c9094 | ||
|
|
02d880cb36 | ||
|
|
1b3fa859b9 | ||
|
|
a6bb24d4c8 | ||
|
|
7c9a240e91 | ||
|
|
5cee5838bf | ||
|
|
0726835c64 | ||
|
|
320ca6ca28 | ||
|
|
4072445f12 | ||
|
|
3f8bb42c7e | ||
|
|
44eccf3e99 | ||
|
|
bca9d10196 | ||
|
|
5d265597f7 | ||
|
|
533e58886e | ||
|
|
afd1e054ec | ||
|
|
42f8892aeb | ||
|
|
c6b05ab2a7 | ||
|
|
8d79ab9138 | ||
|
|
8a331877f7 | ||
|
|
bf5f91136e | ||
|
|
92dc132e55 | ||
|
|
6320031aac | ||
|
|
324d0ddc3b | ||
|
|
95cb3a686d | ||
|
|
51fa48e028 | ||
|
|
030dc46ba9 | ||
|
|
a3ae03ad37 | ||
|
|
514f134015 | ||
|
|
8a410b6fe1 | ||
|
|
509d393ae1 | ||
|
|
1f51267cb5 | ||
|
|
2e507a2491 | ||
|
|
17d4973104 | ||
|
|
8da15e1c80 | ||
|
|
19e0851b35 | ||
|
|
3106d5e24d | ||
|
|
ff9eb3391c | ||
|
|
ee124649b2 | ||
|
|
902cd5e269 | ||
|
|
40e5a9d113 | ||
|
|
8df34cd68e | ||
|
|
8e808c44ee | ||
|
|
cfcaa9c909 | ||
|
|
4023b25ccc | ||
|
|
168b044abc | ||
|
|
01a5f01e3f | ||
|
|
93cb40a1c2 | ||
|
|
e33240dbef | ||
|
|
5c8009f90e | ||
|
|
812bb1716c | ||
|
|
dd51cc7727 | ||
|
|
9b5a6028f2 | ||
|
|
83f74adbed | ||
|
|
6d7ba532c9 | ||
|
|
719f6148dd | ||
|
|
5d62c3cc6a | ||
|
|
aae80b929a | ||
|
|
c3c7fa242d | ||
|
|
8d102035fa | ||
|
|
aa91314590 | ||
|
|
f1d171d635 | ||
|
|
b3068b50ef | ||
|
|
7579ba6446 | ||
|
|
eaa65c0868 | ||
|
|
09e6ecc483 | ||
|
|
cbe5acd88b | ||
|
|
44309b6b69 | ||
|
|
e232ba020c | ||
|
|
aaf2e134b8 | ||
|
|
29c0a861b1 | ||
|
|
699a315d5e | ||
|
|
6e2c371544 | ||
|
|
6c1e42594e | ||
|
|
45b43ac004 | ||
|
|
b502b8efc1 | ||
|
|
52bc62de79 | ||
|
|
7beecd0046 | ||
|
|
959f48bb82 | ||
|
|
9392bde1e3 | ||
|
|
d4bc26bd24 | ||
|
|
aa4c21982b | ||
|
|
9820819552 | ||
|
|
880f61a67c | ||
|
|
521e7835df | ||
|
|
c5bd386711 | ||
|
|
e85e0624e7 | ||
|
|
9821e88608 | ||
|
|
b4b60272e8 | ||
|
|
fc89f1262e | ||
|
|
3e5989752f | ||
|
|
a40574c03f | ||
|
|
f6cf35ca4e | ||
|
|
33244035e4 | ||
|
|
1071f10c04 | ||
|
|
e6328bd509 | ||
|
|
d86149a289 | ||
|
|
14eda85230 | ||
|
|
57e6b9c547 | ||
|
|
82d1070192 | ||
|
|
c0392aee23 | ||
|
|
02822617db | ||
|
|
172fc515a3 | ||
|
|
eac3008773 | ||
|
|
52cca6ed36 | ||
|
|
02f579ce4a | ||
|
|
9ed956dcca | ||
|
|
96d8a8ece0 | ||
|
|
bf9337f3d8 | ||
|
|
4ce66d0295 | ||
|
|
5b7d330067 | ||
|
|
9c4bd18276 | ||
|
|
36ca27b46a | ||
|
|
998811395f | ||
|
|
e7acea9915 | ||
|
|
65d1906f81 | ||
|
|
fce95b6677 | ||
|
|
2ec240eb5c | ||
|
|
21202829f3 | ||
|
|
df8ed489af | ||
|
|
759cc84ac4 | ||
|
|
5e7aa6a1c8 | ||
|
|
943efc9e9f | ||
|
|
b7b3e572b6 | ||
|
|
2b12789fbf | ||
|
|
aaa9ecf79b | ||
|
|
9ac4527500 | ||
|
|
d9d21ee90f | ||
|
|
0068546bf3 | ||
|
|
0d8ecd0d21 | ||
|
|
a41a9d2a9e | ||
|
|
39b506ab01 | ||
|
|
bd004663da | ||
|
|
6ee8dd438a | ||
|
|
a8674b4e10 | ||
|
|
31f63c43ed | ||
|
|
4eb038a1c4 | ||
|
|
094f94cb44 | ||
|
|
82b127ba0b | ||
|
|
93d7608437 | ||
|
|
efe7a90161 | ||
|
|
3c852822ad | ||
|
|
195ec35e03 | ||
|
|
ffc3fedbde | ||
|
|
70903d0a21 | ||
|
|
ce8692fe97 | ||
|
|
a41718dcc7 | ||
|
|
133c46acb5 | ||
|
|
a7ee21f18d | ||
|
|
ea39f306d9 | ||
|
|
c71efb01ce | ||
|
|
e0a60c50f5 | ||
|
|
efec05ce41 | ||
|
|
b5d53cbfd1 | ||
|
|
07e496302c | ||
|
|
329777865b | ||
|
|
bde5680d10 | ||
|
|
60f04d9ed1 | ||
|
|
a44296e6f4 | ||
|
|
4fd072f9b3 | ||
|
|
02d6beada3 | ||
|
|
cf4ae53af2 | ||
|
|
c5bcf9cb2d | ||
|
|
31012ea782 | ||
|
|
3045303bda | ||
|
|
664f7b6ba9 | ||
|
|
ae1c53e386 | ||
|
|
0b3bab9d61 | ||
|
|
7234c2c8d4 | ||
|
|
a86b530963 | ||
|
|
7798a03d15 | ||
|
|
bc50d32b62 | ||
|
|
8fa83f72eb | ||
|
|
c27c3fcdcc | ||
|
|
735a2536da | ||
|
|
f24f902979 | ||
|
|
64dd27f57c | ||
|
|
33ecf1d294 | ||
|
|
918dad7488 | ||
|
|
0d3b70b536 | ||
|
|
6ebf49f699 | ||
|
|
b1df11336d | ||
|
|
6497384abd | ||
|
|
af6d4e6058 | ||
|
|
d0ddeb0ea7 | ||
|
|
177c560d03 | ||
|
|
b5137cca5b | ||
|
|
5b4d8f10d0 | ||
|
|
15861e0899 | ||
|
|
459491e786 | ||
|
|
a25e0f514e | ||
|
|
c5eb29c591 | ||
|
|
5551933833 | ||
|
|
6f7df30dbe | ||
|
|
c7bae18605 | ||
|
|
cbac461555 | ||
|
|
e7af3755e5 | ||
|
|
cf1554a393 | ||
|
|
45fcc528e6 | ||
|
|
6fb703b7e6 | ||
|
|
c90c704127 | ||
|
|
bc2f5778ac | ||
|
|
5820b9d970 | ||
|
|
26432dcb35 | ||
|
|
a060ea6240 | ||
|
|
fdfe478178 | ||
|
|
cea9c992fa | ||
|
|
e510dfda65 | ||
|
|
3349bf4f6c | ||
|
|
50de85c1f1 | ||
|
|
f5acf31b44 | ||
|
|
9a5c5ad50c | ||
|
|
bd887d65a7 | ||
|
|
dfc2a9baa4 | ||
|
|
785b3a8b97 | ||
|
|
e089b55ded | ||
|
|
56eaff5f89 | ||
|
|
b1b0b5e26f | ||
|
|
5f9959cb6a | ||
|
|
d0d165e336 | ||
|
|
673fac74ae | ||
|
|
849a03fcf4 | ||
|
|
43b89a87c3 | ||
|
|
2b462d89ac | ||
|
|
7f02e46de6 | ||
|
|
6ea3a5d455 | ||
|
|
6fd3021383 | ||
|
|
75ffa9f160 | ||
|
|
ae776da105 | ||
|
|
add60686df | ||
|
|
318c4d4e32 | ||
|
|
e93a97fc87 | ||
|
|
758b75177d | ||
|
|
045bea67fd | ||
|
|
d78f3e282e | ||
|
|
f6400c0959 | ||
|
|
9507ed70ae | ||
|
|
358d670381 | ||
|
|
76ee3df50c | ||
|
|
d37950ff50 | ||
|
|
a31ba917d3 | ||
|
|
72cf8919f4 | ||
|
|
a533e6f79e | ||
|
|
e8755c4945 | ||
|
|
e661aff94e | ||
|
|
11af650b54 | ||
|
|
7bdf727629 | ||
|
|
804d8b6a74 | ||
|
|
4699ab09d6 | ||
|
|
a7ec286d93 | ||
|
|
10b1eb2d72 | ||
|
|
f9b23c4cbf | ||
|
|
8a360f6c9d | ||
|
|
b3f041a340 | ||
|
|
f1ccc4dde2 | ||
|
|
42d216f822 | ||
|
|
9e65ef69a5 | ||
|
|
36cdd5f3ff | ||
|
|
d0f31fb261 | ||
|
|
f8e3cddf0a | ||
|
|
4604325dfc | ||
|
|
34ed215e04 | ||
|
|
fa5c5eeb7d | ||
|
|
3317bd174a | ||
|
|
04958e3f9b | ||
|
|
92ff2b7272 | ||
|
|
58150531b4 | ||
|
|
0869043d48 | ||
|
|
c8e259b919 | ||
|
|
c74d723da4 | ||
|
|
d3fb5163a2 | ||
|
|
4ce3a9d36f | ||
|
|
e629278774 | ||
|
|
22d56d374f | ||
|
|
587635d6b6 | ||
|
|
551965e5db | ||
|
|
1e111acc39 | ||
|
|
c461ca32b7 | ||
|
|
a0bac4e516 | ||
|
|
8e4140b79c | ||
|
|
7f3448f68f | ||
|
|
0ee3a71577 | ||
|
|
b1e2b1e3bf | ||
|
|
2ade79cfe2 | ||
|
|
f57fa35533 | ||
|
|
c89366eb3e | ||
|
|
204c694be1 | ||
|
|
b148ba5407 | ||
|
|
9090496ade | ||
|
|
1d66a32348 | ||
|
|
d8a4df2f50 | ||
|
|
daca085785 | ||
|
|
992e77fb04 | ||
|
|
fbe8d4409c | ||
|
|
4743655549 | ||
|
|
08b55a8c92 | ||
|
|
358a7fceee | ||
|
|
6f907b6f81 | ||
|
|
be52de925f | ||
|
|
d7072a40f3 | ||
|
|
7d36c6511d | ||
|
|
9d9d6d8619 | ||
|
|
239695399c | ||
|
|
c1b3007458 | ||
|
|
731717a2fe | ||
|
|
c92d888b06 | ||
|
|
3722e59eaa | ||
|
|
7341a8a72f | ||
|
|
d87745cb1f | ||
|
|
26fe20452e | ||
|
|
fa18c05f79 | ||
|
|
a48dbb8e4c | ||
|
|
e317dd137f | ||
|
|
8946cfe8c2 | ||
|
|
4a01af29d0 | ||
|
|
c14766db45 | ||
|
|
e885f1dd15 | ||
|
|
bab75062ce | ||
|
|
49443b5f2c | ||
|
|
895a74da95 | ||
|
|
446b07e818 | ||
|
|
7fbc9919c2 | ||
|
|
6320f9759f | ||
|
|
72b6ef5cdc | ||
|
|
024577fbad | ||
|
|
6e8bb30a03 |
80
mozilla/build/mac/build_scripts/BuildMozilla.pl
Normal file
80
mozilla/build/mac/build_scripts/BuildMozilla.pl
Normal file
@@ -0,0 +1,80 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Simon Fraser <sfraser@netscape.com>
|
||||
#
|
||||
|
||||
require 5.004;
|
||||
|
||||
use strict;
|
||||
|
||||
use Cwd;
|
||||
use Moz::BuildUtils;
|
||||
use Moz::BuildCore;
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Where have the build options gone?
|
||||
#
|
||||
# The various build flags have been centralized into one place.
|
||||
# The master list of options is in MozBuildFlags.txt. However,
|
||||
# you should never need to edit that file, or this one.
|
||||
#
|
||||
# To customize what gets built, or where to start the build,
|
||||
# edit the $prefs_file_name file in
|
||||
# System Folder:Preferences:Mozilla build prefs:
|
||||
# Documentation is provided in that file.
|
||||
#-------------------------------------------------------------
|
||||
|
||||
my($prefs_file_name) = "Mozilla opt build prefs";
|
||||
my($config_header_file_name) = ":mozilla:config:mac:DefinesOptions.h";
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# hashes to hold build options
|
||||
#-------------------------------------------------------------
|
||||
my(%build);
|
||||
my(%options);
|
||||
my(%filepaths);
|
||||
my(%optiondefines);
|
||||
|
||||
# Hash of input files for this build. Eventually, there will be
|
||||
# input files for manifests, and projects too.
|
||||
my(%inputfiles) = (
|
||||
"buildflags", "MozillaBuildFlags.txt",
|
||||
"checkoutdata", "MozillaCheckoutList.txt",
|
||||
"buildprogress", "¥ Mozilla opt progress",
|
||||
"buildmodule", "MozillaBuildList.pm",
|
||||
"checkouttime", "Mozilla last checkout"
|
||||
);
|
||||
#-------------------------------------------------------------
|
||||
# end build hashes
|
||||
#-------------------------------------------------------------
|
||||
|
||||
# set the build root directory, which is the the dir above mozilla
|
||||
SetupBuildRootDir(":mozilla:build:mac:build_scripts");
|
||||
|
||||
# Set up all the flags on $main::, like DEBUG, CARBON etc.
|
||||
# Override the defaults using the preferences files.
|
||||
SetupDefaultBuildOptions(0, ":mozilla:dist:viewer:", $config_header_file_name);
|
||||
|
||||
my($do_checkout) = 0;
|
||||
my($do_build) = 1;
|
||||
|
||||
RunBuild($do_checkout, $do_build, \%inputfiles, $prefs_file_name);
|
||||
80
mozilla/build/mac/build_scripts/BuildMozillaDebug.pl
Normal file
80
mozilla/build/mac/build_scripts/BuildMozillaDebug.pl
Normal file
@@ -0,0 +1,80 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Simon Fraser <sfraser@netscape.com>
|
||||
#
|
||||
|
||||
require 5.004;
|
||||
|
||||
use strict;
|
||||
|
||||
use Cwd;
|
||||
use Moz::BuildUtils;
|
||||
use Moz::BuildCore;
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Where have the build options gone?
|
||||
#
|
||||
# The various build flags have been centralized into one place.
|
||||
# The master list of options is in MozBuildFlags.txt. However,
|
||||
# you should never need to edit that file, or this one.
|
||||
#
|
||||
# To customize what gets built, or where to start the build,
|
||||
# edit the $prefs_file_name file in
|
||||
# System Folder:Preferences:Mozilla build prefs:
|
||||
# Documentation is provided in that file.
|
||||
#-------------------------------------------------------------
|
||||
|
||||
my($prefs_file_name) = "Mozilla debug build prefs";
|
||||
my($config_header_file_name) = ":mozilla:config:mac:DefinesOptionsDebug.h";
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# hashes to hold build options
|
||||
#-------------------------------------------------------------
|
||||
my(%build);
|
||||
my(%options);
|
||||
my(%filepaths);
|
||||
my(%optiondefines);
|
||||
|
||||
# Hash of input files for this build. Eventually, there will be
|
||||
# input files for manifests, and projects too.
|
||||
my(%inputfiles) = (
|
||||
"buildflags", "MozillaBuildFlags.txt",
|
||||
"checkoutdata", "MozillaCheckoutList.txt",
|
||||
"buildprogress", "¥ Mozilla debug progress",
|
||||
"buildmodule", "MozillaBuildList.pm",
|
||||
"checkouttime", "Mozilla last checkout"
|
||||
);
|
||||
#-------------------------------------------------------------
|
||||
# end build hashes
|
||||
#-------------------------------------------------------------
|
||||
|
||||
# set the build root directory, which is the the dir above mozilla
|
||||
SetupBuildRootDir(":mozilla:build:mac:build_scripts");
|
||||
|
||||
# Set up all the flags on $main::, like DEBUG, CARBON etc.
|
||||
# Override the defaults using the preferences files.
|
||||
SetupDefaultBuildOptions(1, ":mozilla:dist:viewer_debug:", $config_header_file_name);
|
||||
|
||||
my($do_pull) = 0; # overridden by flags and prefs
|
||||
my($do_build) = 1;
|
||||
|
||||
RunBuild($do_pull, $do_build, \%inputfiles, $prefs_file_name);
|
||||
595
mozilla/build/mac/build_scripts/Moz/BuildCore.pm
Normal file
595
mozilla/build/mac/build_scripts/Moz/BuildCore.pm
Normal file
@@ -0,0 +1,595 @@
|
||||
#!perl -w
|
||||
package Moz::BuildCore;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
use vars qw( @ISA @EXPORT );
|
||||
|
||||
# perl includes
|
||||
use Cwd;
|
||||
use POSIX;
|
||||
use Time::Local;
|
||||
use File::Basename;
|
||||
use LWP::Simple;
|
||||
|
||||
# homegrown
|
||||
use Moz::Moz;
|
||||
use Moz::Jar;
|
||||
use Moz::BuildFlags;
|
||||
use Moz::BuildUtils;
|
||||
use Moz::CodeWarriorLib;
|
||||
|
||||
# use MozillaBuildList; # eventually, this should go away, and be replaced by data input
|
||||
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
RunBuild
|
||||
);
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// DoPrebuildCheck
|
||||
#//
|
||||
#// Check the build tools etc before running the build.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub DoPrebuildCheck()
|
||||
{
|
||||
SanityCheckBuildOptions();
|
||||
|
||||
# launch codewarrior and persist its location. Have to call this before first
|
||||
# call to getCodeWarriorPath().
|
||||
my($ide_path_file) = $main::filepaths{"idepath"};
|
||||
$ide_path_file = full_path_to($ide_path_file);
|
||||
LaunchCodeWarrior($ide_path_file);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SanityCheckBuildOptions
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SanityCheckBuildOptions()
|
||||
{
|
||||
my($bad_options) = 0;
|
||||
|
||||
# Jar options
|
||||
if (!$main::options{chrome_jars} && !$main::options{chrome_files})
|
||||
{
|
||||
print "Warning: Both \$options{chrome_jars} and \$options{chrome_files} are off. You won't get any chrome.\n";
|
||||
$bad_options = 1;
|
||||
}
|
||||
|
||||
if (!$main::options{chrome_jars} && $main::options{use_jars})
|
||||
{
|
||||
print "Warning: \$options{chrome_jars} is off but \$options{use_jars} is on. Your build won't run (expects jars, got files).\n";
|
||||
$bad_options = 1;
|
||||
}
|
||||
|
||||
if (!$main::options{chrome_files} && !$main::options{use_jars})
|
||||
{
|
||||
print "Warning: \$options{chrome_jars} is off but \$options{chrome_files} is on. Your build won't run (expects files, got jars).\n";
|
||||
$bad_options = 1;
|
||||
}
|
||||
|
||||
if ($main::options{ldap_experimental} && !$main::options{ldap})
|
||||
{
|
||||
print "Warning: \$options{ldap_experimental} is on but \$options{ldap} is off. LDAP experimental features will not be built.\n";
|
||||
$bad_options = 1;
|
||||
}
|
||||
|
||||
if ($main::options{wsp} && !$main::options{xmlextras})
|
||||
{
|
||||
print "Warning: \$options{wsp} is on but \$options{xmlextras} is off. wsp will not be built.\n";
|
||||
$bad_options = 1;
|
||||
}
|
||||
|
||||
if ($bad_options) {
|
||||
print "Build will start in 5 seconds. Press command-. to stop\n";
|
||||
|
||||
DelayFor(5);
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GenBuildSystemInfo
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub GenBuildSystemInfo()
|
||||
{
|
||||
# always rebuild the configuration program.
|
||||
BuildProjectClean(":mozilla:build:mac:tools:BuildSystemInfo:BuildSystemInfo.mcp", "BuildSystemInfo");
|
||||
|
||||
# delete the configuration file.
|
||||
unlink(":mozilla:build:mac:BuildSystemInfo.pm");
|
||||
|
||||
# run the program.
|
||||
system(":mozilla:build:mac:BuildSystemInfo");
|
||||
|
||||
# wait for the file to be created.
|
||||
while (!(-e ":mozilla:build:mac:BuildSystemInfo.pm")) { WaitNextEvent(); }
|
||||
|
||||
# wait for BuildSystemInfo to finish, so that we see correct results.
|
||||
while (IsProcessRunning("BuildSystemInfo")) { WaitNextEvent(); }
|
||||
|
||||
# now, evaluate the contents of the file.
|
||||
open(F, ":mozilla:build:mac:BuildSystemInfo.pm");
|
||||
while (<F>) { eval; }
|
||||
close(F);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Make library aliases
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub MakeLibAliases()
|
||||
{
|
||||
my($dist_dir) = GetBinDirectory();
|
||||
|
||||
#// ProfilerLib
|
||||
if ($main::PROFILE)
|
||||
{
|
||||
my($profilerlibpath) = Moz::CodeWarriorLib::getCodeWarriorPath("MacOS Support:Profiler:Profiler Common:ProfilerLib");
|
||||
MakeAlias("$profilerlibpath", "$dist_dir"."Essential Files:");
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ConfigureBuildSystem
|
||||
#//
|
||||
#// defines some build-system configuration variables.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ConfigureBuildSystem()
|
||||
{
|
||||
#// In the future, we may want to do configurations based on the actual build system itself.
|
||||
#// GenBuildSystemInfo();
|
||||
|
||||
#// For now, if we discover a newer header file than existed in Universal Interfaces 3.2,
|
||||
#// we'll assume that 3.3 or later is in use.
|
||||
my($universal_interfaces) = Moz::CodeWarriorLib::getCodeWarriorPath("MacOS Support:Universal:Interfaces:CIncludes:");
|
||||
if (-e ($universal_interfaces . "ControlDefinitions.h")) {
|
||||
$main::UNIVERSAL_INTERFACES_VERSION = 0x0330;
|
||||
}
|
||||
|
||||
#// Rename IC SDK folder in the Mac OS Support folder
|
||||
my($ic_sdk_folder) = Moz::CodeWarriorLib::getCodeWarriorPath("MacOS Support:ICProgKit2.0.2");
|
||||
if( -e $ic_sdk_folder)
|
||||
{
|
||||
my($new_ic_folder_name) = Moz::CodeWarriorLib::getCodeWarriorPath("MacOS Support:(ICProgKit2.0.2)");
|
||||
rename ($ic_sdk_folder, $new_ic_folder_name);
|
||||
# note that CodeWarrior doesn't descend into folders with () the name
|
||||
print "Mozilla no longer needs the Internet Config SDK to build:\n Renaming the 'ICProgKit2.0.2' folder to '(ICProgKit2.0.2)'\n";
|
||||
}
|
||||
|
||||
printf("UNIVERSAL_INTERFACES_VERSION = 0x%04X\n", $main::UNIVERSAL_INTERFACES_VERSION);
|
||||
|
||||
# alias required CodeWarrior libs into the Essential Files folder (only the Profiler lib now)
|
||||
MakeLibAliases();
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// CheckOutModule. Takes variable number of args; first two are required
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub CheckOutModule($$$$)
|
||||
{
|
||||
my($session, $module, $revision, $date) = @_;
|
||||
|
||||
my($result) = $session->checkout($module, $revision, $date);
|
||||
|
||||
# result of 1 is success
|
||||
if ($result) { return; }
|
||||
|
||||
my($checkout_err) = $session->getLastError();
|
||||
if ($checkout_err == 708) {
|
||||
die "Error: Checkout was cancelled.\n";
|
||||
} elsif ($checkout_err == 911) {
|
||||
die "Error: CVS session settings are incorrect. Check your password, and the CVS root settings.\n";
|
||||
} elsif ($checkout_err == 703) {
|
||||
die "Error: CVS checkout failed. Unknown module, unknown tag, bad username, or other CVS error.\n";
|
||||
} elsif ($checkout_err == 711) {
|
||||
print "Checkout of '$module' failed.\n";
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getScriptFolder
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getScriptFolder()
|
||||
{
|
||||
return dirname($0);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getScriptFolder
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub get_url_contents($)
|
||||
{
|
||||
my($url) = @_;
|
||||
|
||||
my($url_contents) = LWP::Simple::get($url);
|
||||
$url_contents =~ s/\r\n/\n/g; # normalize linebreaks
|
||||
$url_contents =~ s/\r/\n/g; # normalize linebreaks
|
||||
return $url_contents;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// get_files_from_content
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub uniq
|
||||
{
|
||||
my $lastval;
|
||||
grep(($_ ne $lastval, $lastval = $_)[$[], @_);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// get_files_from_content
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub get_files_from_content($)
|
||||
{
|
||||
my($content) = @_;
|
||||
|
||||
my(@jscalls) = grep (/return js_file_menu[^{]*/, split(/\n/, $content));
|
||||
my $i;
|
||||
|
||||
for ($i = 0; $i < @jscalls ; $i++)
|
||||
{
|
||||
$jscalls[$i] =~ s/.*\(|\).*//g;
|
||||
my(@callparams) = split(/,/, $jscalls[$i]);
|
||||
my ($repos, $dir, $file, $rev) = grep(s/['\s]//g, @callparams);
|
||||
$jscalls[$i] = "$dir/$file";
|
||||
}
|
||||
|
||||
&uniq(sort(@jscalls));
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getLastUpdateTime
|
||||
#//
|
||||
#// Get the last time we updated. Return 0 on failure
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getLastUpdateTime($)
|
||||
{
|
||||
my($timestamp_file) = @_;
|
||||
|
||||
my($time_string);
|
||||
|
||||
local(*TIMESTAMP_FILE);
|
||||
unless (open(TIMESTAMP_FILE, "< $timestamp_file")) { return 0; }
|
||||
|
||||
while (<TIMESTAMP_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
# ignore comments and empty lines
|
||||
if ($line =~ /^\#/ || $line =~ /^\s*$/) {
|
||||
next;
|
||||
}
|
||||
|
||||
$time_string = $line;
|
||||
}
|
||||
|
||||
# get the epoch seconds
|
||||
my($last_update_secs) = $time_string;
|
||||
$last_update_secs =~ s/\s#.+$//;
|
||||
|
||||
print "FAST_UPDATE found that you last updated at ".localtime($last_update_secs)."\n";
|
||||
|
||||
# how long ago was this, in hours?
|
||||
my($gm_now) = time();
|
||||
my($update_hours) = 1 + ceil(($gm_now - $last_update_secs) / (60 * 60));
|
||||
|
||||
return $update_hours;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// saveCheckoutTimestamp
|
||||
#//
|
||||
#// Create a file on disk containing the current time. Param is time(), which is an Epoch seconds
|
||||
#// (and therefore in GMT).
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub saveCheckoutTimestamp($$)
|
||||
{
|
||||
my($gm_secs, $timestamp_file) = @_;
|
||||
|
||||
local(*TIMESTAMP_FILE);
|
||||
open(TIMESTAMP_FILE, ">$timestamp_file") || die "Failed to open $timestamp_file\n";
|
||||
print(TIMESTAMP_FILE "# time of last checkout or update, in GMT. Used by FAST_UPDATE\n");
|
||||
print(TIMESTAMP_FILE "$gm_secs \# around ".localtime()." local time\n");
|
||||
close(TIMESTAMP_FILE);
|
||||
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// FastUpdate
|
||||
#//
|
||||
#// Use Bonsai url data to update only those dirs which have new files
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub FastUpdate($$)
|
||||
{
|
||||
my($modules, $timestamp_file) = @_; # list of modules to check out
|
||||
|
||||
my($num_hours) = getLastUpdateTime($timestamp_file);
|
||||
if ($num_hours == 0 || $num_hours > 170) {
|
||||
print "Can't fast_update; last update was too long ago, or never. Doing normal checkout.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
print "Doing fast update, pulling files changed in the last $num_hours hours\n";
|
||||
|
||||
my($cvsfile) = AskAndPersistFile($main::filepaths{"sessionpath"});
|
||||
my($session) = Moz::MacCVS->new( $cvsfile );
|
||||
unless (defined($session)) { die "Error: Checkout aborted. Cannot create session file: $session" }
|
||||
|
||||
# activate MacCVS
|
||||
ActivateApplication('Mcvs');
|
||||
|
||||
my($checkout_start_time) = time();
|
||||
|
||||
#print "Time now is $checkout_start_time ($checkout_start_time + 0)\n";
|
||||
|
||||
my($this_co);
|
||||
foreach $this_co (@$modules)
|
||||
{
|
||||
my($module, $revision, $date) = ($this_co->[0], $this_co->[1], $this_co->[2]);
|
||||
|
||||
# assume that things pulled by date wont change
|
||||
if ($date ne "") {
|
||||
print "$module is pulled by date, so ignoring in FastUpdate.\n";
|
||||
next;
|
||||
}
|
||||
|
||||
my($search_type) = "hours";
|
||||
my($min_date) = "";
|
||||
my($max_date) = "";
|
||||
my($url) = "http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=${module}&branch=${revision}&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=${num_hours}&date=${search_type}&mindate=${min_date}&maxdate=${max_date}&cvsroot=%2Fcvsroot";
|
||||
|
||||
if ($revision eq "") {
|
||||
print "Getting list of checkins to $module from Bonsai...\n";
|
||||
} else {
|
||||
print "Getting list of checkins to $module on branch $revision from Bonsai...\n";
|
||||
}
|
||||
my(@files) = &get_files_from_content(&get_url_contents($url));
|
||||
|
||||
if ($#files > 0)
|
||||
{
|
||||
my(@cvs_co_list);
|
||||
|
||||
my($co_file);
|
||||
foreach $co_file (@files)
|
||||
{
|
||||
print "Updating $co_file\n";
|
||||
push(@cvs_co_list, $co_file);
|
||||
}
|
||||
|
||||
my($result) = $session->update($revision, \@cvs_co_list);
|
||||
# result of 1 is success
|
||||
if (!$result) { die "Error: Fast update failed\n"; }
|
||||
} else {
|
||||
print "No files in this module changed\n";
|
||||
}
|
||||
}
|
||||
|
||||
saveCheckoutTimestamp($checkout_start_time, $timestamp_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Checkout
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub CheckoutModules($$$)
|
||||
{
|
||||
my($modules, $pull_date, $timestamp_file) = @_; # list of modules to check out
|
||||
|
||||
my($start_time) = TimeStart();
|
||||
|
||||
# assertRightDirectory();
|
||||
my($cvsfile) = AskAndPersistFile($main::filepaths{"sessionpath"});
|
||||
my($session) = Moz::MacCVS->new( $cvsfile );
|
||||
unless (defined($session)) { die "Error: Checkout aborted. Cannot create session file: $session" }
|
||||
|
||||
my($checkout_start_time) = time();
|
||||
|
||||
# activate MacCVS
|
||||
ActivateApplication('Mcvs');
|
||||
|
||||
my($this_co);
|
||||
foreach $this_co (@$modules)
|
||||
{
|
||||
my($module, $revision, $date) = ($this_co->[0], $this_co->[1], $this_co->[2]);
|
||||
if ($date eq "") {
|
||||
$date = $pull_date;
|
||||
}
|
||||
CheckOutModule($session, $module, $revision, $date);
|
||||
# print "Checking out $module with ref $revision, date $date\n";
|
||||
}
|
||||
|
||||
saveCheckoutTimestamp($checkout_start_time, $timestamp_file);
|
||||
TimeEnd($start_time, "Checkout");
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ReadCheckoutModulesFile
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ReadCheckoutModulesFile($$)
|
||||
{
|
||||
my($modules_file, $co_list) = @_;
|
||||
|
||||
my($checkout_file) = getScriptFolder().":".$modules_file;
|
||||
local(*CHECKOUT_FILE);
|
||||
open(CHECKOUT_FILE, "< $checkout_file") || die "Error: failed to open checkout list $checkout_file\n";
|
||||
while (<CHECKOUT_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
# ignore comments and empty lines
|
||||
if ($line =~ /^\#/ || $line =~ /^\s*$/) {
|
||||
next;
|
||||
}
|
||||
|
||||
my(@cvs_co) = ["", "", ""];
|
||||
|
||||
my($module, $revision, $date) = (0, 1, 2);
|
||||
|
||||
if ($line =~ /\s*([^#,\s]+)\s*\,\s*([^#,\s]+)\s*\,\s*([^#]+)/)
|
||||
{
|
||||
@cvs_co[$module] = $1;
|
||||
@cvs_co[$revision] = $2;
|
||||
@cvs_co[$date] = $3;
|
||||
}
|
||||
elsif ($line =~ /\s*([^#,\s]+)\s*\,\s*([^#,\s]+)\s*(#.+)?/)
|
||||
{
|
||||
@cvs_co[$module] = $1;
|
||||
@cvs_co[$revision] = $2;
|
||||
}
|
||||
elsif ($line =~ /\s*([^#,\s]+)\s*\,\s*,\s*([^#,]+)/)
|
||||
{
|
||||
@cvs_co[$module] = $1;
|
||||
@cvs_co[$date] = $2;
|
||||
}
|
||||
elsif ($line =~ /\s*([^#,\s]+)/)
|
||||
{
|
||||
@cvs_co[$module] = $1;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Error: unrecognized line '$line' in $modules_file\n";
|
||||
}
|
||||
|
||||
# strip surrounding space from date
|
||||
@cvs_co[$date] =~ s/^\s*|\s*$//g;
|
||||
|
||||
# print "Going to check out '@cvs_co[$module]', '@cvs_co[$revision]', '@cvs_co[$date]'\n";
|
||||
push(@$co_list, \@cvs_co);
|
||||
}
|
||||
|
||||
close(CHECKOUT_FILE);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// PullFromCVS
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub PullFromCVS($$)
|
||||
{
|
||||
unless ( $main::build{pull} ) { return; }
|
||||
|
||||
my($modules_file, $timestamp_file) = @_;
|
||||
|
||||
StartBuildModule("pull");
|
||||
|
||||
my(@cvs_co_list);
|
||||
ReadCheckoutModulesFile($modules_file, \@cvs_co_list);
|
||||
|
||||
if ($main::FAST_UPDATE && $main::options{pull_by_date})
|
||||
{
|
||||
die "Error: you can't use FAST_UPDATE if you are pulling by date.\n";
|
||||
}
|
||||
|
||||
my($did_fast_update) = $main::FAST_UPDATE && FastUpdate(\@cvs_co_list, $timestamp_file);
|
||||
if (!$did_fast_update)
|
||||
{
|
||||
my($pull_date) = "";
|
||||
if ($main::options{pull_by_date})
|
||||
{
|
||||
# acceptable CVS date formats are (in local time):
|
||||
# ISO8601 (e.g. "1972-09-24 20:05") and Internet (e.g. "24 Sep 1972 20:05").
|
||||
# Perl's localtime() string format also seems to work.
|
||||
$pull_date = localtime().""; # force string interp.
|
||||
print "Pulling by date $pull_date\n";
|
||||
}
|
||||
|
||||
CheckoutModules(\@cvs_co_list, $pull_date, $timestamp_file);
|
||||
}
|
||||
|
||||
EndBuildModule("pull");
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// RunBuild
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub RunBuild($$$$)
|
||||
{
|
||||
my($do_pull, $do_build, $input_files, $build_prefs) = @_;
|
||||
|
||||
InitBuildProgress($input_files->{"buildprogress"});
|
||||
|
||||
# if we are pulling, we probably want to do a full build, so clear the build progress
|
||||
if ($do_pull) {
|
||||
ClearBuildProgress();
|
||||
}
|
||||
|
||||
# read local prefs, and the build progress file, and set flags to say what to build
|
||||
SetupBuildParams(\%main::build,
|
||||
\%main::options,
|
||||
\%main::optiondefines,
|
||||
\%main::filepaths,
|
||||
$input_files->{"buildflags"},
|
||||
$build_prefs);
|
||||
|
||||
# If we were told to pull, make sure we do, overriding prefs etc.
|
||||
if ($do_pull)
|
||||
{
|
||||
$main::build{"pull"} = 1;
|
||||
}
|
||||
|
||||
# transfer this flag
|
||||
$CodeWarriorLib::CLOSE_PROJECTS_FIRST = $main::CLOSE_PROJECTS_FIRST;
|
||||
|
||||
# setup the build log
|
||||
SetupBuildLog($main::filepaths{"buildlogfilepath"}, $main::USE_TIMESTAMPED_LOGS);
|
||||
StopForErrors();
|
||||
|
||||
if ($main::LOG_TO_FILE) {
|
||||
RedirectOutputToFile($main::filepaths{"scriptlogfilepath"});
|
||||
}
|
||||
|
||||
# run a pre-build check to see that the tools etc are in order
|
||||
DoPrebuildCheck();
|
||||
|
||||
# do the pull
|
||||
PullFromCVS($input_files->{"checkoutdata"}, $input_files->{"checkouttime"});
|
||||
|
||||
unless ($do_build) { return; }
|
||||
|
||||
my($build_start) = TimeStart();
|
||||
|
||||
# check the build environment
|
||||
ConfigureBuildSystem();
|
||||
|
||||
# here we load and call methods in the build module indirectly.
|
||||
# we have to use indirection because the build module can be named
|
||||
# differently for different builds.
|
||||
chdir(dirname($0)); # change to the script dir
|
||||
my($build_module) = $input_files->{"buildmodule"};
|
||||
# load the build module
|
||||
require $build_module;
|
||||
{ # scope for no strict 'refs'
|
||||
no strict 'refs';
|
||||
|
||||
my($package_name) = $build_module;
|
||||
$package_name =~ s/\.pm$//;
|
||||
|
||||
chdir($main::MOZ_SRC);
|
||||
&{$package_name."::BuildDist"}();
|
||||
|
||||
chdir($main::MOZ_SRC);
|
||||
&{$package_name."::BuildProjects"}();
|
||||
}
|
||||
|
||||
# the build finished, so clear the build progress state
|
||||
ClearBuildProgress();
|
||||
|
||||
TimeEnd($build_start, "Build");
|
||||
print "Build complete\n";
|
||||
}
|
||||
|
||||
1;
|
||||
425
mozilla/build/mac/build_scripts/Moz/BuildFlags.pm
Normal file
425
mozilla/build/mac/build_scripts/Moz/BuildFlags.pm
Normal file
@@ -0,0 +1,425 @@
|
||||
#!perl -w
|
||||
package Moz::BuildFlags;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
# Package that attempts to read a file from the Preferences folder,
|
||||
# and get build settings out of it
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use Moz::Moz;
|
||||
use Moz::Prefs;
|
||||
|
||||
use vars qw(@ISA @EXPORT);
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
SetupBuildParams
|
||||
InitBuildProgress
|
||||
WriteBuildProgress
|
||||
ClearBuildProgress
|
||||
ReadBuildProgress
|
||||
);
|
||||
|
||||
|
||||
my(@build_flags);
|
||||
my(@options_flags);
|
||||
my(@filepath_flags);
|
||||
|
||||
my(%arrays_list) = (
|
||||
"build_flags", \@build_flags,
|
||||
"options_flags", \@options_flags,
|
||||
"filepath_flags", \@filepath_flags
|
||||
);
|
||||
|
||||
my($progress_file) = "¥ÊBuild progress";
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# appendArrayFlag
|
||||
#
|
||||
# Set a flag in the array
|
||||
#-------------------------------------------------------------------------------
|
||||
sub appendArrayFlag(@)
|
||||
{
|
||||
my($array_name) = shift;
|
||||
my($setting) = shift;
|
||||
my($value) = shift;
|
||||
|
||||
my(@optional_values);
|
||||
foreach (@_) {
|
||||
push(@optional_values, $_);
|
||||
}
|
||||
|
||||
my(@this_flag) = [$setting, $value, @optional_values];
|
||||
my($flags_array) = $arrays_list{$array_name};
|
||||
if ($flags_array)
|
||||
{
|
||||
push(@{$flags_array}, @this_flag) || die "Failed to append\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Error: unknown build flags array $array_name\n";
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# readFlagsFile
|
||||
#
|
||||
# Read the file of build flags from disk. File path is relative to the
|
||||
# script directory.
|
||||
#-------------------------------------------------------------------------------
|
||||
sub readFlagsFile($)
|
||||
{
|
||||
my($flags_file) = @_;
|
||||
|
||||
my($file_path) = $0;
|
||||
$file_path =~ s/[^:]+$/$flags_file/;
|
||||
|
||||
print "Reading build flags from '$file_path'\n";
|
||||
|
||||
local(*FLAGS_FILE);
|
||||
open(FLAGS_FILE, "< $file_path") || die "Error: failed to open flags file $file_path\n";
|
||||
|
||||
my($cur_array) = "";
|
||||
|
||||
while(<FLAGS_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
# ignore comments and empty lines
|
||||
if ($line =~ /^\#/ || $line =~ /^\s*$/) {
|
||||
next;
|
||||
}
|
||||
|
||||
# 1-word line, probably array name
|
||||
if ($line =~ /^([^#\s]+)\s*$/)
|
||||
{
|
||||
$cur_array = $1;
|
||||
next;
|
||||
}
|
||||
elsif ($line =~ /^([^#\s]+)\s+\"(.+)\"(\s+#.+)?$/) # quoted option, possible comment
|
||||
{
|
||||
my($flag) = $1;
|
||||
my($setting) = $2;
|
||||
|
||||
appendArrayFlag($cur_array, $flag, $setting);
|
||||
}
|
||||
elsif ($line =~ /^([^#\s]+)((\s+[^#\s]+)+)(\s+#.+)?$/) # multiple word line, possible comment
|
||||
{
|
||||
my($flag) = $1;
|
||||
|
||||
appendArrayFlag($cur_array, $flag, split(' ', $2));
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Error: unknown build flag at '$line'\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(FLAGS_FILE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# flagsArrayToHash
|
||||
#
|
||||
# Utility routine to migrate flag from a 2D array to a hash, where
|
||||
# item[n][0] is the hash entry name, and item[n][1] is the hash entry value.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub flagsArrayToHash($$)
|
||||
{
|
||||
my($src_array, $dest_hash) = @_;
|
||||
|
||||
my($item);
|
||||
foreach $item (@$src_array)
|
||||
{
|
||||
$dest_hash->{$item->[0]} = $item->[1];
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------
|
||||
# printHash
|
||||
#
|
||||
# Utility routine to print a hash
|
||||
#-----------------------------------------------
|
||||
sub printHash($)
|
||||
{
|
||||
my($hash_ref) = @_;
|
||||
|
||||
print "Printing hash:\n";
|
||||
|
||||
my($key, $value);
|
||||
|
||||
while (($key, $value) = each (%$hash_ref))
|
||||
{
|
||||
print " $key $value\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------
|
||||
# printBuildArray
|
||||
#
|
||||
# Utility routine to print a 2D array
|
||||
#-----------------------------------------------
|
||||
sub printBuildArray($)
|
||||
{
|
||||
my($build_array) = @_;
|
||||
|
||||
my($entry);
|
||||
foreach $entry (@$build_array)
|
||||
{
|
||||
print "$entry->[0] = $entry->[1]\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# SetBuildFlags
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetBuildFlags($)
|
||||
{
|
||||
my($build) = @_;
|
||||
|
||||
flagsArrayToHash(\@build_flags, $build);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# SetBuildOptions
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetBuildOptions($)
|
||||
{
|
||||
my($options) = @_;
|
||||
|
||||
flagsArrayToHash(\@options_flags, $options);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# SetFilepathFlags
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetFilepathFlags($)
|
||||
{
|
||||
my($filepath) = @_;
|
||||
|
||||
flagsArrayToHash(\@filepath_flags, $filepath);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# SetOptionDefines
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetOptionDefines($)
|
||||
{
|
||||
my($optiondefines) = @_;
|
||||
|
||||
foreach my $entry (@options_flags)
|
||||
{
|
||||
if (defined($entry->[2])) {
|
||||
$optiondefines->{$entry->[0]}{$entry->[2]} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# PropagateAllFlags
|
||||
#-------------------------------------------------------------------------------
|
||||
sub PropagateAllFlags($)
|
||||
{
|
||||
my($build_array) = @_;
|
||||
|
||||
# if "all" is set, set all the flags to 1
|
||||
unless ($build_array->[0][0] eq "all") { die "Error: 'all' must come first in the flags array\n"; }
|
||||
|
||||
if ($build_array->[0][1] == 1)
|
||||
{
|
||||
my($index);
|
||||
foreach $index (@$build_array)
|
||||
{
|
||||
$index->[1] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// _getBuildProgressFile
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub _getBuildProgressFile()
|
||||
{
|
||||
return $progress_file;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// setBuildProgressStart
|
||||
#//
|
||||
#// This automagically sets $build{"all"} to 0
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub setBuildProgressStart($$)
|
||||
{
|
||||
my($build_array, $name) = @_;
|
||||
|
||||
my($index);
|
||||
foreach $index (@$build_array)
|
||||
{
|
||||
$index->[1] = 0;
|
||||
if ($index->[0] eq $name) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
print "Building from module after $name, as specified by build progress\n";
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// InitBuildProgress
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub InitBuildProgress($)
|
||||
{
|
||||
my($prog_file) = @_;
|
||||
if ($prog_file ne "") {
|
||||
$progress_file = full_path_to($prog_file);
|
||||
print "Writing build progress to $progress_file\n";
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// WriteBuildProgress
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub WriteBuildProgress($)
|
||||
{
|
||||
my($module_built) = @_;
|
||||
|
||||
my($progress_file) = _getBuildProgressFile();
|
||||
|
||||
if ($progress_file ne "")
|
||||
{
|
||||
open(PROGRESS_FILE, ">>$progress_file") || die "Failed to open $progress_file\n";
|
||||
print(PROGRESS_FILE "$module_built\n");
|
||||
close(PROGRESS_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ClearBuildProgress
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ClearBuildProgress()
|
||||
{
|
||||
my($progress_file) = _getBuildProgressFile();
|
||||
if ($progress_file ne "") {
|
||||
unlink $progress_file;
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// WipeBuildProgress
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub WipeBuildProgress()
|
||||
{
|
||||
print "Ignoring build progress\n";
|
||||
ClearBuildProgress();
|
||||
$progress_file = "";
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ReadBuildProgress
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ReadBuildProgress($)
|
||||
{
|
||||
my($build_array) = @_;
|
||||
my($progress_file) = _getBuildProgressFile();
|
||||
|
||||
my($last_module);
|
||||
|
||||
if (open(PROGRESS_FILE, "< $progress_file"))
|
||||
{
|
||||
print "Getting build progress from $progress_file\n";
|
||||
|
||||
while (<PROGRESS_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
$last_module = $line;
|
||||
}
|
||||
|
||||
close(PROGRESS_FILE);
|
||||
}
|
||||
|
||||
if ($last_module)
|
||||
{
|
||||
setBuildProgressStart($build_array, $last_module);
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# clearOldBuildSettings
|
||||
#-------------------------------------------------------------------------------
|
||||
sub clearOldBuildSettings($$$$)
|
||||
{
|
||||
my($build, $options, $optiondefines, $filepaths) = @_;
|
||||
|
||||
# empty the arrays in case we're being called twice
|
||||
@build_flags = ();
|
||||
@options_flags = ();
|
||||
@filepath_flags = ();
|
||||
|
||||
# and empty the hashes
|
||||
%$build = ();
|
||||
%$options = ();
|
||||
%$optiondefines = ();
|
||||
%$filepaths = ();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# SetupBuildParams
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetupBuildParams($$$$$$)
|
||||
{
|
||||
my($build, $options, $optiondefines, $filepaths, $flags_file, $prefs_file) = @_;
|
||||
|
||||
# Empty the hashes and arrays, to wipe out any stale data.
|
||||
# Needed because these structures persist across two build scripts
|
||||
# called using 'do' from a parent script.
|
||||
clearOldBuildSettings($build, $options, $optiondefines, $filepaths);
|
||||
|
||||
# Read from the flags file, which sets up the various arrays
|
||||
readFlagsFile($flags_file);
|
||||
|
||||
# If 'all' is set in the build array, propagate that to all entries
|
||||
PropagateAllFlags(\@build_flags);
|
||||
|
||||
# read the user pref file, that can change values in the array
|
||||
ReadMozUserPrefs($prefs_file, \@build_flags, \@options_flags, \@filepath_flags);
|
||||
|
||||
# If build progress exists, this clears flags in the array up to a certain point
|
||||
if ($main::USE_BUILD_PROGRESS) {
|
||||
ReadBuildProgress(\@build_flags);
|
||||
} else {
|
||||
WipeBuildProgress();
|
||||
}
|
||||
|
||||
# printBuildArray(\@build_flags);
|
||||
# printBuildArray(\@options_flags);
|
||||
|
||||
SetBuildFlags($build);
|
||||
SetBuildOptions($options);
|
||||
SetOptionDefines($optiondefines);
|
||||
SetFilepathFlags($filepaths);
|
||||
|
||||
# printHash($build);
|
||||
# printHash($options);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
786
mozilla/build/mac/build_scripts/Moz/BuildUtils.pm
Normal file
786
mozilla/build/mac/build_scripts/Moz/BuildUtils.pm
Normal file
@@ -0,0 +1,786 @@
|
||||
|
||||
package Moz::BuildUtils;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
# Package that contains build util functions specific to the Mozilla build
|
||||
# process.
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use Cwd;
|
||||
use File::Path;
|
||||
use File::Basename;
|
||||
|
||||
use Mac::Events;
|
||||
use Mac::StandardFile;
|
||||
|
||||
use Moz::Moz;
|
||||
use Moz::BuildFlags;
|
||||
use Moz::MacCVS;
|
||||
#use Moz::ProjectXML; #optional; required for static build only
|
||||
|
||||
use vars qw(@ISA @EXPORT);
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
SetupDefaultBuildOptions
|
||||
SetupBuildRootDir
|
||||
StartBuildModule
|
||||
EndBuildModule
|
||||
GetBinDirectory
|
||||
BuildOneProjectWithOutput
|
||||
BuildOneProject
|
||||
BuildProject
|
||||
BuildProjectClean
|
||||
BuildIDLProject
|
||||
BuildFolderResourceAliases
|
||||
AskAndPersistFile
|
||||
DelayFor
|
||||
TimeStart
|
||||
TimeEnd
|
||||
EmptyTree
|
||||
SetupBuildLog
|
||||
SetBuildNumber
|
||||
SetTimeBomb
|
||||
UpdateConfigHeader
|
||||
);
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SetupDefaultBuildOptions
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SetupDefaultBuildOptions($$$)
|
||||
{
|
||||
my($debug, $bin_dir, $config_header_file_name) = @_;
|
||||
|
||||
# Here we set up defaults for the various build flags.
|
||||
# If you want to override any of these, it's best to do
|
||||
# so via the relevant preferences file, which lives in
|
||||
# System Folder:Preferences:Mozilla build prefs:{build prefs file}.
|
||||
# For the name of the prefs file, see the .pl script that you
|
||||
# run to start this build. The prefs files are created when
|
||||
# you run the build, and contain some documentation.
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# configuration variables that globally affect what is built
|
||||
#-------------------------------------------------------------
|
||||
$main::DEBUG = $debug;
|
||||
$main::PROFILE = 0;
|
||||
$main::RUNTIME = 0; # turn on to just build runtime support and NSPR projects
|
||||
$main::GC_LEAK_DETECTOR = 0; # turn on to use GC leak detection
|
||||
$main::MOZILLA_OFFICIAL = 0; # generate build number
|
||||
$main::LOG_TO_FILE = 0; # write perl output to a file
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# configuration variables that affect the manner of building,
|
||||
# but possibly affecting the outcome.
|
||||
#-------------------------------------------------------------
|
||||
$main::ALIAS_SYM_FILES = $main::DEBUG;
|
||||
$main::CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before
|
||||
# building each project
|
||||
# The following two options will delete all dist files (if you have $main::build{dist} turned on),
|
||||
# but leave the directory structure intact.
|
||||
$main::CLOBBER_DIST_ALL = 1; # turn on to clobber all aliases/files inside dist (headers/xsym/libs)
|
||||
$main::CLOBBER_DIST_LIBS = 0; # turn on to clobber only aliases/files for libraries/sym files in dist
|
||||
$main::CLOBBER_IDL_PROJECTS = 0; # turn on to clobber all IDL projects.
|
||||
$main::CLOBBER_PROJECTS = 0; # turn on to remove object code from each project before building it
|
||||
|
||||
$main::UNIVERSAL_INTERFACES_VERSION = 0x0320;
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# configuration variables that are preferences for the build,
|
||||
# style and do not affect what is built.
|
||||
#-------------------------------------------------------------
|
||||
$main::CLOSE_PROJECTS_FIRST = 0;
|
||||
# 1 = close then make (for development),
|
||||
# 0 = make then close (for tinderbox).
|
||||
$main::USE_TIMESTAMPED_LOGS = 0;
|
||||
$main::USE_BUILD_PROGRESS = 1; # track build progress for restartable builds
|
||||
#-------------------------------------------------------------
|
||||
# END OF CONFIG SWITCHES
|
||||
#-------------------------------------------------------------
|
||||
|
||||
$main::BIN_DIRECTORY = $bin_dir;
|
||||
$main::DEFINESOPTIONS_FILE = $config_header_file_name;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SetupBuildRootDir
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SetupBuildRootDir($)
|
||||
{
|
||||
my($rel_path_to_script) = @_;
|
||||
|
||||
my($cur_dir) = cwd();
|
||||
$cur_dir =~ s/$rel_path_to_script$//;
|
||||
chdir($cur_dir) || die "Error: failed to set build root directory to '$cur_dir'.\nYou probably need to put 'mozilla' one level down (in a folder).\n";
|
||||
$main::MOZ_SRC = cwd();
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// StartBuildModule
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub StartBuildModule($)
|
||||
{
|
||||
my($module) = @_;
|
||||
|
||||
print("---- Start of $module ----\n");
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// EndBuildModule
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub EndBuildModule($)
|
||||
{
|
||||
my($module) = @_;
|
||||
WriteBuildProgress($module);
|
||||
print("---- End of $module ----\n");
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# GetBinDirectory
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
sub GetBinDirectory()
|
||||
{
|
||||
if ($main::BIN_DIRECTORY eq "") { die "Dist directory not set\n"; }
|
||||
return $main::BIN_DIRECTORY;
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# AskAndPersistFile stores the information about the user pick inside
|
||||
# the file $session_storage
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
sub AskAndPersistFile($)
|
||||
{
|
||||
my ($sessionStorage) = @_;
|
||||
my $cvsfile;
|
||||
|
||||
if (( -e $sessionStorage) &&
|
||||
open( SESSIONFILE, $sessionStorage ))
|
||||
{
|
||||
# Read in the path if available
|
||||
$cvsfile = <SESSIONFILE>;
|
||||
chomp $cvsfile;
|
||||
close SESSIONFILE;
|
||||
if ( ! -e $cvsfile )
|
||||
{
|
||||
print STDERR "$cvsfile has disappeared\n";
|
||||
undef $cvsfile;
|
||||
}
|
||||
}
|
||||
unless (defined ($cvsfile))
|
||||
{
|
||||
# make sure that MacPerl is a front process
|
||||
ActivateApplication('McPL');
|
||||
MacPerl::Answer("Could not find your MacCVS session file. Please choose one", "OK");
|
||||
|
||||
# prompt user for the file name, and store it
|
||||
my $macFile = StandardGetFile( 0, "McvD");
|
||||
if ( $macFile->sfGood() )
|
||||
{
|
||||
$cvsfile = $macFile->sfFile();
|
||||
# save the choice if we can
|
||||
if ( open (SESSIONFILE, ">" . $sessionStorage))
|
||||
{
|
||||
printf SESSIONFILE $cvsfile, "\n";
|
||||
close SESSIONFILE;
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "Could not open storage file $sessionStorage for saving $cvsfile\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return $cvsfile;
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# BuildIDLProject
|
||||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildIDLProject($$)
|
||||
{
|
||||
my ($project_path, $module_name) = @_;
|
||||
|
||||
if ($main::CLOBBER_IDL_PROJECTS)
|
||||
{
|
||||
my (@suffix_list) = (".mcp", ".xml");
|
||||
my ($project_name, $project_dir, $suffix) = fileparse($project_path, @suffix_list);
|
||||
if ($suffix eq "") { die "Error: Project, $project_path must end in .xml or .mcp\n"; }
|
||||
|
||||
my($datafolder_path);
|
||||
if ($suffix eq ".xml")
|
||||
{
|
||||
$datafolder_path = $project_dir . "_" . $project_name . " Data:";
|
||||
}
|
||||
else {
|
||||
$datafolder_path = $project_dir . $project_name . " Data:";
|
||||
}
|
||||
|
||||
print STDERR "Deleting IDL data folder: $datafolder_path\n";
|
||||
EmptyTree($datafolder_path);
|
||||
}
|
||||
|
||||
BuildOneProject($project_path, "headers", 0, 0, 0);
|
||||
BuildOneProject($project_path, $module_name.".xpt", 1, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# CreateStaticLibTargets
|
||||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
sub CreateXMLStaticLibTargets($)
|
||||
{
|
||||
my($xml_path) = @_;
|
||||
|
||||
my (@suffix_list) = (".xml");
|
||||
my ($project_name, $project_dir, $suffix) = fileparse($xml_path, @suffix_list);
|
||||
if ($suffix eq "") { die "XML munging: $xml_path must end in .xml\n"; }
|
||||
|
||||
#sniff the file to see if we need to fix up broken Pro5-exported XML
|
||||
print "Parsing $xml_path\n";
|
||||
|
||||
my $ide_version = Moz::ProjectXML::SniffProjectXMLIDEVersion($xml_path);
|
||||
if ($ide_version eq "4.0")
|
||||
{
|
||||
my $new_file = $project_dir.$project_name."2.xml";
|
||||
|
||||
print "Cleaning up Pro 5 xml to $new_file\n";
|
||||
|
||||
Moz::ProjectXML::CleanupPro5XML($xml_path, $new_file);
|
||||
|
||||
unlink $xml_path;
|
||||
rename ($new_file, $xml_path);
|
||||
}
|
||||
|
||||
my $doc = Moz::ProjectXML::ParseXMLDocument($xml_path);
|
||||
my @target_list = Moz::ProjectXML::GetTargetsList($doc);
|
||||
my $target;
|
||||
|
||||
my %target_hash; # for easy lookups below
|
||||
foreach $target (@target_list) { $target_hash{$target} = 1; }
|
||||
|
||||
foreach $target (@target_list)
|
||||
{
|
||||
if ($target =~ /(.+).shlb$/) # if this is a shared lib target
|
||||
{
|
||||
my $target_base = $1;
|
||||
my $static_target = $target_base.".o";
|
||||
|
||||
# ensure that this does not exist already
|
||||
if ($target_hash{$static_target}) {
|
||||
print "Static target $static_target already exists in project. Not making\n";
|
||||
next;
|
||||
}
|
||||
|
||||
print "Making static target '$static_target' from target '$target'\n";
|
||||
|
||||
Moz::ProjectXML::CloneTarget($doc, $target, $static_target);
|
||||
Moz::ProjectXML::SetAsStaticLibraryTarget($doc, $static_target, $static_target);
|
||||
}
|
||||
}
|
||||
|
||||
print "Writing XML file to $xml_path\n";
|
||||
my $temp_path = $project_dir."_".$project_name.".xml";
|
||||
Moz::ProjectXML::WriteXMLDocument($doc, $temp_path, $ide_version);
|
||||
Moz::ProjectXML::DisposeXMLDocument($doc);
|
||||
|
||||
if (-e $temp_path)
|
||||
{
|
||||
unlink $xml_path;
|
||||
rename ($temp_path, $xml_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Error: Failed to add new targets to XML project\n";
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ProcessProjectXML
|
||||
#//
|
||||
#// Helper routine to allow for XML pre-processing. This should read in the XML, process it,
|
||||
#// and replace the original file with the processed version.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ProcessProjectXML($)
|
||||
{
|
||||
my($xml_path) = @_;
|
||||
|
||||
# we need to manually load Moz::ProjectXML, becaues not everyone will have the
|
||||
# required perl modules in their distro.
|
||||
my($cur_dir) = cwd();
|
||||
|
||||
chdir(dirname($0)); # change to the script dir
|
||||
eval "require Moz::ProjectXML";
|
||||
if ($@) { die "Error: could not do Project XML munging because you do not have the correct XML modules installed. Error is:\n################\n $@################"; }
|
||||
|
||||
chdir($cur_dir);
|
||||
|
||||
CreateXMLStaticLibTargets($xml_path);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Build one project, and make the alias. Parameters are project path, target name, shared library
|
||||
#// name, make shlb alias (boolean), make xSYM alias (boolean), and is component (boolean).
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildOneProjectWithOutput($$$$$$)
|
||||
{
|
||||
my ($project_path, $target_name, $output_name, $alias_lib, $alias_xSYM, $component) = @_;
|
||||
|
||||
unless ($project_path =~ m/^$main::BUILD_ROOT.+/) { return; }
|
||||
|
||||
my (@suffix_list) = (".mcp", ".xml");
|
||||
my ($project_name, $project_dir, $suffix) = fileparse($project_path, @suffix_list);
|
||||
if ($suffix eq "") { die "Error: Project, $project_path must end in .xml or .mcp\n"; }
|
||||
|
||||
my($dist_dir) = GetBinDirectory();
|
||||
|
||||
# Put libraries in "Essential Files" folder, Components in "Components" folder
|
||||
my($output_dir) = $component ? "Components:" : "Essential Files:";
|
||||
my($output_path) = $dist_dir.$output_dir;
|
||||
|
||||
if ($main::options{static_build})
|
||||
{
|
||||
if ($output_name =~ /\.o$/ || $output_name =~ /\.[Ll]ib$/)
|
||||
{
|
||||
$alias_xSYM = 0;
|
||||
$alias_lib = 1;
|
||||
$output_path = $main::DEBUG ? ":mozilla:dist:static_libs_debug:" : ":mozilla:dist:static_libs:";
|
||||
}
|
||||
}
|
||||
|
||||
# if the flag is on to export projects to XML, export and munge them
|
||||
if ($main::EXPORT_PROJECTS && !($project_path =~ /IDL\.mcp$/))
|
||||
{
|
||||
my $xml_out_path = $project_path;
|
||||
|
||||
$xml_out_path =~ s/\.mcp$/\.xml/;
|
||||
|
||||
# only do this if project is newer?
|
||||
if (! -e $xml_out_path)
|
||||
{
|
||||
ExportProjectToXML(full_path_to($project_path), full_path_to($xml_out_path));
|
||||
ProcessProjectXML($xml_out_path);
|
||||
}
|
||||
}
|
||||
|
||||
# if the flag is set to use XML projects, default to XML if the file
|
||||
# is present.
|
||||
if ($main::USE_XML_PROJECTS && !($project_path =~ /IDL\.mcp$/))
|
||||
{
|
||||
my $xml_project_path = $project_dir.$project_name.".xml";
|
||||
if (-e $xml_project_path)
|
||||
{
|
||||
$project_path = $xml_project_path;
|
||||
$suffix = ".xml";
|
||||
}
|
||||
}
|
||||
|
||||
if ($suffix eq ".xml")
|
||||
{
|
||||
my($xml_path) = $project_path;
|
||||
# Prepend an "_" onto the name of the generated project file so it doesn't conflict
|
||||
$project_path = $project_dir . "_" . $project_name . ".mcp";
|
||||
my($project_modtime) = (-e $project_path ? GetFileModDate($project_path) : 0);
|
||||
my($xml_modtime) = (-e $xml_path ? GetFileModDate($xml_path) : 0);
|
||||
|
||||
if ($xml_modtime > $project_modtime)
|
||||
{
|
||||
print("Importing $project_path from $project_name.xml.\n");
|
||||
unlink($project_path);
|
||||
# Might want to delete the "xxx.mcp Data" dir ???
|
||||
ImportXMLProject(full_path_to($xml_path), full_path_to($project_path));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($main::CLOBBER_LIBS)
|
||||
{
|
||||
unlink "$project_dir$output_name"; # it's OK if these fail
|
||||
unlink "$project_dir$output_name.xSYM";
|
||||
}
|
||||
|
||||
DoBuildProject($project_path, $target_name, $main::CLOBBER_PROJECTS);
|
||||
|
||||
$alias_lib ? MakeAlias("$project_dir$output_name", "$output_path") : 0;
|
||||
$alias_xSYM ? MakeAlias("$project_dir$output_name.xSYM", "$output_path") : 0;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// For compatiblity with existing scripts, BuildOneProject now just calls
|
||||
#// BuildOneProjectWithOutput, with the output name and target name identical.
|
||||
#// Note that this routine assumes that the target name and the shared libary name
|
||||
#// are the same.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildOneProject($$$$$)
|
||||
{
|
||||
my ($project_path, $target_name, $alias_lib, $alias_xSYM, $component) = @_;
|
||||
|
||||
BuildOneProjectWithOutput($project_path, $target_name, $target_name,
|
||||
$alias_lib, $alias_xSYM, $component);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// For compatiblity with existing scripts, BuildProject now just calls
|
||||
#// BuildOneProjectWithOutput, with the output name and target name identical.
|
||||
#// Note that this routine assumes that the target name and the shared libary name
|
||||
#// are the same. No aliases of the output are made.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildProject($$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
|
||||
BuildOneProjectWithOutput($project_path, $target_name, $target_name, 0, 0, 0);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Identical to BuildProject but clobbers the project before building it.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildProjectClean($$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
my ($save_clobber_flag) = $main::CLOBBER_PROJECTS;
|
||||
$main::CLOBBER_PROJECTS = 1;
|
||||
BuildOneProjectWithOutput($project_path, $target_name, $target_name, 0, 0, 0);
|
||||
$main::CLOBBER_PROJECTS = $save_clobber_flag;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Make resource aliases for one directory
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub BuildFolderResourceAliases($$)
|
||||
{
|
||||
my($src_dir, $dest_dir) = @_;
|
||||
|
||||
# get a list of all the resource files
|
||||
opendir(SRCDIR, $src_dir) || die("can't open $src_dir");
|
||||
my(@resource_files) = readdir(SRCDIR);
|
||||
closedir(SRCDIR);
|
||||
|
||||
# make aliases for each one into the dest directory
|
||||
print("Placing aliases to all files from $src_dir in $dest_dir\n");
|
||||
for ( @resource_files )
|
||||
{
|
||||
next if $_ eq "CVS";
|
||||
#print(" Doing $_\n");
|
||||
if (-l $src_dir.$_)
|
||||
{
|
||||
print(" $_ is an alias\n");
|
||||
next;
|
||||
}
|
||||
my($file_name) = $src_dir . $_;
|
||||
MakeAlias($file_name, $dest_dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// DelayFor
|
||||
#//
|
||||
#// Delay for the given number of seconds, allowing the script to be cancelled
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub DelayFor($)
|
||||
{
|
||||
my($delay_secs) = @_;
|
||||
|
||||
STDOUT->autoflush(1);
|
||||
|
||||
my($end_time) = time() + $delay_secs;
|
||||
|
||||
my($last_time) = 0;
|
||||
my($cur_time) = time();
|
||||
|
||||
while ($cur_time < $end_time)
|
||||
{
|
||||
$cur_time = time();
|
||||
if ($cur_time > $last_time)
|
||||
{
|
||||
print ".";
|
||||
$last_time = $cur_time;
|
||||
}
|
||||
|
||||
WaitNextEvent();
|
||||
}
|
||||
|
||||
print "\n";
|
||||
STDOUT->autoflush(0);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// TimeStart
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub TimeStart()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// TimeEnd
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub TimeEnd($$)
|
||||
{
|
||||
use integer;
|
||||
|
||||
my($start_time, $operation_name) = @_;
|
||||
my($end_time) = time();
|
||||
|
||||
my($tot_sec) = $end_time - $start_time;
|
||||
|
||||
my($seconds) = $tot_sec;
|
||||
|
||||
my($hours) = $seconds / (60 * 60);
|
||||
$seconds -= $hours * (60 * 60);
|
||||
|
||||
my($minutes) = $seconds / 60;
|
||||
$seconds -= $minutes * 60;
|
||||
|
||||
print "$operation_name took $hours hours $minutes minutes and $seconds seconds\n";
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Remove all files from a tree, leaving directories intact (except "CVS").
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub EmptyTree($)
|
||||
{
|
||||
my ($root) = @_;
|
||||
#print "EmptyTree($root)\n";
|
||||
opendir(DIR, $root);
|
||||
my $sub;
|
||||
foreach $sub (readdir(DIR))
|
||||
{
|
||||
my $fullpathname = $root.$sub; # -f, -d only work on full paths
|
||||
|
||||
# Don't call empty tree for the alias of a directory.
|
||||
# -d returns true for the alias of a directory, false for a broken alias)
|
||||
|
||||
if (-d $fullpathname)
|
||||
{
|
||||
if (-l $fullpathname) # delete aliases
|
||||
{
|
||||
unlink $fullpathname;
|
||||
next;
|
||||
}
|
||||
EmptyTree($fullpathname.":");
|
||||
if ($sub eq "CVS")
|
||||
{
|
||||
#print "rmdir $fullpathname\n";
|
||||
rmdir $fullpathname;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unless (unlink $fullpathname) { die "Failed to delete $fullpathname\n"; }
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Recurse through a directory hierarchy, looking for MANIFEST files.
|
||||
#// Currently unused.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub ScanForManifestFiles($$$$)
|
||||
{
|
||||
my($dir, $theme_root, $theme_name, $dist_dir) = @_;
|
||||
|
||||
opendir(DIR, $dir) or die "Cannot open dir $dir\n";
|
||||
my @files = readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
my $file;
|
||||
|
||||
foreach $file (@files)
|
||||
{
|
||||
my $filepath = $dir.":".$file;
|
||||
|
||||
if (-d $filepath)
|
||||
{
|
||||
# print "Looking for MANIFEST files in $filepath\n";
|
||||
ScanForManifestFiles($filepath, $theme_root, $theme_name, $dist_dir);
|
||||
}
|
||||
elsif ($file eq "MANIFEST")
|
||||
{
|
||||
# print "Doing manifest file $filepath\n";
|
||||
|
||||
# Get the dest path from the first line of the file
|
||||
|
||||
open(MANIFEST, $filepath) || die "Could not open file $file";
|
||||
# Read in the path if available
|
||||
my($dest_line) = <MANIFEST>;
|
||||
chomp $dest_line;
|
||||
close MANIFEST;
|
||||
|
||||
$dest_line =~ s|^#!dest[\t ]+|| || die "No destination line found in $filepath\n";
|
||||
|
||||
my($dest_path) = $dist_dir."chrome:skins:$theme_name:$dest_line";
|
||||
# print " Destination is $dest_path\n";
|
||||
|
||||
InstallResources($filepath, "$dest_path", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------
|
||||
# SetupBuildLog
|
||||
#-----------------------------------------------
|
||||
sub SetupBuildLog($$)
|
||||
{
|
||||
my($logfile_path, $timestamped_log) = @_;
|
||||
|
||||
my($logdir) = "";
|
||||
my($logfile) = $logfile_path;
|
||||
|
||||
if ($logfile_path =~ /(.+?:)([^:]+)$/) # ? for non-greedy match
|
||||
{
|
||||
$logdir = $1;
|
||||
$logfile = $2;
|
||||
|
||||
mkpath($logdir);
|
||||
}
|
||||
|
||||
if ($timestamped_log)
|
||||
{
|
||||
#Use time-stamped names so that you don't clobber your previous log file!
|
||||
my $now = localtime();
|
||||
while ($now =~ s@:@.@) {} # replace all colons by periods
|
||||
OpenErrorLog("${logdir}${now}");
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenErrorLog("${logdir}${logfile}");
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------
|
||||
# SetBuildNumber
|
||||
#-----------------------------------------------
|
||||
sub SetBuildNumber($$)
|
||||
{
|
||||
my($build_num_file, $files_to_touch) = @_;
|
||||
|
||||
# Make sure we add the config dir to search, to pick up mozBDate.pm
|
||||
# Need to do this dynamically, because this module can be used before
|
||||
# mozilla/config has been checked out.
|
||||
|
||||
my ($inc_path) = $0; # $0 is the path to the parent script
|
||||
$inc_path =~ s/:build:mac:build_scripts:.+$/:config/;
|
||||
push(@INC, $inc_path);
|
||||
|
||||
require mozBDate;
|
||||
|
||||
mozBDate::UpdateBuildNumber($build_num_file, $main::MOZILLA_OFFICIAL);
|
||||
|
||||
my($file);
|
||||
foreach $file (@$files_to_touch)
|
||||
{
|
||||
print "Writing build number to $file from ${file}.in\n";
|
||||
mozBDate::SubstituteBuildNumber($file, $build_num_file, "${file}.in");
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------
|
||||
# SetTimeBomb
|
||||
#-----------------------------------------------
|
||||
sub SetTimeBomb($$)
|
||||
{
|
||||
my ($warn_days, $bomb_days) = @_;
|
||||
|
||||
system("perl :mozilla:config:mac-set-timebomb.pl $warn_days $bomb_days");
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Regenerate a configuration header file if necessary
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub UpdateConfigHeader($)
|
||||
{
|
||||
my($config_path) = @_;
|
||||
|
||||
my($config, $oldconfig) = ("", "");
|
||||
my($define, $definevalue, $defines);
|
||||
my($k, $l,);
|
||||
|
||||
foreach $k (keys(%main::options))
|
||||
{
|
||||
if ($main::options{$k})
|
||||
{
|
||||
foreach $l (keys(%{$main::optiondefines{$k}}))
|
||||
{
|
||||
$my::defines{$l} = $main::optiondefines{$k}{$l};
|
||||
print "Setting up my::defines{$l}\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $config_headerfile = current_directory().$config_path;
|
||||
if (-e $config_headerfile)
|
||||
{
|
||||
open(CONFIG_HEADER, "< $config_headerfile") || die "$config_headerfile: $!\n";
|
||||
my($line);
|
||||
while ($line = <CONFIG_HEADER>)
|
||||
{
|
||||
if ($line =~ m/#define\s+([^\s]*)\s+([^\s]*)\s*\n/)
|
||||
{
|
||||
$define = $1;
|
||||
$definevalue = $2;
|
||||
|
||||
#canonicalize so that whitespace changes are not significant
|
||||
my $canon_value = "#define " . $define . " " . $definevalue . "\n";
|
||||
$oldconfig .= $canon_value;
|
||||
|
||||
if (exists ($my::defines{$define}) and ($my::defines{$define} == $definevalue))
|
||||
{
|
||||
delete $my::defines{$define};
|
||||
$config .= $canon_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(CONFIG_HEADER);
|
||||
}
|
||||
|
||||
if (%my::defines)
|
||||
{
|
||||
foreach $k (keys(%my::defines))
|
||||
{
|
||||
$config .= "#define " . $k . " " . $my::defines{$k} . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $file_name = basename($config_headerfile);
|
||||
if (($config ne $oldconfig) || (!-e $config_headerfile))
|
||||
{
|
||||
printf("Writing new configuration header $file_name\n");
|
||||
open(CONFIG_HEADER, "> $config_headerfile") || die "$config_headerfile: $!\n";
|
||||
print(CONFIG_HEADER "/* This file is auto-generated based on build options. Do not edit. */\n");
|
||||
print CONFIG_HEADER ($config);
|
||||
close(CONFIG_HEADER);
|
||||
|
||||
MacPerl::SetFileInfo("CWIE", "TEXT", $config_headerfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Configuration header $file_name is up-to-date\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
660
mozilla/build/mac/build_scripts/Moz/CodeWarriorLib.pm
Normal file
660
mozilla/build/mac/build_scripts/Moz/CodeWarriorLib.pm
Normal file
@@ -0,0 +1,660 @@
|
||||
#!perl
|
||||
package Moz::CodeWarriorLib;
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
CodeWarriorLib - supply interface to CodeWarrior
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#!perl
|
||||
use CodeWarriorLib;
|
||||
CodeWarriorLib::activate();
|
||||
$had_errors = CodeWarriorLib::build_project(
|
||||
$project_path, $target_name, $recent_errors_file, $clean_build
|
||||
);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Replaces the AppleScript library I<CodeWarriorLib>.
|
||||
|
||||
=over 4
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use Mac::Types;
|
||||
use Mac::Events;
|
||||
use Mac::AppleEvents;
|
||||
use Mac::AppleEvents::Simple;
|
||||
use Mac::Processes;
|
||||
use Mac::MoreFiles;
|
||||
use Mac::StandardFile;
|
||||
|
||||
|
||||
use vars qw($VERSION);
|
||||
$VERSION = '1.02';
|
||||
|
||||
my($app) = 'CWIE';
|
||||
my($scriptDir) = cwd(); # could use $0 for this
|
||||
my($ide_loc_file) = "";
|
||||
|
||||
# 0 == don't switch CWIE to front app in do_event(), 1 == do switch
|
||||
# note: activate() still switches when called
|
||||
$Mac::AppleEvents::Simple::SWITCH = 0;
|
||||
# $Mac::AppleEvents::Simple::WARN = 1;
|
||||
|
||||
# supply your own path to the source here
|
||||
#_test('PowerPudgeIV:mozilla:mozilla:');
|
||||
|
||||
# If you want to understand the gobbldeygook that's used to build Apple Events,
|
||||
# you should start by reading the AEGizmos documentation.
|
||||
|
||||
=pod
|
||||
|
||||
=item _get_project($full_path)
|
||||
|
||||
A private routine returning a reference to the open project with the given name,
|
||||
or else the empty string (when that project is not open)
|
||||
|
||||
full_path is a string identifying the project to be built and is of the form,
|
||||
e.g., "HD:ProjectFolder:MyProject.mcp". It must be supplied.
|
||||
|
||||
=cut
|
||||
|
||||
sub _get_project ($) {
|
||||
my(
|
||||
$full_path, $candidate_projects
|
||||
) = @_;
|
||||
$candidate_projects = _doc_named(basename($full_path, '*'));
|
||||
if ($candidate_projects) {
|
||||
my($cps) = _get_dobj($candidate_projects);
|
||||
my($num) = AECountItems($cps);
|
||||
if ($num) { # is a list
|
||||
foreach (1 .. AECountItems($cps)) {
|
||||
my($cp) = AEGetNthDesc($cps, $_);
|
||||
if (lc $full_path eq lc _full_path($cp)) {
|
||||
return($cp);
|
||||
}
|
||||
}
|
||||
} else { # is only one, not a list
|
||||
if (lc $full_path eq lc _full_path($cps)) {
|
||||
return($cps);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=item build_project
|
||||
|
||||
Build a selected target of a project, saving any errors to a file, if supplied.
|
||||
|
||||
full_path is a string identifying the project to be built and is of the form,
|
||||
e.g., "HD:ProjectFolder:MyProject.mcp". It must be supplied.
|
||||
|
||||
If target_name is the empty string, the current target of the selected project
|
||||
will be built, else, target_name should be a string matching a target name in
|
||||
the selected project.
|
||||
|
||||
If error_path is the empty string, errors will not be saved to a file,
|
||||
else, error_path should be the full path of a file to save error messages into.
|
||||
|
||||
=cut
|
||||
|
||||
$CodeWarriorLib::CLOSE_PROJECTS_FIRST = 0; # If true we close then make. If false, make then close.
|
||||
my $last_project_built = "";
|
||||
my $last_project_was_closed = 0;
|
||||
|
||||
sub build_project ($;$$$) {
|
||||
my(
|
||||
$full_path, $target_name, $error_path,
|
||||
$remove_object, $p, $project_was_closed, $had_errors
|
||||
) = @_;
|
||||
_close_errors_window();
|
||||
|
||||
if ($CodeWarriorLib::CLOSE_PROJECTS_FIRST && ($last_project_built ne $full_path))
|
||||
{
|
||||
# If we're in "close first" mode, we don't close if the current project
|
||||
# is the same as the previous one.
|
||||
if ($last_project_was_closed) {
|
||||
$p = _get_project($last_project_built);
|
||||
_close($p);
|
||||
}
|
||||
$last_project_built = $full_path;
|
||||
$last_project_was_closed = 0; # now refers to the new project
|
||||
}
|
||||
$project_was_closed = 0;
|
||||
while (1) {
|
||||
$p = _get_project($full_path);
|
||||
if (!$p) {
|
||||
if ($project_was_closed) {
|
||||
print "### Error - request for project document failed after opening\n";
|
||||
die "### possibly CW Pro 4 bug: be sure to close your Find window\n";
|
||||
}
|
||||
$project_was_closed = 1;
|
||||
$last_project_was_closed = 1;
|
||||
_open_file($full_path);
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$had_errors = 0;
|
||||
if ($target_name eq '') {
|
||||
if ($remove_object) {_remove_object($p)}
|
||||
_build($p);
|
||||
} else {
|
||||
if ($remove_object) {_remove_object($p, $target_name)}
|
||||
_build($p, $target_name);
|
||||
}
|
||||
|
||||
if ($error_path ne '') {
|
||||
_save_errors_window($error_path);
|
||||
}
|
||||
$had_errors = _close_errors_window();
|
||||
|
||||
if (!$CodeWarriorLib::CLOSE_PROJECTS_FIRST)
|
||||
{
|
||||
if ($project_was_closed) {
|
||||
$p = _get_project($full_path);
|
||||
_close($p);
|
||||
}
|
||||
}
|
||||
|
||||
return($had_errors);
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=item appIsRunning()
|
||||
|
||||
=cut
|
||||
sub _appIsRunning($)
|
||||
{
|
||||
my ($appSignature) = @_;
|
||||
my ($psi);
|
||||
my ($found) = 0;
|
||||
my ($appPSN);
|
||||
|
||||
foreach $psi (values(%Process))
|
||||
{
|
||||
if ($psi->processSignature() eq $appSignature)
|
||||
{
|
||||
$appPSN = $psi->processNumber();
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=item appIsFrontmost()
|
||||
|
||||
=cut
|
||||
sub _appIsFrontmost($)
|
||||
{
|
||||
my ($appSignature) = @_;
|
||||
my ($psi);
|
||||
my ($found) = 0;
|
||||
my ($appPSN);
|
||||
|
||||
foreach $psi (values(%Process))
|
||||
{
|
||||
if ($psi->processSignature() eq $appSignature)
|
||||
{
|
||||
$appPSN = $psi->processNumber();
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return (GetFrontProcess() == $appPSN);
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=item activate()
|
||||
|
||||
Launches CodeWarrior and brings it to the front.
|
||||
|
||||
Once found, path will be saved in $idepath_file for future reference.
|
||||
Edit or delete this file to change the location of the IDE. If app is
|
||||
moved, C<activate()> will prompt for a new location.
|
||||
|
||||
First looks for an open CodeWarrior app. Second, tries to open previously
|
||||
saved location in ':idepath.txt'. Third, tries to find it and allow user
|
||||
to choose it with Navigation Services (if present). Fourth, uses good old
|
||||
GUSI routines built-in to MacPerl for a Choose Directory dialog box.
|
||||
|
||||
=cut
|
||||
|
||||
sub activate ($) {
|
||||
|
||||
$ide_loc_file = $_[0]; # save in global
|
||||
|
||||
my($filepath, $appath, $psi) = ($ide_loc_file);
|
||||
|
||||
foreach $psi (values(%Process)) {
|
||||
if ($psi->processSignature() eq $app) {
|
||||
$appath = $psi->processAppSpec();
|
||||
_save_appath($filepath, $appath);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$appath || !-x $appath) {
|
||||
$appath = _read_appath($filepath);
|
||||
}
|
||||
|
||||
if (!$appath || ! -x $appath)
|
||||
{
|
||||
# make sure that MacPerl is a front process
|
||||
#ActivateApplication('McPL');
|
||||
MacPerl::Answer("Please locate the CodeWarrior application.", "OK");
|
||||
|
||||
# prompt user for the file name, and store it
|
||||
my $macFile = StandardGetFile( 0, "APPL");
|
||||
if ( $macFile->sfGood() )
|
||||
{
|
||||
$appath = $macFile->sfFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Operation canceled\n";
|
||||
}
|
||||
|
||||
# if (eval {require Mac::Navigation}) {
|
||||
# my($options, $nav);
|
||||
# Mac::Navigation->import();
|
||||
# $options = NavGetDefaultDialogOptions();
|
||||
# $options->message('Where is CodeWarrior IDE?');
|
||||
# $options->windowTitle('Find CodeWarrior IDE');
|
||||
# $nav = NavChooseObject($Application{$app}, $options);
|
||||
# die "CodeWarrior IDE not found.\n" if (!$nav || !$nav->file(1));
|
||||
# $appath = $nav->file(1);
|
||||
# } else {
|
||||
# local(*D);
|
||||
# my $cwd = `pwd`;
|
||||
# $appath = _get_folder(
|
||||
# 'Where is the CW IDE folder?',
|
||||
# dirname($Application{$app})
|
||||
# );
|
||||
# die "CodeWarrior IDE not found.\n" if !$appath;
|
||||
# opendir(D, $appath) or die $!;
|
||||
# chdir($appath);
|
||||
# foreach my $file (sort readdir (D)) {
|
||||
# my(@app) = MacPerl::GetFileInfo($file);
|
||||
# if ($app[0] && $app[1] &&
|
||||
# $app[1] eq 'APPL' && $app[0] eq $app
|
||||
# ) {
|
||||
# $appath .= $file;
|
||||
# last;
|
||||
# }
|
||||
# }
|
||||
# chomp($cwd);
|
||||
# chdir($cwd);
|
||||
# }
|
||||
_save_appath($filepath, $appath);
|
||||
}
|
||||
|
||||
my($lp) = LaunchParam->new(
|
||||
launchAppSpec => $appath,
|
||||
launchControlFlags => launchContinue() + launchNoFileFlags()
|
||||
);
|
||||
|
||||
unless (LaunchApplication($lp)) {
|
||||
unlink($filepath);
|
||||
die $^E;
|
||||
}
|
||||
|
||||
# wait for CodeWarrior to show up in the list of processes
|
||||
while (!_appIsRunning('CWIE'))
|
||||
{
|
||||
WaitNextEvent();
|
||||
}
|
||||
|
||||
# wait for CodeWarrior to come to the front
|
||||
while (!_appIsFrontmost('CWIE'))
|
||||
{
|
||||
WaitNextEvent();
|
||||
}
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=item getCodeWarriorPath()
|
||||
|
||||
Returns a file path relative to the CodeWarrior folder
|
||||
|
||||
=cut
|
||||
|
||||
sub getCodeWarriorPath($)
|
||||
{
|
||||
my($subfolder)=@_;
|
||||
|
||||
my($app_path) = _read_appath($ide_loc_file);
|
||||
if ($app_path eq "") { die "Error: Failed to get CodeWarrior IDE path\n"; }
|
||||
|
||||
my($codewarrior_root) = $app_path;
|
||||
$codewarrior_root =~ s/[^:]*$//;
|
||||
return ($codewarrior_root . $subfolder);
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=item getCodeWarriorIDEName()
|
||||
|
||||
Returns the name of the CodeWarrior application
|
||||
|
||||
=cut
|
||||
|
||||
sub getCodeWarriorIDEName()
|
||||
{
|
||||
my($subfolder)=@_;
|
||||
|
||||
my($app_path) = _read_appath($ide_loc_file);
|
||||
if ($app_path eq "") { die "Error: Failed to get CodeWarrior IDE path\n"; }
|
||||
|
||||
my(@codewarrior_path) = split(/:/, $app_path);
|
||||
return pop(@codewarrior_path);
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=item quit()
|
||||
|
||||
Quits CodeWarrior.
|
||||
|
||||
=cut
|
||||
|
||||
sub quit() {
|
||||
|
||||
$last_project_built = "";
|
||||
$last_project_was_closed = 0;
|
||||
|
||||
my($evt) = do_event(qw/aevt quit/, $app);
|
||||
}
|
||||
|
||||
|
||||
sub _build ($;$) {
|
||||
my($evt);
|
||||
if ($_[1]) {
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(TRGT), seld:TEXT(@), from:" .
|
||||
AEPrint($_[0]) . '}';
|
||||
$evt = do_event(qw/CWIE MAKE/, $app, $prm, $_[1]);
|
||||
} else {
|
||||
my($prm) = q"'----':" . AEPrint($_[0]);
|
||||
$evt = do_event(qw/CWIE MAKE/, $app, $prm);
|
||||
}
|
||||
}
|
||||
|
||||
sub _remove_object ($;$) {
|
||||
my($evt);
|
||||
if ($_[1]) {
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(TRGT), seld:TEXT(@), from:" .
|
||||
AEPrint($_[0]) . '}';
|
||||
$evt = do_event(qw/CWIE RMOB/, $app, $prm, $_[1]);
|
||||
} else {
|
||||
my($prm) = q"'----':" . AEPrint($_[0]);
|
||||
$evt = do_event(qw/CWIE RMOB/, $app, $prm);
|
||||
}
|
||||
}
|
||||
|
||||
sub _open_file ($) {
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(alis), " .
|
||||
q"seld:TEXT(@), from:'null'()}";
|
||||
|
||||
do_event(qw/aevt odoc/, $app, $prm, $_[0]);
|
||||
}
|
||||
|
||||
sub import_project ($$) {
|
||||
my($xml_file, $project_path) = @_;
|
||||
|
||||
my($prm) = "kocl:type(PRJD), rtyp:TEXT(@), data:TEXT(@), &subj:'null'()";
|
||||
|
||||
my($evt) = do_event(qw/core crel/, $app, $prm, $project_path, $xml_file);
|
||||
my($result) = _get_event_result($evt);
|
||||
|
||||
if ($result eq "") {
|
||||
_close(_get_project($project_path));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub export_project ($$) {
|
||||
my($project_path, $xml_out_path) = @_;
|
||||
my($p, $project_was_closed);
|
||||
|
||||
$project_was_closed = 0;
|
||||
while (1) {
|
||||
$p = _get_project($project_path);
|
||||
if (!$p) {
|
||||
if ($project_was_closed) {
|
||||
print "### Error - request for project document failed after opening\n";
|
||||
die "### possibly CW bug: be sure to close your Find window\n";
|
||||
}
|
||||
$project_was_closed = 1;
|
||||
_open_file($project_path);
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# avoid problems with the Project Messages window
|
||||
_close_named_window("Project Messages");
|
||||
|
||||
my($prm) =
|
||||
q"'----':obj {form:indx, want:type(PRJD), " .
|
||||
q"seld:1, from:'null'()}, kfil:TEXT(@)";
|
||||
|
||||
my($evt) = do_event(qw/CWIE EXPT/, $app, $prm, $xml_out_path);
|
||||
|
||||
if ($project_was_closed) {
|
||||
$p = _get_project($project_path);
|
||||
_close($p);
|
||||
}
|
||||
|
||||
return _get_event_result($evt);
|
||||
}
|
||||
|
||||
sub _doc_named ($) {
|
||||
my($prm) =
|
||||
q"'----':obj {form:test, want:type(docu), from:'null'(), " .
|
||||
q"seld:cmpd{relo:'= ', 'obj1':obj {form:prop, want:type" .
|
||||
q"(prop), seld:type(pnam), from:'exmn'()}, 'obj2':TEXT(@)}}";
|
||||
|
||||
my($evt) = do_event(qw/core getd/, $app, $prm, $_[0]);
|
||||
return($evt->{REPLY} eq 'aevt\ansr{}' ? undef : $evt);
|
||||
}
|
||||
|
||||
sub _full_path ($) {
|
||||
my($obj) = $_[0];
|
||||
my($prm) =
|
||||
q"'----':obj {form:prop, want:type(prop), seld:type(FILE), " .
|
||||
q"from:" . AEPrint($_[0]) . q"}, rtyp:type(TEXT)";
|
||||
my($evt) = do_event(qw/core getd/, $app, $prm);
|
||||
|
||||
return MacPerl::MakePath(
|
||||
MacUnpack('fss ', (
|
||||
AEGetParamDesc($evt->{REP}, keyDirectObject()))->data()->get()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
sub _save_errors_window ($) {
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(alis), seld:TEXT(@), from:'null'()}";
|
||||
do_event(qw/MMPR SvMs/, $app, $prm, $_[0]);
|
||||
}
|
||||
|
||||
|
||||
sub _close_errors_window () {
|
||||
return _close_named_window('Errors & Warnings');
|
||||
}
|
||||
|
||||
|
||||
sub _close_named_window ($) {
|
||||
my($window_name) = @_;
|
||||
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(cwin), " .
|
||||
q"seld:TEXT(@), from:'null'()}";
|
||||
|
||||
my($evt) = do_event(qw/core clos/, $app, $prm, $window_name);
|
||||
return($evt->{REPLY} eq 'aevt\ansr{}' ? 1 : 0);
|
||||
}
|
||||
|
||||
sub _close () {
|
||||
my($prm) = q"'----':" . AEPrint($_[0]);
|
||||
do_event(qw/core clos/, $app, $prm);
|
||||
}
|
||||
|
||||
sub _get_dobj ($) {
|
||||
return(AEGetParamDesc($_[0]->{REP}, keyDirectObject()));
|
||||
}
|
||||
|
||||
sub _get_folder ($$) {
|
||||
require 'GUSI.ph';
|
||||
my($prompt, $default) = @_;
|
||||
MacPerl::Choose(
|
||||
GUSI::AF_FILE(), 0, $prompt, '',
|
||||
GUSI::CHOOSE_DIR() + ($default ? &GUSI::CHOOSE_DEFAULT : 0),
|
||||
$default
|
||||
);
|
||||
}
|
||||
|
||||
sub _get_event_result ($)
|
||||
{
|
||||
my($evt) = @_;
|
||||
|
||||
my($result) = $evt->{ERROR};
|
||||
|
||||
if ( $result eq "" && $evt->{ERRNO} != 0 )
|
||||
{
|
||||
$result = "unknown error (".$evt->{ERRNO}.")";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
sub _save_appath ($$) {
|
||||
|
||||
my($cwd) = cwd(); # remember the current working dir
|
||||
chdir($scriptDir); # change dir to the script dir
|
||||
|
||||
local(*F);
|
||||
open(F, '>' . $_[0]) or die $!;
|
||||
print F $_[1];
|
||||
close(F);
|
||||
|
||||
chdir($cwd); # restore the cwd
|
||||
}
|
||||
|
||||
sub _read_appath ($) {
|
||||
|
||||
my($filepath) = @_;
|
||||
|
||||
my($cwd) = cwd(); # remember the current working dir
|
||||
chdir($scriptDir); # change dir to the script dir
|
||||
|
||||
if (! -e $filepath) {
|
||||
return "";
|
||||
}
|
||||
|
||||
local(*F);
|
||||
open(F, $filepath);
|
||||
my($appath) = <F>;
|
||||
close(F);
|
||||
|
||||
chdir($cwd); # restore the cwd
|
||||
return($appath);
|
||||
}
|
||||
|
||||
|
||||
sub _test ($) {
|
||||
activate($ide_loc_file);
|
||||
my($path) = $_[0];
|
||||
build_project(
|
||||
"${path}modules:xml:macbuild:XML.mcp", '',
|
||||
"${path}build:mac:Mozilla.BuildLog.part"
|
||||
);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
||||
=back
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
=over 4
|
||||
|
||||
=item v1.02, September 23, 1998
|
||||
|
||||
Made fixes in finding and saving location of CodeWarrior IDE.
|
||||
|
||||
=item v1.01, June 1, 1998
|
||||
|
||||
Made fixes to C<chdir()> in C<activate()>, made C<activate()> more robust
|
||||
in finding CodeWarrior IDE, added global variable to NOT switch to IDE
|
||||
for each sent event, a few other fixes.
|
||||
|
||||
=item v1.00, May 30, 1998
|
||||
|
||||
First shot
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Chris Nandor F<E<lt>pudge@pobox.comE<gt>>, and the author of the
|
||||
original I<CodeWarriorLib>, Scott Collins F<E<lt>scc@netscape.comE<gt>>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
BuildProject L<Moz>.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
=cut
|
||||
573
mozilla/build/mac/build_scripts/Moz/Jar.pm
Normal file
573
mozilla/build/mac/build_scripts/Moz/Jar.pm
Normal file
@@ -0,0 +1,573 @@
|
||||
#!perl -w
|
||||
package Moz::Jar;
|
||||
|
||||
#
|
||||
# Module for creating jar files, either using a jar manifest, or
|
||||
# simply jarring up folders on disk.
|
||||
#
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
use Archive::Zip;
|
||||
use File::Path;
|
||||
|
||||
use Mac::Files;
|
||||
|
||||
use Moz::Moz;
|
||||
|
||||
use vars qw( @ISA @EXPORT );
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
CreateJarFileFromDirectory
|
||||
CreateJarFromManifest
|
||||
WriteOutJarFiles
|
||||
SanityCheckJarOptions
|
||||
);
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Add the contents of a directory to the zip file
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub _addDirToJar($$$$)
|
||||
{
|
||||
my($dir, $jar_root, $zip, $compress) = @_;
|
||||
|
||||
opendir(DIR, $dir) or die "Error: Cannot open dir $dir\n";
|
||||
my @files = readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
my $unix_jar_root = $jar_root;
|
||||
$unix_jar_root =~ s|:|/|g; # colon to slash conversion
|
||||
|
||||
my $file;
|
||||
|
||||
foreach $file (@files)
|
||||
{
|
||||
my $filepath = $dir.":".$file;
|
||||
|
||||
if (-d $filepath)
|
||||
{
|
||||
print "Adding files to jar from $filepath\n";
|
||||
_addDirToJar($filepath, $jar_root, $zip, $compress);
|
||||
}
|
||||
else
|
||||
{
|
||||
my $member = Archive::Zip::Member->newFromFile($filepath);
|
||||
die "Error: Failed to create zip file member $filepath\n" unless $member;
|
||||
|
||||
my $unixName = $filepath;
|
||||
$unixName =~ s|:|/|g; # colon to slash conversion
|
||||
$unixName =~ s|^$unix_jar_root||; # relativise
|
||||
|
||||
$member->fileName($unixName);
|
||||
|
||||
# print "Adding $file as $unixName\n";
|
||||
|
||||
if ($compress) {
|
||||
$member->desiredCompressionMethod(Archive::Zip::COMPRESSION_DEFLATED);
|
||||
} else {
|
||||
$member->desiredCompressionMethod(Archive::Zip::COMPRESSION_STORED);
|
||||
}
|
||||
|
||||
$zip->addMember($member);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Add the contents of a directory to the zip file
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub CreateJarFileFromDirectory($$$)
|
||||
{
|
||||
my($srcdir, $jarpath, $compress) = @_;
|
||||
|
||||
my $zip = Archive::Zip->new();
|
||||
|
||||
_addDirToJar($srcdir, $srcdir, $zip, $compress);
|
||||
|
||||
print "Saving zip file...\n";
|
||||
my $status = $zip->writeToFileNamed($jarpath);
|
||||
if ($status == 0) {
|
||||
print "Zipping completed successfully\n";
|
||||
} else {
|
||||
print "Error saving zip file\n";
|
||||
}
|
||||
|
||||
# set the file type/creator to something reasonable
|
||||
MacPerl::SetFileInfo("ZIP ", "ZIP ", $jarpath);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# printZipContents
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub printZipContents($)
|
||||
{
|
||||
my($zip) = @_;
|
||||
|
||||
my(@members) = $zip->memberNames();
|
||||
|
||||
print "Zip contains:\n";
|
||||
|
||||
my($member);
|
||||
foreach $member (@members)
|
||||
{
|
||||
print " $member\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# safeSaveJarFile
|
||||
#
|
||||
# Archive::Zip has a problem where you cannot save a zip file on top of
|
||||
# an existing zip file that it has open, because it holds references
|
||||
# into that zip. So we have to save to a temp file, then do a swap.
|
||||
#
|
||||
# Note that the zip will become invalid after this operation.
|
||||
# If you want to do further operations on it, you'll have to reread it.
|
||||
#-------------------------------------------------------------------------------
|
||||
sub safeSaveJarFile($$)
|
||||
{
|
||||
my($zip, $full_dest_path) = @_;
|
||||
|
||||
my($temp_file_name) = $full_dest_path."_temp";
|
||||
|
||||
($zip->writeToFileNamed($temp_file_name) == Archive::Zip::AZ_OK) || die "Error: died writing jar to temp file $temp_file_name\n";
|
||||
|
||||
unlink $full_dest_path;
|
||||
|
||||
(rename $temp_file_name, $full_dest_path) || die "Error: Failed to rename $temp_file_name\n";
|
||||
|
||||
MacPerl::SetFileInfo("ZIP ", "ZIP ", $full_dest_path);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# addToJarFile
|
||||
#
|
||||
# Add a file to a jar file
|
||||
#
|
||||
# Parameters:
|
||||
# 1. Jar ID. Unix path of jar file inside chrome.
|
||||
# 2. Abs path to jar.mn file (i.e. source) (mac breaks)
|
||||
# 3. File source, relative to jar.mn path (mac breaks)
|
||||
# 4. Abs path to the resulting .jar file (mac breaks)
|
||||
# 5. Relative file path within the jar (unix breaks)
|
||||
# 6. Reference to hash of jar files
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub addToJarFile($$$$$$$)
|
||||
{
|
||||
my($jar_id, $jar_man_dir, $file_src, $jar_path, $file_jar_path, $override, $jars) = @_;
|
||||
|
||||
# print "addToJarFile with:\n $jar_man_dir\n $file_src\n $jar_path\n $file_jar_path\n";
|
||||
|
||||
unless ($jar_path =~ m/(.+:)([^:]+)$/) { die "Error: Bad jar path $jar_path\n"; }
|
||||
|
||||
my($target_dir) = $1;
|
||||
my($jar_name) = $2;
|
||||
|
||||
$target_dir =~ s/[^:]+$//;
|
||||
|
||||
# print "¥ $target_dir $jar_name\n";
|
||||
|
||||
# find the source file
|
||||
my($src) = $jar_man_dir.":".$file_src;
|
||||
if ((!-e $src) && ($file_src =~ m/.+:([^:]+)$/)) # src does not exist. Fall back to looking for src in jar.mn dir
|
||||
{
|
||||
$file_src = $1;
|
||||
$src = $jar_man_dir.":".$file_src;
|
||||
|
||||
if (!-e $src) {
|
||||
die "Error: Can't find chrome file $src\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($main::options{chrome_jars})
|
||||
{
|
||||
my($zip) = $jars->{$jar_id};
|
||||
unless ($zip) { die "Error: Can't find Zip entry for $jar_id\n"; }
|
||||
|
||||
# print "Adding $file_src to jar file $jar_path at $file_jar_path\n";
|
||||
my($member) = Archive::Zip::Member->newFromFile($src);
|
||||
unless ($member) { die "Error: Failed to create zip file member $src\n"; }
|
||||
|
||||
$member->fileName($file_jar_path);
|
||||
|
||||
my($compress) = 1;
|
||||
if ($compress) {
|
||||
$member->desiredCompressionMethod(Archive::Zip::COMPRESSION_DEFLATED);
|
||||
$member->desiredCompressionLevel(Archive::Zip::COMPRESSION_LEVEL_DEFAULT); # defaults to 6
|
||||
} else {
|
||||
$member->desiredCompressionMethod(Archive::Zip::COMPRESSION_STORED);
|
||||
}
|
||||
|
||||
my($old_member) = $zip->memberNamed($file_jar_path);
|
||||
|
||||
if ($override)
|
||||
{
|
||||
if ($old_member)
|
||||
{
|
||||
# print "Overriding $file_jar_path in jar file $jar_id\n";
|
||||
# need to compare mod dates or use the + here
|
||||
$zip->removeMember($old_member);
|
||||
}
|
||||
|
||||
$zip->addMember($member);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($old_member)
|
||||
{
|
||||
#compare dates here
|
||||
my($member_moddate) = $old_member->lastModTime();
|
||||
my($file_moddate) = GetFileModDate($src);
|
||||
|
||||
if ($file_moddate > $member_moddate)
|
||||
{
|
||||
print "Updating older file $file_jar_path in $jar_id\n";
|
||||
$zip->removeMember($old_member);
|
||||
$zip->addMember($member);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "File $file_jar_path in $jar_id is more recent. Not updating.\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$zip->addMember($member);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($main::options{chrome_files}) # we install raw files too
|
||||
{
|
||||
my($rel_path) = $file_jar_path;
|
||||
$rel_path =~ s|/|:|g; # slash to colons
|
||||
|
||||
my($dir_name) = $jar_name;
|
||||
$dir_name =~ s/\.jar$//;
|
||||
|
||||
my($dst) = $target_dir.$dir_name.":".$rel_path;
|
||||
|
||||
# print "Aliassing $src\n to\n$dst\n";
|
||||
if ($override)
|
||||
{
|
||||
unlink $dst;
|
||||
MakeAlias($src, $dst); # don't check errors, otherwise we fail on replacement
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-e $dst)
|
||||
{
|
||||
#compare dates here
|
||||
my($dst_moddate) = GetFileModDate($dst);
|
||||
my($file_moddate) = GetFileModDate($src);
|
||||
|
||||
if ($file_moddate > $dst_moddate)
|
||||
{
|
||||
print "Updating older file $rel_path in $dir_name\n";
|
||||
unlink $dst;
|
||||
MakeAlias($src, $dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "File $file_jar_path in $jar_id is more recent. Not updating.\n";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MakeAlias($src, $dst);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# setupJarFile
|
||||
#
|
||||
# setup a zip for writing
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub setupJarFile($$$)
|
||||
{
|
||||
my($jar_id, $dest_path, $jar_hash) = @_;
|
||||
|
||||
# print "Creating jar file $jar_id at $jar_path\n";
|
||||
|
||||
my($jar_file) = $jar_id;
|
||||
$jar_file =~ s|/|:|g; # slash to colons
|
||||
my($full_jar_path) = full_path_to($dest_path.":".$jar_file);
|
||||
|
||||
if ($main::options{chrome_jars})
|
||||
{
|
||||
my($zip) = $jar_hash->{$jar_id};
|
||||
if (!$zip) # if we haven't made it already, do so
|
||||
{
|
||||
my($zip) = Archive::Zip->new();
|
||||
$jar_hash->{$jar_id} = $zip;
|
||||
|
||||
# does the jar file exist already? If so, read it in
|
||||
if (-e $full_jar_path)
|
||||
{
|
||||
print "Reading in jar file $jar_id\n";
|
||||
if ($zip->read($full_jar_path) != Archive::Zip::AZ_OK) { die "Error: Failed to re-read $full_jar_path\n"; }
|
||||
|
||||
# printZipContents($zip);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# installing files.
|
||||
# nothing to do. MakeAlias creates dirs as needed.
|
||||
|
||||
# add this jar to the list
|
||||
$jar_hash->{$jar_id} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# closeJarFile
|
||||
#
|
||||
# We're done with this jar file _for this jar.mn_. We may add more entries
|
||||
# to it later, so keep it open in the hash.
|
||||
#-------------------------------------------------------------------------------
|
||||
sub closeJarFile($$)
|
||||
{
|
||||
my($jar_path, $jar_hash) = @_;
|
||||
|
||||
# print "Closing jar file $jar_path\n";
|
||||
|
||||
if ($main::options{chrome_jars})
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
# installing files.
|
||||
# nothing to do
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# WriteOutJarFiles
|
||||
#
|
||||
# Now we dump out the jars
|
||||
#-------------------------------------------------------------------------------
|
||||
sub WriteOutJarFiles($$)
|
||||
{
|
||||
my($chrome_dir, $jars) = @_;
|
||||
|
||||
unless ($main::options{chrome_jars}) { return; }
|
||||
|
||||
my($full_chrome_path) = full_path_to($chrome_dir);
|
||||
|
||||
my($key);
|
||||
foreach $key (keys %$jars)
|
||||
{
|
||||
my($zip) = $jars->{$key};
|
||||
|
||||
my($rel_path) = $key;
|
||||
$rel_path =~ s/\//:/g;
|
||||
|
||||
my($output_path) = $full_chrome_path.":".$rel_path;
|
||||
|
||||
print "Writing zip file $key to $output_path\n";
|
||||
|
||||
# ensure the target dirs exist
|
||||
my($path) = $output_path;
|
||||
$path =~ s/[^:]+$//;
|
||||
mkpath($path);
|
||||
|
||||
# unlink $output_path; # remove any existing jar
|
||||
safeSaveJarFile($zip, $output_path);
|
||||
# $zip is invalid after this operation, so nuke it here
|
||||
$jars->{$key} = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# registerChromePackage
|
||||
#
|
||||
# Enter a chrome package into the installed-chrome.txt file
|
||||
#-------------------------------------------------------------------------------
|
||||
sub registerChromePackage($$$$$$)
|
||||
{
|
||||
my($jar_file, $file_path, $chrome_dir, $jar_hash, $chrome_type, $pkg_name) = @_;
|
||||
|
||||
my($manifest_subdir) = $jar_file;
|
||||
$manifest_subdir =~ s/:/\//g;
|
||||
|
||||
my($chrome_entry);
|
||||
|
||||
if ($main::options{use_jars}) {
|
||||
$chrome_entry = "$chrome_type,install,url,jar:resource:/chrome/$manifest_subdir!/$chrome_type/$pkg_name";
|
||||
} else {
|
||||
$manifest_subdir =~ s/\.jar$//;
|
||||
$chrome_entry = "$chrome_type,install,url,resource:/chrome/$manifest_subdir/$chrome_type/$pkg_name";
|
||||
}
|
||||
|
||||
# print "Entering $chrome_entry in installed-chrome.txt\n";
|
||||
|
||||
# ensure chrome_dir exists
|
||||
mkpath($chrome_dir);
|
||||
|
||||
my($inst_chrome) = ${chrome_dir}.":installed-chrome.txt";
|
||||
|
||||
if (open(CHROMEFILE, "<$inst_chrome")) {
|
||||
while (<CHROMEFILE>) {
|
||||
chomp;
|
||||
if ($_ eq $chrome_entry) {
|
||||
# $chrome_entry already appears in installed-chrome.txt file
|
||||
# just update the mod date
|
||||
my $now = time;
|
||||
utime($now, $now, $inst_chrome) || die "Error: Couldn't touch $inst_chrome";
|
||||
print "+++ updating chrome $inst_chrome\n+++\t\t$chrome_entry\n";
|
||||
close(CHROMEFILE) || die "Error: can't close $inst_chrome: $!";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
close(CHROMEFILE) || die "Error: can't close $inst_chrome: $!";
|
||||
}
|
||||
open(CHROMEFILE, ">>${inst_chrome}") || die "Error: Failed to open $inst_chrome\n";
|
||||
print(CHROMEFILE "${chrome_entry}\n");
|
||||
close(CHROMEFILE) || die "Error: Failed to close $inst_chrome\n";
|
||||
print "+++ adding chrome $inst_chrome\n+++\t\t$chrome_entry\n";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Create or add to a jar file from a jar.mn file.
|
||||
# Both arguments are relative to the mozilla root dir.
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub CreateJarFromManifest($$$)
|
||||
{
|
||||
my($jar_man_path, $dest_path, $jars) = @_;
|
||||
|
||||
if ($main::options{chrome_jars}) {
|
||||
print "Jarring from $jar_man_path\n";
|
||||
}
|
||||
if ($main::options{chrome_files}) {
|
||||
print "Installing files from $jar_man_path\n";
|
||||
}
|
||||
|
||||
$jar_man_path = full_path_to($jar_man_path);
|
||||
$dest_path = full_path_to($dest_path);
|
||||
|
||||
# if the jars hash is empty, nuke installed-chrome.txt
|
||||
if (! scalar(%$jars))
|
||||
{
|
||||
print "Nuking installed-chrome.txt\n";
|
||||
my($installed_chrome) = $dest_path.":installed-chrome.txt";
|
||||
# unlink $installed_chrome;
|
||||
}
|
||||
|
||||
my $jar_man_dir = "";
|
||||
my $jar_man_file = "";
|
||||
|
||||
if ($jar_man_path =~ /(.+):([^:]+)$/)
|
||||
{
|
||||
$jar_man_dir = $1; # no trailing :
|
||||
$jar_man_file = $2;
|
||||
}
|
||||
|
||||
# Keep a hash of jar files, keyed on relative jar path (e.g. "packages/core.jar")
|
||||
# Entries are open Archive::Zips (if zipping), and installed-chrome entries.
|
||||
|
||||
my($jar_id) = ""; # Current foo/bar.jar from jar.mn file
|
||||
my($jar_file) = ""; # relative path to jar file (from $dest_path), with mac separators
|
||||
my($full_jar_path);
|
||||
|
||||
open(FILE, "<$jar_man_path") || die "Error: could not open \"$jar_man_path\": $!";
|
||||
while (<FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
# print "$line\n";
|
||||
|
||||
if ($line =~ /^\s*\#.*$/) { # skip comments
|
||||
next;
|
||||
}
|
||||
|
||||
if ($line =~/^([\w\d.\-\_\\\/]+)\:\s*$/) # line start jar file entries
|
||||
{
|
||||
$jar_id = $1;
|
||||
$jar_file = $jar_id;
|
||||
$jar_file =~ s|/|:|g; # slash to colons
|
||||
$full_jar_path = $dest_path.":".$jar_file;
|
||||
|
||||
setupJarFile($jar_id, $dest_path, $jars);
|
||||
|
||||
}
|
||||
elsif ($line =~ /^(\+?)\s+([\w\d.\-\_\\\/]+)\s*(\([\w\d.\-\_\\\/]+\))?$\s*/) # jar file entry
|
||||
{
|
||||
my($override) = ($1 eq "+");
|
||||
my($file_dest) = $2;
|
||||
my($file_src) = $3;
|
||||
|
||||
if ($file_src) {
|
||||
$file_src = substr($file_src, 1, -1); #strip the ()
|
||||
} else {
|
||||
$file_src = $file_dest;
|
||||
}
|
||||
|
||||
$file_src =~ s|/|:|g;
|
||||
|
||||
if ($jar_file ne "") # if jar is open, add to jar
|
||||
{
|
||||
if ($file_dest =~ /([\w\d.\-\_]+)\/([\w\d.\-\_\\\/]+)contents.rdf/)
|
||||
{
|
||||
my $chrome_type = $1;
|
||||
my $pkg_name = $2;
|
||||
registerChromePackage($jar_file, $file_dest, $dest_path, $jars, $chrome_type, $pkg_name);
|
||||
}
|
||||
|
||||
addToJarFile($jar_id, $jar_man_dir, $file_src, $full_jar_path, $file_dest, $override, $jars);
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Error: bad jar.mn format at $line\n";
|
||||
}
|
||||
}
|
||||
elsif ($line =~ /^\s*$/ ) # blank line
|
||||
{
|
||||
if ($jar_file ne "") #if a jar file is open, close it
|
||||
{
|
||||
closeJarFile($full_jar_path, $jars);
|
||||
|
||||
$jar_file = "";
|
||||
$full_jar_path = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
|
||||
if ($jar_file ne "") #if a jar file is open, close it
|
||||
{
|
||||
closeJarFile($full_jar_path, $jars);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
228
mozilla/build/mac/build_scripts/Moz/MacCVS.pm
Normal file
228
mozilla/build/mac/build_scripts/Moz/MacCVS.pm
Normal file
@@ -0,0 +1,228 @@
|
||||
#!perl -w
|
||||
package Moz::MacCVS;
|
||||
|
||||
# package Mac::Apps::MacCVS; this should really be the name of the package
|
||||
# but due to our directory hierarchy in mozilla, I am not doing it
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT);
|
||||
|
||||
use Cwd;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
use Mac::StandardFile;
|
||||
use Mac::AppleEvents;
|
||||
use Mac::AppleEvents::Simple;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(new describe checkout update);
|
||||
$VERSION = "1.00";
|
||||
|
||||
# If you want to understand the gobbldeygook that's used to build Apple Events,
|
||||
# you should start by reading the AEGizmos documentation.
|
||||
|
||||
|
||||
# Architecture:
|
||||
# cvs session object:
|
||||
# name - session name
|
||||
# session_file - session file
|
||||
#
|
||||
#
|
||||
|
||||
my($last_error) = 0;
|
||||
my($gAppSig) = 'Mcvs'; # MacCVS Pro
|
||||
|
||||
#
|
||||
# utility routines
|
||||
#
|
||||
|
||||
|
||||
sub _checkForEventError($)
|
||||
{
|
||||
my($evt) = @_;
|
||||
|
||||
if ($evt->{ERRNO} != 0)
|
||||
{
|
||||
print STDERR "Error. Script returned '$evt->{ERROR} (error $evt->{ERRNO})\n";
|
||||
$last_error = $evt->{ERRNO};
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1; # success
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Session object methods
|
||||
#
|
||||
|
||||
sub new
|
||||
{
|
||||
my ( $proto, $session_file) = @_;
|
||||
my $class = ref($proto) || $proto;
|
||||
my $self = {};
|
||||
|
||||
if ( defined($session_file) && ( -e $session_file) )
|
||||
{
|
||||
$self->{"name"} = basename( $session_file );
|
||||
$self->{"session_file"} = $session_file;
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "MacCVS->new cvs file < $session_file > does not exist\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# makes sure that the session is open
|
||||
# assertSessionOpen()
|
||||
# returns 1 on success
|
||||
sub assertSessionOpen()
|
||||
{
|
||||
my ($self) = shift;
|
||||
|
||||
$last_error = 0;
|
||||
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(alis), seld:TEXT(@), from:'null'()}";
|
||||
|
||||
my($evt) = do_event(qw/aevt odoc/, $gAppSig, $prm, $self->{session_file});
|
||||
return _checkForEventError($evt);
|
||||
}
|
||||
|
||||
# prints the cvs object, used mostly for debugging
|
||||
sub describe
|
||||
{
|
||||
my($self) = shift;
|
||||
$last_error = 0;
|
||||
print "MacCVS:: name: ", $self->{name}, " session file: ", $self->{session_file}, "\n";
|
||||
}
|
||||
|
||||
# checkout( self, module, revision, date)
|
||||
# MacCVS checkout command
|
||||
# returns 1 on success.
|
||||
sub checkout()
|
||||
{
|
||||
my($self, $module, $revision, $date ) = @_;
|
||||
unless( defined ($module) ) { $module = ""; } # get rid of the pesky undefined warnings
|
||||
unless( defined ($revision) ) { $revision = ""; }
|
||||
unless( defined ($date) ) { $date = ""; }
|
||||
|
||||
$last_error = 0;
|
||||
|
||||
$self->assertSessionOpen() || die "Error: failed to open MacCVS session file at $self->{session_file}\n";
|
||||
|
||||
my($revstring) = ($revision ne "") ? $revision : "(none)";
|
||||
my($datestring) = ($date ne "") ? $date : "(none)";
|
||||
|
||||
print "Checking out $module with revision $revstring, date $datestring\n";
|
||||
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(docu), seld:TEXT(@), from:'null'()}, ".
|
||||
q"modl:'TEXT'(@), tagr:'TEXT'(@), tagd:'TEXT'(@) ";
|
||||
|
||||
my($evt) = do_event(qw/MCvs cout/, $gAppSig, $prm, $self->{name}, $module, $revision, $date);
|
||||
return _checkForEventError($evt);
|
||||
}
|
||||
|
||||
|
||||
# update( self, branch tag, list of paths)
|
||||
# MacCVS udate command
|
||||
# returns 1 on success.
|
||||
# NOTE: MacCVS Pro does not correctly support this stuff yet (as of version 2.7d5).
|
||||
sub update()
|
||||
{
|
||||
my($self, $branch, $paths ) = @_;
|
||||
|
||||
$last_error = 0;
|
||||
|
||||
$self->assertSessionOpen() || die "Error: failed to open MacCVS session file at $self->{session_file}\n";
|
||||
|
||||
if ($branch eq "HEAD") {
|
||||
$branch = "";
|
||||
}
|
||||
|
||||
my($paths_list) = "";
|
||||
|
||||
my($path);
|
||||
foreach $path (@$paths)
|
||||
{
|
||||
if ($paths_list ne "") {
|
||||
$paths_list = $paths_list.", ";
|
||||
}
|
||||
|
||||
$paths_list = $paths_list."Ò".$path."Ó";
|
||||
}
|
||||
|
||||
my($prm) =
|
||||
q"'----':obj {form:name, want:type(docu), seld:TEXT(@), from:'null'()}, ".
|
||||
q"tagr:'TEXT'(@), tFls:[";
|
||||
|
||||
$prm = $prm.$paths_list."]";
|
||||
|
||||
my($evt) = do_event(qw/MCvs updt/, $gAppSig, $prm, $self->{name}, $branch);
|
||||
return _checkForEventError($evt);
|
||||
};
|
||||
|
||||
|
||||
sub getLastError()
|
||||
{
|
||||
return $last_error;
|
||||
}
|
||||
|
||||
1;
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MacCVS - Interface to MacCVS
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use MacCVS;
|
||||
$session = MacCVS->new( <session_file_path>) || die "cannot create session";
|
||||
$session->checkout([module] [revision] [date]) || die "Could not check out";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is a MacCVS interface for talking to MacCVS Pro client.
|
||||
MacCVSSession is the class used to manipulate the session
|
||||
|
||||
=item new
|
||||
MacCVS->new( <cvs session file path>);
|
||||
|
||||
Creates a new session. Returns undef on failure.
|
||||
|
||||
=item checkout( <module> [revision] [date] )
|
||||
|
||||
cvs checkout command. Revision and date are optional
|
||||
returns 0 on failure
|
||||
|
||||
=cut
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
=item MacCVS Home Page
|
||||
|
||||
http://www.maccvs.org/
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Aleks Totic atotic@netscape.com
|
||||
Simon Fraser sfraser@netscape.com
|
||||
|
||||
=cut
|
||||
|
||||
__END__
|
||||
603
mozilla/build/mac/build_scripts/Moz/Moz.pm
Normal file
603
mozilla/build/mac/build_scripts/Moz/Moz.pm
Normal file
@@ -0,0 +1,603 @@
|
||||
=head1 NAME
|
||||
|
||||
B<Moz> - routines for automating CodeWarrior builds, and some extra-curricular
|
||||
activities related to building Mozilla
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use Moz;
|
||||
|
||||
OpenErrorLog(":::BuildLog");
|
||||
StopForErrors();
|
||||
|
||||
$Moz::QUIET = 1;
|
||||
InstallFromManifest(":projects:MANIFEST", $dist_dir);
|
||||
|
||||
BuildProjectClean(":projects:SomeProject.mcp", "SomeTarget");
|
||||
MakeAlias(":projects:SomeProject.shlb", $dist_dir);
|
||||
|
||||
DontStopForErrors();
|
||||
|
||||
BuildProject(":projects:SomeOtherProject.mcp", "SomeTarget");
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<Moz> comprises the routines needed to slap CodeWarrior around, force it
|
||||
to build a sequence of projects, report the results, and a few other things.
|
||||
This module should only contain functions that are generic to any build,
|
||||
not just the Mozilla build.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
package Moz::Moz;
|
||||
require Exporter;
|
||||
|
||||
use Cwd;
|
||||
|
||||
use File::Copy;
|
||||
use File::Path;
|
||||
use File::Basename;
|
||||
|
||||
use Mac::Types;
|
||||
use Mac::Events;
|
||||
use Mac::Processes;
|
||||
|
||||
use ExtUtils::Manifest 'maniread';
|
||||
|
||||
use Moz::CodeWarriorLib;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
|
||||
@EXPORT = qw( LaunchCodeWarrior
|
||||
GetCodeWarriorRelativePath
|
||||
current_directory
|
||||
full_path_to
|
||||
DoBuildProject
|
||||
ImportXMLProject
|
||||
ExportProjectToXML
|
||||
OpenErrorLog
|
||||
MakeAlias
|
||||
GetFileModDate
|
||||
StopForErrors
|
||||
DontStopForErrors
|
||||
InstallFromManifest
|
||||
InstallResources
|
||||
RedirectOutputToFile
|
||||
Delay
|
||||
ActivateApplication
|
||||
IsProcessRunning);
|
||||
|
||||
@EXPORT_OK = qw(CloseErrorLog QUIET);
|
||||
|
||||
|
||||
sub current_directory()
|
||||
{
|
||||
my $current_directory = cwd();
|
||||
chop($current_directory) if ( $current_directory =~ m/:$/ );
|
||||
return $current_directory;
|
||||
}
|
||||
|
||||
sub full_path_to($)
|
||||
{
|
||||
my ($path) = @_;
|
||||
if ( $path =~ m/^[^:]+$/ )
|
||||
{
|
||||
$path = ":" . $path;
|
||||
}
|
||||
|
||||
if ( $path =~ m/^:/ )
|
||||
{
|
||||
$path = current_directory() . $path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
$logging = 0;
|
||||
$recent_errors_file = "";
|
||||
$stop_on_1st_error = 1;
|
||||
$QUIET = 0;
|
||||
|
||||
|
||||
|
||||
=head2 Logging all the errors and warnings - C<OpenErrorLog($log_file)>, C<CloseErrorLog()>
|
||||
|
||||
The warnings and errors generated in the course of building projects can be logged to a file.
|
||||
Tinderbox uses this facility to show why a remote build failed.
|
||||
|
||||
Logging is off by default.
|
||||
Start logging at any point in your build process with C<OpenErrorLog($log_file)>.
|
||||
Stop with C<CloseErrorLog()>.
|
||||
You never need to close the log explicitly, unless you want to just log a couple of projects in the middle of a big list.
|
||||
C<CloseErrorLog()> is not exported by default.
|
||||
|
||||
=cut
|
||||
|
||||
sub CloseErrorLog()
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
close(ERROR_LOG);
|
||||
$logging = 0;
|
||||
StopForErrors() if $stop_on_1st_error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub OpenErrorLog($)
|
||||
{
|
||||
my ($log_file) = @_;
|
||||
|
||||
CloseErrorLog();
|
||||
if ( $log_file )
|
||||
{
|
||||
$log_file = full_path_to($log_file);
|
||||
|
||||
open(ERROR_LOG, ">$log_file") || die "Error: Can't open $log_file\n";
|
||||
MacPerl::SetFileInfo("CWIE", "TEXT", $log_file);
|
||||
|
||||
$log_file =~ m/.+:(.+)/;
|
||||
$recent_errors_file = full_path_to("$1.part");
|
||||
$logging = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=head2 Stopping before it's too late - C<StopForErrors()>, C<DontStopForErrors()>
|
||||
|
||||
When building a long list of projects, you decide whether to continue building subsequent projects when one fails.
|
||||
By default, your build script will C<die> after the first project that generates an error while building.
|
||||
Change this behavior with C<DontStopForErrors()>.
|
||||
Re-enable it with C<StopForErrors()>.
|
||||
|
||||
=cut
|
||||
|
||||
sub StopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 1;
|
||||
|
||||
# Can't stop for errors unless we notice them.
|
||||
# Can't notice them unless we are logging.
|
||||
# If the user didn't explicitly request logging, log to a temporary file.
|
||||
|
||||
if ( ! $recent_errors_file )
|
||||
{
|
||||
OpenErrorLog("${TMPDIR}BuildResults");
|
||||
}
|
||||
}
|
||||
|
||||
sub DontStopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 0;
|
||||
}
|
||||
|
||||
sub log_message($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
print ERROR_LOG $message;
|
||||
}
|
||||
}
|
||||
|
||||
sub log_message_with_time($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
my $time_stamp = localtime();
|
||||
log_message("$message ($time_stamp)\n");
|
||||
}
|
||||
}
|
||||
|
||||
sub log_recent_errors($)
|
||||
{
|
||||
my ($project_name) = @_;
|
||||
my $found_errors = 0;
|
||||
|
||||
if ( $logging )
|
||||
{
|
||||
open(RECENT_ERRORS, "<$recent_errors_file");
|
||||
|
||||
while( <RECENT_ERRORS> )
|
||||
{
|
||||
if ( /^Error/ || /^CouldnÕt find project file/ || /^Link Error/ )
|
||||
{
|
||||
# if (!$found_errors)
|
||||
# print $_;
|
||||
$found_errors = 1;
|
||||
}
|
||||
print ERROR_LOG $_;
|
||||
}
|
||||
|
||||
close(RECENT_ERRORS);
|
||||
unlink("$recent_errors_file");
|
||||
}
|
||||
|
||||
if ( $stop_on_1st_error && $found_errors )
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Errors encountered building \"$project_name\".\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub DoBuildProject($$$)
|
||||
{
|
||||
my ($project_path, $target_name, $clean_build) = @_;
|
||||
$project_path = full_path_to($project_path);
|
||||
|
||||
# $project_path =~ m/.+:(.+)/;
|
||||
# my $project_name = $1;
|
||||
|
||||
log_message_with_time("### Building \"$project_path\"");
|
||||
|
||||
# Check that the given project exists
|
||||
if (! -e $project_path)
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Can't find project file \"$project_path\".\n";
|
||||
}
|
||||
|
||||
print "Building \"$project_path\[$target_name\]\"\n";
|
||||
|
||||
$had_errors = Moz::CodeWarriorLib::build_project(
|
||||
$project_path, $target_name, $recent_errors_file, $clean_build
|
||||
);
|
||||
WaitNextEvent();
|
||||
|
||||
# $had_errors =
|
||||
#MacPerl::DoAppleScript(<<END_OF_APPLESCRIPT);
|
||||
# tell (load script file "$CodeWarriorLib") to BuildProject("$project_path", "$project_name", "$target_name", "$recent_errors_file", $clean_build)
|
||||
#END_OF_APPLESCRIPT
|
||||
|
||||
# Append any errors to the globally accumulated log file
|
||||
# if ( $had_errors ) # Removed this test, because we want warnings, too. -- jrm
|
||||
{
|
||||
log_recent_errors($project_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub ImportXMLProject($$)
|
||||
{
|
||||
my ($xml_path, $project_path) = @_;
|
||||
|
||||
# my ($codewarrior_ide_name) = Moz::CodeWarriorLib::getCodeWarriorIDEName();
|
||||
# my $ascript = <<EOS;
|
||||
# tell application "$codewarrior_ide_name"
|
||||
# make new (project document) as ("$project_path") with data ("$xml_path")
|
||||
# end tell
|
||||
#EOS
|
||||
# print $ascript."\n";
|
||||
# my($result) = MacPerl::DoAppleScript($ascript);
|
||||
# unless ($result) { die "Error: ImportXMLProject AppleScript failed $^E $result\n"; }
|
||||
#
|
||||
|
||||
my($import_error) = Moz::CodeWarriorLib::import_project($xml_path, $project_path);
|
||||
if ($import_error ne "") {
|
||||
die "Error: ImportXMLProject failed with error $import_error\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub ExportProjectToXML($$)
|
||||
{
|
||||
my ($project_path, $xml_path) = @_;
|
||||
|
||||
my (@suffix_list) = (".mcp");
|
||||
my ($project_name, $project_dir, $suffix) = fileparse($project_path, @suffix_list);
|
||||
if ($suffix eq "") { die "Project: $project_path doesn't look like a project file.\n"; }
|
||||
|
||||
if (-e $xml_path) {
|
||||
print "$xml_path exists - not exporting $project_path\n";
|
||||
}
|
||||
else {
|
||||
print "Exporting $project_path to $xml_path\n";
|
||||
my($export_error) = Moz::CodeWarriorLib::export_project($project_path, $xml_path);
|
||||
if ($export_error ne "") {
|
||||
die "Error: export_project failed with error '$export_error'\n";
|
||||
}
|
||||
|
||||
if (! -e $xml_path) {
|
||||
die "Error: XML export to $xml_path failed\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=head2 Miscellaneous
|
||||
|
||||
C<MakeAlias($old_file, $new_file)> functions like C<symlink()>, except with better argument defaulting and more explicit error messages.
|
||||
|
||||
=cut
|
||||
|
||||
sub MakeAlias($$)
|
||||
{
|
||||
my ($old_file, $new_file) = @_;
|
||||
|
||||
# if the directory to hold $new_file doesn't exist, create it
|
||||
if ( ($new_file =~ m/(.+:)/) && !-d $1 )
|
||||
{
|
||||
mkpath($1);
|
||||
}
|
||||
|
||||
# if a leaf name wasn't specified for $new_file, use the leaf from $old_file
|
||||
if ( ($new_file =~ m/:$/) && ($old_file =~ m/.+:(.+)/) )
|
||||
{
|
||||
$new_file .= $1;
|
||||
}
|
||||
|
||||
my $message = "Can't create a Finder alias (at \"$new_file\")\n for \"$old_file\"; because ";
|
||||
|
||||
die "Error: $message \"$old_file\" doesn't exist.\n" unless -e $old_file;
|
||||
die "Error: $message I won't replace an existing (non-alias) file with an alias.\n" if ( -e $new_file && ! -l $new_file );
|
||||
|
||||
# now: $old_file exists; $new_file doesn't (or else, is an alias already)
|
||||
|
||||
if ( -l $new_file )
|
||||
{
|
||||
# ...then see if it already points to $old_file
|
||||
my $current_target = full_path_to(readlink($new_file));
|
||||
my $new_target = full_path_to($old_file);
|
||||
|
||||
return if ( $current_target eq $new_target );
|
||||
# if the desired alias already exists and points to the right thing, then we're done
|
||||
|
||||
unlink $new_file;
|
||||
}
|
||||
|
||||
symlink($old_file, $new_file) || die "Error: $message symlink returned an unexpected error.\n";
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
C<InstallFromManifest()>
|
||||
|
||||
=cut
|
||||
|
||||
sub InstallFromManifest($;$$)
|
||||
{
|
||||
my ($manifest_file, $dest_dir, $flat) = @_;
|
||||
|
||||
$flat = 0 unless defined($flat); # if $flat, all rel. paths in MANIFEST get aliased to the root of $dest_dir
|
||||
|
||||
$dest_dir ||= ":";
|
||||
|
||||
$manifest_file =~ m/(.+):/;
|
||||
my $source_dir = $1;
|
||||
|
||||
chop($dest_dir) if $dest_dir =~ m/:$/;
|
||||
|
||||
#Mac::Events->import();
|
||||
WaitNextEvent();
|
||||
if ($flat)
|
||||
{
|
||||
print "Doing manifest on \"$manifest_file\" FLAT\n" unless $QUIET;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Doing manifest on \"$manifest_file\"\n" unless $QUIET;
|
||||
}
|
||||
|
||||
my $read = maniread(full_path_to($manifest_file));
|
||||
foreach $file (keys %$read)
|
||||
{
|
||||
next unless $file;
|
||||
|
||||
$subdir = ":";
|
||||
if (!$flat && ($file =~ /:.+:/ ))
|
||||
{
|
||||
$subdir = $&;
|
||||
}
|
||||
|
||||
$file = ":$file" unless $file =~ m/^:/;
|
||||
MakeAlias("$source_dir$file", "$dest_dir$subdir");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
C<InstallResources()>
|
||||
|
||||
=cut
|
||||
|
||||
# parameters are path to MANIFEST file, destination dir, true (to make copies) or false (to make aliases)
|
||||
sub InstallResources($;$;$)
|
||||
{
|
||||
my ($manifest_file, $dest_dir, $copy_files) = @_;
|
||||
|
||||
$dest_dir ||= ":";
|
||||
mkpath($dest_dir) if !-d $dest_dir;
|
||||
|
||||
$manifest_file =~ m/(.+):/;
|
||||
my $source_dir = $1;
|
||||
|
||||
chop($dest_dir) if $dest_dir =~ m/:$/;
|
||||
|
||||
WaitNextEvent();
|
||||
print "Installing resources from \"$manifest_file\"\n" unless $QUIET;
|
||||
|
||||
my $read = maniread(full_path_to($manifest_file));
|
||||
foreach $file (keys %$read)
|
||||
{
|
||||
next unless $file;
|
||||
|
||||
if ($copy_files)
|
||||
{
|
||||
copy("$source_dir:$file", "$dest_dir:$file");
|
||||
}
|
||||
else
|
||||
{
|
||||
MakeAlias("$source_dir:$file", "$dest_dir:$file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// Delay
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub Delay($)
|
||||
{
|
||||
my ($delay_seconds) = @_;
|
||||
|
||||
$now = time;
|
||||
|
||||
$exit_time = $now + $delay_seconds;
|
||||
|
||||
while ($exit_time > $now) {
|
||||
$now = time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetFileModDate
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetFileModDate($)
|
||||
{
|
||||
my($filePath)=@_;
|
||||
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks) = stat($filePath);
|
||||
return $mtime;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// LaunchCodeWarrior
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub LaunchCodeWarrior($)
|
||||
{
|
||||
my($idepath_file) = @_; # full path to IDE location file
|
||||
my($cur_dir) = cwd();
|
||||
|
||||
# this both launches and writes the IDE path file
|
||||
Moz::CodeWarriorLib::activate($idepath_file);
|
||||
|
||||
chdir($cur_dir);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetCodeWarriorRelativePath
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetCodeWarriorRelativePath($)
|
||||
{
|
||||
my($rel_path) = @_;
|
||||
return Moz::CodeWarriorLib::getCodeWarriorPath($rel_path);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// RedirectOutputToFile
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub RedirectOutputToFile($)
|
||||
{
|
||||
my($log_file) = @_;
|
||||
|
||||
# ensure that folders in the path exist
|
||||
my($logdir) = "";
|
||||
my($logfile) = $log_file;
|
||||
|
||||
if ($log_file =~ /(.+?:)([^:]+)$/) # ? for non-greedy match
|
||||
{
|
||||
$logdir = $1;
|
||||
$logfile = $2;
|
||||
|
||||
mkpath($logdir);
|
||||
}
|
||||
|
||||
print "Output is now being redirected to the file '$log_file'\n";
|
||||
|
||||
open(STDOUT, "> $log_file") || die "Can't redirect stdout";
|
||||
open(STDERR, ">&STDOUT") || die "Can't dup stdout";
|
||||
select(STDERR); $| = 1; # make unbuffered
|
||||
select(STDOUT); $| = 1; # make unbuffered
|
||||
|
||||
MacPerl::SetFileInfo("CWIE", "TEXT", $log_file);
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ActivateApplication
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub ActivateApplication($)
|
||||
{
|
||||
my ($appSignature) = @_;
|
||||
my ($psi, $found);
|
||||
my ($appPSN);
|
||||
|
||||
$found = 0;
|
||||
|
||||
foreach $psi (values(%Process))
|
||||
{
|
||||
if ($psi->processSignature() eq $appSignature)
|
||||
{
|
||||
$appPSN = $psi->processNumber();
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found == 0 || SameProcess($appPSN, GetFrontProcess()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetFrontProcess($appPSN);
|
||||
|
||||
while (GetFrontProcess() != $appPSN)
|
||||
{
|
||||
WaitNextEvent();
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// IsProcessRunning
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub IsProcessRunning($)
|
||||
{
|
||||
my($processName, $psn, $psi) = @_;
|
||||
while ( ($psn, $psi) = each(%Process) ) {
|
||||
if ($psi->processName eq $processName) { return 1; }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Scott Collins <scc@netscape.com>, Simon Fraser <sfraser@netscape.com>, Chris Yeh <cyeh@netscape.com>
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
BuildMozillaDebug.pl (et al), BuildList.pm, CodeWarriorLib (an AppleScript library)
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
=cut
|
||||
272
mozilla/build/mac/build_scripts/Moz/Prefs.pm
Normal file
272
mozilla/build/mac/build_scripts/Moz/Prefs.pm
Normal file
@@ -0,0 +1,272 @@
|
||||
|
||||
package Moz::Prefs;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
# Package that attempts to read a file from the Preferences folder,
|
||||
# and get build settings out of it
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use File::Path;
|
||||
|
||||
use Mac::Files;
|
||||
|
||||
use vars qw(@ISA @EXPORT);
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(ReadMozUserPrefs);
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# GetPrefsFolder
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub GetPrefsFolder()
|
||||
{
|
||||
my($prefs_folder) = FindFolder(kOnSystemDisk, kPreferencesFolderType, 1);
|
||||
return $prefs_folder.":Mozilla build prefs";
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# SetArrayValue
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub SetArrayValue($$$)
|
||||
{
|
||||
my($array_ref, $index1, $index2) = @_;
|
||||
|
||||
my($index);
|
||||
foreach $index (@$array_ref)
|
||||
{
|
||||
if ($index->[0] eq $index1)
|
||||
{
|
||||
$index->[1] = $index2;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# WriteDefaultPrefsFile
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub WriteDefaultPrefsFile($)
|
||||
{
|
||||
my($file_path) = @_;
|
||||
|
||||
my($file_contents);
|
||||
$file_contents = <<'EOS';
|
||||
% You can use this file to customize the Mozilla build system.
|
||||
% The following kinds of lines are allowable:
|
||||
% Comment lines, which start with a '%' in the first column
|
||||
% Lines which modify the default build settings. For the list of flags,
|
||||
% see MozBuildFlags.pm. Examples are:
|
||||
%
|
||||
% build pull 0 % don't pull
|
||||
% options mng 1 % turn mng on
|
||||
%
|
||||
% Line containing the special 'buildfrom' flag, which specifies
|
||||
% where to start the build. Example:
|
||||
%
|
||||
% buildfrom nglayout % where to start the build
|
||||
%
|
||||
% Lines which specify the location of the files used to store paths
|
||||
% to the CodeWarrior IDE, and the MacCVS Pro session file. Note quoting
|
||||
% of paths containing whitespace. Examples:
|
||||
%
|
||||
% filepath idepath ::codewarrior.txt
|
||||
% filepath sessionpath ":Some folder:MacCVS session path.txt"
|
||||
%
|
||||
% Lines which modify the build settings like %main::DEBUG.
|
||||
% Any lines which do not match either of the above are assumed
|
||||
% to set variables on $main::. Examples:
|
||||
%
|
||||
% MOZILLA_OFFICIAL 1
|
||||
%
|
||||
EOS
|
||||
|
||||
$file_contents =~ s/%/#/g;
|
||||
|
||||
local(*PREFS_FILE);
|
||||
|
||||
open(PREFS_FILE, "> $file_path") || die "Could not write default prefs file\n";
|
||||
print PREFS_FILE ($file_contents);
|
||||
close(PREFS_FILE);
|
||||
|
||||
MacPerl::SetFileInfo("McPL", "TEXT", $file_path);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# HandlePrefSet
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub HandlePrefSet($$$$)
|
||||
{
|
||||
my($flags, $name, $value, $desc) = @_;
|
||||
|
||||
if (SetArrayValue($flags, $name, $value)) {
|
||||
print "Prefs set $desc flag '$name' to '$value'\n";
|
||||
} else {
|
||||
die "$desc setting '$name' is not a valid option\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# HandleBuildFromPref
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
sub HandleBuildFromPref($$)
|
||||
{
|
||||
my($build_array, $name) = @_;
|
||||
|
||||
my($setting) = 0;
|
||||
my($index);
|
||||
foreach $index (@$build_array)
|
||||
{
|
||||
if ($index->[0] eq $name) {
|
||||
$setting = 1;
|
||||
}
|
||||
|
||||
$index->[1] = $setting;
|
||||
}
|
||||
|
||||
if ($setting == 1) {
|
||||
print "Building from $name onwards, as specified by prefs\n";
|
||||
} else {
|
||||
printf "Failed to find buildfrom setting '$name'\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# ReadPrefsFile
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub ReadPrefsFile($$$$$)
|
||||
{
|
||||
my($file_path, $build_flags, $options_flags, $filepath_flags, $create_if_missing) = @_;
|
||||
|
||||
local(*PREFS_FILE);
|
||||
|
||||
if (open(PREFS_FILE, "< $file_path"))
|
||||
{
|
||||
print "Reading build prefs from '$file_path'\n";
|
||||
|
||||
while (<PREFS_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
if ($line =~ /^\#/ || $line =~ /^\s*$/) { # ignore comments and empty lines
|
||||
next;
|
||||
}
|
||||
|
||||
if (($line =~ /^\s*([^#\s]+)\s+([^#\s]+)\s+\"(.+)\"(\s+#.+)?/) ||
|
||||
($line =~ /^\s*([^#\s]+)\s+([^#\s]+)\s+\'(.+)\'(\s+#.+)?/) ||
|
||||
($line =~ /^\s*([^#\s]+)\s+([^#\s]+)\s+([^#\s]+)(\s+#.+)?/))
|
||||
{
|
||||
my($array_name) = $1;
|
||||
my($option_name) = $2;
|
||||
my($option_value) = $3;
|
||||
|
||||
# print "Read '$array_name' '$option_name' '$option_value'\n";
|
||||
|
||||
if ($array_name eq "build")
|
||||
{
|
||||
HandlePrefSet($build_flags, $option_name, $option_value, "Build");
|
||||
}
|
||||
elsif ($array_name eq "options")
|
||||
{
|
||||
HandlePrefSet($options_flags, $option_name, $option_value, "Options");
|
||||
}
|
||||
elsif ($array_name eq "filepath" && $option_name && $option_value)
|
||||
{
|
||||
HandlePrefSet($filepath_flags, $option_name, $option_value, "Filepath");
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Unknown pref option at $line\n";
|
||||
}
|
||||
}
|
||||
elsif ($line =~ /^\s*buildfrom\s+([^#\s]+)(\s+#.+)?/)
|
||||
{
|
||||
my($build_start) = $1;
|
||||
HandleBuildFromPref($build_flags, $build_start);
|
||||
}
|
||||
elsif ($line =~ /^\s*([^#\s]+)\s+([^#\s]+)(\s+#.+)?/)
|
||||
{
|
||||
my($build_var) = $1;
|
||||
my($var_setting) = $2;
|
||||
|
||||
print "Setting \$main::$build_var to $var_setting\n";
|
||||
eval "\$main::$build_var = \"$var_setting\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Unrecognized input line at $line\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(PREFS_FILE);
|
||||
}
|
||||
elsif ($create_if_missing)
|
||||
{
|
||||
print "No prefs file found at $file_path; using defaults\n";
|
||||
|
||||
my($folder_path) = $file_path;
|
||||
$folder_path =~ s/[^:]+$//;
|
||||
mkpath($folder_path);
|
||||
WriteDefaultPrefsFile($file_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# ReadMozUserPrefs
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub ReadMozUserPrefs($$$$)
|
||||
{
|
||||
my($prefs_file_name, $build_flags, $options_flags, $filepath_flags) = @_;
|
||||
|
||||
if ($prefs_file_name eq "") { return; }
|
||||
|
||||
# if local prefs exist, just use those. Othewise, look in the prefs folder
|
||||
if (-e $prefs_file_name)
|
||||
{
|
||||
# read local prefs
|
||||
ReadPrefsFile($prefs_file_name, $build_flags, $options_flags, $filepath_flags, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
# first read prefs folder prefs
|
||||
my($prefs_path) = GetPrefsFolder();
|
||||
$prefs_path .= ":$prefs_file_name";
|
||||
|
||||
ReadPrefsFile($prefs_path, $build_flags, $options_flags, $filepath_flags, 1);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
932
mozilla/build/mac/build_scripts/Moz/ProjectXML.pm
Normal file
932
mozilla/build/mac/build_scripts/Moz/ProjectXML.pm
Normal file
@@ -0,0 +1,932 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Simon Fraser <sfraser@netscape.com>
|
||||
#
|
||||
|
||||
package Moz::ProjectXML;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use Cwd;
|
||||
use XML::DOM;
|
||||
|
||||
use vars qw(@ISA @EXPORT);
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
ParseXMLDocument
|
||||
DisposeXMLDocument
|
||||
WriteXMLDocument
|
||||
CleanupPro5XML
|
||||
GetTargetsList
|
||||
CloneTarget
|
||||
SetAsSharedLibraryTarget
|
||||
SetAsStaticLibraryTarget
|
||||
AddTarget
|
||||
RemoveTarget
|
||||
GetTargetSetting
|
||||
SetTargetSetting
|
||||
getChildElementTextContents
|
||||
);
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# A module for reading, manipulating, and writing XML-format CodeWarrior project files.
|
||||
#
|
||||
# Sample usage:
|
||||
#
|
||||
# use ProjectXML;
|
||||
#
|
||||
# my $doc = ProjectXML::ParseXMLDocument("Test.mcp.xml");
|
||||
# ProjectXML::CloneTarget($doc, "Test.shlb", "Test.lib");
|
||||
# ProjectXML::SetAsStaticLibraryTarget($doc, "Test.lib", "TestOutput.lib");
|
||||
# ProjectXML::WriteXMLDocument($doc, "Test_out.xml");
|
||||
# ProjectXML::DisposeXMLDocument($doc);
|
||||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// ParseXMLDocument
|
||||
#// Note that the caller must call DisposeXMLDocument on the returned doc
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub ParseXMLDocument($)
|
||||
{
|
||||
my($doc_path) = @_;
|
||||
|
||||
my $parser = new XML::DOM::Parser(ErrorContext => 2);
|
||||
my $doc = $parser->parsefile($doc_path);
|
||||
|
||||
return $doc;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// DisposeXMLDocument
|
||||
#// Needed to avoid memory leaks - cleanup circular references for garbage collection
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub DisposeXMLDocument($)
|
||||
{
|
||||
my($doc) = @_;
|
||||
|
||||
$doc->dispose();
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// WriteXMLDocument
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
|
||||
sub _pro5_tag_compression($$)
|
||||
{
|
||||
return 1; # Pro 5 is broken and can't import XML with <foo/> style tags
|
||||
}
|
||||
|
||||
sub _pro6plus_tag_compression($$)
|
||||
{
|
||||
return 0; # Pro 6 can deal with empty XML tags like <foo/>
|
||||
}
|
||||
|
||||
sub WriteXMLDocument($$$)
|
||||
{
|
||||
my($doc, $file_path, $ide_version) = @_;
|
||||
|
||||
if ($ide_version eq "4.0")
|
||||
{
|
||||
XML::DOM::setTagCompression(\&_pro5_tag_compression);
|
||||
}
|
||||
else
|
||||
{
|
||||
XML::DOM::setTagCompression(\&_pro6plus_tag_compression);
|
||||
}
|
||||
|
||||
$doc->printToFile($file_path);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// CleanupPro5XML
|
||||
#// XML Projects exported by Pro 5 contain garbage data under the MWMerge_MacOS_skipResources
|
||||
#// setting. This routine cleans this up, saving the result to a new file
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub CleanupPro5XML($$)
|
||||
{
|
||||
my($xml_path, $out_path) = @_;
|
||||
|
||||
local(*XML_FILE);
|
||||
open(XML_FILE, "< $xml_path") || die "Error: failed to open file $xml_path\n";
|
||||
|
||||
local(*CLEANED_FILE);
|
||||
open(CLEANED_FILE, "> $out_path") || die "Error: failed to open file $out_path for writing\n";
|
||||
|
||||
my $in_skip_resources_settings = 0;
|
||||
|
||||
while(<XML_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
|
||||
if ($line =~ /^<\?codewarrior/) # is processing inst line
|
||||
{
|
||||
my $test_line = $line;
|
||||
chomp($test_line);
|
||||
|
||||
my $out_line = $test_line;
|
||||
if ($test_line =~ /^<\?codewarrior\s+exportversion=\"(.+)\"\s+ideversion=\"(.+)\"\s*\?>$/)
|
||||
{
|
||||
my $export_version = $1;
|
||||
my $ide_version = $2;
|
||||
|
||||
$ide_version = "4.0_mozilla"; # pseudo IDE version so we know we touched it
|
||||
$out_line = "<?codewarrior exportversion=\"".$export_version."\" ideversion=\"".$ide_version."\"?>";
|
||||
}
|
||||
|
||||
print CLEANED_FILE "$out_line\n";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($line =~ /MWMerge_MacOS_skipResources/)
|
||||
{
|
||||
$in_skip_resources_settings = 1;
|
||||
print CLEANED_FILE "$line";
|
||||
}
|
||||
elsif($in_skip_resources_settings && $line =~ /<!-- Settings for/)
|
||||
{
|
||||
# leaving bad settings lines. Write closing tag
|
||||
print CLEANED_FILE " <!-- Corrupted setting entries removed by script -->\n";
|
||||
print CLEANED_FILE " </SETTING>\n\n";
|
||||
|
||||
print CLEANED_FILE "$line";
|
||||
|
||||
$in_skip_resources_settings = 0;
|
||||
}
|
||||
elsif (!$in_skip_resources_settings)
|
||||
{
|
||||
print CLEANED_FILE "$line";
|
||||
}
|
||||
}
|
||||
|
||||
close(XML_FILE);
|
||||
close(CLEANED_FILE);
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# SniffProjectXMLIDEVersion
|
||||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
sub SniffProjectXMLIDEVersion($)
|
||||
{
|
||||
my($xml_path) = @_;
|
||||
|
||||
my $found_version = "";
|
||||
|
||||
local(*XML_FILE);
|
||||
open(XML_FILE, "< $xml_path") || die "Error: failed to open file $xml_path\n";
|
||||
|
||||
while(<XML_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
if ($line =~ /^<\?codewarrior/) # is processing inst line
|
||||
{
|
||||
unless ($line =~ /^<\?codewarrior\s+exportversion=\"(.+)\"\s+ideversion=\"(.+)\"\s*\?>$/)
|
||||
{
|
||||
die "Error: Failed to find ideversion in $xml_path in line $line\n";
|
||||
}
|
||||
|
||||
my $export_version = $1;
|
||||
my $ide_version = $2;
|
||||
|
||||
$found_version = $ide_version;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
close(XML_FILE);
|
||||
|
||||
return $found_version;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetTargetsList
|
||||
#// Returns an array of target names
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetTargetsList($)
|
||||
{
|
||||
my($doc) = @_;
|
||||
|
||||
my $nodes = $doc->getElementsByTagName("TARGET");
|
||||
my $n = $nodes->getLength;
|
||||
|
||||
my @target_names;
|
||||
|
||||
for (my $i = 0; $i < $n; $i++)
|
||||
{
|
||||
my ($node) = $nodes->item($i);
|
||||
|
||||
my($target_name) = getChildElementTextContents($node, "NAME");
|
||||
push(@target_names, $target_name);
|
||||
}
|
||||
|
||||
return @target_names;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// CloneTarget
|
||||
#// Clone the named target, renaming it to 'new_name'
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub CloneTarget($$$)
|
||||
{
|
||||
my($doc, $target_name, $new_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
|
||||
# clone here
|
||||
my $target_clone = $target_node->cloneNode(1); # deep clone
|
||||
|
||||
# -- munge target settings --
|
||||
|
||||
# set the target name field
|
||||
setChildElementTextContents($doc, $target_clone, "NAME", $new_name);
|
||||
|
||||
# set the targetname pref
|
||||
setTargetNodeSetting($doc, $target_clone, "Targetname", $new_name);
|
||||
|
||||
# -- insert new target subtree --
|
||||
|
||||
my $target_list = $target_node->getParentNode();
|
||||
$target_list->appendChild($target_clone);
|
||||
|
||||
# -- now add to targetorder --
|
||||
my (@target_order_nodes) = getChildOfDocument($doc, "TARGETORDER");
|
||||
|
||||
my $target_order = @target_order_nodes[0];
|
||||
|
||||
my $new_order = $doc->createElement("ORDEREDTARGET");
|
||||
my $order_name = $doc->createElement("NAME");
|
||||
|
||||
$new_order->appendChild($order_name);
|
||||
|
||||
setChildElementTextContents($doc, $new_order, "NAME", $new_name);
|
||||
$target_order->appendChild($new_order);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SetAsSharedLibraryTarget
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SetAsSharedLibraryTarget($$$)
|
||||
{
|
||||
my($doc, $target_name, $output_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_type", "SharedLibrary");
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_filetype", "1936223330"); #'shlb'
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_outfile", $output_name);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// AddFileToTarget
|
||||
#//
|
||||
#// Add a file to the specified target(s).
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub AddFileToTarget($$$)
|
||||
{
|
||||
my($doc, $target_list, $file_name) = @_;
|
||||
|
||||
# the file must be added in 3 places:
|
||||
# 1. in <TARGET><FILELIST><FILE> (with linkage flags if necessary)
|
||||
# 2. in <TARGET><LINKORDER><FILEREF>
|
||||
# 3. in <GROUPLIST><GROUP><FILEREF>
|
||||
die "Write me\n";
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// RemoveFileFromTarget
|
||||
#//
|
||||
#// Remove a file from the specified target, removing it from the entire project
|
||||
#// if no other targets reference it.
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub RemoveFileFromTarget($$$)
|
||||
{
|
||||
my($doc, $target_node, $file_name) = @_;
|
||||
|
||||
# the file must be removed in 3 places:
|
||||
# 1. in <TARGET><FILELIST><FILE>
|
||||
# 2. in <TARGET><LINKORDER><FILEREF>
|
||||
# 3. in <GROUPLIST><GROUP><FILEREF>
|
||||
|
||||
# first, remove from <FILELIST>
|
||||
my $filelist_node = getFirstChildElement($target_node, "FILELIST");
|
||||
unless ($filelist_node) { die "Error: failed to find FILELIST node\n"; }
|
||||
|
||||
my $file_node = getChildNodeByGrandchildContents($doc, $filelist_node, "FILE", "PATH", $file_name);
|
||||
unless ($file_node) { return; }
|
||||
|
||||
$filelist_node->removeChild($file_node);
|
||||
|
||||
# next, remove from <LINKORDER>
|
||||
my $linkorder_node = getFirstChildElement($target_node, "LINKORDER");
|
||||
unless ($linkorder_node) { die "Error: failed to find LINKORDER node\n"; }
|
||||
|
||||
my $fileref_node = getChildNodeByGrandchildContents($doc, $linkorder_node, "FILEREF", "PATH", $file_name);
|
||||
unless ($fileref_node) { die "Error: link order node for file $file_name not found\n"; }
|
||||
|
||||
$linkorder_node->removeChild($fileref_node);
|
||||
|
||||
# last, remove from <GROUPLIST>
|
||||
# <GROUPLIST> is cross-target, so we have to be careful here.
|
||||
my $grouplist_node = getChildOfDocument($doc, "GROUPLIST");
|
||||
unless ($grouplist_node) { die "Error: failed to find GROUPLIST node\n"; }
|
||||
|
||||
# if the file isn't in any other targets, remove it from the groups
|
||||
if (!GetFileInUse($doc, $file_name))
|
||||
{
|
||||
print "File $file_name is in no other targest. Removing from project\n";
|
||||
|
||||
my @group_nodes;
|
||||
getChildElementsOfType($doc, $grouplist_node, "GROUP", \@group_nodes);
|
||||
my $group_node;
|
||||
foreach $group_node (@group_nodes)
|
||||
{
|
||||
my @fileref_nodes;
|
||||
getChildElementsOfType($doc, $group_node, "FILEREF", \@fileref_nodes);
|
||||
|
||||
my $fileref_node;
|
||||
foreach $fileref_node (@fileref_nodes)
|
||||
{
|
||||
my $path_name = getChildElementTextContents($fileref_node, "PATH");
|
||||
if ($path_name eq $file_name)
|
||||
{
|
||||
print "Removing $file_name from project group list\n";
|
||||
$group_node->removeChild($fileref_node);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# can a file appear in more than one group?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SetAsStaticLibraryTarget
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SetAsStaticLibraryTarget($$$)
|
||||
{
|
||||
my($doc, $target_name, $output_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_type", "Library");
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_filetype", "1061109567"); #'????'
|
||||
setTargetNodeSetting($doc, $target_node, "MWProject_PPC_outfile", $output_name);
|
||||
|
||||
# static targets don't need any library linkage, so we can remove linkage
|
||||
# with all .shlb and .Lib files.
|
||||
|
||||
my(@obsolete_files) = ("NSStdLibStubs", "InterfacesStubs", "InterfaceLib", "InternetConfigLib");
|
||||
|
||||
print " Removing libraries etc. from target\n";
|
||||
|
||||
# get all files in target
|
||||
my @target_files = GetTargetFilesList($doc, $target_name);
|
||||
my $target_file;
|
||||
foreach $target_file (@target_files)
|
||||
{
|
||||
if ($target_file =~ /(\.shlb|\.lib|\.Lib|\.o|\.exp)$/)
|
||||
{
|
||||
RemoveFileFromTarget($doc, $target_node, $target_file);
|
||||
}
|
||||
}
|
||||
|
||||
print " Removing stub libraries from target\n";
|
||||
|
||||
# then remove files with known names
|
||||
my $obs_file;
|
||||
foreach $obs_file (@obsolete_files)
|
||||
{
|
||||
RemoveFileFromTarget($doc, $target_node, $obs_file);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// AddTarget
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub AddTarget($$)
|
||||
{
|
||||
my($doc, $target_name) = @_;
|
||||
|
||||
die "Write me\n";
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// RemoveTarget
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub RemoveTarget($$)
|
||||
{
|
||||
my($doc, $target_name) = @_;
|
||||
|
||||
die "Write me\n";
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetTargetSetting
|
||||
#// Get the value for the specified setting in the specified target
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetTargetSetting($$$)
|
||||
{
|
||||
my($doc, $target_name, $setting_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
return getTargetNodeSetting($target_node, "VALUE");
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// SetTargetSetting
|
||||
#// Set the value for the specified setting in the specified target
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub SetTargetSetting($$$$)
|
||||
{
|
||||
my($doc, $target_name, $setting_name, $new_value) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
setTargetNodeSetting($doc, $target_node, "VALUE", $new_value);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetTargetFilesList
|
||||
#// Return an array of the files in the target (in filelist order)
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetTargetFilesList($$)
|
||||
{
|
||||
my($doc, $target_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
|
||||
my @files_list;
|
||||
|
||||
my $filelist_node = getFirstChildElement($target_node, "FILELIST");
|
||||
unless ($filelist_node) { die "Error: failed to find FILELIST node\n"; }
|
||||
|
||||
my @file_nodes;
|
||||
getChildElementsOfType($doc, $filelist_node, "FILE", \@file_nodes);
|
||||
|
||||
my $node;
|
||||
foreach $node (@file_nodes)
|
||||
{
|
||||
my $file_name = getChildElementTextContents($node, "PATH");
|
||||
push(@files_list, $file_name);
|
||||
}
|
||||
|
||||
return @files_list;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// FileIsInTarget
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub FileIsInTarget($$$)
|
||||
{
|
||||
my($doc, $file_name, $target_name) = @_;
|
||||
|
||||
my $target_node = getTargetNode($doc, $target_name);
|
||||
unless ($target_node) { die "Error: no target found called $target_name\n"; }
|
||||
|
||||
my $file_node = GetTargetFileNode($doc, $target_node, $file_name);
|
||||
if ($file_node) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetFileTargetsList
|
||||
#// Return an array of the targets that a file is in (expensive)
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetFileTargetsList($$)
|
||||
{
|
||||
my ($doc, $file_name) = @_;
|
||||
|
||||
my @target_list;
|
||||
|
||||
my @targets = GetTargetsList($doc);
|
||||
my $target;
|
||||
|
||||
foreach $target (@targets)
|
||||
{
|
||||
if (FileIsInTarget($doc, $file_name, $target))
|
||||
{
|
||||
push(@target_list, $target);
|
||||
}
|
||||
}
|
||||
|
||||
return @target_list;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetTargetFileNode
|
||||
#//
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetTargetFileNode($$$)
|
||||
{
|
||||
my($doc, $target_node, $file_name) = @_;
|
||||
|
||||
my $filelist_node = getFirstChildElement($target_node, "FILELIST");
|
||||
unless ($filelist_node) { die "Error: failed to find FILELIST node\n"; }
|
||||
|
||||
my $file_node = getChildNodeByGrandchildContents($doc, $filelist_node, "FILE", "PATH", $file_name);
|
||||
|
||||
return $file_node;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// GetFileInUse
|
||||
#// Return true if the file is used by any target
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub GetFileInUse($$)
|
||||
{
|
||||
my($doc, $file_name) = @_;
|
||||
|
||||
my $targetlist_node = getChildOfDocument($doc, "TARGETLIST");
|
||||
|
||||
my $target_node = $targetlist_node->getFirstChild();
|
||||
|
||||
while ($target_node)
|
||||
{
|
||||
if ($target_node->getNodeTypeName eq "ELEMENT_NODE" &&
|
||||
$target_node->getTagName() eq "TARGET")
|
||||
{
|
||||
# if this is a target node
|
||||
my $file_node = GetTargetFileNode($doc, $target_node, $file_name);
|
||||
if ($file_node) {
|
||||
return 1; # found it
|
||||
}
|
||||
}
|
||||
|
||||
$target_node = $target_node->getNextSibling();
|
||||
}
|
||||
|
||||
# not found
|
||||
return 0;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getChildOfDocument
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getChildOfDocument($$)
|
||||
{
|
||||
my($doc, $child_type) = @_;
|
||||
|
||||
return getFirstChildElement($doc->getDocumentElement(), $child_type);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getFirstChildElement
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getFirstChildElement($$)
|
||||
{
|
||||
my($node, $element_name) = @_;
|
||||
|
||||
my $found_node;
|
||||
|
||||
unless ($node) { die "getFirstChildElement called with empty node\n"; }
|
||||
|
||||
#look for the first "element_name" child
|
||||
|
||||
my $child_node = $node->getFirstChild();
|
||||
|
||||
while ($child_node)
|
||||
{
|
||||
if ($child_node->getNodeTypeName eq "ELEMENT_NODE" &&
|
||||
$child_node->getTagName() eq $element_name)
|
||||
{
|
||||
$found_node = $child_node;
|
||||
last;
|
||||
}
|
||||
|
||||
$child_node = $child_node->getNextSibling();
|
||||
}
|
||||
|
||||
return $found_node;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getChildElementsOfType
|
||||
#//
|
||||
#// Return an array of refs to child nodes of the given type
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getChildElementsOfType($$$$)
|
||||
{
|
||||
my($doc, $node, $child_type, $array_ref) = @_;
|
||||
|
||||
my $child_node = $node->getFirstChild();
|
||||
|
||||
while ($child_node)
|
||||
{
|
||||
if ($child_node->getNodeTypeName eq "ELEMENT_NODE" &&
|
||||
$child_node->getTagName() eq $child_type)
|
||||
{
|
||||
push(@$array_ref, $child_node);
|
||||
}
|
||||
|
||||
$child_node = $child_node->getNextSibling();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getChildElementTextContents
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Given <FOOPY><NERD>Hi!</NERD></FOOPY>, where $node is <FOOPY>,
|
||||
# returns "Hi!". If > 1 <NERD> node, returns the contents of the first.
|
||||
#
|
||||
sub getChildElementTextContents($$)
|
||||
{
|
||||
my($node, $tag_name) = @_;
|
||||
|
||||
my $first_element = getFirstChildElement($node, $tag_name);
|
||||
my $text_node = $first_element->getFirstChild();
|
||||
|
||||
my $text_contents = "";
|
||||
|
||||
# concat adjacent text nodes
|
||||
while ($text_node)
|
||||
{
|
||||
if ($text_node->getNodeTypeName() ne "TEXT_NODE")
|
||||
{
|
||||
last;
|
||||
}
|
||||
|
||||
$text_contents = $text_contents.$text_node->getData();
|
||||
$text_node = $text_node->getNextSibling();
|
||||
}
|
||||
|
||||
return $text_contents;
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// setChildElementTextContents
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub setChildElementTextContents($$$$)
|
||||
{
|
||||
my($doc, $node, $tag_name, $contents_text) = @_;
|
||||
|
||||
my $first_element = getFirstChildElement($node, $tag_name);
|
||||
my $new_text_node = $doc->createTextNode($contents_text);
|
||||
|
||||
# replace all child elements with a text element
|
||||
removeAllChildren($first_element);
|
||||
|
||||
$first_element->appendChild($new_text_node);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getChildNodeByContents
|
||||
#//
|
||||
#// Consider <foo><bar><baz>Foopy</baz></bar><bar><baz>Loopy</baz></bar></foo>
|
||||
#// This function, when called with getChildNodeByContents($foonode, "bar", "baz", "Loopy")
|
||||
#// returns the second <bar> node.
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getChildNodeByGrandchildContents($$$$$)
|
||||
{
|
||||
my($doc, $node, $child_type, $gc_type, $gc_contents) = @_; # gc = grandchild
|
||||
|
||||
my $found_node;
|
||||
my $child_node = $node->getFirstChild();
|
||||
while ($child_node)
|
||||
{
|
||||
if ($child_node->getNodeTypeName eq "ELEMENT_NODE" &&
|
||||
$child_node->getTagName() eq $child_type)
|
||||
{
|
||||
# check for a child of this node of type
|
||||
my $child_contents = getChildElementTextContents($child_node, $gc_type);
|
||||
|
||||
if ($child_contents eq $gc_contents)
|
||||
{
|
||||
$found_node = $child_node;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$child_node = $child_node->getNextSibling();
|
||||
}
|
||||
|
||||
return $found_node;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getTargetNode
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getTargetNode($$)
|
||||
{
|
||||
my($doc, $target_name) = @_;
|
||||
|
||||
my $targetlist_node = getChildOfDocument($doc, "TARGETLIST");
|
||||
return getChildNodeByGrandchildContents($doc, $targetlist_node, "TARGET", "NAME", $target_name);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getTargetNamedSettingNode
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getTargetNamedSettingNode($$)
|
||||
{
|
||||
my($target_node, $setting_name) = @_;
|
||||
|
||||
my $setting_node;
|
||||
|
||||
my $settinglist_node = getFirstChildElement($target_node, "SETTINGLIST");
|
||||
my $child_node = $settinglist_node->getFirstChild();
|
||||
|
||||
while ($child_node)
|
||||
{
|
||||
if ($child_node->getNodeTypeName ne "ELEMENT_NODE")
|
||||
{
|
||||
$child_node = $child_node->getNextSibling();
|
||||
next;
|
||||
}
|
||||
|
||||
if ($child_node->getTagName() eq "SETTING")
|
||||
{
|
||||
my $set_name = getChildElementTextContents($child_node, "NAME");
|
||||
|
||||
if ($set_name eq $setting_name)
|
||||
{
|
||||
$setting_node = $child_node;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$child_node = $child_node->getNextSibling();
|
||||
}
|
||||
|
||||
return $setting_node;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// getTargetNodeSetting
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub getTargetNodeSetting($$)
|
||||
{
|
||||
my($target_node, $setting_name) = @_;
|
||||
|
||||
my $setting_node = getTargetNamedSettingNode($target_node, $setting_name);
|
||||
return getChildElementTextContents($setting_node, "VALUE");
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// setTargetNodeSetting
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub setTargetNodeSetting($$$$)
|
||||
{
|
||||
my($doc, $target_node, $setting_name, $new_value) = @_;
|
||||
|
||||
my $setting_node = getTargetNamedSettingNode($target_node, $setting_name);
|
||||
|
||||
setChildElementTextContents($doc, $setting_node, "VALUE", $new_value);
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// elementInArray
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub elementInArray($$)
|
||||
{
|
||||
my($element, $array) = @_;
|
||||
my $test;
|
||||
foreach $test (@$array)
|
||||
{
|
||||
if ($test eq $element) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// removeAllChildren
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub removeAllChildren($)
|
||||
{
|
||||
my($node) = @_;
|
||||
|
||||
my $child_node = $node->getFirstChild();
|
||||
|
||||
while ($child_node)
|
||||
{
|
||||
$node->removeChild($child_node);
|
||||
$child_node = $node->getFirstChild();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// dumpNodeData
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub dumpNodeData($)
|
||||
{
|
||||
my($node) = @_;
|
||||
|
||||
unless ($node) { die "Null node passed to dumpNodeData\n"; }
|
||||
|
||||
print "Dumping node $node\n";
|
||||
|
||||
my($node_type) = $node->getNodeTypeName();
|
||||
|
||||
if ($node_type eq "ELEMENT_NODE")
|
||||
{
|
||||
my($node_name) = $node->getTagName();
|
||||
print "Element $node_name\n";
|
||||
}
|
||||
elsif ($node_type eq "TEXT_NODE")
|
||||
{
|
||||
my($node_data) = $node->getData;
|
||||
# my(@node_vals) = unpack("C*", $node_data);
|
||||
print "Text '$node_data'\n"; # may contain LF chars
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Node $node_type\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
#// dumpNodeTree
|
||||
#//--------------------------------------------------------------------------------------------------
|
||||
sub dumpNodeTree($)
|
||||
{
|
||||
my($node) = @_;
|
||||
|
||||
my($child_node) = $node->getFirstChild();
|
||||
|
||||
unless ($child_node) { return; }
|
||||
|
||||
# recurse
|
||||
dumpNodeData($child_node);
|
||||
|
||||
# then go through child nodes
|
||||
while ($child_node)
|
||||
{
|
||||
dumpNodeTree($child_node);
|
||||
|
||||
$child_node = $child_node->getNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
90
mozilla/build/mac/build_scripts/MozillaBuildFlags.txt
Normal file
90
mozilla/build/mac/build_scripts/MozillaBuildFlags.txt
Normal file
@@ -0,0 +1,90 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# These 3 lists are the 'master lists' to control what gets built.
|
||||
#
|
||||
# Ordering in these arrays is important; it has to reflect the order in
|
||||
# which the build occurs.
|
||||
#
|
||||
# Setting containing spaces must be quoted with double quotes.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
build_flags
|
||||
all 1
|
||||
pull 0
|
||||
dist 0
|
||||
config 0
|
||||
xpidl 0
|
||||
idl 0
|
||||
stubs 0
|
||||
runtime 0
|
||||
common 0
|
||||
imglib 0
|
||||
libimg2 0
|
||||
necko 0
|
||||
security 0
|
||||
browserutils 0
|
||||
intl 0
|
||||
nglayout 0
|
||||
accessiblity 0
|
||||
editor 0
|
||||
embedding 0
|
||||
viewer 0
|
||||
xpapp 0
|
||||
extensions 0
|
||||
plugins 0
|
||||
mailnews 0
|
||||
apprunner 0
|
||||
resources 0
|
||||
|
||||
options_flags
|
||||
pull_by_date 0
|
||||
chrome_jars 1
|
||||
chrome_files 0
|
||||
use_jars 1
|
||||
transformiix 1
|
||||
mathml 0 MOZ_MATHML
|
||||
svg 0 MOZ_SVG
|
||||
# svg requires libart, which is an lgpl library. You need to pull it
|
||||
# explicitly.
|
||||
libart_lgpl 0
|
||||
mng 1
|
||||
ldap 1 MOZ_LDAP_XPCOM
|
||||
ldap_experimental 0 MOZ_LDAP_XPCOM_EXPERIMENTAL
|
||||
xmlextras 1
|
||||
wsp 0 MOZ_WSP
|
||||
inspector 1
|
||||
mailextras 1
|
||||
xptlink 0
|
||||
psm 0 MOZ_PSM
|
||||
embedding_test 1
|
||||
embedding_chrome 0
|
||||
embedding_xulprefs 0
|
||||
embedding_xulsecurity 0
|
||||
carbon 0 TARGET_CARBON
|
||||
useimg2 1 USE_IMG2
|
||||
lowmem 0 MOZ_MAC_LOWMEM
|
||||
accessible 1 ACCESSIBILITY
|
||||
bidi 1 IBMBIDI
|
||||
p3p 0
|
||||
jsd 1
|
||||
venkman 1
|
||||
moz_logging 1 MOZ_LOGGING
|
||||
chatzilla 1
|
||||
content_packs 1
|
||||
xml_rpc 1
|
||||
cview 1
|
||||
help 1
|
||||
timeline 0 MOZ_TIMELINE
|
||||
static_build 0 MOZ_STATIC_COMPONENT_LIBS
|
||||
string_debug 0 DEBUG_STRING
|
||||
string_stats 0 DEBUG_STRING_STATS
|
||||
xpctools 0 XPC_TOOLS_SUPPORT
|
||||
smime 1
|
||||
mdn 1
|
||||
print_preview 1 NS_PRINT_PREVIEW
|
||||
moz_xul 1 MOZ_XUL
|
||||
|
||||
filepath_flags
|
||||
idepath ":CodeWarrior IDE Path.txt"
|
||||
sessionpath ":Mozilla session path.txt"
|
||||
buildlogfilepath ":Build Logs:Mozilla build log.txt" # this is a path
|
||||
scriptlogfilepath ":Build Logs:Mozilla script log.txt"
|
||||
2536
mozilla/build/mac/build_scripts/MozillaBuildList.pm
Normal file
2536
mozilla/build/mac/build_scripts/MozillaBuildList.pm
Normal file
File diff suppressed because it is too large
Load Diff
22
mozilla/build/mac/build_scripts/MozillaCheckoutList.txt
Normal file
22
mozilla/build/mac/build_scripts/MozillaCheckoutList.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# List of modules to check out. Format is
|
||||
# module, (tag), (date)
|
||||
# where tag and date are optional (non-trailing commas are required)
|
||||
#
|
||||
# Examples:
|
||||
# mozilla/nsprpub, NSPRPUB_CLIENT_TAG
|
||||
# mozilla/gc, , 10/25/2000 12:00:00
|
||||
#
|
||||
|
||||
mozilla/nsprpub, NETSCAPE_7_0_RTM
|
||||
mozilla/security/nss, NETSCAPE_7_0_RTM
|
||||
mozilla/security/manager, NETSCAPE_7_0_RTM
|
||||
mozilla/accessible, NETSCAPE_7_0_RTM
|
||||
mozilla/directory/c-sdk, NETSCAPE_7_0_RTM
|
||||
mozilla/lib/mac/Instrumentation, NETSCAPE_7_0_RTM
|
||||
mozilla/gfx2, NETSCAPE_7_0_RTM
|
||||
mozilla/modules/libpr0n, NETSCAPE_7_0_RTM
|
||||
SeaMonkeyAll, NETSCAPE_7_0_RTM
|
||||
|
||||
## You need this if you want to be able to use SVG
|
||||
## Note that this library is under the LGPL, not the MPL
|
||||
#mozilla/other-licenses/libart_lgpl
|
||||
79
mozilla/build/mac/build_scripts/PullMozilla.pl
Normal file
79
mozilla/build/mac/build_scripts/PullMozilla.pl
Normal file
@@ -0,0 +1,79 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Simon Fraser <sfraser@netscape.com>
|
||||
#
|
||||
|
||||
require 5.004;
|
||||
|
||||
use strict;
|
||||
|
||||
use Cwd;
|
||||
use Moz::BuildUtils;
|
||||
use Moz::BuildCore;
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Where have the build options gone?
|
||||
#
|
||||
# The various build flags have been centralized into one place.
|
||||
# The master list of options is in MozBuildFlags.txt. However,
|
||||
# you should never need to edit that file, or this one.
|
||||
#
|
||||
# To customize what gets built, or where to start the build,
|
||||
# edit the $prefs_file_name file in
|
||||
# System Folder:Preferences:Mozilla build prefs:
|
||||
# Documentation is provided in that file.
|
||||
#-------------------------------------------------------------
|
||||
|
||||
my($prefs_file_name) = "Mozilla pull prefs";
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# hashes to hold build options
|
||||
#-------------------------------------------------------------
|
||||
my(%build);
|
||||
my(%options);
|
||||
my(%filepaths);
|
||||
my(%optiondefines);
|
||||
|
||||
# Hash of input files for this build. Eventually, there will be
|
||||
# input files for manifests, and projects too.
|
||||
my(%inputfiles) = (
|
||||
"buildflags", "MozillaBuildFlags.txt",
|
||||
"checkoutdata", "MozillaCheckoutList.txt",
|
||||
"buildprogress", "",
|
||||
"buildmodule", "MozillaBuildList.pm",
|
||||
"checkouttime", "Mozilla last checkout"
|
||||
);
|
||||
#-------------------------------------------------------------
|
||||
# end build hashes
|
||||
#-------------------------------------------------------------
|
||||
|
||||
# set the build root directory, which is the the dir above mozilla
|
||||
SetupBuildRootDir(":mozilla:build:mac:build_scripts");
|
||||
|
||||
# Set up all the flags on $main::, like DEBUG, CARBON etc.
|
||||
# Override the defaults using the preferences files.
|
||||
SetupDefaultBuildOptions(0, ":mozilla:dist:viewer:", "");
|
||||
|
||||
my($do_checkout) = 1;
|
||||
my($do_build) = 0;
|
||||
|
||||
RunBuild($do_checkout, $do_build, \%inputfiles, $prefs_file_name);
|
||||
511
mozilla/client.mak
Normal file
511
mozilla/client.mak
Normal file
@@ -0,0 +1,511 @@
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=.
|
||||
|
||||
!if !defined(MOZ_TOP)
|
||||
#enable builds from changed top level directories
|
||||
MOZ_TOP=mozilla
|
||||
!endif
|
||||
|
||||
MOZ_SRC_FLIPPED = $(MOZ_SRC:\=/)
|
||||
MOZ_DIST_FLIPPED = $(MOZ_SRC_FLIPPED)/mozilla/dist
|
||||
!ifdef MOZ_DEBUG
|
||||
MOZ_OBJDIR = WIN32_D.OBJ
|
||||
!else
|
||||
MOZ_OBJDIR = WIN32_O.OBJ
|
||||
!endif
|
||||
|
||||
#
|
||||
# Command macro defines
|
||||
#
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to do the pull.
|
||||
#//------------------------------------------------------------------------
|
||||
# uncomment these, modify branch tag, and check in to branch for milestones
|
||||
MOZ_BRANCH=NETSCAPE_7_0_RTM
|
||||
NSPR_CO_TAG=NETSCAPE_7_0_RTM
|
||||
PSM_CO_TAG=NETSCAPE_7_0_RTM
|
||||
NSS_CO_TAG=NETSCAPE_7_0_RTM
|
||||
LDAPCSDK_CO_TAG=NETSCAPE_7_0_RTM
|
||||
ACCESSIBLE_CO_TAG=NETSCAPE_7_0_RTM
|
||||
IMGLIB2_CO_TAG=NETSCAPE_7_0_RTM
|
||||
GFX2_CO_TAG=NETSCAPE_7_0_RTM
|
||||
|
||||
|
||||
!ifdef MOZ_BRANCH
|
||||
CVS_BRANCH=-r $(MOZ_BRANCH)
|
||||
!endif
|
||||
|
||||
!ifdef MOZ_DATE
|
||||
CVS_BRANCH=$(CVS_BRANCH) -D "$(MOZ_DATE)"
|
||||
!endif
|
||||
|
||||
# default pull is "quiet" but it can be overridden with MOZ_CVS_VERBOSE
|
||||
!ifndef MOZ_CVS_VERBOSE
|
||||
CVS_FLAGS=-q
|
||||
!endif
|
||||
|
||||
# honor any user-defined CVS flags
|
||||
!ifdef MOZ_CVS_FLAGS
|
||||
CVS_FLAGS=$(CVS_FLAGS) $(MOZ_CVS_FLAGS)
|
||||
!endif
|
||||
|
||||
# let's be explicit about CVSROOT... some windows cvs clients
|
||||
# are too stupid to correctly work without the -d option
|
||||
#
|
||||
# if they are too stupid, they should fail. I am
|
||||
# commenting this out because this does not work
|
||||
# under 4nt. (%'s are evaluted differently)
|
||||
#
|
||||
# If it breaks you, mail dougt@netscape.com
|
||||
# and leaf@mozilla.org
|
||||
#
|
||||
!if 0
|
||||
!if defined(CVSROOT)
|
||||
CVS_FLAGS=$(CVS_FLAGS) -d "$(CVSROOT)"
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!ifndef MOZ_CO_FLAGS
|
||||
MOZ_CO_FLAGS = -P
|
||||
!endif
|
||||
|
||||
CVSCO = cvs $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull NSPR.
|
||||
#// If no NSPR_CO_TAG is specified, use the default static tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifndef NSPR_CO_FLAGS
|
||||
NSPR_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
NSPR_CO_FLAGS=$(NSPR_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
|
||||
CVSCO_NSPR = cvs $(CVS_FLAGS) co $(NSPR_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull NSS and PSM libs.
|
||||
#// If no NSS_CO_TAG or PSM_CO_TAG is specified, use the default static tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifndef NSS_CO_FLAGS
|
||||
NSS_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
NSS_CO_FLAGS=$(NSS_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_NSS = cvs $(CVS_FLAGS) co $(NSS_CO_FLAGS)
|
||||
|
||||
!ifndef PSM_CO_FLAGS
|
||||
PSM_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
PSM_CO_FLAGS=$(PSM_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_PSM = cvs $(CVS_FLAGS) co $(PSM_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull LDAP C SDK client libs.
|
||||
#// If no LDAPCSDK_CO_TAG is specified, use the default tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
!ifndef LDAPCSDK_CO_FLAGS
|
||||
LDAPCSDK_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
LDAPCSDK_CO_FLAGS=$(LDAPCSDK_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_LDAPCSDK = cvs $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull accessibility libs.
|
||||
#// If no ACCESSIBLE_CO_TAG is specified, use the default tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifndef ACCESSIBLE_CO_FLAGS
|
||||
ACCESSIBLE_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
ACCESSIBLE_CO_FLAGS=$(ACCESSIBLE_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_ACCESSIBLE = cvs $(CVS_FLAGS) co $(ACCESSIBLE_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull new image library.
|
||||
#// If no IMGLIB2_CO_TAG is specified, use the default tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifndef IMGLIB2_CO_FLAGS
|
||||
IMGLIB2_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
IMGLIB2_CO_FLAGS=$(IMGLIB2_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_IMGLIB2 = cvs $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull new image library.
|
||||
#// If no GFX2_CO_TAG is specified, use the default tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!ifndef GFX2_CO_FLAGS
|
||||
GFX2_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
GFX2_CO_FLAGS=$(GFX2_CO_FLAGS) $(CVS_BRANCH)
|
||||
|
||||
CVSCO_GFX2 = cvs $(CVS_FLAGS) co $(GFX2_CO_FLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to pull the internal libart
|
||||
#// (only pulled and built if MOZ_INTERNAL_LIBART_LGPL is set)
|
||||
#// If no MOZ_INTERNAL_LIBART_CO_TAG is specified, use the default tag
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if defined(MOZ_SVG) && !defined(MOZ_INTERNAL_LIBART_LGPL)
|
||||
ERR_MESSAGE = ^
|
||||
You are trying to build Mozilla with SVG support (MOZ_SVG=1), but you ^
|
||||
haven not specified that mozilla/other-licenses/libart_lgpl should be ^
|
||||
pulled and built. At the moment Mozilla SVG builds need this patched ^
|
||||
version of libart. You either need to disable SVG support (unset MOZ_SVG) ^
|
||||
or enable pulling and building by setting MOZ_INTERNAL_LIBART_LGPL=1.^
|
||||
^
|
||||
If you choose to pull and build libart, note that it is only licensed^
|
||||
under the terms of the LGPL, not the MPL. (Which is why you have to opt^
|
||||
in explicitly.)
|
||||
!endif
|
||||
|
||||
!if defined(MOZ_INTERNAL_LIBART_LGPL)
|
||||
|
||||
!ifndef MOZ_INTERNAL_LIBART_CO_FLAGS
|
||||
MOZ_INTERNAL_LIBART_CO_FLAGS=$(MOZ_CO_FLAGS)
|
||||
!endif
|
||||
|
||||
!if "$(MOZ_INTERNAL_LIBART_CO_TAG)" != ""
|
||||
MOZ_INTERNAL_LIBART_CO_FLAGS=$(MOZ_INTERNAL_LIBART_CO_FLAGS) -r $(MOZ_INTERNAL_LIBART_CO_TAG)
|
||||
!else
|
||||
MOZ_INTERNAL_LIBART_CO_FLAGS=$(MOZ_INTERNAL_LIBART_CO_FLAGS) $(CVS_BRANCH)
|
||||
!endif
|
||||
|
||||
CVSCO_MOZ_INTERNAL_LIBART = cvs $(CVS_FLAGS) co $(MOZ_INTERNAL_LIBART_CO_FLAGS)
|
||||
|
||||
!endif
|
||||
|
||||
## The master target
|
||||
############################################################
|
||||
|
||||
pull_and_build_all: pull_all build_all_dep
|
||||
|
||||
|
||||
## Rules for pulling the source from the cvs repository
|
||||
############################################################
|
||||
|
||||
pull_clobber_and_build_all: pull_all clobber_all build_all
|
||||
|
||||
!if !defined(MOZ_INTERNAL_LIBART_LGPL)
|
||||
pull_all: pull_nspr pull_psm pull_ldapcsdk pull_accessible pull_gfx2 pull_imglib2 pull_seamonkey
|
||||
!else
|
||||
pull_all: pull_nspr pull_psm pull_ldapcsdk pull_accessible pull_gfx2 pull_imglib2 pull_moz_internal_libart pull_seamonkey
|
||||
!endif
|
||||
|
||||
pull_nspr: pull_clientmak
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_NSPR) mozilla/nsprpub
|
||||
|
||||
pull_nss:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_NSS) mozilla/security/coreconf
|
||||
$(CVSCO_NSS) mozilla/security/nss
|
||||
|
||||
pull_psm: pull_nss
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_PSM) mozilla/security/manager
|
||||
$(CVSCO_PSM) mozilla/security/makefile.win
|
||||
|
||||
pull_ldapcsdk:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_LDAPCSDK) mozilla/directory/c-sdk
|
||||
|
||||
pull_accessible:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_ACCESSIBLE) mozilla/accessible
|
||||
|
||||
pull_gfx2:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_GFX2) mozilla/gfx2
|
||||
|
||||
pull_imglib2:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_IMGLIB2) mozilla/modules/libpr0n
|
||||
|
||||
!if defined(MOZ_INTERNAL_LIBART_LGPL)
|
||||
pull_moz_internal_libart:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO_MOZ_INTERNAL_LIBART) mozilla/other-licenses/libart_lgpl
|
||||
!endif
|
||||
|
||||
pull_xpconnect: pull_nspr
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO) mozilla/include
|
||||
$(CVSCO) mozilla/config
|
||||
$(CVSCO) -l mozilla/js
|
||||
$(CVSCO) -l mozilla/js/src
|
||||
$(CVSCO) mozilla/js/src/fdlibm
|
||||
$(CVSCO) mozilla/js/src/xpconnect
|
||||
$(CVSCO) mozilla/modules/libreg
|
||||
$(CVSCO) mozilla/xpcom
|
||||
$(CVSCO) mozilla/string
|
||||
|
||||
# pull either layout only or seamonkey the browser
|
||||
pull_layout:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO) RaptorWin
|
||||
|
||||
pull_seamonkey: pull_clientmak
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO) SeaMonkeyAll
|
||||
|
||||
pull_clientmak:
|
||||
cd $(MOZ_SRC)\.
|
||||
$(CVSCO) mozilla/client.mak
|
||||
|
||||
############################################################
|
||||
|
||||
# nmake has to be hardcoded, or we have to depend on mozilla/config
|
||||
# being pulled already to figure out what $(NMAKE) should be.
|
||||
|
||||
clobber_all: clobber_nspr clobber_ldapcsdk clobber_psm clobber_seamonkey
|
||||
|
||||
build_all: build_nspr build_ldapcsdk build_seamonkey
|
||||
|
||||
build_all_dep: depend libs
|
||||
|
||||
distclean:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\directory\c-sdk
|
||||
gmake -f gmakefile.win distclean MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED)
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\nsprpub
|
||||
gmake -f gmakefile.win distclean MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED)
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
nmake /f client.mak clobber_psm
|
||||
nmake /f client.mak clobber_seamonkey
|
||||
|
||||
clobber_ldapcsdk:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\directory\c-sdk
|
||||
gmake -f gmakefile.win clobber_all MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED) \
|
||||
SHELL=sh
|
||||
|
||||
clobber_nspr:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\nsprpub
|
||||
gmake -f gmakefile.win clobber_all MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED)
|
||||
|
||||
clobber_psm:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\security
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
clobber_xpconnect:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
-rd /s /q dist
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\nsprpub
|
||||
gmake -f gmakefile.win clobber_all MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED)
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\include
|
||||
nmake -f makefile.win clobber_all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\modules\libreg
|
||||
nmake -f makefile.win clobber_all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\string
|
||||
nmake -f makefile.win clobber_all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\xpcom
|
||||
nmake -f makefile.win clobber_all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js
|
||||
nmake -f makefile.win clobber_all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js\src\xpconnect
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
clobber_seamonkey:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
-rd /s /q dist
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
depend: export
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
nmake -f makefile.win depend
|
||||
|
||||
depend_xpconnect:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\include
|
||||
nmake -f makefile.win depend
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\modules\libreg
|
||||
nmake -f makefile.win depend
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\string
|
||||
nmake -f makefile.win depend
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\xpcom
|
||||
nmake -f makefile.win depend
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js\src
|
||||
nmake -f makefile.win depend
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js\src\xpconnect
|
||||
nmake -f makefile.win depend
|
||||
|
||||
build_nspr:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\nsprpub
|
||||
gmake -f gmakefile.win MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED)
|
||||
|
||||
build_ldapcsdk:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\directory\c-sdk
|
||||
gmake -f gmakefile.win MOZ_SRC_FLIPPED=$(MOZ_SRC_FLIPPED) SHELL=sh
|
||||
|
||||
build_psm:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\security
|
||||
nmake -f makefile.win
|
||||
|
||||
build_xpconnect: build_nspr
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\include
|
||||
nmake -f makefile.win all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\modules\libreg
|
||||
nmake -f makefile.win all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\xpcom
|
||||
nmake -f makefile.win export
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\string
|
||||
nmake -f makefile.win all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\xpcom
|
||||
nmake -f makefile.win libs
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js\src
|
||||
nmake -f makefile.win all
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\js\src\xpconnect
|
||||
nmake -f makefile.win all
|
||||
|
||||
build_seamonkey:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
nmake -f makefile.win all
|
||||
|
||||
build_client:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win all
|
||||
|
||||
build_layout:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win all
|
||||
|
||||
build_dist:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win all
|
||||
|
||||
libs:
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
nmake -f makefile.win libs
|
||||
|
||||
export: build_nspr build_ldapcsdk
|
||||
@cd $(MOZ_SRC)\$(MOZ_TOP)\.
|
||||
nmake -f makefile.win export
|
||||
|
||||
clobber_dist:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
clobber_client:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
clobber_layout:
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake -f makefile.win clobber_all
|
||||
|
||||
browse_info::
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
-dir /s /b *.sbr > sbrlist.tmp
|
||||
-bscmake /Es /o mozilla.bsc @sbrlist.tmp
|
||||
-rm sbrlist.tmp
|
||||
|
||||
regchrome::
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake /f makefile.win regchrome
|
||||
|
||||
deliver::
|
||||
@cd $(MOZ_SRC)\mozilla\.
|
||||
nmake /f makefile.win splitsymbols
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Utility stuff...
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
# Verify that MOZ_SRC is set correctly
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
# Check to see if it is set at all
|
||||
!if "$(MOZ_SRC)"==""
|
||||
MOZ_SRC = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
#
|
||||
# create a temp file at the root and make sure it is visible from MOZ_SRC
|
||||
#
|
||||
!if [copy $(MAKEDIR)\client.mak $(MAKEDIR)\xyzzy.tmp > NUL] == 0
|
||||
!endif
|
||||
|
||||
!if !EXIST( $(MOZ_SRC)\mozilla\xyzzy.tmp )
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
MOZ_SRC isn't set correctly: [$(MOZ_SRC)\mozilla]!=[$(MAKEDIR)]
|
||||
!endif
|
||||
|
||||
!if [del $(MAKEDIR)\xyzzy.tmp]
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
# Verify that MOZ_BITS is set
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(MOZ_BITS)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Environment variable MOZ_BITS isn't set.
|
||||
!endif
|
||||
|
||||
!if !defined(MOZ_TOOLS)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Environment variable MOZ_TOOLS isn't set.
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Display error
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if "$(ERR_MESSAGE)" != ""
|
||||
ERR_MESSAGE = ^
|
||||
client.mak: ^
|
||||
$(ERR_MESSAGE) ^
|
||||
^
|
||||
client.mak: usage^
|
||||
^
|
||||
nmake -f client.mak [MOZ_BRANCH=<cvs_branch_name>] ^
|
||||
[MOZ_DATE=<cvs_date>]^
|
||||
[pull_and_build_all]^
|
||||
[pull_all]^
|
||||
[build_all]^
|
||||
^
|
||||
Environment variables:^
|
||||
^
|
||||
MOZ_BITS set to 32^
|
||||
MOZ_TOOLS set to the directory containing the needed tools ^
|
||||
|
||||
!ERROR $(ERR_MESSAGE)
|
||||
|
||||
!endif
|
||||
650
mozilla/client.mk
Normal file
650
mozilla/client.mk
Normal file
@@ -0,0 +1,650 @@
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Stephen Lamm
|
||||
|
||||
# Build the Mozilla client.
|
||||
#
|
||||
# This needs CVSROOT set to work, e.g.,
|
||||
# setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
# or
|
||||
# setenv CVSROOT :pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot
|
||||
#
|
||||
# To checkout and build a tree,
|
||||
# 1. cvs co mozilla/client.mk
|
||||
# 2. cd mozilla
|
||||
# 3. gmake -f client.mk
|
||||
#
|
||||
# Other targets (gmake -f client.mk [targets...]),
|
||||
# checkout
|
||||
# build
|
||||
# clean (realclean is now the same as clean)
|
||||
# distclean
|
||||
#
|
||||
# See http://www.mozilla.org/build/unix.html for more information.
|
||||
#
|
||||
# Options:
|
||||
# MOZ_OBJDIR - Destination object directory
|
||||
# MOZ_CO_DATE - Date tag to use for checkout (default: none)
|
||||
# MOZ_CO_MODULE - Module to checkout (default: SeaMonkeyAll)
|
||||
# MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
|
||||
# MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
|
||||
# MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
|
||||
# MOZ_CO_BRANCH - Branch tag (Deprecated. Use MOZ_CO_TAG below.)
|
||||
#
|
||||
|
||||
#######################################################################
|
||||
# Checkout Tags
|
||||
#
|
||||
# For branches, uncomment the MOZ_CO_TAG line with the proper tag,
|
||||
# and commit this file on that tag.
|
||||
MOZ_CO_TAG = NETSCAPE_7_0_RTM
|
||||
NSPR_CO_TAG = NETSCAPE_7_0_RTM
|
||||
PSM_CO_TAG = NETSCAPE_7_0_RTM
|
||||
NSS_CO_TAG = NETSCAPE_7_0_RTM
|
||||
LDAPCSDK_CO_TAG = NETSCAPE_7_0_RTM
|
||||
ACCESSIBLE_CO_TAG = NETSCAPE_7_0_RTM
|
||||
GFX2_CO_TAG = NETSCAPE_7_0_RTM
|
||||
IMGLIB2_CO_TAG = NETSCAPE_7_0_RTM
|
||||
BUILD_MODULES = all
|
||||
|
||||
#######################################################################
|
||||
# Defines
|
||||
#
|
||||
CVS = cvs
|
||||
|
||||
CWD := $(shell pwd)
|
||||
|
||||
ifeq "$(CWD)" "/"
|
||||
CWD := /.
|
||||
endif
|
||||
|
||||
ifneq (, $(wildcard client.mk))
|
||||
# Ran from mozilla directory
|
||||
ROOTDIR := $(shell dirname $(CWD))
|
||||
TOPSRCDIR := $(CWD)
|
||||
else
|
||||
# Ran from mozilla/.. directory (?)
|
||||
ROOTDIR := $(CWD)
|
||||
TOPSRCDIR := $(CWD)/mozilla
|
||||
endif
|
||||
|
||||
# on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
|
||||
# work; replace first instance with one forward slash
|
||||
TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
|
||||
|
||||
ifndef TOPSRCDIR_MOZ
|
||||
TOPSRCDIR_MOZ=$(TOPSRCDIR)
|
||||
endif
|
||||
|
||||
# if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
|
||||
DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
|
||||
ifeq ($(DIRNAME),)
|
||||
ROOTDIR := /.
|
||||
endif
|
||||
|
||||
AUTOCONF := autoconf
|
||||
MKDIR := mkdir
|
||||
SH := /bin/sh
|
||||
ifndef MAKE
|
||||
MAKE := gmake
|
||||
endif
|
||||
|
||||
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
|
||||
ifdef CONFIG_GUESS_SCRIPT
|
||||
CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
|
||||
else
|
||||
_IS_FIRST_CHECKOUT := 1
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS
|
||||
|
||||
# Add the CVS root to CVS_FLAGS if needed
|
||||
CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
|
||||
ifneq ($(CVS_ROOT_IN_TREE),)
|
||||
ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
|
||||
CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
|
||||
endif
|
||||
endif
|
||||
|
||||
CVSCO = $(strip $(CVS) $(CVS_FLAGS) co $(CVS_CO_FLAGS))
|
||||
CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
|
||||
CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
|
||||
|
||||
ifdef MOZ_CO_TAG
|
||||
CVS_CO_FLAGS := -r $(MOZ_CO_TAG)
|
||||
endif
|
||||
|
||||
####################################
|
||||
# Load mozconfig Options
|
||||
|
||||
# See build pages, http://www.mozilla.org/build/unix.html,
|
||||
# for how to set up mozconfig.
|
||||
MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
|
||||
MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
|
||||
MOZCONFIG_MODULES := mozilla/build/unix/modules.mk
|
||||
run_for_side_effects := \
|
||||
$(shell cd $(ROOTDIR); \
|
||||
if test "$(_IS_FIRST_CHECKOUT)"; then \
|
||||
$(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
|
||||
else true; \
|
||||
fi; \
|
||||
$(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
|
||||
include $(TOPSRCDIR)/.mozconfig.mk
|
||||
include $(TOPSRCDIR)/build/unix/modules.mk
|
||||
|
||||
####################################
|
||||
# Options that may come from mozconfig
|
||||
|
||||
# Change CVS flags if anonymous root is requested
|
||||
ifdef MOZ_CO_USE_MIRROR
|
||||
CVS_FLAGS := -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
endif
|
||||
|
||||
# MOZ_CVS_FLAGS - Basic CVS flags
|
||||
ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
|
||||
CVS_FLAGS := $(CVS_FLAGS) -q -z 3
|
||||
else
|
||||
CVS_FLAGS := $(MOZ_CVS_FLAGS)
|
||||
endif
|
||||
|
||||
# This option is deprecated. The best way to have client.mk pull a tag
|
||||
# is to set MOZ_CO_TAG (see above) and commit that change on the tag.
|
||||
ifdef MOZ_CO_BRANCH
|
||||
$(warning Use MOZ_CO_TAG instead of MOZ_CO_BRANCH)
|
||||
CVS_CO_FLAGS := -r $(MOZ_CO_BRANCH)
|
||||
endif
|
||||
|
||||
# MOZ_CO_FLAGS - Anything that we should use on all checkouts
|
||||
ifeq "$(origin MOZ_CO_FLAGS)" "undefined"
|
||||
CVS_CO_FLAGS := $(CVS_CO_FLAGS) -P
|
||||
else
|
||||
CVS_CO_FLAGS := $(CVS_CO_FLAGS) $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_CO_DATE
|
||||
CVS_CO_DATE_FLAGS := -D "$(MOZ_CO_DATE)"
|
||||
endif
|
||||
|
||||
ifdef MOZ_OBJDIR
|
||||
OBJDIR := $(MOZ_OBJDIR)
|
||||
MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
|
||||
else
|
||||
OBJDIR := $(TOPSRCDIR)
|
||||
MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS defines for PSM
|
||||
#
|
||||
PSM_CO_MODULE= mozilla/security/manager
|
||||
PSM_CO_FLAGS := -P -A
|
||||
ifdef MOZ_CO_FLAGS
|
||||
PSM_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef PSM_CO_TAG
|
||||
PSM_CO_FLAGS := $(PSM_CO_FLAGS) -r $(PSM_CO_TAG)
|
||||
endif
|
||||
CVSCO_PSM = $(CVS) $(CVS_FLAGS) co $(PSM_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(PSM_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defines for NSS
|
||||
#
|
||||
NSS_CO_MODULE = mozilla/security/nss \
|
||||
mozilla/security/coreconf \
|
||||
$(NULL)
|
||||
|
||||
NSS_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef NSS_CO_TAG
|
||||
NSS_CO_FLAGS := $(NSS_CO_FLAGS) -r $(NSS_CO_TAG)
|
||||
endif
|
||||
# Cannot pull static tags by date
|
||||
ifeq ($(NSS_CO_TAG),NSS_CLIENT_TAG)
|
||||
CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
|
||||
else
|
||||
CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS defines for NSPR
|
||||
#
|
||||
NSPR_CO_MODULE = mozilla/nsprpub
|
||||
NSPR_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef NSPR_CO_TAG
|
||||
NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) -r $(NSPR_CO_TAG)
|
||||
endif
|
||||
# Cannot pull static tags by date
|
||||
ifeq ($(NSPR_CO_TAG),NSPRPUB_CLIENT_TAG)
|
||||
CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
|
||||
else
|
||||
CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS defines for the C LDAP SDK
|
||||
#
|
||||
LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
|
||||
LDAPCSDK_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef LDAPCSDK_CO_TAG
|
||||
LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) -r $(LDAPCSDK_CO_TAG)
|
||||
endif
|
||||
CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defines for the C LDAP SDK
|
||||
#
|
||||
ACCESSIBLE_CO_MODULE = mozilla/accessible
|
||||
ACCESSIBLE_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
ACCESSIBLE_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef ACCESSIBLE_CO_TAG
|
||||
ACCESSIBLE_CO_FLAGS := $(ACCESSIBLE_CO_FLAGS) -r $(ACCESSIBLE_CO_TAG)
|
||||
endif
|
||||
CVSCO_ACCESSIBLE = $(CVS) $(CVS_FLAGS) co $(ACCESSIBLE_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(ACCESSIBLE_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defines for gfx2
|
||||
#
|
||||
GFX2_CO_MODULE = mozilla/gfx2
|
||||
GFX2_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
GFX2_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef GFX2_CO_TAG
|
||||
GFX2_CO_FLAGS := $(GFX2_CO_FLAGS) -r $(GFX2_CO_TAG)
|
||||
endif
|
||||
CVSCO_GFX2 = $(CVS) $(CVS_FLAGS) co $(GFX2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(GFX2_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defines for new image library
|
||||
#
|
||||
IMGLIB2_CO_MODULE = mozilla/modules/libpr0n
|
||||
IMGLIB2_CO_FLAGS := -P
|
||||
ifdef MOZ_CO_FLAGS
|
||||
IMGLIB2_CO_FLAGS := $(MOZ_CO_FLAGS)
|
||||
endif
|
||||
ifdef IMGLIB2_CO_TAG
|
||||
IMGLIB2_CO_FLAGS := $(IMGLIB2_CO_FLAGS) -r $(IMGLIB2_CO_TAG)
|
||||
endif
|
||||
CVSCO_IMGLIB2 = $(CVS) $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IMGLIB2_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defines for standalone modules
|
||||
#
|
||||
ifneq ($(BUILD_MODULES),all)
|
||||
MOZ_CO_MODULE := $(filter-out $(NSPRPUB_DIR) security directory/c-sdk, $(BUILD_MODULE_CVS))
|
||||
MOZ_CO_MODULE += allmakefiles.sh client.mk aclocal.m4 configure configure.in
|
||||
MOZ_CO_MODULE += Makefile.in
|
||||
MOZ_CO_MODULE := $(addprefix mozilla/, $(MOZ_CO_MODULE))
|
||||
|
||||
NOSUBDIRS_MODULE := $(addprefix mozilla/, $(BUILD_MODULE_CVS_NS))
|
||||
ifneq ($(NOSUBDIRS_MODULE),)
|
||||
CVSCO_NOSUBDIRS := $(CVSCO) -l $(CVS_CO_DATE_FLAGS) $(NOSUBDIRS_MODULE)
|
||||
endif
|
||||
|
||||
ifeq (,$(filter $(NSPRPUB_DIR), $(BUILD_MODULE_CVS)))
|
||||
CVSCO_NSPR :=
|
||||
endif
|
||||
ifeq (,$(filter security security/manager, $(BUILD_MODULE_CVS)))
|
||||
CVSCO_PSM :=
|
||||
CVSCO_NSS :=
|
||||
endif
|
||||
ifeq (,$(filter directory/c-sdk, $(BUILD_MODULE_CVS)))
|
||||
CVSCO_LDAPCSDK :=
|
||||
endif
|
||||
ifeq (,$(filter accessible, $(BUILD_MODULE_CVS)))
|
||||
CVSCO_ACCESSIBLE :=
|
||||
endif
|
||||
ifeq (,$(filter gfx2, $(BUILD_MODULE_CVS)))
|
||||
CVSCO_GFX2 :=
|
||||
endif
|
||||
ifeq (,$(filter modules/libpr0n, $(BUILD_MODULE_CVS)))
|
||||
CVSCO_IMGLIB2 :=
|
||||
endif
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS defines for SeaMonkey
|
||||
#
|
||||
ifeq ($(MOZ_CO_MODULE),)
|
||||
MOZ_CO_MODULE := SeaMonkeyAll
|
||||
endif
|
||||
CVSCO_SEAMONKEY := $(CVSCO) $(CVS_CO_DATE_FLAGS) $(MOZ_CO_MODULE)
|
||||
|
||||
####################################
|
||||
# CVS defined for libart (pulled and built if MOZ_INTERNAL_LIBART_LGPL is set)
|
||||
#
|
||||
CVSCO_LIBART := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/other-licenses/libart_lgpl
|
||||
|
||||
ifdef MOZ_INTERNAL_LIBART_LGPL
|
||||
FASTUPDATE_LIBART := fast_update $(CVSCO_LIBART)
|
||||
CHECKOUT_LIBART := cvs_co $(CVSCO_LIBART)
|
||||
else
|
||||
CHECKOUT_LIBART := true
|
||||
FASTUPDATE_LIBART := true
|
||||
endif
|
||||
|
||||
####################################
|
||||
# CVS defines for Calendar (pulled and built if MOZ_CALENDAR is set)
|
||||
#
|
||||
CVSCO_CALENDAR := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/calendar
|
||||
|
||||
ifdef MOZ_CALENDAR
|
||||
FASTUPDATE_CALENDAR := fast_update $(CVSCO_CALENDAR)
|
||||
CHECKOUT_CALENDAR := cvs_co $(CVSCO_CALENDAR)
|
||||
else
|
||||
CHECKOUT_CALENDAR := true
|
||||
FASTUPDATE_CALENDAR := true
|
||||
endif
|
||||
|
||||
|
||||
# because some cygwin tools can't handle native dos-drive paths & vice-versa
|
||||
# force configure to use a relative path for --srcdir
|
||||
# need a better check for win32
|
||||
# and we need to get OBJDIR earlier
|
||||
ifdef MOZ_TOOLS
|
||||
_tmpobjdir := $(shell cygpath -u $(OBJDIR))
|
||||
_abs2rel := $(shell cygpath -w $(TOPSRCDIR)/build/unix/abs2rel.pl | sed -e 's|\\|/|g')
|
||||
_OBJ2SRCPATH := $(shell $(_abs2rel) $(TOPSRCDIR) $(_tmpobjdir))
|
||||
endif
|
||||
|
||||
#######################################################################
|
||||
# Rules
|
||||
#
|
||||
|
||||
# Print out any options loaded from mozconfig.
|
||||
all build checkout clean depend distclean export libs install realclean::
|
||||
@if test -f .mozconfig.out; then \
|
||||
cat .mozconfig.out; \
|
||||
rm -f .mozconfig.out; \
|
||||
else true; \
|
||||
fi
|
||||
|
||||
ifdef _IS_FIRST_CHECKOUT
|
||||
all:: checkout build
|
||||
else
|
||||
all:: checkout alldep
|
||||
endif
|
||||
|
||||
# Windows equivalents
|
||||
pull_all: checkout
|
||||
build_all: build
|
||||
build_all_dep: alldep
|
||||
build_all_depend: alldep
|
||||
clobber clobber_all: clean
|
||||
pull_and_build_all: checkout alldep
|
||||
|
||||
# Do everything from scratch
|
||||
everything: checkout clean build
|
||||
|
||||
####################################
|
||||
# CVS checkout
|
||||
#
|
||||
checkout::
|
||||
# @: Backup the last checkout log.
|
||||
@if test -f $(CVSCO_LOGFILE) ; then \
|
||||
mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
|
||||
else true; \
|
||||
fi
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
@echo "Removing local configures" ; \
|
||||
cd $(ROOTDIR) && \
|
||||
$(RM) -f mozilla/configure mozilla/nsprpub/configure \
|
||||
mozilla/directory/c-sdk/configure
|
||||
endif
|
||||
@echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
|
||||
@echo '$(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk'; \
|
||||
cd $(ROOTDIR) && \
|
||||
$(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk
|
||||
@cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
|
||||
|
||||
real_checkout:
|
||||
# @: Start the checkout. Split the output to the tty and a log file. \
|
||||
# : If it fails, touch an error file because "tee" hides the error.
|
||||
@failed=.cvs-failed.tmp; rm -f $$failed*; \
|
||||
cvs_co() { echo "$$@" ; \
|
||||
("$$@" || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \
|
||||
if test -f $$failed; then false; else true; fi; }; \
|
||||
cvs_co $(CVSCO_NSPR) && \
|
||||
cvs_co $(CVSCO_NSS) && \
|
||||
cvs_co $(CVSCO_PSM) && \
|
||||
cvs_co $(CVSCO_LDAPCSDK) && \
|
||||
cvs_co $(CVSCO_ACCESSIBLE) && \
|
||||
cvs_co $(CVSCO_GFX2) && \
|
||||
cvs_co $(CVSCO_IMGLIB2) && \
|
||||
$(CHECKOUT_CALENDAR) && \
|
||||
$(CHECKOUT_LIBART) && \
|
||||
cvs_co $(CVSCO_SEAMONKEY) && \
|
||||
cvs_co $(CVSCO_NOSUBDIRS)
|
||||
@echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
|
||||
# @: Check the log for conflicts. ;
|
||||
@conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
|
||||
if test "$$conflicts" ; then \
|
||||
echo "$(MAKE): *** Conflicts during checkout." ;\
|
||||
echo "$$conflicts" ;\
|
||||
echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
|
||||
false; \
|
||||
else true; \
|
||||
fi
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
@echo Generating configures using $(AUTOCONF) ; \
|
||||
cd $(TOPSRCDIR) && $(AUTOCONF) && \
|
||||
cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \
|
||||
cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF)
|
||||
endif
|
||||
|
||||
fast-update:
|
||||
# @: Backup the last checkout log.
|
||||
@if test -f $(CVSCO_LOGFILE) ; then \
|
||||
mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
|
||||
else true; \
|
||||
fi
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
@echo "Removing local configures" ; \
|
||||
cd $(ROOTDIR) && \
|
||||
$(RM) -f mozilla/configure mozilla/nsprpub/configure \
|
||||
mozilla/directory/c-sdk/configure
|
||||
endif
|
||||
@echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
|
||||
@echo '$(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk'; \
|
||||
cd $(ROOTDIR) && \
|
||||
$(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk
|
||||
@cd $(TOPSRCDIR) && \
|
||||
$(MAKE) -f client.mk real_fast-update
|
||||
|
||||
real_fast-update:
|
||||
# @: Start the update. Split the output to the tty and a log file. \
|
||||
# : If it fails, touch an error file because "tee" hides the error.
|
||||
@failed=.fast_update-failed.tmp; rm -f $$failed*; \
|
||||
fast_update() { (config/cvsco-fast-update.pl $$@ || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \
|
||||
if test -f $$failed; then false; else true; fi; }; \
|
||||
cvs_co() { echo "$$@" ; \
|
||||
("$$@" || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \
|
||||
if test -f $$failed; then false; else true; fi; }; \
|
||||
fast_update $(CVSCO_NSPR) && \
|
||||
cd $(ROOTDIR) && \
|
||||
failed=mozilla/.fast_update-failed.tmp && \
|
||||
cvs_co $(CVSCO_NSS) && \
|
||||
failed=.fast_update-failed.tmp && \
|
||||
cd mozilla && \
|
||||
fast_update $(CVSCO_PSM) && \
|
||||
fast_update $(CVSCO_LDAPCSDK) && \
|
||||
fast_update $(CVSCO_ACCESSIBLE) && \
|
||||
fast_update $(CVSCO_GFX2) && \
|
||||
fast_update $(CVSCO_IMGLIB2) && \
|
||||
$(FASTUPDATE_CALENDAR) && \
|
||||
$(FASTUPDATE_LIBART) && \
|
||||
fast_update $(CVSCO_SEAMONKEY) && \
|
||||
fast_update $(CVSCO_NOSUBDIRS)
|
||||
@echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
|
||||
# @: Check the log for conflicts. ;
|
||||
@conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
|
||||
if test "$$conflicts" ; then \
|
||||
echo "$(MAKE): *** Conflicts during fast-update." ;\
|
||||
echo "$$conflicts" ;\
|
||||
echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
|
||||
false; \
|
||||
else true; \
|
||||
fi
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
@echo Generating configures using $(AUTOCONF) ; \
|
||||
cd $(TOPSRCDIR) && $(AUTOCONF) && \
|
||||
cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \
|
||||
cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF)
|
||||
endif
|
||||
|
||||
####################################
|
||||
# Web configure
|
||||
|
||||
WEBCONFIG_FILE := $(HOME)/.mozconfig
|
||||
|
||||
MOZCONFIG2CONFIGURATOR := build/autoconf/mozconfig2configurator
|
||||
webconfig:
|
||||
@cd $(TOPSRCDIR); \
|
||||
url=`$(MOZCONFIG2CONFIGURATOR) $(TOPSRCDIR)`; \
|
||||
echo Running mozilla with the following url: ;\
|
||||
echo ;\
|
||||
echo $$url ;\
|
||||
mozilla -remote "openURL($$url)" || \
|
||||
netscape -remote "openURL($$url)" || \
|
||||
mozilla $$url || \
|
||||
netscape $$url ;\
|
||||
echo ;\
|
||||
echo 1. Fill out the form on the browser. ;\
|
||||
echo 2. Save the results to $(WEBCONFIG_FILE)
|
||||
|
||||
#####################################################
|
||||
# First Checkout
|
||||
|
||||
ifdef _IS_FIRST_CHECKOUT
|
||||
# First time, do build target in a new process to pick up new files.
|
||||
build::
|
||||
$(MAKE) -f $(TOPSRCDIR)/client.mk build
|
||||
else
|
||||
|
||||
#####################################################
|
||||
# After First Checkout
|
||||
|
||||
|
||||
####################################
|
||||
# Configure
|
||||
|
||||
CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status)
|
||||
CONFIG_CACHE := $(wildcard $(OBJDIR)/config.cache)
|
||||
|
||||
ifdef RUN_AUTOCONF_LOCALLY
|
||||
EXTRA_CONFIG_DEPS := \
|
||||
$(TOPSRCDIR)/aclocal.m4 \
|
||||
$(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
|
||||
$(NULL)
|
||||
|
||||
$(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
|
||||
@echo Generating $@ using autoconf
|
||||
cd $(TOPSRCDIR); $(AUTOCONF)
|
||||
endif
|
||||
|
||||
CONFIG_STATUS_DEPS_L10N := $(wildcard $(TOPSRCDIR)/l10n/makefiles.all)
|
||||
|
||||
CONFIG_STATUS_DEPS := \
|
||||
$(TOPSRCDIR)/configure \
|
||||
$(TOPSRCDIR)/allmakefiles.sh \
|
||||
$(TOPSRCDIR)/.mozconfig.mk \
|
||||
$(wildcard $(TOPSRCDIR)/nsprpub/configure) \
|
||||
$(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
|
||||
$(wildcard $(TOPSRCDIR)/mailnews/makefiles) \
|
||||
$(CONFIG_STATUS_DEPS_L10N) \
|
||||
$(wildcard $(TOPSRCDIR)/themes/makefiles) \
|
||||
$(NULL)
|
||||
|
||||
# configure uses the program name to determine @srcdir@. Calling it without
|
||||
# $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
|
||||
# path of $(TOPSRCDIR).
|
||||
ifeq ($(TOPSRCDIR),$(OBJDIR))
|
||||
CONFIGURE := ./configure
|
||||
else
|
||||
CONFIGURE := $(TOPSRCDIR)/configure
|
||||
endif
|
||||
|
||||
ifdef _OBJ2SRCPATH
|
||||
CONFIGURE_ARGS := --srcdir=$(_OBJ2SRCPATH) $(CONFIGURE_ARGS)
|
||||
endif
|
||||
|
||||
$(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
|
||||
@if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
|
||||
@echo cd $(OBJDIR);
|
||||
@echo $(CONFIGURE) $(CONFIGURE_ARGS)
|
||||
@cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
|
||||
|| ( echo "*** Fix above errors and then restart with\
|
||||
\"$(MAKE) -f client.mk build\"" && exit 1 )
|
||||
@touch $(OBJDIR)/Makefile
|
||||
|
||||
ifdef CONFIG_STATUS
|
||||
$(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
|
||||
cd $(OBJDIR); \
|
||||
CONFIG_FILES=config/autoconf.mk ./config.status
|
||||
endif
|
||||
|
||||
|
||||
####################################
|
||||
# Depend
|
||||
|
||||
depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
|
||||
$(MOZ_MAKE) export && $(MOZ_MAKE) depend
|
||||
|
||||
####################################
|
||||
# Build it
|
||||
|
||||
build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
|
||||
$(MOZ_MAKE)
|
||||
|
||||
####################################
|
||||
# Other targets
|
||||
|
||||
# Pass these target onto the real build system
|
||||
install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
|
||||
$(MOZ_MAKE) $@
|
||||
|
||||
cleansrcdir:
|
||||
@cd $(TOPSRCDIR); \
|
||||
if [ -f webshell/embed/gtk/Makefile ]; then \
|
||||
$(MAKE) -C webshell/embed/gtk distclean; \
|
||||
fi; \
|
||||
if [ -f Makefile ]; then \
|
||||
$(MAKE) distclean ; \
|
||||
else \
|
||||
echo "Removing object files from srcdir..."; \
|
||||
rm -fr `find . -type d \( -name .deps -print -o -name CVS \
|
||||
-o -exec test ! -d {}/CVS \; \) -prune \
|
||||
-o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
|
||||
build/autoconf/clean-config.sh; \
|
||||
fi;
|
||||
|
||||
# (! IS_FIRST_CHECKOUT)
|
||||
endif
|
||||
|
||||
.PHONY: checkout real_checkout depend build export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything
|
||||
@@ -1,432 +0,0 @@
|
||||
#################################################################################
|
||||
# 12/03/01, ChatZilla 0.8.5, <rginda@netscape.com>
|
||||
|
||||
Shipped with 0.9.7. Again, thanks to Samuel Sieb <samuel@sieb.net> for
|
||||
contributing many of the fixes (the most obvious of which is mIRC color code
|
||||
support), reviews, and driving the release candidate process. Thanks to Casey
|
||||
Hutchinson <nnooiissee@yahoo.com> for mac accelerator cleanup, help and edit
|
||||
menus, xul refactoring work, statusbar, and motivation. Thanks to
|
||||
KOIKE Kazuhiko, Katsuhiko Momoi, Shoji Matsumoto, and others who helped out in
|
||||
bug 41564 to get charsets working.
|
||||
|
||||
* strict warning cleanup.
|
||||
* add input/output charset support. use /charset <charsetname> to
|
||||
change the current charset, settings will be saved.
|
||||
* add "open at startup" item to view menus.
|
||||
* implement urls for /query views (isnick urls.)
|
||||
* make nicknames in output window isnick urls.
|
||||
* add mozilla statusbar.
|
||||
* add chatzilla icon to mozilla statusbar.
|
||||
* move "statusbar" to top of message window, rename to "header".
|
||||
* add mirc color code handling.
|
||||
* show long topics in multiple lines in header, instead of cropping.
|
||||
* add bugzilla munger rule, links "bug 12345" and "bug #12345" to appropriate
|
||||
bugzilla bugs.
|
||||
* add channel munger rule to link #channelname to the channel.
|
||||
* add edit and help menus.
|
||||
* make /attach accept urls and url "fragments",
|
||||
/attach moznet, /attach moznet/chatzilla, and /attach irc://moznet/chatzilla
|
||||
are now all valid commands.
|
||||
* add prefs for when to make noise; new msg, msg in existing query view, and/or
|
||||
/stalk matches.
|
||||
* allow for space separated list of sounds to play, like "beep beep", or
|
||||
"file:/foo.wav"
|
||||
* fix bogus "connection refused" error when disconnecting.
|
||||
* add editable topic in header area.
|
||||
* implement server passowrds (they were way broke.)
|
||||
* add ctrl-tab and ctrl-shift-tab handlers to switch views.
|
||||
* fix tab complete behavior, so it works for words in the middle of the line.
|
||||
* add /about command to get version info.
|
||||
* add "collapse consecutive messages" option, useful for motifs with faces.
|
||||
* mac s/ctrl/meta/ fixes.
|
||||
* add default completions per view, as described in bug 63621.
|
||||
* add whowas help info.
|
||||
* format responses from WHO queries.
|
||||
* add network view maxlines pref.
|
||||
* only print "attampting to connect" message once per network.
|
||||
* add target in Kick item of message pane context menu.
|
||||
* remove timestamp tooltips, use status text instead.
|
||||
* show message source in status bar, after timestamp.
|
||||
* remove usage warning from /quit command.
|
||||
* change max connect attempts from 20 to 5.
|
||||
* remove unused listbox.js file from chatzilla.jar.
|
||||
* add help menu.
|
||||
* allow params in /ctcp commands.
|
||||
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
|
||||
41564,63621,71549,86032,88438,91399,92080,95913,97288,98244,99612,100159,100704,101942,102377,103104,103598,104114,105343,105604,105881,105882,106349,107148,108061,110006,111546,111565
|
||||
|
||||
http://bugzilla.mozilla.org/buglist.cgi?bug_id=41564%2C63621%2C71549%2C86032%2C88438%2C91399%2C92080%2C95913%2C97288%2C98244%2C99612%2C100159%2C100704%2C101942%2C102377%2C103104%2C103598%2C104114%2C105343%2C105604%2C105881%2C105882%2C106349%2C107148%2C108061%2C110006%2C111546%2C111565
|
||||
|
||||
28 bugs found.
|
||||
ID Opened Summary
|
||||
63621 2000-12-22 [RFE] Shortcut to reply to the last IRC message
|
||||
98244 2001-09-04 Add "Leave this channel" to channel popup menu
|
||||
101942 2001-09-27 whowas command said unknown even though it exists
|
||||
92080 2001-07-24 Enter key to navigate menus also sends commmand
|
||||
105604 2001-10-18 chatzilla should have a status bar (and component bar)
|
||||
99612 2001-09-14 Chatzilla window id should not be "main-window"
|
||||
102377 2001-09-29 Chatzilla does not handle server passwords
|
||||
103104 2001-10-04 implement isnick urls
|
||||
103598 2001-10-07 JavaScript strict mode patch for Chatzilla
|
||||
91399 2001-07-18 Missing "screen buffer length" pref setting in prefs.js
|
||||
104114 2001-10-10 Can't localize some strings in Chatzilla.
|
||||
100704 2001-09-20 chatzilla needs an easy way to edit the topic
|
||||
105882 2001-10-21 Chatzilla keyboard shortcuts use wrong modifier key
|
||||
100159 2001-09-17 hiding a minimized userlist expands it instead
|
||||
105343 2001-10-17 chatzilla should have /about command
|
||||
106349 2001-10-23 [rfe]show a check beside selected motif in the view menu.
|
||||
107148 2001-10-27 chatzilla menus should move to an overlay
|
||||
105881 2001-10-21 `Edit' menu is missing in Chatzilla
|
||||
88438 2001-06-29 2xAlt-Tab will bring up unexpected "user-match"-message
|
||||
110006 2001-11-13 view/hide status bar is not saved
|
||||
71549 2001-03-09 [RFE] add mIRC and IrcII color code support
|
||||
86032 2001-06-14 [RFE] Ctrl+[shift]+tab and [shift]+F6 to switch channel view
|
||||
95913 2001-08-18 Include Chatzilla icon in Component Bar
|
||||
111565 2001-11-23 /query command no longer sends second argument
|
||||
111546 2001-11-22 User list doesn't repopulate correctly after rejoining chann
|
||||
108061 2001-11-01 /stalk won't stalk nicknames
|
||||
41564 2000-06-05 Internationalize ChatZilla to handle different language scri
|
||||
97288 2001-08-28 Chatzilla gets disconnected w/o indicating anything is wrong
|
||||
|
||||
#################################################################################
|
||||
# 8/23/01, ChatZilla 0.8.4, <rginda@netscape.com>
|
||||
|
||||
Shipped with Mozilla 0.9.4, 0.9.5, and 0.9.6, introduced motifs, channel and
|
||||
mailto links, and other things that were only availble in the 0.8.1a/b releases,
|
||||
which were not checked in. Thanks to Samuel Sieb <samuel@sieb.net> for
|
||||
contributing many of the fixes, and reviewing the rest.
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
|
||||
superbug: 103386
|
||||
|
||||
41337,44447,69296,72272,72702,73652,73767,74408,79322,85573,89692,89717,92327,92403,95781,96567
|
||||
|
||||
http://bugzilla.mozilla.org/buglist.cgi?bugidtype=include&bug_id=41337%2C44447%2C69296%2C72272%2C72702%2C73652%2C73767%2C74408%2C79322%2C85573%2C89692%2C89717%2C92327%2C92403%2C95781%2C96567
|
||||
|
||||
SuperBug: http://bugzilla.mozilla.org/show_bug.cgi?id=89713
|
||||
|
||||
16 bugs found.
|
||||
ID Opened Summary
|
||||
92403 2001-07-26 mozilla -help displays >>>>>>>>>>>> chatzilla-service loaded
|
||||
96567 2001-08-22 long nicks cause extra-high lines
|
||||
95781 2001-08-17 Chatzilla text is black-on-black
|
||||
74408 2001-04-02 Typing in Chatzilla should give Textbox at bottom focus
|
||||
automatically.
|
||||
89692 2001-07-06 /away command only uses first word for reason
|
||||
85573 2001-06-12 [RFE] support for mailto:
|
||||
72272 2001-03-16 irc urls don't detect server/network names correctly
|
||||
72702 2001-03-20 need UI for adding irc:// bookmarks
|
||||
89717 2001-07-06 header text not visible for op and voice
|
||||
73652 2001-03-27 Missing support for !-Channels
|
||||
41337 2000-06-02 /join should join the current window if it is a channel and you
|
||||
are not currently in it
|
||||
79322 2001-05-07 [RFE] Make chatzilla user scriptable
|
||||
73767 2001-03-28 Confusing behaviour if nick already in use
|
||||
44447 2000-07-02 no ctcp ping results
|
||||
69296 2001-02-18 irc URL with # doesn't work
|
||||
92327 2001-07-25 [RFE] Have ops' names in red
|
||||
|
||||
#################################################################################
|
||||
# 07/01/01, ChatZilla 0.8.3, <rginda@netscape.com>
|
||||
|
||||
Revision 0.8.3 removed hardcoded strings, in favor of the Mozilla i18n/l10n api.
|
||||
RTL languages may still have some issues. Many thanks to Chiaki Koufugata
|
||||
<chiaki@mozilla.gr.jp> for doing the heavy lifting.
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
|
||||
http://bugzilla.mozilla.org/show_bug.cgi?id=27805
|
||||
Bug 27805, "ChatZilla needs i18n"
|
||||
|
||||
#################################################################################
|
||||
# 06/03/01, ChatZilla 0.8.2, <rginda@netscape.com>
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
79311, 75226, 80993
|
||||
|
||||
=================================================================================
|
||||
= Changes by file name...
|
||||
chatzilla-service.js:
|
||||
- Add stub allowPort method.
|
||||
- Fix signature for handleContent method, bug 80993
|
||||
|
||||
connection-xpcom.js:
|
||||
- factor chatzilla specific code out of this file. Callbacks into chatzilla specific code are now used, making this file more generic.
|
||||
- according to darinf (the current necko guy), using openOutputStream with asyncRead is a bad thing. Most of the changes in this file involve migrating from usage of openOutputStream to asyncWrite.
|
||||
- Changes also include fixing the function declaration syntax to match the rest of the code (two lines, named functions.)
|
||||
|
||||
irc-debug.js:
|
||||
- check nextLine before using it.
|
||||
|
||||
irc.js:
|
||||
- changes to work with new socket interface.
|
||||
- correct isOp detection in setTopic
|
||||
- remove checks for undefined exceptions
|
||||
- route data-available immediatley. inserting a data-available event to be routed later caused disconnect events to be recieved out of order.
|
||||
|
||||
utils.js:
|
||||
- fix HAS_XPCOM test (XPCDOM broke it.)
|
||||
- add jsenv.HAS_NSPR_EVENTQ
|
||||
|
||||
mybot.js:
|
||||
- not built -
|
||||
- add dummy escape/unescape if it isn't there
|
||||
|
||||
handlers.js:
|
||||
- return false the first time through onClose(), and disconnect from all servers. This makes sure we keep the window around long enough to send the QUIT messages.
|
||||
- close window if client.userClose is set and we disconnected from the last server.
|
||||
|
||||
chatzilla.xul:
|
||||
- hook up onclose event.
|
||||
- apply patch from 75226, fixes initial splitter position.
|
||||
|
||||
static.js:
|
||||
- copy client.userAgent code from chatzilla 0.8.1x
|
||||
- implement getConnectionCount()
|
||||
|
||||
#################################################################################
|
||||
# ChatZilla 0.8.1a and 0.8.1b released only in XPI format, changes to be merged
|
||||
# in later.
|
||||
#################################################################################
|
||||
|
||||
#################################################################################
|
||||
# 03/08/01, ChatZilla 0.8, <rginda@netscape.com>
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
|
||||
The superbug for ChatZilla 0.8 is 71468, which fixes the following bugs:
|
||||
22890, 40959, 41798, 42905, 43850, 44077, 54143, 56312, 59036, 59374, 65633, 65634, 65861, 66040, 71310, and 71378.
|
||||
|
||||
Also, a workaround for bug 70335 is included, and bug 45576 *may* be fixed, we'll have to wait and see
|
||||
|
||||
Link to superbug: http://bugzilla.mozilla.org/show_bug.cgi?id=71468
|
||||
Link to list of bugs fixed: http://bugzilla.mozilla.org/buglist.cgi?bug_id=22890%2C+40959%2C+41798%2C+42905%2C+43850%2C+44077%2C+54143%2C+56312%2C+59036%2C+59374%2C+65633%2C+65634%2C+65861%2C+66040%2C+71310%2C+71378
|
||||
|
||||
=================================================================================
|
||||
= Changes by file name...
|
||||
|
||||
These changes are listed as they appear, when reading a diff between what's in cvs now, and what's in my local tree. Before checking in, I'll tag the current chatzilla code as chatzilla0.7, and after, chatzilla0.8. Just diff those two tags to get something to look at alongside this ChangeLog. Or see the superbug for ChatZilla 0.8, 71468, which has a copy of the diff attached to it.
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
- NEW FILES:
|
||||
|
||||
outputwindow.html:
|
||||
- used as the base html for the output window, allowed bug 41798, bug 54143, and bug 59374 to be fixed.
|
||||
|
||||
ChangeLog:
|
||||
- this file, tracks changes between ChatZilla versions. I added the comments from the previous large checkin (retro-branded as ChatZilla 0.7) as well.
|
||||
|
||||
TODO:
|
||||
- List of things to do in the future.
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
- MODIFIED FILES:
|
||||
|
||||
README:
|
||||
- Started user guide, only the TOC at the moment.
|
||||
|
||||
connection-xpcom.js:
|
||||
- Don't call close on output streams, it throws a NS_ERROR_NOT_IMPLEMENTED. dougt says just let the refcount go to 0 and it'll be fine.
|
||||
- Tell the IRCServer object it has lost it's connection when the stream gets an onStopRequest (bug 22890 and 42905)
|
||||
|
||||
events.js:
|
||||
- dump exception on error (to get the filename and linenumber info, if it's there)
|
||||
|
||||
irc-debug.js:
|
||||
- show data for new "info" type of event.
|
||||
|
||||
irc.js:
|
||||
- add a servers collection to the IRCNetwork. I'm not exactly sure why I didn't do this from the beginning. It allows us to recover and reuse server objects in the event of a disconnect/reconnect. (bug 22890 and 66040)
|
||||
- set default number of reconnect attempts to something more tolerable. (bug 22890 and 66040)
|
||||
- move connection attempt/ next host to attempt information from the event object onto the actual network object. The new reconnect logic needs it in places where the event is not available. (bug 22890 and 66040)
|
||||
- spew out info event when max connect attempts are exhausted. (bug 22890 and 66040)
|
||||
- spew out info event when a connection attempt starts. (bug 22890 and 66040)
|
||||
- add try/catch around server creation, to be safe.
|
||||
- spew info event when moving on to the next connection attempt. (bug 22890 and 66040)
|
||||
- modify CIRCServer connection to check for a dupe server in it's parent.servers collection, re-init/return that object if it exists, otherwise make a new one.
|
||||
- try to reconnect if the connection was broken before we got a 001 message from the server, regardless of wether ot not the parent IRCNetwork has it's "stayingPower" flag set.
|
||||
- forward the disconnect event from the server to the network, to keep the network properly informed.
|
||||
- if an unknown message arrives at the server, send it to the server's onUnknown handler if it exists. If the server has no onUnknown handler, send it to the parent network's handler for that type of message, if it has one. If the parent network has no handler for this message, send it to the network's onUnknown handler as a last ditch. (the event code will fail silently if the network has no onUnknown handler.)
|
||||
- when we get an 001, reset connection attempt cound, and record the successful connection.
|
||||
- if the channel's users collection is considered "stable" when a new names list begins to arrive, mark it as unstable before wiping it out. the list will be marked stable again when the end of names (code 366) message arrives.
|
||||
- refer to this.foo instead of e.server.foo. they are the same object, but this.foo is one less lookup. this change should happen to the rest of this file eventually.
|
||||
- Tell the network when the user changes their nick. This is so nick changes that occur when you're not on any channel don't go unnoticed.
|
||||
- round off excess decimals in the server lag.
|
||||
- add opCount and voiceCount vars to the IRCChannel during a channel.getUsersCount() call.
|
||||
|
||||
utils.js:
|
||||
- make keys() return an array instead of a string. this function was not called by anything before this change.
|
||||
- add formatDateOffset() function to the result of a Date subtraction into english.
|
||||
- add arraySpeak() function to join an array into an english list.
|
||||
- add arrayContains() function to search an array for an element.
|
||||
- add arrayIndexOf() function to get the index of an element within the array.
|
||||
- modify hyphenateWord() function to search for a goo place to break the word with a -/+ 5 character fuzz factor.
|
||||
- add splitLongWord() function, similar to hyphenateWord, except returns an array.
|
||||
- fix stoopid paren bug in roundTo() function.
|
||||
|
||||
chatzilla.xul:
|
||||
- add broadcasters for the file menu items.
|
||||
- add keys for the file menu items.
|
||||
- add file menu. (bug 43850)
|
||||
- move options menu under file menu.
|
||||
- remove old view toolbar.
|
||||
- add crop="right" attribute to the userlist table to prevent horizontal scrollbars. (bug 56312)
|
||||
- whitespace fixes.
|
||||
- add input splitter for multiline-input mode.
|
||||
- add multiline-input control for multiline-input mode.
|
||||
- add crop="right" to statusbar elements (bug 59036 maybe 45576)
|
||||
|
||||
commands.js:
|
||||
- alphabetize commands.
|
||||
- add client, cancel, disconnect, infobar, list, networks, notify, query, and status commands. (bug 44077)
|
||||
|
||||
handlers.js:
|
||||
- don't call setOutputStyle() onLoad (it's been deleted.)
|
||||
- we can now call setClientOutput() and initStatic() onLoad, because the output window is a separate .html file. This means the the xul onLoad will not be called until the .html file is loaded, and so we can be sure that the content model for the output window will be stable.
|
||||
- global change from 'quotes like this' to ``quotes like this''.
|
||||
- set client.debugMode variable when debug messages are on. This flag is used to determine how we display irc message codes.
|
||||
- remove onToggleToolbarIcons() because we don't have a toolbar anymore.
|
||||
- don't allow the last view to be deleted.
|
||||
- move to new sort-service, but leave the old one in for now. This keeps us from breaking 0.8 users.
|
||||
- add keyUp handler for the multiline-input control.
|
||||
- clear the input control's value in the singleline input control's keyUp handler, instead of onInputCompleteLine(), because we don't want to clear the multiline control.
|
||||
- switch to multiline mode if the singleline control hears a ctl+up.
|
||||
- don't spew an error message if autocomplete can't locate a match on [tab]
|
||||
- remove old (and broken) multiline code.
|
||||
- add onNotifyTimeout() handler to take care of sending ISON messages. ISON is used to ask the server if certain users are on, used for the /notify command.
|
||||
- add onInputCancel() handler (for the /cancel command) to cancel and pending /attach command.
|
||||
- send unknown / commands directly to the server, (after warning the user that the command was unknown.)
|
||||
- add onInputSimpleCommand(). Any / commands that can be sent directly to the server can use this function, instead of creating a new one for every "simple" command.
|
||||
- add onInputStatus() (for the /status command.) Prints connection status, including connection duration, lag, and channels joined.
|
||||
- revamp onInputTestdisplay(). It now tests all types of messages, and all munger rules, from multiple sources, to multiple targets. Much more useful than it used to be.
|
||||
- add onInputNetworks() (for /networks.) Lists all networks as a set of irc:// links.
|
||||
- show an error message if you attempt to /attach to a network you are already attached to.
|
||||
- fail a /delete if the user provided a parameter. /delete deletes the *current* view, failing if a param is given prevents accidental deletion.
|
||||
- Change onInputNames() from a function that toggles the infobar (userlist) visibility to a function that sends a NAMES command to the server.
|
||||
- add onInputInfobar() to do what onInputName() used to do.
|
||||
- add extra help message to onInputCommands().
|
||||
- add status messages to onInputAttach().
|
||||
- fix onInputMe() so it works on /query views as well as channels.
|
||||
- add onInputQuery() function (for /query.)
|
||||
- fix onInputMsg() so it does not force a new query window to open.
|
||||
- change parameter of temporary doEval() function form s to __s, so as not to interfere with eval'd expressions.
|
||||
- split EVAL message types into EVAL-IN and EVAL-OUT, so you can see was was eval()d, in the event of an error.
|
||||
- change onInputTopic() from a function that would consult the irc library for topic information to a function send asks the server to update the topic information in the irc library. the code that handles TOPIC replies now tales care of printing this information out.
|
||||
- add onInputNotify() function (for /notify.)
|
||||
- add onInfo handler to networks.
|
||||
- add onUnknown handler to networks.
|
||||
- add 005 to the list of initial server messages that are *always* displayed on the network view.
|
||||
- force handlers attached to the my_showtonet() function to display on the network view (ignoring the client.SLOPPY_NETWORKS setting.)
|
||||
- allow NOTICE messages to be affected by client.SPLOPPY_NETWORKS.
|
||||
- add an on303 (ISON reply) handler to networks.
|
||||
- add an on322 (LIST reply) handler to networks.
|
||||
- use the new arraySpeak() and formatDateOffset() functions when printing WHOIS information.
|
||||
- print error message when a network gets disconnected. (bug 42905)
|
||||
- show nick change information on the network if it is the current view.
|
||||
- display "end of NAMES" message if the channel's pendingNamesReply flag is set, then clear pendingNamesReply. channel.pendingNamesReply is set by the /names command (and cleared in on366) to control wether or not NAMES information (353 and 366 messages) should actually be displayed. (the irc library will request this information when a new channels is joined, and we don't want to display it in that case.) (bug 40959)
|
||||
- print topic information on a 332.
|
||||
- print topic setter information on a 333.
|
||||
- print NAMES information on 353 if the channel's pendingNamesReply flag is set. (bug 40959)
|
||||
- global fixes to .display callsites. new syntax is obj.display (<msg>, <type>, <source>, <dest>);
|
||||
- beep when a message from a user is received.
|
||||
|
||||
readprefs.js:
|
||||
- remove toolbar.icons pref, we don't have a toolbar anymore.
|
||||
- set client.debugMode based on debug messages pref.
|
||||
|
||||
static.js:
|
||||
- removed some unused client.PREFERENCE type variables.
|
||||
- added client.SLOPPY_NETWORKS switch (see comment.)
|
||||
- added client.HIDE_CODES switch (see comment.)
|
||||
- added a message code -> display glyph map for use when client.HIDE_CODES is true.
|
||||
- remove the isPermanent flag from the client view, allows users to delete the client view.
|
||||
- set client.IGNORE_MOTD to false.
|
||||
- bump MAX_MESSAGES up a few notches for various view types.
|
||||
- set onresize handler for the window. (bug 41798)
|
||||
- create an nsISound in the client object, so we can beep for /msgs.
|
||||
- hook up multiline-input control keyUp handler.
|
||||
- remove icons-in-toolbar related code.
|
||||
- remove network list from the hello message, but...
|
||||
- call onInputNetworks() during init.
|
||||
- start the notify interval.
|
||||
- global change from 'quotes like this' to ``quotes like this''.
|
||||
- remove dead servers from the efnet server list.
|
||||
- add opennet network. (bug 65633)
|
||||
- removed the "you-talking-to-me" munger rule, this is now done in display().
|
||||
- made bold, underline, teletype, italic regexps more better.
|
||||
- remove matchMyNick function, this is now done in display().
|
||||
- add a "chatzilla-link" class to all links.
|
||||
- style rheet matches as chatzilla-rheet and chatzilla-link.
|
||||
- keep smileys that start with the number 8 from matching. (bug 65861)
|
||||
- fix insertHyphenatedWord() to use splitLongWord() and empty <img> tags, instead of using hyphenateWord() to insert spaces in long words. the empty <img> lets the layout engine break long words, without adding spaces.
|
||||
- added skin switching voodoo to mainStep, it's a dumb ass hack, read the comment. (bug 59374)
|
||||
- removed setOutputStyle() function, we can't do this now that we load the basic output document as a .html file.
|
||||
- simplified setClientOutput() function. all the extra work is not needed now that we load the basic output document as a .html file.
|
||||
- global fixes to .display callsites. new syntax is obj.display (<msg>, <type>, <source>, <dest>);
|
||||
- added multilineLineInputMode() function, to set the input mode state.
|
||||
- added stringToMsg() function. takes a string and converts it into munged DOM nodes ready to be added to the message window.
|
||||
- set the "selected" attribute on the current view tab button.
|
||||
- add scrollDown() function, it's now used from addHistory and onresize.
|
||||
- put a <tbody> in the <table> before adding content. (bug 70335)
|
||||
- create <xul:tab>s instead of <xul:menubutton>s for the views.
|
||||
- add client.load() function to load js subscripts (won't work until bug 48974 is fixed.)
|
||||
- combined client, network, channel, and user.display() implementations into a single function.
|
||||
|
||||
munger.js:
|
||||
- rename third parameter to .munge() method.
|
||||
- break long words found inside text that matched other munger rules.
|
||||
|
||||
chatzilla.css:
|
||||
- remove unused ids and classes.
|
||||
- made the status data color darker. (bug 65634)
|
||||
|
||||
output-default.css:
|
||||
- removed unused classes.
|
||||
- added huge comment (read it.)
|
||||
- changed color scheme.
|
||||
|
||||
face-*.gif:
|
||||
- made the smiley faces smaller so they fit better with the small font.
|
||||
|
||||
#################################################################################
|
||||
# 10/23/00, ChatZilla 0.7, <rginda@netscape.com>
|
||||
|
||||
=================================================================================
|
||||
= Bugs fixed
|
||||
|
||||
The superbug for ChatZilla 0.7 is 57633, which fixes the following bugs:
|
||||
40636, 41343, 51352, 54145, 56708, 57104, and 57138
|
||||
|
||||
Link to superbug: http://bugzilla.mozilla.org/show_bug.cgi?id=57633
|
||||
List of bugs dependent on the superbug: http://bugzilla.mozilla.org/buglist.cgi?field0-0-0=dependson&type0-0-0=equals&value0-0-0=57633&cmdtype=doit
|
||||
|
||||
=================================================================================
|
||||
= Changes ...
|
||||
|
||||
= fixed 41343, tab complete still works after part.
|
||||
= fixed 56708, link to rheet.wav when someone says rheet.
|
||||
= fixed 40636, delete text when simleys are matched
|
||||
= fixed 57138, toolbars not collapsing correctly.
|
||||
= fixed 57104, link regex was kinda lame.
|
||||
= fixed 54145, link completion char should be a pref.
|
||||
= fixed 51352, chatzilla should remember your nick.
|
||||
= cleaned up strict mode warnings.
|
||||
= adjusted menu layout to make it easier to grok (i hope.)
|
||||
= added "save settings now" and "save settings on exit" menu items.
|
||||
= fixed invalid xul tags (<label/>) to avoid nasty warnings.
|
||||
= implemented save settings functions.
|
||||
= added prefs for default network, startup urls, nickname autocomplete suffix,
|
||||
= delete view after part, save settings on exit, stalk list, smiley text deletion.
|
||||
= removed pref fot startup network/channel (replaced by startup urls.)
|
||||
= added graphic for scc's ear emoticon (*
|
||||
= made ui state (toolbar, userlist, statusbar visiblity) persist.
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
|
||||
|
||||
ChatZilla: Did You Know?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
The basics...
|
||||
|
||||
+ The networks listed in the *client* view on startup are clickable links.
|
||||
Instead of typing /attach <network-name>, you can just click on one of the
|
||||
links.
|
||||
|
||||
+ The view tabs are color coded, green means that something has happened in that
|
||||
view since you last looked at it. Red means that someone has said something
|
||||
to you.
|
||||
|
||||
+ ChatZilla will automatically highlight phrases that contain your nickname.
|
||||
|
||||
+ You can add to the list of words that cause messages to be highlighted with
|
||||
the /stalk command. You can remove words from the list with the /unstalk
|
||||
command.
|
||||
|
||||
+ You can quickly switch to another view using the function keys. F1 will
|
||||
switch to the first view, F2 to the second, etc.
|
||||
|
||||
+ You can turn off the userlist, statusbar, and/or view tabs using the
|
||||
File->Options menu.
|
||||
|
||||
+ You can see a list of commands by typing /commands.
|
||||
|
||||
+ You can get help on any command by typing /help <command-name>.
|
||||
|
||||
+ You can delete any view with the /delete command. Once deleted, the text from
|
||||
that view will be lost. Deleteing a channel view is not the same as leaving
|
||||
the channel. You will still be a member of the channel if you only /delete it.
|
||||
It will reappear (without the previous contents) the next time activity occurs.
|
||||
|
||||
+ You can remove a channel or query view from the tab list without dropping its
|
||||
contents. The /hide command will remove the view's tab, but keep the contents.
|
||||
The next time something happens on that view, it will re-appear with the
|
||||
previous text still intact.
|
||||
|
||||
+ You can recover deleted or hidden views. To recover a deleted *client* view,
|
||||
use /client. To recover a network view use the /attach command, to recover
|
||||
channel view use /join, and to recover a query view use /query.
|
||||
|
||||
The cool commands...
|
||||
|
||||
+ /networks will display the list of networks as a list of clickable links.
|
||||
|
||||
+ /status will show your connection status. If you use /status from a channel,
|
||||
you'll get information about the network and server you are connected to,
|
||||
including connection duration, and last ping and lag (if available.) You will
|
||||
also get status on the channel you are viewing, including number of operators,
|
||||
number voiced, and topic.
|
||||
|
||||
Using /status from a network view will give you information on every channel
|
||||
you are connected to.
|
||||
|
||||
Using /status from the *client* view will give you information on every network
|
||||
you are connected to, as well as every channel on that network.
|
||||
|
||||
+ /disconnect can be used to disconnect from a network without quitting
|
||||
ChatZilla. This can be useful if you are attached to more than one network
|
||||
but want to leave only one of them.
|
||||
|
||||
The more advanced stuff...
|
||||
|
||||
+ The input area can be switched to multiline mode by pressing [CTRL]+[UP].
|
||||
Press [CTRL]+[ENTER] to sent the text to the server. In multiline mode,
|
||||
the text you type not scanned for commands, so stray / characters will not
|
||||
affect your post. To return to single line mode, press [CRTL]+[DOWN].
|
||||
|
||||
+ The place where messages appear can be styled to your own taste, if you
|
||||
know a little css <http://www.htmlhelp.org/reference/css/>. See the comment
|
||||
at the top of <http://lxr.mozilla.org/mozilla/source/extensions/irc/xul/skin/output-default.css>
|
||||
for details.
|
||||
|
||||
+ You can manually bookmark an irc channel by creating a new irc:// bookmark.
|
||||
From the "Manage bookmarks" window, create a new bookmark and enter
|
||||
"irc://moznet/chatzilla", to bookmark the #chatzilla channel, for example.
|
||||
You can also use a server name, as in "irc://irc.mcs.com/javascript".
|
||||
|
||||
+ irc:// urls work from normal web pages as well. You can link to your
|
||||
irc channel from you home page. See
|
||||
<http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt> for a description
|
||||
of irc:// urls.
|
||||
|
||||
+ Turning off File->Options->Enable Smileys actually turns off all of the text
|
||||
matching rules, including link detection, and bold/underline/italic. It will
|
||||
also disable the part of ChatZilla that makes it possible to break long words
|
||||
(ie, you'll end up with a horizontal scrollbar eventually.) This
|
||||
option was added back when a few bugs in the JavaScript engine caused the
|
||||
text matching rules to do Bad Things. You probably don't really want to turn
|
||||
this off.
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License
|
||||
# Version 1.1 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla IRC Extentions, including Basic Socket Library,
|
||||
# and JSIRC Library.
|
||||
#
|
||||
# The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
# Inc. Portions created by New Dimensions Consulting, Inc. Copyright (C) 1999
|
||||
# New Dimenstions Consulting, Inc. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Robert Ginda, rginda@ndcico.com, original author
|
||||
#
|
||||
# Large LED icons (green-*, red-*, yellow-*) and Marble background (xtal.jpg)
|
||||
# Copyright (C) 1996, 1997 Jim Evins.
|
||||
# http://www.clark.net/pub/evins/Icons/
|
||||
#
|
||||
# Other Icons came from "Anthony's WWW Images"
|
||||
# http://www.cit.gu.edu.au/images/Images.html
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXTRA_COMPONENTS = js/lib/chatzilla-service.js
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
Using ChatZilla
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Table Of Contents
|
||||
|
||||
Part 1: Introduction to ChatZilla.
|
||||
|
||||
1.1: Introduction
|
||||
1.1.1: What is IRC?
|
||||
1.1.2: What is ChatZilla?
|
||||
1.1.3: Where do I get more information on IRC?
|
||||
|
||||
1.2: The User Interface.
|
||||
1.2.1: Menu structure.
|
||||
1.2.2: User list.
|
||||
1.2.3: Output area.
|
||||
1.2.4: View tabs.
|
||||
1.2.5: Status bar.
|
||||
|
||||
1.3: Features of the input area.
|
||||
1.3.1: Responding to the last person who spoke to you.
|
||||
1.3.2: Autocompleting nicknames.
|
||||
1.3.3: Autocompleting commands.
|
||||
1.3.4: Multiline input.
|
||||
|
||||
Part 2: Navigating IRC with ChatZilla.
|
||||
|
||||
2.1: Connecting to an IRC network.
|
||||
2.1.1: Listing available networks.
|
||||
2.1.2: Attaching to a network.
|
||||
2.1.3: Canceling an attach that isn't going well.
|
||||
2.1.4: Connecting to a specific server.
|
||||
2.1.5: Disconnecting when you're finished.
|
||||
|
||||
2.2: Channels.
|
||||
2.2.1: Finding a channel.
|
||||
2.2.2: Joining.
|
||||
2.2.3: Modes, Topics, and Kicks.
|
||||
2.2.4: Parting.
|
||||
|
||||
2.3: Private messages.
|
||||
2.3.1: Receiving messages.
|
||||
2.3.2: Sending messages.
|
||||
2.3.3: Query windows.
|
||||
|
||||
Part 3: Scripting ChatZilla.
|
||||
|
||||
3.1: Scripting basics.
|
||||
3.1.1: The /eval command.
|
||||
3.1.2: Writing text to the output window.
|
||||
3.1.3: Writing DOM nodes to the output window.
|
||||
3.1.1: Exploring objects with dumpObjectTree();
|
||||
|
||||
3.2: More Scripting.
|
||||
3.2.1: External scripts.
|
||||
3.2.2: Hooking into IRC events.
|
||||
|
||||
Appendix A:
|
||||
A: Styling the output window.
|
||||
(copy of the comment in output-window.css)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
ChatZilla 0.8.1
|
||||
smarter [tab] code (tab on empty line responds to last /msg or yournick:)
|
||||
flubbed /msg detection.
|
||||
optional time stamps
|
||||
isnick irc:// urls
|
||||
|
||||
ChatZilla 0.9
|
||||
Lots of prefs work, including a pref panel (finally!)
|
||||
@@ -1,86 +0,0 @@
|
||||
THIS BRANCH IS DEAD, PLEASE STOP USING IT, HAVE A NICE DAY.
|
||||
|
||||
chatzilla.jar:
|
||||
content/chatzilla/contents.rdf (xul/content/contents.rdf)
|
||||
locale/en-US/chatzilla/contents.rdf (xul/locale/en-US/contents.rdf)
|
||||
skin/modern/chatzilla/contents.rdf (xul/skin/contents.rdf)
|
||||
content/chatzilla/lib/js/utils.js (js/lib/utils.js)
|
||||
content/chatzilla/lib/js/events.js (js/lib/events.js)
|
||||
content/chatzilla/lib/js/connection-xpcom.js (js/lib/connection-xpcom.js)
|
||||
content/chatzilla/lib/js/command-manager.js (js/lib/command-manager.js)
|
||||
content/chatzilla/lib/js/command-manager.js (js/lib/command-manager.js)
|
||||
content/chatzilla/lib/js/pref-manager.js (js/lib/pref-manager.js)
|
||||
content/chatzilla/lib/js/message-manager.js (js/lib/message-manager.js)
|
||||
content/chatzilla/lib/js/menu-manager.js (js/lib/menu-manager.js)
|
||||
content/chatzilla/lib/js/irc.js (js/lib/irc.js)
|
||||
content/chatzilla/lib/js/irc-debug.js (js/lib/irc-debug.js)
|
||||
content/chatzilla/lib/js/file-utils.js (js/lib/file-utils.js)
|
||||
content/chatzilla/lib/xul/munger.js (xul/lib/munger.js)
|
||||
content/chatzilla/chatzilla.xul (xul/content/chatzilla.xul)
|
||||
content/chatzilla/scripts.xul (xul/content/scripts.xul)
|
||||
content/chatzilla/menus.xul (xul/content/menus.xul)
|
||||
content/chatzilla/popups.xul (xul/content/popups.xul)
|
||||
content/chatzilla/output-window.html (xul/content/output-window.html)
|
||||
content/chatzilla/output-window.js (xul/content/output-window.js)
|
||||
content/chatzilla/commands.js (xul/content/commands.js)
|
||||
content/chatzilla/handlers.js (xul/content/handlers.js)
|
||||
content/chatzilla/prefs.js (xul/content/prefs.js)
|
||||
content/chatzilla/messages.js (xul/content/messages.js)
|
||||
content/chatzilla/menus.js (xul/content/menus.js)
|
||||
content/chatzilla/static.js (xul/content/static.js)
|
||||
content/chatzilla/rdf.js (xul/content/rdf.js)
|
||||
content/chatzilla/dynamic.css (xul/content/dynamic.css)
|
||||
content/chatzilla/output-base.css (xul/content/output-base.css)
|
||||
content/chatzilla/chatzillaOverlay.xul (xul/content/chatzillaOverlay.xul)
|
||||
content/chatzilla/chatzillaOverlay.js (xul/content/chatzillaOverlay.js)
|
||||
content/chatzilla/prefsOverlay.xul (xul/content/prefsOverlay.xul)
|
||||
content/chatzilla/prefpanel/pref-irc.xul (xul/content/prefpanel/pref-irc.xul)
|
||||
content/chatzilla/prefpanel/pref-irc.js (xul/content/prefpanel/pref-irc.js)
|
||||
content/chatzilla/prefpanel/appearance.js (xul/content/prefpanel/appearance.js)
|
||||
content/chatzilla/prefpanel/appearance.css (xul/content/prefpanel/appearance.css)
|
||||
content/chatzilla/prefpanel/appearance.xul (xul/content/prefpanel/appearance.xul)
|
||||
content/chatzilla/prefpanel/interface.js (xul/content/prefpanel/interface.js)
|
||||
content/chatzilla/prefpanel/interface.xul (xul/content/prefpanel/interface.xul)
|
||||
content/chatzilla/prefpanel/sound.js (xul/content/prefpanel/sound.js)
|
||||
content/chatzilla/prefpanel/sound.xul (xul/content/prefpanel/sound.xul)
|
||||
content/chatzilla/prefpanel/stalk.js (xul/content/prefpanel/stalk.js)
|
||||
content/chatzilla/prefpanel/stalk.xul (xul/content/prefpanel/stalk.xul)
|
||||
content/chatzilla/prefpanel/startup.js (xul/content/prefpanel/startup.js)
|
||||
content/chatzilla/prefpanel/startup.xul (xul/content/prefpanel/startup.xul)
|
||||
content/chatzilla/prefpanel/startup-newScript.js (xul/content/prefpanel/startup-newScript.js)
|
||||
content/chatzilla/prefpanel/startup-newScript.xul (xul/content/prefpanel/startup-newScript.xul)
|
||||
content/chatzilla/prefpanel/startup-newURL.js (xul/content/prefpanel/startup-newURL.js)
|
||||
content/chatzilla/prefpanel/startup-newURL.xul (xul/content/prefpanel/startup-newURL.xul)
|
||||
content/chatzilla/prefpanel/appearance-previewCSS.html (xul/content/prefpanel/appearance-previewCSS.html)
|
||||
content/chatzilla/prefpanel/appearance-previewCSS.js (xul/content/prefpanel/appearance-previewCSS.js)
|
||||
content/chatzilla/prefpanel/appearance-previewCSS.xul (xul/content/prefpanel/appearance-previewCSS.xul)
|
||||
content/chatzilla/prefpanel/tabs.xul (xul/content/prefpanel/tabs.xul)
|
||||
content/chatzilla/prefpanel/text.xul (xul/content/prefpanel/text.xul)
|
||||
skin/modern/chatzilla/chatzilla.css (xul/skin/chatzilla.css)
|
||||
skin/modern/chatzilla/chatzillaOverlay.css (xul/skin/chatzillaOverlay.css)
|
||||
skin/modern/chatzilla/output-default.css (xul/skin/output-default.css)
|
||||
skin/modern/chatzilla/output-light.css (xul/skin/output-light.css)
|
||||
skin/modern/chatzilla/output-dark.css (xul/skin/output-dark.css)
|
||||
skin/modern/chatzilla/images/face-ear.gif (xul/skin/images/face-ear.gif)
|
||||
skin/modern/chatzilla/images/face-frown.gif (xul/skin/images/face-frown.gif)
|
||||
skin/modern/chatzilla/images/face-tongue.gif (xul/skin/images/face-tongue.gif)
|
||||
skin/modern/chatzilla/images/face-angry.gif (xul/skin/images/face-angry.gif)
|
||||
skin/modern/chatzilla/images/face-screw.gif (xul/skin/images/face-screw.gif)
|
||||
skin/modern/chatzilla/images/face-wink.gif (xul/skin/images/face-wink.gif)
|
||||
skin/modern/chatzilla/images/face-cry.gif (xul/skin/images/face-cry.gif)
|
||||
skin/modern/chatzilla/images/face-smile.gif (xul/skin/images/face-smile.gif)
|
||||
skin/modern/chatzilla/images/face-dunno.gif (xul/skin/images/face-dunno.gif)
|
||||
skin/modern/chatzilla/images/face-surprise.gif (xul/skin/images/face-surprise.gif)
|
||||
skin/modern/chatzilla/images/is-op.gif (xul/skin/images/is-op.gif)
|
||||
skin/modern/chatzilla/images/isnt-op.gif (xul/skin/images/isnt-op.gif)
|
||||
skin/modern/chatzilla/images/is-voice.gif (xul/skin/images/is-voice.gif)
|
||||
skin/modern/chatzilla/images/isnt-voice.gif (xul/skin/images/isnt-voice.gif)
|
||||
skin/modern/chatzilla/images/taskbar-irc.gif (xul/skin/images/taskbar-irc.gif)
|
||||
skin/modern/chatzilla/images/chatzilla-16.gif (xul/skin/images/chatzilla-16.gif)
|
||||
skin/modern/chatzilla/images/multiline-expand.png (xul/skin/images/multiline-expand.png)
|
||||
skin/modern/chatzilla/images/multiline-contract.png (xul/skin/images/multiline-contract.png)
|
||||
skin/modern/chatzilla/images/input-send.png (xul/skin/images/input-send.png)
|
||||
locale/en-US/chatzilla/chatzillaOverlay.dtd (xul/locale/en-US/chatzillaOverlay.dtd)
|
||||
locale/en-US/chatzilla/chatzilla.dtd (xul/locale/en-US/chatzilla.dtd)
|
||||
locale/en-US/chatzilla/chatzilla.properties (xul/locale/en-US/chatzilla.properties)
|
||||
locale/en-US/chatzilla/pref-irc.dtd (xul/locale/en-US/pref-irc.dtd)
|
||||
@@ -1,363 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Seth Spitzer <sspitzer@netscape.com>
|
||||
* Robert Ginda <rginda@netscape.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains the following chatzilla related components:
|
||||
* 1. Command line handler service, for responding to the -chat command line
|
||||
* option. (CLineHandler)
|
||||
* 2. Content handler for responding to content of type x-application-irc
|
||||
* (IRCContentHandler)
|
||||
* 3. Protocol handler for supplying a channel to the browser when an irc://
|
||||
* link is clicked. (IRCProtocolHandler)
|
||||
* 4. A (nearly empty) imeplementation of nsIChannel for telling the browser
|
||||
* that irc:// links have the content type x-application-irc (BogusChannel)
|
||||
*/
|
||||
|
||||
/* components defined in this file */
|
||||
const CLINE_SERVICE_CONTRACTID =
|
||||
"@mozilla.org/commandlinehandler/general-startup;1?type=chat";
|
||||
const CLINE_SERVICE_CID =
|
||||
Components.ID("{38a95514-1dd2-11b2-97e7-9da958640f2c}");
|
||||
const IRCCNT_HANDLER_CONTRACTID =
|
||||
"@mozilla.org/uriloader/content-handler;1?type=x-application-irc";
|
||||
const IRCCNT_HANDLER_CID =
|
||||
Components.ID("{98919a14-1dd1-11b2-be1a-b84344307f0a}");
|
||||
const IRCPROT_HANDLER_CONTRACTID =
|
||||
"@mozilla.org/network/protocol;1?name=irc";
|
||||
const IRCPROT_HANDLER_CID =
|
||||
Components.ID("{f21c35f4-1dd1-11b2-a503-9bf8a539ea39}");
|
||||
|
||||
/* components used in this file */
|
||||
const MEDIATOR_CONTRACTID =
|
||||
"@mozilla.org/appshell/window-mediator;1";
|
||||
const STANDARDURL_CONTRACTID =
|
||||
"@mozilla.org/network/standard-url;1";
|
||||
const IOSERVICE_CONTRACTID =
|
||||
"@mozilla.org/network/io-service;1";
|
||||
const ASS_CONTRACTID =
|
||||
"@mozilla.org/appshell/appShellService;1";
|
||||
|
||||
/* interafces used in this file */
|
||||
const nsIWindowMediator = Components.interfaces.nsIWindowMediator;
|
||||
const nsICmdLineHandler = Components.interfaces.nsICmdLineHandler;
|
||||
const nsICategoryManager = Components.interfaces.nsICategoryManager;
|
||||
const nsIContentHandler = Components.interfaces.nsIContentHandler;
|
||||
const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler;
|
||||
const nsIURI = Components.interfaces.nsIURI;
|
||||
const nsIStandardURL = Components.interfaces.nsIStandardURL;
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
const nsIRequest = Components.interfaces.nsIRequest;
|
||||
const nsIIOService = Components.interfaces.nsIIOService;
|
||||
const nsIAppShellService = Components.interfaces.nsIAppShellService;
|
||||
const nsISupports = Components.interfaces.nsISupports;
|
||||
|
||||
/* Command Line handler service */
|
||||
function CLineService()
|
||||
{}
|
||||
|
||||
CLineService.prototype.commandLineArgument = "-chat";
|
||||
CLineService.prototype.prefNameForStartup = "general.startup.chat";
|
||||
CLineService.prototype.chromeUrlForTask = "chrome://chatzilla/content";
|
||||
CLineService.prototype.helpText = "Start with an IRC chat client";
|
||||
CLineService.prototype.handlesArgs = false;
|
||||
CLineService.prototype.defaultArgs = "";
|
||||
CLineService.prototype.openWindowWithArgs = false;
|
||||
|
||||
/* factory for command line handler service (CLineService) */
|
||||
var CLineFactory = new Object();
|
||||
|
||||
CLineFactory.createInstance =
|
||||
function (outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(nsICmdLineHandler) && !iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
return new CLineService();
|
||||
}
|
||||
|
||||
/* x-application-irc content handler */
|
||||
function IRCContentHandler ()
|
||||
{}
|
||||
|
||||
IRCContentHandler.prototype.QueryInterface =
|
||||
function (iid)
|
||||
{
|
||||
if (!iid.equals(nsIContentHandler))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
IRCContentHandler.prototype.handleContent =
|
||||
function (contentType, command, windowTarget, request)
|
||||
{
|
||||
var e;
|
||||
var channel = request.QueryInterface(nsIChannel);
|
||||
|
||||
var windowManager =
|
||||
Components.classes[MEDIATOR_CONTRACTID].getService(nsIWindowMediator);
|
||||
|
||||
var w = windowManager.getMostRecentWindow("irc:chatzilla");
|
||||
|
||||
if (w)
|
||||
{
|
||||
w.focus();
|
||||
w.gotoIRCURL(channel.URI.spec);
|
||||
}
|
||||
else
|
||||
{
|
||||
var ass =
|
||||
Components.classes[ASS_CONTRACTID].getService(nsIAppShellService);
|
||||
w = ass.hiddenDOMWindow;
|
||||
|
||||
var args = new Object ();
|
||||
args.url = channel.URI.spec;
|
||||
|
||||
w.openDialog("chrome://chatzilla/content/chatzilla.xul", "_blank",
|
||||
"chrome,menubar,toolbar,status,resizable,dialog=no",
|
||||
args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* content handler factory object (IRCContentHandler) */
|
||||
var IRCContentHandlerFactory = new Object();
|
||||
|
||||
IRCContentHandlerFactory.createInstance =
|
||||
function (outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(nsIContentHandler) && !iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
return new IRCContentHandler();
|
||||
}
|
||||
|
||||
/* irc protocol handler component */
|
||||
function IRCProtocolHandler()
|
||||
{
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.scheme = "irc";
|
||||
IRCProtocolHandler.prototype.defaultPort = 6667;
|
||||
IRCProtocolHandler.prototype.protocolFlags =
|
||||
nsIProtocolHandler.URI_NORELATIVE |
|
||||
nsIProtocolHandler.ALLOWS_PROXY;
|
||||
|
||||
IRCProtocolHandler.prototype.allowPort =
|
||||
function (port, scheme)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.newURI =
|
||||
function (spec, charset, baseURI)
|
||||
{
|
||||
var cls = Components.classes[STANDARDURL_CONTRACTID];
|
||||
var url = cls.createInstance(nsIStandardURL);
|
||||
url.init(nsIStandardURL.URLTYPE_STANDARD, 6667, spec, charset, baseURI);
|
||||
|
||||
return url.QueryInterface(nsIURI);
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.newChannel =
|
||||
function (URI)
|
||||
{
|
||||
ios = Components.classes[IOSERVICE_CONTRACTID].getService(nsIIOService);
|
||||
if (!ios.allowPort(URI.port, URI.scheme))
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
||||
return new BogusChannel (URI);
|
||||
}
|
||||
|
||||
/* protocol handler factory object (IRCProtocolHandler) */
|
||||
var IRCProtocolHandlerFactory = new Object();
|
||||
|
||||
IRCProtocolHandlerFactory.createInstance =
|
||||
function (outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(nsIProtocolHandler) && !iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
return new IRCProtocolHandler();
|
||||
}
|
||||
|
||||
/* bogus IRC channel used by the IRCProtocolHandler */
|
||||
function BogusChannel (URI)
|
||||
{
|
||||
this.URI = URI;
|
||||
this.originalURI = URI;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.QueryInterface =
|
||||
function (iid)
|
||||
{
|
||||
if (!iid.equals(nsIChannel) && !iid.equals(nsIRequest) &&
|
||||
!iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/* nsIChannel */
|
||||
BogusChannel.prototype.loadAttributes = null;
|
||||
BogusChannel.prototype.contentType = "x-application-irc";
|
||||
BogusChannel.prototype.contentLength = 0;
|
||||
BogusChannel.prototype.owner = null;
|
||||
BogusChannel.prototype.loadGroup = null;
|
||||
BogusChannel.prototype.notificationCallbacks = null;
|
||||
BogusChannel.prototype.securityInfo = null;
|
||||
|
||||
BogusChannel.prototype.open =
|
||||
BogusChannel.prototype.asyncOpen =
|
||||
function ()
|
||||
{
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.asyncOpen =
|
||||
function (observer, ctxt)
|
||||
{
|
||||
observer.onStartRequest (this, ctxt);
|
||||
}
|
||||
|
||||
BogusChannel.prototype.asyncRead =
|
||||
function (listener, ctxt)
|
||||
{
|
||||
return listener.onStartRequest (this, ctxt);
|
||||
}
|
||||
|
||||
/* nsIRequest */
|
||||
BogusChannel.prototype.isPending =
|
||||
function ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.status = Components.results.NS_OK;
|
||||
|
||||
BogusChannel.prototype.cancel =
|
||||
function (status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.suspend =
|
||||
BogusChannel.prototype.resume =
|
||||
function ()
|
||||
{
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
var ChatzillaModule = new Object();
|
||||
|
||||
ChatzillaModule.registerSelf =
|
||||
function (compMgr, fileSpec, location, type)
|
||||
{
|
||||
debug("*** Registering -chat handler.\n");
|
||||
|
||||
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
|
||||
|
||||
compMgr.registerFactoryLocation(CLINE_SERVICE_CID,
|
||||
"Chatzilla CommandLine Service",
|
||||
CLINE_SERVICE_CONTRACTID,
|
||||
fileSpec,
|
||||
location,
|
||||
type);
|
||||
|
||||
catman = Components.classes["@mozilla.org/categorymanager;1"]
|
||||
.getService(nsICategoryManager);
|
||||
catman.addCategoryEntry("command-line-argument-handlers",
|
||||
"chatzilla command line handler",
|
||||
CLINE_SERVICE_CONTRACTID, true, true);
|
||||
|
||||
debug("*** Registering x-application-irc handler.\n");
|
||||
compMgr.registerFactoryLocation(IRCCNT_HANDLER_CID,
|
||||
"IRC Content Handler",
|
||||
IRCCNT_HANDLER_CONTRACTID,
|
||||
fileSpec,
|
||||
location,
|
||||
type);
|
||||
|
||||
debug("*** Registering irc protocol handler.\n");
|
||||
compMgr.registerFactoryLocation(IRCPROT_HANDLER_CID,
|
||||
"IRC protocol handler",
|
||||
IRCPROT_HANDLER_CONTRACTID,
|
||||
fileSpec,
|
||||
location,
|
||||
type);
|
||||
|
||||
}
|
||||
|
||||
ChatzillaModule.unregisterSelf =
|
||||
function(compMgr, fileSpec, location)
|
||||
{
|
||||
|
||||
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
|
||||
|
||||
compMgr.unregisterFactoryLocation(CLINE_SERVICE_CID,
|
||||
fileSpec);
|
||||
catman = Components.classes["@mozilla.org/categorymanager;1"]
|
||||
.getService(nsICategoryManager);
|
||||
catman.deleteCategoryEntry("command-line-argument-handlers",
|
||||
CLINE_SERVICE_CONTRACTID, true);
|
||||
}
|
||||
|
||||
ChatzillaModule.getClassObject =
|
||||
function (compMgr, cid, iid)
|
||||
{
|
||||
if (cid.equals(CLINE_SERVICE_CID))
|
||||
return CLineFactory;
|
||||
|
||||
if (cid.equals(IRCCNT_HANDLER_CID))
|
||||
return IRCContentHandlerFactory;
|
||||
|
||||
if (cid.equals(IRCPROT_HANDLER_CID))
|
||||
return IRCProtocolHandlerFactory;
|
||||
|
||||
if (!iid.equals(Components.interfaces.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
}
|
||||
|
||||
ChatzillaModule.canUnload =
|
||||
function(compMgr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* entrypoint */
|
||||
function NSGetModule(compMgr, fileSpec)
|
||||
{
|
||||
return ChatzillaModule;
|
||||
}
|
||||
@@ -1,842 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*/
|
||||
|
||||
function getAccessKey (str)
|
||||
{
|
||||
var i = str.indexOf("&");
|
||||
if (i == -1)
|
||||
return "";
|
||||
return str[i + 1];
|
||||
}
|
||||
|
||||
function CommandRecord (name, func, usage, help, label, flags, keystr, tip,
|
||||
format)
|
||||
{
|
||||
this.name = name;
|
||||
this.func = func;
|
||||
this._usage = usage;
|
||||
this.scanUsage();
|
||||
this.help = help;
|
||||
this.label = label ? label : name;
|
||||
this.format = format;
|
||||
this.labelstr = label.replace ("&", "");
|
||||
this.tip = tip;
|
||||
this.flags = flags;
|
||||
this._enabled = true;
|
||||
this.keyNodes = new Array();
|
||||
this.keystr = keystr;
|
||||
this.uiElements = new Array();
|
||||
}
|
||||
|
||||
CommandRecord.prototype.__defineGetter__ ("enabled", cr_getenable);
|
||||
function cr_getenable ()
|
||||
{
|
||||
return this._enabled;
|
||||
}
|
||||
|
||||
CommandRecord.prototype.__defineSetter__ ("enabled", cr_setenable);
|
||||
function cr_setenable (state)
|
||||
{
|
||||
for (var i = 0; i < this.uiElements.length; ++i)
|
||||
{
|
||||
if (state)
|
||||
this.uiElements[i].removeAttribute ("disabled");
|
||||
else
|
||||
this.uiElements[i].setAttribute ("disabled", "true");
|
||||
}
|
||||
return (this._enabled = state);
|
||||
}
|
||||
|
||||
CommandRecord.prototype.__defineSetter__ ("usage", cr_setusage);
|
||||
function cr_setusage (usage)
|
||||
{
|
||||
this._usage = usage;
|
||||
this.scanUsage();
|
||||
}
|
||||
|
||||
CommandRecord.prototype.__defineGetter__ ("usage", cr_getusage);
|
||||
function cr_getusage()
|
||||
{
|
||||
return this._usage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Scans the argument spec, in the format "<a1> <a2> [<o1> <o2>]", into an
|
||||
* array of strings.
|
||||
*/
|
||||
CommandRecord.prototype.scanUsage =
|
||||
function cr_scanusage()
|
||||
{
|
||||
var spec = this._usage;
|
||||
var currentName = "";
|
||||
var inName = false;
|
||||
var len = spec.length;
|
||||
var capNext = false;
|
||||
|
||||
this._usage = spec;
|
||||
this.argNames = new Array();
|
||||
|
||||
for (var i = 0; i < len; ++i)
|
||||
{
|
||||
switch (spec[i])
|
||||
{
|
||||
case '[':
|
||||
this.argNames.push (":");
|
||||
break;
|
||||
|
||||
case '<':
|
||||
inName = true;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
capNext = true;
|
||||
break;
|
||||
|
||||
case '>':
|
||||
inName = false;
|
||||
this.argNames.push (currentName);
|
||||
currentName = "";
|
||||
capNext = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (inName)
|
||||
currentName += capNext ? spec[i].toUpperCase() : spec[i];
|
||||
capNext = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the command formatted for presentation as part of online
|
||||
* documentation.
|
||||
*/
|
||||
CommandRecord.prototype.getDocumentation =
|
||||
function cr_getdocs(flagFormatter)
|
||||
|
||||
{
|
||||
var str;
|
||||
str = getMsg(MSG_DOC_COMMANDLABEL,
|
||||
[this.label.replace("&", ""), this.name]) + "\n";
|
||||
str += getMsg(MSG_DOC_KEY, this.keystr ? this.keystr : MSG_VAL_NA) + "\n";
|
||||
str += getMsg(MSG_DOC_SYNTAX, [this.name, this.usage]) + "\n";
|
||||
str += MSG_DOC_NOTES + "\n";
|
||||
str += (flagFormatter ? flagFormatter(this.flags) : this.flags) + "\n\n";
|
||||
str += MSG_DOC_DESCRIPTION + "\n";
|
||||
str += wrapText(this.help, 75) + "\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
CommandRecord.prototype.argNames = new Array();
|
||||
|
||||
function CommandManager (defaultBundle)
|
||||
{
|
||||
this.commands = new Object();
|
||||
this.defaultBundle = defaultBundle;
|
||||
}
|
||||
|
||||
CommandManager.prototype.defaultFlags = 0;
|
||||
|
||||
CommandManager.prototype.defineCommands =
|
||||
function cmgr_defcmds (cmdary)
|
||||
{
|
||||
var len = cmdary.length;
|
||||
var commands = new Object();
|
||||
var bundle = "stringBundle" in cmdary ? cmdary.stringBundle : null;
|
||||
|
||||
for (var i = 0; i < len; ++i)
|
||||
{
|
||||
var name = cmdary[i][0];
|
||||
var func = cmdary[i][1];
|
||||
var flags = cmdary[i][2];
|
||||
var usage;
|
||||
if (3 in cmdary[i])
|
||||
usage = cmdary[i][3];
|
||||
|
||||
var command = this.defineCommand(name, func, flags, usage, bundle);
|
||||
commands[name] = command;
|
||||
|
||||
}
|
||||
|
||||
return commands;
|
||||
}
|
||||
|
||||
CommandManager.prototype.defineCommand =
|
||||
function cmdmgr_defcmd (name, func, flags, usage, bundle)
|
||||
{
|
||||
if (!bundle)
|
||||
bundle = this.defaultBundle;
|
||||
|
||||
var helpDefault;
|
||||
var labelDefault = name;
|
||||
var aliasFor;
|
||||
|
||||
if (typeof flags != "number")
|
||||
flags = this.defaultFlags;
|
||||
|
||||
if (flags & CMD_NO_HELP)
|
||||
helpDefault = MSG_NO_HELP;
|
||||
|
||||
if (typeof usage != "string")
|
||||
usage = getMsgFrom(bundle, "cmd." + name + ".params", null, "");
|
||||
|
||||
if (typeof func == "string")
|
||||
{
|
||||
var ary = func.match(/(\S+)/);
|
||||
if (ary)
|
||||
aliasFor = ary[1];
|
||||
else
|
||||
aliasFor = null;
|
||||
helpDefault = getMsg (MSG_DEFAULT_ALIAS_HELP, func);
|
||||
if (aliasFor)
|
||||
labelDefault = getMsgFrom (bundle, "cmd." + aliasFor + ".label",
|
||||
null, name);
|
||||
}
|
||||
|
||||
var label = getMsgFrom(bundle, "cmd." + name + ".label", null,
|
||||
labelDefault);
|
||||
var help = getMsgFrom(bundle, "cmd." + name + ".help", null,
|
||||
helpDefault);
|
||||
var keystr = getMsgFrom (bundle, "cmd." + name + ".key", null, "");
|
||||
var format = getMsgFrom (bundle, "cmd." + name + ".format", null, null);
|
||||
var tip = getMsgFrom (bundle, "cmd." + name + ".tip", null, "");
|
||||
var command = new CommandRecord (name, func, usage, help, label, flags,
|
||||
keystr, tip, format);
|
||||
this.addCommand(command);
|
||||
if (aliasFor)
|
||||
command.aliasFor = aliasFor;
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
CommandManager.prototype.installKeys =
|
||||
function cmgr_instkeys (document, commands)
|
||||
{
|
||||
var parentElem = document.getElementById("dynamic-keys");
|
||||
if (!parentElem)
|
||||
{
|
||||
parentElem = document.createElement("keyset");
|
||||
parentElem.setAttribute ("id", "dynamic-keys");
|
||||
document.firstChild.appendChild (parentElem);
|
||||
}
|
||||
|
||||
if (!commands)
|
||||
commands = this.commands;
|
||||
|
||||
for (var c in commands)
|
||||
this.installKey (parentElem, commands[c]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <key> node relative to a DOM node. Usually called once per command,
|
||||
* per document, so that accelerator keys work in all application windows.
|
||||
*
|
||||
* @param parentElem A reference to the DOM node which should contain the new
|
||||
* <key> node.
|
||||
* @param command reference to the CommandRecord to install.
|
||||
*/
|
||||
CommandManager.prototype.installKey =
|
||||
function cmgr_instkey (parentElem, command)
|
||||
{
|
||||
if (!command.keystr)
|
||||
return;
|
||||
|
||||
var ary = command.keystr.match (/(.*\s)?([\S]+)$/);
|
||||
if (!ASSERT(ary, "couldn't parse key string ``" + command.keystr +
|
||||
"'' for command ``" + command.name + "''"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var key = document.createElement ("key");
|
||||
key.setAttribute ("id", "key:" + command.name);
|
||||
key.setAttribute ("oncommand", "dispatch('" + command.name +
|
||||
"', {isInteractive: true});");
|
||||
key.setAttribute ("modifiers", ary[1]);
|
||||
if (ary[2].indexOf("VK_") == 0)
|
||||
key.setAttribute ("keycode", ary[2]);
|
||||
else
|
||||
key.setAttribute ("key", ary[2]);
|
||||
|
||||
parentElem.appendChild(key);
|
||||
command.keyNodes.push(key);
|
||||
}
|
||||
|
||||
CommandManager.prototype.uninstallKeys =
|
||||
function cmgr_uninstkeys (commands)
|
||||
{
|
||||
if (!commands)
|
||||
commands = this.commands;
|
||||
|
||||
for (var c in commands)
|
||||
this.uninstallKey (commands[c]);
|
||||
}
|
||||
|
||||
CommandManager.prototype.uninstallKey =
|
||||
function cmgr_uninstkey (command)
|
||||
{
|
||||
for (var i in command.keyNodes)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* document may no longer exist in a useful state. */
|
||||
command.keyNodes[i].parentNode.removeChild(command.keyNodes[i]);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("*** caught exception uninstalling key node: " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new command with the manager.
|
||||
*/
|
||||
CommandManager.prototype.addCommand =
|
||||
function cmgr_add (command)
|
||||
{
|
||||
this.commands[command.name] = command;
|
||||
}
|
||||
|
||||
CommandManager.prototype.removeCommands =
|
||||
function cmgr_removes (commands)
|
||||
{
|
||||
for (var c in commands)
|
||||
this.removeCommand(commands[c]);
|
||||
}
|
||||
|
||||
CommandManager.prototype.removeCommand =
|
||||
function cmgr_remove (command)
|
||||
{
|
||||
delete this.commands[command.name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a hook for a particular command name. |id| is a human readable
|
||||
* identifier for the hook, and can be used to unregister the hook. If you
|
||||
* re-use a hook id, the previous hook function will be replaced.
|
||||
* If |before| is |true|, the hook will be called *before* the command executes,
|
||||
* if |before| is |false|, or not specified, the hook will be called *after*
|
||||
* the command executes.
|
||||
*/
|
||||
CommandManager.prototype.addHook =
|
||||
function cmgr_hook (commandName, func, id, before)
|
||||
{
|
||||
if (!ASSERT(commandName in this.commands,
|
||||
"Unknown command '" + commandName + "'"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var command = this.commands[commandName];
|
||||
|
||||
if (before)
|
||||
{
|
||||
if (!("beforeHooks" in command))
|
||||
command.beforeHooks = new Object();
|
||||
command.beforeHooks[id] = func;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!("afterHooks" in command))
|
||||
command.afterHooks = new Object();
|
||||
command.afterHooks[id] = func;
|
||||
}
|
||||
}
|
||||
|
||||
CommandManager.prototype.addHooks =
|
||||
function cmgr_hooks (hooks, prefix)
|
||||
{
|
||||
if (!prefix)
|
||||
prefix = "";
|
||||
|
||||
for (var h in hooks)
|
||||
{
|
||||
this.addHook(h, hooks[h], prefix + ":" + h,
|
||||
("_before" in hooks[h]) ? hooks[h]._before : false);
|
||||
}
|
||||
}
|
||||
|
||||
CommandManager.prototype.removeHooks =
|
||||
function cmgr_remhooks (hooks, prefix)
|
||||
{
|
||||
if (!prefix)
|
||||
prefix = "";
|
||||
|
||||
for (var h in hooks)
|
||||
{
|
||||
this.removeHook(h, prefix + ":" + h,
|
||||
("before" in hooks[h]) ? hooks[h].before : false);
|
||||
}
|
||||
}
|
||||
|
||||
CommandManager.prototype.removeHook =
|
||||
function cmgr_unhook (commandName, id, before)
|
||||
{
|
||||
var command = this.commands[commandName];
|
||||
|
||||
if (before)
|
||||
delete command.beforeHooks[id];
|
||||
else
|
||||
delete command.afterHooks[id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all CommandRecords which start with the string
|
||||
* |partialName|, sorted by |label| property.
|
||||
*
|
||||
* @param partialName Prefix to search for.
|
||||
* @param flags logical ANDed with command flags.
|
||||
* @returns array Array of matching commands, sorted by |label| property.
|
||||
*/
|
||||
CommandManager.prototype.list =
|
||||
function cmgr_list (partialName, flags)
|
||||
{
|
||||
/* returns array of command objects which look like |partialName|, or
|
||||
* all commands if |partialName| is not specified */
|
||||
function compare (a, b)
|
||||
{
|
||||
a = a.labelstr.toLowerCase();
|
||||
b = b.labelstr.toLowerCase();
|
||||
|
||||
if (a == b)
|
||||
return 0;
|
||||
|
||||
if (a > b)
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
var ary = new Array();
|
||||
var commandNames = keys(this.commands);
|
||||
|
||||
/* a command named "eval" wouldn't show up in the result of keys() because
|
||||
* eval is not-enumerable, even if overwritten. */
|
||||
if ("eval" in this.commands && typeof this.commands.eval == "object")
|
||||
commandNames.push ("eval");
|
||||
|
||||
for (var i in commandNames)
|
||||
{
|
||||
var name = commandNames[i];
|
||||
if (!flags || (this.commands[name].flags & flags))
|
||||
{
|
||||
if (!partialName ||
|
||||
this.commands[name].name.indexOf(partialName) == 0)
|
||||
{
|
||||
if (partialName &&
|
||||
partialName.length == this.commands[name].name.length)
|
||||
{
|
||||
/* exact match */
|
||||
return [this.commands[name]];
|
||||
}
|
||||
else
|
||||
{
|
||||
ary.push (this.commands[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ary.sort(compare);
|
||||
return ary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a sorted array of the command names which start with the string
|
||||
* |partialName|.
|
||||
*
|
||||
* @param partialName Prefix to search for.
|
||||
* @param flags logical ANDed with command flags.
|
||||
* @returns array Sorted Array of matching command names.
|
||||
*/
|
||||
CommandManager.prototype.listNames =
|
||||
function cmgr_listnames (partialName, flags)
|
||||
{
|
||||
var cmds = this.list(partialName, flags);
|
||||
var cmdNames = new Array();
|
||||
|
||||
for (var c in cmds)
|
||||
cmdNames.push (cmds[c].name);
|
||||
|
||||
cmdNames.sort();
|
||||
return cmdNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Called to parse the arguments stored in |e.inputData|, as properties of |e|,
|
||||
* for the CommandRecord stored on |e.command|.
|
||||
*
|
||||
* @params e Event object to be processed.
|
||||
*/
|
||||
CommandManager.prototype.parseArguments =
|
||||
function cmgr_parseargs (e)
|
||||
{
|
||||
var rv = this.parseArgumentsRaw(e);
|
||||
//dd("parseArguments '" + e.command.usage + "' " +
|
||||
// (rv ? "passed" : "failed") + "\n" + dumpObjectTree(e));
|
||||
delete e.currentArgIndex;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Don't call parseArgumentsRaw directly, use parseArguments instead.
|
||||
*
|
||||
* Parses the arguments stored in the |inputData| property of the event object,
|
||||
* according to the format specified by the |command| property.
|
||||
*
|
||||
* On success this method returns true, and propery names corresponding to the
|
||||
* argument names used in the format spec will be created on the event object.
|
||||
* All optional parameters will be initialized to |null| if not already present
|
||||
* on the event.
|
||||
*
|
||||
* On failure this method returns false and a description of the problem
|
||||
* will be stored in the |parseError| property of the event.
|
||||
*
|
||||
* For example...
|
||||
* Given the argument spec "<int> <word> [ <word2> <word3> ]", and given the
|
||||
* input string "411 foo", stored as |e.command.usage| and |e.inputData|
|
||||
* respectively, this method would add the following propertys to the event
|
||||
* object...
|
||||
* -name---value--notes-
|
||||
* e.int 411 Parsed as an integer
|
||||
* e.word foo Parsed as a string
|
||||
* e.word2 null Optional parameters not specified will be set to null.
|
||||
* e.word3 null If word2 had been provided, word3 would be required too.
|
||||
*
|
||||
* Each parameter is parsed by calling the function with the same name, located
|
||||
* in this.argTypes. The first parameter is parsed by calling the function
|
||||
* this.argTypes["int"], for example. This function is expected to act on
|
||||
* e.unparsedData, taking it's chunk, and leaving the rest of the string.
|
||||
* The default parse functions are...
|
||||
* <word> parses contiguous non-space characters.
|
||||
* <int> parses as an int.
|
||||
* <rest> parses to the end of input data.
|
||||
* <state> parses yes, on, true, 1, 0, false, off, no as a boolean.
|
||||
* <toggle> parses like a <state>, except allows "toggle" as well.
|
||||
* <...> parses according to the parameter type before it, until the end
|
||||
* of the input data. Results are stored in an array named
|
||||
* paramnameList, where paramname is the name of the parameter
|
||||
* before <...>. The value of the parameter before this will be
|
||||
* paramnameList[0].
|
||||
*
|
||||
* If there is no parse function for an argument type, "word" will be used by
|
||||
* default. You can alias argument types with code like...
|
||||
* commandManager.argTypes["my-integer-name"] = commandManager.argTypes["int"];
|
||||
*/
|
||||
CommandManager.prototype.parseArgumentsRaw =
|
||||
function parse_parseargsraw (e)
|
||||
{
|
||||
var argc = e.command.argNames.length;
|
||||
|
||||
function initOptionals()
|
||||
{
|
||||
for (var i = 0; i < argc; ++i)
|
||||
{
|
||||
if (e.command.argNames[i] != ":" &&
|
||||
e.command.argNames[i] != "..." &&
|
||||
!(e.command.argNames[i] in e))
|
||||
{
|
||||
e[e.command.argNames[i]] = null;
|
||||
}
|
||||
|
||||
if (e.command.argNames[i] == "...")
|
||||
{
|
||||
var paramName = e.command.argNames[i - 1];
|
||||
if (paramName == ":")
|
||||
paramName = e.command.argNames[i - 2];
|
||||
var listName = paramName + "List";
|
||||
if (!(listName in e))
|
||||
e[listName] = [ e[paramName] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("inputData" in e && e.inputData)
|
||||
{
|
||||
/* if data has been provided, parse it */
|
||||
e.unparsedData = e.inputData;
|
||||
var parseResult;
|
||||
var currentArg;
|
||||
e.currentArgIndex = 0;
|
||||
|
||||
if (argc)
|
||||
{
|
||||
currentArg = e.command.argNames[e.currentArgIndex];
|
||||
|
||||
while (e.unparsedData)
|
||||
{
|
||||
if (currentArg != ":")
|
||||
{
|
||||
if (!this.parseArgument (e, currentArg))
|
||||
return false;
|
||||
}
|
||||
if (++e.currentArgIndex < argc)
|
||||
currentArg = e.command.argNames[e.currentArgIndex];
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (e.currentArgIndex < argc && currentArg != ":")
|
||||
{
|
||||
/* parse loop completed because it ran out of data. We haven't
|
||||
* parsed all of the declared arguments, and we're not stopped
|
||||
* at an optional marker, so we must be missing something
|
||||
* required... */
|
||||
e.parseError = getMsg(MSG_ERR_REQUIRED_PARAM,
|
||||
e.command.argNames[e.currentArgIndex]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.unparsedData)
|
||||
{
|
||||
/* parse loop completed with unparsed data, which means we've
|
||||
* successfully parsed all arguments declared. Whine about the
|
||||
* extra data... */
|
||||
display (getMsg(MSG_EXTRA_PARAMS, e.unparsedData), MT_WARN);
|
||||
}
|
||||
}
|
||||
|
||||
var rv = this.isCommandSatisfied(e);
|
||||
if (rv)
|
||||
initOptionals();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if |e| has the properties required to call the command
|
||||
* |command|.
|
||||
*
|
||||
* If |command| is not provided, |e.command| is used instead.
|
||||
*
|
||||
* @param e Event object to test against the command.
|
||||
* @param command Command to test.
|
||||
*/
|
||||
CommandManager.prototype.isCommandSatisfied =
|
||||
function cmgr_isok (e, command)
|
||||
{
|
||||
if (typeof command == "undefined")
|
||||
command = e.command;
|
||||
else if (typeof command == "string")
|
||||
command = this.commands[command];
|
||||
|
||||
if (!command.enabled)
|
||||
return false;
|
||||
|
||||
for (var i = 0; i < command.argNames.length; ++i)
|
||||
{
|
||||
if (command.argNames[i] == ":")
|
||||
return true;
|
||||
|
||||
if (!(command.argNames[i] in e))
|
||||
{
|
||||
e.parseError = getMsg(MSG_ERR_REQUIRED_PARAM, command.argNames[i]);
|
||||
//dd("command '" + command.name + "' unsatisfied: " + e.parseError);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//dd ("command '" + command.name + "' satisfied.");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
* See parseArguments above and the |argTypes| object below.
|
||||
*
|
||||
* Parses the next argument by calling an appropriate parser function, or the
|
||||
* generic "word" parser if none other is found.
|
||||
*
|
||||
* @param e event object.
|
||||
* @param name property name to use for the parse result.
|
||||
*/
|
||||
CommandManager.prototype.parseArgument =
|
||||
function cmgr_parsearg (e, name)
|
||||
{
|
||||
var parseResult;
|
||||
|
||||
if (name in this.argTypes)
|
||||
parseResult = this.argTypes[name](e, name, this);
|
||||
else
|
||||
parseResult = this.argTypes["word"](e, name, this);
|
||||
|
||||
if (!parseResult)
|
||||
e.parseError = getMsg(MSG_ERR_INVALID_PARAM,
|
||||
[name, e.unparsedData]);
|
||||
|
||||
return parseResult;
|
||||
}
|
||||
|
||||
CommandManager.prototype.argTypes = new Object();
|
||||
|
||||
/**
|
||||
* Convenience function used to map a list of new types to an existing parse
|
||||
* function.
|
||||
*/
|
||||
CommandManager.prototype.argTypes.__aliasTypes__ =
|
||||
function at_alias (list, type)
|
||||
{
|
||||
for (var i in list)
|
||||
{
|
||||
this[list[i]] = this[type];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Parses an integer, stores result in |e[name]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["int"] =
|
||||
function parse_int (e, name)
|
||||
{
|
||||
var ary = e.unparsedData.match (/(\d+)(?:\s+(.*))?$/);
|
||||
if (!ary)
|
||||
return false;
|
||||
e[name] = Number(ary[1]);
|
||||
e.unparsedData = (2 in ary) ? ary[2] : "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Parses a word, which is defined as a list of nonspace characters.
|
||||
*
|
||||
* Stores result in |e[name]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["word"] =
|
||||
function parse_word (e, name)
|
||||
{
|
||||
var ary = e.unparsedData.match (/(\S+)(?:\s+(.*))?$/);
|
||||
if (!ary)
|
||||
return false;
|
||||
e[name] = ary[1];
|
||||
e.unparsedData = (2 in ary) ? ary[2] : "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Parses a "state" which can be "true", "on", "yes", or 1 to indicate |true|,
|
||||
* or "false", "off", "no", or 0 to indicate |false|.
|
||||
*
|
||||
* Stores result in |e[name]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["state"] =
|
||||
function parse_state (e, name)
|
||||
{
|
||||
var ary =
|
||||
e.unparsedData.match (/(true|on|yes|1|false|off|no|0)(?:\s+(.*))?$/i);
|
||||
if (!ary)
|
||||
return false;
|
||||
if (ary[1].search(/true|on|yes|1/i) != -1)
|
||||
e[name] = true;
|
||||
else
|
||||
e[name] = false;
|
||||
e.unparsedData = (2 in ary) ? ary[2] : "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Parses a "toggle" which can be "true", "on", "yes", or 1 to indicate |true|,
|
||||
* or "false", "off", "no", or 0 to indicate |false|. In addition, the string
|
||||
* "toggle" is accepted, in which case |e[name]| will be the string "toggle".
|
||||
*
|
||||
* Stores result in |e[name]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["toggle"] =
|
||||
function parse_toggle (e, name)
|
||||
{
|
||||
var ary = e.unparsedData.match
|
||||
(/(toggle|true|on|yes|1|false|off|no|0)(?:\s+(.*))?$/i);
|
||||
|
||||
if (!ary)
|
||||
return false;
|
||||
if (ary[1].search(/toggle/i) != -1)
|
||||
e[name] = "toggle";
|
||||
else if (ary[1].search(/true|on|yes|1/i) != -1)
|
||||
e[name] = true;
|
||||
else
|
||||
e[name] = false;
|
||||
e.unparsedData = (2 in ary) ? ary[2] : "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Returns all unparsed data to the end of the line.
|
||||
*
|
||||
* Stores result in |e[name]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["rest"] =
|
||||
function parse_rest (e, name)
|
||||
{
|
||||
e[name] = e.unparsedData;
|
||||
e.unparsedData = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Parses the rest of the unparsed data the same way the previous argument was
|
||||
* parsed. Can't be used as the first parameter. if |name| is "..." then the
|
||||
* name of the previous argument, plus the suffix "List" will be used instead.
|
||||
*
|
||||
* Stores result in |e[name]| or |e[lastName + "List"]|.
|
||||
*/
|
||||
CommandManager.prototype.argTypes["..."] =
|
||||
function parse_repeat (e, name, cm)
|
||||
{
|
||||
ASSERT (e.currentArgIndex > 0, "<...> can't be the first argument.");
|
||||
|
||||
var lastArg = e.command.argNames[e.currentArgIndex - 1];
|
||||
if (lastArg == ":")
|
||||
lastArg = e.command.argNames[e.currentArgIndex - 2];
|
||||
|
||||
var listName = lastArg + "List";
|
||||
e[listName] = [ e[lastArg] ];
|
||||
|
||||
while (e.unparsedData)
|
||||
{
|
||||
if (!cm.parseArgument(e, lastArg))
|
||||
return false;
|
||||
e[listName].push(e[lastArg]);
|
||||
}
|
||||
|
||||
e[lastArg] = e[listName][0];
|
||||
return true;
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
* Patrick C. Beard <beard@netscape.com,
|
||||
*
|
||||
* wrapper for Rhino that uses Java networking.
|
||||
*
|
||||
*/
|
||||
|
||||
function CBSConnection ()
|
||||
{
|
||||
this._socket = null;
|
||||
}
|
||||
|
||||
CBSConnection.prototype.connect = function(host, port, bind, tcp_flag)
|
||||
{
|
||||
if (typeof tcp_flag == "undefined")
|
||||
tcp_flag = false;
|
||||
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.bind = bind;
|
||||
this.tcp_flag = tcp_flag;
|
||||
|
||||
this._socket = new java.net.Socket(host, port);
|
||||
this._inputStream = this._socket.getInputStream();
|
||||
this._outputStream = new java.io.PrintStream(this._socket.getOutputStream());
|
||||
|
||||
// create a 512 byte buffer for reading into.
|
||||
this._buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 512);
|
||||
dd("connected to " + host);
|
||||
|
||||
this.isConnected = true;
|
||||
|
||||
return this.isConnected;
|
||||
}
|
||||
|
||||
CBSConnection.prototype.disconnect = function()
|
||||
{
|
||||
if (this.isConnected) {
|
||||
this.isConnected = false;
|
||||
this._socket.close();
|
||||
delete this._socket;
|
||||
delete this._inputStream;
|
||||
delete this._outputStream;
|
||||
}
|
||||
}
|
||||
|
||||
CBSConnection.prototype.sendData = function(str)
|
||||
{
|
||||
// dd ("sendData: str=" + str);
|
||||
|
||||
if (!this.isConnected)
|
||||
throw "Not Connected.";
|
||||
|
||||
var rv = false;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
/* var s = new java.lang.String (str);
|
||||
b = s.getBytes();
|
||||
|
||||
this._outputStream.write(b, 0, b.length); */
|
||||
this._outputStream.print(str);
|
||||
rv = true;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("write caught exception " + ex + ".");
|
||||
|
||||
if (typeof ex != "undefined")
|
||||
{
|
||||
this.isConnected = false;
|
||||
throw (ex);
|
||||
}
|
||||
else
|
||||
rv = false;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
CBSConnection.prototype.readData = function(timeout)
|
||||
{
|
||||
if (!this.isConnected)
|
||||
throw "Not Connected.";
|
||||
|
||||
var rv;
|
||||
|
||||
// dd ("readData: timeout " + timeout);
|
||||
|
||||
try {
|
||||
this._socket.setSoTimeout(Number(timeout));
|
||||
var len = this._inputStream.read(this._buffer);
|
||||
// dd ("read done, len = " + len + ", buffer = " + this._buffer);
|
||||
|
||||
rv = String(new java.lang.String(this._buffer, 0, 0, len));
|
||||
} catch (ex) {
|
||||
// dd ("read caught exception " + ex + ".");
|
||||
|
||||
if ((typeof ex != "undefined") &&
|
||||
(!(ex instanceof java.io.InterruptedIOException)))
|
||||
{
|
||||
dd ("@@@ throwing " + ex);
|
||||
|
||||
this.isConnected = false;
|
||||
throw (ex);
|
||||
} else {
|
||||
// dd ("int");
|
||||
rv = "";
|
||||
}
|
||||
}
|
||||
|
||||
// dd ("readData: rv = '" + rv + "'");
|
||||
|
||||
return rv;
|
||||
}
|
||||
@@ -1,373 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
* Peter Van der Beken, peter.vanderbeken@pandora.be, necko-only version
|
||||
*
|
||||
* depends on utils.js, and XPCOM/XPConnect in the JS environment
|
||||
*
|
||||
*/
|
||||
|
||||
const NS_ERROR_MODULE_NETWORK = 2152398848;
|
||||
|
||||
const NS_ERROR_UNKNOWN_HOST = NS_ERROR_MODULE_NETWORK + 30;
|
||||
const NS_ERROR_CONNECTION_REFUSED = NS_ERROR_MODULE_NETWORK + 13;
|
||||
const NS_ERROR_NET_TIMEOUT = NS_ERROR_MODULE_NETWORK + 14;
|
||||
|
||||
const NS_NET_STATUS_RESOLVING_HOST = NS_ERROR_MODULE_NETWORK + 3;
|
||||
const NS_NET_STATUS_CONNECTED_TO = NS_ERROR_MODULE_NETWORK + 4;
|
||||
const NS_NET_STATUS_SENDING_TO = NS_ERROR_MODULE_NETWORK + 5;
|
||||
const NS_NET_STATUS_RECEIVING_FROM = NS_ERROR_MODULE_NETWORK + 6;
|
||||
const NS_NET_STATUS_CONNECTING_TO = NS_ERROR_MODULE_NETWORK + 7;
|
||||
|
||||
function toScriptableInputStream (i)
|
||||
{
|
||||
var si = Components.classes["@mozilla.org/scriptableinputstream;1"];
|
||||
|
||||
si = si.createInstance();
|
||||
si = si.QueryInterface(Components.interfaces.nsIScriptableInputStream);
|
||||
si.init(i);
|
||||
|
||||
return si;
|
||||
}
|
||||
|
||||
function CBSConnection ()
|
||||
{
|
||||
var sockServiceClass =
|
||||
Components.classesByID["{c07e81e0-ef12-11d2-92b6-00105a1b0d64}"];
|
||||
|
||||
if (!sockServiceClass)
|
||||
throw ("Couldn't get socket service class.");
|
||||
|
||||
var sockService = sockServiceClass.getService();
|
||||
if (!sockService)
|
||||
throw ("Couldn't get socket service.");
|
||||
|
||||
this._sockService = sockService.QueryInterface
|
||||
(Components.interfaces.nsISocketTransportService);
|
||||
|
||||
this.wrappedJSObject = this;
|
||||
|
||||
}
|
||||
|
||||
CBSConnection.prototype.connect =
|
||||
function bc_connect(host, port, bind, tcp_flag, observer)
|
||||
{
|
||||
if (typeof tcp_flag == "undefined")
|
||||
tcp_flag = false;
|
||||
|
||||
this.host = host.toLowerCase();
|
||||
this.port = port;
|
||||
this.bind = bind;
|
||||
this.tcp_flag = tcp_flag;
|
||||
|
||||
// Lets get a transportInfo for this
|
||||
var cls =
|
||||
Components.classes["@mozilla.org/network/protocol-proxy-service;1"];
|
||||
var pps = cls.getService(Components.interfaces.nsIProtocolProxyService);
|
||||
|
||||
if (!pps)
|
||||
throw ("Couldn't get protocol proxy service");
|
||||
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
var spec = "irc://" + host + ':' + port;
|
||||
var uri = ios.newURI(spec,null,null);
|
||||
var info = pps.examineForProxy(uri);
|
||||
|
||||
if (jsenv.HAS_STREAM_PROVIDER)
|
||||
{
|
||||
this._transport = this._sockService.createTransport (host, port, info,
|
||||
0, 0);
|
||||
if (!this._transport)
|
||||
throw ("Error creating transport.");
|
||||
|
||||
if (jsenv.HAS_NSPR_EVENTQ)
|
||||
{ /* we've got an event queue, so start up an async write */
|
||||
this._streamProvider = new StreamProvider (observer);
|
||||
this._write_req =
|
||||
this._transport.asyncWrite (this._streamProvider, this,
|
||||
0, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no nspr event queues in this environment, we can't use async
|
||||
* calls, so set up the streams. */
|
||||
this._outputStream = this._transport.openOutputStream(0, -1, 0);
|
||||
if (!this._outputStream)
|
||||
throw "Error getting output stream.";
|
||||
this._inputStream =
|
||||
toScriptableInputStream(this._transport.openInputStream(0,
|
||||
-1, 0));
|
||||
if (!this._inputStream)
|
||||
throw "Error getting input stream.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* use new necko interfaces */
|
||||
this._transport = this._sockService.createTransport(null, 0, host, port,
|
||||
info);
|
||||
if (!this._transport)
|
||||
throw ("Error creating transport.");
|
||||
|
||||
/* if we don't have an event queue, then all i/o must be blocking */
|
||||
var openFlags;
|
||||
if (jsenv.HAS_NSPR_EVENTQ)
|
||||
openFlags = 0;
|
||||
else
|
||||
openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING;
|
||||
|
||||
/* no limit on the output stream buffer */
|
||||
this._outputStream =
|
||||
this._transport.openOutputStream(openFlags, 4096, -1);
|
||||
if (!this._outputStream)
|
||||
throw "Error getting output stream.";
|
||||
this._inputStream = this._transport.openInputStream(openFlags, 0, 0);
|
||||
if (!this._inputStream)
|
||||
throw "Error getting input stream.";
|
||||
}
|
||||
|
||||
this.connectDate = new Date();
|
||||
this.isConnected = true;
|
||||
|
||||
return this.isConnected;
|
||||
|
||||
}
|
||||
|
||||
CBSConnection.prototype.disconnect =
|
||||
function bc_disconnect()
|
||||
{
|
||||
if ("_inputStream" in this && this._inputStream)
|
||||
this._inputStream.close();
|
||||
if ("_outputStream" in this && this._outputStream)
|
||||
this._outputStream.close();
|
||||
this.isConnected = false;
|
||||
/*
|
||||
this._streamProvider.close();
|
||||
if (this._streamProvider.isBlocked)
|
||||
this._write_req.resume();
|
||||
*/
|
||||
}
|
||||
|
||||
CBSConnection.prototype.sendData =
|
||||
function bc_senddata(str)
|
||||
{
|
||||
if (!this.isConnected)
|
||||
throw "Not Connected.";
|
||||
|
||||
if (jsenv.HAS_NSPR_EVENTQ && jsenv.HAS_STREAM_PROVIDER)
|
||||
this.asyncWrite (str);
|
||||
else
|
||||
this.sendDataNow (str);
|
||||
}
|
||||
|
||||
CBSConnection.prototype.readData =
|
||||
function bc_readdata(timeout, count)
|
||||
{
|
||||
if (!this.isConnected)
|
||||
throw "Not Connected.";
|
||||
|
||||
var rv;
|
||||
|
||||
try
|
||||
{
|
||||
rv = this._scriptableInputStream.read (count);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("*** Caught " + ex + " while reading.");
|
||||
this.disconnect();
|
||||
throw (ex);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
CBSConnection.prototype.startAsyncRead =
|
||||
function bc_saread (observer)
|
||||
{
|
||||
if (jsenv.HAS_STREAM_PROVIDER)
|
||||
{
|
||||
this._transport.asyncRead (new StreamListener (observer),
|
||||
this, 0, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
var cls = Components.classes["@mozilla.org/network/input-stream-pump;1"];
|
||||
var pump = cls.createInstance(Components.interfaces.nsIInputStreamPump);
|
||||
pump.init(this._inputStream, -1, -1, 0, 0, false);
|
||||
pump.asyncRead(new StreamListener(observer), this);
|
||||
}
|
||||
}
|
||||
|
||||
CBSConnection.prototype.asyncWrite =
|
||||
function bc_awrite (str)
|
||||
{
|
||||
this._streamProvider.pendingData += str;
|
||||
if (this._streamProvider.isBlocked)
|
||||
{
|
||||
this._write_req.resume();
|
||||
this._streamProvider.isBlocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
CBSConnection.prototype.hasPendingWrite =
|
||||
function bc_haspwrite ()
|
||||
{
|
||||
if (jsenv.HAS_STREAM_PROVIDER)
|
||||
return (this._streamProvider.pendingData != "");
|
||||
else
|
||||
return false; /* data already pushed to necko */
|
||||
}
|
||||
|
||||
CBSConnection.prototype.sendDataNow =
|
||||
function bc_senddatanow(str)
|
||||
{
|
||||
var rv = false;
|
||||
|
||||
try
|
||||
{
|
||||
this._outputStream.write(str, str.length);
|
||||
rv = true;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("*** Caught " + ex + " while sending.");
|
||||
this.disconnect();
|
||||
throw (ex);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
function _notimpl ()
|
||||
{
|
||||
throw "Not Implemented.";
|
||||
}
|
||||
|
||||
if (!jsenv.HAS_NSPR_EVENTQ)
|
||||
{
|
||||
CBSConnection.prototype.startAsyncRead = _notimpl;
|
||||
CBSConnection.prototype.asyncWrite = _notimpl;
|
||||
}
|
||||
else if (jsenv.HAS_STREAM_PROVIDER)
|
||||
{
|
||||
CBSConnection.prototype.sendDataNow = _notimpl;
|
||||
}
|
||||
else
|
||||
{
|
||||
CBSConnection.prototype.asyncWrite = _notimpl;
|
||||
}
|
||||
|
||||
delete _notimpl;
|
||||
|
||||
function StreamProvider(observer)
|
||||
{
|
||||
this._observer = observer;
|
||||
}
|
||||
|
||||
StreamProvider.prototype.pendingData = "";
|
||||
StreamProvider.prototype.isBlocked = true;
|
||||
|
||||
StreamProvider.prototype.close =
|
||||
function sp_close ()
|
||||
{
|
||||
this.isClosed = true;
|
||||
}
|
||||
|
||||
StreamProvider.prototype.onDataWritable =
|
||||
function sp_datawrite (request, ctxt, ostream, offset, count)
|
||||
{
|
||||
//dd ("StreamProvider.prototype.onDataWritable");
|
||||
|
||||
if ("isClosed" in this && this.isClosed)
|
||||
throw Components.results.NS_BASE_STREAM_CLOSED;
|
||||
|
||||
if (!this.pendingData)
|
||||
{
|
||||
this.isBlocked = true;
|
||||
|
||||
/* this is here to support pre-XPCDOM builds (0.9.0 era), which
|
||||
* don't have this result code mapped. */
|
||||
if (!Components.results.NS_BASE_STREAM_WOULD_BLOCK)
|
||||
throw 2152136711;
|
||||
|
||||
throw Components.results.NS_BASE_STREAM_WOULD_BLOCK;
|
||||
}
|
||||
|
||||
var len = ostream.write (this.pendingData, this.pendingData.length);
|
||||
this.pendingData = this.pendingData.substr (len);
|
||||
}
|
||||
|
||||
StreamProvider.prototype.onStartRequest =
|
||||
function sp_startreq (request, ctxt)
|
||||
{
|
||||
//dd ("StreamProvider::onStartRequest: " + request + ", " + ctxt);
|
||||
}
|
||||
|
||||
|
||||
StreamProvider.prototype.onStopRequest =
|
||||
function sp_stopreq (request, ctxt, status)
|
||||
{
|
||||
//dd ("StreamProvider::onStopRequest: " + request + ", " + ctxt + ", " +
|
||||
// status);
|
||||
if (this._observer)
|
||||
this._observer.onStreamClose(status);
|
||||
}
|
||||
|
||||
function StreamListener(observer)
|
||||
{
|
||||
this._observer = observer;
|
||||
}
|
||||
|
||||
StreamListener.prototype.onStartRequest =
|
||||
function sl_startreq (request, ctxt)
|
||||
{
|
||||
//dd ("StreamListener::onStartRequest: " + request + ", " + ctxt);
|
||||
}
|
||||
|
||||
StreamListener.prototype.onStopRequest =
|
||||
function sl_stopreq (request, ctxt, status)
|
||||
{
|
||||
//dd ("StreamListener::onStopRequest: " + request + ", " + ctxt + ", " +
|
||||
//status);
|
||||
if (this._observer)
|
||||
this._observer.onStreamClose(status);
|
||||
}
|
||||
|
||||
StreamListener.prototype.onDataAvailable =
|
||||
function sl_dataavail (request, ctxt, inStr, sourceOffset, count)
|
||||
{
|
||||
ctxt = ctxt.wrappedJSObject;
|
||||
if (!ctxt)
|
||||
{
|
||||
dd ("*** Can't get wrappedJSObject from ctxt in " +
|
||||
"StreamListener.onDataAvailable ***");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!("_scriptableInputStream" in ctxt))
|
||||
ctxt._scriptableInputStream = toScriptableInputStream (inStr);
|
||||
|
||||
if (this._observer)
|
||||
this._observer.onStreamDataAvailable(request, inStr, sourceOffset,
|
||||
count);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
**HERE
|
||||
*
|
||||
* The contents of this file are Copyright 1999 Robert G. Ginda,
|
||||
* rginda@ndcico.com. This program may be freely copied and modified for
|
||||
* non-commercial use, provided everything between HERE and THERE appears
|
||||
* in the copy.
|
||||
* If you have questions, comments or suggestions direct them to
|
||||
* rginda@ndcico.com.
|
||||
*
|
||||
**THERE
|
||||
*
|
||||
* depends on utils.js, and the connection-*.js implementations.
|
||||
*
|
||||
* loads an appropriate connection implementation, or dies trying.
|
||||
*
|
||||
*/
|
||||
|
||||
function connection_init(libPath)
|
||||
{
|
||||
|
||||
if (jsenv.HAS_XPCOM)
|
||||
load (libPath + "connection-xpcom.js");
|
||||
else if (jsenv.HAS_RHINO)
|
||||
load (libPath + "connection-rhino.js");
|
||||
else
|
||||
{
|
||||
dd ("No connection object for this platform.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* JavaScript utility functions.
|
||||
*
|
||||
* 1999-08-15 rginda@ndcico.com v1.0
|
||||
*/
|
||||
|
||||
function CDCCChat (ep, host, port)
|
||||
{
|
||||
|
||||
this.READ_TIMEOUT = 50;
|
||||
|
||||
this.eventPump = ep;
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.connection = new CBSConnection();
|
||||
|
||||
this.savedLine = "";
|
||||
|
||||
}
|
||||
|
||||
CDCCChat.prototype.connect =
|
||||
function dchat_connect (host, port)
|
||||
{
|
||||
|
||||
if (typeof host != "undefined") this.host = host;
|
||||
if (typeof port != "undefined") this.port = port;
|
||||
|
||||
if (!this.connection.connect (this.host, this.port, (void 0), true))
|
||||
return false;
|
||||
|
||||
this.eventPump.addEvent (new CEvent ("dcc-chat", "poll", this, "onPoll"));
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CDCCChat.prototype.onPoll =
|
||||
function dchat_poll (e)
|
||||
{
|
||||
var line = "";
|
||||
|
||||
try
|
||||
{
|
||||
line = this.connection.readData (this.READ_TIMEOUT);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
if (typeof (ex) != "undefined")
|
||||
{
|
||||
this.connection.disconnect();
|
||||
var e = new CEvent ("dcc-chat", "close", this, "onClose");
|
||||
e.reason = "read-error";
|
||||
e.exception = ex;
|
||||
this.eventPump.addEvent (e);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
line = "";
|
||||
}
|
||||
|
||||
this.eventPump.addEvent (new CEvent ("dcc-chat", "poll", this, "onPoll"));
|
||||
|
||||
if (line == "")
|
||||
return false;
|
||||
|
||||
var incomplete = (line[line.length] != '\n');
|
||||
var lines = line.split("\n");
|
||||
|
||||
if (this.savedLine)
|
||||
{
|
||||
lines[0] = this.savedLine + lines[0];
|
||||
this.savedLine = "";
|
||||
}
|
||||
|
||||
if (incomplete)
|
||||
this.savedLine = lines.pop();
|
||||
|
||||
for (i in lines)
|
||||
{
|
||||
var ev = new CEvent("dcc-chat", "rawdata", this, "onRawData");
|
||||
ev.data = lines[i];
|
||||
ev.replyTo = this;
|
||||
this.eventPump.addEvent (ev);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CDCCChat.prototype.say =
|
||||
function dchat_say (msg)
|
||||
{
|
||||
|
||||
this.connection.sendData (msg + "\n");
|
||||
|
||||
}
|
||||
@@ -1,262 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* depends on utils.js
|
||||
*
|
||||
* Event and EventPump classes. The EventPump maintains a queue of event
|
||||
* objects. To inject an event into this queue, use |EventPump.addEvent|.
|
||||
* |EventQueue.routeEvents| steps at most |EventPump.eventsPerStep|
|
||||
* events, and then returns control.
|
||||
*
|
||||
* 1999-08-15 rginda@ndcico.com v1.0
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* event class
|
||||
*/
|
||||
|
||||
function CEvent (set, type, destObject, destMethod)
|
||||
{
|
||||
|
||||
this.set = set;
|
||||
this.type = type;
|
||||
this.destObject = destObject;
|
||||
this.destMethod = destMethod;
|
||||
this.hooks = new Array();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* event pump
|
||||
*/
|
||||
function CEventPump (eventsPerStep)
|
||||
{
|
||||
|
||||
/* event routing stops after this many levels, safety valve */
|
||||
this.MAX_EVENT_DEPTH = 50;
|
||||
this.eventsPerStep = eventsPerStep;
|
||||
this.queue = new Array();
|
||||
this.hooks = new Array();
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.onHook =
|
||||
function ep_hook(e, hooks)
|
||||
{
|
||||
var h;
|
||||
|
||||
if (typeof hooks == "undefined")
|
||||
hooks = this.hooks;
|
||||
|
||||
hook_loop:
|
||||
for (h = hooks.length - 1; h >= 0; h--)
|
||||
{
|
||||
if (!hooks[h].enabled ||
|
||||
!matchObject (e, hooks[h].pattern, hooks[h].neg))
|
||||
continue hook_loop;
|
||||
|
||||
e.hooks.push (hooks[h]);
|
||||
var rv = hooks[h].f(e);
|
||||
if ((typeof rv == "boolean") &&
|
||||
(rv == false))
|
||||
{
|
||||
dd ("hook #" + h + " '" +
|
||||
((typeof hooks[h].name != "undefined") ? hooks[h].name :
|
||||
"") + "' stopped hook processing.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CEventPump.prototype.addHook =
|
||||
function ep_addhook(pattern, f, name, neg, enabled, hooks)
|
||||
{
|
||||
if (typeof hooks == "undefined")
|
||||
hooks = this.hooks;
|
||||
|
||||
if (typeof f != "function")
|
||||
return false;
|
||||
|
||||
if (typeof enabled == "undefined")
|
||||
enabled = true;
|
||||
else
|
||||
enabled = Boolean(enabled);
|
||||
|
||||
neg = Boolean(neg);
|
||||
|
||||
var hook = {
|
||||
pattern: pattern,
|
||||
f: f,
|
||||
name: name,
|
||||
neg: neg,
|
||||
enabled: enabled
|
||||
};
|
||||
|
||||
hooks.push(hook);
|
||||
|
||||
return hook;
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.getHook =
|
||||
function ep_gethook(name, hooks)
|
||||
{
|
||||
if (typeof hooks == "undefined")
|
||||
hooks = this.hooks;
|
||||
|
||||
for (var h in hooks)
|
||||
if (hooks[h].name.toLowerCase() == name.toLowerCase())
|
||||
return hooks[h];
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.removeHookByName =
|
||||
function ep_remhookname(name, hooks)
|
||||
{
|
||||
if (typeof hooks == "undefined")
|
||||
hooks = this.hooks;
|
||||
|
||||
for (var h in hooks)
|
||||
if (hooks[h].name.toLowerCase() == name.toLowerCase())
|
||||
{
|
||||
arrayRemoveAt (hooks, h);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.removeHookByIndex =
|
||||
function ep_remhooki(idx, hooks)
|
||||
{
|
||||
if (typeof hooks == "undefined")
|
||||
hooks = this.hooks;
|
||||
|
||||
return arrayRemoveAt (hooks, idx);
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.addEvent =
|
||||
function ep_addevent (e)
|
||||
{
|
||||
|
||||
e.queuedAt = new Date();
|
||||
arrayInsertAt(this.queue, 0, e);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.routeEvent =
|
||||
function ep_routeevent (e)
|
||||
{
|
||||
var count = 0;
|
||||
|
||||
this.currentEvent = e;
|
||||
|
||||
e.level = 0;
|
||||
while (e.destObject)
|
||||
{
|
||||
e.level++;
|
||||
this.onHook (e);
|
||||
var destObject = e.destObject;
|
||||
e.destObject = (void 0);
|
||||
|
||||
switch (typeof destObject[e.destMethod])
|
||||
{
|
||||
case "function":
|
||||
if (1)
|
||||
try
|
||||
{
|
||||
destObject[e.destMethod] (e);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
if (typeof ex == "string")
|
||||
{
|
||||
dd ("Error routing event " + e.set + "." +
|
||||
e.type + ": " + ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("Error routing event " + e.set + "." +
|
||||
e.type + ": " + dumpObjectTree(ex) +
|
||||
" in " + e.destMethod + "\n" + ex);
|
||||
if ("stack" in ex)
|
||||
dd(ex.stack);
|
||||
}
|
||||
}
|
||||
else
|
||||
destObject[e.destMethod] (e);
|
||||
|
||||
if (count++ > this.MAX_EVENT_DEPTH)
|
||||
throw "Too many events in chain";
|
||||
break;
|
||||
|
||||
case "undefined":
|
||||
//dd ("** " + e.destMethod + " does not exist.");
|
||||
break;
|
||||
|
||||
default:
|
||||
dd ("** " + e.destMethod + " is not a function.");
|
||||
}
|
||||
|
||||
if ((e.type != "event-end") && (!e.destObject))
|
||||
{
|
||||
e.lastSet = e.set;
|
||||
e.set = "eventpump";
|
||||
e.lastType = e.type;
|
||||
e.type = "event-end";
|
||||
e.destMethod = "onEventEnd";
|
||||
e.destObject = this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
delete this.currentEvent;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CEventPump.prototype.stepEvents =
|
||||
function ep_stepevents()
|
||||
{
|
||||
var i = 0;
|
||||
|
||||
while (i < this.eventsPerStep)
|
||||
{
|
||||
var e = this.queue.pop();
|
||||
if (!e || e.type == "yield")
|
||||
break;
|
||||
this.routeEvent (e);
|
||||
i++;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -1,356 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The JavaScript Debugger
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
/* notice that these valuse are octal. */
|
||||
const PERM_IRWXU = 00700; /* read, write, execute/search by owner */
|
||||
const PERM_IRUSR = 00400; /* read permission, owner */
|
||||
const PERM_IWUSR = 00200; /* write permission, owner */
|
||||
const PERM_IXUSR = 00100; /* execute/search permission, owner */
|
||||
const PERM_IRWXG = 00070; /* read, write, execute/search by group */
|
||||
const PERM_IRGRP = 00040; /* read permission, group */
|
||||
const PERM_IWGRP = 00020; /* write permission, group */
|
||||
const PERM_IXGRP = 00010; /* execute/search permission, group */
|
||||
const PERM_IRWXO = 00007; /* read, write, execute/search by others */
|
||||
const PERM_IROTH = 00004; /* read permission, others */
|
||||
const PERM_IWOTH = 00002; /* write permission, others */
|
||||
const PERM_IXOTH = 00001; /* execute/search permission, others */
|
||||
|
||||
const MODE_RDONLY = 0x01;
|
||||
const MODE_WRONLY = 0x02;
|
||||
const MODE_RDWR = 0x04;
|
||||
const MODE_CREATE = 0x08;
|
||||
const MODE_APPEND = 0x10;
|
||||
const MODE_TRUNCATE = 0x20;
|
||||
const MODE_SYNC = 0x40;
|
||||
const MODE_EXCL = 0x80;
|
||||
|
||||
const PICK_OK = Components.interfaces.nsIFilePicker.returnOK;
|
||||
const PICK_CANCEL = Components.interfaces.nsIFilePicker.returnCancel;
|
||||
const PICK_REPLACE = Components.interfaces.nsIFilePicker.returnReplace;
|
||||
|
||||
const FILTER_ALL = Components.interfaces.nsIFilePicker.filterAll;
|
||||
const FILTER_HTML = Components.interfaces.nsIFilePicker.filterHTML;
|
||||
const FILTER_TEXT = Components.interfaces.nsIFilePicker.filterText;
|
||||
const FILTER_IMAGES = Components.interfaces.nsIFilePicker.filterImages;
|
||||
const FILTER_XML = Components.interfaces.nsIFilePicker.filterXML;
|
||||
const FILTER_XUL = Components.interfaces.nsIFilePicker.filterXUL;
|
||||
|
||||
const FTYPE_DIR = Components.interfaces.nsIFile.DIRECTORY_TYPE;
|
||||
const FTYPE_FILE = Components.interfaces.nsIFile.NORMAL_FILE_TYPE;
|
||||
|
||||
// evald f = fopen("/home/rginda/foo.txt", MODE_WRONLY | MODE_CREATE)
|
||||
// evald f = fopen("/home/rginda/vnk.txt", MODE_RDONLY)
|
||||
|
||||
var futils = new Object();
|
||||
|
||||
futils.umask = PERM_IWOTH | PERM_IWGRP;
|
||||
futils.MSG_SAVE_AS = "Save As";
|
||||
futils.MSG_OPEN = "Open";
|
||||
|
||||
futils.getPicker =
|
||||
function futils_nosepicker(initialPath, typeList, attribs)
|
||||
{
|
||||
const classes = Components.classes;
|
||||
const interfaces = Components.interfaces;
|
||||
|
||||
const PICKER_CTRID = "@mozilla.org/filepicker;1";
|
||||
const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
|
||||
|
||||
const nsIFilePicker = interfaces.nsIFilePicker;
|
||||
const nsILocalFile = interfaces.nsILocalFile;
|
||||
|
||||
var picker = classes[PICKER_CTRID].createInstance(nsIFilePicker);
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var a in attribs)
|
||||
picker[a] = attribs[a];
|
||||
}
|
||||
else
|
||||
throw "bad type for param |attribs|";
|
||||
|
||||
if (initialPath)
|
||||
{
|
||||
var localFile;
|
||||
|
||||
if (typeof initialPath == "string")
|
||||
{
|
||||
localFile =
|
||||
classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
|
||||
localFile.initWithPath(initialPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(initialPath instanceof nsILocalFile))
|
||||
throw "bad type for argument |initialPath|";
|
||||
|
||||
localFile = initialPath;
|
||||
}
|
||||
|
||||
picker.displayDirectory = localFile
|
||||
}
|
||||
|
||||
if (typeof typeList == "string")
|
||||
typeList = typeList.split(" ");
|
||||
|
||||
if (typeList instanceof Array)
|
||||
{
|
||||
for (var i in typeList)
|
||||
{
|
||||
switch (typeList[i])
|
||||
{
|
||||
case "$all":
|
||||
picker.appendFilters(FILTER_ALL);
|
||||
break;
|
||||
|
||||
case "$html":
|
||||
picker.appendFilters(FILTER_HTML);
|
||||
break;
|
||||
|
||||
case "$text":
|
||||
picker.appendFilters(FILTER_TEXT);
|
||||
break;
|
||||
|
||||
case "$images":
|
||||
picker.appendFilters(FILTER_IMAGES);
|
||||
break;
|
||||
|
||||
case "$xml":
|
||||
picker.appendFilters(FILTER_XML);
|
||||
break;
|
||||
|
||||
case "$xul":
|
||||
picker.appendFilters(FILTER_XUL);
|
||||
break;
|
||||
|
||||
default:
|
||||
picker.appendFilter(typeList[i], typeList[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return picker;
|
||||
}
|
||||
|
||||
function pickSaveAs (title, typeList, defaultFile, defaultDir)
|
||||
{
|
||||
if (!defaultDir && "lastSaveAsDir" in futils)
|
||||
defaultDir = futils.lastSaveAsDir;
|
||||
|
||||
var picker = futils.getPicker (defaultDir, typeList,
|
||||
{defaultString: defaultFile});
|
||||
picker.init (window, title ? title : futils.MSG_SAVE_AS,
|
||||
Components.interfaces.nsIFilePicker.modeSave);
|
||||
|
||||
var reason;
|
||||
|
||||
try
|
||||
{
|
||||
reason = picker.show();
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("caught exception from file picker: " + ex);
|
||||
}
|
||||
|
||||
var obj = new Object();
|
||||
|
||||
obj.reason = reason;
|
||||
obj.picker = picker;
|
||||
|
||||
if (reason != PICK_CANCEL)
|
||||
{
|
||||
obj.file = picker.file;
|
||||
futils.lastSaveAsDir = picker.file.parent;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.file = null;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function pickOpen (title, typeList, defaultFile, defaultDir)
|
||||
{
|
||||
if (!defaultDir && "lastOpenDir" in futils)
|
||||
defaultDir = futils.lastOpenDir;
|
||||
|
||||
var picker = futils.getPicker (defaultDir, typeList,
|
||||
{defaultString: defaultFile});
|
||||
picker.init (window, title ? title : futils.MSG_OPEN,
|
||||
Components.interfaces.nsIFilePicker.modeOpen);
|
||||
|
||||
var rv = picker.show();
|
||||
|
||||
if (rv != PICK_CANCEL)
|
||||
futils.lastOpenDir = picker.file.parent;
|
||||
|
||||
return {reason: rv, file: picker.file, picker: picker};
|
||||
}
|
||||
|
||||
function mkdir (localFile, perms)
|
||||
{
|
||||
if (typeof perms == "undefined")
|
||||
perms = 0766 & ~futils.umask;
|
||||
|
||||
localFile.create(FTYPE_DIR, perms);
|
||||
}
|
||||
|
||||
function nsLocalFile(path)
|
||||
{
|
||||
const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
|
||||
var localFile =
|
||||
Components.classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
|
||||
localFile.initWithPath(path);
|
||||
return localFile;
|
||||
}
|
||||
|
||||
function fopen (path, mode, perms, tmp)
|
||||
{
|
||||
return new LocalFile(path, mode, perms, tmp);
|
||||
}
|
||||
|
||||
function LocalFile(file, mode, perms, tmp)
|
||||
{
|
||||
const classes = Components.classes;
|
||||
const interfaces = Components.interfaces;
|
||||
|
||||
const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
|
||||
const FILEIN_CTRID = "@mozilla.org/network/file-input-stream;1";
|
||||
const FILEOUT_CTRID = "@mozilla.org/network/file-output-stream;1";
|
||||
const SCRIPTSTREAM_CTRID = "@mozilla.org/scriptableinputstream;1";
|
||||
|
||||
const nsIFile = interfaces.nsIFile;
|
||||
const nsILocalFile = interfaces.nsILocalFile;
|
||||
const nsIFileOutputStream = interfaces.nsIFileOutputStream;
|
||||
const nsIFileInputStream = interfaces.nsIFileInputStream;
|
||||
const nsIScriptableInputStream = interfaces.nsIScriptableInputStream;
|
||||
|
||||
if (typeof perms == "undefined")
|
||||
perms = 0666 & ~futils.umask;
|
||||
|
||||
if (typeof mode == "string")
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case ">":
|
||||
mode = MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE;
|
||||
break;
|
||||
case ">>":
|
||||
mode = MODE_WRONLY | MODE_CREATE | MODE_APPEND;
|
||||
break;
|
||||
case "<":
|
||||
mode = MODE_RDONLY;
|
||||
break;
|
||||
default:
|
||||
throw "Invalid mode ``" + mode + "''";
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof file == "string")
|
||||
{
|
||||
this.localFile = new nsLocalFile(file);
|
||||
}
|
||||
else if (file instanceof nsILocalFile)
|
||||
{
|
||||
this.localFile = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "bad type for argument |file|.";
|
||||
}
|
||||
|
||||
this.path = this.localFile.path;
|
||||
|
||||
if (mode & (MODE_WRONLY | MODE_RDWR))
|
||||
{
|
||||
this.outputStream =
|
||||
classes[FILEOUT_CTRID].createInstance(nsIFileOutputStream);
|
||||
this.outputStream.init(this.localFile, mode, perms, 0);
|
||||
}
|
||||
|
||||
if (mode & (MODE_RDONLY | MODE_RDWR))
|
||||
{
|
||||
var is = classes[FILEIN_CTRID].createInstance(nsIFileInputStream);
|
||||
is.init(this.localFile, mode, perms, tmp);
|
||||
this.inputStream =
|
||||
classes[SCRIPTSTREAM_CTRID].createInstance(nsIScriptableInputStream);
|
||||
this.inputStream.init(is);
|
||||
}
|
||||
}
|
||||
|
||||
LocalFile.prototype.write =
|
||||
function fo_write(buf)
|
||||
{
|
||||
if (!("outputStream" in this))
|
||||
throw "file not open for writing.";
|
||||
|
||||
return this.outputStream.write(buf, buf.length);
|
||||
}
|
||||
|
||||
LocalFile.prototype.read =
|
||||
function fo_read(max)
|
||||
{
|
||||
if (!("inputStream" in this))
|
||||
throw "file not open for reading.";
|
||||
|
||||
var av = this.inputStream.available();
|
||||
if (typeof max == "undefined")
|
||||
max = av;
|
||||
|
||||
if (!av)
|
||||
return null;
|
||||
|
||||
var rv = this.inputStream.read(max);
|
||||
return rv;
|
||||
}
|
||||
|
||||
LocalFile.prototype.close =
|
||||
function fo_close()
|
||||
{
|
||||
if ("outputStream" in this)
|
||||
this.outputStream.close();
|
||||
if ("inputStream" in this)
|
||||
this.inputStream.close();
|
||||
}
|
||||
|
||||
LocalFile.prototype.flush =
|
||||
function fo_close()
|
||||
{
|
||||
return this.outputStream.flush();
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
*
|
||||
* depends on utils.js, events.js, and connection.js
|
||||
*
|
||||
* HTTP document class. Asynchronous retrieval of documents via HTTP.
|
||||
*
|
||||
* 1999-08-15 rginda@ndcico.com v1.0
|
||||
*
|
||||
*/
|
||||
|
||||
function CHTTPDoc (server, path)
|
||||
{
|
||||
|
||||
this.GET_TIMEOUT = 2 * 60; /* 2 minute timeout on gets */
|
||||
this.state = "new";
|
||||
this.server = server;
|
||||
this.path = path;
|
||||
|
||||
}
|
||||
|
||||
CHTTPDoc.prototype.get =
|
||||
function http_get (ep)
|
||||
{
|
||||
|
||||
this.connection = new CBSConnection();
|
||||
if (!this.connection.connect (this.server, 80, (void 0), true))
|
||||
{
|
||||
this.state = "connect-error";
|
||||
var e = new CEvent ("httpdoc", "complete", this, "onComplete");
|
||||
this.eventPump.addEvent (e);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.eventPump = ep;
|
||||
this.state = "opened";
|
||||
this.data = "";
|
||||
this.duration = 0;
|
||||
|
||||
var e = new CEvent ("httpdoc", "poll", this, "onPoll");
|
||||
this.eventPump.addEvent (e);
|
||||
|
||||
this.connection.sendData ("GET " + this.path + "\n");
|
||||
this.startDate = new Date();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CHTTPDoc.prototype.onPoll =
|
||||
function http_poll (e)
|
||||
{
|
||||
var line = "";
|
||||
var ex, c;
|
||||
var need_more = false;
|
||||
|
||||
if (this.duration < this.GET_TIMEOUT)
|
||||
try
|
||||
{
|
||||
line = this.connection.readData (50);
|
||||
need_more = true;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
if (typeof (ex) == "undefined")
|
||||
{
|
||||
line = "";
|
||||
need_more = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("** Caught exception: '" + ex + "' while receiving " +
|
||||
this.server + this.path);
|
||||
this.state = "read-error";
|
||||
}
|
||||
}
|
||||
else
|
||||
this.state = "receive-timeout";
|
||||
|
||||
switch (this.state)
|
||||
{
|
||||
case "opened":
|
||||
case "receive-header":
|
||||
if (this.state == "opened")
|
||||
this.headers = "";
|
||||
|
||||
c = line.search(/\<html\>/i);
|
||||
if (c != -1)
|
||||
{
|
||||
this.data = line.substr (c, line.length);
|
||||
this.state = "receive-data";
|
||||
line = line.substr (0, c);
|
||||
|
||||
c = this.data.search(/\<\/html\>/i);
|
||||
if (c != -1)
|
||||
{
|
||||
this.docType = stringTrim(this.docType);
|
||||
this.state = "complete";
|
||||
need_more = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.headers += line;
|
||||
c = this.headers.search (/\<\!doctype/i);
|
||||
if (c != -1)
|
||||
{
|
||||
this.docType = this.headers.substr (c, line.length);
|
||||
if (this.state == "opened")
|
||||
this.state = "receive-doctype";
|
||||
this.headers = this.headers.substr (0, c);
|
||||
}
|
||||
|
||||
if (this.state == "opened")
|
||||
this.state = "receive-header";
|
||||
break;
|
||||
|
||||
case "receive-doctype":
|
||||
var c = line.search (/\<html\>/i);
|
||||
if (c != -1)
|
||||
{
|
||||
this.docType = stringTrim(this.docType);
|
||||
this.data = line.substr (c, line.length);
|
||||
this.state = "receive-data";
|
||||
line = line.substr (0, c);
|
||||
}
|
||||
|
||||
this.docType += line;
|
||||
break;
|
||||
|
||||
case "receive-data":
|
||||
this.data += line;
|
||||
var c = this.data.search(/\<\/html\>/i);
|
||||
if (c != -1)
|
||||
this.state = "complete";
|
||||
break;
|
||||
|
||||
case "read-error":
|
||||
case "receive-timeout":
|
||||
break;
|
||||
|
||||
default:
|
||||
dd ("** INVALID STATE in HTTPDoc object (" + this.state + ") **");
|
||||
need_more = false;
|
||||
this.state = "error";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ((this.state != "complete") && (need_more))
|
||||
var e = new CEvent ("httpdoc", "poll", this, "onPoll");
|
||||
else
|
||||
{
|
||||
this.connection.disconnect();
|
||||
if (this.data)
|
||||
{
|
||||
var m = this.data.match(/\<title\>(.*)\<\/title\>/i);
|
||||
if (m != null)
|
||||
this.title = m[1];
|
||||
else
|
||||
this.title = "";
|
||||
}
|
||||
var e = new CEvent ("httpdoc", "complete", this, "onComplete");
|
||||
}
|
||||
|
||||
this.eventPump.addEvent (e);
|
||||
this.duration = (new Date() - this.startDate) / 1000;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
CHTTPDoc.prototype.onComplete =
|
||||
function http_complete(e)
|
||||
{
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*/
|
||||
|
||||
/*
|
||||
* Hook used to trace events.
|
||||
*/
|
||||
function event_tracer (e)
|
||||
{
|
||||
var name = "";
|
||||
var data = ("debug" in e) ? e.debug : "";
|
||||
|
||||
switch (e.set)
|
||||
{
|
||||
case "server":
|
||||
name = e.destObject.connection.host;
|
||||
if (e.type == "rawdata")
|
||||
data = "'" + e.data + "'";
|
||||
if (e.type == "senddata")
|
||||
{
|
||||
var nextLine =
|
||||
e.destObject.sendQueue[e.destObject.sendQueue.length - 1];
|
||||
if ("logged" in nextLine)
|
||||
return true; /* don't print again */
|
||||
|
||||
if (nextLine) {
|
||||
data = "'" + nextLine.replace ("\n", "\\n") + "'";
|
||||
nextLine.logged = true;
|
||||
}
|
||||
else
|
||||
data = "!!! Nothing to send !!!";
|
||||
}
|
||||
break;
|
||||
|
||||
case "network":
|
||||
case "channel":
|
||||
name = e.destObject.name;
|
||||
break;
|
||||
|
||||
case "user":
|
||||
name = e.destObject.nick;
|
||||
break;
|
||||
|
||||
case "httpdoc":
|
||||
name = e.destObject.server + e.destObject.path;
|
||||
if (e.destObject.state != "complete")
|
||||
data = "state: '" + e.destObject.state + "', received " +
|
||||
e.destObject.data.length;
|
||||
else
|
||||
dd ("document done:\n" + dumpObjectTree (this));
|
||||
break;
|
||||
|
||||
case "dcc-chat":
|
||||
name = e.destObject.host + ":" + e.destObject.port;
|
||||
if (e.type == "rawdata")
|
||||
data = "'" + e.data + "'";
|
||||
break;
|
||||
|
||||
case "client":
|
||||
if (e.type == "do-connect")
|
||||
data = "attempt: " + e.attempt + "/" +
|
||||
e.destObject.MAX_CONNECT_ATTEMPTS;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (name)
|
||||
name = "[" + name + "]";
|
||||
|
||||
if (e.type == "info")
|
||||
data = "'" + e.msg + "'";
|
||||
|
||||
var str = "Level " + e.level + ": '" + e.type + "', " +
|
||||
e.set + name + "." + e.destMethod;
|
||||
if (data)
|
||||
str += "\ndata : " + data;
|
||||
|
||||
dd (str);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,582 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The JavaScript Debugger
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
function MenuManager (commandManager, menuSpecs, contextFunction, commandStr)
|
||||
{
|
||||
var menuManager = this;
|
||||
|
||||
this.commandManager = commandManager;
|
||||
this.menuSpecs = menuSpecs;
|
||||
this.contextFunction = contextFunction;
|
||||
this.commandStr = commandStr;
|
||||
|
||||
this.onPopupShowing =
|
||||
function mmgr_onshow (event) { return menuManager.showPopup (event); };
|
||||
this.onPopupHiding =
|
||||
function mmgr_onhide (event) { return menuManager.hidePopup (event); };
|
||||
}
|
||||
|
||||
MenuManager.prototype.appendMenuItems =
|
||||
function mmgr_append(menuId, items)
|
||||
{
|
||||
for (var i = 0; i < items.length; ++i)
|
||||
client.menuSpecs[menuId].items.push(items[i]);
|
||||
}
|
||||
|
||||
MenuManager.prototype.createContextMenus =
|
||||
function mmgr_initcxs (document)
|
||||
{
|
||||
for (var id in this.menuSpecs)
|
||||
{
|
||||
if (id.indexOf("context:") == 0)
|
||||
this.createContextMenu(document, id);
|
||||
}
|
||||
}
|
||||
|
||||
MenuManager.prototype.createContextMenu =
|
||||
function mmgr_initcx (document, id)
|
||||
{
|
||||
if (!document.getElementById(id))
|
||||
{
|
||||
if (!ASSERT(id in this.menuSpecs, "unknown context menu " + id))
|
||||
return;
|
||||
|
||||
var dp = document.getElementById("dynamic-popups");
|
||||
var popup = this.appendPopupMenu (dp, null, id, id);
|
||||
var items = this.menuSpecs[id].items;
|
||||
this.createMenuItems (popup, null, items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MenuManager.prototype.createMenus =
|
||||
function mmgr_createtb(document, menuid)
|
||||
{
|
||||
var menu = document.getElementById(menuid);
|
||||
for (id in this.menuSpecs)
|
||||
{
|
||||
var domID;
|
||||
if ("domID" in this.menuSpecs[id])
|
||||
domID = this.menuSpecs[id].domID;
|
||||
else
|
||||
domID = id;
|
||||
|
||||
if (id.indexOf(menuid + ":") == 0)
|
||||
this.createMenu(menu, null, id, domID);
|
||||
}
|
||||
}
|
||||
|
||||
MenuManager.prototype.createMainToolbar =
|
||||
function mmgr_createtb(document, id)
|
||||
{
|
||||
var toolbar = document.getElementById(id);
|
||||
var spec = client.menuSpecs[id];
|
||||
for (var i in spec.items)
|
||||
{
|
||||
this.appendToolbarItem (toolbar, null, spec.items[i]);
|
||||
}
|
||||
|
||||
toolbar.className = "toolbar-primary chromeclass-toolbar";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* Registers event handlers on a given menu.
|
||||
*/
|
||||
MenuManager.prototype.hookPopup =
|
||||
function mmgr_hookpop (node)
|
||||
{
|
||||
node.addEventListener ("popupshowing", this.onPopupShowing, false);
|
||||
node.addEventListener ("popuphiding", this.onPopupHiding, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* |showPopup| is called from the "onpopupshowing" event of menus
|
||||
* managed by the CommandManager. If a command is disabled, represents a command
|
||||
* that cannot be "satisfied" by the current command context |cx|, or has an
|
||||
* "enabledif" attribute that eval()s to false, then the menuitem is disabled.
|
||||
* In addition "checkedif" and "visibleif" attributes are eval()d and
|
||||
* acted upon accordingly.
|
||||
*/
|
||||
MenuManager.prototype.showPopup =
|
||||
function mmgr_showpop (event)
|
||||
{
|
||||
//dd ("showPopup {");
|
||||
/* returns true if the command context has the properties required to
|
||||
* execute the command associated with |menuitem|.
|
||||
*/
|
||||
function satisfied()
|
||||
{
|
||||
if (menuitem.hasAttribute("isSeparator") ||
|
||||
!menuitem.hasAttribute("commandname"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!("menuManager" in cx))
|
||||
{
|
||||
dd ("no menuManager in cx");
|
||||
return false;
|
||||
}
|
||||
|
||||
var name = menuitem.getAttribute("commandname");
|
||||
var commandManager = cx.menuManager.commandManager;
|
||||
var commands = commandManager.commands;
|
||||
|
||||
if (!ASSERT (name in commands,
|
||||
"menu contains unknown command '" + name + "'"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var rv = commandManager.isCommandSatisfied(cx, commands[name]);
|
||||
delete cx.parseError;
|
||||
return rv;
|
||||
};
|
||||
|
||||
/* Convenience function for "enabledif", etc, attributes. */
|
||||
function has (prop)
|
||||
{
|
||||
return (prop in cx);
|
||||
};
|
||||
|
||||
/* evals the attribute named |attr| on the node |node|. */
|
||||
function evalIfAttribute (node, attr)
|
||||
{
|
||||
var ex;
|
||||
var expr = node.getAttribute(attr);
|
||||
if (!expr)
|
||||
return true;
|
||||
|
||||
expr = expr.replace (/\Wand\W/gi, " && ");
|
||||
|
||||
try
|
||||
{
|
||||
return eval("(" + expr + ")");
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dd ("caught exception evaling '" + node.getAttribute("id") + "'.'" +
|
||||
attr + "'\n" + ex);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var cx;
|
||||
var popup = event.originalTarget;
|
||||
var menuitem = popup.firstChild;
|
||||
|
||||
|
||||
/* If the host provided a |contextFunction|, use it now. Remember the
|
||||
* return result as this.cx for use if something from this menu is actually
|
||||
* dispatched. this.cx is deleted in |hidePopup|. */
|
||||
if (typeof this.contextFunction == "function")
|
||||
{
|
||||
cx = this.cx = this.contextFunction (popup.getAttribute("menuName"),
|
||||
event);
|
||||
}
|
||||
else
|
||||
{
|
||||
cx = this.cx = { menuManager: this, originalEvent: event };
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
/* should it be visible? */
|
||||
if (menuitem.hasAttribute("visibleif"))
|
||||
{
|
||||
if (evalIfAttribute(menuitem, "visibleif"))
|
||||
menuitem.removeAttribute ("hidden");
|
||||
else
|
||||
{
|
||||
menuitem.setAttribute ("hidden", "true");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* it's visible, maybe it has a dynamic label? */
|
||||
if (menuitem.hasAttribute("format"))
|
||||
{
|
||||
var label = replaceVars(menuitem.getAttribute("format"), cx);
|
||||
if (label.indexOf("\$") != -1)
|
||||
label = menuitem.getAttribute("backupLabel");
|
||||
menuitem.setAttribute("label", label);
|
||||
}
|
||||
|
||||
/* ok, it's visible, maybe it should be disabled? */
|
||||
if (satisfied())
|
||||
{
|
||||
if (menuitem.hasAttribute("enabledif"))
|
||||
{
|
||||
if (evalIfAttribute(menuitem, "enabledif"))
|
||||
menuitem.removeAttribute ("disabled");
|
||||
else
|
||||
menuitem.setAttribute ("disabled", "true");
|
||||
}
|
||||
else
|
||||
menuitem.removeAttribute ("disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
menuitem.setAttribute ("disabled", "true");
|
||||
}
|
||||
|
||||
/* should it have a check? */
|
||||
if (menuitem.hasAttribute("checkedif"))
|
||||
{
|
||||
if (evalIfAttribute(menuitem, "checkedif"))
|
||||
menuitem.setAttribute ("checked", "true");
|
||||
else
|
||||
menuitem.removeAttribute ("checked");
|
||||
}
|
||||
|
||||
} while ((menuitem = menuitem.nextSibling));
|
||||
|
||||
//dd ("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use only.
|
||||
*
|
||||
* |hidePopup| is called from the "onpopuphiding" event of menus
|
||||
* managed by the CommandManager. Nothing to do here anymore.
|
||||
* We used to just clean up this.cx, but that's a problem for nested
|
||||
* menus.
|
||||
*/
|
||||
MenuManager.prototype.hidePopup =
|
||||
function mmgr_hidepop (id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a sub-menu to an existing menu.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param id ID of the sub-menu to add.
|
||||
* @param label Text to use for this sub-menu. The & character can be
|
||||
* used to indicate the accesskey.
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendSubMenu =
|
||||
function mmgr_addsmenu (parentNode, beforeNode, menuName, domId, label, attribs)
|
||||
{
|
||||
var document = parentNode.ownerDocument;
|
||||
|
||||
/* sometimes the menu is already there, for overlay purposes. */
|
||||
var menu = document.getElementById(domId);
|
||||
|
||||
if (!menu)
|
||||
{
|
||||
menu = document.createElement ("menu");
|
||||
menu.setAttribute ("id", domId);
|
||||
parentNode.insertBefore(menu, beforeNode);
|
||||
}
|
||||
|
||||
var menupopup = menu.firstChild;
|
||||
|
||||
if (!menupopup)
|
||||
{
|
||||
menupopup = document.createElement ("menupopup");
|
||||
menupopup.setAttribute ("id", domId + "-popup");
|
||||
menu.appendChild(menupopup);
|
||||
menupopup = menu.firstChild;
|
||||
}
|
||||
|
||||
menupopup.setAttribute ("menuName", menuName);
|
||||
|
||||
menu.setAttribute ("accesskey", getAccessKey(label));
|
||||
label = label.replace("&", "");
|
||||
menu.setAttribute ("label", label);
|
||||
menu.setAttribute ("isSeparator", true);
|
||||
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
menu.setAttribute (p, attribs[p]);
|
||||
}
|
||||
|
||||
this.hookPopup (menupopup);
|
||||
|
||||
return menupopup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a popup to an existing popupset.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param id ID of the popup to add.
|
||||
* @param label Text to use for this popup. Popup menus don't normally have
|
||||
* labels, but we set a "label" attribute anyway, in case
|
||||
* the host wants it for some reason. Any "&" characters will
|
||||
* be stripped.
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendPopupMenu =
|
||||
function mmgr_addpmenu (parentNode, beforeNode, menuName, id, label, attribs)
|
||||
{
|
||||
var document = parentNode.ownerDocument;
|
||||
var popup = document.createElement ("popup");
|
||||
popup.setAttribute ("id", id);
|
||||
if (label)
|
||||
popup.setAttribute ("label", label.replace("&", ""));
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
popup.setAttribute (p, attribs[p]);
|
||||
}
|
||||
|
||||
popup.setAttribute ("menuName", menuName);
|
||||
|
||||
parentNode.insertBefore(popup, beforeNode);
|
||||
this.hookPopup (popup);
|
||||
|
||||
return popup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a menuitem to an existing menu or popup.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param command A reference to the CommandRecord this menu item will represent.
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendMenuItem =
|
||||
function mmgr_addmenu (parentNode, beforeNode, commandName, attribs)
|
||||
{
|
||||
var menuManager = this;
|
||||
|
||||
var document = parentNode.ownerDocument;
|
||||
if (commandName == "-")
|
||||
return this.appendMenuSeparator(parentNode, beforeNode, attribs);
|
||||
|
||||
var parentId = parentNode.getAttribute("id");
|
||||
|
||||
if (!ASSERT(commandName in this.commandManager.commands,
|
||||
"unknown command " + commandName + " targeted for " +
|
||||
parentId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var command = this.commandManager.commands[commandName];
|
||||
var menuitem = document.createElement ("menuitem");
|
||||
menuitem.setAttribute ("id", parentId + ":" + commandName);
|
||||
menuitem.setAttribute ("commandname", command.name);
|
||||
menuitem.setAttribute ("key", "key:" + command.name);
|
||||
menuitem.setAttribute ("accesskey", getAccessKey(command.label));
|
||||
var label = command.label.replace("&", "");
|
||||
menuitem.setAttribute ("label", label);
|
||||
if (command.format)
|
||||
{
|
||||
menuitem.setAttribute("format", command.format);
|
||||
menuitem.setAttribute("backupLabel", label);
|
||||
}
|
||||
menuitem.setAttribute ("oncommand", this.commandStr);
|
||||
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
menuitem.setAttribute (p, attribs[p]);
|
||||
}
|
||||
|
||||
command.uiElements.push(menuitem);
|
||||
parentNode.insertBefore (menuitem, beforeNode);
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a menuseparator to an existing menu or popup.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendMenuSeparator =
|
||||
function mmgr_addsep (parentNode, beforeNode, attribs)
|
||||
{
|
||||
var document = parentNode.ownerDocument;
|
||||
var menuitem = document.createElement ("menuseparator");
|
||||
menuitem.setAttribute ("isSeparator", true);
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
menuitem.setAttribute (p, attribs[p]);
|
||||
}
|
||||
parentNode.insertBefore (menuitem, beforeNode);
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a toolbaritem to an existing box element.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param command A reference to the CommandRecord this toolbaritem will
|
||||
* represent.
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendToolbarItem =
|
||||
function mmgr_addtb (parentNode, beforeNode, commandName, attribs)
|
||||
{
|
||||
if (commandName == "-")
|
||||
return this.appendToolbarSeparator(parentNode, beforeNode, attribs);
|
||||
|
||||
var parentId = parentNode.getAttribute("id");
|
||||
|
||||
if (!ASSERT(commandName in this.commandManager.commands,
|
||||
"unknown command " + commandName + " targeted for " +
|
||||
parentId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var command = this.commandManager.commands[commandName];
|
||||
var document = parentNode.ownerDocument;
|
||||
var tbitem = document.createElement ("toolbarbutton");
|
||||
|
||||
var id = parentNode.getAttribute("id") + ":" + commandName;
|
||||
tbitem.setAttribute ("id", id);
|
||||
tbitem.setAttribute ("class", "toolbarbutton-1");
|
||||
if (command.tip)
|
||||
tbitem.setAttribute ("tooltiptext", command.tip);
|
||||
tbitem.setAttribute ("label", command.label.replace("&", ""));
|
||||
tbitem.setAttribute ("oncommand",
|
||||
"dispatch('" + commandName + "');");
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
tbitem.setAttribute (p, attribs[p]);
|
||||
}
|
||||
|
||||
command.uiElements.push(tbitem);
|
||||
parentNode.insertBefore (tbitem, beforeNode);
|
||||
|
||||
return tbitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a toolbarseparator to an existing box.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param attribs Object containing CSS attributes to set on the element.
|
||||
*/
|
||||
MenuManager.prototype.appendToolbarSeparator =
|
||||
function mmgr_addmenu (parentNode, beforeNode, attribs)
|
||||
{
|
||||
var document = parentNode.ownerDocument;
|
||||
var tbitem = document.createElement ("toolbarseparator");
|
||||
tbitem.setAttribute ("isSeparator", true);
|
||||
if (typeof attribs == "object")
|
||||
{
|
||||
for (var p in attribs)
|
||||
tbitem.setAttribute (p, attribs[p]);
|
||||
}
|
||||
parentNode.appendChild (tbitem);
|
||||
|
||||
return tbitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates menu DOM nodes from a menu specification.
|
||||
* @param parentNode DOM Node to insert into
|
||||
* @param beforeNode DOM Node already contained by parentNode, to insert before
|
||||
* @param menuSpec array of menu items
|
||||
*/
|
||||
MenuManager.prototype.createMenu =
|
||||
function mmgr_newmenu (parentNode, beforeNode, menuName, domId, attribs)
|
||||
{
|
||||
if (typeof domId == "undefined")
|
||||
domId = menuName;
|
||||
|
||||
if (!ASSERT(menuName in this.menuSpecs, "unknown menu name " + menuName))
|
||||
return null;
|
||||
|
||||
var menuSpec = this.menuSpecs[menuName];
|
||||
|
||||
var subMenu = this.appendSubMenu (parentNode, beforeNode, menuName, domId,
|
||||
menuSpec.label, attribs);
|
||||
|
||||
this.createMenuItems (subMenu, null, menuSpec.items);
|
||||
return subMenu;
|
||||
}
|
||||
|
||||
MenuManager.prototype.createMenuItems =
|
||||
function mmgr_newitems (parentNode, beforeNode, menuItems)
|
||||
{
|
||||
function itemAttribs()
|
||||
{
|
||||
return (1 in menuItems[i]) ? menuItems[i][1] : null;
|
||||
};
|
||||
|
||||
var parentId = parentNode.getAttribute("id");
|
||||
|
||||
for (var i in menuItems)
|
||||
{
|
||||
var itemName = menuItems[i][0];
|
||||
if (itemName[0] == ">")
|
||||
{
|
||||
itemName = itemName.substr(1);
|
||||
if (!ASSERT(itemName in this.menuSpecs,
|
||||
"unknown submenu " + itemName + " referenced in " +
|
||||
parentId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
this.createMenu (parentNode, beforeNode, itemName,
|
||||
parentId + ":" + itemName, itemAttribs());
|
||||
}
|
||||
else if (itemName in this.commandManager.commands)
|
||||
{
|
||||
this.appendMenuItem (parentNode, beforeNode, itemName,
|
||||
itemAttribs());
|
||||
}
|
||||
else if (itemName == "-")
|
||||
{
|
||||
this.appendMenuSeparator (parentNode, beforeNode, itemAttribs());
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("unknown command " + itemName + " referenced in " + parentId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The JavaScript Debugger
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
function MessageManager()
|
||||
{
|
||||
const UC_CTRID = "@mozilla.org/intl/scriptableunicodeconverter";
|
||||
const nsIUnicodeConverter =
|
||||
Components.interfaces.nsIScriptableUnicodeConverter;
|
||||
|
||||
this.ucConverter =
|
||||
Components.classes[UC_CTRID].getService(nsIUnicodeConverter);
|
||||
this.defaultBundle = null;
|
||||
this.bundleList = new Array();
|
||||
}
|
||||
|
||||
MessageManager.prototype.addBundle =
|
||||
function mm_addbundle(bundlePath, targetWindow)
|
||||
{
|
||||
var bundle = srGetStrBundle(bundlePath);
|
||||
this.bundleList.push(bundle);
|
||||
|
||||
this.importBundle(bundle, targetWindow, this.bundleList.length - 1);
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
MessageManager.prototype.importBundle =
|
||||
function mm_importbundle(bundle, targetWindow, index)
|
||||
{
|
||||
const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
|
||||
|
||||
if (!targetWindow)
|
||||
targetWindow = window;
|
||||
|
||||
if (typeof index == "undefined")
|
||||
index = arrayIndexOf(this.bundleList, bundle);
|
||||
|
||||
var pfx;
|
||||
if (index == 0)
|
||||
pfx = "";
|
||||
else
|
||||
pfx = index + ":";
|
||||
|
||||
var enumer = bundle.getSimpleEnumeration();
|
||||
|
||||
while (enumer.hasMoreElements())
|
||||
{
|
||||
var prop = enumer.getNext().QueryInterface(nsIPropertyElement);
|
||||
var ary = prop.key.match (/^(msg|msn)/);
|
||||
if (ary)
|
||||
{
|
||||
var constValue;
|
||||
var constName = prop.key.toUpperCase().replace (/\./g, "_");
|
||||
if (ary[1] == "msn" || prop.value.search(/%(\d+\$)?s/i) != -1)
|
||||
constValue = pfx + prop.key;
|
||||
else
|
||||
constValue = prop.value.replace (/^\"/, "").replace (/\"$/, "");
|
||||
|
||||
targetWindow[constName] = constValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bundleList.length == 1)
|
||||
this.defaultBundle = bundle;
|
||||
}
|
||||
|
||||
MessageManager.prototype.checkCharset =
|
||||
function mm_checkset(charset)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ucConverter.charset = charset;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
MessageManager.prototype.toUnicode =
|
||||
function mm_tounicode(msg, charset)
|
||||
{
|
||||
if (!charset)
|
||||
return msg;
|
||||
|
||||
try
|
||||
{
|
||||
this.ucConverter.charset = charset;
|
||||
msg = this.ucConverter.ConvertToUnicode(msg);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
//dd ("caught exception " + ex + " converting " + msg + " to charset " +
|
||||
// charset);
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
MessageManager.prototype.fromUnicode =
|
||||
function mm_fromunicode(msg, charset)
|
||||
{
|
||||
if (!charset)
|
||||
return msg;
|
||||
|
||||
if (charset != this.ucConverter.charset)
|
||||
this.ucConverter.charset = charset;
|
||||
|
||||
try
|
||||
{
|
||||
if ("Finish" in this.ucConverter)
|
||||
{
|
||||
msg = this.ucConverter.ConvertFromUnicode(msg);
|
||||
this.ucConverter.Finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = this.ucConverter.ConvertFromUnicode(msg + " ");
|
||||
msg = msg.substr(0, msg.length - 1);
|
||||
}
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
//dd ("caught exception " + ex + " converting " + msg + " to charset " +
|
||||
// charset);
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
MessageManager.prototype.getMsg =
|
||||
function mm_getmsg (msgName, params, deflt)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bundle;
|
||||
var ary = msgName.match (/(\d+):(.+)/);
|
||||
if (ary)
|
||||
{
|
||||
return (this.getMsgFrom(this.bundleList[ary[1]], ary[2], params,
|
||||
deflt));
|
||||
}
|
||||
|
||||
return this.getMsgFrom(this.bundleList[0], msgName, params, deflt);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
ASSERT (0, "Caught exception getting message: " + msgName + "/" +
|
||||
params);
|
||||
return deflt ? deflt : msgName;
|
||||
}
|
||||
}
|
||||
|
||||
MessageManager.prototype.getMsgFrom =
|
||||
function mm_getfrom (bundle, msgName, params, deflt)
|
||||
{
|
||||
try
|
||||
{
|
||||
var rv;
|
||||
|
||||
if (params && params instanceof Array)
|
||||
rv = bundle.formatStringFromName (msgName, params, params.length);
|
||||
else if (params || params == 0)
|
||||
rv = bundle.formatStringFromName (msgName, [params], 1);
|
||||
else
|
||||
rv = bundle.GetStringFromName (msgName);
|
||||
|
||||
/* strip leading and trailing quote characters, see comment at the
|
||||
* top of venkman.properties.
|
||||
*/
|
||||
rv = rv.replace (/^\"/, "");
|
||||
rv = rv.replace (/\"$/, "");
|
||||
|
||||
return rv;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
if (typeof deflt == "undefined")
|
||||
{
|
||||
ASSERT (0, "caught exception getting value for ``" + msgName +
|
||||
"''\n" + ex + "\n");
|
||||
return msgName;
|
||||
}
|
||||
return deflt;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1,383 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The JavaScript Debugger
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
const PREF_RELOAD = true;
|
||||
const PREF_WRITETHROUGH = true;
|
||||
|
||||
function PrefManager (branchName)
|
||||
{
|
||||
var prefManager = this;
|
||||
|
||||
function pm_observe (prefService, topic, prefName)
|
||||
{
|
||||
var r = prefManager.prefRecords[prefName];
|
||||
if (!r)
|
||||
return;
|
||||
|
||||
var oldValue = (r.realValue != null) ? r.realValue : r.defaultValue;
|
||||
r.realValue = prefManager.getPref(prefName, PREF_RELOAD);
|
||||
prefManager.onPrefChanged(prefName, r.realValue, oldValue);
|
||||
};
|
||||
|
||||
const PREF_CTRID = "@mozilla.org/preferences-service;1";
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService;
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
|
||||
const nsIPrefBranchInternal = Components.interfaces.nsIPrefBranchInternal;
|
||||
|
||||
this.prefService =
|
||||
Components.classes[PREF_CTRID].getService(nsIPrefService);
|
||||
this.prefBranch = this.prefService.getBranch(branchName);
|
||||
this.defaultValues = new Object();
|
||||
this.prefs = new Object();
|
||||
this.prefNames = new Array();
|
||||
this.prefRecords = new Object();
|
||||
this.observer = { observe: pm_observe };
|
||||
|
||||
this.prefBranchInternal =
|
||||
this.prefBranch.QueryInterface(nsIPrefBranchInternal);
|
||||
this.prefBranchInternal.addObserver("", this.observer, false);
|
||||
|
||||
this.valid = true;
|
||||
}
|
||||
|
||||
PrefManager.prototype.destroy =
|
||||
function pm_destroy()
|
||||
{
|
||||
if (this.valid)
|
||||
{
|
||||
this.prefBranchInternal.removeObserver("", this.observer);
|
||||
this.valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
PrefManager.prototype.getBranch =
|
||||
function pm_getbranch(suffix)
|
||||
{
|
||||
return this.prefService.getBranch(this.prefBranch.root + suffix);
|
||||
}
|
||||
|
||||
PrefManager.prototype.getBranchManager =
|
||||
function pm_getbranchmgr(suffix)
|
||||
{
|
||||
return new PrefManager(this.prefBranch.root + suffix);
|
||||
}
|
||||
|
||||
PrefManager.prototype.onPrefChanged =
|
||||
function pm_changed(prefName, prefManager, topic)
|
||||
{
|
||||
/* clients can override this to hear about pref changes */
|
||||
}
|
||||
|
||||
PrefManager.prototype.listPrefs =
|
||||
function pm_listprefs (prefix)
|
||||
{
|
||||
var list = new Array();
|
||||
var names = this.prefNames;
|
||||
for (var i = 0; i < names.length; ++i)
|
||||
{
|
||||
if (!prefix || names[i].indexOf(prefix) == 0)
|
||||
list.push (names[i]);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
PrefManager.prototype.readPrefs =
|
||||
function pm_readprefs ()
|
||||
{
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
|
||||
|
||||
var list = this.prefBranch.getChildList("", {});
|
||||
for (var i = 0; i < list.length; ++i)
|
||||
{
|
||||
if (!(list[i] in this))
|
||||
{
|
||||
var type = this.prefBranch.getPrefType (list[i]);
|
||||
var defaultValue;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case nsIPrefBranch.PREF_INT:
|
||||
defaultValue = 0;
|
||||
break;
|
||||
|
||||
case nsIPrefBranch.PREF_BOOL:
|
||||
defaultValue = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
defaultValue = "";
|
||||
}
|
||||
|
||||
this.addPref(list[i], defaultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PrefManager.prototype.isKnownPref =
|
||||
function pm_ispref(prefName)
|
||||
{
|
||||
return (prefName in this.prefRecords);
|
||||
}
|
||||
|
||||
PrefManager.prototype.addPrefs =
|
||||
function pm_addprefs(prefSpecs)
|
||||
{
|
||||
for (var i = 0; i < prefSpecs.length; ++i)
|
||||
{
|
||||
this.addPref(prefSpecs[i][0], prefSpecs[i][1],
|
||||
2 in prefSpecs[i] ? prefSpecs[i][2] : null);
|
||||
}
|
||||
}
|
||||
|
||||
PrefManager.prototype.addDeferredPrefs =
|
||||
function pm_addprefsd(targetManager, writeThrough)
|
||||
{
|
||||
function deferGet(prefName)
|
||||
{
|
||||
return targetManager.getPref(prefName);
|
||||
};
|
||||
|
||||
function deferSet(prefName, value)
|
||||
{
|
||||
return targetManager.setPref(prefName, value);
|
||||
};
|
||||
|
||||
var setter = null;
|
||||
|
||||
if (writeThrough)
|
||||
setter = deferSet;
|
||||
|
||||
var prefs = targetManager.prefs;
|
||||
|
||||
for (var i = 0; i < prefs.length; ++i)
|
||||
this.addPref(prefs[i], deferGet, setter);
|
||||
}
|
||||
|
||||
PrefManager.prototype.updateArrayPref =
|
||||
function pm_arrayupdate(prefName)
|
||||
{
|
||||
var record = this.prefRecords[prefName];
|
||||
if (!ASSERT(record, "Unknown pref: " + prefName))
|
||||
return;
|
||||
|
||||
if (record.realValue == null)
|
||||
record.realValue = record.defaultValue;
|
||||
|
||||
if (!ASSERT(record.realValue instanceof Array, "Pref is not an array"))
|
||||
return;
|
||||
|
||||
this.prefBranch.setCharPref(prefName, this.arrayToString(record.realValue));
|
||||
this.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
PrefManager.prototype.stringToArray =
|
||||
function pm_s2a(string)
|
||||
{
|
||||
if (string.search(/\S/) == -1)
|
||||
return [];
|
||||
|
||||
var ary = string.split(/\s*;\s*/);
|
||||
for (var i = 0; i < ary.length; ++i)
|
||||
ary[i] = unescape(ary[i]);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
PrefManager.prototype.arrayToString =
|
||||
function pm_a2s(ary)
|
||||
{
|
||||
var escapedAry = new Array()
|
||||
for (var i = 0; i < ary.length; ++i)
|
||||
escapedAry[i] = escape(ary[i]);
|
||||
|
||||
return escapedAry.join("; ");
|
||||
}
|
||||
|
||||
PrefManager.prototype.getPref =
|
||||
function pm_getpref(prefName, reload)
|
||||
{
|
||||
var prefManager = this;
|
||||
|
||||
function updateArrayPref() { prefManager.updateArrayPref(prefName); };
|
||||
|
||||
var record = this.prefRecords[prefName];
|
||||
if (!ASSERT(record, "Unknown pref: " + prefName))
|
||||
return null;
|
||||
|
||||
var defaultValue;
|
||||
|
||||
if (typeof record.defaultValue == "function")
|
||||
{
|
||||
// deferred pref, call the getter, and don't cache the result.
|
||||
defaultValue = record.defaultValue(prefName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!reload && record.realValue != null)
|
||||
return record.realValue;
|
||||
|
||||
defaultValue = record.defaultValue;
|
||||
}
|
||||
|
||||
var realValue = null;
|
||||
|
||||
try
|
||||
{
|
||||
if (typeof defaultValue == "boolean")
|
||||
{
|
||||
realValue = this.prefBranch.getBoolPref(prefName);
|
||||
}
|
||||
else if (typeof defaultValue == "number")
|
||||
{
|
||||
realValue = this.prefBranch.getIntPref(prefName);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
{
|
||||
realValue = this.prefBranch.getCharPref(prefName);
|
||||
realValue = this.stringToArray(realValue);
|
||||
realValue.update = updateArrayPref;
|
||||
}
|
||||
else if (typeof defaultValue == "string" ||
|
||||
defaultValue == null)
|
||||
{
|
||||
realValue = this.prefBranch.getCharPref(prefName);
|
||||
}
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
// if the pref doesn't exist, ignore the exception.
|
||||
}
|
||||
|
||||
if (realValue == null)
|
||||
return defaultValue;
|
||||
|
||||
record.realValue = realValue;
|
||||
return realValue;
|
||||
}
|
||||
|
||||
PrefManager.prototype.setPref =
|
||||
function pm_setpref(prefName, value)
|
||||
{
|
||||
var prefManager = this;
|
||||
|
||||
function updateArrayPref() { prefManager.updateArrayPref(prefName); };
|
||||
|
||||
var record = this.prefRecords[prefName];
|
||||
if (!ASSERT(record, "Unknown pref: " + prefName))
|
||||
return null;
|
||||
|
||||
if ((record.realValue == null && value == record.defaultValue) ||
|
||||
record.realValue == value)
|
||||
{
|
||||
// no realvalue, and value is the same as default value ... OR ...
|
||||
// no change at all. just bail.
|
||||
return record.realValue;
|
||||
}
|
||||
|
||||
if (value == record.defaultValue)
|
||||
{
|
||||
this.clearPref(prefName);
|
||||
return value;
|
||||
}
|
||||
|
||||
var defaultValue = record.defaultValue;
|
||||
|
||||
if (typeof defaultValue == "function")
|
||||
defaultValue = defaultValue(prefName);
|
||||
|
||||
if (typeof defaultValue == "boolean")
|
||||
{
|
||||
this.prefBranch.setBoolPref(prefName, value);
|
||||
}
|
||||
else if (typeof defaultValue == "number")
|
||||
{
|
||||
this.prefBranch.setIntPref(prefName, value);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
{
|
||||
var str = this.arrayToString(value);
|
||||
this.prefBranch.setCharPref(prefName, str);
|
||||
value.update = updateArrayPref;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.prefBranch.setCharPref(prefName, value);
|
||||
}
|
||||
|
||||
this.prefService.savePrefFile(null);
|
||||
|
||||
record.realValue = value;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
PrefManager.prototype.clearPref =
|
||||
function pm_reset(prefName)
|
||||
{
|
||||
this.prefRecords[prefName].realValue = null;
|
||||
this.prefBranch.clearUserPref(prefName);
|
||||
this.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
PrefManager.prototype.addPref =
|
||||
function pm_addpref(prefName, defaultValue, setter)
|
||||
{
|
||||
var prefManager = this;
|
||||
|
||||
function updateArrayPref() { prefManager.updateArrayPref(prefName); };
|
||||
function prefGetter() { return prefManager.getPref(prefName); };
|
||||
function prefSetter(value) { return prefManager.setPref(prefName, value); };
|
||||
|
||||
if (!ASSERT(!(prefName in this.defaultValues),
|
||||
"Preference already exists: " + prefName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!setter)
|
||||
setter = prefSetter;
|
||||
|
||||
if (defaultValue instanceof Array)
|
||||
defaultValue.update = updateArrayPref;
|
||||
|
||||
this.prefRecords[prefName] = {defaultValue: defaultValue, realValue: null};
|
||||
|
||||
this.prefNames.push(prefName);
|
||||
this.prefNames.sort();
|
||||
|
||||
this.prefs.__defineGetter__(prefName, prefGetter);
|
||||
this.prefs.__defineSetter__(prefName, setter);
|
||||
}
|
||||
@@ -1,820 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
*
|
||||
* JavaScript utility functions.
|
||||
*
|
||||
* 1999-08-15 rginda@ndcico.com v1.0
|
||||
*/
|
||||
|
||||
var utils = new Object();
|
||||
|
||||
var DEBUG = true;
|
||||
var dd;
|
||||
|
||||
if (DEBUG) {
|
||||
var _dd_pfx = "";
|
||||
var _dd_singleIndent = " ";
|
||||
var _dd_indentLength = _dd_singleIndent.length;
|
||||
var _dd_currentIndent = "";
|
||||
var _dd_lastDumpWasOpen = false;
|
||||
var _dd_timeStack = new Array();
|
||||
var _dd_disableDepth = Number.MAX_VALUE;
|
||||
var _dd_currentDepth = 0;
|
||||
dd = function _dd(str) {
|
||||
if (typeof str != "string") {
|
||||
dump (str + "\n");
|
||||
} else if (str[str.length - 1] == "{") {
|
||||
++_dd_currentDepth;
|
||||
if (_dd_currentDepth >= _dd_disableDepth)
|
||||
return;
|
||||
if (str.indexOf("OFF") == 0)
|
||||
_dd_disableDepth = _dd_currentDepth;
|
||||
_dd_timeStack.push (new Date());
|
||||
if (_dd_lastDumpWasOpen)
|
||||
dump("\n");
|
||||
dump (_dd_pfx + _dd_currentIndent + str);
|
||||
_dd_currentIndent += _dd_singleIndent;
|
||||
_dd_lastDumpWasOpen = true;
|
||||
} else if (str[0] == "}") {
|
||||
if (--_dd_currentDepth >= _dd_disableDepth)
|
||||
return;
|
||||
_dd_disableDepth = Number.MAX_VALUE;
|
||||
var sufx = (new Date() - _dd_timeStack.pop()) / 1000 + " sec";
|
||||
_dd_currentIndent =
|
||||
_dd_currentIndent.substr(0, _dd_currentIndent.length -
|
||||
_dd_indentLength);
|
||||
if (_dd_lastDumpWasOpen)
|
||||
dump(str + " " + sufx + "\n");
|
||||
else
|
||||
dump(_dd_pfx + _dd_currentIndent + str + " " +
|
||||
sufx + "\n");
|
||||
_dd_lastDumpWasOpen = false;
|
||||
} else {
|
||||
if (_dd_currentDepth >= _dd_disableDepth)
|
||||
return;
|
||||
if (_dd_lastDumpWasOpen)
|
||||
dump("\n");
|
||||
dump(_dd_pfx + _dd_currentIndent + str + "\n");
|
||||
_dd_lastDumpWasOpen = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dd = function (){};
|
||||
}
|
||||
|
||||
var jsenv = new Object();
|
||||
jsenv.HAS_SECURITYMANAGER = ((typeof netscape == "object") &&
|
||||
(typeof netscape.security == "object"));
|
||||
jsenv.HAS_XPCOM = ((typeof Components == "object") &&
|
||||
(typeof Components.classes == "object"));
|
||||
jsenv.HAS_JAVA = (typeof java == "object");
|
||||
jsenv.HAS_RHINO = (typeof defineClass == "function");
|
||||
jsenv.HAS_DOCUMENT = (typeof document == "object");
|
||||
jsenv.HAS_NSPR_EVENTQ = jsenv.HAS_DOCUMENT;
|
||||
jsenv.HAS_STREAM_PROVIDER = ("nsIStreamProvider" in Components.interfaces);
|
||||
|
||||
function dumpObject (o, pfx, sep)
|
||||
{
|
||||
var p;
|
||||
var s = "";
|
||||
|
||||
sep = (typeof sep == "undefined") ? " = " : sep;
|
||||
pfx = (typeof pfx == "undefined") ? "" : pfx;
|
||||
|
||||
for (p in o)
|
||||
{
|
||||
if (typeof (o[p]) != "function")
|
||||
s += pfx + p + sep + o[p] + "\n";
|
||||
else
|
||||
s += pfx + p + sep + "function\n";
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
/* Dumps an object in tree format, recurse specifiec the the number of objects
|
||||
* to recurse, compress is a boolean that can uncompress (true) the output
|
||||
* format, and level is the number of levels to intitialy indent (only useful
|
||||
* internally.) A sample dumpObjectTree (o, 1) is shown below.
|
||||
*
|
||||
* + parent (object)
|
||||
* + users (object)
|
||||
* | + jsbot (object)
|
||||
* | + mrjs (object)
|
||||
* | + nakkezzzz (object)
|
||||
* | *
|
||||
* + bans (object)
|
||||
* | *
|
||||
* + topic (string) 'ircclient.js:59: nothing is not defined'
|
||||
* + getUsersLength (function) 9 lines
|
||||
* *
|
||||
*/
|
||||
function dumpObjectTree (o, recurse, compress, level)
|
||||
{
|
||||
var s = "";
|
||||
var pfx = "";
|
||||
|
||||
if (typeof recurse == "undefined")
|
||||
recurse = 0;
|
||||
if (typeof level == "undefined")
|
||||
level = 0;
|
||||
if (typeof compress == "undefined")
|
||||
compress = true;
|
||||
|
||||
for (var i = 0; i < level; i++)
|
||||
pfx += (compress) ? "| " : "| ";
|
||||
|
||||
var tee = (compress) ? "+ " : "+- ";
|
||||
|
||||
for (i in o)
|
||||
{
|
||||
var t, ex;
|
||||
|
||||
try
|
||||
{
|
||||
t = typeof o[i];
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
t = "ERROR";
|
||||
}
|
||||
|
||||
switch (t)
|
||||
{
|
||||
case "function":
|
||||
var sfunc = String(o[i]).split("\n");
|
||||
if (sfunc[2] == " [native code]")
|
||||
sfunc = "[native code]";
|
||||
else
|
||||
if (sfunc.length == 1)
|
||||
sfunc = String(sfunc);
|
||||
else
|
||||
sfunc = sfunc.length + " lines";
|
||||
s += pfx + tee + i + " (function) " + sfunc + "\n";
|
||||
break;
|
||||
|
||||
case "object":
|
||||
s += pfx + tee + i + " (object)\n";
|
||||
if (!compress)
|
||||
s += pfx + "|\n";
|
||||
if ((i != "parent") && (recurse))
|
||||
s += dumpObjectTree (o[i], recurse - 1,
|
||||
compress, level + 1);
|
||||
break;
|
||||
|
||||
case "string":
|
||||
if (o[i].length > 200)
|
||||
s += pfx + tee + i + " (" + t + ") " +
|
||||
o[i].length + " chars\n";
|
||||
else
|
||||
s += pfx + tee + i + " (" + t + ") '" + o[i] + "'\n";
|
||||
break;
|
||||
|
||||
case "ERROR":
|
||||
s += pfx + tee + i + " (" + t + ") ?\n";
|
||||
break;
|
||||
|
||||
default:
|
||||
s += pfx + tee + i + " (" + t + ") " + o[i] + "\n";
|
||||
|
||||
}
|
||||
|
||||
if (!compress)
|
||||
s += pfx + "|\n";
|
||||
|
||||
}
|
||||
|
||||
s += pfx + "*\n";
|
||||
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
function replaceVars(str, vars)
|
||||
{
|
||||
// replace "string $with a $variable", with
|
||||
// "string " + vars["with"] + " with a " + vars["variable"]
|
||||
|
||||
function doReplace(symbol)
|
||||
{
|
||||
var name = symbol.substr(1);
|
||||
if (name in vars)
|
||||
return vars[name];
|
||||
|
||||
return "$" + name;
|
||||
};
|
||||
|
||||
return str.replace(/(\$\w[\w\d\-]+)/g, doReplace);
|
||||
}
|
||||
|
||||
function formatException (ex)
|
||||
{
|
||||
if (ex instanceof Error)
|
||||
return getMsg (MSG_FMT_JSEXCEPTION, [ex.name, ex.message, ex.fileName,
|
||||
ex.lineNumber]);
|
||||
|
||||
return String(ex);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clones an existing object (Only the enumerable properties
|
||||
* of course.) use as a function..
|
||||
* var c = Clone (obj);
|
||||
* or a constructor...
|
||||
* var c = new Clone (obj);
|
||||
*/
|
||||
function Clone (obj)
|
||||
{
|
||||
var robj = new Object();
|
||||
|
||||
for (var p in obj)
|
||||
robj[p] = obj[p];
|
||||
|
||||
return robj;
|
||||
|
||||
}
|
||||
|
||||
function Copy(source, dest, overwrite)
|
||||
{
|
||||
if (!dest)
|
||||
dest = new Object();
|
||||
|
||||
for (var p in source)
|
||||
{
|
||||
if (overwrite || !(p in dest))
|
||||
dest[p] = source[p];
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*
|
||||
* matches a real object against one or more pattern objects.
|
||||
* if you pass an array of pattern objects, |negate| controls wether to check
|
||||
* if the object matches ANY of the patterns, or NONE of the patterns.
|
||||
*/
|
||||
function matchObject (o, pattern, negate)
|
||||
{
|
||||
negate = Boolean(negate);
|
||||
|
||||
function _match (o, pattern)
|
||||
{
|
||||
if (pattern instanceof Function)
|
||||
return pattern(o);
|
||||
|
||||
for (p in pattern)
|
||||
{
|
||||
var val;
|
||||
/* nice to have, but slow as molases, allows you to match
|
||||
* properties of objects with obj$prop: "foo" syntax */
|
||||
/*
|
||||
if (p[0] == "$")
|
||||
val = eval ("o." +
|
||||
p.substr(1,p.length).replace (/\$/g, "."));
|
||||
else
|
||||
*/
|
||||
val = o[p];
|
||||
|
||||
if (pattern[p] instanceof Function)
|
||||
{
|
||||
if (!pattern[p](val))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var ary = (new String(val)).match(pattern[p]);
|
||||
if (ary == null)
|
||||
return false;
|
||||
else
|
||||
o.matchresult = ary;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (!(pattern instanceof Array))
|
||||
return Boolean (negate ^ _match(o, pattern));
|
||||
|
||||
for (var i in pattern)
|
||||
if (_match (o, pattern[i]))
|
||||
return !negate;
|
||||
|
||||
return negate;
|
||||
|
||||
}
|
||||
|
||||
function matchEntry (partialName, list)
|
||||
{
|
||||
|
||||
if ((typeof partialName == "undefined") ||
|
||||
(String(partialName) == ""))
|
||||
return list;
|
||||
|
||||
var ary = new Array();
|
||||
|
||||
for (var i in list)
|
||||
{
|
||||
if (list[i].indexOf(partialName) == 0)
|
||||
ary.push (list[i]);
|
||||
}
|
||||
|
||||
return ary;
|
||||
|
||||
}
|
||||
|
||||
function encodeChar(ch)
|
||||
{
|
||||
return "%" + ch.charCodeAt(0).toString(16);
|
||||
}
|
||||
|
||||
function escapeFileName(fileName)
|
||||
{
|
||||
return fileName.replace(/[^\w\d.,#-_]/g, encodeChar);
|
||||
}
|
||||
|
||||
function getCommonPfx (list)
|
||||
{
|
||||
var pfx = list[0];
|
||||
var l = list.length;
|
||||
|
||||
for (var i = 0; i < l; i++)
|
||||
{
|
||||
for (var c = 0; c < pfx.length; ++c)
|
||||
{
|
||||
if (c >= list[i].length)
|
||||
{
|
||||
pfx = pfx.substr (0, c);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pfx[c] != list[i][c])
|
||||
pfx = pfx.substr (0, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pfx;
|
||||
|
||||
}
|
||||
|
||||
function openTopWin (url)
|
||||
{
|
||||
return openDialog (getBrowserURL(), "_blank", "chrome,all,dialog=no", url);
|
||||
}
|
||||
|
||||
function getWindowByType (windowType)
|
||||
{
|
||||
const MEDIATOR_CONTRACTID =
|
||||
"@mozilla.org/appshell/window-mediator;1";
|
||||
const nsIWindowMediator = Components.interfaces.nsIWindowMediator;
|
||||
|
||||
var windowManager =
|
||||
Components.classes[MEDIATOR_CONTRACTID].getService(nsIWindowMediator);
|
||||
|
||||
return windowManager.getMostRecentWindow(windowType);
|
||||
}
|
||||
|
||||
function renameProperty (obj, oldname, newname)
|
||||
{
|
||||
|
||||
if (oldname == newname)
|
||||
return;
|
||||
|
||||
obj[newname] = obj[oldname];
|
||||
delete obj[oldname];
|
||||
|
||||
}
|
||||
|
||||
function newObject(contractID, iface)
|
||||
{
|
||||
if (!jsenv.HAS_XPCOM)
|
||||
return null;
|
||||
|
||||
var obj = Components.classes[contractID].createInstance();
|
||||
var rv;
|
||||
|
||||
switch (typeof iface)
|
||||
{
|
||||
case "string":
|
||||
rv = obj.QueryInterface(Components.interfaces[iface]);
|
||||
break;
|
||||
|
||||
case "object":
|
||||
rv = obj.QueryInterface[iface];
|
||||
break;
|
||||
|
||||
default:
|
||||
rv = null;
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
function getContentWindow(frame)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!frame || !("contentWindow" in frame))
|
||||
return false;
|
||||
|
||||
return frame.contentWindow;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
// throws exception is contentWindow is gone
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getPriv (priv)
|
||||
{
|
||||
if (!jsenv.HAS_SECURITYMANAGER)
|
||||
return true;
|
||||
|
||||
var rv = true;
|
||||
|
||||
try
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege(priv);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
dd ("getPriv: unable to get privlege '" + priv + "': " + e);
|
||||
rv = false;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
function len(o)
|
||||
{
|
||||
var l = 0;
|
||||
|
||||
for (var p in o)
|
||||
++l;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
function keys (o)
|
||||
{
|
||||
var rv = new Array();
|
||||
|
||||
for (var p in o)
|
||||
rv.push(p);
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
function stringTrim (s)
|
||||
{
|
||||
if (!s)
|
||||
return "";
|
||||
s = s.replace (/^\s+/, "");
|
||||
return s.replace (/\s+$/, "");
|
||||
|
||||
}
|
||||
|
||||
/* the offset should be in seconds, it will be rounded to 2 decimal places */
|
||||
function formatDateOffset (offset, format)
|
||||
{
|
||||
var seconds = roundTo(offset % 60, 2);
|
||||
var minutes = Math.floor(offset / 60);
|
||||
var hours = Math.floor(minutes / 60);
|
||||
minutes = minutes % 60;
|
||||
var days = Math.floor(hours / 24);
|
||||
hours = hours % 24;
|
||||
|
||||
if (!format)
|
||||
{
|
||||
var ary = new Array();
|
||||
if (days > 0)
|
||||
ary.push (getMsg(MSG_DAYS, days));
|
||||
if (hours > 0)
|
||||
ary.push (getMsg(MSG_HOURS, hours));
|
||||
if (minutes > 0)
|
||||
ary.push (getMsg(MSG_MINUTES, minutes));
|
||||
if (seconds > 0 || offset == 0)
|
||||
ary.push (getMsg(MSG_SECONDS, seconds));
|
||||
|
||||
format = ary.join(", ");
|
||||
}
|
||||
else
|
||||
{
|
||||
format = format.replace ("%d", days);
|
||||
format = format.replace ("%h", hours);
|
||||
format = format.replace ("%m", minutes);
|
||||
format = format.replace ("%s", seconds);
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
function arrayContains (ary, elem)
|
||||
{
|
||||
return (arrayIndexOf (ary, elem) != -1);
|
||||
}
|
||||
|
||||
function arrayIndexOf (ary, elem)
|
||||
{
|
||||
for (var i in ary)
|
||||
if (ary[i] == elem)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function arrayInsertAt (ary, i, o)
|
||||
{
|
||||
|
||||
ary.splice (i, 0, o);
|
||||
|
||||
/* doh, forgot about that 'splice' thing
|
||||
if (ary.length < i)
|
||||
{
|
||||
this[i] = o;
|
||||
return;
|
||||
}
|
||||
|
||||
for (var j = ary.length; j > i; j--)
|
||||
ary[j] = ary[j - 1];
|
||||
|
||||
ary[i] = o;
|
||||
*/
|
||||
}
|
||||
|
||||
function arrayRemoveAt (ary, i)
|
||||
{
|
||||
|
||||
ary.splice (i, 1);
|
||||
|
||||
/* doh, forgot about that 'splice' thing
|
||||
if (ary.length < i)
|
||||
return false;
|
||||
|
||||
for (var j = i; j < ary.length; j++)
|
||||
ary[j] = ary[j + 1];
|
||||
|
||||
ary.length--;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
/* length should be an even number >= 6 */
|
||||
function abbreviateWord (str, length)
|
||||
{
|
||||
if (str.length <= length || length < 6)
|
||||
return str;
|
||||
|
||||
var left = str.substr (0, (length / 2) - 1);
|
||||
var right = str.substr (str.length - (length / 2) + 1);
|
||||
|
||||
return left + "..." + right;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inserts the string |hyphen| into string |str| every |pos| characters.
|
||||
* If there are any wordbreaking characters in |str| within -/+5 characters of
|
||||
* of a |pos| then the hyphen is inserted there instead, in order to produce a
|
||||
* "cleaner" break.
|
||||
*/
|
||||
function hyphenateWord (str, pos, hyphen)
|
||||
{
|
||||
if (str.length <= pos)
|
||||
return str;
|
||||
if (typeof hyphen == "undefined")
|
||||
hyphen = " ";
|
||||
|
||||
/* search for a nice place to break the word, fuzzfactor of +/-5, centered
|
||||
* around |pos| */
|
||||
var splitPos =
|
||||
str.substring(pos - 5, pos + 5).search(/[^A-Za-z0-9]/);
|
||||
|
||||
splitPos = (splitPos != -1) ? pos - 4 + splitPos : pos;
|
||||
var left = str.substr (0, splitPos);
|
||||
var right = hyphenateWord(str.substr (splitPos), pos, hyphen);
|
||||
|
||||
return left + hyphen + right;
|
||||
}
|
||||
|
||||
/*
|
||||
* Like hyphenateWord, except individual chunks of the word are returned as
|
||||
* elements of an array.
|
||||
*/
|
||||
function splitLongWord (str, pos)
|
||||
{
|
||||
if (str.length <= pos)
|
||||
return [str];
|
||||
|
||||
var ary = new Array();
|
||||
var right = str;
|
||||
|
||||
while (right.length > pos)
|
||||
{
|
||||
/* search for a nice place to break the word, fuzzfactor of +/-5,
|
||||
* centered around |pos| */
|
||||
var splitPos =
|
||||
right.substring(pos - 5, pos + 5).search(/[^A-Za-z0-9]/);
|
||||
|
||||
splitPos = (splitPos != -1) ? pos - 4 + splitPos : pos;
|
||||
ary.push(right.substr (0, splitPos));
|
||||
right = right.substr (splitPos);
|
||||
}
|
||||
|
||||
ary.push (right);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
function getRandomElement (ary)
|
||||
{
|
||||
|
||||
return ary[Math.floor(Math.random() * ary.length)];
|
||||
|
||||
}
|
||||
|
||||
function roundTo (num, prec)
|
||||
{
|
||||
|
||||
return Math.round(num * Math.pow (10, prec)) / Math.pow (10, prec);
|
||||
|
||||
}
|
||||
|
||||
function randomRange (min, max)
|
||||
{
|
||||
|
||||
if (typeof min == "undefined")
|
||||
min = 0;
|
||||
|
||||
if (typeof max == "undefined")
|
||||
max = 1;
|
||||
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
|
||||
}
|
||||
|
||||
function getStackTrace ()
|
||||
{
|
||||
|
||||
if (!jsenv.HAS_XPCOM)
|
||||
return "No stack trace available.";
|
||||
|
||||
var frame = Components.stack.caller;
|
||||
var str = "<top>";
|
||||
|
||||
while (frame)
|
||||
{
|
||||
var name = frame.name ? frame.name : "[anonymous]";
|
||||
str += "\n" + name + "@" + frame.lineNumber;
|
||||
frame = frame.caller;
|
||||
}
|
||||
|
||||
return str;
|
||||
|
||||
}
|
||||
|
||||
function getInterfaces (cls)
|
||||
{
|
||||
if (!jsenv.HAS_XPCOM)
|
||||
return null;
|
||||
|
||||
var rv = new Object();
|
||||
var e;
|
||||
|
||||
for (var i in Components.interfaces)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ifc = Components.interfaces[i];
|
||||
cls.QueryInterface(ifc);
|
||||
rv[i] = ifc;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
/* nada */
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls a named function for each element in an array, sending
|
||||
* the same parameter each call.
|
||||
*
|
||||
* @param ary an array of objects
|
||||
* @param func_name string name of function to call.
|
||||
* @param data data object to pass to each object.
|
||||
*/
|
||||
function mapObjFunc(ary, func_name, data)
|
||||
{
|
||||
/*
|
||||
* WARNING: Caller assumes resonsibility to verify ary
|
||||
* and func_name
|
||||
*/
|
||||
|
||||
for (var i in ary)
|
||||
ary[i][func_name](data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Passes each element of an array to a given function object.
|
||||
*
|
||||
* @param func a function object.
|
||||
* @param ary an array of values.
|
||||
*/
|
||||
function map(func, ary) {
|
||||
|
||||
/*
|
||||
* WARNING: Caller assumnes responsibility to verify
|
||||
* func and ary.
|
||||
*/
|
||||
|
||||
for (var i in ary)
|
||||
func(ary[i]);
|
||||
|
||||
}
|
||||
|
||||
function getSpecialDirectory(name)
|
||||
{
|
||||
if (!("directoryService" in utils))
|
||||
{
|
||||
const DS_CTR = "@mozilla.org/file/directory_service;1";
|
||||
const nsIProperties = Components.interfaces.nsIProperties;
|
||||
|
||||
utils.directoryService =
|
||||
Components.classes[DS_CTR].getService(nsIProperties);
|
||||
}
|
||||
|
||||
return utils.directoryService.get(name, Components.interfaces.nsIFile);
|
||||
}
|
||||
|
||||
function getFileFromURLSpec(url)
|
||||
{
|
||||
const FILE_CTRID = "@mozilla.org/network/protocol;1?name=file";
|
||||
const nsIFileProtocolHandler = Components.interfaces.nsIFileProtocolHandler;
|
||||
|
||||
var handler = Components.classes[FILE_CTRID].createInstance();
|
||||
handler = handler.QueryInterface(nsIFileProtocolHandler);
|
||||
return handler.getFileFromURLSpec(url);
|
||||
}
|
||||
|
||||
function getURLSpecFromFile (file)
|
||||
{
|
||||
if (!file)
|
||||
return null;
|
||||
|
||||
const IOS_CTRID = "@mozilla.org/network/io-service;1";
|
||||
const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
|
||||
|
||||
const nsIIOService = Components.interfaces.nsIIOService;
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
|
||||
if (typeof file == "string")
|
||||
{
|
||||
var fileObj =
|
||||
Components.classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
|
||||
fileObj.initWithPath(file);
|
||||
file = fileObj;
|
||||
}
|
||||
|
||||
var service = Components.classes[IOS_CTRID].getService(nsIIOService);
|
||||
/* In sept 2002, bug 166792 moved this method to the nsIFileProtocolHandler
|
||||
* interface, but we need to support older versions too. */
|
||||
if ("getURLSpecFromFile" in service)
|
||||
return service.getURLSpecFromFile(file);
|
||||
|
||||
var nsIFileProtocolHandler = Components.interfaces.nsIFileProtocolHandler;
|
||||
var fileHandler = service.getProtocolHandler("file");
|
||||
fileHandler = fileHandler.QueryInterface(nsIFileProtocolHandler);
|
||||
return fileHandler.getURLSpecFromFile(file);
|
||||
}
|
||||
@@ -1,630 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dissociated Press javascript for the jsbot
|
||||
* see: http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?query=dissociated%20press
|
||||
*/
|
||||
|
||||
DP_DEBUG = false;
|
||||
|
||||
if (DP_DEBUG)
|
||||
dpprint = dd;
|
||||
else
|
||||
dpprint = (function () {});
|
||||
|
||||
function CDPressMachine()
|
||||
{
|
||||
|
||||
this.wordPivots = new Object();
|
||||
this.cleanCounter = 0;
|
||||
this.cleanCount = 0;
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.CLEAN_CYCLE = 1000; // list will be trimmed after this many
|
||||
// or never if < 1 addPhrase()s
|
||||
CDPressMachine.CLEAN_THRESHOLD = 2; // anything <= this will be trimmed
|
||||
CDPressMachine.RANDOMIZE_DEPTH = 10; // not used yet
|
||||
CDPressMachine.MIN_PHRASE_LENGTH = 3; // requested minimum phrase length
|
||||
CDPressMachine.MAX_PHRASE_LENGTH = 8; // requested maximum phrase length
|
||||
CDPressMachine.LENGTH_RETRIES = 3 // number of retries per word
|
||||
// (to reach maxlen)
|
||||
CDPressMachine.WORD_PATTERN = /[\x21-\x7e]+/; // pattern for words
|
||||
|
||||
/**
|
||||
* Adds a phrase to the engine
|
||||
*/
|
||||
CDPressMachine.prototype.addPhrase =
|
||||
function DPM_addPhrase (strPhrase, weight)
|
||||
{
|
||||
if (strPhrase == "")
|
||||
return;
|
||||
|
||||
this.cleanCounter++;
|
||||
if ((CDPressMachine.CLEAN_CYCLE >= 1) &&
|
||||
(this.cleanCounter >= CDPressMachine.CLEAN_CYCLE))
|
||||
{
|
||||
dpprint ("** cleaning list");
|
||||
|
||||
this.cleanCounter = 0;
|
||||
this.trimList (CDPressMachine.CLEAN_THRESHOLD);
|
||||
this.cleancount++;
|
||||
}
|
||||
|
||||
strPhrase = strPhrase.toLowerCase();
|
||||
|
||||
/* split the phrase */
|
||||
var aryWordMatches = strPhrase.split (" ");
|
||||
var previousWord = aryWordMatches[aryWordMatches.length - 1];
|
||||
previousWord = previousWord.match(CDPressMachine.WORD_PATTERN);
|
||||
var nextWord = "";
|
||||
|
||||
/* loop through each word */
|
||||
for (var i=-1; i < aryWordMatches.length; i++)
|
||||
{
|
||||
var currentWord = nextWord;
|
||||
var currentWordPivot = this.wordPivots[currentWord];
|
||||
|
||||
if (typeof currentWordPivot == "undefined")
|
||||
currentWordPivot =
|
||||
(this.wordPivots[currentWord] = new CWordPivot (currentWord));
|
||||
|
||||
currentWordPivot.previousList.addLink (previousWord, weight);
|
||||
|
||||
if (i < aryWordMatches.length - 1)
|
||||
{
|
||||
nextWord = aryWordMatches[i + 1];
|
||||
if (nextWord == (String.fromCharCode(1) + "action"))
|
||||
nextWord = escape(nextWord.toUpperCase());
|
||||
else
|
||||
nextWord = nextWord.match(CDPressMachine.WORD_PATTERN);
|
||||
|
||||
if (nextWord == null)
|
||||
nextWord = ""; //this is weak
|
||||
|
||||
currentWordPivot.nextList.addLink (nextWord, weight);
|
||||
}
|
||||
else
|
||||
currentWordPivot.nextList.addLink ("");
|
||||
|
||||
previousWord = currentWord;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.addPhrases =
|
||||
function DPM_addPhrases(phrases)
|
||||
{
|
||||
|
||||
for (var i in phrases)
|
||||
this.addPhrase (phrases[i]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a phrase from the engine, starting from seedWord.
|
||||
* if dir is greater than 0, then seedWord will be the first in
|
||||
* the phrase, otherwise it will be the last
|
||||
*/
|
||||
CDPressMachine.prototype.getPhraseDirected =
|
||||
function DPM_getPhraseDirected(seedWord, dir)
|
||||
{
|
||||
var word = (typeof seedWord != "undefined") ? seedWord : "";
|
||||
var tempword = word;
|
||||
var rval = "";
|
||||
var c = 0, retry = 0;
|
||||
|
||||
dpprint ("DPM_getPhraseDirected: '" + word + "' " + dir);
|
||||
|
||||
if (typeof this.wordPivots[word] == "undefined")
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
if (typeof this.wordPivots[word] == "undefined")
|
||||
{
|
||||
dd ("** DP Error: Word '" + word + "' is not a pivot **");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dir > 0) // pick a word
|
||||
word= this.wordPivots[word].nextList.getRandomLink().link;
|
||||
else
|
||||
word= this.wordPivots[word].previousList.getRandomLink().link;
|
||||
|
||||
if (word != "") // if it isnt blank
|
||||
{
|
||||
dpprint ("DPM_getPhraseDirected: got word '" + word + "'");
|
||||
|
||||
if (c < CDPressMachine.MIN_PHRASE_LENGTH)
|
||||
retry = 0;
|
||||
|
||||
if (c > CDPressMachine.MAX_PHRASE_LENGTH)
|
||||
if (((dir > 0) && (this.wordPivots[word].nextList.list[""])) ||
|
||||
((dir <= 0) &&
|
||||
(this.wordPivots[word].previousList.list[""])))
|
||||
{
|
||||
dpprint ("DPM_getPhraseDirected: forcing last word");
|
||||
word="";
|
||||
rval = rval.substring (0, rval.length - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (dir > 0)
|
||||
rval += word + " "; // put it in the rslt
|
||||
else
|
||||
rval = word + " " + rval;
|
||||
|
||||
c++; // count the word
|
||||
}
|
||||
else // otherwise
|
||||
{
|
||||
dpprint ("DPM_getPhraseDirected: last word");
|
||||
// if it's too short
|
||||
// and were not out of retrys
|
||||
if ((c < CDPressMachine.MIN_PHRASE_LENGTH) &&
|
||||
(retry++ < CDPressMachine.LENGTH_RETRIES))
|
||||
word = tempword; // try again
|
||||
else
|
||||
// otherwise, we're done
|
||||
rval = rval.substring (0, rval.length - 1);
|
||||
}
|
||||
|
||||
tempword = word;
|
||||
|
||||
} while (word != "");
|
||||
|
||||
rval = unescape (rval);
|
||||
|
||||
return rval;
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPhraseForward =
|
||||
function DPM_getPhraseForward(firstWord)
|
||||
{
|
||||
return this.getPhraseDirected (firstWord, 1)
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPhraseReverse =
|
||||
function DPM_getPhraseReverse(lastWord)
|
||||
{
|
||||
return this.getPhraseDirected (lastWord, -1)
|
||||
}
|
||||
|
||||
/**
|
||||
* locates a random pivot by following CDPressMachine.RANDOMIZE_DEPTH
|
||||
* links from |word|.
|
||||
*/
|
||||
CDPressMachine.prototype.getRandomPivot =
|
||||
function DPM_getRandomPivot (word)
|
||||
{
|
||||
|
||||
/**
|
||||
* XXXrgg: erm, this is currently pointless, but could be neat later
|
||||
* if max phrase length's were implemented.
|
||||
*/
|
||||
if (false)
|
||||
{
|
||||
var depth = parseInt (Math.round
|
||||
(CDPressMachine.RANDOMIZE_DEPTH * Math.random()));
|
||||
word = "";
|
||||
for (var i = 0;
|
||||
i < depth, word =
|
||||
this.wordPivots[word].nextList.getRandomLink().link;
|
||||
i++); /* empty loop */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPhrase =
|
||||
function DPM_getPhrase(word)
|
||||
{
|
||||
var rval = this.getPhraseContaining (word);
|
||||
|
||||
return rval;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a phrase with |word| somewhere in it.
|
||||
*/
|
||||
CDPressMachine.prototype.getPhraseContaining =
|
||||
function DPM_getPhraseContaining(word)
|
||||
{
|
||||
if (typeof word == "undefined")
|
||||
word = "";
|
||||
else
|
||||
word = word.toString();
|
||||
|
||||
dpprint ("* DPM_getPhraseContaining: '" + word + "'");
|
||||
|
||||
var rval, spc;
|
||||
var post, pre = this.getPhraseReverse (word);
|
||||
if (word != "")
|
||||
var post = this.getPhraseForward (word);
|
||||
|
||||
dpprint ("* DPM_getPhraseContaining: pre = '" + pre + "' post = '" +
|
||||
post + "'");
|
||||
dpprint ("* DPM_getPhraseContaining: " + (post == "" && pre == ""));
|
||||
|
||||
if (word)
|
||||
{
|
||||
word = unescape (word);
|
||||
spc = " ";
|
||||
}
|
||||
else
|
||||
spc = "";
|
||||
|
||||
if (pre)
|
||||
{
|
||||
if (post)
|
||||
rval = pre + spc + word + spc + post;
|
||||
else
|
||||
rval = pre + spc + word;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (post)
|
||||
rval = word + spc + post;
|
||||
else
|
||||
if (post == "" && pre == "")
|
||||
rval = word;
|
||||
}
|
||||
|
||||
if (rval && (rval.charCodeAt(0) == 1))
|
||||
rval += String.fromCharCode(1);
|
||||
|
||||
dpprint ("* DPM_getPhraseContaining: returning '" + rval + "'");
|
||||
|
||||
return rval;
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPhraseWeight =
|
||||
function DPM_getPhraseWeight (phrase)
|
||||
{
|
||||
var ary = this.getPhraseWeights (phrase);
|
||||
var w = 0;
|
||||
|
||||
while (ary.length > 0)
|
||||
w += ary.pop();
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPhraseWeights =
|
||||
function DPM_getPhraseWeights (phrase)
|
||||
{
|
||||
var words, ary = new Array();
|
||||
var lastword = "";
|
||||
var link, pivot;
|
||||
|
||||
if (!phrase)
|
||||
return ary;
|
||||
|
||||
words = phrase.split (" ");
|
||||
|
||||
for (var i = 0; i < words.length; i++)
|
||||
{
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
lastWord = "";
|
||||
nextWord = words[i + 1];
|
||||
}
|
||||
else if (i == words.length - 1)
|
||||
{
|
||||
lastWord = words[i - 1];
|
||||
nextWord = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
lastWord = words[i - 1];
|
||||
nextWord = words[i + 1];
|
||||
}
|
||||
|
||||
pivot = this.wordPivots[words[i]];
|
||||
|
||||
if (pivot)
|
||||
{
|
||||
link = pivot.previousList.list[lastWord];
|
||||
|
||||
if (link)
|
||||
ary.push(link.weight);
|
||||
else
|
||||
ary.push(0);
|
||||
|
||||
link = pivot.nextList.list[nextWord];
|
||||
|
||||
if (link)
|
||||
ary.push(link.weight);
|
||||
else
|
||||
ary.push(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ary.push(0);
|
||||
ary.push(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ary;
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getPivot =
|
||||
function DPM_getPivot(word)
|
||||
{
|
||||
|
||||
return this.wordPivots[word];
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.trimList =
|
||||
function DPM_trimList(threshold)
|
||||
{
|
||||
var el;
|
||||
var c;
|
||||
|
||||
for (el in this.wordPivots)
|
||||
{
|
||||
c = this.wordPivots[el].nextList.trimList (threshold);
|
||||
if (c == 0)
|
||||
delete this.wordPivots[el];
|
||||
else
|
||||
{
|
||||
c = this.wordPivots[el].previousList.trimList (threshold);
|
||||
if (c == 0)
|
||||
delete this.wordPivots[el];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CDPressMachine.prototype.getMachineStatus =
|
||||
function DPM_getMachineStatus()
|
||||
{
|
||||
var o = new Object();
|
||||
|
||||
o.pivotcount = 0;
|
||||
o.linkcount = 0;
|
||||
o.linksperpivot = 0;
|
||||
o.maxweight = 0;
|
||||
o.minweight = Number.MAX_VALUE;
|
||||
o.averageweight = 0;
|
||||
o.cleancounter = this.cleanCounter;
|
||||
o.cleancount = this.cleanCount;
|
||||
|
||||
for (var pivot in this.wordPivots)
|
||||
{
|
||||
o.pivotcount++;
|
||||
|
||||
for (var link in this.wordPivots[pivot].previousList.list)
|
||||
{
|
||||
var l = this.wordPivots[pivot].previousList.list[link];
|
||||
|
||||
o.linkcount++;
|
||||
|
||||
o.maxweight = Math.max (o.maxweight, l.weight);
|
||||
o.minweight = Math.min (o.minweight, l.weight);
|
||||
|
||||
(o.averageweight == 0) ?
|
||||
o.averageweight = l.weight :
|
||||
o.averageweight = (l.weight + o.averageweight) / 2;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
o.linksperpivot = o.linkcount / o.pivotcount;
|
||||
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
function CWordPivot (word)
|
||||
{
|
||||
|
||||
dpprint ("* new pivot : '" + word + "'");
|
||||
this.word = word;
|
||||
this.nextList = new CPhraseLinkList(word, "next");
|
||||
this.previousList = new CPhraseLinkList(word, "prevoius");
|
||||
|
||||
}
|
||||
|
||||
///////////////////////
|
||||
|
||||
function CPhraseLinkList (parentWord, listID)
|
||||
{
|
||||
|
||||
if (DP_DEBUG)
|
||||
{
|
||||
this.parentWord = parentWord;
|
||||
this.listID = listID;
|
||||
}
|
||||
|
||||
this.list = new Object();
|
||||
|
||||
}
|
||||
|
||||
CPhraseLinkList.prototype.addLink =
|
||||
function PLL_addLink (link, weight)
|
||||
{
|
||||
var existingLink = this.list[link];
|
||||
|
||||
dpprint ("* adding link to '" + link + "' from '" + this.parentWord +
|
||||
"' in list '" + this.listID + "'");
|
||||
|
||||
if (typeof weight == "undefined")
|
||||
weight = 1;
|
||||
|
||||
if (typeof existingLink == "undefined")
|
||||
this.list[link] = new CPhraseLink (link, weight);
|
||||
else
|
||||
if (!(typeof existingLink.adjust == "function"))
|
||||
dd("existingLink.adjust is a '" + existingLink.adjust + "' " +
|
||||
"not a function! link is '" + link +"'");
|
||||
else
|
||||
existingLink.adjust (weight);
|
||||
|
||||
}
|
||||
|
||||
CPhraseLinkList.prototype.getRandomLink =
|
||||
function PLL_getRandomLink ()
|
||||
{
|
||||
var tot = 0;
|
||||
var lastMatch = "";
|
||||
var aryChoices = new Array();
|
||||
var fDone = false;
|
||||
|
||||
dpprint ("* PLL_getRandomLink: from '" + this.parentWord + "'");
|
||||
|
||||
for (el in this.list)
|
||||
{
|
||||
tot += this.list[el].weight;
|
||||
|
||||
for (var i = 0; i< aryChoices.length; i++)
|
||||
if (this.list[el].weight <= aryChoices[i].weight)
|
||||
break;
|
||||
|
||||
arrayInsertAt (aryChoices, i, this.list[el]);
|
||||
}
|
||||
|
||||
if (DP_DEBUG)
|
||||
for (var i = 0; i < aryChoices.length; i++)
|
||||
dpprint ("** potential word '" + aryChoices[i].link + "', weight " +
|
||||
aryChoices[i].weight);
|
||||
|
||||
var choice = parseInt (Math.round(((tot - 1) * Math.random()) + 1));
|
||||
|
||||
dpprint ("* PLL_getRandomLink: tot = " + tot + ", choice = " + choice);
|
||||
|
||||
tot = 0;
|
||||
for (i = 0; i < aryChoices.length; i++)
|
||||
{
|
||||
if ((tot += aryChoices[i].weight) >= choice)
|
||||
{
|
||||
lastMatch = aryChoices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastMatch == "")
|
||||
lastMatch = aryChoices[aryChoices.length - 1];
|
||||
|
||||
if (!lastMatch)
|
||||
lastMatch = {link: ""}
|
||||
|
||||
dpprint ("* PLL_getRandomLink: returning: " + lastMatch);
|
||||
|
||||
return lastMatch;
|
||||
|
||||
}
|
||||
|
||||
CPhraseLinkList.prototype.getListWeights =
|
||||
function PLL_getListWeights ()
|
||||
{
|
||||
var ary = new Array();
|
||||
|
||||
for (var el in this.list)
|
||||
ary.push (this.list[el].weight);
|
||||
|
||||
return ary;
|
||||
|
||||
}
|
||||
|
||||
CPhraseLinkList.prototype.getListLinks =
|
||||
function PLL_getListLinks ()
|
||||
{
|
||||
var ary = new Array();
|
||||
|
||||
for (var el in this.list)
|
||||
ary.push (this.list[el].link);
|
||||
|
||||
return ary;
|
||||
|
||||
}
|
||||
|
||||
CPhraseLinkList.prototype.trimList =
|
||||
function PLL_trimList (threshold)
|
||||
{
|
||||
var el;
|
||||
var c;
|
||||
|
||||
dpprint ("trimming '" + this.parentWord + "'s list to " + threshold);
|
||||
|
||||
for (el in this.list)
|
||||
{
|
||||
c++;
|
||||
|
||||
if (this.list[el].weight <= threshold)
|
||||
{
|
||||
dpprint ("removing '" + el + "' from '" + this.parentWord + "'s '" +
|
||||
this.listID + "' list, because it's weight is " +
|
||||
this.list[el].weight);
|
||||
|
||||
delete this.list[el];
|
||||
c--;
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
|
||||
function CPhraseLink (link, weight)
|
||||
{
|
||||
if (typeof weight == "undefined")
|
||||
this.weight = 1;
|
||||
else
|
||||
this.weight = weight;
|
||||
|
||||
this.link = link;
|
||||
|
||||
}
|
||||
|
||||
CPhraseLink.prototype.adjust =
|
||||
function PL_adjust(weight)
|
||||
{
|
||||
|
||||
if ((this.weight += weight) < 1)
|
||||
this.weight = 1;
|
||||
|
||||
}
|
||||
|
||||
CPhraseLink.prototype.weight =
|
||||
function PL_weight ()
|
||||
{
|
||||
|
||||
return this.weight;
|
||||
|
||||
}
|
||||
@@ -1,397 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Sample bot
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* depends on utils.js, events.js, connection.js, http.js, and irc.js
|
||||
*
|
||||
* Sample client for the irc library.
|
||||
*/
|
||||
|
||||
var LIB_PATH = "../lib/";
|
||||
|
||||
bot = new Object();
|
||||
bot.ownerPatterns = new Array();
|
||||
bot.personality = new Object();
|
||||
bot.personality.hooks = new Array();
|
||||
bot.prefix = "!js ";
|
||||
|
||||
function loadDeps()
|
||||
{
|
||||
|
||||
load (LIB_PATH + "utils.js");
|
||||
load (LIB_PATH + "events.js");
|
||||
load (LIB_PATH + "connection.js");
|
||||
load (LIB_PATH + "http.js");
|
||||
load (LIB_PATH + "dcc.js");
|
||||
load (LIB_PATH + "irc.js");
|
||||
load (LIB_PATH + "irc-debug.js");
|
||||
|
||||
if (!connection_init(LIB_PATH))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function initStatic()
|
||||
{
|
||||
|
||||
if (jsenv.HAS_RHINO)
|
||||
gc = java.lang.System.gc;
|
||||
|
||||
CIRCNetwork.prototype.INITIAL_NICK = "jsbot";
|
||||
CIRCNetwork.prototype.INITIAL_NAME = "XPJSBot";
|
||||
CIRCNetwork.prototype.INITIAL_DESC = "XPCOM Javascript bot";
|
||||
CIRCNetwork.prototype.INITIAL_CHANNEL = "#jsbot";
|
||||
|
||||
CIRCNetwork.prototype.stayingPower = true;
|
||||
CIRCNetwork.prototype.on433 = my_433;
|
||||
CIRCChannel.prototype.onPrivmsg = my_chan_privmsg;
|
||||
CIRCUser.prototype.onDCCChat = my_user_dccchat;
|
||||
CDCCChat.prototype.onRawData = my_dccchat_rawdata;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* One time initilization stuff
|
||||
*/
|
||||
function init(obj)
|
||||
{
|
||||
|
||||
obj.eventPump = new CEventPump (100);
|
||||
|
||||
obj.networks = new Object();
|
||||
obj.networks["hybridnet"] =
|
||||
new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}],
|
||||
obj.eventPump);
|
||||
|
||||
obj.networks["moznet"] =
|
||||
new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}],
|
||||
obj.eventPump);
|
||||
|
||||
obj.networks["efnet"] =
|
||||
new CIRCNetwork ("efnet", [
|
||||
{name: "irc.mcs.net", port: 6667},
|
||||
{name: "irc.cs.cmu.edu", port: 6667}],
|
||||
obj.eventPump);
|
||||
|
||||
obj.primNet = obj.networks["efnet"];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Kick off the mainloop for the first time
|
||||
*/
|
||||
function go()
|
||||
{
|
||||
|
||||
if (!loadDeps())
|
||||
return false;
|
||||
initStatic();
|
||||
init(bot);
|
||||
if (DEBUG)
|
||||
/* hook all events EXCEPT server.poll and *.event-end types
|
||||
* (the 4th param inverts the match) */
|
||||
bot.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/},
|
||||
{type: "event-end"}], event_tracer,
|
||||
"event-tracer", true /* negate */);
|
||||
|
||||
if (typeof initPersonality == "function")
|
||||
initPersonality();
|
||||
|
||||
bot.primNet.connect();
|
||||
rego();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* If you didnt compile libjs with JS_HAS_ERROR_EXCEPTIONS, any error the
|
||||
* bot encounters will exit the mainloop and drop you back to a shell ("js>")
|
||||
* prompt. You can continue the mainloop by executing this function.
|
||||
*/
|
||||
function rego()
|
||||
{
|
||||
|
||||
/* mainloop */
|
||||
while (bot.eventPump.queue.length > 0)
|
||||
{
|
||||
bot.eventPump.stepEvents();
|
||||
if (typeof gc == "function")
|
||||
{
|
||||
if ((typeof bot.lastGc == "undefined") ||
|
||||
(Number(new Date()) - bot.lastGc > 60000))
|
||||
{
|
||||
gc();
|
||||
bot.lastGc = Number(new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
dd ("No events to process.");
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function addOwner (pattern)
|
||||
{
|
||||
bot.ownerPatterns.push (pattern);
|
||||
}
|
||||
|
||||
function userIsOwner (user)
|
||||
{
|
||||
if (!user.host)
|
||||
{
|
||||
/* we havn't got any information on this user yet. They havn't spoken
|
||||
* yet, and we havn't /whoi's them yet. Say no for now, but do the
|
||||
* /whois so we'll know for sure next time.
|
||||
*/
|
||||
if (user.TYPE == "IRCChanUser")
|
||||
user.parent.parent.sendData ("WHOIS " + user.nick + "\n");
|
||||
else
|
||||
user.parent.sendData ("WHOIS " + user.nick + "\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
var userString = user.nick + "!" + user.name + "@" + user.host;
|
||||
dd ("userIsOwner: checking userString `" + userString + "' against:");
|
||||
|
||||
for (var p in bot.ownerPatterns)
|
||||
if (userString.search(bot.ownerPatterns[p]) != -1)
|
||||
{
|
||||
dd (String(bot.ownerPatterns[p]) + " passed.");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
dd (String(bot.ownerPatterns[p]) + " fails.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function psn_isAddressedToMe (e)
|
||||
{
|
||||
if (!e.server)
|
||||
return false;
|
||||
|
||||
if ((e.type.search(/privmsg|ctcp-action/)) || (e.set != "channel") ||
|
||||
(e.meat.indexOf(bot.prefix) == 0))
|
||||
return false;
|
||||
|
||||
/*
|
||||
dd ("-*- checking to see if message '" + e.meat + "' is addressed to me.");
|
||||
*/
|
||||
|
||||
var regex = new RegExp ("^\\s*" + e.server.me.nick + "\\W+(.*)", "i");
|
||||
var ary = e.meat.match(regex);
|
||||
|
||||
//dd ("address match: " + ary);
|
||||
|
||||
if (ary != null)
|
||||
{
|
||||
e.statement = ary[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
bot.personality.dp.addPhrase (e.meat);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
function psn_onAddressedMsg (e)
|
||||
{
|
||||
|
||||
bot.eventPump.onHook (e, bot.personality.hooks);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook =
|
||||
function psn_addhook (pattern, f, name, neg, enabled)
|
||||
{
|
||||
if (pattern instanceof RegExp)
|
||||
pattern = {statement: pattern};
|
||||
|
||||
return bot.eventPump.addHook (pattern, f, name, neg, enabled,
|
||||
bot.personality.hooks);
|
||||
|
||||
}
|
||||
|
||||
function bot_eval(e, script)
|
||||
{
|
||||
try
|
||||
{
|
||||
var v = eval(script);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
e.replyTo.say(e.user.nick + ": " + String(ex));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof (v) != "undefined")
|
||||
{
|
||||
if (v != null)
|
||||
v = String(v);
|
||||
else
|
||||
v = "null";
|
||||
|
||||
var rsp = e.user.nick + ", your result is,";
|
||||
|
||||
if (v.indexOf ("\n") != -1)
|
||||
rsp += "\n";
|
||||
else
|
||||
rsp += " ";
|
||||
|
||||
e.replyTo.say (rsp + v);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The following my_* are attached to their proper objects in the init()
|
||||
* function. This is because the CIRC* objects are not defined at load time
|
||||
* (they get defined when loadDeps() loads the irc library) and so connecting
|
||||
* them here would cause an error.
|
||||
*/
|
||||
|
||||
/*
|
||||
* What to do when a privmsg is recieved on a channel
|
||||
*/
|
||||
function my_chan_privmsg (e)
|
||||
{
|
||||
var user = e.user;
|
||||
var meat = e.meat;
|
||||
if (meat.indexOf(bot.prefix) == 0 && userIsOwner(user))
|
||||
{
|
||||
/* if last char is a continuation character, then... */
|
||||
if (meat[meat.length - 1] == '\\') {
|
||||
user.accumulatedScript = meat.substring(bot.prefix.length,
|
||||
meat.length - 1);
|
||||
return false; // prevent other hooks from processing this...
|
||||
}
|
||||
else
|
||||
{
|
||||
return bot_eval(e, meat.substring(bot.prefix.length,
|
||||
meat.length));
|
||||
}
|
||||
}
|
||||
else if ((typeof(user.accumulatedScript) != "undefined") &&
|
||||
userIsOwner(user))
|
||||
/* if we were accumulating a message, add here,
|
||||
* and finish if not ends with '\'. */
|
||||
{
|
||||
var lastLine = (meat[meat.length - 1] != '\\');
|
||||
var line = meat.substring(0, meat.length - (lastLine ? 0 : 1));
|
||||
user.accumulatedScript += line;
|
||||
if (lastLine)
|
||||
{
|
||||
var script = user.accumulatedScript;
|
||||
delete user.accumulatedScript;
|
||||
return bot_eval(e, script);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* What to do when a dcc chat request reaches a user object
|
||||
*/
|
||||
function my_user_dccchat (e)
|
||||
{
|
||||
|
||||
if (!e.user.canDCC)
|
||||
{
|
||||
e.user.notice ("\01DCC REJECT CHAT chat\01");
|
||||
return false;
|
||||
}
|
||||
|
||||
var c = new CDCCChat (bot.eventPump);
|
||||
|
||||
if (!c.connect (e.user.host, e.port))
|
||||
{
|
||||
e.user.notice ("\01DCC REJECT CHAT chat\01");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* What to do when our requested nickname is in use
|
||||
*/
|
||||
function my_433 (e)
|
||||
{
|
||||
|
||||
if (e.params[2] != CIRCNetwork.prototype.INITIAL_NICK)
|
||||
{
|
||||
/* server didn't like the last nick we tried, probably too long.
|
||||
* not much more we can do, bail out. */
|
||||
e.server.disconnect();
|
||||
}
|
||||
|
||||
CIRCNetwork.prototype.INITIAL_NICK += "_";
|
||||
e.server.sendData ("nick " + CIRCNetwork.prototype.INITIAL_NICK + "\n");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* What to do when raw data is recieved on a dcc chat connection
|
||||
*/
|
||||
function my_dccchat_rawdata (e)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var v = eval(e.data);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
this.say (String(ex));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof (v) != "undefined")
|
||||
{
|
||||
if (v != null)
|
||||
v = String(v);
|
||||
else
|
||||
v = "null";
|
||||
|
||||
this.say (v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper around CHTTPDoc to make is simpler to use
|
||||
*/
|
||||
function loadHTTP (host, path, onComplete)
|
||||
{
|
||||
var htdoc = new CHTTPDoc (host, path);
|
||||
|
||||
htdoc.onComplete = onComplete;
|
||||
htdoc.get (bot.eventPump);
|
||||
|
||||
return htdoc;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
*/
|
||||
|
||||
bot.personality.guessPrefixes = ["I guess ", "maybe ", "probably ", "I think ",
|
||||
"could be that ", "", ""];
|
||||
bot.personality.guessActionPrefixes = ["guesses ", "postulates ", "figures ",
|
||||
"tries ","pretends ", "", ""];
|
||||
|
||||
|
||||
function initMingus ()
|
||||
{
|
||||
|
||||
addOwner (/rginda.*!.*@adsl-63-198-63-20\.dsl\.snfc21\.pacbell\.net$/i);
|
||||
addOwner (/rginda.*!.*@.*netscape\.com$/i);
|
||||
addOwner (/ssieb.*!.*@.*pyr\.ec\.gc\.ca$/i);
|
||||
addOwner (/ssieb.*!.*@.*wave\.home\.com$/i);
|
||||
addOwner (/garyc.*!.*@.*ihug\.co\.nz$/i);
|
||||
|
||||
bot.primNet = bot.networks["moznet"];
|
||||
|
||||
load ("DP.js");
|
||||
CIRCNetwork.prototype.INITIAL_NICK = "mingus";
|
||||
CIRCNetwork.prototype.INITIAL_NAME = "mingus";
|
||||
CIRCNetwork.prototype.INITIAL_DESC = "real men do it with prototypes";
|
||||
CIRCNetwork.prototype.INITIAL_CHANNEL = "#chatzilla";
|
||||
|
||||
CIRCChannel.prototype.onJoin =
|
||||
function my_chan_join (e) {
|
||||
if (userIsOwner(e.user))
|
||||
e.user.setOp(true);
|
||||
}
|
||||
|
||||
bot.eventPump.addHook (psn_isAddressedToMe, psn_onAddressedMsg,
|
||||
"addressed-to-me-hook");
|
||||
bot.personality.dp = new CDPressMachine();
|
||||
/*
|
||||
bot.personality.dp.addPhrase ("I am " +
|
||||
CIRCNetwork.prototype.INITIAL_NICK +
|
||||
", hear me roar.");
|
||||
*/
|
||||
bot.personality.dp.addPhrase ("\01ACTION is back.");
|
||||
|
||||
/* dp hooks start */
|
||||
|
||||
var f = function (e)
|
||||
{
|
||||
var catchall = (e.hooks[e.hooks.length - 1].name == "catchall");
|
||||
var answer = "";
|
||||
|
||||
if (catchall)
|
||||
{
|
||||
var ary = e.statement.split(" ");
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
answer =
|
||||
bot.personality.dp.getPhraseContaining(getRandomElement(ary));
|
||||
if (answer)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!answer)
|
||||
answer = bot.personality.dp.getPhrase();
|
||||
|
||||
if (answer[answer.length - 1] == "\01")
|
||||
{
|
||||
if (answer[0] != "\01")
|
||||
if (catchall)
|
||||
answer = "\01ACTION " +
|
||||
getRandomElement(bot.personality.guessActionPrefes) +
|
||||
answer;
|
||||
else
|
||||
answer = "\01ACTION " + answer;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!answer)
|
||||
answer = "I don't know anything";
|
||||
if (catchall)
|
||||
answer = getRandomElement(bot.personality.guessPrefixes) +
|
||||
answer;
|
||||
}
|
||||
|
||||
if (answer[0] != "\01")
|
||||
e.replyTo.say (e.user.properNick + ", " + answer);
|
||||
else
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/* first hook added is last checked */
|
||||
bot.personality.addHook (/.*/i, f, "catchall");
|
||||
bot.personality.addHook (/speak$/i, f, "speak");
|
||||
bot.personality.addHook (/talk$/i, f, "hook");
|
||||
bot.personality.addHook (/say something$/i, f, "say-something");
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var subject = e.matchresult[1].match(CDPressMachine.WORD_PATTERN);
|
||||
if (subject == null)
|
||||
subject = "";
|
||||
else
|
||||
subject = subject.toString();
|
||||
|
||||
var answer =
|
||||
bot.personality.dp.getPhraseContaining (escape(subject.toLowerCase()));
|
||||
|
||||
if (!answer)
|
||||
answer = "I dont know anything about " + e.matchresult[1];
|
||||
|
||||
if (answer.charCodeAt (0) != 1)
|
||||
e.replyTo.say (e.user.properNick + ", " + answer);
|
||||
else
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/speak about (\S+)/i, f);
|
||||
bot.personality.addHook (/talk about (\S+)/i, f);
|
||||
bot.personality.addHook (/say something about (\S+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var answer = bot.personality.dp.getPhraseContaining ("%01ACTION");
|
||||
|
||||
if (!answer)
|
||||
answer = "I can't do a thing.";
|
||||
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/do something/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var ary = bot.personality.dp.getPhraseWeights (e.matchresult[1]);
|
||||
var c = bot.personality.dp.getPhraseWeight (e.matchresult[1]);
|
||||
|
||||
e.replyTo.say (e.user.properNick + ", that phrase weighs " + c + ": " + ary);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/weigh (.+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var word = e.matchresult[1].toLowerCase();
|
||||
var pivot = bot.personality.dp.getPivot(word);
|
||||
var result = "";
|
||||
|
||||
if (pivot)
|
||||
{
|
||||
var list, w, l;
|
||||
|
||||
list = pivot.previousList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: previous list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( "`" + l[i] + "'" + w[i] + " " );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
result += ( "[" + word + "]" );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
list = pivot.nextList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: next list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( " `" + l[i] + "'" + w[i] );
|
||||
|
||||
}
|
||||
else
|
||||
result = "- [" + word + "] -";
|
||||
|
||||
e.replyTo.say (result);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook(/pivot (.*)/i, f);
|
||||
|
||||
/* dp hooks end */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
print ("I can hear you.");
|
||||
e.replyTo.say (e.user.properNick + ", yes, I am.");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/are you alive(\?)?/i, f);
|
||||
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner(e.user))
|
||||
{
|
||||
e.replyTo.say ("nope.");
|
||||
return;
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
|
||||
e.server.sendData ("join " + chan + "\n");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/join\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
{
|
||||
e.channel.say ("nope.");
|
||||
return false;
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
|
||||
e.server.sendData ("part " + chan + "\n");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/part\s+(\S+)\.*/i, f);
|
||||
bot.personality.addHook (/leave\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say ("mmmmmmm. Thanks " + e.user.properNick + ".");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/botsnack/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.act ("blushes");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/you rock/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.act ("hugs " + e.user.properNick);
|
||||
else
|
||||
e.replyTo.act ("hugs " + e.matchresult[1]);
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/hug (.*)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.say (e.user.properNick + ", :*");
|
||||
else
|
||||
e.replyTo.say (e.matchresult[1] + ", :*");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/kiss (\w+)/, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (e.user.properNick + ", I'll try :(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(shut up)|(shaddup)|(be quiet)|(keep quiet)|(sssh)|(stfu)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
e.replyTo.say ("No.");
|
||||
else
|
||||
{
|
||||
for (var n in bot.networks)
|
||||
bot.networks[n].quit("Goodnight.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(go to bed)|(go to sleep)|(sleep)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":)");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(smile)|(rotfl)|(lmao)|(rotflmao)|(look happy)|(you(.)?re smart)/i, f);
|
||||
/* (/(smile)|(rotfl)|(lmao)|(rotflmao)|(you(.)?re funny)|(look happy)|(you(.)?re smart)/i, f); */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(frown)|(don(.)?t like you)|(look sad)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (">:|");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look mad)|(beat you up)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":/");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look confused)|(i like windows)/i, f);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
*/
|
||||
|
||||
if (typeof escape == "undefined")
|
||||
escape = unescape = function (s) {return s;}
|
||||
|
||||
|
||||
function runMyBot()
|
||||
{
|
||||
load ("ircbot.js");
|
||||
go();
|
||||
}
|
||||
|
||||
function initPersonality()
|
||||
{
|
||||
load ("mingus.js");
|
||||
initMingus();
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
function test_matchObject()
|
||||
{
|
||||
var f = true;
|
||||
|
||||
obj1 = {foo:"hey", bar:"ho"}
|
||||
obj2 = {a:"1", b:"2"}
|
||||
|
||||
p1 = {foo:"hey"}
|
||||
p2 = {bar:"ho"}
|
||||
p3 = {a:"1"}
|
||||
p4 = {b:"2"}
|
||||
|
||||
/* true, single pattern, and it matches */
|
||||
f &= matchObject (obj1, p1);
|
||||
/* false, single pattern matches, negated */
|
||||
f &= !matchObject (obj1, p1, true);
|
||||
|
||||
/* false, single pattern doesnt match*/
|
||||
f &= !matchObject (obj1, p3);
|
||||
/* true, single pattern doesnt match, negated */
|
||||
f &= matchObject (obj1, p3, true);
|
||||
|
||||
/* true, p1 matches */
|
||||
f &= matchObject (obj1, [p1, p3]);
|
||||
/* false, p1 matches, negated */
|
||||
f &= !matchObject (obj1, [p1, p3], true);
|
||||
|
||||
/* true, both paterns match */
|
||||
f &= matchObject (obj2, [p3, p4]);
|
||||
/* false, both patterns match, negated */
|
||||
f &= !matchObject (obj2, [p3, p4], true);
|
||||
|
||||
/* false, neither pattern matches */
|
||||
f &= !matchObject (obj1, [p3, p4]);
|
||||
/* true, neither pattern matches, negated */
|
||||
f &= matchObject (obj1, [p3, p4], true);
|
||||
|
||||
return Boolean(f); /* you've got to find any problems by hand :) */
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
function rainbow(str)
|
||||
{
|
||||
str = String(str);
|
||||
var c = str.length;
|
||||
var rv = "";
|
||||
|
||||
for (var i = 0; i < c; i++)
|
||||
{
|
||||
var color = randomRange (2, 6);
|
||||
rv += unescape ("%03" + color + str[i]);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
function fade(str)
|
||||
{
|
||||
var colors = new Array(1, 14, 10, 15, 0);
|
||||
var cIndex = 0;
|
||||
var msg = "";
|
||||
for (i = 0; i < str.length; i++)
|
||||
{
|
||||
msg += "%03" + colors[cIndex] + str[i];
|
||||
if ((++cIndex) == 5)
|
||||
{
|
||||
cIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return unescape(msg);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
- The contents of this file are subject to the Mozilla Public
|
||||
- License Version 1.1 (the "License"); you may not use this file
|
||||
- except in compliance with the License. You may obtain a copy of
|
||||
- the License at http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS
|
||||
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
- implied. See the License for the specific language governing
|
||||
- rights and limitations under the License.
|
||||
-
|
||||
- The Original Code is JSIRC Test Client #3
|
||||
-
|
||||
- The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
- Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
- Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
- Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert Ginda, rginda@ndcico.com, original author
|
||||
- Josh Soref, timeless@mac.com, international support
|
||||
- Chiaki Koufugata chiaki@mozilla.gr.jp UI i18n
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/chatzilla.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://chatzilla/skin/chatzilla.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://chatzilla/content/scripts.xul"?>
|
||||
<?xul-overlay href="chrome://chatzilla/content/menus.xul"?>
|
||||
|
||||
<window id="chatzilla-window"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical" onload="onLoad();" onunload="onUnload();"
|
||||
onclose="return onClose();" onmouseover="onMouseOver(event);"
|
||||
persist="width height screenX screenY sizemode" windowtype="irc:chatzilla">
|
||||
|
||||
<overlaytarget id="scripts-overlay-target"/>
|
||||
<overlaytarget id="menu-overlay-target"/>
|
||||
|
||||
<vbox id="outer-box" flex="1">
|
||||
<vbox id="upper-box" flex="1">
|
||||
<hbox id="tabpanels-contents-box" flex="1">
|
||||
<vbox id="user-list-box" width="20%" persist="collapsed width">
|
||||
|
||||
<tree id="user-list" container="true" datasources="rdf:null" flex="1"
|
||||
containment="http://home.netscape.com/NC-irc#chanuser"
|
||||
context="context:userlist">
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<content uri="?container"/>
|
||||
<member container="?container" child="?member"/>
|
||||
</conditions>
|
||||
|
||||
<bindings>
|
||||
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#op" object="?op"/>
|
||||
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#voice" object="?voice"/>
|
||||
<binding subject="?member" predicate="http://home.netscape.com/NC-irc#nick" object="?nick"/>
|
||||
</bindings>
|
||||
|
||||
<action>
|
||||
<treechildren>
|
||||
<treeitem uri="?member" flex="1" properties="op-?op voice-?voice">
|
||||
<treerow>
|
||||
<treecell properties="state-?op"/>
|
||||
<treecell properties="state-?voice"/>
|
||||
<treecell label="?nick"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecols>
|
||||
<treecol id="usercol-op" label="O"
|
||||
persist="hidden sortDirection"
|
||||
onclick="return onSortCol('usercol-op')"
|
||||
resource="http://home.netscape.com/NC-irc#op" width="25"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="usercol-voice" label="V"
|
||||
persist="hidden sortDirection"
|
||||
onclick="return onSortCol('usercol-voice')"
|
||||
resource="http://home.netscape.com/NC-irc#voice" width="25"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="usercol-nick" label="Nick" flex="1"
|
||||
persist="sortDirection" ignoreincolumnpicker="true"
|
||||
onclick="return onSortCol('usercol-nick')"
|
||||
resource="http://home.netscape.com/NC-irc#nick"/>
|
||||
</treecols>
|
||||
</tree>
|
||||
|
||||
</vbox> <!-- user-list-box -->
|
||||
|
||||
<splitter id="main-splitter" collapse="before" persist="collapsed left">
|
||||
<grippy/>
|
||||
</splitter>
|
||||
|
||||
<vbox flex="1">
|
||||
<deck id="output-deck" flex="1"/>
|
||||
</vbox>
|
||||
|
||||
</hbox> <!-- tabpanels-contents-box -->
|
||||
|
||||
<hbox id="tabstrip-box" flex="0" crop="right">
|
||||
<scrollbox id="view-tabs" persist="collapsed" orient="horizontal"
|
||||
flex="1">
|
||||
|
||||
<hbox>
|
||||
<tabs class="tabs-bottom" id="views-tbar-inner" flex="1" crop="right">
|
||||
<tab collapsed="true"/> <!-- dummy tab to keep the freaking xbl from
|
||||
causing an exception -->
|
||||
</tabs>
|
||||
</hbox>
|
||||
</scrollbox>
|
||||
</hbox>
|
||||
|
||||
</vbox> <!-- upper-box -->
|
||||
|
||||
<splitter id="input-splitter" orient="vertical" collapse="after"
|
||||
collapsed="true"/>
|
||||
|
||||
<hbox id="input-widgets">
|
||||
<text id="server-nick" value=""/>
|
||||
<hbox id="multiline-box" flex="1" collapsed="true">
|
||||
<textbox id="multiline-input" multiline="true" flex="1" height="100px"
|
||||
class="multiline-input-widget" onfocus="onInputFocus();"/>
|
||||
<vbox>
|
||||
<toolbarbutton id="button-input" flex="1"
|
||||
oncommand="onMultilineSend(event);"
|
||||
tooltiptext="&multiline-send.tooltip;" />
|
||||
<toolbarbutton id="button-multiline-contract"
|
||||
oncommand="dispatch('pref multiline false');"
|
||||
tooltiptext="&multiline-contract.tooltip;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox id="singleline-box" flex="1" collapsed="true">
|
||||
<textbox id="input" class="input-widget" flex="1" autostretch="true"
|
||||
onfocus="onInputFocus();"/>
|
||||
<toolbarbutton id="button-multiline-expand"
|
||||
oncommand="dispatch('pref multiline true');"
|
||||
tooltiptext="&multiline-expand.tooltip;"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</vbox> <!-- outer-box -->
|
||||
|
||||
<overlaytarget id="statusbar-overlay-target"/>
|
||||
|
||||
</window>
|
||||
@@ -1,7 +0,0 @@
|
||||
function toIRC()
|
||||
{
|
||||
|
||||
toOpenWindowByType("irc:chatzilla", "chrome://chatzilla/content/chatzilla.xul");
|
||||
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://chatzilla/locale/chatzillaOverlay.dtd" >
|
||||
|
||||
<!-- This is the overlay that addes "Chatzilla" to the (global) task menu. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://chatzilla/skin/chatzillaOverlay.css" type="text/css"?>
|
||||
|
||||
<overlay id="ChatzillaTaskMenuID"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://chatzilla/content/chatzillaOverlay.js"/>
|
||||
|
||||
<keyset id="tasksKeys">
|
||||
<key id="key_irc" key="&ircCmd.commandkey;" command="Tasks:IRC" modifiers="accel"/>
|
||||
</keyset>
|
||||
|
||||
<commandset id="tasksCommands">
|
||||
<command id="Tasks:IRC" oncommand="toIRC();"/>
|
||||
</commandset>
|
||||
|
||||
<menupopup id="windowPopup">
|
||||
<menuitem
|
||||
label="&ircCmd.label;"
|
||||
accesskey="&ircCmd.accesskey;"
|
||||
key="key_irc"
|
||||
command="Tasks:IRC"
|
||||
id="tasksMenuIRC"
|
||||
class="menuitem-iconic"
|
||||
insertafter="tasksMenuAddressBook"/>
|
||||
</menupopup>
|
||||
|
||||
<statusbarpanel id="component-bar">
|
||||
<toolbarbutton class="taskbutton" id="mini-irc" oncommand="toIRC()"
|
||||
position="5" tooltiptext="&ircCmd.label;"/>
|
||||
</statusbarpanel>
|
||||
|
||||
</overlay>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:chatzilla"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:chatzilla"
|
||||
chrome:displayName="Chatzilla"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:localeVersion="1.5b"
|
||||
chrome:name="chatzilla">
|
||||
</RDF:Description>
|
||||
|
||||
<!-- overlay information -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://editor/content/editorTasksOverlay.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://editor/content/editorTasksOverlay.xul">
|
||||
<RDF:li>chrome://chatzilla/content/chatzillaOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
|
||||
<RDF:li>chrome://chatzilla/content/prefsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
||||
@@ -1,3 +0,0 @@
|
||||
/* empty css file. rules are appended to this dynamically */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,277 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
function initMenus()
|
||||
{
|
||||
function isMotif(name)
|
||||
{
|
||||
return "client.prefs['motif.current'] == " +
|
||||
"client.prefs['motif." + name + "']";
|
||||
};
|
||||
|
||||
function onMenuCommand (event, window)
|
||||
{
|
||||
var params;
|
||||
var commandName = event.originalTarget.getAttribute("commandname");
|
||||
if ("cx" in client.menuManager && client.menuManager.cx)
|
||||
{
|
||||
client.menuManager.cx.sourceWindow = window;
|
||||
params = client.menuManager.cx;
|
||||
}
|
||||
else
|
||||
{
|
||||
params = { sourceWindow: window };
|
||||
}
|
||||
|
||||
dispatch (commandName, params);
|
||||
|
||||
delete client.menuManager.cx;
|
||||
};
|
||||
|
||||
client.onMenuCommand = onMenuCommand;
|
||||
client.menuSpecs = new Object();
|
||||
var menuManager = new MenuManager(client.commandManager,
|
||||
client.menuSpecs,
|
||||
getCommandContext,
|
||||
"client.onMenuCommand(event, window);");
|
||||
client.menuManager = menuManager;
|
||||
|
||||
client.menuSpecs["maintoolbar"] = {
|
||||
items:
|
||||
[
|
||||
["disconnect"],
|
||||
["quit"],
|
||||
["part"]
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["mainmenu:file"] = {
|
||||
label: MSG_MNU_FILE,
|
||||
getContext: getDefaultContext,
|
||||
items:
|
||||
[
|
||||
["delete-view", {enabledif: "client.viewsArray.length > 1"}],
|
||||
["quit"],
|
||||
["disconnect"],
|
||||
["-"],
|
||||
[navigator.platform.search(/win/i) == -1 ?
|
||||
"quit-mozilla" : "exit-mozilla"]
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["popup:motifs"] = {
|
||||
label: MSG_MNU_MOTIFS,
|
||||
items:
|
||||
[
|
||||
["motif-default",
|
||||
{type: "checkbox",
|
||||
checkedif: isMotif("default")}],
|
||||
["motif-dark",
|
||||
{type: "checkbox",
|
||||
checkedif: isMotif("dark")}],
|
||||
["motif-light",
|
||||
{type: "checkbox",
|
||||
checkedif: isMotif("light")}],
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["mainmenu:view"] = {
|
||||
label: MSG_MNU_VIEW,
|
||||
getContext: getDefaultContext,
|
||||
items:
|
||||
[
|
||||
[">popup:showhide"],
|
||||
["-"],
|
||||
["toggle-oas",
|
||||
{type: "checkbox",
|
||||
checkedif: "isStartupURL(cx.sourceObject.getURL())"}],
|
||||
["clear-view"],
|
||||
["delete-view",
|
||||
{visibleif: "!cx.channel || !cx.channel.active",
|
||||
enabledif: "client.viewsArray.length > 1"}],
|
||||
["leave", {visibleif: "cx.channel && cx.channel.active"}],
|
||||
["-"],
|
||||
[">popup:motifs"],
|
||||
["toggle-ccm",
|
||||
{type: "checkbox",
|
||||
checkedif: "client.prefs['collapseMsgs']"}],
|
||||
["toggle-copy",
|
||||
{type: "checkbox",
|
||||
checkedif: "client.prefs['copyMessages']"}]
|
||||
]
|
||||
};
|
||||
|
||||
/* Mac expects a help menu with this ID, and there is nothing we can do
|
||||
* about it. */
|
||||
client.menuSpecs["mainmenu:help"] = {
|
||||
label: MSG_MNU_HELP,
|
||||
domID: "menu_Help",
|
||||
items:
|
||||
[
|
||||
["about"],
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["popup:showhide"] = {
|
||||
label: MSG_MNU_SHOWHIDE,
|
||||
items:
|
||||
[
|
||||
["tabstrip",
|
||||
{type: "checkbox",
|
||||
checkedif: "isVisible('view-tabs')"}],
|
||||
["header",
|
||||
{type: "checkbox",
|
||||
checkedif: "cx.sourceObject.prefs['displayHeader']"}],
|
||||
["userlist",
|
||||
{type: "checkbox",
|
||||
checkedif: "isVisible('user-list-box')"}],
|
||||
["statusbar",
|
||||
{type: "checkbox",
|
||||
checkedif: "isVisible('status-bar')"}],
|
||||
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["popup:opcommands"] = {
|
||||
label: MSG_MNU_OPCOMMANDS,
|
||||
items:
|
||||
[
|
||||
["op", {enabledif: "cx.channel.iAmOp() && !cx.user.isOp"}],
|
||||
["deop", {enabledif: "cx.channel.iAmOp() && cx.user.isOp"}],
|
||||
["voice", {enabledif: "cx.channel.iAmOp() && !cx.user.isVoice"}],
|
||||
["devoice", {enabledif: "cx.channel.iAmOp() && cx.user.isVoice"}],
|
||||
["-"],
|
||||
["kick", {enabledif: "cx.channel.iAmOp()"}],
|
||||
["kick-ban", {enabledif: "cx.channel.iAmOp()"}]
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
client.menuSpecs["context:userlist"] = {
|
||||
getContext: getUserlistContext,
|
||||
items:
|
||||
[
|
||||
[">popup:opcommands"],
|
||||
["whois"],
|
||||
["query"],
|
||||
["version"],
|
||||
]
|
||||
};
|
||||
|
||||
var urlenabled = "has('url') && cx.url.search(/^irc:/i) == -1";
|
||||
|
||||
client.menuSpecs["context:messages"] = {
|
||||
getContext: getMessagesContext,
|
||||
items:
|
||||
[
|
||||
["goto-url", {enabledif: urlenabled}],
|
||||
["goto-url-newwin", {enabledif: urlenabled}],
|
||||
["goto-url-newtab", {enabledif: urlenabled}],
|
||||
["-"],
|
||||
["leave",
|
||||
{enabledif: "cx.TYPE == 'IRCChannel'"}],
|
||||
["delete-view", {enabledif: "client.viewsArray.length > 1"}],
|
||||
["disconnect"],
|
||||
["-"],
|
||||
[">popup:opcommands"],
|
||||
["whois"],
|
||||
["query"],
|
||||
["version"],
|
||||
["-"],
|
||||
[">popup:motifs"],
|
||||
["toggle-oas",
|
||||
{type: "checkbox",
|
||||
checkedif: "isStartupURL(cx.sourceObject.getURL())"}],
|
||||
]
|
||||
};
|
||||
|
||||
client.menuSpecs["context:tab"] = {
|
||||
getContext: getTabContext,
|
||||
items:
|
||||
[
|
||||
["leave",
|
||||
{enabledif: "cx.TYPE == 'IRCChannel'"}],
|
||||
["delete-view", {enabledif: "client.viewsArray.length > 1"}],
|
||||
["disconnect"],
|
||||
["-"],
|
||||
["toggle-oas",
|
||||
{type: "checkbox",
|
||||
checkedif: "isStartupURL(cx.sourceObject.getURL())"}],
|
||||
]
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
function createMenus()
|
||||
{
|
||||
client.menuManager.createMenus(document, "mainmenu");
|
||||
client.menuManager.createContextMenus(document);
|
||||
}
|
||||
|
||||
function getCommandContext (id, event)
|
||||
{
|
||||
var cx = { originalEvent: event };
|
||||
|
||||
if (id in client.menuSpecs)
|
||||
{
|
||||
if ("getContext" in client.menuSpecs[id])
|
||||
cx = client.menuSpecs[id].getContext(cx);
|
||||
else if ("cx" in client.menuManager)
|
||||
{
|
||||
//dd ("using existing context");
|
||||
cx = client.menuManager.cx;
|
||||
}
|
||||
else
|
||||
{
|
||||
//no context.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("getCommandContext: unknown menu id " + id);
|
||||
}
|
||||
|
||||
if (typeof cx == "object")
|
||||
{
|
||||
if (!("menuManager" in cx))
|
||||
cx.menuManager = client.menuManager;
|
||||
if (!("contextSource" in cx))
|
||||
cx.contextSource = id;
|
||||
if ("dbgContexts" in client && client.dbgContexts)
|
||||
dd ("context '" + id + "'\n" + dumpObjectTree(cx));
|
||||
}
|
||||
|
||||
return cx;
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is The JavaScript Debugger
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation
|
||||
- Portions created by Netscape are
|
||||
- Copyright (C) 1998 Netscape Communications Corporation.
|
||||
- All Rights Reserved.
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert Ginda, <rginda@netscape.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://chatzilla/locale/chatzilla.dtd" >
|
||||
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
|
||||
<overlay id="chatzilla-menu-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<overlaytarget id="menu-overlay-target">
|
||||
|
||||
<!-- parents for the command manager-managed objects -->
|
||||
<keyset id="dynamic-keys"/>
|
||||
<popupset id="dynamic-popups"/>
|
||||
|
||||
<!-- tooltip thingy -->
|
||||
<tooltip id="html-tooltip-node" onpopupshowing="return onTooltip(event);"/>
|
||||
<tooltip id="xul-tooltip-node" onpopupshowing="return onTooltip(event);"/>
|
||||
|
||||
<!-- Commands -->
|
||||
<commandset id="chatzilla-commands">
|
||||
|
||||
<!-- Edit commands -->
|
||||
<commandset id="selectEditMenuItems"/>
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
<commandset id="undoEditMenuItems"/>
|
||||
<commandset id="clipboardEditMenuItems"/>
|
||||
<command id="cmd_undo"/>
|
||||
<command id="cmd_redo"/>
|
||||
<command id="cmd_cut"/>
|
||||
<command id="cmd_copy"/>
|
||||
<command id="cmd_paste"/>
|
||||
<command id="cmd_delete"/>
|
||||
<command id="cmd_selectAll"/>
|
||||
|
||||
<!-- Tasks commands, from overlay -->
|
||||
<commandset id="tasksCommands"/>
|
||||
</commandset>
|
||||
|
||||
<!-- Keys -->
|
||||
|
||||
<keyset id="chatzillaKeys">
|
||||
<key id="key:reloadui" modifiers="accel alt" key="R"
|
||||
oncommand="if (typeof cmdReloadUI =='function') cmdReloadUI(); else window.location.href = window.location.href;"/>
|
||||
|
||||
<!-- Edit keys -->
|
||||
<key id="key_undo"/>
|
||||
<key id="key_redo"/>
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_paste"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_selectAll"/>
|
||||
|
||||
<!-- Tasks keys, from overlay -->
|
||||
<keyset id="tasksKeys"/>
|
||||
</keyset>
|
||||
|
||||
<!-- Main menu bar -->
|
||||
<toolbox flex="1" id="main-toolbox">
|
||||
<menubar id="mainmenu" persist="collapsed"
|
||||
grippytooltiptext="&Menubar.tooltip;">
|
||||
|
||||
<!-- File menu placeholder, see menus.js -->
|
||||
<menu id="mainmenu:file"/>
|
||||
|
||||
<!-- Edit menu -->
|
||||
<menu id="menu_Edit">
|
||||
<menupopup id="menu_Edit_Popup">
|
||||
<menuitem id="menu_undo"/>
|
||||
<menuitem id="menu_redo"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_cut"/>
|
||||
<menuitem id="menu_copy"/>
|
||||
<menuitem id="menu_paste"/>
|
||||
<menuitem id="menu_delete"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_preferences"
|
||||
oncommand="goPreferences('chatzillaItem', 'chrome://chatzilla/content/prefpanel/pref-irc.xul', 'chatzillaItem');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<!-- View menu placeholder, see venkman-menus.js -->
|
||||
<menu id="mainmenu:view"/>
|
||||
|
||||
<!-- Tasks menu -->
|
||||
<menu id="tasksMenu"/>
|
||||
|
||||
<!-- Tasks menu -->
|
||||
<menu id="windowMenu"/>
|
||||
|
||||
<!-- Help menu -->
|
||||
<!-- Mac expects a help menu with this ID, and there is nothing we can
|
||||
do about it. -->
|
||||
<menu id="menu_Help"/>
|
||||
</menubar>
|
||||
|
||||
</toolbox>
|
||||
|
||||
</overlaytarget>
|
||||
|
||||
<!-- Statusbar (hey, it's /almost/ a menu) -->
|
||||
<overlaytarget id="statusbar-overlay-target">
|
||||
<statusbar class="chromeclass-status" id="status-bar" flex="1">
|
||||
<statusbarpanel id="component-bar"/>
|
||||
<statusbarpanel id="status-text" label="" flex="1"
|
||||
crop="right"/>
|
||||
<!--
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="offline-status"
|
||||
hidden="true" offline="true"/>
|
||||
-->
|
||||
</statusbar>
|
||||
</overlaytarget>
|
||||
|
||||
</overlay>
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
function initMessages()
|
||||
{
|
||||
var path = "chrome://chatzilla/locale/chatzilla.properties";
|
||||
|
||||
client.messageManager = new MessageManager();
|
||||
client.defaultBundle = client.messageManager.addBundle(path);
|
||||
|
||||
client.name = MSG_CLIENT_NAME;
|
||||
client.responseCodeMap =
|
||||
{
|
||||
"HELLO": MSG_RSP_HELLO,
|
||||
"HELP" : MSG_RSP_HELP,
|
||||
"USAGE": MSG_RSP_USAGE,
|
||||
"ERROR": MSG_RSP_ERROR,
|
||||
"WARNING": MSG_RSP_WARN,
|
||||
"INFO": MSG_RSP_INFO,
|
||||
"EVAL-IN": MSG_RSP_EVIN,
|
||||
"EVAL_-OUT": MSG_RSP_EVOUT,
|
||||
"JOIN": "-->|",
|
||||
"PART": "<--|",
|
||||
"QUIT": "|<--",
|
||||
"NICK": "=-=",
|
||||
"TOPIC": "=-=",
|
||||
"KICK": "=-=",
|
||||
"MODE": "=-=",
|
||||
"END_STATUS": "---",
|
||||
"315": "---", /* end of WHO */
|
||||
"318": "---", /* end of WHOIS */
|
||||
"366": "---", /* end of NAMES */
|
||||
"376": "---" /* end of MOTD */
|
||||
};
|
||||
}
|
||||
|
||||
function checkCharset(charset)
|
||||
{
|
||||
return client.messageManager.checkCharset(charset);
|
||||
}
|
||||
|
||||
function toUnicode (msg, charsetOrView)
|
||||
{
|
||||
if (!msg)
|
||||
return msg;
|
||||
|
||||
var charset;
|
||||
if (typeof charsetOrView == "object")
|
||||
charset = charsetOrView.prefs["charset"];
|
||||
else if (typeof charsetOrView == "string")
|
||||
charset = charsetOrView;
|
||||
else
|
||||
charset = client.currentObject.prefs["charset"];
|
||||
|
||||
return client.messageManager.toUnicode(msg, charset);
|
||||
}
|
||||
|
||||
function fromUnicode (msg, charsetOrView)
|
||||
{
|
||||
if (!msg)
|
||||
return msg;
|
||||
|
||||
var charset;
|
||||
if (typeof charsetOrView == "object")
|
||||
charset = charsetOrView.prefs["charset"];
|
||||
else if (typeof charsetOrView == "string")
|
||||
charset = charsetOrView;
|
||||
else
|
||||
charset = client.currentObject.prefs["charset"];
|
||||
|
||||
return client.messageManager.fromUnicode(msg, charset);
|
||||
}
|
||||
|
||||
function getMsg(msgName, params, deflt)
|
||||
{
|
||||
return client.messageManager.getMsg(msgName, params, deflt);
|
||||
}
|
||||
|
||||
function getMsgFrom(bundle, msgName, params, deflt)
|
||||
{
|
||||
return client.messageManager.getMsgFrom(bundle, msgName, params, deflt);
|
||||
}
|
||||
|
||||
/* message types, don't localize */
|
||||
const MT_ATTENTION = "ATTENTION";
|
||||
const MT_ERROR = "ERROR";
|
||||
const MT_HELLO = "HELLO";
|
||||
const MT_HELP = "HELP";
|
||||
const MT_MODE = "MODE";
|
||||
const MT_WARN = "WARN";
|
||||
const MT_INFO = "INFO";
|
||||
const MT_USAGE = "USAGE";
|
||||
const MT_STATUS = "STATUS";
|
||||
const MT_EVALIN = "EVAL-IN";
|
||||
const MT_EVALOUT = "EVAL-OUT";
|
||||
|
||||
@@ -1,518 +0,0 @@
|
||||
/* -*- Mode: Text; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Chatzilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* Styles for output window
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains the CSS rules for the output window in ChatZilla.
|
||||
* The output window is layed out as a table with two columns. The first
|
||||
* column holds a message type or a nickname, depending on what view the
|
||||
* message is contained by, and what kind of message it is. The second column
|
||||
* contains the text of the message. For most message types, ChatZilla displays
|
||||
* ascii-art instead of the actual code. For example, messages of type "JOIN"
|
||||
* are displayed as "-->|", and most unclassified message types are displayed
|
||||
* as "===". If you turn on debug messages (using the options->debug messages
|
||||
* menuitem) ChatZilla will always show the actual message type. This can be
|
||||
* helpful when styling a particular response from the IRC server. See the
|
||||
* description of the msg-type attribute below.
|
||||
*
|
||||
* You can modify these styles on your local system by placing your desired
|
||||
* styles in a file called chatzilla.css in your <profile>/chrome directory.
|
||||
* (the file won't be there already, you have to create it.) Add the line
|
||||
*
|
||||
* @import url(chatzilla.css);
|
||||
*
|
||||
* to the to your userContent.css (also in your <profile>/chrome directory, and
|
||||
* also not there unless you created it already.) End all CSS rules in your
|
||||
* new chatzilla.css with !important to override any styles declared here.
|
||||
* For example, on a Linux system, you would create a file called
|
||||
* /home/<username>/.mozilla/<username>/chrome/userContent.css (if it
|
||||
* doesn't already exist), and add the line @import url(chatzilla.css) to it.
|
||||
* Next, create /home/<username>/.mozilla/<username>/chrome/chatzilla.css, and
|
||||
* add the text:
|
||||
*
|
||||
* .msg {
|
||||
* font-size: 14pt !important;
|
||||
* }
|
||||
*
|
||||
* body.chatzilla-body {
|
||||
* background: green !important;
|
||||
* }
|
||||
*
|
||||
* Close your browser and restart. When you bring up ChatZilla, it should have
|
||||
* a 14pt font and a green background.
|
||||
*
|
||||
* To learn how to make more useful changes to the ChatZilla output style, read
|
||||
* on.
|
||||
*
|
||||
* All of the output in the message window is contained in an html <TABLE>.
|
||||
* New messages are composed of <TR> and <TD> elements inside this <TABLE>.
|
||||
* The message table and it's children have the following CSS classes assigned
|
||||
* to them:
|
||||
*
|
||||
* + .msg-table is used as the class for the surrounding <TABLE>.
|
||||
* Styles applied to this class will affect all parts of all messages.
|
||||
*
|
||||
* + .msg-nested-table is used as the class for the surrounding <TABLE> for
|
||||
* messages sent from users with long nicknames. A new table is created, and
|
||||
* nested inside a <TR colspan="2"> of the .msg-table. The rows of this
|
||||
* table have their classes set as if they were direct children of the
|
||||
* .msg-table. Placing messages from users with long nicknames in a nested
|
||||
* table keeps the nickname column from getting too wide.
|
||||
*
|
||||
* + .msg is used as the class for the surrounding <TR>. This means that
|
||||
* any styles applied here will affect the entire message.
|
||||
*
|
||||
* + .msg-type is used as the class for the <TD> surrounding the message type
|
||||
* portion of messages. Styles applied here will only affect message
|
||||
* types. ie. "-->|", or "[HELP]".
|
||||
*
|
||||
* + .msg-user is used as the class for the <TD> surrounding the nickname
|
||||
* portion of messages. ChatZilla makes use of the :before and :after
|
||||
* pseudoclasses to decorate nicknames with different characters depending
|
||||
* on their message type. For example, when a user performs a /me, their
|
||||
* nickname may be surrounded by asterisks.
|
||||
*
|
||||
* + .msg-data is used as the class for the <TD> surrounding the actual text
|
||||
* of the message.
|
||||
*
|
||||
* In addition to CSS class properties, portions of a message may have one
|
||||
* or mode of the following attributes set:
|
||||
*
|
||||
* + view-type is the type of view the message is contained in. The types
|
||||
* are:
|
||||
* "IRCClient" for the *client* view
|
||||
* "IRCNetwork" for network and server views
|
||||
* "IRCChannel" for channel views
|
||||
* "IRCUser" for query views
|
||||
*
|
||||
* + msg-type is the message type described above. There are too many types
|
||||
* to list here. Turn on debug messages to force message types to print
|
||||
* in the left column of the output.
|
||||
*
|
||||
* + msg-user is the nickname (in lowercase) of the nickname who sent the
|
||||
* message. If you sent the message, msg-user will be set to "ME!", so
|
||||
* that you can style your messages regardless of your nickname.
|
||||
*
|
||||
* + msg-dest is the name of the object that the message is directed to. It
|
||||
* could be a channel name, or a nickname (both in lowercase.)
|
||||
*
|
||||
* + dest-type is the type of object the message is directed to. The types
|
||||
* are:
|
||||
* "IRCChannel" for messages sent to a channel.
|
||||
* "IRCUser" for messages sent directly to another user, including
|
||||
* private messages that appear in a network or channel view (when
|
||||
* a dedicated query view does not exist.)
|
||||
*
|
||||
* + mark is either the text "even" or "odd". When the first user speaks on
|
||||
* a channel, that message is marked as "even". Messages will continue to
|
||||
* be marked "even" until a different user speaks, when the mark switches
|
||||
* to "odd". Each view maintains it's own mark state. An example of how
|
||||
* ChatZilla marks messages would be:
|
||||
*
|
||||
* EVEN: <moe> this deep fat fry-o-later is great.
|
||||
* EVEN: <moe> It'll deep fat fry a whole buffalo in 30 seconds.
|
||||
* ODD: <homer> but I'm hungry *now*!
|
||||
*
|
||||
* + important is either the text "true", or it is not set at all. If
|
||||
* important is true, then the message triggered ChatZilla /stalk function.
|
||||
* This occurs when someone with a nickname matching a pattern in your
|
||||
* /stalk list speaks, when someone says a word that matches a pattern in
|
||||
* your /stalk list, or when someone says your nickname.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* basic classes *
|
||||
******************************************************************************/
|
||||
|
||||
body.chatzilla-body { /* The topmost container in the ChatZilla */
|
||||
margin: 0px 0px 0px 0px; /* output window. */
|
||||
font: 10pt lucida, sans-serif;
|
||||
}
|
||||
|
||||
/* links */
|
||||
a.chatzilla-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* link hover effect */
|
||||
a.chatzilla-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* basic styles */
|
||||
.chatzilla-highlight[name="Large"] {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
.chatzilla-highlight[name="Small"] {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.chatzilla-highlight[name="Bold text"],
|
||||
.chatzilla-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.chatzilla-italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.chatzilla-underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.chatzilla-strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.chatzilla-teletype {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.chatzilla-rheet {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* mirc colors */
|
||||
.chatzilla-fg00 {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.chatzilla-fg01 {
|
||||
color: #c8c8c8;
|
||||
}
|
||||
|
||||
.chatzilla-fg02 {
|
||||
color: #0000c8;
|
||||
}
|
||||
|
||||
.chatzilla-fg03 {
|
||||
color: #00c800;
|
||||
}
|
||||
|
||||
.chatzilla-fg04 {
|
||||
color: #c80000;
|
||||
}
|
||||
|
||||
.chatzilla-fg05 {
|
||||
color: #c8c800;
|
||||
}
|
||||
|
||||
.chatzilla-fg06 {
|
||||
color: #c800c8;
|
||||
}
|
||||
|
||||
.chatzilla-fg07 {
|
||||
color: #ffb000;
|
||||
}
|
||||
|
||||
.chatzilla-fg08 {
|
||||
color: #ffff00;
|
||||
}
|
||||
|
||||
.chatzilla-fg09 {
|
||||
color: #00ff00;
|
||||
}
|
||||
|
||||
.chatzilla-fg10 {
|
||||
color: #00c8c8;
|
||||
}
|
||||
|
||||
.chatzilla-fg11 {
|
||||
color: #00ffff;
|
||||
}
|
||||
|
||||
.chatzilla-fg12 {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
.chatzilla-fg13 {
|
||||
color: #ff00ff;
|
||||
}
|
||||
|
||||
.chatzilla-fg14 {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.chatzilla-fg15 {
|
||||
color: #989898;
|
||||
}
|
||||
|
||||
.chatzilla-bg00 {
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
.chatzilla-bg01 {
|
||||
background: #c8c8c8;
|
||||
}
|
||||
|
||||
.chatzilla-bg02 {
|
||||
background: #0000c8;
|
||||
}
|
||||
|
||||
.chatzilla-bg03 {
|
||||
background: #00c800;
|
||||
}
|
||||
|
||||
.chatzilla-bg04 {
|
||||
background: #c80000;
|
||||
}
|
||||
|
||||
.chatzilla-bg05 {
|
||||
background: #c8c800;
|
||||
}
|
||||
|
||||
.chatzilla-bg06 {
|
||||
background: #c800c8;
|
||||
}
|
||||
|
||||
.chatzilla-bg07 {
|
||||
background: #ffb000;
|
||||
}
|
||||
|
||||
.chatzilla-bg08 {
|
||||
background: #ffff00;
|
||||
}
|
||||
|
||||
.chatzilla-bg09 {
|
||||
background: #00ff00;
|
||||
}
|
||||
|
||||
.chatzilla-bg10 {
|
||||
background: #00c8c8;
|
||||
}
|
||||
|
||||
.chatzilla-bg11 {
|
||||
background: #00ffff;
|
||||
}
|
||||
|
||||
.chatzilla-bg12 {
|
||||
background: #0000ff;
|
||||
}
|
||||
|
||||
.chatzilla-bg13 {
|
||||
background: #ff00ff;
|
||||
}
|
||||
|
||||
.chatzilla-bg14 {
|
||||
background: #808080;
|
||||
}
|
||||
|
||||
.chatzilla-bg15 {
|
||||
background: #989898;
|
||||
}
|
||||
|
||||
.chatzilla-control-char:before {
|
||||
content: "[\\";
|
||||
}
|
||||
|
||||
.chatzilla-control-char:after {
|
||||
content: "]";
|
||||
}
|
||||
|
||||
/* smiley faces */
|
||||
.chatzilla-emote-txt { /* emoticon text inside */
|
||||
display: none;
|
||||
}
|
||||
|
||||
.chatzilla-emote:after { /* empty span to attach :after images to */
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
content: url(chrome://chatzilla/skin/images/face-dunno.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-angry"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-angry.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-cry"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-cry.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-frown"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-frown.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-screw"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-screw.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-smile"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-smile.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-surprise"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-surprise.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-tongue"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-tongue.gif);
|
||||
}
|
||||
|
||||
.chatzilla-emote[type="face-wink"]:after {
|
||||
content: url(chrome://chatzilla/skin/images/face-wink.gif);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* message class base definitions *
|
||||
******************************************************************************/
|
||||
|
||||
.msg-table { /* <TABLE> containing all of the */
|
||||
width: 100%; /* messages. */
|
||||
}
|
||||
|
||||
.msg-nested-table { /* <TABLE> nested inside */
|
||||
width: 100%; /* .msg-table for users with long */
|
||||
margin: 0px; /* nicknames. */
|
||||
border: 0px;
|
||||
border-spacing: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.msg { /* .msg = a single message in the */
|
||||
width: 100%; /* output window */
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.msg-type { /* .msg-type = message type */
|
||||
font-variant: small-caps; /* indicator */
|
||||
font-size: 9pt;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.msg-user { /* msg-user = nickname portion of */
|
||||
text-align: right; /* a message (channel and query */
|
||||
vertical-align: top; /* views) */
|
||||
}
|
||||
|
||||
.msg-data { /* .msg-data = the text portion */
|
||||
padding: 1px 1px 1px 3px; /* of a message */
|
||||
width: 100%;
|
||||
white-space: -moz-pre-wrap;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* message class specific definitions *
|
||||
******************************************************************************/
|
||||
|
||||
/* msg-user is the nickname of the person who spoke, or "ME!" if you said it.
|
||||
* msg-type is the type of the message, taken from the irc message. If you
|
||||
* turn on debug messages (options->debug messages), the msg-types will be
|
||||
* displayed to the left of the messages for all messages except:
|
||||
* PRIVMSG: when a user sends you, or a channel you are on a message.
|
||||
* ACTION: when a user performs a /me.
|
||||
* NOTIFY: when a server or user sends you a notification.
|
||||
*/
|
||||
.msg-data[msg-user="|"], /* messages from common "bulk */
|
||||
.msg-data[msg-user="||"], /* paste" nicks */
|
||||
.msg-data[msg-user="|||"],
|
||||
.msg-data[msg-user="]"],
|
||||
.msg-data[msg-user="["],
|
||||
.msg-data[msg-type="372"], /* MOTD */
|
||||
.msg-data[msg-type="EVAL-IN"], /* /eval results */
|
||||
.msg-data[msg-type="EVAL-OUT"] {
|
||||
font-size: 9pt;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.msg-data[msg-type="USAGE"] {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.msg-data[msg-type="HELP"] {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.msg-user[msg-type="ACTION"] {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.msg-user[important="true"] {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* nickname decorations *
|
||||
******************************************************************************/
|
||||
|
||||
/* :before and :after pseudoclasses form the decorations around nicknames */
|
||||
.msg-user:before {
|
||||
content: "<";
|
||||
}
|
||||
.msg-user:after {
|
||||
content: ">";
|
||||
}
|
||||
.msg-user[important="true"]:before {
|
||||
font-weight: bold;
|
||||
}
|
||||
.msg-user[important="true"]:after {
|
||||
font-weight: bold;
|
||||
}
|
||||
.msg-user[msg-user$="ME!"]:before {
|
||||
content: "<";
|
||||
}
|
||||
.msg-user[msg-user$="ME!"]:after {
|
||||
content: ">";
|
||||
}
|
||||
.msg-user[msg-type="ACTION"]:before,
|
||||
.msg-user[msg-type="ACTION"]:after {
|
||||
content: "";
|
||||
}
|
||||
.msg-user[msg-type="NOTICE"]:before {
|
||||
content: "[";
|
||||
}
|
||||
.msg-user[msg-type="NOTICE"]:after {
|
||||
content: "]";
|
||||
}
|
||||
|
||||
/* private messages *not* in a query window */
|
||||
.msg-user[dest-type="IRCUser"]:before {
|
||||
content: "to(";
|
||||
}
|
||||
.msg-user[msg-dest$="ME!"]:before {
|
||||
content: "from(";
|
||||
}
|
||||
.msg-user[dest-type="IRCUser"]:after {
|
||||
content: ")";
|
||||
}
|
||||
|
||||
/* private messages in a query window */
|
||||
.msg-user[view-type="IRCUser"]:before {
|
||||
content: "{";
|
||||
}
|
||||
.msg-user[view-type="IRCUser"]:after {
|
||||
content: "}";
|
||||
}
|
||||
.msg-user[view-type="IRCUser"][msg-user$="ME!"]:before {
|
||||
content: "{";
|
||||
}
|
||||
.msg-user[view-type="IRCUser"][msg-user$="ME!"]:after {
|
||||
content: "}";
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
||||
|
||||
<html>
|
||||
<style>
|
||||
[hidden="true"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header-outer {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: white;
|
||||
color: black;
|
||||
margin: 2px;
|
||||
border: 1px black solid;
|
||||
}
|
||||
|
||||
#h-table,
|
||||
#net-url,
|
||||
#ch-url {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#splash {
|
||||
padding-top: 55%;
|
||||
padding-bottom: 20%;
|
||||
font-size: 24pt;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#cli-version-container {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#usr-descnodes,
|
||||
#ch-topicnodes {
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
#ch-usercount,
|
||||
#ch-modestr,
|
||||
#net-lag {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
.value {
|
||||
vertical-align: top;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
#usr-title,
|
||||
#usr-descnodes {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<link id="pre-effect-css" rel="stylesheet" type="text/css"
|
||||
href="about-blank">
|
||||
<link id="main-css" rel="stylesheet" type="text/css"
|
||||
href="about:blank">
|
||||
<link id="post-effect-css" rel="stylesheet" type="text/css"
|
||||
href="about:blank">
|
||||
<head>
|
||||
<script src="chrome://chatzilla/content/output-window.js"></script>
|
||||
<!-- <script src="file:///home/rginda/.chatzilla/scripts/goodies/output-window.js"></script> -->
|
||||
</head>
|
||||
|
||||
<body class="chatzilla-body">
|
||||
|
||||
<div class="header-outer">
|
||||
|
||||
<div class="header" id="cli-container" hidden="true">
|
||||
<table id="h-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label">Known Networks</td>
|
||||
<td class="value" id="cli-netcount"><none></td>
|
||||
<td class="label" id="cli-version-container"
|
||||
condition="yellow">ChatZilla <span id="cli-version">0.9.8</span></td>
|
||||
<td class="label">Connected Networks</td>
|
||||
<td class="value" id="cli-connectcount"><none></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="header" id="net-container" hidden="true">
|
||||
<table id="h-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label" id="net-url-l">URL</td>
|
||||
<td class="value" id="net-url">
|
||||
<a id="net-url-anchor" class="chatzilla-link"
|
||||
href="irc://foo/bar">irc://foo/bar</a>
|
||||
</td>
|
||||
<td class="value" id="net-status"
|
||||
condition="red">Not Connected</td>
|
||||
<td class="label" id="net-lag-l">Lag</td>
|
||||
<td class="value" id="net-lag"><unknown></td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="header" id="ch-container" hidden="true">
|
||||
<table id="h-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label" id="ch-url-l">URL</td>
|
||||
<td class="value" id="ch-url">
|
||||
<a id="ch-url-anchor" class="chatzilla-link"
|
||||
href="irc://foo/bar">irc://foo/bar</a>
|
||||
</td>
|
||||
<td class="label" id="ch-modestr-l">Mode</td>
|
||||
<td class="value" id="ch-modestr"><none></td>
|
||||
<td class="label" id="ch-usercount-l">Users</td>
|
||||
<td class="value" id="ch-usercount"><none></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" id="ch-topicnodes-l">Topic</td>
|
||||
<td class="value" id="ch-topicnodes"
|
||||
colspan="6"><none></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="header" id="usr-container" hidden="true">
|
||||
<table id="h-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label">URL</td>
|
||||
<td class="value" width="100%">
|
||||
<a id="usr-url-anchor" class="chatzilla-link"
|
||||
href="irc://foo/bar">irc://foo/bar</a>
|
||||
</td>
|
||||
<td class="label" id="usr-serverstr-l">Connected via</td>
|
||||
<td class="value" id="usr-serverstr"><none></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="usr-title" colspan="4"><none></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="usr-descnodes" colspan="4"><none></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="messages-outer" hidden="true">
|
||||
<div id="splash"></div>
|
||||
<div id="output"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,355 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
var initialized = false;
|
||||
|
||||
var view;
|
||||
var client;
|
||||
var mainWindow;
|
||||
|
||||
var dd;
|
||||
var getMsg;
|
||||
var getObjectDetails;
|
||||
|
||||
var header = null;
|
||||
var headers = {
|
||||
IRCClient: {
|
||||
prefix: "cli-",
|
||||
fields: ["container", "netcount", "version-container", "version",
|
||||
"connectcount"],
|
||||
update: updateClient
|
||||
},
|
||||
|
||||
IRCNetwork: {
|
||||
prefix: "net-",
|
||||
fields: ["container", "url-anchor", "status", "lag"],
|
||||
update: updateNetwork
|
||||
},
|
||||
|
||||
IRCChannel: {
|
||||
prefix: "ch-",
|
||||
fields: ["container", "url-anchor", "modestr", "usercount",
|
||||
"topicnodes"],
|
||||
update: updateChannel
|
||||
},
|
||||
|
||||
IRCUser: {
|
||||
prefix: "usr-",
|
||||
fields: ["container", "url-anchor", "serverstr", "title",
|
||||
"descnodes"],
|
||||
update: updateUser
|
||||
}
|
||||
};
|
||||
|
||||
var initOutputWindow = stock_initOutputWindow;
|
||||
|
||||
function stock_initOutputWindow(newClient, newView)
|
||||
{
|
||||
function initHeader()
|
||||
{
|
||||
/* it's better if we wait a half a second before poking at these
|
||||
* dom nodes. */
|
||||
setHeaderState(view.prefs["displayHeader"]);
|
||||
updateHeader();
|
||||
var div = document.getElementById("messages-outer");
|
||||
div.removeAttribute("hidden");
|
||||
window.scrollTo(0, window.document.height);
|
||||
};
|
||||
|
||||
client = newClient;
|
||||
view = newView;
|
||||
mainWindow = client.mainWindow;
|
||||
|
||||
client.messageManager.importBundle(client.defaultBundle, window);
|
||||
|
||||
getMsg = mainWindow.getMsg;
|
||||
getObjectDetails = mainWindow.getObjectDetails;
|
||||
dd = mainWindow.dd;
|
||||
|
||||
changeCSS(view.prefs["motif.current"]);
|
||||
|
||||
var output = document.getElementById("output");
|
||||
output.appendChild(view.messages);
|
||||
|
||||
if (view.TYPE in headers)
|
||||
{
|
||||
header = cacheNodes(headers[view.TYPE].prefix,
|
||||
headers[view.TYPE].fields);
|
||||
header.update = headers[view.TYPE].update;
|
||||
}
|
||||
|
||||
var splash = document.getElementById("splash");
|
||||
var name;
|
||||
if ("unicodeName" in view)
|
||||
name = view.unicodeName;
|
||||
else if ("properNick" in view)
|
||||
name = view.properNick;
|
||||
else
|
||||
name = view.name;
|
||||
splash.appendChild(document.createTextNode(name));
|
||||
|
||||
setTimeout(initHeader, 500);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
function cacheNodes(pfx, ary, nodes)
|
||||
{
|
||||
if (!nodes)
|
||||
nodes = new Object();
|
||||
|
||||
for (var i = 0; i < ary.length; ++i)
|
||||
nodes[ary[i]] = document.getElementById(pfx + ary[i]);
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
function changeCSS(url, id)
|
||||
{
|
||||
if (!id)
|
||||
id = "main-css";
|
||||
|
||||
node = document.getElementById(id);
|
||||
|
||||
if (!node)
|
||||
{
|
||||
node = document.createElement("link");
|
||||
node.setAttribute("id", "main-css");
|
||||
node.setAttribute("rel", "stylesheet");
|
||||
node.setAttribute("type", "text/css");
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
head.appendChild(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.getAttribute("href") == url)
|
||||
return;
|
||||
}
|
||||
|
||||
node.setAttribute("href", url);
|
||||
window.scrollTo(0, window.document.height);
|
||||
}
|
||||
|
||||
function setText(field, text, checkCondition)
|
||||
{
|
||||
if (!header[field].firstChild)
|
||||
header[field].appendChild(document.createTextNode(""));
|
||||
|
||||
if (typeof text != "string")
|
||||
{
|
||||
text = MSG_UNKNOWN;
|
||||
if (checkCondition)
|
||||
setAttribute(field, "condition", "red");
|
||||
}
|
||||
else if (checkCondition)
|
||||
{
|
||||
setAttribute(field, "condition", "green");
|
||||
}
|
||||
|
||||
header[field].firstChild.data = text;
|
||||
}
|
||||
|
||||
function setAttribute(field, name, value)
|
||||
{
|
||||
if (!value)
|
||||
value = "true";
|
||||
|
||||
header[field].setAttribute(name, value);
|
||||
}
|
||||
|
||||
function removeAttribute(field, name)
|
||||
{
|
||||
header[field].removeAttribute(name);
|
||||
}
|
||||
|
||||
function hasAttribute(field, name)
|
||||
{
|
||||
header[field].hasAttribute(name);
|
||||
}
|
||||
|
||||
function setHeaderState(state)
|
||||
{
|
||||
if (header)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
updateHeader();
|
||||
removeAttribute("container", "hidden");
|
||||
}
|
||||
else
|
||||
{
|
||||
setAttribute("container", "hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateHeader()
|
||||
{
|
||||
if (!header || hasAttribute("container", "hidden"))
|
||||
return;
|
||||
|
||||
for (var id in header)
|
||||
{
|
||||
var value;
|
||||
|
||||
if (id == "url-anchor")
|
||||
{
|
||||
value = view.getURL();
|
||||
setAttribute("url-anchor", "href", value);
|
||||
setText("url-anchor", value);
|
||||
}
|
||||
else if (id in view)
|
||||
{
|
||||
setText(id, view[id]);
|
||||
}
|
||||
}
|
||||
|
||||
if (header.update)
|
||||
header.update();
|
||||
}
|
||||
|
||||
function updateClient()
|
||||
{
|
||||
var n = 0, c = 0;
|
||||
for (name in client.networks)
|
||||
{
|
||||
++n;
|
||||
if (client.networks[name].isConnected())
|
||||
++c;
|
||||
}
|
||||
|
||||
setAttribute("version-container", "title", client.userAgent);
|
||||
setAttribute("version-container", "condition", mainWindow.__cz_condition);
|
||||
setText("version", mainWindow.__cz_version);
|
||||
setText("netcount", String(n));
|
||||
setText("connectcount", String(c));
|
||||
}
|
||||
|
||||
function updateNetwork()
|
||||
{
|
||||
if (view.connecting)
|
||||
{
|
||||
setText("status", MSG_CONNECTING);
|
||||
setAttribute("status","condition", "yellow");
|
||||
removeAttribute("status", "title");
|
||||
setText("lag", MSG_UNKNOWN);
|
||||
}
|
||||
else if (view.isConnected())
|
||||
{
|
||||
setText("status", MSG_CONNECTED);
|
||||
setAttribute("status","condition", "green");
|
||||
setAttribute("status", "title",
|
||||
getMsg(MSG_CONNECT_VIA, view.primServ.name));
|
||||
if (view.primServ.lag != -1)
|
||||
setText("lag", getMsg(MSG_FMT_SECONDS, view.primServ.lag));
|
||||
else
|
||||
setText("lag", MSG_UNKNOWN);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
setText("status", MSG_DISCONNECTED);
|
||||
setAttribute("status","condition", "red");
|
||||
removeAttribute("status", "title");
|
||||
setText("lag", MSG_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
function updateChannel()
|
||||
{
|
||||
header["topicnodes"].removeChild(header["topicnodes"].firstChild);
|
||||
|
||||
if (view.active)
|
||||
{
|
||||
var str = view.mode.getModeStr();
|
||||
if (!str)
|
||||
str = MSG_NO_MODE;
|
||||
setText("modestr", str);
|
||||
setAttribute("modestr", "condition", "green");
|
||||
|
||||
setText("usercount", getMsg(MSG_FMT_USERCOUNT,
|
||||
[view.getUsersLength(), view.opCount,
|
||||
view.voiceCount]));
|
||||
setAttribute("usercount", "condition", "green");
|
||||
|
||||
if (view.topic)
|
||||
{
|
||||
var nodes = client.munger.munge(view.topic, null,
|
||||
getObjectDetails(view));
|
||||
header["topicnodes"].appendChild(nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
setText("topicnodes", MSG_NONE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setText("modestr", MSG_UNKNOWN);
|
||||
setAttribute("modestr", "condition", "red");
|
||||
setText("usercount", MSG_UNKNOWN);
|
||||
setAttribute("usercount", "condition", "red");
|
||||
setText("topicnodes", MSG_UNKNOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateUser()
|
||||
{
|
||||
var source;
|
||||
if (view.name)
|
||||
source = "<" + view.name + "@" + view.host + ">";
|
||||
else
|
||||
source = MSG_UNKNOWN;
|
||||
|
||||
if (view.parent.isConnected)
|
||||
setText("serverstr", view.connectionHost, true);
|
||||
else
|
||||
setText("serverstr", null, true);
|
||||
|
||||
setText("title", getMsg(MSG_TITLE_USER, [view.properNick, source]));
|
||||
|
||||
header["descnodes"].removeChild(header["descnodes"].firstChild);
|
||||
if (typeof view.desc != "undefined")
|
||||
{
|
||||
var nodes = client.munger.munge(view.desc, null,
|
||||
getObjectDetails(view));
|
||||
header["descnodes"].appendChild(nodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
setText("descnodes", "");
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation
|
||||
- Portions created by Netscape are
|
||||
- Copyright (C) 1998 Netscape Communications Corporation.
|
||||
- All Rights Reserved.
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert Ginda, <rginda@netscape.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://chatzilla/locale/chatzilla.dtd" >
|
||||
|
||||
<overlay id="chatzilla-popup-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<overlaytarget id="popup-overlay-target">
|
||||
|
||||
<commandset id="chatzillaPopupCommands">
|
||||
<!-- Context menu commands -->
|
||||
<command id="cmd_leaveview" oncommand="dispatch('part');"/>
|
||||
<command id="cmd_clearview" oncommand="dispatch('clear-view');"/>
|
||||
<command id="cmd_deleteview" oncommand="dispatch('delete-view');"/>
|
||||
<command id="cmd_status" oncommand="dispatch('status')"/>
|
||||
<command id="cmd_popup_query"
|
||||
oncommand="onPopupSimulateCommand('/query $nick');"/>
|
||||
<command id="cmd_popup_whois"
|
||||
oncommand="onPopupSimulateCommand('/whois $nick');"/>
|
||||
<command id="cmd_popup_ping"
|
||||
oncommand="onPopupSimulateCommand('/ctcp $nick PING');"/>
|
||||
<command id="cmd_popup_version"
|
||||
oncommand="onPopupSimulateCommand('/ctcp $nick VERSION');"/>
|
||||
<command id="cmd_popup_highlight"
|
||||
oncommand="onPopupHighlight(true);"/>
|
||||
<command id="cmd_popup_nohighlight"
|
||||
oncommand="onPopupHighlight(false);"/>
|
||||
<command id="cmd_popup_giveop"
|
||||
oncommand="onPopupSimulateCommand('/op $nick');"/>
|
||||
<command id="cmd_popup_takeop"
|
||||
oncommand="onPopupSimulateCommand('/deop $nick');"/>
|
||||
<command id="cmd_popup_givevoice"
|
||||
oncommand="onPopupSimulateCommand('/voice $nick');"/>
|
||||
<command id="cmd_popup_takevoice"
|
||||
oncommand="onPopupSimulateCommand('/devoice $nick');"/>
|
||||
<command id="cmd_popup_kick"
|
||||
oncommand="onPopupSimulateCommand('/kick $nick');"/>
|
||||
</commandset>
|
||||
|
||||
<!-- html tooltips -->
|
||||
<tooltip id="aHTMLTooltip"
|
||||
onpopupshowing="return fillInTooltip(document.tooltipNode,'aHTMLTooltip');"/>
|
||||
|
||||
<!--
|
||||
tab tooltips, always show above the tab, so we don't draw over the input box
|
||||
-->
|
||||
<tooltip id="tabTT" position="end_after"
|
||||
onpopupshowing="return fillInTooltip(document.tooltipNode,'tabTT');"/>
|
||||
|
||||
<popupset id="contextMenus">
|
||||
<popup id="userlistPopup" oncommand="onUserListPopupClick(event)">
|
||||
<menuitem label="&op.value;" accesskey="&op.accesskey;" code="/op" />
|
||||
<menuitem label="&deop.value;" accesskey="&deop.accesskey;"
|
||||
code="/deop" />
|
||||
<menuitem label="&voice.value;" accesskey="&voice.accesskey;"
|
||||
code="/voice" />
|
||||
<menuitem label="&devoice.value;" accesskey="&devoice.accesskey;"
|
||||
code="/devoice" />
|
||||
<menuitem label="&kick.value;" accesskey="&kick.accesskey;"
|
||||
code="/kick" />
|
||||
<menuitem label="&whois.value;" accesskey="&whois.accesskey;"
|
||||
code="/whois" />
|
||||
</popup>
|
||||
|
||||
<popup id="outputContext"
|
||||
onpopupshowing="if (event.originalTarget == this) return onOutputContextMenuCreate(event); else return true;"
|
||||
onpopuphiding="if (event.originalTarget == this) delete client._popupContext;">
|
||||
<menuitem format="&PopupQueryCmd.label;" accesskey="&PopupQueryCmd.aKey;"
|
||||
observes="cmd_popup_query"
|
||||
visibleif="targetUser"/>
|
||||
<menuitem format="&PopupWhoisCmd.label;" accesskey="&PopupWhoisCmd.aKey;"
|
||||
observes="cmd_popup_whois"
|
||||
visibleif="targetUser"/>
|
||||
<menuitem format="&PopupPingCmd.label;" accesskey="&PopupPingCmd.aKey;"
|
||||
observes="cmd_popup_ping"
|
||||
visibleif="targetUser"/>
|
||||
<menuitem format="&PopupVersionCmd.label;"
|
||||
accesskey="&PopupVersionCmd.aKey;"
|
||||
observes="cmd_popup_version"
|
||||
visibleif="targetUser"/>
|
||||
|
||||
<!--
|
||||
<menu format="&PopupHighlightStyle.label;"
|
||||
accesskey="&PopupHighlightStyle.aKey;"
|
||||
visibleif="targetUser">
|
||||
<menupopup id="highlightMenu">
|
||||
<menuitem/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
-->
|
||||
|
||||
<menuseparator
|
||||
visibleif="targetUser"/>
|
||||
|
||||
<menuitem label="&PopupGiveOp.label;" accesskey="&PopupGiveOp.aKey;"
|
||||
observes="cmd_popup_giveop"
|
||||
visibleif="iAmOp == 'yes' and targetIsOp == 'no'"/>
|
||||
<menuitem label="&PopupTakeOp.label;" accesskey="&PopupTakeOp.aKey;"
|
||||
observes="cmd_popup_takeop"
|
||||
visibleif="iAmOp == 'yes' and targetIsOp == 'yes'"/>
|
||||
<menuitem label="&PopupGiveVoice.label;"
|
||||
accesskey="&PopupGiveVoice.aKey;"
|
||||
observes="cmd_popup_givevoice"
|
||||
visibleif="iAmOp == 'yes' and targetIsVoice == 'no'"/>
|
||||
<menuitem label="&PopupTakeVoice.label;"
|
||||
accesskey="&PopupTakeVoice.aKey;"
|
||||
observes="cmd_popup_takevoice"
|
||||
visibleif="iAmOp == 'yes' and targetIsVoice == 'yes'"/>
|
||||
<menuitem format="&PopupKick.label;" accesskey="&PopupKick.aKey;"
|
||||
observes="cmd_popup_kick"
|
||||
visibleif="iAmOp == 'yes' and targetUser != 'undefined'"/>
|
||||
|
||||
<menuseparator
|
||||
visibleif="targetUser != 'undefined' and iAmOp == 'yes'"/>
|
||||
|
||||
<menuitem label="&StartupVisitCmd.label;" type="checkbox"
|
||||
accesskey="&StartupVisitCmd.aKey;" observes="cmd_toggle_startup_visit"
|
||||
checkedif="isStartupURL(client.currentObject.getURL())"/>
|
||||
<menuitem format="&LeaveViewCmd.label;" accesskey="&LeaveViewCmd.aKey;"
|
||||
observes="cmd_leaveview" key="key_deleteview"
|
||||
visibleif="client.currentObject.TYPE == 'IRCChannel'"/>
|
||||
<menuitem label="&DeleteViewCmd.label;" accesskey="&DeleteViewCmd.aKey;"
|
||||
observes="cmd_deleteview" key="key_deleteview"
|
||||
visibleif="client.currentObject.TYPE != 'IRCChannel'"/>
|
||||
<menuitem label="&ClearViewCmd.label;" accesskey="&ClearViewCmd.aKey;"
|
||||
observes="cmd_clearview" key="key_clearview"/>
|
||||
<menuseparator/>
|
||||
|
||||
<menuitem label="&StatusCmd.label;" accesskey="&StatusCmd.aKey;"
|
||||
observes="cmd_status"/>
|
||||
</popup>
|
||||
|
||||
</popupset>
|
||||
|
||||
</overlaytarget>
|
||||
|
||||
</overlay>
|
||||
@@ -1,76 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var css = "chrome://chatzilla/skin/output-default.css";
|
||||
if (document.location.search)
|
||||
css = document.location.search.substr(1);
|
||||
|
||||
document.write ("<LINK REL=StyleSheet HREF='" + css +
|
||||
"' TYPE='text/css' MEDIA='screen'>");
|
||||
</script>
|
||||
<!--<LINK REL=StyleSheet id='dynamic-styles' TYPE='text/css' MEDIA='screen'
|
||||
href='chrome://chatzilla/content/dynamic.css'>-->
|
||||
</head>
|
||||
<body class="chatzilla-body">
|
||||
<div id="output">
|
||||
</div>
|
||||
<table class="msg-table" view-type="IRCChannel">
|
||||
<tbody>
|
||||
<tr class="msg" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[INFO]</span></td><td class="msg-data" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Channel view for ``#mozilla'' opened.</span></td></tr>
|
||||
<tr class="msg" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="NOTICE" msg-user="moznet" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span>*** Your host is irc.mozilla.org[irc.mozilla.org/6667], running version 2.8/hybrid-6.0</span></td></tr>
|
||||
<tr class="msg" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="250" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>: Highest connection count: 417 (417 clients) (269041 since server was (re)started)</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="ME!" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>YOU have joined #mozilla</span></td></tr>
|
||||
<tr class="msg" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Topic for #mozilla is ``<pinkerton> something crude''</span></td></tr>
|
||||
<tr class="msg" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span>Topic for #mozilla was set by dmose on Thu Jul 12 12:03:59 GMT-0700 (PDT) 2001</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:10" class="msg-type" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="illsleydc" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>illsleydc (<a href="mailto:illsleydc@usr2574-kno.cableinet.co.uk" class="chatzilla-link">illsleydc@usr2574-kno.cableinet.co.uk</a>) has joined #mozilla</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:11" class="msg-type" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>fantasai (<a href="mailto:fantasai@escape.com" class="chatzilla-link">fantasai@escape.com</a>) has joined #mozilla</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:11" class="msg-type" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="walk84_" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span>walk84_ (<a href="mailto:walk84@tc0-193.stn.bluemarble.net" class="chatzilla-link">walk84@tc0-193.stn.bluemarble.net</a>) has joined #mozilla</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 14:12" class="msg-user" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">fantasai</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="fantasai" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>Hixie: ping</span></td></tr>
|
||||
<tr class="msg" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:13" class="msg-type" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="NICK" msg-user="akkpit" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>akk is now known as akkPit</span></td></tr>
|
||||
<tr class="msg" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="ACTION" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>notices the tipic</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>er, topic</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>hey ben</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">BenGoodger</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="bengoodger" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>pink!</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="smfr2" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="smfr2" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">smfr2</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="smfr2" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>pink: bug 87112</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-user" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">pinkerton</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="pinkerton" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>gracias</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="mang" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:14" class="msg-type" msg-type="JOIN" msg-user="mang" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="mang" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>mang (<a href="mailto:mang@h-208-12-41-197.netscape.com" class="chatzilla-link">mang@h-208-12-41-197.netscape.com</a>) has joined #mozilla</span></td></tr>
|
||||
<tr class="msg" msg-type="QUIT" msg-user="kowalski" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:15" class="msg-type" msg-type="QUIT" msg-user="kowalski" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">|<--</span></td><td class="msg-data" msg-type="QUIT" msg-user="kowalski" msg-dest="#mozilla" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Kowalski has left moznet (How did you manage to get your face caught in the door?)</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>foo</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>foo</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="blablabalabl" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="blablabalabl" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">blablabalabl</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="blablabalabl" dest-type="IRCUser" view-type="IRCChannel" mark="odd"><span>bnla</span></td></tr>
|
||||
<tr class="msg" msg-type="401" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="401" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="401" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>blablabalabl: No such nick/channel</span></td></tr>
|
||||
<tr class="msg" msg-type="HELLO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="HELLO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[HELLO]</span></td><td class="msg-data" msg-type="HELLO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample HELLO message.</span></td></tr>
|
||||
<tr class="msg" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[INFO]</span></td><td class="msg-data" msg-type="INFO" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample INFO message.</span></td></tr>
|
||||
<tr class="msg" msg-type="ERROR" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="ERROR" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[ERROR]</span></td><td class="msg-data" msg-type="ERROR" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample ERROR message.</span></td></tr>
|
||||
<tr class="msg" msg-type="HELP" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="HELP" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[HELP]</span></td><td class="msg-data" msg-type="HELP" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample HELP message.</span></td></tr>
|
||||
<tr class="msg" msg-type="USAGE" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="USAGE" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">[USAGE]</span></td><td class="msg-data" msg-type="USAGE" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample USAGE message.</span></td></tr>
|
||||
<tr class="msg" msg-type="STATUS" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="STATUS" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel"><span class="undefined">===</span></td><td class="msg-data" msg-type="STATUS" msg-user="undefined" msg-dest="undefined" dest-type="unk" view-type="IRCChannel" mark="odd"><span>Sample STATUS message.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Normal message from IRCUser ``IRCMonkey'' to you</span></td></tr>
|
||||
<tr class="msg" msg-type="ACTION" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="ACTION" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="ACTION" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Action message from IRCUser ``IRCMonkey'' to you</span></td></tr>
|
||||
<tr class="msg" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Notice message from IRCUser ``IRCMonkey'' to you</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Normal message from you to IRCUser ``IRCMonkey''</span></td></tr>
|
||||
<tr class="msg" msg-type="ACTION" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="ACTION" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="ACTION" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Action message from you to IRCUser ``IRCMonkey''</span></td></tr>
|
||||
<tr class="msg" msg-type="NOTICE" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="NOTICE" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="NOTICE" msg-user="ME!" msg-dest="ircmonkey" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Notice message from you to IRCUser ``IRCMonkey''</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Sample URL <<a href="http://www.mozilla.org" class="chatzilla-link" target="_content">http://www.mozilla.org</a>> message.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Sample text styles <span class="chatzilla-bold">*bold*<img></span>, <span class="chatzilla-underline">_underline_<img></span>, <span class="chatzilla-italic">/italic/<img></span>, <span class="chatzilla-teletype">|teletype|<img></span> message.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Sample emoticon<span class="chatzilla-emote-txt" type="face-smile"> :) </span><span class="chatzilla-emote" type="face-smile"></span><span class="chatzilla-emote-txt" type="face-frown">:( </span><span class="chatzilla-emote" type="face-frown"></span><span class="chatzilla-emote-txt" type="face-cry">:~( </span><span class="chatzilla-emote" type="face-cry"></span><span class="chatzilla-emote-txt" type="face-surprise">:0 </span><span class="chatzilla-emote" type="face-surprise"></span><span class="chatzilla-emote-txt" type="face-screw">:/ </span><span class="chatzilla-emote" type="face-screw"></span><span class="chatzilla-emote-txt" type="face-tongue">:P </span><span class="chatzilla-emote" type="face-tongue"></span><span class="chatzilla-emote-txt" type="face-angry">:| </span><span class="chatzilla-emote" type="face-angry"></span><img src="chrome://chatzilla/skin/images/face-ear.gif"> message.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="ME!" dest-type="IRCUser" view-type="IRCChannel" mark="even"><span>Sample <a href="ftp://ftp.mozilla.org/pub/mozilla/libraries/bonus-tracks/rheet.wav" class="chatzilla-rheet chatzilla-link">Rheeeeeeeeeet!</a> message.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>Normal message from IRCUser ``IRCMonkey'' to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="ACTION" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="ACTION" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="ACTION" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>Action message from IRCUser ``IRCMonkey'' to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="NOTICE" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="even"><span>Notice message from IRCUser ``IRCMonkey'' to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Normal message from you to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="ACTION" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="ACTION" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="ACTION" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Action message from you to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="NOTICE" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="NOTICE" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="NOTICE" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Notice message from you to IRCChannel ``<a href="irc://moznet/#mojo" class="chatzilla-link">#mojo</a>''</span></td></tr>
|
||||
<tr class="msg" msg-type="TOPIC" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="TOPIC" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="TOPIC" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Topic message</span></td></tr>
|
||||
<tr class="msg" msg-type="JOIN" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="JOIN" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">-->|</span></td><td class="msg-data" msg-type="JOIN" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Join message</span></td></tr>
|
||||
<tr class="msg" msg-type="PART" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="PART" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined"><--|</span></td><td class="msg-data" msg-type="PART" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Part message</span></td></tr>
|
||||
<tr class="msg" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">=-=</span></td><td class="msg-data" msg-type="KICK" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Kick message</span></td></tr>
|
||||
<tr class="msg" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-type" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">|<--</span></td><td class="msg-data" msg-type="QUIT" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample Quit message</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true"><span class="undefined">IRCMonkey</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ircmonkey" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" important="true" mark="even"><span>rgindafoo : Sample /stalk match.</span></td></tr>
|
||||
<tr class="msg" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><td title="7/12 15:17" class="msg-user" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel"><span class="undefined">rgindaFOO</span></td><td class="msg-data" msg-type="PRIVMSG" msg-user="ME!" msg-dest="#mojo" dest-type="IRCChannel" view-type="IRCChannel" mark="odd"><span>Sample text styles <span class="chatzilla-bold">*bold*<img></span>, <span class="chatzilla-underline">_underline_<img></span>, <span class="chatzilla-italic">/italic/<img></span>, <span class="chatzilla-teletype">|teletype|<img></span>, message.</span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,54 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gData;
|
||||
var gPage;
|
||||
|
||||
function Init()
|
||||
{
|
||||
gPage = document.getElementById('czPreviewPage');
|
||||
|
||||
if ("arguments" in window && window.arguments[0])
|
||||
gData = window.arguments[0];
|
||||
|
||||
if (! gData)
|
||||
gData = new Object();
|
||||
|
||||
gPage.contentDocument.location.href =
|
||||
"chrome://chatzilla/content/prefpanel/appearance-previewCSS.html"
|
||||
+ (gData.style ? "?" + gData.style : '');
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE dialog SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();" buttons="accept" style=" width: 50em; height: 40em; "
|
||||
title="&appearance-previewCSS.window.title;">
|
||||
|
||||
<script src="chrome://chatzilla/content/prefpanel/appearance-previewCSS.js"/>
|
||||
|
||||
<keyset id="dialogKeys"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<iframe id="czPreviewPage" flex="1" src="about:blank"/>
|
||||
</hbox>
|
||||
|
||||
<separator/>
|
||||
|
||||
</dialog>
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
#czMungerBold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#czMungerItalic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* FIXME: This doesn't work in XUL due to bug 68841. */
|
||||
#czMungerUnderline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#czMungerTeletype {
|
||||
font-family: monospace;
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
||||
const czStyleDefault = "chrome://chatzilla/skin/output-default.css";
|
||||
const czStyleLight = "chrome://chatzilla/skin/output-light.css";
|
||||
const czStyleDark = "chrome://chatzilla/skin/output-dark.css";
|
||||
const czStyleFacesDefault = "http://www.hacksrus.com/~ginda/chatzilla/motifs/output-default-faces.css";
|
||||
const czStyleFacesLight = "http://www.hacksrus.com/~ginda/chatzilla/motifs/output-light-faces.css";
|
||||
const czStyleFacesDark = "http://www.hacksrus.com/~ginda/chatzilla/motifs/output-dark-faces.css";
|
||||
|
||||
function Init()
|
||||
{
|
||||
parent.initPanel("chrome://chatzilla/content/prefpanel/appearance.xul");
|
||||
|
||||
var edit = document.getElementById("czStyleCSS");
|
||||
selectStyle(edit.getAttribute("prefvalue"));
|
||||
}
|
||||
|
||||
function onChooseFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
var edit = document.getElementById("czStyleCSS");
|
||||
var oldStyle = edit.getAttribute("prefvalue");
|
||||
|
||||
var fpClass = Components.classes["@mozilla.org/filepicker;1"];
|
||||
var fp = fpClass.createInstance(nsIFilePicker);
|
||||
fp.init(window, getMsg("file_browse_CSS"), nsIFilePicker.modeOpen);
|
||||
|
||||
fp.appendFilter(getMsg("file_browse_CSS_spec"), "*.css");
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK && fp.fileURL.spec
|
||||
&& fp.fileURL.spec.length > 0)
|
||||
selectStyle(fp.fileURL.spec);
|
||||
else
|
||||
selectStyle(oldStyle);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
dump ("caught exception in `onChooseFile`\n" + ex);
|
||||
}
|
||||
}
|
||||
|
||||
function selectStyle(file)
|
||||
{
|
||||
var edit = document.getElementById("czStyleCSS");
|
||||
var option = document.getElementById("czStyleCustomCSS");
|
||||
|
||||
edit.setAttribute("prefvalue", file);
|
||||
|
||||
var opts = edit.childNodes[0].childNodes;
|
||||
for (var i = 0; i < opts.length; i++)
|
||||
{
|
||||
if (opts[i].getAttribute("url") == file)
|
||||
{
|
||||
edit.selectedIndex = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
option.hidden = false;
|
||||
option.label = file;
|
||||
option.setAttribute("url", file);
|
||||
edit.selectedIndex = 7;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function previewStyle()
|
||||
{
|
||||
var edit = document.getElementById("czStyleCSS");
|
||||
var gData = new Object();
|
||||
|
||||
gData.style = edit.getAttribute("prefvalue");
|
||||
|
||||
window.openDialog("chrome://chatzilla/content/prefpanel/appearance-previewCSS.xul",
|
||||
"czPreviewCSS", "chrome,modal,resizable=yes", gData);
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://chatzilla/content/prefpanel/appearance.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
headertitle="&appearance.window.title;">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/pref-irc.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/appearance.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czMungerBold", "czMungerItalic", "czMungerUnderline",
|
||||
"czMungerTeletype", "czMungerWeb", "czMungerMail", "czMungerChannels",
|
||||
"czMungerBugzilla", "czMungerEmoti", "czMungerColors", "czMungerWrap",
|
||||
"czMungerBugzillaURL", "czStyleCSS"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&prePro.title;"/>
|
||||
<label>&prePro.desc;</label>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/><column flex="1"/><column flex="1"/><column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&prePro.styles;" hidden="true"/>
|
||||
<checkbox id="czMungerBold" label="&prePro.styles.bold.label;"
|
||||
tooltiptext="&prePro.styles.bold.tooltip;"
|
||||
accesskey="&prePro.styles.bold.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.bold"/>
|
||||
<checkbox id="czMungerItalic" label="&prePro.styles.italic.label;"
|
||||
tooltiptext="&prePro.styles.italic.tooltip;"
|
||||
accesskey="&prePro.styles.italic.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.italic"/>
|
||||
<checkbox id="czMungerUnderline" label="&prePro.styles.underline.label;"
|
||||
tooltiptext="&prePro.styles.underline.tooltip;"
|
||||
accesskey="&prePro.styles.underline.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.underline"/>
|
||||
<checkbox id="czMungerTeletype" label="&prePro.styles.teletype.label;"
|
||||
tooltiptext="&prePro.styles.teletype.tooltip;"
|
||||
accesskey="&prePro.styles.teletype.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.teletype"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&prePro.links;" hidden="true"/>
|
||||
<checkbox id="czMungerWeb" label="&prePro.styles.web.label;"
|
||||
tooltiptext="&prePro.styles.web.tooltip;"
|
||||
accesskey="&prePro.styles.web.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.link"/>
|
||||
<checkbox id="czMungerMail" label="&prePro.styles.mail.label;"
|
||||
tooltiptext="&prePro.styles.mail.tooltip;"
|
||||
accesskey="&prePro.styles.mail.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.mailto"/>
|
||||
<checkbox id="czMungerChannels" label="&prePro.styles.channel.label;"
|
||||
tooltiptext="&prePro.styles.channel.tooltip;"
|
||||
accesskey="&prePro.styles.channel.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.channel-link"/>
|
||||
<checkbox id="czMungerBugzilla" label="&prePro.styles.bug.label;"
|
||||
tooltiptext="&prePro.styles.bug.tooltip;"
|
||||
accesskey="&prePro.styles.bug.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.bugzilla-link"/>
|
||||
</row>
|
||||
<row>
|
||||
<checkbox id="czMungerEmoti" label="&prePro.emoti.label;"
|
||||
tooltiptext="&prePro.emoti.tooltip;"
|
||||
accesskey="&prePro.emoti.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.face"/>
|
||||
<checkbox id="czMungerColors" label="&prePro.colors.label;"
|
||||
tooltiptext="&prePro.colors.tooltip;"
|
||||
accesskey="&prePro.colors.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.colorCodes"/>
|
||||
<checkbox id="czMungerWrap" label="&prePro.wrap.label;"
|
||||
tooltiptext="&prePro.wrap.tooltip;"
|
||||
accesskey="&prePro.wrap.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.munger.word-hyphenator"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&prePro.bugURL.label;" control="czMungerBugzillaURL"
|
||||
accesskey="&prePro.bugURL.accesskey;"/>
|
||||
<textbox id="czMungerBugzillaURL" flex="1"
|
||||
prefdefval="http://bugzilla.mozilla.org/show_bug.cgi?id=%s"
|
||||
prefstring="extensions.irc.bugURL"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&style.title;"/>
|
||||
<vbox>
|
||||
<label>&style.desc;</label>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&style.css.label;" control="czStyleCSS"
|
||||
accesskey="&style.css.accesskey;"/>
|
||||
<!-- FIXME: Shows blank when switching to this pref page. -->
|
||||
<menulist flex="1" id="czStyleCSS" crop="center"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
prefdefval="chrome://chatzilla/skin/output-default.css"
|
||||
preftype="string" prefstring="extensions.irc.motif.current">
|
||||
<menupopup>
|
||||
<menuitem label="&style.default.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="chrome://chatzilla/skin/output-default.css"/>
|
||||
<menuitem label="&style.dark.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="chrome://chatzilla/skin/output-dark.css"/>
|
||||
<menuitem label="&style.light.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="chrome://chatzilla/skin/output-light.css"/>
|
||||
<menuitem label="&style.faces.default.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="http://www.hacksrus.com/~ginda/chatzilla/motifs/output-default-faces.css"/>
|
||||
<menuitem label="&style.faces.dark.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="http://www.hacksrus.com/~ginda/chatzilla/motifs/output-dark-faces.css"/>
|
||||
<menuitem label="&style.faces.light.label;"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"
|
||||
url="http://www.hacksrus.com/~ginda/chatzilla/motifs/output-light-faces.css"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="czStyleCustomCSS" label="" hidden="true" url="" crop="center"
|
||||
oncommand="selectStyle(this.getAttribute('url'));"/>
|
||||
<menuitem label="&style.custom.label;" oncommand="onChooseFile();"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<button label="&style.preview.label;" accesskey="&style.preview.accesskey;"
|
||||
oncommand="previewStyle();"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,95 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function Init() {
|
||||
parent.initPanel("chrome://chatzilla/content/prefpanel/interface.xul");
|
||||
initPMTabsPref();
|
||||
}
|
||||
|
||||
function initPMTabsPref()
|
||||
{
|
||||
var allowTabs = document.getElementById("czCreateTabsForPMs");
|
||||
var limitTabs = document.getElementById("czLimitPMTabs");
|
||||
var userTabs = document.getElementById("csPMTabLimitUser");
|
||||
var prefBox = document.getElementById("czPMTabLimit");
|
||||
|
||||
if (prefBox.value == 0)
|
||||
{
|
||||
allowTabs.checked = true;
|
||||
limitTabs.checked = false;
|
||||
userTabs.value = "15";
|
||||
}
|
||||
else if (prefBox.value == 1)
|
||||
{
|
||||
allowTabs.checked = false;
|
||||
limitTabs.checked = false;
|
||||
userTabs.value = "15";
|
||||
}
|
||||
else
|
||||
{
|
||||
allowTabs.checked = true;
|
||||
limitTabs.checked = true;
|
||||
userTabs.value = prefBox.value;
|
||||
}
|
||||
limitTabs.disabled = ! allowTabs.checked;
|
||||
userTabs.disabled = ! (allowTabs.checked && limitTabs.checked);
|
||||
}
|
||||
|
||||
function updatePMTabPref()
|
||||
{
|
||||
var allowTabs = document.getElementById("czCreateTabsForPMs");
|
||||
var limitTabs = document.getElementById("czLimitPMTabs");
|
||||
var userTabs = document.getElementById("csPMTabLimitUser");
|
||||
var prefBox = document.getElementById("czPMTabLimit");
|
||||
|
||||
if (allowTabs.checked)
|
||||
{
|
||||
if (limitTabs.checked)
|
||||
prefBox.value = userTabs.value;
|
||||
else
|
||||
prefBox.value = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
prefBox.value = "1";
|
||||
}
|
||||
limitTabs.disabled = ! allowTabs.checked;
|
||||
userTabs.disabled = ! (allowTabs.checked && limitTabs.checked);
|
||||
|
||||
if (! userTabs.disabled)
|
||||
userTabs.focus();
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
headertitle="&interface.window.title;">
|
||||
|
||||
<script src="chrome://chatzilla/content/prefpanel/interface.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czPMTabLimit", "czFocusPMs", "czConL",
|
||||
"czScrollback1", "czScrollback2", "czScrollback3",
|
||||
"czScrollback4"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox align="start">
|
||||
<caption label="&tabs.title;"/>
|
||||
|
||||
<vbox>
|
||||
<checkbox id="czCreateTabsForPMs" label="&tabs.createForPMs.label;"
|
||||
accesskey="&tabs.createForPMs.accesskey;" oncommand="updatePMTabPref();"/>
|
||||
<hbox class="indent">
|
||||
<checkbox id="czLimitPMTabs" label="&tabs.limitPMTabs.label;"
|
||||
accesskey="&tabs.limitPMTabs.accesskey;" oncommand="updatePMTabPref();"/>
|
||||
<textbox id="csPMTabLimitUser" size="5" oninput="updatePMTabPref();"/>
|
||||
<textbox id="czPMTabLimit" hidden="true" prefdefval="15"
|
||||
preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.newTabLimit"/>
|
||||
<!-- Set to 0 for unlimited tabs, and 1 for no PM tabs. -->
|
||||
</hbox>
|
||||
</vbox>
|
||||
<checkbox id="czFocusPMs" label="&tabs.focusPMs.label;"
|
||||
accesskey="&tabs.focusPMs.accesskey;" prefdefval="false"
|
||||
prefstring="extensions.irc.raiseNewTab"/>
|
||||
<checkbox id="czConL" label="&tabs.closeOnLeave.label;"
|
||||
accesskey="&tabs.closeOnLeave.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.deleteOnPart"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&scrollback.title;"/>
|
||||
<vbox>
|
||||
<label>&scrollback.label;</label>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/><column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&scrollback.1.label;" control="czScrollback1"
|
||||
accesskey="&scrollback.1.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback1" size="5" preftype="int"
|
||||
prefattribute="value" prefdefval="200"
|
||||
prefstring="extensions.irc.views.client.maxlines"
|
||||
/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.2.label;" control="czScrollback2"
|
||||
accesskey="&scrollback.2.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback2" size="5" preftype="int"
|
||||
prefattribute="value" prefdefval="100"
|
||||
prefstring="extensions.irc.views.network.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.3.label;" control="czScrollback3"
|
||||
accesskey="&scrollback.3.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback3" size="5" preftype="int"
|
||||
prefattribute="value" prefdefval="300"
|
||||
prefstring="extensions.irc.views.channel.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.4.label;" control="czScrollback4"
|
||||
accesskey="&scrollback.4.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback4" size="5" preftype="int"
|
||||
prefattribute="value" prefdefval="200"
|
||||
prefstring="extensions.irc.views.chanuser.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,73 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var strBundle;
|
||||
|
||||
function getMsg (msgName)
|
||||
{
|
||||
var restCount = arguments.length - 1;
|
||||
|
||||
if (!strBundle)
|
||||
{
|
||||
strBundle =
|
||||
srGetStrBundle("chrome://chatzilla/locale/chatzilla.properties");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (restCount == 1 && arguments[1] instanceof Array)
|
||||
{
|
||||
return strBundle.formatStringFromName (msgName, arguments[1],
|
||||
arguments[1].length);
|
||||
}
|
||||
else if (restCount > 0)
|
||||
{
|
||||
var subPhrases = new Array();
|
||||
for (var i = 1; i < arguments.length; ++i)
|
||||
subPhrases.push(arguments[i]);
|
||||
return strBundle.formatStringFromName (msgName, subPhrases,
|
||||
subPhrases.length);
|
||||
}
|
||||
|
||||
return strBundle.GetStringFromName (msgName);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
dump ("caught exception getting value for ``" + msgName + "''\n" + ex);
|
||||
return msgName;
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://chatzilla/content/prefpanel/pref-irc.xul');"
|
||||
headertitle="&pref-irc.window.title;">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czNickname", "czUsername", "czDesc",
|
||||
"czNotify", "czDisplayCollapse", "czDisplayCopyMsgs",
|
||||
"czReconnect", "czColorCodes", "czNickCompleteStr", "czCharset"];
|
||||
|
||||
const OSBS_CTRID = "@mozilla.org/observer-service;1";
|
||||
const nsIObserverService = Components.interfaces.nsIObserverService;
|
||||
var observerService =
|
||||
Components.classes[OSBS_CTRID].getService(nsIObserverService);
|
||||
observerService.notifyObservers(null, "charsetmenu-selected", "other");
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&userDetails.title;"/>
|
||||
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column/><column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&userDetails.nick.label;" control="czNickname"
|
||||
accesskey="&userDetails.nick.accesskey;"/><hbox>
|
||||
<textbox id="czNickname" size="20" prefdefval="IRCMonkey"
|
||||
prefstring="extensions.irc.nickname"/><spacer/></hbox>
|
||||
</row><row align="center">
|
||||
<label value="&userDetails.name.label;" control="czUsername"
|
||||
accesskey="&userDetails.name.accesskey;"/><hbox>
|
||||
<textbox id="czUsername" size="20" prefdefval="chatzilla"
|
||||
prefstring="extensions.irc.username"/><spacer/></hbox>
|
||||
</row><row align="center">
|
||||
<label value="&userDetails.desc.label;" control="czDesc"
|
||||
accesskey="&userDetails.desc.accesskey;"/>
|
||||
<textbox id="czDesc" prefdefval="New Now Know How"
|
||||
prefstring="extensions.irc.desc"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox id="czUserHelpButton">
|
||||
<button label="&userDetails.help.label;"
|
||||
accesskey="&userDetails.help.accesskey;"
|
||||
oncommand="
|
||||
document.getElementById('czUserHelpButton').hidden = true;
|
||||
document.getElementById('czUserHelpBox').hidden = false;
|
||||
"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
<label id="czUserHelpBox" hidden="true">&userDetails.help.desc;</label>
|
||||
</groupbox>
|
||||
|
||||
<groupbox align="start">
|
||||
<caption label="&global.title;"/>
|
||||
|
||||
<checkbox id="czNotify" label="&global.notify.label;"
|
||||
accesskey="&global.notify.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.notify.aggressive"/>
|
||||
<checkbox id="czDisplayCollapse" label="&global.collapse.label;"
|
||||
accesskey="&global.collapse.accesskey;" prefdefval="false"
|
||||
prefstring="extensions.irc.collapseMsgs"/>
|
||||
<checkbox id="czDisplayCopyMsgs" label="&global.copyMsgs.label;"
|
||||
accesskey="&global.copyMsgs.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.copyMessages"/>
|
||||
<checkbox id="czReconnect" label="&global.reconnect.label;"
|
||||
accesskey="&global.reconnect.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.reconnect"/>
|
||||
<checkbox id="czColorCodes" label="&global.colorcodes.label;"
|
||||
accesskey="&global.colorcodes.accesskey;" prefdefval="false"
|
||||
prefstring="extensions.irc.outgoing.colorCodes"/>
|
||||
<separator/>
|
||||
<hbox align="center">
|
||||
<label value="&global.nickCompleteStr.label;" control="czNickCompleteStr"
|
||||
accesskey="&global.nickCompleteStr.accesskey;"/>
|
||||
<textbox id="czNickCompleteStr" size="5" prefdefval=","
|
||||
prefstring="extensions.irc.nickCompleteStr"/>
|
||||
</hbox>
|
||||
<label>&global.nickCompleteStr.desc;</label>
|
||||
</groupbox>
|
||||
<groupbox align="start">
|
||||
<caption label="&global.Charset.grouplabel;"/>
|
||||
<hbox align="center">
|
||||
<label value="&global.DefaultCharset.label;" accesskey="&global.DefaultCharset.accesskey;" control="DefaultCharsetList"/>
|
||||
<menulist id="czCharset" ref="NC:DecodersRoot" datasources="rdf:charset-menu"
|
||||
prefstring="extensions.irc.charset" preftype="localizedstring"
|
||||
wsm_attributes="value">
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
|
||||
</menupopup>
|
||||
</template>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,101 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
||||
function Init()
|
||||
{
|
||||
parent.initPanel("chrome://chatzilla/content/prefpanel/sound.xul");
|
||||
|
||||
var edit = document.getElementById("czSound1");
|
||||
selectSound(1, edit.getAttribute("prefvalue"));
|
||||
edit = document.getElementById("czSound2");
|
||||
selectSound(2, edit.getAttribute("prefvalue"));
|
||||
edit = document.getElementById("czSound3");
|
||||
selectSound(3, edit.getAttribute("prefvalue"));
|
||||
}
|
||||
|
||||
function onChooseFile(index)
|
||||
{
|
||||
try
|
||||
{
|
||||
var edit = document.getElementById("czSound" + index);
|
||||
var oldValue = edit.getAttribute("prefvalue");
|
||||
|
||||
var fpClass = Components.classes["@mozilla.org/filepicker;1"];
|
||||
var fp = fpClass.createInstance(nsIFilePicker);
|
||||
fp.init(window, getMsg("file_browse_Wave"), nsIFilePicker.modeOpen);
|
||||
|
||||
fp.appendFilter(getMsg("file_browse_Wave_spec"), "*.wav");
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
if ((fp.show() == nsIFilePicker.returnOK) && fp.fileURL.spec
|
||||
&& fp.fileURL.spec.length > 0)
|
||||
selectSound(index, fp.fileURL.spec);
|
||||
else
|
||||
selectSound(index, oldValue);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
dump ("caught exception in `onChooseFile`\n" + ex);
|
||||
}
|
||||
}
|
||||
|
||||
function selectSound(index, value)
|
||||
{
|
||||
var edit = document.getElementById("czSound" + index);
|
||||
var custom = document.getElementById("czSound" + index + "Custom");
|
||||
|
||||
edit.setAttribute("prefvalue", value);
|
||||
|
||||
var opts = edit.childNodes[0].childNodes;
|
||||
for (var i = 0; i < opts.length; i++)
|
||||
{
|
||||
if (opts[i].getAttribute("url") == value)
|
||||
{
|
||||
edit.selectedIndex = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
custom.hidden = false;
|
||||
custom.label = value;
|
||||
custom.setAttribute("url", value);
|
||||
edit.selectedIndex = 4;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
headertitle="&sound.window.title;" onload="Init();">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/pref-irc.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/sound.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czSound1", "czSound2", "czSound3"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox>
|
||||
<caption><label value="&sndSimpleMsg.title;" control="czSound1"
|
||||
accesskey="&sndSimpleMsg.accesskey;"/></caption>
|
||||
|
||||
<hbox flex="1" align="center">
|
||||
<label value="&sndFile.label;"/>
|
||||
<menulist id="czSound1" flex="1" crop="center" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
prefstring="extensions.irc.msgBeep" prefdefval="beep beep">
|
||||
<menupopup>
|
||||
<menuitem label="&sndPreset1.label;" url=""
|
||||
oncommand="selectSound(1, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset2.label;" url="beep"
|
||||
oncommand="selectSound(1, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset3.label;" url="beep beep"
|
||||
oncommand="selectSound(1, this.getAttribute('url'));"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="czSound1Custom" label="" crop="center" hidden="true"/>
|
||||
<menuitem label="&sndChoose.label;" oncommand="onChooseFile(1);"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption><label value="&sndPrivateMsg.title;" control="czSound2"
|
||||
accesskey="&sndPrivateMsg.accesskey;"/></caption>
|
||||
|
||||
<hbox flex="1" align="center">
|
||||
<label value="&sndFile.label;"/>
|
||||
<menulist id="czSound2" flex="1" crop="center" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
prefstring="extensions.irc.queryBeep" prefdefval="beep">
|
||||
<menupopup>
|
||||
<menuitem label="&sndPreset1.label;" url=""
|
||||
oncommand="selectSound(2, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset2.label;" url="beep"
|
||||
oncommand="selectSound(2, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset3.label;" url="beep beep"
|
||||
oncommand="selectSound(2, this.getAttribute('url'));"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="czSound2Custom" label="" crop="center" hidden="true"/>
|
||||
<menuitem label="&sndChoose.label;" oncommand="onChooseFile(2);"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption><label value="&sndStalkMsg.title;" control="czSound3"
|
||||
accesskey="&sndStalkMsg.accesskey;"/></caption>
|
||||
|
||||
<hbox flex="1" align="center">
|
||||
<label value="&sndFile.label;"/>
|
||||
<menulist id="czSound3" flex="1" crop="center" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
prefstring="extensions.irc.stalkBeep" prefdefval="beep">
|
||||
<menupopup>
|
||||
<menuitem label="&sndPreset1.label;" url=""
|
||||
oncommand="selectSound(3, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset2.label;" url="beep"
|
||||
oncommand="selectSound(3, this.getAttribute('url'));"/>
|
||||
<menuitem label="&sndPreset3.label;" url="beep beep"
|
||||
oncommand="selectSound(3, this.getAttribute('url'));"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="czSound3Custom" label="" crop="center" hidden="true"/>
|
||||
<menuitem label="&sndChoose.label;" oncommand="onChooseFile(3);"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,158 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function Init()
|
||||
{
|
||||
parent.initPanel("chrome://chatzilla/content/prefpanel/stalk.xul");
|
||||
loadList("StalkWords");
|
||||
}
|
||||
|
||||
function loadList(list)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
|
||||
var prefList = gList.getAttribute("prefvalue");
|
||||
|
||||
if (prefList)
|
||||
{
|
||||
var items = prefList.split(/\s*;\s*/);
|
||||
for (i in items)
|
||||
listAddItem(list, items[i]);
|
||||
}
|
||||
|
||||
listUpdateButtons(list);
|
||||
}
|
||||
|
||||
function addStalkWord()
|
||||
{
|
||||
var word = prompt(getMsg("stalk_add_msg"));
|
||||
|
||||
if (word)
|
||||
listAddItem("StalkWords", word);
|
||||
}
|
||||
|
||||
function listUpdateButtons(list)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
var gButtonAdd = document.getElementById("czAdd" + list);
|
||||
var gButtonDel = document.getElementById("czDel" + list);
|
||||
|
||||
if (gList.selectedItems && gList.selectedItems.length)
|
||||
gButtonDel.removeAttribute("disabled");
|
||||
else
|
||||
gButtonDel.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function listUpdate(list) {
|
||||
var gList = document.getElementById("cz" + list);
|
||||
|
||||
listUpdateButtons(list);
|
||||
|
||||
var prefList = "";
|
||||
|
||||
for (var item = gList.firstChild; item; item = item.nextSibling)
|
||||
{
|
||||
var url = item.getAttribute("url");
|
||||
if (prefList)
|
||||
prefList = prefList + "; " + url;
|
||||
else
|
||||
prefList = url;
|
||||
}
|
||||
gList.setAttribute("prefvalue", prefList);
|
||||
}
|
||||
|
||||
function listAdd(list) {
|
||||
if (list == "StalkWords")
|
||||
addStalkWord();
|
||||
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listDelete(list)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
gList.removeChild(selected);
|
||||
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listAddItem(list, url)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
var newItem = document.createElement("listitem");
|
||||
|
||||
var label = url;
|
||||
|
||||
newItem.setAttribute("label", label);
|
||||
newItem.setAttribute("url", url);
|
||||
|
||||
gList.appendChild(newItem);
|
||||
}
|
||||
|
||||
function listMoveUp(list)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
var before = selected.previousSibling;
|
||||
if (before)
|
||||
{
|
||||
before.parentNode.insertBefore(selected, before);
|
||||
gList.selectItem(selected);
|
||||
gList.ensureElementIsVisible(selected);
|
||||
}
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listMoveDown(list)
|
||||
{
|
||||
var gList = document.getElementById("cz" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
if (selected.nextSibling)
|
||||
{
|
||||
if (selected.nextSibling.nextSibling)
|
||||
gList.insertBefore(selected, selected.nextSibling.nextSibling);
|
||||
else
|
||||
gList.appendChild(selected);
|
||||
|
||||
gList.selectItem(selected);
|
||||
}
|
||||
listUpdate(list);
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
headertitle="&stalk.window.title;">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/pref-irc.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/stalk.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czStalkWords", "czStalkWholeWords"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox flex="1">
|
||||
<groupbox flex="1">
|
||||
<caption><label value="&stalkWords.title;" control="czStalkWords"
|
||||
accesskey="&stalkWords.accesskey;"/></caption>
|
||||
|
||||
<label>&stalkWords.label1;</label>
|
||||
<label>&stalkWords.label2;</label>
|
||||
|
||||
<hbox flex="1">
|
||||
<listbox id="czStalkWords" flex="1"
|
||||
style="width: 0px; height: 0px;" crop="center"
|
||||
prefstring="extensions.irc.stalkWords" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
onselect="listUpdateButtons('StalkWords');"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button id="czAddStalkWords" label="&list.add.label;"
|
||||
accesskey="&list.add.stalk.accesskey;"
|
||||
oncommand="listAdd('StalkWords');"/>
|
||||
<button id="czDelStalkWords" label="&list.del.label;"
|
||||
accesskey="&list.del.stalk.accesskey;"
|
||||
oncommand="listDelete('StalkWords');"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<checkbox id="czStalkWholeWords" label="&stalkWholeWords.label;"
|
||||
tooltiptext="&stalkWholeWords.tooltip;"
|
||||
accesskey="&stalkWholeWords.accesskey;" prefdefval="true"
|
||||
prefstring="extensions.irc.stalkWholeWords"/>
|
||||
|
||||
</vbox>
|
||||
</page>
|
||||
@@ -1,40 +0,0 @@
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var gFileBox;
|
||||
var gData;
|
||||
|
||||
function Init() {
|
||||
doSetOKCancel(onOK);
|
||||
|
||||
gFileBox = document.getElementById("czFileBox");
|
||||
|
||||
if ("arguments" in window && window.arguments[0]) {
|
||||
gData = window.arguments[0];
|
||||
}
|
||||
|
||||
gFileBox.focus();
|
||||
}
|
||||
|
||||
function onChooseFile() {
|
||||
try {
|
||||
var flClass = Components.classes["@mozilla.org/filepicker;1"];
|
||||
var fp = flClass.createInstance(nsIFilePicker);
|
||||
fp.init(window, getMsg("file_browse_Script"),
|
||||
nsIFilePicker.modeOpen);
|
||||
|
||||
fp.appendFilter(getMsg("file_browse_Script_spec"), "*.js");
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK && fp.fileURL.spec
|
||||
&& fp.fileURL.spec.length > 0)
|
||||
gFileBox.value = fp.fileURL.spec;
|
||||
}
|
||||
catch(ex) {
|
||||
}
|
||||
}
|
||||
|
||||
function onOK() {
|
||||
gData.url = gFileBox.value;
|
||||
gData.ok = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
class="dialog" style="width: 40em;"
|
||||
title="&startup-newScript.window.title;">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://chatzilla/content/prefpanel/startup-newScript.js"/>
|
||||
|
||||
<keyset id="dialogKeys"/>
|
||||
|
||||
<label value="&text.desc;"/>
|
||||
<hbox align="center">
|
||||
<textbox id="czFileBox" type="autocomplete" searchSessions="history"
|
||||
timeout="50" maxrows="6"
|
||||
disablehistory="true" flex="1"/>
|
||||
<button label="Choose File.." onclick="onChooseFile();"/>
|
||||
</hbox>
|
||||
|
||||
<separator/>
|
||||
|
||||
<hbox id="okCancelButtonsRight"/>
|
||||
|
||||
</window>
|
||||
@@ -1,168 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var gFileBox;
|
||||
var gData;
|
||||
var gType;
|
||||
var gServer;
|
||||
var gServerNeedPass;
|
||||
var gServerAlso;
|
||||
var gChannel;
|
||||
var gChannelIsNick;
|
||||
var gChannelNeedKey;
|
||||
|
||||
function Init()
|
||||
{
|
||||
doSetOKCancel(onOK);
|
||||
|
||||
gType = document.getElementById("czURLType");
|
||||
gServer = document.getElementById("czServer");
|
||||
gServerNeedPass = document.getElementById("czServerNeedPass");
|
||||
gServerAlso = document.getElementById("czServerAlso");
|
||||
gChannel = document.getElementById("czChannel");
|
||||
gChannelIsNick = document.getElementById("czChannelIsNick");
|
||||
gChannelNeedKey = document.getElementById("czChannelNeedKey");
|
||||
|
||||
if ("arguments" in window && window.arguments[0])
|
||||
gData = window.arguments[0];
|
||||
|
||||
if (! gData)
|
||||
gData = new Object();
|
||||
if (!("url" in gData) || !gData.url)
|
||||
gData.url = "irc:///";
|
||||
|
||||
if (gData.url == "irc:" || gData.url == "irc:/" || gData.url == "irc://")
|
||||
{
|
||||
gType.selectedItem = gType.mRadioChildren[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
gType.selectedItem = gType.mRadioChildren[0];
|
||||
gChannelIsNick.selectedItem = gChannelIsNick.mRadioChildren[0];
|
||||
|
||||
// Split it up into server/channel parts...
|
||||
var params = gData.url.match(/^irc:\/\/(.*)\/([^,]*)(.*)?$/);
|
||||
gServer.value = params[1];
|
||||
gChannel.value = params[2];
|
||||
gServerAlso.checked = (gChannel.value != '');
|
||||
|
||||
if (params.length >= 4)
|
||||
{
|
||||
var modifiers = params[3].split(/,/);
|
||||
|
||||
for (m in modifiers)
|
||||
{
|
||||
if (modifiers[m] == 'needpass')
|
||||
gServerNeedPass.checked = true;
|
||||
|
||||
if (modifiers[m] == 'isnick')
|
||||
gChannelIsNick.selectedItem = gChannelIsNick.mRadioChildren[1];
|
||||
|
||||
if (modifiers[m] == 'needkey')
|
||||
gChannelNeedKey.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateType();
|
||||
|
||||
gData.ok = false;
|
||||
}
|
||||
|
||||
function updateType()
|
||||
{
|
||||
if (gType.value == "normal")
|
||||
{
|
||||
gServer.removeAttribute("disabled");
|
||||
gServerNeedPass.removeAttribute("disabled");
|
||||
gServerAlso.removeAttribute("disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
gServer.setAttribute("disabled", "true");
|
||||
gServerNeedPass.setAttribute("disabled", "true");
|
||||
gServerAlso.setAttribute("disabled", "true");
|
||||
}
|
||||
if ((gType.value == "normal") && gServerAlso.checked)
|
||||
{
|
||||
gChannel.removeAttribute("disabled");
|
||||
gChannelIsNick.childNodes[1].removeAttribute("disabled");
|
||||
gChannelIsNick.childNodes[5].removeAttribute("disabled");
|
||||
if (gChannelIsNick.value == "channel")
|
||||
gChannelNeedKey.removeAttribute("disabled");
|
||||
else
|
||||
gChannelNeedKey.setAttribute("disabled", "true");
|
||||
gServer.focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
gChannel.setAttribute("disabled", "true");
|
||||
gChannelIsNick.childNodes[1].setAttribute("disabled", "true");
|
||||
gChannelIsNick.childNodes[5].setAttribute("disabled", "true");
|
||||
gChannelNeedKey.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
||||
function onOK()
|
||||
{
|
||||
if (gType.value == "normal")
|
||||
{
|
||||
gData.url = "irc://" + gServer.value + "/";
|
||||
|
||||
if (gServerAlso.checked)
|
||||
{
|
||||
gData.url += gChannel.value;
|
||||
|
||||
if ((gChannelIsNick.value == "channel") &&
|
||||
(gChannelNeedKey.checked))
|
||||
gData.url += ",needkey";
|
||||
|
||||
if (gChannelIsNick.value == "nickname")
|
||||
gData.url += ",isnick";
|
||||
}
|
||||
if (gServerNeedPass.checked)
|
||||
gData.url += ",needpass";
|
||||
}
|
||||
else
|
||||
{
|
||||
gData.url = "irc://";
|
||||
}
|
||||
gData.ok = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
onload="Init();"
|
||||
class="dialog" style=" width: 25em; "
|
||||
title="&startup-newURL.window.title;">
|
||||
|
||||
<script src="chrome://chatzilla/content/prefpanel/startup-newURL.js"/>
|
||||
|
||||
<keyset id="dialogKeys"/>
|
||||
|
||||
<radiogroup id="czURLType" onselect="updateType();">
|
||||
<radio value="normal" label="&normal.label;"/>
|
||||
<vbox class="indent">
|
||||
<vbox style=" x-width: 22em; ">
|
||||
<label>&normal.server;</label>
|
||||
<textbox id="czServer" size="5"/>
|
||||
<checkbox id="czServerNeedPass" label="&normal.needpass.label;"/>
|
||||
</vbox>
|
||||
<groupbox>
|
||||
<caption><checkbox id="czServerAlso" label="&normal.channel.label;"
|
||||
oncommand="updateType();"/></caption>
|
||||
|
||||
<radiogroup id="czChannelIsNick" orient="horizontal"
|
||||
onselect="updateType();" align="center">
|
||||
<spacer flex="1"/>
|
||||
<radio value="channel" label="&normal.ischan.label;"/>
|
||||
<spacer flex="1"/>
|
||||
<label value="&normal.isor.label;"/>
|
||||
<spacer flex="1"/>
|
||||
<radio value="nickname" label="&normal.isnick.label;" flex="1"/>
|
||||
<spacer flex="1"/>
|
||||
</radiogroup>
|
||||
<textbox id="czChannel"/>
|
||||
<checkbox id="czChannelNeedKey" label="&normal.needkey.label;"/>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
<radio value="client" label="&client.label;"/>
|
||||
<vbox class="indent">
|
||||
<label>&client.desc;</label>
|
||||
</vbox>
|
||||
</radiogroup>
|
||||
|
||||
<separator/>
|
||||
|
||||
<hbox id="okCancelButtonsRight"/>
|
||||
|
||||
</window>
|
||||
@@ -1,284 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* ____________________________________________.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* James Ross, <twpol@aol.com>, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
||||
function Init()
|
||||
{
|
||||
parent.initPanel("chrome://chatzilla/content/prefpanel/startup.xul");
|
||||
loadList("Scripts");
|
||||
loadList("URLs");
|
||||
}
|
||||
|
||||
function loadList(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
|
||||
var prefList = gList.getAttribute("prefvalue");
|
||||
|
||||
if (prefList.search(/\S/) != -1)
|
||||
{
|
||||
var items = prefList.split(/\s*;\s*/);
|
||||
for (var i = 0; i < items.length; i++)
|
||||
listAddItem(list, items[i]);
|
||||
}
|
||||
|
||||
listUpdateButtons(list);
|
||||
}
|
||||
|
||||
function getIRCDisplayText(url)
|
||||
{
|
||||
var params;
|
||||
|
||||
// NOTE: This code (by design) ignores all the irc:// modifiers except
|
||||
// 'isnick'. Showing the others can be added later, if needed.
|
||||
|
||||
// FIXME: Localization support here (getMsg).
|
||||
|
||||
if ((url == "irc:" || url == "irc:/" || url == "irc://"))
|
||||
return "Client view";
|
||||
|
||||
if ((url == "irc:///"))
|
||||
return "Default network";
|
||||
|
||||
if ((params = url.match(/^irc:\/\/\/([^,]*)(.*),isnick(,.*)?$/)))
|
||||
return params[2] + " nickname on default network";
|
||||
|
||||
if ((params = url.match(/^irc:\/\/\/([^,]+)/)))
|
||||
return params[1] + " channel on default network";
|
||||
|
||||
if ((params = url.match(/^irc:\/\/(.*)\/(,.*)?$/)))
|
||||
return params[1] + " network";
|
||||
|
||||
if ((params = url.match(/^irc:\/\/(.*)\/([^,]*)(.*),isnick(,.*)?$/)))
|
||||
return params[2] + " nickname on " + params[1];
|
||||
|
||||
if ((params = url.match(/^irc:\/\/(.*)\/([^,]+)/)))
|
||||
return params[2] + " channel on " + params[1];
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
function addScript()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fpClass = Components.classes["@mozilla.org/filepicker;1"];
|
||||
var fp = fpClass.createInstance(nsIFilePicker);
|
||||
fp.init(window, getMsg("file_browse_Script"), nsIFilePicker.modeOpen);
|
||||
|
||||
fp.appendFilter(getMsg("file_browse_Script_spec"), "*.js");
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK && fp.fileURL.spec &&
|
||||
fp.fileURL.spec.length > 0)
|
||||
listAddItem("Scripts", fp.fileURL.spec);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
dump ("caught exception in `addScript`\n" + ex);
|
||||
}
|
||||
}
|
||||
|
||||
function addURL()
|
||||
{
|
||||
var gData = new Object();
|
||||
|
||||
window.openDialog("chrome://chatzilla/content/prefpanel/startup-newURL.xul",
|
||||
"czAddURL", "chrome,modal,resizable=no", gData);
|
||||
|
||||
if (gData.ok)
|
||||
listAddItem("URLs", gData.url);
|
||||
}
|
||||
|
||||
function editURL()
|
||||
{
|
||||
var gData = new Object();
|
||||
var gList = document.getElementById("czInitialURLs");
|
||||
|
||||
if (gList.selectedItems.length == 0)
|
||||
return;
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
|
||||
gData.url = selected.getAttribute("url");
|
||||
|
||||
window.openDialog("chrome://chatzilla/content/prefpanel/startup-newURL.xul",
|
||||
"czEditURL", "chrome,modal,resizable=no", gData);
|
||||
|
||||
if (gData.ok)
|
||||
{
|
||||
selected.setAttribute("label", getIRCDisplayText(gData.url));
|
||||
selected.setAttribute("url", gData.url);
|
||||
}
|
||||
}
|
||||
|
||||
function listUpdateButtons(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
var gButtonUp = document.getElementById("czUp" + list);
|
||||
var gButtonDn = document.getElementById("czDn" + list);
|
||||
var gButtonAdd = document.getElementById("czAdd" + list);
|
||||
var gButtonEdit = document.getElementById("czEdit" + list);
|
||||
var gButtonDel = document.getElementById("czDel" + list);
|
||||
|
||||
if (gList.selectedItems && gList.selectedItems.length)
|
||||
{
|
||||
if (gButtonEdit) gButtonEdit.removeAttribute("disabled");
|
||||
gButtonDel.removeAttribute("disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gButtonEdit) gButtonEdit.setAttribute("disabled", "true");
|
||||
gButtonDel.setAttribute("disabled", "true");
|
||||
}
|
||||
if (gList.selectedItems.length == 0 || gList.selectedIndex == 0)
|
||||
{
|
||||
gButtonUp.setAttribute("disabled", "true");
|
||||
}
|
||||
else
|
||||
{
|
||||
gButtonUp.removeAttribute("disabled");
|
||||
}
|
||||
if (gList.selectedItems.length == 0 ||
|
||||
gList.selectedIndex == gList.childNodes.length - 1)
|
||||
{
|
||||
gButtonDn.setAttribute("disabled", "true");
|
||||
}
|
||||
else
|
||||
{
|
||||
gButtonDn.removeAttribute("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function listUpdate(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
|
||||
listUpdateButtons(list);
|
||||
|
||||
var prefList = "";
|
||||
|
||||
for (var item = gList.firstChild; item; item = item.nextSibling)
|
||||
{
|
||||
var url = escape(item.getAttribute("url"));
|
||||
if (prefList)
|
||||
prefList = prefList + "; " + url;
|
||||
else
|
||||
prefList = url;
|
||||
}
|
||||
gList.setAttribute("prefvalue", prefList);
|
||||
}
|
||||
|
||||
function listAdd(list)
|
||||
{
|
||||
if (list == "Scripts")
|
||||
addScript();
|
||||
else if (list == "URLs")
|
||||
addURL();
|
||||
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listEdit(list)
|
||||
{
|
||||
if (list == "URLs")
|
||||
editURL();
|
||||
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listDelete(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
gList.removeChild(selected);
|
||||
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listAddItem(list, url)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
var newItem = document.createElement("listitem");
|
||||
|
||||
url = unescape(url);
|
||||
var label = url;
|
||||
if (list == "URLs")
|
||||
label = getIRCDisplayText(url);
|
||||
|
||||
if (list == "Scripts")
|
||||
newItem.setAttribute("crop", "center");
|
||||
|
||||
newItem.setAttribute("label", label);
|
||||
newItem.setAttribute("url", url);
|
||||
|
||||
gList.appendChild(newItem);
|
||||
}
|
||||
|
||||
function listMoveUp(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
var before = selected.previousSibling;
|
||||
if (before)
|
||||
{
|
||||
before.parentNode.insertBefore(selected, before);
|
||||
gList.selectItem(selected);
|
||||
gList.ensureElementIsVisible(selected);
|
||||
}
|
||||
listUpdate(list);
|
||||
}
|
||||
|
||||
function listMoveDown(list)
|
||||
{
|
||||
var gList = document.getElementById("czInitial" + list);
|
||||
|
||||
var selected = gList.selectedItems[0];
|
||||
if (selected.nextSibling)
|
||||
{
|
||||
if (selected.nextSibling.nextSibling)
|
||||
gList.insertBefore(selected, selected.nextSibling.nextSibling);
|
||||
else
|
||||
gList.appendChild(selected);
|
||||
|
||||
gList.selectItem(selected);
|
||||
}
|
||||
listUpdate(list);
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Init();"
|
||||
headertitle="&startup.window.title;">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/pref-irc.js"/>
|
||||
<script src="chrome://chatzilla/content/prefpanel/startup.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czInitialScripts", "czInitialURLs"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<label>&startupOrder.label;</label>
|
||||
|
||||
<groupbox flex="1">
|
||||
<caption><label value="&autoScripts.title;" control="czInitialScripts"
|
||||
accesskey="&autoScripts.accesskey;"/></caption>
|
||||
|
||||
<hbox flex="1">
|
||||
<listbox id="czInitialScripts" flex="1" prefdefval=""
|
||||
style="width: 0px; height: 0px;" crop="center"
|
||||
prefstring="extensions.irc.initialScripts" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
onselect="listUpdateButtons('Scripts');"/>
|
||||
<vbox>
|
||||
<button id="czUpScripts" label="&list.up.label;" class="up"
|
||||
accesskey="&list.up.script.accesskey;"
|
||||
oncommand="listMoveUp('Scripts');"/>
|
||||
<button id="czDnScripts" label="&list.dn.label;" class="down"
|
||||
accesskey="&list.dn.script.accesskey;"
|
||||
oncommand="listMoveDown('Scripts');"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button id="czAddScripts" label="&list.add.label;"
|
||||
accesskey="&list.add.script.accesskey;"
|
||||
oncommand="listAdd('Scripts');"/>
|
||||
<button id="czDelScripts" label="&list.del.label;"
|
||||
accesskey="&list.del.script.accesskey;"
|
||||
oncommand="listDelete('Scripts');"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<groupbox flex="1">
|
||||
<caption><label value="&autoURLs.title;" control="czInitialURLs"
|
||||
accesskey="&autoURLs.accesskey;"/></caption>
|
||||
|
||||
<hbox flex="1">
|
||||
<listbox id="czInitialURLs" flex="1" prefdefval="irc:///"
|
||||
style="width: 0px; height: 0px;"
|
||||
prefstring="extensions.irc.initialURLs" preftype="string"
|
||||
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||||
onselect="listUpdateButtons('URLs');" ondblclick="listEdit('URLs');"/>
|
||||
<vbox>
|
||||
<button id="czUpURLs" label="&list.up.label;" class="up"
|
||||
accesskey="&list.up.server.accesskey;"
|
||||
oncommand="listMoveUp('URLs');"/>
|
||||
<button id="czDnURLs" label="&list.dn.label;" class="down"
|
||||
accesskey="&list.dn.server.accesskey;"
|
||||
oncommand="listMoveDown('URLs');"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button id="czAddURLs" label="&list.add.label;"
|
||||
accesskey="&list.add.server.accesskey;"
|
||||
oncommand="listAdd('URLs');"/>
|
||||
<button id="czEditURLs" label="&list.edit.label;"
|
||||
accesskey="&list.edit.accesskey;"
|
||||
oncommand="listEdit('URLs');"/>
|
||||
<button id="czDelURLs" label="&list.del.label;"
|
||||
accesskey="&list.del.server.accesskey;"
|
||||
oncommand="listDelete('URLs');"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,114 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License Version
|
||||
- 1.1 (the "License"); you may not use this file except in compliance with
|
||||
- the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is ChatZilla.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- ____________________________________________.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2002
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://chatzilla/content/prefpanel/tabs.xul');"
|
||||
headertitle="&tabs.window.title;">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czPMTabLimit", "czFocusPMs", "czConL",
|
||||
"czScrollback1", "czScrollback2", "czScrollback3",
|
||||
"czScrollback4"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox align="start">
|
||||
<caption label="&tabs.title;"/>
|
||||
|
||||
<vbox>
|
||||
<checkbox id="czCreateTabsForPMs" label="&tabs.createForPMs.label;"
|
||||
accesskey="&tabs.createForPMs.accesskey;"/>
|
||||
<hbox class="indent">
|
||||
<checkbox id="czLimitPMTabs" label="&tabs.limitPMTabs.label;"
|
||||
accesskey="&tabs.limitPMTabs.accesskey;"/>
|
||||
<textbox id="czPMTabLimit" size="5"
|
||||
preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.newTabLimit"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<checkbox id="czFocusPMs" label="&tabs.focusPMs.label;"
|
||||
accesskey="&tabs.focusPMs.accesskey;"
|
||||
prefstring="extensions.irc.raiseNewTab"/>
|
||||
<checkbox id="czConL" label="&tabs.closeOnLeave.label;"
|
||||
accesskey="&tabs.closeOnLeave.accesskey;"
|
||||
prefstring="extensions.irc.deleteOnPart"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&scrollback.title;"/>
|
||||
<vbox>
|
||||
<label>&scrollback.label;</label>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/><column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&scrollback.1.label;"
|
||||
accesskey="&scrollback.1.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback1" size="5" preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.views.client.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.2.label;"
|
||||
accesskey="&scrollback.2.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback2" size="5" preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.views.network.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.3.label;"
|
||||
accesskey="&scrollback.3.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback3" size="5" preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.views.channel.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&scrollback.4.label;"
|
||||
accesskey="&scrollback.4.accesskey;"/><hbox>
|
||||
<textbox id="czScrollback4" size="5" preftype="int" prefattribute="value"
|
||||
prefstring="extensions.irc.views.chanuser.maxlines"/><spacer/></hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,111 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<!DOCTYPE page SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://chatzilla/content/prefpanel/text.xul');"
|
||||
headertitle="&text.window.title;">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["czMungerBold", "czMungerItalic", "czMungerUnderline",
|
||||
"czMungerTeletype", "czMungerWeb", "czMungerMail", "czMungerChannels",
|
||||
"czMungerBugzilla", "czMungerEmoti", "czMungerColors", "czMungerWrap",
|
||||
"czDisplayCollapse", "czDisplayCopyMsgs"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&prePro.title;"/>
|
||||
<label>&prePro.desc;</label>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/><column flex="1"/><column flex="1"/><column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&prePro.styles;"/>
|
||||
<checkbox id="czMungerBold" label="Bold" accesskey="B"
|
||||
prefstring="extensions.irc.munger.bold"/>
|
||||
<checkbox id="czMungerItalic" label="Italic" accesskey="I"
|
||||
prefstring="extensions.irc.munger.italic"/>
|
||||
<checkbox id="czMungerUnderline" label="Underline" accesskey="U"
|
||||
prefstring="extensions.irc.munger.underline"/>
|
||||
<checkbox id="czMungerTeletype" label="Teletype" accesskey="T"
|
||||
prefstring="extensions.irc.munger.teletype"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&prePro.links;"/>
|
||||
<checkbox id="czMungerWeb" label="Web" accesskey="W"
|
||||
prefstring="extensions.irc.munger.link"/>
|
||||
<checkbox id="czMungerMail" label="Mail" accesskey="M"
|
||||
prefstring="extensions.irc.munger.mailto"/>
|
||||
<checkbox id="czMungerChannels" label="Channels" accesskey="C"
|
||||
prefstring="extensions.irc.munger.channel-link"/>
|
||||
<checkbox id="czMungerBugzilla" label="Bugzilla" accesskey="z"
|
||||
prefstring="extensions.irc.munger.bugzilla-link"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<label value="&prePro.otherOptions;"/>
|
||||
<vbox class="indent" align="start">
|
||||
<checkbox id="czMungerEmoti" label="&prePro.emoti;" accesskey="e"
|
||||
prefstring="extensions.irc.munger.face"/>
|
||||
<checkbox id="czMungerColors" label="&prePro.colors;" accesskey="c"
|
||||
prefstring="extensions.irc.munger.colorCodes"/>
|
||||
<checkbox id="czMungerWrap" label="&prePro.wrap;" accesskey="W"
|
||||
prefstring="extensions.irc.munger.word-hyphenator"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox align="start">
|
||||
<caption label="&text.title;"/>
|
||||
<label>&text.desc;</label>
|
||||
|
||||
<checkbox id="czDisplayCollapse" label="&text.collapse;" accesskey="l"
|
||||
prefstring="extensions.irc.views.collapseMsgs"/>
|
||||
<checkbox id="czDisplayCopyMsgs" label="&text.copyMsgs;" accesskey="p"
|
||||
prefstring="extensions.irc.views.copyMessages"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&style.title;"/>
|
||||
<label>&style.desc;</label>
|
||||
|
||||
<textbox/>
|
||||
</groupbox>
|
||||
</page>
|
||||
@@ -1,514 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
const DEFAULT_NICK = "IRCMonkey"
|
||||
|
||||
function initPrefs()
|
||||
{
|
||||
client.prefManager = new PrefManager("extensions.irc.");
|
||||
client.prefManagers = [client.prefManager];
|
||||
|
||||
client.prefs = client.prefManager.prefs;
|
||||
|
||||
var profilePath = getSpecialDirectory("ProfD");
|
||||
profilePath.append("chatzilla");
|
||||
|
||||
client.prefManager.addPref("profilePath", profilePath.path);
|
||||
|
||||
profilePath = new nsLocalFile(client.prefs["profilePath"]);
|
||||
|
||||
if (!profilePath.exists())
|
||||
mkdir(profilePath);
|
||||
|
||||
client.prefManager.profilePath = profilePath;
|
||||
|
||||
var scriptPath = profilePath.clone();
|
||||
scriptPath.append("scripts");
|
||||
if (!scriptPath.exists())
|
||||
mkdir(scriptPath);
|
||||
client.prefManager.scriptPath = scriptPath;
|
||||
|
||||
var logPath = profilePath.clone();
|
||||
logPath.append("logs");
|
||||
if (!logPath.exists())
|
||||
mkdir(logPath);
|
||||
client.prefManager.logPath = logPath;
|
||||
|
||||
var logDefault = client.prefManager.logPath.clone();
|
||||
logDefault.append(escapeFileName("client.log"));
|
||||
|
||||
var prefs =
|
||||
[
|
||||
["aliases", []],
|
||||
["bugURL", "http://bugzilla.mozilla.org/show_bug.cgi?id=%s"],
|
||||
["channelHeader", true],
|
||||
["channelLog", false],
|
||||
["channelMaxLines", 500],
|
||||
["charset", "utf-8"],
|
||||
["clientMaxLines", 200],
|
||||
["collapseMsgs", false],
|
||||
["copyMessages", true],
|
||||
["debugMode", ""],
|
||||
["desc", "New Now Know How"],
|
||||
["deleteOnPart", true],
|
||||
["displayHeader", true],
|
||||
["guessCommands", true],
|
||||
["focusChannelOnJoin", true],
|
||||
["initialURLs", []],
|
||||
["initialScripts", [getURLSpecFromFile(scriptPath.path)]],
|
||||
["log", false],
|
||||
["logFileName", logDefault.path],
|
||||
["messages.click", "goto-url"],
|
||||
["messages.ctrlClick", "goto-url-newwin"],
|
||||
["messages.metaClick", "goto-url-newtab"],
|
||||
["motif.dark", "chrome://chatzilla/skin/output-dark.css"],
|
||||
["motif.light", "chrome://chatzilla/skin/output-light.css"],
|
||||
["motif.default", "chrome://chatzilla/skin/output-default.css"],
|
||||
["motif.current", "chrome://chatzilla/skin/output-default.css"],
|
||||
["msgBeep", "beep beep"],
|
||||
["multiline", false],
|
||||
["munger.colorCodes", true],
|
||||
["networkHeader", true],
|
||||
["networkLog", false],
|
||||
["networkMaxLines", 200],
|
||||
["newTabLimit", 15],
|
||||
["notify.aggressive", true],
|
||||
["nickCompleteStr", ":"],
|
||||
["nickname", DEFAULT_NICK],
|
||||
["outgoing.colorCodes", false],
|
||||
["outputWindowURL", "chrome://chatzilla/content/output-window.html"],
|
||||
["queryBeep", "beep"],
|
||||
["raiseNewTab", false],
|
||||
["reconnect", true],
|
||||
["stalkBeep", "beep"],
|
||||
["stalkWholeWords", true],
|
||||
["stalkWords", []],
|
||||
["username", "chatzilla"],
|
||||
["usermode", "+ix"],
|
||||
["userHeader", true],
|
||||
["userLog", false],
|
||||
["userMaxLines", 200]
|
||||
];
|
||||
|
||||
client.prefManager.addPrefs(prefs);
|
||||
client.prefManager.onPrefChanged = onPrefChanged;
|
||||
|
||||
CIRCNetwork.prototype.stayingPower = client.prefs["reconnect"];
|
||||
CIRCNetwork.prototype.INITIAL_NICK = client.prefs["nickname"];
|
||||
CIRCNetwork.prototype.INITIAL_NAME = client.prefs["username"];
|
||||
CIRCNetwork.prototype.INITIAL_DESC = client.prefs["desc"];
|
||||
CIRCNetwork.prototype.INITIAL_UMODE = client.prefs["usermode"];
|
||||
CIRCNetwork.prototype.MAX_MESSAGES = client.prefs["networkMaxLines"];
|
||||
CIRCChannel.prototype.MAX_MESSAGES = client.prefs["channelMaxLines"];
|
||||
CIRCChanUser.prototype.MAX_MESSAGES = client.prefs["userMaxLines"];
|
||||
client.MAX_MESSAGES = client.prefs["clientMaxLines"];
|
||||
client.charset = client.prefs["charset"];
|
||||
|
||||
initAliases();
|
||||
}
|
||||
|
||||
function pref_mungeName(name)
|
||||
{
|
||||
return escape(name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase());
|
||||
}
|
||||
|
||||
function getNetworkPrefManager(network)
|
||||
{
|
||||
function defer(prefName)
|
||||
{
|
||||
return client.prefs[prefName];
|
||||
};
|
||||
|
||||
function onPrefChanged(prefName, newValue, oldValue)
|
||||
{
|
||||
onNetworkPrefChanged (network, prefName, newValue, oldValue);
|
||||
};
|
||||
|
||||
var logDefault = client.prefManager.logPath.clone();
|
||||
logDefault.append(escapeFileName(pref_mungeName(network.name)) + ".log");
|
||||
|
||||
var prefs =
|
||||
[
|
||||
["charset", defer],
|
||||
["collapseMsgs", defer],
|
||||
["desc", defer],
|
||||
["displayHeader", client.prefs["networkHeader"]],
|
||||
["log", client.prefs["networkLog"]],
|
||||
["logFileName", logDefault.path],
|
||||
["motif.current", defer],
|
||||
["nickname", defer],
|
||||
["outputWindowURL", defer],
|
||||
["reconnect", defer],
|
||||
["username", defer],
|
||||
["usermode", defer]
|
||||
];
|
||||
|
||||
var branch = "extensions.irc.networks." + pref_mungeName(network.name) +
|
||||
".";
|
||||
var prefManager = new PrefManager(branch);
|
||||
prefManager.addPrefs(prefs);
|
||||
prefManager.onPrefChanged = onPrefChanged;
|
||||
|
||||
network.INITIAL_NICK = prefManager.prefs["nickname"];
|
||||
network.INITIAL_NAME = prefManager.prefs["username"];
|
||||
network.INITIAL_DESC = prefManager.prefs["desc"];
|
||||
network.INITIAL_UMODE = prefManager.prefs["usermode"];
|
||||
network.stayingPower = prefManager.prefs["reconnect"];
|
||||
|
||||
client.prefManagers.push(prefManager);
|
||||
|
||||
return prefManager;
|
||||
}
|
||||
|
||||
function getChannelPrefManager(channel)
|
||||
{
|
||||
var network = channel.parent.parent;
|
||||
|
||||
function defer(prefName)
|
||||
{
|
||||
return network.prefs[prefName];
|
||||
};
|
||||
|
||||
function onPrefChanged(prefName, newValue, oldValue)
|
||||
{
|
||||
onChannelPrefChanged (channel, prefName, newValue, oldValue);
|
||||
};
|
||||
|
||||
var logDefault = client.prefManager.logPath.clone();
|
||||
var filename = pref_mungeName(network.name) + "," +
|
||||
pref_mungeName(channel.name);
|
||||
|
||||
logDefault.append(escapeFileName(filename) + ".log");
|
||||
|
||||
var prefs =
|
||||
[
|
||||
["charset", defer],
|
||||
["collapseMsgs", defer],
|
||||
["displayHeader", client.prefs["channelHeader"]],
|
||||
["log", client.prefs["channelLog"]],
|
||||
["logFileName", logDefault.path],
|
||||
["motif.current", defer],
|
||||
["outputWindowURL", defer]
|
||||
];
|
||||
|
||||
var branch = "extensions.irc.networks." + pref_mungeName(network.name) +
|
||||
".channels." + pref_mungeName(channel.normalizedName) + "."
|
||||
var prefManager = new PrefManager(branch);
|
||||
prefManager.addPrefs(prefs);
|
||||
prefManager.onPrefChanged = onPrefChanged;
|
||||
|
||||
client.prefManagers.push(prefManager);
|
||||
|
||||
return prefManager;
|
||||
}
|
||||
|
||||
function getUserPrefManager(user)
|
||||
{
|
||||
var network = user.parent.parent;
|
||||
|
||||
function defer(prefName)
|
||||
{
|
||||
return network.prefs[prefName];
|
||||
};
|
||||
|
||||
function onPrefChanged(prefName, newValue, oldValue)
|
||||
{
|
||||
onUserPrefChanged (user, prefName, newValue, oldValue);
|
||||
};
|
||||
|
||||
var logDefault = client.prefManager.logPath.clone();
|
||||
var filename = pref_mungeName(network.name);
|
||||
filename += "," + pref_mungeName(user.nick);
|
||||
logDefault.append(escapeFileName(filename) + ".log");
|
||||
|
||||
var prefs =
|
||||
[
|
||||
["charset", defer],
|
||||
["collapseMsgs", defer],
|
||||
["displayHeader", client.prefs["userHeader"]],
|
||||
["motif.current", defer],
|
||||
["outputWindowURL", defer],
|
||||
["log", client.prefs["userLog"]],
|
||||
["logFileName", logDefault.path]
|
||||
];
|
||||
|
||||
var branch = "extensions.irc.networks." + pref_mungeName(network.name) +
|
||||
".users." + pref_mungeName(user.nick) + ".";
|
||||
var prefManager = new PrefManager(branch);
|
||||
prefManager.addPrefs(prefs);
|
||||
prefManager.onPrefChanged = onPrefChanged;
|
||||
|
||||
client.prefManagers.push(prefManager);
|
||||
|
||||
return prefManager;
|
||||
}
|
||||
|
||||
function destroyPrefs()
|
||||
{
|
||||
if ("prefManagers" in client)
|
||||
{
|
||||
for (var i = 0; i < client.prefManagers.length; ++i)
|
||||
client.prefManagers[i].destroy();
|
||||
}
|
||||
}
|
||||
|
||||
function onPrefChanged(prefName, newValue, oldValue)
|
||||
{
|
||||
switch (prefName)
|
||||
{
|
||||
case "channelMaxLines":
|
||||
CIRCChannel.prototype.MAX_MESSAGES = newValue;
|
||||
break;
|
||||
|
||||
case "charset":
|
||||
client.charset = newValue;
|
||||
break;
|
||||
|
||||
case "clientMaxLines":
|
||||
client.MAX_MESSAGES = newValue;
|
||||
|
||||
case "nickname":
|
||||
CIRCNetwork.prototype.INITIAL_NICK = newValue;
|
||||
break;
|
||||
|
||||
case "username":
|
||||
CIRCNetwork.prototype.INITIAL_NAME = newValue;
|
||||
break;
|
||||
|
||||
case "usermode":
|
||||
CIRCNetwork.prototype.INITIAL_UMODE = newValue;
|
||||
break;
|
||||
|
||||
case "userMaxLines":
|
||||
CIRCChanUser.prototype.MAX_MESSAGES = newValue;
|
||||
break;
|
||||
|
||||
case "debugMode":
|
||||
if (newValue.indexOf("e") != -1)
|
||||
client.debugHook.enabled = true;
|
||||
else
|
||||
client.debugHook.enabled = false;
|
||||
|
||||
if (newValue.indexOf("c") != -1)
|
||||
client.dbgContexts = true;
|
||||
else
|
||||
delete client.dbgContexts;
|
||||
|
||||
if (newValue.indexOf("d") != -1)
|
||||
client.dbgDispatch = true;
|
||||
else
|
||||
delete client.dbgDispatch;
|
||||
break;
|
||||
|
||||
case "desc":
|
||||
CIRCNetwork.prototype.INITIAL_DESC = newValue;
|
||||
break;
|
||||
|
||||
case "stalkWholeWords":
|
||||
case "stalkWords":
|
||||
updateAllStalkExpressions();
|
||||
break;
|
||||
|
||||
case "motif.current":
|
||||
dispatch("sync-motifs");
|
||||
break;
|
||||
|
||||
case "multiline":
|
||||
multilineInputMode(newValue);
|
||||
break;
|
||||
|
||||
case "munger.colorCodes":
|
||||
client.enableColors = newValue;
|
||||
break;
|
||||
|
||||
case "networkMaxLines":
|
||||
CIRCNetwork.prototype.MAX_MESSAGES = newValue;
|
||||
break;
|
||||
|
||||
case "outputWindowURL":
|
||||
dispatch("sync-windows");
|
||||
break;
|
||||
|
||||
case "displayHeader":
|
||||
dispatch("sync-headers");
|
||||
break;
|
||||
|
||||
case "log":
|
||||
dispatch("sync-logs");
|
||||
break;
|
||||
|
||||
case "aliases":
|
||||
initAliases();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function onNetworkPrefChanged(network, prefName, newValue, oldValue)
|
||||
{
|
||||
if (network != client.networks[network.name])
|
||||
{
|
||||
/* this is a stale observer, remove it */
|
||||
network.prefManager.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
network.updateHeader();
|
||||
|
||||
switch (prefName)
|
||||
{
|
||||
case "nickname":
|
||||
network.INITIAL_NICK = newValue;
|
||||
break;
|
||||
|
||||
case "username":
|
||||
network.INITIAL_NAME = newValue;
|
||||
break;
|
||||
|
||||
case "usermode":
|
||||
network.INITIAL_UMODE = newValue;
|
||||
if (network.isConnected())
|
||||
{
|
||||
network.primServ.sendData("mode " + network.server.me + " :" +
|
||||
newValue + "\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case "desc":
|
||||
network.INITIAL_DESC = newValue;
|
||||
break;
|
||||
|
||||
case "reconnect":
|
||||
network.stayingPower = newValue;
|
||||
break;
|
||||
|
||||
case "motif.current":
|
||||
dispatch("sync-motifs");
|
||||
break;
|
||||
|
||||
case "outputWindowURL":
|
||||
dispatch("sync-windows");
|
||||
break;
|
||||
|
||||
case "displayHeader":
|
||||
dispatch("sync-headers");
|
||||
break;
|
||||
|
||||
case "log":
|
||||
dispatch("sync-logs");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function onChannelPrefChanged(channel, prefName, newValue, oldValue)
|
||||
{
|
||||
var network = channel.parent.parent;
|
||||
|
||||
if (network != client.networks[network.name] ||
|
||||
channel.parent != network.primServ ||
|
||||
channel != network.primServ.channels[channel.normalizedName])
|
||||
{
|
||||
/* this is a stale observer, remove it */
|
||||
channel.prefManager.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
channel.updateHeader();
|
||||
|
||||
switch (prefName)
|
||||
{
|
||||
case "motif.current":
|
||||
dispatch("sync-motifs");
|
||||
|
||||
case "outputWindowURL":
|
||||
dispatch("sync-windows");
|
||||
break;
|
||||
|
||||
case "displayHeader":
|
||||
dispatch("sync-headers");
|
||||
break;
|
||||
|
||||
case "log":
|
||||
dispatch("sync-logs");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function onUserPrefChanged(user, prefName, newValue, oldValue)
|
||||
{
|
||||
var network = user.parent.parent;
|
||||
|
||||
if (network != client.networks[network.name] ||
|
||||
user.parent != network.primServ ||
|
||||
user != network.primServ.users[user.name])
|
||||
{
|
||||
/* this is a stale observer, remove it */
|
||||
user.prefManager.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
user.updateHeader();
|
||||
|
||||
switch (prefName)
|
||||
{
|
||||
case "motif.current":
|
||||
dispatch("sync-motifs");
|
||||
|
||||
case "outputWindowURL":
|
||||
dispatch("sync-windows");
|
||||
break;
|
||||
|
||||
case "displayHeader":
|
||||
dispatch("sync-headers");
|
||||
break;
|
||||
|
||||
case "log":
|
||||
dispatch("sync-logs");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function initAliases()
|
||||
{
|
||||
var aliasDefs = client.prefs["aliases"];
|
||||
|
||||
for (var i = 0; i < aliasDefs.length; ++i)
|
||||
{
|
||||
var ary = aliasDefs[i].split(/\s*=\s*/);
|
||||
var name = ary[0];
|
||||
var list = ary[1];
|
||||
|
||||
client.commandManager.defineCommand(name, list);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Chatzilla
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- James Ross, <twpol@aol.com>, original author
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://chatzilla/locale/pref-irc.dtd">
|
||||
|
||||
<overlay id="ovCZPrefs"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="panelChildren">
|
||||
<treeitem container="true" id="chatzillaItem" insertbefore="advancedItem">
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/pref-irc.xul"
|
||||
label="&pref-irc.window.title;"/>
|
||||
</treerow>
|
||||
<treechildren id="chatzillaChildren">
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/startup.xul"
|
||||
label="&startup.window.title;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/interface.xul"
|
||||
label="&interface.window.title;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/appearance.xul"
|
||||
label="&appearance.window.title;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/stalk.xul"
|
||||
label="&stalk.window.title;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
<treeitem>
|
||||
<treerow>
|
||||
<treecell url="chrome://chatzilla/content/prefpanel/sound.xul"
|
||||
label="&sound.window.title;"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Chatzilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*/
|
||||
|
||||
const RES_PFX = "http://home.netscape.com/NC-irc#";
|
||||
|
||||
const nsIRDFResource = Components.interfaces.nsIRDFResource;
|
||||
const nsIRDFNode = Components.interfaces.nsIRDFNode;
|
||||
|
||||
function initRDF()
|
||||
{
|
||||
client.rdf = new RDFHelper();
|
||||
|
||||
client.rdf.initTree("user-list");
|
||||
client.rdf.setTreeRoot("user-list", client.rdf.resNullChan);
|
||||
}
|
||||
|
||||
function RDFHelper()
|
||||
{
|
||||
const RDF_MEMORYDS_CONTRACTID =
|
||||
"@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
|
||||
const RDF_DS_IID = Components.interfaces.nsIRDFDataSource;
|
||||
|
||||
const RDF_DS_CONTRACTID = "@mozilla.org/rdf/rdf-service;1";
|
||||
const RDF_SVC_IID = Components.interfaces.nsIRDFService;
|
||||
|
||||
this.ds =
|
||||
Components.classes[RDF_MEMORYDS_CONTRACTID].createInstance(RDF_DS_IID);
|
||||
this.svc =
|
||||
Components.classes[RDF_DS_CONTRACTID].getService(RDF_SVC_IID);
|
||||
|
||||
/* predefined nodes */
|
||||
this.resRoot = this.svc.GetResource ("NC:chatzilla-data");
|
||||
this.resNullUser = this.svc.GetResource (RES_PFX + "NUSER");
|
||||
this.resNullChan = this.svc.GetResource (RES_PFX + "NCHAN");
|
||||
|
||||
/* predefined arcs */
|
||||
this.resNetwork = this.svc.GetResource (RES_PFX + "network");
|
||||
this.resServer = this.svc.GetResource (RES_PFX + "server");
|
||||
this.resChannel = this.svc.GetResource (RES_PFX + "channel");
|
||||
this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser");
|
||||
this.resOp = this.svc.GetResource (RES_PFX + "op");
|
||||
this.resVoice = this.svc.GetResource (RES_PFX + "voice");
|
||||
this.resNick = this.svc.GetResource (RES_PFX + "nick");
|
||||
this.resUser = this.svc.GetResource (RES_PFX + "user");
|
||||
this.resHost = this.svc.GetResource (RES_PFX + "host");
|
||||
|
||||
/* predefined literals */
|
||||
this.litTrue = this.svc.GetLiteral ("true");
|
||||
this.litFalse = this.svc.GetLiteral ("false");
|
||||
this.litUnk = this.svc.GetLiteral ("----");
|
||||
|
||||
this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true);
|
||||
this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true);
|
||||
this.ds.Assert (this.resNullUser, this.resNick, this.litUnk, true);
|
||||
this.ds.Assert (this.resNullUser, this.resUser, this.litUnk, true);
|
||||
this.ds.Assert (this.resNullUser, this.resHost, this.litUnk, true);
|
||||
/*
|
||||
this.ds.Assert (this.resNullChan, this.resChanUser, this.resNullUser, true);
|
||||
*/
|
||||
this.ds.Assert (this.resRoot, this.resChannel, this.resNullChan, true);
|
||||
|
||||
}
|
||||
|
||||
RDFHelper.prototype.GetResource =
|
||||
function rdf_getr (s)
|
||||
{
|
||||
return this.svc.GetResource(s);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.GetLiteral =
|
||||
function rdf_getl (s)
|
||||
{
|
||||
return this.svc.GetLiteral(s);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.Assert =
|
||||
function rdf_assert (n1, a, n2, f)
|
||||
{
|
||||
|
||||
if (typeof f == "undefined")
|
||||
f = true;
|
||||
|
||||
//return this.dAssert (n1, a, n2, f);
|
||||
return this.ds.Assert (n1, a, n2, f);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.Unassert =
|
||||
function rdf_uassert (n1, a, n2)
|
||||
{
|
||||
/*return this.dUnassert (n1, a, n2);*/
|
||||
return this.ds.Unassert (n1, a, n2);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.dAssert =
|
||||
function rdf_dassert (n1, a, n2, f)
|
||||
{
|
||||
var n1v = n1 ? n1.Value : "!!!";
|
||||
var av = a ? a.Value : "!!!";
|
||||
var n2v = n2 ? n2.Value : "!!!";
|
||||
|
||||
if (!n1 || !a || !n2)
|
||||
dd(getStackTrace());
|
||||
|
||||
this.ds.Assert (n1, a, n2, f)
|
||||
}
|
||||
|
||||
RDFHelper.prototype.dUnassert =
|
||||
function rdf_duassert (n1, a, n2)
|
||||
{
|
||||
|
||||
var n1v = n1 ? n1.Value : "!!!";
|
||||
var av = a ? a.Value : "!!!";
|
||||
var n2v = n2 ? n2.Value : "!!!";
|
||||
|
||||
if (!n1 || !a || !n2)
|
||||
dd(getStackTrace());
|
||||
|
||||
this.ds.Unassert (n1, a, n2)
|
||||
|
||||
}
|
||||
|
||||
RDFHelper.prototype.Change =
|
||||
function rdf_change (n1, a, n2)
|
||||
{
|
||||
|
||||
var oldN2 = this.ds.GetTarget (n1, a, true);
|
||||
if (!ASSERT(oldN2, "Unable to change " + n1.Value + " -[" + a.Value +
|
||||
"]->, " + "because old value was not found."))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.ds.Change (n1, a, oldN2, n2);
|
||||
|
||||
}
|
||||
|
||||
RDFHelper.prototype.clearTargets =
|
||||
function rdf_cleart (n1, a, recurse)
|
||||
{
|
||||
if (typeof recurse == "undefined")
|
||||
recurse = false;
|
||||
|
||||
var targets = this.ds.GetTargets(n1, a, true);
|
||||
|
||||
while (targets.hasMoreElements())
|
||||
{
|
||||
var n2 = targets.getNext().QueryInterface(nsIRDFNode);
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resN2 = n2.QueryInterface(nsIRDFResource);
|
||||
var arcs = this.ds.ArcLabelsOut(resN2);
|
||||
|
||||
while (arcs.hasMoreElements())
|
||||
{
|
||||
var arc = arcs.getNext().QueryInterface(nsIRDFNode);
|
||||
this.clearTargets (resN2, arc, true);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
/*
|
||||
ASSERT(0, "Caught " + e + " while recursivley clearing " +
|
||||
n2.Value + " **");
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
this.Unassert (n1, a, n2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RDFHelper.prototype.initTree =
|
||||
function rdf_inittree (id)
|
||||
{
|
||||
var tree = document.getElementById (id);
|
||||
tree.database.AddDataSource (this.ds);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.setTreeRoot =
|
||||
function rdf_settroot (id, root)
|
||||
{
|
||||
var tree = document.getElementById (id);
|
||||
|
||||
if (typeof root == "object")
|
||||
root = root.Value;
|
||||
tree.setAttribute ("ref", root);
|
||||
}
|
||||
|
||||
RDFHelper.prototype.getTreeRoot =
|
||||
function rdf_gettroot (id, root)
|
||||
{
|
||||
var tree = document.getElementById (id);
|
||||
|
||||
return tree.getAttribute ("ref");
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Test Client #3
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*/
|
||||
|
||||
/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
* THIS FILE IS NO LONGER USED. IT'S ONLY IN THE TREE FOR LATER REFERENCE.
|
||||
* SEE prefs.js IN THIS SAME DIRECTORY INSTEAD.
|
||||
* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
*/
|
||||
|
||||
/*
|
||||
* currently recognized prefs:
|
||||
* + extensions.irc.
|
||||
* +- nickname (String) initial nickname
|
||||
* +- username (String) initial username (ie: username@host.tld)
|
||||
* +- desc (String) initial description (used in whois info)
|
||||
* +- defaultNet (String) default network to use for irc:// urls
|
||||
* +- reconnect (Boolean) reconnect when disconnected due to ERROR
|
||||
* +- multiline (Boolean) multiline input mode
|
||||
* +- colorcodes (Boolean) enable color code escape characters
|
||||
* +- bugURL (String) url to use for "bug 12345" links. Use %s to place
|
||||
* | the bug number.
|
||||
* +- initialURLs (String) irc:// urls to connect to on startup, semicolon
|
||||
* | separated
|
||||
* +- initialScripts (String) urls for scripts to run at startup,
|
||||
* | semicolon separated
|
||||
* +- newTabLimit (Number) max number of tabs to have open before disabling
|
||||
* | automatic tab creation for private messages.
|
||||
* | use 0 for unlimited new tabs, or 1 to disable
|
||||
* | automatic tab creation.
|
||||
* +- raiseNewTab (Boolean) bring new tabs created in response to a private
|
||||
* | message to the front.
|
||||
* +- munger (Boolean) send output through text->html munger
|
||||
* | +- colorCodes (Boolean) enable color code handling
|
||||
* | +- <various> (Boolean) enable specific munger entry
|
||||
* | +- smileyText (Boolean) true => display text (and graphic) when
|
||||
* | matching smileys
|
||||
* | false => show only the smiley graphic
|
||||
* +- nickCompleteStr (String) String to use when tab-completing nicknames
|
||||
* | at the beginning of sentences
|
||||
* +- stalkWords (String) List of words to add to the stalk victims list
|
||||
* | semicolon separated (see the /stalk command)
|
||||
* +- stalkWholeWords (Boolean) True if stalk words should not match against
|
||||
* | parts of words.
|
||||
* +- deleteOnPart (Boolean) Delete channel window automatically after a /part
|
||||
* |
|
||||
* | The following beep prefs can be set to the text "beep" to use the
|
||||
* | system beep, or "" to disable the beep.
|
||||
* +- msgBeep (String) url to sound to play when a /msg is recieved
|
||||
* +- stalkBeep (String) url to sound to play when a /stalk matches
|
||||
* +- queryBeep (String) url to sound to play for new msgs in a /query
|
||||
* |
|
||||
* +- notify
|
||||
* | +- aggressive (Boolean) flash trayicon/ bring window to top when
|
||||
* | your nickname is mentioned.
|
||||
* +- settings
|
||||
* | +- autoSave (Boolean) Save settings on exit
|
||||
* +- style
|
||||
* | +- default (String) url to default style sheet
|
||||
* +- views
|
||||
* | +- collapseMsgs (Boolean) Collapse consecutive messages from same
|
||||
* | | user
|
||||
* | +- copyMessages (Boolean) Copy important messages to the network
|
||||
* | | window
|
||||
* | +- client
|
||||
* | | +- maxlines (Number) max lines to keep in *client* view
|
||||
* | +- network
|
||||
* | | +- maxlines (Number) max lines to keep in network views
|
||||
* | +- channel
|
||||
* | | +- maxlines (Number) max lines to keep in channel views
|
||||
* | +- chanuser
|
||||
* | +- maxlines (Number) max lines to keep in /msg views
|
||||
* +- debug
|
||||
* | +- tracer (Boolean) enable/disable debug message tracing
|
||||
* +- viewList
|
||||
* +- client
|
||||
* | +- logging (Boolean) enable/disable logging in the client view
|
||||
* +- <escaped network name>
|
||||
* | +- logging (Boolean) enable/disable logging in the <network> view
|
||||
* +- <escaped network,channel>
|
||||
* +- logging (Boolean) enable/disable logging in the <channel> view on
|
||||
* <network>
|
||||
*/
|
||||
|
||||
function initReadPrefs()
|
||||
{
|
||||
client.prefSpecs = {
|
||||
//"nickname": ["CIRCNetwork.prototype.INITIAL_NICK", "IRCMonkey"],
|
||||
//"username": ["CIRCNetwork.prototype.INITIAL_NAME", "chatzilla"],
|
||||
//"desc": ["CIRCNetwork.prototype.INITIAL_DESC","New Now Know How"],
|
||||
//"reconnect": ["CIRCNetwork.prototype.stayingPower", true],
|
||||
//"multiline": ["client.MULTILINE", false],
|
||||
//"colorCodes": ["client.COLORCODES", false],
|
||||
//REMOVED: "defaultNet": ["client.DEFAULT_NETWORK", "moznet"],
|
||||
//"charset": ["client.CHARSET", ""],
|
||||
//"initialURLs": ["client.INITIAL_URLS", "irc://"],
|
||||
//"initialScripts": ["client.INITIAL_SCRIPTS", ""],
|
||||
//"newTabLimit": ["client.NEW_TAB_LIMIT", 15],
|
||||
//REMOVED: "raiseNewTab": ["client.RAISE_NEW_TAB", false],
|
||||
//"nickCompleteStr": ["client.ADDRESSED_NICK_SEP", ", "],
|
||||
//"stalkWords": ["client.stalkingVictims", []],
|
||||
//"stalkWholeWords": ["client.STALK_WHOLE_WORDS", true],
|
||||
//"deleteOnPart": ["client.DELETE_ON_PART", true],
|
||||
//"stalkBeep": ["client.STALK_BEEP", "beep"],
|
||||
//"msgBeep": ["client.MSG_BEEP", "beep beep"],
|
||||
//"queryBeep": ["client.QUERY_BEEP", "beep"],
|
||||
//REMOVED: "munger": ["client.munger.enabled", true],
|
||||
//"munger.colorCodes": ["client.enableColors", true],
|
||||
//REMOVED: "munger.smileyText": ["client.smileyText", false],
|
||||
//"bugURL": ["client.BUG_URL",
|
||||
// "http://bugzilla.mozilla.org/show_bug.cgi?id=%s"],
|
||||
//"notify.aggressive": ["client.FLASH_WINDOW", true],
|
||||
//REMOVED: "settings.autoSave": ["client.SAVE_SETTINGS", true],
|
||||
//REMOVED: "debug.tracer" : ["client.debugHook.enabled", false],
|
||||
//"style.default": ["client.DEFAULT_STYLE",
|
||||
// "chrome://chatzilla/skin/output-default.css"],
|
||||
//CHANGED: "views.collapseMsgs": ["client.COLLAPSE_MSGS", false],
|
||||
//CHANGED: "views.copyMessages": ["client.COPY_MESSAGES", true],
|
||||
//CHANGED:"views.client.maxlines": ["client.MAX_MESSAGES", 200],
|
||||
//CHANGED:"views.network.maxlines":
|
||||
// ["CIRCNetwork.prototype.MAX_MESSAGES", 100],
|
||||
//CHANGED:"views.channel.maxlines":
|
||||
// ["CIRCChannel.prototype.MAX_MESSAGES", 300],
|
||||
//CHANGED:"views.chanuser.maxlines":
|
||||
// ["CIRCChanUser.prototype.MAX_MESSAGES", 200]
|
||||
};
|
||||
|
||||
const PREF_CTRID = "@mozilla.org/preferences-service;1";
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService;
|
||||
const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
|
||||
const nsIPrefBranchInternal = Components.interfaces.nsIPrefBranchInternal;
|
||||
|
||||
client.prefService =
|
||||
Components.classes[PREF_CTRID].getService(nsIPrefService);
|
||||
client.prefBranch = client.prefService.getBranch ("extensions.irc.");
|
||||
|
||||
var internal = client.prefBranch.QueryInterface(nsIPrefBranchInternal);
|
||||
internal.addObserver("", client.prefObserver, false);
|
||||
|
||||
readPrefs();
|
||||
}
|
||||
|
||||
function destroyReadPrefs()
|
||||
{
|
||||
const nsIPrefBranchInternal = Components.interfaces.nsIPrefBranchInternal;
|
||||
var internal = client.prefBranch.QueryInterface(nsIPrefBranchInternal);
|
||||
internal.removeObserver("", client.prefObserver);
|
||||
}
|
||||
|
||||
client.prefObserver = new Object();
|
||||
|
||||
client.prefObserver.observe =
|
||||
function pref_observe (prefService, topic, prefName)
|
||||
{
|
||||
if (!("prefLock" in client))
|
||||
readPref(prefName);
|
||||
}
|
||||
|
||||
function readPref(prefName)
|
||||
{
|
||||
var ary;
|
||||
|
||||
if (prefName in client.prefSpecs)
|
||||
{
|
||||
var varName = client.prefSpecs[prefName][0];
|
||||
var defaultValue = client.prefSpecs[prefName][1];
|
||||
var prefValue;
|
||||
|
||||
if (typeof defaultValue == "boolean")
|
||||
{
|
||||
prefValue = getBoolPref(prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue);
|
||||
}
|
||||
else if (typeof defaultValue == "number")
|
||||
{
|
||||
prefValue = getIntPref(prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
{
|
||||
prefValue = getCharPref(prefName, defaultValue.join("; "));
|
||||
if (prefValue)
|
||||
eval (varName + " = " + prefValue.split(/\s*;\s*/).toSource());
|
||||
else
|
||||
eval (varName + " = []");
|
||||
}
|
||||
else
|
||||
{
|
||||
prefValue = getCharPref (prefName, defaultValue);
|
||||
eval (varName + " = " + prefValue.quote());
|
||||
}
|
||||
}
|
||||
else if ((ary = prefName.match(/munger\.(.*)/)) &&
|
||||
ary[1] in client.munger.entries)
|
||||
{
|
||||
client.munger.entries[ary[1]].enabled =
|
||||
getBoolPref ("munger." + prefName,
|
||||
client.munger.entries[ary[1]].enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(prefName.match(/viewList\..*/)))
|
||||
dd ("readPref: UNKNOWN PREF ``" + prefName + "''");
|
||||
}
|
||||
}
|
||||
|
||||
function readPrefs()
|
||||
{
|
||||
for (var p in client.prefSpecs)
|
||||
readPref(p);
|
||||
|
||||
//if (!client.INITIAL_URLS)
|
||||
// client.INITIAL_URLS = "irc://";
|
||||
|
||||
for (var entry in client.munger.entries)
|
||||
{
|
||||
if (entry[0] != ".")
|
||||
{
|
||||
client.munger.entries[entry].enabled =
|
||||
getBoolPref ("munger." + entry,
|
||||
client.munger.entries[entry].enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function writePref(prefName)
|
||||
{
|
||||
function clearPref(prefName)
|
||||
{
|
||||
try
|
||||
{
|
||||
client.prefBranch.clearUserPref (prefName);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
// ignore missing pref exception
|
||||
}
|
||||
};
|
||||
|
||||
var ary;
|
||||
|
||||
if (prefName in client.prefSpecs)
|
||||
{
|
||||
var varName = client.prefSpecs[prefName][0];
|
||||
var defaultValue = client.prefSpecs[prefName][1];
|
||||
var prefValue = eval(varName);
|
||||
|
||||
if (prefValue != defaultValue)
|
||||
{
|
||||
if (typeof defaultValue == "boolean")
|
||||
client.prefBranch.setBoolPref(prefName, prefValue);
|
||||
else if (typeof defaultValue == "number")
|
||||
client.prefBranch.setIntPref(prefName, prefValue);
|
||||
else if (defaultValue instanceof Array)
|
||||
client.prefBranch.setCharPref(prefName, prefValue.join("; "));
|
||||
else
|
||||
client.prefBranch.setCharPref(prefName, prefValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
clearPref(prefName);
|
||||
}
|
||||
}
|
||||
else if ((ary = prefName.match(/munger\.(.*)/)) &&
|
||||
ary[1] in client.munger.entries)
|
||||
{
|
||||
var entry = client.munger.entries[ary[1]];
|
||||
if (entry.enabled != entry.enabledDefault)
|
||||
client.prefBranch.setBoolPref(prefName, entry.enabled);
|
||||
else
|
||||
clearPref (prefName);
|
||||
}
|
||||
else
|
||||
{
|
||||
dd ("writePref: UNKNOWN PREF ``" + prefName + "''");
|
||||
}
|
||||
|
||||
if (!("prefLock" in client))
|
||||
client.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
function writePrefs (rootNode)
|
||||
{
|
||||
client.prefLock = true;
|
||||
|
||||
for (var p in client.prefSpecs)
|
||||
writePref(p);
|
||||
|
||||
for (var entry in client.munger.entries)
|
||||
{
|
||||
if (entry[0] != ".")
|
||||
{
|
||||
writePref("munger." + entry);
|
||||
}
|
||||
}
|
||||
|
||||
delete client.prefLock;
|
||||
|
||||
client.prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
function getCharPref (prefName, defaultValue)
|
||||
{
|
||||
var rv;
|
||||
|
||||
try
|
||||
{
|
||||
rv = client.prefBranch.getCharPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
rv = defaultValue;
|
||||
}
|
||||
|
||||
//dd ("getCharPref: returning '" + rv + "' for " + prefName);
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
function getIntPref (prefName, defaultValue)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
return client.prefBranch.getIntPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getBoolPref (prefName, defaultValue, branch)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
if (branch)
|
||||
return branch.getBoolPref (prefName);
|
||||
return client.prefBranch.getBoolPref (prefName);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is The JavaScript Debugger
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation
|
||||
- Portions created by Netscape are
|
||||
- Copyright (C) 1998 Netscape Communications Corporation.
|
||||
- All Rights Reserved.
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert Ginda, <rginda@netscape.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<overlay id="chatzilla-scripts-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<overlaytarget id="scripts-overlay-target">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://global/content/nsUserSettings.js"/>
|
||||
<script src="chrome://global/content/nsTransferable.js"/>
|
||||
<script src="chrome://global/content/nsClipboard.js"/>
|
||||
<script src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script src="chrome://communicator/content/contentAreaUtils.js"/>
|
||||
<script src="chrome://communicator/content/contentAreaDD.js"/>
|
||||
|
||||
<script src="chrome://chatzilla/content/lib/js/utils.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/connection-xpcom.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/events.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/command-manager.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/pref-manager.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/message-manager.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/menu-manager.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/irc.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/irc-debug.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/js/file-utils.js"/>
|
||||
<script src="chrome://chatzilla/content/lib/xul/munger.js"/>
|
||||
|
||||
<script src="chrome://chatzilla/content/static.js"/>
|
||||
<script src="chrome://chatzilla/content/commands.js"/>
|
||||
<script src="chrome://chatzilla/content/menus.js"/>
|
||||
<script src="chrome://chatzilla/content/prefs.js"/>
|
||||
<script src="chrome://chatzilla/content/messages.js"/>
|
||||
<script src="chrome://chatzilla/content/handlers.js"/>
|
||||
<script src="chrome://chatzilla/content/rdf.js"/>
|
||||
|
||||
</overlaytarget>
|
||||
|
||||
</overlay>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,208 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is JSIRC Library
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*/
|
||||
|
||||
function CListBox ()
|
||||
{
|
||||
|
||||
this.listContainer = document.createElement ("box");
|
||||
this.listContainer.setAttribute ("class", "list");
|
||||
this.listContainer.setAttribute ("align", "vertical");
|
||||
|
||||
}
|
||||
|
||||
CListBox.prototype.clear =
|
||||
function lbox_clear (e)
|
||||
{
|
||||
var obj = this.listContainer.firstChild;
|
||||
|
||||
while (obj)
|
||||
{
|
||||
this.listContainer.removeChild (obj);
|
||||
obj = obj.nextSibling;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CListBox.prototype.clickHandler =
|
||||
function lbox_chandler (e)
|
||||
{
|
||||
var lm = this.listManager;
|
||||
|
||||
e.target = this;
|
||||
|
||||
if (lm && typeof lm.onClick == "function")
|
||||
lm.onClick ({realTarget: this, event: e});
|
||||
|
||||
}
|
||||
|
||||
CListBox.prototype.onClick =
|
||||
function lbox_chandler (e)
|
||||
{
|
||||
|
||||
/* Check for the button number first */
|
||||
/* FIXME: are there constants for this stuff? */
|
||||
if (e.event.button == 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the ctrlKey is _not_ set, unselect all currently
|
||||
* selected items
|
||||
*/
|
||||
|
||||
if (!e.event.ctrlKey)
|
||||
{
|
||||
this.enumerateElements(this._unselectCallback, e.realTarget);
|
||||
}
|
||||
|
||||
/* Check to see whether the item is currently selected */
|
||||
var isSelected = e.realTarget.getAttribute("selected");
|
||||
|
||||
/* toggle the value */
|
||||
if ("true" == isSelected)
|
||||
e.realTarget.setAttribute("selected", "false");
|
||||
else
|
||||
e.realTarget.setAttribute("selected", "true");
|
||||
|
||||
}
|
||||
|
||||
CListBox.prototype._unselectCallback =
|
||||
function (element, ndx, realTarget)
|
||||
{
|
||||
if (element != realTarget)
|
||||
element.setAttribute("selected", "false");
|
||||
}
|
||||
|
||||
CListBox.prototype.add =
|
||||
function lbox_add (stuff, tag)
|
||||
{
|
||||
/* NOTE: JG using a div here makes the item span the full
|
||||
length and looks better when selected */
|
||||
|
||||
var option = document.createElement ("box");
|
||||
option.setAttribute ("class", "list-option");
|
||||
option.setAttribute ("align", "horizontal");
|
||||
option.appendChild (stuff);
|
||||
option.onclick = this.clickHandler;
|
||||
option.listManager = this;
|
||||
option.tag = tag;
|
||||
this.listContainer.appendChild (option);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CListBox.prototype.prepend =
|
||||
function lbox_prepend (stuff, oldstuff, tag)
|
||||
{
|
||||
|
||||
if (!this.listContainer.firstChild)
|
||||
return this.add (stuff, tag);
|
||||
|
||||
var nextOption = this._findOption (oldstuff);
|
||||
if (!nextOption)
|
||||
return false;
|
||||
|
||||
var option = document.createElement ("box");
|
||||
option.setAttribute ("align", "horizontal");
|
||||
|
||||
option.appendChild (stuff);
|
||||
option.onclick = this.clickHandler;
|
||||
option.listManager = this;
|
||||
option.tag = tag;
|
||||
this.listContainer.insertBefore (option, nextOption);
|
||||
|
||||
}
|
||||
|
||||
CListBox.prototype.insert =
|
||||
function lbox_Insert (stuff, tag)
|
||||
{
|
||||
this.prepend (stuff, this.listContainer.firstChild, tag);
|
||||
}
|
||||
|
||||
CListBox.prototype.remove =
|
||||
function lbox_remove (stuff)
|
||||
{
|
||||
var option = this._findOption (stuff);
|
||||
|
||||
if (option)
|
||||
this.listContainer.removeChild (option);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CListBox.prototype._findOption =
|
||||
function lbox_remove (stuff)
|
||||
{
|
||||
var option = this.listContainer.firstChild;
|
||||
|
||||
while (option)
|
||||
{
|
||||
if (option.firstChild == stuff)
|
||||
return option;
|
||||
option = option.nextSibling;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CListBox.prototype.enumerateElements =
|
||||
/* NOTE: JG: added data param so arbitrary data can be passed. */
|
||||
function lbox_enum (callback, data)
|
||||
{
|
||||
var i = 0;
|
||||
var current = this.listContainer.firstChild;
|
||||
|
||||
while (current)
|
||||
{
|
||||
callback (current, i++, data);
|
||||
current = current.nextSibling;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Using enumerateElements, this is used just to fill an array
|
||||
* with selected nick names.
|
||||
* @returns an array of selected nicknames
|
||||
*/
|
||||
CListBox.prototype.getSelectedItems =
|
||||
function lbox_getselecteditems ()
|
||||
{
|
||||
var ary = [];
|
||||
|
||||
this.enumerateElements(this.selectedItemCallback, ary);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
/**
|
||||
* used to build the array of values returned by getSelectedItems.
|
||||
*/
|
||||
CListBox.prototype.selectedItemCallback =
|
||||
function (item, idx, data)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is ChatZilla
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
* Samuel Sieb, samuel@sieb.net, MIRC color codes
|
||||
*/
|
||||
|
||||
function initMunger()
|
||||
{
|
||||
client.linkRE =
|
||||
/((\w[\w-]+):[^<>\[\]()\'\"\s\u201d]+|www(\.[^.<>\[\]()\'\"\s\u201d]+){2,})/;
|
||||
|
||||
var munger = client.munger = new CMunger();
|
||||
munger.addRule ("quote", /(``|'')/, insertQuote);
|
||||
munger.addRule ("bold", /(?:\s|^)(\*[^*()]*\*)(?:[\s.,]|$)/,
|
||||
"chatzilla-bold");
|
||||
munger.addRule ("underline", /(?:\s|^)(\_[^_()]*\_)(?:[\s.,]|$)/,
|
||||
"chatzilla-underline");
|
||||
munger.addRule ("italic", /(?:\s|^)(\/[^\/()]*\/)(?:[\s.,]|$)/,
|
||||
"chatzilla-italic");
|
||||
/* allow () chars inside |code()| blocks */
|
||||
munger.addRule ("teletype", /(?:\s|^)(\|[^|]*\|)(?:[\s.,]|$)/,
|
||||
"chatzilla-teletype");
|
||||
munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/,
|
||||
mircChangeColor);
|
||||
munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold);
|
||||
munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder);
|
||||
munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor);
|
||||
munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor);
|
||||
munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar);
|
||||
munger.addRule ("link", client.linkRE, insertLink);
|
||||
munger.addRule ("mailto",
|
||||
/(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s\u201d]+@[^.<>\[\]()\'\"\s\u201d]+\.[^<>\[\]()\'\"\s\u201d]+)/i,
|
||||
insertMailToLink);
|
||||
munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+#?\d{3,6})/i,
|
||||
insertBugzillaLink);
|
||||
munger.addRule ("channel-link",
|
||||
/(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i,
|
||||
insertChannelLink);
|
||||
|
||||
munger.addRule ("face",
|
||||
/((^|\s)[\<\>]?[\;\=\:]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/,
|
||||
insertSmiley);
|
||||
munger.addRule ("ear", /(?:\s|^)(\(\*)(?:\s|$)/, insertEar, false);
|
||||
munger.addRule ("rheet", /(?:\s|\W|^)(rhee+t\!*)(?:\s|$)/i, insertRheet);
|
||||
munger.addRule ("word-hyphenator",
|
||||
new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"),
|
||||
insertHyphenatedWord);
|
||||
|
||||
client.enableColors = client.prefs["munger.colorCodes"];
|
||||
for (var entry in client.munger.entries)
|
||||
{
|
||||
var branch = client.prefManager.prefBranch;
|
||||
if (entry[0] != ".")
|
||||
{
|
||||
try
|
||||
{
|
||||
munger.entries[entry].enabled =
|
||||
branch.getBoolPref("munger." + entry);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
// nada
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CMungerEntry (name, regex, className, enable, tagName)
|
||||
{
|
||||
this.name = name;
|
||||
if (name[0] != ".")
|
||||
this.description = getMsg("munger." + name, null, null);
|
||||
this.enabled = (typeof enable == "undefined" ? true : enable);
|
||||
this.enabledDefault = this.enabled;
|
||||
this.tagName = (tagName) ? tagName : "html:span";
|
||||
|
||||
if (regex instanceof RegExp)
|
||||
this.regex = regex;
|
||||
else
|
||||
this.lambdaMatch = regex;
|
||||
|
||||
if (typeof className == "function")
|
||||
this.lambdaReplace = className;
|
||||
else
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
function CMunger ()
|
||||
{
|
||||
this.entries = new Object();
|
||||
this.tagName = "html:span";
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
CMunger.prototype.enabled = true;
|
||||
|
||||
CMunger.prototype.addRule =
|
||||
function mng_addrule (name, regex, className, enable)
|
||||
{
|
||||
this.entries[name] = new CMungerEntry (name, regex, className, enable);
|
||||
}
|
||||
|
||||
CMunger.prototype.delRule =
|
||||
function mng_delrule (name)
|
||||
{
|
||||
delete this.entries[name];
|
||||
}
|
||||
|
||||
CMunger.prototype.munge =
|
||||
function mng_munge (text, containerTag, data)
|
||||
{
|
||||
var entry;
|
||||
var ary;
|
||||
var wbr, newClass;
|
||||
|
||||
if (!containerTag)
|
||||
{
|
||||
containerTag =
|
||||
document.createElementNS ("http://www.w3.org/1999/xhtml",
|
||||
this.tagName);
|
||||
}
|
||||
|
||||
if (this.enabled)
|
||||
{
|
||||
for (entry in this.entries)
|
||||
{
|
||||
if (this.entries[entry].enabled)
|
||||
{
|
||||
if (typeof this.entries[entry].lambdaMatch == "function")
|
||||
{
|
||||
var rval;
|
||||
|
||||
rval = this.entries[entry].lambdaMatch(text, containerTag,
|
||||
data,
|
||||
this.entries[entry]);
|
||||
if (rval)
|
||||
ary = [(void 0), rval];
|
||||
else
|
||||
ary = null;
|
||||
}
|
||||
else
|
||||
ary = text.match(this.entries[entry].regex);
|
||||
|
||||
if ((ary != null) && (ary[1]))
|
||||
{
|
||||
var startPos = text.indexOf(ary[1]);
|
||||
|
||||
if (typeof this.entries[entry].lambdaReplace == "function")
|
||||
{
|
||||
this.munge (text.substr(0,startPos), containerTag,
|
||||
data);
|
||||
this.entries[entry].lambdaReplace (ary[1], containerTag,
|
||||
data,
|
||||
this.entries[entry]);
|
||||
this.munge (text.substr (startPos + ary[1].length,
|
||||
text.length), containerTag,
|
||||
data);
|
||||
|
||||
return containerTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.munge (text.substr(0,startPos), containerTag,
|
||||
data);
|
||||
|
||||
var subTag = document.createElementNS
|
||||
("http://www.w3.org/1999/xhtml",
|
||||
this.entries[entry].tagName);
|
||||
|
||||
newClass = this.entries[entry].className;
|
||||
|
||||
if ("hasColorInfo" in data)
|
||||
{
|
||||
if ("currFgColor" in data)
|
||||
newClass += " chatzilla-fg" + data.currFgColor;
|
||||
if ("currBgColor" in data)
|
||||
newClass += " chatzilla-bg" + data.currBgColor;
|
||||
if ("isBold" in data)
|
||||
newClass += " chatzilla-bold";
|
||||
if ("isUnderline" in data)
|
||||
newClass += " chatzilla-underline";
|
||||
}
|
||||
|
||||
subTag.setAttribute ("class", newClass);
|
||||
|
||||
/* don't let this rule match again */
|
||||
this.entries[entry].enabled = false;
|
||||
this.munge(ary[1], subTag, data);
|
||||
this.entries[entry].enabled = true;
|
||||
|
||||
containerTag.appendChild (subTag);
|
||||
|
||||
this.munge (text.substr (startPos + ary[1].length,
|
||||
text.length), containerTag,
|
||||
data);
|
||||
|
||||
return containerTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var textNode = document.createTextNode (text);
|
||||
|
||||
if ("hasColorInfo" in data)
|
||||
{
|
||||
|
||||
newClass = "";
|
||||
if ("currFgColor" in data)
|
||||
newClass = "chatzilla-fg" + data.currFgColor;
|
||||
if ("currBgColor" in data)
|
||||
newClass += " chatzilla-bg" + data.currBgColor;
|
||||
if ("isBold" in data)
|
||||
newClass += " chatzilla-bold";
|
||||
if ("isUnderline" in data)
|
||||
newClass += " chatzilla-underline";
|
||||
if (newClass != "")
|
||||
{
|
||||
var newTag = document.createElementNS
|
||||
("http://www.w3.org/1999/xhtml",
|
||||
"html:span");
|
||||
newTag.setAttribute ("class", newClass);
|
||||
newTag.appendChild (textNode);
|
||||
containerTag.appendChild (newTag);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete data.hasColorInfo;
|
||||
containerTag.appendChild (textNode);
|
||||
}
|
||||
wbr = document.createElementNS ("http://www.w3.org/1999/xhtml",
|
||||
"html:wbr");
|
||||
containerTag.appendChild (wbr);
|
||||
}
|
||||
else
|
||||
containerTag.appendChild (textNode);
|
||||
|
||||
return containerTag;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
@@ -1,108 +0,0 @@
|
||||
<!ENTITY Menubar.tooltip "Main Menu">
|
||||
<!ENTITY Toolbar.tooltip "Main Toolbar">
|
||||
|
||||
|
||||
<!ENTITY menuBar.tooltip "Menu Bar">
|
||||
<!ENTITY header.tooltip "Headers">
|
||||
<!ENTITY op.value "Op">
|
||||
<!ENTITY op.accesskey "o">
|
||||
<!ENTITY deop.value "Deop">
|
||||
<!ENTITY deop.accesskey "d">
|
||||
<!ENTITY voice.value "Voice">
|
||||
<!ENTITY voice.accesskey "v">
|
||||
<!ENTITY devoice.value "Devoice">
|
||||
<!ENTITY devoice.accesskey "e">
|
||||
<!ENTITY kick.value "Kick">
|
||||
<!ENTITY kick.accesskey "k">
|
||||
<!ENTITY kick2.value "Kick With Reason">
|
||||
<!ENTITY kick2.accesskey "r">
|
||||
<!ENTITY whois.value "Whois">
|
||||
<!ENTITY whois.accesskey "w">
|
||||
|
||||
<!ENTITY multiline-expand.tooltip "Switch to multi-line input (Ctrl+Up)">
|
||||
<!ENTITY multiline-contract.tooltip "Switch to single-line input (Ctrl+Down)">
|
||||
<!ENTITY multiline-send.tooltip "Send this text (Ctrl+Enter)">
|
||||
|
||||
<!ENTITY url.label "URL">
|
||||
<!ENTITY mode.label "Mode">
|
||||
<!ENTITY topic.label "Topic">
|
||||
<!ENTITY users.label "Users">
|
||||
<!ENTITY lag.label "Lag">
|
||||
|
||||
<!ENTITY OptionsCmd.label "Options">
|
||||
<!ENTITY OptionsCmd.accesskey "O">
|
||||
<!ENTITY MungerCmd.label "Munger">
|
||||
<!ENTITY MungerCmd.accesskey "M">
|
||||
<!ENTITY DisableMunger.label "Disable All">
|
||||
<!ENTITY DisableMunger.accesskey "D">
|
||||
<!ENTITY EnableColors.label "Color Codes">
|
||||
<!ENTITY EnableColors.accesskey "C">
|
||||
|
||||
<!ENTITY DebugMsgCmd.label "Debug Mode">
|
||||
<!ENTITY DebugMsgCmd.aKey "D">
|
||||
<!ENTITY SaveSetNowCmd.label "Save Settings Now">
|
||||
<!ENTITY SaveSetNowCmd.akey "N">
|
||||
<!ENTITY SaveSetExitCmd.label "Save Settings on Exit">
|
||||
<!ENTITY SaveSetExitCmd.akey "E">
|
||||
<!ENTITY ViewCmd.label "View">
|
||||
<!ENTITY ViewCmd.aKey "V">
|
||||
<!ENTITY ShowCmd.label "Show/Hide">
|
||||
<!ENTITY ShowCmd.akey "S">
|
||||
<!ENTITY ShowTabStripCmd.label "Tabs">
|
||||
<!ENTITY ShowTabStripCmd.aKey "T">
|
||||
<!ENTITY ShowUserlistCmd.label "Userlist">
|
||||
<!ENTITY ShowUserlistCmd.aKey "U">
|
||||
<!ENTITY ShowHeaderCmd.label "Header">
|
||||
<!ENTITY ShowHeaderCmd.aKey "H">
|
||||
<!ENTITY ShowStatusbarCmd.label "Status Bar">
|
||||
<!ENTITY ShowStatusbarCmd.aKey "S">
|
||||
<!ENTITY CollapseCmd.label "Collapse Consecutive Messages">
|
||||
<!ENTITY CollapseCmd.aKey "N">
|
||||
<!ENTITY CopyMessagesCmd.label "Copy Important Messages">
|
||||
<!ENTITY CopyMessagesCmd.aKey "I">
|
||||
<!ENTITY NoneCmd.label "No Motif">
|
||||
<!ENTITY NoneCmd.aKey "N">
|
||||
<!ENTITY DefaultCmd.label "Default Motif">
|
||||
<!ENTITY DefaultCmd.aKey "D">
|
||||
<!ENTITY DarkCmd.label "Dark Motif">
|
||||
<!ENTITY DarkCmd.aKey "k">
|
||||
<!ENTITY LightCmd.label "Light Motif">
|
||||
<!ENTITY LightCmd.aKey "L">
|
||||
<!ENTITY HideCmd.label "Hide">
|
||||
<!ENTITY LeaveViewCmd.label "Leave ``$viewname''">
|
||||
<!ENTITY LeaveViewCmd.aKey "">
|
||||
<!ENTITY StartupVisitCmd.label "Open at Startup">
|
||||
<!ENTITY StartupVisitCmd.aKey "">
|
||||
<!ENTITY ClearViewCmd.label "Clear View">
|
||||
<!ENTITY ClearViewCmd.aKey "e">
|
||||
<!ENTITY DeleteViewCmd.label "Close View">
|
||||
<!ENTITY DeleteViewCmd.aKey "V">
|
||||
<!ENTITY StatusCmd.label "Connection Status">
|
||||
<!ENTITY StatusCmd.aKey "C">
|
||||
|
||||
<!ENTITY CloseCmd.label "Close Window">
|
||||
<!ENTITY CloseCmd.aKey "C">
|
||||
|
||||
<!ENTITY PopupQueryCmd.label "Private Chat ``$nick''">
|
||||
<!ENTITY PopupQueryCmd.aKey "P">
|
||||
<!ENTITY PopupWhoisCmd.label "Who Is ``$nick''">
|
||||
<!ENTITY PopupWhoisCmd.aKey "W">
|
||||
<!ENTITY PopupPingCmd.label "Ping ``$nick''">
|
||||
<!ENTITY PopupPingCmd.aKey "I">
|
||||
<!ENTITY PopupVersionCmd.label "Version ``$nick''">
|
||||
<!ENTITY PopupVersionCmd.aKey "V">
|
||||
<!ENTITY PopupHighlightStyle.label "Highlight $nick's messages">
|
||||
<!ENTITY PopupHighlightStyle.aKey "H">
|
||||
<!ENTITY PopupHighlightNoStyle.label "None">
|
||||
<!ENTITY PopupGiveOp.label "Grant Operator Status">
|
||||
<!ENTITY PopupGiveOp.aKey "O">
|
||||
<!ENTITY PopupTakeOp.label "Revoke Operator Status">
|
||||
<!ENTITY PopupTakeOp.aKey "O">
|
||||
<!ENTITY PopupGiveVoice.label "Grant Voiced Status">
|
||||
<!ENTITY PopupGiveVoice.aKey "V">
|
||||
<!ENTITY PopupTakeVoice.label "Revoke Voiced Status">
|
||||
<!ENTITY PopupTakeVoice.aKey "V">
|
||||
<!ENTITY PopupKick.label "Kick ``$nick''">
|
||||
<!ENTITY PopupKick.aKey "K">
|
||||
|
||||
<!ENTITY StatusText.label "Welcome to ChatZilla!">
|
||||
@@ -1,649 +0,0 @@
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is ChatZilla i18n strings, english
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Chiaki Koufugata.
|
||||
#
|
||||
# Copyright (C) Chiaki Koufugata.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Chiaki Koufugata, original author
|
||||
# Robert Ginda, rginda@netscape.com, owner/maintainer
|
||||
# James Ross, twpol@aol.com, pref pages code
|
||||
#
|
||||
|
||||
unknown=<unknown>
|
||||
none=<none>
|
||||
na=<n/a>
|
||||
|
||||
# command.js
|
||||
|
||||
cmd.about.label = About ChatZilla
|
||||
cmd.about.help = Display information about this version of ChatZilla.
|
||||
|
||||
cmd.alias.params = [<alias-name> <command-list>]
|
||||
cmd.alias.help = Defines <alias-name> as an alias for the semicolon (';') delimited list of commands specified by <command-list>. If <command-list> is a minus ('-') character, the alias will be removed. If <alias-name> is not provided, all aliases will be listed.
|
||||
|
||||
cmd.attach.params = <irc-url>
|
||||
cmd.attach.help = Attaches to the IRC URL specified by <irc-url>. If you are already attached, the view for <irc-url> is made current. If that view has been deleted, it is recreated. You may omit the irc:// portion of the <irc-url>. Examples are; /attach moznet, /attach moznet/chatzilla, and /attach irc.mozilla.org/mozbot,isnick.
|
||||
|
||||
cmd.away.params = [<reason>]
|
||||
cmd.away.help = If <reason> is specified, sets you away with that message. Used without <reason>, you are marked back as no longer being away.
|
||||
|
||||
cmd.cancel.help = Cancels a /attach or /server command. Use /cancel when ChatZilla is repeatedly trying to attach to a network that is not responding, to tell ChatZilla to give up before the normal number of retries.
|
||||
|
||||
cmd.charset.params = [<new-charset>]
|
||||
cmd.charset.help = Sets the character encoding mode to <new-charset>, or displays the current character encoding mode if <new-charset> is not provided.
|
||||
|
||||
cmd.channel-charset.params = [<new-charset> [<channel>]]
|
||||
cmd.channel-charset.help = Sets the character encoding mode to <new-charset>, or displays the current character encoding mode if <new-charset> is not provided. If <channel> is not provided, the current channel will be assumed.
|
||||
|
||||
cmd.channel-motif.params = [<motif> [<channel>]]
|
||||
cmd.channel-motif.help = Sets the CSS file used for the message tab for this specific channel. <motif> can be a URL to a .css file, or the shortcut "default", "light", or "dark". If <motif> is a minus ('-') character, the motif will revert to the network motif. If <channel> is not provided, the current channel will be assumed. See the the ChatZilla homepage at <http://www.mozilla.org/projects/rt-messaging/chatzilla/> for more information on how to style ChatZilla. See also |motif|.
|
||||
|
||||
cmd.channel-pref.params = [<pref-name> [<pref-value> [<delete-pref> [<channel>]]]]
|
||||
cmd.channel-pref.help = Sets the value of the preference named <pref-name> to the value of <pref-value> on the channel <channel>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-name> starts with a minus ('-') character, then the preference will revert back to its default value. If <channel> is not provided, the current channel is assumed.
|
||||
|
||||
cmd.clear-view.label = Cl&ear This Tab
|
||||
cmd.clear-view.params = [<view>]
|
||||
cmd.clear-view.help = Clear the current view, discarding *all* content.
|
||||
|
||||
cmd.client.help = Make the ``*client*'' view current. If the ``*client*'' view has been deleted, it will be recreated.
|
||||
|
||||
cmd.commands.params = [<pattern>]
|
||||
cmd.commands.help = Lists all command names matching <pattern>, or all command names if pattern is not specified.
|
||||
|
||||
cmd.sync-motifs.help = Syncronizes all views with their current motif setting.
|
||||
cmd.sync-logs.help = Syncronizes all views with their current logging setting.
|
||||
cmd.sync-windows.help = Syncronizes all views with their current output window setting.
|
||||
cmd.sync-headers.help = Syncronizes all views with their current header display setting.
|
||||
|
||||
cmd.ctcp.params = <target> <code> [<params>]
|
||||
cmd.ctcp.help = Sends the CTCP code <code> to the target (user or channel) <target>. If <params> are specified they are sent along as well.
|
||||
|
||||
cmd.delete-view.key = accel W
|
||||
cmd.delete-view.label = &Close Tab
|
||||
cmd.delete-view.params = [<view>]
|
||||
cmd.delete-view.help = Clear the current view, discarding *all* content, and drop its icon from the tab strip.
|
||||
|
||||
cmd.deop.format = Remove Operator Status from $nickname
|
||||
cmd.deop.label = Remove Operator Status
|
||||
cmd.deop.params = <nickname> [<...>]
|
||||
cmd.deop.help = Removes operator status from <nickname> on current channel. Requires operator status.
|
||||
|
||||
cmd.desc.params = <description>
|
||||
cmd.desc.help = Changes the 'ircname' line returned when someone performs a /whois on you. You must specify this *before* connecting to the network.
|
||||
|
||||
cmd.devoice.format = Remove Voice Status from $nickname
|
||||
cmd.devoice.label = Remove Voice Status
|
||||
cmd.devoice.params = <nickname> [<...>]
|
||||
cmd.devoice.help = Removes voice status from <nickname> on current channel. Requires operator status.
|
||||
|
||||
cmd.disconnect.format = Disconnect From $networkName
|
||||
cmd.disconnect.label = Disconnect
|
||||
cmd.disconnect.params = [<reason>]
|
||||
cmd.disconnect.help = Disconnects from the server represented by the active view when the command is executed providing the reason <reason> or the default reason if <reason> is not specified.
|
||||
|
||||
cmd.echo.params = <message>
|
||||
cmd.echo.help = Displays <message> in the current view, but does not send it to the server.
|
||||
|
||||
cmd.enable-plugin.params = <plugin>
|
||||
cmd.enable-plugin.help = Meant to be used to re-enable a plugin after calling |disable-plugin|, this command calls the plugin's enablePlugin function. There are no guarantees that the plugin will properly enable itself.
|
||||
|
||||
|
||||
cmd.eval.params = <expression>
|
||||
cmd.eval.help = Evaluates <expression> as JavaScript code. Not for the faint of heart.
|
||||
|
||||
cmd.exit.params = [<reason>]
|
||||
cmd.exit.help = Disconnects from all active servers and networks, providing the reason <reason>, or the default reason if <reason> is not specified. Exits ChatZilla after disconnecting.
|
||||
|
||||
cmd.focus-input.key = VK_ESCAPE
|
||||
cmd.focus-input.help = Force keyboard focus to the input box.
|
||||
|
||||
cmd.goto-url.label = Open Link
|
||||
cmd.goto-url.params = <url>
|
||||
cmd.goto-url.help = Navigate to the url specified by <url>. If the <url> is not an irc: url, it will be opened in the most recent browser window.
|
||||
|
||||
cmd.goto-url-newwin.label = Open Link in New Window
|
||||
cmd.goto-url-newwin.params = <url>
|
||||
cmd.goto-url-newwin.help = Navigate to the url specified by <url>. If the <url> is not an irc: url, it will be opened in a new browser window.
|
||||
|
||||
cmd.goto-url-newtab.label = Open Link in New Tab
|
||||
cmd.goto-url-newtab.params = <url>
|
||||
cmd.goto-url-newtab.help = Navigate to the url specified by <url>. If the <url> is not an irc: url, it will be opened in a new tab in the most recent browser window.
|
||||
|
||||
cmd.header.help = Toggles visiblility of the header bar.
|
||||
|
||||
cmd.help.params = [<pattern>]
|
||||
cmd.help.help = Displays help on all commands matching <pattern>, if <pattern> is not given, displays help on all commands.
|
||||
|
||||
cmd.hide-view.params = [<view>]
|
||||
cmd.hide-view.help = Drop the current view's icon from the tab strip, but save its contents. The icon will reappear the next time there is activity on the view.
|
||||
|
||||
cmd.toggle-ui.params = <thing>
|
||||
cmd.toggle-ui.help = Toggles the visibility of various pieces of the user interface. <thing> must be one of: tabstrip, userlist, header, status.
|
||||
|
||||
cmd.userlist.label = User List
|
||||
cmd.userlist.key = accel shift L
|
||||
|
||||
cmd.tabstrip.label = Tab Strip
|
||||
cmd.tabstrip.key = accel shift T
|
||||
|
||||
cmd.statusbar.label = Status Bar
|
||||
cmd.statusbar.key = accel shift S
|
||||
|
||||
cmd.header.label = Header
|
||||
cmd.header.key = accel shift H
|
||||
|
||||
cmd.toggle-pref.params = <pref-name>
|
||||
cmd.toggle-pref.help = Toggles the boolean preference specified by <pref-name>.
|
||||
|
||||
cmd.toggle-ccm.label = Collapse Co&nsecutive Messages
|
||||
|
||||
cmd.toggle-copy.label = Copy &Important Messages
|
||||
|
||||
cmd.userlist.help = Toggles the visibility of the user list.
|
||||
|
||||
cmd.invite.params = <nickname> [<channel-name>]
|
||||
cmd.invite.help = Invites <nickname> to <channel-name> or current channel if not supplied. Requires operator status if +i is set.
|
||||
|
||||
cmd.j.params = <channel-name> [<key>]
|
||||
cmd.j.help = This command is an alias for /join.
|
||||
|
||||
cmd.join.params = <channel-name> [<key>]
|
||||
cmd.join.help = Joins the global (name starts with #), local (name starts with &), or modeless (name starts with a +) channel named <channel-name>. If no prefix is given, # is assumed. Provides the key <key> if specified.
|
||||
|
||||
cmd.join-charset.params = [<channel-name> <charset> [<key>]]
|
||||
cmd.join-charset.help = Joins the global (name starts with #), local (name starts with &), or modeless (name starts with a +) channel named <channel-name>. Messages will be encoded and decoded according for the character set specified by <charset>. The <charset> parameter is independent of the default character set, which can be selected with the /charset command. If no prefix is given, # is assumed. Provides the key <key> if specified.
|
||||
|
||||
cmd.kick.format = Kick $nickname from $channelName
|
||||
cmd.kick.label = Kick
|
||||
cmd.kick.params = <nickname> [<reason>]
|
||||
cmd.kick.help = Kicks <nickname> off the current channel. Requires operator status.
|
||||
|
||||
cmd.kick-ban.format = Kickban $nickname from $channelName
|
||||
cmd.kick-ban.label = Kickban
|
||||
cmd.kick-ban.params = <nickname> [<reason>]
|
||||
cmd.kick-ban.help = Bans *!username@hostmask from the current channel, then kicks them off. Requires operator status.
|
||||
|
||||
cmd.leave.format = Leave $channelName
|
||||
cmd.leave.label = Leave
|
||||
cmd.leave.params = [<channel-name> [<no-delete>]
|
||||
cmd.leave.help = Leaves the current channel, use /delete or /hide to force the view to go away. If <no-delete> is provided and is |true|, |on|, |yes|, or |1|, the the tab will not be deleted.
|
||||
|
||||
cmd.list.params = [<channel-name>]
|
||||
cmd.list.help = Lists channel name, user count, and topic information for the network/server you are attached to. If you omit the optional channel argument, all channels will be listed. On large networks, the server may disconnect you for asking for a complete list.
|
||||
|
||||
cmd.list-plugins.params = [<plugin>]
|
||||
cmd.list-plugins.help = If <plugin> is not provided, this command lists information on all loaded plugins. If <plugin> is provided, only its information will be displayed. If this command is dispatched from the console, you may specify <plugin> by either the plugin id, or index.
|
||||
|
||||
cmd.load.params = <url>
|
||||
cmd.load.help = Executes the contents of the url specified by <url>. See also: The |initialScripts| pref.
|
||||
|
||||
cmd.log.params = <state>
|
||||
cmd.log.help = Turns logging on or off for the current channel. The state will be saved in prefs, so that if logging is on when you close chatzilla, it will resume logging the next time you join the channel.
|
||||
|
||||
cmd.rlist.params = <regexp>
|
||||
cmd.rlist.help = Lists channel name, user count, and topic information for the network/server you are attached to, filtered by the regular expression.
|
||||
|
||||
cmd.reload-ui.help = Reload the ChatZilla XUL file. Used during development.
|
||||
|
||||
cmd.me.params = <action>
|
||||
cmd.me.help = Performs an 'action' on the current channel.
|
||||
|
||||
cmd.motif.params = [<motif>]
|
||||
cmd.motif.help = Sets the default CSS file used for the message tabs. <motif> can be a URL to a .css file, or the shortcut "default", "light", or "dark". See the the ChatZilla homepage at <http://www.mozilla.org/projects/rt-messaging/chatzilla/> for more information on how to style ChatZilla. See also |network-motif|, |channel-motif|, |user-motif|.
|
||||
|
||||
cmd.motif-default.label = &Default Motif
|
||||
cmd.motif-dark.label = Dar&k Motif
|
||||
cmd.motif-light.label = &Light Motif
|
||||
|
||||
cmd.msg.params = <nickname> <message>
|
||||
cmd.msg.help = Sends a private message <msg> to <nickname>.
|
||||
|
||||
cmd.name.params = <username>
|
||||
cmd.name.help = Changes the username displayed before your hostmask if the server you're connecting to allows it. Some servers will only trust the username reply from the ident service. You must specify this *before* connecting to the network.
|
||||
|
||||
cmd.names.params = [<channel-name>]
|
||||
cmd.names.help = Lists the users in a channel.
|
||||
|
||||
cmd.network.params = <network-name>
|
||||
cmd.network.help = Sets the current network to <network-name>
|
||||
|
||||
cmd.networks.help = Lists all available networks as clickable links.
|
||||
|
||||
cmd.network-charset.params = [<new-charset> [<network>]]
|
||||
cmd.network-charset.help = Sets the character encoding mode to <new-charset>, or displays the current character encoding mode if <new-charset> is not provided. If <networks> is not provided, the current network will be assumed.
|
||||
|
||||
cmd.network-motif.params = [<motif> [<network>]]
|
||||
cmd.network-motif.help = Sets the CSS file used for the message tab for the network <network>. <motif> can be a URL to a .css file, or the shortcut "default", "light", or "dark". If <motif> is a minus ('-') character, the motif will revert to the global motif. If <network> is not provided, the current network is assumed. See the the ChatZilla homepage at <http://www.mozilla.org/projects/rt-messaging/chatzilla/> for more information on how to style ChatZilla. See also |motif|.
|
||||
|
||||
cmd.network-pref.params = [<pref-name> [<pref-value> [<delete-pref> [<network>]]]]
|
||||
cmd.network-pref.help = Sets the value of the preference named <pref-name> to the value of <pref-value> on the network <network>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-name> starts with a minus ('-') character, then the preference will revert back to its default value. If <network> is not provided, the current network is assumed.
|
||||
|
||||
cmd.nick.params = <nickname>
|
||||
cmd.nick.help = Changes your current nickname.
|
||||
|
||||
cmd.notify.params = [<nickname> [<...>]]
|
||||
cmd.notify.help = With no parameters, /notify shows you the online/offline status of all the users on your notify list. If one or more <nickname> parameters are supplied, the nickname(s) will be added to your notify list if they are not yet on it, or removed from it if they are.
|
||||
|
||||
cmd.op.format = Give Operator Status to $nickname
|
||||
cmd.op.label = Give Operator Status
|
||||
cmd.op.params = <nickname> [<...>]
|
||||
cmd.op.help = Gives operator status to <nickname> on current channel. Requires operator status.
|
||||
|
||||
cmd.open-at-startup.params = [<toggle>]
|
||||
cmd.open-at-startup.help = Used to add the current view to the list of views that will be automatically opened at startup. If <toggle> is not provided, the status of the current view will be displayed. <toggle> can be one of: yes, on, true, 1, no, off, false, 0, or toggle, to toggle the current state.
|
||||
|
||||
cmd.toggle-oas.format = Open This $viewType at Startup
|
||||
cmd.toggle-oas.label = Open at Startup
|
||||
|
||||
cmd.ping.params = <target>
|
||||
cmd.ping.help = Attempts to measure the time it takes to send a message to the user nickname, and receive a response. Specifiying a channel instead is the same a pinging every person on the channel. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not.
|
||||
|
||||
cmd.pref.params = [<pref-name> [<pref-value> [<delete-pref>]]]
|
||||
cmd.pref.help = Sets the value of the preference named <pref-name> to the value of <pref-value>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-value> is a minus ('-') character, then the preference will revert back to its default value.
|
||||
|
||||
cmd.query.format = Open Private Chat with $nickname
|
||||
cmd.query.label = Open Private Chat
|
||||
cmd.query.params = <nickname> [<message>]
|
||||
cmd.query.help = Opens a one-on-one chat with <nickname>. If <message> is supplied, it is sent as the initial private message to <nickname>.
|
||||
|
||||
cmd.quit.label = Close &Window
|
||||
cmd.quit.params = [<reason>]
|
||||
cmd.quit.help = Quit ChatZilla.
|
||||
|
||||
cmd.exit-mozilla.label = &Exit
|
||||
cmd.exit-mozilla.key = accel Q
|
||||
|
||||
cmd.quit-mozilla.label = &Quit
|
||||
cmd.quit-mozilla.key = accel Q
|
||||
cmd.quit-mozilla.help = Quit Mozilla.
|
||||
|
||||
cmd.quote.params = <irc-command>
|
||||
cmd.quote.help = Sends a raw command to the IRC server, not a good idea if you don't know what you're doing. see IRC 1459 <http://www.irchelp.org/irchelp/rfc1459.html> for complete details.
|
||||
|
||||
cmd.server.params = <hostname> [<port> [<password>]]
|
||||
cmd.server.help = Connects to server <hostname> on <port>, or 6667 if <port> is not specified. Provides the password <password> if specified. If you are already connected, the view for <hostname> is made current. If that view has been deleted, it is recreated.
|
||||
|
||||
cmd.squery.params = <service> [<commands>]
|
||||
cmd.squery.help = Sends the commands <commands> to the service <service>.
|
||||
|
||||
cmd.stalk.params = <text>
|
||||
cmd.stalk.help = Add text to list of words for which you would like to see alerts. Whenever a person with a nickname matching <text> speaks, or someone says a phrase containing <text>, your ChatZilla window will become active (on some operating systems) and its taskbar icon will flash (on some operating systems.)
|
||||
|
||||
cmd.status.help = Shows status information for the current view.
|
||||
|
||||
cmd.statusbar.help = Toggles the visibility of the status bar.
|
||||
|
||||
cmd.testdisplay.help = Displays a sample text. Used to preview styles.
|
||||
|
||||
cmd.topic.params = [<new-topic>]
|
||||
cmd.topic.help = If <new-topic> is specified and you are a chanop, or the channel is not in 'private topic' mode (+t), the topic will be changed to <new-topic>. If <new-topic> is *not* specified, the current topic will be displayed.
|
||||
|
||||
cmd.tabstrip.help = Toggles the visibility of the channel tab strip.
|
||||
|
||||
cmd.unstalk.params = <text>
|
||||
cmd.unstalk.help = Remove word from list of terms for which you would like to see alerts.
|
||||
|
||||
cmd.disable-plugin.params = <plugin>
|
||||
cmd.disable-plugin.help = This command calls the plugin's disablePlugin function, if it exists. There are no guarantees that the plugin will properly disable itself.
|
||||
|
||||
cmd.usermode.params = [<new-mode>]
|
||||
cmd.usermode.help = Changes or displays the current user mode.
|
||||
|
||||
cmd.user-charset.params = [<new-charset> [<user>]]
|
||||
cmd.user-charset.help = Sets the character encoding mode to <new-charset>, or displays the current character encoding mode if <new-charset> is not provided. If <user> is not provided, the current user will be assumed.
|
||||
|
||||
cmd.user-motif.params = [<motif> [<user>]]
|
||||
cmd.user-motif.help = Sets the CSS file used for the message tab for the user <user>. <motif> can be a URL to a .css file, or the shortcut "default", "light", or "dark". If <motif> is a minus ('-') character, the motif will revert to the network motif. If <user> is not provided, the current user is assumed. See the the ChatZilla homepage at <http://www.mozilla.org/projects/rt-messaging/chatzilla/> for more information on how to style ChatZilla. See also |motif|.
|
||||
|
||||
cmd.user-pref.params = [<pref-name> [<pref-value> [<delete-pref> [<user>]]]]
|
||||
cmd.user-pref.help = Sets the value of the preference named <pref-name> to the value of <pref-value> on the user <user>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-name> starts with a minus ('-') character, then the preference will revert back to its default value. If <user> is not provided, the current user is assumed.
|
||||
|
||||
cmd.version.format = Get Version Information from $nickname
|
||||
cmd.version.label = Get Version Information
|
||||
cmd.version.params = <nickname>
|
||||
cmd.version.help = Asks <nickname> what irc client they're running. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not.
|
||||
|
||||
cmd.voice.format = Give Voice Status to $nickname
|
||||
cmd.voice.label = Give Voice Status
|
||||
cmd.voice.params = <nickname> [<...>]
|
||||
cmd.voice.help = Gives voice status to <nickname> on current channel. Requires operator status.
|
||||
|
||||
cmd.who.params = <pattern>
|
||||
cmd.who.help = List users who have name, host, or description information matching <pattern>.
|
||||
|
||||
cmd.whois.format = Whois $nickname
|
||||
cmd.whois.label = Whois
|
||||
cmd.whois.params = <nickname> [<...>]
|
||||
cmd.whois.help = Displays information about the user <nickname>, including 'real name', server connected to, idle time, and signon time. Note that some servers will lie about the idle time.
|
||||
|
||||
cmd.whowas.params = <nick-pattern>
|
||||
cmd.whowas.help = List brief information for users with a nickname matching <nick-pattern> who have recently logged on to the IRC network.
|
||||
|
||||
## dispatch-related error messages ##
|
||||
msg.err.internal.dispatch = Internal error dispatching command ``%1$S''.
|
||||
msg.err.internal.hook = Internal error processing hook ``%1$S''.
|
||||
msg.err.no.command = No command named ``%1$S''.
|
||||
msg.err.invalid.param = Invalid value for parameter %1$S (%2$S)
|
||||
msg.err.disabled = Sorry, ``%1$S'' is currently disabled
|
||||
msg.err.notimplemented = Sorry, ``%1$S'' has not been implemented
|
||||
msg.err.required.param = Missing required parameter %1$S
|
||||
msg.err.ambigcommand = Ambiguous command, ``%1$S'', %2$S commands match [%3$S]
|
||||
|
||||
## chatzilla error messages ##
|
||||
msg.err.invalid.pref = Invalid value for preference %1$S (%2$S)
|
||||
msg.err.failure = Operation Failed: %1$S
|
||||
msg.err.scriptload = Error loading subscript from <%1$S>.
|
||||
msg.err.invalid.scheme = Invalid scheme in url <%1$S>.
|
||||
msg.err.unknown.pref = Unknown pref name ``%1$S''.
|
||||
msg.err.unknown.network = Unknown network ``%S''
|
||||
msg.err.unknown.channel = Unknown channel ``%S''
|
||||
msg.err.unknown.user = Unknown user ``%S''
|
||||
msg.err.unknown.stalk = Not stalking %S
|
||||
msg.err.unknown.motif = Unknown motif ``%S''
|
||||
msg.err.invalid.charset = Invalid character encoding mode ``%S''.
|
||||
msg.err.improper.view = ``%S'' cannot be used from this view.
|
||||
msg.err.not.connected = Not connected.
|
||||
msg.err.last.view = Cannot delete last view.
|
||||
msg.err.bad.ircurl = Invalid IRC URL ``%S''
|
||||
msg.err.need.network = Command ``%1$S'' must be run in the context of a network
|
||||
msg.err.need.server = Command ``%1$S'' must be run in the context of an attached server
|
||||
msg.err.need.channel = Command ``%1$S'' must be run in the context of a channel
|
||||
msg.err.need.user = Command ``%1$S'' must be run in the context of a user
|
||||
msg.err.no.default = No default action for objects of type ``%S''
|
||||
msg.err.no.match = No match for ``%S''
|
||||
msg.err.no.socket = Error creating socket
|
||||
msg.err.exhausted = Connection attempts exhausted, giving up.
|
||||
|
||||
msg.warn.unk.command = Unknown command ``%S'', just guessing.
|
||||
|
||||
msg.val.on = on
|
||||
msg.val.off = off
|
||||
|
||||
## formatting ##
|
||||
msg.fmt.usage = %1$S %2$S
|
||||
msg.fmt.jsexception = %1$S: %2$S @ <%3$S> %4$S"
|
||||
# 1: error number, 2: error text, 3: file name, 4: line number, 5: function name
|
||||
# 1: pref name 2: value
|
||||
msg.fmt.pref = Preference ``%1$S'' is ``%2$S''
|
||||
msg.fmt.netpref = Network preference ``%1$S'' is ``%2$S''
|
||||
msg.fmt.chanpref = Channel preference ``%1$S'' is ``%2$S''
|
||||
msg.fmt.userpref = User preference ``%1$S'' is ``%2$S''
|
||||
|
||||
msg.fmt.plugin1 = Plugin at index %S, loaded from <%S>
|
||||
msg.fmt.plugin2 = id: %S, version: %S, enabled: %S, status: %S
|
||||
msg.fmt.plugin3 = Description: %S
|
||||
|
||||
msg.fmt.usercount = %S, %S@, %S+
|
||||
msg.fmt.alias = %S = %S
|
||||
msg.fmt.seconds = %S seconds
|
||||
|
||||
msg.fmt.matchlist = %S matches for ``%S'': [%S]
|
||||
msg.fmt.ctcpreply = CTCP %S reply ``%S'' from %S
|
||||
msg.fmt.chanlist = %S %S %S
|
||||
|
||||
# 1: month, 2: dom, 3: hours, 4: minutes, 5: nick info
|
||||
msg.fmt.status = %S/%S %S:%S, %S
|
||||
# 1: month, 2: dom, 3: hours, 4: minutes
|
||||
msg.fmt.date = %S/%S %S:%S
|
||||
|
||||
msg.unknown = <unknown>
|
||||
msg.none = <none>
|
||||
msg.na = <n/a>
|
||||
|
||||
msg.commasp = ", "
|
||||
msg.always = always
|
||||
msg.and = and
|
||||
msg.primary = primary
|
||||
msg.secondary = secondary
|
||||
msg.you = you
|
||||
msg.network = Network
|
||||
msg.channel = Channel
|
||||
msg.user = User
|
||||
msg.client = Client
|
||||
msg.view = View
|
||||
msg.tab = Tab
|
||||
msg.loading = Loading
|
||||
msg.error = Error
|
||||
msg.here = here
|
||||
msg.gone = gone
|
||||
msg.connecting = Connecting
|
||||
msg.connected = Connected
|
||||
msg.disconnected = Disconnected
|
||||
|
||||
msg.days=%S days
|
||||
msg.hours=%S hours
|
||||
msg.minutes=%S minutes
|
||||
msg.seconds=%S seconds
|
||||
|
||||
|
||||
msg.rsp.hello = [HELLO]
|
||||
msg.rsp.help = [HELP]
|
||||
msg.rsp.usage = [USAGE]
|
||||
msg.rsp.error = [ERROR]
|
||||
msg.rsp.warn = [WARNING]
|
||||
msg.rsp.info = [INFO]
|
||||
msg.rsp.evin = [EVAL-IN]
|
||||
msg.rsp.evout = [EVAL-OUT]
|
||||
|
||||
msg.mnu.showhide = Sho&w/Hide
|
||||
msg.mnu.file = &File
|
||||
msg.mnu.help = &Help
|
||||
msg.mnu.view = &View
|
||||
msg.mnu.motifs = Color Scheme
|
||||
msg.mnu.opcommands = Operator Commands
|
||||
|
||||
msg.client.name = *client*
|
||||
msg.cant.disable = Plugin %S does not support being disabled.
|
||||
msg.cant.enable = Plugin %S does not support being enabled.
|
||||
msg.no.help = Help not available.
|
||||
msg.no.cmdmatch = No commands match ``%1$S''.
|
||||
msg.cmdmatch = Commands matching ``%1$S'' are [%2$S].
|
||||
msg.default.alias.help = This command is an alias for |%1$S|.
|
||||
msg.extra.params = Extra parameters ``%1$S'' ignored.
|
||||
msg.version.reply = Chatzilla %S [%S]
|
||||
msg.nothing.to.cancel = No connection in progress, nothing to cancel.
|
||||
msg.cancelling = Cancelling connection to ``%S''...
|
||||
msg.current.charset = Using ``%S'' as default charset.
|
||||
msg.current.charset.net = Using ``%S'' as default charset for this network.
|
||||
msg.current.charset.chan = Using ``%S'' as charset for this channel.
|
||||
msg.current.charset.user = Using ``%S'' as charset for this user.
|
||||
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.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).
|
||||
msg.server.info = %S: Connected for %S, last ping: %S, server roundtrip (lag): %S seconds.
|
||||
msg.connect.via = Connected via %S
|
||||
msg.user.mode = User mode for %S is now %S
|
||||
msg.not.connected = %S: Not connected.
|
||||
msg.member = Member
|
||||
msg.operator = Operator member
|
||||
msg.voiced = Voiced member
|
||||
msg.voiceop = Operator and voiced member
|
||||
msg.no.mode = no mode
|
||||
msg.topic.info = %S, %S: Topic, ``%S''
|
||||
msg.notopic.info = %S, %S: No topic.
|
||||
msg.channel.info = %S: %S of %S (%S) <%S>
|
||||
msg.channel.details = %S/%S: %S users total, %S operators, %S voiced.
|
||||
msg.nonmember = %S: No longer a member of %S.
|
||||
msg.end.status = End of status.
|
||||
msg.networks.heada = Available networks are [
|
||||
msg.networks.headb = ].
|
||||
msg.messages.cleared = Messages Cleared.
|
||||
cli_inamesMsg3=You must supply a channel name to use /names from this view.
|
||||
msg.channel.opened = Channel view for ``%S'' opened.
|
||||
msg.commands.header = Type /help <command-name> for information about a specific command.
|
||||
msg.match.commands = Currently implemented commands matching the pattern ``%S'' are [%S].\nType /help <command-name> for information about a specific command.
|
||||
msg.all.commands = Currently implemented commands are [%S].
|
||||
msg.homepage = Please visit the ChatZilla homepage at <http://www.mozilla.org/projects/rt-messaging/chatzilla/> for more information.
|
||||
msg.client.opened = JavaScript console for ``*client*'' opened.
|
||||
msg.newnick.you = YOU are now known as %S
|
||||
msg.newnick.notyou = %S is now known as %S
|
||||
|
||||
msg.no.notify.list = Your notify list is empty
|
||||
msg.notify.addone = %S has been added to your notify list.
|
||||
msg.notify.addsome = %S have been added to your notify list.
|
||||
msg.notify.delone = %S has been removed from your notify list.
|
||||
msg.notify.delsome = %S have been removed from your notify list.
|
||||
|
||||
msg.not.an.alias = No such alias: %S
|
||||
msg.alias.removed = Removed alias: %S
|
||||
msg.alias.created = Created alias: %S = %S
|
||||
msg.no.aliases = No aliases are defined
|
||||
|
||||
msg.no.stalk.list = No stalking victims.
|
||||
msg.stalk.list = Currently stalking [%S]
|
||||
msg.stalk.add = Now stalking %S
|
||||
msg.stalk.del = No longer stalking %S
|
||||
|
||||
msg.title.net.on = User %S on ``%S'' (%S:%S)
|
||||
msg.title.net.off = User %S, not connected to network ``%S''
|
||||
msg.title.nonick = <unregistered-user>
|
||||
msg.title.no.topic = No Topic
|
||||
msg.title.no.mode = No Mode
|
||||
msg.title.channel = %S on %S (%S): %S
|
||||
msg.title.user = Conversation with %S %S
|
||||
msg.title.unknown = ChatZilla!
|
||||
msg.title.activity = %S -- Activity [%S]
|
||||
|
||||
msg.logging.off = Logging is off.
|
||||
msg.logging.on = Logging is on. Log output is going to file ``%S''.
|
||||
msg.logfile.closed = Logfile closed.
|
||||
msg.logfile.error = Unable to open file ``%S'', logging disabled.
|
||||
msg.logfile.opened = Now logging to <%S>.
|
||||
msg.logfile.closing = Closing log file.
|
||||
msg.logfile.write.error = Unable to write to file ``%S''. Logging disabled.
|
||||
|
||||
msg.query.opened = Query view for ``%S'' opened.
|
||||
msg.network.opened = Network view for ``%S'' opened.
|
||||
msg.already.connected = You are already connected to ``%S''.
|
||||
msg.enter.nick = Please select a nickname
|
||||
msg.network.connecting = Attempting to connect to ``%S''. Use /cancel to abort.
|
||||
|
||||
msg.url.password = Enter a password for the url %S
|
||||
msg.url.key = Enter key for url %S
|
||||
|
||||
msg.startup.added = <%1$S> will now open at startup.
|
||||
msg.startup.removed = <%1$S> will no longer open at startup.
|
||||
msg.startup.exists = <%1$S> is currently opened at startup.
|
||||
msg.startup.notfound = <%1$S> is not currently opened at startup.
|
||||
|
||||
msg.test.hello = Sample HELLO message, <http://testurl.com/foo.html>.
|
||||
msg.test.info = Sample INFO message, <http://testurl.com/foo.html>.
|
||||
msg.test.error = Sample ERROR message, <http://testurl.com/foo.html>.
|
||||
msg.test.help = Sample HELP message, <http://testurl.com/foo.html>.
|
||||
msg.test.usage = Sample USAGE message, <http://testurl.com/foo.html>.
|
||||
msg.test.status = Sample STATUS message, <http://testurl.com/foo.html>.
|
||||
msg.test.privmsg = Normal message from %S to %S, <http://testurl.com/foo.html>.
|
||||
msg.test.action = Action message from %S to %S, <http://testurl.com/foo.html>.
|
||||
msg.test.notice = Notice message from %S to %S, <http://testurl.com/foo.html>.
|
||||
msg.test.url = Sample URL <http://www.mozilla.org> message.
|
||||
msg.test.styles = Sample text styles *bold*, _underline_, /italic/, |teletype| message.
|
||||
msg.test.emoticon = Sample emoticon :) :( :~( :0 :/ :P :| (* message.
|
||||
msg.test.rheet = Sample Rheeeeeeeeeet! message.
|
||||
msg.test.topic = Sample Topic message, <http://testurl.com/foo.html>.
|
||||
msg.test.join = Sample Join message, <http://testurl.com/foo.html>.
|
||||
msg.test.part = Sample Part message, <http://testurl.com/foo.html>.
|
||||
msg.test.kick = Sample Kick message, <http://testurl.com/foo.html>.
|
||||
msg.test.quit = Sample Quit message, <http://testurl.com/foo.html>.
|
||||
msg.test.stalk = %S : Sample /stalk match, <http://testurl.com/foo.html>.
|
||||
msg.test.ctlchr = Sample control char >%01<\\1 -- >%05<\\5 -- >%10<\\10
|
||||
msg.test.color = Sample color %033c%034o%034l%033o%033r%034%20%036t%036e%032s%034t%0f message.
|
||||
msg.test.quote = Sample ``double quote'' message.
|
||||
|
||||
msg.welcome = Welcome to ChatZilla...\nUse /attach <network-name> to connect to a network, or click on one of the network names below.\nFor general IRC help and FAQs, please go to <http://www.irchelp.org>, for information about ChatZilla go to <http://www.mozilla.org/projects/rt-messaging/chatzilla/>.
|
||||
msg.tabdnd.drop = Would you like to use the file ``%S'' as your new motif?
|
||||
msg.default.status = Welcome to ChatZilla!
|
||||
|
||||
msg.closing = Disconnecting from IRC. Click close again to exit now.
|
||||
|
||||
msg.whois.name = %S <%S@%S> ``%S''
|
||||
msg.whois.channels = %S: member of %S
|
||||
msg.whois.server = %S: attached to %S ``%S''
|
||||
msg.whois.idle = %S: idle for %S (on since %S)
|
||||
msg.whois.end = End of WHOIS information for %S
|
||||
|
||||
msg.you.invite = You have invited %S to %S
|
||||
msg.invite.you = %S (%S@%S) has invited you to %S
|
||||
|
||||
msg.nick.in.use = The nickname ``%S'' is already in use, use the /nick command to pick a new one.
|
||||
msg.retry.nick = The nickname ``%S'' is already in use, trying ``%S''.
|
||||
|
||||
msg.list.rerouted = List reply will appear on the ``%S'' view.
|
||||
msg.list.end = Displayed %S of %S channels
|
||||
|
||||
msg.who.end = End of WHO results for ``%S'', %S user(s) found
|
||||
msg.who.match = User %S, (%S@%S) ``%S'' (%S), member of %S, is connected to <irc://%S/>, %S hop(s)
|
||||
|
||||
msg.connection.attempt = Connecting to %S via %S:%S, attempt %S of %S...
|
||||
msg.connection.refused = Connection to %S (%S:%S) refused.
|
||||
msg.connection.timeout = Connection to %S (%S:%S) timed out.
|
||||
msg.unknown.host = Unknown host %S.
|
||||
msg.connection.closed = Connection to %S (%S:%S) closed.
|
||||
msg.close.status = Connection to %S (%S:%S) closed with status %S.
|
||||
|
||||
msg.ping.reply = Ping reply from %S in %S
|
||||
msg.prefix.response = %S , your result is,
|
||||
|
||||
msg.topic.changed = %S has changed the topic to ``%S''
|
||||
msg.topic = Topic for %S is ``%S''
|
||||
msg.no.topic = No topic for channel %S
|
||||
msg.topic.date = Topic for %S was set by %S on %S
|
||||
|
||||
msg.you.joined = YOU have joined %S
|
||||
msg.someone.joined = %S (%S@%S) has joined %S
|
||||
msg.you.left = YOU have left %S
|
||||
msg.someone.left = %S has left %S
|
||||
msg.youre.gone = YOU have been booted from %S by %S (%S)
|
||||
msg.someone.gone = %S was booted from %S by %S (%S)
|
||||
|
||||
msg.mode.changed = Mode %S by %S
|
||||
|
||||
msg.you.quit = YOU have left %S (%S)
|
||||
msg.someone.quit = %S has left %S (%S)
|
||||
|
||||
msg.unknown.ctcp = Unknown CTCP %S (%S) from %S
|
||||
|
||||
# pref-irc-appearance.js
|
||||
file_browse_CSS=Choose a Cascading Stylesheet (CSS) file
|
||||
file_browse_CSS_spec=Cascading Stylesheet files (*.css)
|
||||
|
||||
# pref-irc-sound.js
|
||||
file_browse_Wave=Choose a Wave Sound file
|
||||
file_browse_Wave_spec=Sound files (*.wav)
|
||||
|
||||
# pref-irc-stalk.js
|
||||
stalk_add_msg=Enter the stalk word to add:
|
||||
|
||||
# pref-irc-startup.js
|
||||
file_browse_Script=Choose a JavaScript Script file
|
||||
file_browse_Script_spec=JavaScript Script files (*.js)
|
||||
|
||||
munger.mailto=Mailto
|
||||
munger.link=URLs
|
||||
munger.channel-link=IRC channel
|
||||
munger.bugzilla-link=Bugzilla link
|
||||
munger.face=Face
|
||||
munger.ear=Ear
|
||||
munger.quote=Double Quotes
|
||||
munger.rheet=Rheet
|
||||
munger.bold=Bold
|
||||
munger.italic=Italic
|
||||
munger.teletype=Teletype
|
||||
munger.underline=Underline
|
||||
munger.ctrl-char=Control Chars
|
||||
@@ -1,3 +0,0 @@
|
||||
<!ENTITY ircCmd.label "IRC Chat">
|
||||
<!ENTITY ircCmd.accesskey "i">
|
||||
<!ENTITY ircCmd.commandkey "6">
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US"
|
||||
chrome:displayName="English(US)"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="en-US"
|
||||
chrome:previewURL="http://www.mozilla.org/locales/en-US.gif">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US:chatzilla"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US:chatzilla"
|
||||
chrome:localeVersion="1.5b"/>
|
||||
|
||||
</RDF:RDF>
|
||||
@@ -1,235 +0,0 @@
|
||||
<!ENTITY text.window.title "Appearance">
|
||||
|
||||
<!ENTITY prePro.title "Text Munger">
|
||||
<!ENTITY prePro.desc "The Text Munger processes all text before display, and does things like convert web addresses into links you can click on. Hover the mouse over a checkbox for an explanation of the item.">
|
||||
<!ENTITY prePro.styles "Styles:">
|
||||
<!ENTITY prePro.links "Links:">
|
||||
<!ENTITY prePro.otherOptions "Other text options:">
|
||||
|
||||
<!-- NOTE for localizers: "Bugzilla" is a product name. -->
|
||||
<!ENTITY prePro.styles.bold.label "Bold">
|
||||
<!ENTITY prePro.styles.bold.accesskey "B">
|
||||
<!ENTITY prePro.styles.bold.tooltip "Displays text between asterisks (*) in bold">
|
||||
<!ENTITY prePro.styles.italic.label "Italic">
|
||||
<!ENTITY prePro.styles.italic.accesskey "I">
|
||||
<!ENTITY prePro.styles.italic.tooltip "Displays text between forward slashes (/) in italic">
|
||||
<!ENTITY prePro.styles.underline.label "Underline">
|
||||
<!ENTITY prePro.styles.underline.accesskey "U">
|
||||
<!ENTITY prePro.styles.underline.tooltip "Displays text between underscores (_) with underline">
|
||||
<!ENTITY prePro.styles.teletype.label "Teletype">
|
||||
<!ENTITY prePro.styles.teletype.accesskey "T">
|
||||
<!ENTITY prePro.styles.teletype.tooltip "Displays text between pipes (|) in a fixed-width font">
|
||||
<!ENTITY prePro.styles.web.label "Web links">
|
||||
<!ENTITY prePro.styles.web.accesskey "W">
|
||||
<!ENTITY prePro.styles.web.tooltip "Converts text that looks like website addresses into links">
|
||||
<!ENTITY prePro.styles.mail.label "E-mail links">
|
||||
<!ENTITY prePro.styles.mail.accesskey "m">
|
||||
<!ENTITY prePro.styles.mail.tooltip "Converts text that looks like e-mail addresses into links">
|
||||
<!ENTITY prePro.styles.channel.label "Channel">
|
||||
<!ENTITY prePro.styles.channel.accesskey "C">
|
||||
<!ENTITY prePro.styles.channel.tooltip "Converts text that looks like IRC channel names into links">
|
||||
<!ENTITY prePro.styles.bug.label "Bugzilla bugs">
|
||||
<!ENTITY prePro.styles.bug.accesskey "g">
|
||||
<!ENTITY prePro.styles.bug.tooltip "Converts the text 'bug ' followed by a number into a Bugzilla bug link">
|
||||
<!ENTITY prePro.emoti.label "Emoticons">
|
||||
<!ENTITY prePro.emoti.accesskey "E">
|
||||
<!ENTITY prePro.emoti.tooltip "Displays eight common emoticons (e.g. :) ) as small graphics">
|
||||
<!ENTITY prePro.colors.label "Colors">
|
||||
<!ENTITY prePro.colors.accesskey "l">
|
||||
<!ENTITY prePro.colors.tooltip "Enables displaying text in different colors, if it includes special color codes">
|
||||
<!ENTITY prePro.wrap.label "Wrap lines">
|
||||
<!ENTITY prePro.wrap.accesskey "p">
|
||||
<!ENTITY prePro.wrap.tooltip "Allows longs words to wrap in the middle">
|
||||
<!ENTITY prePro.bugURL.label "Bugzilla URL:">
|
||||
<!ENTITY prePro.bugURL.accesskey "z">
|
||||
|
||||
<!-- NOTE for localizers: "ChatZilla" is a product name. -->
|
||||
<!ENTITY style.title "Text Style">
|
||||
<!ENTITY style.desc "ChatZilla applies a Cascading Stylesheet (CSS) to all the chat text it displays. You can use this to change how the text looks, including the color and size of the text.">
|
||||
<!ENTITY style.css.label "Style:">
|
||||
<!ENTITY style.css.accesskey "S">
|
||||
<!ENTITY style.custom.label "Custom stylesheet file...">
|
||||
<!ENTITY style.default.label "Default (normal)">
|
||||
<!ENTITY style.light.label "Light (normal)">
|
||||
<!ENTITY style.dark.label "Dark (normal)">
|
||||
<!ENTITY style.faces.default.label "Default (with faces)">
|
||||
<!ENTITY style.faces.light.label "Light (with faces)">
|
||||
<!ENTITY style.faces.dark.label "Dark (with faces)">
|
||||
<!ENTITY style.preview.label "Preview">
|
||||
<!ENTITY style.preview.accesskey "v">
|
||||
|
||||
<!ENTITY appearance-previewCSS.window.title "Preview ChatZilla Stylesheet">
|
||||
<!ENTITY pref-irc.window.title "ChatZilla">
|
||||
|
||||
<!ENTITY userDetails.title "User Identification">
|
||||
<!ENTITY userDetails.help.label "What do these mean?">
|
||||
<!ENTITY userDetails.help.accesskey "W">
|
||||
<!ENTITY userDetails.help.desc "Your hostmask, which is used to identify you to other clients and the server, places your user name before the host you are connecting from. So a user name of 'myself' would mean you would be identified as 'myself@host.tld', where 'host.tld' would be dependent on your internet service provider.">
|
||||
|
||||
<!ENTITY userDetails.nick.label "Nick name:">
|
||||
<!ENTITY userDetails.nick.accesskey "N">
|
||||
<!ENTITY userDetails.name.label "User name:">
|
||||
<!ENTITY userDetails.name.accesskey "U">
|
||||
<!ENTITY userDetails.desc.label "Description:">
|
||||
<!ENTITY userDetails.desc.accesskey "D">
|
||||
|
||||
<!ENTITY global.title "Global Options">
|
||||
|
||||
<!ENTITY global.notify.label "Allow aggressive notify (flashing window or bringing to top)">
|
||||
<!ENTITY global.notify.accesskey "a">
|
||||
<!ENTITY global.collapse.label "Collapse consecutive messages from the same source">
|
||||
<!ENTITY global.collapse.accesskey "c">
|
||||
<!ENTITY global.copyMsgs.label "Copy important messages to the network tab">
|
||||
<!ENTITY global.copyMsgs.accesskey "i">
|
||||
<!ENTITY global.reconnect.label "Automatically reconnect after a disconnect">
|
||||
<!ENTITY global.reconnect.accesskey "r">
|
||||
<!ENTITY global.colorcodes.label "Enable color code escape characters">
|
||||
<!ENTITY global.colorcodes.accesskey "l">
|
||||
<!ENTITY global.nickCompleteStr.label "Nickname completion string:">
|
||||
<!ENTITY global.nickCompleteStr.accesskey "k">
|
||||
<!ENTITY global.nickCompleteStr.desc "This is appended to a nickname when tab-completed as the first word.">
|
||||
<!ENTITY global.Charset.grouplabel "Character Coding">
|
||||
<!ENTITY global.DefaultCharset.label "Default Character Coding:">
|
||||
<!ENTITY global.DefaultCharset.accesskey "d">
|
||||
<!-- LOCALIZATION NOTE Charset Coding Preferences Dialog: Do NOT localize the terms "en-bz, ar-jo" -->
|
||||
<!ENTITY interface.window.title "Interface">
|
||||
|
||||
<!ENTITY tabs.title "Tab Options">
|
||||
|
||||
<!ENTITY tabs.createForPMs.label "Create new tabs for private messages">
|
||||
<!ENTITY tabs.createForPMs.accesskey "t">
|
||||
<!ENTITY tabs.limitPMTabs.label "Limit private message tabs to">
|
||||
<!ENTITY tabs.limitPMTabs.accesskey "L">
|
||||
<!ENTITY tabs.focusPMs.label "Focus Private Message tabs when created">
|
||||
<!ENTITY tabs.focusPMs.accesskey "F">
|
||||
<!ENTITY tabs.closeOnLeave.label "Close tab when you leave a channel">
|
||||
<!ENTITY tabs.closeOnLeave.accesskey "C">
|
||||
|
||||
<!ENTITY scrollback.title "Scrollback Options">
|
||||
|
||||
<!ENTITY scrollback.label "Use the boxes here to specify how many lines of scrollback each type of tab has. When more text arrives in a tab, the oldest lines are removed according to the limits set here.">
|
||||
|
||||
<!ENTITY scrollback.1.label "Client view:">
|
||||
<!ENTITY scrollback.1.accesskey "i">
|
||||
<!ENTITY scrollback.2.label "Network views:">
|
||||
<!ENTITY scrollback.2.accesskey "n">
|
||||
<!ENTITY scrollback.3.label "Channel views:">
|
||||
<!ENTITY scrollback.3.accesskey "h">
|
||||
<!ENTITY scrollback.4.label "Private message views:">
|
||||
<!ENTITY scrollback.4.accesskey "p">
|
||||
<!ENTITY sound.window.title "Sound">
|
||||
|
||||
<!ENTITY sndFile.label "Sound file:">
|
||||
<!ENTITY sndPresets.label "Preset sounds:">
|
||||
<!ENTITY sndPreset1.label "No sound">
|
||||
<!ENTITY sndPreset2.label "Single beep">
|
||||
<!ENTITY sndPreset3.label "Double beep">
|
||||
<!ENTITY sndChoose.label "Custom sound file...">
|
||||
|
||||
<!ENTITY sndSimpleMsg.title "Sound on new Private Message tab">
|
||||
<!ENTITY sndSimpleMsg.accesskey "n">
|
||||
|
||||
<!ENTITY sndPrivateMsg.title "Sound on existing Private Message tab">
|
||||
<!ENTITY sndPrivateMsg.accesskey "e">
|
||||
|
||||
<!ENTITY sndStalkMsg.title "Sound on stalk word(s)">
|
||||
<!ENTITY sndStalkMsg.accesskey "s">
|
||||
<!ENTITY stalk.window.title "Stalking">
|
||||
|
||||
<!ENTITY stalkWords.title "Stalk Words">
|
||||
<!ENTITY stalkWords.accesskey "S">
|
||||
<!ENTITY stalkWholeWords.label "Stalk whole words only">
|
||||
<!ENTITY stalkWholeWords.tooltip "Do not match stalk words as substrings of larger words">
|
||||
<!ENTITY stalkWholeWords.accesskey "w">
|
||||
|
||||
<!ENTITY stalkWords.label1 "When ChatZilla sees an 'important' message, it will highlight the line and the channel's tab. If you have 'aggressive notify' enabled, ChatZilla will also use an OS-dependent method to grab your attention.">
|
||||
<!ENTITY stalkWords.label2 "Your nickname is always considered 'important', but you can add more words; just add them to the list below.">
|
||||
|
||||
<!ENTITY list.up.label "Move Up">
|
||||
<!ENTITY list.up.script.accesskey "U">
|
||||
<!ENTITY list.up.server.accesskey "v">
|
||||
|
||||
<!ENTITY list.dn.label "Move Down">
|
||||
<!ENTITY list.dn.script.accesskey "w">
|
||||
<!ENTITY list.dn.server.accesskey "n">
|
||||
|
||||
<!ENTITY list.add.label "Add...">
|
||||
<!ENTITY list.add.script.accesskey "A">
|
||||
<!ENTITY list.add.server.accesskey "d">
|
||||
<!ENTITY list.add.stalk.accesskey "A">
|
||||
|
||||
<!ENTITY list.edit.label "Edit...">
|
||||
<!ENTITY list.edit.accesskey "E">
|
||||
|
||||
<!ENTITY list.del.label "Remove">
|
||||
<!ENTITY list.del.script.accesskey "R">
|
||||
<!ENTITY list.del.server.accesskey "m">
|
||||
<!ENTITY list.del.stalk.accesskey "m">
|
||||
<!ENTITY startup.window.title "Startup">
|
||||
|
||||
<!ENTITY startupOrder.label "When ChatZilla starts, it will load the JavaScript scripts first, then connect to any autoconnect servers and channels in the order shown.">
|
||||
|
||||
<!ENTITY autoScripts.title "Autoload scripts">
|
||||
<!ENTITY autoScripts.accesskey "l">
|
||||
<!ENTITY autoURLs.title "Autoconnect servers, channels and private message views">
|
||||
<!ENTITY autoURLs.accesskey "c">
|
||||
|
||||
<!ENTITY startup-newScript.window.title "ChatZilla Script Item">
|
||||
|
||||
<!ENTITY text.desc "Enter a web location (URL), or specify the local script file you want:">
|
||||
<!ENTITY startup-newURL.window.title "ChatZilla Autoconnect Item">
|
||||
|
||||
<!ENTITY normal.label "Connect to a server or network">
|
||||
<!ENTITY normal.server "Enter the host name (irc.myserver.com) or the IP address (127.1.2.3) of the server:">
|
||||
<!ENTITY normal.channel.label "Also connect to the...">
|
||||
<!ENTITY normal.isnick.label "nickname">
|
||||
<!ENTITY normal.isor.label "or">
|
||||
<!ENTITY normal.ischan.label "channel">
|
||||
<!ENTITY normal.needpass.label "This server needs a password">
|
||||
<!ENTITY normal.needkey.label "This channel has a key">
|
||||
|
||||
<!ENTITY client.label "Open client view">
|
||||
<!ENTITY client.desc "The client view shows some basic information about ChatZilla and how to use it.">
|
||||
<!ENTITY tabs.window.title "Tabs">
|
||||
|
||||
<!ENTITY tabs.title "Tab Options">
|
||||
|
||||
<!ENTITY tabs.createForPMs.label "Create new tabs for private messages">
|
||||
<!ENTITY tabs.createForPMs.accesskey "">
|
||||
<!ENTITY tabs.limitPMTabs.label "Limit private message tabs to:">
|
||||
<!ENTITY tabs.limitPMTabs.accesskey "">
|
||||
<!ENTITY tabs.focusPMs.label "Focus Private Message tabs when created">
|
||||
<!ENTITY tabs.focusPMs.accesskey "f">
|
||||
<!ENTITY tabs.closeOnLeave.label "Close tab when you leave a channel">
|
||||
<!ENTITY tabs.closeOnLeave.accesskey "c">
|
||||
|
||||
<!ENTITY scrollback.title "Scrollback Options">
|
||||
|
||||
<!ENTITY scrollback.label "Use the boxes here to specify how many lines of scrollback each type of tab has. When more text arrives in a tab, the oldest lines are removed according to the limits set here.">
|
||||
|
||||
<!ENTITY scrollback.1.label "Client view">
|
||||
<!ENTITY scrollback.1.accesskey "">
|
||||
<!ENTITY scrollback.2.label "Network views">
|
||||
<!ENTITY scrollback.2.accesskey "">
|
||||
<!ENTITY scrollback.3.label "Channel views">
|
||||
<!ENTITY scrollback.3.accesskey "">
|
||||
<!ENTITY scrollback.4.label "Private message views">
|
||||
<!ENTITY scrollback.4.accesskey "">
|
||||
<!ENTITY appearance.window.title "Appearance">
|
||||
|
||||
<!ENTITY prePro.title "Text Pre-processor">
|
||||
<!ENTITY prePro.desc "The Text Pre-processor processes all text before display, and does things like convert web addresses into links you can click on.">
|
||||
<!ENTITY prePro.styles "Styles:">
|
||||
<!ENTITY prePro.links "Links:">
|
||||
<!ENTITY prePro.otherOptions "Other text options:">
|
||||
<!ENTITY prePro.emoti "Enable emoticons (smilies)">
|
||||
<!ENTITY prePro.colors "Enable color codes">
|
||||
<!ENTITY prePro.wrap "Wrap long lines">
|
||||
|
||||
<!ENTITY text.title "Text Display">
|
||||
<!ENTITY text.desc "These are some options that affect how text is displayed after it has been through the Text Pre-processor.">
|
||||
<!ENTITY text.collapse "Collapse consecutive messages">
|
||||
<!ENTITY text.copyMsgs "Copy important messages (to server tab)">
|
||||
|
||||
<!ENTITY style.title "Text Style">
|
||||
<!ENTITY style.desc "">
|
||||
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla JSIRC Library.
|
||||
*
|
||||
* The Initial Developer of the Original Code is New Dimensions Consulting,
|
||||
* Inc. Portions created by New Dimensions Consulting, Inc. are
|
||||
* Copyright (C) 1999 New Dimenstions Consulting, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* Styles for UI, See output-default.css for output window styles
|
||||
*
|
||||
*/
|
||||
|
||||
@import url(chrome://communicator/skin/);
|
||||
|
||||
window {
|
||||
|
||||
width: 640px;
|
||||
height: 480px;
|
||||
|
||||
}
|
||||
|
||||
#menu-view-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tabpanels-contents-box {
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
#header-url:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#input-widget,
|
||||
#input-widget-multiline {
|
||||
border: thin silver inset;
|
||||
}
|
||||
|
||||
#button-multiline-expand {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/multiline-expand.png");
|
||||
}
|
||||
|
||||
#button-multiline-contract {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/multiline-contract.png");
|
||||
}
|
||||
|
||||
#button-input {
|
||||
list-style-image:url("chrome://chatzilla/skin/images/input-send.png");
|
||||
}
|
||||
|
||||
.highlight-menu-item:hover {
|
||||
color: white !important;
|
||||
background: darkslategrey !important;
|
||||
}
|
||||
|
||||
.view-button {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.view-button[state="current"] {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.view-button[state="superfluous"] {
|
||||
color: darkblue;
|
||||
}
|
||||
|
||||
.view-button[state="activity"] {
|
||||
color: darkgreen;
|
||||
}
|
||||
|
||||
.view-button[state="attention"] {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* spaces after the 4th and 8th tab, so you can line them up with your Fn
|
||||
* keys */
|
||||
.view-button[viewKey="4"],
|
||||
.view-button[viewKey="8"] {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.header-box, .usercount-data {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#server-nick {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.header-label {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.header-data {
|
||||
text-align: left;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#channel-topic {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#channel-topic[editable="true"] {
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.output-container {
|
||||
border: thin silver inset;
|
||||
}
|
||||
|
||||
/* op image column */
|
||||
treechildren:-moz-tree-image(usercol-op, state-true),
|
||||
treechildren::-moz-tree-image(usercol-op, state-true) {
|
||||
list-style-image: url(chrome://chatzilla/skin/images/is-op.gif)
|
||||
}
|
||||
|
||||
treechildren:-moz-tree-image(usercol-op, state-false),
|
||||
treechildren::-moz-tree-image(usercol-op, state-false) {
|
||||
list-style-image: url(chrome://chatzilla/skin/images/isnt-op.gif)
|
||||
}
|
||||
|
||||
/* voice image column */
|
||||
treechildren:-moz-tree-image(usercol-voice, state-true),
|
||||
treechildren::-moz-tree-image(usercol-voice, state-true) {
|
||||
list-style-image: url(chrome://chatzilla/skin/images/is-voice.gif)
|
||||
}
|
||||
|
||||
treechildren:-moz-tree-image(usercol-voice, state-false),
|
||||
treechildren::-moz-tree-image(usercol-voice, state-false) {
|
||||
list-style-image: url(chrome://chatzilla/skin/images/isnt-voice.gif)
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ChatZilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Andreas Premstaller.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda <rginda@ndcico.com>
|
||||
* Andreas Premstaller <andreas.premstaller@uibk.ac.at>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#mini-irc {
|
||||
list-style-image: url("chrome://chatzilla/skin/images/taskbar-irc.gif");
|
||||
}
|
||||
|
||||
#tasksMenuIRC {
|
||||
list-style-image: url("chrome://chatzilla/skin/images/chatzilla-16.gif");
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:skin:root">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0" />
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- skin information -->
|
||||
<RDF:Description about="urn:mozilla:skin:modern/1.0"
|
||||
chrome:displayName="Modern"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="modern/1.0">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:skin:modern/1.0:packages">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0:chatzilla"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 224 B |
Binary file not shown.
|
Before Width: | Height: | Size: 150 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user