index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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. <style>
  141. ul.fancytree-container{
  142. border:unset;
  143. width: max-content;
  144. }
  145. .fancytree-container .active {
  146. font-weight: 700;
  147. color: var(--main-color);
  148. background: linear-gradient(to right, var(--link-color), var(--nocolor));
  149. border-radius: 5px;
  150. }
  151. span.fancytree-title{
  152. color: var(--main-color1);
  153. }
  154. span.fancytree-node{
  155. display: flex;
  156. }
  157. #content_toc>ul>li>span.fancytree-node{
  158. font-size: 120%;
  159. font-weight: 900;
  160. }
  161. #article_path chapter{
  162. display:unset;
  163. }
  164. .float_dlg {
  165. display: none;
  166. width: 25em;
  167. position: absolute;
  168. right: 0;
  169. background-color: var(--btn-hover-bg-color);
  170. padding: 10px;
  171. border-radius: 5px;
  172. box-shadow: 0 0 10px var(--main-color);
  173. z-index: 1;
  174. }
  175. .float_dlg_left {
  176. display: none;
  177. width: 25em;
  178. position: absolute;
  179. background-color: var(--btn-hover-bg-color);
  180. padding: 10px;
  181. border-radius: 5px;
  182. box-shadow: 0 0 10px var(--main-color);
  183. z-index: 200;
  184. }
  185. #contents ul, li {
  186. margin-block-start: 0.5em;
  187. margin-block-end: 0.5em;
  188. margin-left: 18px;
  189. }
  190. .click_dropdown_div{
  191. align-self: center;
  192. }
  193. .channel_select_button{
  194. color: var(--link-color);
  195. }
  196. .channel_select_button:hover{
  197. text-decoration-line: underline;
  198. }
  199. .sent_tran_div a{
  200. white-space: normal;
  201. overflow-wrap: anywhere;
  202. }
  203. .para_tran_div a{
  204. white-space: normal;
  205. overflow-wrap: anywhere;
  206. }
  207. </style>
  208. <?php
  209. require_once("../pcdl/head_bar.php");
  210. ?>
  211. <script>
  212. function show_content(){
  213. $("#left_pannal").toggleClass("hidden");
  214. if($("#left_pannal").hasClass("hidden")){
  215. $("#main_view").removeClass("main_view_narrow");
  216. $(".fun_frame").removeClass("fun_frame_narrow");
  217. $("#contents_div").removeClass("contents_div_narrow");
  218. //$("#main_view").css("margin-left","0");
  219. //$(".fun_frame").css("width","30vw");
  220. //$("#contents_div").css("width","calc(70vw - 2em)");
  221. $("#left_pannal_inner").css("width","unset");
  222. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  223. }else{
  224. $("#main_view").toggleClass("main_view_narrow");
  225. $(".fun_frame").toggleClass("fun_frame_narrow");
  226. $("#contents_div").toggleClass("contents_div_narrow");
  227. //$("#main_view").css("margin-left","20vw");
  228. //$(".fun_frame").css("width","20vw");
  229. //$("#contents_div").css("width","calc(60vw - 2em)");
  230. $("#left_pannal_inner").css("width","unset");
  231. localStorage.setItem('article_show_toc_'+_mode, 'show');
  232. }
  233. }
  234. function set_toc_visible(isVisible){
  235. if(isVisible){
  236. $("#left_pannal").removeClass("hidden");
  237. $("#main_view").toggleClass("main_view_narrow");
  238. //$("#main_view").css("margin-left","20vw");
  239. $(".fun_frame").toggleClass("fun_frame_narrow");
  240. //$(".fun_frame").css("width","20vw");
  241. $("#contents_div").toggleClass("contents_div_narrow");
  242. //$("#contents_div").css("width","calc(60vw - 2em)");
  243. $("#left_pannal_inner").css("width","unset");
  244. localStorage.setItem('article_show_toc_'+_mode, 'show');
  245. }else{
  246. $("#left_pannal").addClass("hidden");
  247. $("#main_view").removeClass("main_view_narrow");
  248. //$("#main_view").css("margin-left","0");
  249. $(".fun_frame").removeClass("fun_frame_narrow");
  250. //$(".fun_frame").css("width","30vw");
  251. $("#contents_div").removeClass("contents_div_narrow");
  252. //$("#contents_div").css("width","calc(70vw - 2em)");
  253. $("#left_pannal_inner").css("width","unset");
  254. localStorage.setItem('article_show_toc_'+_mode, 'hide');
  255. }
  256. }
  257. </script>
  258. <div id="head_bar" >
  259. <div style="display:flex;">
  260. <button class="icon_btn" onclick="show_content()"><?php echo $_local->gui->contents; ?></button>
  261. </div>
  262. <div style="margin: auto 0;">
  263. <span id="head_span">
  264. <?php
  265. if(isset($_GET["view"]) && $_GET["view"]=="article"){
  266. echo "<button class='icon_btn show_pc' title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
  267. echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
  268. echo "' target='_blank'>{$_local->gui->modify}</a></button>";
  269. }
  270. if($_GET["view"]!=="article" && $_GET["view"]!=="collection"){
  271. ?>
  272. <span id="convert_article" class="icon_btn_div show_pc">
  273. <button id="file_add" type="button" class="icon_btn" onclick="to_article()" title=" ">
  274. <svg class="icon">
  275. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  276. </svg>
  277. 转换为文章
  278. </button>
  279. <div id='article_add_div' class="float_dlg"></div>
  280. </span>
  281. <?php
  282. }
  283. echo "<button class='icon_btn show_pc' title='{$_local->gui->add}{$_local->gui->subfield}'>";
  284. echo "<a href='../article/frame.php?view=".$_GET["view"];
  285. if(isset($_GET["id"])){
  286. echo "&id=".$_GET["id"];
  287. }
  288. if(isset($_GET["collection"])){
  289. echo "&collection=".$_GET["collection"];
  290. }
  291. if(isset($_GET["channel"])){
  292. echo "&channel=".$_GET["channel"];
  293. }
  294. if(isset($_GET["lang"])){
  295. echo "&lang=".$_GET["lang"];
  296. }
  297. if(isset($_GET["book"])){
  298. echo "&book=".$_GET["book"];
  299. }
  300. if(isset($_GET["par"])){
  301. echo "&par=".$_GET["par"];
  302. }
  303. if(isset($_GET["start"])){
  304. echo "&start=".$_GET["start"];
  305. }
  306. if(isset($_GET["end"])){
  307. echo "&end=".$_GET["end"];
  308. }
  309. echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";
  310. ?>
  311. <span>
  312. <?php include "../reader/right_tool_bar.php";?>
  313. </span>
  314. </span>
  315. </div>
  316. </div>
  317. <div id="left_pannal">
  318. <div id="left_pannal_inner" class="fun_frame" style="z-index: 99;">
  319. <!--<div id = "collect_title" class="title" style="text-align: right;background: #ffd70087;" onclick="show_content(this)"></div>-->
  320. <div id = "toc_content" class="content" style="padding-top:0;">
  321. </div>
  322. </div>
  323. </div>
  324. <div id="main_view" class="main_view <?php echo $classMode;?>">
  325. <div id="article_head" style="border-bottom: 1px solid gray;">
  326. <div id="head_nav" >
  327. <div id="head_nav_left" >
  328. <div id="article_path" class=""></div>
  329. <div id="article_path_title"></div>
  330. </div>
  331. <div id="head_nav_right" >
  332. <select id="select_lang" onchange="lang_changed(this)">
  333. <option>全部语言</option>
  334. <option>简体中文</option>
  335. <option>繁体中文</option>
  336. <option>英文</option>
  337. </select>
  338. <div id="article_edition" style="display:flex;">
  339. <span style='font-weight: 700;'>文章版本 </span>
  340. <div id="edition_dropdown" class="case_dropdown">
  341. <span></span>
  342. </div>
  343. </div>
  344. <div>
  345. <button id="btn_show_channel" onclick='show_channel_detail_pannal()'>Details</button>
  346. </div>
  347. </div>
  348. </div>
  349. <div id="article_title" class="term_word_head_pali"></div>
  350. <div id="article_subtitle"></div>
  351. <div id="article_author"></div>
  352. <div id="like_div">
  353. <like restype='article' resid='124'></like>
  354. <watch restype='article' resid='124'></watch>
  355. </div>
  356. </div>
  357. <div id="contents_view">
  358. <div id="contents_div" class="contents_div">
  359. <div id="summary"></div>
  360. <div id="contents" class="content_inner <?php echo $contentClass;?>">
  361. <?php echo $_local->gui->loading; ?>...
  362. </div>
  363. <div id="glossary"></div>
  364. <div id="contents_foot">
  365. <div id="contents_nav" style="display:flex;justify-content: space-between;">
  366. <div id="contents_nav_left" class="nav_bnt nav_left" onclick="goto_prev()">
  367. <svg class='icon' style='fill: var(--box-bg-color1)'>
  368. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-left'>
  369. </svg>
  370. <span id="contents_nav_left_inner" ></span>
  371. </div>
  372. <div id="contents_nav_right" class="nav_bnt nav_right" onclick="goto_next()">
  373. <span id="contents_nav_right_inner" ></span>
  374. <svg class='icon' style='fill: var(--box-bg-color1)'>
  375. <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-right'>
  376. </svg>
  377. </div>
  378. </div>
  379. <div id="contents_dicuse">
  380. </div>
  381. </div>
  382. </div>
  383. <div id="right_pannal" style="max-width: unset;">
  384. <div class="fun_frame" style="position: fixed;width: auto;height: calc(100vh - 250px);display: grid;">
  385. <div style="display:flex;justify-content: space-between;">
  386. <div class="title"><?php echo $_local->gui->contributor; ?></div>
  387. <div class="click_dropdown_div">
  388. <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>
  389. </div>
  390. </div>
  391. <div class='channel_select'>
  392. <button onclick='onChannelChange()'><?php echo $_local->gui->confirm; ?></button>
  393. <button onclick='onChannelMultiSelectCancel()'><?php echo $_local->gui->cancel; ?></button>
  394. </div>
  395. <div id="channal_list" class="content" style="max-height:calc(100vh - 300px);">
  396. </div>
  397. </div>
  398. </div>
  399. </div>
  400. </div>
  401. <script>
  402. $(document).ready(function(){
  403. if(window.innerWidth>800){
  404. if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
  405. set_toc_visible(false);
  406. }else{
  407. set_toc_visible(true);
  408. }
  409. }else{
  410. set_toc_visible(false);
  411. }
  412. article_add_dlg_init("article_add_div");
  413. ntf_init();
  414. click_dropdown_init();
  415. note_create();
  416. historay_init();
  417. chapter_dynamic_init();
  418. switch (_view) {
  419. case "article":
  420. articel_load(_articel_id,_collection_id);
  421. if(_collection_id!=""){
  422. articel_load_article_list(_articel_id,_collection_id);
  423. }
  424. break;
  425. case "collection":
  426. collect_load(_collection_id);
  427. break;
  428. case "sent":
  429. case "para":
  430. case "chapter":
  431. case "book":
  432. case "series":
  433. palicanon_load();
  434. reader_get_path();
  435. render_toc();
  436. break;
  437. case "simsent":
  438. case "sim":
  439. palicanon_load();
  440. break;
  441. case 'term':
  442. term_load();
  443. break;
  444. default:
  445. break;
  446. }
  447. if(_view=='chapter'){
  448. //获取章节的channel列表
  449. loadChapterChannel({
  450. book:_book,
  451. para:_par,
  452. target:$("#article_author"),
  453. showchannel:_channal.split(',')
  454. });
  455. }
  456. });
  457. window.addEventListener('scroll',winScroll);
  458. function winScroll(e){
  459. if(GetPageScroll().y>220){
  460. }
  461. else{
  462. }
  463. }
  464. //滚动条位置
  465. function GetPageScroll()
  466. {
  467. var pos=new Object();
  468. var x, y;
  469. if(window.pageYOffset)
  470. { // all except IE
  471. y = window.pageYOffset;
  472. x = window.pageXOffset;
  473. } else if(document.documentElement && document.documentElement.scrollTop)
  474. { // IE 6 Strict
  475. y = document.documentElement.scrollTop;
  476. x = document.documentElement.scrollLeft;
  477. } else if(document.body) { // all other IE
  478. y = document.body.scrollTop;
  479. x = document.body.scrollLeft;
  480. }
  481. pos.x=x;
  482. pos.y=y;
  483. return(pos);
  484. }
  485. </script>
  486. <div class="modal_win_bg">
  487. </div>
  488. <div id="model_win" class="model_win_container"></div>
  489. </body>
  490. </html>