📤📚 A small utility to share content on the internet. Files are served raw, no transcoding or special magic. Uploading requires a password. https://picopublish.sequentialread.com/
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.

49 lines
1.8 KiB

2 months ago
3 months ago
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>picopublish</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <link rel="stylesheet" type="text/css" href="/static/application.css">
  9. <link rel="stylesheet" type="text/css" href="{{ .CaptchaURL }}/static/captcha.css">
  10. <script src="{{ .CaptchaURL }}/static/captcha.js?v=3"></script>
  11. </head>
  12. <body>
  13. <div class="header">
  14. <h3>PicoPublish</h3>
  15. <div style="float:right; padding-right:20px;">
  16. <a href="https://git.sequentialread.com/forest/picopublish">source code</a>
  17. </div>
  18. </div>
  19. <div class="header-shadow"></div>
  20. <div class="splash content">
  21. <h3>Please wait for a moment...</h3>
  22. <form method="POST" action="" style="font-size: 11px;">
  23. <input type="hidden" name="challenge" value="{{ .Challenge }}" />
  24. <input type="hidden" name="nonce" />
  25. <div class="captcha-container"
  26. data-sqr-captcha-url="{{ .CaptchaURL }}"
  27. data-sqr-captcha-challenge="{{ .Challenge }}"
  28. data-sqr-captcha-callback="myCaptchaCallback">
  29. </div>
  30. </form>
  31. </div>
  32. <script>
  33. window.myCaptchaCallback = (nonce) => {
  34. document.querySelector("form input[name='nonce']").value = nonce;
  35. setTimeout(function() {
  36. document.querySelector("form").submit();
  37. }, 500);
  38. };
  39. // note its important that the CSS is already loaded at this point,
  40. // otherwise the script will wait to create the captcha element
  41. // until the css is loaded, and so code inside sqrCaptchaTrigger will fail
  42. // because it will try to update the captcha element that doesn't exist yet.
  43. window.sqrCaptchaInit();
  44. window.sqrCaptchaTrigger();
  45. </script>
  46. </body>
  47. </html>