Add base install wizard scripts

This commit is contained in:
Brian Federle 2011-11-11 10:28:58 -08:00
parent 771b27aa3d
commit 7eb51d65d0
4 changed files with 59 additions and 0 deletions

View File

@ -1391,6 +1391,8 @@
<!-- CloudStack -->
<script src="scripts/ui-custom/login.js" type="text/javascript"></script>
<script src="scripts-test/cloudStack.js" type="text/javascript"></script>
<script src="scripts-test/installWizard.js" type="text/javascript"></script>
<script src="scripts/ui-custom/installWizard.js" type="text/javascript"></script>
<script src="scripts/ui-custom/projects.js" type="text/javascript"></script>
<script src="scripts-test/projects.js" type="text/javascript"></script>
<script src="scripts-test/dashboard.js" type="text/javascript"></script>

View File

@ -1399,6 +1399,8 @@
<script src="scripts/ui-custom/login.js" type="text/javascript"></script>
<script src="scripts/ui-custom/projects.js" type="text/javascript"></script>
<script src="scripts/cloudStack.js" type="text/javascript"></script>
<script src="scripts-test/installWizard.js" type="text/javascript"></script>
<script src="scripts/ui-custom/installWizard.js" type="text/javascript"></script>
<script src="scripts/projects.js" type="text/javascript"></script>
<script src="scripts/dashboard.js" type="text/javascript"></script>
<script src="scripts/ui-custom/instanceWizard.js" type="text/javascript"></script>

View File

@ -0,0 +1,12 @@
(function($, cloudStack, testData) {
cloudStack.installWizard = {
// Check if install wizard should be invoked
check: function(args) {
setTimeout(function() {
args.response.success({
doInstall: false
});
}, 100);
}
};
}(jQuery, cloudStack, testData));

View File

@ -0,0 +1,43 @@
(function($, cloudStack, testData) {
cloudStack.uiCustom.installWizard = function(args) {
var context = args.context;
var $installWizard = $('<div>').addClass('install-wizard');
var $container = args.$container;
var elems = {
nextButton: function() {
return $('<div>').addClass('button next').html('Next');
}
};
// Layout/behavior for each step in wizard
var steps = {
// Welcome screen
welcome: function(args) {
return $.merge(
$('<h1>').html('Welcome screen'),
$('<p>').html('Welcome text goes here.'),
$('<div>').addClass('button next').html('Next'),
elems.nextButton().click(args.nextStep)
);
},
addZone: function(args) {
var $zoneWizard = $('#template').find('.multi-wizard.zone-wizard').clone();
return $.merge(
$zoneWizard.find('.steps .setup-zone'),
elems.nextButton().click(function() {
args.nextStep({
data: {
zone: cloudStack.serializeForm
}
});
})
);
}
};
$installWizard.append(steps.addZone).appendTo($container);
};
}(jQuery, cloudStack, testData));