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.

342 lines
16KB

  1. <div style="float: right; display: inline-flex; margin-right: 18px;">
  2. <span style="margin-right: 16px;margin-top:3px;">Dark mode:</span>
  3. <div class="button-switch">
  4. <input type="checkbox" id="cdark__mode" class="switch" />
  5. </div>
  6. </div>
  7. <script src="https://web.nordcast.app/jquery.js"></script>
  8. <script>
  9. // Thanks to https://stackoverflow.com/questions/9979415/dynamically-load-and-unload-stylesheets
  10. function loadjscssfile(filename, filetype){
  11. if (filetype === "js") {
  12. var fileref = document.createElement('script');
  13. fileref.setAttribute("type","text/javascript");
  14. fileref.setAttribute("src", filename);
  15. } else if (filetype === "css") {
  16. var fileref = document.createElement("link");
  17. fileref.setAttribute("rel", "stylesheet");
  18. fileref.setAttribute("type", "text/css");
  19. fileref.setAttribute("href", filename);
  20. }
  21. if (typeof fileref!="undefined") {
  22. document.getElementsByTagName("head")[0].appendChild(fileref);
  23. }
  24. }
  25. function removejscssfile(filename, filetype){
  26. var targetelement = (filetype=="js")? "script" : (filetype=="css")? "link" : "none";
  27. var targetattr = (filetype=="js")? "src" : (filetype=="css")? "href" : "none";
  28. var allsuspects = document.getElementsByTagName(targetelement);
  29. for (var i=allsuspects.length; i>=0; i--) {
  30. if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1) {
  31. allsuspects[i].parentNode.removeChild(allsuspects[i]);
  32. }
  33. }
  34. }
  35. $(document).ready(function() {
  36. try {
  37. if (localStorage.getItem("darkmode") === "true") {
  38. $("#cdark__mode").attr("checked", "");
  39. loadjscssfile("https://web.nordcast.app/dark.css", "css");
  40. $(".custom-logo").attr("src", "https://web.nordcast.app/logo_dark.png");
  41. } else {
  42. $("#cdark__mode").removeAttr("checked");
  43. $(".custom-logo").attr("src", "https://web.nordcast.app/logo.png");
  44. }
  45. } catch (e) {
  46. localStorage.setItem("darkmode", "false");
  47. }
  48. $("#cdark__mode").click(function() {
  49. if (localStorage.getItem("darkmode") === "true") {
  50. localStorage.setItem("darkmode", "false");
  51. $("#cdark__mode").removeAttr("checked", "");
  52. try {
  53. removejscssfile("https://web.nordcast.app/dark.css", "css");
  54. } catch (e) {}
  55. } else {
  56. localStorage.setItem("darkmode", "true");
  57. $("#cdark__mode").removeAttr("checked");
  58. loadjscssfile("https://web.nordcast.app/dark.css", "css");
  59. }
  60. if (localStorage.getItem("darkmode") === "true") {
  61. $(".custom-logo").attr("src", "https://web.nordcast.app/logo_dark.png?v="+new Date().getMilliseconds());
  62. $("#cdark__mode").removeAttr("checked");
  63. }
  64. if (localStorage.getItem("darkmode") === "false") {
  65. $(".custom-logo").attr("src", "https://web.nordcast.app/logo.png?v="+new Date().getMilliseconds());
  66. $("#cdark__mode").attr("checked", "");
  67. }
  68. });
  69. $.get("https://api.nordcast.app/api/v1/getfeatured/de", function(data) {
  70. data.forEach(function(el) {
  71. $("textarea#getfeatured_de").val($("textarea#getfeatured_de").val()+el[0]+"#"+el[1]);
  72. });
  73. });
  74. $.get("https://api.nordcast.app/api/v1/getfeatured/ca", function(data) {
  75. data.forEach(function(el) {
  76. $("textarea#getfeatured_en").val($("textarea#getfeatured_en").val()+el[0]+"#"+el[1]);
  77. });
  78. });
  79. $.get("https://api.nordcast.app/api/v1/gethiddendownloads", function(data) {
  80. $("textarea#gethiddendownloads").val(data);
  81. });
  82. $.get("https://api.nordcast.app/api/v1/gethiddendownloads", function(data) {
  83. $("textarea#gethiddendownloads").val(data);
  84. });
  85. $.get("https://api.nordcast.app/api/v1/gethiddenauthors", function(data) {
  86. $("textarea#gethiddenauthors").val(data);
  87. });
  88. $.get("https://api.nordcast.app/api/v1/gethiddensubtitles", function(data) {
  89. $("textarea#gethiddensubtitles").val(data);
  90. });
  91. $.get("https://api.nordcast.app/api/v1/getoriginals/de", function(data) {
  92. $("textarea#getoriginals_de").val(data["podlist"]);
  93. });
  94. $.get("https://api.nordcast.app/api/v1/getoriginals/ca", function(data) {
  95. $("textarea#getoriginals_en").val(data["podlist"]);
  96. });
  97. $.get("https://api.nordcast.app/api/v1/getcustomsection/de", function(data) {
  98. $("textarea#getcustom_de").val(data);
  99. });
  100. $.get("https://api.nordcast.app/api/v1/getcustomsection/ca", function(data) {
  101. $("textarea#getcustom_en").val(data);
  102. });
  103. $.get("https://api.nordcast.app/api/v1/getnotifications/de", function(data) {
  104. $("textarea#getnotifications_de").val(data);
  105. });
  106. $.get("https://api.nordcast.app/api/v1/getnotifications/ca", function(data) {
  107. $("textarea#getnotifications_en").val(data);
  108. });
  109. $.get("https://api.nordcast.app/api/v1/getreversed", function(data) {
  110. $("textarea#getreversed").val(data);
  111. });
  112. $("#submit_featured").click(function() {
  113. $("#submit_featured").attr("disabled", "");
  114. $("#submit_featured").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  115. $.post("https://api.nordcast.app/api/v1/admin/featured/"+$("#admin_id").val()+"/de", {content: $("#getfeatured_de").val()}, function(data) {
  116. if (data["action"] === "success") {
  117. $("#submit_featured").removeAttr("disabled");
  118. $("#submit_featured").html("Submit");
  119. }
  120. });
  121. $("#submit_featured").attr("disabled", "");
  122. $("#submit_featured").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  123. $.post("https://api.nordcast.app/api/v1/admin/featured/"+$("#admin_id").val()+"/ca", {content: $("#getfeatured_en").val()}, function(data) {
  124. if (data["action"] === "success") {
  125. $("#submit_featured").removeAttr("disabled");
  126. $("#submit_featured").html("Submit");
  127. }
  128. });
  129. });
  130. $("#submit_originals").click(function() {
  131. $("#submit_originals").attr("disabled", "");
  132. $("#submit_originals").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  133. $.post("https://api.nordcast.app/api/v1/admin/originals/"+$("#admin_id").val()+"/de", {content: $("#getoriginals_de").val()}, function(data) {
  134. if (data["action"] === "success") {
  135. $("#submit_originals").removeAttr("disabled");
  136. $("#submit_originals").html("Submit");
  137. }
  138. });
  139. $("#submit_originals").attr("disabled", "");
  140. $("#submit_originals").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  141. $.post("https://api.nordcast.app/api/v1/admin/originals/"+$("#admin_id").val()+"/ca", {content: $("#getoriginals_en").val()}, function(data) {
  142. if (data["action"] === "success") {
  143. $("#submit_originals").removeAttr("disabled");
  144. $("#submit_originals").html("Submit");
  145. }
  146. });
  147. });
  148. $("#submit_custom").click(function() {
  149. $("#submit_custom").attr("disabled", "");
  150. $("#submit_custom").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  151. $.post("https://api.nordcast.app/api/v1/admin/custom/"+$("#admin_id").val()+"/de", {content: $("#getcustom_de").val()}, function(data) {
  152. if (data["action"] === "success") {
  153. $("#submit_custom").removeAttr("disabled");
  154. $("#submit_custom").html("Submit");
  155. }
  156. });
  157. $("#submit_custom").attr("disabled", "");
  158. $("#submit_custom").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  159. $.post("https://api.nordcast.app/api/v1/admin/custom/"+$("#admin_id").val()+"/ca", {content: $("#getcustom_en").val()}, function(data) {
  160. if (data["action"] === "success") {
  161. $("#submit_custom").removeAttr("disabled");
  162. $("#submit_custom").html("Submit");
  163. }
  164. });
  165. });
  166. $("#submit_notifications").click(function() {
  167. $("#submit_notifications").attr("disabled", "");
  168. $("#submit_notifications").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  169. $.post("https://api.nordcast.app/api/v1/admin/notifications/"+$("#admin_id").val()+"/de", {content: $("#getnotifications_de").val()}, function(data) {
  170. if (data["action"] === "success") {
  171. $("#submit_notifications").removeAttr("disabled");
  172. $("#submit_notifications").html("Submit");
  173. }
  174. });
  175. $("#submit_notifications").attr("disabled", "");
  176. $("#submit_notifications").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  177. $.post("https://api.nordcast.app/api/v1/admin/notifications/"+$("#admin_id").val()+"/ca", {content: $("#getnotifications_en").val()}, function(data) {
  178. if (data["action"] === "success") {
  179. $("#submit_notifications").removeAttr("disabled");
  180. $("#submit_notifications").html("Submit");
  181. }
  182. });
  183. });
  184. $("#submit_hiddendownloads").click(function() {
  185. $("#submit_hiddendownloads").attr("disabled", "");
  186. $("#submit_hiddendownloads").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  187. $.post("https://api.nordcast.app/api/v1/admin/hiddendownloads/"+$("#admin_id").val(), {content: $("#gethiddendownloads").val()}, function(data) {
  188. if (data["action"] === "success") {
  189. $("#submit_hiddendownloads").removeAttr("disabled");
  190. $("#submit_hiddendownloads").html("Submit");
  191. }
  192. });
  193. });
  194. $("#submit_hiddenauthors").click(function() {
  195. $("#submit_hiddenauthors").attr("disabled", "");
  196. $("#submit_hiddenauthors").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  197. $.post("https://api.nordcast.app/api/v1/admin/hiddenauthors/"+$("#admin_id").val(), {content: $("#gethiddenauthors").val()}, function(data) {
  198. if (data["action"] === "success") {
  199. $("#submit_hiddenauthors").removeAttr("disabled");
  200. $("#submit_hiddenauthors").html("Submit");
  201. }
  202. });
  203. });
  204. $("#submit_hiddensubtitles").click(function() {
  205. $("#submit_hiddensubtitles").attr("disabled", "");
  206. $("#submit_hiddensubtitles").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  207. $.post("https://api.nordcast.app/api/v1/admin/hiddensubtitles/"+$("#admin_id").val(), {content: $("#gethiddensubtitles").val()}, function(data) {
  208. if (data["action"] === "success") {
  209. $("#submit_hiddensubtitles").removeAttr("disabled");
  210. $("#submit_hiddensubtitles").html("Submit");
  211. }
  212. });
  213. });
  214. $("#submit_reversed").click(function() {
  215. $("#submit_reversed").attr("disabled", "");
  216. $("#submit_reversed").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  217. $.post("https://api.nordcast.app/api/v1/admin/reversed/"+$("#admin_id").val(), {content: $("#getreversed").val()}, function(data) {
  218. if (data["action"] === "success") {
  219. $("#submit_reversed").removeAttr("disabled");
  220. $("#submit_reversed").html("Submit");
  221. }
  222. });
  223. });
  224. $("#submit_banner").click(function() {
  225. $("#submit_banner").attr("disabled", "");
  226. $("#submit_banner").html("<img src=\"https://koyu.keybase.pub/loading.svg\" style=\"height: 16px !important;\">");
  227. $("#error").attr("style", "display:none;color:red;");
  228. try {
  229. var fd = new FormData();
  230. var file = $("#banner")[0].files[0];
  231. fd.append('banner', file);
  232. $.ajax({
  233. url: "https://api.nordcast.app/api/v1/admin/banner/"+$("#admin_id").val(),
  234. type: 'post',
  235. data: fd,
  236. contentType: false,
  237. processData: false,
  238. success: function(data){
  239. if (data["action"] === "success") {
  240. $("#submit_banner").removeAttr("disabled");
  241. $("#submit_banner").html("Submit");
  242. $("#banner").val("");
  243. } else {
  244. $("#submit_banner").removeAttr("disabled");
  245. $("#submit_banner").html("Submit");
  246. $("#banner").val("");
  247. $("#error").attr("style", "color:red;");
  248. }
  249. },
  250. }).error(function() {
  251. $("#submit_banner").removeAttr("disabled");
  252. $("#submit_banner").html("Submit");
  253. $("#banner").val("");
  254. $("#error").attr("style", "color:red;");
  255. });
  256. } catch (e) {
  257. $("#submit_banner").removeAttr("disabled");
  258. $("#submit_banner").html("Submit");
  259. $("#banner").val("");
  260. $("#error").attr("style", "color:red;");
  261. }
  262. });
  263. var userLang = navigator.language || navigator.userLanguage;
  264. if (userLang.includes("de")) {
  265. $(".text-intro").html("Die Podcast-App von koyu.space");
  266. $("#privacypolicy").html("Datenschutz");
  267. $("#sourcecode").html("Quellcode");
  268. $(".gplay").attr("src", "https://play.google.com/intl/en_us/badges/images/generic/de_badge_web_generic.png");
  269. $(".appstore").attr("src", "https://www.apple.com/de/itunes/link/images/link_badge_appstore_large.png");
  270. $("#post-15 > div > div > small").html("(Bald verfügbar)");
  271. }
  272. });
  273. </script>
  274. <style>
  275. .button-switch {
  276. font-size: 18px;
  277. height: 1.875em;
  278. margin-bottom: 0.625em;
  279. position: relative;
  280. width: 3.6em;
  281. font-family: Tahoma, Geneva, sans-serif;
  282. }
  283. .button-switch .switch {
  284. -webkit-appearance: none;
  285. -moz-appearance: none;
  286. appearance: none;
  287. height: 0;
  288. font-size: 1em;
  289. left: 0;
  290. line-height: 0;
  291. outline: none;
  292. position: absolute;
  293. top: 0;
  294. width: 0;
  295. }
  296. .button-switch .switch:before, .button-switch .switch:after {
  297. content: '';
  298. font-size: 1em;
  299. position: absolute;
  300. }
  301. .button-switch .switch:before {
  302. border-radius: 1.25em;
  303. background: #bdc3c7;
  304. height: 1.875em;
  305. left: -0.25em;
  306. top: -0.1875em;
  307. transition: background-color 0.25s ease-out 0.1s;
  308. width: 3.6em;
  309. }
  310. .button-switch .switch:after {
  311. box-shadow: 0 0.0625em 0.375em 0 #666;
  312. border-radius: 50%;
  313. background: #fefefe;
  314. height: 1.5em;
  315. transform: translate(0, 0);
  316. transition: transform 0.25s ease-out 0.1s;
  317. width: 1.5em;
  318. }
  319. .button-switch .switch:checked:after {
  320. transform: translate(1.625em, 0);
  321. }
  322. .button-switch .switch.switch:checked:before {
  323. background: #3498db;
  324. }
  325. * {
  326. outline: 0 !important;
  327. }
  328. </style>