Current Path :
/
home
/
develito
/
public_html
/
media
/
lib_eshiol_j2xml
/
js
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/public_html/media/lib_eshiol_j2xml/js/j2xml.min.js
(function(){var a=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];console=window.console=window.console||{};a.forEach(function(b){if(!console[b]){console[b]=function(){}}})}());if(typeof(eshiol)==="undefined"){eshiol={}}if(typeof(eshiol.j2xml)==="undefined"){eshiol.j2xml={}}if(typeof(eshiol.j2xml.convert)==="undefined"){eshiol.j2xml.convert=[]}eshiol.j2xml.version="20.5.348";console.log("j2xml Library v"+eshiol.j2xml.version);eshiol.j2xml.send=function(c,b,a){console.log("eshiol.j2xml.send");if(c.length>0){item=c.shift();console.log(item);jQuery.ajax({type:"POST",url:"index.php?option=com_j2xml&task=cpanel.import&format=json",data:{j2xml_data:item},success:function(d,f,e){console.log("done");console.log(d);if(!d.success&&d.message){eshiol.renderMessages({error:[d.message]})}else{if(d.messages){eshiol.renderMessages(d.messages)}}},dataType:"json"}).always(function(){console.log("always");b++;if(b==a){button.innerHTML=button_text+"ed... 100%";setTimeout(function(){button.innerHTML=button_text},2000)}else{x=Math.floor(b/a*100);button.innerHTML=button_text+"ing... "+x+"%"}document.getElementById("j-main-container").scrollIntoView();eshiol.j2xml.send(c,b,a)})}};eshiol.j2xml.importer=function(c,b){console.log("eshiol.j2xml.importer");console.log(c);console.log(b);console.log("filetype: "+jQuery("#"+c+"_filetype").val());switch(jQuery("#"+c+"_filetype").val()){case"2":if(jQuery("#"+c+"_url").val()){return false}else{alert("Please select a file");return true}break;case"3":if(jQuery("#"+c+"_server").val()){return false}else{alert("Please select a file");return true}break;default:if(!jQuery("#"+c+"_local").val()){alert("Please select a file");return true}break}if(!window.File||!window.FileReader||!window.FileList||!window.Blob){alert("The File APIs are not fully supported in this browser.");return false}Joomla.removeMessages();var a=[];input=jQuery("#"+c+"_local");if(!input){alert("Um, couldn't find the fileinput element.");return false}input=input[0];if(!input.files){alert("This browser doesn't seem to support the `files` property of file inputs.");return false}if(!input.files[0]){alert("Please select a file before clicking 'Load'");return false}output_default=jQuery("#"+c+"_upload").find("span")[0].html;file=input.files[0];jQuery("#"+c+"_local").val("");jQuery("#"+c+"_local1").val("");fr=new FileReader();fr.onload=function(){var d=fr.result;eshiol.j2xml.convert.forEach(function(e){d=e(d)});var g;var k=Array();try{g=jQuery.parseXML(d);$xml=jQuery(g);root=$xml.find(":root")[0];if(root.nodeName=="j2xml"){console.log(jQuery(root).attr("version"));$root=jQuery(root);var j='<?xml version="1.0" encoding="UTF-8" ?>\n<j2xml version="'+$root.attr("version")+'">\n';var i="\n</j2xml>";$root.children("field").each(function(e){k.push(j+eshiol.XMLToString(this)+i)});$root.children("user").each(function(e){k.push(j+eshiol.XMLToString(this)+i)});$root.children("tag").each(function(e){k.push(j+eshiol.XMLToString(this)+i)});$root.children("category").each(function(e){k.push(j+eshiol.XMLToString(this)+i)});var f="";if($root.children("base").length){f=eshiol.XMLToString($root.children("base")[0])}$root.children("content").each(function(e){k.push(j+f+eshiol.XMLToString(this)+i)});$root.children().each(function(e){if(["base","field","user","tag","category","content"].indexOf(this.nodeName)==-1){k.push(j+eshiol.XMLToString(this)+i)}})}else{k.push(d)}}catch(h){var k=[d]}tot=k.length;if(tot==0){return true}n=0;button=jQuery("#"+c+"_upload").find("span")[0];button_text=button.innerHTML;button.innerHTML=button_text+"ing... 0%";eshiol.j2xml.send(k,n,tot)};fr.readAsText(file);return true};