Skip to content

Commit ceb39da

Browse files
committedJul 15, 2020
fix --size variable and cursor site #602
The problem was that the terminal on init calculate size but it use fake terminal added to body because of this it didn't pick up --size from different selectors like '.foo .terminal'
1 parent 7fd692f commit ceb39da

7 files changed

+46
-25
lines changed
 

‎README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
__ / / // / // / _ / _/ // / / / _ / _/ / / \/ / _ \/ /
55
/ / / // / // / ___/ // // / / / ___/ // / / / / /\ / // / /__
66
\___/____ \\__/____/_/ \__ / /_/____/_//_/_/_/_/_/ \/\__\_\___/
7-
\/ /____/ version 2.17.6
7+
\/ /____/ version DEV
88
```
99
http://terminal.jcubic.pl
1010

11-
[![npm](https://img.shields.io/badge/npm-2.17.6-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
12-
![bower](https://img.shields.io/badge/bower-2.17.6-yellow.svg)
13-
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=master&6132f4c5b8aeeac9eacbb9f2d9f2338e9eb76e73)](https://travis-ci.org/jcubic/jquery.terminal)
14-
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=master&5750bf4c2bd025ae34802a8577d09ee0)](https://coveralls.io/github/jcubic/jquery.terminal?branch=master)
11+
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
12+
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
13+
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&7fd692fa1f1919164584f81c368992fde668d8d3)](https://travis-ci.org/jcubic/jquery.terminal)
14+
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&5750bf4c2bd025ae34802a8577d09ee0)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
1515
![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
1616
[![](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded)](https://www.jsdelivr.com/package/npm/jquery.terminal)
1717
[![LICENSE MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jcubic/jquery.terminal/blob/master/LICENSE)
@@ -78,20 +78,20 @@ Include jQuery library, you can use cdn from https://jquery.com/download/
7878
```
7979

8080

81-
Then include js/jquery.terminal-2.17.6.min.js and css/jquery.terminal-2.17.6.min.css
81+
Then include js/jquery.terminal-DEV.min.js and css/jquery.terminal-DEV.min.css
8282

8383
You can grab the files from CDN:
8484

8585
```html
86-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.17.6/js/jquery.terminal.min.js"></script>
87-
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.17.6/css/jquery.terminal.min.css" rel="stylesheet"/>
86+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/js/jquery.terminal.min.js"></script>
87+
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/css/jquery.terminal.min.css" rel="stylesheet"/>
8888
```
8989

9090
or
9191

9292
```html
93-
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.17.6/js/jquery.terminal.min.js"></script>
94-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.17.6/css/jquery.terminal.min.css">
93+
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/js/jquery.terminal.min.js"></script>
94+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/css/jquery.terminal.min.css">
9595
```
9696

9797
If you always want latest version, you can get it from [unpkg](https://unpkg.com/) without specifying version,

‎js/jquery.terminal-2.17.6.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
55
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
66
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
7-
* \/ /____/ version 2.17.6
7+
* \/ /____/ version DEV
88
*
99
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
1010
*
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Tue, 14 Jul 2020 07:54:55 +0000
44+
* Date: Wed, 15 Jul 2020 07:24:17 +0000
4545
*/
4646
/* global define, Map */
4747
/* eslint-disable */
@@ -4452,8 +4452,8 @@
44524452
}
44534453
// -------------------------------------------------------------------------
44544454
$.terminal = {
4455-
version: '2.17.6',
4456-
date: 'Tue, 14 Jul 2020 07:54:55 +0000',
4455+
version: 'DEV',
4456+
date: 'Wed, 15 Jul 2020 07:24:17 +0000',
44574457
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
44584458
color_names: [
44594459
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -9729,6 +9729,9 @@
97299729
self.height(settings.height);
97309730
}
97319731
var char_size = get_char_size(self);
9732+
// this is needed when terminal have selector with --size that is not
9733+
// bare .terminal so fake terminal will not get the proper size #602
9734+
var need_char_size_recalculate = !terminal_ready(self);
97329735
// so it's the same as in TypeScript definition for options
97339736
delete settings.formatters;
97349737
// used to throw error when calling methods on destroyed terminal
@@ -10242,6 +10245,10 @@
1024210245
if (self.is(':visible')) {
1024310246
var width = fill.width();
1024410247
var height = fill.height();
10248+
if (need_char_size_recalculate) {
10249+
need_char_size_recalculate = !terminal_ready(self);
10250+
calculate_char_size();
10251+
}
1024510252
// prevent too many calculations in IE
1024610253
if (old_height !== height || old_width !== width) {
1024710254
self.resize();

‎js/jquery.terminal-2.17.6.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎js/jquery.terminal-src.js

+7
Original file line numberDiff line numberDiff line change
@@ -9729,6 +9729,9 @@
97299729
self.height(settings.height);
97309730
}
97319731
var char_size = get_char_size(self);
9732+
// this is needed when terminal have selector with --size that is not
9733+
// bare .terminal so fake terminal will not get the proper size #602
9734+
var need_char_size_recalculate = !terminal_ready(self);
97329735
// so it's the same as in TypeScript definition for options
97339736
delete settings.formatters;
97349737
// used to throw error when calling methods on destroyed terminal
@@ -10242,6 +10245,10 @@
1024210245
if (self.is(':visible')) {
1024310246
var width = fill.width();
1024410247
var height = fill.height();
10248+
if (need_char_size_recalculate) {
10249+
need_char_size_recalculate = !terminal_ready(self);
10250+
calculate_char_size();
10251+
}
1024510252
// prevent too many calculations in IE
1024610253
if (old_height !== height || old_width !== width) {
1024710254
self.resize();

‎js/jquery.terminal.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
55
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
66
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
7-
* \/ /____/ version 2.17.6
7+
* \/ /____/ version DEV
88
*
99
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
1010
*
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Tue, 14 Jul 2020 07:54:55 +0000
44+
* Date: Wed, 15 Jul 2020 07:24:17 +0000
4545
*/
4646
/* global define, Map */
4747
/* eslint-disable */
@@ -4452,8 +4452,8 @@
44524452
}
44534453
// -------------------------------------------------------------------------
44544454
$.terminal = {
4455-
version: '2.17.6',
4456-
date: 'Tue, 14 Jul 2020 07:54:55 +0000',
4455+
version: 'DEV',
4456+
date: 'Wed, 15 Jul 2020 07:24:17 +0000',
44574457
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
44584458
color_names: [
44594459
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -9729,6 +9729,9 @@
97299729
self.height(settings.height);
97309730
}
97319731
var char_size = get_char_size(self);
9732+
// this is needed when terminal have selector with --size that is not
9733+
// bare .terminal so fake terminal will not get the proper size #602
9734+
var need_char_size_recalculate = !terminal_ready(self);
97329735
// so it's the same as in TypeScript definition for options
97339736
delete settings.formatters;
97349737
// used to throw error when calling methods on destroyed terminal
@@ -10242,6 +10245,10 @@
1024210245
if (self.is(':visible')) {
1024310246
var width = fill.width();
1024410247
var height = fill.height();
10248+
if (need_char_size_recalculate) {
10249+
need_char_size_recalculate = !terminal_ready(self);
10250+
calculate_char_size();
10251+
}
1024510252
// prevent too many calculations in IE
1024610253
if (old_height !== height || old_width !== width) {
1024710254
self.resize();

‎js/jquery.terminal.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎js/jquery.terminal.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.