2011-06-20 01:33:34 +04:00
|
|
|
$(document).ready(function() {
|
2011-08-11 20:18:50 +04:00
|
|
|
$('#selectDbType').buttonset();
|
2011-09-30 20:22:12 +04:00
|
|
|
$('#datadirContent').hide(250);
|
2011-10-03 15:32:16 +04:00
|
|
|
$('#databaseField').hide(250);
|
2011-06-20 01:33:34 +04:00
|
|
|
if($('#hasSQLite').val()=='true'){
|
2011-09-12 00:06:45 +04:00
|
|
|
$('#use_other_db').hide();
|
|
|
|
$('#dbhost').hide();
|
|
|
|
$('#dbhostlabel').hide();
|
2011-06-20 01:33:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
$('#sqlite').click(function() {
|
2011-08-09 13:32:22 +04:00
|
|
|
$('#use_other_db').slideUp(250);
|
2011-09-04 17:03:25 +04:00
|
|
|
$('#dbhost').hide(250);
|
|
|
|
$('#dbhostlabel').hide(250);
|
2011-06-20 01:33:34 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#mysql').click(function() {
|
2011-08-09 13:32:22 +04:00
|
|
|
$('#use_other_db').slideDown(250);
|
2011-09-04 17:03:25 +04:00
|
|
|
$('#dbhost').show(250);
|
|
|
|
$('#dbhostlabel').show(250);
|
2011-08-07 23:06:53 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#pgsql').click(function() {
|
2011-08-09 13:32:22 +04:00
|
|
|
$('#use_other_db').slideDown(250);
|
2011-09-04 17:03:25 +04:00
|
|
|
$('#dbhost').show(250);
|
|
|
|
$('#dbhostlabel').show(250);
|
2011-06-20 01:33:34 +04:00
|
|
|
});
|
|
|
|
|
2011-09-30 20:22:12 +04:00
|
|
|
$('input[checked]').trigger('click');
|
|
|
|
|
2011-06-20 01:33:34 +04:00
|
|
|
$('#showAdvanced').click(function() {
|
2011-09-30 20:22:12 +04:00
|
|
|
$('#datadirContent').slideToggle(250);
|
2011-10-03 15:32:16 +04:00
|
|
|
$('#databaseField').slideToggle(250);
|
2011-06-20 01:33:34 +04:00
|
|
|
});
|
2011-09-23 21:39:30 +04:00
|
|
|
$("form").submit(function(){
|
|
|
|
// Save form parameters
|
|
|
|
var post = $(this).serializeArray();
|
|
|
|
|
|
|
|
// Disable inputs
|
2011-09-24 23:56:40 +04:00
|
|
|
$(':submit', this).attr('disabled','disabled').val('Finishing …');
|
2011-09-23 21:39:30 +04:00
|
|
|
$('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-20 01:33:34 +04:00
|
|
|
});
|