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

Feature/html resources #81

Merged

Conversation

chrisgarrity
Copy link
Contributor

@chrisgarrity chrisgarrity commented Aug 31, 2017

Converted curricula and assessment resources from PDFs to HTML so they can be translated.

One of the main items was the ScrollManager component. react-router v4 does not scroll the page when loading new components, and basically they decided to punt because browsers are starting to do the right thing: remix-run/react-router#3950
Unfortunately not all browsers are doing the right thing now, so I found examples from other people. It needed a little bit of modification because scratchjr views use a 'basename' and that wasn't handled.

All of this was only needed because the new HTML resources tend to be quite long, and to have #hash locations.

Testing:

  • Links on teach/curricula page go to HTML pages not PDF files
  • When printed the curricula pages only show the content (none of the site navigation), and include page breaks so that lessons start on a new page.
  • Assessment/solveit/answersheet is not PDF, and prints without the site navigation

@chrisgarrity
Copy link
Contributor Author

For the purposes of review, you can ignore all the images and .html files. The HTML/img files are replacing the previous PDFs - they were provided by Tufts, so the content should be fine. That reduces the number of files to review to about 25!

@chrisgarrity
Copy link
Contributor Author

ping @rschamp @mewtaylor it would be good to have a review on this and the other scratchjr PRs this week so I have time to make changes before the freeze if needed. thx

curricular/full.css contains styles for printing any curriculum.

moved added print-footer to teach to share between all curricula.

May be able to share print css between curricula and assessment pages, but not counting on it.
Change curricula from static PDF files to webpages with print styles.

Also update pattern for webpack url-loader to ignore case when matching file extensions (Tufts sends us things that were made on Windows, so images are .JPG, .PNG etc)
Also moved the full.css from curricula to print.css at the teach level. It’s shared by all the teach printable pages.

// router location does not include basename, since this function is setting
// window.location later, pathname needs basename prepended
if (typeof (this.props.basename) === 'string') {

This comment was marked as abuse.

// history.replace loop
const historyState = window.history.state || {};
const {
state = {}

This comment was marked as abuse.

window.removeEventListener('scroll', this.debouncedScroll, {passive: true});
}

onPush ({location}) {

This comment was marked as abuse.


.student_answer_sheet img.small-image{
width:30%;
}

This comment was marked as abuse.

@chrisgarrity chrisgarrity merged commit d4bfd10 into scratchfoundation:develop Sep 19, 2017
@chrisgarrity chrisgarrity deleted the feature/html-resources branch September 19, 2017 13:54
@chrisgarrity chrisgarrity removed their assignment Sep 21, 2017
@mewtaylor
Copy link

On OSX 10.12, Chrome 60:

  • Links on teach/curricula page go to HTML pages not PDF files
    • Everything looks good except for "printable block images", but I assume that's intentional
  • When printed the curricula pages only show the content (none of the site navigation), and include page breaks so that lessons start on a new page.
    • Animated genres is in a different structure, but everything looks good printed
  • Assessment/solveit/answersheet is not PDF, and prints without the site navigation

@chrisgarrity
Copy link
Contributor Author

@mewtaylor yes, Tufts hasn't done an HTML version of the blocks yet, so they're still PDF. Just the curricula were converted to HTML.

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

Successfully merging this pull request may close these issues.

None yet

4 participants