index.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?PHP
  2. include "../pcdl/html_head.php";
  3. ?>
  4. <body class="wiki_body" onload="wiki_index_init()">
  5. <style>
  6. .term_link,.term_link_new{
  7. color: blue;
  8. padding-left: 2px;
  9. padding-right: 2px;
  10. }
  11. .term_link_new{
  12. color:red;
  13. }
  14. #search_result{
  15. position: absolute;
  16. background: wheat;
  17. max-width: 95%;
  18. width: 24em;
  19. }
  20. chapter{
  21. color: blue;
  22. text-decoration: none;
  23. cursor: pointer;
  24. }
  25. chapter:hover{
  26. color: blue;
  27. text-decoration: underline;
  28. }
  29. .fun_block {
  30. color: var(--tool-color);
  31. width: 95%;
  32. margin-top:3em;
  33. margin-left:auto;
  34. margin-right:auto;
  35. max-width: 30em;
  36. margin-bottom: 20px;
  37. box-shadow: 2px 2px 10px 2px var(--shadow-color);
  38. border-radius: 8px;
  39. }
  40. .wiki_body{
  41. align-items: center;
  42. }
  43. .search_toolbar{
  44. height: initial;
  45. padding: 1em 1em;
  46. background-color: var(--tool-bg-color1);
  47. border-bottom: none;
  48. }
  49. #index_list{
  50. display:flex;
  51. }
  52. </style>
  53. <style media="screen and (max-width:767px)">
  54. #index_list{
  55. display:block;
  56. }
  57. </style>
  58. <?php
  59. require_once("../pcdl/head_bar.php");
  60. ?>
  61. <script src="../public/js/highcharts/highcharts.js"></script>
  62. <script src="../public/js/highcharts/modules/exporting.js"></script>
  63. <script src="../public/js/highcharts/modules/data.js"></script>
  64. <script src="../public/js/highcharts/modules/series-label.js"></script>
  65. <script src="../public/js/highcharts/modules/oldie.js"></script>
  66. <script src="../term/term.js"></script>
  67. <script src="../term/note.js"></script>
  68. <script src="wiki.js"></script>
  69. <div id="container" style="min-width:400px;height:200px;"></div>
  70. <div id="wiki_search" style="width:100%;">
  71. </div>
  72. <!-- tool bar begin-->
  73. <div id='search_toolbar' class="search_toolbar">
  74. <div style="display:flex;justify-content: space-between;">
  75. <div ></div>
  76. <div>
  77. <div>
  78. <input id="wiki_search_input" type="input" placeholder="<?php echo $_local->gui->search;?>" style=" margin-left: 0.5em;width: 40em;max-width: 100%;font-size:140%;padding: 0.6em;color: var(--btn-hover-bg-color);background-color: var(--btn-color);" onkeyup="wiki_search_keyup(event,this)"/>
  79. </div>
  80. <div id="search_result">
  81. </div>
  82. </div>
  83. <div >
  84. <ul>
  85. <li>人人皆可编辑</li>
  86. <li>引用圣典原文</li>
  87. <li>内容翔实可信</li>
  88. </ul>
  89. </div>
  90. </div>
  91. </div>
  92. <!--tool bar end -->
  93. <div id="index_list">
  94. <div style="flex:3;margin:12px;">
  95. <div class="card" style="padding:10px;">
  96. <div>最近搜索</div>
  97. </div>
  98. </div>
  99. <div style="flex:3;margin:12px;">
  100. <div class="card" style="padding:10px;">
  101. <div>优质词条</div>
  102. </div>
  103. </div>
  104. <div style="flex:3;margin:12px;">
  105. <div class="card" style="padding:10px;">
  106. <div>我的贡献</div>
  107. <div>新手指南</div>
  108. </div>
  109. </div>
  110. </div>
  111. <script>
  112. $.get('../term/update_analytics.php', function (csvStr) {
  113. console.log(csvStr);
  114. csvStr = csvStr.replace(/\n\n/g, '\n');
  115. Highcharts.chart('container', {
  116. chart: {
  117. scrollablePlotArea: {
  118. minWidth: 700
  119. }
  120. },
  121. data: {
  122. //csvURL: 'https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/analytics.csv',
  123. csv: csvStr
  124. },
  125. title: {
  126. text: '圣典百科百日更新'
  127. },
  128. subtitle: {
  129. text: ''
  130. },
  131. xAxis: {
  132. tickInterval: 7 * 24 * 3600 * 1000, // one week
  133. tickWidth: 0,
  134. gridLineWidth: 1,
  135. labels: {
  136. align: 'left',
  137. x: 3,
  138. y: -3
  139. }
  140. },
  141. yAxis: [{ // left y axis
  142. title: {
  143. text: null
  144. },
  145. labels: {
  146. align: 'left',
  147. x: 3,
  148. y: 16,
  149. format: '{value:.,0f}'
  150. },
  151. showFirstLabel: false
  152. }, { // right y axis
  153. linkedTo: 0,
  154. gridLineWidth: 0,
  155. opposite: true,
  156. title: {
  157. text: null
  158. },
  159. labels: {
  160. align: 'right',
  161. x: -3,
  162. y: 16,
  163. format: '{value:.,0f}'
  164. },
  165. showFirstLabel: false
  166. }],
  167. legend: {
  168. align: 'left',
  169. verticalAlign: 'top',
  170. borderWidth: 0
  171. },
  172. tooltip: {
  173. shared: true,
  174. crosshairs: true
  175. },
  176. plotOptions: {
  177. series: {
  178. cursor: 'pointer',
  179. point: {
  180. events: {
  181. click: function (e) {
  182. hs.htmlExpand(null, {
  183. pageOrigin: {
  184. x: e.pageX || e.clientX,
  185. y: e.pageY || e.clientY
  186. },
  187. headingText: this.series.name,
  188. maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':<br/> ' +
  189. this.y + ' sessions',
  190. width: 200
  191. });
  192. }
  193. }
  194. },
  195. marker: {
  196. lineWidth: 1
  197. }
  198. }
  199. },
  200. series: [{
  201. name: 'All sessions',
  202. lineWidth: 4,
  203. marker: {
  204. radius: 4
  205. }
  206. }, {
  207. name: 'New users'
  208. }]
  209. });
  210. });
  211. </script>
  212. </body>
  213. </html>