Skip to content

Commit

Permalink
fix calling login_name in dynamic prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 27, 2022
1 parent 957abb5 commit 4a8f649
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@
* fix regression in less + images
* fix embedding Terminal inside SVG [#744](https://github.com/jcubic/jquery.terminal/issues/744)
* fix when login function is not async
* fix calling login_name in dynamic prompt

## 2.32.1
### Bugfix
Expand Down
24 changes: 12 additions & 12 deletions js/jquery.terminal-2.32.1.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 27 Mar 2022 22:48:55 +0000
* Date: Sun, 27 Mar 2022 23:01:27 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5169,7 +5169,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 27 Mar 2022 22:48:55 +0000',
date: 'Sun, 27 Mar 2022 23:01:27 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9235,20 +9235,15 @@
// so we know how many times call pop
var level = self.level();
function login_callback(user, token, silent) {
var next;
if (token) {
popUserPass();
var name = self.prefix_name(true) + '_';
storage.set(name + 'token', token);
storage.set(name + 'login', user);
in_login = false;
fire_event('onAfterLogin', [user, token]);
if (is_function(success)) {
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
success();
}
next = success;
} else {
if (infinite) {
if (!silent) {
Expand All @@ -9263,13 +9258,18 @@
self.pop(undefined, true).pop(undefined, true);
}
// used only to call pop in push
if (is_function(error)) {
error();
}
next = error;
}
if (self.paused()) {
self.resume();
}
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
if (is_function(next)) {
next();
}
self.off('terminal.autologin');
}
self.on('terminal.autologin', function(event, user, token, silent) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.32.1.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions js/jquery.terminal-src.js
Expand Up @@ -9235,20 +9235,15 @@
// so we know how many times call pop
var level = self.level();
function login_callback(user, token, silent) {
var next;
if (token) {
popUserPass();
var name = self.prefix_name(true) + '_';
storage.set(name + 'token', token);
storage.set(name + 'login', user);
in_login = false;
fire_event('onAfterLogin', [user, token]);
if (is_function(success)) {
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
success();
}
next = success;
} else {
if (infinite) {
if (!silent) {
Expand All @@ -9263,13 +9258,18 @@
self.pop(undefined, true).pop(undefined, true);
}
// used only to call pop in push
if (is_function(error)) {
error();
}
next = error;
}
if (self.paused()) {
self.resume();
}
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
if (is_function(next)) {
next();
}
self.off('terminal.autologin');
}
self.on('terminal.autologin', function(event, user, token, silent) {
Expand Down
24 changes: 12 additions & 12 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 27 Mar 2022 22:48:55 +0000
* Date: Sun, 27 Mar 2022 23:01:27 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5169,7 +5169,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 27 Mar 2022 22:48:55 +0000',
date: 'Sun, 27 Mar 2022 23:01:27 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9235,20 +9235,15 @@
// so we know how many times call pop
var level = self.level();
function login_callback(user, token, silent) {
var next;
if (token) {
popUserPass();
var name = self.prefix_name(true) + '_';
storage.set(name + 'token', token);
storage.set(name + 'login', user);
in_login = false;
fire_event('onAfterLogin', [user, token]);
if (is_function(success)) {
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
success();
}
next = success;
} else {
if (infinite) {
if (!silent) {
Expand All @@ -9263,13 +9258,18 @@
self.pop(undefined, true).pop(undefined, true);
}
// used only to call pop in push
if (is_function(error)) {
error();
}
next = error;
}
if (self.paused()) {
self.resume();
}
// will be used internaly since users know
// when login success (they decide when
// it happen by calling the callback -
// this funtion)
if (is_function(next)) {
next();
}
self.off('terminal.autologin');
}
self.on('terminal.autologin', function(event, user, token, silent) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 4a8f649

Please sign in to comment.