[Pkg-mozext-commits] [nostalgy] 25/235: *** empty log message ***
David Prévot
taffit at alioth.debian.org
Tue Oct 8 20:41:29 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit e04584ac4ee272ccbc35ac52944a8924c8cb340b
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Thu Aug 31 15:37:21 2006 +0000
*** empty log message ***
git-svn-id: http://nostalgy.googlecode.com/svn/trunk@25 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
content/about.xhtml | 9 +++++++--
content/edit_prefs.js | 30 ++++++++++++++++++------------
content/edit_prefs.xul | 15 ++++++++++-----
content/edit_rule.js | 16 ++++++++++++++--
content/edit_rule.xul | 9 ++++++++-
content/folders.js | 2 +-
content/nostalgy.js | 16 +++++++++++++---
7 files changed, 71 insertions(+), 26 deletions(-)
diff --git a/content/about.xhtml b/content/about.xhtml
index a0f82b9..0b633ff 100644
--- a/content/about.xhtml
+++ b/content/about.xhtml
@@ -78,7 +78,9 @@
<p>Nostalgy has a notion of rule. A rule associates a folder to a
message by looking for a substring of the Sender or Subject (or both)
- headers. When a rule selects a folder for a given message, Nostalgy
+ headers. A rule can be restricted to match messages only under
+ a given server/folder. When a rule selects a folder for a given message,
+ Nostalgy
informs you in the status line. You can then use the Shift-S/Shift-C
shortcuts to move/copy directly the message to this folder.
Nostalgy's rules can be edited from the preference dialog.</p>
@@ -86,7 +88,10 @@
<p>
When no rule apply to a given message, Nostalgy proposes to re-use
(with Shift-S/Shift-C) the folder same as for the last move/copy
- operation folder.
+ operation folder. If the folder lookup has been restricted
+ to the current server (in the Nostalgy preference dialog), then
+ the last operation folder is attached to the current server. Otherwise,
+ it is global.
</p>
<h3>About Nostalgy...</h3>
diff --git a/content/edit_prefs.js b/content/edit_prefs.js
index bb53463..a999018 100644
--- a/content/edit_prefs.js
+++ b/content/edit_prefs.js
@@ -39,12 +39,19 @@ function SetItem(item, rule) {
f.setAttribute("label", lab);
item.childNodes.item(1).setAttribute("label", rule.contains);
- item.childNodes.item(2).setAttribute("value", rule.folder);
- item.childNodes.item(2).setAttribute("label", NostalgyCrop(rule.folder));
+
+ var u = "";
+ if (rule.under) { u = rule.under; }
+ item.childNodes.item(2).setAttribute("value", u);
+ item.childNodes.item(2).setAttribute("label", NostalgyCrop(u));
+
+ item.childNodes.item(3).setAttribute("value", rule.folder);
+ item.childNodes.item(3).setAttribute("label", NostalgyCrop(rule.folder));
}
function RuleOfItem(item) {
- return ({ folder: item.childNodes.item(2).getAttribute("value"),
+ return ({ folder: item.childNodes.item(3).getAttribute("value"),
+ under: item.childNodes.item(2).getAttribute("value"),
contains: item.childNodes.item(1).getAttribute("label"),
field: item.childNodes.item(0).getAttribute("value") });
}
@@ -54,6 +61,7 @@ function CreateItem(rule) {
item.appendChild(document.createElement("listcell"));
item.appendChild(document.createElement("listcell"));
item.appendChild(document.createElement("listcell"));
+ item.appendChild(document.createElement("listcell"));
SetItem(item,rule);
gList.appendChild(item);
gList.selectedItem = item;
@@ -64,6 +72,7 @@ function StrOfRule(rule) {
return (
"{field: '" + rule.field + "'," +
" contains: " + rule.contains.quote() + "," +
+ " under: " + rule.under.quote() + "," +
" folder: " + rule.folder.quote() + "}"
);
}
@@ -104,7 +113,7 @@ function onAcceptChanges() {
}
function DoNewRule() {
- EditRule({ field:"any", contains:"", folder:"" }, CreateItem);
+ EditRule({ field:"any", contains:"", folder:"", under:"" }, CreateItem);
}
function DoDelete() {
@@ -124,17 +133,14 @@ function onNostalgyLoad() {
getService(Components.interfaces.nsIPrefBranch);
try {
- var r = eval(prefs.getCharPref("extensions.nostalgy.rules"));
- var i;
- for (i = 0; i < r.length; i++) {
- r[i].folder = r[i].folder;
- r[i].contains = r[i].contains;
- CreateItem(r[i]);
- }
+ var r = eval(prefs.getCharPref("extensions.nostalgy.rules"));
+ var i;
+ for (i = 0; i < r.length; i++) { CreateItem(r[i]); }
} catch (ex) { }
var b = false;
- try { b=prefs.getBoolPref("extensions.nostalgy.restrict_to_current_server"); }
+ try {
+ b=prefs.getBoolPref("extensions.nostalgy.restrict_to_current_server"); }
catch (ex) { }
gRestrict.checked = b;
}
diff --git a/content/edit_prefs.xul b/content/edit_prefs.xul
index 7ffc042..dc0f1bd 100644
--- a/content/edit_prefs.xul
+++ b/content/edit_prefs.xul
@@ -15,24 +15,29 @@
<script src="edit_prefs.js"/>
<vbox style="width:800px">
- <groupbox>
+ <groupbox flex="0">
<label>Rules associate folders to messages by looking for a
-substring of the Sender or Subject (or both) headers. When a folder
+substring of the Sender or Subject (or both) headers. A rule can be
+restricted to match messages under a given server/folder. When a folder
is selected for a given message, Nostalgy informs you in the status line.
You can then use the Shift-S/Shift-C
shortcuts to move/copy the message to this folder.</label>
- <listbox id="rules">
+ <hbox flex="0">
+ <listbox id="rules" flex="0">
<listhead>
<listheader label="Field"/>
<listheader label="Contains"/>
- <listheader label="Folder"/>
+ <listheader label="Under"/>
+ <listheader label="Target"/>
</listhead>
<listcols>
<listcol/>
<listcol/>
- <listcol flex="10"/>
+ <listcol width="150" maxwidth="150"/>
+ <listcol width="450" maxwidth="450"/>
</listcols>
</listbox>
+ </hbox>
<vbox align="center">
<hbox>
diff --git a/content/edit_rule.js b/content/edit_rule.js
index 4430c90..98acb76 100644
--- a/content/edit_rule.js
+++ b/content/edit_rule.js
@@ -3,19 +3,23 @@ function gEBI(id) { return (document.getElementById(id)); }
var gFolderSelect = null;
var gContainsSelect = null;
var gFieldSelect = null;
+var gUnderSelect = null;
function onNostalgyLoad() {
var rule = window.arguments[0];
if (!rule) { alert("rule=null!"); }
- gFolderSelect = gEBI("folderselect");
gContainsSelect = gEBI("contains");
gFieldSelect = gEBI("field");
+ gFolderSelect = gEBI("folderselect");
NostalgyFolderSelectionBox(gFolderSelect);
+ gUnderSelect = gEBI("underselect");
+ NostalgyFolderSelectionBox(gUnderSelect);
gContainsSelect.focus();
gFolderSelect.value = rule.folder;
+ gUnderSelect.value = rule.under;
gContainsSelect.value = rule.contains;
gFieldSelect.selectedItem = gEBI(rule.field);
}
@@ -33,7 +37,8 @@ function onAcceptChanges() {
var rule = {
field: gFieldSelect.selectedItem.getAttribute("id"),
contains: gContainsSelect.value,
- folder: folder_name(folder)
+ folder: folder_name(folder),
+ under: gUnderSelect.value
};
(window.arguments[1])(rule);
@@ -47,4 +52,11 @@ function ChooseFolder() {
}
}
+function ChooseUnder() {
+ if (gUnderSelect.value != "") {
+ var under = NostalgyResolveFolder(gUnderSelect.value);
+ if (under) { gUnderSelect.value = folder_name(under); }
+ }
+}
+
window.addEventListener("load", onNostalgyLoad, false);
\ No newline at end of file
diff --git a/content/edit_rule.xul b/content/edit_rule.xul
index b51be9a..36b3e8b 100644
--- a/content/edit_rule.xul
+++ b/content/edit_rule.xul
@@ -13,7 +13,7 @@
<script src="folders.js"/>
<script src="edit_rule.js"/>
-<vbox style="width:600px">
+<vbox style="width:750px">
<groupbox>
<grid flex="1">
@@ -38,6 +38,13 @@
<label value="contains"/>
<textbox id="contains"/>
</row>
+
+ <row>
+ <label value="and message folder is under"/>
+ <textbox type="autocomplete" tabScrolling="true" id="underselect"
+ flex="3" maxrows="15" crop="end" ontextcommand="ChooseUnder();"/>
+ </row>
+
<row>
<label value="then save to"/>
<textbox type="autocomplete" tabScrolling="true" id="folderselect"
diff --git a/content/folders.js b/content/folders.js
index 12a1081..e93cd5c 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -164,7 +164,7 @@ function IterateFoldersAllServers(f) {
}
function IterateSubfolders(folder,f) {
- if (!folder.isServer) { f(folder); }
+ /* if (!folder.isServer) */ { f(folder); }
if (folder.hasSubFolders) {
var subfolders = folder.GetSubFolders();
var done = false;
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 1f37652..7b8569b 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -57,6 +57,7 @@ var NostalgyRules =
case "restrict_to_current_server":
restrict_to_current_server =
this._branch.getBoolPref("restrict_to_current_server");
+ if (!in_message_window) { NostalgyDefLabel(); }
break;
}
},
@@ -66,10 +67,13 @@ var NostalgyRules =
var folder = null;
var rules = this.rules;
var i = 0;
+ var current_folder = folder_name(gDBView.msgFolder);
for (i = 0; (i < rules.length) && (!folder); i++) {
var r = rules[i];
- if ((r.field != "subject") && (sender.indexOf(r.contains) >= 0)
- || (r.field != "sender") && (subject.indexOf(r.contains) >= 0)) {
+ if (((r.field != "subject") && (sender.indexOf(r.contains) >= 0)
+ || (r.field != "sender") && (subject.indexOf(r.contains) >= 0))
+ && (current_folder.indexOf(r.under) == 0))
+ {
folder = FindFolderExact(r.folder);
}
}
@@ -86,6 +90,7 @@ var focus_saved = null;
var command = null;
//var last_folder_author = new Array();
//var last_folder_subject = new Array();
+var last_folder_server = new Array();
var last_folder = null;
var gsuggest_folder = null;
@@ -180,6 +185,7 @@ function MailSubject() {
function register_folder(folder) {
// last_folder_author[MailAuthor()] = folder;
// last_folder_subject[MailSubject()] = folder;
+ last_folder_server[gDBView.msgFolder.server.key] = folder;
last_folder = folder
}
@@ -196,7 +202,11 @@ function NostalgySuggest() {
// r = last_folder_subject[MailSubject()];
// if (r) { return(r); }
- return(last_folder);
+ if (restrict_to_current_server) {
+ return(last_folder_server[gDBView.msgFolder.server.key]);
+ } else {
+ return(last_folder);
+ }
}
/** Commands **/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list