@@ -220,24 +220,25 @@ function(_yargs, d3, demos) {
220
220
} ,
221
221
222
222
command : function ( entry ) {
223
- if ( entry . trim ( ) === '' ) {
223
+ entry = entry . trim ( )
224
+ if ( entry === '' ) {
224
225
return ;
225
226
}
226
227
227
228
document . getElementById ( 'last-command' ) . textContent = entry
228
229
229
- if ( entry . trim ( ) === 'pres()' ) {
230
+ if ( entry === 'pres()' ) {
230
231
window . pres ( )
231
232
return
232
233
}
233
234
234
- if ( entry . trim ( ) . toLowerCase ( ) . indexOf ( 'mode ' ) === 0 ) {
235
- var mode = entry . trim ( ) . split ( ' ' ) . pop ( ) . trim ( )
235
+ if ( entry . toLowerCase ( ) . indexOf ( 'mode ' ) === 0 ) {
236
+ var mode = entry . split ( ' ' ) . pop ( )
236
237
this . changeMode ( mode )
237
238
return
238
239
}
239
240
240
- if ( entry . trim ( ) . toLowerCase ( ) === 'undo' ) {
241
+ if ( entry . toLowerCase ( ) === 'undo' ) {
241
242
var lastId = this . undoHistory . pointer - 1
242
243
var lastState = this . undoHistory . stack [ lastId ]
243
244
if ( lastState ) {
@@ -255,7 +256,7 @@ function(_yargs, d3, demos) {
255
256
return
256
257
}
257
258
258
- if ( entry . trim ( ) . toLowerCase ( ) === 'redo' ) {
259
+ if ( entry . toLowerCase ( ) === 'redo' ) {
259
260
var lastId = this . undoHistory . pointer + 1
260
261
var lastState = this . undoHistory . stack [ lastId ]
261
262
if ( lastState ) {
@@ -273,7 +274,7 @@ function(_yargs, d3, demos) {
273
274
return
274
275
}
275
276
276
- if ( entry . trim ( ) . toLowerCase ( ) === 'clear' ) {
277
+ if ( entry . toLowerCase ( ) === 'clear' ) {
277
278
window . resetVis ( )
278
279
return
279
280
}
0 commit comments