Skip to content

Commit

Permalink
initialize DOM before initializing OS
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNisnevich committed Apr 6, 2012
1 parent 34878f3 commit d3342cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
15 changes: 7 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
if (command !== '') {
if (command.split('(').length > command.split(')').length) {
// incomplete expression - remove from lines and history
terminal.set_command(command + '\n.. ');
terminal.lines(terminal.lines().slice(0,-1));
terminal.set_command(command + '\n.. '); // start new line in command
terminal.lines(terminal.lines().slice(0,-1)); // remove last line in output
for (i = 1; i < command.split(/\n/).length; i++) {
terminal.get_history().pop(); // need to pop once for each line after the first
terminal.get_history().pop(); // need to pop once for each line after the first
}
terminal.resize();
terminal.resize(); // refresh terminal
} else {
var result = evaluate(command);
if (result !== undefined) {
Expand All @@ -49,7 +49,9 @@
height: 200,
prompt: 'ecmachine:/ guest$',
onInit: function(term) {
terminal = term;
$('body').css('margin', '0');
$('<div>').attr('id', 'overlays').appendTo('.terminal');
terminal = term;
OS.initialize();
terminalResize();
},
Expand All @@ -61,9 +63,6 @@
}
});

$('body').css('margin', '0');
$('<div>').attr('id', 'overlays').appendTo('.terminal');

$(window).resize(terminalRefresh);
});

Expand Down
1 change: 0 additions & 1 deletion js/lib/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,6 @@ function get_stack(caller) {
command_list: command_list,
greetings: settings.greetings
});
console.log(settings);
var command_line = self.find('.terminal-output').next().cmd({
prompt: settings.prompt,
history: settings.history,
Expand Down

0 comments on commit d3342cd

Please sign in to comment.