2016-07-25 20:27:22 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
let AutoTypeFilter = function(windowInfo, appModel) {
|
|
|
|
this.title = windowInfo.title;
|
|
|
|
this.url = windowInfo.url;
|
|
|
|
this.text = '';
|
|
|
|
this.ignoreWindowInfo = false;
|
|
|
|
this.appModel = appModel;
|
|
|
|
};
|
|
|
|
|
|
|
|
AutoTypeFilter.prototype.getEntries = function() {
|
2016-07-31 20:38:08 +02:00
|
|
|
let filter = {
|
|
|
|
text: this.text
|
|
|
|
};
|
|
|
|
if (!this.ignoreWindowInfo) {
|
|
|
|
filter.title = this.title; // TODO
|
|
|
|
filter.url = this.url; // TODO
|
|
|
|
}
|
|
|
|
return this.appModel.getEntriesByFilter(filter); // TODO: sort entries
|
2016-07-25 20:27:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = AutoTypeFilter;
|