header.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.13ad.de'"?>;
  79. server_setting_bibliogram = <?=$config["Media"]["bibliogram"] ? "'".$config["Media"]["bibliogram"]."'" : "'bibliogram.dsrev.ru'"?>;
  80. </script>
  81. </head>
  82. <body>
  83. <header id="header">
  84. <div class="header_nav_wrap">
  85. <nav class="header_left_box">
  86. <ul class="header_nav_list">
  87. <li id="header_nav_item_home" class="header_nav_item">
  88. <a href="/" id="home_nav">
  89. <i class="fa fa-fw fa-home"></i>
  90. <span><?=_('Home')?></span>
  91. </a>
  92. <div class="home_badge nav_badge invisible"></div>
  93. </li>
  94. <li id="header_nav_item_local" class="header_nav_item local_nav">
  95. <a href="/local" id="local_nav">
  96. <i class="fa fa-fw fa-users"></i>
  97. <span><?=_('Local')?></span>
  98. </a>
  99. <div class="local_badge nav_badge invisible"></div>
  100. </li>
  101. <li id="header_nav_item_federated" class="header_nav_item federated_nav">
  102. <a href="/federated" id="federated_nav">
  103. <i class="fa fa-fw fa-globe"></i>
  104. <span><?=_('Federated')?></span>
  105. </a>
  106. <div class="federated_badge nav_badge invisible"></div>
  107. </li>
  108. <li id="header_nav_item_notifications" class="header_nav_item notifications_nav">
  109. <a href="/notifications" id="notifications_nav">
  110. <i class="fa fa-fw fa-bell"></i>
  111. <span><?=_('Notifications')?></span>
  112. </a>
  113. <div class="notification_badge nav_badge invisible"></div>
  114. </li>
  115. <li id="header_nav_item_lists" class="header_nav_item lists_nav">
  116. <a href="/lists" id="lists_nav">
  117. <i class="fa fa-fw fa-list"></i>
  118. <span><?=_('Lists')?></span>
  119. </a>
  120. <div class="lists_badge nav_badge invisible"></div>
  121. </li>
  122. </ul>
  123. </nav>
  124. <nav class="header_right_box">
  125. <ul class="header_nav_list">
  126. <li class="header_nav_item search_form_wrap">
  127. <form class="search_form" action="/search" method="GET">
  128. <input id="search_form" class="search_form_input" placeholder="<?=_('Search Mastodon')?>" type="text" name="q" accesskey="/" autocomplete="off">
  129. <span class="search_form_submit">
  130. <button type="submit">
  131. <i class="fa fa-fw fa-search"></i>
  132. </button>
  133. </span>
  134. </form>
  135. <nav class="header_search_suggestions invisible"></nav>
  136. </li>
  137. <li class="header_nav_item my_account_wrap">
  138. <button class="header_account_avatar">
  139. <div class="my_account">
  140. <img class="js_current_profile_image">
  141. </div>
  142. </button>
  143. <nav class="header_my_account_nav invisible">
  144. <ul>
  145. <li>
  146. <a class="js_current_profile_link emoji_poss">
  147. <span class="js_current_profile_displayname display_name"></span>
  148. <span><?=_('View profile')?></span>
  149. </a>
  150. </li>
  151. </ul>
  152. <ul>
  153. <li>
  154. <a href="/direct"><?=_('Direct')?></a>
  155. </li>
  156. <li>
  157. <a href="/bookmarks"><?=_('Bookmarks')?></a>
  158. </li>
  159. <li>
  160. <a href="/settings"><?=_('Settings')?></a>
  161. </li>
  162. <li>
  163. <a href="/logout"><?=_('Log out')?></a>
  164. </li>
  165. </ul>
  166. </nav>
  167. </li>
  168. <li class="header_nav_item toot_button_wrap">
  169. <button id="creat_status" class="toot_button" accesskey="n">
  170. <div class="toot_button_label">
  171. <i class="fa fa-fw fa-pencil-square-o"></i>
  172. <span><?=_('Toot')?></span>
  173. </div>
  174. </button>
  175. </li>
  176. </ul>
  177. </nav>
  178. </div>
  179. </header>