alpheios-project / alpheios_nemo_ui

Alpheios Reader
https://texts.alpheios.net
GNU General Public License v3.0
3 stars 0 forks source link

default to numeric keyboard for input of find passage? #278

Closed balmas closed 5 years ago

balmas commented 5 years ago

I don't know if this is possible, but @abrasax would like for mobile devices to default to the numeric keyboard when you try to input into the Find Passage input box.

@irina060981 can you investigate if/how this could be done? Thanks!

abrasax commented 5 years ago

It doesn't seem necessary for chrome on android since both numerals and letters appear by default- but on safari on the iphone it appears to be a problem.

On Fri, Aug 23, 2019 at 3:45 PM Bridget Almas notifications@github.com wrote:

I don't know if this is possible, but @abrasax https://github.com/abrasax would like for mobile devices to default to the numeric keyboard when you try to input into the Find Passage input box.

@irina060981 https://github.com/irina060981 can you investigate if/how this could be done? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alpheios-project/alpheios_nemo_ui/issues/278?email_source=notifications&email_token=ABK7KE77QXVMMFL46AC3Q3LQGA44JA5CNFSM4IPCYJ3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HHDWE5Q, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK7KE5SX3Y57F4HYUSQ54DQGA44JANCNFSM4IPCYJ3A .

irina060981 commented 5 years ago

I don't think that it is possible, because according to this https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

Iphone has only the following type of keyboard image

As you could see that there exists the numeric keyboard (and it is really easy to get it - if added type="tel" to the input), but it doesn't have point, letters and spaces. And other types gives text keyboard first.

I have tested it on my Iphone and didn't find the other way to show numeric first and also save an ability to switch to text.

balmas commented 5 years ago

@irina060981 thanks for this. I wonder what we would happen if we used the pattern attribute to suggest the pattern for the input? In the apple developer page you referenced, it shows the following for suggesting zipcode input:

<input type="text" pattern="[0-9]*"></input>

What happens if we do:

<input type="text" pattern="[0-9\.]*"></input>

irina060981 commented 5 years ago

I tried it - and then it shows a text keyboard first Because I think, there is no such keyboard - first numeric and then it could be switch to text. And only when we want to limit the keyboard it could show only numeric for telephones. And that's all.

balmas commented 5 years ago

ok. After discussion with @abrasax we'd like to try instead putting the current passage in as the placeholder text for the input. @irina060981 can you do that? Thank you!

irina060981 commented 5 years ago

we'd like to try instead putting the current passage in as the placeholder text for the input

@balmas , I didn't quitely understand what do you mean here. Could you show me some example?

balmas commented 5 years ago

Currently we have

  <input class="form-control" type="text" id="find_subreference" placeholder="Find passage ..." size="10"
          name="subreference" data-route="{{url_for('.r_passage_json',objectId=objectId,subreference='REPLACE_REF')}}">

I think instead it might be

  <input class="form-control" type="text" id="find_subreference" placeholder="{{subreference}}" size="10"
          name="subreference" data-route="{{url_for('.r_passage_json',objectId=objectId,subreference='REPLACE_REF')}}">

Using the current subreference as the value of the placeholder attribute in the input form

irina060981 commented 5 years ago

The I suggest to style it this way

image

This way it would be better separated from the real value

What do you think?

irina060981 commented 5 years ago

And finally

It would be this way

image

image

image

image

irina060981 commented 5 years ago

Merged and closed

monzug commented 5 years ago

having some issues with Find passage in Epistulae - Horace (also Ex Ponto, Ovid and Carmina, Horace). there are 2 books in TOC. the passages go from 1 to 105 and then passage start again from 5 to 70 then again from 5 to 35 and so on. if I enter 1.10 it takes to the beginning of the book so I am missing all the other passages with line 10 in book 1 and there are several line 10. then if I enter in Go to: e.g. 2.10 (book 2, passage 10), it gives PASSAGE NOT FOUND: 2.10 is not a valid passage reference in this text. Browse the Table of Contents for valid references. when I scroll down the text in book 2 I can see that the passages # do not increase, there is only passage 2. see also issue https://github.com/alpheios-project/alpheios_nemo_ui/issues/285

balmas commented 5 years ago

hmm. I think this is a problem with the TOC for Horace rather than the Find Passage display. At least Epitsulae is a 3 level citation scheme - Book, Poem, Line but the Poem level is missing from the TOC. Will keep investigating to fully understand what is happening.

balmas commented 5 years ago

Yes, i think this was because we were grouping Horace on the poem level and not the line, so it made the poem level of the citation scheme seem invisible. I will fix this by grouping by line.

balmas commented 5 years ago

since this is unrelated to the styling of the find passage box, I've moved the problem with the ranges and Horace et. al. to a new issue, #288. I think though, to avoid unnecessary confusion, it would still be better to just single citation reference in the placeholder, so I'm going to make that change too.

balmas commented 5 years ago

find passage placeholder now just contains the first passage of the current range.

monzug commented 5 years ago

I can see the first passage of the current range on the go to field. However the passage does not get updated when scrolling the text. I think this is ok, @balmas?

balmas commented 5 years ago

yes, that's okay. Thanks!