Просмотр исходного кода

Merge pull request #271 from visuddhinanda/master

缅文convert
visuddhinanda 5 лет назад
Родитель
Сommit
76b3f4bf41

+ 4 - 0
app/dict/index.php

@@ -214,6 +214,10 @@ require_once "../pcdl/html_head.php";
 			-moz-justify-content: center;
 			justify-content: center;
 		}
+
+		.dict_find_gramma guide{
+			color:unset;
+		}
 	</style>
 	<link type="text/css" rel="stylesheet" href="./css/style.css" >
 	<link type="text/css" rel="stylesheet" href="./css/style_mobile.css" media="screen and (max-width:800px)">

+ 42 - 41
app/install/db_collact_para_bookid.php

@@ -1,30 +1,21 @@
 <?php
-require_once "install_head.php";
-?>
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-<h2>提取para?_??的内容</h2>
-<p><a href="index.php">Home</a></p>
-<?php
-
-$thisFileName=basename(__FILE__);
-
-if(isset($_GET["from"])==false){
-?>
-<form action="<?php echo $thisFileName;?>" method="get">
-From: <input type="text" name="from"><br>
-To: <input type="text" name="to"><br>
-<input type="submit">
-</form>
-<?php
-return;
+# 用拆分好的三藏数据 导出cs6段落编号
+require_once '../public/_pdo.php';
+require_once '../path.php';
+if ($argc < 3){
+	echo "无效的参数 ";
+	exit;
+}
+$from = (int)$argv[1];
+$to =(int)$argv[2];
+if($from<1){
+	$from = 1;
 }
+if($to>217){
+	$to = 217;
+}
+
 
-$from=$_GET["from"];
-$to=$_GET["to"];
 $filelist=array();
 $fileNums=0;
 $log="";
@@ -37,13 +28,12 @@ if(($handle=fopen("filelist.csv",'r'))!==FALSE){
 		$fileNums++;
 	}
 }
-if($to==0 || $to>=$fileNums) $to=$fileNums-1;
 
-$outputFile = fopen("xml/book_link.csv", "a") or die("Unable to open file!");
+$outputFile = fopen(_DIR_PALI_CSV_."/book_cs6_para.csv", "w") or die("Unable to open file!");
 $aBook = array();
 
