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

Url config & rewriting for museum display #47

Open
hyanwong opened this issue Jan 22, 2018 · 4 comments
Open

Url config & rewriting for museum display #47

hyanwong opened this issue Jan 22, 2018 · 4 comments

Comments

@hyanwong
Copy link
Member

We need to add the option of passing some extra parameters through the URL, in particular:

Image source
Tree type
Colour scheme
(possibly - list of popular places)

These also need to be added to the URL recording scheme we have, e.g. at

function get_params(options) {

@jrosindell
Copy link
Member

jrosindell commented Jan 22, 2018

For the museum display, this should also store the the components of the original URL that we may need to reset to after screensaver. Initially this will just be default tree position. It might be easier to just save the entire URL (and even maybe reload the page)

@hyanwong hyanwong self-assigned this Jan 22, 2018
@hyanwong
Copy link
Member Author

hyanwong commented Feb 17, 2018

I have coded up the possibility of passing colour changes in to the web page, so a museum can modify minlife.html to add e.g. var tree_config={projection:'polytomy','colours.branch.stroke':'rgb(100,0,100}' which will allow them to set their own tree type and colour schemes without passing them via the URL. But this would be a nice feature to have, regardless.

@hyanwong
Copy link
Member Author

Actually, since the code I have written passes stuff via OZentry.default() which is a javascript routine, then we should be able to pass a JSON string in the URL which can be passed on to the JS function.

@hyanwong
Copy link
Member Author

hyanwong commented Feb 21, 2018

Much of the groundwork for this is now there. I think the only 3 things to do are

  1. parse values like d_vis=AT&d_cols=tree&d_cols.branch.stroke=rgb(0,0,0) from the URL into JSON like {'vis':'AT', 'cols':'tree','cols.branch.stroke':'rgb(0,0,0)'}, which we can then pass in to the constructor, overriding any previously set in the tree_config variable.
  2. save these initial bits of the URL into config.default_setting in global_config.js
  3. test, test, test!

NB 1. could be done either in web2py or by parsing the URL string in ECMAscript. We already have to do the latter to get e.g. locations working, so perhaps we should also parse setting there. The problem is we would want to override the set_defaults options specified when setting up the OZentry.default() call, but I guess this is OK: we can just call set_defaults(new_params) again.

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

No branches or pull requests

2 participants