Skip to content

Commit

Permalink
make text on hover links when background is transparent #990
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 22, 2025
1 parent f122078 commit f14c3b6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 48 deletions.
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&1687bf76f899dace3e9c668c6d0414bf)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&fd1428cc07b47e9b924bc0bef4da0f89)](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
43 changes: 1 addition & 42 deletions __tests__/__snapshots__/terminal.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,48 +72,7 @@ exports[`Terminal plugin interprer return should rener promise of array 1`] = `
"foo" "bar" 10"
`;

exports[`Terminal plugin jQuery Terminal methods echo should show error in sync echo 1`] = `
"[[;;;terminal-error][ECHO]: x is not defined]
[[;;;terminal-error;ReferenceError: x is not defined]ReferenceError: x is not defined]
[[;;;terminal-error; at jQuery.fn.init.x (/home/kuba/projects/jcubic/terminal/repo/__tests__/terminal.spec.js:6953:21)] at jQuery.fn.init.x (/home/kuba/projects/jcubic/terminal/repo/__tests__/terminal.spec.js:6953:21]
[[;;;terminal-error; at jQuery.fn.init.x (/home/kuba/projects/jcubic/terminal/repo/__tests__/terminal.spec.js:6953:21)])]
[[;;;terminal-error; at value (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:12273:25)] at value (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:12273:25)]
[[;;;terminal-error; at stringify_value (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:8561:30)] at stringify_value (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:8561:30)]
[[;;;terminal-error; at process_line (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11299:40)] at process_line (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11299:40)]
[[;;;terminal-error; at callback (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:1208:24)] at callback (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:1208:24)]
[[;;;terminal-error; at unpromise (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11280:25)] at unpromise (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11280:25)]
[[;;;terminal-error; at jQuery.fn.init.echo (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11359:21)] at jQuery.fn.init.echo (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11359]
[[;;;terminal-error; at jQuery.fn.init.echo (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:11359:21)]:21)]
[[;;;terminal-error; at jQuery.fn.init.apply [as echo] (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:12093:32)] at jQuery.fn.init.apply [as echo] (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-s]
[[;;;terminal-error; at jQuery.fn.init.apply [as echo] (/home/kuba/projects/jcubic/terminal/repo/js/jquery.terminal-src.js:12093:32)]rc.js:12093:32)]
[[;;;terminal-error; at Object.echo (/home/kuba/projects/jcubic/terminal/repo/__tests__/terminal.spec.js:6952:22)] at Object.echo (/home/kuba/projects/jcubic/terminal/repo/__tests__/terminal.spec.js:6952:22)]
[[;;;terminal-error; at Promise.then.completed (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/utils.js:298:28)] at Promise.then.completed (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/bui]
[[;;;terminal-error; at Promise.then.completed (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/utils.js:298:28)]ld/utils.js:298:28)]
[[;;;terminal-error; at new Promise (<anonymous>)] at new Promise (<anonymous>)]
[[;;;terminal-error; at callAsyncCircusFn (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/utils.js:231:10)] at callAsyncCircusFn (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/ut]
[[;;;terminal-error; at callAsyncCircusFn (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/utils.js:231:10)]ils.js:231:10)]
[[;;;terminal-error; at _callCircusTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:316:40)] at _callCircusTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.]
[[;;;terminal-error; at _callCircusTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:316:40)]js:316:40)]
[[;;;terminal-error; at _runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:252:3)] at _runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:252:]
[[;;;terminal-error; at _runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:252:3)]3)]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:126:9)] at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:126:9)]build/run.js:126:9)]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)] at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)]build/run.js:121:9)]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)] at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)]build/run.js:121:9)]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)] at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/]
[[;;;terminal-error; at _runTestsForDescribeBlock (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:121:9)]build/run.js:121:9)]
[[;;;terminal-error; at run (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:71:3)] at run (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/run.js:71:3)]
[[;;;terminal-error; at runAndTransformResultsToJestFormat (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)] at runAndTransformResultsToJestFormat (/home/kuba/projects/jcubic/terminal/repo/node_modules/jes]
[[;;;terminal-error; at runAndTransformResultsToJestFormat (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)]t-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)]
[[;;;terminal-error; at jestAdapter (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)] at jestAdapter (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/legacy-c]
[[;;;terminal-error; at jestAdapter (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)]ode-todo-rewrite/jestAdapter.js:79:19)]
[[;;;terminal-error; at runTestInternal (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runTest.js:367:16)] at runTestInternal (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runT]
[[;;;terminal-error; at runTestInternal (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runTest.js:367:16)]est.js:367:16)]
[[;;;terminal-error; at runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runTest.js:444:34)] at runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runTest.js:4]
[[;;;terminal-error; at runTest (/home/kuba/projects/jcubic/terminal/repo/node_modules/jest-runner/build/runTest.js:444:34)]44:34)]"
`;
exports[`Terminal plugin jQuery Terminal methods echo should show error in sync echo 1`] = `"[[;;;terminal-error]&#91;ECHO&#93;: x is not defined]"`;

exports[`Terminal plugin jQuery Terminal methods exec should invoke array of commands when each command pause terminal 1`] = `
"> exec_async_array
Expand Down
3 changes: 2 additions & 1 deletion __tests__/terminal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6952,7 +6952,8 @@ describe('Terminal plugin', function() {
term.echo(function() {
x();
});
expect(term.get_output()).toMatchSnapshot();
const error = term.get_output().split('\n').shift();
expect(error).toMatchSnapshot();
});
});
describe('error', function() {
Expand Down
10 changes: 10 additions & 0 deletions css/jquery.terminal-src.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ body.full-screen-terminal {
color: var(--base-background, #000) !important;
text-decoration: none;
}
/*
* make text on hover links visible when background is transparent #990
*/
@container style(--background: transparent) {
.terminal .terminal-output > :not(.raw) a[href]:hover,
.cmd a[href]:hover,
.terminal.external a[href]:hover {
--base-background: black;
}
}
.terminal .terminal-output > :not(.raw) a[href] span,
.cmd a[href] span,
.terminal.external a[href] span {
Expand Down
12 changes: 11 additions & 1 deletion css/jquery.terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2010-2025 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Sat, 22 Feb 2025 14:32:54 +0000
* Date: Sat, 22 Feb 2025 17:18:23 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd-prompt, .cmd-prompt div {
Expand Down Expand Up @@ -184,6 +184,16 @@ body.full-screen-terminal {
color: var(--base-background, #000) !important;
text-decoration: none;
}
/*
* make text on hover links visible when background is transparent #990
*/
@container style(--background: transparent) {
.terminal .terminal-output > :not(.raw) a[href]:hover,
.cmd a[href]:hover,
.terminal.external a[href]:hover {
--base-background: black;
}
}
.terminal .terminal-output > :not(.raw) a[href] span,
.cmd a[href] span,
.terminal.external a[href] span {
Expand Down
4 changes: 2 additions & 2 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.

0 comments on commit f14c3b6

Please sign in to comment.