From c99b5a08321c952ed58d67b8c37de9c97840254e Mon Sep 17 00:00:00 2001 From: opto Date: Wed, 19 Feb 2020 10:14:11 +0100 Subject: [PATCH] Closes #71, update for TB68 (#74) * cleanup some old files * version 1.0.20 * set right github address and id * v1.0.22 * v1.0.22b * v1.0.24 according to #74 * 1.0.25 various changes from #74 * v1.0.26 remove chrome.manifest * Revert "v1.0.26 remove chrome.manifest" This reverts commit bc417b0992e0679dcc27142cb3bc21a408889736. --- CHANGES => CHANGES.txt | 23 +- LICENSE | 4 +- Makefile | 14 - README.md | 14 +- build.sh | 132 --- chrome.manifest | 4 +- chrome.manifest.pack | 7 - chrome/components/nostalgy-autocomplete.js | 79 ++ {content => chrome/content}/about.xhtml | 84 +- {content => chrome/content}/about.xul | 0 {content => chrome/content}/composer.js | 4 +- .../content}/composerOverlay.xul | 0 {content => chrome/content}/dummy_window.xul | 0 {content => chrome/content}/edit_prefs.js | 52 +- {content => chrome/content}/edit_prefs.xul | 67 +- {content => chrome/content}/edit_rule.js | 9 + {content => chrome/content}/edit_rule.xul | 2 +- {content => chrome/content}/folders.js | 14 + {content => chrome/content}/header_parser.js | 20 +- .../content}/messageOverlay.xul | 37 +- {content => chrome/content}/misc.js | 4 +- {content => chrome/content}/nfpredict.js | 0 {content => chrome/content}/nostalgy.js | 48 +- chrome/content/nostalgy.js.bak | 920 ++++++++++++++++++ {content => chrome/content}/nostalgy_keys.js | 8 +- {content => chrome/content}/sqlite.js | 0 .../content}/thunderbirdOverlay.xul | 33 +- chrome/locale/en-US/nostalgy.dtd | 3 + chrome/locale/en-US/nostalgy.properties | 4 + components/nostalgy-autocomplete.js | 8 +- config_build.sh | 9 - defaults/preferences/nostalgy.js | 2 +- files | 24 - install.rdf | 40 - manifest.json | 25 + 35 files changed, 1310 insertions(+), 384 deletions(-) rename CHANGES => CHANGES.txt (96%) delete mode 100644 Makefile delete mode 100755 build.sh delete mode 100644 chrome.manifest.pack create mode 100644 chrome/components/nostalgy-autocomplete.js rename {content => chrome/content}/about.xhtml (77%) rename {content => chrome/content}/about.xul (100%) rename {content => chrome/content}/composer.js (94%) rename {content => chrome/content}/composerOverlay.xul (100%) rename {content => chrome/content}/dummy_window.xul (100%) rename {content => chrome/content}/edit_prefs.js (89%) rename {content => chrome/content}/edit_prefs.xul (81%) rename {content => chrome/content}/edit_rule.js (95%) rename {content => chrome/content}/edit_rule.xul (96%) rename {content => chrome/content}/folders.js (94%) rename {content => chrome/content}/header_parser.js (95%) rename {content => chrome/content}/messageOverlay.xul (67%) rename {content => chrome/content}/misc.js (94%) rename {content => chrome/content}/nfpredict.js (100%) rename {content => chrome/content}/nostalgy.js (95%) create mode 100644 chrome/content/nostalgy.js.bak rename {content => chrome/content}/nostalgy_keys.js (86%) rename {content => chrome/content}/sqlite.js (100%) rename {content => chrome/content}/thunderbirdOverlay.xul (75%) create mode 100644 chrome/locale/en-US/nostalgy.dtd create mode 100644 chrome/locale/en-US/nostalgy.properties delete mode 100644 config_build.sh delete mode 100644 files delete mode 100644 install.rdf create mode 100644 manifest.json diff --git a/CHANGES b/CHANGES.txt similarity index 96% rename from CHANGES rename to CHANGES.txt index f807445..88fda81 100644 --- a/CHANGES +++ b/CHANGES.txt @@ -1,7 +1,26 @@ -Next version +1.0.25 + +- Use Services for restart + +1.0.23, 1.0.24 + + - More (cosmetic, documentation) changes according to discussion in #74 + +1.0.22 + + - More update changes to TB 68 +1.0.15 + - Update code for TB 68 + - Add restart button for TB to utilities tab + +Changes in Nostalgy (original version) + +Next version (originally planned by Alain, maybe obsolete now) - #24: config setting for custom timeout after creating folder before moving email to it (Adam Kerz) - #60, #62: fix for TB 60.3 (h271fa GitHub user) - + + + 0.2.36 - Fix for TB 60 (thanks to lepokle GitHub user) diff --git a/LICENSE b/LICENSE index b5c665b..62b47d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2008 Alain Frisch +Copyright (c) 2008 - 2020 Alain Frisch +Copyright (c) 2019 - 2020 opto (Klaus Buecher) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,3 +20,4 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. + diff --git a/Makefile b/Makefile deleted file mode 100644 index cb4df6c..0000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -pack: - ./build.sh - sort files > files.sorted - mv files.sorted files - -clean: - rm -f nostalgy.jar nostalgy.xpi *~ - (cd content; rm -f *~) - - -install: - scp CHANGES frisch@frisch.fr:www/info/CHANGES_NOSTALGY - scp content/about.xhtml frisch@frisch.fr:www/info/ABOUT_NOSTALGY.html - scp nostalgy.xpi frisch@frisch.fr:www/info/nostalgy-current.xpi diff --git a/README.md b/README.md index ae90703..0b021c5 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,11 @@ save time by doing more operations with the keyboard. If you want to use Thunderbird without sacrificing the productivity you had with good old mutt/pine, this extension is for you! +It is especially useful if you have long folderlists and need to sort emails +into those folders. + Nostalgy adds keyboard shortcuts to change folder, move/copy messages, -with folder name auto-completion (using only the keyboard). Also +with folder name auto-completion (using only the keyboard). It also includes a system of rules to suggest a target folder for saving messages; re-creates Eudora's Alt-Click; facilitates navigation in the 3-pane window; makes it easy to change between To/Bcc/Cc fields in the @@ -19,11 +22,14 @@ header in the composer (To/Cc/Bcc), adding an attachment, hide the folder view. +Modified by opto (Klaus Buecher) for TB 68 + Installation ============ -The easiest way to install Thunderbird is through -https://addons.mozilla.org/en-US/thunderbird/addon/nostalgy/ . It + + +The easiest way to install Thunderbird is through Thunderbird`s addon page. It will automatically update itself when new versions are released. -You can also try the latest development version from http://alain.frisch.fr/info/nostalgy-current.xpi +You can also try the latest development versions from http://alain.frisch.fr/info/nostalgy-current.xpi or from https://github.com/opto/nostalgy/releases diff --git a/build.sh b/build.sh deleted file mode 100755 index 5fb40ae..0000000 --- a/build.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# build.sh -- builds JAR and XPI files for mozilla extensions -# by Nickolay Ponomarev -# (original version based on Nathan Yergler's build script) -# Most recent version is at - -# This script assumes the following directory structure: -# ./ -# chrome.manifest (optional - for newer extensions) -# install.rdf -# (other files listed in $ROOT_FILES) -# -# content/ | -# locale/ |} these can be named arbitrary and listed in $CHROME_PROVIDERS -# skin/ | -# -# defaults/ | -# components/ |} these must be listed in $ROOT_DIRS in order to be packaged -# ... | -# -# It uses a temporary directory ./build when building; don't use that! -# Script's output is: -# ./$APP_NAME.xpi -# ./$APP_NAME.jar (only if $KEEP_JAR=1) -# ./files -- the list of packaged files -# -# Note: It modifies chrome.manifest when packaging so that it points to -# chrome/$APP_NAME.jar!/* - -# -# default configuration file is ./config_build.sh, unless another file is -# specified in command-line. Available config variables: -APP_NAME= # short-name, jar and xpi files name. Must be lowercase with no spaces -CHROME_PROVIDERS= # which chrome providers we have (space-separated list) -CLEAN_UP= # delete the jar / "files" when done? (1/0) -ROOT_FILES= # put these files in root of xpi (space separated list of leaf filenames) -ROOT_DIRS= # ...and these directories (space separated list) -BEFORE_BUILD= # run this before building (bash command) -AFTER_BUILD= # ...and this after the build (bash command) - -if [ -z $1 ]; then - . ./config_build.sh -else - . $1 -fi - -if [ -z $APP_NAME ]; then - echo "You need to create build config file first!" - echo "Read comments at the beginning of this script for more info." - exit; -fi - -ROOT_DIR=`pwd` -TMP_DIR=build - -#uncomment to debug -#set -x - -# remove any left-over files from previous build -rm -f $APP_NAME.jar $APP_NAME.xpi files -rm -rf $TMP_DIR - -$BEFORE_BUILD - -mkdir --parents --verbose $TMP_DIR/chrome - -# generate the JAR file, excluding SVN and temporary files -JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar -echo "Generating $JAR_FILE..." -touch files -find content -path '*.svn*' -prune -o -type f -print | grep -v \~ >> files -find locale -path '*.svn*' -prune -o -type f -print | grep -v \~ >> files - - -cat files | zip -0 $JAR_FILE -@ -# The following statement should be used instead if you don't wish to use the JAR file -#cp --verbose --parents `cat files` $TMP_DIR/chrome - -# prepare components and defaults -echo "Copying various files to $TMP_DIR folder..." -for DIR in $ROOT_DIRS; do - mkdir $TMP_DIR/$DIR - FILES="`find $DIR -path '*.svn*' -prune -o -type f -print | grep -v \~`" - echo $FILES >> files - cp --verbose --parents $FILES $TMP_DIR -done - -# Copy other files to the root of future XPI. -for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do - cp --verbose $ROOT_FILE $TMP_DIR - if [ -f $ROOT_FILE ]; then - echo $ROOT_FILE >> files - fi -done - -rm -f $TMP_DIR/chrome.manifest -cp chrome.manifest.pack $TMP_DIR/chrome.manifest - -cd $TMP_DIR - -if [ -f "chrome.manifest" ]; then - echo "Preprocessing chrome.manifest..." - # You think this is scary? - #s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\2/ - #s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/ - # - # Then try this! (Same, but with characters escaped for bash :) -# sed -i -r "s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/" chrome.manifest -# sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest - - # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest) -fi - -# generate the XPI file -echo "Generating $APP_NAME.xpi..." -zip -r ../$APP_NAME.xpi * - -cd "$ROOT_DIR" - -echo "Cleanup..." -if [ $CLEAN_UP = 0 ]; then - # save the jar file - mv $TMP_DIR/chrome/$APP_NAME.jar . -else - rm ./files -fi - -# remove the working files -rm -rf $TMP_DIR -echo "Done!" - -$AFTER_BUILD diff --git a/chrome.manifest b/chrome.manifest index 435093a..fc4434a 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -1,5 +1,5 @@ -content nostalgy content/ -locale nostalgy en-US locale/en-US/ +content nostalgy chrome/content/ +locale nostalgy en-US chrome/locale/en-US/ overlay chrome://messenger/content/messenger.xul chrome://nostalgy/content/thunderbirdOverlay.xul overlay chrome://messenger/content/messageWindow.xul chrome://nostalgy/content/messageOverlay.xul overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://nostalgy/content/composerOverlay.xul diff --git a/chrome.manifest.pack b/chrome.manifest.pack deleted file mode 100644 index e9b1102..0000000 --- a/chrome.manifest.pack +++ /dev/null @@ -1,7 +0,0 @@ -content nostalgy jar:chrome/nostalgy.jar!/content/ -locale nostalgy en-US jar:chrome/nostalgy.jar!/locale/en-US/ -overlay chrome://messenger/content/messenger.xul chrome://nostalgy/content/thunderbirdOverlay.xul -overlay chrome://messenger/content/messageWindow.xul chrome://nostalgy/content/messageOverlay.xul -overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://nostalgy/content/composerOverlay.xul -component {0368fb30-62f8-11e3-949a-0800200c9a66} components/nostalgy-autocomplete.js -contract @mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete {0368fb30-62f8-11e3-949a-0800200c9a66} diff --git a/chrome/components/nostalgy-autocomplete.js b/chrome/components/nostalgy-autocomplete.js new file mode 100644 index 0000000..f6168fc --- /dev/null +++ b/chrome/components/nostalgy-autocomplete.js @@ -0,0 +1,79 @@ +const Cc = Components.classes; +const Ci = Components.interfaces; +const Cu = Components.utils; + var ChromeUtils = require("ChromeUtils.jsm"); +var {XPCOMUtils} = ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm'); +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + + +const CLASS_ID = Components.ID('0368fb30-62f8-11e3-949a-0800200c9a66'); +const CLASS_NAME = "Nostalgy Folder Autocomplete"; +const CONTRACT_ID = '@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete'; + + +// nsIAutoCompleteResult implementation + +function NostalgyDebug(aText) +{ + var csClass = Components.classes['@mozilla.org/consoleservice;1']; + var cs = csClass.getService(Components.interfaces.nsIConsoleService); + cs.logStringMessage(aText); +} + +function NostalgyAutoCompleteResult(searchString, results) { + const ACR = Ci.nsIAutoCompleteResult; + this._searchResult = results.length > 0 ? ACR.RESULT_SUCCESS : ACR.NOMATCH; + this._searchString = searchString; + this._results = results; +} + +NostalgyAutoCompleteResult.prototype = { + _searchString: "", + _searchResult: 0, + _results: [], + + get searchString() { return this._searchString; }, + get searchResult() { return this._searchResult; }, + get defaultIndex() { return 0; }, + get errorDescription() { return ""; }, + get matchCount() { return this._results.length; }, + getValueAt: function(index) { return this._results[index]; }, + getCommentAt: function(index) { return ""; }, + getStyleAt: function(index) { return null; }, + getImageAt : function (index) { return ""; }, + removeValueAt: function(index, removeFromDb) { this._results.splice(index, 1); }, + getLabelAt: function(index) { return this._results[index]; }, + QueryInterface: ChromeUtils.generateQI([ Ci.nsIAutoCompleteResult ]), +}; + + +// nsIAutoCompleteSearch implementation + +function NostalgyAutoCompleteSearch() { + this.wrappedJSObject = this; +} + +NostalgyAutoCompleteSearch.prototype = { + classID: CLASS_ID, + classDescription : CLASS_NAME, + contractID : CONTRACT_ID, + _f: {}, + _id: 0, + + attachGetValuesFunction: function(f) { this._id++; this._f[this._id] = f; return this._id; }, + + startSearch: function(searchString, searchParam, previousResult, listener) { + var searchResults = this._f[searchParam](searchString); + var result = new NostalgyAutoCompleteResult(searchString, searchResults); + listener.onSearchResult(this, result); + }, + + stopSearch: function() {}, + + QueryInterface: ChromeUtils.generateQI([ Ci.nsIAutoCompleteSearch ]) , +}; + + +// XPCOM component creation + +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ NostalgyAutoCompleteSearch ]); diff --git a/content/about.xhtml b/chrome/content/about.xhtml similarity index 77% rename from content/about.xhtml rename to chrome/content/about.xhtml index 02b64b5..d6da89f 100644 --- a/content/about.xhtml +++ b/chrome/content/about.xhtml @@ -22,9 +22,8 @@

