Skip to content

Commit

Permalink
update terminal signature #972
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 21, 2024
1 parent 0dae81b commit 424bd56
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* allow using Object URLs in links [#982](https://github.com/jcubic/jquery.terminal/issues/982)
* experimental `--cols` CSS variable [#956](https://github.com/jcubic/jquery.terminal/issues/956)
* add `terminal::lines()` [#966](https://github.com/jcubic/jquery.terminal/issues/966)
* add small ASCII Art to signature [#972](https://github.com/jcubic/jquery.terminal/issues/972)
### Bugfix
* fix `terminal::login()` when user already authenticated [#980](https://github.com/jcubic/jquery.terminal/issues/980)
* improve mobile support
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![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&1620e1f399d74967a5e6292177558e0a)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&f6f4cbb4305eab7c6a36637dff2538c9)](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
4 changes: 2 additions & 2 deletions __tests__/terminal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6245,14 +6245,14 @@ describe('Terminal plugin', function() {
function max_length() {
var lines = term.signature().split('\n');
return Math.max.apply(null, lines.map(function(line) {
return line.length;
return $.terminal.length(line);
}));
}
it('should return space', function() {
expect(term.signature()).toEqual('');
});
it('should return proper max length of signature', function() {
var numbers = {20: 20, 36: 33, 60: 56, 70: 66, 100: 75};
var numbers = {20: 20, 36: 35, 70: 66, 100: 75};
Object.keys(numbers).forEach(function(numChars) {
var length = numbers[numChars];
term.option('numChars', numChars);
Expand Down
17 changes: 13 additions & 4 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -7496,13 +7496,22 @@
var reg = new RegExp(' {' + version_string.length + '}$');
var name_ver = 'jQuery Terminal Emulator' +

Check failure on line 7497 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

'name_ver' is assigned a value but never used
(version_set ? version_string : '');
function small_string(name) {
return '(c) 2011-2024 [[!;;;;https://jcubic.pl/me]' + name + ']';

Check failure on line 7500 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 12
}
// -----------------------------------------------------------------------
// :: Terminal Signatures
// -----------------------------------------------------------------------
var signatures = [
['jQuery Terminal', '(c) 2011-2024 jcubic'],
[name_ver, copyright.replace(/^Copyright | *<.*>/g, '')],
[name_ver, copyright.replace(/^Copyright /, '')],
['jQuery Terminal', small_string('jcubic')],
[' __ ____ ________',
' / // _ /__ ___/__ ___ ______',

Check failure on line 7508 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
' __ / // // / / // _ // _// /',

Check failure on line 7509 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
'/ / // // / / // ___// / / / / /',

Check failure on line 7510 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
'\\___//____ \\ /_//____//_/ /_/ /_/',

Check failure on line 7511 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
' \\/ '

Check failure on line 7512 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
.replace(reg, ' ') + version_string,

Check failure on line 7513 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 16 spaces but found 13
small_string('Jakub T. Jankiewicz')],

Check failure on line 7514 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 9
[
' _______ ________ __',
' / / _ /_ ____________ _/__ ___/______________ _____ / /',
Expand Down Expand Up @@ -10533,7 +10542,7 @@
var cols = self.cols();
for (var i = signatures.length; i--;) {
var lengths = signatures[i].map(function(line) {
return line.length;
return $.terminal.length(line);
});
if (Math.max.apply(null, lengths) <= cols) {
return signatures[i].join('\n').replace(/\s+$/m, '') + '\n';
Expand Down
21 changes: 15 additions & 6 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: Thu, 21 Nov 2024 14:33:45 +0000
* Date: Thu, 21 Nov 2024 14:51:40 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5345,7 +5345,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Thu, 21 Nov 2024 14:33:45 +0000',
date: 'Thu, 21 Nov 2024 14:51:40 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -7496,13 +7496,22 @@
var reg = new RegExp(' {' + version_string.length + '}$');
var name_ver = 'jQuery Terminal Emulator' +
(version_set ? version_string : '');
function small_string(name) {
return '(c) 2011-2024 [[!;;;;https://jcubic.pl/me]' + name + ']';
}
// -----------------------------------------------------------------------
// :: Terminal Signatures
// -----------------------------------------------------------------------
var signatures = [
['jQuery Terminal', '(c) 2011-2024 jcubic'],
[name_ver, copyright.replace(/^Copyright | *<.*>/g, '')],
[name_ver, copyright.replace(/^Copyright /, '')],
['jQuery Terminal', small_string('jcubic')],
[' __ ____ ________',
' / // _ /__ ___/__ ___ ______',
' __ / // // / / // _ // _// /',
'/ / // // / / // ___// / / / / /',
'\\___//____ \\ /_//____//_/ /_/ /_/',
' \\/ '
.replace(reg, ' ') + version_string,
small_string('Jakub T. Jankiewicz')],
[
' _______ ________ __',
' / / _ /_ ____________ _/__ ___/______________ _____ / /',
Expand Down Expand Up @@ -10533,7 +10542,7 @@
var cols = self.cols();
for (var i = signatures.length; i--;) {
var lengths = signatures[i].map(function(line) {
return line.length;
return $.terminal.length(line);
});
if (Math.max.apply(null, lengths) <= cols) {
return signatures[i].join('\n').replace(/\s+$/m, '') + '\n';
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 424bd56

Please sign in to comment.