index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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. if(isset($_GET["view"]) && $_GET["view"]=="article"){
  269. echo "<button class='icon_btn show_pc' title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
  270. echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
  271. echo "' target='_blank'>{$_local->gui->modify}</a></button>";
  272. }
  273. if($_GET["view"]!=="article" && $_GET["view"]!=="collection"){
  274. ?>
  275. <span id="convert_article" class="icon_btn_div show_pc">
  276. <button id="file_add" type="button" class="icon_btn" onclick="to_article()" title=" ">
  277. <svg class="icon">
  278. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  279. </svg>
  280. 转换为文章
  281. </button>
  282. <div id='article_add_div' class="float_dlg"></div>
  283. </span>
  284. <?php
  285. }
  286. echo "<button class='icon_btn show_pc' title='{$_local->gui->add}{$_local->gui->subfield}'>";
  287. echo "<a href='../article/frame.php?view=".$_GET["view"];
  288. if(isset($_GET["id"])){
  289. echo "&id=".$_GET["id"];
  290. }
  291. if(isset($_GET["collection"])){
  292. echo "&collection=".$_GET["collection"];
  293. }
  294. if(isset($_GET["channel"])){
  295. echo "&channel=".$_GET["channel"];
  296. }
  297. if(isset($_GET["lang"])){
  298. echo "&lang=".$_GET["lang"];
  299. }
  300. if(isset($_GET["book"])){
  301. echo "&book=".$_GET["book"];
  302. }
  303. if(isset($_GET["par"])){
  304. echo "&par=".$_GET["par"];
  305. }
  306. if(isset($_GET["start"])){
  307. echo "&start=".$_GET["start"];
  308. }
  309. if(isset($_GET["end"])){
  310. echo "&end=".$_GET["end"];
  311. }
  312. echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";
  313. ?>
  314. <button id="btn_show_channel" class="icon_btn show_pc" onclick='show_channel_detail_pannal()'>
  315. <?php echo $_local->gui->contributor.$_local->gui->white_space.$_local->gui->list; ?>
  316. </button>
  317. <span>
  318. <?php include "../reader/right_tool_bar.php";?>
  319. </span>
  320. </span>
  321. </div>
  322. </div>
  323. <div id="left_pannal">
  324. <div id="left_pannal_inner" class="fun_frame" style="z-index: 99;">
  325. <!--<div id = "collect_title" class="title" style="text-align: right;background: #ffd70087;" onclick="show_content(this)"></div>-->
  326. <div id = "toc_content" class="content" style="padding-top:0;">
  327. </div>
  328. </div>
  329. </div>
  330. <div id="main_view" class="main_view <?php echo $classMode;?>">
  331. <div id="article_head" style="border-bottom: 1px solid gray;">
  332. <div id="head_nav" >
  333. <div id="head_nav_left" >
  334. <div id="article_path" class=""></div>
  335. <div id="article_path_title"></div>
  336. </div>
  337. <div id="head_nav_right" >
  338. <select id="select_lang" onchange="lang_changed(this)">
  339. <option>全部语言</option>
  340. <option><?php echo $_local->language->zh_cn; ?></option>
  341. <option><?php echo $_local->language->zh_tw; ?></option>
  342. <option><?php echo $_local->language->en; ?></option>
  343. <option><?php echo $_local->language->si; ?></option>
  344. <option><?php echo $_local->language->my; ?></option>
  345. </select>
  346. <div id="article_edition" style="display:flex;">
  347. <span style='font-weight: 700;'>
  348. <?php echo $_local->gui->channels; ?>
  349. </span>
  350. <div id="edition_dropdown" class="case_dropdown">
  351. <span></span>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. <div id="article_title" class="term_word_head_pali"></div>
  357. <div id="article_subtitle"></div>
  358. <div id="article_author"></div>
  359. <div id="like_div">
  360. <like restype='article' resid='124'></like>
  361. <watch restype='article' resid='124'></watch>
  362. </div>
  363. </div>
  364. <div id="contents_view">
  365. <div id="contents_div" class="contents_div">
  366. <div id="summary"></div>
  367. <div id="contents" class="content_inner <?php echo $contentClass;?>">
  368. <?php echo $_local->gui->loading; ?>...
  369. </div>
  370. <div id="glossary"></div>
  371. <div id="contents_foot">
  372. <div id="contents_nav" style="display:flex;justify-content: space-between;">
  373. <div id="contents_nav_left" class="nav_bnt nav_left" onclick="goto_prev()">
  374. <svg class='icon' style='fill: var(--box-bg-color1)'>
  375. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-left'>
  376. </svg>
  377. <span id="contents_nav_left_inner" ></span>
  378. </div>
  379. <div id="contents_nav_right" class="nav_bnt nav_right" onclick="goto_next()">
  380. <span id="contents_nav_right_inner" ></span>
  381. <svg class='icon' style='fill: var(--box-bg-color1)'>
  382. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-right'>
  383. </svg>
  384. </div>
  385. </div>
  386. <div id="contents_dicuse">
  387. </div>
  388. </div>
  389. </div>
  390. <div id="right_pannal" style="max-width: unset;">
  391. <div class="fun_frame" style="position: fixed;width: auto;height: calc(100vh - 250px);display: grid;">
  392. <div style="display:flex;justify-content: space-between;">
  393. <div class="title"><?php echo $_local->gui->contributor; ?></div>
  394. <div class="click_dropdown_div">
  395. <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>
  396. </div>
  397. </div>
  398. <div class='channel_select'>
  399. <button onclick='onChannelChange()'><?php echo $_local->gui->confirm; ?></button>
  400. <button onclick='onChannelMultiSelectCancel()'><?php echo $_local->gui->cancel; ?></button>
  401. </div>
  402. <div id="channal_list" class="content" style="max-height:calc(100vh - 300px);">
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. <script>
  409. $(document).ready(function(){
  410. if(window.innerWidth>800){
  411. if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
  412. set_toc_visible(false);
  413. }else{
  414. set_toc_visible(true);
  415. }
  416. }else{
  417. set_toc_visible(false);
  418. }
  419. article_add_dlg_init("article_add_div");
  420. ntf_init();
  421. click_dropdown_init();
  422. note_create();
  423. historay_init();
  424. chapter_dynamic_init();
  425. switch (_view) {
  426. case "article":
  427. articel_load(_articel_id,_collection_id);
  428. if(_collection_id!=""){
  429. articel_load_article_list(_articel_id,_collection_id);
  430. }
  431. break;
  432. case "collection":
  433. collect_load(_collection_id);
  434. break;
  435. case "sent":
  436. case "para":
  437. case "chapter":
  438. case "book":
  439. case "series":
  440. palicanon_load();
  441. reader_get_path();
  442. render_toc();
  443. break;
  444. case "simsent":
  445. case "sim":
  446. palicanon_load();
  447. break;
  448. case 'term':
  449. term_load();
  450. break;
  451. default:
  452. break;
  453. }
  454. if(_view=='chapter'){
  455. //获取章节的channel列表
  456. loadChapterChannel({
  457. book:_book,
  458. para:_par,
  459. target:$("#article_author"),
  460. showchannel:_channal.split(',')
  461. });
  462. }
  463. });
  464. window.addEventListener('scroll',winScroll);
  465. function winScroll(e){
  466. if(GetPageScroll().y>220){
  467. }
  468. else{
  469. }
  470. }
  471. //滚动条位置
  472. function GetPageScroll()
  473. {
  474. var pos=new Object();
  475. var x, y;
  476. if(window.pageYOffset)
  477. { // all except IE
  478. y = window.pageYOffset;
  479. x = window.pageXOffset;
  480. } else if(document.documentElement && document.documentElement.scrollTop)
  481. { // IE 6 Strict
  482. y = document.documentElement.scrollTop;
  483. x = document.documentElement.scrollLeft;
  484. } else if(document.body) { // all other IE
  485. y = document.body.scrollTop;
  486. x = document.body.scrollLeft;
  487. }
  488. pos.x=x;
  489. pos.y=y;
  490. return(pos);
  491. }
  492. </script>
  493. <div class="modal_win_bg">
  494. </div>
  495. <div id="model_win" class="model_win_container"></div>
  496. </body>
  497. </html>