Merge develop branch, resolve conflicts
This commit is contained in:
commit
54e351f296
22 changed files with 258 additions and 175 deletions
|
|
@ -8,6 +8,7 @@ let defaultin_plugin = (function () {
|
|||
//
|
||||
// handle the default <enter> key triggering onSend()
|
||||
var onKeydown = function (event) {
|
||||
$("#inputfield").focus();
|
||||
if ( (event.which === 13) && (!event.shiftKey) ) { // Enter Key without shift
|
||||
var inputfield = $("#inputfield");
|
||||
var outtext = inputfield.val();
|
||||
|
|
|
|||
|
|
@ -43,14 +43,6 @@ let history_plugin = (function () {
|
|||
history_pos = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Go to the last history line
|
||||
var end = function () {
|
||||
// move to the end of the history stack
|
||||
history_pos = 0;
|
||||
return history[history.length -1];
|
||||
}
|
||||
|
||||
//
|
||||
// Add input to the scratch line
|
||||
var scratch = function (input) {
|
||||
|
|
@ -69,28 +61,17 @@ let history_plugin = (function () {
|
|||
var history_entry = null;
|
||||
var inputfield = $("#inputfield");
|
||||
|
||||
if (inputfield[0].selectionStart == inputfield.val().length) {
|
||||
// Only process up/down arrow if cursor is at the end of the line.
|
||||
if (code === 38) { // Arrow up
|
||||
history_entry = back();
|
||||
}
|
||||
else if (code === 40) { // Arrow down
|
||||
history_entry = fwd();
|
||||
}
|
||||
if (code === 38) { // Arrow up
|
||||
history_entry = back();
|
||||
}
|
||||
else if (code === 40) { // Arrow down
|
||||
history_entry = fwd();
|
||||
}
|
||||
|
||||
if (history_entry !== null) {
|
||||
// Doing a history navigation; replace the text in the input.
|
||||
inputfield.val(history_entry);
|
||||
}
|
||||
else {
|
||||
// Save the current contents of the input to the history scratch area.
|
||||
setTimeout(function () {
|
||||
// Need to wait until after the key-up to capture the value.
|
||||
scratch(inputfield.val());
|
||||
end();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -99,6 +80,7 @@ let history_plugin = (function () {
|
|||
// Listen for onSend lines to add to history
|
||||
var onSend = function (line) {
|
||||
add(line);
|
||||
return null; // we are not returning an altered input line
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue