let connection = ""; function start(ip){ linkcss = document.createElement("link"); linkcss.rel = "stylesheet";linkcss.type = "text/css"; linkcss.href = "https://codelosophy.com/API/1.0/wcag_reports/wcga_style.css"; document.getElementsByTagName("HEAD")[0].appendChild(linkcss); $.ajax({ type: "POST", async:true, url: "https://codelosophy.com/API/1.0/wcag_reports/tools/", data:{ "API_ID":"NTQ1MTJkYzdhMWVjOGQ1MDM4ZDFhYzE5MzdkOTA1MzU=","CALLBACK":window.location.protocol + "//" + document.location.hostname,"CLIENT": ip, "PATH": encodeURI(document.location.href)}, success:function(response){connection=response;connect()}, error:function(response){connection=response;disconect()} }); } $(document).on("focus","bts-help-readerDummy",function(){ $.ajax({ type: "POST", async:true, url: "https://codelosophy.com/API/1.0/wcag_reports/tools/blind_focus.php", data:{ "API_ID":"NTQ1MTJkYzdhMWVjOGQ1MDM4ZDFhYzE5MzdkOTA1MzU=","CALLBACK":window.location.protocol + "//" + document.location.hostname,"CLIENT": ip, "PATH": encodeURI(document.location.href)}, success:function(response){console.log("...")} }); }) function connect(){ if ( connection.type == "success" ){ var link = document.createElement("a"); link.href = "https://codelosophy.com/wcga-report-webpage/e6f884e615731b57318abbb2cc5546e62e021b9d/?url=" + encodeURI(document.location.href); link.style.display="none"; link.text = "Report WCGA Fail on this Page"; document.body.prepend(link); var link1 = document.createElement("a"); link1.href = "https://codelosophy.com/wcga-report-webpage/e6f884e615731b57318abbb2cc5546e62e021b9d/?url=" + encodeURI(document.location.href); link1.id = "bts-help-readerDummy"; link1.innerHTML = ""; document.body.prepend(link1); console.log("BTS Helper Loaded..."); }else{ console.error(connection.message); } } function disconect(){ connection = connection.responseJSON; console.error("Fail loading reports tools..."); if ( connection.type == "error" ) console.error(connection.message) } function getUserIp(){ $.getJSON("https://codelosophy.com/API/1.0/wcag_reports/tools/getUserIp.php", function(data) { start(data.ip); }); } getUserIp();