Part of fix for bug # 22139: put internet search results for single engines into sidebar. Approval: chofmann

This commit is contained in:
rjc%netscape.com 1999-12-19 06:53:18 +00:00
Родитель 741303b745
Коммит 48bc87c873
11 изменённых файлов: 1197 добавлений и 813 удалений

Просмотреть файл

@ -474,7 +474,29 @@ function UpdateBookmarksLastVisitedDate(event)
}
}
function createBrowserInstance() {
function UpdateInternetSearchResults(event)
{
if (window.content.location.href && window.content.location.href != "")
{
try
{
var search = Components.classes["component://netscape/rdf/datasource?name=internetsearch"].getService();
if (search) search = search.QueryInterface(Components.interfaces.nsIInternetSearchService);
if (search) search.FindInternetSearchResults(window.content.location.href);
}
catch(ex)
{
}
}
}
function createBrowserInstance()
{
appCore = Components
.classes[ "component://netscape/appshell/component/browser/instance" ]
.createInstance( Components.interfaces.nsIBrowserInstance );
@ -514,6 +536,8 @@ function UpdateBookmarksLastVisitedDate(event)
// be notified when onloads complete.
window.addEventListener("load", UpdateHistory, true);
window.addEventListener("load", UpdateBookmarksLastVisitedDate, true);
window.addEventListener("load", UpdateInternetSearchResults, true);
// Check for window.arguments[0]. If present, go to that url.
if ( window.arguments && window.arguments[0] ) {
// Load it using yet another psuedo-onload handler.

Просмотреть файл

@ -37,7 +37,9 @@ interface nsILocalSearchService : nsISupports
[scriptable, uuid(6bd1d803-1c67-11d3-9820-ed1b357eb3c4)]
interface nsIInternetSearchService : nsISupports
{
void FindInternetSearchResults(in string url);
void Stop();
void ClearResults();
void ClearResultSearchSites();
nsIRDFDataSource GetCategoryDataSource();
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -22,10 +22,12 @@
</box>
<tree id="internetresultstree" ref="" style="height: 70%; width: 100%;" flex="100%" datasources="rdf:internetsearch"
onclick="if (event.clickCount == 2) return OpenURL(event, event.target.parentNode.parentNode); else doResultClick(event.target.parentNode.parentNode);">
onclick="if (event.clickCount == 2) return OpenURL(event, event.target.parentNode.parentNode); else return doResultClick(event.target.parentNode.parentNode);">
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance" sortActive="true" sortDirection="descending" />
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance"
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
sortActive="true" sortDirection="descending" />
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"/>
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"/>
@ -46,19 +48,13 @@
<treechildren>
<treeitem uri="..." rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
<treerow>
<treecell>
<titledbutton style="width: 100%;" class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Name" />
</treecell>
<treecell class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Name" />
<treecell>
<progressmeter value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="horizontal" mode="normal" />
<titledbutton crop="right" value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none; width: 100%;" />
</treecell>
<treecell>
<titledbutton style="width: 100%;" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Site" />
</treecell>
<treecell>
<titledbutton style="width: 100%;" class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Engine" />
<titledbutton crop="right" value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none;" />
</treecell>
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Site" />
<treecell class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Engine" />
</treerow>
</treeitem>
</treechildren>

Просмотреть файл

@ -474,7 +474,29 @@ function UpdateBookmarksLastVisitedDate(event)
}
}
function createBrowserInstance() {
function UpdateInternetSearchResults(event)
{
if (window.content.location.href && window.content.location.href != "")
{
try
{
var search = Components.classes["component://netscape/rdf/datasource?name=internetsearch"].getService();
if (search) search = search.QueryInterface(Components.interfaces.nsIInternetSearchService);
if (search) search.FindInternetSearchResults(window.content.location.href);
}
catch(ex)
{
}
}
}
function createBrowserInstance()
{
appCore = Components
.classes[ "component://netscape/appshell/component/browser/instance" ]
.createInstance( Components.interfaces.nsIBrowserInstance );
@ -514,6 +536,8 @@ function UpdateBookmarksLastVisitedDate(event)
// be notified when onloads complete.
window.addEventListener("load", UpdateHistory, true);
window.addEventListener("load", UpdateBookmarksLastVisitedDate, true);
window.addEventListener("load", UpdateInternetSearchResults, true);
// Check for window.arguments[0]. If present, go to that url.
if ( window.arguments && window.arguments[0] ) {
// Load it using yet another psuedo-onload handler.

Просмотреть файл

@ -37,7 +37,9 @@ interface nsILocalSearchService : nsISupports
[scriptable, uuid(6bd1d803-1c67-11d3-9820-ed1b357eb3c4)]
interface nsIInternetSearchService : nsISupports
{
void FindInternetSearchResults(in string url);
void Stop();
void ClearResults();
void ClearResultSearchSites();
nsIRDFDataSource GetCategoryDataSource();
};

Просмотреть файл

@ -2,7 +2,7 @@
<HEAD>
<TITLE>Search</TITLE>
<BASE TARGET='_NEW'>
<BASE TARGET="_blank">
</HEAD>
<BODY>

Просмотреть файл

@ -7,6 +7,6 @@ titledbutton.engine[loading="true"] {
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
}
titledbutton.result {
titledbutton.iconic {
list-style-image: url("resource:/res/rdf/document.gif") ! important ;
}

Просмотреть файл

@ -22,10 +22,12 @@
</box>
<tree id="internetresultstree" ref="" style="height: 70%; width: 100%;" flex="100%" datasources="rdf:internetsearch"
onclick="if (event.clickCount == 2) return OpenURL(event, event.target.parentNode.parentNode); else doResultClick(event.target.parentNode.parentNode);">
onclick="if (event.clickCount == 2) return OpenURL(event, event.target.parentNode.parentNode); else return doResultClick(event.target.parentNode.parentNode);">
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance" sortActive="true" sortDirection="descending" />
<treecol id="RelevanceColumn" rdf:resource="http://home.netscape.com/NC-rdf#Relevance"
rdf:resource2="http://home.netscape.com/NC-rdf#Name"
sortActive="true" sortDirection="descending" />
<treecol id="SiteColumn" rdf:resource="http://home.netscape.com/NC-rdf#Site"/>
<treecol id="EngineColumn" rdf:resource="http://home.netscape.com/NC-rdf#Engine"/>
@ -46,19 +48,13 @@
<treechildren>
<treeitem uri="..." rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
<treerow>
<treecell>
<titledbutton style="width: 100%;" class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Name" />
</treecell>
<treecell class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Name" />
<treecell>
<progressmeter value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="horizontal" mode="normal" />
<titledbutton crop="right" value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none; width: 100%;" />
</treecell>
<treecell>
<titledbutton style="width: 100%;" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Site" />
</treecell>
<treecell>
<titledbutton style="width: 100%;" class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Engine" />
<titledbutton crop="right" value="rdf:http://home.netscape.com/NC-rdf#Relevance" align="left" style="list-style-image: none;" />
</treecell>
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Site" />
<treecell class="iconic" src="rdf:http://home.netscape.com/NC-rdf#Icon" align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Engine" />
</treerow>
</treeitem>
</treechildren>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -187,7 +187,7 @@ struct Components {
static Components gComponents[] = {
{ "LocalSearch", &kLocalSearchServiceCID, NS_LOCALSEARCH_SERVICE_PROGID },
{ "LocalSearch", &kLocalSearchServiceCID, NS_LOCALSEARCH_DATASOURCE_PROGID },
{ "InternetSearch", &kInternetSearchServiceCID, NS_INTERNETSEARCH_DATASOURCE_PROGID },
{ "InternetSearch", &kInternetSearchServiceCID, NS_INTERNETSEARCH_SERVICE_PROGID },
{ "InternetSearch", &kInternetSearchServiceCID, NS_INTERNETSEARCH_DATASOURCE_PROGID },
};
#define NUM_COMPONENTS (sizeof(gComponents) / sizeof(gComponents[0]))