[Pkg-mozext-commits] [nostalgy] 226/252: Cleanup.
David Prévot
taffit at moszumanska.debian.org
Tue Jun 14 15:25:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit d1a09162472958a2578b59f454d8121bcac17fb1
Author: alain.frisch <alain.frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Mon Dec 16 10:48:53 2013 +0000
Cleanup.
---
content/folders.js | 118 ++++++++++++++++++++++++++---------------------------
1 file changed, 57 insertions(+), 61 deletions(-)
diff --git a/content/folders.js b/content/folders.js
index 66292c5..721b3b6 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -140,67 +140,65 @@ function NostalgyAutocomplete(box) {
}
NostalgyAutocomplete.prototype.onStartLookup =
-function(text, results, listener) {
- var items = this.xresults.items;
- 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);
- nb++;
- };
-
- var f = function (folder) { add_folder(NostalgyFolderName(folder)); };
-
- if (text == "") {
- var added_count=0;
- 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 )
- {
- f(predictedFolders[j]);
- added_count++;
- }
- }
- for ( j = 0; j < nostalgy_recent_folders.length; j++)
- {
- var found=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 )
- {
- add_folder(nostalgy_recent_folders[j]);
- added_count++;
- }
+ function(text, results, listener) {
+ var items = this.xresults.items;
+ 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);
+ 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 )
+ {
+ 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) {
+ f(predictedFolders[j]);
+ added_count++;
+ }
+ }
+ 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)
+ 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 ) {
+ add_folder(nostalgy_recent_folders[j]);
+ added_count++;
}
- } else {
- nostalgy_search_folder_options.do_tags =
- nostalgy_completion_options.always_include_tags ||
- (text.substr(0,1) == ":");
- NostalgyIterateMatches(text, this.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);
- }
- }
+ }
+ } else {
+ nostalgy_search_folder_options.do_tags =
+ nostalgy_completion_options.always_include_tags ||
+ (text.substr(0,1) == ":");
+ NostalgyIterateMatches(text, this.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);
+ }
+ }
- this.xresults.searchString = text;
- this.xresults.defaultItemIndex = 0;
- listener.onAutoComplete(this.xresults, 1);
-}
+ this.xresults.searchString = text;
+ this.xresults.defaultItemIndex = 0;
+ listener.onAutoComplete(this.xresults, 1);
+ };
NostalgyAutocomplete.prototype.onStopLookup =
function() { };
@@ -221,10 +219,8 @@ function NostalgyStartLookup() {
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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list