Skip to content

Cleanup doc embed js #1507

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

Merged
merged 7 commits into from
Jul 31, 2015
Merged

Cleanup doc embed js #1507

merged 7 commits into from
Jul 31, 2015

Conversation

ericholscher
Copy link
Member

This is a re-PR of #1499 which was merged, then reverted.

Original PR text:

This integrates the data provided by /api/v1/version//highest/ into the /api/v2/footer_html/ response. We can use this to avoid one API request per doc page view. The API v1 version endpoint is still in place for backwards compatibility.

I also refactored the doc-embed JavaScript into multiple files for easier maintainability.

Fixes #1463.

function injectFooter(data) {
// If the theme looks like ours, update the existing badge
// otherwise throw a a full one into the page.
if (build.is_rtd_theme()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build doesn't exist here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh :( that's addressed now.

@ericholscher ericholscher added the PR: work in progress Pull request is not ready for full review label Jul 30, 2015
…js""

This reverts commit 13a8162.

Conflicts:
	readthedocs/core/static-src/core/js/readthedocs-doc-embed.js
	readthedocs/core/static/core/js/readthedocs-doc-embed.js
@ericholscher ericholscher force-pushed the cleanup-doc-embed-js branch from ca43574 to a675748 Compare July 30, 2015 22:56
ericholscher and others added 5 commits July 30, 2015 15:58
There is no other place were the build instance was used and that is nicer than
passing the object down the call chain.

Based on feedback:
#1507 (comment)
@d0ugal
Copy link
Contributor

d0ugal commented Jul 31, 2015

👍

@ericholscher
Copy link
Member Author

Great. Tested this locally, and it appears to be working much better now :)

ericholscher added a commit that referenced this pull request Jul 31, 2015
@ericholscher ericholscher merged commit f7a0538 into master Jul 31, 2015
@gregmuellegger gregmuellegger deleted the cleanup-doc-embed-js branch August 3, 2015 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants