Skip to content

Commit

Permalink
Implemented tooltips on input fields (both for instance config fields…
Browse files Browse the repository at this point in the history
… and for action options). closes #49
  • Loading branch information
willosof committed Jun 10, 2018
1 parent 7285fec commit 71127e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/module/millumin/millumin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ instance.prototype.config_fields = function () {
type: 'textinput',
id: 'host',
label: 'Target IP',
tooltip: 'The IP of the computer running Millumin',
width: 6,
regex: self.REGEX_IP
},
Expand Down Expand Up @@ -52,7 +53,7 @@ instance.prototype.actions = function(system) {
options: [
{
type: 'textinput',
label: 'Column Nr',
label: 'Column',
id: 'int',
default: 1,
regex: self.REGEX_NUMBER
Expand All @@ -65,7 +66,7 @@ instance.prototype.actions = function(system) {
options: [
{
type: 'textinput',
label: 'Column Nr',
label: 'Column',
id: 'int',
default: 1,
regex: self.REGEX_NUMBER
Expand Down Expand Up @@ -103,9 +104,10 @@ instance.prototype.actions = function(system) {
options: [
{
type: 'textinput',
label: 'Column Nr',
label: 'Column',
id: 'int',
default: 1,
tooltip: 'Column number',
regex: self.REGEX_NUMBER
}
]
Expand Down
1 change: 1 addition & 0 deletions lib/module/mitti/mitti.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ instance.prototype.config_fields = function () {
type: 'textinput',
id: 'host',
label: 'Target IP',
tooltip: 'The IP of the computer running Mitti',
width: 6,
regex: self.REGEX_IP
}
Expand Down
6 changes: 6 additions & 0 deletions public/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ $(function() {

if (option.type == 'textinput') {
var $opt_input = $("<input type='text' class='action-option-keyup form-control'>");
if (option.tooltip !== undefined) {
$opt_input.attr('title', option.tooltip);
}
$opt_input.data('action-id', action.id);
$opt_input.data('option-id', option.id);

Expand Down Expand Up @@ -116,6 +119,9 @@ $(function() {
var $opt_input = $("<select class='action-option-change form-control'></select>");
$opt_input.data('action-id', action.id);
$opt_input.data('option-id', option.id);
if (option.tooltip !== undefined) {
$opt_input.attr('title', option.tooltip);
}

for (var x in option.choices) {
var str = new String(option.choices[x]);
Expand Down

0 comments on commit 71127e6

Please sign in to comment.