2017-03-31 19:35:33 -04:00
|
|
|
var React = require('react');
|
2017-05-03 16:19:56 -04:00
|
|
|
var render = require('../../lib/render.jsx');
|
2017-03-31 19:35:33 -04:00
|
|
|
|
|
|
|
var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage;
|
|
|
|
var FormattedMessage = require('react-intl').FormattedMessage;
|
2017-09-19 11:56:30 -04:00
|
|
|
var injectIntl = require('react-intl').injectIntl;
|
2017-03-31 19:35:33 -04:00
|
|
|
|
2017-06-16 10:11:58 -04:00
|
|
|
var api = require('../../lib/api');
|
2017-05-03 16:19:56 -04:00
|
|
|
var Page = require('../../components/page/www/page.jsx');
|
2017-04-01 10:55:47 -04:00
|
|
|
var TitleBanner = require('../../components/title-banner/title-banner.jsx');
|
|
|
|
var FlexRow = require('../../components/flex-row/flex-row.jsx');
|
2017-04-06 10:40:46 -04:00
|
|
|
var SubNavigation = require('../../components/subnavigation/subnavigation.jsx');
|
|
|
|
|
|
|
|
require('./download.scss');
|
2017-05-03 16:19:56 -04:00
|
|
|
require('../../components/forms/button.scss');
|
2017-04-01 10:55:47 -04:00
|
|
|
|
2017-09-19 11:56:30 -04:00
|
|
|
var Download = injectIntl(React.createClass({
|
2017-04-01 10:55:47 -04:00
|
|
|
type: 'Download',
|
2017-06-16 10:11:58 -04:00
|
|
|
getInitialState: function () {
|
|
|
|
return {
|
2017-06-19 11:36:33 -04:00
|
|
|
swfVersion: ''
|
2017-06-16 10:11:58 -04:00
|
|
|
};
|
|
|
|
},
|
|
|
|
componentDidMount: function () {
|
2017-09-19 11:56:30 -04:00
|
|
|
var uri = '/scratchr2/static/sa/version.xml';
|
|
|
|
if (this.props.intl.locale === 'pt-br') {
|
|
|
|
uri = '/scratchr2/static/sa/pt-br/version.xml';
|
|
|
|
}
|
2017-06-16 10:11:58 -04:00
|
|
|
api({
|
|
|
|
host: '',
|
2017-09-19 11:56:30 -04:00
|
|
|
uri: uri,
|
2017-06-16 10:11:58 -04:00
|
|
|
responseType: 'string'
|
2017-06-19 11:36:33 -04:00
|
|
|
}, function (err, body, res) {
|
|
|
|
if (err || res.statusCode >= 400) {
|
|
|
|
return this.setState({
|
|
|
|
swfVersion: -1
|
|
|
|
});
|
|
|
|
}
|
2017-06-16 10:11:58 -04:00
|
|
|
|
|
|
|
var doc = new DOMParser().parseFromString(body, 'text/xml');
|
|
|
|
return this.setState({
|
|
|
|
swfVersion: doc.getElementsByTagName('versionNumber')[0].childNodes[0].nodeValue
|
|
|
|
});
|
|
|
|
}.bind(this));
|
|
|
|
},
|
2017-04-01 10:55:47 -04:00
|
|
|
render: function () {
|
2017-09-19 11:56:30 -04:00
|
|
|
var downloadPath = '/scratchr2/static/sa/Scratch-';
|
|
|
|
if (this.props.intl.locale === 'pt-br') {
|
|
|
|
downloadPath = '/scratchr2/static/sa/pt-br/Scratch-';
|
|
|
|
}
|
2017-06-19 11:36:33 -04:00
|
|
|
if (this.state.swfVersion.length > 0 && this.state.swfVersion !== -1) {
|
|
|
|
var downloadUrls = {
|
2017-09-19 11:56:30 -04:00
|
|
|
mac: downloadPath + this.state.swfVersion + '.dmg',
|
|
|
|
mac105: downloadPath + this.state.swfVersion + '.air',
|
|
|
|
windows: downloadPath + this.state.swfVersion + '.exe',
|
|
|
|
linux: downloadPath + this.state.swfVersion + '.air'
|
2017-06-19 11:36:33 -04:00
|
|
|
};
|
|
|
|
}
|
2017-06-16 10:11:58 -04:00
|
|
|
|
2017-04-01 10:55:47 -04:00
|
|
|
return (
|
|
|
|
<div className="download">
|
|
|
|
<TitleBanner className="masthead">
|
|
|
|
<div className="inner">
|
|
|
|
<h1 className="title-banner-h1">
|
|
|
|
<FormattedMessage id='download.title' />
|
|
|
|
</h1>
|
|
|
|
<p className="title-banner-p intro">
|
|
|
|
<FormattedMessage id='download.intro' />
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div className="band">
|
|
|
|
<SubNavigation className="inner">
|
2017-06-23 09:23:24 -04:00
|
|
|
<a href="#installation" className="sub-nav-item">
|
2017-04-01 10:55:47 -04:00
|
|
|
<li>
|
|
|
|
<FormattedMessage id='download.installation' />
|
|
|
|
</li>
|
|
|
|
</a>
|
2017-06-23 09:23:24 -04:00
|
|
|
<a href="#updates" className="sub-nav-item">
|
2017-04-01 10:55:47 -04:00
|
|
|
<li>
|
|
|
|
<FormattedMessage id='download.updatesTitle' />
|
|
|
|
</li>
|
|
|
|
</a>
|
2017-06-23 09:23:24 -04:00
|
|
|
<a href="#other" className="sub-nav-item">
|
2017-04-01 10:55:47 -04:00
|
|
|
<li>
|
|
|
|
<FormattedMessage id='download.otherVersionsTitle' />
|
|
|
|
</li>
|
|
|
|
</a>
|
2017-06-23 09:23:24 -04:00
|
|
|
<a href="#issues" className="sub-nav-item">
|
2017-04-01 10:55:47 -04:00
|
|
|
<li>
|
|
|
|
<FormattedMessage id='download.knownIssuesTitle' />
|
|
|
|
</li>
|
|
|
|
</a>
|
|
|
|
</SubNavigation>
|
|
|
|
</div>
|
|
|
|
</TitleBanner>
|
2017-05-20 00:24:18 -04:00
|
|
|
<div className="download-content">
|
2017-06-19 11:36:33 -04:00
|
|
|
<section id="installation" className="installation">
|
2017-06-23 09:23:24 -04:00
|
|
|
<div className="inner">
|
|
|
|
<p className="callout">
|
|
|
|
<FormattedHTMLMessage id='download.introMac' />
|
|
|
|
</p>
|
|
|
|
<FlexRow className="three-col-row">
|
|
|
|
<div className="installation-column">
|
|
|
|
<div className="installation-column-number">
|
|
|
|
<h2 className="installation-column-number-text">{'1'}</h2>
|
|
|
|
</div>
|
|
|
|
<h3><FormattedMessage id='download.airTitle' /></h3>
|
|
|
|
<p><FormattedHTMLMessage id='download.airBody' /></p>
|
2017-05-20 00:24:18 -04:00
|
|
|
<ul className="installation-downloads">
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.macOSX' /> -
|
2017-06-23 09:23:24 -04:00
|
|
|
{' '}<a href="http://get.adobe.com/air/">
|
2017-05-20 00:24:18 -04:00
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.macOlder' /> -
|
2017-06-23 09:23:24 -04:00
|
|
|
{' '}<a href="http://airdownload.adobe.com/air/mac/download/2.6/AdobeAIR.zip">
|
2017-05-20 00:24:18 -04:00
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.windows' /> -
|
2017-06-23 09:23:24 -04:00
|
|
|
{' '}<a href="http://get.adobe.com/air/">
|
2017-05-20 00:24:18 -04:00
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.linux' /> -
|
2017-06-23 09:23:24 -04:00
|
|
|
{' '}<a href="http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin">
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div className="installation-column">
|
|
|
|
<div className="installation-column-number">
|
|
|
|
<h2 className="installation-column-number-text">{'2'}</h2>
|
|
|
|
</div>
|
|
|
|
<h3><FormattedMessage id='download.offlineEditorTitle' /></h3>
|
|
|
|
<p><FormattedMessage id='download.offlineEditorBody' /></p>
|
|
|
|
{downloadUrls ? [
|
|
|
|
<ul className="installation-downloads">
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.macOSX' /> -
|
|
|
|
{' '}<a href={downloadUrls.mac}>
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.macOlder' /> -
|
|
|
|
{' '}<a href={downloadUrls.mac105}>
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.windows' /> -
|
|
|
|
{' '}<a href={downloadUrls.windows}>
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.linux' /> -
|
|
|
|
{' '}<a href={downloadUrls.linux}>
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
] : []}
|
|
|
|
{this.state.swfVersion === -1 ? [
|
|
|
|
<p><i><FormattedMessage id='download.notAvailable' /></i></p>
|
|
|
|
] : []}
|
|
|
|
</div>
|
|
|
|
<div className="installation-column">
|
|
|
|
<div className="installation-column-number">
|
|
|
|
<h2 className="installation-column-number-text">{'3'}</h2>
|
|
|
|
</div>
|
|
|
|
<h3><FormattedMessage id='download.supportMaterialsTitle' /></h3>
|
|
|
|
<p><FormattedMessage id='download.supportMaterialsBody' /></p>
|
|
|
|
<ul className="installation-downloads">
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.starterProjects' /> -
|
|
|
|
{' '}<a href="https://scratch.mit.edu/scratchr2/static/sa/Scratch2StarterProjects.zip">
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.gettingStarted' /> -
|
|
|
|
{' '}<a href="https://cdn.scratch.mit.edu/scratchr2/static/__709da8e5f3d72129538a4ccdbcbf5f2a__/pdfs/help/Getting-Started-Guide-Scratch2.pdf">
|
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li className="installation-downloads-item">
|
|
|
|
<FormattedMessage id='download.scratchCards' /> -
|
|
|
|
{' '}<a href="https://cdn.scratch.mit.edu/scratchr2/static/__709da8e5f3d72129538a4ccdbcbf5f2a__/pdfs/help/Scratch2Cards.pdf">
|
2017-05-20 00:24:18 -04:00
|
|
|
<FormattedMessage id='download.download' />
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-06-23 09:23:24 -04:00
|
|
|
</div>
|
|
|
|
</FlexRow>
|
|
|
|
</div>
|
2017-06-19 11:36:33 -04:00
|
|
|
</section>
|
|
|
|
<div className="inner">
|
2017-05-20 00:24:18 -04:00
|
|
|
<section id="updates">
|
|
|
|
<span className="nav-spacer"></span>
|
|
|
|
<h2><FormattedMessage id='download.updatesTitle' /></h2>
|
|
|
|
<p><FormattedMessage id='download.updatesBody' /></p>
|
2017-06-19 11:36:33 -04:00
|
|
|
{this.state.swfVersion !== -1 ? [
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id='download.currentVersion'
|
|
|
|
values={{
|
|
|
|
version: this.state.swfVersion
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
] : []}
|
2017-05-20 00:24:18 -04:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="other">
|
|
|
|
<span className="nav-spacer"></span>
|
|
|
|
<h2><FormattedMessage id='download.otherVersionsTitle' /></h2>
|
|
|
|
<p><FormattedHTMLMessage id='download.otherVersionsOlder' /></p>
|
|
|
|
<p><FormattedHTMLMessage id='download.otherVersionsAdmin' /></p>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="issues">
|
|
|
|
<span className="nav-spacer"></span>
|
|
|
|
<h2><FormattedMessage id='download.knownIssuesTitle' /></h2>
|
|
|
|
<p><FormattedMessage id='download.knownIssuesOne' /></p>
|
|
|
|
<p><FormattedMessage id='download.knownIssuesTwo' /></p>
|
|
|
|
<p><FormattedHTMLMessage id='download.knownIssuesThree' /></p>
|
2017-05-24 20:19:49 -04:00
|
|
|
<a href="https://scratch.mit.edu/discuss/3/" className='button mod-link'>
|
2017-05-20 00:24:18 -04:00
|
|
|
<FormattedMessage id='download.reportBugs' />
|
|
|
|
</a>
|
|
|
|
</section>
|
|
|
|
</div>
|
2017-04-01 10:55:47 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-09-19 11:56:30 -04:00
|
|
|
}));
|
2017-04-01 10:55:47 -04:00
|
|
|
|
|
|
|
render(<Page><Download /></Page>, document.getElementById('app'));
|