Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getUrlParameters(parameter, staticURL, decode){
- var currLocation = (staticURL.length)? staticURL : window.location.search,
- parArr = currLocation.split("?")[1].split("&"),
- returnBool = true;
- for(var i = 0; i < parArr.length; i++){
- parr = parArr[i].split("=");
- if(parr[0] == parameter){
- return (decode) ? decodeURIComponent(parr[1]) : parr[1];
- returnBool = true;
- }else{
- returnBool = false;
- }
- }
- if(!returnBool) return false;
- }
- $("#url").attr("href",url);
- var url = getUrlParameters("url", "", true);
- var data = window.atob(url);
- //alert(data);
- //alert(url);
- var downloadButton = document.getElementById("espera");
- var url = document.getElementById("url").href=("http://")+data;
- var counter = 10;
- var newElement = document.createElement("p");
- newElement.innerHTML = "Você poderá baixar seu arquivo em 10 segundos.";
- var id;
- downloadButton.parentNode.replaceChild(newElement, downloadButton);
- id = setInterval(function() {
- counter--;
- if(counter < 0) {
- newElement.parentNode.replaceChild(downloadButton, newElement);
- clearInterval(id);
- } else {
- newElement.innerHTML = "Você poderá baixar seu arquivo em " + counter.toString() + " segundos.";
- }
- }, 1000);
Add Comment
Please, Sign In to add comment