index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <?php
  2. require_once "../public/load_lang.php";
  3. require_once "../config.php";
  4. require_once "../pcdl/html_head.php";
  5. ?>
  6. <body style="margin: 0;padding: 0;" class="reader_body" >
  7. <script>
  8. var gCaseTable=<?php echo file_get_contents("../public/js/case.json"); ?>
  9. </script>
  10. <script src="./article.js"></script>
  11. <script src="./term.js"></script>
  12. <script src="../widget/like.js"></script>
  13. <link type="text/css" rel="stylesheet" href="../widget/like.css"/>
  14. <script src="../palicanon/chapter_channel.js"></script>
  15. <link type="text/css" rel="stylesheet" href="../palicanon/chapter_channel.css"/>
  16. <script src="../widget/click_dropdown.js"></script>
  17. <link type="text/css" rel="stylesheet" href="../widget/click_dropdown.css"/>
  18. <script>
  19. <?php
  20. $_id = "";
  21. $_display = "";
  22. $_channal = "";
  23. $_collect = "";
  24. if(isset($_GET["view"])){
  25. echo "_view='".$_GET["view"]."';";
  26. }
  27. else{
  28. echo "_view='article';";
  29. }
  30. if(isset($_GET["id"])){
  31. echo "_articel_id='".$_GET["id"]."';";
  32. echo "_id='".$_GET["id"]."';";
  33. }
  34. if(isset($_GET["collect"])){
  35. echo "_collection_id='".$_GET["collect"]."';";
  36. }
  37. if(isset($_GET["collection"])){
  38. echo "_collection_id='".$_GET["collection"]."';";
  39. }
  40. if(isset($_GET["channal"])){
  41. echo "_channal='".$_GET["channal"]."';";
  42. }
  43. if(isset($_GET["channel"])){
  44. echo "_channal='".$_GET["channel"]."';";
  45. }
  46. if(isset($_GET["lang"])){
  47. echo "_lang='".$_GET["lang"]."';";
  48. }
  49. if(isset($_GET["author"])){
  50. echo "_author='".$_GET["author"]."';";
  51. }
  52. if(isset($_GET["book"])){
  53. echo "_book=".$_GET["book"].";";
  54. }
  55. if(isset($_GET["par"])){
  56. echo "_par=".$_GET["par"].";";
  57. }
  58. if(isset($_GET["para"])){
  59. echo "_par=".$_GET["para"].";";
  60. }
  61. if(isset($_GET["start"])){
  62. echo "_start=".$_GET["start"].";";
  63. }
  64. if(isset($_GET["begin"])){
  65. echo "_start=".$_GET["begin"].";";
  66. }
  67. if(isset($_GET["end"])){
  68. echo "_end=".$_GET["end"].";";
  69. }
  70. if(isset($_GET["mode"]) && $_GET["mode"]=="edit" && isset($_COOKIE["userid"])){
  71. #登录状态下 编辑模式
  72. $_mode = "edit";
  73. echo "_mode='edit';";
  74. $classMode="edit_mode";
  75. }
  76. else{
  77. $_mode = "read";
  78. echo "_mode='read';";
  79. $classMode="read_mode";
  80. }
  81. if(isset($_GET["display"])){
  82. if($_mode == "edit"){
  83. $_display = "sent";
  84. echo "_display='sent';";
  85. }
  86. else{
  87. $_display = $_GET["display"];
  88. echo "_display='".$_GET["display"]."';";
  89. }
  90. }
  91. else{
  92. if($_mode=="read"){
  93. $_display = "para";
  94. echo "_display='para';";
  95. }
  96. else{
  97. $_display = "sent";
  98. echo "_display='sent';";
  99. }
  100. }
  101. if(isset($_GET["direction"])){
  102. $_direction = $_GET["direction"];
  103. echo "_direction='".$_GET["direction"]."';";
  104. }
  105. else{
  106. if($_mode=="read"){
  107. $_direction = "row";
  108. echo "_direction='row';";
  109. }
  110. else{
  111. $_direction = "col";
  112. echo "_direction='col';";
  113. }
  114. }
  115. $contentClass= "";
  116. if($_direction=="row"){
  117. $contentClass .= ' horizontal ';
  118. }
  119. else{
  120. $contentClass .= ' vertical ';
  121. }
  122. if($_display=="para"){
  123. $contentClass .= ' para_mode ';
  124. }
  125. else{
  126. $contentClass .= ' sent_mode ';
  127. }
  128. $contentClass .= " $_mode ";
  129. ?>
  130. </script>
  131. <link type="text/css" rel="stylesheet" href="style.css" />
  132. <link type="text/css" rel="stylesheet" href="pad.css" media="screen and (max-width:1280px)" />
  133. <link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)" />
  134. <link type="text/css" rel="stylesheet" href="print.css" media="print" />
  135. <link href="../../node_modules/jquery.fancytree/dist/skin-win7/ui.fancytree.css" rel="stylesheet" type="text/css" class="skinswitcher">
  136. <script src="../tree/jquery.fancytree.js" type="text/javascript"></script>
  137. <script src="../article/my_collect.js" type="text/javascript"></script>
  138. <script src="../article/article_add_dlg.js"></script>
  139. <script src="../../node_modules/mustache/mustache.js"></script>
  140. <?php
  141. require_once("../pcdl/head_bar.php");
  142. ?>
  143. <style>
  144. ul.fancytree-container{
  145. border:unset;
  146. width: max-content;
  147. }
  148. .fancytree-container .active {
  149. font-weight: 700;
  150. color: var(--main-color);
  151. background: linear-gradient(to right, var(--link-color), var(--nocolor));
  152. border-radius: 5px;
  153. }
  154. span.fancytree-title{
  155. color: var(--main-color1);
  156. }
  157. span.fancytree-node{
  158. display: flex;
  159. }
  160. #content_toc>ul>li>span.fancytree-node{
  161. font-size: 120%;
  162. font-weight: 900;
  163. }
  164. #article_path chapter{
  165. display:unset;
  166. }
  167. .float_dlg {
  168. display: none;
  169. width: 25em;
  170. position: absolute;
  171. right: 0;
  172. background-color: var(--btn-hover-bg-color);
  173. padding: 10px;
  174. border-radius: 5px;
  175. box-shadow: 0 0 10px var(--main-color);
  176. z-index: 1;
  177. }
  178. .float_dlg_left {
  179. display: none;
  180. width: 25em;
  181. position: absolute;
  182. background-color: var(--btn-hover-bg-color);
  183. padding: 10px;
  184. border-radius: 5px;
  185. box-shadow: 0 0 10px var(--main-color);
  186. z-index: 200;
  187. }
  188. #contents ul, li {
  189. margin-block-start: 0.5em;
  190. margin-block-end: 0.5em;
  191. margin-left: 18px;
  192. }
  193. .click_dropdown_div{
  194. align-self: center;
  195. }
  196. .channel_select_button{
  197. color: var(--link-color);
  198. }
  199. .channel_select_button:hover{
  200. text-decoration-line: underline;
  201. }
  202. .sent_tran_div a{
  203. white-space: normal;
  204. overflow-wrap: anywhere;
  205. }
  206. .para_tran_div a{
  207. white-space: normal;
  208. overflow-wrap: anywhere;
  209. }
  210. .show_pc{
  211. color: var(--main-color);
  212. }
  213. </style>
  214. <script>
  215. function show_content(){
  216. $("#left_pannal").toggleClass("hidden");
  217. if($("#left_pannal").hasClass("hidden")){
  218. $("#main_view").removeClass("main_view_narrow");
  219. $(".fun_frame").removeClass("fun_frame_narrow");
  220. $("#contents_div").removeClass("contents_div_narrow");
  221. //$("#main_view").css("margin-left","0");
  222. //$(".fun_frame").css("width","30vw");
  223. //$("#contents_div").css("width","calc(70vw - 2em)");
  224. $("#left_pannal_inner").css("width","unset");
  225. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  226. }else{
  227. $("#main_view").toggleClass("main_view_narrow");
  228. $(".fun_frame").toggleClass("fun_frame_narrow");
  229. $("#contents_div").toggleClass("contents_div_narrow");
  230. //$("#main_view").css("margin-left","20vw");
  231. //$(".fun_frame").css("width","20vw");
  232. //$("#contents_div").css("width","calc(60vw - 2em)");
  233. $("#left_pannal_inner").css("width","unset");
  234. localStorage.setItem('article_show_toc_'+_mode, 'show');
  235. }
  236. }
  237. function set_toc_visible(isVisible){
  238. if(isVisible){
  239. $("#left_pannal").removeClass("hidden");
  240. $("#main_view").toggleClass("main_view_narrow");
  241. //$("#main_view").css("margin-left","20vw");
  242. $(".fun_frame").toggleClass("fun_frame_narrow");
  243. //$(".fun_frame").css("width","20vw");
  244. $("#contents_div").toggleClass("contents_div_narrow");
  245. //$("#contents_div").css("width","calc(60vw - 2em)");
  246. $("#left_pannal_inner").css("width","unset");
  247. localStorage.setItem('article_show_toc_'+_mode, 'show');
  248. }else{
  249. $("#left_pannal").addClass("hidden");
  250. $("#main_view").removeClass("main_view_narrow");
  251. //$("#main_view").css("margin-left","0");
  252. $(".fun_frame").removeClass("fun_frame_narrow");
  253. //$(".fun_frame").css("width","30vw");
  254. $("#contents_div").removeClass("contents_div_narrow");
  255. //$("#contents_div").css("width","calc(70vw - 2em)");
  256. $("#left_pannal_inner").css("width","unset");
  257. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  258. }
  259. }
  260. </script>
  261. <div id="head_bar" >
  262. <div style="display:flex;">
  263. <button class="icon_btn" onclick="show_content()" style="color: var(--main-color);"><?php echo $_local->gui->contents; ?></button>
  264. </div>
  265. <div style="margin: auto 0;">
  266. <span id="head_span">
  267. <?php
  268. $link = '/pcd/article/'.$_GET["view"].'/';
  269. if(isset($_GET["channel"])){
  270. $channel = str_replace(',','_',$_GET["channel"]);
  271. }else if(isset($_GET["channal"])){
  272. $channel = str_replace(',','_',$_GET["channal"]);
  273. }
  274. switch ($_GET["view"]) {
  275. case 'chapter':
  276. case 'para':
  277. $link .= $_GET["book"].'-'.$_GET["par"].'?book='.$_GET["book"].'&par='.$_GET["par"];
  278. break;
  279. case 'article':
  280. $link .= $_GET["id"];
  281. if(isset($_GET['collection'])){
  282. $link .= '?anthology='.$_GET["collection"];
  283. }
  284. break;
  285. default:
  286. # code...
  287. break;
  288. }
  289. if(isset($channel)){
  290. $link .='&channel='.$channel;
  291. }
  292. echo "<a href='{$link}' target='_blank'>在新版中打开</a>";
  293. if(isset($_GET["view"]) && $_GET["view"]=="article"){
  294. echo "<button class='icon_btn show_pc' title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
  295. echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
  296. echo "' target='_blank'>{$_local->gui->modify}</a></button>";
  297. }
  298. if($_GET["view"]!=="article" && $_GET["view"]!=="collection"){
  299. ?>
  300. <span id="convert_article" class="icon_btn_div show_pc">
  301. <button id="file_add" type="button" class="icon_btn" onclick="to_article()" title=" ">
  302. <svg class="icon">
  303. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  304. </svg>
  305. 转换为文章
  306. </button>
  307. <div id='article_add_div' class="float_dlg"></div>
  308. </span>
  309. <?php
  310. }
  311. echo "<button class='icon_btn show_pc' title='{$_local->gui->add}{$_local->gui->subfield}'>";
  312. echo "<a href='../article/frame.php?view=".$_GET["view"];
  313. if(isset($_GET["id"])){
  314. echo "&id=".$_GET["id"];
  315. }
  316. if(isset($_GET["collection"])){
  317. echo "&collection=".$_GET["collection"];
  318. }
  319. if(isset($_GET["channel"])){
  320. echo "&channel=".$_GET["channel"];
  321. }
  322. if(isset($_GET["lang"])){
  323. echo "&lang=".$_GET["lang"];
  324. }
  325. if(isset($_GET["book"])){
  326. echo "&book=".$_GET["book"];
  327. }
  328. if(isset($_GET["par"])){
  329. echo "&par=".$_GET["par"];
  330. }
  331. if(isset($_GET["start"])){
  332. echo "&start=".$_GET["start"];
  333. }
  334. if(isset($_GET["end"])){
  335. echo "&end=".$_GET["end"];
  336. }
  337. echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";
  338. ?>
  339. <button id="btn_show_channel" class="icon_btn show_pc" onclick='show_channel_detail_pannal()'>
  340. <?php echo $_local->gui->contributor.$_local->gui->white_space.$_local->gui->list; ?>
  341. </button>
  342. <span>
  343. <?php include "../reader/right_tool_bar.php";?>
  344. </span>
  345. </span>
  346. </div>
  347. </div>
  348. <div id="left_pannal">
  349. <div id="left_pannal_inner" class="fun_frame" style="z-index: 99;">
  350. <!--<div id = "collect_title" class="title" style="text-align: right;background: #ffd70087;" onclick="show_content(this)"></div>-->
  351. <div id = "toc_content" class="content" style="padding-top:0;">
  352. </div>
  353. </div>
  354. </div>
  355. <div id="main_view" class="main_view <?php echo $classMode;?>">
  356. <div id="article_head" style="border-bottom: 1px solid gray;">
  357. <div id="head_nav" >
  358. <div id="head_nav_left" >
  359. <div id="article_path" class=""></div>
  360. <div id="article_path_title"></div>
  361. </div>
  362. <div id="head_nav_right" >
  363. <select id="select_lang" onchange="lang_changed(this)">
  364. <option>全部语言</option>
  365. <option><?php echo $_local->language->zh_cn; ?></option>
  366. <option><?php echo $_local->language->zh_tw; ?></option>
  367. <option><?php echo $_local->language->en; ?></option>
  368. <option><?php echo $_local->language->si; ?></option>
  369. <option><?php echo $_local->language->my; ?></option>
  370. </select>
  371. <div id="article_edition" style="display:flex;">
  372. <span style='font-weight: 700;'>
  373. <?php echo $_local->gui->channels; ?>
  374. </span>
  375. <div id="edition_dropdown" class="case_dropdown">
  376. <span></span>
  377. </div>
  378. </div>
  379. </div>
  380. </div>
  381. <div id="article_title" class="term_word_head_pali"></div>
  382. <div id="article_subtitle"></div>
  383. <div id="article_author"></div>
  384. <div id="like_div">
  385. <like restype='article' resid='124'></like>
  386. <watch restype='article' resid='124'></watch>
  387. </div>
  388. </div>
  389. <div id="contents_view">
  390. <div id="contents_div" class="contents_div">
  391. <div id="summary"></div>
  392. <div id="contents" class="content_inner <?php echo $contentClass;?>">
  393. <?php echo $_local->gui->loading; ?>...
  394. </div>
  395. <div id="glossary"></div>
  396. <div id="contents_foot">
  397. <div id="contents_nav" style="display:flex;justify-content: space-between;">
  398. <div id="contents_nav_left" class="nav_bnt nav_left" onclick="goto_prev()">
  399. <svg class='icon' style='fill: var(--box-bg-color1)'>
  400. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-left'>
  401. </svg>
  402. <span id="contents_nav_left_inner" ></span>
  403. </div>
  404. <div id="contents_nav_right" class="nav_bnt nav_right" onclick="goto_next()">
  405. <span id="contents_nav_right_inner" ></span>
  406. <svg class='icon' style='fill: var(--box-bg-color1)'>
  407. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-right'>
  408. </svg>
  409. </div>
  410. </div>
  411. <div id="contents_dicuse">
  412. </div>
  413. </div>
  414. </div>
  415. <div id="right_pannal" style="max-width: unset;">
  416. <div class="fun_frame" style="position: fixed;width: auto;height: calc(100vh - 250px);display: grid;">
  417. <div style="display:flex;justify-content: space-between;">
  418. <div class="title"><?php echo $_local->gui->contributor; ?></div>
  419. <div class="click_dropdown_div">
  420. <div class="channel_select_button" style="color: var(--link-color);" onclick="onChannelMultiSelectStart()"><?php echo $_local->gui->select.$_local->gui->space.$_local->gui->more.$_local->gui->space.$_local->gui->channel."⬇"; ?></div>
  421. </div>
  422. </div>
  423. <div class='channel_select'>
  424. <button onclick='onChannelChange()'><?php echo $_local->gui->confirm; ?></button>
  425. <button onclick='onChannelMultiSelectCancel()'><?php echo $_local->gui->cancel; ?></button>
  426. </div>
  427. <div id="channal_list" class="content" style="max-height:calc(100vh - 300px);">
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. <script>
  434. $(document).ready(function(){
  435. if(window.innerWidth>800){
  436. if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
  437. set_toc_visible(false);
  438. }else{
  439. set_toc_visible(true);
  440. }
  441. }else{
  442. set_toc_visible(false);
  443. }
  444. article_add_dlg_init("article_add_div");
  445. ntf_init();
  446. click_dropdown_init();
  447. note_create();
  448. historay_init();
  449. chapter_dynamic_init();
  450. switch (_view) {
  451. case "article":
  452. articel_load(_articel_id,_collection_id);
  453. if(_collection_id!=""){
  454. articel_load_article_list(_articel_id,_collection_id);
  455. }
  456. break;
  457. case "collection":
  458. collect_load(_collection_id);
  459. break;
  460. case "sent":
  461. case "para":
  462. case "chapter":
  463. case "book":
  464. case "series":
  465. palicanon_load();
  466. reader_get_path();
  467. render_toc();
  468. break;
  469. case "simsent":
  470. case "sim":
  471. palicanon_load();
  472. break;
  473. case 'term':
  474. term_load();
  475. break;
  476. default:
  477. break;
  478. }
  479. if(_view=='chapter'){
  480. //获取章节的channel列表
  481. loadChapterChannel({
  482. book:_book,
  483. para:_par,
  484. target:$("#article_author"),
  485. showchannel:_channal.split(',')
  486. });
  487. }
  488. });
  489. window.addEventListener('scroll',winScroll);
  490. function winScroll(e){
  491. if(GetPageScroll().y>220){
  492. }
  493. else{
  494. }
  495. }
  496. //滚动条位置
  497. function GetPageScroll()
  498. {
  499. var pos=new Object();
  500. var x, y;
  501. if(window.pageYOffset)
  502. { // all except IE
  503. y = window.pageYOffset;
  504. x = window.pageXOffset;
  505. } else if(document.documentElement && document.documentElement.scrollTop)
  506. { // IE 6 Strict
  507. y = document.documentElement.scrollTop;
  508. x = document.documentElement.scrollLeft;
  509. } else if(document.body) { // all other IE
  510. y = document.body.scrollTop;
  511. x = document.body.scrollLeft;
  512. }
  513. pos.x=x;
  514. pos.y=y;
  515. return(pos);
  516. }
  517. </script>
  518. <div class="modal_win_bg">
  519. </div>
  520. <div id="model_win" class="model_win_container"></div>
  521. </body>
  522. </html>