index.php 12 KB

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