Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace jQuery with vanilla JavaScript#160

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JulienPalard merged 6 commits intopython:mainfromhugovk:rm-jquery
Jul 14, 2023

Conversation

hugovk
Copy link
Member

Possiblyfixes#159.

Is there a good way to test this?

@JulienPalard
Copy link
Member

Is there a good way to test this?

Yes, run the command in the README like:

python3 ./build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group $(id -g) --skip-cache-invalidation

you can limit it to one language and one version for a faster build by adding--language en --branch main.

hugovk reacted with thumbs up emoji

@egeakman
Copy link
Contributor

Ah, I almost opened a pull request for this, you were quicker :D

hugovk reacted with rocket emoji

@hugovk
Copy link
MemberAuthor

I ran:

python3 ./build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group $(id -g) --skip-cache-invalidation --language en --branch origin/main

I didn't get any console errors, but also didn't see the switchers:

image

I then did two languages and two versions:

python3 ./build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group $(id -g) --skip-cache-invalidation --language en fr --branch 3.13 --branch 3.12

And served the pages viapython -m http.server -d www, but again saw no switchers for any of the four.

@egeakman
Copy link
Contributor

egeakman commentedJul 13, 2023
edited
Loading

In my version, I can't see the switchers until I resize the page enough to see the mobile view. It works as intended and no JS errors. Is this the case you're facing too@hugovk?

image

@hugovk
Copy link
MemberAuthor

Ah right, thanks, and I had old results in thewww directory so this time I deleted it first.

rm -rf wwwpython3 ./build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group$(id -g) --skip-cache-invalidation --language en fr --branch 3.13python3 -m http.server -d www

Here'smain on the left, with console errors and no switchers; and this PR on the right with no errors and switchers:

image

@egeakman
Copy link
Contributor

egeakman commentedJul 13, 2023
edited
Loading

<select> is missing in the switcher div, switchers.js is not populating it for some reason:

image

How it should be:

image

@hugovkhugovk marked this pull request as draftJuly 14, 2023 06:13
@hugovkhugovk marked this pull request as ready for reviewJuly 14, 2023 06:50
@hugovk
Copy link
MemberAuthor

hugovk commentedJul 14, 2023
edited
Loading

Okay, looks like it's working now at the top:

image

And in the mobile sidebar:

image

There was a problem that$('.version_switcher_placeholder') returned all placeholders, butdocument.querySelector('.version_switcher_placeholder'); returned only the first. So we need to usequerySelectorAll and loop.

There was also a possible issue with adding too many quotes near thequote_attr calls.

egeakman reacted with thumbs up emoji

@JulienPalard
Copy link
Member

I'm very happy to see this land, thanks for the work!

hugovk and egeakman reacted with rocket emoji

@JulienPalardJulienPalard merged commit952c9ee intopython:mainJul 14, 2023
@hugovkhugovk deleted the rm-jquery branchJuly 14, 2023 13:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JulienPalardJulienPalardJulienPalard approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

switchers.js not compatible with Sphinx 6 / requires jQuery
3 participants
@hugovk@JulienPalard@egeakman

[8]ページ先頭

©2009-2025 Movatter.jp