File: index.html.ca_ES

package info (click to toggle)
jwchat 1.0beta3-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,288 kB
  • ctags: 382
  • sloc: xml: 462; sh: 80; makefile: 6
file content (426 lines) | stat: -rw-r--r-- 14,483 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Welcome to JWChat</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <script src="config.js" language="JavaScript1.2"></script>
    <script src="browsercheck.js" language="JavaScript1.2"></script>
    <script src="shared.js" language="JavaScript1.2"></script>
    <script src="switchStyle.js"></script>
    <script language="JavaScript">
<!--

 /*
  * JWChat, a web based jabber client
  * Copyright (C) 2003-2004 Stefan Strigler <steve@zeank.in-berlin.de>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  * Please visit http://jwchat.sourceforge.net for more information!
  */

var jid, pass, register, prio, connect_host, connect_port, connect_secure;
var jwchats = new Array();

var JABBERSERVER;
var HTTPBASE;
var BACKEND_TYPE;

/* check if user want's to register new
 * account and things */    
function loginCheck(form) { 
  if (form.jid.value == '') {
    alert("You need to supply a username");
    return false;
  }

  if (form.pass.value == '') {
    alert("You need to supply a password");
    return false;
  }

  if (document.getElementById('tr_server').style.display != 'none') {
    var val = document.getElementById('server').value;
    if (val == '') {
      alert("You need to supply a jabber server");
      return false;
    }

    JABBERSERVER = val;
  }

  jid = form.jid.value + "@" + JABBERSERVER + "/";
  if (form.res.value != '')
    jid += form.res.value;
  else
    jid += DEFAULTRESOURCE;

  if(!isValidJID(jid))
    return false;

  if (jwchats[jid] && !jwchats[jid].closed) {
    jwchats[jid].focus();
    return false;
  }

  pass = form.pass.value;
  register = form.register.checked;

  prio = form.prio[form.prio.selectedIndex].value;

  connect_port = form.connect_port.value;
  connect_host = form.connect_host.value;
  connect_secure = form.connect_secure.checked;

  jwchats[jid] = window.open('jwchat.html',makeWindowName(jid),'width=180,height=390,resizable=yes');

  return false;
}

function toggleMoreOpts(show) {
  if (show) {
    document.getElementById('showMoreOpts').style.display = 'none';
    document.getElementById('showLessOpts').style.display = '';
  } else {
    document.getElementById('showLessOpts').style.display = 'none';
    document.getElementById('showMoreOpts').style.display = '';
  }

  var rows = document.getElementById('lTable').getElementsByTagName('TBODY').item(0).getElementsByTagName('TR');

  for (var i=0; i<rows.length; i++) {
    if (rows[i].className == 'moreOpts') {
      if (show)
	rows[i].style.display = '';
      else
	rows[i].style.display = 'none';
    }
  }
  return false;
}

function serverSelected() {
  var oSel = document.getElementById('server');
  var servers_allowed = BACKENDS[bs.selectedIndex].servers_allowed;

  // TODO ...
  
  /* change format of servers_allowed to be able to associate connect 
   * host information to it 
   */
}

function backendSelected() {
  var bs = document.getElementById('backend_selector');
  var servers_allowed, default_server;
  if (bs) {
    servers_allowed = BACKENDS[bs.selectedIndex].servers_allowed;
    default_server = BACKENDS[bs.selectedIndex].default_server;
    if (BACKENDS[bs.selectedIndex].description)
      document.getElementById('backend_description').innerHTML = BACKENDS[bs.selectedIndex].description;
    HTTPBASE = BACKENDS[bs.selectedIndex].httpbase;
    BACKEND_TYPE = BACKENDS[bs.selectedIndex].type;
  }	else {
    servers_allowed = BACKENDS[0].servers_allowed;
    default_server = BACKENDS[0].default_server;
    HTTPBASE = BACKENDS[0].httpbase;
    BACKEND_TYPE = BACKENDS[0].type;
  }
  
  if (!servers_allowed
      || servers_allowed.length == 0) 
    { // allow any
      var tr_server = document.getElementById('tr_server');
      
      var input = document.createElement('input');
      input.setAttribute("type","text");
      input.setAttribute("id","server");
      input.setAttribute("name","server");
      input.setAttribute("tabindex","2");
      input.className = 'input_text';
      
      if (default_server)
	input.setAttribute("value",default_server);
      
      var td = tr_server.getElementsByTagName('td').item(0);
      for (var i=0; i<td.childNodes.length; i++)
	td.removeChild(td.childNodes.item(i));
      
      td.appendChild(input);
      
      tr_server.style.display = ''; 
      
      document.getElementById('connect_port').disabled = false;
      document.getElementById('connect_host').disabled = false;
      document.getElementById('connect_secure').disabled = false;
    }
  else if (servers_allowed.length == 1) {
    document.getElementById('tr_server').style.display = 'none';
    JABBERSERVER = servers_allowed[0];
    document.getElementById('connect_port').disabled = true;
    document.getElementById('connect_host').disabled = true;
    document.getElementById('connect_secure').disabled = true;
  } else { // create selectbox
    var tr_server = document.getElementById('tr_server');
    
    var oSelect = document.createElement('select');
    oSelect.setAttribute('id','server');
    oSelect.setAttribute('name','server');
    oSelect.setAttribute('tabindex',"2");
    oSelect.onchange = serverSelected;
    
    var td = tr_server.getElementsByTagName('td').item(0);
    for (var i=0; i<td.childNodes.length; i++)
      td.removeChild(td.childNodes.item(i));
    
    td.appendChild(oSelect);
    
    for (var i=0; i<servers_allowed.length; i++) {
      if (typeof(servers_allowed[i]) == 'undefined')
	continue;
      oSelect.options.add(new Option(servers_allowed[i],servers_allowed[i]));
    }
    
    tr_server.style.display = ''; 
    document.getElementById('connect_port').disabled = true;
    document.getElementById('connect_host').disabled = true;
    document.getElementById('connect_secure').disabled = true;
  }
}

