From 6db3e4865014e4769c54b8af8789aaa39fc215ba Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Thu, 2 Mar 2006 20:17:01 +0000 Subject: [PATCH] Bug #328795 --> Covnert Thunderbird to use toolkit's typeaheadfind bar sr=bienvenu --- mail/app/profile/all-thunderbird.js | 5 ++++ mail/base/content/mail3PaneWindowCommands.js | 6 ++--- mail/base/content/mailWindow.js | 8 +++++- mail/base/content/mailWindowOverlay.js | 20 ++++---------- mail/base/content/mailWindowOverlay.xul | 26 +++++++++++-------- mail/base/content/messageWindow.js | 10 ++++--- mail/base/content/messageWindow.xul | 3 +-- mail/base/content/messenger.xul | 3 +-- mail/base/content/msgMail3PaneWindow.js | 26 +++++++++++-------- .../en-US/chrome/messenger/messenger.dtd | 2 -- 10 files changed, 59 insertions(+), 50 deletions(-) diff --git a/mail/app/profile/all-thunderbird.js b/mail/app/profile/all-thunderbird.js index 13b56b1fac2b..8bff9e45d0af 100644 --- a/mail/app/profile/all-thunderbird.js +++ b/mail/app/profile/all-thunderbird.js @@ -179,6 +179,11 @@ pref("browser.preferences.animateFadeIn", true); pref("browser.preferences.animateFadeIn", false); #endif +pref("accessibility.typeaheadfind", false); +pref("accessibility.typeaheadfind.timeout", 5000); +pref("accessibility.typeaheadfind.linksonly", false); +pref("accessibility.typeaheadfind.flashBar", 1); + ///////////////////////////////////////////////////////////////// // Overrides of the seamonkey suite mailnews.js prefs ///////////////////////////////////////////////////////////////// diff --git a/mail/base/content/mail3PaneWindowCommands.js b/mail/base/content/mail3PaneWindowCommands.js index 6f96bbf7a608..0432fa4aa6cc 100644 --- a/mail/base/content/mail3PaneWindowCommands.js +++ b/mail/base/content/mail3PaneWindowCommands.js @@ -200,7 +200,7 @@ var DefaultController = case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": - case "cmd_findPrev": + case "cmd_findPrevious": case "cmd_search": case "button_mark": case "cmd_markAsRead": @@ -366,7 +366,7 @@ var DefaultController = return IsFolderSelected(); case "cmd_find": case "cmd_findAgain": - case "cmd_findPrev": + case "cmd_findPrevious": return IsMessageDisplayedInMessagePane(); break; case "cmd_search": @@ -592,7 +592,7 @@ var DefaultController = SetFocusMessagePane(); MsgFindAgain(false); return; - case "cmd_findPrev": + case "cmd_findPrevious": // make sure the message pane has focus before we start a find since we only support searching // within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus SetFocusMessagePane(); diff --git a/mail/base/content/mailWindow.js b/mail/base/content/mailWindow.js index 659cb1043462..0e7bfe1b0c40 100644 --- a/mail/base/content/mailWindow.js +++ b/mail/base/content/mailWindow.js @@ -224,7 +224,7 @@ function InitMsgWindow() msgWindow.msgHeaderSink = messageHeaderSink; msgWindow.SetDOMWindow(window); mailSession.AddMsgWindow(msgWindow); - document.getElementById("messagepane").docShell.allowAuth = false; + getBrowser().docShell.allowAuth = false; msgWindow.rootDocShell.allowAuth = true; } @@ -602,6 +602,12 @@ function HidingThreadPane() ClearThreadPane(); } +// the find toolbar needs a method called getBrowser +function getBrowser() +{ + return document.getElementById("messagepane"); +} + function ObserveDisplayDeckChange(event) { var deck = document.getElementById("displayDeck"); diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js index 5621240a4bad..3bfbb5ed7e71 100644 --- a/mail/base/content/mailWindowOverlay.js +++ b/mail/base/content/mailWindowOverlay.js @@ -1372,26 +1372,16 @@ function MsgViewPageSource() ViewPageSource(messages); } -var gFindInstData; -function getFindInstData() -{ - if (!gFindInstData) { - gFindInstData = new nsFindInstData(); - gFindInstData.browser = getMessageBrowser(); - gFindInstData.__proto__.rootSearchWindow = window.top.content; - gFindInstData.__proto__.currentSearchWindow = window.top.content; - } - return gFindInstData; -} - function MsgFind() { - findInPage(getFindInstData()); + gFindBar.onFindCmd(); } - function MsgFindAgain(reverse) { - findAgainInPage(getFindInstData(), reverse); + if (reverse) + gFindBar.onFindPreviousCmd(); + else + gFindBar.onFindAgainCmd(); } function MsgCanFindAgain() diff --git a/mail/base/content/mailWindowOverlay.xul b/mail/base/content/mailWindowOverlay.xul index b42b85c603b3..c96ff1af497d 100644 --- a/mail/base/content/mailWindowOverlay.xul +++ b/mail/base/content/mailWindowOverlay.xul @@ -37,7 +37,8 @@ # ***** END LICENSE BLOCK ***** - + + @@ -51,6 +52,8 @@ %contentAreaCommandsDTD; %brandDTD; + + %findBarDTD; ]>