Skip to content

Commit

Permalink
fix click to change position when command have newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Apr 16, 2017
1 parent 1e95e71 commit f07218e
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,3 +1,4 @@
1.1.3 fix click to change position when command have newlines
1.1.2 from pauseEvents option form cmd plugin - it always execute keyboard events
1.1.1 don't fire keymap when terminal paused
fix delete in IE11
Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
VERSION=1.1.2
VERSION=1.1.3
SED=sed
CP=cp
RM=rm
Expand Down
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -4,12 +4,12 @@
__ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
/ / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
\___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
\/ /____/ version 1.1.2
\/ /____/ version 1.1.3
```
http://terminal.jcubic.pl

[![npm](https://img.shields.io/badge/npm-1.1.2-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-1.1.2-yellow.svg)
[![npm](https://img.shields.io/badge/npm-1.1.3-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-1.1.3-yellow.svg)
[![Gitter chat](https://badges.gitter.im/jcubic/jquery.terminal.png)](https://gitter.im/jcubic/jquery.terminal)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=master)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=master&ceb0dd82f8cf95dffe11d2ba2032286d)](https://coveralls.io/github/jcubic/jquery.terminal?branch=master)
Expand Down Expand Up @@ -74,29 +74,29 @@ npm install --save jquery.terminal
Include jQuery library, you can use cdn from http://jquery.com/download/


Then include js/jquery.terminal-1.1.2.min.js and css/jquery.terminal-1.1.2.css
Then include js/jquery.terminal-1.1.3.min.js and css/jquery.terminal-1.1.3.css
You can also include js/jquery.mousewheel-min.js

```html
<script src="js/jquery.terminal-1.1.2.min.js"></script>
<script src="js/jquery.terminal-1.1.3.min.js"></script>
<script src="js/jquery.mousewheel-min.js"></script>
<link href="css/jquery.terminal-1.1.2.css" rel="stylesheet"/>
<link href="css/jquery.terminal-1.1.3.css" rel="stylesheet"/>
```

**NOTE:** From version 1.0.0 if you want to support old browsers or Safari then you'll need to use [key event property polyfill](https://github.com/cvan/keyboardevent-key-polyfill/)

You can also grab the files from CDN:

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

or

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

And you're good to go.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "jquery.terminal",
"version": "1.1.2",
"version": "1.1.3",
"main": [
"js/jquery.terminal.min.js",
"js/jquery.mousewheel-min.js",
Expand Down
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2017 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Tue, 11 Apr 2017 16:39:22 +0000
* Date: Sun, 16 Apr 2017 11:16:32 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down

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

2 changes: 1 addition & 1 deletion css/jquery.terminal.css
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2017 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Tue, 11 Apr 2017 16:39:22 +0000
* Date: Sun, 16 Apr 2017 11:16:32 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down
2 changes: 1 addition & 1 deletion css/jquery.terminal.min.css

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

9 changes: 5 additions & 4 deletions js/jquery.terminal-1.1.2.js → js/jquery.terminal-1.1.3.js
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 1.1.2
* \/ /____/ version 1.1.3
*
* This file is part of jQuery Terminal. http://terminal.jcubic.pl
*
Expand All @@ -31,7 +31,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Tue, 11 Apr 2017 16:39:20 +0000
* Date: Sun, 16 Apr 2017 11:16:29 +0000
*/

/* TODO:
Expand Down Expand Up @@ -940,7 +940,8 @@
} else {
try_pos = col - prompt_len;
}
var text = command.replace(/\t/g, '\x00\x00\x00\x00');
// tabs are 4 spaces and newline don't show up in results
var text = command.replace(/\t/g, '\x00\x00\x00\x00').replace(/\n/, '');
var before = text.slice(0, try_pos);
var len = before.replace(/\x00{4}/g, '\t').replace(/\x00+/, '').length;
return len > command.length ? command.length : len;
Expand Down Expand Up @@ -2105,7 +2106,7 @@
var re_re = /^\/((?:\\\/|[^/]|\[[^\]]*\/[^\]]*\])+)\/([gimy]*)$/;
/* eslint-enable */
$.terminal = {
version: '1.1.2',
version: '1.1.3',
// colors from http://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion js/jquery.terminal-src.js
Expand Up @@ -940,7 +940,8 @@
} else {
try_pos = col - prompt_len;
}
var text = command.replace(/\t/g, '\x00\x00\x00\x00');
// tabs are 4 spaces and newline don't show up in results
var text = command.replace(/\t/g, '\x00\x00\x00\x00').replace(/\n/, '');
var before = text.slice(0, try_pos);
var len = before.replace(/\x00{4}/g, '\t').replace(/\x00+/, '').length;
return len > command.length ? command.length : len;
Expand Down

0 comments on commit f07218e

Please sign in to comment.