home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 December
/
PCWorld_2006-12_cd.bin
/
komunikace
/
netscape
/
nsb-install-8-1-2.exe
/
chrome
/
aim.jar
/
content
/
aim
/
icqSearch.js
< prev
next >
Wrap
Text File
|
2006-01-06
|
4KB
|
156 lines
function OnLoadIcqSearch()
{
var icqbox = document.getElementById("icqnumber");
if (icqbox)
{
icqbox.addEventListener("keypress", checkValidIcq, true);
}
return;
}
function OnUnloadIcqSearch()
{
return;
}
function onIcqHelpSearch()
{
// TODO: opendialog(IcqHelp.xul);
// This will what happen when icq search returns zero users found
document.getElementById("icqEmptySearch").setAttribute('style', 'visibility:visible');
document.getElementById("ResultsDeck").setAttribute("selectedIndex",1);
window.sizeToContent();
return;
}
function onIcqSearch()
{
var tab=document.getElementById("icqTabPanels");
var searchItem=getSearchItemInput(tab.selectedIndex);
if (searchItem == "false")
return;
if (searchItem == "" && (tab.selectedIndex != 2)) {
aimErrorBox(aimString("icqsearch.emptyinput"));
return;
}
if (searchItem == "" && (tab.selectedIndex == 2)) {
aimErrorBox(aimString("icqsearch.invalidicq"));
return;
}
//Call Search()
window.open("chrome://aim/content/icqSearchProgress.xul", "", "chrome,titlebar,dialog,modal");
//var userfound=icqSearchInterface.Search(searchItem);
//if (userfound)
//{
document.getElementById("icqNonEmptySearch").setAttribute('style', 'visibility:visible');
document.getElementById("ResultsDeck").setAttribute("selectedIndex",0);
window.sizeToContent();
//}
//else
//{
//document.getElementById("icqEmptySearch").setAttribute('style', 'visibility:visible');
//document.getElementById("ResultsDeck").setAttribute("selectedIndex",1);
//window.sizeToContent();
//}
return;
}
function onIcqAddUser()
{
//if (Authrequired) //Maybe check the tree column for auth from search results?
var tab=document.getElementById("icqTabPanels");
var icqnumber=getSearchItemInput(tab.selectedIndex);
//Get icqnumber, email, nickname from searchresults and pass them as args
openDialog("chrome://aim/content/BuddyAddBuddy.xul", "", "modal=yes,titlebar,chrome", null, null, icqnumber);
return;
}
function getSelectedTab()
{
var tab=document.getElementById("icqTabPanels");
return (tab.selectedIndex) ;
}
function getSearchItemInput(tab)
{
var inputVal="";
switch(tab) {
case 0:
inputVal=document.getElementById("email").value;
if ( checkInputEmail(inputVal) == false)
return "false";
break;
case 1:
inputVal=document.getElementById("nickname").value;
break;
case 2:
inputVal=document.getElementById("icqnumber").value;
break;
default:
aimErrorBox(aimString("icqsearch.emptyinput"));
break;
}
return inputVal;
}
function checkValidIcq(event){
if ((event.charCode <47) || (event.charCode > 58))
{
event.preventBubble();
event.preventDefault();
return false;
}
return true;
}
function fillIcqSearchPaneContextMenu()
{
//Set target nodes and values accordingly
}
function getSelectedItemField(fieldname)
{
var tree=document.getElementById('icqSearchResultsTree').treeBoxObject.view.selection;
return "1234"; // TEST - DELME
//Get the selected row.
//Get the fieldname column in row
//return fieldname.value;
}
function cxtAddContact()
{
var icqnumber=getSelectedItemField(icqnumber);
openDialog("chrome://aim/content/BuddyAddBuddy.xul", "", "modal=yes,titlebar,chrome", null, null, icqnumber);
return;
}
function cxtGetUser()
{
var icqnumber=getSelectedItemField(icqnumber);
//Open get user info window
return;
}
function cxtSendMsg()
{
var icqnumber=getSelectedItemField(icqnumber);
aimIMInvokeIMForm(icqnumber);
return;
}
function icqResultsPaneOnClick(event)
{
return;
}