This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cleanup some old files * version 1.0.20 * set right github address and id * v1.0.22 * v1.0.22b * v1.0.24 according to #74 * 1.0.25 various changes from #74 * v1.0.26 remove chrome.manifest * Revert "v1.0.26 remove chrome.manifest" This reverts commit bc417b0992e0679dcc27142cb3bc21a408889736.
- Loading branch information
Showing
35 changed files
with
1,310 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
const Cc = Components.classes; | ||
const Ci = Components.interfaces; | ||
const Cu = Components.utils; | ||
var ChromeUtils = require("ChromeUtils.jsm"); | ||
var {XPCOMUtils} = ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm'); | ||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||
|
||
|
||
const CLASS_ID = Components.ID('0368fb30-62f8-11e3-949a-0800200c9a66'); | ||
const CLASS_NAME = "Nostalgy Folder Autocomplete"; | ||
const CONTRACT_ID = '@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete'; | ||
|
||
|
||
// nsIAutoCompleteResult implementation | ||
|
||
function NostalgyDebug(aText) | ||
{ | ||
var csClass = Components.classes['@mozilla.org/consoleservice;1']; | ||
var cs = csClass.getService(Components.interfaces.nsIConsoleService); | ||
cs.logStringMessage(aText); | ||
} | ||
|
||
function NostalgyAutoCompleteResult(searchString, results) { | ||
const ACR = Ci.nsIAutoCompleteResult; | ||
this._searchResult = results.length > 0 ? ACR.RESULT_SUCCESS : ACR.NOMATCH; | ||
this._searchString = searchString; | ||
this._results = results; | ||
} | ||
|
||
NostalgyAutoCompleteResult.prototype = { | ||
_searchString: "", | ||
_searchResult: 0, | ||
_results: [], | ||
|
||
get searchString() { return this._searchString; }, | ||
get searchResult() { return this._searchResult; }, | ||
get defaultIndex() { return 0; }, | ||
get errorDescription() { return ""; }, | ||
get matchCount() { return this._results.length; }, | ||
getValueAt: function(index) { return this._results[index]; }, | ||
getCommentAt: function(index) { return ""; }, | ||
getStyleAt: function(index) { return null; }, | ||
getImageAt : function (index) { return ""; }, | ||
removeValueAt: function(index, removeFromDb) { this._results.splice(index, 1); }, | ||
getLabelAt: function(index) { return this._results[index]; }, | ||
QueryInterface: ChromeUtils.generateQI([ Ci.nsIAutoCompleteResult ]), | ||
}; | ||
|
||
|
||
// nsIAutoCompleteSearch implementation | ||
|
||
function NostalgyAutoCompleteSearch() { | ||
this.wrappedJSObject = this; | ||
} | ||
|
||
NostalgyAutoCompleteSearch.prototype = { | ||
classID: CLASS_ID, | ||
classDescription : CLASS_NAME, | ||
contractID : CONTRACT_ID, | ||
_f: {}, | ||
_id: 0, | ||
|
||
attachGetValuesFunction: function(f) { this._id++; this._f[this._id] = f; return this._id; }, | ||
|
||
startSearch: function(searchString, searchParam, previousResult, listener) { | ||
var searchResults = this._f[searchParam](searchString); | ||
var result = new NostalgyAutoCompleteResult(searchString, searchResults); | ||
listener.onSearchResult(this, result); | ||
}, | ||
|
||
stopSearch: function() {}, | ||
|
||
QueryInterface: ChromeUtils.generateQI([ Ci.nsIAutoCompleteSearch ]) , | ||
}; | ||
|
||
|
||
// XPCOM component creation | ||
|
||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ NostalgyAutoCompleteSearch ]); |
Oops, something went wrong.