/* Jappix - An open social platform These are the directory JS scripts for Jappix ------------------------------------------------- License: AGPL Author: Vanaryon Last revision: 03/03/11 */ // Opens the directory popup function openDirectory() { // Popup HTML content var html = '
' + _e("User directory") + '
' + '
' + '
' + '
' + _e("Server to query") + '
' + '' + '
' + '
' + '
' + '
' + '
' + '' + _e("Close") + '' + '
'; // Create the popup createPopup('directory', html); // Associate the events launchDirectory(); // Start a search! startDirectory(); return false; } // Quits the directory popup function closeDirectory() { // Destroy the popup destroyPopup('directory'); return false; } // Launches a directory search function startDirectory() { // Get the server to query var server = $('#directory .directory-server-input').val(); // Launch the search! dataForm($('#directory .directory-server-input').val(), 'search', '', '', 'directory'); logThis('Directory search launched: ' + server); return false; } // Addon launcher function launchDirectory() { // Click event $('#directory .bottom .finish').click(closeDirectory); // Keyboard event $('#directory .directory-server-input').keyup(function(e) { if(e.keyCode == 13) { // No value? if(!$(this).val()) $(this).val(HOST_VJUD); // Start the directory search startDirectory(); return false; } }); }