Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chromeIPass search for partial match #696

Open
pmolensky opened this issue Jan 10, 2019 · 1 comment
Open

chromeIPass search for partial match #696

pmolensky opened this issue Jan 10, 2019 · 1 comment

Comments

@pmolensky
Copy link

pmolensky commented Jan 10, 2019

I'm missing an option where the search would return all results where part of the username/title matches the typed characters (*searchstring*). And not only results, starting at position 1 (searchstring*)

I was looking at the code and I found the jQuery.autocomplete (v1.11) widget is used. By default this widget should return any matching entry:
https://api.jqueryui.com/1.10/autocomplete/
source: https://api.jqueryui.com/1.10/autocomplete/

But I can't seem to find where the cIPJQ and jQuery differ and create a PR.
I tried to compare the unminified sources from cIPJQ and jQuery, but due to all the minified function- and variablenames, it's hard to compare.
Or am I looking at the wrong files?

Any suggestions?

@pmolensky
Copy link
Author

UPDATE
I found it was not related to jQueryUI. But the function cipAutocomplete.onSource did a search on index equal to zero. Changing the check to greater or equal to zero allows for wildcard searches.

cipAutocomplete.onSource = function (request, callback) {
	var matches = cIPJQ.map( cipAutocomplete.elements, function(tag) {
		if ( tag.label.toUpperCase().indexOf(request.term.toUpperCase()) >= 0 ) {
			return tag;
		}
	});
	callback(matches);
}

Is there a deliberate reason for making the index=0-check? Otherwise I'll make this into a PR. I'll try and make this change conditional and create a setting in the options page to allow for both strict/username only searches or any part of the KeePass entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant