server/core/js/setup.js

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2011-06-19 21:33:34 +00:00
$(document).ready(function() {
$('#selectDbType').buttonset();
2011-06-19 21:33:34 +00:00
$('#datadirField').hide(250);
if($('#hasSQLite').val()=='true'){
2011-09-04 13:03:25 +00:00
$('#databaseField').hide();
$('#use_other_db').hide();
$('#dbhost').hide();
$('#dbhostlabel').hide();
2011-06-19 21:33:34 +00:00
}
$('#sqlite').click(function() {
$('#use_other_db').slideUp(250);
2011-09-04 13:03:25 +00:00
$('#dbhost').hide(250);
$('#dbhostlabel').hide(250);
2011-06-19 21:33:34 +00:00
});
$('#mysql').click(function() {
$('#use_other_db').slideDown(250);
2011-09-04 13:03:25 +00:00
$('#dbhost').show(250);
$('#dbhostlabel').show(250);
2011-08-07 19:06:53 +00:00
});
$('#pgsql').click(function() {
$('#use_other_db').slideDown(250);
2011-09-04 13:03:25 +00:00
$('#dbhost').show(250);
$('#dbhostlabel').show(250);
2011-06-19 21:33:34 +00:00
});
$('#showAdvanced').click(function() {
$('#datadirField').slideToggle(250);
if($('#hasSQLite').val()=='true'){
$('#databaseField').slideToggle(250);
}
});
$("form").submit(function(){
// Save form parameters
var post = $(this).serializeArray();
// Disable inputs
$(':submit', this).attr('disabled','disabled').val('Please wait....');
$('input', this).addClass('ui-state-disabled').attr('disabled','disabled');
$('#selectDbType').button('disable');
$('label.ui-button', this).addClass('ui-state-disabled').attr('aria-disabled', 'true').button('disable');
// Create the form
var form = $('<form>');
form.attr('action', $(this).attr('action'));
form.attr('method', 'POST');
for(var i=0; i<post.length; i++){
var input = $('<input type="hidden">');
input.attr(post[i]);
form.append(input);
}
// Submit the form
form.appendTo(document.body);
form.submit();
return false;
});
2011-06-19 21:33:34 +00:00
});