mirror of
https://github.com/ansible/awx.git
synced 2026-03-25 21:05:03 -02:30
Help generator now supports an img object with src, maxWidth and maxHeight properties. Added fading and sizing changes to Group help images.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 19 KiB |
@@ -14,13 +14,13 @@ angular.module('InventorySummaryHelpDefinition', [])
|
|||||||
steps: {
|
steps: {
|
||||||
step1: {
|
step1: {
|
||||||
intro: 'Start by creating a group:',
|
intro: 'Start by creating a group:',
|
||||||
img: 'help002.png',
|
img: { src: 'help002.png', maxWidth: 460 , maxHeight: 111 },
|
||||||
box: "Click the <em>Create New</em> button and add a new group to the inventory.",
|
box: "Click the <em>Create New</em> button and add a new group to the inventory.",
|
||||||
height: 400
|
height: 400
|
||||||
},
|
},
|
||||||
step2: {
|
step2: {
|
||||||
intro: 'After creating a group, add hosts:',
|
intro: 'After creating a group, add hosts:',
|
||||||
img: 'help001.png',
|
img: { src: 'help001.png', maxWidth: 467, maxHeight: 208 },
|
||||||
box: "Navigate to <em>Hosts</em> using the drop-down menu, where you can add hosts to the new group",
|
box: "Navigate to <em>Hosts</em> using the drop-down menu, where you can add hosts to the new group",
|
||||||
height: 480
|
height: 480
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,14 @@ angular.module('Utilities',['RestServices', 'Utilities'])
|
|||||||
function buildHtml(step) {
|
function buildHtml(step) {
|
||||||
var html = '';
|
var html = '';
|
||||||
html += (step.intro) ? "<div class=\"help-intro\">" + step.intro + "</div>" : "";
|
html += (step.intro) ? "<div class=\"help-intro\">" + step.intro + "</div>" : "";
|
||||||
html += (step.img) ? "<img src=\"" + $basePath + "img/help/" + step.img + "\" style=\"max-width:" + (width - 30) + "px\" >" : "";
|
if (step.img) {
|
||||||
|
html += "<img src=\"" + $basePath + "img/help/" + step.img.src + "\" ";
|
||||||
|
html += "style=\"";
|
||||||
|
html += (step.img.maxWidth) ? "max-width:" + step.img.maxWidth + "px;" : "";
|
||||||
|
html += (step.img.maxHeight) ? " max-height: " + step.img.maxHeight + "px;" : "";
|
||||||
|
html += "\" ";
|
||||||
|
html += ">";
|
||||||
|
}
|
||||||
html += (step.box) ? "<div class=\"help-box\">" + step.box + "</div>" : "";
|
html += (step.box) ? "<div class=\"help-box\">" + step.box + "</div>" : "";
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
@@ -265,6 +272,12 @@ angular.module('Utilities',['RestServices', 'Utilities'])
|
|||||||
showHelp({ defn: nxtStory });
|
showHelp({ defn: nxtStory });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$('#help-modal').dialog('hide');
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
$('#help-modal').html(buildHtml(defn.story.steps[nxt])).dialog({
|
$('#help-modal').html(buildHtml(defn.story.steps[nxt])).dialog({
|
||||||
position: { my: "center top", at: "center top+150", of: 'body' },
|
position: { my: "center top", at: "center top+150", of: 'body' },
|
||||||
title: defn.story.hdr,
|
title: defn.story.hdr,
|
||||||
@@ -272,12 +285,20 @@ angular.module('Utilities',['RestServices', 'Utilities'])
|
|||||||
height: height,
|
height: height,
|
||||||
buttons: [{ text: "Next", click: nxtStep }],
|
buttons: [{ text: "Next", click: nxtStep }],
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
|
show: 500,
|
||||||
|
hide: 500,
|
||||||
close: function() { $('#help-modal').empty(); }
|
close: function() { $('#help-modal').empty(); }
|
||||||
});
|
});
|
||||||
$('.ui-dialog-buttonset button').addClass('btn btn-primary').focus();
|
$('.ui-dialog-buttonset button').addClass('btn btn-primary').focus();
|
||||||
$('.ui-dialog-titlebar-close').empty().removeClass('close').removeClass('ui-dialog-titlebar-close').addClass('close').append('x');
|
$('.ui-dialog-titlebar-close').empty().removeClass('close').removeClass('ui-dialog-titlebar-close').addClass('close').append('x');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
try {
|
||||||
|
$('#help-modal').dialog('hide');
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
$('#help-modal').html(buildHtml(defn.story.steps[nxt])).dialog({
|
$('#help-modal').html(buildHtml(defn.story.steps[nxt])).dialog({
|
||||||
position: { my: "center top", at: "center top+150", of: 'body' },
|
position: { my: "center top", at: "center top+150", of: 'body' },
|
||||||
title: defn.story.hdr,
|
title: defn.story.hdr,
|
||||||
@@ -285,6 +306,8 @@ angular.module('Utilities',['RestServices', 'Utilities'])
|
|||||||
height: height,
|
height: height,
|
||||||
buttons: [ { text: "OK", click: function() { $( this ).dialog( "close" ); } } ],
|
buttons: [ { text: "OK", click: function() { $( this ).dialog( "close" ); } } ],
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
|
show: 500,
|
||||||
|
hide: 500,
|
||||||
close: function() { $('#help-modal').empty(); }
|
close: function() { $('#help-modal').empty(); }
|
||||||
});
|
});
|
||||||
$('.ui-dialog-buttonset button').addClass('btn btn-primary').focus();
|
$('.ui-dialog-buttonset button').addClass('btn btn-primary').focus();
|
||||||
|
|||||||
Reference in New Issue
Block a user