Skip to content

Commit

Permalink
add new method geometry to the API #637
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 3, 2021
1 parent f62c871 commit e8b59ab
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 2.21.0
### Features
* add wrap and keepWords option to less [#641](https://github.com/jcubic/jquery.terminal/issues/641)
* add new method geometry to the API [#637](https://github.com/jcubic/jquery.terminal/issues/637)
### Bugfix
* fix parsing JSON code inside strings [#642](https://github.com/jcubic/jquery.terminal/issues/642)

Expand Down
18 changes: 16 additions & 2 deletions js/jquery.terminal-2.20.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 03 Feb 2021 15:11:46 +0000
* Date: Wed, 03 Feb 2021 15:24:28 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4486,7 +4486,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 03 Feb 2021 15:11:46 +0000',
date: 'Wed, 03 Feb 2021 15:24:28 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -8618,6 +8618,20 @@
return command_line.history();
},
// -------------------------------------------------------------
// :: Return size of the terminal instance
// -------------------------------------------------------------
geometry: function() {
return {
terminal: {
width: old_width,
height: old_height
},
char: char_size,
cols: this.cols(),
rows: this.rows()
};
},
// -------------------------------------------------------------
// :: toggle recording of history state
// -------------------------------------------------------------
history_state: function(toggle) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.20.2.min.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -8618,6 +8618,20 @@
return command_line.history();
},
// -------------------------------------------------------------
// :: Return size of the terminal instance
// -------------------------------------------------------------
geometry: function() {
return {
terminal: {
width: old_width,
height: old_height
},
char: char_size,
cols: this.cols(),
rows: this.rows()
};
},
// -------------------------------------------------------------
// :: toggle recording of history state
// -------------------------------------------------------------
history_state: function(toggle) {
Expand Down
12 changes: 12 additions & 0 deletions js/jquery.terminal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ declare namespace JQueryTerminal {
rest: string;
};

type size = {
width: number,
height: number
};
interface geometry {
terminal: size;
char: size;
cols: number;
rows: number;
}

type AnsiColorType = {
black: string;
red: string;
Expand Down Expand Up @@ -605,6 +616,7 @@ interface JQueryTerminal<TElement = HTMLElement> extends JQuery<TElement> {
resume(): JQueryTerminal;
cols(): number;
rows(): number;
geometry(): JQueryTerminal.geometry;
history(): JQueryTerminal.History<string>;
history_state(toggle: boolean): JQueryTerminal;
clear_history_state(): JQueryTerminal;
Expand Down
18 changes: 16 additions & 2 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 03 Feb 2021 15:11:46 +0000
* Date: Wed, 03 Feb 2021 15:24:28 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4486,7 +4486,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 03 Feb 2021 15:11:46 +0000',
date: 'Wed, 03 Feb 2021 15:24:28 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -8618,6 +8618,20 @@
return command_line.history();
},
// -------------------------------------------------------------
// :: Return size of the terminal instance
// -------------------------------------------------------------
geometry: function() {
return {
terminal: {
width: old_width,
height: old_height
},
char: char_size,
cols: this.cols(),
rows: this.rows()
};
},
// -------------------------------------------------------------
// :: toggle recording of history state
// -------------------------------------------------------------
history_state: function(toggle) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit e8b59ab

Please sign in to comment.