Post Reply 
Can you specify filter options in the literature.hpcalc.org URL?
11-05-2023, 06:02 AM
Post: #1
Can you specify filter options in the literature.hpcalc.org URL?
Is it possible to specify any of the filter options available at the top of the literature.hpcalc.org/ site in a URL?
For example if I wanted to post a link to https://literature.hpcalc.org/ that just showed the English language documents for a HP-42S.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-05-2023, 06:42 AM (This post was last modified: 11-05-2023 02:55 PM by lvt.)
Post: #2
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-05-2023 06:02 AM)Steve Simpkin Wrote:  Is it possible to specify any of the filter options available at the top of the literature.hpcalc.org/ site in a URL?
For example if I wanted to post a link to https://literature.hpcalc.org/ that just showed the English language documents for a HP-42S.

That method only works with a page that is dynamically generated.

This page, however is sort of static web page, the whole content is already available, when you select a filter, a Javascript function will hide all the rows that don't match the selected value.

If you want to make it work by typing an URL, there must be a Javascript function that capture the URL then converts it to variables to use with the hideRows() function. After that you can use URL with custom filters, for example : https://literature.hpcalc.org/?filterLan...&model=42S

HP-12C Gold / HP-12C Platinum
Find all posts by this user
Quote this message in a reply
11-05-2023, 04:03 PM
Post: #3
RE: Can you specify filter options in the literature.hpcalc.org URL?
That's something that's been in the To Do list for a long time but I hadn't gotten around to it. Now that I'm caught up on scanning books I probably should take a look at adding it. I think I will have to add the parameters after # rather than ?, based on what I've seen elsewhere, but I haven't yet looked into it.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-05-2023, 04:38 PM
Post: #4
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-05-2023 04:03 PM)Eric Rechlin Wrote:  That's something that's been in the To Do list for a long time but I hadn't gotten around to it. Now that I'm caught up on scanning books I probably should take a look at adding it. I think I will have to add the parameters after # rather than ?, based on what I've seen elsewhere, but I haven't yet looked into it.

The "#" is usually used to jump to a specific section of the webpage. Some Ajax enabled pages use the "#" as well but in case you want to parse a query with multiple parameters from an URL using GET method, it should start with the "?" and the parameters are separated with "&".

HP-12C Gold / HP-12C Platinum
Find all posts by this user
Quote this message in a reply
11-05-2023, 06:53 PM
Post: #5
RE: Can you specify filter options in the literature.hpcalc.org URL?
I don't want to parse the parameters from the URL in the GET method. I want to do it all on the client-side in JavaScript, without any excess page-reloading. So I used the hash (#). I chose to separate values from parameter names with a colon and separate individual parameter/value pairs with a slash.

I believe I have now implemented something that works. If any big problems appear in the behavior I may change the implementation (and therefore the URLs), but hopefully as it is now should work. I tested mostly in Firefox and did some quick checks in Chrome.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-05-2023, 07:49 PM
Post: #6
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-05-2023 06:53 PM)Eric Rechlin Wrote:  I don't want to parse the parameters from the URL in the GET method. I want to do it all on the client-side in JavaScript, without any excess page-reloading. So I used the hash (#). I chose to separate values from parameter names with a colon and separate individual parameter/value pairs with a slash.

I believe I have now implemented something that works. If any big problems appear in the behavior I may change the implementation (and therefore the URLs), but hopefully as it is now should work. I tested mostly in Firefox and did some quick checks in Chrome.

That should work too, however the GET method is more "web standard" and easy to use for the users, specially when they want to create custom query string.

BTW, thank you for the super useful collection of manuals.

HP-12C Gold / HP-12C Platinum
Find all posts by this user
Quote this message in a reply
11-05-2023, 07:52 PM
Post: #7
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-05-2023 06:53 PM)Eric Rechlin Wrote:  I don't want to parse the parameters from the URL in the GET method. I want to do it all on the client-side in JavaScript, without any excess page-reloading. So I used the hash (#). I chose to separate values from parameter names with a colon and separate individual parameter/value pairs with a slash.

I believe I have now implemented something that works. If any big problems appear in the behavior I may change the implementation (and therefore the URLs), but hopefully as it is now should work. I tested mostly in Firefox and did some quick checks in Chrome.

Eric,
That is awesome! Now I can just set the filters as needed and copy the updated URL.
Thank you very much for implementing this!

https://literature.hpcalc.org/#lang:English/model:42S
https://literature.hpcalc.org/#lang:Engl...tt-Packard
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2023, 04:11 AM
Post: #8
RE: Can you specify filter options in the literature.hpcalc.org URL?
Can you please check the filter by keyword feature, it seems to have stopped working?

HP-12C Gold / HP-12C Platinum
Find all posts by this user
Quote this message in a reply
11-06-2023, 04:14 AM
Post: #9
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-06-2023 04:11 AM)lvt Wrote:  Can you please check the filter by keyword feature, it seems to have stopped working?

I just tried a number of different cases and they seem to be working for me.

https://literature.hpcalc.org/#lang:English/model:10C

https://literature.hpcalc.org/#lang:English/model:11C

https://literature.hpcalc.org/#lang:English/model:15C
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2023, 04:14 AM
Post: #10
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-06-2023 04:11 AM)lvt Wrote:  Can you please check the filter by keyword feature, it seems to have stopped working?

Fixed. Thanks.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-06-2023, 05:05 AM
Post: #11
RE: Can you specify filter options in the literature.hpcalc.org URL?
(11-06-2023 04:14 AM)Steve Simpkin Wrote:  
(11-06-2023 04:11 AM)lvt Wrote:  Can you please check the filter by keyword feature, it seems to have stopped working?

I just tried a number of different cases and they seem to be working for me.

https://literature.hpcalc.org/#lang:English/model:10C

https://literature.hpcalc.org/#lang:English/model:11C

https://literature.hpcalc.org/#lang:English/model:15C

I mean the search box, not the URL query (which is fine).

HP-12C Gold / HP-12C Platinum
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)