[Pkg-mozext-commits] [nostalgy] 89/252: *** empty log message ***

David Prévot taffit at moszumanska.debian.org
Tue Jun 14 15:24:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository nostalgy.

commit 9388e52135c208a8d83a8647f6c506000d197678
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Mon May 28 12:09:29 2007 +0000

    *** empty log message ***
---
 CHANGES                        |  1 +
 content/edit_prefs.js          | 24 ++++----------
 content/edit_prefs.xul         |  1 +
 content/messageOverlay.xul     | 12 +------
 content/nostalgy.js            | 72 ++++++++++++++++--------------------------
 content/nostalgy_keys.js       | 19 +++++++++++
 content/thunderbirdOverlay.xul | 26 +--------------
 install.rdf                    |  2 +-
 locale/en-US/nostalgy.dtd      |  3 --
 9 files changed, 59 insertions(+), 101 deletions(-)

diff --git a/CHANGES b/CHANGES
index 5fcbafa..f3de2a0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ Since 0.2.13
   - a system to export/import Nostalgy's rules (through e-mails)
   - bug fix: custom shortcuts should not be recognized when typing
     in a text box (QuickSearch or Nostalgy's completion box)
+  - make it work with TB 3.0 (tested with 3.0a1pre 20070527)
 
 0.2.12
   - bug fix: use the mime-decoded version for the subject (for matching
diff --git a/content/edit_prefs.js b/content/edit_prefs.js
index be10367..e67e302 100644
--- a/content/edit_prefs.js
+++ b/content/edit_prefs.js
@@ -10,17 +10,6 @@ var kKeysPrefs = "extensions.nostalgy.keys.";
 var kCustomActionsPrefs = "extensions.nostalgy.actions.";
 var max_custom = (-1);
 
-var keys = [
- ["save","Save message","S"],
- ["save_suggest","Save as suggested","shift S"],
- ["copy","Copy message","C"],
- ["copy_suggest","Copy as suggested","shift C"],
- ["go","Go to folder","G"],
- ["go_suggest","Go as suggested","shift G"],
- ["hide_folders","Hide folder pane","L"],
- ["search_sender","Show messages with same sender/same subject","`"],
-];
-
 (function () {
    var m = {
             '\b': '\\b',
@@ -218,8 +207,9 @@ function onAcceptChanges() {
     prefs.setBoolPref("extensions.nostalgy."+n,	gEBI(n).checked);
  
   if (wait_key) { wait_key.value = wait_key_old; wait_key = null; }
-  for (var i in keys)
-    prefs.setCharPref(kKeysPrefs+keys[i][0],gEBI("key_" + keys[i][0]).value);
+  for (var i in nostalgy_keys)
+    prefs.setCharPref(kKeysPrefs+nostalgy_keys[i][0],
+    gEBI("key_" + nostalgy_keys[i][0]).value);
 
 
   var a = prefs.getChildList(kKeysPrefs, { });
@@ -316,12 +306,12 @@ function onNostalgyLoad() {
    gEBI(n).checked = getBoolPref(prefs, n);
 
  key_rows = gEBI("key_rows");
- for (var i = 0; i < keys.length; i++) {
-  var v = keys[i][2];
+ for (var i = 0; i < nostalgy_keys.length; i++) {
+  var v = nostalgy_keys[i][2];
   try {
-    v = prefs.getCharPref(kKeysPrefs + keys[i][0]);
+    v = prefs.getCharPref(kKeysPrefs + nostalgy_keys[i][0]);
   } catch (ex) { }
-  key_rows.appendChild(createKeyRow(keys[i][0],keys[i][1],v));
+  key_rows.appendChild(createKeyRow(nostalgy_keys[i][0],nostalgy_keys[i][1],v));
  }
 
  var a = prefs.getChildList(kKeysPrefs, { });
diff --git a/content/edit_prefs.xul b/content/edit_prefs.xul
index aaf2d1d..e85d601 100644
--- a/content/edit_prefs.xul
+++ b/content/edit_prefs.xul
@@ -12,6 +12,7 @@
         title="Nostalgy Preferences">
 
  <script src="folders.js"/>
+ <script src="nostalgy_keys.js"/>
  <script src="edit_prefs.js"/>
 
  <tabbox style="width:800px">
diff --git a/content/messageOverlay.xul b/content/messageOverlay.xul
index 297e409..c08abef 100644
--- a/content/messageOverlay.xul
+++ b/content/messageOverlay.xul
@@ -4,19 +4,9 @@
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
  <script src="folders.js"/>
+ <script src="nostalgy_keys.js"/>
  <script src="nostalgy.js"/>
 
- <keyset id="mailKeys">
-  <key key="S" id = "nostalgy_key_save"
-       oncommand="NostalgyCmd('&nostalgy.move-memo;', NostalgyMoveToFolder, true);"/>
-  <key key="S" modifiers="shift" id = "nostalgy_key_save_suggest"
-       oncommand="NostalgySuggested('&nostalgy.move-memo;',NostalgyMoveToFolder);"/>
-  <key key="C" id = "nostalgy_key_copy"
-       oncommand="NostalgyCmd('&nostalgy.copy-memo;', NostalgyCopyToFolder, true);"/>
-  <key key="C" modifiers="shift" id = "nostalgy_key_copy_suggest"
-       oncommand="NostalgySuggested('&nostalgy.copy-memo;',NostalgyCopyToFolder);"/>
- </keyset>
-
  <commandset id="tasksCommands">
    <command id="cmd_nostalgyconfig" label="Nostalgy..." 
      oncommand="openDialog('chrome://nostalgy/content/edit_prefs.xul', 'nostalgy', 'resizable');"/>
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 4326930..0921a25 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -8,28 +8,9 @@ var nostalgy_label = null;
 var nostalgy_th_statusBar = null;
 var nostalgy_cmdLabel = null;
 var nostalgy_extracted_rules = "";
-var custom_keys = { };
+var nostalgy_active_keys = { };
 var timeout_regkey = 0;
 
-/** Keys **/
-
-function NostalgySetKey(s,k) {
-  k.removeAttribute("modifiers");
-  k.removeAttribute("key");
-  k.removeAttribute("keycode");
-  k.removeAttribute("charcode");
-
-  if (s == "(disabled)") { k.setAttribute("keycode","VK_SHIFT"); return; }
-
-  var comps = s.split(/ /);
-  var mods = comps.slice(0,comps.length - 1).join(" ");
-  s = comps[comps.length-1];
-  
-  if (mods) k.setAttribute("modifiers",mods);
-  if (s.length == 1) k.setAttribute("key",s);
-  else k.setAttribute("keycode","VK_" + s);
-}
-
 /** Rules **/
 
 function match_contains(field,contain) {
@@ -63,26 +44,23 @@ var NostalgyRules =
   },
 
   register_keys: function() {
-    var keys = document.getElementsByTagName("key");
-    for (var i in keys) {
-      if (keys[i].id) {
-       var f = keys[i].id.match(/nostalgy_key_(.+)/);
-       if (f)
-       try {
-         var v = this._branch.getCharPref("keys." + f[1]);
-         NostalgySetKey(v,keys[i]);
-       } catch (ex) { }
-      }
+    nostalgy_active_keys = { };
+    for (var i in nostalgy_keys) {
+      var k = "";
+      try {
+	k = this._branch.getCharPref("keys." + nostalgy_keys[i][0]);
+      } catch (ex) { k = nostalgy_keys[i][2]; }
+      nostalgy_active_keys[k] = nostalgy_keys[i][3];
     }
+    
     var a = this._branch.getChildList("actions.", { });
-    custom_keys = { };
     var s = "";
     for (var i in a) {
       var id = a[i].substr(8);
       try {
         var key = this._branch.getCharPref("keys." + id);
         var cmd = this._branch.getCharPref("actions." + id);
-       custom_keys[key] = cmd;
+       nostalgy_active_keys[key] = cmd;
       } catch (ex) { }
     }
   },
@@ -558,14 +536,13 @@ function NostalgyCopyToFolder(folder) {
  else gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages,folder);
 }
 
-function NostalgySuggested(lab,cmd) {
- if (gsuggest_folder) { cmd(gsuggest_folder); }
+function NostalgySuggested(cmd) {
+  if (gsuggest_folder) cmd(gsuggest_folder);
 }
 
 
 
 var NostalgyLastEscapeTimeStamp = 0;
-var NostalgyEscapeDown = false;
 
 function isThreadPaneFocused() { 
   return (WhichPaneHasFocus() == GetThreadTree()); 
@@ -646,15 +623,15 @@ function NostalgySearchSender() {
 
 function onNostalgyKeyPress(ev) {
   if (NostalgyEscapePressed >= 1) {
-    if (ev.charCode == 109) { // M
+    if (!in_message_window && ev.charCode == 109) { // M
       NostalgyFocusMessagePane();
       ev.preventDefault();
     } else
-    if (ev.charCode == 102) { // F
+    if (!in_message_window && ev.charCode == 102) { // F
       SetFocusFolderPane();
       ev.preventDefault();
     } else
-    if (ev.charCode == 105) { // I
+    if (!in_message_window && ev.charCode == 105) { // I
       GetSearchInput().focus();
       ev.preventDefault();
     }
@@ -671,11 +648,15 @@ function onNostalgyKeyPress(ev) {
     return;
   }
   if (ev.originalTarget.localName == "input") return;
-  var k = custom_keys[RecognizeKey(ev)];
+  var k = nostalgy_active_keys[RecognizeKey(ev)];
   if (k) { ParseCommand(k); ev.preventDefault(); }
 }
 
 function ParseCommand(k) {
+  if (k.indexOf("JS:") == 0) {
+    eval(k.substr(3,k.length - 3));
+    return;
+  }
   var spl = k.match(/(.*) -> (.*)/);
   var folder = FindFolderExact(spl[2]);
   if (!folder) { alert("Cannot find folder " + spl[2]); return; }
@@ -687,11 +668,14 @@ function ParseCommand(k) {
   }
 }
 
+function NostalgyGoCommand() {
+  if (!in_message_window) NostalgyCmd('Go to folder:', NostalgyShowFolder, false);
+}
+function NostalgyGoSuggestedCommand() {
+  if (!in_message_window) NostalgySuggested(NostalgyShowFolder);
+}
+
 window.addEventListener("load", onNostalgyLoad, false);
 window.addEventListener("resize", onNostalgyResize, false);
 window.addEventListener("unload", onNostalgyUnload, false);
-
-if (!in_message_window)
-  window.addEventListener("keypress", onNostalgyKeyPress, false);
-
-
+window.addEventListener("keypress", onNostalgyKeyPress, false);
diff --git a/content/nostalgy_keys.js b/content/nostalgy_keys.js
new file mode 100644
index 0000000..6ed72f1
--- /dev/null
+++ b/content/nostalgy_keys.js
@@ -0,0 +1,19 @@
+var nostalgy_keys = [
+  ["save","Save message","S", 
+   "JS:NostalgyCmd('Move messages to:', NostalgyMoveToFolder, true);"],
+  ["save_suggest","Save as suggested","shift S", 
+   "JS:NostalgySuggested(NostalgyMoveToFolder);"],
+  ["copy","Copy message","C",
+   "JS:NostalgyCmd('Copy messages to:', NostalgyCopyToFolder, true);"],
+  ["copy_suggest","Copy as suggested","shift C",
+   "JS:NostalgySuggested(NostalgyCopyToFolder);"],
+  ["go","Go to folder","G",
+   "JS:NostalgyGoCommand();"],
+  ["go_suggest","Go as suggested","shift G",
+   "JS:NostalgyGoSuggestedCommand();"],
+  ["hide_folders","Hide folder pane","L",
+   "JS:NostalgyCollapseFolderPane();"],
+  ["search_sender","Show messages with same sender/same subject","`",
+   "JS:NostalgySearchSender();"]
+];
+
diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul
index caf4913..8f2e7d6 100644
--- a/content/thunderbirdOverlay.xul
+++ b/content/thunderbirdOverlay.xul
@@ -4,6 +4,7 @@
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
  <script src="folders.js"/>
+ <script src="nostalgy_keys.js"/>
  <script src="nostalgy.js"/>
 
  <commandset id="tasksCommands">
@@ -18,31 +19,6 @@
 
 
  <keyset id="mailKeys">
-  <key id="nostalgy_key_go"
-       key="G" 
-       oncommand="NostalgyCmd('&nostalgy.go-memo;', NostalgyShowFolder, false);"/>
-  <key id="nostalgy_key_go_suggest"
-       key="G" modifiers="shift" 
-       oncommand="NostalgySuggested('&nostalgy.go-memo;', NostalgyShowFolder);"/>
-  <key id = "nostalgy_key_save"
-       key="S" 
-       oncommand="NostalgyCmd('&nostalgy.move-memo;', NostalgyMoveToFolder, true);"/>
-  <key id = "nostalgy_key_save_suggest"
-       key="S" modifiers="shift" 
-       oncommand="NostalgySuggested('&nostalgy.move-memo;',NostalgyMoveToFolder);"/>
-  <key id = "nostalgy_key_copy"
-       key="C" 
-       oncommand="NostalgyCmd('&nostalgy.copy-memo;', NostalgyCopyToFolder, true);"/>
-  <key id = "nostalgy_key_copy_suggest"
-       key="C" modifiers="shift" 
-       oncommand="NostalgySuggested('&nostalgy.copy-memo;',NostalgyCopyToFolder);"/>
-  <key id = "nostalgy_key_hide_folders"
-       key="L" 
-       oncommand="NostalgyCollapseFolderPane();"/>
-  <key id = "nostalgy_key_search_sender"
-       key="`" 
-       oncommand="NostalgySearchSender();"/>
-
   <key keycode="VK_LEFT" modifiers="control" 
        oncommand="NostalgyScrollMsg(-50);"/>
   <key keycode="VK_RIGHT" modifiers="control" 
diff --git a/install.rdf b/install.rdf
index 3405ad8..853bb13 100644
--- a/install.rdf
+++ b/install.rdf
@@ -16,5 +16,5 @@
   <RDF:Description RDF:about="rdf:#$3Mz8c3"
                    em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
                    em:minVersion="1.5"
-                   em:maxVersion="2.0.0.*" />
+                   em:maxVersion="3.0.0.*" />
 </RDF:RDF>
diff --git a/locale/en-US/nostalgy.dtd b/locale/en-US/nostalgy.dtd
index a906244..9d021dd 100644
--- a/locale/en-US/nostalgy.dtd
+++ b/locale/en-US/nostalgy.dtd
@@ -1,6 +1,3 @@
-<!ENTITY nostalgy.move-memo     "Move messages to:">
-<!ENTITY nostalgy.copy-memo     "Copy messages to:">
-<!ENTITY nostalgy.go-memo       "Go to folder:">
 <!ENTITY nostalgy.memo          "(G)o (S)ave (C)opy">
 <!ENTITY nostalgy.memomessage   "(S)ave (C)opy">
 

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