Преглед изворни кода

Merge branch 'laravel' into nissaya-channel

visuddhinanda@gmail.com пре 4 година
родитељ
комит
3ba9a56fe5

+ 13 - 1
public/app/article/article.js

@@ -514,7 +514,19 @@ function render_toc(){
 					nextChapter = it.next_chapter;
 					prevChapter = it.prev_chapter;
 				}
-				arrToc.push({article:it.paragraph,title:it.toc,level:it.level});
+                let strTitle;
+                switch (getCookie('language')) {
+                    case 'my':
+                        strTitle = roman_to_my(it.toc);
+                        break;
+                    case 'si':
+                        strTitle = roman_to_si(it.toc);
+                        break;
+                    default:
+                        strTitle = it.toc;
+                        break;
+                }
+				arrToc.push({article:it.paragraph,title:strTitle,title_roman:it.toc,level:it.level});
 			}
 			$("#toc_content").fancytree({
 				autoScroll: true,

+ 3 - 3
public/app/article/function.php

@@ -119,9 +119,9 @@ class Article extends Table
 			}
 		}
 		#查询共享权限,如果共享权限更大,覆盖上面的的
-		$sharePower = share_get_res_power($_COOKIE["user_uid"],$id);
+		$sharePower = share_get_res_power($userId,$id);
 		if($collectionId!=""){
-			$sharePowerCollection = share_get_res_power($_COOKIE["user_uid"],$collectionId);
+			$sharePowerCollection = share_get_res_power($userId,$collectionId);
 		}
 		else{
 			$sharePowerCollection =0;
@@ -133,7 +133,7 @@ class Article extends Table
 			$iPower=$sharePowerCollection;
 		}
 		if($this->redis!==false){
-			$this->redis->hSet("power://article/".$id,$_COOKIE["user_uid"],$iPower);
+			$this->redis->hSet("power://article/".$id,$userId,$iPower);
 		}
 		return $iPower;
 	}

+ 12 - 0
public/app/article/style.css

@@ -317,4 +317,16 @@ img {
 #contents_nav{
 	display: flex;
     justify-content: space-between;
+}
+td, th {
+    border: unset;
+    vertical-align: baseline;
+    padding:6px;
+}
+table {
+  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
+  border-collapse: collapse;
+}
+tr {
+  border-bottom: 1px solid gray;
 }

+ 53 - 13
public/app/palicanon/palicanon.js

