index.php 13 KB

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