Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 13, 2024
1 parent eae60c1 commit 4735d6c
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 59 deletions.
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -114,8 +114,6 @@ eslint:
$(ESLINT) js/pipe.js
$(ESLINT) js/autocomplete_menu.js
$(ESLINT) js/echo_newline.js
$(ESLINT) js/forms.js
$(ESLINT) js/animation.js

skipped_tests:
@! grep -E $(skip_re) __tests__/terminal.spec.js
Expand Down
22 changes: 11 additions & 11 deletions README.md
@@ -1,14 +1,14 @@
<h1 align="center">
<img src="https://github.com/jcubic/jquery.terminal/blob/master/assets/ascii_art.svg?raw=true&ver=2.39.0"
<img src="https://github.com/jcubic/jquery.terminal/blob/devel/assets/ascii_art.svg?raw=true&ver=DEV"
alt="ASCII Art that represent text jQuery Terminal - JavaScript Library for Web Based Terminal Emulators" />
</h1>

[JavaScript Library for Web Based Terminal Emulators](https://terminal.jcubic.pl)

[![npm](https://img.shields.io/badge/npm-2.39.0-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-2.39.0-yellow.svg)
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=master&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=master&998c1c8b8a57dd88c9cf5a40049e8bf2)](https://coveralls.io/github/jcubic/jquery.terminal?branch=master)
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&998c1c8b8a57dd88c9cf5a40049e8bf2)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
![NPM Downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded&n=1)](https://www.jsdelivr.com/package/npm/jquery.terminal)
[![Paid Support](https://img.shields.io/badge/paid-support-354465.svg)](https://support.jcubic.pl/)
Expand Down Expand Up @@ -87,7 +87,7 @@ You can test current version at this URL:

or if it doesn't use latest version (because of jsDelivr cache) you can force it with this URL:

* [https://jcubic.github.io/jquery.terminal/?ver=2.39.0](https://jcubic.github.io/jquery.terminal/?ver=2.39.0)
* [https://jcubic.github.io/jquery.terminal/?ver=DEV](https://jcubic.github.io/jquery.terminal/?ver=DEV)

And development version using:

Expand All @@ -106,20 +106,20 @@ or use jsDelivr:

```

Then include js/jquery.terminal-2.39.0.min.js and css/jquery.terminal-2.39.0.min.css
Then include js/jquery.terminal-DEV.min.js and css/jquery.terminal-DEV.min.css

You can grab the files from CDN:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.39.0/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.39.0/css/jquery.terminal.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/css/jquery.terminal.min.css" rel="stylesheet"/>
```

or

```html
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.39.0/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.39.0/css/jquery.terminal.min.css"/>
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/css/jquery.terminal.min.css"/>
```

If you always want latest version, you can get it from [unpkg](https://unpkg.com/) without specifying version,
Expand Down
2 changes: 1 addition & 1 deletion css/emoji.css

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

12 changes: 8 additions & 4 deletions css/jquery.terminal-2.39.0.css
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2023 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Sat, 02 Mar 2024 17:57:52 +0000
* Date: Wed, 13 Mar 2024 13:11:10 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd-prompt, .cmd-prompt div {
Expand Down Expand Up @@ -101,6 +101,11 @@ body.terminal, body.full-screen-terminal {
body.full-screen-terminal .terminal {
height: 100%;
}
body.full-screen-terminal {
height: 100%;
height: 100dvh;
height: calc(var(--terminal-force-height) * 1px);
}
.terminal > div.terminal-fill {
min-height: 100%;
height: 100%;
Expand Down Expand Up @@ -1115,17 +1120,16 @@ terminal .terminal-output > div {
display: inline-block;
}
.cmd-editable {
position: absolute;
position: fixed;
top: 0;
top: calc(var(--terminal-y, var(--cmd-y, 0)) + var(--terminal-scroll, 0) * 1px);
right: 0;
left: 0;
bottom: 0;
bottom: calc(var(--terminal-scroll, 0) * -1px);
z-index: 500;
color: transparent;
background: transparent;
opacity: 0.01;
outline: 0px solid transparent;
}
/* Scrollbar */
.terminal-scroller::-webkit-scrollbar {
Expand Down
6 changes: 3 additions & 3 deletions css/jquery.terminal-2.39.0.min.css

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions css/jquery.terminal.css
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2023 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Sat, 02 Mar 2024 17:57:52 +0000
* Date: Wed, 13 Mar 2024 13:11:10 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd-prompt, .cmd-prompt div {
Expand Down Expand Up @@ -101,6 +101,11 @@ body.terminal, body.full-screen-terminal {
body.full-screen-terminal .terminal {
height: 100%;
}
body.full-screen-terminal {
height: 100%;
height: 100dvh;
height: calc(var(--terminal-force-height) * 1px);
}
.terminal > div.terminal-fill {
min-height: 100%;
height: 100%;
Expand Down Expand Up @@ -1115,17 +1120,16 @@ terminal .terminal-output > div {
display: inline-block;
}
.cmd-editable {
position: absolute;
position: fixed;
top: 0;
top: calc(var(--terminal-y, var(--cmd-y, 0)) + var(--terminal-scroll, 0) * 1px);
right: 0;
left: 0;
bottom: 0;
bottom: calc(var(--terminal-scroll, 0) * -1px);
z-index: 500;
color: transparent;
background: transparent;
opacity: 0.01;
outline: 0px solid transparent;
}
/* Scrollbar */
.terminal-scroller::-webkit-scrollbar {
Expand Down
6 changes: 3 additions & 3 deletions css/jquery.terminal.min.css

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

49 changes: 39 additions & 10 deletions js/jquery.terminal-2.39.0.js
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.39.0
* \/ /____/ version DEV
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
Expand Down Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Tue, 13 Feb 2024 21:18:12 +0000
* Date: Wed, 13 Mar 2024 13:11:10 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -2368,7 +2368,9 @@
}
var tmp = command;
// fix scroll the page where there is no scrollbar
clip.$node.blur();
if (!is_mobile) {
clip.$node.blur();
}
history.reset();

// for next input event on firefox/android with google keyboard
Expand All @@ -2388,7 +2390,9 @@
}
self.set('');
clip.val('');
clip.$node.focus();
if (!is_mobile) {
clip.$node.focus();
}
return false;
},
'SHIFT+ENTER': function() {
Expand Down Expand Up @@ -5284,9 +5288,24 @@
}
}
// -------------------------------------------------------------------------
// :: handler to trigger when window change size. The most important
// :: is that it's triggers when virtual keyboard is toggled
// -------------------------------------------------------------------------
function on_height_change(callback) {
var height = window.visualViewport.height;
callback(height);
window.visualViewport.addEventListener('resize', function() {
var newHeight = window.visualViewport.height;
if (height !== newHeight) {
height = newHeight;
callback(height);
}
});
}
// -------------------------------------------------------------------------
$.terminal = {
version: '2.39.0',
date: 'Tue, 13 Feb 2024 21:18:12 +0000',
version: 'DEV',
date: 'Wed, 13 Mar 2024 13:11:10 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -10070,7 +10089,7 @@
// :: Return size of the terminal instance
// -------------------------------------------------------------
geometry: function() {
const padding = get_padding();
var padding = get_padding();
return {
terminal: {
padding: {
Expand Down Expand Up @@ -10630,9 +10649,9 @@
'--terminal-height': self.height(),
'--terminal-x': offset.left - self_offset.left,
'--terminal-y': offset.top - self_offset.top,
'--terminal-scroll': self.prop('scrollTop')
'--terminal-scroll': scroller.prop('scrollTop')
});
if (enabled) {
if (enabled && !is_mobile) {
// Firefox won't reflow the cursor automatically, so
// hide it briefly then reshow it
cmd_cursor.hide();
Expand Down Expand Up @@ -12021,6 +12040,9 @@
if (!enabled) {
clip.focus();
self.focus();
setTimeout(function() {
self.scroll_to_bottom();
}, 100);
} else {
clip.blur();
self.disable();
Expand All @@ -12031,6 +12053,13 @@
start = null;
});
})();
if ('visualViewport' in window) {
on_height_change(function(height) {
css(document.documentElement, {
'--terminal-force-height': height
});
});
}
} else {
// work weird on mobile
$win.on('focus.terminal_' + self.id(), focus_terminal).
Expand Down Expand Up @@ -12536,7 +12565,7 @@
ret = settings.touchscroll(event, delta, self);
}
css(self[0], {
'--terminal-scroll': self.prop('scrollTop')
'--terminal-scroll': scroller.prop('scrollTop')
});
if (ret === true) {
return;
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal-2.39.0.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal-src.js
Expand Up @@ -10089,7 +10089,7 @@
// :: Return size of the terminal instance
// -------------------------------------------------------------
geometry: function() {
const padding = get_padding();
var padding = get_padding();
return {
terminal: {
padding: {
Expand Down

0 comments on commit 4735d6c

Please sign in to comment.