This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated repo to match June 20th changes
- Loading branch information
1 parent
fb4fca4
commit 7241a12
Showing
6 changed files
with
199 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
var start; | ||
var timer; | ||
var email; | ||
$(document).ready(function() | ||
{ | ||
if ($("#email").val() != "") | ||
{ | ||
$("#download").val("Send to Email"); | ||
} | ||
}); | ||
|
||
$("#download").click(function() { | ||
if (!$(this).hasClass("disabled")) | ||
{ | ||
$(this).addClass("disabled"); | ||
$.post("parser.php", $("#form").serialize()) | ||
.always(function() { | ||
$(this).val("Submitting..."); | ||
}) | ||
.done(function(data) { | ||
if (data == "done") | ||
{ | ||
$(this).val("Waiting..."); | ||
email = $("#email").val(); | ||
start = Date.now(); | ||
timer = setInterval(checkDownload, 1000); | ||
} | ||
else | ||
{ | ||
$("#download").val("Error!"); | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
$('#email').keyup(function() { | ||
if ($(this).val() != "") | ||
{ | ||
$("#download").val("Send to Email"); | ||
} | ||
else | ||
{ | ||
$("#download").val("Download"); | ||
} | ||
}); | ||
|
||
function checkDownload() | ||
{ | ||
$.get("process.php", function(data) { | ||
if (data == "waiting") | ||
{ | ||
var seconds = Math.abs((Date.now() - start) / 1000); | ||
$("#download").val("Waiting. " + Math.floor(seconds) + "s..."); | ||
} | ||
else if (data == "done") | ||
{ | ||
clearInterval(timer); | ||
if (email === "") | ||
{ | ||
window.location.replace("http://ficsave.com/process.php?get"); | ||
} | ||
else | ||
{ | ||
$("#download").val("Email Sent!"); | ||
} | ||
$("#download").removeClass("disabled"); | ||
} | ||
else | ||
{ | ||
clearInterval(timer); | ||
$("#download").val("Error!"); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters