2018-01-30 11:53:12 -05:00
|
|
|
const FormattedMessage = require('react-intl').FormattedMessage;
|
|
|
|
const injectIntl = require('react-intl').injectIntl;
|
|
|
|
const intlShape = require('react-intl').intlShape;
|
|
|
|
const React = require('react');
|
2017-03-31 19:35:33 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
2018-12-10 17:33:22 -05:00
|
|
|
const bindAll = require('lodash.bindall');
|
2017-03-31 19:35:33 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
const Page = require('../../components/page/www/page.jsx');
|
|
|
|
const render = require('../../lib/render.jsx');
|
2019-09-24 14:34:02 -04:00
|
|
|
const detectOS = require('../../lib/detect-os.js').default;
|
2019-11-12 18:17:30 -05:00
|
|
|
const OS_ENUM = require('../../lib/os-enum.js');
|
2019-09-24 14:34:02 -04:00
|
|
|
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
|
2018-12-10 17:33:22 -05:00
|
|
|
const OSChooser = require('../../components/os-chooser/os-chooser.jsx');
|
2019-09-24 14:34:02 -04:00
|
|
|
const InstallScratch = require('../../components/install-scratch/install-scratch.jsx');
|
|
|
|
const {isDownloaded, isFromGooglePlay} = require('../../components/install-scratch/install-util.js');
|
2017-04-06 10:40:46 -04:00
|
|
|
|
|
|
|
require('./download.scss');
|
2017-05-03 16:19:56 -04:00
|
|
|
require('../../components/forms/button.scss');
|
2017-04-01 10:55:47 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
class Download extends React.Component {
|
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
2018-12-10 17:33:22 -05:00
|
|
|
bindAll(this, [
|
2018-12-10 18:09:36 -05:00
|
|
|
'onSetOS'
|
|
|
|
]);
|
2018-12-10 17:33:22 -05:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
this.state = {
|
2019-09-24 14:34:02 -04:00
|
|
|
OS: detectOS()
|
2017-06-16 10:11:58 -04:00
|
|
|
};
|
2018-01-30 11:53:12 -05:00
|
|
|
}
|
2017-06-16 10:11:58 -04:00
|
|
|
|
2018-12-10 17:33:22 -05:00
|
|
|
onSetOS (os) {
|
|
|
|
this.setState({
|
|
|
|
OS: os
|
2018-01-30 11:53:12 -05:00
|
|
|
});
|
|
|
|
}
|
2017-06-16 10:11:58 -04:00
|
|
|
|
2018-12-10 17:33:22 -05:00
|
|
|
render () {
|
2017-04-01 10:55:47 -04:00
|
|
|
return (
|
|
|
|
<div className="download">
|
2018-12-10 17:33:22 -05:00
|
|
|
<div className="download-header">
|
|
|
|
<FlexRow className="inner">
|
|
|
|
<FlexRow className="column download-info">
|
|
|
|
<FlexRow className="column download-copy">
|
2018-12-11 10:11:06 -05:00
|
|
|
<h1 className="download-title">
|
|
|
|
<img
|
2018-12-11 11:55:42 -05:00
|
|
|
alt={this.props.intl.formatMessage({id: 'download.iconAltText'})}
|
2018-12-13 10:14:24 -05:00
|
|
|
className="icon"
|
2018-12-11 10:11:06 -05:00
|
|
|
height="40"
|
2018-12-13 14:57:21 -05:00
|
|
|
src="/images/download/icon.png"
|
2018-12-11 10:11:06 -05:00
|
|
|
width="40"
|
|
|
|
/>
|
2019-09-24 14:34:02 -04:00
|
|
|
<FormattedMessage
|
|
|
|
id={CHROME_APP_RELEASED ? 'download.appTitle' :
|
|
|
|
'download.title'}
|
|
|
|
/>
|
2018-12-10 17:33:22 -05:00
|
|
|
</h1>
|
2018-12-10 19:34:23 -05:00
|
|
|
<span className="download-description">
|
2019-09-24 14:34:02 -04:00
|
|
|
<FormattedMessage
|
|
|
|
id={CHROME_APP_RELEASED ? 'download.appIntro' :
|
|
|
|
'download.intro'}
|
|
|
|
/>
|
2018-12-10 19:34:23 -05:00
|
|
|
</span>
|
2018-12-10 17:33:22 -05:00
|
|
|
</FlexRow>
|
|
|
|
<FlexRow className="column download-requirements-container">
|
|
|
|
<span className="requirements-header">
|
|
|
|
<FormattedMessage id="download.requirements" />
|
|
|
|
</span>
|
|
|
|
<FlexRow className="download-requirements">
|
|
|
|
<span>
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
src="/svgs/extensions/windows.svg"
|
|
|
|
/>
|
|
|
|
Windows 10+
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
src="svgs/extensions/mac.svg"
|
|
|
|
/>
|
|
|
|
macOS 10.13+
|
|
|
|
</span>
|
2019-09-24 14:34:02 -04:00
|
|
|
{CHROME_APP_RELEASED && (
|
|
|
|
<React.Fragment>
|
|
|
|
<span>
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
src="svgs/extensions/chromeos.svg"
|
|
|
|
/>
|
|
|
|
ChromeOS
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
src="svgs/extensions/android.svg"
|
|
|
|
/>
|
2019-10-02 18:57:06 -04:00
|
|
|
Android 6.0+
|
2019-09-24 14:34:02 -04:00
|
|
|
</span>
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
2018-12-10 17:33:22 -05:00
|
|
|
</FlexRow>
|
2017-06-23 09:23:24 -04:00
|
|
|
</FlexRow>
|
2018-12-10 17:33:22 -05:00
|
|
|
</FlexRow>
|
|
|
|
<div className="download-image">
|
|
|
|
<img
|
|
|
|
alt={this.props.intl.formatMessage({id: 'download.imgAltDownloadIllustration'})}
|
|
|
|
src="/images/download/download.png"
|
|
|
|
/>
|
2017-06-23 09:23:24 -04:00
|
|
|
</div>
|
2018-12-10 17:33:22 -05:00
|
|
|
</FlexRow>
|
|
|
|
</div>
|
|
|
|
<OSChooser
|
|
|
|
currentOS={this.state.OS}
|
|
|
|
handleSetOS={this.onSetOS}
|
|
|
|
/>
|
2019-09-24 14:34:02 -04:00
|
|
|
<InstallScratch currentOS={this.state.OS} />
|
|
|
|
{isDownloaded(this.state.OS) && (
|
|
|
|
<div className="download-section">
|
|
|
|
<FlexRow className="inner column">
|
|
|
|
<h2 className="title">
|
|
|
|
<FormattedMessage id="download.olderVersionsTitle" />
|
|
|
|
</h2>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.olderVersions" />
|
|
|
|
</p>
|
|
|
|
<FlexRow>
|
|
|
|
<div className="older-version">
|
|
|
|
<a href="/download/scratch2">
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
className="screenshot"
|
|
|
|
height="106"
|
|
|
|
src="/images/download/scratch2.png"
|
|
|
|
width="150"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<p>
|
2018-12-10 17:33:22 -05:00
|
|
|
<a
|
2019-09-24 14:34:02 -04:00
|
|
|
className="legacy-link"
|
|
|
|
href="/download/scratch2"
|
2018-12-10 17:33:22 -05:00
|
|
|
>
|
2019-09-24 14:34:02 -04:00
|
|
|
<FormattedMessage id="download.scratch2Desktop" />
|
|
|
|
<img
|
|
|
|
className="little-arrow"
|
|
|
|
src="/svgs/download/r-arrow.svg"
|
|
|
|
/>
|
2018-12-10 17:33:22 -05:00
|
|
|
</a>
|
2019-09-24 14:34:02 -04:00
|
|
|
</p>
|
2018-12-10 17:33:22 -05:00
|
|
|
</div>
|
2019-09-24 14:34:02 -04:00
|
|
|
<div className="older-version">
|
|
|
|
<a href="/scratch_1.4">
|
|
|
|
<img
|
|
|
|
alt=""
|
|
|
|
className="screenshot"
|
|
|
|
height="106"
|
|
|
|
src="/images/download/scratch1-4.png"
|
|
|
|
width="150"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<p>
|
|
|
|
<a
|
|
|
|
className="legacy-link"
|
|
|
|
href="/scratch_1.4"
|
|
|
|
>
|
|
|
|
<FormattedMessage id="download.scratch1-4Desktop" />
|
|
|
|
<img
|
|
|
|
className="little-arrow"
|
|
|
|
src="/svgs/download/r-arrow.svg"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</FlexRow>
|
|
|
|
</FlexRow>
|
|
|
|
</div>
|
|
|
|
)}
|
2018-12-10 17:33:22 -05:00
|
|
|
<div className="download-section faq">
|
|
|
|
<FlexRow className="inner column">
|
2018-12-11 10:11:06 -05:00
|
|
|
<h2 className="title">
|
2018-12-10 19:34:23 -05:00
|
|
|
<FormattedMessage id="download.troubleshootingTitle" />
|
|
|
|
</h2>
|
2019-12-09 13:22:32 -05:00
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage id="download.doIHaveToDownload" />
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.doIHaveToDownloadAnswer" />
|
|
|
|
</p>
|
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage id="download.howConnectHardwareDevices" />
|
|
|
|
</h3>
|
|
|
|
{isDownloaded(this.state.OS) && (
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.howConnectHardwareDevicesAnswerLink"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</p>
|
2019-09-24 14:34:02 -04:00
|
|
|
)}
|
2019-12-09 13:22:32 -05:00
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.howConnectHardwareDevicesAnswerApp"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</p>
|
2019-09-24 14:34:02 -04:00
|
|
|
)}
|
2019-12-09 13:22:32 -05:00
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.canIShareApp"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</h3>
|
|
|
|
{isDownloaded(this.state.OS) && (
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.canIShareAnswerDownloaded"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</p>
|
2019-10-02 18:57:06 -04:00
|
|
|
)}
|
2019-09-24 14:34:02 -04:00
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
2019-12-09 13:22:32 -05:00
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.canIShareAnswerPlayStore" />
|
|
|
|
</p>
|
2019-09-24 14:34:02 -04:00
|
|
|
)}
|
2019-10-02 18:57:06 -04:00
|
|
|
<h3 className="faq-question">
|
2019-12-09 13:22:32 -05:00
|
|
|
<FormattedMessage id="download.appAndBrowser" />
|
2019-10-02 18:57:06 -04:00
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.yesAnswer" />
|
|
|
|
</p>
|
2019-09-24 14:34:02 -04:00
|
|
|
<h3 className="faq-question">
|
2019-12-09 13:22:32 -05:00
|
|
|
<FormattedMessage id="download.onPhone" />
|
2019-09-24 14:34:02 -04:00
|
|
|
</h3>
|
|
|
|
<p>
|
2019-12-09 13:22:32 -05:00
|
|
|
<FormattedMessage id="download.onPhoneAnswer" />
|
2019-09-24 14:34:02 -04:00
|
|
|
</p>
|
2020-02-04 11:02:49 -05:00
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage id="download.howUpdateApp" />
|
|
|
|
</h3>
|
|
|
|
{isDownloaded(this.state.OS) && (
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.howUpdateAppAnswerDownload"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
)}
|
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.howUpdateAppAnswerApp"
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
)}
|
2019-12-09 13:22:32 -05:00
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage id="download.whenSupportLinuxApp" />
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.whenSupportLinuxAppAnswer" />
|
|
|
|
</p>
|
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
2019-11-12 18:17:30 -05:00
|
|
|
<React.Fragment>
|
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage id="download.whyNoDevicesVisible" />
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.whyNoDevicesVisibleAnswer"
|
|
|
|
values={{
|
|
|
|
devicePosessive: (
|
|
|
|
this.state.OS === OS_ENUM.ANDROID ?
|
|
|
|
<FormattedMessage id="download.androidPossessive" /> :
|
|
|
|
<FormattedMessage id="download.chromebookPossessive" />
|
|
|
|
),
|
|
|
|
whyNoDevicesContactUsLink: (
|
|
|
|
<a href="//scratch.mit.edu/contact-us/">
|
|
|
|
<FormattedMessage id="download.whyNoDevicesContactUsLink" />
|
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
2019-12-09 13:22:32 -05:00
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
2019-11-12 18:17:30 -05:00
|
|
|
<React.Fragment>
|
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.whyAskForLocation"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.whyAskForLocationAnswer" />
|
|
|
|
</p>
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
2019-12-09 13:22:32 -05:00
|
|
|
{isFromGooglePlay(this.state.OS) && (
|
|
|
|
<React.Fragment>
|
|
|
|
<h3 className="faq-question">
|
|
|
|
<FormattedMessage
|
|
|
|
id="download.whereProjectStored"
|
|
|
|
values={{operatingsystem: this.state.OS}}
|
|
|
|
/>
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<FormattedMessage id="download.whereProjectStoredAnswer" />
|
|
|
|
</p>
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
2018-12-10 17:33:22 -05:00
|
|
|
</FlexRow>
|
2017-04-01 10:55:47 -04:00
|
|
|
</div>
|
2019-09-24 14:34:02 -04:00
|
|
|
|
2017-04-01 10:55:47 -04:00
|
|
|
</div>
|
|
|
|
);
|
2018-12-10 17:33:22 -05:00
|
|
|
|
2017-04-01 10:55:47 -04:00
|
|
|
}
|
2018-01-30 11:53:12 -05:00
|
|
|
}
|
|
|
|
Download.propTypes = {
|
|
|
|
intl: intlShape
|
2018-12-10 17:33:22 -05:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
const WrappedDownload = injectIntl(Download);
|
2017-04-01 10:55:47 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
render(<Page><WrappedDownload /></Page>, document.getElementById('app'));
|