reader.php 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079
  1. <?php
  2. require_once "../public/_pdo.php";
  3. require_once "../path.php";
  4. require_once '../public/load_lang.php';
  5. require_once '../public/function.php';
  6. require_once '../channal/function.php';
  7. require_once '../ucenter/function.php';
  8. ?>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  14. <link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
  15. <link type="text/css" rel="stylesheet" href="css/reader.css"/>
  16. <link type="text/css" rel="stylesheet" href="css/reader_mob.css" media="screen and (max-width:767px)">
  17. <title id="page_title">PCD Reader</title>
  18. <script src="js/jquery-3.3.1.min.js"></script>
  19. <script src="../public/js/jquery-ui-1.12.1/jquery-ui.js"></script>
  20. <script src="js/fixedsticky.js"></script>
  21. <script src="js/reader.js"></script>
  22. <script src="../public/js/comm.js"></script>
  23. <script src="../term/term.js"></script>
  24. <script src="../term/note.js"></script>
  25. </head>
  26. <body class="reader_body" >
  27. <a name="page_head"></a>
  28. <script type="text/javascript">
  29. $(document).ready(function(){
  30. $(".toc_1_title").click(function(){
  31. $(this).parent().siblings().children(".toc_2").hide();
  32. $(this).siblings().slideToggle("200");
  33. });
  34. });
  35. </script>
  36. <style>
  37. .edit_icon{
  38. display:inline-block;
  39. width:1.4em;
  40. height:1.4em;
  41. }
  42. #para_nav {
  43. display: flex;
  44. justify-content: space-between;
  45. padding: 5px 1em;
  46. border-top: 1px solid gray;
  47. }
  48. .word{
  49. display:inline-block;
  50. padding: 1px 3px;
  51. }
  52. .mean{
  53. font-size: 65%;
  54. }
  55. /* 下拉内容 (默认隐藏) */
  56. #mean_menu {
  57. margin: 0.3em;
  58. position: absolute;
  59. background-color: white;
  60. min-width: 8em;
  61. max-width: 30em;
  62. margin: -1px 0px;
  63. box-shadow: 0px 3px 13px 0px black;
  64. color: var(--main-color);
  65. z-index: 200;
  66. }
  67. /* 下拉菜单的链接 */
  68. #mean_menu a {
  69. /*padding: 0.3em 0.4em;*/
  70. line-height: 160%;
  71. text-decoration: none;
  72. display: block;
  73. cursor: pointer;
  74. text-align: left;
  75. font-size:80%;
  76. }
  77. /* 鼠标移上去后修改下拉菜单链接颜色 */
  78. .mean_menu a:hover {
  79. background-color: blue;
  80. color: white;
  81. }
  82. .par_pali_div{
  83. margin-top:1em;
  84. }
  85. .par_pali_div{
  86. font-weight:700;
  87. }
  88. sent{
  89. font-weight:500;
  90. font-size:110%;
  91. line-height: 150%;
  92. }
  93. sent:hover{
  94. background-color:#fefec1;
  95. }
  96. para {
  97. color: white;
  98. background-color: #F1CA23;
  99. min-width: 2em;
  100. display: inline-block;
  101. text-align: center;
  102. padding: 3px 6px;
  103. border-radius: 99px;
  104. margin-right: 5px;
  105. cursor:pointer;
  106. font-size:80%;
  107. }
  108. para:hover{
  109. }
  110. .sent_count{
  111. font-size:80%;
  112. color: white;
  113. background-color: #1cb70985;
  114. min-width: 2em;
  115. display: inline-block;
  116. text-align: center;
  117. padding: 2px 0;
  118. border-radius: 99px;
  119. margin-left: 5px;
  120. cursor:pointer;
  121. }
  122. .toc_1{
  123. padding: 5px;
  124. cursor: pointer;
  125. border-left: 2px solid #aaaaaa;
  126. }
  127. .toc_1_title{
  128. font-weight:700;
  129. }
  130. .toc_2{
  131. font-weight:500;
  132. padding-left:1em;
  133. display:none;
  134. }
  135. .curr_chapter{
  136. border-color: #4d4dff;
  137. color: #4d4dff;
  138. }
  139. .toc_curr_chapter2{
  140. display:block;
  141. }
  142. .toc_title2 a{
  143. color:black;
  144. line-height:1.4em;
  145. text-decoration: none;
  146. }
  147. .toc_title2 a:hover{
  148. text-decoration: underline;
  149. }
  150. .curr_chapter_title2 a{
  151. color:#4d4dff;
  152. font-weight:900;
  153. }
  154. #leftmenuinner{
  155. width: 20em;
  156. max-width: 90%;
  157. overflow-y: scroll;
  158. border-right: unset;
  159. }
  160. #leftmenuinnerinner{
  161. }
  162. #leftmenuinnerinner{
  163. margin-left: 2em;
  164. font-size: 0.8em;
  165. border-right: unset;
  166. }
  167. .sent_toc{
  168. font-weight:700;
  169. font-family: Noto serif;
  170. font-size: 150%;
  171. }
  172. </style>
  173. <!-- tool bar begin-->
  174. <div id="main_tool_bar" class='reader_toolbar'>
  175. <div id="index_nav">
  176. <button onclick="setNaviVisibility()">
  177. <svg t='1598084571450' class='icon' viewBox='0 0 1029 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6428' width='20px' height='20px'><path d='M159.744 69.632 53.248 69.632C28.672 69.632 4.096 90.112 4.096 118.784l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0C184.32 266.24 208.896 241.664 208.896 212.992L208.896 118.784C208.896 90.112 184.32 69.632 159.744 69.632zM970.752 69.632 368.64 69.632c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152L1024 118.784C1028.096 94.208 999.424 69.632 970.752 69.632zM159.744 413.696 53.248 413.696c-28.672 0-53.248 24.576-53.248 49.152l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0c28.672 0 53.248-24.576 53.248-49.152l0-94.208C208.896 438.272 184.32 413.696 159.744 413.696zM970.752 413.696 368.64 413.696c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152l0-94.208C1028.096 438.272 999.424 413.696 970.752 413.696zM159.744 757.76 53.248 757.76c-28.672 0-53.248 24.576-53.248 49.152l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0c28.672 0 53.248-24.576 53.248-49.152l0-94.208C208.896 782.336 184.32 757.76 159.744 757.76zM970.752 761.856 368.64 761.856c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152l0-94.208C1028.096 782.336 999.424 761.856 970.752 761.856z' fill='#757AF7' p-id='6429'></path></svg>
  178. </button>
  179. </div>
  180. <div>
  181. <span id="tool_bar_title" style="font-family: 'Noto Serif';"><?php echo $_local->gui->title; ?></span>
  182. </div>
  183. <div style="display: flex;">
  184. <form action="../studio/project.php" method="post" onsubmit="return pali_canon_edit_now(this)" target="_blank" style="display: inline-block;">
  185. <div style="display:none;">
  186. <input type="input" name="op" value="create">
  187. <input type="hidden" name="view" value="<?php echo $_GET["view"]?>" />
  188. <input type="hidden" name="book" value="<?php echo $_GET["book"]?>" />
  189. <input type="hidden" id = "para" name="para" value="" />
  190. <input type="hidden" id = "para_end" name="para_end" value="" />
  191. <input type="hidden" id = "chapter_title" name="chapter_title" value="" />
  192. <textarea id="project_new_res_data" rows="3" cols="18" name="data"></textarea>
  193. </div>
  194. <input type="submit" value="<?php echo $_local->gui->edit_now; ?>">
  195. </form>
  196. <div class="case_dropdown">
  197. <p class="case_dropbtn"><button>
  198. <svg t='1598086376923' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='8426' width='20px' height='20px'><path d='M609.745455 453.818182v130.327273h69.818181V535.272727H744.727273v377.018182h95.418182V535.272727H907.636364v48.872728h69.818181V453.818182z' p-id='8427' fill='#757AF7'></path><path d='M677.236364 300.218182V111.709091H46.545455V300.218182h69.818181v-51.2h162.909091v663.272727h165.236364V249.018182h162.909091v51.2z' p-id='8428' fill='#757AF7'></path></svg>
  199. </button></p>
  200. <div class="case_dropdown-content" style="right: 0;width:10em;">
  201. <div ><button>A+</button><button>A-</button></div>
  202. <div ><button><?php echo $_local->gui->white;?></button><button><?php echo $_local->gui->dawn;//棕?></button><button><?php echo $_local->gui->night;//夜?></button></div>
  203. </div>
  204. </div>
  205. <div class="case_dropdown">
  206. <p class="case_dropbtn"><button>
  207. <svg t='1598086493824' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='9217' width='20px' height='20px'><path d='M912.695652 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9218' fill='#757AF7'></path><path d='M512 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9219' fill='#757AF7'></path><path d='M111.304348 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9220' fill='#757AF7'></path></svg>
  208. </button></p>
  209. <div class="case_dropdown-content" style="right: 2em;min-width:6em;">
  210. <a onclick="tool_changed('dighest')"><?php echo $_local->gui->digest; //书摘?></a>
  211. <a onclick="tool_changed('comments')"><?php echo $_local->gui->comment; //批注?></a>
  212. <a onclick="tool_changed('target')"><?php echo $_local->gui->tag; //标签?></a>
  213. <a onclick="tool_changed('layout')"><?php echo $_local->gui->layout; //布局?></a>
  214. <a onclick="tool_changed('porpername')"><?php echo $_local->gui->dict_terms; //术语?></a>
  215. <a onclick="tool_changed('share')"><?php echo $_local->gui->share; //分享?></a>
  216. <a onclick="tool_changed('fix')"><?php echo $_local->gui->modify; //修改?></a>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <div id="tool_bar_comments">
  222. <div class='reader_toolbar' style="height:auto;">
  223. <div>
  224. </div>
  225. <div>
  226. <span>单击段落文字添加批注</span>
  227. </div>
  228. <div>
  229. </div>
  230. </div>
  231. </div>
  232. <div id="tool_bar_dighest">
  233. <div class='reader_toolbar' style="height:auto;">
  234. <div>
  235. <button onclick="dighest_cancle()">取消</button>
  236. </div>
  237. <div>
  238. <span id="dighest_message">单击文字选择段落</span>
  239. </div>
  240. <div>
  241. <button onclick="dighest_ok()">完成</button>
  242. </div>
  243. </div>
  244. </div>
  245. <div id="tool_bar_fix">
  246. <div class='reader_toolbar' style="height:auto;">
  247. <div>
  248. <button onclick="fix_cancle()">取消</button>
  249. </div>
  250. <div>
  251. <span id="fix_message">单击按钮调整段落</span>
  252. </div>
  253. <div>
  254. <button onclick="fix_ok()">完成</button>
  255. </div>
  256. </div>
  257. </div>
  258. <!--tool bar end -->
  259. <div id="main_text_view" style="padding-bottom: 10em;">
  260. <?php
  261. $tocHtml="";
  262. if(isset($_GET["album"])){
  263. $album=$_GET["album"];
  264. }
  265. if(isset($_GET["channal"])){
  266. $channal=$_GET["channal"];
  267. }
  268. if(isset($_GET["book"])){
  269. $book=$_GET["book"];
  270. }
  271. else{
  272. echo "no book id";
  273. }
  274. if(substr($book,0,1)=='p'){
  275. $book=substr($book,1);
  276. }
  277. if(isset($_GET["paragraph"])){
  278. $paragraph = $_GET["paragraph"];
  279. }
  280. else if(isset($_GET["para"])){
  281. $paragraph = $_GET["para"];
  282. }
  283. else{
  284. $paragraph = -1;
  285. }
  286. if(isset($_GET["view"])){
  287. $_view = $_GET["view"];
  288. }
  289. else{
  290. echo "Error : 未定义必要的参数view";
  291. exit;
  292. }
  293. if(isset($_GET["display"])){
  294. $_display = $_GET["display"];
  295. }
  296. else{
  297. if($_view=="para" || $_view=="sent"){
  298. $_display = "sent";//默认值
  299. }
  300. else{
  301. $_display = "para";
  302. }
  303. }
  304. $tocList = array();
  305. if($_view=="chapter" || $_view=="para" || $_view=="sent" ){
  306. PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
  307. //生成目录
  308. $htmlToc2 = "<div><a href='#page_head'>页首</a></div>";
  309. //找到该位置对应的书
  310. $query = "select paragraph,level,chapter_len,parent from 'pali_text' where book='$book' and paragraph='$paragraph'";
  311. $FetchParInfo = PDO_FetchAll($query);
  312. $deep = 0;
  313. if(count($FetchParInfo)>0){
  314. $para = $FetchParInfo[0]["paragraph"];
  315. $level = $FetchParInfo[0]["level"];
  316. $chapter_len = $FetchParInfo[0]["chapter_len"];
  317. $parent = $FetchParInfo[0]["parent"];
  318. $currParaBegin = $para;
  319. $currParaEnd = $para + $chapter_len;
  320. $currParaLevel = $level;
  321. $currParaParentLevel = 0;
  322. //循环查找父标题 找到level=1的段落 也就是书名
  323. while($parent>-1){
  324. $query = "select paragraph,level,parent,chapter_len from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$parent}' limit 0,1";
  325. $FetParent = PDO_FetchAll($query);
  326. if(count($FetParent)>0){
  327. $para = $FetParent[0]["paragraph"];
  328. $level = $FetParent[0]["level"];
  329. $chapter_len = $FetParent[0]["chapter_len"];
  330. $parent = $FetParent[0]["parent"];
  331. if($currParaParentLevel==0){
  332. $currParaParentLevel = $level;
  333. }
  334. }
  335. $deep++;
  336. if($deep>8){
  337. break;
  338. }
  339. }
  340. $paraBegin = $para+1;
  341. $paraEnd = $para+$chapter_len;
  342. $query = "SELECT toc,paragraph,level,chapter_len,parent FROM 'pali_text' WHERE book='$book' AND (paragraph BETWEEN '$paraBegin' AND '$paraEnd') and level<100";
  343. $chapter_toc = PDO_FetchAll($query);
  344. $tocMaxLevel = 0;
  345. $tocMinLevel = 0;
  346. $tocBegin = 0;
  347. $tocEnd = 0;
  348. $toc1Level = 0;
  349. $toc2Level = 0;
  350. echo "<div><div>";
  351. foreach ($chapter_toc as $key => $value) {
  352. $tocList[$value["paragraph"]] = $value["level"];
  353. $classCurrToc="";
  354. $classCurrToc2 = "";
  355. $classCurrTocTitle2="";
  356. if($paragraph>=$value["paragraph"] && $paragraph<$value["paragraph"]+$value["chapter_len"]){
  357. $classCurrToc = " curr_chapter";
  358. $classCurrToc2 = " toc_curr_chapter2";
  359. $classCurrTocTitle2=" curr_chapter_title2";
  360. }
  361. if($tocBegin==0 || ($tocBegin>0 && $value["paragraph"]>=$tocEnd)){
  362. //开始新的标题1
  363. $tocBegin =$value["paragraph"];
  364. $tocEnd = $tocBegin + $value["chapter_len"];
  365. $toc1Level = $value["level"];
  366. if(isset($chapter_toc[$key+1])){
  367. if($chapter_toc[$key+1]["level"]>$toc1Level){
  368. $toc2Level = $chapter_toc[$key+1]["level"];
  369. }
  370. else{
  371. $tocBegin=0;
  372. }
  373. }
  374. $tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
  375. $tocHtml .= "<div class='toc_1_title {$classCurrToc}'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2'>";
  376. }
  377. else{
  378. //下一级标题
  379. if($value["level"]==$toc2Level ){
  380. $tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}&display={$_display}'>{$value["toc"]}</a></div>";
  381. }
  382. }
  383. //右侧目录
  384. if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
  385. //$tocList[$value["paragraph"]] = $value["level"];
  386. $htmlToc2 .= "<div><a href='#para_{$value["paragraph"]}'>{$value["toc"]}</a></div>";
  387. }
  388. }
  389. echo " </div></div>";
  390. }
  391. $htmlToc2 .= "<div><a href='#nav_foot'>导航</a></div>";
  392. $htmlToc2 .= "<div><a href='#sim_doc'>相关文档</a></div>";
  393. //获取段落信息 如 父段落 下一个段落等
  394. $query = "select * from 'pali_text' where book='$book' and paragraph='$paragraph'";
  395. $FetchParInfo = PDO_FetchAll($query);
  396. if(count($FetchParInfo)==0){
  397. echo "Error:no paragraph info";
  398. echo $query;
  399. }
  400. $currLevel = $FetchParInfo[0]["level"];
  401. $par_begin=$paragraph+1-1;
  402. if($_view=="para"){
  403. $par_end = $par_begin;
  404. }
  405. else{
  406. $par_end=$par_begin+$FetchParInfo[0]["chapter_len"]-1;
  407. }
  408. $par_next=$FetchParInfo[0]["next_chapter"];
  409. $par_prev=$FetchParInfo[0]["prev_chapter"];
  410. $par_parent=$FetchParInfo[0]["parent"];
  411. if($par_parent >= 0){
  412. $query = "select toc from 'pali_text' where book='$book' and paragraph='$par_parent'";
  413. $FetchToc = PDO_FetchAll($query);
  414. if(count($FetchToc)>0){
  415. $_parent_title = $FetchToc[0]["toc"];
  416. }
  417. }
  418. //查询标题
  419. if($_view=="chapter"){
  420. $par_title = $FetchParInfo[0]["toc"];
  421. }
  422. else{
  423. $par_title = $_parent_title;
  424. }
  425. //导航按钮
  426. if($_view=="sent"){
  427. $next_para_link = "";
  428. $prev_para_link = "";
  429. }
  430. else{
  431. if($par_next != -1){
  432. $query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_next' ";
  433. $FetchPara = PDO_FetchAll($query);
  434. if(count($FetchPara)>0){
  435. $next_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_next}&display={$_display}'><span id='para_nav_next'>{$FetchPara[0]["toc"]}</span><span id='para_nav_next_a'>";
  436. $next_para_link .= "<svg t='1598093121925' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32px' height='32px'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m180.14208 439.84896l-109.19936 128.59392a46.65344 46.65344 0 0 1-65.86368 5.36576 46.71488 46.71488 0 0 1-5.38624-65.8432l43.86816-51.63008h-188.12928a46.6944 46.6944 0 1 1 0-93.42976h188.12928l-43.86816-51.63008a46.75584 46.75584 0 0 1 71.24992-60.47744l109.19936 128.59392c14.82752 17.408 14.82752 43.008 0 60.45696z' p-id='4452' fill='#757AF7'></path></svg>";
  437. $next_para_link .= "</span></a>";
  438. }
  439. else{
  440. $next_para_link = $_local->gui->text_without_title;
  441. }
  442. }
  443. else{
  444. $next_para_link = $_local->gui->end_of_text;
  445. }
  446. if($par_prev != -1){
  447. $query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_prev' ";
  448. $FetchPara = PDO_FetchAll($query);
  449. if(count($FetchPara)>0){
  450. $prev_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_prev}&display={$_display}'><span id='para_nav_prev_a'>";
  451. $prev_para_link .= "<svg t='1598093521111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4644' width='32' height='32'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m144.54784 456.31488h-188.12928l43.84768 51.63008a46.6944 46.6944 0 0 1-35.59424 76.96384 46.55104 46.55104 0 0 1-35.61472-16.4864l-109.24032-128.59392a46.71488 46.71488 0 0 1 0-60.47744l109.24032-128.59392a46.6944 46.6944 0 1 1 71.20896 60.47744l-43.84768 51.63008h188.12928a46.6944 46.6944 0 1 1 0 93.45024z' p-id='4645' fill='#757AF7'></path></svg>";
  452. if($FetchPara[0]["toc"]==""){
  453. $prev_para_link .= "</span><span id='para_nav_prev'>({$_local->gui->text_without_title})</span></a>";
  454. }
  455. else{
  456. $prev_para_link .= "</span><span id='para_nav_prev'>{$FetchPara[0]["toc"]}</span></a>";
  457. }
  458. }
  459. else{
  460. $prev_para_link = $_local->gui->text_without_title;
  461. }
  462. }
  463. else{
  464. $prev_para_link = $_local->gui->begin_of_text;
  465. }
  466. }
  467. //设置标题栏的经文名称
  468. echo "<script>";
  469. echo "document.getElementById('tool_bar_title').innerHTML='".$par_title."';\n";
  470. echo "$('#chapter_title').val('".$par_title."');\n";
  471. echo "$('#para_end').val('".$par_end."');\n";
  472. echo "$('#para').val('".$par_begin."');\n";
  473. echo "</script>";
  474. }
  475. if($currParaLevel==1 || $currParaParentLevel==1){
  476. echo $_local->gui->chapter_select;
  477. }
  478. else{
  479. //上一级
  480. echo "<div>";
  481. switch($_view){
  482. case 1 :
  483. break;
  484. case 2:
  485. break;
  486. case 3:
  487. break;
  488. case 4:
  489. break;
  490. case 5:
  491. break;
  492. case 5:
  493. break;
  494. case 6:
  495. break;
  496. case "chapter":
  497. if($par_parent >= 0 && $currLevel>$tocMinLevel){
  498. echo "<a href='reader.php?view={$_view}&book={$book}&paragraph={$par_parent}'>";
  499. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  500. echo "{$_parent_title}</a>";
  501. }
  502. break;
  503. case "para":
  504. if($par_parent >= 0){
  505. echo "<a href='reader.php?view=chapter&book={$book}&paragraph={$par_parent}'>";
  506. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  507. echo "{$_parent_title}</a>";
  508. }
  509. break;
  510. case "sent":
  511. echo "<a href='reader.php?view=para&book={$book}&paragraph={$paragraph}'>";
  512. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  513. echo "{$paragraph}</a>";
  514. break;
  515. case 10:
  516. break;
  517. }
  518. echo "</div>";
  519. //生成一个段落空壳 等会儿查询数据,按照不同数据类型填充进去
  520. PDO_Connect("sqlite:"._FILE_DB_PALI_SENTENCE_);
  521. if($_display=="sent"){
  522. //逐句显示
  523. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  524. if($_view=="sent"){
  525. $query = "select text, begin, end from 'pali_sent' where book='$book' and paragraph='$paragraph' and begin='{$_GET["begin"]}' and end ='{$_GET["end"]}'";
  526. }
  527. else{
  528. $query = "select text, begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  529. }
  530. if(isset($tocList[$iPar])){
  531. $sentClass = " sent_toc";
  532. }
  533. else{
  534. $sentClass = "";
  535. }
  536. $FetchSent = PDO_FetchAll($query);
  537. echo "<div id='par-b$book-$iPar' class='par_div'>";
  538. echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
  539. foreach ($FetchSent as $key => $value) {
  540. echo "<div id='sent-pali-b$book-$iPar-{$value["begin"]}' class='par_pali_div'>";
  541. $pali_sent = str_replace("{","<b>",$value["text"]);
  542. $pali_sent = str_replace("}","</b>",$pali_sent);
  543. echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
  544. echo "</div>";
  545. echo "<div id='sent-wbwdiv-b$book-$iPar-{$value["begin"]}' class='par_translate_div'>";
  546. echo "</div>";
  547. echo "<div id='sent-translate-b$book-$iPar-{$value["begin"]}' class='par_translate_div'>";
  548. echo "</div>";
  549. }
  550. echo "</div>";
  551. }
  552. }
  553. else{
  554. //段落显示
  555. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  556. if(isset($tocList[$iPar])){
  557. $sentClass = " sent_toc";
  558. }
  559. else{
  560. $sentClass = "";
  561. }
  562. $query = "select text , begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  563. $FetchSent = PDO_FetchAll($query);
  564. echo "<div id='par-b$book-$iPar' class='par_div'>";
  565. echo "<div id='par-pali-b$book-$iPar' class='par_pali_div'>";
  566. echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
  567. foreach ($FetchSent as $key => $value) {
  568. $sent_text = str_replace("{","<b>",$value["text"]) ;
  569. $sent_text = str_replace("}","</b>",$sent_text) ;
  570. echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$sent_text}</sent>";
  571. }
  572. echo "</div>";
  573. echo "<div id='par-wbwdiv-b$book-$iPar' class='par_translate_div'>";
  574. echo "</div>";
  575. echo "<div id='par-translate-b$book-$iPar' class='par_translate_div'>";
  576. echo "</div>";
  577. echo "<div id='par-note-b$book-$iPar' class='par_translate_div'>";
  578. echo "</div>";
  579. echo "</div>";
  580. }
  581. }
  582. $strSimSent = "";
  583. if($_GET["view"]=="sent"){
  584. $query = "select sim_sents from 'pali_sent' where book='$book' and paragraph='$paragraph' and begin='{$_GET["begin"]}' and end ='{$_GET["end"]}'";
  585. $FetchSent = PDO_FetchOne($query);
  586. if(!empty($FetchSent)){
  587. $sim_sents = str_replace(",","','",$FetchSent);
  588. $sim_sents = "'".$sim_sents."'";
  589. $query = "SELECT book, paragraph,begin, end, text from 'pali_sent' where id IN ( {$sim_sents} ) ";
  590. $FetchSim = PDO_FetchAll($query);
  591. foreach ($FetchSim as $key => $value) {
  592. $strSimSent .= "<div>". $value["text"]."</div>";
  593. $strSimSent .= "<div><a href='../pcdl/reader.php?view=para&book={$value["book"]}&para={$value["paragraph"]}'>"._get_para_path($value["book"],$value["paragraph"])."</a></div><br/>";
  594. }
  595. }
  596. }
  597. if(isset($_GET["sent_mode"])){
  598. }
  599. //查询编辑者数量
  600. //查询句子译文内容
  601. PDO_Connect("sqlite:"._FILE_DB_SENTENCE_);
  602. $dbh = new PDO("sqlite:"._FILE_DB_PALI_SENTENCE_, "", "");
  603. $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  604. //查询channal数量
  605. switch ($_view) {
  606. case 'chapter':
  607. $query = "SELECT channal from 'sentence' where book= ? and (paragraph between ? and ? ) group by channal";
  608. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$par_end));
  609. break;
  610. case 'para':
  611. # code...
  612. $query = "SELECT channal from 'sentence' where book= ? and paragraph = ? group by channal";
  613. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin));
  614. break;
  615. case 'sent':
  616. # code...
  617. $query = "SELECT channal from 'sentence' where book= ? and paragraph = ? AND begin = ? AND end = ? group by channal";
  618. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$_GET["begin"],$_GET["end"]));
  619. break;
  620. }
  621. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  622. if($_view=="sent"){
  623. $FetchPaliSent = array(array("begin" => $_GET["begin"] , "end" => $_GET["end"]));
  624. }
  625. else{
  626. $query = "select begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  627. $stmt = $dbh->query($query);
  628. $FetchPaliSent = $stmt->fetchAll(PDO::FETCH_ASSOC);
  629. }
  630. foreach ($FetchPaliSent as $key => $value) {
  631. $begin = $value["begin"];
  632. $end = $value["end"];
  633. if(isset($_GET["channal"])){
  634. $query_channal = " AND channal=".$PDO->quote($_GET["channal"]);
  635. }
  636. if($_view=="sent"){
  637. if(isset($_GET["sent"])){
  638. $query="SELECT * FROM \"sentence\" WHERE id = ".$PDO->quote($_GET["sent"]);
  639. }
  640. else{
  641. $query="SELECT * FROM \"sentence\" WHERE (book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen <> 0 ) {$query_channal} order by modify_time DESC";
  642. }
  643. }
  644. else{
  645. $query = "SELECT * FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen <> 0 {$query_channal} order by modify_time DESC limit 0, 1";
  646. }
  647. $query_count = "SELECT count(book) FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen > 0 {$query_channal} ";
  648. $sent_count = PDO_FetchOne($query_count);
  649. if($sent_count>9){
  650. $sent_count = "9+";
  651. }
  652. $FetchText = PDO_FetchAll($query);
  653. $iFetchText=count($FetchText);
  654. if($iFetchText>0){
  655. if(isset($_GET["sent"])){
  656. $query="SELECT * FROM \"sentence\" WHERE parent = ".$PDO->quote($_GET["sent"]);
  657. $FetchChildren = PDO_FetchAll($query);
  658. $FetchText = array_merge ($FetchText,$FetchChildren);
  659. }
  660. $iFetchText=count($FetchText);
  661. for($i=0;$i<$iFetchText;$i++){
  662. $currParNo=$iPar;
  663. if($_display=="sent"){
  664. $sent_style = "display:block";
  665. }
  666. else{
  667. $sent_style = "";
  668. }
  669. if(!empty($FetchText[$i]["parent"])){
  670. $reply_style = " sent_reply ";
  671. }
  672. else{
  673. $reply_style = "";
  674. }
  675. $tran_text = str_replace("[[","<term status='0'>",$FetchText[$i]["text"]);
  676. $tran_text = str_replace("]]","</term>",$tran_text);
  677. echo "<sent_trans style='{$sent_style}{$reply_style}' id='sent-tran-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}-{$i}' class='sent_trans ' book='$book' para='$currParNo' begin='{$FetchText[$i]["begin"]}'>";
  678. echo "<span class='sent_text' ";
  679. echo " sent_id='".$FetchText[$i]["id"]."'";
  680. echo " editor='".$FetchText[$i]["editor"]."'";
  681. echo " book='".$FetchText[$i]["book"]."'";
  682. echo " para='".$FetchText[$i]["paragraph"]."'";
  683. echo " begin='".$FetchText[$i]["begin"]."'";
  684. echo " end='".$FetchText[$i]["end"]."'";
  685. echo " lang='".$FetchText[$i]["language"]."'";
  686. echo " channal='".$FetchText[$i]["channal"]."'";
  687. echo " tag='".$FetchText[$i]["tag"]."'";
  688. echo " author='".$FetchText[$i]["author"]."'";
  689. echo " text='".$FetchText[$i]["text"]."'";
  690. echo ">";
  691. echo $tran_text;
  692. echo "</span>";
  693. if($_view!="sent" && $_display=="sent"){
  694. if(isset($_GET["channal"])){
  695. echo "<svg class='edit_icon';'><use xlink:href='../studio/svg/icon.svg#ic_mode_edit'></use></svg>";
  696. }
  697. else{
  698. echo "<span class='sent_count'>$sent_count</span>";
  699. }
  700. }
  701. echo "</sent_trans>";
  702. echo "<script>";
  703. if($_display=="sent"){
  704. echo "document.getElementById('sent-translate-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}').appendChild(document.getElementById('sent-tran-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}-{$i}'));";
  705. }
  706. else{
  707. echo "document.getElementById('par-translate-b{$book}-{$currParNo}').appendChild(document.getElementById('sent-tran-b{$book}-{$currParNo}-{$FetchText[$i]["begin"]}-{$i}'));";
  708. }
  709. echo "</script>";
  710. }
  711. }
  712. }
  713. }
  714. //查询句子译文内容结束
  715. echo "<div id='para_nav'><a name='nav_foot'></a>";
  716. echo "<div style='display:inline-flex;'>";
  717. echo "<svg t='1598094361320' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4933' width='32' height='32'><path d='M698.75712 684.4416a81.92 81.92 0 0 1-124.88704 106.06592l-191.488-225.4848a81.89952 81.89952 0 0 1 0-106.06592l191.488-225.4848a81.92 81.92 0 0 1 124.88704 106.06592l-146.45248 172.46208 146.45248 172.4416z' p-id='4934' fill='#757AF7'></path></svg>";
  718. echo "$prev_para_link</div>";
  719. echo "<div style='display:inline-flex;'>$next_para_link";
  720. echo "<svg t='1598094021808' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32' height='32'><path d='M698.75712 565.02272l-191.488 225.4848a81.73568 81.73568 0 0 1-62.48448 28.89728 81.89952 81.89952 0 0 1-62.40256-134.94272l146.432-172.4416-146.432-172.4416a81.92 81.92 0 0 1 124.88704-106.06592l191.488 225.4848a81.87904 81.87904 0 0 1 0 106.02496z' p-id='4452' fill='#757AF7'></path></svg>";
  721. echo "</div>";
  722. echo "</div>";
  723. }
  724. ?>
  725. <div>
  726. <a name="sim_doc"></a>
  727. <div>相似句子</div>
  728. <?php echo $strSimSent; ?>
  729. <div>相关段落</div>
  730. <ul>
  731. <?php
  732. //查找相关标题
  733. if(strtolower(mb_substr($par_title,mb_strlen($par_title,"UTF-8")-7,null,"UTF-8"))=="vaṇṇanā"){
  734. $searchToc = strtolower(mb_substr($par_title,0,-7,"UTF-8"));
  735. }
  736. else{
  737. $searchToc = strtolower(mb_substr($par_title,0,-1,"UTF-8"));
  738. }
  739. PDO_Connect("sqlite:"._FILE_DB_RESRES_INDEX_);
  740. $query = "select book, paragraph,title from 'index' where \"title\" like ".$PDO->quote($searchToc.'%')." limit 0,50";
  741. $Fetch = PDO_FetchAll($query);
  742. foreach ($Fetch as $key => $value) {
  743. echo "<div style='margin-bottom: 0.5em;'>";
  744. echo "<div><a href='reader.php?view=chapter&book={$value["book"]}&para={$value["paragraph"]}' target='_blank'> {$value["title"]} </a></div>";
  745. echo "<div>". _get_para_path($value["book"],$value["paragraph"])."</div>";
  746. echo "</div>";
  747. }
  748. ?>
  749. </ul>
  750. </div>
  751. </div><!--main_text_view end-->
  752. <div id="new_comm_shell" style="display:none;">
  753. <div id="new_comm_div">
  754. <textarea id="new_comm_text"></textarea>
  755. <button onclick="new_comm_submit()">提交</button><button onclick="new_comm_cancel()">取消</button>
  756. </div>
  757. </div>
  758. <div id="dighest_edit_div" class="full_screen_window">
  759. <div class="win_caption">
  760. <div><button onclick="dighest_edit_cancle()">取消</button></div>
  761. <div><button onclick="dighest_edit_submit()">提交</button></div>
  762. </div>
  763. <div id="dighest_edit_body" class="win_body">
  764. <div>
  765. 标题:<input id="dighest_edit_title" />
  766. </div>
  767. <div>
  768. 简介:<textarea id="dighest_edit_summary"></textarea>
  769. </div>
  770. <div>
  771. 标签:<input id="dighest_edit_taget" />
  772. </div>
  773. <div id="dighest_text_preview">
  774. </div>
  775. </div>
  776. </div>
  777. <div id="right_panal_toc" style="position: fixed;top:3em;width:17em;left: calc(100% - 17em);height:auto; min-height:30em;border-left: 1px solid gray; font-size: 80%;padding: 2em 0.5em;">
  778. <?php
  779. if($currLevel>=$tocMinLevel){
  780. echo $htmlToc2;
  781. }
  782. echo "<div>Channal</div>";
  783. $_channal = new Channal();
  784. $_userinfo = new UserInfo();
  785. echo "<div>";
  786. echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
  787. echo "&book=".$_GET["book"];
  788. echo "&para=".$_GET["para"];
  789. if(isset($_GET["begin"])){
  790. echo "&begin=".$_GET["begin"];
  791. }
  792. if(isset($_GET["end"])){
  793. echo "&end=".$_GET["end"];
  794. }
  795. echo "' >";
  796. echo "全部";
  797. echo "</a>";
  798. echo "</div>";
  799. foreach ($FetchChannal as $key => $value) {
  800. # code...
  801. echo "<div>";
  802. echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
  803. echo "&book=".$_GET["book"];
  804. echo "&para=".$_GET["para"];
  805. if(isset($_GET["begin"])){
  806. echo "&begin=".$_GET["begin"];
  807. }
  808. if(isset($_GET["end"])){
  809. echo "&end=".$_GET["end"];
  810. }
  811. echo "&channal=".$value["channal"]."' >";
  812. $channalInfo = $_channal->getChannal($value["channal"]);
  813. if($channalInfo){
  814. echo $_userinfo->getName($channalInfo["owner"]);
  815. echo '/'.$channalInfo["name"];
  816. }
  817. echo "</a>";
  818. echo "</div>";
  819. }
  820. ?>
  821. </div>
  822. </div>
  823. <!-- 全屏 黑色背景 -->
  824. <div id="BV" class="blackscreen" onclick="setNaviVisibility()"></div>
  825. <!-- nav begin-->
  826. <div id="leftmenuinner" class="viewswitch_off">
  827. <div class="win_caption">
  828. <div><button id="left_menu_hide" onclick="setNaviVisibility()">返回</button></div>
  829. <div id="menubartoolbar_New">
  830. <ul class="common-tab">
  831. <li id="content_menu_li" class="common-tab_li_act" onclick="menuSelected_2(menu_toc,'content_menu_li')">目录</li>
  832. <li id="palicanon_menu_li" class="common-tab_li" onclick="menuSelected_2(menu_pali_cannon,'palicanon_menu_li')">批注</li>
  833. <li id="bookmark_menu_li" class="common-tab_li" onclick="menuSelected_2(menu_bookmark,'bookmark_menu_li')">书签</li>
  834. </ul>
  835. </div>
  836. </div>
  837. <div class='toc' id='leftmenuinnerinner' style="font-family: 'Noto Serif';">
  838. <!-- toc begin -->
  839. <div class="menu" id="menu_toc">
  840. <a name="_Content" ></a>
  841. <div id="toc_content"><?php echo $tocHtml; ?></div>
  842. </div>
  843. <!-- toc end -->
  844. <!-- comments begin -->
  845. <div class="menu" id="menu_comments">
  846. <div id="navi_comments_inner"></div>
  847. </div>
  848. <!-- comments end -->
  849. <!-- book mark begin -->
  850. <div class="menu" id="menu_bookmark" style="display:none;">
  851. <div>
  852. <input id="B_Bookmark_All" onclick="setBookmarkVisibility('all')" type="checkbox" style="width: 20px; height: 20px" />
  853. <input id="B_Bookmark_A" onclick="setBookmarkVisibility('bma','B_Bookmark_A')" type="checkbox" style="width: 20px; height: 20px" /><span class="bookmarkcolora , bookmarkcolorblock" >a</span>
  854. <input id="B_Bookmark_X" onclick="setBookmarkVisibility('bmx','B_Bookmark_X')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolorx , bookmarkcolorblock" >?</span>
  855. <input id="B_Bookmark_1" onclick="setBookmarkVisibility('bm1','B_Bookmark_1')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor1 , bookmarkcolorblock" >1</span>
  856. <input id="B_Bookmark_2" onclick="setBookmarkVisibility('bm2','B_Bookmark_2')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor2 , bookmarkcolorblock" >2</span>
  857. <input id="B_Bookmark_3" onclick="setBookmarkVisibility('bm3','B_Bookmark_3')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor3 , bookmarkcolorblock" >3</span>
  858. <input id="B_Bookmark_4" onclick="setBookmarkVisibility('bm4','B_Bookmark_4')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor4 , bookmarkcolorblock" >4</span>
  859. <input id="B_Bookmark_5" onclick="setBookmarkVisibility('bm5','B_Bookmark_5')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor5 , bookmarkcolorblock" >5</span>
  860. <input id="B_Bookmark_0" onclick="setBookmarkVisibility('bm0','B_Bookmark_0')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor0 , bookmarkcolorblock" >0</span>
  861. </div>
  862. <div id="navi_bookmark_inner"></div>
  863. </div>
  864. <!-- book mark end -->
  865. </div>
  866. </div>
  867. <!-- nav end -->
  868. </div>
  869. <div id="mean_menu" ></div>
  870. <div id="sent_modify_win">
  871. <div>
  872. <textarea id="sent_modify_text" style="width:100%;">
  873. </textarea><br>
  874. <button onclick="trans_sent_save()">发送</button>
  875. </div>
  876. </div>
  877. <script>
  878. $(".pali").mouseover(function(e){
  879. var targ
  880. if (!e) var e = window.event;
  881. if (e.target) targ = e.target;
  882. else if (e.srcElement) targ = e.srcElement;
  883. if (targ.nodeType == 3) // defeat Safari bug
  884. targ = targ.parentNode;
  885. var pali_word;
  886. pali_word=targ.innerHTML;
  887. objCurrMouseOverPaliMean=targ.nextSibling;
  888. $("#tool_bar_title").html(pali_word);
  889. $("#mean_menu").html(getWordMeanMenu(pali_word));
  890. targ.parentNode.appendChild(document.getElementById("mean_menu"));
  891. });
  892. $("sent").click(function(e){
  893. let book = $(this).attr("book");
  894. let para = $(this).attr("para");
  895. let begin = $(this).attr("begin");
  896. let end = $(this).attr("end");
  897. window.location.assign("reader.php?view=sent&book="+book+"&para="+para+"&begin="+begin+"&end="+end);
  898. });
  899. $("sent").mouseenter(function(e){
  900. let book = $(this).attr("book");
  901. let para = $(this).attr("para");
  902. let begin = $(this).attr("begin");
  903. $(this).css("background-color","#fefec1");
  904. $("sent_trans[book='"+book+"'][para='"+para+"'][begin='"+begin+"']").css("background-color","#fefec1");
  905. });
  906. $("sent").mouseleave(function(e){
  907. let book = $(this).attr("book");
  908. let para = $(this).attr("para");
  909. let begin = $(this).attr("begin");
  910. $(this).css("background-color","unset");
  911. $("sent_trans[book='"+book+"'][para='"+para+"'][begin='"+begin+"']").css("background-color","unset");
  912. });
  913. $("para").mouseenter(function(e){
  914. let book = $(this).attr("book");
  915. let para = $(this).attr("para");
  916. $("sent[book='"+book+"'][para='"+para+"']").css("background-color","#fefec1");
  917. });
  918. $("para").mouseleave(function(e){
  919. let book = $(this).attr("book");
  920. let para = $(this).attr("para");
  921. $("sent[book='"+book+"'][para='"+para+"']").css("background-color","unset");
  922. });
  923. $("sent_trans").mouseenter(function(e){
  924. let book = $(this).attr("book");
  925. let para = $(this).attr("para");
  926. let begin = $(this).attr("begin");
  927. $(this).css("background-color","#fefec1");
  928. $("sent[book='"+book+"'][para='"+para+"'][begin='"+begin+"']").css("background-color","#fefec1");
  929. });
  930. $("sent_trans").mouseleave(function(e){
  931. let book = $(this).attr("book");
  932. let para = $(this).attr("para");
  933. let begin = $(this).attr("begin");
  934. $(this).css("background-color","unset");
  935. $("sent[book='"+book+"'][para='"+para+"'][begin='"+begin+"']").css("background-color","unset");
  936. });
  937. $(".sent_text").click(function(e){
  938. let book = $(this).attr("book");
  939. let para = $(this).attr("para");
  940. let begin = $(this).attr("begin");
  941. let end = $(this).attr("end");
  942. let id = $(this).attr("sent_id");
  943. window.location.assign("reader.php?view=sent&book="+book+"&para="+para+"&begin="+begin+"&end="+end+"&sent="+id);
  944. });
  945. $(".edit_icon").click(function(e){
  946. let objSent = $(this).parent().children(".sent_text").first();
  947. if(objSent){
  948. let text = objSent.attr("text");
  949. $("#sent_modify_text").val(text);
  950. $("#sent_modify_text").attr("sent_id",objSent.attr("sent_id"));
  951. $("#sent_modify_text").attr("editor",objSent.attr("editor"));
  952. $("#sent_modify_text").attr("book",objSent.attr("book"));
  953. $("#sent_modify_text").attr("para",objSent.attr("para"));
  954. $("#sent_modify_text").attr("begin",objSent.attr("begin"));
  955. $("#sent_modify_text").attr("end",objSent.attr("end"));
  956. $("#sent_modify_text").attr("lang",objSent.attr("lang"));
  957. $("#sent_modify_text").attr("tag",objSent.attr("tag"));
  958. $(this).parent().append($("#sent_modify_win"));
  959. }
  960. });
  961. $("para").click(function(e){
  962. let book = $(this).attr("book");
  963. let para = $(this).attr("para");
  964. window.location.assign("reader.php?view=para&book="+book+"&para="+para);
  965. });
  966. term_updata_translation();
  967. var wordlist = new Array();
  968. $("term").each(function(index,element){
  969. wordlist.push($(this).attr("pali"));
  970. }
  971. );
  972. function haha(){
  973. var wordquery ="('" + wordlist.join("','")+"')";
  974. $.post("../term/term.php",
  975. {
  976. op:"extract",
  977. words:wordquery
  978. },
  979. function(data,status){
  980. if(data.length>0){
  981. try{
  982. arrMyTerm = JSON.parse(data);
  983. term_updata_translation();
  984. }
  985. catch(e){
  986. console.error(e.error+" data:"+data);
  987. }
  988. }
  989. });
  990. }
  991. </script>
  992. </body>
  993. </html>