|
|
@@ -19,331 +19,16 @@ require_once '../public/load_lang.php';
|
|
|
<script src="../term/term.js"></script>
|
|
|
<script src="../term/note.js"></script>
|
|
|
|
|
|
- <script>
|
|
|
- var curr_tool="";
|
|
|
- var dighest_count=0;//书摘段落数量
|
|
|
- var res_list=new Array();
|
|
|
- var new_comments_album=-1;
|
|
|
- var new_comments_book=-1;
|
|
|
- var new_comments_paragraph=-1;
|
|
|
- function add_new_res(album,book,paragraph,text){
|
|
|
- var new_res=new Object();
|
|
|
- new_res.album=album;
|
|
|
- new_res.book=book;
|
|
|
- new_res.paragraph=paragraph;
|
|
|
- new_res.dighest=false;
|
|
|
- new_res.text=text;
|
|
|
- new_res.textchanged=false;
|
|
|
- res_list.push(new_res);
|
|
|
- }
|
|
|
- function tool_changed(tool_name){
|
|
|
- if(tool_name==curr_tool){
|
|
|
- return;
|
|
|
- }
|
|
|
- $("#main_tool_bar").fadeOut();
|
|
|
- curr_tool=tool_name;
|
|
|
- switch(tool_name){
|
|
|
- case "comments":
|
|
|
- $("#tool_bar_dighest").fadeOut();
|
|
|
- $("#tool_bar_comments").fadeIn();
|
|
|
- break;
|
|
|
- case "dighest":
|
|
|
- $("#tool_bar_comments").fadeOut();
|
|
|
- $("#tool_bar_dighest").fadeIn();
|
|
|
- break;
|
|
|
- case "fix":
|
|
|
- $("#tool_bar_comments").fadeOut();
|
|
|
- $("#tool_bar_fix").fadeIn();
|
|
|
- render_all_tran();
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- function paragraph_click(album,book,paragraph){
|
|
|
- switch(curr_tool){
|
|
|
- case "comments":
|
|
|
- new_comments(album,book,paragraph);
|
|
|
- break;
|
|
|
- case "dighest":
|
|
|
- dighest_par_click(album,book,paragraph);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- function new_comments(album,book,paragraph){
|
|
|
- new_comments_album=album;
|
|
|
- new_comments_book=book;
|
|
|
- new_comments_paragraph=paragraph;
|
|
|
- document.getElementById("new-comm-a"+album+"-b"+book+"-"+paragraph).appendChild(document.getElementById("new_comm_div"));
|
|
|
-
|
|
|
- }
|
|
|
- function new_comm_cancel(){
|
|
|
- $("#tool_bar_comments").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- document.getElementById("new_comm_text").value="";
|
|
|
- document.getElementById("new_comm_shell").appendChild(document.getElementById("new_comm_div"));
|
|
|
- curr_tool="";
|
|
|
- }
|
|
|
- function new_comm_submit(){
|
|
|
- $("#tool_bar_comments").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
- var comm_text=document.getElementById("new_comm_text").value;
|
|
|
- $.post("comments.php",
|
|
|
- {
|
|
|
- album:new_comments_album,
|
|
|
- book:new_comments_book,
|
|
|
- paragraph:new_comments_paragraph,
|
|
|
- text:comm_text
|
|
|
- },
|
|
|
- function(data,status){
|
|
|
- alert("Data: " + data + "\nStatus: " + status);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //书摘处理
|
|
|
- function dighest_par_click(album,book,paragraph){
|
|
|
- for (var x in res_list){
|
|
|
- if(
|
|
|
- res_list[x].album==album &&
|
|
|
- res_list[x].book==book &&
|
|
|
- res_list[x].paragraph==paragraph){
|
|
|
- if(res_list[x].dighest==false){
|
|
|
- res_list[x].dighest=true;
|
|
|
- res_list[x].text=document.getElementById("text-a"+album+"-b"+book+"-"+paragraph).innerHTML;
|
|
|
- $("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","yellow");
|
|
|
- dighest_count++;
|
|
|
- }
|
|
|
- else{
|
|
|
- res_list[x].dighest=false;
|
|
|
- $("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","white");
|
|
|
- dighest_count--;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $("#dighest_message").text="已经选择"+dighest_count+"段";
|
|
|
- }
|
|
|
-
|
|
|
- //将段落列表重置
|
|
|
- function dighest_reset_res_list(){
|
|
|
- for (var x in res_list){
|
|
|
- var album=res_list[x].album;
|
|
|
- var book=res_list[x].book;
|
|
|
- var paragraph=res_list[x].paragraph;
|
|
|
-
|
|
|
- if(res_list[x].dighest==false){
|
|
|
- dighest_count=0;
|
|
|
- }
|
|
|
- else{
|
|
|
- res_list[x].dighest=false;
|
|
|
- $("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","white");
|
|
|
- dighest_count=0;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function dighest_cancle(){
|
|
|
- $("#tool_bar_dighest").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
- //将段落列表重置
|
|
|
- dighest_reset_res_list();
|
|
|
- }
|
|
|
- function dighest_ok(){
|
|
|
- var output="";
|
|
|
- for (var x in res_list){
|
|
|
- if(res_list[x].dighest==true){
|
|
|
- output+="<p>"+res_list[x].text+"</p>";
|
|
|
- }
|
|
|
- }
|
|
|
- //书摘文字预览
|
|
|
- document.getElementById("dighest_text_preview").innerHTML=output;
|
|
|
- $("#tool_bar_dighest").fadeOut();
|
|
|
- $("#dighest_edit_div").fadeIn();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- function dighest_edit_cancle(){
|
|
|
- $("#dighest_edit_div").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
- //将段落列表重置
|
|
|
- dighest_reset_res_list();
|
|
|
- }
|
|
|
- function dighest_edit_submit(){
|
|
|
- $("#dighest_edit_div").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
-
|
|
|
- //计算书摘数量 生成书摘字符串
|
|
|
- if(res_list.length==0){
|
|
|
- return;
|
|
|
- }
|
|
|
- var output=new Array();
|
|
|
- for (var x in res_list){
|
|
|
- if(res_list[x].dighest==true){
|
|
|
- output.push(res_list[x].album+"-"+res_list[x].book+"-"+res_list[x].paragraph);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var dighest_text=output.join();
|
|
|
- var dighest_title=document.getElementById("dighest_edit_title").value;
|
|
|
- var dighest_summary=document.getElementById("dighest_edit_summary").value;
|
|
|
- var dighest_tag=document.getElementById("dighest_edit_taget").value;
|
|
|
- if(dighest_title==""){alert("标题不能为空");return;}
|
|
|
- if(dighest_summary==""){alert("简介不能为空");return;}
|
|
|
- if(dighest_tag==""){alert("标签不能为空");return;}
|
|
|
- $.post("dighest.php",
|
|
|
- {
|
|
|
- title:dighest_title,
|
|
|
- summary:dighest_summary,
|
|
|
- tag:dighest_tag,
|
|
|
- data:dighest_text
|
|
|
- },
|
|
|
- function(data,status){
|
|
|
- alert("Data: " + data + "\nStatus: " + status);
|
|
|
- });
|
|
|
- //将段落列表重置
|
|
|
- dighest_reset_res_list();
|
|
|
- }
|
|
|
-
|
|
|
- function setNaviVisibility(){
|
|
|
- var objNave = document.getElementById('leftmenuinner');
|
|
|
- var objblack = document.getElementById('BV');
|
|
|
- if ( objNave.className=='viewswitch_off'){
|
|
|
- objblack.style.display = "block";
|
|
|
- objNave.className = "viewswitch_on";
|
|
|
- }
|
|
|
- else{
|
|
|
- objblack.style.display = "none";
|
|
|
- objNave.className = "viewswitch_off";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function render_all_tran(mode="fix"){
|
|
|
- for (var x in res_list){
|
|
|
- var album=res_list[x].album;
|
|
|
- var book=res_list[x].book;
|
|
|
- var paragraph=res_list[x].paragraph;
|
|
|
- var text=res_list[x].text;
|
|
|
- if(mode=="fix"){
|
|
|
- var new_text=getSuperTranslateModifyString(x);
|
|
|
- }
|
|
|
- else{
|
|
|
- var new_text=text;
|
|
|
- }
|
|
|
- var obj=document.getElementById("text-a"+album+"-b"+book+"-"+paragraph);
|
|
|
- if(obj){
|
|
|
- obj.innerHTML=new_text;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- function getSuperTranslateModifyString(index){
|
|
|
- var newString = res_list[index].text.replace(/。/g,"。#");
|
|
|
- newString = newString.replace(/,/g,",#");
|
|
|
- newString = newString.replace(/!/g,"!#");
|
|
|
- newString = newString.replace(/?/g,"?#");
|
|
|
- newString = newString.replace(/”/g,"”#");
|
|
|
- newString = newString.replace(/“/g,"“#");
|
|
|
- newString = newString.replace(/’/g,"’#");
|
|
|
-
|
|
|
- arrString = newString.split("#");
|
|
|
-
|
|
|
- var output="";
|
|
|
- var str_pos=0;
|
|
|
- for (x in arrString){
|
|
|
- var str_len=arrString[x].length;
|
|
|
- str_pos+=str_len;
|
|
|
- output +=arrString[x]+"<span class=\"tooltip\">※<span class=\"tooltiptext tooltip-bottom\"><button onclick='text_move("+index+"," + str_pos + ",0)'>▲</button> <button onclick='text_move("+index+"," + str_pos + ",1)'>▼</button> </span> </span> ";
|
|
|
- }
|
|
|
- return output;
|
|
|
- }
|
|
|
-
|
|
|
- function text_move(index,str_pos,updown){
|
|
|
- if(updown==0 && index==0){
|
|
|
- return;
|
|
|
- }
|
|
|
- if(updown==1 && index==res_list.length-1){
|
|
|
- return;
|
|
|
- }
|
|
|
- if(updown==0){
|
|
|
- res_list[index-1].text+=res_list[index].text.substring(0,str_pos);
|
|
|
- res_list[index-1].textchanged=true;
|
|
|
- res_list[index].text=res_list[index].text.substring(str_pos);
|
|
|
- res_list[index].textchanged=true;
|
|
|
-
|
|
|
- }
|
|
|
- else{
|
|
|
- res_list[index+1].text=res_list[index].text.substring(str_pos)+res_list[index+1].text;
|
|
|
- res_list[index+1].textchanged=true;
|
|
|
- res_list[index].text=res_list[index].text.substring(0,str_pos);
|
|
|
- res_list[index].textchanged=true;
|
|
|
- }
|
|
|
- render_all_tran();
|
|
|
- }
|
|
|
-
|
|
|
- function fix_cancle(){
|
|
|
- $("#tool_bar_fix").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
- render_all_tran("");
|
|
|
- }
|
|
|
- function fix_ok(){
|
|
|
- $("#tool_bar_fix").fadeOut();
|
|
|
- $("#main_tool_bar").fadeIn();
|
|
|
- curr_tool="";
|
|
|
- render_all_tran("");
|
|
|
-
|
|
|
- //计算书摘数量 生成书摘字符串
|
|
|
- if(res_list.length==0){
|
|
|
- return;
|
|
|
- }
|
|
|
- var output=new Array();
|
|
|
- for (var x in res_list){
|
|
|
- if(res_list[x].textchanged==true){
|
|
|
- output.push(res_list[x].album+"@"+res_list[x].book+"@"+res_list[x].paragraph+"@"+res_list[x].text);
|
|
|
- res_list[x].textchanged=false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var fix_text=output.join("#");
|
|
|
- var fix_album=res_list[0].album;
|
|
|
- $.post("tran_text.php",
|
|
|
- {
|
|
|
- album:fix_album,
|
|
|
- data:fix_text
|
|
|
- },
|
|
|
- function(data,status){
|
|
|
- alert("Data: " + data + "\nStatus: " + status);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- function lookup(){
|
|
|
- var xPali=document.getElementsByClassName("pali");
|
|
|
- for (var x in xPali){
|
|
|
- var pali = xPali[x].innerHTML;
|
|
|
- var xMean=xPali[x].nextSibling;
|
|
|
- if(bh[pali]){
|
|
|
- var arrMean=bh[pali].split("$");
|
|
|
- if(arrMean.length>0){
|
|
|
- xMean.innerHTML=arrMean[0];
|
|
|
- }
|
|
|
- }
|
|
|
- else if(sys_r[pali]){
|
|
|
- var word_parent=sys_r[pali];
|
|
|
- if(bh[word_parent]){
|
|
|
- var arrMean=bh[word_parent].split("$");
|
|
|
- if(arrMean.length>0){
|
|
|
- xMean.innerHTML=arrMean[0];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- </script>
|
|
|
<body class="reader_body" >
|
|
|
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(function(){
|
|
|
+ $(".toc_1_title").click(function(){
|
|
|
+ $(".toc_2").hide();
|
|
|
+ $(this).siblings().slideDown("200");
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
|
|
|
<style>
|
|
|
#para_nav {
|
|
|
@@ -432,6 +117,45 @@ para:hover{
|
|
|
margin-left: 5px;
|
|
|
cursor:pointer;
|
|
|
}
|
|
|
+.toc_1{
|
|
|
+ padding: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.toc_1_title{
|
|
|
+ font-weight:700;
|
|
|
+}
|
|
|
+.toc_2{
|
|
|
+ font-weight:500;
|
|
|
+ padding-left:1em;
|
|
|
+ display:none;
|
|
|
+}
|
|
|
+.curr_chapter{
|
|
|
+ background-color:#e1e1e1;
|
|
|
+}
|
|
|
+.toc_curr_chapter2{
|
|
|
+ display:block;
|
|
|
+}
|
|
|
+.toc_title2 a{
|
|
|
+ color:black;
|
|
|
+ line-height:1.4em;
|
|
|
+ text-decoration: none;
|
|
|
+}
|
|
|
+.toc_title2 a:hover{
|
|
|
+ text-decoration: underline;
|
|
|
+}
|
|
|
+.curr_chapter_title2{
|
|
|
+ background-color:#F1CA23;
|
|
|
+}
|
|
|
+#leftmenuinner{
|
|
|
+ width: 17em;
|
|
|
+}
|
|
|
+#leftmenuinnerinner{
|
|
|
+ overflow-y: scroll;
|
|
|
+}
|
|
|
+.sent_toc{
|
|
|
+ font-weight:700;
|
|
|
+ font-size:120%;
|
|
|
+}
|
|
|
</style>
|
|
|
<!-- tool bar begin-->
|
|
|
<div id="main_tool_bar" class='reader_toolbar'>
|
|
|
@@ -570,9 +294,93 @@ else{
|
|
|
$_display = "para";
|
|
|
}
|
|
|
}
|
|
|
+ $tocList = array();
|
|
|
if($_view=="chapter" || $_view=="para" || $_view=="sent" ){
|
|
|
PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
|
|
|
+ //生成目录
|
|
|
+ $htmlToc2 = "";
|
|
|
+ //找到该位置对应的书
|
|
|
+ $query = "select paragraph,level,chapter_len,parent from 'pali_text' where book='$book' and paragraph='$paragraph'";
|
|
|
+ $FetchParInfo = PDO_FetchAll($query);
|
|
|
+ $deep = 0;
|
|
|
+ if(count($FetchParInfo)>0){
|
|
|
+ $para = $FetchParInfo[0]["paragraph"];
|
|
|
+ $level = $FetchParInfo[0]["level"];
|
|
|
+ $chapter_len = $FetchParInfo[0]["chapter_len"];
|
|
|
+ $parent = $FetchParInfo[0]["parent"];
|
|
|
+ $currParaBegin = $para;
|
|
|
+ $currParaEnd = $para + $chapter_len;
|
|
|
+ //循环查找父标题 得到整条路径
|
|
|
+ while($parent>-1){
|
|
|
+ $query = "select paragraph,level,parent,chapter_len from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$parent}' limit 0,1";
|
|
|
+ $FetParent = PDO_FetchAll($query);
|
|
|
+ if(count($FetParent)>0){
|
|
|
+ $para = $FetParent[0]["paragraph"];
|
|
|
+ $level = $FetParent[0]["level"];
|
|
|
+ $chapter_len = $FetParent[0]["chapter_len"];
|
|
|
+ $parent = $FetParent[0]["parent"];
|
|
|
+ }
|
|
|
+ $deep++;
|
|
|
+ if($deep>8){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $paraBegin = $para+1;
|
|
|
+ $paraEnd = $para+$chapter_len;
|
|
|
+
|
|
|
+ $query = "SELECT toc,paragraph,level,chapter_len,parent FROM 'pali_text' WHERE book='$book' AND (paragraph BETWEEN '$paraBegin' AND '$paraEnd') and level<100";
|
|
|
+ $chapter_toc = PDO_FetchAll($query);
|
|
|
+ $tocMaxLevel = 0;
|
|
|
+ $tocMinLevel = 0;
|
|
|
+ echo "<div><div>";
|
|
|
+ foreach ($chapter_toc as $key => $value) {
|
|
|
+ $classCurrToc="";
|
|
|
+ $classCurrToc2 = "";
|
|
|
+ $classCurrTocTitle2="";
|
|
|
+ if($paragraph>=$value["paragraph"] && $paragraph<$value["paragraph"]+$value["chapter_len"]){
|
|
|
+ $classCurrToc = " curr_chapter";
|
|
|
+ $classCurrToc2 = " toc_curr_chapter2";
|
|
|
+ $classCurrTocTitle2=" curr_chapter_title2";
|
|
|
+ }
|
|
|
+
|
|
|
+ if($tocMaxLevel==0){
|
|
|
+ $tocMaxLevel =$value["level"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if($tocMinLevel==0){
|
|
|
+ if($value["level"]>$tocMaxLevel){
|
|
|
+ $tocMinLevel = $value["level"];
|
|
|
+ $tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}¶={$value["paragraph"]}'>{$value["toc"]}</a></div>";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
|
|
|
+ $tocHtml .= "<div class='toc_1_title'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2'>";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ if($value["level"] == $tocMaxLevel){
|
|
|
+ $tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
|
|
|
+ $tocHtml .= "<div class='toc_1_title'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2' >";
|
|
|
+ }
|
|
|
+ else if($value["level"] == $tocMinLevel){
|
|
|
+ $tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}¶={$value["paragraph"]}'>{$value["toc"]}</a></div>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //右侧目录
|
|
|
+ if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
|
|
|
+ $tocList[$value["paragraph"]] = $value["level"];
|
|
|
+ $htmlToc2 .= "<div><a href='#para_{$value["paragraph"]}'>{$value["toc"]}</a></div>";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ echo " </div></div>";
|
|
|
+ }
|
|
|
+
|
|
|
//获取段落信息 如 父段落 下一个段落等
|
|
|
+
|
|
|
$query = "select * from 'pali_text' where book='$book' and paragraph='$paragraph'";
|
|
|
$FetchParInfo = PDO_FetchAll($query);
|
|
|
if(count($FetchParInfo)==0){
|
|
|
@@ -598,11 +406,6 @@ else{
|
|
|
$_parent_title = $FetchToc[0]["toc"];
|
|
|
}
|
|
|
}
|
|
|
- $query = "select paragraph,toc from 'pali_text' where book='$book' and parent='$paragraph' and level < '8'";
|
|
|
- $FetchParent = PDO_FetchAll($query);
|
|
|
- foreach ($FetchParent as $key => $value) {
|
|
|
- $tocHtml .= "<div><a href='reader.php?view=chapter&book={$book}¶={$value["paragraph"]}'>{$value["toc"]}</a></div>";
|
|
|
- }
|
|
|
|
|
|
//查询标题
|
|
|
if($_view=="chapter"){
|
|
|
@@ -659,7 +462,10 @@ else{
|
|
|
echo "</script>";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ if($currLevel<$tocMinLevel){
|
|
|
+ echo "请选择章节";
|
|
|
+ }
|
|
|
+ else{
|
|
|
//上一级
|
|
|
echo "<div>";
|
|
|
switch($_view){
|
|
|
@@ -678,7 +484,7 @@ else{
|
|
|
case 6:
|
|
|
break;
|
|
|
case "chapter":
|
|
|
- if($par_parent >= 0){
|
|
|
+ if($par_parent >= 0 && $currLevel>$tocMinLevel){
|
|
|
echo "<a href='reader.php?view={$_view}&book={$book}¶graph={$par_parent}'>";
|
|
|
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>";
|
|
|
echo "{$_parent_title}</a>";
|
|
|
@@ -700,6 +506,8 @@ else{
|
|
|
break;
|
|
|
}
|
|
|
echo "</div>";
|
|
|
+
|
|
|
+
|
|
|
//生成一个段落空壳 等会儿查询数据,按照不同数据类型填充进去
|
|
|
PDO_Connect("sqlite:"._FILE_DB_PALI_SENTENCE_);
|
|
|
|
|
|
@@ -712,15 +520,21 @@ else{
|
|
|
else{
|
|
|
$query = "select text, begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
|
|
|
}
|
|
|
-
|
|
|
+ if(isset($tocList[$iPar])){
|
|
|
+ $sentClass = " sent_toc";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $sentClass = "";
|
|
|
+ }
|
|
|
$FetchSent = PDO_FetchAll($query);
|
|
|
echo "<div id='par-b$book-$iPar' class='par_div'>";
|
|
|
- echo "<para book='$book' para='$iPar'>$iPar</para>";
|
|
|
+ echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
|
|
|
foreach ($FetchSent as $key => $value) {
|
|
|
echo "<div id='sent-pali-b$book-$iPar-{$value["begin"]}' class='par_pali_div'>";
|
|
|
$pali_sent = str_replace("{","<b>",$value["text"]);
|
|
|
$pali_sent = str_replace("}","</b>",$pali_sent);
|
|
|
- echo "<sent book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
|
|
|
+
|
|
|
+ echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
|
|
|
echo "</div>";
|
|
|
echo "<div id='sent-wbwdiv-b$book-$iPar-{$value["begin"]}' class='par_translate_div'>";
|
|
|
echo "</div>";
|
|
|
@@ -733,15 +547,21 @@ else{
|
|
|
else{
|
|
|
//段落显示
|
|
|
for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
|
|
|
+ if(isset($tocList[$iPar])){
|
|
|
+ $sentClass = " sent_toc";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $sentClass = "";
|
|
|
+ }
|
|
|
$query = "select text , begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
|
|
|
$FetchSent = PDO_FetchAll($query);
|
|
|
echo "<div id='par-b$book-$iPar' class='par_div'>";
|
|
|
echo "<div id='par-pali-b$book-$iPar' class='par_pali_div'>";
|
|
|
- echo "<para book='$book' para='$iPar'>$iPar</para>";
|
|
|
+ echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
|
|
|
foreach ($FetchSent as $key => $value) {
|
|
|
$sent_text = str_replace("{","<b>",$value["text"]) ;
|
|
|
$sent_text = str_replace("}","</b>",$sent_text) ;
|
|
|
- echo "<sent book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$sent_text}</sent>";
|
|
|
+ echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$sent_text}</sent>";
|
|
|
}
|
|
|
echo "</div>";
|
|
|
echo "<div id='par-wbwdiv-b$book-$iPar' class='par_translate_div'>";
|
|
|
@@ -830,175 +650,16 @@ else{
|
|
|
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>";
|
|
|
echo "</div>";
|
|
|
echo "</div>";
|
|
|
-
|
|
|
- if(isset($album)){
|
|
|
-
|
|
|
- /*
|
|
|
- //自动逐词译
|
|
|
- $db_file = "../appdata/palicanon/templet/p".$book."_tpl.db3";
|
|
|
- PDO_Connect("sqlite:$db_file");
|
|
|
- for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
|
|
|
- $query="SELECT * FROM \"main\" WHERE (\"paragraph\" = ".$PDO->quote($iPar)." ) ";
|
|
|
- $Fetch = PDO_FetchAll($query);
|
|
|
- $iFetch=count($Fetch);
|
|
|
- if($iFetch>0){
|
|
|
- echo "<div id='par-wbw-b$book-$iPar' class='wbw_par'>";
|
|
|
- for($i=0;$i<$iFetch;$i++){
|
|
|
- $type=$Fetch[$i]["type"];
|
|
|
- if($type!=".ctl."){
|
|
|
- echo "<div class='word'>";
|
|
|
- echo "<div class='pali'>".$Fetch[$i]["word"]."</div>";
|
|
|
- echo "<div class='mean'>".$Fetch[$i]["mean"]."</div>";
|
|
|
- echo "</div>";
|
|
|
- }
|
|
|
- }
|
|
|
- echo "</div>";
|
|
|
- echo "<script>";
|
|
|
- echo "document.getElementById('par-wbwdiv-b$book-$iPar').appendChild(document.getElementById('par-wbw-b$book-$iPar'));";
|
|
|
- echo "</script>";
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- ////自动逐词译结束
|
|
|
- */
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- PDO_Connect("sqlite:"._FILE_DB_RESRES_INDEX_);
|
|
|
- $query = "select * from 'album' where id='$album'";
|
|
|
- $Fetch = PDO_FetchAll($query);
|
|
|
- $iFetch=count($Fetch);
|
|
|
- if($iFetch>0){
|
|
|
- switch($Fetch[0]["type"]){
|
|
|
- case 1://巴利原文
|
|
|
- break;
|
|
|
- case 2://逐词译
|
|
|
- $db_file =_DIR_PALICANON_WBW_."/p{$book}_wbw.db3";
|
|
|
- PDO_Connect("sqlite:$db_file");
|
|
|
- for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
|
|
|
- $table="p{$book}_wbw_data";
|
|
|
- $query="SELECT * FROM \"{$table}\" WHERE (\"paragraph\" = ".$PDO->quote($iPar)." ) and album_id={$album} ";
|
|
|
- $Fetch = PDO_FetchAll($query);
|
|
|
- $iFetch=count($Fetch);
|
|
|
- if($iFetch>0){
|
|
|
- echo "<div id='par-wbw-b$book-$iPar' class='wbw_par'>";
|
|
|
- for($i=0;$i<$iFetch;$i++){
|
|
|
- $wordtype=$Fetch[$i]["type"];
|
|
|
- if($wordtype!=".ctl."){
|
|
|
- echo "<div class='word'>";
|
|
|
- echo "<div class='pali'>{$Fetch[$i]["word"]}</div>";
|
|
|
- echo "<div class='mean'>{$Fetch[$i]["mean"]}</div>";
|
|
|
- echo "<div class='case'>{$wordtype}#{$Fetch[$i]["gramma"]}</div>";
|
|
|
- echo "</div>";
|
|
|
- }
|
|
|
- }
|
|
|
- echo "</div>";
|
|
|
- echo "<script>";
|
|
|
- echo "document.getElementById('par-wbwdiv-b$book-$iPar').appendChild(document.getElementById('par-wbw-b$book-$iPar'));";
|
|
|
- echo "</script>";
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- //译文
|
|
|
- $tocHtml="";
|
|
|
- //打开翻译数据文件
|
|
|
- $db_file =_DIR_PALICANON_TRAN_."/p{$book}_translate.db3";
|
|
|
- PDO_Connect("sqlite:{$db_file}");
|
|
|
- $this_album_id=$album;
|
|
|
- $table="p{$book}_translate_info";
|
|
|
- if($par_begin==-1){
|
|
|
- //全文
|
|
|
- $query="SELECT * FROM '{$table}' WHERE album_id=$this_album_id ";
|
|
|
- }
|
|
|
- else{
|
|
|
- //部分段落
|
|
|
- $query="SELECT * FROM '{$table}' WHERE (\"paragraph\" BETWEEN ".$PDO->quote($par_begin)." AND ".$PDO->quote($par_end).") and album_id=$this_album_id ";
|
|
|
- }
|
|
|
-
|
|
|
- //查询翻译经文内容
|
|
|
- $FetchText = PDO_FetchAll($query);
|
|
|
- $iFetchText=count($FetchText);
|
|
|
- if($iFetchText>0){
|
|
|
- for($i=0;$i<$iFetchText;$i++){
|
|
|
- $currParNo=$FetchText[$i]["paragraph"];
|
|
|
- //查另一个表,获取段落文本。一句一条记录。有些是一段一条记录
|
|
|
- $table_data="p{$book}_translate_data";
|
|
|
- $query="SELECT * FROM '{$table_data}' WHERE info_id={$FetchText[$i]["id"]}";
|
|
|
- $aParaText = PDO_FetchAll($query);
|
|
|
- $par_text="";
|
|
|
- foreach($aParaText as $sent){
|
|
|
- $par_text.=$sent["text"];
|
|
|
- }
|
|
|
- //获取段落文本结束。
|
|
|
- $par_text=str_replace("<pb></pb>","<br/><pb></pb>",$par_text);
|
|
|
- echo "<div id='par-translate-a$album-b$book-$currParNo' class='translate_text'>";
|
|
|
- echo "<a name='par_$currParNo'></a>";
|
|
|
- echo "<div id='text-a$album-b$book-$currParNo' class='text_level_".$par_level["$currParNo"]."' onclick='paragraph_click($album,$book,$currParNo)'>".$par_text."</div>";
|
|
|
- echo "<div id='comm-a$album-b$book-$currParNo' class='comments'>";
|
|
|
- echo "<div id='new-comm-a$album-b$book-$currParNo' class='new_comments'></div>";
|
|
|
- echo "</div>";
|
|
|
- echo "</div>";
|
|
|
- echo "<script>";
|
|
|
- echo "add_new_res($album,$book,$currParNo,'$par_text');";
|
|
|
- echo "document.getElementById('par-translate-b$book-$currParNo').appendChild(document.getElementById('par-translate-a$album-b$book-$currParNo'));";
|
|
|
- echo "</script>";
|
|
|
- //目录字符串
|
|
|
- $tocLevel=$par_level["$currParNo"]+1-1;
|
|
|
- if($tocLevel>0 && $tocLevel<8){
|
|
|
- $tocHtml.="<div class='toc_item level_$tocLevel'><a href='#par_$currParNo'>{$par_text}</a></div>";
|
|
|
- }
|
|
|
- }
|
|
|
- //设置标题栏的经文名称
|
|
|
- echo "<script>";
|
|
|
- echo "document.getElementById('tool_bar_title').innerHTML='".$FetchText[0]["title"]."'";
|
|
|
- echo "</script>";
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- break;
|
|
|
- case 7:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //添加注解
|
|
|
- PDO_Connect("sqlite:"._FILE_DB_COMMENTS_);
|
|
|
-
|
|
|
- if($par_begin==-1){
|
|
|
- $query="SELECT * FROM \"comments\" WHERE album='$album' order by id DESC";
|
|
|
- }
|
|
|
- else{
|
|
|
- $query="SELECT * FROM \"comments\" WHERE album='$album' AND (\"paragraph\" BETWEEN ".$PDO->quote($par_begin)." AND ".$PDO->quote($par_end).") order by id DESC ";
|
|
|
- }
|
|
|
- //查询注解内容
|
|
|
- $FetchText = PDO_FetchAll($query);
|
|
|
- $iFetchText=count($FetchText);
|
|
|
- if($iFetchText>0){
|
|
|
- for($i=0;$i<$iFetchText;$i++){
|
|
|
- $currParNo=$FetchText[$i]["paragraph"];
|
|
|
- $comm_id=$FetchText[$i]["id"];
|
|
|
-
|
|
|
- echo "<div id='comm-id-".$comm_id."' class='comments_text_div'><div class='comments_text'>".$FetchText[$i]["text"]."</div><div><button>赞</button>".$FetchText[$i]["reputable"]."</div></div>";
|
|
|
- echo "<script>";
|
|
|
- echo "document.getElementById('comm-a$album-b$book-$currParNo').appendChild(document.getElementById('comm-id-".$comm_id."'));";
|
|
|
- echo "</script>";
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
|
|
|
- if($par_next!=-1){
|
|
|
- echo "<a href='reader.php?book=$book&album=$album¶graph=$par_next'>Next</a>";
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
?>
|
|
|
|
|
|
</div><!--main_text_view end-->
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<div id="new_comm_shell" style="display:none;">
|
|
|
<div id="new_comm_div">
|
|
|
@@ -1026,11 +687,21 @@ else{
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <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;">
|
|
|
+ <?php
|
|
|
+ if($currLevel>=$tocMinLevel){
|
|
|
+ echo $htmlToc2;
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
<!-- 全屏 黑色背景 -->
|
|
|
<div id="BV" class="blackscreen" onclick="setNaviVisibility()"></div>
|
|
|
<!-- nav begin-->
|
|
|
|
|
|
- <div id="leftmenuinner" class="viewswitch_off">
|
|
|
+ <div id="leftmenuinner" class="viewswitch_off">
|
|
|
<div class="win_caption">
|
|
|
<div><button id="left_menu_hide" onclick="setNaviVisibility()">返回</button></div>
|
|
|
<div id="menubartoolbar_New">
|
|
|
@@ -1042,8 +713,7 @@ else{
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
- <div class='toc' id='leftmenuinnerinner'>
|
|
|
+ <div class='toc' id='leftmenuinnerinner'>
|
|
|
<!-- toc begin -->
|
|
|
<div class="menu" id="menu_toc">
|
|
|
<a name="_Content" ></a>
|
|
|
@@ -1085,10 +755,10 @@ else{
|
|
|
|
|
|
</div>
|
|
|
<!-- nav end -->
|
|
|
+ </div>
|
|
|
|
|
|
-
|
|
|
- <div id="mean_menu" ></div>
|
|
|
- <script>
|
|
|
+ <div id="mean_menu" ></div>
|
|
|
+<script>
|
|
|
//lookup();
|
|
|
$(".pali").mouseover(function(e){
|
|
|
var targ
|
|
|
@@ -1188,7 +858,7 @@ else{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- </script>
|
|
|
+</script>
|
|
|
|
|
|
</body>
|
|
|
</html>
|