@@ -19,6 +19,7 @@ function palicanon_onload() {
 	$("#tag_input").keypress(function () {
 		tag_render_others();
 	});
+    render_main_tag();
 }
 
 function palicanon_load_term() {
@@ -32,7 +33,7 @@ function palicanon_load_term() {
             break;    
         case '':
             lang = 'en';
-            break;  
+            break;
     }
 	$.get(
 		"/api/v2/terms",
@@ -67,13 +68,17 @@ function tag_changed() {
 	}
 	console.log(strTags);
 	let lang = getCookie("language");
-	if (lang == "zh-cn") {
-		lang = "zh-hans";
-	} else if (lang == "zh-tw") {
-		lang = "zh-hant";
-	} else if (lang == "") {
-		lang = "en";
-	}
+    switch (lang) {
+        case 'zh-cn':
+            lang = 'zh-hans';
+            break;
+        case 'zh-tw':
+            lang = 'zh-hant';
+            break;    
+        case '':
+            lang = 'en';
+            break;
+    }
 	$.get(
 		"./book_tag.php",
 		{
@@ -206,7 +211,21 @@ function render_chapter_head(chapter_info, parent) {
 	let link = "../reader/?view=chapter&book=" + chapter_info.book + "&par=" + chapter_info.paragraph;
 	html += "<div class='title'>";
 	if (typeof chapter_info.trans_title == "undefined") {
-		html += "	<div class='title_1'><a href='" + link + "' target='_blank'>" + chapter_info.text + "</a></div>";
+		html += "	<div class='title_1'>";
+        html += "<a href='" + link + "' target='_blank'>" ;
+        switch (getCookie('language')) {
+            case 'my':
+                html += roman_to_my(chapter_info.text);
+                break;
+            case 'si':
+                html += roman_to_si(chapter_info.text);
+                break;        
+            default:
+                html += chapter_info.text ;
+                break;
+        }
+        html += "</a>";
+        html += "</div>";
 	} else {
 		html +=
 			"	<div class='title_1'><a href='" + link + "' target='_blank'>" + chapter_info.trans_title + "</a></div>";
@@ -310,7 +329,20 @@ function palicanon_render_chapter_row(chapter) {
 	html += '<div class="title">';
 
 	if (typeof chapter.trans_title == "undefined") {
-		html += "	<div class='title_1'>" + chapter.title + "</div>";
+		html += "	<div class='title_1'>" ;
+        switch (getCookie('language')) {
+            case 'my':
+                html += roman_to_my(chapter.title);
+                break;
+            case 'si':
+                html += roman_to_si(chapter.title);
+                break;
+            default:
+                html += chapter.title ;
+                break;
+        }
+        
+        html += "</div>";
 	} else {
 		html += "	<div class='title_1'>" + chapter.trans_title + "</div>";
 	}
@@ -342,10 +374,18 @@ function palicanon_render_chapter_row(chapter) {
 }
 function tag_get_local_word(word) {
 	let termKey = term_lookup_my(word, "", getCookie("userid"), getCookie("language"));
-	if (termKey) {
-		return termKey.meaning;
+	if (typeof termKey == 'undefined' || termKey === false || termKey === '') {
+        switch (getCookie('language')) {
+            case 'my':
+                return roman_to_my(word);
+            case 'si':
+                return roman_to_si(word);
+            default:
+                return word;
+        }        
+		
 	} else {
-		return word;
+        return termKey.meaning;
 	}
 }
 function tag_render_others() {

+ 21 - 21
public/app/public/lang/my.json

@@ -32,7 +32,7 @@
 		"buddhist_calendar": "Buddhist Calendar",
 		"budha": "ဗုဓ",
 		"by": "By",
-		"cancel": "Cancel",
+		"cancel": "ဖျက်သိမ်းသည်",
 		"canda": "စန္ဒ",
 		"caption": "Caption",
 		"CE": "CE",
@@ -45,13 +45,13 @@
 		"click_word_to": "click word to ",
 		"code_convert": "Code Convert",
 		"color": "Color",
-		"column_compare": "Up&nbsp;&&nbsp;Down",
+		"column_compare": "ပေါ်&nbsp;&&nbsp;အောက်",
 		"commentary": "Commentary",
 		"completely_delete": "completely delete",
 		"computer": "Computer",
 		"confirm": "Confirm",
-		"content": "Content",
-		"contents": "Table of Content",
+		"content": "မာတိကာ",
+		"contents": "မာတိကာ",
 		"copy": "copy",
 		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
@@ -71,7 +71,7 @@
 		"dict": "Dict",
 		"dict_match": "Match the Dictionary and Document",
 		"dict_terms": "Terms",
-		"dictionary": "Dictionary",
+		"dictionary": "အဘိဓာန်",
 		"dictionary_match_result": "Dictionary Match Result",
 		"dictsouce": "Source of Terms",
 		"difficulty": "difficulty level",
@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"draft": "As Draft",
 		"dawn": "dawn",
-		"each_paragraph": "E&nbsp;paragraph",
-		"each_sentence": "E&nbsp;sentence",
+		"each_paragraph": "paragraph",
+		"each_sentence": "ဝါကျကဏ္ဍ",
 		"eat": "eat",
 		"edit": "Edit",
 		"edit_now": "Edit in Studio",
@@ -147,11 +147,11 @@
 		"input": "input",
 		"kala": "ကာလ",
 		"keywords": "Keywords",
-		"language": "Language",
+		"language": "ဘာသာ",
 		"language_select": "ဘာသာ",
 		"layout": "Layout",
 		"left": "Remains ",
-		"lesson": "lesson",
+		"lesson": "သင်တန်း",
 		"letters": "&nbsp;letters",
 		"level": "Lv",
 		"list": "List",
@@ -220,8 +220,8 @@
 		"pa_auk_dictionary": "Pa-auk Dictionary",
 		"pacchā_māsa": "ပစ္ဆာ-မာသ",
 		"pakkha": "Lunar Phases ",
-		"pāli": "Pāli",
-		"pali_canon": "Pāḷi Canon",
+		"pāli": "ပါဠိ",
+		"pali_canon": "တိပိဋက",
 		"pāli_code": "Pāli Code",
 		"para": "&nbsp;Paragraphs",
 		"paragraph": "Paragraph",
@@ -245,7 +245,7 @@
 		"pubba_māsa": "ပုဗ္ဗ-မာသ",
 		"publish": "Publish",
 		"ravi": "ရဝိ",
-		"read": "Read",
+		"read": "စာဖတ်",
 		"read_only": "Read Only",
 		"recent_scan": "Recent Scan",
 		"recycle_bin": "Recycle Bin",
@@ -261,7 +261,7 @@
 		"revision_mode": "Revision Mode",
 		"round_1": "Round ",
 		"round_2": "&nbsp;dictionary",
-		"row_compare": "Left&nbsp;&&nbsp;Right",
+		"row_compare": "ဘယ်&nbsp;&&nbsp;ညာ",
 		"same_word": "same words",
 		"saṃvacchara": "သံဝစ္ဆရ",
 		"sandhi": "Sandhi",
@@ -270,7 +270,7 @@
 		"sandhi_end": "Sandhi End",
 		"sandhi_orginal_word": "Sandhi Orginal Word",
 		"sandhi_splited_word": "Sandhi Splited Word",
-		"save": "Save",
+		"save": "သိမ်းထားသည",
 		"script": "Script",
 		"search": "Search",
 		"season": "Season ",
@@ -312,7 +312,7 @@
 		"total_workload": "total workload",
 		"totally": "Totally ",
 		"tran_workload": "whole passage translate ",
-		"translate": "Translate",
+		"translate": "စကားပြန်",
 		"translate_convert": "Translate Convert",
 		"translate1": "Translated By ",
 		"translation": "Translation",
@@ -321,10 +321,10 @@
 		"undo_shared": "undo shared",
 		"unsplit": "Slur Splited",
 		"up": "Up",
-		"up_and_down": "Up And Down",
+		"up_and_down": "ပေါ် And အောက်",
 		"update_all_wbw_to_database": "Update All WBW to Database",
 		"user": "User",
-		"to_user_dictionary": "Save & Add to My Vocabulary List",
+		"to_user_dictionary": "သိမ်းထားသည & Add to My Vocabulary List",
 		"user_id": "User ID",
 		"userdict": "Vocabulary List",
 		"vannana": "vaṇṇanā",
@@ -387,7 +387,7 @@
 		"add_to_folder": "add to folder",
 		"rename": "rename",
 		"collaborate": "collaborate",
-		"help": "help",
+		"help": "အကူအညီ",
 		"function_introduce": "functions of Wikipāḷi",
 		"vedio_link": "vedio link",
 		"project_introduce": "conference of pāḷi-translating platform",
@@ -463,7 +463,7 @@
 		"comment": "comments",
 		"my_term": "my term",
 		"scan_in_reader": "scan in reader",
-		"selected": "selected",
+		"selected": "မှတ်ပါ",
 		"to_be_selected": "to be selected",
 		"text_without_title": "text without title",
 		"end_of_text": "No Prev",
@@ -626,7 +626,7 @@
 		"years_ago": "&nbsp;years ago",
 		"similar": "similar",
 		"suggest": "suggest",
-		"next_line": "new line",
+		"next_line": "နောက်တစ်ကြောင်း",
 		"link": "link",
 		"co_channel": "collaborative channels",
 		"permission": "permission",
@@ -935,7 +935,7 @@
 		},
 		{
 			"id": ".comp.",
-			"value": "သမာသ"
+			"value": "စကားပေါင်း"
 		},
 		{
 			"id": ".pre.",

+ 28 - 0
public/documents/tables.md

@@ -0,0 +1,28 @@
+# Tables
+
+业务表
+
+|name|description|
+|-|-|
+|wbws|逐词解析|
+|wbw_blocks|逐词解析段落索引|
+|channels|版本|
+|sentences|用户上传的句子|
+|sent_blocks|句子段落索引|
+|sent_prs|句子修改建议|
+|sent_histories|句子历史记录|
+|user_dicts|用户字典|
+|user_operation_dailies|用户操作记录(每日)|
+|user_operation_frames|用户操作记录(连续时间片段)|
+|user_operation_logs|用户操作记录(所有学习行为)|
+|articles|文章|
+|collections|文集|
+|article_collections|文章文集多对多|
+|dhamma_terms|术语|
+|shares|资源分享和协作|
+|group_infos|工作组|
+|group_members|工作组成员|
+|file_indices|逐词解析文件索引|
+|custom_books|用户自定义书名|
+|custom_book_sentences|用户自定义书句子|
+|custom_book_ids|用户自定义书最大序列号|