function init() {
  var welcome = "Welcome to JWChat at "+SITENAME;
  document.title = welcome;
  document.getElementById("welcomeh1").innerHTML = welcome;

  // create backend chooser - if any
  if (typeof(BACKENDS) == 'undefined' || BACKENDS.length == 0) {
    // ...
  } else if (BACKENDS.length == 1) {
    backendSelected();
  } else {
    // create chooser
    var oSelect = document.createElement('select');
    oSelect.setAttribute('id','backend_selector');
    oSelect.setAttribute('name','backend');
    oSelect.setAttribute('tabindex',"1");
    oSelect.onchange = backendSelected;

    var tr = document.createElement('tr');
    var td = tr.appendChild(document.createElement('th'));
    var label = td.appendChild(document.createElement('label'));
    label.setAttribute('for','backend_selector');
    label.appendChild(document.createTextNode("Choose Backend"));
    
    tr.appendChild(document.createElement('td')).appendChild(oSelect);
    
    var tr_server = document.getElementById('tr_server');
    tr_server.parentNode.insertBefore(tr,tr_server);
    
    tr = document.createElement('tr');
    td = tr.appendChild(document.createElement('td'));
    td = document.createElement('td');
    td.setAttribute('id','backend_description');
    td.className= 'desc';
    tr.appendChild(td);

    tr_server.parentNode.insertBefore(tr,tr_server);

    for (var i=0; i<BACKENDS.length; i++) {
      if (typeof(BACKENDS[i]) == 'undefined')
	continue;
      var oOption =  new Option(BACKENDS[i].name,BACKENDS[i].httpbase);
      oOption.setAttribute('description',BACKENDS[i].description);
      oSelect.options[i] = oOption;
    }
    
    backendSelected();
  }
  document.forms[0].jid.focus();
  document.getElementById('chars_prohibited').innerHTML = prohibited;
  if (typeof(DEFAULTRESOURCE) != 'undefined' && DEFAULTRESOURCE)
    document.forms[0].res.value = DEFAULTRESOURCE;
  
  document.getElementById('login_button').disabled = false;
}


onload = init;
//-->
    </script>
    <style type="text/css">
/*<![CDATA[*/
      body {
      color: #2a3847;
      background-color: white;
      }

      th {
      font-size: 0.8em;
      text-align: right;
      white-space: nowrap;
      }

      a { color: #2a3847; } 
      
      h1 { 
      font-size: 1.4em; 
      margin-top:0px; 
      margin-bottom: 0px; 
      }
      
      h2 { padding-top: 0px; margin-top: 0px; }
      
      h3 {
      border-bottom: 1px solid #2a3847;
      margin-bottom: 0px;

      font-style: normal;
      font-variant: small-caps;
      
      text-align: right;
      }
      
      input.input_text {
      border: 1px solid #2a3847;
      }
      
      input:focus, input:hover {
      background-color: #f9fae1;
      }
      
      .toggleOpts { cursor: pointer; }
      
      .desc {
      font-size: 0.65em;
      }
      
      .form_spacer {
      padding-top: 20px;
      }
      
      #td_top {
      padding-top: 20px;
      }
      #td_form {
      padding-top: 20px;
      }
      #td_bottom {
      padding: 4px;
      font-size:8pt; 
      border-top:1px solid #2a3847;
      }
      #lTable {
      padding: 8px;
      
      border: 2px solid #2a3847;
      -moz-border-radius: 8px;
      
      background-color: #81addc;
      }
