Nordcast is a podcast streaming app by koyu.space
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.

193 lines
10KB

  1. <script src="https://web.nordcast.app/jquery.js"></script>
  2. <script>
  3. $(document).ready(function() {
  4. $.get("https://api.nordcast.app/api/v1/getfeatured/de", function(data) {
  5. data.forEach(function(el) {
  6. $("textarea#getfeatured_de").val($("textarea#getfeatured_de").val()+el[0]+"#"+el[1]);
  7. });
  8. });
  9. $.get("https://api.nordcast.app/api/v1/getfeatured/ca", function(data) {
  10. data.forEach(function(el) {
  11. $("textarea#getfeatured_en").val($("textarea#getfeatured_en").val()+el[0]+"#"+el[1]);
  12. });
  13. });
  14. $.get("https://api.nordcast.app/api/v1/gethiddendownloads", function(data) {
  15. $("textarea#gethiddendownloads").val(data);
  16. });
  17. $.get("https://api.nordcast.app/api/v1/gethiddendownloads", function(data) {
  18. $("textarea#gethiddendownloads").val(data);
  19. });
  20. $.get("https://api.nordcast.app/api/v1/gethiddenauthors", function(data) {
  21. $("textarea#gethiddenauthors").val(data);
  22. });
  23. $.get("https://api.nordcast.app/api/v1/gethiddensubtitles", function(data) {
  24. $("textarea#gethiddensubtitles").val(data);
  25. });
  26. $.get("https://api.nordcast.app/api/v1/getoriginals/de", function(data) {
  27. $("textarea#getoriginals_de").val(data["podlist"]);
  28. });
  29. $.get("https://api.nordcast.app/api/v1/getoriginals/ca", function(data) {
  30. $("textarea#getoriginals_en").val(data["podlist"]);
  31. });
  32. $.get("https://api.nordcast.app/api/v1/getcustomsection/de", function(data) {
  33. $("textarea#getcustom_de").val(data);
  34. });
  35. $.get("https://api.nordcast.app/api/v1/getcustomsection/ca", function(data) {
  36. $("textarea#getcustom_en").val(data);
  37. });
  38. $.get("https://api.nordcast.app/api/v1/getreversed", function(data) {
  39. $("textarea#getreversed").val(data);
  40. });
  41. $("#submit_featured").click(function() {
  42. $("#submit_featured").attr("disabled", "");
  43. $("#submit_featured").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  44. $.post("https://api.nordcast.app/api/v1/admin/featured/"+$("#admin_id").val()+"/de", {content: $("#getfeatured_de").val()}, function(data) {
  45. if (data["action"] === "success") {
  46. $("#submit_featured").removeAttr("disabled");
  47. $("#submit_featured").html("Submit");
  48. }
  49. });
  50. $("#submit_featured").attr("disabled", "");
  51. $("#submit_featured").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  52. $.post("https://api.nordcast.app/api/v1/admin/featured/"+$("#admin_id").val()+"/ca", {content: $("#getfeatured_en").val()}, function(data) {
  53. if (data["action"] === "success") {
  54. $("#submit_featured").removeAttr("disabled");
  55. $("#submit_featured").html("Submit");
  56. }
  57. });
  58. });
  59. $("#submit_originals").click(function() {
  60. $("#submit_originals").attr("disabled", "");
  61. $("#submit_originals").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  62. $.post("https://api.nordcast.app/api/v1/admin/originals/"+$("#admin_id").val()+"/de", {content: $("#getoriginals_de").val()}, function(data) {
  63. if (data["action"] === "success") {
  64. $("#submit_originals").removeAttr("disabled");
  65. $("#submit_originals").html("Submit");
  66. }
  67. });
  68. $("#submit_originals").attr("disabled", "");
  69. $("#submit_originals").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  70. $.post("https://api.nordcast.app/api/v1/admin/originals/"+$("#admin_id").val()+"/ca", {content: $("#getoriginals_en").val()}, function(data) {
  71. if (data["action"] === "success") {
  72. $("#submit_originals").removeAttr("disabled");
  73. $("#submit_originals").html("Submit");
  74. }
  75. });
  76. });
  77. $("#submit_custom").click(function() {
  78. $("#submit_custom").attr("disabled", "");
  79. $("#submit_custom").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  80. $.post("https://api.nordcast.app/api/v1/admin/custom/"+$("#admin_id").val()+"/de", {content: $("#getcustom_de").val()}, function(data) {
  81. if (data["action"] === "success") {
  82. $("#submit_custom").removeAttr("disabled");
  83. $("#submit_custom").html("Submit");
  84. }
  85. });
  86. $("#submit_custom").attr("disabled", "");
  87. $("#submit_custom").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  88. $.post("https://api.nordcast.app/api/v1/admin/custom/"+$("#admin_id").val()+"/ca", {content: $("#getcustom_en").val()}, function(data) {
  89. if (data["action"] === "success") {
  90. $("#submit_custom").removeAttr("disabled");
  91. $("#submit_custom").html("Submit");
  92. }
  93. });
  94. });
  95. $("#submit_hiddendownloads").click(function() {
  96. $("#submit_hiddendownloads").attr("disabled", "");
  97. $("#submit_hiddendownloads").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  98. $.post("https://api.nordcast.app/api/v1/admin/hiddendownloads/"+$("#admin_id").val(), {content: $("#gethiddendownloads").val()}, function(data) {
  99. if (data["action"] === "success") {
  100. $("#submit_hiddendownloads").removeAttr("disabled");
  101. $("#submit_hiddendownloads").html("Submit");
  102. }
  103. });
  104. });
  105. $("#submit_hiddenauthors").click(function() {
  106. $("#submit_hiddenauthors").attr("disabled", "");
  107. $("#submit_hiddenauthors").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  108. $.post("https://api.nordcast.app/api/v1/admin/hiddenauthors/"+$("#admin_id").val(), {content: $("#gethiddenauthors").val()}, function(data) {
  109. if (data["action"] === "success") {
  110. $("#submit_hiddenauthors").removeAttr("disabled");
  111. $("#submit_hiddenauthors").html("Submit");
  112. }
  113. });
  114. });
  115. $("#submit_hiddensubtitles").click(function() {
  116. $("#submit_hiddensubtitles").attr("disabled", "");
  117. $("#submit_hiddensubtitles").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  118. $.post("https://api.nordcast.app/api/v1/admin/hiddensubtitles/"+$("#admin_id").val(), {content: $("#gethiddensubtitles").val()}, function(data) {
  119. if (data["action"] === "success") {
  120. $("#submit_hiddensubtitles").removeAttr("disabled");
  121. $("#submit_hiddensubtitles").html("Submit");
  122. }
  123. });
  124. });
  125. $("#submit_reversed").click(function() {
  126. $("#submit_reversed").attr("disabled", "");
  127. $("#submit_reversed").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  128. $.post("https://api.nordcast.app/api/v1/admin/reversed/"+$("#admin_id").val(), {content: $("#getreversed").val()}, function(data) {
  129. if (data["action"] === "success") {
  130. $("#submit_reversed").removeAttr("disabled");
  131. $("#submit_reversed").html("Submit");
  132. }
  133. });
  134. });
  135. $("#submit_banner").click(function() {
  136. $("#submit_banner").attr("disabled", "");
  137. $("#submit_banner").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  138. $("#error").attr("style", "display:none;color:red;");
  139. try {
  140. var fd = new FormData();
  141. var file = $("#banner")[0].files[0];
  142. fd.append('banner', file);
  143. $.ajax({
  144. url: "https://api.nordcast.app/api/v1/admin/banner/"+$("#admin_id").val(),
  145. type: 'post',
  146. data: fd,
  147. contentType: false,
  148. processData: false,
  149. success: function(data){
  150. if (data["action"] === "success") {
  151. $("#submit_banner").removeAttr("disabled");
  152. $("#submit_banner").html("Submit");
  153. $("#banner").val("");
  154. } else {
  155. $("#submit_banner").removeAttr("disabled");
  156. $("#submit_banner").html("Submit");
  157. $("#banner").val("");
  158. $("#error").attr("style", "color:red;");
  159. }
  160. },
  161. }).error(function() {
  162. $("#submit_banner").removeAttr("disabled");
  163. $("#submit_banner").html("Submit");
  164. $("#banner").val("");
  165. $("#error").attr("style", "color:red;");
  166. });
  167. } catch (e) {
  168. $("#submit_banner").removeAttr("disabled");
  169. $("#submit_banner").html("Submit");
  170. $("#banner").val("");
  171. $("#error").attr("style", "color:red;");
  172. }
  173. });
  174. var userLang = navigator.language || navigator.userLanguage;
  175. if (userLang.includes("de")) {
  176. $(".text-intro").html("Die Podcast-App von koyu.space");
  177. $("#privacypolicy").html("Datenschutz");
  178. $("#sourcecode").html("Quellcode");
  179. $(".gplay").attr("src", "https://play.google.com/intl/en_us/badges/images/generic/de_badge_web_generic.png");
  180. $(".appstore").attr("src", "https://www.apple.com/de/itunes/link/images/link_badge_appstore_large.png");
  181. $("#post-15 > div > div > small").html("(Bald verfügbar)");
  182. }
  183. });
  184. </script>