~ubuntu-branches/ubuntu/trusty/jwchat/trusty

« back to all changes in this revision

Viewing changes to groupchat_bottom.html.pt_br

  • Committer: Bazaar Package Importer
  • Author(s): Lincoln de Sousa, Lincoln de Sousa, Marcelo Jorge Vieira
  • Date: 2010-09-16 11:42:28 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100916114228-5s5ne28n1w6wrfbl
Tags: 1.0+dfsg-1
[Lincoln de Sousa]

* Switch to dpkg-source 3.0 (quilt) format
* Migrating package from cdbs to debhelper 7.0.50~
* Changing the rule get-orig-source to generate a dfsg compatible
  package striping swf files from the orig (Closes: #591962)
* Updated Standards-Version to 3.9.1
* Removing po-debconf from the Build-Depends-Indep list.

[Marcelo Jorge Vieira]

* Fixing the default backend
* Fixing Debugger dependency
* Changing information about packaging from old maintainers to
  Debian XMPP Team.
* Removing sound support.
* Setting a port for apache VirtualHost.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
  <head>
4
 
    <title></title>
5
 
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
 
    <script src="browsercheck.js"></script>
7
 
    <script src="shared.js"></script>
8
 
    <script src="switchStyle.js"></script>
9
 
    <script src="jsjac.js"></script>
10
 
    <script>
11
 
      <!--
12
 
 
13
 
function submitClicked() {
14
 
  var body = document.forms[0].elements["msgbox"].value;
15
 
 
16
 
  if (body == '') // don't send empty message
17
 
    return false;
18
 
 
19
 
        var aMessage = new JSJaCMessage();
20
 
        aMessage.setTo(parent.group);
21
 
        
22
 
  /* handle commands */
23
 
  if (body.match(/^\/say (.+)/)) {
24
 
 
25
 
                /* *** say *** */
26
 
 
27
 
                body = RegExp.$1;
28
 
                aMessage.setBody(body);
29
 
                aMessage.setType('groupchat');
30
 
                parent.srcW.con.send(aMessage);
31
 
  } else if (body.match(/^\/clear/)) {
32
 
 
33
 
                /* *** clear *** */
34
 
 
35
 
                parent.cFrame.body.innerHTML = '';
36
 
  } else if (body.match(/^\/nick (.+)/)) {
37
 
 
38
 
                /* *** nick *** */
39
 
 
40
 
    var nick = body.replace(/^\/nick (.+)/,"$1");
41
 
                var aPresence = new JSJaCPresence();
42
 
                aPresence.setTo(parent.group+"/"+nick);
43
 
                parent.srcW.con.send(aPresence);
44
 
  } else if (body.match(/^\/topic (.+)/)) {
45
 
 
46
 
                /* *** topic *** */
47
 
 
48
 
    var topic = body.replace(/^\/topic (.+)/,"$1");
49
 
                aMessage.setType('groupchat');
50
 
                aMessage.setSubject(topic);
51
 
                parent.srcW.con.send(aMessage);
52
 
  } else if (body.match(/^\/ban (\S+)\s*(.*)/)) {
53
 
 
54
 
                /* *** ban *** */
55
 
 
56
 
                var nick = RegExp.$1;
57
 
                var reason = RegExp.$2;
58
 
 
59
 
                var jid = parent.roster.getFullJIDByNick(nick);
60
 
                if (jid == null) {
61
 
                        parent.putMsgHTML("Nao existe esse nick"+": " + nick, new Date().toLocaleTimeString(), parent.jid);
62
 
                } else {
63
 
                        parent.changeAffiliation(jid,'outcast',false,reason);
64
 
                }
65
 
  } else if (body.match(/^\/kick (\S+)\s*(.*)/)) {
66
 
 
67
 
                /* *** kick *** */
68
 
 
69
 
                var nick = RegExp.$1;
70
 
                var reason = RegExp.$2;
71
 
 
72
 
                var jid = parent.roster.getFullJIDByNick(nick);
73
 
                if (jid == null) {
74
 
                        parent.putMsgHTML("Nao existe esse nick"+": " + nick, new Date().toLocaleTimeString(), parent.jid);
75
 
                } else {
76
 
                        parent.changeRole(jid,'none',false,reason);
77
 
                }
78
 
  } else if (body.match(/^\/invite (\S+)\s*(.*)/)) { // [TODO]
79
 
 
80
 
                /* *** invite *** */
81
 
 
82
 
                var jid = RegExp.$1;
83
 
                var reason = RegExp.$2;
84
 
 
85
 
        var x = 
86
 
          aMessage.appendNode('x', 
87
 
                                                  {'xmlns': 'http://jabber.org/protocol/muc#user'});
88
 
                var aNode = x.appendChild(aMessage.getDoc().createElement('invite'));
89
 
                aNode.setAttribute('to',jid);
90
 
                if (reason && reason != '')
91
 
                        aNode.appendChild(aMessage.getDoc().createElement('reason')).appendChild(aMessage.getDoc().createTextNode(reason));
92
 
                parent.srcW.con.send(aMessage);
93
 
  } else if (body.match(/^\/join (\S+)\s*(.*)/)) {
94
 
 
95
 
                /* *** join *** */
96
 
 
97
 
                var room = RegExp.$1;
98
 
                var pass = RegExp.$2;
99
 
                parent.srcW.openGroupchat(room,parent.nick,pass);
100
 
  } else if (body.match(/^\/msg (\S+)\s*(.*)/)) {
101
 
 
102
 
                /* *** msg *** */
103
 
 
104
 
                var nick = RegExp.$1;
105
 
                var body = RegExp.$2;
106
 
 
107
 
                var jid = parent.roster.getFullJIDByNick(nick);
108
 
                if (jid == null)
109
 
                        parent.putMsgHTML("Nao existe esse nick"+": " + nick, new Date().toLocaleTimeString(), parent.jid);
110
 
                else {
111
 
                        aMessage.setType('chat');
112
 
                        aMessage.setTo(jid);
113
 
                        aMessage.setBody(body);
114
 
                        parent.srcW.con.send(aMessage);
115
 
                }
116
 
  } else if (body.match(/^\/part\s*(.*)/)) {
117
 
 
118
 
                /* *** part *** */
119
 
 
120
 
                var msg = RegExp.$1;
121
 
                var aPresence = new JSJaCPresence();
122
 
                aPresence.setTo(parent.group);
123
 
                aPresence.setType('unavailable');
124
 
                if (msg && msg != '')
125
 
                        aPresence.setStatus(msg);
126
 
                parent.srcW.con.send(aPresence);
127
 
  } else if (body.match(/^\/whois (\S+)/)) {
128
 
 
129
 
                /* *** whois *** */
130
 
 
131
 
                var nick = RegExp.$1;
132
 
                var jid = parent.roster.getFullJIDByNick(nick);
133
 
                if (jid == null)
134
 
                        parent.putMsgHTML("Nao existe esse nick"+": " + nick, new Date().toLocaleTimeString(), parent.jid);
135
 
                else
136
 
                        parent.srcW.openUserInfo(jid);
137
 
  } else if (body.match(/^\/help/)) {
138
 
 
139
 
                /* *** help *** */
140
 
 
141
 
                open("http://www.jabber.org/jeps/jep-0045.html#impl-client-irc");
142
 
  } else {
143
 
                aMessage.setType('groupchat');
144
 
                aMessage.setBody(body);
145
 
                parent.srcW.con.send(aMessage);
146
 
  }                     
147
 
 
148
 
  // add message to our message history
149
 
  parent.srcW.addtoHistory(body);
150
 
  document.forms["chatform"].msgbox.value=''; // empty box
151
 
  document.forms["chatform"].msgbox.focus(); // set focus back on input field
152
 
  
153
 
  return false;
154
 
}
155
 
 
156
 
var rw;
157
 
function openRegisterRoom() {
158
 
        if (!rw || rw.closed)
159
 
                rw = open("groupchat_register.html","rw"+makeWindowName(parent.jid),"width=300,height=400,resizable=yes");
160
 
        rw.focus();
161
 
 
162
 
        return false;
163
 
}
164
 
 
165
 
var iw;
166
 
function openInvite() {
167
 
        if (!iw || iw.closed)
168
 
                iw = open("groupchat_invite_dialog.html","iw"+makeWindowName(parent.group),"width=300,height=200");
169
 
        iw.focus();
170
 
        return false;
171
 
}
172
 
 
173
 
function cleanUp() {
174
 
        if (iw && !iw.closed)
175
 
                iw.close();
176
 
        if (rw && !rw.closed)
177
 
                rw.close();
178
 
}
179
 
 
180
 
function msgboxKeyPressed(el,e) {
181
 
        var keycode;
182
 
        if (window.event) { e  = window.event; keycode = window.event.keyCode; }
183
 
        else if (e) keycode = e.keyCode;
184
 
        else return true;
185
 
        
186
 
        switch (keycode) {
187
 
        case 9: // tab
188
 
         var txt = document.forms["chatform"].msgbox;
189
 
         var pos1, pos2;
190
 
         var part;
191
 
         var possibilities = new Array();
192
 
         if(is.ie)
193
 
           return false;
194
 
         else {
195
 
           pos1 = txt.selectionStart; // current cursor position
196
 
           // no selection, not at the beginning of the line and at the end of a word or at the end of the line
197
 
           if(pos1 == txt.selectionEnd && pos1 > 0 && (txt.value.substring(pos1, pos1+1) == ' ' || pos1 == txt.value.length)) { 
198
 
             part = txt.value.substring(0, pos1);
199
 
             pos2 = part.lastIndexOf(" ") + 1;
200
 
             if(pos2 != -1)
201
 
               part = part.substring(pos2, pos1);
202
 
           }
203
 
         }
204
 
         if(part) {
205
 
           for (i in top.roster.users) {
206
 
             if(top.roster.users[i].name.indexOf(part) == 0)
207
 
               possibilities.push(top.roster.users[i].name);
208
 
           }
209
 
           if(possibilities.length == 1) { // complete, if only one possibility has been found or enumerate possibilities
210
 
             if(pos2 == 0) //special case: beginning of line, add additional ":"
211
 
               txt.value = txt.value.substring(0, pos2) + possibilities.pop() + ": " + txt.value.substring(pos1, txt.value.length)
212
 
             else
213
 
               txt.value = txt.value.substring(0, pos2) + possibilities.pop() + " " + txt.value.substring(pos1, txt.value.length)
214
 
             return false;
215
 
           }
216
 
           else if(possibilities.length > 1) {
217
 
             var string = possibilities.join(" ");
218
 
             parent.putMsgHTML(string, new Date().toLocaleTimeString(), parent.jid);
219
 
             return false;
220
 
           }
221
 
           
222
 
         }
223
 
         return true;
224
 
 
225
 
        case 13:
226
 
                if (!e.shiftKey && !e.ctrlKey)
227
 
                        return submitClicked();
228
 
                break;
229
 
        }
230
 
        return true;
231
 
}
232
 
 
233
 
function msgboxKeyDown(el,e) {
234
 
        var keycode;
235
 
        if (window.event) { e  = window.event; keycode = window.event.keyCode; }
236
 
        else if (e) keycode = e.which;
237
 
        else return true;
238
 
 
239
 
        switch (keycode) {
240
 
 
241
 
        case 38:                                // shift+up
242
 
                if (e.ctrlKey) {
243
 
                        el.value = parent.srcW.getHistory('up', el.value);
244
 
                        el.focus(); el.select();
245
 
                }
246
 
                break;
247
 
        case 40:                                // shift+down 
248
 
                if (e.ctrlKey) {
249
 
                        el.value = parent.srcW.getHistory('down', el.value);
250
 
                        el.focus(); el.select();
251
 
                }
252
 
                break;
253
 
        case 76:
254
 
                if (e.ctrlKey) {   // ctrl+l
255
 
                        parent.cFrame.body.innerHTML = '';
256
 
                        return false;
257
 
                }
258
 
                break;
259
 
        case 27:
260
 
                window.close();
261
 
                break;
262
 
        }
263
 
        return true;
264
 
}
265
 
 
266
 
onunload = cleanUp
267
 
      //-->
268
 
    </script>
269
 
  </head>
270
 
  <body style="margin:8px;">
271
 
    <form name="chatform">
272
 
      <table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
273
 
          <tr height="100%">
274
 
            <td width="100%"><textarea id="msgbox" wrap="virtual" style="width:100%;height:100%;" tabindex=1 onKeyPress="return msgboxKeyPressed(this,event);" onKeyDown="return msgboxKeyDown(this,event);"></textarea></td></tr>
275
 
          <tr><td height=5></td></tr>
276
 
          <tr>
277
 
            <td align="right"><button id="config_chan_button" onClick="return parent.openConfig();" style="display:none;" tabindex=5>Configurar</button>&nbsp;<span id="register_room_span" style="display:none;"><button id="register_room_button" onClick="return openRegisterRoom();" tabindex=4>Registrar</button>&nbsp;</span><button id="invite_button" onClick="return openInvite();" tabindex=3>Convidar</button>&nbsp;<button id='submit' name='submit' type='submit' onClick="return submitClicked();" tabindex=2>Enviar</button></td></tr>
278
 
      </table>
279
 
    </form>
280
 
  </body>
281
 
</html>