shell-emulator
Advanced tools
Comparing version 1.0.1 to 1.0.3
16
index.js
@@ -6,8 +6,6 @@ // initialize with ID (string) of field that should act like a shell, | ||
// shell functions for | ||
// * setCaretPosition | ||
// * postMessage | ||
// * scrollDown | ||
// * interrupt | ||
exports.create = function (shellArea, historyArea, shellFunctions) { | ||
exports.create = function (shell, historyArea, shellFunctions) { | ||
var keys = { | ||
@@ -29,9 +27,9 @@ // The keys 37, 38, 39 and 40 are the arrow keys. | ||
var setCaretPosition = shellFunctions['setCaretPosition']; | ||
var postMessage = shellFunctions['postMessage']; | ||
var scrollDown = require('scroll-down').now; | ||
var interrupt = shellFunctions['interrupt']; | ||
var setCaretPosition = require('set-caret-position'); | ||
var scrollDown = require('scroll-down'); | ||
var mathProgramOutput = ""; | ||
var shell = shellArea; | ||
var history = historyArea; | ||
@@ -87,3 +85,3 @@ var cmdHistory = []; // History of commands for shell-like arrow navigation | ||
var packageAndSendMessage = function (tail, notrack) { | ||
setCaretPosition(shell, shell.val().length); | ||
setCaretPosition(shell.attr('id'), shell.val().length); | ||
if (shell.val().length >= mathProgramOutput.length) { | ||
@@ -130,3 +128,3 @@ l = shell.val().length; | ||
if (e.keyCode == keys.enter) { | ||
setCaretPosition(shell, shell.val().length); | ||
setCaretPosition(shell.attr('id'), shell.val().length); | ||
} | ||
@@ -150,3 +148,3 @@ | ||
if (pos < mathProgramOutput.length) { | ||
setCaretPosition(shell, shell.val().length); | ||
setCaretPosition(shell.attr('id'), shell.val().length); | ||
} | ||
@@ -153,0 +151,0 @@ // This deals with backspace. |
{ | ||
"name": "shell-emulator", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"description": "Emulate a shell in the browser", | ||
@@ -33,4 +33,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"scroll-down": "1.0.0" | ||
"scroll-down": "2.0.0", | ||
"set-caret-position": "3.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9545
2
195
+ Addedset-caret-position@3.0.0
+ Addedscroll-down@2.0.0(transitive)
+ Addedset-caret-position@3.0.0(transitive)
- Removedscroll-down@1.0.0(transitive)
Updatedscroll-down@2.0.0