Please visit Nostalgy's - homepage. It contains a copy of this page that might be - better read in your browser! From there, you can also download - the latest development version. + original homepage (upto TB 60) and for the adaptation to TB 68 " opto's github page . + You can also try the latest development versions from http://alain.frisch.fr/info/nostalgy-current.xpi, from https://github.com/nostalgy/nostalgy/releases or from https://github.com/opto/nostalgy/releases

@@ -37,8 +36,8 @@

  • We give here the default values for shortcuts. Most of them can be changed from the preference dialog.
  • -
  • Even if the key shortcuts above are written in - uppercase, you must not press Shift.
  • +
  • Even if the key shortcuts are written in + uppercase, you must not press Shift (= use lowercase letters on keyboard).
  • The ESC-X shortcuts means: press and release ESCAPE, and then press X within 300ms (ESC-ESC is thus like a double click on ESCAPE).
  • @@ -55,11 +54,11 @@ - - - + + - +
    ShortcutDescription
    GOpen a specific folder
    SMove the current message to a specific folder
    BMove the current message to a specific folder +
    gOpen a specific folder
    sMove the current message to a specific folder
    bMove the current message to a specific folder and go there
    CCopy the current message to a specific folder
    cCopy the current message to a specific folder

    @@ -75,18 +74,20 @@

    Before you type anything in the folder completion box, the popup - displays the most recently selected folders. You can choose one - of them with the UP/DOWN keys. + can display the most recently selected folders. You can choose one + of them with the UP/DOWN keys. Die to recent chnanges in TB, + you need to press back arrow followed by up arrow to populate this + box with the history.

    -

    +

    In the folder completion box, the TAB key activates a shell-like autocompletion mode (this feature must be enabled in Nostalgy's preference dialog; otherwise, TAB cycles through the possible completions). In this mode, the completed suggestions only mentions possible completions one level down in the folder hierarchy, and the TAB key itself automatically completes with - the longest unambiguous fragment. + the longest unambiguous fragment. (currently not working in TB68 - may be updated)

    @@ -96,21 +97,22 @@

    - The S,B,C commands can be applied to one or many messages. + The s,b,c commands can be applied to one or many messages.

    - The S and C commands also work in a standalone message window. + The s and c commands also work in a standalone message window. +

    - The G command also focuses the thread pane. If you were doing a + The g command also focuses the thread pane. If you were doing a QuickSearch (that is, if you had typed some text in the search box), the same search carried over to the new folder.

    - The B command preserves the selection. The moved messages will + The b command preserves the selection. The moved messages will be selected again in the target folder.

    @@ -119,7 +121,7 @@

    In the preference dialog, you can define any number of custom - keyboard shortcuts. A custom shortcut triggers a G, S, C or B + keyboard shortcuts. A custom shortcut triggers a g, s, c or b command to a specific folder.

    @@ -127,8 +129,8 @@

    3-pane navigation

    - Because of the G command, the folder pane becomes thus much less - useful, and it can be hidden with the L shortcut. + Because of the g command, the folder pane becomes thus much less + useful, and it can be hidden with the l shortcut. (Thunderbird already proposes a shortcut to show/hide the message pane: F8).

    @@ -143,15 +145,16 @@ - - - + + +
    ShortcutDescription
    LHide/show the folder pane
    ESC-FFocus the folder pane
    ESC-MFocus the message pane
    lHide/show the folder pane
    ESC-fFocus the folder pane
    ESC-mFocus the message pane
    ESC-ESCFocus the thread pane
    ESC-ESC-ESCFocus the thread pane, clear quick search box, select the "All" view
    Ctrl-Left/RightScroll the message from the thread pane
    +

    Rules

    @@ -185,24 +188,16 @@

    Exporting and importing rules

    -

    - Nostalgy comes with a backup system for rules. In the Preferences - dialog (tab "Rules"), there is a button "Send rules by email". - It allows you to send an e-mail to any address (your own address - by default). This special e-mail contains a copy of all your - rules. When you read such an e-mail, Thunderbird will show you a - button "Import Nostalgy rules" which lets you import - all the rules found in the message. -

    +

    - This import/export feature can be used as a backup mechanism, or + Nostalgy can import/export rules. This feature can be used as a backup mechanism, or to exchange rules between various computer or Thunderbird profiles.

    - IMPORTANT: importing rules from an e-email will destroy + IMPORTANT: importing rules will destroy your current rules. Use this feature with caution.

    @@ -216,7 +211,7 @@ subject are searched. And if you press again, the QuickSearch is cancelled. In the Sent folder, the search is done on the first recipient (To: - header) instead of the sender. + header) instead of the sender. (Previous versions only, might be repaired for TB 72)

    Tags

    @@ -228,11 +223,14 @@ messages. Thunderbird's tagging feature replaces its former labeling feature, and allows users to define an unlimited number of tags, more than one of which can be attached to a single message.

    -

    Nostalgy helps you use tags in much the same way it helps you use folders: +

    +Nostalgy helps you use tags in much the same way it helps you use folders: The completion box for the Go/Save/Copy commands has always listed your email folders, but for Thunderbird 2.0, it also lists your existing tags, prefixed with a semi-colon.

    +

    This needs to be enabled in settings

    +

    A "Go" command applied to a tag restricts the current folder view to show only the messages that have this tag (ESC-ESC-ESC restores the "All messages" view). A "Save" or a "Copy" command applied to a tag toggles the @@ -307,13 +305,19 @@ the input box starts with a colon character, or if no folder matches.

