share.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. include("language.php");
  3. if(isset($_GET["url"]) || (isset($_GET["action"]) && $_GET["action"] == "send")) {
  4. $pagetitle = _("Share a link on Mastodon");
  5. $pageheading = _("Share a link with your followers");
  6. $shareurl = htmlspecialchars($_GET["url"]);
  7. if(isset($_GET["text"])) $sharetext = htmlspecialchars($_GET["text"])." ";
  8. else $sharetext = "";
  9. }
  10. else {
  11. $pagetitle = _("Post a Toot on Mastodon");
  12. $pageheading = _("What's happening?");
  13. $shareurl = "";
  14. $sharetext = "";
  15. }
  16. ?>
  17. <!DOCTYPE HTML>
  18. <html lang="en">
  19. <head>
  20. <meta charset="utf-8">
  21. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  22. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  23. <title><?=$pagetitle?></title>
  24. <link rel="shortcut icon" href="/assets/images/favicon.ico">
  25. <link rel="stylesheet" href="/assets/css/sharebox.css" media="all">
  26. <?php
  27. if(array_key_exists('darktheme',$_COOKIE)) {
  28. if($_COOKIE['darktheme'] == "true") echo '<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">';
  29. else if($_COOKIE['darktheme'] == "unset") {
  30. ?>
  31. <script>
  32. if(window.matchMedia("(prefers-color-scheme: dark)").matches)
  33. document.write('<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">');
  34. </script>
  35. <?php }} else {?>
  36. <script>
  37. if(window.matchMedia("(prefers-color-scheme: dark)").matches)
  38. document.write('<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">');
  39. </script>
  40. <?php } ?>
  41. <script src="/assets/js/jquery/jquery.min.js"></script>
  42. <script src="/assets/js/mastodon.js/mastodon.js"></script>
  43. <script src="/assets/js/autosize/autosize.js"></script>
  44. <script>
  45. var text_cantclose = "<?=_("Toot posted successfully but your browser doesn't allow closing the window")?>";
  46. var sendnow = <?php if(isset($_GET["action"]) && $_GET["action"] == "send" && !isset($_GET["url"]) && !isset($_GET["text"])) echo "true"; else echo "false"; ?>;
  47. </script>
  48. <script src="/assets/js/halcyon/halcyonSharebox.js"></script>
  49. </head>
  50. <body>
  51. <header id="header">
  52. <div class="header_nav_wrap">
  53. <nav class="header_left_box">
  54. <ul class="header_nav_list">
  55. <li id="header_nav_item_home" class="header_nav_item">
  56. <a href="/" id="home_nav">
  57. <img src="/assets/images/halcyon_logo.png" style="width:32px">
  58. </a>
  59. </li>
  60. </ul>
  61. </nav>
  62. <nav class="header_right_box">
  63. <ul class="header_nav_list">
  64. <li class="header_nav_item my_account_wrap loggedin" style="display:none">
  65. <a class="nav_profilelink">
  66. <button class="header_account_avatar">
  67. <div class="my_account">
  68. <img class="js_current_profile_image">
  69. </div>
  70. </button>
  71. </a>
  72. </li>
  73. <li class="header_nav_item toot_button_wrap loggedin" style="display:none">
  74. <a class="nav_profilelink">
  75. <div class="nav_username"></div>
  76. </a>
  77. </li>
  78. <li class="header_nav_item toot_button_wrap loggedout">
  79. <a href="https://instances.social">
  80. <span><?=_("Sign up")?> ›</span>
  81. </a>
  82. </li>
  83. </ul>
  84. </nav>
  85. </div>
  86. </header>
  87. <main id="main">
  88. <div class="article_wrap">
  89. <div class="content first">
  90. <span class="putmessage"></span>
  91. <form id="statusform" method="POST" action="/login/">
  92. <span class="pageheading"><?=$pageheading?></span>
  93. <textarea class="status_textarea"><?=$sharetext.$shareurl?></textarea>
  94. <div class="usernamebox loggedout">
  95. <label for="username"><?=_("Username")?></label>
  96. <input type="text" id="username" name="acct" placeholder="@johndoe@example.com">
  97. </div>
  98. <button type="submit" class="toot_button loggedout">
  99. <div class="toot_button_label">
  100. <span><?=_("Log in and Toot")?></span>
  101. </div>
  102. </button>
  103. <button class="toot_button loggedin" style="display:none">
  104. <div class="toot_button_label">
  105. <span><?=_("Toot")?></span>
  106. </div>
  107. </button>
  108. </form>
  109. </div>
  110. </div>
  111. </main>
  112. <main id="main" class="dark loggedout">
  113. <div class="article_wrap">
  114. <div class="content">
  115. <span class="pageheading"><?=_("New to Mastodon?")?></span>
  116. <a href="https://instances.social">
  117. <button class="toot_button">
  118. <div class="toot_button_label">
  119. <span><?=_("Sign up")?></span>
  120. </div>
  121. </button>
  122. </a><br/>
  123. <p><?=_("Get instant updates from your friends, industry experts, favorite celebrities, and what's happening around the world.")?></p>
  124. <p><a href="https://joinmastodon.org"><?=_("What is Mastodon? Learn more.")?></a></p>
  125. </div>
  126. </div>
  127. </main>
  128. </body>
  129. </html>