b0y-101 Mini Shell


Current Path : E:/www/instructor/teacher28/media/com_akeeba/js/
File Upload :
Current File : E:/www/instructor/teacher28/media/com_akeeba/js/MultipleDatabases.min.js

/*
 Copyright (c)2006-2017 Nicholas K. Dionysopoulos / Akeeba Ltd
 @license   GNU General Public License version 3, or later
*/
if("undefined"==typeof akeeba)var akeeba={};"undefined"==typeof akeeba.Multidb&&(akeeba.Multidb={loadingGif:"",modalDialog:null});akeeba.Multidb.render=function(b){var f=document.getElementById("ak_list_contents");f.innerHTML="";for(rootname in b)b.hasOwnProperty(rootname)&&akeeba.Multidb.addRow(rootname,b[rootname],f);akeeba.Multidb.addNewRecordButton(f)};
akeeba.Multidb.addRow=function(b,f,n){var g=document.createElement("tr");g.className="ak_filter_row";akeeba.System.data.set(g,"root",b);akeeba.System.data.set(g,"def",JSON.stringify(f));var k=document.createElement("td");k.style.width="2em";var h=document.createElement("span");h.className="ak_filter_tab_icon_container btn btn-default";akeeba.System.addEventListener(h,"click",function(){var b={root:akeeba.System.data.get(this.parentNode.parentNode,"root"),verb:"remove"};akeeba.Fsfilters.toggle(b,this,
function(b,c){if(!0==b.success){var m=c.parentNode.parentNode;m.parentNode.removeChild(m)}})});var c=document.createElement("span");c.className="ak-toggle-button icon icon-trash deletebutton";h.appendChild(c);k.appendChild(h);h=document.createElement("td");h.style.width="2em";c=document.createElement("span");c.className="ak_filter_tab_icon_container btn btn-default";akeeba.System.addEventListener(c,"click",function(){var c=this.parentNode.parentNode,d=JSON.parse(akeeba.System.data.get(c,"def","{}"));
akeeba.System.data.get(c,"root");var e=document.getElementById("akEditorDialog");""==d.driver&&(d.driver="mysqli");document.getElementById("ake_driver").value=d.driver;document.getElementById("ake_host").value=d.host;document.getElementById("ake_username").value=d.username;document.getElementById("ake_password").value=d.password;document.getElementById("ake_database").value=d.database;document.getElementById("ake_prefix").value=d.prefix;try{var f=document.getElementById("ak_editor_notifier");f.parentNode.removeChild(f)}catch(g){}akeeba.System.addEventListener(document.getElementById("akEditorBtnDefault"),
"click",function(){try{var a=document.getElementById("ak_editor_notifier");a.parentNode.removeChild(a)}catch(c){}a=document.createElement("div");a.className="alert alert-info alert-dismissable";a.id="ak_editor_notifier";a.insertAdjacentHTML("afterbegin",'<span type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</span>');var d=document.createElement("span");d.id="ak_editor_notifier_content";a.appendChild(d);var e=document.createElement("img");e.setAttribute("border",0);e.setAttribute("src",
akeeba.Multidb.loadingGif);d.appendChild(e);e=document.createElement("span");e.textContent=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_LOADING");d.appendChild(e);document.getElementById("ak_editor_table").insertAdjacentHTML("beforebegin",a.outerHTML);a=document.getElementById("ake_driver");a=a.options[a.selectedIndex];a=null==a?"":a.value;a={verb:"test",root:b,data:{host:document.getElementById("ake_host").value,driver:a,port:document.getElementById("ake_port").value,user:document.getElementById("ake_username").value,
password:document.getElementById("ake_password").value,database:document.getElementById("ake_database").value,prefix:document.getElementById("ake_prefix").value}};a={action:JSON.stringify(a)};akeeba.System.doAjax(a,function(a){var b=document.getElementById("ak_editor_notifier_content");!0==a.status?b.textContent=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTOK"):b.innerHTML=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTFAIL")+"<br/><code>"+a.message+"</code>"},function(a){document.getElementById("ak_editor_notifier_content").textContent=
Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_CONNECTFAIL");"object"==typeof akeeba.Multidb.modalDialog&&akeeba.Multidb.modalDialog.close&&akeeba.Multidb.modalDialog.close();akeeba.System.params.errorCallback(a)},!1,15E3)});d=document.getElementById("akEditorBtnSave");akeeba.System.removeEventListener(d,"click");akeeba.System.addEventListener(d,"click",function(){try{var a=document.getElementById("ak_editor_notifier");a.parentNode.removeChild(a)}catch(e){}a=document.createElement("div");a.className=
"alert alert-info alert-dismissable";a.id="ak_editor_notifier";a.insertAdjacentHTML("afterbegin",'<span type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</span>');var d=document.createElement("span");d.id="ak_editor_notifier_content";a.appendChild(d);var f=document.createElement("img");f.setAttribute("border",0);f.setAttribute("src",akeeba.Multidb.loadingGif);d.appendChild(f);f=document.createElement("span");f.textContent=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_LOADING");
d.appendChild(f);document.getElementById("ak_editor_table").insertAdjacentHTML("beforebegin",a.outerHTML);var a=document.getElementById("ake_driver"),a=a.options[a.selectedIndex],a=null==a?"":a.value,g={verb:"set",root:b,data:{host:document.getElementById("ake_host").value,driver:a,port:document.getElementById("ake_port").value,username:document.getElementById("ake_username").value,password:document.getElementById("ake_password").value,database:document.getElementById("ake_database").value,prefix:document.getElementById("ake_prefix").value,
dumpFile:String(b).substr(0,9)+document.getElementById("ake_database").value+".sql"}},a={action:JSON.stringify(g)};akeeba.System.doAjax(a,function(a){!0!=a?document.getElementById("ak_editor_notifier_content").textContent=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_SAVEFAIL"):(akeeba.System.data.set(c,"def",JSON.stringify(g.data)),c.querySelectorAll("td"),c.querySelector("span.ak_dbhost").textContent=g.data.host,c.querySelector("span.ak_dbname").textContent=g.data.database,-1==c.querySelector("span.editbutton").className.indexOf("icon-pencil")&&
(c.querySelector("span.deletebutton").parentNode.style.display="inline-block",a=c.querySelector("span.editbutton"),akeeba.System.removeClass(a,"icon-plus-circle"),akeeba.System.addClass(a,"icon-pencil ak-toggle-button"),akeeba.Multidb.addNewRecordButton(c.parentNode)),"object"==typeof akeeba.Multidb.modalDialog&&akeeba.Multidb.modalDialog.close&&akeeba.Multidb.modalDialog.close())},function(a){document.getElementById("ak_editor_notifier_content").textContent=Joomla.JText._("COM_AKEEBA_MULTIDB_GUI_LBL_SAVEFAIL");
"object"==typeof akeeba.Multidb.modalDialog&&akeeba.Multidb.modalDialog.close&&akeeba.Multidb.modalDialog.close();akeeba.System.params.errorCallback(a)},!1,15E3)});d=document.getElementById("akEditorBtnCancel");akeeba.System.removeEventListener(d,"click");akeeba.System.addEventListener(d,"click",function(){"object"==typeof akeeba.Multidb.modalDialog&&akeeba.Multidb.modalDialog.close&&akeeba.Multidb.modalDialog.close()});akeeba.Multidb.modalDialog=akeeba.Modal.open({inherit:e,width:"80%"});akeeba.System.triggerEvent(e.querySelector("span"),
"focus")});var e=document.createElement("span");e.className="fa icon-pencil editbutton ak-toggle-button";c.appendChild(e);h.appendChild(c);c=document.createElement("td");c.className="ak_filter_item";e=document.createElement("span");e.className="ak_filter_name ak_dbhost";e.textContent=f.host;c.appendChild(e);e=document.createElement("td");e.className="ak_filter_item";var l=document.createElement("span");l.className="ak_filter_name ak_dbname";l.textContent=f.database;e.appendChild(l);g.appendChild(k);
g.appendChild(h);g.appendChild(c);g.appendChild(e);n.appendChild(g)};akeeba.Multidb.addNewRecordButton=function(b){var f=Math.uuid();akeeba.Multidb.addRow(f,{host:"",port:"",username:"",password:"",database:"",prefix:""},b);b=document.getElementById("ak_list_contents").children;b=b[b.length-1].querySelectorAll("td");b[0].querySelector("span").style.display="none";b=b[1].querySelectorAll("span");b=b[b.length-1];akeeba.System.removeClass(b,"icon-pencil");akeeba.System.addClass(b,"icon-plus-circle ak-toggle-button")}; //# sourceMappingURL=MultipleDatabases.min.map

Copyright © 2019 by b0y-101