index.php 12 KB

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