Skip to content

Commit ee1e3d0

Browse files
committed
Bugggg fixing
1 parent f26b274 commit ee1e3d0

File tree

7 files changed

+35
-11
lines changed

7 files changed

+35
-11
lines changed

src/components/Console/Console.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ import JSConsole from './jsconsole'
88

99
import './Console.scss'
1010

11+
const CTRL_KEY = 'Ctrl';
1112
const HELP_TEXT = [
1213
'`Welcome to the interactive ES6 console',
1314
' :help - Show this help text',
1415
'',
1516
' Console commands:',
1617
' Up & Down - Navigate command history',
1718
' Enter - Execute code',
18-
' Ctrl-L - Clear console',
19-
' Ctrl-C - Cancel current command`',
19+
` ${CTRL_KEY}-L - Clear console`,
20+
` ${CTRL_KEY}-C - Cancel current command`,
21+
` ${CTRL_KEY}-S - Save snippet\``,
2022

2123
].join('\n');
2224

src/components/Editor/Editor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class _Editor extends Component {
124124
let {
125125
runCode,
126126
transformCode,
127+
saveSnippet,
127128
} = this.props;
128129

129130
let options = {
@@ -132,8 +133,12 @@ class _Editor extends Component {
132133
viewportMargin : Infinity,
133134
gutters : [GUTTER_ID,'CodeMirror-linenumbers'],
134135
extraKeys: {
135-
'Cmd-Enter': cm => runCode(),
136-
'Cmd-B': cm => transformCode(),
136+
'Ctrl-Enter': cm => runCode(),
137+
'Ctrl-B': cm => transformCode(),
138+
'Ctrl-S': cm => {
139+
const code = cm.getValue();
140+
saveSnippet(code);
141+
}
137142
}
138143
};
139144

src/layouts/CoreLayout/CoreLayout.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ class CoreLayout extends Component {
174174
<Icon name='book' />
175175
</div>
176176

177+
<a className='sidebar-uno__bottom-two' href="//twitter.com/tthisk">
178+
<div className='button-round'>
179+
<Icon name='twitter' />
180+
</div>
181+
</a>
182+
177183
<a className='sidebar-uno__bottom' href="//github.com/matthisk/es6console">
178184
<div className='button-round'>
179185
<Icon name='github' />

src/layouts/CoreLayout/CoreLayout.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
}
6060
}
6161

62+
.sidebar-uno__bottom-two {
63+
@extend .sidebar-uno__bottom;
64+
bottom: 45px;
65+
}
66+
6267
.button-round {
6368
width: 34px;
6469
height: 34px;

src/routes/Home/components/HomeView.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
padding-left: 25px;
2121
transition: flex .3s;
2222
min-height: 0px;
23-
overflow-y: scroll;
23+
overflow-y: hidden;
2424
}
2525

2626
.ide__column-gutter {

src/store/ide.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function transformOnTypeReducer(state, action) {
222222
let {
223223
errors = [],
224224
code = ''
225-
} = transform(state, action);
225+
} = transformReducer(state, action);
226226

227227
let { editors } = state;
228228

todo.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,34 @@
55
- show line numbers
66
- select theme
77
- indent unit
8-
[] Keyboard shortcuts
8+
[*] Keyboard shortcuts
99
- [*] Cmd-Enter
1010
- [*] Cmd-B
11-
- [] Cmd-S
11+
- [*] Cmd-S
1212
[*] Console better formatting for log lines
1313
[*] Help text when you open console
1414
[*] Localstorage saving
1515
[*] Saving to psql
1616
[*] Loading from psql
1717
[*] Examples for es2016 and es2017 presets
18+
[*] Loading screen
1819
[] Draggable editor sizes
19-
[] Add Linter
20-
[] Loading screen
20+
[*] Add link to my Twitter
21+
22+
###Ops
23+
[] Create test deploy to dokku
24+
[] Create real deploy to dokku
2125

2226
### Bugs
2327

2428
[*] Console prints multiple times on run
2529
[] Catch errors on iframe (sandbox)
26-
[] Saving from a snippet page doesn't seem to work
30+
[*] Saving from a snippet page doesn't seem to work
2731
[] Async examples will not log all statements to the console
2832
[] CompletionValue is not logged to console
33+
[] locationChange should load snippet
2934

3035
### Future
3136

37+
[] Add Linter
3238
[] Wiki

0 commit comments

Comments
 (0)