open help popup when the option is set.
This commit is contained in:
parent
303fc584c9
commit
b91504110f
1 changed files with 21 additions and 3 deletions
|
|
@ -77,11 +77,13 @@ let options_plugin = (function () {
|
||||||
if (code === 27) { // Escape key
|
if (code === 27) { // Escape key
|
||||||
if ($('#helpdialog').is(':visible')) {
|
if ($('#helpdialog').is(':visible')) {
|
||||||
plugins['popups'].closePopup("#helpdialog");
|
plugins['popups'].closePopup("#helpdialog");
|
||||||
} else {
|
|
||||||
plugins['popups'].closePopup("#optionsdialog");
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if ($('#optionsdialog').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#optionsdialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,6 +131,21 @@ let options_plugin = (function () {
|
||||||
plugins['popups'].closePopup("#helpdialog");
|
plugins['popups'].closePopup("#helpdialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Make sure to close any dialogs on connection lost
|
||||||
|
var onText = function (args, kwargs) {
|
||||||
|
// is helppopup set? and if so, does this Text have type 'help'?
|
||||||
|
if ('helppopup' in options && options['helppopup'] ) {
|
||||||
|
if (kwargs && ('type' in kwargs) && (kwargs['type'] == 'help') ) {
|
||||||
|
$('#helpdialogcontent').append('<div>'+ args + '</div>');
|
||||||
|
plugins['popups'].togglePopup("#helpdialog");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Register and init plugin
|
// Register and init plugin
|
||||||
var init = function () {
|
var init = function () {
|
||||||
|
|
@ -155,6 +172,7 @@ let options_plugin = (function () {
|
||||||
onGotOptions: onGotOptions,
|
onGotOptions: onGotOptions,
|
||||||
onPrompt: onPrompt,
|
onPrompt: onPrompt,
|
||||||
onConnectionClose: onConnectionClose,
|
onConnectionClose: onConnectionClose,
|
||||||
|
onText: onText,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
plugin_handler.add('options', options_plugin);
|
plugin_handler.add('options', options_plugin);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue