Page MenuHome

Manual: Version Switch
AbandonedPublic

Authored by Tobias Heinke (TobiasH) on Mar 3 2017, 3:43 PM.

Details

Summary

A template that adds a placeholder,
a JS script that replaces it and switches the url.

Diff Detail

Repository
rBM Blender Manual

Event Timeline

Tobias Heinke (TobiasH) retitled this revision from to Manual: Versioning.
Tobias Heinke (TobiasH) updated this object.
Tobias Heinke (TobiasH) set the repository for this revision to rBM Blender Manual.

Currently:
This adds a mock-up in both possible position: under the search and the bottom (separate template files).

The output of the script is not visible (outside of screen).

There are to ways to implement the drop-down:

  • List of links - thus leave page directly (line 30) (rtd).
  • <select> menu emulation: select an option and the script will navigate to that page (pydoc)

The second option allows to check if the target page is not a 404 (line 54) and else nav. to home.

This functionality could be added to 404 pages instead to make a script check if
A index in the folder or in the folder above exits
and then offer the user links to go to those pages.

The current problem is the theme does not output the language: workaround would be to extract it from the url.

Small quick notes,

  1. These should not be active on hovering; should require you to click on the menu.
  2. I think the menu at the bottom of the screen is better.
Tobias Heinke (TobiasH) edited edge metadata.

Script out put is visible now. only the upper ones have event-handlers.

I agree the upper screen space is too precious, still keeping it just case.

Tobias Heinke (TobiasH) removed rBM Blender Manual as the repository for this revision.

+replace url, generate language list

resources/theme/js/version_switch.js
13–20

We should spell these out.

Hi,

I've been checking out the patch, and this is how it looks for me.

Can you confirm this is the current status?

Tobias Heinke (TobiasH) retitled this revision from Manual: Versioning to Manual: Version Switch.
Tobias Heinke (TobiasH) edited edge metadata.
Tobias Heinke (TobiasH) set the repository for this revision to rBM Blender Manual.
Tobias Heinke (TobiasH) marked an inline comment as done.

Only bottom one, spell out languages names, add slide animation.

currently only the click on the click on the panel title switches the class as intended.

@Francesco Siddi (fsiddi) then I must had make a mistake copying the files (I use a smaller repo. for testing) sorry

Now it look like this:

The "anchor" is a *tricky design challenge: the statusbar common between all browsers overlaps the buttons.
Hope you have an idea how to solve this better.

~no visual change,
create list on click event,
unify functions (lang & version)
proper event handling

state: 70%

The links do not work. I am getting links like https://docs.blender.org/manual/en/dev/2.78/it/index.html I guess because we do not have the version numbers on the server yet?

What I think is a glitch is that if I click on the menu and do not mouse over it but it does not go away when moving the mouse out of the menu area.
Also, it is a little strange when clicking on the menu that the text on the icon disappears. I am also not sure I am a big fan of the animation as it is not really used anywhere else in the theme/b.org

I am not really a fan of the green either. Maybe we should make it the same has the text in the sidebar.

fix lang/version order, current tagging, speed up animation.

@: no button leave event: no glitch I didn't add it for debugging.
the green is from rtd. There has to be a contrast to the background.

It clearly shows why there's a problem with current tagging:
two 2.78

add script via conf.py (not template)
clean up css, animate button
not use <a> on current

Some tests of alternative versions:

I like the triangle version.

resources/theme/js/version_switch.js
6

Should we have a latest version here?

use added theme lang. output var

no titel: toggle button between current and title.

Francesco Siddi (fsiddi) requested changes to this revision.Mar 24 2017, 3:36 PM

It's great to see you are enthusiastically developing here, but I would recommend you take a step back and consider using the same framework that is sphinx_rtd_theme is based on. Wyrm provides a solution for dropdowns using the framework http://wyrmsass.org/section-8.html.

More in general, it would be good to:

  • see graphic mockups before starting such a task
  • consider using at least sass if you plan to extend the template
This revision now requires changes to proceed.Mar 24 2017, 3:36 PM

I would be against using Wyrm, it would be a more complicated approach and does not give any different/better results.

Also note that the read the docs theme might decouple itself from Wyrm in the future.

Tobias Heinke (TobiasH) edited edge metadata.

add accessibility (ARIA) and keyboard nav (tab, shift-tab)
rtd doesn't offers that.

for debug: tab index is at page start, then it will be at the end of the page.
mixing mouse and keyboard input doesn't work yet (if it is easy fixable).

If you have plans to develop a new theme, it would be great to see them outlined before you start working on them. Could you explain in which way is Wyrm more complicated than what you are doing now?

Ah... at first I thought that the read the docs theme did not pull in the Wyrm css for .dropdown however after looking at the code I stand corrected.
As for moving to sass/scss I would still be against this as it adds another layer of complexity to the manual. I would rather avoid this especially if we are only doing small edits to the theme.

Anyway... @Tobias Heinke (TobiasH) if you think that using Wyrm is a better/easier solution then go for it, however, it sounds like what we have here is more advanced then the Wyrm implementations.

harmonize and unite mouse and key & JS clean up. (90%)

@The main reason is to avoid dependencies: changes that potentially break something.
With a full custom only depends on: a bit JS and JQuery.

Rtd would add: html and CSS.

And the rtd horizontal list are not good-looking.
I will write the rtd "injection" version as a fallback.

I see no benefit of a CSS pre-processing: no repeating structures and more important plain CSS is not a extra language you have to know for edit it.

Tobias Heinke (TobiasH) updated this revision to Diff 8515.EditedMar 29 2017, 4:52 PM

use event bubbling, separate version/lang. list, add json query to fetch it from (latest or dev)
The json file is copied by extra path into the build folder. (95%)

Should be only the versions and not the languages in the json, right?

use icon font instead of unicode, json file only versions, init with async,
language code to name on load (not for versions, because of the query).
(100% basic feature complete)

Plan:

  1. Invisible test (display: none) for test of the query
  2. Beta test: Deactivate versions = language switch only
  3. Full: activate versions, when there are builds

fix bug: on click close and reopen: by using mousedown and preventdefault (to not call focusout).
use prototype: more common implementation, easier to store variables, this pointer instead of parameter.

A note on progress: This has for the most part been committed (versions being the exception). @Francesco Siddi (fsiddi) if you would like to give an in-depth review that would be appreciated.
A side note that there is also a version of this patch that makes the versioning/ language switcher match more of the read the docs style. Pros: Slightly nicer looking (more of a personal preference),
Cons: takes up more space in the sidebar. @Tobias Heinke (TobiasH) can provide this if needed. So moving forward, we need to decide on the final design and review the JS. After this is done we can work on adding version support.
I am working on getting the older docs ready currently, doing the older versions (2.75-2.78) will be hard but for future release, we can make a script. The biggest difficulty here is I am trying to narrow down the size.
Currently, it is just under 3gb, this includes a lot of duplicated images that I can set up as sym links and we can probably get the number down to 2gb.

Francesco Siddi (fsiddi) requested changes to this revision.Apr 12 2017, 7:01 PM

Did you test the language menu on Chrome? There is an issue that prevent selecting items from it. We can address further changes afterwards.

This revision now requires changes to proceed.Apr 12 2017, 7:01 PM

CSS bug a gap between the list triggering a mouse-leave event.
hopefully fixed with rBM3501