(function()
{
var _autoStatus;
var _autoStatusTime = 60000; // 1 minuto
var addUser = null;
var conn = null;
var fullName = "";
var path = "";
var _preferencesIM = "";
var selectEditable = null;
var showhidden = null;
var _statusMessage = "";
var timeoutId = null;
var userCurrent = null;
var Xtools = null;
var zIndex = 9001;
// Images
var add_user = new Image();
add_user.src = path_jabberit + 'templates/default/images/adduser_azul.png';
var arrow_down = new Image();
arrow_down.src = path_jabberit + 'templates/default/images/arrow_down.gif';
var arrow_right = new Image();
arrow_right.src = path_jabberit + 'templates/default/images/arrow_right.gif';
function actionButton()
{
if( arguments.length > 0 )
{
var e = arguments[0];
var _element = ( e.target ) ? e.target : e.srcElement;
var jid = arguments[1];
var index = arguments[2];
var coord = null;
if ( !e )
e = window.event;
var _X = e.clientX + document.body.scrollLeft - document.body.clientLeft;
var _Y = e.clientY + document.body.scrollTop - document.body.clientTop;
coord = { X : _X, Y : _Y };
var _onContextMenu = function()
{
return false;
};
window.document.oncontextmenu = _onContextMenu;
if( e.button )
{
if( e.button > 1 )
optionsItensContact( jid, index, coord );
else
TrophyIM.rosterClick(jid);
}
else if( e.which )
{
if( e.which > 1 )
optionsItensContact( jid, index, coord );
else
if( e.target.id )
TrophyIM.rosterClick(jid);
}
}
}
function addContact()
{
if( arguments.length > 0 )
addUser.add();
else
addUser.show();
}
function addIcon()
{
var div_write_msg = ( getElement('em_div_write_msg') != null ) ? getElement('em_div_write_msg') : null ;
var StatusBar = ( getElement('divStatusBar') != null ) ? getElement('divStatusBar') : null ;
var StatusBarIM = ( getElement('JabberMessenger') != null ) ? getElement('JabberMessenger') : null;
/**************************************************************************
*
* Quando estiver habilitada a opção fora de escritório nos filtros.
*
*/
if( ( div_write_msg && StatusBarIM ) != null )
{
div_write_msg.parentNode.insertBefore(StatusBarIM, div_write_msg);
StatusBarIM.style.paddingLeft = '33px';
return;
}
/**************************************************************************/
if ( !StatusBarIM )
{
StatusBarIM = document.createElement('div');
StatusBarIM.setAttribute('id', 'JabberMessenger');
}
if( StatusBar )
{
StatusBar.style.paddingLeft = '33px';
var _div = document.createElement('div');
_div.appendChild(StatusBar.parentNode.removeChild(StatusBar.previousSibling));
StatusBar.parentNode.insertBefore( _div, StatusBar);
var _fastMenu = top.document.createElement('div');
_fastMenu.setAttribute('id', 'fast_menu_jabber_expresso');
_fastMenu.style.background = 'no-repeat';
_fastMenu.style.backgroundImage = 'url(' + arrow_down.src + ')';
_fastMenu.style.float = 'left';
_fastMenu.style.height = '15px';
_fastMenu.style.left = '7px';
_fastMenu.style.margin = '8 0 0 10px';
_fastMenu.style.padding = '0px';
_fastMenu.style.position = 'absolute';
_fastMenu.style.width = '15px';
_fastMenu.style.cursor = 'pointer';
StatusBarIM.insertBefore( _fastMenu, StatusBarIM.firstChild );
// Add event onclick element _fastMenu
configEvents( _fastMenu, 'onclick', function(){ fastMenu(_fastMenu); });
var _statusJabber = top.document.createElement('div');
_statusJabber.setAttribute('id','status_jabber_expresso');
_statusJabber.style.background = 'no-repeat';
_statusJabber.style.backgroundImage = 'url(' + add_user.src +')';
_statusJabber.style.float = 'left';
_statusJabber.style.height = '18px';
_statusJabber.style.left = '19px';
_statusJabber.style.margin = '0 0 0 10px';
_statusJabber.style.padding = '0px';
_statusJabber.style.position = 'absolute';
_statusJabber.style.width = '18px';
_statusJabber.style.cursor = 'pointer';
_statusJabber.style.zindex = '999999';
StatusBarIM.insertBefore( _statusJabber, StatusBarIM.firstChild );
StatusBar.insertBefore( StatusBarIM, StatusBar.firstChild );
// Add event onclick element _statusJabber
configEvents( _statusJabber, 'onclick', function(){ TrophyIM.load();});
}
}
function autoStatus()
{
var _div_status = ( getElement('status_jabber_expresso') != null ) ? getElement('status_jabber_expresso') : null;
if ( _autoStatus )
clearTimeout(_autoStatus);
if ( _div_status != null )
{
var _status = _div_status.style.backgroundImage;
_status = _status.substr(_status.lastIndexOf('/') + 1);
_status = _status.substr(0, _status.indexOf('.'));
if( _status == "xa" )
{
if( getStatusMessage() != "")
TrophyIM.setPresence("available", getStatusMessage());
else
TrophyIM.setPresence("available");
loadscript.setStatusJabber("Disponível","available");
}
}
var TimeStatus = _preferencesIM[2].split(':');
if( TimeStatus[1] )
_autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(TimeStatus[1]) * _autoStatusTime );
else
_autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(_autoStatusTime));
}
function autoStatusHandler()
{
var _div_status = ( getElement('status_jabber_expresso') != null ) ? getElement('status_jabber_expresso') : null;
if ( _div_status != null )
{
var _status = _div_status.style.backgroundImage;
_status = _status.substr(_status.lastIndexOf('/') + 1);
_status = _status.substr(0, _status.indexOf('.'));
if( _status == "available" )
{
if(getStatusMessage() != "")
TrophyIM.setPresence("xa", getStatusMessage());
else
TrophyIM.setPresence("xa");
loadscript.setStatusJabber("Não Disponível","xa");
}
}
}
function clrAllContacts()
{
getElement("JabberIMRoster").innerHTML = "";
}
function configEvents(pObj, pEvent, pHandler)
{
if ( typeof pObj == 'object' )
{
if ( pEvent.substring(0, 2) == 'on' )
pEvent = pEvent.substring(2, pEvent.length);
if ( pObj.addEventListener )
pObj.addEventListener(pEvent, pHandler, false);
else if ( pObj.attachEvent )
pObj.attachEvent('on' + pEvent, pHandler);
}
}
function fastMenu()
{
if( arguments.length > 0 )
{
var element = arguments[0];
if( showhidden == null )
showhidden = new ShowHidden(300);
var _options = [
['Adicionar Contato', 'loadscript.addContact();' ],
['Ajuda', 'alert("2")' ],
['Preferências', 'loadscript.preferences();'],
];
var _itens = "";
for( var i in _options )
{
if( _options[i].constructor == Function )
continue;
_itens += '';
_itens += '';
_itens += _options[i][0] + '
';
}
var _optionsItens = document.createElement("div");
_optionsItens.id = "fastMenu_Jabber";
_optionsItens.style.marginTop = "19px";
_optionsItens.style.marginLeft = "-8px";
_optionsItens.className = "x-menu";
_optionsItens.style.zIndex = '999999';
_optionsItens.innerHTML = _itens;
_optionsItens.onclick = function(){ showhidden.hiddenObject(false); };
_optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); };
_optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); };
showhidden.action('onmouseover', 'onmouseout', _optionsItens);
element.parentNode.appendChild( _optionsItens );
}
}
function getElement( elementId )
{
return document.getElementById( elementId );
}
function getPhotoUser( jid )
{
var _divPhoto = getElement( jid + '__photo' );
if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 )
{
var _imgUser = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date );
_imgUser += '&photo_ldap=' + jid;
_divPhoto.style.backgroundImage = 'url(' + _imgUser + ')';
}
}
function getStatusMessage()
{
return _statusMessage;
}
function getShowContactsOffline()
{
if( _preferencesIM[3] )
{
var showOffline = _preferencesIM[3].split(":");
if( showOffline[1] === "true")
return true;
else
return false;
}
return true;
}
function getUserCurrent()
{
return userCurrent;
}
function getZindex()
{
return zIndex++;
}
function groupsHidden()
{
if( arguments.length > 0 )
{
var _element = arguments[0];
_element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_right.gif') no-repeat center left";
_element.onclick = function(){ groupsVisible(_element);};
// Hidden all
var _elementNext = _element.nextSibling;
while( _elementNext )
{
if( _elementNext.nodeType == 1 )
_elementNext.style.display = "none";
_elementNext = _elementNext.nextSibling;
}
}
}
function groupsVisible()
{
if( arguments.length > 0 )
{
var _element = arguments[0];
_element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_down.gif') no-repeat center left";
_element.onclick = function(){ groupsHidden(_element);};
// Display all
var _elementNext = _element.nextSibling;
while( _elementNext )
{
if( _elementNext.nodeType == 1 && _elementNext.nodeName.toLowerCase() == "div")
{
var is_off = _elementNext.style.backgroundImage.indexOf("unavailable");
if( is_off > 0 && !getShowContactsOffline())
_elementNext.style.display = "none";
else
_elementNext.style.display = "block";
}
_elementNext = _elementNext.nextSibling;
}
}
}
function keyPressSearch()
{
if( arguments.length > 0 )
{
var ev = arguments[0];
var element = arguments[1];
if ( ev.keyCode == 13 )
if( element.value.length >= 3 )
searchUser( element.value );
else
alert('Your search argument must be longer than 3 characters.');
}
}
function loginPage()
{
var winLoginPage =
{
id_window : "window_login_page",
width : 260,
height : 150,
top : 100,
left : 400,
draggable : true,
visible : "display",
resizable : true,
zindex : zIndex++,
title : "Expresso Messenger - Login",
closeAction : "remove",
content : Xtools.parse(Xtools.xml("login_page"), "loginPage.xsl")
};
_winBuild( winLoginPage );
}
function loadScripts(pFiles)
{
// Load JavaScript
var loadJavaScript = function(pJs)
{
var newScript = document.createElement("script");
newScript.setAttribute("type", "text/javascript");
newScript.setAttribute("src", pJs );
return newScript;
};
// Load CSS
var loadStyleSheet = function(pCss)
{
var newStyle = document.createElement("link");
newStyle.setAttribute("rel", "stylesheet");
newStyle.setAttribute("type", "text/css");
newStyle.setAttribute("href", pCss);
return newStyle;
};
for(var i = 0; i < pFiles.length; i++)
{
if( pFiles[i].indexOf(".js") > -1 )
document.getElementsByTagName("head")[0].appendChild(loadJavaScript(pFiles[i]));
if( pFiles[i].indexOf(".css") > -1 )
document.getElementsByTagName("head")[0].appendChild(loadStyleSheet(pFiles[i]));
}
}
function notificationNewMessage()
{
var oldTitle = document.title;
var newTitle = "## NOVA MENSAGEM ##";
var idWindow = arguments[1];
if( timeoutId == null )
{
timeoutId = setInterval(function()
{
document.title = ( document.title == newTitle ) ? oldTitle : newTitle;
}, 1000);
configEvents( window.document, 'onclick', function()
{
clearInterval(timeoutId);
document.title = oldTitle;
timeoutId = null;
});
configEvents( window.document, 'onkeypress', function()
{
clearInterval(timeoutId);
document.title = oldTitle;
timeoutId = null;
});
}
}
function optionsItensContact()
{
if( arguments.length > 0 )
{
var jid = arguments[0];
var index = arguments[1];
var coord = arguments[2];
var element = getElement('itenContact_' + jid + '_' + index );
var action = ( element.getAttribute("subscription") === "not-in-roster" ) ? "Adicionar" : "Autorizar";
if( showhidden == null )
showhidden = new ShowHidden(300);
var _options = [
[ action , 'loadscript.setAutorization(\''+jid+'\',\''+index+'\')'],
['Remover' , 'loadscript.removeContact(\''+jid+'\',\''+index+'\')'],
['Renomear' , 'loadscript.renameContact(\''+jid+'\',\''+index+'\')'],
['Trocar grupo' , 'loadscript.renameGroup(\''+jid+'\',\''+index+'\')']
];
var _itens = "";
for( var i in _options )
{
if( typeof(_options[i]) == "object")
{
_itens += '';
_itens += '';
_itens += _options[i][0] + '
';
}
}
var _optionsItens = document.createElement("div");
_optionsItens.className = "x-menu";
_optionsItens.style.top = coord.Y;
_optionsItens.style.left = ( coord.X - element.offsetLeft );
_optionsItens.style.zIndex = getZindex();
_optionsItens.innerHTML = _itens;
_optionsItens.onclick = function(){ showhidden.hiddenObject(false); };
_optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); };
_optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); };
showhidden.action('onmouseover', 'onmouseout', _optionsItens);
window.document.body.appendChild(_optionsItens);
setTimeout(function()
{
window.document.oncontextmenu = function()
{
return true;
};
},500);
}
}
function parse()
{
if( arguments.length == 2 )
return Xtools.parse(Xtools.xml(arguments[0]), arguments[1] );
if( arguments.length === 3 )
return Xtools.parse(Xtools.xml(arguments[0]), arguments[1], arguments[2] );
}
function preferences()
{
var paramPreferences =
{
'path' : path,
'lang1' : 'Suas Preferências',
'lang2' : 'Conexão',
'lang3' : 'Conectar Automaticamente o IM',
'lang4' : 'Usuários OffLine',
'lang5' : 'Exibir amigos Offline',
'lang6' : 'Salvar',
'lang7' : 'Cancelar',
'lang8' : 'Janela de Contatos',
'lang9' : 'Abrir janela como Pop-up',
'lang10' : 'Ausente',
'lang11' : 'Definir status de ausente depois de',
'lang12' : 'minutos',
'lang13' : 'Mostrar Contatos',
'lang14' : 'Mostrar contatos desconectados',
'langYes': 'Sim',
'langNo' : 'Não'
};
var _win_preferences =
{
id_window : "jabberit_preferences",
width : 430,
height : 410,
top : 150,
left : 100,
draggable : true,
visible : "display",
resizable : true,
zindex : zIndex++,
title : 'Expresso Messenger - Preferências',
closeAction : "remove",
content : Xtools.parse(Xtools.xml('preferences'), 'preferences.xsl', paramPreferences)
};
_winBuild(_win_preferences);
var _pButtons = {
'lang1' : 'Salvar',
'lang2' : 'Fechar',
'onclickClose' : '_winBuild("jabberit_preferences","remove");',
'onclickSubmit' : 'javascript:loadscript.setPreferences();'
};
document.getElementById('buttons_preferences_jabberit').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons);
// Element openWindowJabberit
var value1 = _preferencesIM[0].split(':');
var element1 = document.getElementById(value1[0]);
var valueSelect1 = value1[1];
for(var i = 0; i < element1.options.length; i++)
if( element1.options[i].value == valueSelect1 )
element1.options[i].selected = true;
// Element openWindowJabberitPopUp
var value2 = _preferencesIM[1].split(':');
var element2 = document.getElementById(value2[0]);
var valueSelect2 = value2[1];
for(var i = 0; i < element2.options.length; i++)
if( element2.options[i].value == valueSelect2 )
element2.options[i].selected = true;
// Element flagAwayIM
var value3 = _preferencesIM[2].split(':');
var element3 = document.getElementById(value3[0]);
element3.value = value3[1];
// Element showContactsOfflineJabberit
var value4 = _preferencesIM[3].split(':');
var element4 = document.getElementById(value4[0]);
var valueSelect4 = value4[1];
for(var i = 0; i < element4.options.length; i++)
if( element4.options[i].value == valueSelect4 )
element4.options[i].selected = true;
}
function removeContact(jid, index)
{
setTimeout(function()
{
TrophyIM.removeContact(jid, index);
},300);
}
function removeElement( )
{
if( arguments.length > 0 )
{
var _element = arguments[0]
var _parent = _element.parentNode;
_parent.removeChild( _element );
}
}
function removeGroup()
{
var _parent = arguments[0];
if( _parent.childNodes.length <= 2 )
_parent.parentNode.removeChild(_parent);
}
function renameContact()
{
if( arguments.length > 0 )
{
var _jid = arguments[0];
var _index = arguments[1];
TrophyIM.renameContact( _jid, _index );
}
}
function renameGroup()
{
if( arguments.length > 0 )
{
var _jid = arguments[0];
var _index = arguments[1];
TrophyIM.renameGroup( _jid , _index );
}
}
function rosterDiv()
{
var paramListContact =
{
'idUser' : Base64.decode(getUserCurrent().jid),
'full_name' : (( fullName.length < 25 ) ? fullName : ( fullName.substring( 0, 25) + "...")),
'path_jabberit' : path_jabberit,
'zIndex_' : zIndex++
};
var winRosterDiv =
{
id_window : "window_Roster_im",
width : 250,
height : 410,
top : 50,
left : 50,
draggable : true,
visible : "display",
resizable : true,
zindex : zIndex++,
title : "Expresso Messenger - Contatos",
closeAction : "hidden",
content : Xtools.parse(Xtools.xml("contacts_list"),"contactsList.xsl", paramListContact)
};
_winBuild( winRosterDiv );
// Photo User
getPhotoUser(Base64.decode(getUserCurrent().jid));
}
function searchUser()
{
var _input = getElement('search_user_jabber');
if( _input.value.length >= 3 )
addUser.search();
else
alert('Your search argument must be longer than 3 characters.');
}
function setAutorization(jidTo, indexTo)
{
var divItenContact = null;
if( ( divItenContact = getElement('itenContact_' + jidTo + '_' + indexTo )))
{
var subscription = divItenContact.getAttribute('subscription');
switch(subscription)
{
case 'from':
TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
break;
case 'none' :
TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
break;
case 'not-in-roster':
setTimeout(function()
{
var _add = "";
if( ( _add = confirm("Deseja adicionar o usuario!")) )
{
addUser.add( jidTo, indexTo );
}
},100);
break;
case 'to' :
TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
case 'subscribe' :
TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
break;
}
}
}
function setMessageStatus()
{
if( arguments.length > 0 )
{
var _element = arguments[0];
var _parent = _element.parentNode;
if( _element.nodeName.toLowerCase() == "label")
{
var _input = document.createElement("input");
_input.size = "35";
_input.maxlength = "35";
_input.style.border = "0";
_input.value = _element.innerHTML;
// OnkeyUp
configEvents( _input, "onkeyup", function(e)
{
if( e.keyCode == 13 ) loadscript.setMessageStatus(_input, _element);
}
);
// Onblur
configEvents(_input, "onblur", function(){ loadscript.setMessageStatus(_input, _element)});
if( _parent != null )
{
// Remove label
if( _element != null )
_parent.removeChild( _element );
// Add Input
if( _input != null )
_parent.appendChild( _input );
}
_input.focus();
_input.select();
}
else
{
var _label = arguments[1];
_statusMessage = _element.value.replace(/^\(+|\)+$/g,"");
if( ( _statusMessage = _statusMessage.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "")
_label.innerHTML = "( " + _statusMessage + " )";
else
_label.innerHTML = "( Digite aqui sua mensagem de Status )";
if( _parent != null )
{
// Remove Input
if( _element != null )
_parent.removeChild( _element );
// Add Label
if( _label != null )
_parent.appendChild( _label );
}
// Send Status Message
TrophyIM.setPresence("status", _statusMessage );
}
}
}
function setPreferences()
{
// Element openWindowJabberit
var elementOpenW = document.getElementById('openWindowJabberit');
var value = '';
var flagReload = false;
for(var i = 0 ; i < elementOpenW.options.length; i++)
if( elementOpenW.options[i].selected == true)
{
value = 'preferences1=openWindowJabberit:' + elementOpenW.options[i].value;
_preferencesIM[0] = 'openWindowJabberit:' + elementOpenW.options[i].value;
}
// Element openWindowJabberitPopUp
var elementOpenPop = document.getElementById('openWindowJabberitPopUp');
for(var i = 0; i < elementOpenPop.options.length; i++ )
if( elementOpenPop.options[i].selected == true )
{
value += '&preferences2=openWindowJabberitPopUp:' + elementOpenPop.options[i].value;
if( _preferencesIM[1] != 'openWindowJabberitPopUp:' + elementOpenPop.options[i].value)
flagReload = true;
_preferencesIM[1] = 'openWindowJabberitPopUp:' + elementOpenPop.options[i].value;
}
// Element flagAwayIM
var elementFlagIM = document.getElementById('flagAwayIM');
if( elementFlagIM.value.length > 0 && parseInt(elementFlagIM.value) > 0 )
{
_preferencesIM[2] = 'flagAwayIM:' + elementFlagIM.value;
value += '&preferences3=flagAwayIM:' + elementFlagIM.value;
}
else
{
alert('Informe um valor igual ou maior que 1!');
return false;
}
// Element showContactsOfflineJabberit
var elementShowOffline = document.getElementById('showContactsOfflineJabberit');
for(var i = 0 ; i < elementShowOffline.options.length; i++)
if( elementShowOffline.options[i].selected == true)
{
_preferencesIM[3] = 'showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
value += '&preferences4=showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
}
// Save Preferences
conn.go('p.pf.setPreferences',
function(data)
{
if(data == 'true')
{
if( flagReload )
{
window.location.reload();
myWindow.close();
}
}
else{ alert('Erro salvando suas preferências!'); }
_winBuild('jabberit_preferences', 'remove');
},
value);
}
function setPresence()
{
if( arguments.length > 0 )
{
var element = arguments[0];
if( showhidden == null )
showhidden = new ShowHidden(300);
var _status = [
['Afastado', 'away', ''],
['Disponível', 'available', ''],
['Livre p/ Conversa', 'chat', ''],
['Não Disponível', 'xa', ''],
['Ocupado', 'dnd', ''],
['Desconectado', 'unavailable', ''],
['Mensagem de Status...', 'status', ''],
];
var _itens = "";
for( var i in _status )
{
if( typeof( _status[i]) == "object" )
{
_itens += '';
_itens += _status[i][2]+ "" + _status[i][0] + "
";
}
}
var _statusItens = document.createElement("div");
_statusItens.style.marginTop = "65px";
_statusItens.style.marginLeft = "67px";
_statusItens.className = "x-menu";
_statusItens.style.zIndex = '99999';
_statusItens.innerHTML = _itens;
_statusItens.onclick = function(){ showhidden.hiddenObject(false); };
showhidden.action('onmouseover', 'onmouseout', _statusItens);
element.parentNode.onmouseout = function(){ showhidden.hiddenObject(false); };
element.parentNode.onmouseover = function(){ showhidden.hiddenObject(true); };
element.parentNode.appendChild(_statusItens);
}
}
function setSelectEditable(element)
{
if( getElement('selectBox0') == null )
selectEditable.create(element);
}
function setStatusJabber()
{
if( arguments.length > 0 )
{
if( arguments[1] != 'status' )
{
var _text = arguments[0];
var _img = arguments[1];
getElement('statusJabberText').innerHTML = _text;
getElement('statusJabberImg').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif')";
getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat";
}
}
}
function teste_meu(_jid, _password )
{
userCurrent =
{
'jid' : _jid.substring(11, _jid.length),
'password' : _password.substring(11, _password.length)
}
}
function setUserCurrent()
{
conn.go('p.ff.data_0',
function(_User)
{
var _user = _User;
conn.go('p.ff.data_1',
function(_pass)
{
teste_meu( _user, _pass );
});
});
}
function loadIM()
{
if( arguments.length > 0 )
{
var files = [
path_jabberit + 'js/connector.js',
path_jabberit + 'js/xtools.js',
path_jabberit + 'js/dragdrop.js',
path_jabberit + 'js/makeW.js',
path_jabberit + 'js/show_hidden.js',
path_jabberit + 'js/trophyim.js',
path_jabberit + 'js/AddUser.js',
path_jabberit + 'js/SelectEditable.js',
path_jabberit + 'templates/default/css/button.css',
path_jabberit + 'templates/default/css/common.css',
path_jabberit + 'templates/default/css/selectEditableStyle.css',
path_jabberit + 'templates/default/css/' + theme_jabberit
];
// FullName
fullName = arguments[0];
// Preferences
_preferencesIM = arguments[1].split(";");
if( !_preferencesIM[3] ) _preferencesIM[3] = "showContactsOfflineJabberit:false";
loadScripts(files);
setTimeout(function()
{
// Object Xtools
if( Xtools == null )
Xtools = new xtools(path_jabberit);
// Object Conector
if( conn == null )
conn = new AjaxConnector(path_jabberit);
// Object Add User
if( addUser == null )
addUser = new addUserIM(Xtools, conn);
// Object SelectEditable
if( selectEditable == null )
selectEditable = new SelectEditable();
// Add Jabber in StatusBar;
addIcon();
window.document.oncontextmenu = function()
{
return true;
};
// Auto Connect
setTimeout(function()
{
if( _preferencesIM[0] === 'openWindowJabberit:true' )
TrophyIM.load();
},1500);
// Auto Status
autoStatus();
configEvents( document, 'onmousemove', autoStatus );
configEvents( document, 'onkeypress', autoStatus );
}, 2000);
}
}
loadIM.prototype.adIcon = addIcon;
loadIM.prototype.actionButton = actionButton;
loadIM.prototype.addContact = addContact;
loadIM.prototype.clrAllContacts = clrAllContacts;
loadIM.prototype.configEvents = configEvents;
loadIM.prototype.getPhotoUser = getPhotoUser;
loadIM.prototype.getStatusMessage = getStatusMessage;
loadIM.prototype.getShowContactsOffline = getShowContactsOffline;
loadIM.prototype.getUserCurrent = getUserCurrent;
loadIM.prototype.getZIndex = getZindex;
loadIM.prototype.groupsHidden = groupsHidden;
loadIM.prototype.groupsVisible = groupsVisible;
loadIM.prototype.keyPressSearch = keyPressSearch;
loadIM.prototype.loginPage = loginPage;
loadIM.prototype.notification = notificationNewMessage;
loadIM.prototype.parse = parse;
loadIM.prototype.preferences = preferences;
loadIM.prototype.searchUser = searchUser
loadIM.prototype.setAutorization = setAutorization;
loadIM.prototype.setMessageStatus = setMessageStatus;
loadIM.prototype.setPreferences = setPreferences;
loadIM.prototype.setPresence = setPresence;
loadIM.prototype.setStatusJabber = setStatusJabber;
loadIM.prototype.setSelectEditable = setSelectEditable;
loadIM.prototype.setUserCurrent = setUserCurrent;
loadIM.prototype.removeContact = removeContact;
loadIM.prototype.removeElement = removeElement;
loadIM.prototype.removeGroup = removeGroup;
loadIM.prototype.renameContact = renameContact;
loadIM.prototype.renameGroup = renameGroup;
loadIM.prototype.rosterDiv = rosterDiv;
window.LoadIM = loadIM;
})();