зеркало из https://github.com/mozilla/pjs.git
finally hook up search, and bring filters more in line with the way search does things
r=sspitzer #33101
This commit is contained in:
Родитель
82144ebae8
Коммит
621092769d
|
@ -191,6 +191,12 @@ function saveFilter() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onTargetFolderSelected(event)
|
||||||
|
{
|
||||||
|
SetFolderPicker(event.target.id, gActionTargetElement.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function onActionChanged(event)
|
function onActionChanged(event)
|
||||||
{
|
{
|
||||||
var menuitem = event.target;
|
var menuitem = event.target;
|
||||||
|
|
|
@ -20,7 +20,7 @@ Rights Reserved.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
|
||||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul">
|
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||||
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
|
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
|
||||||
<?xul-overlay href="chrome://messenger/content/searchTermOverlay.xul"?>
|
<?xul-overlay href="chrome://messenger/content/searchTermOverlay.xul"?>
|
||||||
|
|
||||||
|
@ -34,8 +34,9 @@ Rights Reserved.
|
||||||
persist="width heigh screenX screenY"
|
persist="width heigh screenX screenY"
|
||||||
onload="filterEditorOnLoad('msgFccFolderPicker');">
|
onload="filterEditorOnLoad('msgFccFolderPicker');">
|
||||||
|
|
||||||
<script language="JavaScript" src="chrome://messenger/content/FilterEditor.js"/>
|
|
||||||
<script language="JavaScript" src="chrome://global/content/strres.js"/>
|
<script language="JavaScript" src="chrome://global/content/strres.js"/>
|
||||||
|
<script language="JavaScript" src="chrome://messenger/content/FilterEditor.js"/>
|
||||||
|
|
||||||
<keyset id="keyset"/>
|
<keyset id="keyset"/>
|
||||||
<box orient="horizontal" class="padded">
|
<box orient="horizontal" class="padded">
|
||||||
<text value="&filterName.label;"/>
|
<text value="&filterName.label;"/>
|
||||||
|
@ -58,28 +59,8 @@ Rights Reserved.
|
||||||
</menulist>
|
</menulist>
|
||||||
<deck id="actionValueDeck" flex="1">
|
<deck id="actionValueDeck" flex="1">
|
||||||
<menulist id="actionTargetFolder" flex="1"
|
<menulist id="actionTargetFolder" flex="1"
|
||||||
containment="http://home.netscape.com/NC-rdf#child"
|
oncommand="onTargetFolderSelected(event);"/>
|
||||||
datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
|
|
||||||
ref="msgaccounts:/">
|
|
||||||
<template>
|
|
||||||
<rule iscontainer="true" isempty="false">
|
|
||||||
<menupopup>
|
|
||||||
<menu uri="..." value="rdf:http://home.netscape.com/NC-rdf#Name">
|
|
||||||
<menupopup>
|
|
||||||
<menuitem uri="..." data="..." value="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
|
||||||
<menuseparator/>
|
|
||||||
</menupopup>
|
|
||||||
</menu>
|
|
||||||
</menupopup>
|
|
||||||
</rule>
|
|
||||||
<rule>
|
|
||||||
<menupopup>
|
|
||||||
<menuitem uri="..." data="..." value="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
|
||||||
</menupopup>
|
|
||||||
</rule>
|
|
||||||
</template>
|
|
||||||
<menupopup/>
|
|
||||||
</menulist>
|
|
||||||
<menulist id="actionValuePriority">
|
<menulist id="actionValuePriority">
|
||||||
<menupopup>
|
<menupopup>
|
||||||
<!-- see MailNewsTypes2.idl -->
|
<!-- see MailNewsTypes2.idl -->
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
* The contents of this file are subject to the Netscape Public
|
* The contents of this file are subject to the Netscape Public
|
||||||
* License Version 1.1 (the "License"); you may not use this file
|
* License Version 1.1 (the "License"); you may not use this file
|
||||||
* except in compliance with the License. You may obtain a copy of
|
* except in compliance with the License. You may obtain a copy of
|
||||||
|
@ -30,12 +30,14 @@ var gFolderPicker;
|
||||||
|
|
||||||
var RDF;
|
var RDF;
|
||||||
|
|
||||||
function searchOnLoad() {
|
function searchOnLoad()
|
||||||
|
{
|
||||||
initializeSearchWidgets();
|
initializeSearchWidgets();
|
||||||
initializeSearchWindowWidgets();
|
initializeSearchWindowWidgets();
|
||||||
setSearchScope(0);
|
setSearchScope(0);
|
||||||
|
|
||||||
setupDatasource();
|
setupDatasource();
|
||||||
|
onMore(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchWindowWidgets()
|
function initializeSearchWindowWidgets()
|
||||||
|
@ -53,12 +55,20 @@ function onChooseFolder(event) {
|
||||||
gCurrentFolder =
|
gCurrentFolder =
|
||||||
RDF.GetResource(event.target.id).QueryInterface(nsIMsgFolder);
|
RDF.GetResource(event.target.id).QueryInterface(nsIMsgFolder);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSearch(event)
|
||||||
|
{
|
||||||
// tell the search session what the new scope is
|
// tell the search session what the new scope is
|
||||||
gSearchSession.AddScopeTerm(GetScopeForFolder(gCurrentFolder),
|
gSearchSession.addScopeTerm(GetScopeForFolder(gCurrentFolder),
|
||||||
gCurrentFolder)
|
gCurrentFolder)
|
||||||
|
|
||||||
|
saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
|
||||||
|
|
||||||
|
gSearchSession.search(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function GetScopeForFolder(folder) {
|
function GetScopeForFolder(folder) {
|
||||||
if (folder.server.type == "nntp")
|
if (folder.server.type == "nntp")
|
||||||
return nsMsgSearchScope.Newsgroup;
|
return nsMsgSearchScope.Newsgroup;
|
||||||
|
@ -72,7 +82,9 @@ function setupDatasource() {
|
||||||
|
|
||||||
gSearchDatasource = Components.classes[rdfDatasourcePrefix + "msgsearch"].createInstance(Components.interfaces.nsIRDFDataSource);
|
gSearchDatasource = Components.classes[rdfDatasourcePrefix + "msgsearch"].createInstance(Components.interfaces.nsIRDFDataSource);
|
||||||
|
|
||||||
|
dump("The root is " + gSearchDatasource.URI + "\n");
|
||||||
|
gResultsTree.setAttribute("ref", gSearchDatasource.URI);
|
||||||
|
|
||||||
// the thread pane needs to use the search datasource (to get the
|
// the thread pane needs to use the search datasource (to get the
|
||||||
// actual list of messages) and the message datasource (to get any
|
// actual list of messages) and the message datasource (to get any
|
||||||
// attributes about each message)
|
// attributes about each message)
|
||||||
|
@ -80,9 +92,13 @@ function setupDatasource() {
|
||||||
|
|
||||||
gResultsTree.database.AddDataSource(gSearchDatasource);
|
gResultsTree.database.AddDataSource(gSearchDatasource);
|
||||||
|
|
||||||
|
var messageDatasource = Components.classes[rdfDatasourcePrefix + "mailnewsmessages"].createInstance(Components.interfaces.nsIRDFDataSource);
|
||||||
|
gResultsTree.database.AddDataSource(messageDatasource);
|
||||||
|
|
||||||
// the datasource is a listener on the search results
|
// the datasource is a listener on the search results
|
||||||
searchListener = gSearchDatasource.QueryInterface(Components.interfaces.nsIMsgSearchNotify);
|
searchListener = gSearchDatasource.QueryInterface(Components.interfaces.nsIMsgSearchNotify);
|
||||||
gSearchSession.RegisterListener(searchListener);
|
gSearchSession.registerListener(searchListener);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ Rights Reserved.
|
||||||
|
|
||||||
<script src="chrome://global/content/strres.js"/>
|
<script src="chrome://global/content/strres.js"/>
|
||||||
<script src="chrome://messenger/content/SearchDialog.js"/>
|
<script src="chrome://messenger/content/SearchDialog.js"/>
|
||||||
<script src="chrome://messenger/content/msgFolderPickerOverlay.js"/>
|
|
||||||
|
|
||||||
<text value="This dialog is a work in progress! Please don't file any bugs against it."/>
|
<text value="This dialog is a work in progress! Please don't file any bugs against it."/>
|
||||||
<box>
|
<box>
|
||||||
|
@ -51,8 +50,8 @@ Rights Reserved.
|
||||||
<box>
|
<box>
|
||||||
<titledbox id="searchTermListBox" flex="1"/>
|
<titledbox id="searchTermListBox" flex="1"/>
|
||||||
<box orient="vertical">
|
<box orient="vertical">
|
||||||
<button value="&searchButton.label;"/>
|
<button value="&searchButton.label;" onclick="onSearch(event)"/>
|
||||||
<button value="&resetButton.label;"/>
|
<button value="&resetButton.label;" onclick="onReset(event)"/>
|
||||||
</box>
|
</box>
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче