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.

184 lines
7.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. {% extends "bootstrap/base.html" %}
  2. {% block title %}Read TI Later{% endblock %}
  3. {% block metas %}
  4. {{super()}}
  5. <meta name="apple-mobile-web-app-capable" content="yes">
  6. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
  8. <link rel="manifest" crossorigin="use-credentials" href="./manifest.json">
  9. <link rel="apple-touch-icon" href="{{url_for('.static', filename='read-it-later.png')}}">
  10. {% endblock %}
  11. {% block styles %}
  12. {{super()}}
  13. <link rel="stylesheet" href="{{url_for('.static', filename='style.css')}}">
  14. {% endblock %}
  15. {% block navbar %}
  16. <nav class="navbar navbar-expand-lg sticky-top navbar-dark bg-dark">
  17. {% if article[5] == 1 %}
  18. <a href="{{url_for('archived')}}"><div class="navbar-brand"><svg
  19. {% else %}
  20. <a href="{{url_for('index')}}"><div class="navbar-brand"><svg
  21. {% endif %}
  22. width="24"
  23. height="24"
  24. fill="none"
  25. stroke="currentColor"
  26. stroke-width="2"
  27. stroke-linecap="round"
  28. stroke-linejoin="round"
  29. style="line-height: 1.5; vertical-align: middle; margin-bottom: 4px;">
  30. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#arrow-left"/>
  31. </svg></div></a>
  32. <form class="form-inline ml-auto">
  33. {# <div class="custom-control custom-switch">
  34. <input type="checkbox" class="custom-control-input" id="darkSwitch" />
  35. <label class="custom-control-label" for="darkSwitch">Dark Mode</label>
  36. </div>
  37. <div class="navbar-text" style="margin-right: 20px; ">{{ user['userName'] }}</div> #}
  38. <div id="type-button" class="toolbar-button" onclick="showTypeMenu();"><svg
  39. width="24"
  40. height="24"
  41. fill="none"
  42. stroke="currentColor"
  43. stroke-width="2"
  44. stroke-linecap="round"
  45. stroke-linejoin="round"
  46. style="line-height: 1.5; vertical-align: middle; margin-bottom: 4px;">
  47. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#type"/>
  48. </svg><svg
  49. width="16"
  50. height="16"
  51. fill="none"
  52. stroke="currentColor"
  53. stroke-width="2"
  54. stroke-linecap="round"
  55. stroke-linejoin="round"
  56. style="line-height: 1.5; vertical-align: middle; margin-bottom: 4px;">
  57. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#chevron-down"/>
  58. </svg></div>
  59. {% if article[5] == 1 %}
  60. <a class="toolbar-button" href="/unarchive/{{ article[0] }}" data-toggle="tooltip" data-placement="bottom" title="Unarchive"><svg
  61. {% else %}
  62. <a class="toolbar-button" href="/archive/{{ article[0] }}" data-toggle="tooltip" data-placement="bottom" title="Archive"><svg
  63. {% endif %}
  64. width="24"
  65. height="24"
  66. fill="none"
  67. stroke="currentColor"
  68. stroke-width="2"
  69. stroke-linecap="round"
  70. stroke-linejoin="round"
  71. style="line-height: 1.5; vertical-align: middle; margin-bottom: 4px;">
  72. {% if article[5] == 1 %}
  73. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#plus-square"/>
  74. {% else %}
  75. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#archive"/>
  76. {% endif %}
  77. </svg></a>
  78. <a class="toolbar-button" href="/delete/{{ article[0] }}" style="padding-right: 1rem;" data-toggle="tooltip" data-placement="bottom" title="Trash"><svg
  79. width="24"
  80. height="24"
  81. fill="none"
  82. stroke="currentColor"
  83. stroke-width="2"
  84. stroke-linecap="round"
  85. stroke-linejoin="round"
  86. style="line-height: 1.5; vertical-align: middle; margin-bottom: 4px;">
  87. <use xlink:href="{{url_for('.static', filename='feather-sprite.svg')}}#trash"/>
  88. </svg></a>
  89. </form>
  90. </nav>
  91. {% endblock %}
  92. {% block content %}
  93. <div class="container wrapper" style="padding-left: 15px !important; padding-right: 15px !important; margin-right: auto !important; margin-left: auto !important; left: 0; right: 0;">
  94. <div id="error-alert" class="alert alert-danger" role="alert" style="display: none;">
  95. This is a danger alert—check it out!
  96. </div>
  97. <form>
  98. <div class="row justify-content-center">
  99. {# <div class="col-lg-6">
  100. <label for="formGroupExampleInput4">URL</label>
  101. <input id="link-form" type="text" class="form-control" placeholder="https://example.com">
  102. <br>
  103. <button type="button" class="btn btn-primary" onclick="addUrl();">Add</button>
  104. <br>
  105. <br>
  106. </div> #}
  107. <div class="col-lg-12">
  108. <div style="padding: 10px; word-wrap: break-word; display: none;" id="article">
  109. <h1 style="text-align: center;">{{ article[3] }}</h1>
  110. <a href="{{ article[1] }}" class="text-info" target="_blank" style="display: block; text-align: center; margin-bottom: 20px;">View Original</a>
  111. {{ article[2] | safe}}
  112. </div>
  113. </div>
  114. </div>
  115. </form>
  116. </div>
  117. {% include 'fragments/type_menu.j2' %}
  118. {% endblock %}
  119. {% block scripts %}
  120. {{ super() }}
  121. <script type="text/javascript" src="{{url_for('.static', filename='cookies.js')}}"></script>
  122. <script>
  123. $('#article img').css('max-width', '100%');
  124. $('#article img').css('height', 'auto');
  125. window.addEventListener( 'DOMContentLoaded', function( event ) {
  126. var x = readCookie('fontcookie');
  127. if (x) {
  128. $('#article').css('font-family', x);
  129. } else {
  130. createCookie('fontcookie', 'sans-serif', 365);
  131. }
  132. var x = readCookie('fontsizecookie');
  133. if (x) {
  134. $('#article').css('font-size', x);
  135. } else {
  136. createCookie('fontsizecookie', '1.25rem', 365);
  137. }
  138. $('#article').show();
  139. }, true );
  140. $(function () {
  141. $('[data-toggle="tooltip"]').tooltip();
  142. });
  143. function showTypeMenu() {
  144. pos = $('#type-button').first().position();
  145. left = pos.left-$('#type-menu').width() + 50
  146. if (left < 0) left = 0
  147. $('#type-menu').css({top: pos.top+30, left: left});
  148. $('#type-menu').show();
  149. var overlay = jQuery('<div id="overlay" onclick="closeTypeMenu();"> </div>');
  150. overlay.appendTo(document.body)
  151. }
  152. function closeTypeMenu() {
  153. $('#type-menu').hide();
  154. $('#overlay').remove();
  155. }
  156. function setFont(fonts) {
  157. createCookie('fontcookie', fonts, 365);
  158. $('#article').css('font-family', "'" + fonts + "'");
  159. }
  160. function setSize(size) {
  161. createCookie('fontsizecookie', size, 365);
  162. $('#article').css('font-size', size);
  163. }
  164. $( window ).resize(function() {
  165. pos = $('#type-button').first().position();
  166. left = pos.left-$('#type-menu').width() + 50;
  167. if (left < 0) left = 0;
  168. $('#type-menu').css({top: pos.top+30, left: left});
  169. });
  170. </script>
  171. {% endblock %}