define(["require","exports"],function(e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a=function(){function e(e){this.$form=e;var s=e.find(".testDBcaller");this.dbTestUrl=s.data("url"),$("#sqlPassword").on("keyup",function(){$("#sqlPasswordNone").prop("checked",!1)}),$("#sqlPasswordNone").on("change",function(){$(this).prop("checked")&&$("#sqlPassword").val("").attr("placeholder","")}),s.click(this.testDb.bind(this)),""==$("#sqlHost").val()&&""==$("#sqlPassword").val()||s.click(),$("#language").on("changed.fu.selectlist",this.gotoLanguageVariant.bind(this))}return e.prototype.gotoLanguageVariant=function(e,s){var a=window.location.href.split("?")[0];a+="?language="+s.value,window.location.href=a},e.prototype.testDb=function(){var e=$(".testDBRpending"),s=$(".testDBsuccess"),a=$(".testDBerror"),t=$(".createTables"),n=$("input[name=_csrf]").val(),r={sqlType:$("input[name=sqlType]").val(),sqlHost:$("input[name=sqlHost]").val(),sqlUsername:$("input[name=sqlUsername]").val(),sqlPassword:$("input[name=sqlPassword]").val(),sqlDB:$("input[name=sqlDB]").val(),_csrf:n};$("input[name=sqlPasswordNone]").prop("checked")&&(r.sqlPasswordNone=1),e.removeClass("hidden"),a.addClass("hidden"),s.addClass("hidden"),$.post(this.dbTestUrl,r,function(n){n.success?(s.removeClass("hidden"),n.alreadyCreated?t.addClass("alreadyCreated"):t.removeClass("alreadyCreated")):(a.removeClass("hidden"),a.find(".result").text(n.error),t.removeClass("alreadyCreated")),e.addClass("hidden")}).fail(function(e){alert("An internal error occurred: "+e.status+" / "+e.responseText)})},e}();s.InitDb=a});
//# sourceMappingURL=InitDb.js.map