/*]]>*/
    </style>
  </head>
  
  <body>
    <table width="100%" height="100%">
        <tr>
          <td align=center id='td_top'>
            <table>
                <tr>
                  <td>
                    <h1 id="welcomeh1">Welcome to JWChat</h1>
                    <h2>A web-based Jabber<sup><small>&reg;</small></sup> client</h2>
                  </td>
                </tr>
            </table>
          </td>
        </tr>
    <form name="login" onSubmit="return loginCheck(this);">
      <tr>
        <td height="100%" align=center valign=top id='td_form'>
          <table border=0 cellspacing=0 cellpadding=2 id="lTable" align=center width=380>
              <tr>
                <td colspan=2><h3>Login<img src="images/available.gif" width=16 height=16></h3></td>
              </tr>
              <tr id="tr_server" style="display:none;">
                <th title="Select Jabber server to connect to"><label for='server'>Server</label></th>
                <td></td>
              </tr>
              <tr>
                <th class='form_spacer'><label for='jid'>Username</label></th>
                <td class='form_spacer' width="100%"><input type="text" id='jid' name="jid" tabindex=3 class='input_text'></td>
              </tr>
              <tr><td>&nbsp;</td><td nowrap class="desc">Username must not contain: <span id='chars_prohibited'></span></td></tr>
              <tr>
                <th><label for='pass'>Password</label></th>
                <td><input type="password" id='pass' name="pass" tabindex=4 class='input_text'></td>
              </tr>
              <tr><td>&nbsp;</td><td><input type=checkbox name=register id=register> <label for="register">Register New Account</label></td></tr>
              <tr id="showMoreOpts" class="toggleOpts">
                <td>&nbsp;</td>
                <td onClick="return toggleMoreOpts(1);"><img src="images/group_close.gif" title="Show More Options"> Show More Options</td>
              </tr>
              <tr id="showLessOpts" class="toggleOpts" style="display:none;">
                <td>&nbsp;</td>
                <td onClick="return toggleMoreOpts(0);"><img src="images/group_open.gif" title="Show Less Options"> Show Less Options</td>
              </tr>
              <tr class="moreOpts" style="display:none;">
                <th><label for='res'>Resource</label></th>
                <td><input type="text" id="res" name="res" class="input_text"></td>
					</tr>
              <tr class="moreOpts" style="display:none;">
                <th><label for='prio'>Priority</label></th>
                <td>
                  <select type="text" id="prio"  name="prio" class="input_text" size="1">
                    <option value="0">low</option>
                    <option value="10" selected>medium</option>
                    <option value="100">high</option>
                  </select>
                </td>
              </tr>
              <tr class="moreOpts" style="display: none;">
                <th class="form_spacer"><label for="connect_port">Port</th>
                <td class="form_spacer"><input type="text" name="connect_port" id="connect_port" class="input_text" disabled></td>
              </tr>
              <tr class="moreOpts" style="display: none;">
                <th><label for="connect_host">Connect Host</th>
                <td><input type="text" name="connect_host" id="connect_host" class="input_text" disabled></td>
              </tr>
              <tr class="moreOpts" style="display: none;">
                <td>&nbsp;</td>
                <td><input type="checkbox" name="connect_secure" id="connect_secure" class="input_text" disabled> <label for="connect_secure" title="Advise connection manager to connect through SSL" disabled>Allow secure conncetions only</td>
              </tr>
              
              <tr><td>&nbsp;</td><td><button type="submit" id='login_button' tabindex=5 disabled>Login</button></td></tr>
          </table>
    </form>	
  </td>
  </tr>
    <tr>
      <td id='td_bottom'>
        <a href="http://sourceforge.net/donate/index.php?group_id=92011"><img src="http://images.sourceforge.net/images/project-support.jpg" width="88" height="32" border="0" alt="Support This Project" align=right /></a>
        For details please visit <a href="http://jwchat.sourceforge.net">JWChat's Homepage</a>.
        <br>
        &copy; 2003-2005 <a href="mailto:steve@zeank.in-berlin.de">Stefan Strigler</a> - 
        <!-- Created: Wed Feb  5 15:19:17 CET 2003 -->
        <!-- hhmts start -->
Last modified: Fri Jan 19 14:26:00 CET 2007
<!-- hhmts end -->
      </td>
    </tr>
  </table>
  </body>
</html>