mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Added some more documentation
This commit is contained in:
parent
9e58efc7e2
commit
112cad14e3
11 changed files with 46 additions and 9 deletions
|
@ -39,7 +39,7 @@ Use `^C` to stop the node process `npm start` starts.
|
||||||
| `PORT` | `8333` | Port for devserver (http://localhost:XXXX) |
|
| `PORT` | `8333` | Port for devserver (http://localhost:XXXX) |
|
||||||
| `FALLBACK` | `''` | Pass-through location for old site |
|
| `FALLBACK` | `''` | Pass-through location for old site |
|
||||||
|
|
||||||
**NOTE:** Because by default both `API_HOST=https://api.scratch.mit.edu` and `FALLBACK=https://scratch.mit.edu`, please be aware that, by default, you will be seeing and interacting with real data on the Scratch website.
|
**NOTE:** Because by default `API_HOST=https://api.scratch.mit.edu`, please be aware that, by default, you will be seeing and interacting with real data on the Scratch website.
|
||||||
|
|
||||||
### To Test
|
### To Test
|
||||||
```bash
|
```bash
|
||||||
|
@ -56,3 +56,5 @@ Most of the issues we have currently revolve around the use of `FALLBACK`. This
|
||||||
Setting `FALLBACK=https://scratch.mit.edu` allows the web client to retrieve data from the Scratch website in your development environment. However, because of security concerns, trying to send data to Scratch through your development environment won't work. This means the following things will be broken for the time being:
|
Setting `FALLBACK=https://scratch.mit.edu` allows the web client to retrieve data from the Scratch website in your development environment. However, because of security concerns, trying to send data to Scratch through your development environment won't work. This means the following things will be broken for the time being:
|
||||||
* Login on the splash page (*In the process of being fixed*)
|
* Login on the splash page (*In the process of being fixed*)
|
||||||
* Some update attempts to production data made through a development version of the web client
|
* Some update attempts to production data made through a development version of the web client
|
||||||
|
|
||||||
|
Additionally, if you set `FALLBACK=https://scratch.mit.edu`, be aware that clicking on links to parts of the website not yet migrated over (currently such as `Explore`, `Discuss`, `Profile`, etc.) will take you to the Scratch website itself.
|
||||||
|
|
|
@ -3,6 +3,10 @@ var React = require('react');
|
||||||
|
|
||||||
require('./banner.scss');
|
require('./banner.scss');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container for messages displayed below the nav bar that can be dismissed
|
||||||
|
* (See: email not confirmed banner)
|
||||||
|
*/
|
||||||
var Banner = React.createClass({
|
var Banner = React.createClass({
|
||||||
type: 'Banner',
|
type: 'Banner',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
|
|
@ -9,6 +9,9 @@ require('slick-carousel/slick/slick.scss');
|
||||||
require('slick-carousel/slick/slick-theme.scss');
|
require('slick-carousel/slick/slick-theme.scss');
|
||||||
require('./carousel.scss');
|
require('./carousel.scss');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays content in horizontal scrolling box. Example usage: splash page rows.
|
||||||
|
*/
|
||||||
var Carousel = React.createClass({
|
var Carousel = React.createClass({
|
||||||
type: 'Carousel',
|
type: 'Carousel',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
|
|
@ -8,6 +8,9 @@ var Select = require('../forms/select.jsx');
|
||||||
|
|
||||||
require('./languagechooser.scss');
|
require('./languagechooser.scss');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Footer dropdown menu that allows one to change their language.
|
||||||
|
*/
|
||||||
var LanguageChooser = React.createClass({
|
var LanguageChooser = React.createClass({
|
||||||
type: 'LanguageChooser',
|
type: 'LanguageChooser',
|
||||||
mixins: [
|
mixins: [
|
||||||
|
|
|
@ -25,6 +25,9 @@ var defaultStyle = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container for pop up windows (See: registration window)
|
||||||
|
*/
|
||||||
var Modal = React.createClass({
|
var Modal = React.createClass({
|
||||||
type: 'Modal',
|
type: 'Modal',
|
||||||
statics: {
|
statics: {
|
||||||
|
|
|
@ -48,14 +48,14 @@ var Navigation = React.createClass({
|
||||||
loginOpen: false,
|
loginOpen: false,
|
||||||
loginError: null,
|
loginError: null,
|
||||||
registrationOpen: false,
|
registrationOpen: false,
|
||||||
unreadMessageCount: 0,
|
unreadMessageCount: 0, // bubble number to display how many notifications someone has.
|
||||||
messageCountIntervalId: -1
|
messageCountIntervalId: -1 // javascript method interval id for getting messsage count.
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
componentDidMount: function () {
|
componentDidMount: function () {
|
||||||
if (this.state.session.user) {
|
if (this.state.session.user) {
|
||||||
this.getMessageCount();
|
this.getMessageCount();
|
||||||
var intervalId = setInterval(this.getMessageCount, 120000);
|
var intervalId = setInterval(this.getMessageCount, 120000); // check for new messages every 2 mins.
|
||||||
this.setState({'messageCountIntervalId': intervalId});
|
this.setState({'messageCountIntervalId': intervalId});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,6 +3,10 @@ var React = require('react');
|
||||||
|
|
||||||
require('./subnavigation.scss');
|
require('./subnavigation.scss');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Container for a custom, horizontal list of navigation elements
|
||||||
|
* that can be displayed within a view or component.
|
||||||
|
*/
|
||||||
var SubNavigation = React.createClass({
|
var SubNavigation = React.createClass({
|
||||||
type: 'SubNavigation',
|
type: 'SubNavigation',
|
||||||
render: function () {
|
render: function () {
|
||||||
|
|
|
@ -2,6 +2,9 @@ var ReactIntl = require('react-intl');
|
||||||
|
|
||||||
var customLanguages = require('../../custom-locales.json');
|
var customLanguages = require('../../custom-locales.json');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add custom locales to react-intl if it doesn't have them.
|
||||||
|
*/
|
||||||
for (var locale in customLanguages) {
|
for (var locale in customLanguages) {
|
||||||
ReactIntl.addLocaleData(customLanguages[locale]);
|
ReactIntl.addLocaleData(customLanguages[locale]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
var cookie = require('cookie');
|
var cookie = require('cookie');
|
||||||
var xhr = require('xhr');
|
var xhr = require('xhr');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module that handles coookie interactions.
|
||||||
|
* (Cookies?!?! Jar?!?! Get it?!?! WE'RE AMAZING!!!!)
|
||||||
|
*
|
||||||
|
* get(name, callback) – can be sync or async, as callback is optional
|
||||||
|
* set(name, value) – synchronously sets the cookie
|
||||||
|
* use(name, uri, callback) – can by sync or async, gets cookie from the uri if not there.
|
||||||
|
*/
|
||||||
var Jar = {};
|
var Jar = {};
|
||||||
|
|
||||||
Jar.get = function (name, callback) {
|
Jar.get = function (name, callback) {
|
||||||
|
|
|
@ -6,6 +6,13 @@ var log = require('../lib/log.js');
|
||||||
|
|
||||||
var CookieMixinFactory = require('./cookieMixinFactory.jsx');
|
var CookieMixinFactory = require('./cookieMixinFactory.jsx');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component mixin that constructs requests to the scratch api.
|
||||||
|
* Custom arguments:
|
||||||
|
* - useCsrf [boolean] – handles csrf construction for POST requests
|
||||||
|
*
|
||||||
|
* It also takes in other arguments specified in the xhr library spec.
|
||||||
|
*/
|
||||||
var Api = {
|
var Api = {
|
||||||
mixins: [
|
mixins: [
|
||||||
// Provides useScratchcsrftoken
|
// Provides useScratchcsrftoken
|
||||||
|
|
|
@ -29,11 +29,11 @@ var Splash = injectIntl(React.createClass({
|
||||||
getInitialState: function () {
|
getInitialState: function () {
|
||||||
return {
|
return {
|
||||||
projectCount: 10569070,
|
projectCount: 10569070,
|
||||||
activity: [],
|
activity: [], // recent social actions taken by users someone is following
|
||||||
news: [],
|
news: [], // gets news posts from the scratch Tumblr
|
||||||
featuredCustom: {},
|
featuredCustom: {}, // custom homepage rows, such as "Projects by Scratchers I'm Following"
|
||||||
featuredGlobal: {},
|
featuredGlobal: {}, // global homepage rows, such as "Featured Projects"
|
||||||
showEmailConfirmationModal: false,
|
showEmailConfirmationModal: false, // flag that determines whether to show banner to request email conf.
|
||||||
refreshCacheStatus: 'notrequested'
|
refreshCacheStatus: 'notrequested'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue