Fixes#654
IE does not honor responseType: 'json', and will not parse responses as JSON unless json data is present in the request. For some reason this issue can also be solved by including a `json` attribute on the xhr request, but if that's present, url encoded form data is overwritten with the contents of the json. So just try to parse the response ourselves if it looks like it wasn't parsed.
See https://github.com/Raynos/xhr/issues/123
Before, if a cookie didn't exist, it would throw an error, not causing permissions/tokens to change to empty values. This fixes that (and #626) by setting the value to undefined instead.
* 'feature/teacher-registration-flow' of https://github.com/rschamp/scratch-www: (46 commits)
Add serverside email validation
Clean up
Move registration step to main component
Submit the rest of the fields when registering
This help text is redundant now
Fix organization "other" field enablement
Get the form creating regular accounts
Add method to api for submitting forms
Update language chooser for formsy
Add missing string
Add progress indicators
Style pass
Remove unused label component
Remove unused mixin factory
Fixup api refactor
Add serverside username validation
L10n pass
Explain the GeneralError component
Add help text when a field is not required
L10n WIP
...
# Conflicts:
# src/l10n.json
# src/views/splash/splash.jsx
Some of our legacy endpoints expect this style rather than json.
Also clean up the way useCsrf works — don't always set json attribute to an empty object.
* 'develop' of https://github.com/LLK/scratch-www: (29 commits)
Add explore redirects
Allow access to 2014 and 2015 pages
use route aliases for generalizable route patterns
remove `/components` from `routes.json`
Remove Make it Fly banner
Fix issues in FAQ of /developers page.
move shuffle to utility module
fix error with shuffleArray function
add shuffleArray function, shuffle most loved and most remixed
use `image` to get studio thumbnail
quick formatting fix for box header on search
Fix merge issue
Add localizations, minor style changes
Removed rows from grid, changed explore tabs
Removed extraneous image file
Whitespace added
Small fix
Support for studios
Refactoring, new grid component
Style changes
...
# Conflicts:
# src/views/splash/splash.jsx
# src/views/splash/splash.scss
1. split `auth.js` up so it's 1 reducer per file
2. consolidate the conference schedule reducers
3. make conference reducer names more descriptive
4. add error handling for `body === 'undefined'`
Thanks @rschamp for all the help!
* 'develop' of https://github.com/LLK/scratch-www: (32 commits)
Lint
Bundle all locale data
Don't bundle polyfills
Set up Raven within init.js
Prefix privacyPolicy message string
Exclude minified javascript from linting
One space more
Changes "interfacesto" to "interfaces to"
Remove tag target
Filter before mapping to avoid returning undefined
Fix Pass condition for "static" routes
Spacing2
Mangling is the default
Spacing
Update for typography fixes
Cherry pick PR #476 into master
Add invisible spacer to anchored sections
For Developers
Lint JSON, expand and simplify lint step
Fix banned user redirect
...
# Conflicts:
# src/redux/actions.js
# src/redux/reducer.js
Use a model of reducer/action files for each component that has them, and make `reducer.js` be the one that imports and configures all of them. This modeling is based on a few examples I've seen which seemed to work for our current case, but I'm totally fine with splitting actions and reducers into separate directories if we'd like too.
This should allow us to define and update our dependencies more easily (via npm) as well as reducing the number of requests.
Additionally, when we add common packages this will avoid the issue after deploys where a user may get a cached HTML page, but new Javascript, leading to the dreaded blank page because the browser didn't download all dependencies.
Using mangle with UglifyJS also made the total file size for the common chunk bundle smaller than the current total for all of our external/polyfill scripts (1.18MB vs 1.55MB).
Assumes the session cookie is stored as JSON which may or may not have been compressed via zlib (indicated by a leading `.`), which is then base64-encoded, and made URL-safe by replacing all `+` and `/` characters with `-` and `_` respectively.
1. changes intl filenames to `[view].intl.js`
2. Move nav/footer rendering to `render.jsx`
3. Set locale cookie before submitting language change form
Thanks @thisandagain !
This moves all locale/translation building to a dependency, `scratch-www-intl-loader`, as well as tests associated with it. Also gets rid of the `make translations` step.
1. Load locale strings into `window._messages` in a separate file added to `template.html`, which contains view-specific and general strings
2. Update build-locales to compile separate files
isolate cookie business logic from react mixin logic so that they are more modular. And use the cookie business logic to set translation objects on the window