1 | (function() |
---|
2 | { |
---|
3 | var _autoStatus; |
---|
4 | var _autoStatusTime = 60000; // 1 minuto |
---|
5 | var addUser = null; |
---|
6 | var conn = null; |
---|
7 | var fullName = ""; |
---|
8 | var path = ""; |
---|
9 | var _preferencesIM = ""; |
---|
10 | var selectEditable = null; |
---|
11 | var showhidden = null; |
---|
12 | var statusUserIM = ""; |
---|
13 | var _statusMessage = ""; |
---|
14 | var timeoutId = null; |
---|
15 | var userCurrent = null; |
---|
16 | var _timeOutNotification = ""; |
---|
17 | var Xtools = null; |
---|
18 | var zIndex = 9001; |
---|
19 | var windowPopUp = []; |
---|
20 | |
---|
21 | // Images |
---|
22 | var add_user = new Image(); |
---|
23 | add_user.src = path_jabberit + 'templates/default/images/adduser_azul.png'; |
---|
24 | |
---|
25 | var arrow_down = new Image(); |
---|
26 | arrow_down.src = path_jabberit + 'templates/default/images/arrow_down.gif'; |
---|
27 | |
---|
28 | var arrow_right = new Image(); |
---|
29 | arrow_right.src = path_jabberit + 'templates/default/images/arrow_right.gif'; |
---|
30 | |
---|
31 | function actionButton() |
---|
32 | { |
---|
33 | if( arguments.length > 0 ) |
---|
34 | { |
---|
35 | var e = arguments[0]; |
---|
36 | var _element = ( e.target ) ? e.target : e.srcElement; |
---|
37 | var jid = arguments[1]; |
---|
38 | var coord = null; |
---|
39 | |
---|
40 | if ( !e ) |
---|
41 | e = window.event; |
---|
42 | |
---|
43 | var _X = e.clientX + document.body.scrollLeft - document.body.clientLeft; |
---|
44 | var _Y = e.clientY + document.body.scrollTop - document.body.clientTop; |
---|
45 | |
---|
46 | coord = { X : _X, Y : _Y }; |
---|
47 | |
---|
48 | |
---|
49 | var _onContextMenu = function() |
---|
50 | { |
---|
51 | return false; |
---|
52 | }; |
---|
53 | |
---|
54 | window.document.oncontextmenu = _onContextMenu; |
---|
55 | |
---|
56 | if( e.button ) |
---|
57 | { |
---|
58 | if( e.button > 1 ) |
---|
59 | optionsItensContact( jid, coord ); |
---|
60 | else |
---|
61 | TrophyIM.rosterClick(jid); |
---|
62 | } |
---|
63 | else if( e.which ) |
---|
64 | { |
---|
65 | if( e.which > 1 ) |
---|
66 | optionsItensContact( jid, coord ); |
---|
67 | else |
---|
68 | if( e.target.id ) |
---|
69 | TrophyIM.rosterClick(jid); |
---|
70 | } |
---|
71 | |
---|
72 | setTimeout(function() |
---|
73 | { |
---|
74 | window.document.oncontextmenu = function() |
---|
75 | { |
---|
76 | return true; |
---|
77 | }; |
---|
78 | |
---|
79 | },500); |
---|
80 | } |
---|
81 | } |
---|
82 | |
---|
83 | function addContact() |
---|
84 | { |
---|
85 | if( arguments.length > 0 ) |
---|
86 | addUser.add(); |
---|
87 | else |
---|
88 | addUser.show(); |
---|
89 | } |
---|
90 | |
---|
91 | function addIcon() |
---|
92 | { |
---|
93 | |
---|
94 | var div_write_msg = ( getElement('em_div_write_msg') != null ) ? getElement('em_div_write_msg') : null ; |
---|
95 | var StatusBar = ( getElement('divStatusBar') != null ) ? getElement('divStatusBar') : null ; |
---|
96 | var StatusBarIM = ( getElement('JabberMessenger') != null ) ? getElement('JabberMessenger') : null; |
---|
97 | |
---|
98 | /************************************************************************** |
---|
99 | * |
---|
100 | * Quando estiver habilitada a opção fora de escritório nos filtros. |
---|
101 | * |
---|
102 | */ |
---|
103 | |
---|
104 | if( ( div_write_msg && StatusBarIM ) != null ) |
---|
105 | { |
---|
106 | div_write_msg.parentNode.insertBefore(StatusBarIM, div_write_msg); |
---|
107 | StatusBarIM.style.paddingLeft = '33px'; |
---|
108 | return; |
---|
109 | } |
---|
110 | |
---|
111 | /**************************************************************************/ |
---|
112 | |
---|
113 | if ( !StatusBarIM ) |
---|
114 | { |
---|
115 | StatusBarIM = document.createElement('div'); |
---|
116 | StatusBarIM.setAttribute('id', 'JabberMessenger'); |
---|
117 | } |
---|
118 | |
---|
119 | if( StatusBar ) |
---|
120 | { |
---|
121 | StatusBar.style.paddingLeft = '33px'; |
---|
122 | |
---|
123 | var _div = document.createElement('div'); |
---|
124 | _div.appendChild(StatusBar.parentNode.removeChild(StatusBar.previousSibling)); |
---|
125 | |
---|
126 | StatusBar.parentNode.insertBefore( _div, StatusBar); |
---|
127 | |
---|
128 | var _fastMenu = top.document.createElement('div'); |
---|
129 | _fastMenu.setAttribute('id', 'fast_menu_jabber_expresso'); |
---|
130 | _fastMenu.style.background = 'no-repeat'; |
---|
131 | _fastMenu.style.backgroundImage = 'url(' + arrow_down.src + ')'; |
---|
132 | _fastMenu.style.float = 'left'; |
---|
133 | _fastMenu.style.height = '15px'; |
---|
134 | _fastMenu.style.left = '7px'; |
---|
135 | _fastMenu.style.margin = '8 0 0 10px'; |
---|
136 | _fastMenu.style.padding = '0px'; |
---|
137 | _fastMenu.style.position = 'absolute'; |
---|
138 | _fastMenu.style.width = '15px'; |
---|
139 | _fastMenu.style.cursor = 'pointer'; |
---|
140 | |
---|
141 | StatusBarIM.insertBefore( _fastMenu, StatusBarIM.firstChild ); |
---|
142 | |
---|
143 | // Add event onclick element _fastMenu |
---|
144 | configEvents( _fastMenu, 'onclick', function(){ fastMenu(_fastMenu); }); |
---|
145 | |
---|
146 | var _statusJabber = top.document.createElement('div'); |
---|
147 | _statusJabber.setAttribute('id','status_jabber_expresso'); |
---|
148 | _statusJabber.style.background = 'no-repeat'; |
---|
149 | _statusJabber.style.backgroundImage = 'url(' + add_user.src +')'; |
---|
150 | _statusJabber.style.float = 'left'; |
---|
151 | _statusJabber.style.height = '18px'; |
---|
152 | _statusJabber.style.left = '19px'; |
---|
153 | _statusJabber.style.margin = '0 0 0 10px'; |
---|
154 | _statusJabber.style.padding = '0px'; |
---|
155 | _statusJabber.style.position = 'absolute'; |
---|
156 | _statusJabber.style.width = '18px'; |
---|
157 | _statusJabber.style.cursor = 'pointer'; |
---|
158 | _statusJabber.style.zindex = '999999'; |
---|
159 | |
---|
160 | StatusBarIM.insertBefore( _statusJabber, StatusBarIM.firstChild ); |
---|
161 | |
---|
162 | StatusBar.insertBefore( StatusBarIM, StatusBar.firstChild ); |
---|
163 | |
---|
164 | // Add event onclick element _statusJabber |
---|
165 | if( _preferencesIM[0] == "openWindowJabberit:true" ) |
---|
166 | { |
---|
167 | configEvents( _statusJabber, 'onclick', function(){ rosterDiv(); }); |
---|
168 | } |
---|
169 | else |
---|
170 | { |
---|
171 | configEvents( _statusJabber, 'onclick', function(){ TrophyIM.load(); }); |
---|
172 | } |
---|
173 | } |
---|
174 | } |
---|
175 | |
---|
176 | function addNewUser() |
---|
177 | { |
---|
178 | addUser.newUser(); |
---|
179 | } |
---|
180 | |
---|
181 | function autoStatus() |
---|
182 | { |
---|
183 | var _div_status = ( getElement('status_jabber_expresso') != null ) ? getElement('status_jabber_expresso') : null; |
---|
184 | |
---|
185 | if ( _autoStatus ) |
---|
186 | clearTimeout(_autoStatus); |
---|
187 | |
---|
188 | if ( _div_status != null ) |
---|
189 | { |
---|
190 | var _status = _div_status.style.backgroundImage; |
---|
191 | _status = _status.substr(_status.lastIndexOf('/') + 1); |
---|
192 | _status = _status.substr(0, _status.indexOf('.')); |
---|
193 | |
---|
194 | if( _status == "xa" && _div_status.getAttribute('autoStatus') ) |
---|
195 | { |
---|
196 | if( getStatusMessage() != "") |
---|
197 | TrophyIM.setPresence("available", getStatusMessage()); |
---|
198 | else |
---|
199 | TrophyIM.setPresence("available"); |
---|
200 | |
---|
201 | _div_status.removeAttribute('autoStatus'); |
---|
202 | loadscript.setStatusJabber("Disponível","available"); |
---|
203 | } |
---|
204 | } |
---|
205 | |
---|
206 | var TimeStatus = _preferencesIM[2].split(':'); |
---|
207 | |
---|
208 | if( TimeStatus[1] ) |
---|
209 | _autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(TimeStatus[1]) * _autoStatusTime ); |
---|
210 | else |
---|
211 | _autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(_autoStatusTime)); |
---|
212 | } |
---|
213 | |
---|
214 | function autoStatusHandler() |
---|
215 | { |
---|
216 | var _div_status = ( getElement('status_jabber_expresso') != null ) ? getElement('status_jabber_expresso') : null; |
---|
217 | |
---|
218 | if ( _div_status != null ) |
---|
219 | { |
---|
220 | var _status = _div_status.style.backgroundImage; |
---|
221 | _status = _status.substr(_status.lastIndexOf('/') + 1); |
---|
222 | _status = _status.substr(0, _status.indexOf('.')); |
---|
223 | |
---|
224 | if( _status == "available" ) |
---|
225 | { |
---|
226 | if(getStatusMessage() != "") |
---|
227 | TrophyIM.setPresence("xa", getStatusMessage()); |
---|
228 | else |
---|
229 | TrophyIM.setPresence("xa"); |
---|
230 | |
---|
231 | _div_status.setAttribute('autoStatus','true'); |
---|
232 | |
---|
233 | loadscript.setStatusJabber("Não Disponível","xa"); |
---|
234 | } |
---|
235 | } |
---|
236 | } |
---|
237 | |
---|
238 | function clrAllContacts() |
---|
239 | { |
---|
240 | getElement("JabberIMRoster").innerHTML = ""; |
---|
241 | } |
---|
242 | |
---|
243 | function configEvents(pObj, pEvent, pHandler) |
---|
244 | { |
---|
245 | if ( typeof pObj == 'object' ) |
---|
246 | { |
---|
247 | if ( pEvent.substring(0, 2) == 'on' ) |
---|
248 | pEvent = pEvent.substring(2, pEvent.length ); |
---|
249 | |
---|
250 | if ( arguments.length == 3 ) |
---|
251 | { |
---|
252 | if ( pObj.addEventListener ) |
---|
253 | pObj.addEventListener(pEvent, pHandler, false ); |
---|
254 | else if ( pObj.attachEvent ) |
---|
255 | pObj.attachEvent( 'on' + pEvent, pHandler ); |
---|
256 | } |
---|
257 | else if ( arguments.length == 4 ) |
---|
258 | { |
---|
259 | if ( pObj.removeEventListener ) |
---|
260 | pObj.removeEventListener( pEvent, pHandler, false ); |
---|
261 | else if ( pObj.detachEvent ) |
---|
262 | pObj.detachEvent( 'on' + pEvent, pHandler ); |
---|
263 | } |
---|
264 | } |
---|
265 | } |
---|
266 | |
---|
267 | function disabledNotificationNewUsers() |
---|
268 | { |
---|
269 | var _notification = getElement('notification_new_users_jabber') ; |
---|
270 | var _statusJabber = getElement('status_jabber_expresso'); |
---|
271 | |
---|
272 | _notification.style.display = 'none'; |
---|
273 | |
---|
274 | _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; |
---|
275 | |
---|
276 | if( _timeOutNotification ) |
---|
277 | clearTimeout(_timeOutNotification ); |
---|
278 | |
---|
279 | TrophyIM.controll.notificationNewUsers = 0; |
---|
280 | } |
---|
281 | |
---|
282 | function enabledNotificationNewUsers() |
---|
283 | { |
---|
284 | var _notification = getElement('notification_new_users_jabber') ; |
---|
285 | var _statusJabber = getElement('status_jabber_expresso'); |
---|
286 | |
---|
287 | if( _notification && _statusJabber ) |
---|
288 | { |
---|
289 | if ( _notification.style.display == 'none' ) |
---|
290 | { |
---|
291 | _notification.style.display = 'block'; |
---|
292 | |
---|
293 | _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/alert_mini.png') no-repeat"; |
---|
294 | |
---|
295 | if( _timeOutNotification ) |
---|
296 | clearTimeout(_timeOutNotification ); |
---|
297 | |
---|
298 | _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 2000 ); |
---|
299 | } |
---|
300 | else |
---|
301 | { |
---|
302 | _notification.style.display = 'none'; |
---|
303 | |
---|
304 | _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; |
---|
305 | |
---|
306 | if( _timeOutNotification ) |
---|
307 | clearTimeout(_timeOutNotification ); |
---|
308 | |
---|
309 | _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 800 ); |
---|
310 | } |
---|
311 | } |
---|
312 | } |
---|
313 | |
---|
314 | function fastMenu() |
---|
315 | { |
---|
316 | if( arguments.length > 0 ) |
---|
317 | { |
---|
318 | var element = arguments[0]; |
---|
319 | |
---|
320 | if( showhidden == null ) |
---|
321 | showhidden = new ShowHidden(300); |
---|
322 | |
---|
323 | var _options = [ |
---|
324 | ['Adicionar Contato', 'loadscript.addContact();' ], |
---|
325 | ['Preferências', 'loadscript.preferences();'], |
---|
326 | ['Sala(s) de Bate-Papo', 'loadscript.getListRooms();'], |
---|
327 | ]; |
---|
328 | |
---|
329 | var _itens = ""; |
---|
330 | |
---|
331 | for( var i in _options ) |
---|
332 | { |
---|
333 | if( _options[i].constructor == Function ) |
---|
334 | continue; |
---|
335 | |
---|
336 | _itens += '<img src="'+arrow_right.src+'"/>'; |
---|
337 | _itens += '<span style="cursor:pointer; margin:3px;" onclick='+_options[i][1]+'>'; |
---|
338 | _itens += _options[i][0] + '</span><br/>'; |
---|
339 | } |
---|
340 | |
---|
341 | var _optionsItens = document.createElement("div"); |
---|
342 | _optionsItens.id = "fastMenu_Jabber"; |
---|
343 | _optionsItens.style.marginTop = "19px"; |
---|
344 | _optionsItens.style.marginLeft = "-8px"; |
---|
345 | _optionsItens.className = "x-menu"; |
---|
346 | _optionsItens.style.zIndex = '999999'; |
---|
347 | _optionsItens.innerHTML = _itens; |
---|
348 | _optionsItens.onclick = function(){ showhidden.hiddenObject(false); }; |
---|
349 | _optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); }; |
---|
350 | _optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); }; |
---|
351 | |
---|
352 | showhidden.action('onmouseover', 'onmouseout', _optionsItens); |
---|
353 | |
---|
354 | element.parentNode.appendChild( _optionsItens ); |
---|
355 | } |
---|
356 | } |
---|
357 | |
---|
358 | function getElement( elementId ) |
---|
359 | { |
---|
360 | return document.getElementById( elementId ); |
---|
361 | } |
---|
362 | |
---|
363 | function getIsIE() |
---|
364 | { |
---|
365 | return SnifferBrowser.isCompatible('is_ie'); |
---|
366 | } |
---|
367 | |
---|
368 | function getPhotoUser( jid ) |
---|
369 | { |
---|
370 | try |
---|
371 | { |
---|
372 | var _divPhoto = getElement( jid + '__photo' ); |
---|
373 | |
---|
374 | if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 ) |
---|
375 | { |
---|
376 | var _imgUser = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date ); |
---|
377 | _imgUser += '&photo_ldap=' + jid; |
---|
378 | |
---|
379 | _divPhoto.style.backgroundImage = 'url(' + _imgUser + ')'; |
---|
380 | } |
---|
381 | }catch(e){} |
---|
382 | } |
---|
383 | |
---|
384 | function getShowContactsOffline() |
---|
385 | { |
---|
386 | if( _preferencesIM[3] ) |
---|
387 | { |
---|
388 | var showOffline = _preferencesIM[3].split(":"); |
---|
389 | |
---|
390 | if( showOffline[1] === "true") |
---|
391 | return true; |
---|
392 | else |
---|
393 | return false; |
---|
394 | } |
---|
395 | |
---|
396 | return true; |
---|
397 | } |
---|
398 | |
---|
399 | function getSmiles( String ) |
---|
400 | { |
---|
401 | String = String.replace( /:\)|:-\)/g , " <img src='"+path_jabberit+"templates/default/images/smiles/1.gif'/> "); |
---|
402 | String = String.replace( /:-D/g , " <img src='"+path_jabberit+"templates/default/images/smiles/2.gif'/> "); |
---|
403 | String = String.replace( /;-\)/g , " <img src='"+path_jabberit+"templates/default/images/smiles/3.gif'/> "); |
---|
404 | String = String.replace( /=-O/g , " <img src='"+path_jabberit+"templates/default/images/smiles/4.gif'/> "); |
---|
405 | String = String.replace( /:P/g , " <img src='"+path_jabberit+"templates/default/images/smiles/5.gif'/> "); |
---|
406 | String = String.replace( /8-\)/g , " <img src='"+path_jabberit+"templates/default/images/smiles/6.gif'/> "); |
---|
407 | String = String.replace( /\>:o/g , " <img src='"+path_jabberit+"templates/default/images/smiles/7.gif'/> "); |
---|
408 | String = String.replace( /:-\$/g , " <img src='"+path_jabberit+"templates/default/images/smiles/8.gif'/> "); |
---|
409 | String = String.replace( /:s|:-X/g , " <img src='"+path_jabberit+"templates/default/images/smiles/9.gif'/> "); |
---|
410 | String = String.replace( /:-\(/g , " <img src='"+path_jabberit+"templates/default/images/smiles/10.gif'/> "); |
---|
411 | String = String.replace( /:\'\(/g , " <img src='"+path_jabberit+"templates/default/images/smiles/11.gif'/> "); |
---|
412 | String = String.replace( /:\|/g , " <img src='"+path_jabberit+"templates/default/images/smiles/12.gif'/> "); |
---|
413 | String = String.replace( /O:-\)/g , " <img src='"+path_jabberit+"templates/default/images/smiles/13.gif'/> "); |
---|
414 | String = String.replace( /\*\*@#%/g , " <img src='"+path_jabberit+"templates/default/images/smiles/14.gif'/> "); |
---|
415 | String = String.replace( /\(I\)/g , " <img src='"+path_jabberit+"templates/default/images/smiles/15.gif'/> "); |
---|
416 | String = String.replace( /C28I/g , " <img src='"+path_jabberit+"templates/default/images/smiles/16.gif'/> "); |
---|
417 | |
---|
418 | return String; |
---|
419 | } |
---|
420 | |
---|
421 | function getStatusUserIM() |
---|
422 | { |
---|
423 | return statusUserIM; |
---|
424 | } |
---|
425 | |
---|
426 | function getStatusMessage() |
---|
427 | { |
---|
428 | return _statusMessage; |
---|
429 | } |
---|
430 | |
---|
431 | function getUserCurrent() |
---|
432 | { |
---|
433 | return userCurrent; |
---|
434 | } |
---|
435 | |
---|
436 | function getZindex() |
---|
437 | { |
---|
438 | return zIndex++; |
---|
439 | } |
---|
440 | |
---|
441 | function groupsHidden() |
---|
442 | { |
---|
443 | if( arguments.length > 0 ) |
---|
444 | { |
---|
445 | var _element = arguments[0]; |
---|
446 | _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_right.gif') no-repeat center left"; |
---|
447 | _element.onclick = function(){ groupsVisible(_element);}; |
---|
448 | |
---|
449 | // Hidden all |
---|
450 | var _elementNext = _element.nextSibling; |
---|
451 | |
---|
452 | while( _elementNext ) |
---|
453 | { |
---|
454 | if( _elementNext.nodeType == 1 ) |
---|
455 | _elementNext.style.display = "none"; |
---|
456 | |
---|
457 | _elementNext = _elementNext.nextSibling; |
---|
458 | } |
---|
459 | } |
---|
460 | } |
---|
461 | |
---|
462 | function groupsVisible() |
---|
463 | { |
---|
464 | if( arguments.length > 0 ) |
---|
465 | { |
---|
466 | var _element = arguments[0]; |
---|
467 | _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_down.gif') no-repeat center left"; |
---|
468 | _element.onclick = function(){ groupsHidden(_element);}; |
---|
469 | |
---|
470 | // Display all |
---|
471 | var _elementNext = _element.nextSibling; |
---|
472 | |
---|
473 | while( _elementNext ) |
---|
474 | { |
---|
475 | if( _elementNext.nodeType == 1 && _elementNext.nodeName.toLowerCase() == "div" ) |
---|
476 | { |
---|
477 | var is_off = _elementNext.style.backgroundImage.indexOf("unavailable"); |
---|
478 | |
---|
479 | if( is_off > 0 && !getShowContactsOffline()) |
---|
480 | { |
---|
481 | _elementNext.style.display = "none"; |
---|
482 | getElement("span_show_" + _elementNext.id ).style.display = "none"; |
---|
483 | |
---|
484 | } |
---|
485 | else |
---|
486 | { |
---|
487 | _elementNext.style.display = "block"; |
---|
488 | getElement("span_show_" + _elementNext.id ).style.display = "block"; |
---|
489 | } |
---|
490 | } |
---|
491 | |
---|
492 | _elementNext = _elementNext.nextSibling; |
---|
493 | } |
---|
494 | } |
---|
495 | } |
---|
496 | |
---|
497 | function keyPressSearch() |
---|
498 | { |
---|
499 | if( arguments.length > 0 ) |
---|
500 | { |
---|
501 | var ev = arguments[0]; |
---|
502 | var element = arguments[1]; |
---|
503 | |
---|
504 | if ( ev.keyCode == 13 ) |
---|
505 | if( element.value.length >= 3 ) |
---|
506 | searchUser( element.value ); |
---|
507 | else |
---|
508 | alert( i18n.YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS + '.' ); |
---|
509 | } |
---|
510 | } |
---|
511 | |
---|
512 | |
---|
513 | function loginPage() |
---|
514 | { |
---|
515 | var paramsLoginPage = |
---|
516 | { |
---|
517 | 'username' : ((( Base64.decode(getUserCurrent().jid) )) ? Base64.decode(getUserCurrent().jid) : ""), |
---|
518 | 'password' : ((( Base64.decode(getUserCurrent().password) )) ? Base64.decode(getUserCurrent().password) : "") |
---|
519 | } |
---|
520 | |
---|
521 | var winLoginPage = |
---|
522 | { |
---|
523 | id_window : "window_login_page", |
---|
524 | width : 260, |
---|
525 | height : 120, |
---|
526 | top : 100, |
---|
527 | left : 400, |
---|
528 | draggable : true, |
---|
529 | visible : "display", |
---|
530 | resizable : true, |
---|
531 | zindex : zIndex++, |
---|
532 | title : "Expresso Messenger - Login", |
---|
533 | closeAction : "remove", |
---|
534 | content : Xtools.parse(Xtools.xml("login_page"), "loginPage.xsl", paramsLoginPage) |
---|
535 | }; |
---|
536 | |
---|
537 | _winBuild( winLoginPage ); |
---|
538 | } |
---|
539 | |
---|
540 | function loadScripts(pFiles) |
---|
541 | { |
---|
542 | // Load JavaScript |
---|
543 | var loadJavaScript = function(pJs) |
---|
544 | { |
---|
545 | var newScript = document.createElement("script"); |
---|
546 | newScript.setAttribute("type", "text/javascript"); |
---|
547 | newScript.setAttribute("src", pJs ); |
---|
548 | |
---|
549 | return newScript; |
---|
550 | }; |
---|
551 | |
---|
552 | // Load CSS |
---|
553 | var loadStyleSheet = function(pCss) |
---|
554 | { |
---|
555 | var newStyle = document.createElement("link"); |
---|
556 | newStyle.setAttribute("rel", "stylesheet"); |
---|
557 | newStyle.setAttribute("type", "text/css"); |
---|
558 | newStyle.setAttribute("href", pCss); |
---|
559 | |
---|
560 | return newStyle; |
---|
561 | }; |
---|
562 | |
---|
563 | for(var i = 0; i < pFiles.length; i++) |
---|
564 | { |
---|
565 | if( pFiles[i].indexOf(".js") > -1 ) |
---|
566 | document.getElementsByTagName("head")[0].appendChild(loadJavaScript(pFiles[i])); |
---|
567 | |
---|
568 | if( pFiles[i].indexOf(".css") > -1 ) |
---|
569 | document.getElementsByTagName("head")[0].appendChild(loadStyleSheet(pFiles[i])); |
---|
570 | } |
---|
571 | } |
---|
572 | |
---|
573 | function notificationNewMessage() |
---|
574 | { |
---|
575 | var _doc = document; |
---|
576 | var _id = arguments[0]; |
---|
577 | var _win_name = _id.replace( /\W/g, '' ); |
---|
578 | |
---|
579 | if ( windowPOPUP( _id ) ) |
---|
580 | { |
---|
581 | _doc = windowPopUp[_win_name].document; |
---|
582 | } |
---|
583 | |
---|
584 | var oldTitle = _doc.title; |
---|
585 | var newTitle = "## NOVA MENSAGEM ##"; |
---|
586 | |
---|
587 | if( timeoutId == null ) |
---|
588 | { |
---|
589 | timeoutId = setInterval(function() |
---|
590 | { |
---|
591 | _doc.title = ( _doc.title == newTitle ) ? oldTitle : newTitle; |
---|
592 | }, 1000); |
---|
593 | |
---|
594 | configEvents( _doc, 'onclick', function() |
---|
595 | { |
---|
596 | clearInterval(timeoutId); |
---|
597 | _doc.title = oldTitle; |
---|
598 | timeoutId = null; |
---|
599 | }); |
---|
600 | |
---|
601 | configEvents( _doc, 'onkeypress', function() |
---|
602 | { |
---|
603 | clearInterval(timeoutId); |
---|
604 | _doc.title = oldTitle; |
---|
605 | timeoutId = null; |
---|
606 | }); |
---|
607 | } |
---|
608 | } |
---|
609 | |
---|
610 | function optionsItensContact() |
---|
611 | { |
---|
612 | if( arguments.length > 0 ) |
---|
613 | { |
---|
614 | var jid = arguments[0]; |
---|
615 | var coord = arguments[1]; |
---|
616 | var element = getElement('itenContact_' + jid ); |
---|
617 | var action = ( element.getAttribute("subscription") === "not-in-roster" ) ? "Adicionar" : "Autorizar"; |
---|
618 | |
---|
619 | if( showhidden == null ) |
---|
620 | showhidden = new ShowHidden(300); |
---|
621 | |
---|
622 | var _options = [ |
---|
623 | [ action , 'loadscript.setAutorization(\''+jid+'\')'], |
---|
624 | ['Remover' , 'loadscript.removeContact(\''+jid+'\')'], |
---|
625 | ['Renomear' , 'loadscript.renameContact(\''+jid+'\')'], |
---|
626 | ['Trocar grupo' , 'loadscript.renameGroup(\''+jid+'\')'] |
---|
627 | ]; |
---|
628 | |
---|
629 | var _itens = ""; |
---|
630 | |
---|
631 | for( var i in _options ) |
---|
632 | { |
---|
633 | if( typeof(_options[i]) == "object") |
---|
634 | { |
---|
635 | _itens += '<img src="'+arrow_right.src+'"/>'; |
---|
636 | _itens += '<span style="cursor:pointer;margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>'; |
---|
637 | _itens += _options[i][0] + '</span><br/>'; |
---|
638 | } |
---|
639 | } |
---|
640 | |
---|
641 | var _optionsItens = document.createElement("div"); |
---|
642 | _optionsItens.className = "x-menu"; |
---|
643 | _optionsItens.style.top = coord.Y; |
---|
644 | _optionsItens.style.left = ( coord.X - element.offsetLeft ); |
---|
645 | _optionsItens.style.zIndex = getZindex(); |
---|
646 | _optionsItens.innerHTML = _itens; |
---|
647 | _optionsItens.onclick = function(){ showhidden.hiddenObject(false); }; |
---|
648 | _optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); }; |
---|
649 | _optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); }; |
---|
650 | |
---|
651 | showhidden.action('onmouseover', 'onmouseout', _optionsItens); |
---|
652 | |
---|
653 | window.document.body.appendChild(_optionsItens); |
---|
654 | } |
---|
655 | } |
---|
656 | |
---|
657 | function parse() |
---|
658 | { |
---|
659 | if( arguments.length == 2 ) |
---|
660 | return Xtools.parse(Xtools.xml(arguments[0]), arguments[1] ); |
---|
661 | |
---|
662 | if( arguments.length === 3 ) |
---|
663 | return Xtools.parse(Xtools.xml(arguments[0]), arguments[1], arguments[2] ); |
---|
664 | } |
---|
665 | |
---|
666 | function preferences() |
---|
667 | { |
---|
668 | var paramPreferences = |
---|
669 | { |
---|
670 | 'path' : path, |
---|
671 | 'lang1' : 'Suas Preferências', |
---|
672 | 'lang2' : 'Conexão', |
---|
673 | 'lang3' : 'Conectar Automaticamente o IM', |
---|
674 | 'lang4' : 'Usuários OffLine', |
---|
675 | 'lang5' : 'Exibir amigos Offline', |
---|
676 | 'lang6' : 'Salvar', |
---|
677 | 'lang7' : 'Cancelar', |
---|
678 | 'lang8' : 'Janela de Contatos', |
---|
679 | 'lang9' : 'Abrir janela como Pop-up', |
---|
680 | 'lang10' : 'Ausente', |
---|
681 | 'lang11' : 'Definir status de ausente depois de', |
---|
682 | 'lang12' : 'minutos', |
---|
683 | 'lang13' : 'Mostrar Contatos', |
---|
684 | 'lang14' : 'Mostrar contatos desconectados', |
---|
685 | 'langYes': 'Sim', |
---|
686 | 'langNo' : 'Não' |
---|
687 | }; |
---|
688 | |
---|
689 | |
---|
690 | var _win_preferences = |
---|
691 | { |
---|
692 | id_window : "jabberit_preferences", |
---|
693 | width : 430, |
---|
694 | height : 350, |
---|
695 | top : 150, |
---|
696 | left : 100, |
---|
697 | draggable : true, |
---|
698 | visible : "display", |
---|
699 | resizable : true, |
---|
700 | zindex : zIndex++, |
---|
701 | title : 'Expresso Messenger - Preferências', |
---|
702 | closeAction : "remove", |
---|
703 | content : Xtools.parse(Xtools.xml('preferences'), 'preferences.xsl', paramPreferences) |
---|
704 | }; |
---|
705 | |
---|
706 | _winBuild(_win_preferences); |
---|
707 | |
---|
708 | |
---|
709 | var _pButtons = { |
---|
710 | 'lang1' : 'Salvar', |
---|
711 | 'lang2' : 'Fechar', |
---|
712 | 'onclickClose' : '_winBuild("jabberit_preferences","remove");', |
---|
713 | 'onclickSubmit' : 'javascript:loadscript.setPreferences();' |
---|
714 | }; |
---|
715 | |
---|
716 | document.getElementById('buttons_preferences_jabberit').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons); |
---|
717 | |
---|
718 | // Element openWindowJabberit |
---|
719 | var value1 = _preferencesIM[0].split(':'); |
---|
720 | var element1 = document.getElementById(value1[0]); |
---|
721 | var valueSelect1 = value1[1]; |
---|
722 | |
---|
723 | for(var i = 0; i < element1.options.length; i++) |
---|
724 | if( element1.options[i].value == valueSelect1 ) |
---|
725 | element1.options[i].selected = true; |
---|
726 | |
---|
727 | // Element openWindowJabberitPopUp |
---|
728 | var value2 = _preferencesIM[1].split(':'); |
---|
729 | |
---|
730 | // Element flagAwayIM |
---|
731 | var value3 = _preferencesIM[2].split(':'); |
---|
732 | var element3 = document.getElementById(value3[0]); |
---|
733 | element3.value = value3[1]; |
---|
734 | |
---|
735 | // Element showContactsOfflineJabberit |
---|
736 | var value4 = _preferencesIM[3].split(':'); |
---|
737 | var element4 = document.getElementById(value4[0]); |
---|
738 | var valueSelect4 = value4[1]; |
---|
739 | for(var i = 0; i < element4.options.length; i++) |
---|
740 | if( element4.options[i].value == valueSelect4 ) |
---|
741 | element4.options[i].selected = true; |
---|
742 | } |
---|
743 | |
---|
744 | function removeContact( jid ) |
---|
745 | { |
---|
746 | TrophyIM.removeContact( jid ); |
---|
747 | } |
---|
748 | |
---|
749 | function removeElement( ) |
---|
750 | { |
---|
751 | if( arguments.length > 0 ) |
---|
752 | { |
---|
753 | var _element = arguments[0] |
---|
754 | |
---|
755 | if( _element != null ) |
---|
756 | { |
---|
757 | _element.parentNode.removeChild( _element ); |
---|
758 | } |
---|
759 | } |
---|
760 | } |
---|
761 | |
---|
762 | function removeGroup() |
---|
763 | { |
---|
764 | var _parent = arguments[0]; |
---|
765 | |
---|
766 | if( _parent.childNodes.length <= 2 ) |
---|
767 | _parent.parentNode.removeChild(_parent); |
---|
768 | } |
---|
769 | |
---|
770 | function renameContact() |
---|
771 | { |
---|
772 | if( arguments.length > 0 ) |
---|
773 | { |
---|
774 | var _jid = arguments[0]; |
---|
775 | |
---|
776 | TrophyIM.renameContact( _jid ); |
---|
777 | } |
---|
778 | } |
---|
779 | |
---|
780 | function renameGroup() |
---|
781 | { |
---|
782 | if( arguments.length > 0 ) |
---|
783 | { |
---|
784 | var _jid = arguments[0]; |
---|
785 | |
---|
786 | TrophyIM.renameGroup( _jid ); |
---|
787 | } |
---|
788 | } |
---|
789 | |
---|
790 | function rosterDiv() |
---|
791 | { |
---|
792 | var _rosterDiv = function() |
---|
793 | { |
---|
794 | |
---|
795 | var winRosterDiv = |
---|
796 | { |
---|
797 | id_window : "window_Roster_im", |
---|
798 | width : 250, |
---|
799 | height : 410, |
---|
800 | top : 50, |
---|
801 | left : -1500, |
---|
802 | leftOld : 50, |
---|
803 | draggable : true, |
---|
804 | visible : "display", |
---|
805 | resizable : true, |
---|
806 | zindex : zIndex++, |
---|
807 | title : "Expresso Messenger - Contatos", |
---|
808 | closeAction : "hidden", |
---|
809 | content : "" |
---|
810 | }; |
---|
811 | |
---|
812 | if( _preferencesIM[0] == "openWindowJabberit:false" ) |
---|
813 | { |
---|
814 | winRosterDiv.left = 50; |
---|
815 | winRosterDiv.leftOld = -1500; |
---|
816 | } |
---|
817 | |
---|
818 | if( SnifferBrowser.isCompatible('ie8','firefox3','epiphany2','iceweasel3') ) |
---|
819 | { |
---|
820 | var _idUser = Base64.decode(getUserCurrent().jid); |
---|
821 | |
---|
822 | var paramListContact = |
---|
823 | { |
---|
824 | 'idUser' : _idUser, |
---|
825 | 'full_name' : (( fullName.length < 25 ) ? fullName : ( fullName.substring( 0, 25) + "...")), |
---|
826 | 'path_jabberit' : path_jabberit, |
---|
827 | 'help_expresso' : help_expresso, |
---|
828 | 'zIndex_' : zIndex++ |
---|
829 | }; |
---|
830 | |
---|
831 | winRosterDiv.content = Xtools.parse(Xtools.xml("contacts_list"),"contactsList.xsl", paramListContact) |
---|
832 | |
---|
833 | } |
---|
834 | else |
---|
835 | { |
---|
836 | var paramList = |
---|
837 | { |
---|
838 | 'path_jabberit' : path_jabberit |
---|
839 | }; |
---|
840 | |
---|
841 | winRosterDiv.width = 280; |
---|
842 | winRosterDiv.height = 430; |
---|
843 | winRosterDiv.content = Xtools.parse(Xtools.xml("navigator"),"navigatorCompatible.xsl", paramList); |
---|
844 | } |
---|
845 | |
---|
846 | _winBuild( winRosterDiv ); |
---|
847 | |
---|
848 | // Photo User |
---|
849 | getPhotoUser(_idUser); |
---|
850 | } |
---|
851 | |
---|
852 | setTimeout( function(){ _rosterDiv(); }, 200 ); |
---|
853 | } |
---|
854 | |
---|
855 | function searchUser() |
---|
856 | { |
---|
857 | var _input = getElement('search_user_jabber'); |
---|
858 | |
---|
859 | if( _input.value.length >= 3 ) |
---|
860 | addUser.search(); |
---|
861 | else |
---|
862 | alert( i18n.YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS + '.' ); |
---|
863 | } |
---|
864 | |
---|
865 | function setAutorization() |
---|
866 | { |
---|
867 | var divItenContact = null; |
---|
868 | |
---|
869 | if( arguments.length > 0 ) |
---|
870 | { |
---|
871 | var jidTo = arguments[0]; |
---|
872 | |
---|
873 | if( getElement('itenContact_' + jidTo) ) |
---|
874 | divItenContact = getElement('itenContact_' + jidTo ); |
---|
875 | } |
---|
876 | |
---|
877 | if( divItenContact ) |
---|
878 | { |
---|
879 | var subscription = divItenContact.getAttribute('subscription'); |
---|
880 | |
---|
881 | switch(subscription) |
---|
882 | { |
---|
883 | case 'from': |
---|
884 | |
---|
885 | TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribe'); |
---|
886 | break; |
---|
887 | |
---|
888 | case 'subscribe' : |
---|
889 | |
---|
890 | TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribed'); |
---|
891 | break; |
---|
892 | |
---|
893 | case 'none' : |
---|
894 | |
---|
895 | TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribe'); |
---|
896 | break; |
---|
897 | |
---|
898 | case 'to' : |
---|
899 | |
---|
900 | TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribed'); |
---|
901 | removeElement( getElement('itenContactNotification_' + jidTo ) ); |
---|
902 | break; |
---|
903 | |
---|
904 | case 'not-in-roster': |
---|
905 | |
---|
906 | TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); |
---|
907 | addUser.add( jidTo ); |
---|
908 | break; |
---|
909 | } |
---|
910 | } |
---|
911 | } |
---|
912 | |
---|
913 | function setMessageStatus() |
---|
914 | { |
---|
915 | if( arguments.length > 0 ) |
---|
916 | { |
---|
917 | var _element = arguments[0]; |
---|
918 | var _parent = _element.parentNode; |
---|
919 | |
---|
920 | if( _element.nodeName.toLowerCase() == "label") |
---|
921 | { |
---|
922 | var _input = document.createElement("input"); |
---|
923 | _input.size = "35"; |
---|
924 | _input.maxlength = "35"; |
---|
925 | _input.style.border = "0"; |
---|
926 | _input.value = _element.innerHTML; |
---|
927 | |
---|
928 | // OnkeyUp |
---|
929 | configEvents( _input, "onkeyup", function(e) |
---|
930 | { |
---|
931 | if( e.keyCode == 13 ) loadscript.setMessageStatus(_input, _element); |
---|
932 | } |
---|
933 | ); |
---|
934 | |
---|
935 | // Onblur |
---|
936 | configEvents(_input, "onblur", function(){ loadscript.setMessageStatus(_input, _element)}); |
---|
937 | |
---|
938 | |
---|
939 | if( _parent != null ) |
---|
940 | { |
---|
941 | // Remove label |
---|
942 | if( _element != null ) |
---|
943 | _parent.removeChild( _element ); |
---|
944 | |
---|
945 | // Add Input |
---|
946 | if( _input != null ) |
---|
947 | _parent.appendChild( _input ); |
---|
948 | } |
---|
949 | |
---|
950 | _input.focus(); |
---|
951 | _input.select(); |
---|
952 | } |
---|
953 | else |
---|
954 | { |
---|
955 | var _label = arguments[1]; |
---|
956 | _statusMessage = _element.value.replace(/^\(+|\)+$/g,""); |
---|
957 | |
---|
958 | if( ( _statusMessage = _statusMessage.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "") |
---|
959 | _label.innerHTML = "( " + _statusMessage + " )"; |
---|
960 | else |
---|
961 | _label.innerHTML = "( " + i18n.TYPE_YOUR_MESSAGE_HERE_STATUS + " )"; |
---|
962 | |
---|
963 | if( _parent != null ) |
---|
964 | { |
---|
965 | // Remove Input |
---|
966 | if( _element != null ) |
---|
967 | _parent.removeChild( _element ); |
---|
968 | |
---|
969 | // Add Label |
---|
970 | if( _label != null ) |
---|
971 | _parent.appendChild( _label ); |
---|
972 | } |
---|
973 | |
---|
974 | // Send Status Message |
---|
975 | _statusMessage = ( ( _statusMessage != i18n.TYPE_YOUR_MESSAGE_HERE_STATUS ) ? _statusMessage : "" ); |
---|
976 | |
---|
977 | TrophyIM.setPresence("status", _statusMessage ); |
---|
978 | } |
---|
979 | } |
---|
980 | } |
---|
981 | |
---|
982 | function setPreferences() |
---|
983 | { |
---|
984 | // Element openWindowJabberit |
---|
985 | var elementOpenW = document.getElementById('openWindowJabberit'); |
---|
986 | var value = ''; |
---|
987 | |
---|
988 | for(var i = 0 ; i < elementOpenW.options.length; i++) |
---|
989 | if( elementOpenW.options[i].selected == true) |
---|
990 | { |
---|
991 | value = 'preferences1=openWindowJabberit:' + elementOpenW.options[i].value; |
---|
992 | _preferencesIM[0] = 'openWindowJabberit:' + elementOpenW.options[i].value; |
---|
993 | } |
---|
994 | |
---|
995 | // Element openWindowJabberitPopUp |
---|
996 | value += '&preferences2=openWindowJabberitPopUp:false'; |
---|
997 | _preferencesIM[1] = 'openWindowJabberitPopUp:false'; |
---|
998 | |
---|
999 | // Element flagAwayIM |
---|
1000 | var elementFlagIM = document.getElementById('flagAwayIM'); |
---|
1001 | |
---|
1002 | if( elementFlagIM.value.length > 0 && parseInt(elementFlagIM.value) > 0 ) |
---|
1003 | { |
---|
1004 | _preferencesIM[2] = 'flagAwayIM:' + elementFlagIM.value; |
---|
1005 | value += '&preferences3=flagAwayIM:' + elementFlagIM.value; |
---|
1006 | } |
---|
1007 | else |
---|
1008 | { |
---|
1009 | alert('Informe um valor igual ou maior que 1!'); |
---|
1010 | return false; |
---|
1011 | } |
---|
1012 | |
---|
1013 | // Element showContactsOfflineJabberit |
---|
1014 | var elementShowOffline = document.getElementById('showContactsOfflineJabberit'); |
---|
1015 | |
---|
1016 | for(var i = 0 ; i < elementShowOffline.options.length; i++) |
---|
1017 | if( elementShowOffline.options[i].selected == true) |
---|
1018 | { |
---|
1019 | _preferencesIM[3] = 'showContactsOfflineJabberit:' + elementShowOffline.options[i].value; |
---|
1020 | value += '&preferences4=showContactsOfflineJabberit:' + elementShowOffline.options[i].value; |
---|
1021 | } |
---|
1022 | |
---|
1023 | // Save Preferences |
---|
1024 | conn.go('p.pf.setPreferences', |
---|
1025 | function(data) |
---|
1026 | { |
---|
1027 | if( data == 'false' ) |
---|
1028 | { |
---|
1029 | alert('Erro salvando suas preferências!'); |
---|
1030 | } |
---|
1031 | |
---|
1032 | _winBuild('jabberit_preferences', 'remove'); |
---|
1033 | }, |
---|
1034 | value); |
---|
1035 | } |
---|
1036 | |
---|
1037 | function setPresence() |
---|
1038 | { |
---|
1039 | if( arguments.length > 0 ) |
---|
1040 | { |
---|
1041 | var element = arguments[0]; |
---|
1042 | |
---|
1043 | if( showhidden == null ) |
---|
1044 | showhidden = new ShowHidden(300); |
---|
1045 | |
---|
1046 | var _status = [ |
---|
1047 | ['Afastado', 'away', '<img src="'+path_jabberit+'templates/default/images/away.gif" />'], |
---|
1048 | ['Disponível', 'available', '<img src="'+path_jabberit+'templates/default/images/available.gif" />'], |
---|
1049 | ['Livre p/ Conversa', 'chat', '<img src="'+path_jabberit+'templates/default/images/chat.gif" />'], |
---|
1050 | ['Não Disponível', 'xa', '<img src="'+path_jabberit+'templates/default/images/xa.gif" />'], |
---|
1051 | ['Ocupado', 'dnd', '<img src="'+path_jabberit+'templates/default/images/dnd.gif" />'], |
---|
1052 | ['Desconectado', 'unavailable', '<img src="'+path_jabberit+'templates/default/images/unavailable.gif" />'], |
---|
1053 | ['Mensagem de Status...', 'status', '<img src="'+path_jabberit+'templates/default/images/message_normal.gif" />'], |
---|
1054 | ]; |
---|
1055 | |
---|
1056 | var _itens = ""; |
---|
1057 | |
---|
1058 | for( var i in _status ) |
---|
1059 | { |
---|
1060 | if( typeof( _status[i]) == "object" ) |
---|
1061 | { |
---|
1062 | _itens += '<span style="cursor:pointer;" onclick="TrophyIM.setPresence(\''+_status[i][1]+'\'); loadscript.setStatusJabber(\''+_status[i][0]+'\',\''+_status[i][1]+'\');">'; |
---|
1063 | _itens += _status[i][2]+ "<span style='margin:3px;'>" + _status[i][0] + "</span></span><br/>"; |
---|
1064 | } |
---|
1065 | } |
---|
1066 | |
---|
1067 | var _statusItens = document.createElement("div"); |
---|
1068 | _statusItens.style.marginTop = "65px"; |
---|
1069 | _statusItens.style.marginLeft = "67px"; |
---|
1070 | _statusItens.className = "x-menu"; |
---|
1071 | _statusItens.style.zIndex = '99999'; |
---|
1072 | _statusItens.innerHTML = _itens; |
---|
1073 | _statusItens.onclick = function(){ showhidden.hiddenObject(false); }; |
---|
1074 | |
---|
1075 | showhidden.action('onmouseover', 'onmouseout', _statusItens); |
---|
1076 | |
---|
1077 | element.parentNode.onmouseout = function(){ showhidden.hiddenObject(false); }; |
---|
1078 | element.parentNode.onmouseover = function(){ showhidden.hiddenObject(true); }; |
---|
1079 | element.parentNode.appendChild(_statusItens); |
---|
1080 | } |
---|
1081 | } |
---|
1082 | |
---|
1083 | function setSelectEditable(element, top, left ) |
---|
1084 | { |
---|
1085 | if( getElement('selectBox0') == null ) |
---|
1086 | selectEditable.create(element, top, left ); |
---|
1087 | } |
---|
1088 | |
---|
1089 | function setStatusJabber() |
---|
1090 | { |
---|
1091 | if( arguments.length > 0 ) |
---|
1092 | { |
---|
1093 | if( arguments[1] != 'status' ) |
---|
1094 | { |
---|
1095 | var _text = arguments[0]; |
---|
1096 | var _img = statusUserIM = arguments[1]; |
---|
1097 | |
---|
1098 | getElement('statusJabberText').innerHTML = _text; |
---|
1099 | getElement('statusJabberImg').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif')"; |
---|
1100 | getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat"; |
---|
1101 | } |
---|
1102 | } |
---|
1103 | } |
---|
1104 | |
---|
1105 | function _setUserCurrent( _user ) |
---|
1106 | { |
---|
1107 | userCurrent = |
---|
1108 | { |
---|
1109 | 'jid' : _user.jid.substring(11, _user.jid.length), |
---|
1110 | 'password' : _user.password.substring(11, _user.password.length) |
---|
1111 | } |
---|
1112 | } |
---|
1113 | |
---|
1114 | function setUserCurrent() |
---|
1115 | { |
---|
1116 | if( getUserCurrent() == null ) |
---|
1117 | { |
---|
1118 | conn.go('p.ff.data_0', |
---|
1119 | function(_User) |
---|
1120 | { |
---|
1121 | conn.go('p.ff.data_1', |
---|
1122 | function(_pass) |
---|
1123 | { |
---|
1124 | _setUserCurrent( { jid : _User, password : _pass } ); |
---|
1125 | }); |
---|
1126 | }); |
---|
1127 | } |
---|
1128 | } |
---|
1129 | |
---|
1130 | var _stylesheets = [ ]; |
---|
1131 | var _links = document.getElementsByTagName( 'link' ); |
---|
1132 | |
---|
1133 | for ( var i = 0; i < _links.length; i++ ) |
---|
1134 | if ( _links.item( i ).type && _links.item( i ).type.toLowerCase( ) == 'text/css' ) |
---|
1135 | _stylesheets[ _stylesheets.length ] = _links.item( i ); |
---|
1136 | |
---|
1137 | function windowPOPUP() |
---|
1138 | { |
---|
1139 | var _id = arguments[0]; |
---|
1140 | var _win_name = _id.replace( /\W/g, '' ); |
---|
1141 | |
---|
1142 | if ( arguments.length == 1 ) |
---|
1143 | { |
---|
1144 | if ( windowPopUp[_win_name] ) |
---|
1145 | return true; |
---|
1146 | else |
---|
1147 | return false; |
---|
1148 | } |
---|
1149 | |
---|
1150 | if( arguments.length == 2 ) |
---|
1151 | { |
---|
1152 | if( !windowPopUp[_win_name] ) |
---|
1153 | { |
---|
1154 | windowPopUp[_win_name] = window.open( '', _win_name + '__popup', 'height=355,width=380,top=50,left=50,toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,titlebar=no'); |
---|
1155 | var tmp = windowPopUp[_win_name].document; |
---|
1156 | |
---|
1157 | tmp.write('<html><head>'); |
---|
1158 | tmp.write('</head><body>'); |
---|
1159 | tmp.write('</body></html>'); |
---|
1160 | tmp.close(); |
---|
1161 | |
---|
1162 | for ( var i = 0; i < _stylesheets.length; i++ ) |
---|
1163 | tmp.documentElement.getElementsByTagName( 'head' ).item(0).appendChild( _stylesheets[ i ].cloneNode( true ) ); |
---|
1164 | |
---|
1165 | var divPOP = getElement( _id + "__popUp" ); |
---|
1166 | divPOP.style.background = "url('"+path_jabberit+"templates/default/images/icon_down.png') no-repeat"; |
---|
1167 | divPOP.innerHTML = "PopIn"; |
---|
1168 | |
---|
1169 | function _close( ) |
---|
1170 | { |
---|
1171 | windowPopUp[_win_name].close(); |
---|
1172 | configEvents( divPOP ,'onclick', _close, true ); |
---|
1173 | } |
---|
1174 | |
---|
1175 | configEvents( divPOP ,'onclick', _close ); |
---|
1176 | |
---|
1177 | var _content = tmp.documentElement.getElementsByTagName( 'body' ).item(0).appendChild( getElement(_id + '__chatBox' ).parentNode ); |
---|
1178 | |
---|
1179 | _content.firstChild.scrollTop = _content.firstChild.scrollHeight; |
---|
1180 | |
---|
1181 | configEvents( windowPopUp[_win_name] ,'onbeforeunload', function() |
---|
1182 | { |
---|
1183 | delete windowPopUp[_win_name]; |
---|
1184 | divPOP.style.background = "url('"+path_jabberit+"templates/default/images/icon_up.png') no-repeat"; |
---|
1185 | divPOP.innerHTML = "PopUp"; |
---|
1186 | divPOP.onclick = function(){ loadscript.windowPOPUP( _id , true ); }; |
---|
1187 | _winBuild( 'window_chat_area_' + _id, "display" ).content( true ); |
---|
1188 | }); |
---|
1189 | |
---|
1190 | _winBuild( 'window_chat_area_' + _id, 'hidden' ); |
---|
1191 | } |
---|
1192 | } |
---|
1193 | } |
---|
1194 | |
---|
1195 | function windowNotificationNewUsers() |
---|
1196 | { |
---|
1197 | var _users = Xtools.xml('notification_new_users'); |
---|
1198 | |
---|
1199 | for( var user in TrophyIM.rosterObj.roster ) |
---|
1200 | { |
---|
1201 | if ( TrophyIM.rosterObj.roster[ user ].constructor == Function ) |
---|
1202 | continue; |
---|
1203 | |
---|
1204 | if( TrophyIM.rosterObj.roster[ user ].contact.jid != Base64.decode( loadscript.getUserCurrent().jid) ) |
---|
1205 | { |
---|
1206 | var _subscription = TrophyIM.rosterObj.roster[user].contact.subscription; |
---|
1207 | |
---|
1208 | if ( _subscription == 'to' || _subscription == 'not-in-roster' ) |
---|
1209 | { |
---|
1210 | var _user = _users.createElement('user'); |
---|
1211 | var _jid = _users.createElement('jid'); |
---|
1212 | var _status = _users.createElement('status'); |
---|
1213 | _jid.appendChild( _users.createTextNode(TrophyIM.rosterObj.roster[user].contact.jid) ); |
---|
1214 | _status.appendChild( _users.createTextNode( _subscription ) ); |
---|
1215 | _user.appendChild( _jid ); |
---|
1216 | _user.appendChild( _status ); |
---|
1217 | _users.documentElement.appendChild( _user ); |
---|
1218 | } |
---|
1219 | } |
---|
1220 | } |
---|
1221 | |
---|
1222 | var paramsNotification = |
---|
1223 | { |
---|
1224 | 'lang_1' : "Notificação", |
---|
1225 | 'lang_2' : "O(s) usuário(s) abaixo pedem sua autorização.", |
---|
1226 | 'lang_3' : "Autorizar", |
---|
1227 | 'lang_4' : "Remover" |
---|
1228 | }; |
---|
1229 | |
---|
1230 | var winNotification = |
---|
1231 | { |
---|
1232 | id_window : "window_notification_new_users", |
---|
1233 | width : 400, |
---|
1234 | height : 300, |
---|
1235 | top : 100, |
---|
1236 | left : 400, |
---|
1237 | draggable : true, |
---|
1238 | visible : "display", |
---|
1239 | resizable : true, |
---|
1240 | zindex : zIndex++, |
---|
1241 | title : "Expresso Messenger - Notificação de Novos Usuários", |
---|
1242 | closeAction : "remove", |
---|
1243 | content : Xtools.parse( _users , "notificationNewUsers.xsl", paramsNotification ) |
---|
1244 | }; |
---|
1245 | |
---|
1246 | _winBuild( winNotification ); |
---|
1247 | } |
---|
1248 | |
---|
1249 | function createChatRooms() |
---|
1250 | { |
---|
1251 | _winBuild("window_List_Rooms_jabberit_messenger","remove"); |
---|
1252 | |
---|
1253 | var paramCreateChatRoom = |
---|
1254 | { |
---|
1255 | 'lang_nameChatRoom' : "Nome da Sala", |
---|
1256 | 'lang_nickName' : "Apelido" |
---|
1257 | }; |
---|
1258 | |
---|
1259 | var winCreateChatRooms = |
---|
1260 | { |
---|
1261 | id_window : "window_create_chat_rooms", |
---|
1262 | width : 360, |
---|
1263 | height : 160, |
---|
1264 | top : 100, |
---|
1265 | left : 410, |
---|
1266 | draggable : true, |
---|
1267 | visible : "display", |
---|
1268 | resizable : true, |
---|
1269 | zindex : loadscript.getZIndex(), |
---|
1270 | title : "Expresso Messenger - Criar Sala de Bate Papo", |
---|
1271 | closeAction : "remove", |
---|
1272 | content : Xtools.parse( Xtools.xml("create_chat_room"), "createChatRoom.xsl", paramCreateChatRoom ) |
---|
1273 | }; |
---|
1274 | |
---|
1275 | _winBuild( winCreateChatRooms ); |
---|
1276 | |
---|
1277 | var _pButtons = |
---|
1278 | { |
---|
1279 | 'lang1' : 'Ingressar', |
---|
1280 | 'lang2' : 'Fechar', |
---|
1281 | 'onclickClose' : '_winBuild("window_create_chat_rooms","remove");', |
---|
1282 | 'onclickSubmit' : 'TrophyIM.createChatRooms(); _winBuild("window_create_chat_rooms","remove");' |
---|
1283 | }; |
---|
1284 | |
---|
1285 | // Add Buttons |
---|
1286 | document.getElementById('buttons_createChatRoom').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons); |
---|
1287 | |
---|
1288 | } |
---|
1289 | |
---|
1290 | function listRooms( element ) |
---|
1291 | { |
---|
1292 | element = element.getElementsByTagName( 'item' ); |
---|
1293 | |
---|
1294 | var _roomsCount = 0; |
---|
1295 | var _xml = Xtools.xml('listRooms'); |
---|
1296 | var _listRooms = _xml.documentElement; |
---|
1297 | |
---|
1298 | var show = function( ) |
---|
1299 | { |
---|
1300 | if ( _roomsCount != element.length ) |
---|
1301 | return false; |
---|
1302 | |
---|
1303 | var paramsListRooms = |
---|
1304 | { |
---|
1305 | "path_jabberit" : path_jabberit |
---|
1306 | }; |
---|
1307 | |
---|
1308 | var winListRooms = |
---|
1309 | { |
---|
1310 | id_window : "window_List_Rooms_jabberit_messenger", |
---|
1311 | width : 450, |
---|
1312 | height : 300, |
---|
1313 | top : 100, |
---|
1314 | left : 400, |
---|
1315 | draggable : true, |
---|
1316 | visible : "display", |
---|
1317 | resizable : true, |
---|
1318 | zindex : loadscript.getZIndex(), |
---|
1319 | title : "Expresso Messenger - Salas de Bate Papo", |
---|
1320 | closeAction : "remove", |
---|
1321 | content : Xtools.parse( _xml, "listRooms.xsl", paramsListRooms ) |
---|
1322 | }; |
---|
1323 | |
---|
1324 | _winBuild( winListRooms ); |
---|
1325 | |
---|
1326 | var _pButtons = |
---|
1327 | { |
---|
1328 | 'lang1' : 'Criar Nova Sala', |
---|
1329 | 'lang2' : 'Fechar', |
---|
1330 | 'onclickClose' : '_winBuild("window_List_Rooms_jabberit_messenger","remove");', |
---|
1331 | 'onclickSubmit' : 'loadscript.createChatRooms();' |
---|
1332 | }; |
---|
1333 | |
---|
1334 | // Add Buttons |
---|
1335 | document.getElementById('buttons_addChatRoom').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons); |
---|
1336 | }; |
---|
1337 | |
---|
1338 | var _add_room = function( _room ) |
---|
1339 | { |
---|
1340 | _roomsCount++; |
---|
1341 | |
---|
1342 | var _ROOM = _xml.createElement('room') |
---|
1343 | var _JIDROOM = _xml.createElement('jidRoom') |
---|
1344 | var nameRoom = _room.getAttribute( 'from' ); |
---|
1345 | |
---|
1346 | _ROOM.setAttribute( 'nameRoom', unescape((nameRoom.substring(0, nameRoom.indexOf("@"))).toUpperCase()) ); |
---|
1347 | _JIDROOM.appendChild( _xml.createTextNode(nameRoom) ); |
---|
1348 | _ROOM.appendChild( _JIDROOM ); |
---|
1349 | |
---|
1350 | // Get fields elements; |
---|
1351 | var _fields = _room.getElementsByTagName( 'field' ); |
---|
1352 | |
---|
1353 | for ( var f = 0; f < _fields.length; f++ ) |
---|
1354 | { |
---|
1355 | if ( _fields[ f ].getAttribute( 'var' ) ) |
---|
1356 | { |
---|
1357 | if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_description' ) |
---|
1358 | { |
---|
1359 | var _description = _xml.createElement("description"); |
---|
1360 | _description.appendChild( _xml.createTextNode( _fields[ f ].firstChild.firstChild.nodeValue ) ); |
---|
1361 | _ROOM.appendChild( _description ); |
---|
1362 | } |
---|
1363 | |
---|
1364 | if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_occupants' ) |
---|
1365 | { |
---|
1366 | var _occupants = _xml.createElement("occupants") |
---|
1367 | _occupants.appendChild( _xml.createTextNode( _fields[ f ].firstChild.firstChild.nodeValue) ); |
---|
1368 | _ROOM.appendChild( _occupants ); |
---|
1369 | } |
---|
1370 | } |
---|
1371 | } |
---|
1372 | |
---|
1373 | // Get feature elements; |
---|
1374 | var _feature = _room.getElementsByTagName( 'feature' ); |
---|
1375 | |
---|
1376 | for( var f = 0 ; f < _feature.length; f++ ) |
---|
1377 | { |
---|
1378 | if ( _feature[ f ].getAttribute( 'var' ) ) |
---|
1379 | { |
---|
1380 | if( _feature[ f ].getAttribute( 'var' ) == 'muc_unsecured' ) |
---|
1381 | { |
---|
1382 | var _password = _xml.createElement("password"); |
---|
1383 | _password.appendChild( _xml.createTextNode("false") ); |
---|
1384 | _ROOM.appendChild( _password ); |
---|
1385 | } |
---|
1386 | else if( _feature[ f ].getAttribute( 'var' ) == 'muc_passwordprotected' ) |
---|
1387 | { |
---|
1388 | var _password = _xml.createElement("password"); |
---|
1389 | _password.appendChild( _xml.createTextNode("true") ); |
---|
1390 | _ROOM.appendChild( _password ); |
---|
1391 | } |
---|
1392 | } |
---|
1393 | } |
---|
1394 | |
---|
1395 | _listRooms.appendChild( _ROOM ); |
---|
1396 | |
---|
1397 | show( ); |
---|
1398 | }; |
---|
1399 | |
---|
1400 | var _get_room_info = function( _room ) |
---|
1401 | { |
---|
1402 | TrophyIM.connection.sendIQ( |
---|
1403 | $iq( { "to" : _room, "type" : "get" } ).c( "query",{xmlns: Strophe.NS.DISCO_INFO } ), |
---|
1404 | _add_room, |
---|
1405 | function( a ) |
---|
1406 | { |
---|
1407 | _roomsCount++; |
---|
1408 | |
---|
1409 | show( ); |
---|
1410 | |
---|
1411 | }, 500 ); |
---|
1412 | }; |
---|
1413 | |
---|
1414 | if( element.length > 0 ) |
---|
1415 | { |
---|
1416 | for ( var i = 0; i < element.length; i++ ) |
---|
1417 | { |
---|
1418 | _get_room_info( element[ i ].getAttribute( 'jid' ) ); |
---|
1419 | } |
---|
1420 | } |
---|
1421 | else |
---|
1422 | { |
---|
1423 | show(); |
---|
1424 | } |
---|
1425 | } |
---|
1426 | |
---|
1427 | function getListRooms() |
---|
1428 | { |
---|
1429 | TrophyIM.getListRooms(); |
---|
1430 | } |
---|
1431 | |
---|
1432 | function joinRoom( jidRoom, nameRoom ) |
---|
1433 | { |
---|
1434 | var append_nick = function( room, nick ) |
---|
1435 | { |
---|
1436 | var room_nick = room; |
---|
1437 | |
---|
1438 | if ( nick ) |
---|
1439 | { |
---|
1440 | room_nick += "/" + nick; |
---|
1441 | } |
---|
1442 | |
---|
1443 | return room_nick; |
---|
1444 | } |
---|
1445 | |
---|
1446 | if( document.getElementById( 'window_chat_room_' + jidRoom + '__main' ) != null ) |
---|
1447 | { |
---|
1448 | _winBuild('window_chat_room_' + jidRoom, 'display'); |
---|
1449 | } |
---|
1450 | else |
---|
1451 | { |
---|
1452 | var nickName = Base64.decode( loadscript.getUserCurrent().jid ); |
---|
1453 | nickName = nickName.substring(0, nickName.indexOf('@')); |
---|
1454 | |
---|
1455 | var _prompt = prompt("Deseja informar um Apelido ?", nickName ); |
---|
1456 | |
---|
1457 | if( _prompt ) |
---|
1458 | { |
---|
1459 | _prompt = _prompt.replace(/^\s+|\s+$|^\n|\n$/g,""); |
---|
1460 | |
---|
1461 | var room_nick = append_nick( jidRoom, nickName ); |
---|
1462 | |
---|
1463 | if( _prompt && _prompt != "" ) |
---|
1464 | { |
---|
1465 | var room_nick = append_nick( jidRoom, _prompt ); |
---|
1466 | } |
---|
1467 | |
---|
1468 | TrophyIM.makeChatRoom( jidRoom , nameRoom ); |
---|
1469 | |
---|
1470 | TrophyIM.activeChatRoom.name[ TrophyIM.activeChatRoom.name.length ] = room_nick; |
---|
1471 | |
---|
1472 | TrophyIM.joinChatRoom( room_nick); |
---|
1473 | } |
---|
1474 | } |
---|
1475 | |
---|
1476 | _winBuild("window_List_Rooms_jabberit_messenger","remove"); |
---|
1477 | } |
---|
1478 | |
---|
1479 | function loadIM() |
---|
1480 | { |
---|
1481 | if( arguments.length > 0 ) |
---|
1482 | { |
---|
1483 | var files = [ |
---|
1484 | path_jabberit + 'templates/default/css/button.css', |
---|
1485 | path_jabberit + 'templates/default/css/common.css', |
---|
1486 | path_jabberit + 'templates/default/css/selectEditableStyle.css', |
---|
1487 | path_jabberit + 'templates/default/css/' + theme_jabberit |
---|
1488 | ]; |
---|
1489 | // FullName |
---|
1490 | fullName = arguments[0]; |
---|
1491 | |
---|
1492 | // Preferences |
---|
1493 | _preferencesIM = arguments[1].split(";"); |
---|
1494 | |
---|
1495 | if( !_preferencesIM[3] ) _preferencesIM[3] = "showContactsOfflineJabberit:true"; |
---|
1496 | |
---|
1497 | loadScripts(files); |
---|
1498 | |
---|
1499 | setTimeout(function() |
---|
1500 | { |
---|
1501 | // Object Xtools |
---|
1502 | if( Xtools == null ) |
---|
1503 | Xtools = new xtools(path_jabberit); |
---|
1504 | |
---|
1505 | // Object Conector |
---|
1506 | if( conn == null ) |
---|
1507 | conn = new AjaxConnector(path_jabberit); |
---|
1508 | |
---|
1509 | // Object Add User |
---|
1510 | if( addUser == null ) |
---|
1511 | addUser = new addUserIM(Xtools, conn); |
---|
1512 | |
---|
1513 | |
---|
1514 | // Object SelectEditable |
---|
1515 | if( selectEditable == null ) |
---|
1516 | selectEditable = new SelectEditable(); |
---|
1517 | |
---|
1518 | // Add Jabber in StatusBar; |
---|
1519 | addIcon(); |
---|
1520 | |
---|
1521 | // Auto Connect |
---|
1522 | setTimeout(function() |
---|
1523 | { |
---|
1524 | if( _preferencesIM[0] === 'openWindowJabberit:true' ) |
---|
1525 | { |
---|
1526 | if( SnifferBrowser.isCompatible('ie8','firefox3','epiphany2','iceweasel3') ) |
---|
1527 | TrophyIM.load(); |
---|
1528 | } |
---|
1529 | |
---|
1530 | },1500); |
---|
1531 | |
---|
1532 | // Auto Status |
---|
1533 | autoStatus(); |
---|
1534 | configEvents( document, 'onmousemove', autoStatus ); |
---|
1535 | configEvents( document, 'onkeypress', autoStatus ); |
---|
1536 | |
---|
1537 | }, 2000); |
---|
1538 | } |
---|
1539 | } |
---|
1540 | |
---|
1541 | loadIM.prototype.adIcon = addIcon; |
---|
1542 | loadIM.prototype.actionButton = actionButton; |
---|
1543 | loadIM.prototype.addContact = addContact; |
---|
1544 | loadIM.prototype.addNewUser = addNewUser; |
---|
1545 | loadIM.prototype.clrAllContacts = clrAllContacts; |
---|
1546 | loadIM.prototype.configEvents = configEvents; |
---|
1547 | loadIM.prototype.createChatRooms = createChatRooms; |
---|
1548 | loadIM.prototype.disabledNotificationNewUsers = disabledNotificationNewUsers; |
---|
1549 | loadIM.prototype.enabledNotificationNewUsers = enabledNotificationNewUsers; |
---|
1550 | loadIM.prototype.getListRooms = getListRooms; |
---|
1551 | loadIM.prototype.getIsIE = getIsIE; |
---|
1552 | loadIM.prototype.getPhotoUser = getPhotoUser; |
---|
1553 | loadIM.prototype.getSmiles = getSmiles; |
---|
1554 | loadIM.prototype.getStatusUserIM = getStatusUserIM; |
---|
1555 | loadIM.prototype.getStatusMessage = getStatusMessage; |
---|
1556 | loadIM.prototype.getShowContactsOffline = getShowContactsOffline; |
---|
1557 | loadIM.prototype.getUserCurrent = getUserCurrent; |
---|
1558 | loadIM.prototype.getZIndex = getZindex; |
---|
1559 | loadIM.prototype.groupsHidden = groupsHidden; |
---|
1560 | loadIM.prototype.groupsVisible = groupsVisible; |
---|
1561 | loadIM.prototype.joinRoom = joinRoom; |
---|
1562 | loadIM.prototype.keyPressSearch = keyPressSearch; |
---|
1563 | loadIM.prototype.listRooms = listRooms; |
---|
1564 | loadIM.prototype.loginPage = loginPage; |
---|
1565 | loadIM.prototype.notification = notificationNewMessage; |
---|
1566 | loadIM.prototype.parse = parse; |
---|
1567 | loadIM.prototype.preferences = preferences; |
---|
1568 | loadIM.prototype.searchUser = searchUser |
---|
1569 | loadIM.prototype.setAutorization = setAutorization; |
---|
1570 | loadIM.prototype.setMessageStatus = setMessageStatus; |
---|
1571 | loadIM.prototype.setPreferences = setPreferences; |
---|
1572 | loadIM.prototype.setPresence = setPresence; |
---|
1573 | loadIM.prototype.setStatusJabber = setStatusJabber; |
---|
1574 | loadIM.prototype.setSelectEditable = setSelectEditable; |
---|
1575 | loadIM.prototype.setUserCurrent = setUserCurrent; |
---|
1576 | loadIM.prototype.removeContact = removeContact; |
---|
1577 | loadIM.prototype.removeElement = removeElement; |
---|
1578 | loadIM.prototype.removeGroup = removeGroup; |
---|
1579 | loadIM.prototype.renameContact = renameContact; |
---|
1580 | loadIM.prototype.renameGroup = renameGroup; |
---|
1581 | loadIM.prototype.rosterDiv = rosterDiv; |
---|
1582 | loadIM.prototype.windowNotificationNewUsers = windowNotificationNewUsers; |
---|
1583 | loadIM.prototype.windowPOPUP = windowPOPUP; |
---|
1584 | |
---|
1585 | window.LoadIM = loadIM; |
---|
1586 | |
---|
1587 | // Necessário para não ocasionar problema no ExpressoMail |
---|
1588 | // quando os itens abaixo não são criados pelo próprio ExpressoMail |
---|
1589 | if( SnifferBrowser.isCompatible('is_ie') ) |
---|
1590 | { |
---|
1591 | configEvents( window, 'onload', function( ) |
---|
1592 | { |
---|
1593 | if ( ! document.getElementById( 'cc_msg_err_serialize_data_unknown' ) ) |
---|
1594 | { |
---|
1595 | var fix = document.createElement('input'); |
---|
1596 | fix.type = 'hidden'; |
---|
1597 | fix.id = 'cc_msg_err_serialize_data_unknown'; |
---|
1598 | |
---|
1599 | document.appendChild( fix ); |
---|
1600 | } |
---|
1601 | if ( ! window.showMessage ) |
---|
1602 | window.showMessage = function(){}; |
---|
1603 | }); |
---|
1604 | } |
---|
1605 | |
---|
1606 | })(); |
---|