Skip to content

Commit c76b660

Browse files
author
Arne Claassen
committed
Merge pull request #20 from aaronmars/closure_fix
Fixes for closure compiler builds
2 parents 2572375 + 175862d commit c76b660

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

js/example.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// -------------------------
4646

4747
// Setup the `Underscore` template for displaying items in the `KillRing`.
48-
var killringItemTemplate = _.template("<div><% _.each(items, function(item, i) { %><div><%- i %>&nbsp;<%- item %></div><% }); %></div>")
48+
var killringItemTemplate = _.template("<div><% _.each(items, function(item, i) { %><div><%- i %>&nbsp;<%- item %></div><% }); %></div>");
4949

5050
// Create a the command `killring` which will display all text currently in the `KillRing`, by attaching
5151
// a handler to the `Shell`.
@@ -125,7 +125,7 @@
125125
// references like `.` and `..`. In implementations that let you explore an hierarchy on a server, this function
126126
// would live on the server side and be called remotely via `getNode`.
127127
function findNode(current, parts, callback) {
128-
if(!parts || parts.length == 0) {
128+
if(!parts || parts.length === 0) {
129129
return callback(current);
130130
}
131131
if(parts[0] == ".") {
@@ -208,7 +208,7 @@
208208
boot: {},
209209
dev: {},
210210
etc: {
211-
default: {},
211+
'default': {},
212212
'rc.d': {},
213213
sysconfig: {},
214214
x11: {}
@@ -254,7 +254,7 @@
254254
},
255255
src: {}
256256
},
257-
var: {
257+
'var': {
258258
lib: {},
259259
lock: {},
260260
run: {},

js/input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var Josh = Josh || {};
2222
var range = this.createTextRange();
2323
range.move("character", index);
2424
range.select();
25-
} else if (this.selectionStart != null) {
25+
} else if (this.selectionStart !== null) {
2626
this.setSelectionRange(index, index);
2727
}
2828
next();
@@ -34,7 +34,7 @@ var Josh = Josh || {};
3434
var range = el.createTextRange();
3535
range.moveStart('character', -el.value.length);
3636
return range.text.length;
37-
} else if (el.selectionStart != null) {
37+
} else if (el.selectionStart !== null) {
3838
return el.selectionStart;
3939
}
4040
return 0;
@@ -154,7 +154,7 @@ var Josh = Josh || {};
154154
readline.onChange(renderSpan);
155155
}
156156
readline.unbind({keyCode: Josh.Keys.Special.Tab});
157-
readline.unbind({char: 'R', ctrlKey: true});
157+
readline.unbind({'char': 'R', ctrlKey: true});
158158
readline.onActivate(function () {
159159
_active = true;
160160
activate();

js/readline.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Josh.Version = "0.2.9";
8585
left: cmdLeft,
8686
right: cmdRight,
8787
cancel: cmdCancel,
88-
delete: cmdDeleteChar,
88+
'delete': cmdDeleteChar,
8989
backspace: cmdBackspace,
9090
kill_eof: cmdKillToEOF,
9191
kill_wordback: cmdKillWordBackward,
@@ -96,9 +96,9 @@ Josh.Version = "0.2.9";
9696
wordback: cmdBackwardWord,
9797
wordforward: cmdForwardWord,
9898
yank_rotate: cmdRotate
99-
}
99+
};
100100
var _keyMap = {
101-
default: {
101+
'default': {
102102
8: cmdBackspace, // Backspace
103103
9: cmdComplete, // Tab
104104
13: cmdDone, // Enter
@@ -272,8 +272,8 @@ Josh.Version = "0.2.9";
272272
} else if(key.ctrlKey) {
273273
k.modifier = 'control';
274274
}
275-
if(key.char) {
276-
k.code = key.char.charCodeAt(0);
275+
if(key['char']) {
276+
k.code = key['char'].charCodeAt(0);
277277
}
278278
return k;
279279
}
@@ -674,7 +674,7 @@ Josh.Version = "0.2.9";
674674

675675
// check for some special first keys, regardless of modifiers
676676
_console.log("key: " + e.keyCode);
677-
var cmd = _keyMap.default[e.keyCode];
677+
var cmd = _keyMap['default'][e.keyCode];
678678
// intercept ctrl- and meta- sequences (may override the non-modifier cmd captured above
679679
var mod;
680680
if(e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) {
@@ -727,5 +727,3 @@ Josh.Version = "0.2.9";
727727
return self;
728728
};
729729
})(this);
730-
731-

0 commit comments

Comments
 (0)