-for($iFile=$from;$iFile<$to;$iFile++){
-	echo "<h2>$iFile</h2>";
+for($iFile=$from-1;$iFile<=$to-1;$iFile++){
+	echo "doing $iFile ";
 	$FileName=$filelist[$iFile][1].".htm";
 	$fileId=$filelist[$iFile][0];
 
@@ -53,14 +43,13 @@ for($iFile=$from;$iFile<$to;$iFile++){
 	$vriParNum=0;
 	$wordOrder=1;
 
-	$dirXmlBase="xml/";
+	$dirXmlBase=_DIR_PALI_CSV_."/";
 	$dirXml=$outputFileNameHead."/";
 
 	$currParNum="";
 
 	$xmlfile = $inputFileName;
-	echo "doing:".$xmlfile."<br>";
-	$log=$log."$from,$FileName,open\r\n";
+	# $log=$log."$from,$FileName,open\r\n";
 
 
 	// 打开文件并读取数据
@@ -71,19 +60,35 @@ for($iFile=$from;$iFile<$to;$iFile++){
 	if(($fp=fopen($dirXmlBase.$dirXml.$outputFileNameHead.".csv", "r"))!==FALSE){
 		while(($data=fgetcsv($fp,0,','))!==FALSE){
 			if($data[7]==".a."){
-				if(substr($data[4],0,4)=="para"){
+				if(stripos($data[4],"para")!==false){
 					if($bookid=stristr($data[4],"_")){
 						$bookid=substr($bookid,1);
-						$aBook["{$bookid}"]=1;
+						$paraString = stristr($data[4],"_",true);
+						$paraBegin = stripos($paraString,"para")+4;
+						$paraNum = explode("-",substr($paraString,$paraBegin));
+						$count++;
+						$output = array();
+						$output[] = substr($data[2],1);
+						$output[] = $data[3];
+						$output[] = $bookid;
+
+						foreach ($paraNum as $key => $value) {
+							# code...
+							$output[] = $value;
+						}
+						if(count($paraNum)==1){
+							$output[] = $paraNum[0];
+						}
+						fputcsv($outputFile,$output);
 					}
 				}
-			}			
+			}
 		}
 		fclose($fp);
-		echo "单词表load:".$dirXmlBase.$dirXml.$outputFileNameHead.".csv<br>";
+		echo "$count \n";
 	}
 	else{
-		echo "can not open csv file. filename=".$dirXmlBase.$dirXml.$outputFileNameHead.".csv";
+		echo "can not open csv file. filename=".$dirXmlBase.$dirXml.$outputFileNameHead.".csv \n";
 	}
 }
 
@@ -94,12 +99,8 @@ for($iFile=$from;$iFile<$to;$iFile++){
 	*/
 	fclose($outputFile);
 	
-	echo "count:".count($aBook)."<br>";
-	foreach($aBook as $x=>$value){
-		echo "{$x}<br>";
-	}
 
-	echo "<h2>齐活!功德无量!all done!</h2>";
+	echo "齐活!功德无量!all done! \n";
 
 ?>
 </body>

+ 173 - 0
app/install/page_index.php

@@ -0,0 +1,173 @@
+<?php 
+/*
+用拆分好的三藏数据 导出cs6段落编号
+*/
+
+?>
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<h2>Export Paragraph No.</h2>
+<p>用拆分好的三藏数据 导出cs6段落编号</p>
+<?php
+require_once '../public/_pdo.php';
+require_once '../path.php';
+if(isset($_GET["run"])==false){
+?>
+<form action="db_insert_templet.php" method="get">
+From: <input type="text" value="0" name="from"><br>
+To: <input type="text" value="216" name="to"><br>
+<input type="submit">
+</form>
+<?php
+return;
+}
+
+$from=0;
+$to=216;
+$filelist=array();
+$fileNums=0;
+$log="";
+echo "<h2>$from</h2>";
+
+if(($handle=fopen("filelist.csv",'r'))!==FALSE){
+	while(($filelist[$fileNums]=fgetcsv($handle,0,','))!==FALSE){
+		$fileNums++;
+	}
+}
+if($to==0 || $to>=$fileNums) $to=$fileNums-1;
+
+$FileName=$filelist[$from][1].".htm";
+$fileId=$filelist[$from][0];
+$fileId=$filelist[$from][0];
+
+$dirLog=_DIR_LOG_;
+
+$dirDb=_DIR_PALICANON_TEMPLET_;
+$inputFileName=$FileName;
+$outputFileNameHead=$filelist[$from][1];
+$bookId=$filelist[$from][2];
+$vriParNum=0;
+$wordOrder=1;
+
+$dirXmlBase=_DIR_PALI_CSV_."/";
+$dirXml=$outputFileNameHead."/";
+
+$currChapter="";
+$currParNum="";
+$arrAllWords[0]=array("id","wid","book","paragraph","word","real","type","gramma","mean","note","part","partmean","bmc","bmt","un","style","vri","sya","si","ka","pi","pa","kam");
+$g_wordCounter=0;
+
+$arrUnWords[0]=array("id","word","type","gramma","parent","mean","note","part","partmean","cf","state","delete","tag","len");
+$g_unWordCounter=0;
+
+$arrUnPart[0]="word";
+$g_unPartCounter=-1;
+
+/*去掉标点符号的统计*/
+$arrAllPaliWordsCount=array();
+$g_paliWordCounter=0;
+$g_wordCounterInSutta=0;
+$g_paliWordCountCounter=0;
+
+
+$xmlfile = $inputFileName;
+echo "doing:".$xmlfile."<br>";
+$log=$log."$from,$FileName,open\r\n";
+
+$arrInserString=array();
+$db_file = $dirDb."/".$bookId.'_tpl.db3';
+PDO_Connect("sqlite:$db_file");
+
+PDO_Execute("DROP TABLE IF EXISTS main;");
+$query="CREATE TABLE 'main' ( 'id' TEXT PRIMARY KEY NOT NULL, 
+							'book' INTEGER, 
+							'paragraph' INTEGER, 
+							'wid' INTEGER, 
+							'word' TEXT, 
+							'real' TEXT, 
+							'type' TEXT, 
+							'gramma' TEXT, 
+							'part' TEXT, 
+							'style' TEXT)";
+    $stmt = @PDO_Execute($query);
+    if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
+        $error = PDO_ErrorInfo();
+        print_r($error[2]);
+
+	}
+	PDO_Execute("DROP INDEX IF EXISTS search;");
+	
+$query="CREATE INDEX 'search' ON \"main\" (\"book\", \"paragraph\", \"wid\" ASC)";
+    $stmt = @PDO_Execute($query);
+    if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
+        $error = PDO_ErrorInfo();
+        print_r($error[2]);
+        $log=$log."$from, $FileName, error, $error[2] \r\n";
+    }
+
+// 打开文件并读取数据
+if(($fp=fopen($dirXmlBase.$dirXml.$outputFileNameHead.".csv", "r"))!==FALSE){
+	while(($data=fgetcsv($fp,0,','))!==FALSE){
+		//id,wid,book,paragraph,word,real,type,gramma,mean,note,part,partmean,bmc,bmt,un,style,vri,sya,si,ka,pi,pa,kam
+		
+		$params=array($data[0],
+					 mb_substr($data[2],1),
+					 $data[3],
+					 $data[16],
+					 $data[4],
+					 $data[5],
+					 $data[6],
+					 $data[7],
+					 $data[10],
+					 $data[15]);
+		$arrInserString[]=$params;
+	}
+	fclose($fp);
+	echo "单词表load:".$dirXmlBase.$dirXml.$outputFileNameHead.".csv<br>";
+}
+else{
+	echo "can not open csv file. filename=".$dirXmlBase.$dirXml.$outputFileNameHead.".csv";
+}
+
+// 开始一个事务,关闭自动提交
+$PDO->beginTransaction();
+$query="INSERT INTO main ('id','book','paragraph','wid','word','real','type','gramma','part','style') VALUES (?,?,?,?,?,?,?,?,?,?)";
+$stmt = $PDO->prepare($query);
+foreach($arrInserString as $oneParam){
+	$stmt->execute($oneParam);
+}
+// 提交更改 
+$PDO->commit();
+if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
+	$error = PDO_ErrorInfo();
+	echo "error - $error[2] <br>";
+	
+	$log=$log."$from, $FileName, error, $error[2] \r\n";
+}
+else{
+	$count=count($arrInserString);
+	echo "updata $count recorders.";
+}
+
+	$myLogFile = fopen($dirLog."insert_db.log", "a");
+	fwrite($myLogFile, $log);
+	fclose($myLogFile);
+?>
+
+
+<?php 
+if($from==$to){
+	echo "<h2>齐活!功德无量!all done!</h2>";
+}
+else{
+	echo "<script>";
+	echo "window.location.assign(\"db_insert_templet.php?from=".($from+1)."&to=".$to."\")";
+	echo "</script>";
+	echo "正在载入:".($from+1)."——".$filelist[$from+1][0];
+}
+?>
+</body>
+</html>

