Gestion download au travers de premiumizeme
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB

  1. "use strict";
  2. function subURL() {
  3. $("body").css("cursor", "progress");
  4. var lines = $('#urls').val().split('\n');
  5. var url = [];
  6. $.each(lines, function(){
  7. if ('' === $.trim(this)) {
  8. alert('Pas de liens ?');
  9. return;
  10. }
  11. url.push($.trim(this));
  12. });
  13. if (url.length != 0) {
  14. $.ajax({
  15. url: "/download/",
  16. type: 'post',
  17. data: {
  18. myurls: url,
  19. dtype: dtype.value,
  20. worker: worker.value
  21. },
  22. dataType: 'json',
  23. success: function(data) {
  24. $("body").css("cursor", "auto");
  25. location.reload();
  26. },
  27. error: function(xhr, err) {
  28. $("body").css("cursor", "auto");
  29. alert(err);
  30. }
  31. });
  32. } else {
  33. $("body").css("cursor", "auto");
  34. }
  35. }
  36. function wipe(type, status)
  37. {
  38. $.ajax({
  39. url: "/cleanList/",
  40. type: 'get',
  41. data: {
  42. type: type,
  43. state: status
  44. },
  45. dataType: 'json',
  46. async: false,
  47. success: function(data) {
  48. $("body").css("cursor", "auto");
  49. location.reload();
  50. },
  51. error: function(xhr, err) {
  52. $("body").css("cursor", "auto");
  53. alert('ERR');
  54. }
  55. });
  56. }