[Pkg-mozext-commits] [nostalgy] 18/235: *** empty log message ***

David Prévot taffit at alioth.debian.org
Tue Oct 8 20:41:28 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 4c225ad1585eba0897fe5b5f785b8cbb8fc14320
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Tue Aug 29 16:28:48 2006 +0000

    *** empty log message ***
    
    
    git-svn-id: http://nostalgy.googlecode.com/svn/trunk@18 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
 CHANGES                        |    5 +++++
 Makefile                       |    4 +++-
 content/about.xhtml            |   22 +++++++++++++++++----
 content/edit_prefs.js          |   14 +++++++++++++-
 content/edit_prefs.xul         |    7 ++++++-
 content/folders.js             |   17 +++++++++++++++--
 content/messageOverlay.xul     |   10 ++++++++--
 content/nostalgy.js            |   41 +++++++++++++++++++++++++---------------
 content/thunderbirdOverlay.xul |    7 +++----
 files                          |    9 ++++-----
 install.rdf                    |    2 +-
 11 files changed, 102 insertions(+), 36 deletions(-)

diff --git a/CHANGES b/CHANGES
index d14b2e3..56f9071 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+0.1.6
+  - add the rule system (quick selection of a default folder for messages)
+  - add the Shift-Left/Shift-Right keys (scroll the message while the
+    thread pane is focused)
+
 0.1.5
   - add the commands:
     L: hide/show the folder pane
diff --git a/Makefile b/Makefile
index 014993c..a533b67 100644
--- a/Makefile
+++ b/Makefile
@@ -7,4 +7,6 @@ clean:
 
 
 install:
-	scp CHANGES clipper.ens.fr:www/info/CHANGES_NOSTALGY
\ No newline at end of file
+	scp CHANGES clipper.ens.fr:www/info/CHANGES_NOSTALGY
+	scp content/about.xhtml clipper.ens.fr:www/info/ABOUT_NOSTALGY.html
+	scp nostalgy.xpi clipper.ens.fr:www/nostalgy-current.xpi
\ No newline at end of file
diff --git a/content/about.xhtml b/content/about.xhtml
index d941f8f..a0f82b9 100644
--- a/content/about.xhtml
+++ b/content/about.xhtml
@@ -21,8 +21,11 @@
 
    <h2>Nostalgy</h2>
 
+   <p>
    Nostalgy adds several keyboard shortcuts to improve your
-   productivity with Thunderbird.
+   productivity with Thunderbird. A custom preference dialog 
+   for Nostalgy is available through the Tools menu.
+   </p>
 
    <h3>Folder commands</h3>
 
@@ -38,11 +41,17 @@
 
    <p>The G, S and C commands open an auto-completion box 
       (in place of the status bar) 
-      where you can select a folder by typing part of its name. Regular 
+      where you can select a folder by typing part of its name. 
+      Matching is case-insensitive. Regular 
       expressions are accepted as well (and .. is a short-hand for .*
       meaning: any sequence of characters). You can choose the first
       suggested completion with Return, or first choose another one with
       the Up/Down keys. You can cancel the command with Escape.</p>
+
+   <p>It is possible to restrict (see the preference dialog)
+   the completion to the folders on the
+   same server as the currently displayed folder.</p>
+
    <p>The S and C commands also work in a standalone message window.</p>
 
    <h3>3-pane navigation</h3>
@@ -72,8 +81,13 @@
    headers. 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 a command in the Tools menu.</p>
+   Nostalgy's rules can be edited from the preference dialog.</p>
+
+   <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.
+   </p>
 
    <h3>About Nostalgy...</h3>
    <p>The Nostalgy extension has been written by Alain Frisch (<tt>Alain.Frisch at inria.fr</tt>). Comments ands suggestions are welcome!</p>
diff --git a/content/edit_prefs.js b/content/edit_prefs.js
index 975fbf7..716085d 100644
--- a/content/edit_prefs.js
+++ b/content/edit_prefs.js
@@ -1,4 +1,7 @@
+function gEBI(s) { return document.getElementById(s); }
+
 var gList = null;
