[Pkg-mozext-commits] [nostalgy] 134/235: Support TB3. Automatic creation of folders.

David Prévot taffit at alioth.debian.org
Tue Oct 8 20:42:04 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 00d684b86a666f8f5b4b99f57bbdb8d694e25983
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Thu May 1 14:12:19 2008 +0000

    Support TB3. Automatic creation of folders.
    
    git-svn-id: http://nostalgy.googlecode.com/svn/trunk@134 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
 CHANGES             |    6 +-
 TODO                |    2 -
 content/folders.js  |  127 ++++++++++++++++++++----------------
 content/nostalgy.js |  177 ++++++++++++++++++++++++++++++---------------------
 install.rdf         |    4 +-
 5 files changed, 181 insertions(+), 135 deletions(-)

diff --git a/CHANGES b/CHANGES
index 925c0a3..131c677 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
-
-Since 0.2.15
+0.2.16
+  - allow it to run with TB 3.0
   - added an explicit license file (zlib/libpng-like)
+  - bug fix: RETURN did not work in QuickSearch when searching in message bodies
+  - suggest to create a folder when it does not exist (for Go/Copy/Move operations)
 
 0.2.15
   - bug fix: the G command did not work when QuickSearch is not shown in 
diff --git a/TODO b/TODO
index e0b75fc..e69de29 100644
--- a/TODO
+++ b/TODO
@@ -1,2 +0,0 @@
-- Allow the user to define keyboard shortcuts to save messages to
-  specified folders with a single keystroke.
\ No newline at end of file
diff --git a/content/folders.js b/content/folders.js
index 6b7c992..c4cac7f 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -64,9 +64,9 @@ function NostalgyMakeRegexp(s) {
 }
 
 function mayLowerCase(s) {
-  if (!nostalgy_completion_options.match_case_sensitive) 
+  if (!nostalgy_completion_options.match_case_sensitive)
     return (s.toLowerCase());
-  else 
+  else
     return s;
 }
 
@@ -128,20 +128,20 @@ function NostalgyFolderMatch(f,reg) {
 
 function NostalgyAutocomplete(box) {
  this.box = box;
- this.xresults = 
+ this.xresults =
   Components.classes[
    "@mozilla.org/autocomplete/results;1"
   ].getService(Components.interfaces.nsIAutoCompleteResults);
 }
 
-NostalgyAutocomplete.prototype.onStartLookup = 
+NostalgyAutocomplete.prototype.onStartLookup =
 function(text, results, listener) {
  var items = this.xresults.items;
  var nb = 0;
  items.Clear();
 
  var add_folder = function (fname) {
-  var newitem = 
+  var newitem =
    Components.classes[
     "@mozilla.org/autocomplete/item;1"
    ].createInstance(Components.interfaces.nsIAutoCompleteItem);
@@ -150,15 +150,15 @@ function(text, results, listener) {
   items.AppendElement(newitem);
   nb++;
  };
- 
- var f = function (folder) { add_folder(folder_name(folder)); }; 
- 
+
+ var f = function (folder) { add_folder(folder_name(folder)); };
+
  if (text == "") {
-   for (var j = 0; j < nostalgy_recent_folders.length; j++) 
+   for (var j = 0; j < nostalgy_recent_folders.length; j++)
      add_folder(nostalgy_recent_folders[j]);
  } else {
-   nostalgy_search_folder_options.do_tags = 
-     nostalgy_completion_options.always_include_tags || 
+   nostalgy_search_folder_options.do_tags =
+     nostalgy_completion_options.always_include_tags ||
      (text.substr(0,1) == ":");
    IterateMatches(text, this.box.shell_completion, f);
    if (nb == 0 && !nostalgy_search_folder_options.do_tags) {
@@ -172,12 +172,12 @@ function(text, results, listener) {
  listener.onAutoComplete(this.xresults, 1);
 }
 
-NostalgyAutocomplete.prototype.onStopLookup = 
+NostalgyAutocomplete.prototype.onStopLookup =
   function() {  }
-NostalgyAutocomplete.prototype.onAutoComplete = 
+NostalgyAutocomplete.prototype.onAutoComplete =
   function(text, results, listener){ }
 
-NostalgyAutocomplete.prototype.QueryInterface = 
+NostalgyAutocomplete.prototype.QueryInterface =
 function(iid) {
  if (iid.equals(Components.interfaces.nsIAutoCompleteSession)) return this;
  throw Components.results.NS_NOINTERFACE;
@@ -188,14 +188,14 @@ function NostalgyProcessResults(aSessionName, aResults, aStatus) {
  this.clearResults(false); // clear results, but don't repaint yet
  this.mLastResults[aSessionName] = aResults;
  this.autoFillInput(aSessionName, aResults, false);
- this.addResultElements(aSessionName, aResults);      
+ this.addResultElements(aSessionName, aResults);
  this.openResultPopup();
 }
 
 function NostalgyProcessInput() {
  if (this.ignoreInputEvent)
    return;
- 
+
  this.userAction = "typing";
  this.mNeedToFinish = true;
  this.mTransientValue = false;
@@ -204,7 +204,7 @@ function NostalgyProcessInput() {
  this.resultsPopup.selectedIndex = null;
  this.removeAttribute("noMatchesFound");
 
- this.mAutoCompleteTimer = 
+ this.mAutoCompleteTimer =
    setTimeout(this.callListener, this.timeout, this, "startLookup");
 }
 
@@ -216,7 +216,7 @@ function NostalgyProcessKeyPress(aEvent) {
      if (this.getAttribute("normaltab") != "true") {
       if (nostalgy_completion_options.tab_shell_completion) {
        this.shell_completion = true;
-       this.value = NostalgyCompleteUnique(this.value); 
+       this.value = NostalgyCompleteUnique(this.value);
        this.processInput();
        killEvent = true;
       }
@@ -225,8 +225,8 @@ function NostalgyProcessKeyPress(aEvent) {
        killEvent = this.keyNavigation(aEvent);
       }
      }
-     break;              
-              
+     break;
+
    case KeyEvent.DOM_VK_RETURN:
      killEvent = this.mMenuOpen;
      this.finishAutoComplete(true, true, aEvent);
@@ -239,7 +239,7 @@ function NostalgyProcessKeyPress(aEvent) {
      this.undoAutoComplete();
      this.closeResultPopup();
      break;
-  
+
    case KeyEvent.DOM_VK_PAGE_UP:
    case KeyEvent.DOM_VK_DOWN:
    case KeyEvent.DOM_VK_PAGE_DOWN:
@@ -267,8 +267,8 @@ function NostalgyFolderSelectionBox(box) {
 
  box.shell_completion = false;
  box.addSession(new NostalgyAutocomplete(box));
- box.processInput = NostalgyProcessInput;  
- box.processKeyPress = NostalgyProcessKeyPress; 
+ box.processInput = NostalgyProcessInput;
+ box.processKeyPress = NostalgyProcessKeyPress;
 }
 
 function NostalgyFolderSelectionBoxes() {
@@ -287,16 +287,16 @@ function NostalgyCompleteUnique(s) {
   var rexp = NostalgyMakeRegexp(mayLowerCase(s));
   IterateFolders(function (f) {
    var n = mayLowerCase(folder_name(f));
-   if (n.search(rexp) == 0) { 
+   if (n.search(rexp) == 0) {
      nb++;
      if (nb == 1) { ret = n; } else { ret = LongestCommonPrefix(ret,n); }
    }
   });
-  if (ret) { 
+  if (ret) {
     var f = FindFolderCompleted(ret);
     if (f) {
      if (f.hasSubFolders) { return (folder_name(f) + "/"); }
-     else return (folder_name(f)); 
+     else return (folder_name(f));
     }
     else { return(ret); }
   } else { return s;  }
@@ -358,7 +358,7 @@ function FindFolderCropped(uri) {
 function IterateFoldersAllServers(f) {
  IterateTags(f);
 
- var amService = 
+ var amService =
     Components.classes["@mozilla.org/messenger/account-manager;1"]
               .getService(Components.interfaces.nsIMsgAccountManager);
 
@@ -380,7 +380,7 @@ function IterateFoldersAllServers(f) {
  }
 }
 
-function CompareFolderNames(a,b) { 
+function CompareFolderNames(a,b) {
   var an = a.prettyName;
   var bn = b.prettyName;
   return ((an < bn) ? -1 : ((an > bn) ? 1 : 0));
@@ -400,40 +400,55 @@ function ClearNostalgyCache() {
 }
 
 function IterateSubfolders(folder,f) {
- if ((!folder.isServer || 
+ if ((!folder.isServer ||
       !nostalgy_completion_options.restrict_to_current_server)
-     && (folder.canFileMessages || 
+     && (folder.canFileMessages ||
          !nostalgy_search_folder_options.require_file))
- { 
+ {
   try { f(folder); }
   catch (ex) { if (ex == 1) { return; } else { throw ex; } }
  }
+ if (!folder.hasSubFolders) return;
+
  var arr;
- if (folder.hasSubFolders) {
-  if (nostalgy_completion_options.sort_folders) {
-    arr = sorted_subfolders[full_folder_name(folder)];
-    if (arr) { for (var n in arr) { IterateSubfolders(arr[n],f); }
-                return; }
-  }
+ if (nostalgy_completion_options.sort_folders) {
+   arr = sorted_subfolders[full_folder_name(folder)];
+   if (arr) {
+       for (var n in arr) IterateSubfolders(arr[n],f);
+       return;
+   }
+ }
 
-  var subfolders = folder.GetSubFolders();
-  var arr = new Array();
-  var done = false;
-  while (!done) {
-   var subfolder = subfolders.currentItem().
-                   QueryInterface(Components.interfaces.nsIMsgFolder);
-   if (nostalgy_completion_options.sort_folders) { arr.push(subfolder); } 
-   else { IterateSubfolders(subfolder,f); }
-   try {subfolders.next();}
-   catch(e) {done = true;}
-  }
-  if (nostalgy_completion_options.sort_folders) {
-    arr.sort(CompareFolderNames);
-    sorted_subfolders[full_folder_name(folder)] = arr;
-    for (var n in arr) { IterateSubfolders(arr[n],f); }
-  }
+ if (folder.subFolders) {
+     // TB >= 3.0
+     var subfolders = folder.subFolders;
+     arr = new Array();
+     while (subfolders.hasMoreElements()) {
+         var subfolder = subfolders.getNext().
+             QueryInterface(Components.interfaces.nsIMsgFolder);
+         if (nostalgy_completion_options.sort_folders) { arr.push(subfolder); }
+         else { IterateSubfolders(subfolder,f); }
+     }
+ } else {
+     // TB < 3.0
+     var subfolders = folder.GetSubFolders();
+     arr = new Array();
+     var done = false;
+     while (!done) {
+         var subfolder = subfolders.currentItem().
+             QueryInterface(Components.interfaces.nsIMsgFolder);
+         if (nostalgy_completion_options.sort_folders) { arr.push(subfolder); }
+         else { IterateSubfolders(subfolder,f); }
+         try {subfolders.next();}
+         catch(e) {done = true;}
+     }
  }
-}  
+ if (nostalgy_completion_options.sort_folders) {
+     arr.sort(CompareFolderNames);
+     sorted_subfolders[full_folder_name(folder)] = arr;
+     for (var n in arr) IterateSubfolders(arr[n],f);
+ }
+}
 
 function IterateFoldersCurrentServer(f) {
  IterateTags(f);
@@ -444,7 +459,7 @@ function IterateFoldersCurrentServer(f) {
 function IterateTags(f) {
  if (!nostalgy_search_folder_options.do_tags) return;
  try {
- var tagService = 
+ var tagService =
   Components.classes["@mozilla.org/messenger/tagservice;1"]
             .getService(Components.interfaces.nsIMsgTagService);
  var tagArray = tagService.getAllTags({});
@@ -453,7 +468,7 @@ function IterateTags(f) {
 }
 
 function IterateFolders(f) {
- if (nostalgy_completion_options.restrict_to_current_server) 
+ if (nostalgy_completion_options.restrict_to_current_server)
    IterateFoldersCurrentServer(f);
  else IterateFoldersAllServers(f);
 }
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 812afdf..174cc45 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -1,4 +1,4 @@
-var in_message_window = !window.SetFocusFolderPane;
+var in_message_window = !window.SetFocusThreadPane;
 
 var nostalgy_folderBox = null;
 var nostalgy_statusBar = null;
@@ -36,7 +36,7 @@ var NostalgyRules =
   register: function()
   {
     this._branch = NostalgyPrefService().getBranch("extensions.nostalgy.");
-    this._branch2 = 
+    this._branch2 =
         this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
     this._branch2.addObserver("", this, false);
     this.get_rules();
@@ -58,7 +58,7 @@ var NostalgyRules =
       } catch (ex) { k = nostalgy_keys[i][2]; }
       nostalgy_active_keys[k] = nostalgy_keys[i][3];
     }
-    
+
     var a = this._branch.getChildList("actions.", { });
     var s = "";
     for (var i in a) {
@@ -87,7 +87,7 @@ var NostalgyRules =
        rule.contains = rule.contains.toLowerCase();
        // convert from previous version
        if (rule.field) {
-       if (rule.field == "any") { 
+       if (rule.field == "any") {
         rule.sender = true;
         rule.recipients = true;
         rule.subject = true;
@@ -153,7 +153,7 @@ function NostalgyExtractRules() {
 "Do you want to install the rules contained in this message?\n"+
 "This will overwrite your current set of rules.\n"+
 "IMPORTANT: do this only if you trust the sender of this e-mail.\n"
-)) 
+))
     NostalgyRules._branch.setCharPref("rules", s)
 }
 
@@ -174,13 +174,13 @@ function onNostalgyResize() {
 }
 
 var NostalgyFolderListener = {
- OnItemAdded: function(parentItem, item) { 
+ OnItemAdded: function(parentItem, item) {
    try { var i = item.QueryInterface(Components.interfaces.nsIMsgFolder);
-   ClearNostalgyCache(); 
+   ClearNostalgyCache();
  } catch (ex) { } },
- OnItemRemoved: function(parentItem, item) { 
+ OnItemRemoved: function(parentItem, item) {
    try { var i = item.QueryInterface(Components.interfaces.nsIMsgFolder);
-   ClearNostalgyCache(); 
+   ClearNostalgyCache();
  } catch (ex) { } },
 
  OnItemPropertyChanged: function(item, property, oldValue, newValue) { },
@@ -188,7 +188,7 @@ var NostalgyFolderListener = {
  OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) { },
  OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){ },
  OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) { },
- OnItemEvent: function(folder, event) { 
+ OnItemEvent: function(folder, event) {
    var evt = event.toString();
    // NostalgyDebug(evt + " folder:" + folder.prettyName);
    if (evt == "FolderLoaded") setTimeout(NostalgySelectLastMsg,50);
@@ -207,7 +207,7 @@ function NostalgySelectMessageByNavigationType(type)
 
   gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true);
 
-  if ((resultId.value != nsMsgKey_None) && 
+  if ((resultId.value != nsMsgKey_None) &&
       (resultIndex.value != nsMsgKey_None)) {
 
     gEBI("threadTree").treeBoxObject.ensureRowIsVisible(resultIndex.value);
@@ -239,7 +239,8 @@ function onNostalgyLoad() {
 
 
  if (!in_message_window) {
-   gEBI("threadTree").addEventListener("select", NostalgyDefLabel, false); 
+   gEBI("threadTree").addEventListener("select", NostalgyDefLabel, false);
+   onSearchKeyPress = function() { };
  } else {
    // find a better way to be notified when the displayed message changes
    var old = UpdateStandAloneMessageCounts;
@@ -252,11 +253,10 @@ function onNostalgyLoad() {
  window.addEventListener("mousedown", NostalgyHideIfBlurred, false);
  // Don't know why, but the blur event does not seem to be fired properly...
 
-
  var mSession = NostalgyMailSession();
  var nsIFolderListener = Components.interfaces.nsIFolderListener;
- if (mSession) 
-   mSession.AddFolderListener(NostalgyFolderListener, 
+ if (mSession)
+   mSession.AddFolderListener(NostalgyFolderListener,
       nsIFolderListener.added | nsIFolderListener.removed | nsIFolderListener.event);
 
  Components.classes["@mozilla.org/observer-service;1"].
@@ -265,16 +265,16 @@ function onNostalgyLoad() {
 
  /*
  var old_OnMsgParsed = OnMsgParsed;
- OnMsgParsed = function (url) {   
+ OnMsgParsed = function (url) {
    NostalgyDebug("OnMsgParsed");
-   old_OnMsgParsed(url); 
-   setTimeout(NostalgyOnMsgParsed,100); 
+   old_OnMsgParsed(url);
+   setTimeout(NostalgyOnMsgParsed,100);
  };
  */
 
  if (window.gSearchNotificationListener) {
    var old_f0 = gSearchNotificationListener.onSearchDone;
-   gSearchNotificationListener.onSearchDone = function(status) { 
+   gSearchNotificationListener.onSearchDone = function(status) {
      if (nostalgy_on_search_done) nostalgy_on_search_done();
      old_f0(status);
    };
@@ -297,11 +297,11 @@ function onNostalgyLoad() {
    if (search)
        search.addEventListener
 	 ("popuphiding",
-	  function() { 
+	  function() {
 	   if (nostalgy_completion_options.always_show_search_mode &&
 	       nostalgy_search_focused) setTimeout(NostalgyShowSearchMode,0);
 	 },
-	  false); 
+	  false);
  }
 }
 
@@ -311,7 +311,7 @@ function NostalgyOnMsgParsed() {
     nostalgy_extracted_rules = "";
     button.hidden = true;
   }
-  
+
   var doc = document.getElementById('messagepane').contentDocument;
   var content = doc.body.textContent;
   var b = "BEGIN RULES\n";
@@ -320,7 +320,7 @@ function NostalgyOnMsgParsed() {
   i += b.length;
   var j = content.indexOf("END RULES\n", i);
   if (j < 0) return;
-  
+
   nostalgy_extracted_rules = content.substr(i, j - i);
   if (nostalgy_extracted_rules != "") {
     var button = gEBI("nostalgy_extract_rules_buttons");
@@ -351,7 +351,7 @@ function onNostalgyUnload() {
 function NostalgyHideIfBlurred() {
   setTimeout(function (){
       var focused = document.commandDispatcher.focusedElement;
-    if ((!nostalgy_statusBar.hidden) && 
+    if ((!nostalgy_statusBar.hidden) &&
         (focused != nostalgy_folderBox) &&
 	(focused != nostalgy_folderBox.inputField))
       { NostalgyHide(false); }
@@ -369,10 +369,10 @@ function NostalgyHide(restore) {
  NostalgyDefLabel();
 }
 
-function NostalgyDefLabel() { 
+function NostalgyDefLabel() {
  gsuggest_folder = NostalgySuggest();
  if (gsuggest_folder) {
-   nostalgy_label.value = 
+   nostalgy_label.value =
        default_label + " [+Shift: ==> " + folder_name(gsuggest_folder) + "]";
  } else {
    nostalgy_label.value = default_label;
@@ -400,9 +400,9 @@ function NostalgyCmd(lab,cmd,require_file) {
  nostalgy_statusBar.hidden = false;
  nostalgy_folderBox.value = "";
 
- setTimeout(function() { 
-   nostalgy_folderBox.focus();  
-   nostalgy_folderBox.processInput(); 
+ setTimeout(function() {
+   nostalgy_folderBox.focus();
+   nostalgy_folderBox.processInput();
  }, 0);
  // For some unknown reason, doing nostalgyBox.focus immediatly
  // sometimes does not work...
@@ -411,20 +411,20 @@ function NostalgyCmd(lab,cmd,require_file) {
 
 
 function NostalgyCreateTag(name) {
- var tagService = 
+ var tagService =
     Components.classes["@mozilla.org/messenger/tagservice;1"]
               .getService(Components.interfaces.nsIMsgTagService);
  tagService.addTag(name, '', '');
  var key = tagService.getKeyForTag(name);
  var ok = false;
- var args = {result: "", keyToEdit: key, 
+ var args = {result: "", keyToEdit: key,
              okCallback: function(){ ok = true; } };
  var dialog = window.openDialog(
                               "chrome://messenger/content/newTagDialog.xul",
                               "",
                               "chrome,titlebar,modal",
-                              args);    
-  if (ok) nostalgy_command({ tag:name,key:key });   
+                              args);
+  if (ok) nostalgy_command({ tag:name,key:key });
   else tagService.deleteKey(key);
 }
 
@@ -436,16 +436,47 @@ function NostalgyRunCommand() {
     NostalgyRecordRecentFolder(f);
     nostalgy_command(f);
   }
-  else { 
+  else {
     if (s.substr(0,1) == ":" && s != ":") {
       var name;
-      if (s.substr(s.length-1,1) == ":") 
+      if (s.substr(s.length-1,1) == ":")
          name = s.substr(1,s.length - 2);
-      else 
+      else
          name = s.substr(1,s.length - 1);
       NostalgyCreateTag(name);
-    } else
-      alert("No folder " + s);
+    } else {
+        nostalgy_search_folder_options.require_file = false;
+        var i = s.lastIndexOf("/", s.length);
+        var parent = null;
+        var name = null;
+        if (i <= 0) {
+            parent = gDBView.msgFolder.server.rootMsgFolder;
+            if (i = 0) name = s.substr(1, s.length - 1); else name = s;
+        }
+        else {
+            parent = NostalgyResolveFolder(s.substr(0, i));
+            name = s.substr(i + 1, s.length - i - 1);
+        }
+        if (parent) {
+            if (confirm("Create new folder [" + name + "]\nunder " + full_folder_name(parent) + "?")) {
+                parent.createSubfolder(name, msgWindow);
+                ClearNostalgyCache();
+                parent.updateFolder(msgWindow);
+                setTimeout(function() {
+                        f = NostalgyResolveFolder(s);
+                        if (f) {
+                            NostalgyRecordRecentFolder(f);
+                            nostalgy_command(f);
+                            return;
+                        }
+                        else
+                            alert("No folder " + s);
+                    }, 200);
+            } else
+                return;
+        } else
+            alert("No folder " + s);
+    }
   }
 }
 
@@ -465,7 +496,7 @@ function MailAuthor() {
 function MailAuthorName()
 {
   var msgHdr = gDBView.hdrForFirstSelectedMessage;
-  var headerParser = 
+  var headerParser =
  Components.classes["@mozilla.org/messenger/headerparser;1"].
    getService(Components.interfaces.nsIMsgHeaderParser);
  var emailAddress = headerParser.extractHeaderAddressMailboxes(null, msgHdr.author);
@@ -475,7 +506,7 @@ function MailAuthorName()
 function MailRecipName()
 {
   var msgHdr = gDBView.hdrForFirstSelectedMessage;
-  var headerParser = 
+  var headerParser =
  Components.classes["@mozilla.org/messenger/headerparser;1"].
    getService(Components.interfaces.nsIMsgHeaderParser);
  var emailAddress = headerParser.extractHeaderAddressMailboxes(null, msgHdr.recipients);
@@ -489,7 +520,7 @@ function MailSubject() {
  var s = gDBView.hdrForFirstSelectedMessage.mime2DecodedSubject.toLowerCase();
  var old;
 
- do { old = s; s = s.replace(/^\[fwd:|^fwd:|^fw:|^re:|^ |^e :|\]$/g, ""); } 
+ do { old = s; s = s.replace(/^\[fwd:|^fwd:|^fw:|^re:|^ |^e :|\]$/g, ""); }
  while (s != old);
 
  // do { old =s; s = s.replace(/^\[.*\]/g,""); } while (s != old);
@@ -517,10 +548,10 @@ function NostalgySuggest() {
 // r = last_folder_subject[MailSubject()];
 // if (r) { return(r); }
 
- if (nostalgy_completion_options.restrict_to_current_server) { 
-   return(last_folder_server[gDBView.msgFolder.server.key]); 
- } else { 
-   return(last_folder); 
+ if (nostalgy_completion_options.restrict_to_current_server) {
+   return(last_folder_server[gDBView.msgFolder.server.key]);
+ } else {
+   return(last_folder);
  }
 }
 
@@ -549,15 +580,15 @@ function NostalgyEnsureFolderIndex(builder, msgFolder)
   if (index == -1) {
     // if we couldn't find the folder, make all its ancestors visible
 
-    if (!msgFolder.parent) { throw 0; }  
+    if (!msgFolder.parent) { throw 0; }
 	// Folder not reachable in current view
 
     parent_idx = NostalgyEnsureFolderIndex(builder, msgFolder.parent);
     // maybe the folder is now visible
     index = builder.getIndexOfResource(msgFolder);
     // no: this means that the parent is closed, so open it.
-    if (index == -1) { 
-      builder.toggleOpenState(parent_idx); 
+    if (index == -1) {
+      builder.toggleOpenState(parent_idx);
       index = builder.getIndexOfResource(msgFolder);
     }
   }
@@ -574,7 +605,7 @@ function NostalgySelectLastMsg() {
 /*
     if (!NostalgySelectMessageByNavigationType(nsMsgNavigationType.firstUnreadMessage)) {
     NostalgySelectMessageByNavigationType(nsMsgNavigationType.lastMessage);
-  }	
+  }
 */
   }
 }
@@ -588,7 +619,7 @@ function NostalgyShowFolder(folder) {
   var folderTree = GetFolderTree();
   var totry = 1;
   var savedFolderView;
-  if (window.CycleFolderView) { 
+  if (window.CycleFolderView) {
     totry = kNumFolderViews;
     savedFolderView = gCurrentFolderView;
   }
@@ -599,7 +630,7 @@ function NostalgyShowFolder(folder) {
     try {
       var idx = NostalgyEnsureFolderIndex(folderTree.builderView, folder);
       ChangeSelection(folderTree, idx);
-      setTimeout(function() { SetFocusThreadPane(); 
+      setTimeout(function() { SetFocusThreadPane();
         var s = GetThreadTree().view.selection;
 	if (s.count == 0) { s.select(s.currentIndex); }
       }, 400);
@@ -642,7 +673,7 @@ function NostalgyMoveToFolderAndGo(folder) {
  NostalgyShowFolder(folder);
  nostalgy_selection_saved = null;
  nostalgy_on_move_completed = function() { nostalgy_selection_saved = sel; };
- setTimeout(function () { 
+ setTimeout(function () {
    if (!nostalgy_selection_saved) nostalgy_on_move_completed = null;
  }, 1000);
  return true;
@@ -664,8 +695,8 @@ function NostalgySuggested(cmd) {
 
 var NostalgyLastEscapeTimeStamp = 0;
 
-function isThreadPaneFocused() { 
-  return (WhichPaneHasFocus() == GetThreadTree()); 
+function isThreadPaneFocused() {
+  return (WhichPaneHasFocus() == GetThreadTree());
 }
 
 function NostalgyScrollMsg(d) {
@@ -715,7 +746,7 @@ function NostalgyEscape() {
   setTimeout(
     function(){ if (NostalgyEscapePressed==i) NostalgyEscapePressed = 0; },
     300);
-  if (NostalgyEscapePressed == 3) { 
+  if (NostalgyEscapePressed == 3) {
     // var o = NostalgySaveSelection();
 
     onClearSearch();
@@ -732,10 +763,10 @@ function NostalgyFocusMessagePane() {
 
   SetFocusMessagePane();
   var i = 10;
-  while (i > 0 && 
-         top.document.commandDispatcher.focusedWindow.name != "messagepane") 
-  { 
-    document.commandDispatcher.advanceFocus(); i--; 
+  while (i > 0 &&
+         top.document.commandDispatcher.focusedWindow.name != "messagepane")
+  {
+    document.commandDispatcher.advanceFocus(); i--;
   }
 }
 
@@ -770,7 +801,7 @@ function NostalgySearchSender() {
   onEnterInSearchBar();
   SetFocusThreadPane();
   gDBView.selectMsgByKey(key);
-  } catch (ex) { 
+  } catch (ex) {
    input.focus();
    last_cycle_restrict = 0; input.value = "";  onEnterInSearchBar();
    SetFocusThreadPane();
@@ -781,7 +812,7 @@ function NostalgySearchSender() {
 function NostalgySearchSelectAll(select) {
   if (!nostalgy_search_focused) return false;
 
-  if (!gSearchInput || gSearchInput.value == "" 
+  if (!gSearchInput || gSearchInput.value == ""
       || gSearchInput.showingSearchCriteria) {
     SetFocusThreadPane();
     return true;
@@ -790,7 +821,7 @@ function NostalgySearchSelectAll(select) {
   initializeSearchBar();
   nostalgy_on_search_done = function() {
     nostalgy_on_search_done = null;
-    if (select) setTimeout(function(){ gDBView.selection.selectAll(); },0); 
+    if (select) setTimeout(function(){ gDBView.selection.selectAll(); },0);
     else NostalgySelectLastMsg();
     SetFocusThreadPane();
   };
@@ -804,8 +835,8 @@ function NostalgySearchSelectAll(select) {
 
 function NostalgyShowSearchMode() {
   var o = gEBI("quick-search-menupopup");
-  o.showPopup(gEBI("quick-search-button"),-1,-1,"tooltip", 
-	      "bottomleft", "topleft");  
+  o.showPopup(gEBI("quick-search-button"),-1,-1,"tooltip",
+	      "bottomleft", "topleft");
 }
 
 function NostalgyEnterSearch() {
@@ -821,7 +852,7 @@ function NostalgyLeaveSearch() {
   o.hidePopup();
 }
 
-function NostalgySearchMode(current,dir) {  
+function NostalgySearchMode(current,dir) {
   var input = GetSearchInput();
   var popup = gEBI("quick-search-menupopup");
   if (!popup) return;
@@ -845,7 +876,7 @@ function onNostalgyKeyPressCapture(ev) {
     {
     // ugly hack: it takes some time for the folderBox to be focused
     if (ev.charCode) {
-      nostalgy_folderBox.value =  nostalgy_folderBox.value + 
+      nostalgy_folderBox.value =  nostalgy_folderBox.value +
           String.fromCharCode(ev.charCode);
     }
     NostalgyStopEvent(ev);
@@ -865,7 +896,7 @@ function onNostalgyKeyPressCapture(ev) {
       return;
     }
     if (ev.keyCode == KeyEvent.DOM_VK_ESCAPE) {
-      Search(""); 
+      Search("");
       setTimeout(SetFocusThreadPane,0);
       NostalgyStopEvent(ev);
       return;
@@ -883,7 +914,7 @@ function onNostalgyKeyPress(ev) {
       NostalgyStopEvent(ev);
     } else
     if (!in_message_window && ev.charCode == 102) { // F
-      SetFocusFolderPane();
+      GetFolderTree().focus();
       NostalgyStopEvent(ev);
     } else
     if (!in_message_window && ev.charCode == 105) { // I
@@ -892,11 +923,11 @@ function onNostalgyKeyPress(ev) {
       NostalgyStopEvent(ev);
     }
     return;
-  } 
+  }
 
   var kn = RecognizeKey(ev);
-  if (ev.charCode && ev.originalTarget.localName == "input" 
-      && !ev.ctrlKey && !ev.altKey) 
+  if (ev.charCode && ev.originalTarget.localName == "input"
+      && !ev.ctrlKey && !ev.altKey)
     return;
   var k = nostalgy_active_keys[kn];
   if (k && ParseCommand(k)) NostalgyStopEvent(ev);
@@ -944,12 +975,12 @@ function NostalgySaveAndGoSuggested() {
 }
 
 function onNostalgyKeyDown(ev) {
-  if ((ev.keyCode == KeyEvent.DOM_VK_ALT || 
+  if ((ev.keyCode == KeyEvent.DOM_VK_ALT ||
        ev.keyCode == KeyEvent.DOM_VK_CONTROL)
       && nostalgy_search_focused) NostalgyShowSearchMode();
 }
 function onNostalgyKeyUp(ev) {
-  if ((ev.keyCode == KeyEvent.DOM_VK_ALT || 
+  if ((ev.keyCode == KeyEvent.DOM_VK_ALT ||
        ev.keyCode == KeyEvent.DOM_VK_CONTROL)
      && nostalgy_search_focused
      && !nostalgy_completion_options.always_show_search_mode) {
diff --git a/install.rdf b/install.rdf
index c64944a..3cfc6f4 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,11 +5,11 @@
   <RDF:Description RDF:about="rdf:#$rVuKA2"
                    em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
                    em:minVersion="1.5"
-                   em:maxVersion="2.0.0.*" />
+                   em:maxVersion="3.0.0.*" />
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    em:id="nostalgy at alain.frisch"
                    em:name="Nostalgy"
-                   em:version="0.2.15"
+                   em:version="0.2.16"
                    em:creator="Alain Frisch"
                    em:description="Adds shortcuts to change folder, move message, with folder completion"
                    em:homepageURL="http://alain.frisch.fr/soft_mozilla.html"

-- 
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