Skip to content

Commit

Permalink
merge with devel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jul 1, 2020
2 parents 7c2c3c4 + 81ff454 commit f0331a2
Show file tree
Hide file tree
Showing 20 changed files with 4,462 additions and 3,127 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.17.3
### Bugfix
* fix for font-family wildcard css rule
* fix cursor on scrollbar
* fix broken html with wide characters without formatting
* fix jumping to address bar on CTRL+L [#587](https://github.com/jcubic/jquery.terminal/issues/587)
* fix issue in less when only one image get rendered [#583](https://github.com/jcubic/jquery.terminal/issues/583)
* fix jumping on focus on mobile when terminal content scrolled down [#572](https://github.com/jcubic/jquery.terminal/issues/572)
* fix detecting iPad iOS 13as mobile [#589](https://github.com/jcubic/jquery.terminal/issues/589)
* fix return false from onPaste to disable insert from clipboard
* fix paste in command mode of less plugin [#581](https://github.com/jcubic/jquery.terminal/issues/581)
* fix jumping when click near bottom or left edge [#592](https://github.com/jcubic/jquery.terminal/issues/592)

## 2.17.2
### Bugfix
* fix cursor on strings in prism
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__ / / // / // / _ / _/ // / / / _ / _/ / / \/ / _ \/ /
/ / / // / // / ___/ // // / / / ___/ // / / / / /\ / // / /__
\___/____ \\__/____/_/ \__ / /_/____/_//_/_/_/_/_/ \/\__\_\___/
\/ /____/ version 2.17.2
\/ /____/ version DEV
```
http://terminal.jcubic.pl

Expand Down Expand Up @@ -78,20 +78,20 @@ Include jQuery library, you can use cdn from https://jquery.com/download/
```


Then include js/jquery.terminal-2.17.2.min.js and css/jquery.terminal-2.17.2.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.17.2/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.17.2/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.17.2/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.17.2/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 __tests__/__snapshots__/terminal.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exports[`Terminal utils $.terminal.format should handle emails 1`] = `"<a href=\

exports[`Terminal utils $.terminal.format should handle emails 2`] = `"<a href=\\"mailto:[email protected]\\" tabindex=\\"1000\\" data-text>j</a><a href=\\"mailto:[email protected]\\" tabindex=\\"1000\\" data-text>[email protected]</a>"`;

exports[`Terminal utils $.terminal.format should handle wider characters without formatting 1`] = `"<span style=\\"width: 24ch\\" data-text=\\"<span style=\\"width: 24ch\\"><span style=\\"width: 2ch\\">タ</span><span style=\\"width: 2ch\\">ー</span><span style=\\"width: 2ch\\">ミ</span><span style=\\"width: 2ch\\">ナ</span><span style=\\"width: 2ch\\">ル</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">ィ</span><span style=\\"width: 2ch\\">ン</span><span style=\\"width: 2ch\\">ド</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">は</span><span style=\\"width: 2ch\\">黒</span></span>\\"><span style=\\"width: 24ch\\"><span style=\\"width: 2ch\\">タ</span><span style=\\"width: 2ch\\">ー</span><span style=\\"width: 2ch\\">ミ</span><span style=\\"width: 2ch\\">ナ</span><span style=\\"width: 2ch\\">ル</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">ィ</span><span style=\\"width: 2ch\\">ン</span><span style=\\"width: 2ch\\">ド</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">は</span><span style=\\"width: 2ch\\">黒</span></span></span><span style=\\"width: 4ch\\" data-text=\\"です\\"><span><span style=\\"width: 4ch\\"><span style=\\"width: 2ch\\">で</span><span style=\\"width: 2ch\\">す</span></span></span></span>"`;
exports[`Terminal utils $.terminal.format should handle wider characters without formatting 1`] = `"<span style=\\"width: 24ch\\" data-text=\\"ターミナルウィンドウは黒\\"><span style=\\"width: 24ch\\"><span style=\\"width: 2ch\\">タ</span><span style=\\"width: 2ch\\">ー</span><span style=\\"width: 2ch\\">ミ</span><span style=\\"width: 2ch\\">ナ</span><span style=\\"width: 2ch\\">ル</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">ィ</span><span style=\\"width: 2ch\\">ン</span><span style=\\"width: 2ch\\">ド</span><span style=\\"width: 2ch\\">ウ</span><span style=\\"width: 2ch\\">は</span><span style=\\"width: 2ch\\">黒</span></span></span><span style=\\"width: 4ch\\" data-text=\\"です\\"><span><span style=\\"width: 4ch\\"><span style=\\"width: 2ch\\">で</span><span style=\\"width: 2ch\\">す</span></span></span></span>"`;
exports[`Terminal utils $.terminal.format should not allow attributes 1`] = `"<span data-text=\\"foo\\"><span>foo</span></span>"`;
Expand Down
10 changes: 9 additions & 1 deletion __tests__/terminal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ describe('Terminal utils', function() {
var js = "javascript".split('').map(function(chr) {
return '&#' + chr.charCodeAt(0) + ';';
}).join('');
var warn = console.warn;
console.warn = jest.fn();
var tests = [
[
"[[!;;;;javascript:alert('x')]xss]", {},
Expand All @@ -935,6 +937,8 @@ describe('Terminal utils', function() {
var output = $.terminal.format(spec[0], spec[1]);
expect(output).toEqual(spec[2]);
});
expect(count(console.warn)).toEqual(3);
console.warn = warn;
});
it('should add nofollow', function() {
var input = '[[!;;]https://terminal.jcubic.pl]';
Expand Down Expand Up @@ -2184,7 +2188,7 @@ describe('Terminal utils', function() {
});
it('should render broken image', async function() {
term.less('xxx\n[[@;;;;error.jpg]]\nxxx');
await delay(100);
await delay(300);
var err = term.find('.terminal-broken-image');
expect(err.length).toEqual(1);
expect(err.text()).toEqual(nbsp('[BROKEN IMAGE]'));
Expand Down Expand Up @@ -5622,8 +5626,12 @@ describe('Terminal plugin', function() {
});
it('should not execute methods', function() {
spy(term, 'clear');
var warn = console.warn;
console.warn = jest.fn();
term.echo('bar');
term.echo('[[ terminal::clear() ]]', { invokeMethods: false });
expect(count(console.warn)).toEqual(1);
console.warn = warn;
term.echo('[[ foo ]]', { invokeMethods: false });
expect(interpreter.foo).toHaveBeenCalled();
expect(a0(term.find('.terminal-output').text())).toEqual('bar');
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.

23 changes: 17 additions & 6 deletions css/jquery.terminal-2.17.2.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.17.2
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2020 Jakub Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Thu, 11 Jun 2020 19:20:15 +0000
* Date: Sun, 28 Jun 2020 15:36:54 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd-prompt, .cmd-prompt div {
Expand Down Expand Up @@ -206,7 +206,10 @@ body.full-screen-terminal .terminal {
}
.terminal,
.terminal-output > :not(.raw),
.cmd {
.terminal-output > :not(.raw) span,
.terminal-output > :not(.raw) a,
.cmd,
.cmd span {
font-family: monospace;
/*font-family: FreeMono, monospace; this don't work on Android */
font-size: 12px;
Expand Down Expand Up @@ -247,7 +250,6 @@ body.full-screen-terminal .terminal {

.terminal, .cmd {
box-sizing: border-box;
cursor: text;
}
.cmd .cmd-cursor span:not(.token):not(.inverted) {
color: inherit;
Expand Down Expand Up @@ -672,9 +674,12 @@ terminal .terminal-output > div {
pointer-events: none;
box-sizing: border-box;
}
.terminal, .terminal .terminal-fill {
.terminal, .terminal .terminal-fill, .cmd-editable {
padding: 10px;
}
.cmd-editable {
padding-top: 0;
}
/* padding added as margin to .cmd to fix FireFox bug see: https://stackoverflow.com/q/29986977/387194 */
.terminal {
padding-bottom: 0;
Expand Down Expand Up @@ -943,15 +948,21 @@ terminal .terminal-output > div {
.terminal-mobile.terminal-less .terminal-output a, .cmd-editable {
pointer-events: visible;
}
.cmd-editable::before {
content: attr(data-cmd-prompt);
display: inline-block;
}
.cmd-editable {
position: absolute;
top: 0;
top: calc(var(--terminal-y, var(--cmd-y, 0)) * 1px);
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;
}
.terminal::-webkit-scrollbar {
Expand Down
6 changes: 3 additions & 3 deletions css/jquery.terminal-2.17.2.min.css

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions css/jquery.terminal-src.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ body.full-screen-terminal .terminal {
}
.terminal,
.terminal-output > :not(.raw),
.cmd {
.terminal-output > :not(.raw) span,
.terminal-output > :not(.raw) a,
.cmd,
.cmd span {
font-family: monospace;
/*font-family: FreeMono, monospace; this don't work on Android */
font-size: 12px;
Expand Down Expand Up @@ -247,7 +250,6 @@ body.full-screen-terminal .terminal {

.terminal, .cmd {
box-sizing: border-box;
cursor: text;
}
.cmd .cmd-cursor span:not(.token):not(.inverted) {
color: inherit;
Expand Down Expand Up @@ -672,9 +674,12 @@ terminal .terminal-output > div {
pointer-events: none;
box-sizing: border-box;
}
.terminal, .terminal .terminal-fill {
.terminal, .terminal .terminal-fill, .cmd-editable {
padding: 10px;
}
.cmd-editable {
padding-top: 0;
}
/* padding added as margin to .cmd to fix FireFox bug see: https://stackoverflow.com/q/29986977/387194 */
.terminal {
padding-bottom: 0;
Expand Down Expand Up @@ -943,15 +948,21 @@ terminal .terminal-output > div {
.terminal-mobile.terminal-less .terminal-output a, .cmd-editable {
pointer-events: visible;
}
.cmd-editable::before {
content: attr(data-cmd-prompt);
display: inline-block;
}
.cmd-editable {
position: absolute;
top: 0;
top: calc(var(--terminal-y, var(--cmd-y, 0)) * 1px);
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;
}
.terminal::-webkit-scrollbar {
Expand Down
23 changes: 17 additions & 6 deletions css/jquery.terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.17.2
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2020 Jakub Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Thu, 11 Jun 2020 19:20:15 +0000
* Date: Sun, 28 Jun 2020 15:36:54 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd-prompt, .cmd-prompt div {
Expand Down Expand Up @@ -206,7 +206,10 @@ body.full-screen-terminal .terminal {
}
.terminal,
.terminal-output > :not(.raw),
.cmd {
.terminal-output > :not(.raw) span,
.terminal-output > :not(.raw) a,
.cmd,
.cmd span {
font-family: monospace;
/*font-family: FreeMono, monospace; this don't work on Android */
font-size: 12px;
Expand Down Expand Up @@ -247,7 +250,6 @@ body.full-screen-terminal .terminal {

.terminal, .cmd {
box-sizing: border-box;
cursor: text;
}
.cmd .cmd-cursor span:not(.token):not(.inverted) {
color: inherit;
Expand Down Expand Up @@ -672,9 +674,12 @@ terminal .terminal-output > div {
pointer-events: none;
box-sizing: border-box;
}
.terminal, .terminal .terminal-fill {
.terminal, .terminal .terminal-fill, .cmd-editable {
padding: 10px;
}
.cmd-editable {
padding-top: 0;
}
/* padding added as margin to .cmd to fix FireFox bug see: https://stackoverflow.com/q/29986977/387194 */
.terminal {
padding-bottom: 0;
Expand Down Expand Up @@ -943,15 +948,21 @@ terminal .terminal-output > div {
.terminal-mobile.terminal-less .terminal-output a, .cmd-editable {
pointer-events: visible;
}
.cmd-editable::before {
content: attr(data-cmd-prompt);
display: inline-block;
}
.cmd-editable {
position: absolute;
top: 0;
top: calc(var(--terminal-y, var(--cmd-y, 0)) * 1px);
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;
}
.terminal::-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.

Loading

0 comments on commit f0331a2

Please sign in to comment.