Package: release.debian.org Severity: normal Tags: wheezy User: release.debian....@packages.debian.org Usertags: pu
Hi, With the latest DSA 3061-1, icedove is updated to 31 via security, and some extensions may again need some update. The incompatibility of nostalgy with icedove 31 is known for a while, so the fix for #752870 is already in place in testing for a few months. Please consider accepting this new upstream version in stable, even if it breaks icedove << 31. For once, the debdiff is not as insane as usual… $ diffstat /tmp/nostalgy.diff | tail -n1 17 files changed, 194 insertions(+), 153 deletions(-) Regards David P.-S.: I may be back in a few weeks with other request(s) if other extensions get identified as broken with icedove 31.
diff --git a/CHANGES b/CHANGES index 6d2358b..3f99da6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +0.2.32 + - Modernize code and adapt for TB 26.0 (thanks to Jens Hatlak) + 0.2.31 - Fix for TB >= 20 (thanks to Aaron Solochek) - Add hot keys for "Move up/down" in the rule edition popup (thanks to Michael vann Rooyen) diff --git a/chrome.manifest b/chrome.manifest index ba9a14c..435093a 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -3,3 +3,5 @@ locale nostalgy en-US 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.manifest.pack b/chrome.manifest.pack index acbab62..e9b1102 100644 --- a/chrome.manifest.pack +++ b/chrome.manifest.pack @@ -3,3 +3,5 @@ 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/components/nostalgy-autocomplete.js b/components/nostalgy-autocomplete.js new file mode 100644 index 0000000..fb6e3f3 --- /dev/null +++ b/components/nostalgy-autocomplete.js @@ -0,0 +1,77 @@ +const Cc = Components.classes; +const Ci = Components.interfaces; +const Cu = Components.utils; + +Cu.import('resource://gre/modules/XPCOMUtils.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: XPCOMUtils.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: XPCOMUtils.generateQI([ Ci.nsIAutoCompleteSearch ]) +}; + + +// XPCOM component creation + +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ NostalgyAutoCompleteSearch ]); diff --git a/config_build.sh b/config_build.sh index 8d40480..449871e 100644 --- a/config_build.sh +++ b/config_build.sh @@ -4,6 +4,6 @@ APP_NAME=nostalgy CHROME_PROVIDERS="content locale" CLEAN_UP=0 ROOT_FILES= -ROOT_DIRS="defaults" +ROOT_DIRS="defaults components" BEFORE_BUILD= AFTER_BUILD= diff --git a/content/edit_prefs.xul b/content/edit_prefs.xul index 3618269..43e6279 100644 --- a/content/edit_prefs.xul +++ b/content/edit_prefs.xul @@ -111,6 +111,8 @@ shortcuts to move/copy the message to this folder.</label> <radio value="SaveGo" label="Save+Go"/> </radiogroup> <textbox style="width:600px" type="autocomplete" id="folderselect" + autocompletesearch="nostalgy-autocomplete" + completeselectedindex="true" nostalgyfolderbox="NostalgySelectFolder();"/> <button label="Create" oncommand="NostalgySelectFolder();"/> </hbox> diff --git a/content/edit_rule.xul b/content/edit_rule.xul index d178e93..51a5811 100644 --- a/content/edit_rule.xul +++ b/content/edit_rule.xul @@ -42,6 +42,8 @@ <label value="when message is under folder"/> <textbox type="autocomplete" id="underselect" normaltab="true" + completeselectedindex="true" + autocompletesearch="nostalgy-autocomplete" nostalgyfolderbox="NostalgyChooseUnder();"/> </row> @@ -49,6 +51,8 @@ <label value="then save to"/> <textbox type="autocomplete" id="folderselect" normaltab="true" + completeselectedindex="true" + autocompletesearch="nostalgy-autocomplete" nostalgyfolderbox="NostalgyChooseFolder();"/> </row> </rows> diff --git a/content/folders.js b/content/folders.js index f438d7e..0b798ac 100644 --- a/content/folders.js +++ b/content/folders.js @@ -131,57 +131,39 @@ function NostalgyFolderMatch(f,reg) { } } -function NostalgyAutocomplete(box) { - this.box = box; - this.xresults = - Components.classes[ - "@mozilla.org/autocomplete/results;1" - ].getService(Components.interfaces.nsIAutoCompleteResults); -} - -NostalgyAutocomplete.prototype.onStartLookup = -function(text, results, listener) { - var items = this.xresults.items; +function NostalgyGetAutoCompleteValuesFunction(box) { + return function NostalgyGetAutoCompleteValues(text) { + var values = []; var nb = 0; - items.Clear(); var add_folder = function (fname) { - var newitem = - Components.classes[ - "@mozilla.org/autocomplete/item;1" - ].createInstance(Components.interfaces.nsIAutoCompleteItem); - newitem.value = NostalgyCrop(fname); - - items.AppendElement(newitem); + values.push(NostalgyCrop(fname)); nb++; }; - var f = function (folder) { add_folder(NostalgyFolderName(folder)); }; if (text == "") { var added_count=0; + var predictedFolders = null; if ( nostalgy_completion_options.use_statistical_prediction ) { - var predictedFolders = null; try { predictedFolders = NostalgyPredict.predict_folder(nostalgy_recent_folders_max_size); } catch (ex) { } if( predictedFolders != null && predictedFolders.length > 0 ) for (var j = 0; j < predictedFolders.length; j++) - if ( added_count < nostalgy_recent_folders_max_size ) - { + if (added_count < nostalgy_recent_folders_max_size) { f(predictedFolders[j]); added_count++; } } - for ( j = 0; j < nostalgy_recent_folders.length; j++) - { + for (var j = 0; j < nostalgy_recent_folders.length; j++) { var found=0; - if ( nostalgy_completion_options.use_statistical_prediction && predictedFolders != null && predictedFolders.length > 0) + if (nostalgy_completion_options.use_statistical_prediction && + predictedFolders != null && predictedFolders.length > 0) for (var i=0; i < predictedFolders.length; i++) if (NostalgyFolderName(predictedFolders[i]) == nostalgy_recent_folders[j] ) found=1; - if ( found==0 && added_count < nostalgy_recent_folders_max_size ) - { + if ( found==0 && added_count < nostalgy_recent_folders_max_size ) { add_folder(nostalgy_recent_folders[j]); added_count++; } @@ -190,117 +172,30 @@ function(text, results, listener) { nostalgy_search_folder_options.do_tags = nostalgy_completion_options.always_include_tags || (text.substr(0,1) == ":"); - NostalgyIterateMatches(text, this.box.shell_completion, f); + NostalgyIterateMatches(text, box.shell_completion, f); if (nb == 0 && !nostalgy_search_folder_options.do_tags) { nostalgy_search_folder_options.do_tags = true; - NostalgyIterateMatches(text, this.box.shell_completion, f); + NostalgyIterateMatches(text, box.shell_completion, f); } } - this.xresults.searchString = text; - this.xresults.defaultItemIndex = 0; - listener.onAutoComplete(this.xresults, 1); -} + /* For unknown reason, the popup is left closed (even though box.popupOpen = true) + * when the user does a new nostalgy completion after the previous one has been + * cancelled with Escape. We this force the popup to be opened some time after + * the completeion is done. + */ + if (box.popup.state == "closed") + setTimeout(function() { + if (box.popup.state == "closed") { + NostalgyDebug("Forcing popup to be opened"); + box.popup.sizeTo(box.boxObject.width,300); + box.popup.openPopup(box, "before_start", 0, 0, false, false); + } }, 50); -NostalgyAutocomplete.prototype.onStopLookup = - function() { } -NostalgyAutocomplete.prototype.onAutoComplete = - function(text, results, listener){ } - -NostalgyAutocomplete.prototype.QueryInterface = -function(iid) { - if (iid.equals(Components.interfaces.nsIAutoCompleteSession)) return this; - throw Components.results.NS_NOINTERFACE; -} - -function NostalgyStartLookup() { - // Copy from autocomplete.xml, but does not exit early if box is empty - var str = this.currentSearchString; - try{ - - this.isSearching = true; - this.mFirstReturn = true; - this.mSessionReturns = this.sessionCount; - this.mFailureCount = 0; // For TB 2.0 - this.mFailureItems = 0; - this.mDefaultMatchFilled = false; // clear out our prefill state. - this.removeAttribute("noMatchesFound"); // For TB 2.0 - - // tell each session to start searching... - for (var name in this.mSessions) - try { - this.mSessions[name].onStartLookup(str, this.mLastResults[name], this.mListeners[name]); - } catch (e) { - --this.mSessionReturns; - this.searchFailed(); - } - } catch (e) { NostalgyDebug("ERR" + e); } -} - -function NostalgyProcessInput() { - if (this.ignoreInputEvent) - return; - - this.userAction = "typing"; - this.mNeedToFinish = true; - this.mTransientValue = false; - this.mNeedToComplete = true; - this.currentSearchString = this.value; -// this.resultsPopup.selectedIndex = null; -// this.popup.selectedIndex = null; - this.removeAttribute("noMatchesFound"); - - this.mAutoCompleteTimer = - setTimeout(this.callListener, this.timeout, this, "startLookup"); -} - -function NostalgyProcessKeyPress(aEvent) { - this.mLastKeyCode = aEvent.keyCode; - var killEvent = false; - switch (aEvent.keyCode) { - case KeyEvent.DOM_VK_TAB: - if (this.getAttribute("normaltab") != "true") { - if (nostalgy_completion_options.tab_shell_completion) { - this.shell_completion = true; - this.value = NostalgyCompleteUnique(this.value); - this.processInput(); - killEvent = true; - } - else { - this.clearTimer(); - killEvent = this.keyNavigation(aEvent); - } + return values; + }; } - break; - - case KeyEvent.DOM_VK_RETURN: - killEvent = this.mMenuOpen; - this.finishAutoComplete(true, true, aEvent); -// this.closePopup(); -// this.closeResultPopup(); - break; - - case KeyEvent.DOM_VK_ESCAPE: - this.clearTimer(); - killEvent = this.mMenuOpen; - this.undoAutoComplete(); -// this.closePopup(); -// this.closeResultPopup(); - break; - case KeyEvent.DOM_VK_PAGE_UP: - case KeyEvent.DOM_VK_DOWN: - case KeyEvent.DOM_VK_PAGE_DOWN: - case KeyEvent.DOM_VK_UP: - if (!aEvent.ctrlKey && !aEvent.metaKey) { - this.clearTimer(); - killEvent = this.keyNavigation(aEvent); - } - break; - } - if (killEvent) NostalgyStopEvent(aEvent); - return true; -} function NostalgyFolderSelectionBox(box) { var cmd = box.getAttribute("nostalgyfolderbox"); @@ -314,10 +209,24 @@ function NostalgyFolderSelectionBox(box) { } box.shell_completion = false; - box.addSession(new NostalgyAutocomplete(box)); - box.processInput = NostalgyProcessInput; - box.processKeyPress = NostalgyProcessKeyPress; - box.startLookup = NostalgyStartLookup; + var nac = + Components + .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"] + .getService() + .wrappedJSObject; + box.searchParam = nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box)); + + + box.onkeypress=function(event){ + if (event.keyCode == KeyEvent.DOM_VK_TAB && box.getAttribute("normaltab") != "true") { + event.preventDefault(); + if (nostalgy_completion_options.tab_shell_completion) { + box.shell_completion = true; + box.value = NostalgyCompleteUnique(box.value); + box.controller.handleText(); + } + } + }; } function NostalgyFolderSelectionBoxes() { diff --git a/content/messageOverlay.xul b/content/messageOverlay.xul index 666270a..f9ee795 100644 --- a/content/messageOverlay.xul +++ b/content/messageOverlay.xul @@ -26,10 +26,12 @@ <statusbarpanel flex="1"> <label id="nostalgy-command-label"/> <textbox id="nostalgy-folderbox" type="autocomplete" tabScrolling="true" + autocompletesearch="nostalgy-autocomplete" ontextentered="NostalgyRunCommand();" ontextcommand="NostalgyRunCommand();" ontextreverted="NostalgyHide(true);" ontextrevert="NostalgyHide(true);" + completeselectedindex="true" flex="1" maxrows="25" crop="center" /> diff --git a/content/nostalgy.js b/content/nostalgy.js index 8417b3e..3f4c961 100644 --- a/content/nostalgy.js +++ b/content/nostalgy.js @@ -123,7 +123,7 @@ var NostalgyRules = if (!nostalgy_in_message_window) NostalgyDefLabel(); return; } - if (aData = "number_of_recent_folders") { + if (aData == "number_of_recent_folders") { nostalgy_recent_folders_max_size = this._branch.getIntPref("number_of_recent_folders"); return; } @@ -311,7 +311,7 @@ function NostalgyCmd(lab,cmd,require_file) { setTimeout(function() { nostalgy_folderBox.focus(); - nostalgy_folderBox.processInput(); + //nostalgy_folderBox.processInput(); }, 0); // For some unknown reason, doing nostalgyBox.focus immediatly // sometimes does not work... @@ -347,7 +347,7 @@ function NostalgyRunCommand() { } else { if (s.substr(0,1) == ":") { - if ((s == ":") || (s == "::")) return + if ((s == ":") || (s == "::")) return; var name; if (s.substr(s.length-1,1) == ":") name = s.substr(1,s.length - 2); @@ -691,7 +691,7 @@ function NostalgySearchSenderQuickFilter() { new_state.states[field] = true; } return new_state; - } + }; var current = JSON.stringify(state); diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul index d668c4c..70b867b 100644 --- a/content/thunderbirdOverlay.xul +++ b/content/thunderbirdOverlay.xul @@ -39,10 +39,11 @@ <statusbarpanel flex="1"> <label id="nostalgy-command-label"/> <textbox id="nostalgy-folderbox" type="autocomplete" tabScrolling="true" + autocompletesearch="nostalgy-autocomplete" ontextentered="NostalgyRunCommand();" - ontextcommand="NostalgyRunCommand();" ontextreverted="NostalgyHide(true);" - ontextrevert="NostalgyHide(true);" + completeselectedindex="true" + highlightnonmatches="true" flex="1" maxrows="25" crop="center" /> diff --git a/debian/changelog b/debian/changelog index 3f6cdb8..6a14ba5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +nostalgy (0.2.32+4real-1~deb7u1) wheezy; urgency=medium + + * Team upload + * Drop maxVersion for Wheezy rebuild + * Upload compatible version with recent icedove to stable + + -- David Prévot <taf...@debian.org> Fri, 31 Oct 2014 17:40:56 -0400 + +nostalgy (0.2.32+4real-1) unstable; urgency=medium + + * Team upload of the actual 0.2.32 version (the previous upload was + actually a beta release) + + [ alain.frisch ] + * Fix for TB 31. (Closes: #752870) + * Cleanup, restore tab completion. + * Require TB 31. + + [ David Prévot ] + * Bump standards version to 3.9.5 + + -- David Prévot <taf...@debian.org> Sat, 09 Aug 2014 15:34:14 -0400 + +nostalgy (0.2.32-2) unstable; urgency=medium + + * Really upload to unstable + + -- Guido Günther <a...@sigxcpu.org> Mon, 14 Jul 2014 14:41:39 +0200 + +nostalgy (0.2.32-1) wheezy; urgency=medium + + * New upstream version (Closes: #752870) + * [85e746c] Drop 0003-Drop-maxVersion-for-Wheezy-rebuild.patch. Rebuild is + not for wheezy. + * [32990cf] Refresh patches + + -- Guido Günther <a...@sigxcpu.org> Mon, 14 Jul 2014 13:08:56 +0200 + nostalgy (0.2.31-1~deb7u1) wheezy; urgency=medium * Team upload diff --git a/debian/control b/debian/control index 1da62c9..687e363 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian Mozilla Extension Maintainers <pkg-mozext-maintain...@lists.alioth.debian.org> Uploaders: Guido Günther <a...@sigxcpu.org> Build-Depends: debhelper (>= 9), mozilla-devscripts -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-mozext/nostalgy.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-mozext/nostalgy.git Homepage: http://alain.frisch.fr/soft_mozilla.html diff --git a/debian/patches/0002-Fix-RDF-syntax.patch b/debian/patches/0002-Fix-RDF-syntax.patch index a47f1aa..f0333d8 100644 --- a/debian/patches/0002-Fix-RDF-syntax.patch +++ b/debian/patches/0002-Fix-RDF-syntax.patch @@ -7,7 +7,7 @@ Subject: Fix RDF syntax 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.rdf b/install.rdf -index d254814..a72b2da 100644 +index 51caf28..f7ad862 100644 --- a/install.rdf +++ b/install.rdf @@ -14,27 +14,27 @@ @@ -17,8 +17,8 @@ index d254814..a72b2da 100644 - <Description> + <RDF:Description> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> - <em:minVersion>1.5</em:minVersion> - <em:maxVersion>20.*</em:maxVersion> + <em:minVersion>31.0</em:minVersion> + <em:maxVersion>31.*</em:maxVersion> - </Description> + </RDF:Description> </em:targetApplication> diff --git a/debian/patches/0003-Drop-maxVersion-for-Wheezy-rebuild.patch b/debian/patches/0003-Drop-maxVersion-for-Wheezy-rebuild.patch index 600df63..7019acf 100644 --- a/debian/patches/0003-Drop-maxVersion-for-Wheezy-rebuild.patch +++ b/debian/patches/0003-Drop-maxVersion-for-Wheezy-rebuild.patch @@ -2,20 +2,20 @@ From: =?utf-8?q?David_Pr=C3=A9vot?= <taf...@debian.org> Date: Thu, 29 May 2014 18:27:17 -0400 Subject: Drop maxVersion for Wheezy rebuild -Wheezy ship with mozilla-devscripts (<< 0.33) so need extra care. +Wheezy is shipped with mozilla-devscripts (<< 0.33) so need extra care. --- install.rdf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.rdf b/install.rdf -index a72b2da..8154618 100644 +index f7ad862..d554107 100644 --- a/install.rdf +++ b/install.rdf @@ -17,7 +17,7 @@ <RDF:Description> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> - <em:minVersion>1.5</em:minVersion> -- <em:maxVersion>20.*</em:maxVersion> + <em:minVersion>31.0</em:minVersion> +- <em:maxVersion>31.*</em:maxVersion> + <em:maxVersion>*</em:maxVersion> </RDF:Description> </em:targetApplication> diff --git a/files b/files index 7737634..63b8aab 100644 --- a/files +++ b/files @@ -19,5 +19,6 @@ content/about.xhtml locale/en-US/nostalgy.properties locale/en-US/nostalgy.dtd defaults/preferences/nostalgy.js +components/nostalgy-autocomplete.js install.rdf chrome.manifest diff --git a/install.rdf b/install.rdf index d254814..51caf28 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ <RDF:Description RDF:about="urn:mozilla:install-manifest" em:id="nostalgy@alain.frisch" em:name="Nostalgy" - em:version="0.2.31" + em:version="0.2.32" em:creator="Alain Frisch" em:description="Adds shortcuts to change folder, move message, with folder completion" em:homepageURL="http://alain.frisch.fr/soft_mozilla.html" @@ -16,8 +16,8 @@ <!-- Thunderbird --> <Description> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> - <em:minVersion>1.5</em:minVersion> - <em:maxVersion>20.*</em:maxVersion> + <em:minVersion>31.0</em:minVersion> + <em:maxVersion>31.*</em:maxVersion> </Description> </em:targetApplication> <em:targetApplication>
signature.asc
Description: Digital signature