Skip to content

Commit 672f23e

Browse files
committed
Merge branch 'develop' into chore/sandbox
2 parents efeab9f + 0ab685a commit 672f23e

File tree

10 files changed

+646
-11
lines changed

10 files changed

+646
-11
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"tabWidth": 2,
1515
"trailingComma": "none",
1616
"useTabs": false,
17-
"quoteProps": "as-needed"
17+
"quoteProps": "as-needed",
18+
"endOfLine":"auto"
1819
}

client/components/Nav.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,16 @@ class Nav extends React.PureComponent {
647647
Português
648648
</button>
649649
</li>
650+
<li className="nav__dropdown-item">
651+
<button
652+
onFocus={this.handleFocusForLang}
653+
onBlur={this.handleBlur}
654+
value="de"
655+
onClick={(e) => this.handleLangSelection(e)}
656+
>
657+
Deutsch
658+
</button>
659+
</li>
650660
<li className="nav__dropdown-item">
651661
<button
652662
onFocus={this.handleFocusForLang}

client/i18n.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33
import Backend from 'i18next-http-backend';
4-
import { enUS, es, ja, hi, ptBR } from 'date-fns/locale';
4+
import { enUS, es, ja, hi, ptBR, de } from 'date-fns/locale';
55

66
const fallbackLng = ['en-US'];
7-
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi', 'pt-BR'];
7+
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi', 'pt-BR', 'de'];
88

99
export function languageKeyToLabel(lang) {
1010
const languageMap = {
1111
'en-US': 'English',
1212
'es-419': 'Español',
1313
ja: '日本語',
1414
hi: 'हिन्दी',
15-
'pt-BR': 'Português'
15+
'pt-BR': 'Português',
16+
de: 'Deutsch'
1617
};
1718
return languageMap[lang];
1819
}
@@ -23,6 +24,7 @@ export function languageKeyToDateLocale(lang) {
2324
'es-419': es,
2425
ja,
2526
hi,
27+
de,
2628
'pt-BR': ptBR
2729
};
2830
return languageMap[lang];

client/modules/IDE/reducers/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const defaultHTML = `<!DOCTYPE html>
1313
<html lang="en">
1414
<head>
1515
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script>
16-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/addons/p5.sound.min.js"></script>
16+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script>
1717
<link rel="stylesheet" type="text/css" href="style.css">
1818
<meta charset="utf-8" />
1919

client/modules/User/pages/DashboardView.jsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import AssetList from '../../IDE/components/AssetList';
1111
import AssetSize from '../../IDE/components/AssetSize';
1212
import CollectionList from '../../IDE/components/CollectionList';
1313
import SketchList from '../../IDE/components/SketchList';
14+
import * as ProjectActions from '../../IDE/actions/project';
1415
import {
1516
CollectionSearchbar,
1617
SketchSearchbar
@@ -29,6 +30,7 @@ class DashboardView extends React.Component {
2930
constructor(props) {
3031
super(props);
3132
this.closeAccountPage = this.closeAccountPage.bind(this);
33+
this.createNewSketch = this.createNewSketch.bind(this);
3234
this.gotoHomePage = this.gotoHomePage.bind(this);
3335
this.toggleCollectionCreate = this.toggleCollectionCreate.bind(this);
3436
this.state = {
@@ -44,6 +46,10 @@ class DashboardView extends React.Component {
4446
browserHistory.push(this.props.previousPath);
4547
}
4648

49+
createNewSketch() {
50+
this.props.newProject();
51+
}
52+
4753
gotoHomePage() {
4854
browserHistory.push('/');
4955
}
@@ -98,7 +104,9 @@ class DashboardView extends React.Component {
98104
return (
99105
<React.Fragment>
100106
{this.isOwner() && (
101-
<Button to="/">{t('DashboardView.NewSketch')}</Button>
107+
<Button onClick={this.createNewSketch}>
108+
{t('DashboardView.NewSketch')}
109+
</Button>
102110
)}
103111
<SketchSearchbar />
104112
</React.Fragment>
@@ -170,7 +178,12 @@ function mapStateToProps(state) {
170178
};
171179
}
172180

181+
const mapDispatchToProps = {
182+
...ProjectActions
183+
};
184+
173185
DashboardView.propTypes = {
186+
newProject: PropTypes.func.isRequired,
174187
location: PropTypes.shape({
175188
pathname: PropTypes.string.isRequired
176189
}).isRequired,
@@ -185,4 +198,6 @@ DashboardView.propTypes = {
185198
t: PropTypes.func.isRequired
186199
};
187200

188-
export default withTranslation()(connect(mapStateToProps)(DashboardView));
201+
export default withTranslation()(
202+
connect(mapStateToProps, mapDispatchToProps)(DashboardView)
203+
);

client/testData/testReduxStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const initialTestState = {
6868
},
6969
{
7070
name: 'index.html',
71-
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.2.0/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.2.0/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <script src="sketch.js"></script> </body> </html>`,
71+
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <script src="sketch.js"></script> </body> </html>`,
7272
id: '606fc1c46045e19ca2ee2646',
7373
_id: '606fc1c46045e19ca2ee2646',
7474
fileType: 'file',

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p5.js-web-editor",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "The web editor for p5.js.",
55
"scripts": {
66
"clean": "rimraf dist",

server/scripts/examples.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const defaultHTML = `<!DOCTYPE html>
1010
<html lang="en">
1111
<head>
1212
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/addons/p5.sound.min.js"></script>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script>
1414
<link rel="stylesheet" type="text/css" href="style.css">
1515
<meta charset="utf-8" />
1616
</head>

0 commit comments

Comments
 (0)