index.php 12 KB

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