check url path only from start

This commit is contained in:
antelle 2016-08-02 23:34:00 +03:00
parent 7d3d47d812
commit 548ed11997
1 changed files with 10 additions and 2 deletions

View File

@ -52,10 +52,18 @@ AutoTypeFilter.prototype.getEntryRank = function(entry) {
if (entryUrlParts[2] === this.urlParts[2]) {
rank += 10;
// path
rank += this.getStringRank(entryUrlParts[3], this.urlParts[3]);
if (entryUrlParts[3] === this.urlParts[3]) {
rank += 10;
} else if (entryUrlParts[3] && this.urlParts[3]) {
if (entryUrlParts[3].lastIndexOf(this.urlParts[3], 0) === 0) {
rank += 5;
} else if (this.urlParts.lastIndexOf(entryUrlParts[3], 0) === 0) {
rank += 3;
}
}
// scheme
if (entryUrlParts[1] === this.urlParts[1]) {
rank += 5;
rank += 1;
}
} else {
if (entry.searchText.indexOf(this.urlLower) >= 0) {