+ 2 - 0
app/pcdl/html_head.php

@@ -69,6 +69,8 @@ else{
 	<script src="../guide/guide.js"></script>
 	<link type="text/css" rel="stylesheet" href="../guide/guide.css"/>
 
+	<script src="../ucenter/setting.js"></script>
+
 	<script src="../public/js/marked.js"></script>
 	<script src="../public/js/mermaid.min.js"></script>
 

+ 54 - 15
app/public/charcode/coverter_my.js

@@ -597,6 +597,34 @@ var char_myn_to_roman_2 = [
 
 function roman_to_my(input) {
 	let char_roman_to_myn = [
+		{ id: "ggho", value: "ဂ္ဃေါ" },
+		{ id: "gghā", value: "ဂ္ဃါ" },
+
+		{ id: "ddho", value: "ဒ္ဓေါ" },
+		{ id: "ddhā", value: "ဒ္ဓါ" },
+
+		//{ id: "ppho", value: "ပ္ဖေါ" },
+		//{ id: "pphā", value: "ပ္ဖါ" },
+
+		{ id: "ss", value: "ဿ္" },
+
+		{ id: "vh", value: "ဝှ္" },
+		{ id: "vy", value: "ဝျ္" },
+		{ id: "vr", value: "ဝြ္" },
+
+		{ id: "yh", value: "ယှ္" },
+		{ id: "yy", value: "ယျ္" },
+		{ id: "yr", value: "ယြ္" },
+		{ id: "yv", value: "ယွ္" },
+
+		{ id: "hy", value: "ဟျ္" },
+		{ id: "hr", value: "ဟြ္" },
+		{ id: "hv", value: "ဟွ္" },
+
+		{ id: "rv", value: "ရွ္" },
+		{ id: "rh", value: "ရှ္" },
+		{ id: "ry", value: "ရျ္" },
+
 		{ id: "kh", value: "ခ္" },
 		{ id: "gh", value: "ဃ္" },
 		{ id: "ch", value: "ဆ္" },
@@ -620,20 +648,21 @@ function roman_to_my(input) {
 		{ id: "t", value: "တ္" },
 		{ id: "d", value: "ဒ္" },
 		{ id: "n", value: "န္" },
-		{ id: "h", value: "ဟ္" },
 		{ id: "p", value: "ပ္" },
 		{ id: "b", value: "ဗ္" },
 		{ id: "m", value: "မ္" },
-		{ id: "y", value: "ယ္" },
-		{ id: "r", value: "ရ္" },
 		{ id: "l", value: "လ္" },
-		{ id: "v", value: "ဝ္" },
 		{ id: "s", value: "သ္" },
-		{ id: "ṅ", value: "င္" },
+		{ id: "ṅ", value: "င်္" },
+
+		{ id: "္h", value: "ှ္" },
+		{ id: "h", value: "ဟ္" },
 		{ id: "္y", value: "ျ္" },
-		{ id: "္v", value: "ွ္" },
+		{ id: "y", value: "ယ္" },
 		{ id: "္r", value: "ြ္" },
-		{ id: "္h", value: "ှ္" },
+		{ id: "r", value: "ရ္" },
+		{ id: "္v", value: "ွ္" },
+		{ id: "v", value: "ဝ္" },
 		{ id: "္aṃ", value: "ံ" },
 		{ id: "္iṃ", value: "ိံ" },
 		{ id: "္uṃ", value: "ုံ" },
@@ -655,15 +684,23 @@ function roman_to_my(input) {
 		{ id: "ū", value: "ဦ" },
 		{ id: "e", value: "ဧ" },
 		{ id: "o", value: "ဩ" },
-
-		{ id: "ခာ", value: "ခါ" },
-		{ id: "ဂာ", value: "ဂါ" },
-		{ id: "ငာ", value: "ငါ" },
-		{ id: "ဒာ", value: "ဒါ" },
-		{ id: "ပာ", value: "ပါ" },
-		{ id: "ဝာ", value: "ဝါ" },
-
+		{ id: "်္အ", value: "" },
 		{ id: "္အ", value: "" },
+		{ id: "ခော", value: "ခေါ" },
+		{ id: "ခာ", value: "ခါ" }, //kh
+		{ id: "က္ခေါ", value: "က္ခော" }, //kkho
+		{ id: "က္ခါ", value: "က္ခာ" }, //kkhā
+		{ id: "ဂော", value: "ဂေါ" },
+		{ id: "ငော", value: "ငေါ" },
+		{ id: "ဒော", value: "ဒေါ" },
+		{ id: "ပော", value: "ပေါ" },
+		{ id: "ဝော", value: "ဝေါ" },
+		{ id: "ဂာ", value: "ဂါ" }, //g
+		{ id: "ငာ", value: "ငါ" }, //ṅ
+		{ id: "ဒာ", value: "ဒါ" }, //d
+		{ id: "ပာ", value: "ပါ" }, //p
+		{ id: "ဝာ", value: "ဝါ" }, //v
+
 		{ id: "1", value: "၁" },
 		{ id: "2", value: "၂" },
 		{ id: "3", value: "၃" },
@@ -675,7 +712,9 @@ function roman_to_my(input) {
 		{ id: "9", value: "၉" },
 		{ id: "0", value: "၀" },
 		{ id: ".", value: "။" },
+		{ id: ";", value: "။" },
 		{ id: ",", value: "၊" },
+		{ id: ",", value: "၊" },
 	];
 
 	let txt = input.toLowerCase();

+ 50 - 12
app/public/charcode/myanmar.js

@@ -1,4 +1,32 @@
 var char_roman_to_myn = [
+	{ id: "ggho", value: "ဂ္ဃေါ" },
+	{ id: "gghā", value: "ဂ္ဃါ" },
+
+	{ id: "ddho", value: "ဒ္ဓေါ" },
+	{ id: "ddhā", value: "ဒ္ဓါ" },
+
+	//{ id: "ppho", value: "ပ္ဖေါ" },
+	//{ id: "pphā", value: "ပ္ဖါ" },
+
+	{ id: "ss", value: "ဿ္" },
+
+	{ id: "vh", value: "ဝှ္" },
+	{ id: "vy", value: "ဝျ္" },
+	{ id: "vr", value: "ဝြ္" },
+
+	{ id: "yh", value: "ယှ္" },
+	{ id: "yy", value: "ယျ္" },
+	{ id: "yr", value: "ယြ္" },
+	{ id: "yv", value: "ယွ္" },
+
+	{ id: "hy", value: "ဟျ္" },
+	{ id: "hr", value: "ဟြ္" },
+	{ id: "hv", value: "ဟွ္" },
+
+	{ id: "rv", value: "ရွ္" },
+	{ id: "rh", value: "ရှ္" },
+	{ id: "ry", value: "ရျ္" },
+
 	{ id: "kh", value: "ခ္" },
 	{ id: "gh", value: "ဃ္" },
 	{ id: "ch", value: "ဆ္" },
@@ -22,20 +50,21 @@ var char_roman_to_myn = [
 	{ id: "t", value: "တ္" },
 	{ id: "d", value: "ဒ္" },
 	{ id: "n", value: "န္" },
-	{ id: "h", value: "ဟ္" },
 	{ id: "p", value: "ပ္" },
 	{ id: "b", value: "ဗ္" },
 	{ id: "m", value: "မ္" },
-	{ id: "y", value: "ယ္" },
-	{ id: "r", value: "ရ္" },
 	{ id: "l", value: "လ္" },
-	{ id: "v", value: "ဝ္" },
 	{ id: "s", value: "သ္" },
 	{ id: "ṅ", value: "င်္" },
+
+	{ id: "္h", value: "ှ္" },
+	{ id: "h", value: "ဟ္" },
 	{ id: "္y", value: "ျ္" },
-	{ id: "္v", value: "ွ္" },
+	{ id: "y", value: "ယ္" },
 	{ id: "္r", value: "ြ္" },
-	{ id: "္h", value: "ှ္" },
+	{ id: "r", value: "ရ္" },
+	{ id: "္v", value: "ွ္" },
+	{ id: "v", value: "ဝ္" },
 	{ id: "္aṃ", value: "ံ" },
 	{ id: "္iṃ", value: "ိံ" },
 	{ id: "္uṃ", value: "ုံ" },
@@ -57,13 +86,22 @@ var char_roman_to_myn = [
 	{ id: "ū", value: "ဦ" },
 	{ id: "e", value: "ဧ" },
 	{ id: "o", value: "ဩ" },
+	{ id: "်္အ", value: "" },
 	{ id: "္အ", value: "" },
-	{ id: "ခာ", value: "ခါ" },
-	{ id: "ဂာ", value: "ဂါ" },
-	{ id: "ငာ", value: "ငါ" },
-	{ id: "ဒာ", value: "ဒါ" },
-	{ id: "ပာ", value: "ပါ" },
-	{ id: "ဝာ", value: "ဝါ" },
+	{ id: "ခော", value: "ခေါ" },
+	{ id: "ခာ", value: "ခါ" }, //kh
+	{ id: "က္ခေါ", value: "က္ခော" }, //kkho
+	{ id: "က္ခါ", value: "က္ခာ" }, //kkhā
+	{ id: "ဂော", value: "ဂေါ" },
+	{ id: "ငော", value: "ငေါ" },
+	{ id: "ဒော", value: "ဒေါ" },
+	{ id: "ပော", value: "ပေါ" },
+	{ id: "ဝော", value: "ဝေါ" },
+	{ id: "ဂာ", value: "ဂါ" }, //g
+	{ id: "ငာ", value: "ငါ" }, //ṅ
+	{ id: "ဒာ", value: "ဒါ" }, //d
+	{ id: "ပာ", value: "ပါ" }, //p
+	{ id: "ဝာ", value: "ဝါ" }, //v
 ];
 
 var char_myn_to_roman_1 = [

+ 18 - 0
app/studio/css/print.css

@@ -0,0 +1,18 @@
+.word_punc,
+.word {
+	page-break-inside: avoid;
+}
+
+.mean,
+.org,
+.om,
+.case {
+	page-break-after: avoid;
+}
+#toolbar {
+	display: none;
+}
+
+#left_tool_bar {
+	display: none;
+}

+ 1 - 0
app/studio/editor.php

@@ -26,6 +26,7 @@ else{$currDevice="computer";}
 	<link type="text/css" rel="stylesheet" href="css/style.css"/>
 	<link type="text/css" rel="stylesheet" href="css/color_day.css" id="colorchange" />
 	<link type="text/css" rel="stylesheet" href="css/style_mobile.css" media="screen and (max-width:800px)">
+	<link type="text/css" rel="stylesheet" href="css/print.css" media="print" />
 	<link href="https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&display=swap" rel="stylesheet">
 	<link type="text/css" rel="stylesheet" href="../public/css/notify.css"/>
 	<?php

+ 38 - 22
app/term/note.js

@@ -224,6 +224,7 @@ function note_refresh_new() {
 						note_ref_init();
 						term_get_dict();
 						note_channal_list();
+						refresh_pali_script();
 					} catch (e) {
 						console.error(e);
 					}
@@ -939,31 +940,46 @@ function note_show_pali_sim(SentId) {
 }
 
 function set_pali_script(pos, script) {
-	$(".palitext" + pos).each(function () {
-		let html = $(this).siblings(".palitext_roma").first().html();
-		$(this).html(html);
-	});
+	if (script == "none") {
+		$(".palitext" + pos).html("");
+	} else {
+		$(".palitext" + pos).each(function () {
+			let html = $(this).siblings(".palitext_roma").first().html();
+			$(this).html(html);
+		});
 
-	$(".palitext" + pos)
-		.find("*")
-		.contents()
-		.filter(function () {
-			return this.nodeType != 1;
-		})
-		.wrap("<pl" + pos + "></pl" + pos + ">");
-
-	$(".palitext" + pos)
-		.contents()
-		.filter(function () {
-			return this.nodeType != 1;
-		})
-		.wrap("<pl" + pos + "></pl" + pos + ">");
-
-	$("pl" + pos).html(function (index, oldcontent) {
-		return roman_to_my(oldcontent);
-	});
+		$(".palitext" + pos)
+			.find("*")
+			.contents()
+			.filter(function () {
+				return this.nodeType != 1;
+			})
+			.wrap("<pl" + pos + "></pl" + pos + ">");
+
+		$(".palitext" + pos)
+			.contents()
+			.filter(function () {
+				return this.nodeType != 1;
+			})
+			.wrap("<pl" + pos + "></pl" + pos + ">");
+
+		$("pl" + pos).html(function (index, oldcontent) {
+			return roman_to_my(oldcontent);
+		});
+	}
 }
 
+function refresh_pali_script() {
+	if (_display && _display == "para") {
+		//段落模式
+	} else {
+		//句子模式
+		setting_get("lib.second_script", set_second_scrip);
+	}
+}
+function set_second_scrip(value) {
+	set_pali_script(2, value);
+}
 function slider_show(obj) {
 	$(obj).parent().parent().parent().parent().parent().toggleClass("slider_show_shell");
 }

+ 23 - 20
app/ucenter/default.json

@@ -1,22 +1,25 @@
 {
-  "account.head": 0,
-  "_ui.lang": ["en", "zh-hans", "zh-hant"],
-  "ui.lang": ["en", "zh-hans", "zh-hant", "si", "my"],
-  "_studio.translation.lang": ["en", "zh-hans", "zh-hant", "si", "my"],
-  "studio.translation.lang": ["en", "zh-hans", "zh-hant"],
-  "studio.translation.autosave": true,
-  "_dict.lang": ["en", "zh", "zh-hans", "zh-hant", "si"],
-  "dict.lang": ["zh", "en"],
-  "_dict.list": [
-    {
-      "id": "regular",
-      "name": "dict_sys_regular",
-      "table": "/system/sys_regular.db"
-    },
-    { "id": "bhmf", "table": "bhmf.db" },
-    { "id": "bhmf", "table": "bhmf.db" },
-    { "id": "bhmf", "table": "bhmf.db" }
-  ],
-  "dict.whitelist": ["@kosalla", "@mine"],
-  "dict.blacklist": ["@all", "bhmf"]
+	"account.head": 0,
+	"_ui.lang": ["en", "zh-hans", "zh-hant"],
+	"ui.lang": ["en", "zh-hans", "zh-hant", "si", "my"],
+	"_studio.translation.lang": ["en", "zh-hans", "zh-hant", "si", "my"],
+	"studio.translation.lang": ["en", "zh-hans", "zh-hant"],
+	"studio.translation.autosave": true,
+	"_dict.lang": ["en", "zh", "zh-hans", "zh-hant", "si"],
+	"dict.lang": ["zh", "en"],
+	"_dict.list": [
+		{
+			"id": "regular",
+			"name": "dict_sys_regular",
+			"table": "/system/sys_regular.db"
+		},
+		{ "id": "bhmf", "table": "bhmf.db" },
+		{ "id": "bhmf", "table": "bhmf.db" },
+		{ "id": "bhmf", "table": "bhmf.db" }
+	],
+	"dict.whitelist": ["@kosalla", "@mine"],
+	"dict.blacklist": ["@all", "bhmf"],
+	"lib.first_script": "roma",
+	"lib.second_script": "none",
+	"lib.pali_script": ["none", "roma", "my"]
 }

+ 142 - 106
app/ucenter/setting.js

@@ -1,126 +1,162 @@
 var setting;
 function setting_head_render(file) {
-  let html = '<svg class="head_icon" style="height: 3em;width: 3em;">';
-  html += '<use xlink:href="../head/images/"' + file + "></use>";
-  html += "</svg>";
-  $("#head_img").html(html);
+	let html = '<svg class="head_icon" style="height: 3em;width: 3em;">';
+	html += '<use xlink:href="../head/images/"' + file + "></use>";
+	html += "</svg>";
+	$("#head_img").html(html);
 }
 function setting_onload() {
-  $.post("get_setting.php", {}, function (data, status) {
-    try {
-      setting = JSON.parse(data);
-      let html;
+	$.post("get_setting.php", {}, function (data, status) {
+		try {
+			setting = JSON.parse(data);
+			let html;
 
-      html = "";
-      html += gLocal.gui.interface_language + ":";
-      $("#setting_general").html(html);
+			//通用设置
+			html = "";
+			html += gLocal.gui.interface_language + ":";
+			$("#setting_general").html(html);
+			//通用设置结束
 
-      html = "";
-      html += gLocal.gui.translation_language + ":";
+			//Library 设置
 
-      $("#setting_studio").html(html);
+			html = "";
+			html += "<h3>显示/Display</h3>";
+			html += "<div>巴利原文1" + setting_render_paliscript("lib.first_script") + "</div>";
+			html += "<div>巴利原文2" + setting_render_paliscript("lib.second_script") + "</div>";
 
-      let dict_lang_others = new Array();
-      for (const iterator of setting["_dict.lang"]) {
-        if (setting["dict.lang"].indexOf(iterator) == -1) {
-          dict_lang_others.push(iterator);
-        }
-      }
-      html = "";
-      html += gLocal.gui.magic_dict_language + ":";
-      html += "<div style='display:flex;'>";
+			$("#setting_library").html(html);
+			//Library 设置结束
 
-      html += "<fieldset style='width:10em;'>";
-      html += "<legend>" + gLocal.gui.priority + "</legend>";
-      html += "<ul id='ul_dict_lang1' class='dict_lang'>";
-      let i = 0;
-      for (const iterator of setting["dict.lang"]) {
-        html +=
-          "<li id='dict_lang1_li_" +
-          i +
-          "' value='" +
-          iterator +
-          "'>" +
-          lang_get_org_name(iterator) +
-          "</li>";
-        i++;
-      }
-      html += "</ul>";
-      html += "</fieldset>";
+			//Studio 设置
+			html = "";
+			html += gLocal.gui.translation_language + ":";
 
-      html += "<fieldset style='width:10em;'>";
-      html += "<legend>" + gLocal.gui.no_need + "</legend>";
-      html += "<ul id='ul_dict_lang2' class='dict_lang'>";
-      i = 0;
-      for (const iterator of dict_lang_others) {
-        html +=
-          "<li id='dict_lang2_li_" +
-          i +
-          "' value='" +
-          iterator +
-          "'>" +
-          lang_get_org_name(iterator) +
-          "</li>";
-        i++;
-      }
-      html += "</ul>";
-      html += "</fieldset>";
-      html += "</div>";
-      $("#setting_dictionary").html(html);
+			$("#setting_studio").html(html);
+			//Studio 设置结束
 
-      $("#ul_dict_lang1, #ul_dict_lang2")
-        .sortable({
-          connectWith: ".dict_lang",
-        })
-        .disableSelection();
-      $("#ul_dict_lang1").sortable({
-        update: function (event, ui) {
-          let sortedIDs = $("#ul_dict_lang1").sortable("toArray");
-          let newLang = new Array();
-          for (const iSorted of sortedIDs) {
-            newLang.push($("#" + iSorted).attr("value"));
-          }
-          setting["dict.lang"] = newLang;
-          setting_save();
-        },
-      });
-    } catch (e) {}
-  });
+			let dict_lang_others = new Array();
+			for (const iterator of setting["_dict.lang"]) {
+				if (setting["dict.lang"].indexOf(iterator) == -1) {
+					dict_lang_others.push(iterator);
+				}
+			}
+			html = "";
+			html += gLocal.gui.magic_dict_language + ":";
+			html += "<div style='display:flex;'>";
+
+			html += "<fieldset style='width:10em;'>";
+			html += "<legend>" + gLocal.gui.priority + "</legend>";
+			html += "<ul id='ul_dict_lang1' class='dict_lang'>";
+			let i = 0;
+			for (const iterator of setting["dict.lang"]) {
+				html +=
+					"<li id='dict_lang1_li_" +
+					i +
+					"' value='" +
+					iterator +
+					"'>" +
+					lang_get_org_name(iterator) +
+					"</li>";
+				i++;
+			}
+			html += "</ul>";
+			html += "</fieldset>";
+
+			html += "<fieldset style='width:10em;'>";
+			html += "<legend>" + gLocal.gui.no_need + "</legend>";
+			html += "<ul id='ul_dict_lang2' class='dict_lang'>";
+			i = 0;
+			for (const iterator of dict_lang_others) {
+				html +=
+					"<li id='dict_lang2_li_" +
+					i +
+					"' value='" +
+					iterator +
+					"'>" +
+					lang_get_org_name(iterator) +
+					"</li>";
+				i++;
+			}
+			html += "</ul>";
+			html += "</fieldset>";
+			html += "</div>";
+			$("#setting_dictionary").html(html);
+
+			$("#ul_dict_lang1, #ul_dict_lang2")
+				.sortable({
+					connectWith: ".dict_lang",
+				})
+				.disableSelection();
+			$("#ul_dict_lang1").sortable({
+				update: function (event, ui) {
+					let sortedIDs = $("#ul_dict_lang1").sortable("toArray");
+					let newLang = new Array();
+					for (const iSorted of sortedIDs) {
+						newLang.push($("#" + iSorted).attr("value"));
+					}
+					setting["dict.lang"] = newLang;
+					setting_save();
+				},
+			});
+		} catch (e) {}
+	});
 }
 function li_remove() {
-  $(this).parent().remove();
+	$(this).parent().remove();
 }
 var get_callback;
 function setting_get(key, callback) {
-  get_callback = callback;
-  $.post(
-    "../ucenter/get_setting.php",
-    {
-      key: key,
-    },
-    function (data, status) {
-      try {
-        let arrSetting = JSON.parse(data);
-        if (arrSetting.hasOwnProperty(key)) {
-          get_callback(arrSetting[key]);
-        } else {
-          get_callback(false);
-        }
-      } catch (e) {
-        get_callback(false);
-      }
-    }
-  );
+	get_callback = callback;
+	$.post(
+		"../ucenter/get_setting.php",
+		{
+			key: key,
+		},
+		function (data, status) {
+			try {
+				let arrSetting = JSON.parse(data);
+				if (arrSetting.hasOwnProperty(key)) {
+					get_callback(arrSetting[key]);
+				} else {
+					get_callback(false);
+				}
+			} catch (e) {
+				get_callback(false);
+			}
+		}
+	);
 }
 
 function setting_save() {
-  $.post(
-    "set_setting.php",
-    {
-      data: JSON.stringify(setting),
-    },
-    function (data, status) {
-      ntf_show(data);
-    }
-  );
+	$.post(
+		"set_setting.php",
+		{
+			data: JSON.stringify(setting),
+		},
+		function (data, status) {
+			ntf_show(data);
+		}
+	);
+}
+
+function setting_paliscript_change(set) {
+	let x = document.getElementById(set);
+	setting[set] = x.options[x.selectedIndex].text;
+	setting_save();
+}
+function setting_render_paliscript(set) {
+	let html = "";
+	html += "<select id='" + set + "' onchange=\"setting_paliscript_change('" + set + "')\">";
+	for (const iterator of setting["lib.pali_script"]) {
+		html += "<option value='" + iterator + "'";
+		if (iterator == setting[set]) {
+			html += "selected='selected'";
+		}
+		html += ">";
+		html += iterator;
+		html += "</option>";
+	}
+	html += "</select>";
+
+	return html;
 }

+ 27 - 6
app/ucenter/setting.php

@@ -221,6 +221,11 @@ para:hover{
     min-height: 4em;
 	margin:0.5em;
 }
+.setting_shell{
+	border-bottom: 1px solid gray;
+    margin-bottom: 3em;
+    padding-bottom: 3em;
+}
 </style>
 		<!-- tool bar begin-->
 		<div id="main_tool_bar" class='reader_toolbar'>
@@ -240,7 +245,8 @@ para:hover{
 
 		
 	<div id="main_text_view" style="padding-bottom: 10em;">
-        <?php 
+		<?php 
+			echo "<div id='setting_account_shell' class='setting_shell'>";
             echo "<a name='account'></a>";
 			echo "<h2>{$_local->gui->account}</h2>";
 			echo "头像:<span id='head_img'></span>";
@@ -249,23 +255,38 @@ para:hover{
             echo "{$_local->gui->nick_name}:{$_COOKIE["nickname"]} <button>修改</button><br />";
             echo "{$_local->gui->e_mail}:{$_COOKIE["email"]}<button>修改</button><br />";
             echo "<a href='../ucenter/pwd_set.php'>{$_local->gui->change_password}</a><br>";
-            echo "<a href='login.php?op=logout'>{$_local->gui->logout}</a>";
+			echo "<a href='login.php?op=logout'>{$_local->gui->logout}</a>";
+			echo "</div>";
+			
 
+			echo "<div id='setting_general_shell' class='setting_shell'>";
+			echo "<a name='general'></a>";
             echo "<h2>{$_local->gui->general}</h2>";
             echo "<div id='setting_general' class='setting_content'>";
-            echo "</div>";
+			echo "</div>";
+			echo "</div>";
+
+			
+			echo "<div id='setting_library_shell' class='setting_shell'>";
+			echo "<a name='library'></a>";
+            echo "<h2>{$_local->gui->library}</h2>";
+            echo "<div id='setting_library' class='setting_content'>";
+            echo "</div>";			
+            echo "</div>";			
 
+			echo "<div id='setting_studio_shell' class='setting_shell'>";
+			echo "<a name='studio'></a>";
             echo "<h2>{$_local->gui->studio}</h2>";
             echo "<div id='setting_studio' class='setting_content'>";
             echo "</div>";
-            
-            echo "<h2>{$_local->gui->library}</h2>";
-            echo "<div id='setting_library' class='setting_content'>";
             echo "</div>";
 
+			echo "<div id='setting_dictionary_shell' class='setting_shell'>";
+			echo "<a name='dictionary'></a>";
             echo "<h2>{$_local->gui->dictionary}</h2>";
             echo "<div id='setting_dictionary' class='setting_content'>";
             echo "</div>";
+            echo "</div>";
 
         ?>
 

+ 5 - 0
documents/users_guide/zh-cn/grammar_2p.md

@@ -0,0 +1,5 @@
+## 第二人称
+
+缩写: 2p
+
+动词的一种变化形式。动作的发出者是第二人称(你、你们)。

+ 4 - 0
documents/users_guide/zh-cn/grammar_aor.md

@@ -0,0 +1,4 @@
+## 不定过去
+
+缩写:aor.
+巴利语中的过去式。表达过去发生的动作。

+ 5 - 4
documents/users_guide/zh-cn/grammar_pl.md

@@ -1,6 +1,7 @@
 # 复数
+
+缩写: pl.
 pāḷi:bahuvacana
-```
-Bahūnamatthānaṃ vacanaṃ bahuvacanaṃ.
-表达“有多个”含义的用语,为复数。
-```
+
+> Bahūnamatthānaṃ vacanaṃ bahuvacanaṃ.
+> 表达“有多个”含义的用语,为复数。