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-18 02:29:59 +01:00
|
|
|
$('#database_selection li label, #database_selection input:radio').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
|
|
|
|
*/
|
2010-05-17 11:55:39 +02:00
|
|
|
$('#reinstall_confirmation').click(function() {
|
2010-03-15 07:41:38 +01:00
|
|
|
$('#install_button').attr('disabled', !$(this).is(':checked'));
|
2010-03-19 04:54:45 +01:00
|
|
|
});
|
|
|
|
|
2010-03-15 07:41:38 +01:00
|
|
|
$('#install_button').click(function() {
|
|
|
|
$('#saving_top').hide();
|
|
|
|
$(this).val('Installing SilverStripe...');
|
2010-03-19 04:54:45 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show all the requirements
|
|
|
|
*/
|
|
|
|
$('h5.requirement a').click(function() {
|
|
|
|
if($(this).text() == 'Hide All Requirements') {
|
|
|
|
// hide the shown requirements
|
|
|
|
$(this).parents('h5').next('table.testResults').find('.good').hide();
|
|
|
|
$(this).text('See All Requirements');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// show the requirements.
|
|
|
|
$(this).parents('h5').next('table.testResults').find('.good').show();
|
|
|
|
$(this).text('Hide All Requirements');
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
2010-03-15 07:41:38 +01:00
|
|
|
});
|