+ +

Utilities

+

The restart button forces Thunderbird to restart. This may be useful for developers, when many windows need to be closed, or when addons have been deleted/reloaded etc.

+ + +
-

The Nostalgy extension has been written by Alain Frisch (alain@frisch.fr). Comments and - suggestions are welcome! You can join the Nostalgy mailing list. +

The Nostalgy extension has been written by Alain Frisch and adapted to TB 68 by opto (Klaus Buecher) (Klaus). Comments and + suggestions are welcome! You can add suggestions or bugs to the issues in github in opto's account https://github.com/opto/nostalgy Donations can be sent to the Paypal - account alain@frisch.fr.

+ account .

diff --git a/content/about.xul b/chrome/content/about.xul similarity index 100% rename from content/about.xul rename to chrome/content/about.xul diff --git a/content/composer.js b/chrome/content/composer.js similarity index 94% rename from content/composer.js rename to chrome/content/composer.js index 89e7545..420e772 100644 --- a/content/composer.js +++ b/chrome/content/composer.js @@ -46,10 +46,10 @@ function NostalgyKeyPress(ev) { } -function onNostalgyLoad(){ +function onNostalgyLoadComp(){ nostalgy_old_awRecipientKeyPress = window.awRecipientKeyPress; window.awRecipientKeyPress = nostalgy_awRecipientKeyPress; window.addEventListener("keypress", NostalgyKeyPress, false); } -window.addEventListener("load", onNostalgyLoad, false); +window.addEventListener("load", onNostalgyLoadComp, false); diff --git a/content/composerOverlay.xul b/chrome/content/composerOverlay.xul similarity index 100% rename from content/composerOverlay.xul rename to chrome/content/composerOverlay.xul diff --git a/content/dummy_window.xul b/chrome/content/dummy_window.xul similarity index 100% rename from content/dummy_window.xul rename to chrome/content/dummy_window.xul diff --git a/content/edit_prefs.js b/chrome/content/edit_prefs.js similarity index 89% rename from content/edit_prefs.js rename to chrome/content/edit_prefs.js index f4830d5..a4331b2 100644 --- a/content/edit_prefs.js +++ b/chrome/content/edit_prefs.js @@ -1,3 +1,7 @@ +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + + + var nostalgy_gList = null; var nostalgy_wait_key = null; @@ -63,8 +67,9 @@ function NostalgySetItem(item, rule) { f.setAttribute("value", lab); f.setAttribute("label", lab); - + f.setAttribute("align", "center"); item.childNodes.item(1).setAttribute("label", rule.contains); + item.childNodes.item(1).setAttribute("value", rule.contains); var u = ""; if (rule.under) { u = rule.under; } @@ -86,13 +91,15 @@ function NostalgyRuleOfItem(item) { } function NostalgyCreateItem(rule) { - var item = document.createElement("listitem"); +/* +*/ + var item = document.createXULElement("richlistitem"); item.addEventListener("dblclick", function() { NostalgyDoEditItem(item); }, false); - item.appendChild(document.createElement("listcell")); - item.appendChild(document.createElement("listcell")); - item.appendChild(document.createElement("listcell")); - item.appendChild(document.createElement("listcell")); + item.appendChild(document.createXULElement("label")); + item.appendChild(document.createXULElement("label")); + item.appendChild(document.createXULElement("label")); + item.appendChild(document.createXULElement("label")); // convert from previous version if (rule.field == "any") { @@ -104,6 +111,7 @@ function NostalgyCreateItem(rule) { NostalgySetItem(item,rule); nostalgy_gList.appendChild(item); + } @@ -172,6 +180,9 @@ function NostalgyDoMoveDown(idx1,idx2) { function onNostalgyAcceptChanges() { var prefs = NostalgyPrefBranch(); + let sCopy="c"; + let sSave="s"; + let sGo="g"; prefs.setCharPref("extensions.nostalgy.rules", NostalgyMkPrefStr()); try { prefs.setIntPref("extensions.nostalgy.number_of_recent_folders", 0 + NostalgyEBI("number_of_recent_folders").value); @@ -188,10 +199,17 @@ function onNostalgyAcceptChanges() { prefs.setBoolPref("extensions.nostalgy."+n, NostalgyEBI(n).checked); if (nostalgy_wait_key) { nostalgy_wait_key.value = nostalgy_wait_key_old; nostalgy_wait_key = null; } - for (var i in nostalgy_keys) + for (var i in nostalgy_keys) { + let sKey= nostalgy_keys[i][0]; + let sValue= NostalgyEBI("key_" + nostalgy_keys[i][0]).value; + if (sKey=="save") sSave=sValue; + if (sKey=="go") sGo=sValue; + if (sKey=="copy") sCopy=sValue; prefs.setCharPref(nostalgy_kKeysPrefs+nostalgy_keys[i][0], NostalgyEBI("key_" + nostalgy_keys[i][0]).value); - + } + let DefaultString = "save ("+sSave+") copy (" + sCopy + ") go ("+sGo+")"; + nostalgy_default_label= DefaultString ; var a = prefs.getChildList(nostalgy_kKeysPrefs, { }); for (var i in a) { @@ -223,7 +241,7 @@ function NostalgyDoNewRule() { function NostalgyDoDelete() { var idx = nostalgy_gList.selectedIndex; if (idx >= 0) { - nostalgy_gList.removeItemAt(idx); + nostalgy_gList.getItemAtIndex(idx).remove(); if (nostalgy_gList.getRowCount() <= idx) { idx = nostalgy_gList.getRowCount() - 1; } nostalgy_gList.selectedIndex = idx; } @@ -279,9 +297,11 @@ function NostalgyRemoveRow(r) { } function onNostalgyLoad() { + document.addEventListener("dialogaccept", (event) => { onNostalgyAcceptChanges(); }); NostalgyFolderSelectionBoxes(); + document.addEventListener("dialogextra2", (event) => { openDialog('chrome://nostalgy/content/about.xul', 'about_nostalgy', 'resizable'); }); - nostalgy_gList = NostalgyEBI("rules"); + nostalgy_gList = NostalgyEBI("nrules"); nostalgy_folder_select = NostalgyEBI("folderselect"); var prefs = NostalgyPrefBranch(); @@ -385,5 +405,17 @@ function NostalgySelectFolder() { } } + + + +function NostalgyDoRestart() { +Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eForceQuit); +} + + + + + + window.addEventListener("load", onNostalgyLoad, false); window.addEventListener("keypress", onNostalgyKeyPress, true); diff --git a/content/edit_prefs.xul b/chrome/content/edit_prefs.xul similarity index 81% rename from content/edit_prefs.xul rename to chrome/content/edit_prefs.xul index 43e6279..18336f4 100644 --- a/content/edit_prefs.xul +++ b/chrome/content/edit_prefs.xul @@ -1,5 +1,8 @@ + + + + - + - - - - - - - - - - - - - - - - +shortcuts to move/copy the message to this folder. + + + + + + + + + + + + + + + + + + + + + @@ -118,6 +127,28 @@ shortcuts to move/copy the message to this folder. + + + + + + + + + + + + + + + +