slugbucket / crossword-hints

Python Flask web application to aid decipherment of cryptic crossword clues for known setters
GNU General Public License v3.0
1 stars 0 forks source link

When adding a new solution, highlight the clue text for easy overwriting #15

Closed slugbucket closed 5 years ago

slugbucket commented 5 years ago

When adding a new solution the first thing that needs to be done is to select the clue field and highlight the default text for overwriting. It would be easier if the text was already selected to avoid the initial navigation task.

slugbucket commented 5 years ago

Perhaps https://stackoverflow.com/questions/45795912/auto-select-text-in-html-input

slugbucket commented 5 years ago

It would also make sense to have the clue form field selected when pressing the tab key. Including the following in the form template would seem to do the trick

onfocus="this.select()", tabindex="1"
slugbucket commented 5 years ago

Tracking as feat0012

$ git flow feature start feat0012
$ git add templates/views/crossword-solutions/_form.html
$ git commit -m "feat0012 added HTML options to solutions form to autoselect the clue when focus is on the input element and also set the tabindex to 1 to allow quick select of the inout box"
$ git commit -m "feat0012 temporary removal of file tracking tracking of files to allow feature commit to complete"
$ git flow feature finish feat0012
$ git push

Had to take backups of the database file that had been modified during testing so that it could be restored after git had completed its dirty work.

slugbucket commented 5 years ago

I turns out that all the solution form items need a tabindex rather than just the first; the page will follow the first item with what it would have done otherwise.

$ git flow feature start feat0012
$ git add crossword_hints.db templates/macros.html templates/views/crossword-solutions/_form.html xword-hints.sql
$ git commit -m "feat0012 added tab indexes to all the solution fields; select macro for templates need to parse kwargs sp that class and onfocus items are shown; more base cue words; more clues and solutions added"
$ git flow feature finish feat0012
$ git push

The form navigation is a more consistent with the tab ordering in place.