index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <?php
  2. require_once "../public/load_lang.php";
  3. require_once "../path.php";
  4. require_once "../pcdl/html_head.php";
  5. ?>
  6. <body style="margin: 0;padding: 0;" class="reader_body" >
  7. <script src="./article.js"></script>
  8. <script src="../widget/like.js"></script>
  9. <link type="text/css" rel="stylesheet" href="../widget/like.css"/>
  10. <script src="../widget/click_dropdown.js"></script>
  11. <link type="text/css" rel="stylesheet" href="../widget/click_dropdown.css"/>
  12. <script>
  13. <?php
  14. $_id = "";
  15. $_display = "";
  16. $_channal = "";
  17. $_collect = "";
  18. if(isset($_GET["view"])){
  19. echo "_view='".$_GET["view"]."';";
  20. }
  21. else{
  22. echo "_view='article';";
  23. }
  24. if(isset($_GET["id"])){
  25. echo "_articel_id='".$_GET["id"]."';";
  26. echo "_id='".$_GET["id"]."';";
  27. }
  28. if(isset($_GET["collect"])){
  29. echo "_collection_id='".$_GET["collect"]."';";
  30. }
  31. if(isset($_GET["collection"])){
  32. echo "_collection_id='".$_GET["collection"]."';";
  33. }
  34. if(isset($_GET["channal"])){
  35. echo "_channal='".$_GET["channal"]."';";
  36. }
  37. if(isset($_GET["channel"])){
  38. echo "_channal='".$_GET["channel"]."';";
  39. }
  40. if(isset($_GET["lang"])){
  41. echo "_lang='".$_GET["lang"]."';";
  42. }
  43. if(isset($_GET["author"])){
  44. echo "_author='".$_GET["author"]."';";
  45. }
  46. if(isset($_GET["book"])){
  47. echo "_book=".$_GET["book"].";";
  48. }
  49. if(isset($_GET["par"])){
  50. echo "_par=".$_GET["par"].";";
  51. }
  52. if(isset($_GET["start"])){
  53. echo "_start=".$_GET["start"].";";
  54. }
  55. if(isset($_GET["begin"])){
  56. echo "_start=".$_GET["begin"].";";
  57. }
  58. if(isset($_GET["end"])){
  59. echo "_end=".$_GET["end"].";";
  60. }
  61. if(isset($_GET["mode"]) && $_GET["mode"]=="edit" && isset($_COOKIE["userid"])){
  62. #登录状态下 编辑模式
  63. $_mode = "edit";
  64. echo "_mode='edit';";
  65. $classMode="edit_mode";
  66. }
  67. else{
  68. $_mode = "read";
  69. echo "_mode='read';";
  70. $classMode="read_mode";
  71. }
  72. if(isset($_GET["display"])){
  73. if($_mode == "edit"){
  74. $_display = "sent";
  75. echo "_display='sent';";
  76. }
  77. else{
  78. $_display = $_GET["display"];
  79. echo "_display='".$_GET["display"]."';";
  80. }
  81. }
  82. else{
  83. if($_mode=="read"){
  84. $_display = "para";
  85. echo "_display='para';";
  86. }
  87. else{
  88. $_display = "sent";
  89. echo "_display='sent';";
  90. }
  91. }
  92. if(isset($_GET["direction"])){
  93. $_direction = $_GET["direction"];
  94. echo "_direction='".$_GET["direction"]."';";
  95. }
  96. else{
  97. if($_mode=="read"){
  98. $_direction = "row";
  99. echo "_direction='row';";
  100. }
  101. else{
  102. $_direction = "col";
  103. echo "_direction='col';";
  104. }
  105. }
  106. $contentClass= "";
  107. if($_direction=="row"){
  108. $contentClass .= ' horizontal ';
  109. }
  110. else{
  111. $contentClass .= ' vertical ';
  112. }
  113. if($_display=="para"){
  114. $contentClass .= ' para_mode ';
  115. }
  116. else{
  117. $contentClass .= ' sent_mode ';
  118. }
  119. $contentClass .= " $_mode ";
  120. ?>
  121. </script>
  122. <link type="text/css" rel="stylesheet" href="style.css" />
  123. <link type="text/css" rel="stylesheet" href="pad.css" media="screen and (max-width:1280px)" />
  124. <link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)" />
  125. <link type="text/css" rel="stylesheet" href="print.css" media="print" />
  126. <link href="../../node_modules/jquery.fancytree/dist/skin-win7/ui.fancytree.css" rel="stylesheet" type="text/css" class="skinswitcher">
  127. <script src="../tree/jquery.fancytree.js" type="text/javascript"></script>
  128. <script src="../article/my_collect.js" type="text/javascript"></script>
  129. <script language="javascript" src="../article/article_add_dlg.js"></script>
  130. <style>
  131. ul.fancytree-container{
  132. border:unset;
  133. }
  134. .fancytree-container .active {
  135. font-weight: 700;
  136. color: var(--main-color);
  137. background: linear-gradient(to right, var(--link-color), var(--nocolor));
  138. border-radius: 5px;
  139. }
  140. span.fancytree-title{
  141. color: var(--main-color1);
  142. }
  143. span.fancytree-node{
  144. display: flex;
  145. }
  146. #content_toc>ul>li>span.fancytree-node{
  147. font-size: 120%;
  148. font-weight: 900;
  149. }
  150. #article_path chapter{
  151. display:unset;
  152. }
  153. .float_dlg {
  154. display: none;
  155. width: 25em;
  156. position: absolute;
  157. right: 0;
  158. background-color: var(--btn-hover-bg-color);
  159. padding: 10px;
  160. border-radius: 5px;
  161. box-shadow: 0 0 10px var(--main-color);
  162. z-index: 1;
  163. }
  164. .float_dlg_left {
  165. display: none;
  166. width: 25em;
  167. position: absolute;
  168. background-color: var(--btn-hover-bg-color);
  169. padding: 10px;
  170. border-radius: 5px;
  171. box-shadow: 0 0 10px var(--main-color);
  172. z-index: 200;
  173. }
  174. #contents ul, li {
  175. margin-block-start: 0.5em;
  176. margin-block-end: 0.5em;
  177. margin-left: 7px;
  178. }
  179. </style>
  180. <?php
  181. require_once("../pcdl/head_bar.php");
  182. ?>
  183. <script>
  184. function show_content(){
  185. $("#left_pannal").toggleClass("hidden");
  186. if($("#left_pannal").hasClass("hidden")){
  187. $("#main_view").css("margin-left","auto");
  188. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  189. }else{
  190. $("#main_view").css("margin-left","270px");
  191. localStorage.setItem('article_show_toc_'+_mode, 'show');
  192. }
  193. }
  194. function set_toc_visible(isVisible){
  195. if(isVisible){
  196. $("#left_pannal").removeClass("hidden");
  197. $("#main_view").css("margin-left","270px");
  198. localStorage.setItem('article_show_toc_'+_mode, 'show');
  199. }else{
  200. $("#left_pannal").addClass("hidden");
  201. $("#main_view").css("margin-left","auto");
  202. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  203. }
  204. }
  205. </script>
  206. <div id="head_bar" >
  207. <div style="display:flex;">
  208. <button class="icon_btn" onclick="show_content()"><?php echo $_local->gui->contents; ?></button>
  209. </div>
  210. <div style="margin: auto 0;">
  211. <span id="head_span">
  212. <select id="select_lang" onchange="lang_changed(this)">
  213. <option>全部语言</option>
  214. <option>简体中文</option>
  215. <option>繁体中文</option>
  216. <option>英文</option>
  217. </select>
  218. <?php
  219. if(isset($_GET["view"]) && $_GET["view"]=="article"){
  220. echo "<button class='icon_btn show_pc' title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
  221. echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
  222. echo "' target='_blank'>{$_local->gui->modify}</a></button>";
  223. }
  224. if($_GET["view"]!=="article" && $_GET["view"]!=="collection"){
  225. ?>
  226. <span id="convert_article" class="icon_btn_div show_pc">
  227. <button id="file_add" type="button" class="icon_btn" onclick="to_article()" title=" ">
  228. <svg class="icon">
  229. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  230. </svg>
  231. 转换为文章
  232. </button>
  233. <div id='article_add_div' class="float_dlg"></div>
  234. </span>
  235. <?php
  236. }
  237. echo "<button class='icon_btn show_pc' title='{$_local->gui->add}{$_local->gui->subfield}'>";
  238. echo "<a href='../article/frame.php?view=".$_GET["view"];
  239. if(isset($_GET["id"])){
  240. echo "&id=".$_GET["id"];
  241. }
  242. if(isset($_GET["collection"])){
  243. echo "&collection=".$_GET["collection"];
  244. }
  245. if(isset($_GET["channel"])){
  246. echo "&channel=".$_GET["channel"];
  247. }
  248. if(isset($_GET["lang"])){
  249. echo "&lang=".$_GET["lang"];
  250. }
  251. if(isset($_GET["book"])){
  252. echo "&book=".$_GET["book"];
  253. }
  254. if(isset($_GET["par"])){
  255. echo "&par=".$_GET["par"];
  256. }
  257. if(isset($_GET["start"])){
  258. echo "&start=".$_GET["start"];
  259. }
  260. if(isset($_GET["end"])){
  261. echo "&end=".$_GET["end"];
  262. }
  263. echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";
  264. ?>
  265. <span>
  266. <?php include "../reader/right_tool_bar.php";?>
  267. </span>
  268. </span>
  269. </div>
  270. </div>
  271. <div id="left_pannal">
  272. <div id="left_pannal_inner" class="fun_frame" style="z-index: 99;">
  273. <!--<div id = "collect_title" class="title" style="text-align: right;background: #ffd70087;" onclick="show_content(this)"></div>-->
  274. <div id = "toc_content" class="content" style="padding-top:0;">
  275. </div>
  276. </div>
  277. </div>
  278. <div id="main_view" class="main_view <?php echo $classMode;?>">
  279. <div id="article_head" style="border-bottom: 1px solid gray;">
  280. <div id="head_nav" >
  281. <div id="head_nav_left" >
  282. <div id="article_path" class=""></div>
  283. <div id="article_path_title"></div>
  284. </div>
  285. <div id="head_nav_right" >
  286. <div id="article_edition" style="display:flex;">
  287. <span style='font-weight: 700;'>文章版本 </span>
  288. <div id="edition_dropdown" class="case_dropdown">
  289. <span></span>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. <div id="article_title" class="term_word_head_pali"></div>
  295. <div id="article_subtitle"></div>
  296. <div id="article_author"></div>
  297. <div id="like_div">
  298. <like restype='article' resid='124'></like>
  299. <watch restype='article' resid='124'></watch>
  300. </div>
  301. </div>
  302. <div id="contents_view">
  303. <div id="contents_div">
  304. <div id="summary"></div>
  305. <div id="contents" class="<?php echo $contentClass;?>">
  306. <?php echo $_local->gui->loading; ?>...
  307. </div>
  308. <div id="contents_foot">
  309. <div id="contents_nav" style="display:flex;justify-content: space-between;">
  310. <div id="contents_nav_left"></div>
  311. <div id="contents_nav_right"></div>
  312. </div>
  313. <div id="contents_dicuse">
  314. </div>
  315. </div>
  316. </div>
  317. <div id="right_pannal">
  318. <div class="fun_frame" style="overflow-x: scroll;position: fixed;width: 18%;height: calc(100vh - 250px);">
  319. <div style="display:flex;justify-content: space-between;">
  320. <div class="title"><?php echo $_local->gui->contributor; ?></div>
  321. <div class="click_dropdown_div">
  322. <div class="channel_select_button" onclick="onChannelMultiSelectStart()"><?php echo $_local->gui->select; ?></div>
  323. </div>
  324. </div>
  325. <div class='channel_select'>
  326. <button onclick='onChannelChange()'><?php echo $_local->gui->confirm; ?></button>
  327. <button onclick='onChannelMultiSelectCancel()'><?php echo $_local->gui->cancel; ?></button>
  328. </div>
  329. <div id="channal_list" class="content" style="max-height:calc(100vh - 20em);">
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. <script>
  336. $(document).ready(function(){
  337. if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
  338. set_toc_visible(false);
  339. }else{
  340. set_toc_visible(true);
  341. }
  342. article_add_dlg_init("article_add_div");
  343. ntf_init();
  344. click_dropdown_init();
  345. note_create();
  346. historay_init();
  347. switch (_view) {
  348. case "article":
  349. articel_load(_articel_id,_collection_id);
  350. if(_collection_id!=""){
  351. articel_load_article_list(_articel_id,_collection_id);
  352. }
  353. break;
  354. case "collection":
  355. collect_load(_collection_id);
  356. break;
  357. case "sent":
  358. case "para":
  359. case "chapter":
  360. case "book":
  361. case "series":
  362. palicanon_load();
  363. reader_get_path();
  364. render_toc();
  365. break;
  366. case "simsent":
  367. case "sim":
  368. palicanon_load();
  369. break;
  370. default:
  371. break;
  372. }
  373. });
  374. window.addEventListener('scroll',winScroll);
  375. function winScroll(e){
  376. if(GetPageScroll().y>220){
  377. }
  378. else{
  379. }
  380. }
  381. //滚动条位置
  382. function GetPageScroll()
  383. {
  384. var pos=new Object();
  385. var x, y;
  386. if(window.pageYOffset)
  387. { // all except IE
  388. y = window.pageYOffset;
  389. x = window.pageXOffset;
  390. } else if(document.documentElement && document.documentElement.scrollTop)
  391. { // IE 6 Strict
  392. y = document.documentElement.scrollTop;
  393. x = document.documentElement.scrollLeft;
  394. } else if(document.body) { // all other IE
  395. y = document.body.scrollTop;
  396. x = document.body.scrollLeft;
  397. }
  398. pos.x=x;
  399. pos.y=y;
  400. return(pos);
  401. }
  402. </script>
  403. <div class="modal_win_bg">
  404. </div>
  405. <div id="model_win" class="model_win_container"></div>
  406. </body>
  407. </html>