0byt3m1n1-V2
Path:
/
home
/
phangnga
/
media
/
com_akeeba
/
js
/
[
Home
]
File: MultipleDatabases.min.js
if(typeof akeeba=="undefined"){var akeeba={}}if(typeof akeeba.Multidb=="undefined"){akeeba.Multidb={loadingGif:""}}(function(a){akeeba.Multidb.render=function(c){var b=a("#ak_list_contents");b.html("");a.each(c,function(d,e){akeeba.Multidb.addRow(d,e,b)});akeeba.Multidb.addNewRecordButton(b)};akeeba.Multidb.addRow=function(b,d,c){a(document.createElement("tr")).addClass("ak_filter_row").data("root",b).data("def",d).append(a(document.createElement("td")).css("width","2em").append(a(document.createElement("span")).addClass("ak_filter_tab_icon_container btn btn-default").click(function(){var e={root:a(this).parent().parent().data("root"),verb:"remove"};akeeba.Fsfilters.toggle(e,a(this).find("span").first(),function(f,g){if(f.success==true){g.parent().parent().parent().remove()}})}).append(a(document.createElement("span")).addClass("ak-toggle-button icon icon-trash deletebutton")))).append(a(document.createElement("td")).css("width","2em").append(a(document.createElement("span")).addClass("ak_filter_tab_icon_container btn btn-default").click(function(){var g=a(this).parent().parent();var f=a(this).parent().parent().data("def");var i=a(this).parent().parent().data("root");var h=a("#akEditorDialog");if(f.driver==""){f.driver="mysqli"}a("#ake_driver").val(f.driver);a("#ake_host").val(f.host);a("#ake_username").val(f.username);a("#ake_password").val(f.password);a("#ake_database").val(f.database);a("#ake_prefix").val(f.prefix);try{a("#ak_editor_notifier").remove()}catch(j){}a("#akEditorBtnDefault").click(function(){try{a("#ak_editor_notifier").remove()}catch(m){}a("#ak_editor_table").before(a(document.createElement("div")).addClass("alert alert-info alert-dismissable").attr("id","ak_editor_notifier").append(a(document.createElement("button")).attr({type:"button","class":"close","data-dismiss":"alert","aria-hidden":"true"}).html("×")).append(a(document.createElement("span")).attr("id","ak_editor_notifier_content").append(a(document.createElement("img")).attr({border:0,src:akeeba.Multidb.loadingGif})).append(a(document.createElement("span")).html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_LOADING")))));var k={verb:"test",root:b,data:{host:a("#ake_host").val(),driver:a("#ake_driver").val(),port:a("#ake_port").val(),user:a("#ake_username").val(),password:a("#ake_password").val(),database:a("#ake_database").val(),prefix:a("#ake_prefix").val()}};var l={action:JSON.stringify(k)};akeeba.System.doAjax(l,function(e){if(e.status==true){a("#ak_editor_notifier_content").html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTOK"))}else{a("#ak_editor_notifier_content").html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTFAIL")+"<br/><code>"+e.message+"</code>")}},function(e){a("#ak_editor_notifier_content").html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTFAIL"));a("#akEditorDialog").modal("hide");akeeba.System.params.errorCallback(e)},false,15000)});a("#akEditorBtnSave").unbind("click").click(function(){try{a("#ak_editor_notifier").remove()}catch(m){}a("#ak_editor_table").before(a(document.createElement("div")).addClass("alert alert-info alert-dismissable").attr("id","ak_editor_notifier").append(a(document.createElement("button")).attr({type:"button","class":"close","data-dismiss":"alert","aria-hidden":"true"}).html("×")).append(a(document.createElement("span")).attr("id","ak_editor_notifier_content").append(a(document.createElement("img")).attr({border:0,src:akeeba.Multidb.loadingGif})).append(a(document.createElement("span")).html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_LOADING")))));var k={verb:"set",root:b,data:{host:a("#ake_host").val(),driver:a("#ake_driver").val(),port:a("#ake_port").val(),username:a("#ake_username").val(),password:a("#ake_password").val(),database:a("#ake_database").val(),prefix:a("#ake_prefix").val(),dumpFile:String(b).substr(0,9)+a("#ake_database").val()+".sql"}};var l={action:JSON.stringify(k)};akeeba.System.doAjax(l,function(e){if(e==true){g.data("def",k.data);var n=g.children("td");n.find("span.ak_dbhost").html(k.data.host);n.find("span.ak_dbname").html(k.data.database);if(!n.find("span.editbutton").hasClass("icon-pencil")){n.find("span.deletebutton").parent().show();n.find("span.editbutton").removeClass("icon-plus-circle").addClass("icon-pencil").addClass("ak-toggle-button");akeeba.Multidb.addNewRecordButton(g.parent())}a("#akEditorDialog").modal("hide")}else{a("#ak_editor_notifier_content").html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_SAVEFAIL"))}},function(e){a("#ak_editor_notifier_content").html(Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_SAVEFAIL"));a("#akEditorDialog").modal("hide");akeeba.System.params.errorCallback(e)},false,15000)});h.modal({keyboard:false,backdrop:"static"});h.find("span").focus()}).append(a(document.createElement("span")).addClass("fa icon-pencil editbutton").addClass("ak-toggle-button")))).append(a(document.createElement("td")).addClass("ak_filter_item").append(a(document.createElement("span")).addClass("ak_filter_name").addClass("ak_dbhost").html(d.host))).append(a(document.createElement("td")).addClass("ak_filter_item").append(a(document.createElement("span")).addClass("ak_filter_name").addClass("ak_dbname").html(d.database))).appendTo(a(c))};akeeba.Multidb.addNewRecordButton=function(d){var b=Math.uuid();var c={host:"",port:"",username:"",password:"",database:"",prefix:""};akeeba.Multidb.addRow(b,c,d);a("#ak_list_contents tr:last-child td:first-child span:first").hide();a("#ak_list_contents tr:last-child td:nth-child(2) span:last").removeClass("icon-pencil").addClass("icon-plus-circle").addClass("ak-toggle-button")}}(akeeba.jQuery));
©
2018.