gecko-dev/xpfe/components/search/resources/search.js

90 lines
1.7 KiB
JavaScript
Raw Normal View History

1999-06-15 05:14:37 +00:00
1999-08-19 19:58:26 +00:00
var gSearchStr = "";
var gTabName = "";
1999-08-19 19:58:26 +00:00
function loadPage(thePage, searchStr)
1999-06-15 05:14:37 +00:00
{
var content="", results="";
var tabName="";
1999-06-15 05:14:37 +00:00
1999-08-19 19:58:26 +00:00
gSearchStr = "";
1999-06-15 05:14:37 +00:00
if (thePage == "find")
{
tabName="findTab";
content="chrome://search/content/find.xul";
results="chrome://search/content/findresults.xul";
1999-06-15 05:14:37 +00:00
}
else if (thePage == "internet")
{
tabName="internetTab";
content="chrome://search/content/internet.xul";
results="chrome://search/content/internetresults.xul";
1999-08-19 19:58:26 +00:00
if ((searchStr) && (searchStr != null))
{
gSearchStr = searchStr;
}
1999-06-15 05:14:37 +00:00
}
1999-08-05 23:05:19 +00:00
else if (thePage == "mail")
1999-06-15 05:14:37 +00:00
{
tabName="mailnewsTab";
1999-06-15 05:14:37 +00:00
content="about:blank";
results="about:blank";
}
else if (thePage == "addressbook")
{
tabName="addressbookTab";
1999-06-15 05:14:37 +00:00
content="about:blank";
results="about:blank";
}
1999-08-05 23:05:19 +00:00
if (tabName == gTabName) return(true);
gTabName = tabName;
1999-06-15 05:14:37 +00:00
if ((content != "") && (results != ""))
{
var contentFrame = document.getElementById("content");
if (contentFrame)
{
contentFrame.setAttribute("src", content);
}
var resultsFrame = document.getElementById("results");
if (resultsFrame)
{
resultsFrame.setAttribute("src", results);
}
var theTab = document.getElementById(tabName);
if (theTab)
{
theTab.setAttribute("selected", "true");
}
1999-06-15 05:14:37 +00:00
}
return(true);
}
1999-08-19 19:58:26 +00:00
function getSearchText()
{
return(gSearchStr);
}
function doUnload()
{
// Get the current window position/size.
var x = window.screenX;
var y = window.screenY;
var h = window.outerHeight;
var w = window.outerWidth;
// Store these into the window attributes (for persistence).
var win = document.getElementById( "search-window" );
win.setAttribute( "x", x );
win.setAttribute( "y", y );
win.setAttribute( "height", h );
win.setAttribute( "width", w );
}