/* Jappix - An open social platform These are the discovery JS scripts for Jappix ------------------------------------------------- License: AGPL Author: Vanaryon Last revision: 03/03/11 */ // Opens the discovery popup function openDiscovery() { // Popup HTML content var html = '
' + _e("Service discovery") + '
' + '
' + '
' + '
' + _e("Server to query") + '
' + '' + '
' + '
' + '' + '
' + '

' + _e("Authentications") + '

' + '
' + '
' + '

' + _e("Automation") + '

' + '
' + '
' + '

' + _e("Clients") + '

' + '
' + '
' + '

' + _e("Collaboration") + '

' + '
' + '
' + '

' + _e("Components") + '

' + '
' + '
' + '

' + _e("Rooms") + '

' + '
' + '
' + '

' + _e("Directories") + '

' + '
' + '
' + '

' + _e("Gateways") + '

' + '
' + '
' + '

' + _e("News") + '

' + '
' + '
' + '

' + _e("Hierarchy") + '

' + '
' + '
' + '

' + _e("Proxies") + '

' + '
' + '
' + '

' + _e("Publication/Subscription") + '

' + '
' + '
' + '

' + _e("Server") + '

' + '
' + '
' + '

' + _e("Storage") + '

' + '
' + '
' + '

' + _e("Others") + '

' + '
' + '
' + '

' + _e("Loading") + '

' + '
' + '
' + '
' + '
' + '
' + '' + _e("Close") + '' + '
'; // Create the popup createPopup('discovery', html); // Associate the events launchDiscovery(); // We request a disco to the default server startDiscovery(); return false; } // Quits the discovery popup function closeDiscovery() { // Destroy the popup destroyPopup('discovery'); return false; } // Launches a discovery function startDiscovery() { /* REF: http://xmpp.org/extensions/xep-0030.html */ // We get the server to query var discoServer = $('#discovery .disco-server-input').val(); // We launch the items query dataForm(discoServer, 'browse', '', '', 'discovery'); logThis('Service discovery launched: ' + discoServer); return false; } // Cleans the discovery results function cleanDiscovery() { // We remove the results $('#discovery .discovery-oneresult, #discovery .oneinstructions, #discovery .onetitle, #discovery .no-results').remove(); // We clean the user info $('#discovery .disco-server-info').text(''); // We hide the wait icon, the no result alert and the results $('#discovery .wait, #discovery .disco-category').hide(); } // Addon launcher function launchDiscovery() { // Click event $('#discovery .bottom .finish').click(closeDiscovery); // Keyboard event $('#discovery .disco-server-input').keyup(function(e) { if(e.keyCode == 13) { // No value? if(!$(this).val()) $(this).val(HOST_MAIN); // Start the discovery startDiscovery(); return false; } }); }