index.php 11 KB

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