nodecg-for-smash icon indicating copy to clipboard operation
nodecg-for-smash copied to clipboard

Adds player data autocomplete

Open claabs opened this issue 9 years ago • 7 comments

To resolve issue #7, Save and autocomplete player info.

Saves data locally in an array of objects using Replicants. Currently only works with a button press to auto-fill the fields. Could not get event listeners to work at all. The intended functionality was to check for matches and auto-complete the fields as each character of the tag was typed.

claabs avatar Jul 05 '16 02:07 claabs

It seems that the player tag dropdown only appears after you update once. i.e. if you refresh the dashboard, your saved tags will not show up until you update once. It would be nice if it showed right away.

Also, it seems quite easy to accidentally wipe a player's saved data by clicking update instead of complete fields. In fact, I did it several times while testing. While it's not that big of a deal to retype the info, it might be a source of annoyance, especially in a live setting. Maybe putting the complete fields button on the same row as swap players would reduce the likelihood of misclicking?

mparkms avatar Jul 06 '16 02:07 mparkms

I think if I could figure out how to get event listeners to work, it would resolve both these problems. An event listener for page load could refresh the dropdown and an event listener for input change could replace the function of the complete fields button. That was my intended functionality but I spent too long trying to get event listeners to work with no avail. Not sure if I should put them in players.js, or in a players.html.

claabs avatar Jul 06 '16 02:07 claabs

Have you tried using Polymer? I have a WebComponentsReady event listener for each of the Polymer modules in players.html, which is (for this purpose anyway) effectively a page load listener. You could also try adding a input listener, though I'm not confident that will work.

mparkms avatar Jul 06 '16 04:07 mparkms

The nodecg-replicant and nodecg-replicant-input Polymer elements might also be useful for what you want to do.

mparkms avatar Jul 06 '16 17:07 mparkms

I'll merge this if you aren't planning to work on this for now; we can add autocompletion later.

mparkms avatar Jul 14 '16 05:07 mparkms

I've been working on some other stuff for my own fork recently. Running into even more stuff where I need text-input update event listeners and I still can't get them to work.

This weekend I can probably fix those minor things you mentioned earlier before we merge. If I can ever get the listeners to work I'll be sure to update this PR.

claabs avatar Jul 14 '16 14:07 claabs

OK, let me know when you're ready to merge.

mparkms avatar Jul 14 '16 17:07 mparkms