+var gRestrict = null;
 
 (function () {
    var m = {
@@ -94,6 +97,8 @@ function onAcceptChanges() {
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].
                          getService(Components.interfaces.nsIPrefBranch);
   prefs.setCharPref("extensions.nostalgy.rules", MkPrefStr());
+  prefs.setBoolPref("extensions.nostalgy.restrict_to_current_server", 
+	gRestrict.checked);
   window.close();
 }
 
@@ -111,10 +116,12 @@ function DoDelete() {
 }
 
 function onNostalgyLoad() {
-  gList = document.getElementById("rules");
+  gList = gEBI("rules");
+  gRestrict = gEBI("restrict_to_current_server");
 
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].
                          getService(Components.interfaces.nsIPrefBranch);
+
   var r = eval(prefs.getCharPref("extensions.nostalgy.rules"));
   var i;
   for (i = 0; i < r.length; i++) { 
@@ -122,6 +129,11 @@ function onNostalgyLoad() {
     r[i].contains = r[i].contains;
     CreateItem(r[i]); 
   }
+
+ var b = false;
+ try { b=prefs.getBoolPref("extensions.nostalgy.restrict_to_current_server"); }
+ catch (ex) { }
+ gRestrict.checked = b;
 }
 
 function onKeyPress(ev) {
diff --git a/content/edit_prefs.xul b/content/edit_prefs.xul
index 06243a4..50bd79f 100644
--- a/content/edit_prefs.xul
+++ b/content/edit_prefs.xul
@@ -37,11 +37,16 @@ shortcuts to move/copy the message to this folder.</label>
   <hbox>
   <button label="Edit" accesskey="E" oncommand="DoEdit();"/>
   <button label="Delete" accesskey="D" oncommand="DoDelete();"/>
-
   <button label="New rule" accesskey="N" oncommand="DoNewRule();"/>
   </hbox>
  </vbox>
  </groupbox>
+
+ <groupbox>
+   <checkbox label="Restrict folder completion to the current server"
+             id="restrict_to_current_server" accesskey="R"/>
+ </groupbox>
+
 </vbox>
 
  <keyset>
diff --git a/content/folders.js b/content/folders.js
index 004b4c1..9080e13 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -1,3 +1,5 @@
+var restrict_to_current_server = false;
+
 function NostalgyCrop(s,len) {
   var l = s.length;
   if (l < len) return s;
@@ -127,14 +129,14 @@ function FindFolderExact(uri) {
  var ret = null;
  uri = uri.toLowerCase();
  try {
-  IterateFolders(function (folder) {
+  IterateFoldersAllServers(function (folder) {
    if (folder_name(folder).toLowerCase() == uri) { ret = folder; throw(0); }
   });
  } catch (ex) { }
  return ret;
 }
 
-function IterateFolders(f) {
+function IterateFoldersAllServers(f) {
  var amService = 
     Components.classes["@mozilla.org/messenger/account-manager;1"]
               .getService(Components.interfaces.nsIMsgAccountManager);
@@ -142,6 +144,7 @@ function IterateFolders(f) {
  var servers= amService.allServers;
  var seen = { };
  var i;
+
  for (i = 0; i < servers.Count(); i++) {
   var server = servers.GetElementAt(i).
                QueryInterface(Components.interfaces.nsIMsgIncomingServer);
@@ -171,3 +174,13 @@ function IterateSubfolders(folder,f) {
  }
 }  
 
+function IterateFoldersCurrentServer(f) {
+ if (!window.gDBView) { alert("BLA!"); }
+ var server = gDBView.msgFolder.server;
+ IterateSubfolders(server.rootMsgFolder,f);
+}
+
+function IterateFolders(f) {
+ if (restrict_to_current_server) { IterateFoldersCurrentServer(f); }
+ else { IterateFoldersAllServers(f); }
+}
\ No newline at end of file
diff --git a/content/messageOverlay.xul b/content/messageOverlay.xul
index 19853b4..9dda315 100644
--- a/content/messageOverlay.xul
+++ b/content/messageOverlay.xul
@@ -7,8 +7,14 @@
  <script src="nostalgy.js"/>
 
  <keyset id="mailKeys">
-  <key key="S" oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, '');"/>
-  <key key="C" oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
+  <key key="S" 
+       oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, '');"/>
+  <key key="S" modifiers="shift" 
+       oncommand="NostalgySuggested('&nostalgy.move-memo;',MoveToFolder);"/>
+  <key key="C" 
+       oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
+  <key key="C" modifiers="shift" 
+       oncommand="NostalgySuggested('&nostalgy.copy-memo;',CopyToFolder);"/>
  </keyset>
 
  <commandset id="globalCommandset">
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 0774786..a69dee4 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -1,5 +1,7 @@
 function gEBI(s) { return document.getElementById(s); }
 
+var in_message_window = !window.SetFocusFolderPane;
+
 var nostalgy_folderBox = null;
 var nostalgy_statusBar = null;
 var nostalgy_label = null;
@@ -19,6 +21,8 @@ var NostalgyRules =
         this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
     this._branch2.addObserver("", this, false);
     this.get_rules();
+    restrict_to_current_server = 
+        this._branch.getBoolPref("restrict_to_current_server");
   },
 
   unregister: function()
@@ -43,6 +47,11 @@ var NostalgyRules =
     switch (aData) {
       case "rules":
         this.get_rules();
+        if (!in_message_window) { NostalgyDefLabel(); }
+        break;
+      case "restrict_to_current_server":
+        restrict_to_current_server = 
+           this._branch.getBoolPref("restrict_to_current_server");
         break;
     }
   },
@@ -51,6 +60,7 @@ var NostalgyRules =
   {
     var folder = null;
     var rules = this.rules;
+    var i = 0;
     for (i = 0; (i < rules.length) && (!folder); i++) {
       var r = rules[i];
       if ((r.field != "subject") && (sender.indexOf(r.contains) >= 0)
@@ -69,8 +79,8 @@ NostalgyRules.register();
 var default_label = "";
 var focus_saved = null;
 var command = null;
-var last_folder_author = new Array();
-var last_folder_subject = new Array();
+//var last_folder_author = new Array();
+//var last_folder_subject = new Array();
 var last_folder = null;
 var gsuggest_folder = null;
 
@@ -85,7 +95,9 @@ function onNostalgyLoad() {
  default_label = nostalgy_label.value;
 
 
- gEBI("threadTree").addEventListener("select", NostalgyDefLabel, false); 
+ if (!in_message_window) {
+   gEBI("threadTree").addEventListener("select", NostalgyDefLabel, false); 
+ }
 
  var saved_str = "";
  nostalgy_folderBox.addEventListener("keydown", 
@@ -164,15 +176,17 @@ function MailSubject() {
 }
 
 function register_folder(folder) {
- last_folder_author[MailAuthor()] = folder;
- last_folder_subject[MailSubject()] = folder;
- last_folder = folder
+// last_folder_author[MailAuthor()] = folder;
+// last_folder_subject[MailSubject()] = folder;
+  last_folder = folder
 }
 
 function NostalgySuggest() {
  var r = null;
- r = NostalgyRules.apply(MailAuthor(), MailSubject());
- if (r) { return(r); }
+ try {
+  r = NostalgyRules.apply(MailAuthor(), MailSubject());
+  if (r) { return(r); }
+ } catch (ex) { }
 
 // r = last_folder_author[MailAuthor()];
 // if (r) { return(r); }
@@ -180,8 +194,7 @@ function NostalgySuggest() {
 // r = last_folder_subject[MailSubject()];
 // if (r) { return(r); }
 
-// return(last_folder);
-  return(null);
+ return(last_folder);
 }
 
 /**  Commands **/
@@ -201,10 +214,8 @@ function CopyToFolder(folder) {
  gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages,folder);
 }
 
-function NostalgyAgain(lab,cmd) {
- if (gsuggest_folder) {
-   cmd(gsuggest_folder);
- }
+function NostalgySuggested(lab,cmd) {
+ if (gsuggest_folder) { cmd(gsuggest_folder); }
 }
 
 
@@ -239,6 +250,6 @@ function onNostalgyKeyPress(ev) {
 
 
 window.addEventListener("load", onNostalgyLoad, false);
-if (SetFocusFolderPane) {
+if (!in_message_window) {
   window.addEventListener("keypress", onNostalgyKeyPress, false);
 }
\ No newline at end of file
diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul
index e74ec00..2d36e0c 100644
--- a/content/thunderbirdOverlay.xul
+++ b/content/thunderbirdOverlay.xul
@@ -7,7 +7,7 @@
  <script src="nostalgy.js"/>
 
  <commandset id="globalCommandset">
-   <command id="cmd_nostalgyconfig" label="Nostalgy rules..." 
+   <command id="cmd_nostalgyconfig" label="Nostalgy..." 
      oncommand="openDialog('chrome://nostalgy/content/edit_prefs.xul', 'nostalgy', 'resizable');"/>
   </commandset>
 
@@ -23,13 +23,12 @@
   <key key="S" 
        oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, '');"/>
   <key key="S" modifiers="shift" 
-       oncommand="NostalgyAgain('&nostalgy.move-memo;',MoveToFolder);"/>
+       oncommand="NostalgySuggested('&nostalgy.move-memo;',MoveToFolder);"/>
   <key key="C" 
        oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
   <key key="C" modifiers="shift" 
-       oncommand="NostalgyAgain('&nostalgy.copy-memo;',CopyToFolder);"/>
+       oncommand="NostalgySuggested('&nostalgy.copy-memo;',CopyToFolder);"/>
   <key key="L" oncommand="NostalgyCollapseFolderPane();"/>
-  <key key="X" oncommand="NostalgySelect();"/>
  </keyset>
 
 
diff --git a/files b/files
index ff6eea1..081b440 100644
--- a/files
+++ b/files
@@ -1,14 +1,13 @@
 content/about.xul
-content/overlay.js
+content/edit_prefs.xul
 content/thunderbirdOverlay.xul
-content/NostalgyEditRule.xul
 content/messageOverlay.xul
 content/about.xhtml
-content/NostalgyPref.xul
-content/pref.js
+content/edit_rule.xul
 content/folders.js
 content/edit_rule.js
-content/rule.js
+content/edit_prefs.js
+content/nostalgy.js
 locale/en-US/nostalgy.dtd
 locale/en-US/nostalgy.properties
 defaults/preferences/nostalgy.js
diff --git a/install.rdf b/install.rdf
index 781571a..b197c95 100644
--- a/install.rdf
+++ b/install.rdf
@@ -4,7 +4,7 @@
   <Description about="urn:mozilla:install-manifest">
     <em:id>nostalgy at alain.frisch</em:id>
     <em:name>Nostalgy</em:name>
-    <em:version>0.1.5</em:version>
+    <em:version>0.1.6</em:version>
     <em:creator>Alain Frisch</em:creator>
     <em:description>Adds shortcuts to change folder, move message, with folder completion</em:description>
     <em:homepageURL>http://www.eleves.ens.fr/home/frisch/soft_mozilla.html</em:homepageURL>

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