Skip to content

Commit

Permalink
fix paused terminal when echo broken image
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Apr 29, 2024
1 parent 18899a6 commit a9d9382
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
## 2.41.1
### Bugfix
* fix paused terminal when echo broken image
* fix returning String instance from interpreter

## 2.41.0
Expand Down
21 changes: 15 additions & 6 deletions js/jquery.terminal-2.41.0.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Mon, 29 Apr 2024 15:50:20 +0000
* Date: Mon, 29 Apr 2024 16:19:54 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5312,7 +5312,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.41.0',
date: 'Mon, 29 Apr 2024 15:50:20 +0000',
date: 'Mon, 29 Apr 2024 16:19:54 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -7355,6 +7355,10 @@
return get_type(object) === 'function';
}
// -----------------------------------------------------------------------
function is_string(object) {
return get_type(object) === 'string';
}
// -----------------------------------------------------------------------
function is_object(object) {
return object && typeof object === 'object';
}
Expand Down Expand Up @@ -7403,6 +7407,9 @@
if (Array.isArray(object)) {
return 'array';
}
if (object instanceof String) {
return 'string';
}
if (typeof object === 'object') {
return 'object';
}
Expand Down Expand Up @@ -7723,7 +7730,7 @@
if (render(object)) {
return;
}
if (typeof object === 'string') {
if (is_string(object)) {
self.echo(object);
} else if (is_array(object)) {
self.echo($.map(object, function(object) {
Expand Down Expand Up @@ -8497,10 +8504,9 @@
// signature have ascii art so it's not suite for screen readers
self.echo(self.signature, {finalize: a11y_hide, formatters: false});
} else if (settings.greetings) {
var type = typeof settings.greetings;
if (type === 'string' || settings.greetings instanceof String) {
if (is_string(settings.greetings)) {
self.echo(settings.greetings);
} else if (type === 'function') {
} else if (is_function(settings.greetings)) {
self.echo(function() {
try {
var defer = new $.Deferred();
Expand Down Expand Up @@ -10870,6 +10876,9 @@
node.on_load({
error: function(element) {
element.replaceWith(use_broken_image);
if (should_pause) {
self.resume();
}
},
done: function(has_elements) {
if (has_elements && should_pause) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.41.0.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions js/jquery.terminal-src.js
Expand Up @@ -10876,6 +10876,9 @@
node.on_load({
error: function(element) {
element.replaceWith(use_broken_image);
if (should_pause) {
self.resume();
}
},
done: function(has_elements) {
if (has_elements && should_pause) {
Expand Down
21 changes: 15 additions & 6 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Mon, 29 Apr 2024 15:50:20 +0000
* Date: Mon, 29 Apr 2024 16:19:54 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5312,7 +5312,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.41.0',
date: 'Mon, 29 Apr 2024 15:50:20 +0000',
date: 'Mon, 29 Apr 2024 16:19:54 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -7355,6 +7355,10 @@
return get_type(object) === 'function';
}
// -----------------------------------------------------------------------
function is_string(object) {
return get_type(object) === 'string';
}
// -----------------------------------------------------------------------
function is_object(object) {
return object && typeof object === 'object';
}
Expand Down Expand Up @@ -7403,6 +7407,9 @@
if (Array.isArray(object)) {
return 'array';
}
if (object instanceof String) {
return 'string';
}
if (typeof object === 'object') {
return 'object';
}
Expand Down Expand Up @@ -7723,7 +7730,7 @@
if (render(object)) {
return;
}
if (typeof object === 'string') {
if (is_string(object)) {
self.echo(object);
} else if (is_array(object)) {
self.echo($.map(object, function(object) {
Expand Down Expand Up @@ -8497,10 +8504,9 @@
// signature have ascii art so it's not suite for screen readers
self.echo(self.signature, {finalize: a11y_hide, formatters: false});
} else if (settings.greetings) {
var type = typeof settings.greetings;
if (type === 'string' || settings.greetings instanceof String) {
if (is_string(settings.greetings)) {
self.echo(settings.greetings);
} else if (type === 'function') {
} else if (is_function(settings.greetings)) {
self.echo(function() {
try {
var defer = new $.Deferred();
Expand Down Expand Up @@ -10870,6 +10876,9 @@
node.on_load({
error: function(element) {
element.replaceWith(use_broken_image);
if (should_pause) {
self.resume();
}
},
done: function(has_elements) {
if (has_elements && should_pause) {
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 a9d9382

Please sign in to comment.