Browse code

initial import.

devnewton authored on 23/07/2012 at 06:53:28
Showing 156 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+* Stefan Strigler <steve@zeank.in-berlin.de>
1
+  Main Developer
2
+
3
+* Florian Jensen <flosoft.biz@gmail.com>
4
+  Graphical Design
5
+
6
+* devnewton ( devnewton _at_ bci.im )
7
+  Tribune features developper.
0 8
new file mode 100644
... ...
@@ -0,0 +1,340 @@
0
+		    GNU GENERAL PUBLIC LICENSE
1
+		       Version 2, June 1991
2
+
3
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
4
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+			    Preamble
9
+
10
+  The licenses for most software are designed to take away your
11
+freedom to share and change it.  By contrast, the GNU General Public
12
+License is intended to guarantee your freedom to share and change free
13
+software--to make sure the software is free for all its users.  This
14
+General Public License applies to most of the Free Software
15
+Foundation's software and to any other program whose authors commit to
16
+using it.  (Some other Free Software Foundation software is covered by
17
+the GNU Library General Public License instead.)  You can apply it to
18
+your programs, too.
19
+
20
+  When we speak of free software, we are referring to freedom, not
21
+price.  Our General Public Licenses are designed to make sure that you
22
+have the freedom to distribute copies of free software (and charge for
23
+this service if you wish), that you receive source code or can get it
24
+if you want it, that you can change the software or use pieces of it
25
+in new free programs; and that you know you can do these things.
26
+
27
+  To protect your rights, we need to make restrictions that forbid
28
+anyone to deny you these rights or to ask you to surrender the rights.
29
+These restrictions translate to certain responsibilities for you if you
30
+distribute copies of the software, or if you modify it.
31
+
32
+  For example, if you distribute copies of such a program, whether
33
+gratis or for a fee, you must give the recipients all the rights that
34
+you have.  You must make sure that they, too, receive or can get the
35
+source code.  And you must show them these terms so they know their
36
+rights.
37
+
38
+  We protect your rights with two steps: (1) copyright the software, and
39
+(2) offer you this license which gives you legal permission to copy,
40
+distribute and/or modify the software.
41
+
42
+  Also, for each author's protection and ours, we want to make certain
43
+that everyone understands that there is no warranty for this free
44
+software.  If the software is modified by someone else and passed on, we
45
+want its recipients to know that what they have is not the original, so
46
+that any problems introduced by others will not reflect on the original
47
+authors' reputations.
48
+
49
+  Finally, any free program is threatened constantly by software
50
+patents.  We wish to avoid the danger that redistributors of a free
51
+program will individually obtain patent licenses, in effect making the
52
+program proprietary.  To prevent this, we have made it clear that any
53
+patent must be licensed for everyone's free use or not licensed at all.
54
+
55
+  The precise terms and conditions for copying, distribution and
56
+modification follow.
57
+
58
+		    GNU GENERAL PUBLIC LICENSE
59
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
+
61
+  0. This License applies to any program or other work which contains
62
+a notice placed by the copyright holder saying it may be distributed
63
+under the terms of this General Public License.  The "Program", below,
64
+refers to any such program or work, and a "work based on the Program"
65
+means either the Program or any derivative work under copyright law:
66
+that is to say, a work containing the Program or a portion of it,
67
+either verbatim or with modifications and/or translated into another
68
+language.  (Hereinafter, translation is included without limitation in
69
+the term "modification".)  Each licensee is addressed as "you".
70
+
71
+Activities other than copying, distribution and modification are not
72
+covered by this License; they are outside its scope.  The act of
73
+running the Program is not restricted, and the output from the Program
74
+is covered only if its contents constitute a work based on the
75
+Program (independent of having been made by running the Program).
76
+Whether that is true depends on what the Program does.
77
+
78
+  1. You may copy and distribute verbatim copies of the Program's
79
+source code as you receive it, in any medium, provided that you
80
+conspicuously and appropriately publish on each copy an appropriate
81
+copyright notice and disclaimer of warranty; keep intact all the
82
+notices that refer to this License and to the absence of any warranty;
83
+and give any other recipients of the Program a copy of this License
84
+along with the Program.
85
+
86
+You may charge a fee for the physical act of transferring a copy, and
87
+you may at your option offer warranty protection in exchange for a fee.
88
+
89
+  2. You may modify your copy or copies of the Program or any portion
90
+of it, thus forming a work based on the Program, and copy and
91
+distribute such modifications or work under the terms of Section 1
92
+above, provided that you also meet all of these conditions:
93
+
94
+    a) You must cause the modified files to carry prominent notices
95
+    stating that you changed the files and the date of any change.
96
+
97
+    b) You must cause any work that you distribute or publish, that in
98
+    whole or in part contains or is derived from the Program or any
99
+    part thereof, to be licensed as a whole at no charge to all third
100
+    parties under the terms of this License.
101
+
102
+    c) If the modified program normally reads commands interactively
103
+    when run, you must cause it, when started running for such
104
+    interactive use in the most ordinary way, to print or display an
105
+    announcement including an appropriate copyright notice and a
106
+    notice that there is no warranty (or else, saying that you provide
107
+    a warranty) and that users may redistribute the program under
108
+    these conditions, and telling the user how to view a copy of this
109
+    License.  (Exception: if the Program itself is interactive but
110
+    does not normally print such an announcement, your work based on
111
+    the Program is not required to print an announcement.)
112
+
113
+These requirements apply to the modified work as a whole.  If
114
+identifiable sections of that work are not derived from the Program,
115
+and can be reasonably considered independent and separate works in
116
+themselves, then this License, and its terms, do not apply to those
117
+sections when you distribute them as separate works.  But when you
118
+distribute the same sections as part of a whole which is a work based
119
+on the Program, the distribution of the whole must be on the terms of
120
+this License, whose permissions for other licensees extend to the
121
+entire whole, and thus to each and every part regardless of who wrote it.
122
+
123
+Thus, it is not the intent of this section to claim rights or contest
124
+your rights to work written entirely by you; rather, the intent is to
125
+exercise the right to control the distribution of derivative or
126
+collective works based on the Program.
127
+
128
+In addition, mere aggregation of another work not based on the Program
129
+with the Program (or with a work based on the Program) on a volume of
130
+a storage or distribution medium does not bring the other work under
131
+the scope of this License.
132
+
133
+  3. You may copy and distribute the Program (or a work based on it,
134
+under Section 2) in object code or executable form under the terms of
135
+Sections 1 and 2 above provided that you also do one of the following:
136
+
137
+    a) Accompany it with the complete corresponding machine-readable
138
+    source code, which must be distributed under the terms of Sections
139
+    1 and 2 above on a medium customarily used for software interchange; or,
140
+
141
+    b) Accompany it with a written offer, valid for at least three
142
+    years, to give any third party, for a charge no more than your
143
+    cost of physically performing source distribution, a complete
144
+    machine-readable copy of the corresponding source code, to be
145
+    distributed under the terms of Sections 1 and 2 above on a medium
146
+    customarily used for software interchange; or,
147
+
148
+    c) Accompany it with the information you received as to the offer
149
+    to distribute corresponding source code.  (This alternative is
150
+    allowed only for noncommercial distribution and only if you
151
+    received the program in object code or executable form with such
152
+    an offer, in accord with Subsection b above.)
153
+
154
+The source code for a work means the preferred form of the work for
155
+making modifications to it.  For an executable work, complete source
156
+code means all the source code for all modules it contains, plus any
157
+associated interface definition files, plus the scripts used to
158
+control compilation and installation of the executable.  However, as a
159
+special exception, the source code distributed need not include
160
+anything that is normally distributed (in either source or binary
161
+form) with the major components (compiler, kernel, and so on) of the
162
+operating system on which the executable runs, unless that component
163
+itself accompanies the executable.
164
+
165
+If distribution of executable or object code is made by offering
166
+access to copy from a designated place, then offering equivalent
167
+access to copy the source code from the same place counts as
168
+distribution of the source code, even though third parties are not
169
+compelled to copy the source along with the object code.
170
+
171
+  4. You may not copy, modify, sublicense, or distribute the Program
172
+except as expressly provided under this License.  Any attempt
173
+otherwise to copy, modify, sublicense or distribute the Program is
174
+void, and will automatically terminate your rights under this License.
175
+However, parties who have received copies, or rights, from you under
176
+this License will not have their licenses terminated so long as such
177
+parties remain in full compliance.
178
+
179
+  5. You are not required to accept this License, since you have not
180
+signed it.  However, nothing else grants you permission to modify or
181
+distribute the Program or its derivative works.  These actions are
182
+prohibited by law if you do not accept this License.  Therefore, by
183
+modifying or distributing the Program (or any work based on the
184
+Program), you indicate your acceptance of this License to do so, and
185
+all its terms and conditions for copying, distributing or modifying
186
+the Program or works based on it.
187
+
188
+  6. Each time you redistribute the Program (or any work based on the
189
+Program), the recipient automatically receives a license from the
190
+original licensor to copy, distribute or modify the Program subject to
191
+these terms and conditions.  You may not impose any further
192
+restrictions on the recipients' exercise of the rights granted herein.
193
+You are not responsible for enforcing compliance by third parties to
194
+this License.
195
+
196
+  7. If, as a consequence of a court judgment or allegation of patent
197
+infringement or for any other reason (not limited to patent issues),
198
+conditions are imposed on you (whether by court order, agreement or
199
+otherwise) that contradict the conditions of this License, they do not
200
+excuse you from the conditions of this License.  If you cannot
201
+distribute so as to satisfy simultaneously your obligations under this
202
+License and any other pertinent obligations, then as a consequence you
203
+may not distribute the Program at all.  For example, if a patent
204
+license would not permit royalty-free redistribution of the Program by
205
+all those who receive copies directly or indirectly through you, then
206
+the only way you could satisfy both it and this License would be to
207
+refrain entirely from distribution of the Program.
208
+
209
+If any portion of this section is held invalid or unenforceable under
210
+any particular circumstance, the balance of the section is intended to
211
+apply and the section as a whole is intended to apply in other
212
+circumstances.
213
+
214
+It is not the purpose of this section to induce you to infringe any
215
+patents or other property right claims or to contest validity of any
216
+such claims; this section has the sole purpose of protecting the
217
+integrity of the free software distribution system, which is
218
+implemented by public license practices.  Many people have made
219
+generous contributions to the wide range of software distributed
220
+through that system in reliance on consistent application of that
221
+system; it is up to the author/donor to decide if he or she is willing
222
+to distribute software through any other system and a licensee cannot
223
+impose that choice.
224
+
225
+This section is intended to make thoroughly clear what is believed to
226
+be a consequence of the rest of this License.
227
+
228
+  8. If the distribution and/or use of the Program is restricted in
229
+certain countries either by patents or by copyrighted interfaces, the
230
+original copyright holder who places the Program under this License
231
+may add an explicit geographical distribution limitation excluding
232
+those countries, so that distribution is permitted only in or among
233
+countries not thus excluded.  In such case, this License incorporates
234
+the limitation as if written in the body of this License.
235
+
236
+  9. The Free Software Foundation may publish revised and/or new versions
237
+of the General Public License from time to time.  Such new versions will
238
+be similar in spirit to the present version, but may differ in detail to
239
+address new problems or concerns.
240
+
241
+Each version is given a distinguishing version number.  If the Program
242
+specifies a version number of this License which applies to it and "any
243
+later version", you have the option of following the terms and conditions
244
+either of that version or of any later version published by the Free
245
+Software Foundation.  If the Program does not specify a version number of
246
+this License, you may choose any version ever published by the Free Software
247
+Foundation.
248
+
249
+  10. If you wish to incorporate parts of the Program into other free
250
+programs whose distribution conditions are different, write to the author
251
+to ask for permission.  For software which is copyrighted by the Free
252
+Software Foundation, write to the Free Software Foundation; we sometimes
253
+make exceptions for this.  Our decision will be guided by the two goals
254
+of preserving the free status of all derivatives of our free software and
255
+of promoting the sharing and reuse of software generally.
256
+
257
+			    NO WARRANTY
258
+
259
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
260
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
261
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
262
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
263
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
264
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
265
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
266
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
267
+REPAIR OR CORRECTION.
268
+
269
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
270
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
271
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
272
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
273
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
274
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
275
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
276
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
277
+POSSIBILITY OF SUCH DAMAGES.
278
+
279
+		     END OF TERMS AND CONDITIONS
280
+
281
+	    How to Apply These Terms to Your New Programs
282
+
283
+  If you develop a new program, and you want it to be of the greatest
284
+possible use to the public, the best way to achieve this is to make it
285
+free software which everyone can redistribute and change under these terms.
286
+
287
+  To do so, attach the following notices to the program.  It is safest
288
+to attach them to the start of each source file to most effectively
289
+convey the exclusion of warranty; and each file should have at least
290
+the "copyright" line and a pointer to where the full notice is found.
291
+
292
+    <one line to give the program's name and a brief idea of what it does.>
293
+    Copyright (C) 19yy  <name of author>
294
+
295
+    This program is free software; you can redistribute it and/or modify
296
+    it under the terms of the GNU General Public License as published by
297
+    the Free Software Foundation; either version 2 of the License, or
298
+    (at your option) any later version.
299
+
300
+    This program is distributed in the hope that it will be useful,
301
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
302
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
303
+    GNU General Public License for more details.
304
+
305
+    You should have received a copy of the GNU General Public License
306
+    along with this program; if not, write to the Free Software
307
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
308
+
309
+
310
+Also add information on how to contact you by electronic and paper mail.
311
+
312
+If the program is interactive, make it output a short notice like this
313
+when it starts in an interactive mode:
314
+
315
+    Gnomovision version 69, Copyright (C) 19yy name of author
316
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+    This is free software, and you are welcome to redistribute it
318
+    under certain conditions; type `show c' for details.
319
+
320
+The hypothetical commands `show w' and `show c' should show the appropriate
321
+parts of the General Public License.  Of course, the commands you use may
322
+be called something other than `show w' and `show c'; they could even be
323
+mouse-clicks or menu items--whatever suits your program.
324
+
325
+You should also get your employer (if you work as a programmer) or your
326
+school, if any, to sign a "copyright disclaimer" for the program, if
327
+necessary.  Here is a sample; alter the names:
328
+
329
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+  <signature of Ty Coon>, 1 April 1989
333
+  Ty Coon, President of Vice
334
+
335
+This General Public License does not permit incorporating your program into
336
+proprietary programs.  If your program is a subroutine library, you may
337
+consider it more useful to permit linking proprietary applications with the
338
+library.  If this is what you want to do, use the GNU Library General
339
+Public License instead of this License.
0 340
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+Changes since v0.1:
1
+
2
+	* autoscroll only if scrollbar at bottom
3
+	* support for private messages
4
+	* nick highlighting
5
+	* configurable backend (http polling and/or binding)
6
+	* a lot of fixes and enhancements
0 7
\ No newline at end of file
1 8
new file mode 100644
... ...
@@ -0,0 +1,192 @@
0
+MUCkl tribune 
1
+=============
2
+
3
+A special version of MUCkl with tribune features.
4
+
5
+What is MUCkl ?
6
+===============
7
+
8
+  MUCkl is a web based groupchat application with focus on ease of
9
+  installation and usage. As a user you just need to enter your
10
+  desired nickname and start chatting.
11
+  MUCkl doesn't need Perl, PHP or MySQL at the server side nor Java at
12
+  the client side. It's just plain HTML/JavaScript.
13
+
14
+  MUCkl uses [1]Jabber technology to handle all communication. It
15
+  let's you connect to any predefined [2]MUC-based chat room.
16
+
17
+  This version 
18
+
19
+
20
+  [1] http://www.jabber.org
21
+  [2] http://www.jabber.org/jeps/jep-0045.html
22
+
23
+What is a tribune?
24
+==================
25
+
26
+A tribune is a type of chat popular in some obscure french websites.
27
+
28
+It adds to traditionnal chat some usefull features:
29
+
30
+- norloge: a conversation flow highlightning tool.
31
+- totoz: a way to insert stupid images.
32
+
33
+Supported browsers and plattforms
34
+=================================
35
+
36
+  As of this release MUCkl has not been tested a lot. It should work
37
+  with any version of Internet Explorer since version 5 and all recent
38
+  versions of Gecko ("Mozilla") based browsers. 
39
+
40
+  Feedback on this is very welcome!
41
+
42
+
43
+Prerequisites
44
+=============
45
+
46
+  In order to use MUCkl you need to have access to an [3]HTTP Polling
47
+  or [4]HTTP Binding service for Jabber. These allow you to connect to
48
+  a Jabber server using the HTTP protocol rather than raw TCP/IP
49
+  sockets. There are Jabber servers that have built-in HTTP Polling
50
+  support like [5]ejabberd or some of the commercial ones.
51
+
52
+  There are also some standalone implementations of HTTP Polling
53
+  available like [6]tonneru and [7]webjah. Both allow you to connect
54
+  to any jabber server. Latest versions of punjab have built in
55
+  support for HTTP Polling and HTTP Binding. See [8]punjab's website for
56
+  details.
57
+
58
+  Additionally you need a web server of your choice capable of doing
59
+  address rewriting (at least if you're using an HTTP proxy service
60
+  that is not local to your web server).
61
+
62
+  So to sum it up: If you don't know of any public jabber server which
63
+  offers HTTP Polling as a free service, you will have to install your
64
+  own jabber server or one of the HTTP Polling components mentioned
65
+  above. If you've got the choice use ejabberd as it's the most
66
+  reliable solution available at the moment at no cost.
67
+
68
+  [3] http://www.jabber.org/jeps/jep-0025.html
69
+  [4] http://www.jabber.org/jeps/jep-0124.html
70
+  [5] http://ejabberd.jabberstudio.org
71
+  [6] http://tonneru.tanoshi.net/
72
+  [7] http://www.gonzo.kiev.ua/projects/jabber/index.html#webjah
73
+  [8] http://punjab.sourceforge.net/
74
+
75
+
76
+Installation
77
+============
78
+
79
+  1) Unpacking
80
+
81
+     Unpack MUCkl into a directory accessible by your web server.
82
+
83
+  2) Configure Web Server
84
+
85
+     This is the trickiest part of the setup as it depends on which
86
+     HTTP Polling service you've chosen. It requires some knowledge of
87
+     apache configuration as well as some understanding of what HTTP
88
+     Polling is.
89
+
90
+     First let me explain, what we need to do and why: Due to security
91
+     considerations most browsers don't allow JavaScript to access any
92
+     data outside the domain it has been loaded from. Gecko based
93
+     browsers are even more restrictive in this as they don't allow
94
+     them to access data on a different port either.
95
+
96
+     So say, the HTTP Polling service we plan to use for MUCkl is
97
+     located at http://jabber.somedomain.com:5280/http-poll/ (a
98
+     typical ejabberd URI). MUCkl itself is served at
99
+     http://www.mydomain.com/MUCkl/. Now we have to make sure that our
100
+     installation of MUCkl can access the HTTP Polling service by
101
+     calling some local URI like
102
+     http://www.mydomain.com/http-poll/. So we have to
103
+     setup a rewrite rule which redirects requests on
104
+     http://www.mydomain.com/MUCkl/http-poll/ to
105
+     http://jabber.somedomain.com:5280/http-poll/.
106
+
107
+     Using apache this can be achieved by the following steps:
108
+
109
+     * Make sure that mod_rewrite and mod_proxy (additionally
110
+       mod_proxy_http for apache2) are loaded.
111
+
112
+     * Define a rewrite rule for your MUCkl installation directory (Step 1). 
113
+       E.g. create an .htaccess file within your MUCkl installation
114
+       directory like the following:
115
+
116
+       <IfModule mod_rewrite.c>
117
+         RewriteEngine On
118
+         RewriteRule http-poll/ http://jabber.somedomain.com:5280/http-poll/ [P]
119
+       </IfModule>
120
+
121
+
122
+  3) Setup Jabber Account
123
+
124
+     In order to complete Step 3 and 4 you will need a native Jabber
125
+     client that supports registration of new accounts and the MUC
126
+     protocol for configuration of your chat room. My tip: Use Exodus
127
+     on Windows, tkabber on Linux.
128
+
129
+     Now you need to create a new jabber account. Make sure that you
130
+     can connect to it by way of the chosen HTTP Polling service. So
131
+     most probably using the example above you would create it on
132
+     jabber.somedomain.com.
133
+
134
+     Everybody using your installation of MUCkl will use this account
135
+     data to enter the Jabber network and join your chat room.
136
+
137
+  4) Setup Chat Room
138
+
139
+     Now use some different Jabber account which will be the owner of
140
+     your desired chat room. Enter your room or create a new one and
141
+     configure it to suit your needs (e.g. don't make it
142
+     private/invite only/password protected, as MUCkl doesn't support
143
+     these kind of things).
144
+
145
+  5) Configure MUCkl
146
+
147
+     Now that we have all necessary data at hand we finally may edit
148
+     config.js (located in MUCkl's installation directory). For
149
+     detailed information on how to do this refer to the comments
150
+     given in this file!
151
+
152
+     When done, fire up your prefered browser (see above! ;-)) and
153
+     login to MUCkl.
154
+
155
+
156
+Further Information/Reading
157
+===========================
158
+
159
+  MUCkl is a stripped down version of [9]JWChat - a web based Jabber
160
+  client. As such it uses the [10]JSJaC library for communication with
161
+  the Jabber network. JSJaC allows you to connect to Jabber servers
162
+  using either [11]HTTP Polling or [12]HTTP Binding. Groupchat
163
+  functionality is realized as an implementation of the [13]Multi User
164
+  Conference Protocol [MUC].
165
+
166
+
167
+  [9] http://jwchat.sourceforge.net
168
+  [10] http://jsjac.jabberstudio.org
169
+  [11] http://www.jabber.org/jeps/jep-0025.html
170
+  [12] http://www.jabber.org/jeps/jep-0124.html
171
+  [13] http://www.jabber.org/jeps/jep-0045.html
172
+
173
+
174
+Disclaimer
175
+==========
176
+
177
+  This program is free software; you can redistribute it and/or modify
178
+  it under the terms of the GNU General Public License as published by
179
+  the Free Software Foundation; either version 2 of the License, or
180
+  (at your option) any later version.
181
+
182
+  This program is distributed in the hope that it will be useful, but
183
+  WITHOUT ANY WARRANTY; without even the implied warranty of
184
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
185
+  General Public License for more details.
186
+
187
+  You should have received a copy of the GNU General Public License
188
+  along with this program; if not, write to the Free Software
189
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
190
+  USA
191
+
0 192
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+planed for 0.3:
1
+
2
+ * allow to choose preconfigured chat rooms from a list on login
3
+ * add possibility to set online status (away) and away message
4
+
5
+
0 6
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+/*	BrowserCheck Object
1
+	provides most commonly needed browser checking variables
2
+	19990326
3
+*/
4
+// Copyright (C) 1999 Dan Steinman
5
+// Distributed under the terms of the GNU Library General Public License
6
+// Available at http://www.dansteinman.com/dynapi/
7
+
8
+function BrowserCheck() {
9
+	var b = navigator.appName
10
+	if (b=="Netscape") this.b = "ns"
11
+	else if (b=="Microsoft Internet Explorer") this.b = "ie"
12
+	else if (b=="Opera") this.b = "op"
13
+	else this.b = b
14
+	this.v = parseInt(navigator.appVersion)
15
+	this.ns = (this.b=="ns" && this.v>=4)
16
+	this.ns4 = (this.b=="ns" && this.v==4)
17
+	this.ns5 = (this.b=="ns" && this.v==5)
18
+	this.ie = (this.b=="ie" && this.v>=4)
19
+	this.op = (this.b=="op" && this.v>=7)
20
+	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
21
+	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
22
+	this.ie55 = (navigator.userAgent.indexOf('MSIE 5.5')>0)
23
+	if (this.ie55) {
24
+		this.v = 5.5;
25
+		this.ie5 = false;
26
+	}
27
+	this.mac = (navigator.userAgent.indexOf('Mac')>0);
28
+	if (this.ie5) this.v = 5
29
+	this.min = (this.ns||this.ie)
30
+}
31
+
32
+// automatically create the "is" object
33
+is = new BrowserCheck()
0 34
new file mode 100644
... ...
@@ -0,0 +1,108 @@
0
+/*
1
+ * MUCkl - A Web Based Groupchat Application
2
+ * Copyright (C) 2004 Stefan Strigler <steve@zeank.in-berlin.de>
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License
6
+ * as published by the Free Software Foundation; either version 2
7
+ * of the License, or (at your option) any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
+ */
18
+
19
+/* ***
20
+ * This is the main configuration file for the chat client itself.
21
+ * You have to edit this before you can start using MUCkl on your website!
22
+ * ***
23
+ */
24
+
25
+/* BACKENDTYPE - the type of backend to be used
26
+ * 
27
+ * Either 'polling' for HTTP Polling
28
+ * Or     'binding' for HTTP Binding
29
+ */
30
+var BACKENDTYPE = 'binding';
31
+
32
+/* HTTPBASE - base URI to contact HTTP Polling service
33
+ * 
34
+ * This must be local to your web server which serves MUCkl. If
35
+ * HTTP Polling service is not local to your web server you have to
36
+ * define a rewrite rule which matches this address and redirects to
37
+ * the real HTTP Polling URI.
38
+ * 
39
+ * [refers to step 2 of installation instructions]
40
+ */
41
+
42
+//var HTTPBASE = "/tomcat/JHB/";
43
+var HTTPBASE = "/http-bind/";
44
+
45
+/* Login Data - the user to login
46
+ * 
47
+ * [refers to step 3 of installation instructions]
48
+ */
49
+
50
+var XMPPDOMAIN = "bci.im"; // domain name of jabber service to be used
51
+
52
+var AUTHTYPE = 'anonymous';
53
+//var AUTHHOST = "anon.localhost"; // hostname of sasl anonymous service 
54
+
55
+var MUCKLJID = "muckl"; // username
56
+var MUCKLPASS = "muckl"; // password
57
+
58
+/* ROOMS
59
+ *
60
+ * Which chat room to join
61
+ * 
62
+ * [refers to step 4 of installation instructions]
63
+ */
64
+
65
+var ROOMS =
66
+[
67
+        {
68
+                name:'newton_adventure',
69
+                description:'newton adventure',
70
+                server:'conference.bci.im'//,
71
+//		logo: 'http://localhost/spongebob.png'
72
+        }
73
+];
74
+
75
+/* CONFERENCENOHIST
76
+ * whether to not show room history upon joining 
77
+ */
78
+var CONFERENCENOHIST = false;
79
+
80
+/* DEFAULT_LOCK_MINS
81
+ * time a user is being locked out if not otherwise indicated by kick reason
82
+ */
83
+var DEFAULT_LOCK_MINS = 1;
84
+
85
+/* MAX_LOCK_MINS
86
+ * maximum allowed number of minutes a user may be locked out by kick reason
87
+ * on ban this is used as default value
88
+ */
89
+var MAX_LOCK_MINS = 60;
90
+
91
+/* ***
92
+ * some internally used vars - don't change except you really know
93
+ * what you are doing
94
+ * ***
95
+ */
96
+
97
+var timerval = 5000; // poll frequency in msec
98
+
99
+var stylesheet = "muckl.css";
100
+var THEMESDIR = "themes";
101
+
102
+/* debugging options */
103
+var DEBUG = true; // turn debugging on
104
+var DEBUG_LVL = 2; // debug-level 0..4 (4 = very noisy)
105
+
106
+/* ** Don't touch ** */
107
+var VERSION = "0.4.4";
0 108
new file mode 100644
... ...
@@ -0,0 +1,275 @@
0
+// name:	RhymBox
1
+// description:	Default set of icons in RhymBox.  Created by Greg Fleming as part of his Megapack1 icon collection.
2
+// author:	Greg Fleming
3
+// author:	Sebastiaan Deckers
4
+// creation:	2002-04-07
5
+
6
+var emoticons = new Object();
7
+var emoticonpath = "./images/emoticons/rythmbox/";
8
+
9
+emoticons[':cat:'] = 'cat.gif';
10
+
11
+emoticons[':dog:'] = 'dog.gif';
12
+
13
+emoticons['@-\\)'] = 'alien.gif';
14
+
15
+emoticons['8-\\]'] = 'ogre.gif';
16
+
17
+emoticons['o-\\)'] = 'cyclops.gif';
18
+emoticons['O-\\)'] = 'cyclops.gif';
19
+
20
+emoticons['o-\\]'] = 'robot.gif';
21
+emoticons['O-\\]'] = 'robot.gif';
22
+
23
+emoticons['\\|:-\\)'] = 'rambo.gif';
24
+
25
+emoticons[':#\\('] = 'hurt.gif';
26
+
27
+emoticons['#-\\('] = 'dead.gif';
28
+
29
+emoticons['O:-\\)'] = 'angel.gif';
30
+emoticons['o:-\\)'] = 'angel.gif';
31
+emoticons['o:\\)'] = 'angel.gif';
32
+emoticons['O:\\)'] = 'angel.gif';
33
+
34
+emoticons['\\(6\\)'] = 'devil.gif';
35
+emoticons[':devil:'] = 'devil.gif';
36
+
37
+emoticons['\\(y\\)'] = 'thumbup.gif';
38
+emoticons['\\(Y\\)'] = 'thumbup.gif';
39
+emoticons[':yes:'] = 'thumbup.gif';
40
+
41
+emoticons['\\(n\\)'] = 'thumbdown.gif';
42
+emoticons['\\(N\\)'] = 'thumbdown.gif';
43
+emoticons[':no:'] = 'thumbdown.gif';
44
+
45
+emoticons[':heart:'] = 'heart.gif';
46
+emoticons['\\(l\\)'] = 'heart.gif';
47
+emoticons['\\(L\\)'] = 'heart.gif';
48
+
49
+emoticons['\\(u\\)'] = 'heart.gif';
50
+emoticons['\\(U\\)'] = 'heart.gif';
51
+emoticons[':bheart:'] = 'heart.gif';
52
+
53
+emoticons['\\(z\\)'] = 'person.gif';
54
+emoticons['\\(Z\\)'] = 'person.gif';
55
+emoticons[':man:'] = 'person.gif';
56
+
57
+emoticons['\\(e\\)'] = 'letter.gif';
58
+emoticons['\\(E\\)'] = 'letter.gif';
59
+emoticons[':letter:'] = 'letter.gif';
60
+
61
+emoticons[':coffee:'] = 'coffee.gif';
62
+emoticons['\\(c\\)'] = 'coffee.gif';
63
+emoticons['\\(C\\)'] = 'coffee.gif';
64
+
65
+emoticons['\\(i\\)'] = 'bulb.gif';
66
+emoticons['\\(I\\)'] = 'bulb.gif';
67
+emoticons[':lamp:'] = 'bulb.gif';
68
+emoticons[':jabber:'] = 'bulb.gif';
69
+
70
+emoticons['\\}\\{'] = 'bat.gif';
71
+emoticons[':bat:'] = 'bat.gif';
72
+
73
+emoticons[':dragon:'] = 'dragon.gif';
74
+
75
+emoticons[':home:'] = 'house.gif';
76
+
77
+emoticons[':apple:'] = 'apple.gif';
78
+
79
+emoticons[':glasses:'] = 'glasses.gif';
80
+
81
+emoticons['\\(t\\)'] = 'phone.gif';
82
+emoticons['\\(T\\)'] = 'phone.gif';
83
+emoticons[':phone:'] = 'phone.gif';
84
+
85
+emoticons[':mushroom:'] = 'mushroom.gif';
86
+
87
+emoticons['\\(p\\)'] = 'camera.gif';
88
+emoticons['\\(P\\)'] = 'camera.gif';
89
+emoticons[':photo:'] = 'camera.gif';
90
+
91
+emoticons[':world:'] = 'globe.gif';
92
+
93
+emoticons[':syringe:'] = 'needle.gif';
94
+
95
+
96
+emoticons['\\(b\\)'] = 'beer.gif';
97
+emoticons['\\(B\\)'] = 'beer.gif';
98
+emoticons[':beer:'] = 'beer.gif';
99
+
100
+emoticons[':carrot:'] = 'carrot.gif';
101
+
102
+emoticons[':cherry:'] = 'cherry.gif';
103
+
104
+emoticons[':cobra:'] = 'cobra.gif';
105
+
106
+emoticons[':wine:'] = 'cocktail.gif';
107
+emoticons[':cocktail:'] = 'cocktail.gif';
108
+emoticons['\\(d\\)'] = 'cocktail.gif';
109
+emoticons['\\(D\\)'] = 'cocktail.gif';
110
+
111
+emoticons[':dinosaur:'] = 'dinosaur.gif';
112
+
113
+emoticons[':drink:'] = 'drink.gif';
114
+
115
+emoticons[':fish:'] = 'fish.gif';
116
+
117
+emoticons[':graduate:'] = 'graduate.gif';
118
+
119
+emoticons[':death:'] = 'grimreaper.gif';
120
+
121
+emoticons[':hammer:'] = 'hammer.gif';
122
+
123
+emoticons[':helicopter:'] = 'helicopter.gif';
124
+
125
+emoticons['\\(8\\)'] = 'music.gif';
126
+emoticons[':note:'] = 'music.gif';
127
+emoticons[':music:'] = 'music.gif';
128
+
129
+emoticons[':tux:'] = 'penguin.gif';
130
+emoticons[':linux:'] = 'penguin.gif';
131
+
132
+emoticons[':skull:'] = 'skull.gif';
133
+
134
+emoticons[':speaker:'] = 'speaker.gif';
135
+
136
+emoticons[':tv:'] = 'tv.gif';
137
+emoticons[':television:'] = 'tv.gif';
138
+
139
+emoticons[':p'] = 'ditsy.gif';
140
+
141
+emoticons[':pill:'] = 'pill.png';
142
+emoticons['\\(E\\)'] = 'pill.png';
143
+emoticons['\\(e\\)'] = 'pill.png';
144
+
145
+emoticons[':god:'] = 'trinity_glowing.gif';
146
+emoticons[':water:'] = 'water_molecule.gif';
147
+
148
+emoticons[':\\)'] = 'smile.gif';
149
+emoticons[':-\\)'] = 'smile.gif';
150
+emoticons['\\(:'] = 'spin.gif';
151
+emoticons['\\(-:'] = 'spin.gif';
152
+
153
+emoticons[';\\)'] = 'wink.gif';
154
+emoticons[';-\\)'] = 'wink.gif';
155
+emoticons['\\(;'] = 'wink.gif';
156
+emoticons['\\(-;'] = 'wink.gif';
157
+
158
+emoticons[':\\|'] = 'normal.gif';
159
+emoticons[':-\\|'] = 'normal.gif';
160
+
161
+emoticons[':-\\\\'] = 'ermm.gif';
162
+emoticons[':\\\\'] = 'ermm.gif';
163
+emoticons[':-\\/'] = 'ermm.gif';
164
+emoticons[':\\/'] = 'ermm.gif';
165
+
166
+emoticons[':S'] = 'puzzled.gif';
167
+emoticons[':s'] = 'puzzled.gif';
168
+emoticons[':-S'] = 'puzzled.gif';
169
+emoticons[':-s'] = 'puzzled.gif';
170
+
171
+emoticons[':\\('] = 'depressed.gif';
172
+emoticons[':-\\('] = 'depressed.gif';
173
+emoticons['\\):'] = 'depressed.gif';
174
+emoticons['\\)-:'] = 'depressed.gif';
175
+
176
+emoticons[':\'\\('] = 'cry.gif';
177
+emoticons[':\'-\\('] = 'cry.gif';
178
+
179
+emoticons[':X'] = 'speechless.gif';
180
+emoticons[':x'] = 'speechless.gif';
181
+
182
+emoticons[':o'] = 'surprised.gif';
183
+emoticons[':-o'] = 'surprised.gif';
184
+emoticons[':O'] = 'surprised.gif';
185
+emoticons[':-O'] = 'surprised.gif';
186
+
187
+emoticons['%\\)'] = 'evolved.gif';
188
+emoticons['%-\\)'] = 'evolved.gif';
189
+
190
+emoticons['\\&gt;:D'] = 'laugh.gif';
191
+
192
+emoticons[':D'] = 'silly.gif';
193
+emoticons[':-d'] = 'silly.gif';
194
+emoticons[':d'] = 'silly.gif';
195
+emoticons[':-D'] = 'silly.gif';
196
+
197
+emoticons[':o\\)'] = 'cheerful.gif';
198
+
199
+emoticons[':\\)'] = 'smiley.gif';
200
+
201
+emoticons['8-D'] = 'cheeky.gif';
202
+
203
+emoticons[':\\*\\)'] = 'embarrassed.gif';
204
+
205
+emoticons[':-0'] = 'shocked.gif';
206
+emoticons[':-O'] = 'shocked.gif';
207
+
208
+emoticons[':0'] = 'scared.gif';
209
+emoticons[':O'] = 'scared.gif';
210
+
211
+emoticons[':-P'] = 'lick.gif';
212
+emoticons[':-p'] = 'lick.gif';
213
+
214
+emoticons['B-\\)'] = 'cool.gif';
215
+
216
+emoticons['B-\\|'] = 'calm.gif';
217
+
218
+emoticons[':-!'] = 'smoker.gif';
219
+
220
+emoticons['\\|-\\)'] = 'bandit.gif';
221
+
222
+emoticons['P-\\)'] = 'pirate.gif';
223
+
224
+emoticons[':-\\)\\}'] = 'beard.gif';
225
+
226
+emoticons[':-\\)\\{'] = 'beard.gif';
227
+
228
+emoticons[':-\\)\\&gt;'] = 'old-man.gif';
229
+
230
+emoticons['\\[:\\|\\]'] = 'ninja.gif';
231
+
232
+emoticons[':-\\[\\]'] = 'gasmask.gif';
233
+
234
+emoticons[':-\\['] = 'vampire.gif';
235
+emoticons[':\\['] = 'vampire.gif';
236
+
237
+emoticons['3-\\|\\{'] = 'sleeping.gif';
238
+
239
+emoticons['8-\\/'] = 'paranoid.gif';
240
+
241
+emoticons['\\?-\\|'] = 'ponder.gif';
242
+
243
+emoticons[':-S'] = 'nervous.gif';
244
+
245
+emoticons['8-s'] = 'confused.gif';
246
+
247
+emoticons['8-\\|'] = 'tired.gif';
248
+
249
+emoticons['8-\\['] = 'bored.gif';
250
+
251
+emoticons['8-\\('] = 'disappointed.gif';
252
+
253
+emoticons[':-\\&lt;'] = 'sad.gif';
254
+
255
+emoticons['\\&gt;:-D'] = 'evil.gif';
256
+
257
+emoticons['\\&gt;:-\\|'] = 'angry.gif';
258
+
259
+emoticons['\\&gt;:-\\)'] = 'devious.gif';
260
+
261
+emoticons['\\&gt;:-o'] = 'mad.gif';
262
+
263
+emoticons[':D'] = 'grin.gif';
264
+
265
+emoticons['8\\)'] = 'classic.gif';
266
+
267
+emoticons[':-\\]'] = 'square-eyed.gif';
268
+
269
+emoticons['\\|\\|-\\)'] = 'cross-eyed.gif';
270
+
271
+emoticons['8-\\)'] = 'foureyes.gif';
272
+
273
+emoticons['x-\\)'] = 'knocked-out.gif';
274
+emoticons['X-\\)'] = 'knocked-out.gif';
0 275
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+<?xml version="1.0" encoding="ISO-8859-1" ?>
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+<head>
4
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
5
+<style type="text/css" media="screen">
6
+/*<![CDATA[*/
7
+@import url(muckl.css);
8
+/*]]>*/
9
+</style>
10
+<title>MUCkl</title>
11
+</head>
12
+<body>
13
+
14
+</body>
15
+</html>
0 16
\ No newline at end of file
1 17
new file mode 100644
... ...
@@ -0,0 +1,764 @@
0
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1
+<html>
2
+  <head>
3
+    <title>JWChat - Groupchat</title>
4
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+    <script src="shared.js"></script>
6
+    <script src="browsercheck.js"></script>
7
+    <script src="emoticons.js"></script>
8
+    <script src="config.js"></script>
9
+
10
+    <script src="switchStyle.js"></script>
11
+
12
+    <script src="roster.js"></script>
13
+
14
+    <script src="jsjac.js"></script>
15
+    <script src="uuid.core.js"></script>
16
+
17
+    <script>
18
+
19
+function submitClicked() {
20
+  if (!clearedEls['msgbox'])
21
+    return false;
22
+
23
+  var body = document.getElementById("msgbox").value;
24
+  var to = ''; 
25
+
26
+  if (body == '') // don't send empty message
27
+    return false;
28
+
29
+  var aMessage = new JSJaCMessage();
30
+  aMessage.setID('muckl' + UUID.generate());
31
+  if (frames['groupchatIRoster'].userSelected) {
32
+    to = frames['groupchatIRoster'].userSelected.getAttribute('username');
33
+    var jid = roster.getFullJIDByNick(htmlFullEnc(to));
34
+    if (jid == null) {
35
+      putMsgHTML("No such nick"+": " + htmlFullEnc(to), new Date().toLocaleTimeString(), group);
36
+
37
+      // unselect user
38
+      if (frames['groupchatIRoster'].userSelected)
39
+        frames['groupchatIRoster'].userSelected.className = "rosterUser";;
40
+      frames['groupchatIRoster'].userSelected = null;;
41
+      document.getElementById('send_to_label').innerHTML = '';
42
+
43
+      srcW.addtoHistory(body);
44
+      document.getElementById('msgbox').value=''; // empty box
45
+      document.getElementById('msgbox').focus(); // set focus back on input field
46
+      return;
47
+    } else {
48
+      aMessage.setType('chat');
49
+      aMessage.setTo(jid);
50
+    }
51
+  } else {
52
+    aMessage.setType('groupchat');
53
+    aMessage.setTo(group);
54
+  }
55
+	
56
+  /* handle commands */
57
+  if (body.match(/^\/say (.+)/)) {
58
+
59
+    /* *** say *** */
60
+
61
+    body = RegExp.$1;
62
+    aMessage.setBody(body);
63
+    srcW.con.send(aMessage);
64
+  } else if (body.match(/^\/clear/)) {
65
+
66
+    /* *** clear *** */
67
+
68
+    cFrame.body.innerHTML = '';
69
+  } else if (body.match(/^\/nick (.+)/)) {
70
+
71
+    /* *** nick *** */
72
+
73
+    var nick2 = body.replace(/^\/nick (.+)/,"$1");
74
+    var aPresence = new JSJaCPresence();
75
+    aPresence.setTo(group+"/"+nick2);
76
+    srcW.con.send(aPresence);
77
+  } else if (body.match(/^\/topic (.+)/)) {
78
+
79
+    /* *** topic *** */
80
+
81
+    var topic = body.replace(/^\/topic (.+)/,"$1");
82
+    aMessage.setType('groupchat');
83
+    aMessage.setSubject(topic);
84
+    srcW.con.send(aMessage);
85
+  } else if (body.match(/^\/ban (\S+)\s*(.*)/)) {
86
+
87
+    /* *** ban *** */
88
+
89
+    var nick2 = RegExp.$1;
90
+    var reason = RegExp.$2;
91
+
92
+    var jid = roster.getFullJIDByNick(nick2);
93
+    if (jid == null) {
94
+      putMsgHTML("No such nick"+": " + nick2, new Date().toLocaleTimeString(), group);
95
+    } else {
96
+      changeAffiliation(jid,'outcast',false,reason);
97
+    }
98
+  } else if (body.match(/^\/kick (\S+)\s*(.*)/)) {
99
+
100
+    /* *** kick *** */
101
+
102
+    var nick2 = RegExp.$1;
103
+    var reason = RegExp.$2;
104
+
105
+    var jid = roster.getFullJIDByNick(nick2);
106
+    if (jid == null) {
107
+      putMsgHTML("No such nick"+": " + nick2, new Date().toLocaleTimeString(),group);
108
+    } else {
109
+      changeRole(jid,'none',false,reason);
110
+    }
111
+  } else if (body.match(/^\/join (\S+)\s*(.*)/)) {
112
+
113
+    /* *** join *** */
114
+
115
+    var room = RegExp.$1;
116
+    var pass = RegExp.$2;
117
+    srcW.roster.openGroupchat(room,nick,pass);
118
+  } else if (body.match(/^\/msg (\S+)\s*(.*)/)) {
119
+
120
+    /* *** msg *** */
121
+
122
+    to = RegExp.$1;
123
+    var body = RegExp.$2;
124
+
125
+    var jid = roster.getFullJIDByNick(to);
126
+    if (jid == null)
127
+      putMsgHTML("No such nick"+": " + to, new Date().toLocaleTimeString(), group);
128
+    else {
129
+      aMessage.setType('chat');
130
+      aMessage.setTo(jid);
131
+      aMessage.setBody(body);
132
+      srcW.con.send(aMessage);
133
+    }
134
+  } else if (body.match(/^\/part\s*(.*)/)) {
135
+
136
+    /* *** part *** */
137
+
138
+    var msg = RegExp.$1;
139
+    var aPresence = new JSJaCPresence();
140
+    aPresence.setTo(group);
141
+    aPresence.setType('unavailable');
142
+    if (msg && msg != '')
143
+      aPresence.setStatus(msg);
144
+    srcW.con.send(aPresence);
145
+  } else if (body.match(/^\/help/)) {
146
+
147
+    /* *** help *** */
148
+
149
+    open("http://www.jabber.org/jeps/jep-0045.html#impl-client-irc");
150
+  } else {
151
+    aMessage.setBody(body);
152
+    srcW.con.send(aMessage);
153
+  }			
154
+
155
+  if (aMessage.getType() == 'chat') { // a private message we have to putMsgHTML ourself
156
+    putMsgHTML(aMessage.getBody(),new Date().toLocaleTimeString(),to,'purple',null,'to');
157
+  }
158
+
159
+  // add message to our message history
160
+  srcW.addtoHistory(body);
161
+  document.getElementById('msgbox').value=''; // empty box
162
+  document.getElementById('msgbox').focus(); // set focus back on input field
163
+  
164
+  return false;
165
+}
166
+
167
+function partRoom() {
168
+  if (confirm('Are you sure you want to leave this chat room?')) 
169
+    if (parent.document.referrer)
170
+      return parent.location.replace(parent.document.referrer);
171
+    else
172
+      return parent.location.replace('index.html');
173
+}
174
+
175
+var colors = new Array('maroon','green','olive','navy','purple','teal','red','blue');
176
+
177
+var norlogeToMtime = {};
178
+
179
+function putMsgHTML(msg,mtime,user,usercolor,err,type,norloge) {
180
+  var msgHTML = '';
181
+
182
+  if(norloge) {
183
+      msgHTML += '<div data-norloge="' + norloge +'">';
184
+      msgHTML += '<span class="norloge norloge-ref" data-norloge="' + norloge +'">[' + mtime + ']&nbsp</span>';
185
+      norlogeToMtime[norloge] = mtime;
186
+  }
187
+  else
188
+      msgHTML += '<div';
189
+
190
+  if (msg.match(/^\/me /)) {
191
+    msg = msgFormat(msg,norlogeToMtime);
192
+
193
+    msg = msg.replace(/^\/me /,"<span class='meMsg'>*&nbsp;<span class='chatUser' username=\""+htmlFullEnc(user)+"\" title='@ "+mtime+"'>"+htmlEnc(user)+"</span></span>&nbsp;");
194
+  } else if (user && user != group) {
195
+    msg = msgFormat(msg,norlogeToMtime);
196
+
197
+    if (type == 'chat' || type == 'to') { // a private message
198
+      msgHTML += "<span class='privMsg'>[";
199
+      msgHTML += "<span class='chatUser' username=\""+htmlFullEnc(user)+"\" title=\"@ "+mtime+"\">" + htmlEnc(user) + "</span>";
200
+      if (type == 'to')                 
201
+        msgHTML += "&laquo;";
202
+      else
203
+        msgHTML += "&raquo;";
204
+      msgHTML += "]</span>&nbsp;";
205
+    } else
206
+      msgHTML += "<span style=\"color:"+usercolor+";\" class='chatUser' username=\""+htmlFullEnc(user)+"\" title='@ "+mtime+"'>&lt;" + htmlEnc(user) + "&gt;</span>&nbsp;";
207
+  }
208
+
209
+  if (user == group) {/* channel status messages */
210
+    if (err)
211
+      msgHTML += "<span style=\"font-weight:bold;color:red;\">"+msg+"</span>";
212
+    else
213
+      msgHTML += "<span style=\"font-weight:bold;\">"+msg+"</span>";
214
+  } else {
215
+
216
+    if (user != nick && meRegExp.test(msg) && !notHREFMeRegExp.test(msg))
217
+      msgHTML += msg.replace(meRegExp,"<span class='highlighted'>$1</span>");
218
+    else 
219
+      msgHTML += msg;
220
+  }
221
+
222
+  msgHTML += "</div>";
223
+  
224
+  scroll_bottom = false;
225
+  if (cFrame.body.scrollTop+cFrame.body.clientHeight >= cFrame.body.scrollHeight)
226
+    scroll_bottom = true;
227
+
228
+  cFrame.body.innerHTML += msgHTML;
229
+
230
+  if (scroll_bottom)
231
+    frames.groupchatIChat.scrollTo(0,cFrame.body.scrollHeight);
232
+}
233
+
234
+function popMsgs() {
235
+  if (!user) 
236
+    user = srcW.roster.getUserByJID(group);
237
+
238
+  while (user.chatmsgs.length>0) {
239
+    var msg;
240
+    if (is.ie5||is.op) {
241
+      msg = user.chatmsgs[0];
242
+      user.chatmsgs = user.chatmsgs.slice(1,user.chatmsgs.length);
243
+    } else
244
+      msg = user.chatmsgs.shift();
245
+
246
+    var from = msg.getFrom();
247
+    if (msg.getFrom().indexOf('/') != -1)
248
+      from = msg.getFrom().substring(msg.getFrom().indexOf('/')+1);
249
+
250
+    /* get date */
251
+    var timestamp;
252
+    if (msg.jwcTimestamp)
253
+      timestamp = msg.jwcTimestamp;
254
+    else
255
+      timestamp = new Date();
256
+
257
+    var mtime = '';
258
+    if (new Date() - timestamp > 24*3600*1000)
259
+      mtime += timestamp.toLocaleDateString() + " ";
260
+		
261
+    mtime += timestamp.toLocaleTimeString();
262
+    
263
+    /* look for a subject */
264
+    if (msg.getType() == 'groupchat' && msg.getSubject()) { // set topic
265
+      user.roster.subject = msg.getSubject();
266
+      document.getElementById('room_topic').innerHTML = htmlEnc(msg.getSubject());
267
+      putMsgHTML("/me has set the topic to: "+msg.getSubject(), mtime, from);
268
+      return;
269
+    }
270
+
271
+    if(!msg.getBody() || msg.getBody() == '')
272
+      return;
273
+	
274
+    srcW.playSound('chat_recv');
275
+
276
+    /* calculate color */
277
+    var charSum = 0;
278
+    for (var i=0; i<from.length; i++)
279
+      charSum += from.charCodeAt(i);
280
+  
281
+  var norloge = msg.getID();
282
+  if(!norloge)
283
+      norloge = "message_sans_id_puxor";
284
+  
285
+  putMsgHTML(msg.getBody(),mtime,from,colors[charSum%(colors.length)],null,msg.getType(),norloge);	
286
+  } /* end while */
287
+
288
+}
289
+
290
+function displayTimestamp() {
291
+  var tstyle;
292
+  if (is.ie) {
293
+    tstyle = cFrame.styleSheets('timestampstyle');
294
+    tstyle.disabled = srcW.timestamps;
295
+  } else {
296
+    tstyle = cFrame.getElementById("timestampstyle");
297
+    tstyle.sheet.disabled = srcW.timestamps;
298
+  }
299
+}
300
+
301
+function updateMe() {
302
+  document.getElementById('submit_button').disabled = (roster.me.role == 'none');
303
+
304
+  if (roster.me.role == 'none') {// seems we left
305
+    cFrame.body.innerHTML += "<span style='color:red';>"+"Disconnected."+"</span><br>";
306
+    groupchatIChat.scrollTo(0,cFrame.body.scrollHeight);
307
+  }
308
+}
309
+
310
+function changeUserStat(jid,stat,val,confirm,reason) {
311
+  var user = roster.getUserByJID(jid);
312
+  var iq = new JSJaCIQ();
313
+  iq.setType('set');
314
+  iq.setTo(group);
315
+
316
+  var query = iq.setQuery('http://jabber.org/protocol/muc#admin');
317
+  var item = query.appendChild(iq.getDoc().createElement('item'));
318
+  item.setAttribute('nick',user.name);
319
+
320
+  item.setAttribute(stat,val);
321
+	
322
+  if (reason || (confirm && (reason = prompt("Reason","")) != ''))
323
+    item.appendChild(iq.getDoc().createElement('reason')).appendChild(iq.getDoc().createTextNode(reason));
324
+
325
+  me = this;
326
+  srcW.con.send(iq,me.handleError);
327
+}
328
+
329
+function handleError(iq) {
330
+  // handle error
331
+  if (iq && iq.getType() == 'error') {
332
+    var error = iq.getNode().getElementsByTagName('error').item(0);
333
+    if (error) {
334
+      var msg = '';
335
+      for (var i=0; i<error.childNodes.length; i++) {
336
+        switch (error.childNodes.item(i).nodeName) {
337
+        case 'not-allowed':
338
+          putMsgHTML("Not Allowed",new Date(),group,null,true);
339
+          break;
340
+        case 'forbidden':
341
+          putMsgHTML("Forbidden",new Date(),group,null,true);
342
+          break;
343
+        case 'item-not-found':
344
+          putMsgHTML("Not Found",new Date(),group,null,true);
345
+          break;
346
+        default:
347
+          putMsgHTML(error.childNodes.item(i).nodeName,new Date(),group,null,true);
348