2
0

index.php 14 KB

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