[Pkg-mozext-commits] [nostalgy] 37/235: *** empty log message ***
David Prévot
taffit at alioth.debian.org
Tue Oct 8 20:41:33 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 a4c047b38e5e7b8751e59845a7d4f000f1a21250
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Thu Sep 28 08:22:49 2006 +0000
*** empty log message ***
git-svn-id: http://nostalgy.googlecode.com/svn/trunk@37 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
CHANGES | 3 +++
content/folders.js | 36 ++++++++++++++++++++++++++++++++----
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/CHANGES b/CHANGES
index b3e4ab4..9b5d8d0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
Since 0.1.8
- select a message when entering a folder with the G key
+ - don't prefix folder names with the server name when restricting
+ to the current server
+ - folders are sorted by name in the completion box
0.1.8
- bug fix: the M and I keys were incorrectly captured
diff --git a/content/folders.js b/content/folders.js
index b632a95..616e6eb 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -13,7 +13,7 @@ function NostalgyMakeRegexp(s) {
return (new RegExp(s.replace(/\.\./g, ".*"), ""));
}
-function folder_name(folder) {
+function full_folder_name(folder) {
var uri = folder.prettyName;
while (!folder.isServer) {
folder = folder.parent;
@@ -22,6 +22,25 @@ function folder_name(folder) {
return uri;
}
+function short_folder_name(folder) {
+ var uri = folder.prettyName;
+ if (folder.isServer) { return uri; }
+ folder = folder.parent;
+ while (!folder.isServer) {
+ uri = folder.prettyName + "/" + uri;
+ folder = folder.parent;
+ }
+ return uri;
+}
+
+function folder_name(folder) {
+ if (restrict_to_current_server) {
+ return(short_folder_name(folder));
+ } else {
+ return(full_folder_name(folder));
+ }
+}
+
function LongestCommonPrefix(s1,s2) {
var i = 0;
var l = s1.length;
@@ -129,7 +148,7 @@ function FindFolderExact(uri) {
var u = uri.toLowerCase();
try {
IterateFoldersAllServers(function (folder) {
- if (folder_name(folder).toLowerCase() == u) { ret = folder; throw(0); }
+ if (full_folder_name(folder).toLowerCase() == u) { ret = folder; throw(0); }
});
} catch (ex) { }
return ret;
@@ -171,17 +190,26 @@ function IterateFoldersAllServers(f) {
}
function IterateSubfolders(folder,f) {
- /* if (!folder.isServer) */ { f(folder); }
+ if (!folder.isServer || !restrict_to_current_server) { f(folder); }
if (folder.hasSubFolders) {
var subfolders = folder.GetSubFolders();
+ var arr = new Array();
var done = false;
while (!done) {
var subfolder = subfolders.currentItem().
QueryInterface(Components.interfaces.nsIMsgFolder);
- IterateSubfolders(subfolder,f);
+ arr.push(subfolder);
try {subfolders.next();}
catch(e) {done = true;}
}
+
+ arr.sort(function (a,b) {
+ var an = a.prettyName;
+ var bn = b.prettyName;
+ if (an < bn) { return (-1); } else { return 1; }
+ });
+ var i;
+ for (i = 0; i < arr.length; i++) { IterateSubfolders(arr[i],f) }
}
}
--
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