header.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. include("language.php");
  3. ?>
  4. <!DOCTYPE HTML>
  5. <html lang="en">
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. <title>Halcyon</title>
  11. <link rel="shortcut icon" href="/assets/images/favicon.ico">
  12. <link rel="gettext" type="text/x-gettext-translation" href="/locale/<?=$locale?>/LC_MESSAGES/messages.po">
  13. <link rel="stylesheet" href="/assets/css/style.css" media="all">
  14. <?php
  15. if(array_key_exists('darktheme',$_COOKIE)) {
  16. if($_COOKIE['darktheme'] == "true") echo '<link rel="stylesheet" href="/assets/css/dark.css" media="all">';
  17. else if($_COOKIE['darktheme'] == "unset") {
  18. ?>
  19. <script>
  20. if(window.matchMedia("(prefers-color-scheme: dark)").matches)
  21. document.write('<link rel="stylesheet" href="/assets/css/dark.css" media="all">');
  22. </script>
  23. <?php }} ?>
  24. <link rel="stylesheet" href="/assets/css/fontawesome.min.css" media="all">
  25. <link rel="stylesheet" href="/assets/css/emojipicker.css" media="all">
  26. <script src="/assets/js/jquery/jquery.min.js"></script>
  27. <script src="/assets/js/halcyon/halcyonFunctions.js"></script>
  28. <script src="/assets/js/mastodon.js/mastodon.js"></script><!-- thx @kirschn -->
  29. <script src="/assets/js/jquery-cookie/src/jquery.cookie.js"></script>
  30. <script src="/assets/js/autosize/autosize.js"></script>
  31. <script src="/assets/js/autocomplete/textarea.js"></script>
  32. <script src="/assets/js/shortcut.js"></script>
  33. <script src="/assets/js/replace_emoji.js"></script>
  34. <script src="/assets/js/blurhash.js"></script>
  35. <script src="/assets/js/emojipicker/emojidata.js"></script>
  36. <script src="/assets/js/emojipicker/emojipicker.js"></script>
  37. <script src="/assets/js/halcyon/halcyonTemplates.js"></script>
  38. <script src="/assets/js/halcyon/halcyonUI.js"></script>
  39. <script src="/assets/js/autocomplete/search.js"></script>
  40. <script src="/assets/js/pomo/pomo.js"></script>
  41. <script src="/assets/js/twemoji/twemoji.min.js"></script>
  42. <script src="/assets/js/clipboard.js/clipboard.min.js"></script>
  43. <script src="/assets/js/player/soundmanager.js"></script>
  44. <script src="/assets/js/player/audio.js"></script>
  45. <script>
  46. if(!localStorage.getItem("current_id") | !localStorage.getItem("current_instance") | !localStorage.getItem("current_authtoken")) {
  47. location.href = "/login";
  48. }
  49. else {
  50. Pomo.domain = 'messages';
  51. Pomo.returnStrings = true;
  52. Pomo.unescapeStrings = true;
  53. var pomo_def = Pomo.load(null,{
  54. format:'po',
  55. mode:'link',
  56. translation_domain:'messages'
  57. });
  58. var __ = (function(){
  59. var _ = !!window.Pomo? window.Pomo : (!!window.__Pomo? window.__Pomo: false);
  60. var gettext_wrap = function(word, options){return _.getText(word, options)};
  61. gettext_wrap = !!_? gettext_wrap: false;
  62. if(!gettext_wrap){
  63. throw new "Pomo can't be found";
  64. }
  65. return gettext_wrap;
  66. })();
  67. if($.cookie("session") === "true") {
  68. refreshApp();
  69. }
  70. else if($.cookie("session") === undefined) {
  71. resetApp();
  72. }
  73. }
  74. server_setting_youplay = <?=$config["Media"]["youplay"] ? "true" : "false"?>;
  75. server_setting_vimeo = <?=$config["Media"]["vimeo"] ? "true" : "false"?>;
  76. server_setting_unshorten = <?=$config["App"]["url_unshortener"] ? "true" : "false"?>;
  77. server_setting_invidious = <?=$config["Media"]["invidious"] ? "'".$config["Media"]["invidious"]."'" : "'invidiou.sh'"?>;
  78. server_setting_nitter = <?=$config["Media"]["nitter"] ? "'".$config["Media"]["nitter"]."'" : "'nitter.nixnet.xyz'"?>;
  79. </script>
  80. </head>
  81. <body>
  82. <header id="header">
  83. <div class="header_nav_wrap">
  84. <nav class="header_left_box">
  85. <ul class="header_nav_list">
  86. <li id="header_nav_item_home" class="header_nav_item">
  87. <a href="/" id="home_nav">
  88. <i class="fa fa-fw fa-home"></i>
  89. <span><?=_('Home')?></span>
  90. </a>
  91. <div class="home_badge nav_badge invisible"></div>
  92. </li>
  93. <li id="header_nav_item_local" class="header_nav_item local_nav">
  94. <a href="/local" id="local_nav">
  95. <i class="fa fa-fw fa-users"></i>
  96. <span><?=_('Local')?></span>
  97. </a>
  98. <div class="local_badge nav_badge invisible"></div>
  99. </li>
  100. <li id="header_nav_item_federated" class="header_nav_item federated_nav">
  101. <a href="/federated" id="federated_nav">
  102. <i class="fa fa-fw fa-globe"></i>
  103. <span><?=_('Federated')?></span>
  104. </a>
  105. <div class="federated_badge nav_badge invisible"></div>
  106. </li>
  107. <li id="header_nav_item_notifications" class="header_nav_item notifications_nav">
  108. <a href="/notifications" id="notifications_nav">
  109. <i class="fa fa-fw fa-bell"></i>
  110. <span><?=_('Notifications')?></span>
  111. </a>
  112. <div class="notification_badge nav_badge invisible"></div>
  113. </li>
  114. <li id="header_nav_item_lists" class="header_nav_item lists_nav">
  115. <a href="/lists" id="lists_nav">
  116. <i class="fa fa-fw fa-list"></i>
  117. <span><?=_('Lists')?></span>
  118. </a>
  119. <div class="lists_badge nav_badge invisible"></div>
  120. </li>
  121. </ul>
  122. </nav>
  123. <nav class="header_right_box">
  124. <ul class="header_nav_list">
  125. <li class="header_nav_item search_form_wrap">
  126. <form class="search_form" action="/search" method="GET">
  127. <input id="search_form" class="search_form_input" placeholder="<?=_('Search Mastodon')?>" type="text" name="q" accesskey="/" autocomplete="off">
  128. <span class="search_form_submit">
  129. <button type="submit">
  130. <i class="fa fa-fw fa-search"></i>
  131. </button>
  132. </span>
  133. </form>
  134. <nav class="header_search_suggestions invisible"></nav>
  135. </li>
  136. <li class="header_nav_item my_account_wrap">
  137. <button class="header_account_avatar">
  138. <div class="my_account">
  139. <img class="js_current_profile_image">
  140. </div>
  141. </button>
  142. <nav class="header_my_account_nav invisible">
  143. <ul>
  144. <li>
  145. <a class="js_current_profile_link emoji_poss">
  146. <span class="js_current_profile_displayname display_name"></span>
  147. <span><?=_('View profile')?></span>
  148. </a>
  149. </li>
  150. </ul>
  151. <ul>
  152. <li>
  153. <a href="/direct"><?=_('Direct')?></a>
  154. </li>
  155. <li>
  156. <a href="/settings"><?=_('Settings')?></a>
  157. </li>
  158. <li>
  159. <a href="/logout"><?=_('Log out')?></a>
  160. </li>
  161. </ul>
  162. </nav>
  163. </li>
  164. <li class="header_nav_item toot_button_wrap">
  165. <button id="creat_status" class="toot_button" accesskey="n">
  166. <div class="toot_button_label">
  167. <i class="fa fa-fw fa-pencil-square-o"></i>
  168. <span><?=_('Toot')?></span>
  169. </div>
  170. </button>
  171. </li>
  172. </ul>
  173. </nav>
  174. </div>
  175. </header>