tab5.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. function validateDownloadForm()
  2. {
  3. document.getElementById("fsync-download-1-error").style.display = "none";
  4. document.getElementById("fsync-download-2-error").style.display = "none";
  5. if(document.getElementById("input-date-start").value == '')
  6. {
  7. //document.getElementById('input-date-stop').value = new Date().toDateInputValue();
  8. document.getElementById("fsync-download-1-error").style.display = "block";
  9. return false;
  10. }
  11. if(document.getElementById("input-date-start").value > document.getElementById("input-date-stop").value)
  12. {
  13. //document.getElementById('input-date-stop').value = new Date().toDateInputValue();
  14. document.getElementById("fsync-download-2-error").style.display = "block";
  15. return false;
  16. }
  17. return true;
  18. }
  19. function submitDownloadForm()
  20. {
  21. if(validateDownloadForm())
  22. {
  23. document.getElementById('download_log_form').submit();
  24. }
  25. }
  26. function clearLog()
  27. {
  28. document.getElementById('clear_btn').classList.remove('btn-blue');
  29. document.getElementById('clear_btn').innerHTML = '<img src="View/img/loader.gif" />';
  30. document.getElementById('clear_log_form').submit();
  31. }
  32. function checkLatestVersion()
  33. {
  34. var xhttp;
  35. xhttp = new XMLHttpRequest();
  36. xhttp.onreadystatechange = function() {
  37. if (this.readyState == 4 && this.status == 200) {
  38. if( this.responseText != '')
  39. {
  40. document.getElementById("check_latest_version_result").innerHTML = this.responseText;
  41. }
  42. }
  43. };
  44. xhttp.open("GET", "ajax.php?random=" + Math.random() + "&action&action=checkLatestVersion",true);
  45. xhttp.send();
  46. }