Skip to content

Commit

Permalink
Fix Cycle::rotate and remove global window.terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jun 19, 2016
1 parent 6885186 commit 9916880
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 47 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -6,6 +6,7 @@ RM=rm
CAT=cat
DATE=`date -uR`


ALL: Makefile .$(VERSION) js/jquery.terminal-$(VERSION).js js/jquery.terminal.js js/jquery.terminal-$(VERSION).min.js js/jquery.terminal.min.js css/jquery.terminal-$(VERSION).css css/jquery.terminal-$(VERSION).min.css css/jquery.terminal.min.css css/jquery.terminal.css README.md www/Makefile terminal.jquery.json bower.json package.json

bower.json: bower.in .$(VERSION)
Expand Down Expand Up @@ -65,6 +66,7 @@ jshint:
jshint js/dterm.js
jshint js/xml_formatting.js
jshint js/unix_formatting.js
jshint spec/terminalSpec.js

install:
npm install
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -66,6 +66,7 @@ jshint:
jshint js/dterm.js
jshint js/xml_formatting.js
jshint js/unix_formatting.js
jshint spec/terminalSpec.js

install:
npm install
2 changes: 1 addition & 1 deletion css/jquery.terminal-0.11.0.css
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2016 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Sat, 18 Jun 2016 12:04:42 +0000
* Date: Sat, 18 Jun 2016 18:09:57 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down
2 changes: 1 addition & 1 deletion css/jquery.terminal-0.11.0.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/jquery.terminal.css
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2016 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Sat, 18 Jun 2016 12:04:42 +0000
* Date: Sat, 18 Jun 2016 18:09:57 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down
2 changes: 1 addition & 1 deletion css/jquery.terminal.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions js/jquery.terminal-0.11.0.js
Expand Up @@ -31,7 +31,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Sat, 18 Jun 2016 12:04:40 +0000
* Date: Sun, 19 Jun 2016 09:16:47 +0000
*/

/* TODO:
Expand Down Expand Up @@ -683,6 +683,9 @@
return data;
},
rotate: function() {
if (!data.filter(Boolean).length) {
return;
}
if (data.length === 1) {
return data[0];
} else {
Expand All @@ -694,7 +697,7 @@
if (data[pos]) {
return data[pos];
} else {
this.rotate();
return this.rotate();
}
}
},
Expand Down Expand Up @@ -2642,7 +2645,7 @@
// :: All terminal globals
// -------------------------------------------------------------------------
var requests = []; // for canceling on CTRL+D
var terminals = window.terminals = new Cycle(); // list of terminals global in this scope
var terminals = new Cycle(); // list of terminals global in this scope
// state for all terminals, terminals can't have own array fo state because
// there is only one popstate event
var save_state = []; // hold objects returned by export_view by history API
Expand Down Expand Up @@ -2897,7 +2900,7 @@
}
};
});
interpreter_object['help'] = function(fn) {
interpreter_object.help = function(fn) {
if (typeof fn == 'undefined') {
self.echo('Available commands: ' + ret.procs.map(function(proc) {
return proc.name;
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal-0.11.0.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions js/jquery.terminal-src.js
Expand Up @@ -683,6 +683,9 @@
return data;
},
rotate: function() {
if (!data.filter(Boolean).length) {
return;
}
if (data.length === 1) {
return data[0];
} else {
Expand All @@ -694,7 +697,7 @@
if (data[pos]) {
return data[pos];
} else {
this.rotate();
return this.rotate();
}
}
},
Expand Down Expand Up @@ -2642,7 +2645,7 @@
// :: All terminal globals
// -------------------------------------------------------------------------
var requests = []; // for canceling on CTRL+D
var terminals = window.terminals = new Cycle(); // list of terminals global in this scope
var terminals = new Cycle(); // list of terminals global in this scope
// state for all terminals, terminals can't have own array fo state because
// there is only one popstate event
var save_state = []; // hold objects returned by export_view by history API
Expand Down Expand Up @@ -2897,7 +2900,7 @@
}
};
});
interpreter_object['help'] = function(fn) {
interpreter_object.help = function(fn) {
if (typeof fn == 'undefined') {
self.echo('Available commands: ' + ret.procs.map(function(proc) {
return proc.name;
Expand Down
11 changes: 7 additions & 4 deletions js/jquery.terminal.js
Expand Up @@ -31,7 +31,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Sat, 18 Jun 2016 12:04:40 +0000
* Date: Sun, 19 Jun 2016 09:16:47 +0000
*/

/* TODO:
Expand Down Expand Up @@ -683,6 +683,9 @@
return data;
},
rotate: function() {
if (!data.filter(Boolean).length) {
return;
}
if (data.length === 1) {
return data[0];
} else {
Expand All @@ -694,7 +697,7 @@
if (data[pos]) {
return data[pos];
} else {
this.rotate();
return this.rotate();
}
}
},
Expand Down Expand Up @@ -2642,7 +2645,7 @@
// :: All terminal globals
// -------------------------------------------------------------------------
var requests = []; // for canceling on CTRL+D
var terminals = window.terminals = new Cycle(); // list of terminals global in this scope
var terminals = new Cycle(); // list of terminals global in this scope
// state for all terminals, terminals can't have own array fo state because
// there is only one popstate event
var save_state = []; // hold objects returned by export_view by history API
Expand Down Expand Up @@ -2897,7 +2900,7 @@
}
};
});
interpreter_object['help'] = function(fn) {
interpreter_object.help = function(fn) {
if (typeof fn == 'undefined') {
self.echo('Available commands: ' + ret.procs.map(function(proc) {
return proc.name;
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

0 comments on commit 9916880

Please sign in to comment.