Skip to content

Commit 40c51a3

Browse files
Cursor Y position stick during window resizing, dependencies update
1 parent 1ea350a commit 40c51a3

File tree

4 files changed

+45
-42
lines changed

4 files changed

+45
-42
lines changed

ISSUE_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Thank you for reaching WebTerminal project! Just a few guidelines for you:
22

33
+ Feel free to submit questions and feature requests!
4-
+ If you are going to submit bug report, please include technical details: Caché version and a way how to reproduce the problem. Please, submit some demonstration code (when appropriate).
4+
+ If you are going to submit bug report, please include technical details: Caché version and a way
5+
how to reproduce the problem. Please, submit some demonstration code (when appropriate).
56
+ By using search, check if there were no such issues before.
67
+ Replace this text with your issue! Thanks!

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"printableName": "Cache Web Terminal",
66
"description": "Web-based terminal emulator for Caché administering.",
77
"author": "ZitRo",
8-
"version": "4.2.9",
8+
"version": "4.2.10",
99
"gaID": "UA-83005064-2",
1010
"releaseNumber": 26,
1111
"scripts": {
@@ -16,20 +16,20 @@
1616
"url": "https://github.com/intersystems-ru/webterminal.git"
1717
},
1818
"devDependencies": {
19-
"babel-core": "^6.9.0",
20-
"babel-polyfill": "^6.9.1",
21-
"babel-preset-es2015": "^6.9.0",
19+
"babel-core": "^6.23.1",
20+
"babel-polyfill": "^6.23.0",
21+
"babel-preset-es2015": "^6.22.0",
2222
"babelify": "^7.3.0",
23-
"browserify": "^13.1.1",
23+
"browserify": "^14.1.0",
2424
"gulp": "^3.9.1",
2525
"gulp-cssnano": "^2.1.2",
2626
"gulp-minify-css": "^1.2.4",
2727
"gulp-preprocess": "^2.0.0",
2828
"gulp-rename": "^1.2.2",
2929
"gulp-replace": "^0.5.4",
30-
"gulp-rimraf": "^0.2.0",
31-
"gulp-sass": "^3.0.0",
32-
"gulp-uglify": "^2.0.0",
30+
"gulp-rimraf": "^0.2.1",
31+
"gulp-sass": "^3.1.0",
32+
"gulp-uglify": "^2.1.0",
3333
"preprocessify": "^1.0.1",
3434
"vinyl-buffer": "^1.0.0",
3535
"vinyl-source-stream": "^1.1.0"

readme.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,6 @@ Download the latest version from <a href="http://intersystems-ru.github.io/webte
6464
After installation, you will be able to access application at `http://[host]:[port]/terminal/` (slash at the end is required).
6565
Type `/help` there to get more information.
6666

67-
Development
68-
-----------
69-
70-
We are glad to see anyone who want to contribute to Caché WEB Terminal development! Check the
71-
[developer's](https://github.com/intersystems-ru/webterminal/blob/master/CONTRIBUTING.md) guide.
72-
73-
In short, the "hot start" is extremely easy. Having latest [Git](https://git-scm.com/) and
74-
[NodeJS](https://nodejs.org/en/) installed (tested on NodeJS v4-6), execute the following:
75-
76-
```sh
77-
git clone https://github.com/intersystems-ru/webterminal
78-
cd webterminal # enter repository directory
79-
npm install # install all project's dependencies
80-
81-
npm run build # build the project
82-
# OR edit import.bat script (on Windows) and then use only the following command:
83-
import
84-
```
85-
86-
Now, in `build` folder you will find `WebTerminal-v*.xml` file. Every time you
87-
changes is ready to be tested, just run `import`.
88-
8967
Integration and WebTerminal's API
9068
---------------------------------
9169

@@ -188,3 +166,25 @@ iFrame.addEventListener("load", function () {
188166
iFrame.contentWindow.onTerminalInit(myInitHandler); // handle terminal initialization
189167
});
190168
```
169+
170+
WebTerminal Project Development
171+
-------------------------------
172+
173+
We are glad to see anyone who want to contribute to Caché WEB Terminal development! Check our
174+
[developer's guide](https://github.com/intersystems-ru/webterminal/blob/master/CONTRIBUTING.md).
175+
176+
In short, the "hot start" is extremely easy. Having latest [Git](https://git-scm.com/) and
177+
[NodeJS](https://nodejs.org/en/) installed (tested on NodeJS v4-6), execute the following:
178+
179+
```sh
180+
git clone https://github.com/intersystems-ru/webterminal
181+
cd webterminal # enter repository directory
182+
npm install # install all project's dependencies
183+
184+
npm run build # build the project
185+
# OR edit import.bat script (on Windows) and then use only the following command:
186+
import
187+
```
188+
189+
Now, in `build` folder you will find `WebTerminal-v*.xml` file. Every time you
190+
changes is ready to be tested, just run `import`.

src/client/js/output/index.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ function output (plainText = "") {
409409
*/
410410
export function getLineByIndex (index) {
411411

412-
let toPush = Math.max(index - lines.length + 1, 0);
412+
const toPush = Math.max(index - lines.length + 1, 0);
413413

414414
if (toPush > 0)
415415
pushLines(toPush);
@@ -431,10 +431,10 @@ export function getLineByCursorY (y) {
431431
*/
432432
export function clear () {
433433
scrollDisplay(1);
434-
let i = getTopLineIndex() + getCursorY() - 1,
435-
m = lines.length,
436-
r = m - i - 1,
437-
t = lines.length - getTopLineIndex();
434+
const i = getTopLineIndex() + getCursorY() - 1,
435+
m = lines.length,
436+
r = m - i - 1,
437+
t = lines.length - getTopLineIndex();
438438
pushLines(Math.max(HEIGHT - r, t));
439439
setCursorX(1);
440440
setCursorY(1);
@@ -463,11 +463,12 @@ export function scrollDown () {
463463
*/
464464
function sizeChanged () {
465465

466-
let tel = document.createElement("span"),
467-
testScrollbar = document.createElement("div"),
468-
scrollBarWidth,
469-
lastOverflowProperty = elements.output.style.overflowY,
470-
ow, oh;
466+
const originLineIndex = getCurrentLineIndex(),
467+
tel = document.createElement("span"),
468+
testScrollbar = document.createElement("div"),
469+
lastOverflowProperty = elements.output.style.overflowY;
470+
471+
let scrollBarWidth, ow, oh;
471472

472473
elements.output.style.overflowY = "scroll";
473474
testScrollbar.className = LINE_CLASS_NAME;
@@ -490,6 +491,7 @@ function sizeChanged () {
490491
elements.input.style.width = `${ WIDTH * SYMBOL_WIDTH }px`;
491492

492493
elements.output.removeChild(testScrollbar);
494+
setCursorYToLineIndex(originLineIndex);
493495

494496
// In case of custom styling when integrating WebTerminal to other solutions, the WebTerminal
495497
// may be hidden on the page by default. This will cause WebTerminal to set up wrong
@@ -502,7 +504,7 @@ function sizeChanged () {
502504
+ ` WebTerminal's iFrame is visible and is attached to the DOM.`;
503505
try { console.warn(m); } catch (e) { console.log(m); }
504506
}
505-
507+
506508
// elements.output.style.width = `${ WIDTH * SYMBOL_WIDTH + scrollBarWidth }px`;
507509
// elements.output.style.height = `${ HEIGHT * SYMBOL_HEIGHT }px`; = 100%
508510
// console.log(`S W/H ${ SYMBOL_WIDTH }/${ SYMBOL_HEIGHT } ${ WIDTH }/${ HEIGHT }`);

0 commit comments

Comments
 (0)