2010-03-15 07:41:38 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggle field readonly modes, if check configuration comes from
|
|
|
|
* _ss_environment (values populated on reload).
|
|
|
|
*/
|
|
|
|
$('#use_environment').click(function(e) {
|
|
|
|
if(!$(this).is(':checked')) {
|
|
|
|
$('.configured-by-env').removeAttr('disabled');
|
|
|
|
} else {
|
|
|
|
$('.configured-by-env').attr('disabled', 'disabled');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hide all existing database warnings, and show only current one
|
|
|
|
*/
|
2010-03-17 00:58:24 +01:00
|
|
|
$('#database_selection li label, input').click(function(e) {
|
2010-03-15 07:41:38 +01:00
|
|
|
$('.dbfields').hide();
|
|
|
|
// only show fields if there's no db error
|
2010-03-17 00:58:24 +01:00
|
|
|
if(!$('.databaseError', $(this).parent()).length) $('.dbfields', $(this).parent()).show();
|
2010-03-15 07:41:38 +01:00
|
|
|
$('.databaseError').hide();
|
2010-03-17 00:58:24 +01:00
|
|
|
$('.databaseError', $(this).parent()).show();
|
2010-03-15 07:41:38 +01:00
|
|
|
});
|
2010-03-17 00:58:24 +01:00
|
|
|
|
2010-03-15 07:41:38 +01:00
|
|
|
// Select first
|
2010-03-17 00:58:24 +01:00
|
|
|
$('#database_selection li input:checked').siblings('label').click();
|
2010-03-15 07:41:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Install button
|
|
|
|
*/
|
|
|
|
$('#ReIn').click(function() {
|
|
|
|
$('#install_button').attr('disabled', !$(this).is(':checked'));
|
|
|
|
})
|
|
|
|
$('#install_button').click(function() {
|
|
|
|
$('#saving_top').hide();
|
|
|
|
$(this).val('Installing SilverStripe...');
|
|
|
|
})
|
|
|
|
});
|