From dfa6e5a0f181a345169d45563b0012ef6498efd0 Mon Sep 17 00:00:00 2001
From: Rich Roth
Date: Fri, 29 May 2020 14:55:59 +0200
Subject: [PATCH 1/4] Patch for TB 68
I made a hacked version (notes below) you can find at:
http://www.tnrglobal.com/2020/05/thunderbird-addons/
Hack issues:
1) It does require TB restart although it doesn't report that.
2) I've mainly used search and Ctl-Shift FIELD for searching,
SO please try your favorite options and let me know if it works.
3) I don't have access to add better update info
4) FYI, This is a legacy mode extension
I call it hacked because I not a extension pro, even if I am a Kernel level professional programmer.
good luck. It is not in any way compromised as many use hacked to mean.
If I get github access I will make a branch for this.
fixes #80
---
bootstrap.js | 11 +-
content/es.js | 105 +++++++++--------
content/help.html | 25 ++--
locale/de-DE/ExpressionSearch.dtd | 116 +++++++++---------
locale/de-DE/ExpressionSearch.properties | 144 +++++++++++------------
manifest.json | 6 +-
6 files changed, 211 insertions(+), 196 deletions(-)
diff --git a/bootstrap.js b/bootstrap.js
index 9d427a7..3f0a795 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -14,11 +14,14 @@ function loadIntoWindow(window) {
if ( !window ) return; // windows is the global host context
let document = window.document; // XULDocument
let type = document.documentElement.getAttribute('windowtype'); // documentElement maybe 'messengerWindow' / 'addressbookWindow'
+
if ( targetWindows.indexOf(type) < 0 ) return;
+
+ Services.console.logStringMessage("Expression Search: loading ExpressionSearchChrome");
ExpressionSearchChrome.init(); // will and add my filter, and TB want the domID exists when filter registered, so only called when have window ready
ExpressionSearchChrome.Load(window);
}
-
+
var windowListener = {
onOpenWindow: function(aWindow) {
let onLoadWindow = function() {
@@ -53,15 +56,15 @@ function startup(aData, aReason) {
// validator warnings on the below line, ignore it
if ( !sss.sheetRegistered(userCSS, sss.USER_SHEET) ) sss.loadAndRegisterSheet(userCSS, sss.USER_SHEET); // will be unregister when shutdown
}
-
+
function shutdown(aData, aReason) {
// When the application is shutting down we normally don't have to clean up any UI changes made
- if (aReason == APP_SHUTDOWN) return;
+ //** if (aReason == APP_SHUTDOWN) return;
try {
if ( sss.sheetRegistered(userCSS, sss.USER_SHEET) ) sss.unregisterSheet(userCSS, sss.USER_SHEET);
} catch (err) {Cu.reportError(err);}
-
+
try {
Services.obs.removeObserver(windowListener, observeEvent);
// Unload from any existing windows
diff --git a/content/es.js b/content/es.js
index 654e1fc..9e34121 100644
--- a/content/es.js
+++ b/content/es.js
@@ -22,45 +22,55 @@ var ExpressionSearchChrome = {
isEnter: 0,
hookedGlobalFunctions: [],
three_panes: [], // 3pane windows
-
+
needMoveId: "quick-filter-bar-main-bar",
originalFilterId: "qfb-qs-textbox",
textBoxDomId: "expression-search-textbox",
strBundle: Services.strings.createBundle('chrome://expressionsearch/locale/ExpressionSearch.properties'),
-
+
prefs: null, // preference object
options: {}, // preference strings
loaded: 0,
init: function() {
Cu.import("chrome://expressionsearch/content/log.js"); // load log first
+ //ChomeUtils.import("chrome://expressionsearch/content/log.js"); // load log first
if ( this.loaded ) {
+
+ try {
+ ExpressionSearchLog.log("Expression Search: init...1", false, true);
+ this.importModules();
+ this.initPerf();
+ } catch (err) {
+ ExpressionSearchLog.logException(err);
+ }
+
if ( !this.prefs && ExpressionSearchLog ) {
- ExpressionSearchLog.log("Expression Search is NOT restartless! Please restart Thunderbird!", 1);
+ ExpressionSearchLog.log("Expression Search is now restartless!", 1);
} else return;
}
this.loaded = 1;
try {
- ExpressionSearchLog.log("Expression Search: init...", false, true);
+ ExpressionSearchLog.log("Expression Search: init...2", false, true);
this.importModules();
this.initPerf();
} catch (err) {
ExpressionSearchLog.logException(err);
}
},
-
+
importModules: function() {
/* https://bugzilla.mozilla.org/show_bug.cgi?id=1383215#c24
There are two ways that we currently support packaging omnijar:
1) Separate JAR files for toolkit (GRE) content and app-specific content.
2) One JAR file containing both app-specific and toolkit content.
-
+
Firefox uses the former (but used to use the latter), and Thunderbird uses the latter.
In case 2, resource:/// and resource://gre/ point to the same place, so it's technically possible to refer to app or toolkit content by two separate URLs,
and it's easy to carelessly use the wrong one. We had a bunch of these issues (especially with add-ons) when we switched layouts.
-
+
But the code that's using resource://gre/ URLs for app content, or vice versa, is still technically wrong. */
-
+
Cu.import("chrome://expressionsearch/content/gmailuiParse.js");
Cu.import("chrome://expressionsearch/content/aop.js");
Cu.import("chrome://expressionsearch/content/common.js");
@@ -88,12 +98,12 @@ var ExpressionSearchChrome = {
//Cu.import("resource:///modules/gloda/msg_search.js");
Cu.import("chrome://expressionsearch/content/ExpressionSearchFilter.js");
},
-
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1415567 Remove {get,set}ComplexValue use of nsISupportsString in Thunderbird
oldAPI_58: Services.vc.compare(Services.appinfo.platformVersion, '58') < 0,
complexPrefs: ["c2s_regexpMatch", "c2s_regexpReplace", "installed_version", "virtual_folder_path"],
mozIJSSubScriptLoader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader),
-
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1413413 Remove support for extensions having their own prefs file
setDefaultPrefs: function () {
let branch = Services.prefs.getDefaultBranch("");
@@ -119,7 +129,7 @@ var ExpressionSearchChrome = {
ExpressionSearchLog.logException(err);
}
},
-
+
initPerf: function() {
this.setDefaultPrefs();
this.prefs = Services.prefs.getBranch("extensions.expressionsearch.");
@@ -128,13 +138,14 @@ var ExpressionSearchChrome = {
"results_label_size", "showbuttonlabel", "statusbar_info_showtime", "statusbar_info_hidetime", "c2s_enableCtrl", "c2s_enableShift", "c2s_enableCtrlReplace",
"c2s_enableShiftReplace", "c2s_regexpMatch", "c2s_regexpReplace", "c2s_removeDomainName", "installed_version", "enable_statusbar_info", "enable_verbose_info"].forEach( function(key) {
try {
+ ExpressionSearchLog.log("Expression Search: watch key:"+key, false, true);
ExpressionSearchChrome.observe('', 'nsPref:changed', key); // we fake one
} catch ( err ) {
ExpressionSearchLog.logException(err);
}
});
},
-
+
// get called when event occurs with our perf branch
observe: function(subject, topic, data) {
if (topic != "nsPref:changed") {
@@ -189,7 +200,7 @@ var ExpressionSearchChrome = {
if ( !show && !aFilterer.visible && hasFilter ) aFilterer.visible = true;
return invocation.proceed();
})[0] );
-
+
// onMakeActive && onTabSwitched: show or hide the buttons & search box
win._expression_search.hookedFunctions.push( ExpressionSearchaop.around( {target: win.QuickFilterBarMuxer, method: 'onMakeActive'}, function(invocation) {
let aFolderDisplay = invocation.arguments[0];
@@ -199,7 +210,7 @@ var ExpressionSearchChrome = {
win.document.getElementById("qfb-results-label").style.visibility = appropriate ? 'visible': 'hidden';
return invocation.proceed();
})[0] );
-
+
win._expression_search.hookedFunctions.push( ExpressionSearchaop.before( {target: win.QuickFilterBarMuxer, method: 'onTabSwitched'}, function() {
let filterer = this.maybeActiveFilterer;
// filterer means if the tab can use quick filter
@@ -207,7 +218,7 @@ var ExpressionSearchChrome = {
win.document.getElementById(ExpressionSearchChrome.needMoveId).style.visibility = filterer /*&& filterer.visible*/ ? 'visible': 'hidden';
win.document.getElementById("qfb-results-label").style.visibility = filterer /*&& filterer.visible*/ ? 'visible': 'hidden';
})[0] );
-
+
// hook _flattenGroupifyTerms to avoid being flatten
if ( !ExpressionSearchChrome.hookedGlobalFunctions.length ) {
ExpressionSearchChrome.hookedGlobalFunctions.push( ExpressionSearchaop.around( {target: SearchSpec.prototype, method: '_flattenGroupifyTerms'}, function(invocation) {
@@ -238,7 +249,7 @@ var ExpressionSearchChrome = {
return outTerms;
})[0] );
}
-
+
// for results label to show correct colour by copy filterActive attribute from quick-filter-bar to qfb-results-label, and set colour in overlay.css
win._expression_search.hookedFunctions.push( ExpressionSearchaop.after( {target: win.QuickFilterBarMuxer, method: 'reflectFiltererResults'}, function(result) {
let qfb = win.document.getElementById("quick-filter-bar");
@@ -248,9 +259,9 @@ var ExpressionSearchChrome = {
}
return result;
})[0] );
-
+
},
-
+
registerCallback(win) {
this.three_panes.push(win);
},
@@ -280,20 +291,20 @@ var ExpressionSearchChrome = {
delete win._expression_search;
delete win.ExpressionSearchChrome;
},
-
+
cleanup: function() {
this.prefs.removeObserver("", ExpressionSearchChrome);
delete this.prefs;
this.hookedGlobalFunctions.forEach( hooked => hooked.unweave() );
ExpressionSearchLog.info("Expression Search: cleanup done");
},
-
+
refreshFilterBar: function(win) {
let document = win.document;
let QuickFilterBarMuxer = win.QuickFilterBarMuxer;
//thunderbird-private-tabmail-buttons
// qfb-show-filter-bar : document.getElementById("qfb-show-filter-bar").checked = aFilterer.visible;
-
+
//quick-filter-bar
// quick-filter-bar-main-bar
// qfb-sticky qfb-filter-label [quick-filter-bar-collapsible-buttons] [100 results] [search filter]
@@ -301,7 +312,7 @@ var ExpressionSearchChrome = {
// quick-filter-bar-tab-bar : it's taG bar
// quick-filter-bar-filter-text-bar.collapsed=(aFilterValue.text == null);
//QuickFilterState.visible
-
+
//QuickFilterBarMuxer
// onMakeActive for qfb-show-filter-bar visiable
// reflectFiltererState for qfb-show-filter-bar checked
@@ -349,11 +360,11 @@ var ExpressionSearchChrome = {
spacer.style.flex = '1 2000 auto';
}
}
-
+
let resultsLabel = document.getElementById("qfb-results-label");
if ( resultsLabel ) {
if ( typeof(resultsLabel._saved_minWidth) == 'undefined' ) resultsLabel._saved_minWidth = resultsLabel.getAttribute('minwidth') || 1;
- let layout = Services.prefs.getIntPref("mail.pane_config.dynamic");
+ let layout = Services.prefs.getIntPref("mail.pane_config.dynamic");
let minWidth = ( this.options.results_label_size == 2 || ( this.options.results_label_size == 0 && this.options.move2bar == 0 && layout == win.kVerticalMailLayout ) ) ? 0 : resultsLabel._saved_minWidth;
resultsLabel.setAttribute('minwidth', minWidth);
if ( minWidth == 0 ) delete resultsLabel.style.width;
@@ -382,14 +393,14 @@ var ExpressionSearchChrome = {
QuickFilterBarMuxer._minExpandedBarWidth = 0; // let it re-calculate the min expanded bar width because we changed the layout
QuickFilterBarMuxer.onWindowResize.apply(QuickFilterBarMuxer);
} else {
- let quickFilterBarBox = document.getElementById("quick-filter-bar-main-bar");
+ let quickFilterBarBox = document.getElementById("quick-filter-bar-main-bar");
if ( quickFilterBarBox && quickFilterBarBox.clientWidth < quickFilterBarBox.scrollWidth ) {
QuickFilterBarMuxer.onOverflow.apply(QuickFilterBarMuxer);
}
}
}
}
-
+
let menu = document.getElementById(contextMenuID);
if ( menu ) {
for (let i = 0; i < menu.childNodes.length; i++ ) {
@@ -399,13 +410,13 @@ var ExpressionSearchChrome = {
};
}
},
-
+
hideUpsellPanel: function(win) {
let panel = win.document.getElementById("qfb-text-search-upsell");
if ( panel.state == "open")
panel.hidePopup();
},
-
+
helpTimer: 0,
showHideHelp: function(win, show, line1, line2, line3, line4) {
@@ -436,7 +447,7 @@ var ExpressionSearchChrome = {
this.helpTimer = setTimeout( function(){ tooltip.hidePopup(); }, time2hide );
}
},
-
+
onTokenChange: function(event) {
let searchValue = this.value;
let start = searchValue.lastIndexOf(' ', this.selectionEnd > 0 ? this.selectionEnd - 1 : 0); // selectionEnd is index of the character after the selection
@@ -448,7 +459,7 @@ var ExpressionSearchChrome = {
let win = ExpressionSearchChrome.getWinFromEvent(event);
ExpressionSearchChrome.showHideHelp(win, 1, help.alias, help.info, help.matchString, term);
},
-
+
delayedOnSearchKeyPress: function(event) {
let me = ExpressionSearchChrome;
let win = ExpressionSearchChrome.getWinFromEvent(event);
@@ -489,20 +500,20 @@ var ExpressionSearchChrome = {
// me.back2OriginalFolder(win);
else me.onTokenChange.apply(this, [event]);
},
-
+
onSearchKeyPress: function(event){
let self = this;
// defer the call or this.value is still the old value, not updated with event.char yet
setTimeout( function(){ ExpressionSearchChrome.delayedOnSearchKeyPress.call(self,event); }, 0);
},
-
+
onSearchBarBlur: function(event) {
let win = ExpressionSearchChrome.getWinFromEvent(event);
ExpressionSearchChrome.hideUpsellPanel(win);
ExpressionSearchChrome.isFocus = false;
ExpressionSearchChrome.showHideHelp(win, false);
},
-
+
getWinFromEvent: function(event) {
try {
return event.view || event.currentTarget.ownerDocument.defaultView;
@@ -510,7 +521,7 @@ var ExpressionSearchChrome = {
ExpressionSearchLog.logException(err);
}
},
-
+
onSearchBarFocus: function(event) {
let win = ExpressionSearchChrome.getWinFromEvent(event);
let aNode = win.document.getElementById(ExpressionSearchChrome.textBoxDomId);
@@ -542,7 +553,7 @@ var ExpressionSearchChrome = {
aNode.setAttribute("minwidth", 280);
oldTextbox.parentNode.insertBefore(aNode, oldTextbox.nextSibling);
win._expression_search.createdElements.push(aNode);
-
+
aNode.addEventListener("keypress", this.onSearchKeyPress, true); // false will be after onComand, too late
//aNode.addEventListener("input", this.onTokenChange, true); // input can't get arrow key change but can get update when click2search
aNode.addEventListener("click", this.onTokenChange, true); // to track selectEnd change
@@ -550,14 +561,14 @@ var ExpressionSearchChrome = {
aNode.addEventListener("focus", this.onSearchBarFocus, true);
this.setSearchTimeout(win);
},
-
+
setSearchTimeout: function(win) {
let doc = win.document;
let aNode = doc.getElementById(this.textBoxDomId);
if ( !aNode ) return;
aNode.timeout = this.options.search_timeout || 1000000000;
},
-
+
back2OriginalFolder: function(win) {
try {
if ( typeof(win._expression_search.originalURI) == 'undefined' ) return;
@@ -565,7 +576,7 @@ var ExpressionSearchChrome = {
} catch (err) {
}
},
-
+
// not works well for complex searchTerms. But it's for all folders.
createQuickFolder: function(win, searchTerms) {
const nsMsgFolderFlags = Ci.nsMsgFolderFlags;
@@ -587,7 +598,7 @@ var ExpressionSearchChrome = {
return;
}
let QSFolderURI = targetFolderParent.URI + "/" + QSFolderName;
-
+
if ( !targetFolderParent.containsChildNamed(QSFolderName) || ! this.options.reuse_existing_folder ) {
for (let folder of fixIterator(rootFolder.descendants, Ci.nsIMsgFolder)) {
// only add non-virtual non-news folders
@@ -665,7 +676,7 @@ var ExpressionSearchChrome = {
}
ExpressionSearchChrome.isEnter = false;
},
-
+
calculateResult: function(e) {
if (e.kind == 'op') {
if (e.tok == '+' || (e.right != undefined && e.tok == '-') || e.tok == '*' || e.tok == '/') {
@@ -713,7 +724,7 @@ var ExpressionSearchChrome = {
aNode.value = lhs + " = " + rhs;
aNode.setSelectionRange(lhs.length, lhs.length + rhs.length + 3); // TODO: not work?
},
-
+
//Check conditions for search: corresponding modifier is hold on or middle button is pressed
CheckClickSearchEvent: function( event ) {
// event.button: 0:left, 1:middle, 2:right
@@ -722,8 +733,8 @@ var ExpressionSearchChrome = {
if ( ExpressionSearchChrome.options.c2s_enableShift && event.shiftKey ) return true;
return false;
},
-
- //Replace string using user-defined regexp. If not match, return original strings.
+
+ //Replace string using user-defined regexp. If not match, return original strings.
//If multiple matches, return all replaces, concatinated with OR operator
RegexpReplaceString : function( str ) {
if ( ExpressionSearchChrome.options.c2s_regexpMatch.length == 0 ) return str;
@@ -842,7 +853,7 @@ var ExpressionSearchChrome = {
aNode._fireCommand(aNode);
return;
},
-
+
firstRunAction: function() {
let anchor = '';
if ( this.options.installed_version != "0.1" ) anchor = '#version_history'; // this is an update
@@ -944,7 +955,7 @@ var ExpressionSearchChrome = {
win._expression_search.createdElements.push(statusbarPanel);
}
},
-
+
loadInto3pane: function(win) {
let me = ExpressionSearchChrome;
try {
@@ -1014,7 +1025,7 @@ var ExpressionSearchChrome = {
aWindow.removeEventListener("unload", ExpressionSearchChrome.onUnLoad, false);
ExpressionSearchChrome.unLoad(aWindow);
},
-
+
setFocus: function(win) {
if ( ExpressionSearchChrome.options.move2bar==0 && !QuickFilterBarMuxer.activeFilterer.visible )
QuickFilterBarMuxer._showFilterBar(true);
@@ -1052,7 +1063,7 @@ var ExpressionSearchChrome = {
let menupopup = doc.createElementNS(XULNS, "menupopup");
let menuGroupName = 'expression_search-status_menu';
menupopup.id = contextMenuID;
- [
+ [
["about:config", "", function(){ ExpressionSearchCommon.loadURL('about:config'); }],
["about:crashes", "", function(){ ExpressionSearchCommon.loadTab('about:crashes'); }],
["about:memory", "", function(){ ExpressionSearchCommon.loadURL('about:memory?verbose'); }],
diff --git a/content/help.html b/content/help.html
index e4fd28c..065cf58 100644
--- a/content/help.html
+++ b/content/help.html
@@ -54,7 +54,7 @@ Search expressions and quick search key
Here are some examples:
-
weekend plans
-This expression searches all messages in the current folder or view for
+
This expression searches all messages in the current folder or view for
'weekend plans' in the from, to, cc, or subject
fields.
If "Act as normal filter" enabled, the "Sender", "Recipients", "Subject" and "Body" buttons will
@@ -91,7 +91,7 @@
Search expressions and quick search key
subject:electric bill or s:electric bill
-This expression searches all messages in the current folder or view for 'electric bill'
+
This expression searches all messages in the current folder or view for 'electric bill'
in the subject fields of the message. Case insensitive.
@@ -136,7 +136,7 @@
Search expressions and quick search key
attachment:yes or a:yes
This expression searches all messages in the current folder or view for an attachment,
-Notice that it does not search for attachments named "yes". You can also use "y" or "1" for
+Notice that it does not search for attachments named "yes". You can also use "y" or "1" for
"yes". You can use "no", "n", or "0" to search for messages without attachments.
@@ -161,7 +161,7 @@
Search expressions and quick search key
before:07:12:00 or be:5:9 or after:03:07:05 or af:(3:0 -4:0)
This expression searches all messages in the current folder or view within the time range.
-af:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day.
+af:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day.
date:2011/01 or date:2011/01/03 or d:" 03:" or in zh-CN locale d:2011年3月
@@ -184,10 +184,10 @@
Search expressions and quick search key
body:electric bill
-This expression searches all messages in the current folder or view for 'electric bill'
-in the body of the message. On large or remote folders it may take some time. Also, if you
-combine this with other search operators like "from:", "subject:" or "to:" this will speed
-things up considerably.
+
This expression searches all messages in the current folder or view for 'electric bill'
+in the body of the message. On large or remote folders it may take some time. Also, if you
+combine this with other search operators like "from:", "subject:" or "to:" this will speed
+things up considerably.
bodyre:/hello.*world/i or br:test
@@ -235,7 +235,7 @@
Hot Key
you will be able to type.
Expression Search add one additional hot key "Ctrl+B".
Once you are typing in your search query, and you hit enter or otherwise let
-it begin searching, your cursor will remain inside of the query box to allow you
+it begin searching, your cursor will remain inside of the query box to allow you
to modify the query. However, if you'd rather go back to browsing your messages,
instead of clicking on the message headers in your search results, you can just
press 'ESC' to to clear the search criteria, and press 'ESC' again to refocus back
@@ -260,7 +260,7 @@ Quick Search Virtual Folder
current account.
The resulting virtual folder 'ExpressionSearch' can then be modified
by editing properties, or can be renamed to make it a permanent virtual search folder.
-If you do not rename the folder, the next time you use ctrl-enter the ExpressionSearch
+If you do not rename the folder, the next time you use ctrl-enter the ExpressionSearch
virtual folder is reused to show your new quick search result.
@@ -338,6 +338,7 @@ Click 2 Search
Version history
-
Version 1.4:
+- 1.4.2: Works with TB 68, fixed by R Roth see RR TB Addons/li>
- Works with TB 63 nightly, drop support for TB older than 60
- Change from legacy XUL overly addon to restartless addon
@@ -481,9 +482,9 @@ Known Issues of this extension or Thunderbird
-
Bug 474730 - should search newest first - searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases
-
-Bug 564328 - Keyboard shortcut Ctrl+F conflict and cmd_find ambiguity, used for both Find in This Message and Quick Filter
+Bug 564328 - Keyboard shortcut Ctrl+F conflict and cmd_find ambiguity, used for both Find in This Message and Quick Filter
-
-Bug 600140 - 'Unread' quick filter hides some unread messages (the beginning of a thread)
+Bug 600140 - 'Unread' quick filter hides some unread messages (the beginning of a thread)
-
Bug 607295 - Provide UI for new archive granularity and folder structure options
-
diff --git a/locale/de-DE/ExpressionSearch.dtd b/locale/de-DE/ExpressionSearch.dtd
index 7e06b3c..9a6ea38 100644
--- a/locale/de-DE/ExpressionSearch.dtd
+++ b/locale/de-DE/ExpressionSearch.dtd
@@ -1,58 +1,58 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/de-DE/ExpressionSearch.properties b/locale/de-DE/ExpressionSearch.properties
index 32b5694..a96d25d 100644
--- a/locale/de-DE/ExpressionSearch.properties
+++ b/locale/de-DE/ExpressionSearch.properties
@@ -1,72 +1,72 @@
-# for customer search terms
-Bcc=Bcc
-toSomebodyOnly=To Somebody Only
-subjectRegex=Subject (RegEx)
-subjectSimple=Subject (Long)
-headerRegex=Header (RegEx)
-fromRegex=From (RegEx)
-toRegex=Recipients (To/Cc/Bcc RegEx)
-dayTime=Time (Every Day)
-dateMatch=Date Match (2011/01/01)
-attachmentNameOrType=Attachment Name/Type
-bodyRegex=Body (RegEx)
-
-# for input
-textbox.emptyText.base=Expression Search... #1
-focusSearch.key=b
-focusSearch.mod=accel
-back2folder.keycode=VK_LEFT
-back2folder.mod=accel alt
-
-# for context menu
-about.about=About
-dialog.settings=Settings
-option.help=Help
-donate.label=Donate
-donate.image=chrome://expressionsearch/content/paypal.ico
-donate.pay=paypal
-
-# for tooltip information
-info.helpLine1=You can disable this tooltip in option dialog
-info.helpLine2=Please type keyword to search
-info.disable=You can disable this tooltip in option dialog
-info.blank=Please type keywords to search, click this line for help
-info.after=after:Mar 10, 2011\naf:(2011/03/01 -2011/03/09)\nafter:Mon, 25 Dec 1995 13:30:00 GMT\naf:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day
-info.all=search message within from, to, cc, or subject fields, and the body
-info.attachment=attachment:yes or a:yes or a:no
-info.bcc=BCC field contains
-info.before=before:2011/03/09 07:12:00\nbe:09 Mar 2011 05:00:00
-info.body=Body contains
-info.bodyre=bodyre:/hello.*world/i\nBody match\nWarning! May crash your Thunderbird
-info.cc=CC field contains
-info.date=date:yyyy/mm/dd hh:mm:ss\ndate:2011/01\ndate:2011/01/03
-info.days=age:3 or older_than:today or days:(3 -5)\ntoday means -1, week means 7 and month means 30
-info.filename=filename:foo.doc or fi:image or fn:msword or file:html\nsearches for an attachment name or type
-info.from=from:(Alice or Bob)\nSearches From field
-info.fromto=fromto:(Alice)\nFrom, To, CC or BCC field contains
-info.fromre=fromre:/^[a-d].*[m-z]$/i\nSearches From field using regular expression
-info.tore=tore:/^[a-d].*[m-z]$/i\nSearches recipients(To/Cc/Bcc) field using regular expression
-info.newer_than=n:8 or nt:7week or newer_than:1year
-info.only=only:tom\ntom should be the only recipients in to field
-info.regex=regex:/^begin/i or re:end$ or r:/\d+\s*\d+/\nSubject matches
-info.headerre=headerre:List-Id=/all-test/i or h:list-id or hr:header~/^value/
-info.simple=simple:hello'\nSubject field contains, support special characters
-info.status=is:replied or i:UnRead or status:Forwarded or status:F\nThe status can be one of Replied, Read, Marked/Star, Forwarded, UnRead, New, ImapDeleted or Attachment.
-info.subject=subject:(Hello -World!)\nSearches Subject to Contains Hello but not World!
-info.tag=tag:Important\nTag contains\ntag:NA means no tag
-info.to=To or CC field contains
-info.tonocc=To fileld contains
-info.size=size:10 or size:1.4M\nMessage Size big than
-info.smaller=smaller:1G or sm:1024\nMessage Size less than
-info.gloda=Trigger gloda search if enabled
-
-# for virtual folder select
-virtualfolder.selectall=Select All
-virtualfolder.clearall=Clear All
-virtualfolder.modelabel=When click change:
-virtualfolder.modesingle=Current Only
-virtualfolder.modechild=Current & Children
-virtualfolder.modedescendants=Current & Descendants
-
-# If you can localize the help document, please change "content" to "locale" below and put localized document under locale dir
-expressionsearch.helpfile=chrome://expressionsearch/content/help.html
+# for customer search terms
+Bcc=Bcc
+toSomebodyOnly=To Somebody Only
+subjectRegex=Subject (RegEx)
+subjectSimple=Subject (Long)
+headerRegex=Header (RegEx)
+fromRegex=From (RegEx)
+toRegex=Recipients (To/Cc/Bcc RegEx)
+dayTime=Time (Every Day)
+dateMatch=Date Match (2011/01/01)
+attachmentNameOrType=Attachment Name/Type
+bodyRegex=Body (RegEx)
+
+# for input
+textbox.emptyText.base=Expression Search... #1
+focusSearch.key=b
+focusSearch.mod=accel
+back2folder.keycode=VK_LEFT
+back2folder.mod=accel alt
+
+# for context menu
+about.about=About
+dialog.settings=Settings
+option.help=Help
+donate.label=Donate
+donate.image=chrome://expressionsearch/content/paypal.ico
+donate.pay=paypal
+
+# for tooltip information
+info.helpLine1=You can disable this tooltip in option dialog
+info.helpLine2=Please type keyword to search
+info.disable=You can disable this tooltip in option dialog
+info.blank=Please type keywords to search, click this line for help
+info.after=after:Mar 10, 2011\naf:(2011/03/01 -2011/03/09)\nafter:Mon, 25 Dec 1995 13:30:00 GMT\naf:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day
+info.all=search message within from, to, cc, or subject fields, and the body
+info.attachment=attachment:yes or a:yes or a:no
+info.bcc=BCC field contains
+info.before=before:2011/03/09 07:12:00\nbe:09 Mar 2011 05:00:00
+info.body=Body contains
+info.bodyre=bodyre:/hello.*world/i\nBody match\nWarning! May crash your Thunderbird
+info.cc=CC field contains
+info.date=date:yyyy/mm/dd hh:mm:ss\ndate:2011/01\ndate:2011/01/03
+info.days=age:3 or older_than:today or days:(3 -5)\ntoday means -1, week means 7 and month means 30
+info.filename=filename:foo.doc or fi:image or fn:msword or file:html\nsearches for an attachment name or type
+info.from=from:(Alice or Bob)\nSearches From field
+info.fromto=fromto:(Alice)\nFrom, To, CC or BCC field contains
+info.fromre=fromre:/^[a-d].*[m-z]$/i\nSearches From field using regular expression
+info.tore=tore:/^[a-d].*[m-z]$/i\nSearches recipients(To/Cc/Bcc) field using regular expression
+info.newer_than=n:8 or nt:7week or newer_than:1year
+info.only=only:tom\ntom should be the only recipients in to field
+info.regex=regex:/^begin/i or re:end$ or r:/\d+\s*\d+/\nSubject matches
+info.headerre=headerre:List-Id=/all-test/i or h:list-id or hr:header~/^value/
+info.simple=simple:hello'\nSubject field contains, support special characters
+info.status=is:replied or i:UnRead or status:Forwarded or status:F\nThe status can be one of Replied, Read, Marked/Star, Forwarded, UnRead, New, ImapDeleted or Attachment.
+info.subject=subject:(Hello -World!)\nSearches Subject to Contains Hello but not World!
+info.tag=tag:Important\nTag contains\ntag:NA means no tag
+info.to=To or CC field contains
+info.tonocc=To fileld contains
+info.size=size:10 or size:1.4M\nMessage Size big than
+info.smaller=smaller:1G or sm:1024\nMessage Size less than
+info.gloda=Trigger gloda search if enabled
+
+# for virtual folder select
+virtualfolder.selectall=Select All
+virtualfolder.clearall=Clear All
+virtualfolder.modelabel=When click change:
+virtualfolder.modesingle=Current Only
+virtualfolder.modechild=Current & Children
+virtualfolder.modedescendants=Current & Descendants
+
+# If you can localize the help document, please change "content" to "locale" below and put localized document under locale dir
+expressionsearch.helpfile=chrome://expressionsearch/content/help.html
diff --git a/manifest.json b/manifest.json
index 0a59e26..660ce07 100644
--- a/manifest.json
+++ b/manifest.json
@@ -6,17 +6,17 @@
"strict_max_version": "68.9"
}
},
- "version": "1.4beta",
+ "version": "1.4.2",
"manifest_version": 2,
"name": "Expression Search / Google Mail UI",
"description": "Type 'from:fred to:tom' to see all messages from Fred to Tom in the current view.",
- "author": "Opera Wang",
+ "author": "Opera Wang V68 by Rich Roth - http://www.tnrglobal.com/2020/05/thunderbird-addons/",
"homepage_url": "https://github.com/wangvisual/expression-search",
"legacy": {
"type": "bootstrap",
"options": {
"page": "chrome://expressionsearch/content/esPrefDialog.xul",
- "open_in_tab": false
+ "open_in_tab": true
}
},
"icons": {
From bc0de4f670b46e59209512cb7b8c3c130bf7c863 Mon Sep 17 00:00:00 2001
From: Till Riedel
Date: Wed, 8 Jul 2020 00:31:16 +0200
Subject: [PATCH 2/4] revert some unnecessary changes
---
bootstrap.js | 8 +-
content/es.js | 111 +++++++++--------
content/help.html | 24 ++--
locale/de-DE/ExpressionSearch.dtd | 116 +++++++++---------
locale/de-DE/ExpressionSearch.properties | 144 +++++++++++------------
5 files changed, 199 insertions(+), 204 deletions(-)
diff --git a/bootstrap.js b/bootstrap.js
index 3f0a795..f79a313 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -14,14 +14,12 @@ function loadIntoWindow(window) {
if ( !window ) return; // windows is the global host context
let document = window.document; // XULDocument
let type = document.documentElement.getAttribute('windowtype'); // documentElement maybe 'messengerWindow' / 'addressbookWindow'
-
if ( targetWindows.indexOf(type) < 0 ) return;
-
Services.console.logStringMessage("Expression Search: loading ExpressionSearchChrome");
ExpressionSearchChrome.init(); // will and add my filter, and TB want the domID exists when filter registered, so only called when have window ready
ExpressionSearchChrome.Load(window);
}
-
+
var windowListener = {
onOpenWindow: function(aWindow) {
let onLoadWindow = function() {
@@ -56,7 +54,7 @@ function startup(aData, aReason) {
// validator warnings on the below line, ignore it
if ( !sss.sheetRegistered(userCSS, sss.USER_SHEET) ) sss.loadAndRegisterSheet(userCSS, sss.USER_SHEET); // will be unregister when shutdown
}
-
+
function shutdown(aData, aReason) {
// When the application is shutting down we normally don't have to clean up any UI changes made
//** if (aReason == APP_SHUTDOWN) return;
@@ -64,7 +62,7 @@ function shutdown(aData, aReason) {
try {
if ( sss.sheetRegistered(userCSS, sss.USER_SHEET) ) sss.unregisterSheet(userCSS, sss.USER_SHEET);
} catch (err) {Cu.reportError(err);}
-
+
try {
Services.obs.removeObserver(windowListener, observeEvent);
// Unload from any existing windows
diff --git a/content/es.js b/content/es.js
index 9e34121..a10bbad 100644
--- a/content/es.js
+++ b/content/es.js
@@ -22,31 +22,28 @@ var ExpressionSearchChrome = {
isEnter: 0,
hookedGlobalFunctions: [],
three_panes: [], // 3pane windows
-
+
needMoveId: "quick-filter-bar-main-bar",
originalFilterId: "qfb-qs-textbox",
textBoxDomId: "expression-search-textbox",
strBundle: Services.strings.createBundle('chrome://expressionsearch/locale/ExpressionSearch.properties'),
-
+
prefs: null, // preference object
options: {}, // preference strings
loaded: 0,
init: function() {
Cu.import("chrome://expressionsearch/content/log.js"); // load log first
- //ChomeUtils.import("chrome://expressionsearch/content/log.js"); // load log first
if ( this.loaded ) {
-
- try {
- ExpressionSearchLog.log("Expression Search: init...1", false, true);
- this.importModules();
- this.initPerf();
- } catch (err) {
- ExpressionSearchLog.logException(err);
- }
-
+ try {
+ ExpressionSearchLog.log("Expression Search: init...1", false, true);
+ this.importModules();
+ this.initPerf();
+ } catch (err) {
+ ExpressionSearchLog.logException(err);
+ }
if ( !this.prefs && ExpressionSearchLog ) {
- ExpressionSearchLog.log("Expression Search is now restartless!", 1);
+ ExpressionSearchLog.log("Expression Search is NOT restartless! Please restart Thunderbird!", 1);
} else return;
}
this.loaded = 1;
@@ -58,19 +55,19 @@ var ExpressionSearchChrome = {
ExpressionSearchLog.logException(err);
}
},
-
+
importModules: function() {
/* https://bugzilla.mozilla.org/show_bug.cgi?id=1383215#c24
There are two ways that we currently support packaging omnijar:
1) Separate JAR files for toolkit (GRE) content and app-specific content.
2) One JAR file containing both app-specific and toolkit content.
-
+
Firefox uses the former (but used to use the latter), and Thunderbird uses the latter.
In case 2, resource:/// and resource://gre/ point to the same place, so it's technically possible to refer to app or toolkit content by two separate URLs,
and it's easy to carelessly use the wrong one. We had a bunch of these issues (especially with add-ons) when we switched layouts.
-
+
But the code that's using resource://gre/ URLs for app content, or vice versa, is still technically wrong. */
-
+
Cu.import("chrome://expressionsearch/content/gmailuiParse.js");
Cu.import("chrome://expressionsearch/content/aop.js");
Cu.import("chrome://expressionsearch/content/common.js");
@@ -98,12 +95,12 @@ var ExpressionSearchChrome = {
//Cu.import("resource:///modules/gloda/msg_search.js");
Cu.import("chrome://expressionsearch/content/ExpressionSearchFilter.js");
},
-
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1415567 Remove {get,set}ComplexValue use of nsISupportsString in Thunderbird
oldAPI_58: Services.vc.compare(Services.appinfo.platformVersion, '58') < 0,
complexPrefs: ["c2s_regexpMatch", "c2s_regexpReplace", "installed_version", "virtual_folder_path"],
mozIJSSubScriptLoader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader),
-
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1413413 Remove support for extensions having their own prefs file
setDefaultPrefs: function () {
let branch = Services.prefs.getDefaultBranch("");
@@ -129,7 +126,7 @@ var ExpressionSearchChrome = {
ExpressionSearchLog.logException(err);
}
},
-
+
initPerf: function() {
this.setDefaultPrefs();
this.prefs = Services.prefs.getBranch("extensions.expressionsearch.");
@@ -145,7 +142,7 @@ var ExpressionSearchChrome = {
}
});
},
-
+
// get called when event occurs with our perf branch
observe: function(subject, topic, data) {
if (topic != "nsPref:changed") {
@@ -200,7 +197,7 @@ var ExpressionSearchChrome = {
if ( !show && !aFilterer.visible && hasFilter ) aFilterer.visible = true;
return invocation.proceed();
})[0] );
-
+
// onMakeActive && onTabSwitched: show or hide the buttons & search box
win._expression_search.hookedFunctions.push( ExpressionSearchaop.around( {target: win.QuickFilterBarMuxer, method: 'onMakeActive'}, function(invocation) {
let aFolderDisplay = invocation.arguments[0];
@@ -210,7 +207,7 @@ var ExpressionSearchChrome = {
win.document.getElementById("qfb-results-label").style.visibility = appropriate ? 'visible': 'hidden';
return invocation.proceed();
})[0] );
-
+
win._expression_search.hookedFunctions.push( ExpressionSearchaop.before( {target: win.QuickFilterBarMuxer, method: 'onTabSwitched'}, function() {
let filterer = this.maybeActiveFilterer;
// filterer means if the tab can use quick filter
@@ -218,7 +215,7 @@ var ExpressionSearchChrome = {
win.document.getElementById(ExpressionSearchChrome.needMoveId).style.visibility = filterer /*&& filterer.visible*/ ? 'visible': 'hidden';
win.document.getElementById("qfb-results-label").style.visibility = filterer /*&& filterer.visible*/ ? 'visible': 'hidden';
})[0] );
-
+
// hook _flattenGroupifyTerms to avoid being flatten
if ( !ExpressionSearchChrome.hookedGlobalFunctions.length ) {
ExpressionSearchChrome.hookedGlobalFunctions.push( ExpressionSearchaop.around( {target: SearchSpec.prototype, method: '_flattenGroupifyTerms'}, function(invocation) {
@@ -249,7 +246,7 @@ var ExpressionSearchChrome = {
return outTerms;
})[0] );
}
-
+
// for results label to show correct colour by copy filterActive attribute from quick-filter-bar to qfb-results-label, and set colour in overlay.css
win._expression_search.hookedFunctions.push( ExpressionSearchaop.after( {target: win.QuickFilterBarMuxer, method: 'reflectFiltererResults'}, function(result) {
let qfb = win.document.getElementById("quick-filter-bar");
@@ -259,9 +256,9 @@ var ExpressionSearchChrome = {
}
return result;
})[0] );
-
+
},
-
+
registerCallback(win) {
this.three_panes.push(win);
},
@@ -291,20 +288,20 @@ var ExpressionSearchChrome = {
delete win._expression_search;
delete win.ExpressionSearchChrome;
},
-
+
cleanup: function() {
this.prefs.removeObserver("", ExpressionSearchChrome);
delete this.prefs;
this.hookedGlobalFunctions.forEach( hooked => hooked.unweave() );
ExpressionSearchLog.info("Expression Search: cleanup done");
},
-
+
refreshFilterBar: function(win) {
let document = win.document;
let QuickFilterBarMuxer = win.QuickFilterBarMuxer;
//thunderbird-private-tabmail-buttons
// qfb-show-filter-bar : document.getElementById("qfb-show-filter-bar").checked = aFilterer.visible;
-
+
//quick-filter-bar
// quick-filter-bar-main-bar
// qfb-sticky qfb-filter-label [quick-filter-bar-collapsible-buttons] [100 results] [search filter]
@@ -312,7 +309,7 @@ var ExpressionSearchChrome = {
// quick-filter-bar-tab-bar : it's taG bar
// quick-filter-bar-filter-text-bar.collapsed=(aFilterValue.text == null);
//QuickFilterState.visible
-
+
//QuickFilterBarMuxer
// onMakeActive for qfb-show-filter-bar visiable
// reflectFiltererState for qfb-show-filter-bar checked
@@ -360,11 +357,11 @@ var ExpressionSearchChrome = {
spacer.style.flex = '1 2000 auto';
}
}
-
+
let resultsLabel = document.getElementById("qfb-results-label");
if ( resultsLabel ) {
if ( typeof(resultsLabel._saved_minWidth) == 'undefined' ) resultsLabel._saved_minWidth = resultsLabel.getAttribute('minwidth') || 1;
- let layout = Services.prefs.getIntPref("mail.pane_config.dynamic");
+ let layout = Services.prefs.getIntPref("mail.pane_config.dynamic");
let minWidth = ( this.options.results_label_size == 2 || ( this.options.results_label_size == 0 && this.options.move2bar == 0 && layout == win.kVerticalMailLayout ) ) ? 0 : resultsLabel._saved_minWidth;
resultsLabel.setAttribute('minwidth', minWidth);
if ( minWidth == 0 ) delete resultsLabel.style.width;
@@ -393,14 +390,14 @@ var ExpressionSearchChrome = {
QuickFilterBarMuxer._minExpandedBarWidth = 0; // let it re-calculate the min expanded bar width because we changed the layout
QuickFilterBarMuxer.onWindowResize.apply(QuickFilterBarMuxer);
} else {
- let quickFilterBarBox = document.getElementById("quick-filter-bar-main-bar");
+ let quickFilterBarBox = document.getElementById("quick-filter-bar-main-bar");
if ( quickFilterBarBox && quickFilterBarBox.clientWidth < quickFilterBarBox.scrollWidth ) {
QuickFilterBarMuxer.onOverflow.apply(QuickFilterBarMuxer);
}
}
}
}
-
+
let menu = document.getElementById(contextMenuID);
if ( menu ) {
for (let i = 0; i < menu.childNodes.length; i++ ) {
@@ -410,13 +407,13 @@ var ExpressionSearchChrome = {
};
}
},
-
+
hideUpsellPanel: function(win) {
let panel = win.document.getElementById("qfb-text-search-upsell");
if ( panel.state == "open")
panel.hidePopup();
},
-
+
helpTimer: 0,
showHideHelp: function(win, show, line1, line2, line3, line4) {
@@ -447,7 +444,7 @@ var ExpressionSearchChrome = {
this.helpTimer = setTimeout( function(){ tooltip.hidePopup(); }, time2hide );
}
},
-
+
onTokenChange: function(event) {
let searchValue = this.value;
let start = searchValue.lastIndexOf(' ', this.selectionEnd > 0 ? this.selectionEnd - 1 : 0); // selectionEnd is index of the character after the selection
@@ -459,7 +456,7 @@ var ExpressionSearchChrome = {
let win = ExpressionSearchChrome.getWinFromEvent(event);
ExpressionSearchChrome.showHideHelp(win, 1, help.alias, help.info, help.matchString, term);
},
-
+
delayedOnSearchKeyPress: function(event) {
let me = ExpressionSearchChrome;
let win = ExpressionSearchChrome.getWinFromEvent(event);
@@ -500,20 +497,20 @@ var ExpressionSearchChrome = {
// me.back2OriginalFolder(win);
else me.onTokenChange.apply(this, [event]);
},
-
+
onSearchKeyPress: function(event){
let self = this;
// defer the call or this.value is still the old value, not updated with event.char yet
setTimeout( function(){ ExpressionSearchChrome.delayedOnSearchKeyPress.call(self,event); }, 0);
},
-
+
onSearchBarBlur: function(event) {
let win = ExpressionSearchChrome.getWinFromEvent(event);
ExpressionSearchChrome.hideUpsellPanel(win);
ExpressionSearchChrome.isFocus = false;
ExpressionSearchChrome.showHideHelp(win, false);
},
-
+
getWinFromEvent: function(event) {
try {
return event.view || event.currentTarget.ownerDocument.defaultView;
@@ -521,7 +518,7 @@ var ExpressionSearchChrome = {
ExpressionSearchLog.logException(err);
}
},
-
+
onSearchBarFocus: function(event) {
let win = ExpressionSearchChrome.getWinFromEvent(event);
let aNode = win.document.getElementById(ExpressionSearchChrome.textBoxDomId);
@@ -553,7 +550,7 @@ var ExpressionSearchChrome = {
aNode.setAttribute("minwidth", 280);
oldTextbox.parentNode.insertBefore(aNode, oldTextbox.nextSibling);
win._expression_search.createdElements.push(aNode);
-
+
aNode.addEventListener("keypress", this.onSearchKeyPress, true); // false will be after onComand, too late
//aNode.addEventListener("input", this.onTokenChange, true); // input can't get arrow key change but can get update when click2search
aNode.addEventListener("click", this.onTokenChange, true); // to track selectEnd change
@@ -561,14 +558,14 @@ var ExpressionSearchChrome = {
aNode.addEventListener("focus", this.onSearchBarFocus, true);
this.setSearchTimeout(win);
},
-
+
setSearchTimeout: function(win) {
let doc = win.document;
let aNode = doc.getElementById(this.textBoxDomId);
if ( !aNode ) return;
aNode.timeout = this.options.search_timeout || 1000000000;
},
-
+
back2OriginalFolder: function(win) {
try {
if ( typeof(win._expression_search.originalURI) == 'undefined' ) return;
@@ -576,7 +573,7 @@ var ExpressionSearchChrome = {
} catch (err) {
}
},
-
+
// not works well for complex searchTerms. But it's for all folders.
createQuickFolder: function(win, searchTerms) {
const nsMsgFolderFlags = Ci.nsMsgFolderFlags;
@@ -598,7 +595,7 @@ var ExpressionSearchChrome = {
return;
}
let QSFolderURI = targetFolderParent.URI + "/" + QSFolderName;
-
+
if ( !targetFolderParent.containsChildNamed(QSFolderName) || ! this.options.reuse_existing_folder ) {
for (let folder of fixIterator(rootFolder.descendants, Ci.nsIMsgFolder)) {
// only add non-virtual non-news folders
@@ -676,7 +673,7 @@ var ExpressionSearchChrome = {
}
ExpressionSearchChrome.isEnter = false;
},
-
+
calculateResult: function(e) {
if (e.kind == 'op') {
if (e.tok == '+' || (e.right != undefined && e.tok == '-') || e.tok == '*' || e.tok == '/') {
@@ -724,7 +721,7 @@ var ExpressionSearchChrome = {
aNode.value = lhs + " = " + rhs;
aNode.setSelectionRange(lhs.length, lhs.length + rhs.length + 3); // TODO: not work?
},
-
+
//Check conditions for search: corresponding modifier is hold on or middle button is pressed
CheckClickSearchEvent: function( event ) {
// event.button: 0:left, 1:middle, 2:right
@@ -733,8 +730,8 @@ var ExpressionSearchChrome = {
if ( ExpressionSearchChrome.options.c2s_enableShift && event.shiftKey ) return true;
return false;
},
-
- //Replace string using user-defined regexp. If not match, return original strings.
+
+ //Replace string using user-defined regexp. If not match, return original strings.
//If multiple matches, return all replaces, concatinated with OR operator
RegexpReplaceString : function( str ) {
if ( ExpressionSearchChrome.options.c2s_regexpMatch.length == 0 ) return str;
@@ -853,7 +850,7 @@ var ExpressionSearchChrome = {
aNode._fireCommand(aNode);
return;
},
-
+
firstRunAction: function() {
let anchor = '';
if ( this.options.installed_version != "0.1" ) anchor = '#version_history'; // this is an update
@@ -955,7 +952,7 @@ var ExpressionSearchChrome = {
win._expression_search.createdElements.push(statusbarPanel);
}
},
-
+
loadInto3pane: function(win) {
let me = ExpressionSearchChrome;
try {
@@ -1025,7 +1022,7 @@ var ExpressionSearchChrome = {
aWindow.removeEventListener("unload", ExpressionSearchChrome.onUnLoad, false);
ExpressionSearchChrome.unLoad(aWindow);
},
-
+
setFocus: function(win) {
if ( ExpressionSearchChrome.options.move2bar==0 && !QuickFilterBarMuxer.activeFilterer.visible )
QuickFilterBarMuxer._showFilterBar(true);
@@ -1063,7 +1060,7 @@ var ExpressionSearchChrome = {
let menupopup = doc.createElementNS(XULNS, "menupopup");
let menuGroupName = 'expression_search-status_menu';
menupopup.id = contextMenuID;
- [
+ [
["about:config", "", function(){ ExpressionSearchCommon.loadURL('about:config'); }],
["about:crashes", "", function(){ ExpressionSearchCommon.loadTab('about:crashes'); }],
["about:memory", "", function(){ ExpressionSearchCommon.loadURL('about:memory?verbose'); }],
@@ -1191,4 +1188,4 @@ var ExpressionSearchChrome = {
}
},
-};
\ No newline at end of file
+};
diff --git a/content/help.html b/content/help.html
index 065cf58..b86c38e 100644
--- a/content/help.html
+++ b/content/help.html
@@ -54,7 +54,7 @@
Search expressions and quick search key
Here are some examples:
-
weekend plans
-This expression searches all messages in the current folder or view for
+
This expression searches all messages in the current folder or view for
'weekend plans' in the from, to, cc, or subject
fields.
If "Act as normal filter" enabled, the "Sender", "Recipients", "Subject" and "Body" buttons will
@@ -91,7 +91,7 @@
Search expressions and quick search key
subject:electric bill or s:electric bill
-This expression searches all messages in the current folder or view for 'electric bill'
+
This expression searches all messages in the current folder or view for 'electric bill'
in the subject fields of the message. Case insensitive.
@@ -136,7 +136,7 @@
Search expressions and quick search key
attachment:yes or a:yes
This expression searches all messages in the current folder or view for an attachment,
-Notice that it does not search for attachments named "yes". You can also use "y" or "1" for
+Notice that it does not search for attachments named "yes". You can also use "y" or "1" for
"yes". You can use "no", "n", or "0" to search for messages without attachments.
@@ -161,7 +161,7 @@
Search expressions and quick search key
before:07:12:00 or be:5:9 or after:03:07:05 or af:(3:0 -4:0)
This expression searches all messages in the current folder or view within the time range.
-af:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day.
+af:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day.
date:2011/01 or date:2011/01/03 or d:" 03:" or in zh-CN locale d:2011年3月
@@ -184,10 +184,10 @@
Search expressions and quick search key
body:electric bill
-This expression searches all messages in the current folder or view for 'electric bill'
-in the body of the message. On large or remote folders it may take some time. Also, if you
-combine this with other search operators like "from:", "subject:" or "to:" this will speed
-things up considerably.
+
This expression searches all messages in the current folder or view for 'electric bill'
+in the body of the message. On large or remote folders it may take some time. Also, if you
+combine this with other search operators like "from:", "subject:" or "to:" this will speed
+things up considerably.
bodyre:/hello.*world/i or br:test
@@ -235,7 +235,7 @@
Hot Key
you will be able to type.
Expression Search add one additional hot key "Ctrl+B".
Once you are typing in your search query, and you hit enter or otherwise let
-it begin searching, your cursor will remain inside of the query box to allow you
+it begin searching, your cursor will remain inside of the query box to allow you
to modify the query. However, if you'd rather go back to browsing your messages,
instead of clicking on the message headers in your search results, you can just
press 'ESC' to to clear the search criteria, and press 'ESC' again to refocus back
@@ -260,7 +260,7 @@ Quick Search Virtual Folder
current account.
The resulting virtual folder 'ExpressionSearch' can then be modified
by editing properties, or can be renamed to make it a permanent virtual search folder.
-If you do not rename the folder, the next time you use ctrl-enter the ExpressionSearch
+If you do not rename the folder, the next time you use ctrl-enter the ExpressionSearch
virtual folder is reused to show your new quick search result.
@@ -482,9 +482,9 @@ Known Issues of this extension or Thunderbird
-
Bug 474730 - should search newest first - searching returns messages in bad order, making searches very time-consuming and irrelevant for large databases
-
-Bug 564328 - Keyboard shortcut Ctrl+F conflict and cmd_find ambiguity, used for both Find in This Message and Quick Filter
+Bug 564328 - Keyboard shortcut Ctrl+F conflict and cmd_find ambiguity, used for both Find in This Message and Quick Filter
-
-Bug 600140 - 'Unread' quick filter hides some unread messages (the beginning of a thread)
+Bug 600140 - 'Unread' quick filter hides some unread messages (the beginning of a thread)
-
Bug 607295 - Provide UI for new archive granularity and folder structure options
-
diff --git a/locale/de-DE/ExpressionSearch.dtd b/locale/de-DE/ExpressionSearch.dtd
index 9a6ea38..7e06b3c 100644
--- a/locale/de-DE/ExpressionSearch.dtd
+++ b/locale/de-DE/ExpressionSearch.dtd
@@ -1,58 +1,58 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/locale/de-DE/ExpressionSearch.properties b/locale/de-DE/ExpressionSearch.properties
index a96d25d..32b5694 100644
--- a/locale/de-DE/ExpressionSearch.properties
+++ b/locale/de-DE/ExpressionSearch.properties
@@ -1,72 +1,72 @@
-# for customer search terms
-Bcc=Bcc
-toSomebodyOnly=To Somebody Only
-subjectRegex=Subject (RegEx)
-subjectSimple=Subject (Long)
-headerRegex=Header (RegEx)
-fromRegex=From (RegEx)
-toRegex=Recipients (To/Cc/Bcc RegEx)
-dayTime=Time (Every Day)
-dateMatch=Date Match (2011/01/01)
-attachmentNameOrType=Attachment Name/Type
-bodyRegex=Body (RegEx)
-
-# for input
-textbox.emptyText.base=Expression Search... #1
-focusSearch.key=b
-focusSearch.mod=accel
-back2folder.keycode=VK_LEFT
-back2folder.mod=accel alt
-
-# for context menu
-about.about=About
-dialog.settings=Settings
-option.help=Help
-donate.label=Donate
-donate.image=chrome://expressionsearch/content/paypal.ico
-donate.pay=paypal
-
-# for tooltip information
-info.helpLine1=You can disable this tooltip in option dialog
-info.helpLine2=Please type keyword to search
-info.disable=You can disable this tooltip in option dialog
-info.blank=Please type keywords to search, click this line for help
-info.after=after:Mar 10, 2011\naf:(2011/03/01 -2011/03/09)\nafter:Mon, 25 Dec 1995 13:30:00 GMT\naf:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day
-info.all=search message within from, to, cc, or subject fields, and the body
-info.attachment=attachment:yes or a:yes or a:no
-info.bcc=BCC field contains
-info.before=before:2011/03/09 07:12:00\nbe:09 Mar 2011 05:00:00
-info.body=Body contains
-info.bodyre=bodyre:/hello.*world/i\nBody match\nWarning! May crash your Thunderbird
-info.cc=CC field contains
-info.date=date:yyyy/mm/dd hh:mm:ss\ndate:2011/01\ndate:2011/01/03
-info.days=age:3 or older_than:today or days:(3 -5)\ntoday means -1, week means 7 and month means 30
-info.filename=filename:foo.doc or fi:image or fn:msword or file:html\nsearches for an attachment name or type
-info.from=from:(Alice or Bob)\nSearches From field
-info.fromto=fromto:(Alice)\nFrom, To, CC or BCC field contains
-info.fromre=fromre:/^[a-d].*[m-z]$/i\nSearches From field using regular expression
-info.tore=tore:/^[a-d].*[m-z]$/i\nSearches recipients(To/Cc/Bcc) field using regular expression
-info.newer_than=n:8 or nt:7week or newer_than:1year
-info.only=only:tom\ntom should be the only recipients in to field
-info.regex=regex:/^begin/i or re:end$ or r:/\d+\s*\d+/\nSubject matches
-info.headerre=headerre:List-Id=/all-test/i or h:list-id or hr:header~/^value/
-info.simple=simple:hello'\nSubject field contains, support special characters
-info.status=is:replied or i:UnRead or status:Forwarded or status:F\nThe status can be one of Replied, Read, Marked/Star, Forwarded, UnRead, New, ImapDeleted or Attachment.
-info.subject=subject:(Hello -World!)\nSearches Subject to Contains Hello but not World!
-info.tag=tag:Important\nTag contains\ntag:NA means no tag
-info.to=To or CC field contains
-info.tonocc=To fileld contains
-info.size=size:10 or size:1.4M\nMessage Size big than
-info.smaller=smaller:1G or sm:1024\nMessage Size less than
-info.gloda=Trigger gloda search if enabled
-
-# for virtual folder select
-virtualfolder.selectall=Select All
-virtualfolder.clearall=Clear All
-virtualfolder.modelabel=When click change:
-virtualfolder.modesingle=Current Only
-virtualfolder.modechild=Current & Children
-virtualfolder.modedescendants=Current & Descendants
-
-# If you can localize the help document, please change "content" to "locale" below and put localized document under locale dir
-expressionsearch.helpfile=chrome://expressionsearch/content/help.html
+# for customer search terms
+Bcc=Bcc
+toSomebodyOnly=To Somebody Only
+subjectRegex=Subject (RegEx)
+subjectSimple=Subject (Long)
+headerRegex=Header (RegEx)
+fromRegex=From (RegEx)
+toRegex=Recipients (To/Cc/Bcc RegEx)
+dayTime=Time (Every Day)
+dateMatch=Date Match (2011/01/01)
+attachmentNameOrType=Attachment Name/Type
+bodyRegex=Body (RegEx)
+
+# for input
+textbox.emptyText.base=Expression Search... #1
+focusSearch.key=b
+focusSearch.mod=accel
+back2folder.keycode=VK_LEFT
+back2folder.mod=accel alt
+
+# for context menu
+about.about=About
+dialog.settings=Settings
+option.help=Help
+donate.label=Donate
+donate.image=chrome://expressionsearch/content/paypal.ico
+donate.pay=paypal
+
+# for tooltip information
+info.helpLine1=You can disable this tooltip in option dialog
+info.helpLine2=Please type keyword to search
+info.disable=You can disable this tooltip in option dialog
+info.blank=Please type keywords to search, click this line for help
+info.after=after:Mar 10, 2011\naf:(2011/03/01 -2011/03/09)\nafter:Mon, 25 Dec 1995 13:30:00 GMT\naf:(3:0 -4:0) will search for messages in current view that date between 3am to 4am EVERY day
+info.all=search message within from, to, cc, or subject fields, and the body
+info.attachment=attachment:yes or a:yes or a:no
+info.bcc=BCC field contains
+info.before=before:2011/03/09 07:12:00\nbe:09 Mar 2011 05:00:00
+info.body=Body contains
+info.bodyre=bodyre:/hello.*world/i\nBody match\nWarning! May crash your Thunderbird
+info.cc=CC field contains
+info.date=date:yyyy/mm/dd hh:mm:ss\ndate:2011/01\ndate:2011/01/03
+info.days=age:3 or older_than:today or days:(3 -5)\ntoday means -1, week means 7 and month means 30
+info.filename=filename:foo.doc or fi:image or fn:msword or file:html\nsearches for an attachment name or type
+info.from=from:(Alice or Bob)\nSearches From field
+info.fromto=fromto:(Alice)\nFrom, To, CC or BCC field contains
+info.fromre=fromre:/^[a-d].*[m-z]$/i\nSearches From field using regular expression
+info.tore=tore:/^[a-d].*[m-z]$/i\nSearches recipients(To/Cc/Bcc) field using regular expression
+info.newer_than=n:8 or nt:7week or newer_than:1year
+info.only=only:tom\ntom should be the only recipients in to field
+info.regex=regex:/^begin/i or re:end$ or r:/\d+\s*\d+/\nSubject matches
+info.headerre=headerre:List-Id=/all-test/i or h:list-id or hr:header~/^value/
+info.simple=simple:hello'\nSubject field contains, support special characters
+info.status=is:replied or i:UnRead or status:Forwarded or status:F\nThe status can be one of Replied, Read, Marked/Star, Forwarded, UnRead, New, ImapDeleted or Attachment.
+info.subject=subject:(Hello -World!)\nSearches Subject to Contains Hello but not World!
+info.tag=tag:Important\nTag contains\ntag:NA means no tag
+info.to=To or CC field contains
+info.tonocc=To fileld contains
+info.size=size:10 or size:1.4M\nMessage Size big than
+info.smaller=smaller:1G or sm:1024\nMessage Size less than
+info.gloda=Trigger gloda search if enabled
+
+# for virtual folder select
+virtualfolder.selectall=Select All
+virtualfolder.clearall=Clear All
+virtualfolder.modelabel=When click change:
+virtualfolder.modesingle=Current Only
+virtualfolder.modechild=Current & Children
+virtualfolder.modedescendants=Current & Descendants
+
+# If you can localize the help document, please change "content" to "locale" below and put localized document under locale dir
+expressionsearch.helpfile=chrome://expressionsearch/content/help.html
From 0d3bc522661b563f654d520ced7bd25a60251ab8 Mon Sep 17 00:00:00 2001
From: Till Riedel
Date: Wed, 8 Jul 2020 00:42:38 +0200
Subject: [PATCH 3/4] looser max version string
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index 660ce07..20a5486 100644
--- a/manifest.json
+++ b/manifest.json
@@ -3,7 +3,7 @@
"gecko": {
"id": "{03EF8A6E-C972-488f-92FA-98ABC2C9F8B9}",
"strict_min_version": "68.0",
- "strict_max_version": "68.9"
+ "strict_max_version": "68.*"
}
},
"version": "1.4.2",
From 1fd64d168b0d2dfcef155bf510e472e34fc3d0ac Mon Sep 17 00:00:00 2001
From: Till Riedel
Date: Wed, 8 Jul 2020 00:53:25 +0200
Subject: [PATCH 4/4] add release into repo (strange but...)
---
.../gmailui-1.4.2-tb.xpi | Bin 109376 -> 134060 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
rename beta/gmailui-1.4-tb.xpi => releases/gmailui-1.4.2-tb.xpi (59%)
diff --git a/beta/gmailui-1.4-tb.xpi b/releases/gmailui-1.4.2-tb.xpi
similarity index 59%
rename from beta/gmailui-1.4-tb.xpi
rename to releases/gmailui-1.4.2-tb.xpi
index 69bf779e38320b8c6bf3d469a6086421a56a03ba..2486d033e6034a25e5d3db903f57c1c636063a6f 100644
GIT binary patch
delta 45355
zcmV)LK)Jub)&{JX2!BvZ0|XQR000O8;sNMTxJEDQ`33+0=@9?`3;+NCVsCGBb98cH
za4u?dtytS~(=ZTy&sQvY00$BWhBt0QNdlB9*N}l3hUqBwCN{ODAjwGs^xrv>Y$pW@
zh2a5O%e$++owMr>hxBsATEy>!T;AZ*m1bjdB@GLmWDl36$bXACQ6)Wjbu@hb>ZsGL
z43n`sPi*&Yr!%VJyj&@5qb@X6r4zn094<8vOO;jyo8gr8I#1ZdpG?{9-RS&%|0x6P>T@aiUT_ZZ4XcTrT6x
zmPMzNAOcIq7=OA?qvS*PVX404MImCPmqWa?EbY+PZNUSRG24L&Uf#Xc{TMIV)=o#G
zJeKBg>IA1wu0BT?;Rb}EN7E^8X~WD_EO|3~a~O4#Osmr6<1bzME~++GREQ1MT=%zxZj=h{}Hc&v()^-*qYmp(RD
z)Z7KflQm+7k?v_#3^v~8K=Tr^NOo%ge&as6B?*zJlT
z+(@NHpC
zq&{szK39quKlt?JB67F%=pNnNr2-0VE4citg5yFhr|?fMpToFVa@3u)4FPG_5qEsj
zAws)X;myc5kwXq$@DA?eHVVOR(B&j#N(hC@Eq^WY0`=|tqqmP}Bai@Bo>Y~GW8zbk
z-_RywSxX{}rX~7h6e(G3DG^1%X%NfAn(MkjR;1gD-8w=^xmPS5hD>!LhFTQP|}$V=TL4%8yTWnDb`#9VZQB~+oJCH~U1zcYir
z?|+}O*r$akjKg=Z^#c+bf5Pjt@T0j88UOdo&iXD30jYZlFxC7MC$>*kt@5N#sj#An
zH1wrAr~CKMp?sH%^U03)(;QK4JbqoV-XcoY3(<03`}~GKR}7-oJqNTO#Smgsqb4gM
z8YIWD_<{4V;58Rb)8vwb138J+%8`YTB!3N_>nsu-N|UFIE)~92HMdevJg3yPkHm?<
z*`5dSj=>D@YO7Tw#z+{t{|yVHWXQ|Ez!T)~M5$%L^c<8+v%}_wIF17}_Xgp`wBJk~
zKMjMP>*h?>muOS}08zvP}Z_I|!h2uzwk_r|Y6L*8uH%pxj5h
z+kr5eL95LM(Wi~lC&pjqj@uzw+%Xcq!I|78Q-tP1GKV);4lRqTV^)qI;1&u|l
zHPQjH((K4;qBXe19o}^7^RIh7s~Tldj^lK;!z9`E|qPc?YF`Ai&F0
zU~9Z3xy$q5FXmsn6#UGrt@Q6_@KmNSE0=x^%
08XJU*NrJUW_C
zc$&R9d@+4{aCFo>zk2fKVBEZQWb2hZn?Kdg;LQD%;g#kjH~eH2
zxl>do!S5k||7oqPN0=+k+1@94y)OJb+0J${6{h!vQr`hkO9KQH000080C$@%P?IDF
zmIQ1A=unfs2OO~I#09X){z&IL~paBZAV<}G$1b3S*P_wo;)ea7Y0_ac+
zJZB(sI{*MS;FFn0C>dZdOU~UuvI%jrz%#*bERF3Uvc~9$W0w7s+D9B7P0F)!oR6}T
z>+BE3ID1)sniZ4mw3=jJz0AweyXTV>NJbyMevy59H|u9FU%&Xtk2hF-I-8V(*~YJb
z^5dWU`0ye%(^i7Wq;9}lYWbe8@3-HUGyvxBU2KAT;l
z#?{qT@1pu=IU41?YI4^9P+VW+QxK+qmd}b0MS(u`XXnMF=#|r6H6C5}KFvoRKva0s
zSw5RjPx8rg{C@rfkT;4?mq2M+R^#nykxvHa+gfNFrPz}gNfQBwlPpOiK{R_=jOT6G
znUi7q=BEp(vTgG=96zqM}NET(?SM0@<5i2s(e_WmpUfpxSZ{0r)D&|n>wah
z76`cZPRP_8&(N7ONID2QwoCZ<=PWxdCsV-;t(<0E3@}8Pww_5lKjN#|}aZncPiZ0>bNJa(}AN`S|;6
zkk7CLb&JVFQCx)9(@%p!h%Ut)4DGV%^et&g1~B`@FPb1JEwsuy6yQwz=GEH_PiOgL
zhW<@&Wv@p?j@8XP%if-Y5sS%5IT_vpopy<&w)1^ffMzH-n@`5(slhxPr-N+Qyfovq
zE|zYb_UhxLuv*3`d>M|DB7dI@(?YCj!{qw>xnJ;gLQnV;!`9WLC{
z^XlptZ+e5X^2>5~uzUBx-M!uWKOOAdQvh$dh-VPp+3c#yuJY?CI+xF~t0EiBCzz)*
zC^*ykCGp5E^TCH4g6k}+F2?2G^U1yf+1&(LA^#y_vfn>^gDD1dMSq9lg7=}EW!5G|-cS@&c<<3rXK&5iG{SV10dZVA+YOMPuEVOn@T#)zZp-WFNgs#|@j
zo#Z4t^e$A3bFrEvhZn^svl>i~K&I3Je~zaaQ!1%5d}*HK>NCBLBCSUA$o
zQgP+bP3-`@d-Gx{43r5T0vodrr7B=MDL5n1gzfUxq~dsvi(dApB0GnW%(D~l*?Cr-
zvH*&e)9D=D?-oLILGY^NI1Go|5W1UCkfAw)W2SgKI0s2bIe(Pk*)$r6N1!(w98^QL
zoD;A4l!Ka*iaikSVUJBWx7c;AY1v0;68RRz%yb4mkLV_y>1DV3VZ&>!8E06iNAvP^
zKA9G}c-#O;UR~a}E;OkNsIftHFcgVFHN{B)L!a3!ADlx2h2ktw8f0SgmLS+du-+jC
z)@=${t3{M80e_}Q7+@Zj>&96z#$IRyWK}(>k!RI?&bqziwyhD!&H70m3BWbdwEx-iI^DtL%kV4af^nN%TlEYUYWq(wt#xL`6eirOd4Lzw`Q-FOK
zS637_+