Skip to content

Commit d83bf93

Browse files
authored
Merge branch 'develop' into changes_by_almas_khan
2 parents b94784d + 9f9ff88 commit d83bf93

File tree

11 files changed

+36
-244
lines changed

11 files changed

+36
-244
lines changed

client/modules/IDE/actions/ide.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,6 @@ export function closeShareModal() {
171171
};
172172
}
173173

174-
export function showEditorOptions() {
175-
return {
176-
type: ActionTypes.SHOW_EDITOR_OPTIONS
177-
};
178-
}
179-
180-
export function closeEditorOptions() {
181-
return {
182-
type: ActionTypes.CLOSE_EDITOR_OPTIONS
183-
};
184-
}
185-
186174
export function showKeyboardShortcutModal() {
187175
return {
188176
type: ActionTypes.SHOW_KEYBOARD_SHORTCUT_MODAL

client/modules/IDE/components/Editor.jsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -362,20 +362,10 @@ class Editor extends React.Component {
362362
});
363363
}
364364

365-
toggleEditorOptions() {
366-
if (this.props.editorOptionsVisible) {
367-
this.props.closeEditorOptions();
368-
} else {
369-
this.optionsButton.focus();
370-
this.props.showEditorOptions();
371-
}
372-
}
373-
374365
render() {
375366
const editorSectionClass = classNames({
376367
editor: true,
377-
'sidebar--contracted': !this.props.isExpanded,
378-
'editor--options': this.props.editorOptionsVisible
368+
'sidebar--contracted': !this.props.isExpanded
379369
});
380370

381371
const editorHolderClass = classNames({
@@ -462,9 +452,6 @@ Editor.propTypes = {
462452
fileType: PropTypes.string.isRequired,
463453
url: PropTypes.string
464454
}).isRequired,
465-
editorOptionsVisible: PropTypes.bool.isRequired,
466-
showEditorOptions: PropTypes.func.isRequired,
467-
closeEditorOptions: PropTypes.func.isRequired,
468455
setUnsavedChanges: PropTypes.func.isRequired,
469456
startRefreshSketch: PropTypes.func.isRequired,
470457
autorefresh: PropTypes.bool.isRequired,

client/modules/IDE/reducers/files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ function draw() {
1212
const defaultHTML = `<!DOCTYPE html>
1313
<html lang="en">
1414
<head>
15-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.0/p5.js"></script>
16-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.0/addons/p5.sound.min.js"></script>
15+
<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>
1717
<link rel="stylesheet" type="text/css" href="style.css">
1818
<meta charset="utf-8" />
1919

client/modules/IDE/reducers/ide.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const initialState = {
1414
shareModalProjectId: 'abcd',
1515
shareModalProjectName: 'My Cute Sketch',
1616
shareModalProjectUsername: 'p5_user',
17-
editorOptionsVisible: false,
1817
keyboardShortcutVisible: false,
1918
unsavedChanges: false,
2019
infiniteLoop: false,
@@ -82,10 +81,6 @@ const ide = (state = initialState, action) => {
8281
});
8382
case ActionTypes.CLOSE_SHARE_MODAL:
8483
return Object.assign({}, state, { shareModalVisible: false });
85-
case ActionTypes.SHOW_EDITOR_OPTIONS:
86-
return Object.assign({}, state, { editorOptionsVisible: true });
87-
case ActionTypes.CLOSE_EDITOR_OPTIONS:
88-
return Object.assign({}, state, { editorOptionsVisible: false });
8984
case ActionTypes.SHOW_KEYBOARD_SHORTCUT_MODAL:
9085
return Object.assign({}, state, { keyboardShortcutVisible: true });
9186
case ActionTypes.CLOSE_KEYBOARD_SHORTCUT_MODAL:

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/styles/components/_editor.scss

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -372,41 +372,6 @@ pre.CodeMirror-line {
372372
height: #{29 / $base-font-size}rem;
373373
}
374374

375-
.editor__options-button {
376-
@include icon();
377-
position: absolute;
378-
top: #{10 / $base-font-size}rem;
379-
right: #{2 / $base-font-size}rem;
380-
z-index: 1;
381-
}
382-
383-
384-
.editor__options {
385-
display: none;
386-
@extend %modal;
387-
position: absolute;
388-
right: #{0 / $base-font-size}rem;
389-
padding: #{8 / $base-font-size}rem #{20 / $base-font-size}rem;
390-
font-size: #{12 / $base-font-size}rem;
391-
@include themify() {
392-
background-color: getThemifyVariable('modal-background-color');
393-
box-shadow: 0 0 18px getThemifyVariable('shadow-color');
394-
}
395-
.editor--options & {
396-
display: block;
397-
}
398-
}
399-
400-
.editor__options li {
401-
padding: #{4 / $base-font-size}rem 0;
402-
}
403-
404-
.editor__options a {
405-
@include themify() {
406-
color: getThemifyVariable('secondary-text-color');
407-
}
408-
}
409-
410375
.editor__file-name {
411376
@include themify() {
412377
color: getThemifyVariable('primary-text-color');

client/testData/testReduxStore.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const initialTestState = {
3232
shareModalProjectId: 'abcd',
3333
shareModalProjectName: 'My Cute Sketch',
3434
shareModalProjectUsername: 'p5_user',
35-
editorOptionsVisible: false,
3635
keyboardShortcutVisible: false,
3736
unsavedChanges: false,
3837
infiniteLoop: false,

0 commit comments

Comments
 (0)