|
237 | 237 | return "Please confirm that you would like to leave the editor.";
|
238 | 238 | });
|
239 | 239 |
|
240 |
| - $(document).on('click', '#editor, #editor-bar, #navigator', function() { |
241 |
| - occEditor.focus_terminal(false); |
242 |
| - //if (terminal_win) { |
243 |
| - //terminal_win.blur(); |
244 |
| - //} |
245 |
| - }); |
246 |
| - |
247 |
| - editor.on('focus', function() { |
248 |
| - occEditor.focus_terminal(false); |
249 |
| - //if (terminal_win) { |
250 |
| - // terminal_win.blur(); |
251 |
| - //} |
252 |
| - }); |
253 |
| - |
254 | 240 | editor_startup("Initializing Editor Events");
|
255 | 241 | editor.on('change', function() {
|
256 | 242 | var $file_element = $('.filesystem li.file-open');
|
|
583 | 569 | occEditor.focus_terminal = function(should_focus) {
|
584 | 570 | if (should_focus) {
|
585 | 571 | $('.bar').css('background-color', '#2c58bd');
|
586 |
| - //$('#editor-output-wrapper').css({ 'opacity' : 1 }); |
587 |
| - //$('#editor, #editor-bar').css({ 'opacity' : 0.95 }); |
588 | 572 | } else {
|
589 | 573 | $('.bar').css('background-color', '#323233');
|
590 |
| - //$('#editor-output-wrapper').css({ 'opacity' : 0.95 }); |
591 |
| - //$('#editor, #editor-bar').css({ 'opacity' : 1 }); |
592 | 574 | }
|
593 | 575 | };
|
594 | 576 |
|
|
808 | 790 |
|
809 | 791 | occEditor.send_terminal_command = function(command) {
|
810 | 792 | if (is_terminal_open) {
|
811 |
| - window.term.writeln(command); |
812 |
| - editor.focus(); |
| 793 | + term.send(JSON.stringify({type: "input", data: command})); |
813 | 794 | }
|
814 | 795 | };
|
815 | 796 |
|
|
835 | 816 |
|
836 | 817 | function run_command(command) {
|
837 | 818 | console.log("sending command: " + command);
|
838 |
| - term.send(JSON.stringify({type: "input", data: command})); |
| 819 | + occEditor.send_terminal_command(command); |
839 | 820 | }
|
840 | 821 |
|
841 | 822 | // Clean terminal
|
|
0 commit comments