Browse Source

Merge pull request #131 from visuddhinanda/master

重大更新
Bhikkhu-Kosalla 5 years ago
parent
commit
62acb5cc47

+ 165 - 155
app/README.md

@@ -1,34 +1,39 @@
 # wikipali demo wikipali 的功能演示
+
 ## Breif Introduction 简介
-wikipali 的功能演示。用php pdo js html css3 写成。没有使用任何框架。jQuray 除外。
- 
- wikipali demo build by php  pdo js html css3 jQuray . no any framework. 
- 
- 本仓库为demo测试版代码,bug 多多,供设计者提交设计思路,仅供测试和功能演示,并非最终代码。
- 
- This is the demo code for disigners’ submit, but only for test and check not the final code.
- 
- 请注意,我们的协作仅仅在Github上进行,但我们回让【码云】上的代码与github保持强制同步,这会覆盖不知情者在【码云】上的修改。
-
- Attention please! we collaborate on Github only, but we will keep the synchronization of the code on Gitee with Github, which will overwrite unknowers’ commits.
-## Resources相关资源
-### web demo网站演示版
 
-visit [www.wikipali.org/demo](https://www.wikipali.org/demo) to scan, test and check for the developer only, not for the normal users.
+wikipali 的功能演示。用 php pdo js html css3 写成。没有使用任何框架。jQuray 除外。
+
+wikipali demo build by php pdo js html css3 jQuray . no any framework.
+
+本仓库为 demo 测试版代码,bug 多多,供设计者提交设计思路,仅供测试和功能演示,并非最终代码。
+
+This is the demo code for disigners’ submit, but only for test and check not the final code.
+
+请注意,我们的协作仅仅在 Github 上进行,但我们会让【码云】上的代码与 github 保持强制同步,这会覆盖不知情者在【码云】上的修改。
+
+Attention please! we collaborate on Github only, but we will keep the synchronization of the code on Gitee with Github, which will overwrite unknowers’ commits.
 
+## Resources 相关资源
+
+### web demo 网站演示版
+
+visit [www.wikipali.org/demo](https://www.wikipali.org/demo) to scan, test and check for the developer only, not for the normal users.
 
 访问[www.wikipali.org/demo](https://www.wikipali.org/demo) 仅仅是针对开发者来进行浏览、测试和检查的,而不是面向普通用户。
 
 ### code for wikipali website Demo 网站演示版代码
+
 1. If anyone want to push his github code to the server, please contact with Ven. Bhikkhu Visuddhinanda and Ven. Bhikkhu Kosalla by wechat or teams.
-想要将其github上的代码推送至服务器,请微信联络Bhikkhu Visuddhinanda和Bhikkhu Kosalla.
+   想要将其 github 上的代码推送至服务器,请微信联络 Bhikkhu Visuddhinanda  Bhikkhu Kosalla.
 2. download and install "gitbash", "TortoiseGit" and "github desktop" and make the submit and communication esay.
-下载并安装"gitbash", "TortoiseGit"和"github desktop"来进行代码提交,这样相互交流更加便捷。
+   下载并安装"gitbash", "TortoiseGit"和"github desktop"来进行代码提交,这样相互交流更加便捷。
+
+### videos 视频
 
-### videos视频
 [functions demo 功能演示](https://www.youtube.com/playlist?list=PL_1iJBQvNPFFNLOaZh2u3VwDYUyJuK_xa)
 
-[Example Class课程范例](https://www.youtube.com/playlist?list=PL_1iJBQvNPFHwP1ZL4sbhtJTnYeMiEm29)
+[Example Class 课程范例](https://www.youtube.com/playlist?list=PL_1iJBQvNPFHwP1ZL4sbhtJTnYeMiEm29)
 
 [conference of translating platform 三藏翻译会议简报](https://www.youtube.com/playlist?list=PL_1iJBQvNPFHT6UisME_cOSts5fFecK14)
 
@@ -38,41 +43,47 @@ Due to the unstable connection the online video conference had been influnced, o
 [collection of conference papers 会议文集](https://drive.google.com/file/d/1CDPKLXMUX30IXc27BeNleHI3uI5OhsFL/view?usp=sharing)(2020.2.12-14)
 
 # Summary of Database 数据库总体描述
+
 ## 不包含用户数据的
-* 字典数据库
-  * 标准字典(逐词解析下拉菜单用的字典数据)
-    * 第三方字典
-    appdata\dict\3rd
-    * 标准变形
-    appdata\dict\system\sys_regular.db
-    * 非标准变形
-    appdata\dict\system\sys_regular.db
-  * 参考字典(字典模块用的字典数据)
-* 三藏全文 Full Text of nonPali Canon
-  * 逐词解析模板 Word By Word Translation
+
+- 字典数据库
+  - 标准字典(逐词解析下拉菜单用的字典数据)
+    - 第三方字典
+      appdata\dict\3rd
+    - 标准变形
+      appdata\dict\system\sys_regular.db
+    - 非标准变形
+      appdata\dict\system\sys_regular.db
+  - 参考字典(字典模块用的字典数据)
+- 三藏全文 Full Text of nonPali Canon
+  - 逐词解析模板 Word By Word Translation
     appdata/palicaono/templet
-  * 单词索引 Pali Canon Word Index
-  * 句子数据 Pali Canon Sentence
+  - 单词索引 Pali Canon Word Index
+  - 句子数据 Pali Canon Sentence
     appdata/palicaono/sentence.db3
-  * 段落数据 Pali Canon Paragraph
+  - 段落数据 Pali Canon Paragraph
     appdata/palicaono/pali_text.db3
+
 ## 包含用户数据 Include User Data
-* User Infomation用户
-* File Index文件目录
-* Dynamic User Dictionary动态用户词典
-* Word by Word Analyze逐词解析
-* Translation by Sentence逐句翻译
-* Term术语
-* [db manager(temporary) 数据库管理器(临时)](https://www.wikipali.org/demo/app/studio/dictadmin/user/pla.php)
-  
+
+- User Infomation 用户
+- File Index 文件目录
+- Dynamic User Dictionary 动态用户词典
+- Word by Word Analyze 逐词解析
+- Translation by Sentence 逐句翻译
+- Term 术语
+- [db manager(temporary) 数据库管理器(临时)](https://www.wikipali.org/demo/app/studio/dictadmin/user/pla.php)
+
 # Import Pali Canon Data From HTML 基础三藏数据导入
-(discription unfinished描述未完成) 
 
-# User Center 用户管理 
+(discription unfinished 描述未完成)
+
+# User Center 用户管理
 
 ## 功能
 
 ## 数据结构
+
 ```
 CREATE TABLE user (
     id       INTEGER    PRIMARY KEY AUTOINCREMENT,
@@ -86,23 +97,23 @@ CREATE TABLE user (
 
 ```
 
-| Field name | Type | Summary |
-| --- | --- | --- |
-| id | INTEGER    PRIMARY KEY AUTOINCREMENT, | |
-| userid | TEXT       UNIQUE, | uuid |
-| username | TEXT (64)  NOT NULL, | |
-| password | TEXT       NOT NULL, | |
-| nickname | TEXT (64)  NOT NULL, | |
-| email | TEXT (256), | |
-| ctime | INTEGER | 创建时间 |
+| Field name | Type                               | Summary  |
+| ---------- | ---------------------------------- | -------- |
+| id         | INTEGER PRIMARY KEY AUTOINCREMENT, |          |
+| userid     | TEXT UNIQUE,                       | uuid     |
+| username   | TEXT (64) NOT NULL,                |          |
+| password   | TEXT NOT NULL,                     |          |
+| nickname   | TEXT (64) NOT NULL,                |          |
+| email      | TEXT (256),                        |          |
+| ctime      | INTEGER                            | 创建时间 |
 
 ## 算法
 
 ## demo
 
-[login登录](https://www.wikipali.org/demo/app/ucenter/index.php?language=en)
+[login 登录](https://www.wikipali.org/demo/app/ucenter/index.php?language=en)
 
-[Sign in注册](https://www.wikipali.org/demo/app/ucenter/index.php?language=en&op=new)
+[Sign in 注册](https://www.wikipali.org/demo/app/ucenter/index.php?language=en&op=new)
 
 # File Manager
 
@@ -112,53 +123,53 @@ user/fileindex.db
 
 ## 数据结构
 
-| field name | type | summary |
-| --- | --- | --- |
-| id | INTEGER PRIMARY KEY AUTOINCREMENT, | 整数不方便离线建立数据的在线同步,以后将用doc_id |
-| userid | INTEGER, | |
-| parent_id | TEXT (40), | 从其他共享文档拉取的文档,有父文档的id |
-| doc_id | TEXT (40), | 文档uuid |
-| book | INTEGER DEFAULT (0), | 书号 1-217 |
-| paragraph | INTEGER DEFAULT (0), | 段落号 |
-| file_name | TEXT NOT NULL, | 文件名 |
-| title | TEXT, | 标题 |
-| tag | TEXT, | 标签 过滤文档用 |
-| status | INTEGER DEFAULT (1), | 状态 0 回收站 1 正常 |
-| create_time | INTEGER, | 建立时间 |
-| modify_time | INTEGER, | 修改时间 |
-| accese_time | INTEGER, | 访问时间 |
-| file_size | INTEGER, | 文件大小 |
-| share | INTEGER DEFAULT (0), | 是否是共享文档 0 否 1 是 |
-| doc_info | TEXT, | (json) |
-| doc_block | TEXT, | (json) |
-| receive_time | INTEGER | |
+| field name   | type                               | summary                                           |
+| ------------ | ---------------------------------- | ------------------------------------------------- |
+| id           | INTEGER PRIMARY KEY AUTOINCREMENT, | 整数不方便离线建立数据的在线同步,以后将用 doc_id |
+| userid       | INTEGER,                           |                                                   |
+| parent_id    | TEXT (40),                         | 从其他共享文档拉取的文档,有父文档的 id           |
+| doc_id       | TEXT (40),                         | 文档 uuid                                         |
+| book         | INTEGER DEFAULT (0),               | 书号 1-217                                        |
+| paragraph    | INTEGER DEFAULT (0),               | 段落号                                            |
+| file_name    | TEXT NOT NULL,                     | 文件名                                            |
+| title        | TEXT,                              | 标题                                              |
+| tag          | TEXT,                              | 标签 过滤文档用                                   |
+| status       | INTEGER DEFAULT (1),               | 状态 0 回收站 1 正常                              |
+| create_time  | INTEGER,                           | 建立时间                                          |
+| modify_time  | INTEGER,                           | 修改时间                                          |
+| accese_time  | INTEGER,                           | 访问时间                                          |
+| file_size    | INTEGER,                           | 文件大小                                          |
+| share        | INTEGER DEFAULT (0),               | 是否是共享文档 0 否 1 是                          |
+| doc_info     | TEXT,                              | (json)                                            |
+| doc_block    | TEXT,                              | (json)                                            |
+| receive_time | INTEGER                            |                                                   |
 
 用户文件索引。用于用户文件管理。所有用户用一张表。
 
 ## 文件存储方式
 
-1. xml文件
+1. xml 文件
 2. 数据库
 
-### xml文件
+### xml 文件
 
-扩展名pcs。保存在 user/user-uuid/my_document  
-文件格式见[Document Format文档格式](#document-format文档格式)
+扩展名 pcs。保存在 user/user-uuid/my_document  
+文件格式见[Document Format 文档格式](#document-format文档格式)
 
 ### 数据库
 
-使用数据库中的记录在服务器端生成相同的xml数据,并传送到浏览器。文件头使用doc_info字段。doc_block是数据块列表。
-从两个数据库中提取doc_block数据.详情见[database to memory XML Data](#new-method--database-to-memory-xml-data)
+使用数据库中的记录在服务器端生成相同的 xml 数据,并传送到浏览器。文件头使用 doc_info 字段。doc_block 是数据块列表。
+从两个数据库中提取 doc_block 数据.详情见[database to memory XML Data](#new-method--database-to-memory-xml-data)
 
 **以后的程序使用数据库方式。可以实现网路同步等功能。**
 
-# Studio编辑器
+# Studio 编辑器
 
-(discription unfinished描述未完成)
+(discription unfinished 描述未完成)
 
-[demo链接link](https://www.wikipali.org/demo/app/studio)
+[demo 链接 link](https://www.wikipali.org/demo/app/studio)
 
-## Document Format文档格式
+## Document Format 文档格式
 
 XML format use for the editable data.
 
@@ -185,18 +196,18 @@ studio/js/data.js is document manager
 
 ```
 
-* type:aways pcdsset
-* mode:aways package
-* var:varsion
-* toc:not used
-* style:Document css. css only for this Document
-* block: one block is one paragraph on one Media Type. Two Kinds of Type. 1. wbw(word by word translation) 2. translate 
+- type:aways pcdsset
+- mode:aways package
+- var:varsion
+- toc:not used
+- style:Document css. css only for this Document
+- block: one block is one paragraph on one Media Type. Two Kinds of Type. 1. wbw(word by word translation) 2. translate
 
 ```
 <block>
 	<info>
 		<type>heading</type>
-		<book>85</book>		
+		<book>85</book>
 		<paragraph>11</paragraph>
 		<album_id>85</album_id>
 		<album_guid>4FC0BE7B1C3042B79742D7D5BA90E77A</album_guid>
@@ -213,24 +224,24 @@ studio/js/data.js is document manager
 </block>
 
 ```
-* type
-  * heading
-  * pali_text
-  * translate
-  * wbw (word by word translation)
-* level 目录层级
-* id 数据块uuid 
 
-## Document Load 文档载入 
+- type
+  - heading
+  - pali_text
+  - translate
+  - wbw (word by word translation)
+- level 目录层级
+- id 数据块 uuid
 
-(discription unfinished描述未完成)
+## Document Load 文档载入
 
+(discription unfinished 描述未完成)
 
 ### Old Method —— XML File
 
 数据载入:studio/project_load.php
 
-js数据解析:studio/js/data.js 
+js 数据解析:studio/js/data.js
 function projectDataParse(xmlBookData)
 
 ### New Method —— database to memory XML Data
@@ -239,7 +250,7 @@ function projectDataParse(xmlBookData)
 
 #### 逐词解析数据库
 
-数据库user/user_wbw.db3
+数据库 user/user_wbw.db3
 数据块头信息
 
 ```
@@ -272,11 +283,11 @@ CREATE TABLE wbw (
     modify_time  INTEGER,
     receive_time INTEGER,
     status       INTEGER,
-    owner        CHAR (36) 
+    owner        CHAR (36)
 );
 ```
 
-data:xml格式单词数据
+data:xml 格式单词数据
 
 #### 译文数据库
 
@@ -297,7 +308,9 @@ CREATE TABLE sent_block (
 );
 
 ```
+
 句子内容。一条记录是一句。
+
 ```
 
 CREATE TABLE sentence (
@@ -319,10 +332,11 @@ CREATE TABLE sentence (
 );
 ```
 
-* begin:句子起始单词索引
-* end:句子终止单词索引
-* 
-## Edit Word by Word Translation 逐词解析编辑 
+- begin:句子起始单词索引
+- end:句子终止单词索引
+-
+
+## Edit Word by Word Translation 逐词解析编辑
 
 ## 用户词典
 
@@ -350,12 +364,12 @@ CREATE TABLE sentence (
 
 ### 文件列表
 
-* term\
-  * note.js - 生成注释
-  * note.php - 
-  * sync.php - 与internet或其他主机同步数据
-  * term.js
-  * term.php-术语数据库新增,修改,等
+- term\
+  - note.js - 生成注释
+  - note.php -
+  - sync.php - 与 internet 或其他主机同步数据
+  - term.js
+  - term.php-术语数据库新增,修改,等
 
 ### 数据结构
 
@@ -378,24 +392,24 @@ CREATE TABLE term (
 );
 ```
 
-term 
-
-| field name | type | summary |
-| --- | --- | --- |
-| id | INTEGER   PRIMARY KEY AUTOINCREMENT | 以后会停用,改为uuid |
-| guid | TEXT (36) | uuid |
-| word | TEXT | pali词头 |
-| word_en | TEXT | 英文字母表示,ā->a ṭ->t用于模糊搜索 |
-| meaning | TEXT | 首选意思 |
-| other_meaning | TEXT | 备选意思 |
-| note | TEXT | 注解内容 |
-| tag | TEXT | 标签 |
-| create_time | INTEGER | * |
-| owner | TEXT | * |
-| hit | INTEGER   DEFAULT (0) | 点击量 |
-| language | CHAR (8) | * |
-| receive_time | INTEGER | 服务器接收到数据的时间 |
-| modify_time | INTEGER | * |
+term
+
+| field name    | type                              | summary                              |
+| ------------- | --------------------------------- | ------------------------------------ |
+| id            | INTEGER PRIMARY KEY AUTOINCREMENT | 以后会停用,改为 uuid                |
+| guid          | TEXT (36)                         | uuid                                 |
+| word          | TEXT                              | pali 词头                            |
+| word_en       | TEXT                              | 英文字母表示,ā->a ṭ->t 用于模糊搜索 |
+| meaning       | TEXT                              | 首选意思                             |
+| other_meaning | TEXT                              | 备选意思                             |
+| note          | TEXT                              | 注解内容                             |
+| tag           | TEXT                              | 标签                                 |
+| create_time   | INTEGER                           | \*                                   |
+| owner         | TEXT                              | \*                                   |
+| hit           | INTEGER DEFAULT (0)               | 点击量                               |
+| language      | CHAR (8)                          | \*                                   |
+| receive_time  | INTEGER                           | 服务器接收到数据的时间               |
+| modify_time   | INTEGER                           | \*                                   |
 
 ### 算法
 
@@ -403,15 +417,14 @@ term
 
 ## Plugin 插件
 
-(discription unfinished描述未完成)
+(discription unfinished 描述未完成)
 
-# Dictionary字典
+# Dictionary 字典
 
 ## demo
 
 https://www.wikipali.org/demo/app/dict/index.php
 
-
 ## 数据结构
 
 ### 标准字典
@@ -435,27 +448,26 @@ CREATE TABLE dict (
 );
 ```
 
-| Field name | Type | Summary |
-| --- | --- | --- |
-| id | INTEGER | --- |
-| pali | TEXT     NOT NULL | 巴利单词 |
-| type | TEXT | --- |
-| gramma | TEXT | --- |
-| parent | TEXT | --- |
-| mean | TEXT | 释义 |
-| note | TEXT | --- |
-| parts | TEXT | --- |
-| partmean | TEXT | --- |
-| status | INTEGER  DEFAULT (1) | --- |
-| confidence | INTEGER  DEFAULT (100) | 信心指数 1-100 |
-| len | INTEGER | 单词长度 |
-| dict_name | TEXT | 字典名 |
-| lang | CHAR (3) DEFAULT sc | 语言 |
+| Field name | Type                  | Summary        |
+| ---------- | --------------------- | -------------- |
+| id         | INTEGER               | ---            |
+| pali       | TEXT NOT NULL         | 巴利单词       |
+| type       | TEXT                  | ---            |
+| gramma     | TEXT                  | ---            |
+| parent     | TEXT                  | ---            |
+| mean       | TEXT                  | 释义           |
+| note       | TEXT                  | ---            |
+| parts      | TEXT                  | ---            |
+| partmean   | TEXT                  | ---            |
+| status     | INTEGER DEFAULT (1)   | ---            |
+| confidence | INTEGER DEFAULT (100) | 信心指数 1-100 |
+| len        | INTEGER               | 单词长度       |
+| dict_name  | TEXT                  | 字典名         |
+| lang       | CHAR (3) DEFAULT sc   | 语言           |
 
 ### 参考字典
 
-
-# Full Text Search全文搜索
+# Full Text Search 全文搜索
 
 ## Demo
 
@@ -467,7 +479,7 @@ https://www.wikipali.org/demo/app/search/index.php
 
 ## 算法
 
-# Encyclopedia百科
+# Encyclopedia 百科
 
 ## Demo
 
@@ -481,5 +493,3 @@ https://www.wikipali.org/demo/app/search/index.php
 
 base on the Term Database.
 基于术语数据库
-
-

+ 38 - 0
app/article/article.js

@@ -0,0 +1,38 @@
+var _articel_id = "";
+var _channal = "";
+var _lang = "";
+var _author = "";
+var _display = "";
+
+function articel_load(id) {
+  if (id == "") {
+    return;
+  }
+  $.get(
+    "../article/get.php",
+    {
+      id: id,
+      setting: "",
+    },
+    function (data, status) {
+      if (status == "success") {
+        try {
+          let result = JSON.parse(data);
+          if (result) {
+            $("#article_title").html(result.title);
+            $("#article_subtitle").html(result.subtitle);
+            $("#article_author").html(
+              result.username.nickname + "@" + result.username.username
+            );
+            $("#contents").html(note_init(result.content));
+            note_refresh_new();
+          }
+        } catch (e) {
+          console.error(e);
+        }
+      } else {
+        console.error("ajex error");
+      }
+    }
+  );
+}

+ 26 - 0
app/article/get.php

@@ -0,0 +1,26 @@
+<?php
+//查询term字典
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+
+if(isset($_GET["id"])){
+    PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
+    $id=$_GET["id"];
+    $query = "select * from article  where id = ".$PDO->quote($id);
+    $Fetch = PDO_FetchRow($query);
+    if($Fetch){
+        $userinfo = new UserInfo();
+        $user = $userinfo->getName($Fetch["owner"]);
+        $Fetch["username"] = $user;
+        echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
+        exit;
+    }
+}
+
+echo json_encode(array(), JSON_UNESCAPED_UNICODE);	
+
+?>

+ 398 - 0
app/article/index.php

@@ -0,0 +1,398 @@
+<?php
+require_once "../public/load_lang.php";
+require_once "../path.php";
+
+?>
+
+<?PHP
+include "../pcdl/html_head.php";
+?>
+<body style="margin: 0;padding: 0;" class="reader_body" >
+	<script src="../term/term.js"></script>
+	<script src="../term/note.js"></script>
+	<script src="./article.js"></script>
+	<script>
+	<?php
+	$_id = "";
+	$_display = "";
+	$_channal  = "";
+
+	if(isset($_GET["id"])){
+		echo "_articel_id='".$_GET["id"]."';";
+	}
+	if(isset($_GET["display"])){
+		echo "_display='".$_GET["display"]."';";
+	}
+	if(isset($_GET["channal"])){
+		echo "_channal='".$_GET["channal"]."';";
+	}
+	if(isset($_GET["lang"])){
+		echo "_lang='".$_GET["lang"]."';";
+	}
+	if(isset($_GET["author"])){
+		echo "_author='".$_GET["author"]."';";
+	}
+	?>
+	</script>
+	<style>
+	body{
+		font-size:12pt;
+	}
+	.term_link,.term_link_new{
+		color: blue;
+		padding-left: 2px;
+		padding-right: 2px;
+	}
+	.term_link_new{
+		color:red;
+	}
+	#search_result{
+		position: absolute;
+		background: wheat;
+		max-width: 95%;
+		width: 24em;
+	}
+	note:hover chapter{
+		display:inline;
+	} 
+	.ref>chapter:first-child{
+		display:inline;
+	}
+	chapter{
+		display:none;
+		color: var(--box-bg-color1);
+		text-decoration: none;
+		cursor: pointer;
+	}
+	chapter:hover{
+		color: var(--link-color);
+		text-decoration: underline;
+	}
+	para{
+		background-color: var(--drop-bg-color);
+		padding: 2px 8px;
+		text-decoration: none;
+		cursor: pointer;
+		color: var(--btn-border-color);
+		border-radius: 5px;
+	}
+	para:hover{
+		text-decoration: underline;
+	}
+	.icon{
+		width: 15px;
+		height: 15px;
+	}
+	.submenu_title{
+		font-size: 120%;
+		font-weight: 700;		
+	}
+	.term_word_head_pali {
+		text-transform: capitalize;
+		font-size: 200%;
+		margin: 0.5em 0;
+	}
+	.term_word_head{
+		border-bottom: 1px solid #cecece;
+		padding: 5px 0;
+	}
+	.term_block{
+		border-bottom: 1px solid #cecece;
+		padding: 5px 0;
+	}
+	.term_word_head_authors a{
+		color: blue;
+		margin: 0 3px;
+	}
+	.term_word_head_authors a:hover{
+		text-decoration: underline;
+		cursor: pointer;
+	}
+
+	note .ref{
+		text-align: right;
+		padding: 5px;
+		font-size: 75%;
+		margin-top: 8px;
+	}
+	note{
+		background-color: #80808014;
+		padding: 0.5em 0.8em;
+		margin-bottom: 0.4em;
+		border-radius: 5px;
+		line-height:1.3em;
+		<?php
+		if(isset($_GET["display"]) && $_GET["display"]=="para"){
+			echo "display:inline;";
+		}
+		else{
+			echo "display:block;";
+		}
+		?>
+	}
+	note>.tran{
+		color: #5c5c5c;
+		padding-left: 1em;
+	}
+	note>.palitext , .palitext{
+		font-family: Noto serif;
+		line-height: 1.5em;
+		color: #9f3a01;
+		font-weight: 500;
+	}
+	note>.palitext>note{
+		display:inline;
+		color:blue;
+		background-color: unset;
+		padding: unset;
+		margin-bottom: unset;
+		border-radius: unset;
+	}
+
+
+	.term_block_bar {
+		display: flex;
+		justify-content: space-between;
+	}
+	#head_bar{
+		display: flex;
+    justify-content: space-between;
+    height: 5em;
+    background-color: var(--bookx);
+    border-bottom: 1px solid var(--tool-line-color);
+	}
+	.term_block_bar_left{
+		display: flex;
+	}
+	.term_block_bar_left_icon{
+    display: inline-block;
+    width: 1.5em;
+    text-align: center;
+    height: 1.5em;
+    background-color: gray;
+    font-size: 180%;
+    color: white;
+    border-radius: 99px;
+	}
+	.term_block_bar_left_info{
+		    padding-left: 8px;
+	}
+	.term_meaning{
+		font-weight: 700;
+	}
+	.term_author{
+		font-size: 80%;
+		color: gray;
+	}
+	.term_tag{
+		font-size: 80%;
+		font-weight: 500;
+		margin: 0 8px;
+	}
+	.term_link {
+    cursor: pointer;
+	}
+	.main_view{
+		padding: 0 1em;
+		max-width: 1280px;
+		margin-left: auto;
+		margin-right: auto;
+	}
+	#term_list_right{
+		width: 25em;
+	}
+	#term_list{
+		width: 100%;
+		padding: 0.5em;
+	}
+	#term_list_div{
+		display: flex;
+		justify-content: space-between;
+	}
+	.fun_frame {
+		border-bottom: 1px solid gray;
+		margin-right: 10px;
+		margin-bottom: 10px;
+	}
+	.fun_frame>.title{
+		padding:6px;
+		font-weight: 700;
+	}
+	.fun_frame>.content{
+		padding:6px;
+		max-height:6em;
+		overflow-y: scroll;
+	}
+	
+	.fixed{
+		position:fixed;
+		right: 0;
+    	top: 0;
+	}
+	.when_right_fixed{
+		padding-right:20em;
+	}
+	.bg_color_1{
+		background-color:#ebebeb66;
+	}
+	.bg_color_2{
+		background:linear-gradient(to right, #6afdb033, #ebebeb66);
+	}
+	.bg_color_3{
+		background:linear-gradient(to right, #6a95fd26, #ebebeb66);
+	}
+	.bg_color_4{
+		background:linear-gradient(to right, #f9e7911c, #ebebeb66);
+	}
+	.bg_color_5{
+		background:linear-gradient(to right, #fe99b91c, #ebebeb66);
+	}
+
+	pre {
+		white-space: pre-line;
+		font-family: auto;
+		border-left: 3px solid var(--border-shadow);
+		margin-left: 1em;
+		padding-left: 0.5em;
+	}
+	#contents_view{
+		display:flex;
+	}
+	#contents{
+		flex:7;
+	}
+	#right_pannal{
+		flex:3;
+		max-width:20em;
+	}
+	#head_bar{
+		height:unset;
+	}
+
+<?php
+		if(isset($_GET["display"]) && $_GET["display"]=="para"){
+?>
+	.tran>p{
+		display:inline;
+	}
+	note{
+		padding: 2px;
+		margin-bottom: unset;
+	}
+<?php
+		}
+?>
+
+	</style>
+
+<style media="screen and (max-width:767px)">
+#right_pannal{
+	display:none;
+}
+.when_right_fixed{
+	padding-right:0;
+}
+.index_toolbar{
+		position:unset;
+	}
+	#pali_pedia{
+		font-size: 200%;
+    margin-top: auto;
+    margin-bottom: auto;
+    padding-left: 0.5em;
+	}
+</style>
+
+<script>
+term_word_link_fun("wiki_goto_word");
+</script>
+
+<?php
+    require_once("../pcdl/head_bar.php");
+?>
+<div id="head_bar" >
+	<div id="pali_pedia" style="display:flex;">
+		<span>文集</span>
+	</div>
+
+	<div>
+		<span>
+		<?php
+		echo "<a href='../article/?id=".$_GET["id"];
+		echo "&display=para";
+		echo "'>[逐段]</a>";
+		echo "<a href='../article/?id=".$_GET["id"];
+		echo "&display=sent";
+		echo "'>[逐句]</a>";
+		?>
+			<a href="#">[帮助]</a>
+		</span>
+	</div>
+</div>
+<div id="main_view" class="main_view">
+<div id="article_head" style="border-bottom: 1px solid gray;">
+	<div id="article_title" class="term_word_head_pali">Title</div>
+	<div id="article_subtitle">Subtitle</div>
+	<div id="article_author">author</div>
+</div>
+<div id="contents_view">
+	<div id="contents" style="padding: 0 1em;">
+	loading...
+	</div>
+	<div id="right_pannal">
+		<div class="fun_frame">
+			<div class="title">About Author</div>
+			<div class="content" style="max-height:10em;">
+			</div>
+		</div>
+		<div class="fun_frame">
+			<div class="title">Table of Content</div>
+			<div class="content" style="max-height:10em;">
+			</div>
+		</div>
+		<div class="fun_frame">
+			<div class="title">Other Authors</div>
+			<div class="content" style="max-height:10em;">
+			</div>
+		</div>
+	</div>
+</div>
+</div>
+<script>
+	articel_load(_articel_id);
+
+	 window.addEventListener('scroll',winScroll);
+	function winScroll(e){ 
+		if(GetPageScroll().y>220){
+
+		}
+		else{
+
+		}
+		
+	}
+ //滚动条位置
+function GetPageScroll() 
+{ 
+	var pos=new Object();
+	var x, y; 
+	if(window.pageYOffset) 
+	{	// all except IE	
+		y = window.pageYOffset;	
+		x = window.pageXOffset; 
+	} else if(document.documentElement && document.documentElement.scrollTop) 
+	{	// IE 6 Strict	
+		y = document.documentElement.scrollTop;	
+		x = document.documentElement.scrollLeft; 
+	} else if(document.body) {	// all other IE	
+		y = document.body.scrollTop;	
+		x = document.body.scrollLeft;   
+	} 
+	pos.x=x;
+	pos.y=y;
+	return(pos);
+}
+	</script>
+
+</body>
+</html>

+ 28 - 0
app/article/list.php

@@ -0,0 +1,28 @@
+<?php
+//查询term字典
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+
+if(isset($_GET["userid"])){
+    PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
+    $userid=$_GET["userid"];
+    $query = "SELECT * from article  where owner = ".$PDO->quote($userid)." and status <> 0 order by modify_time DESC";
+    $Fetch = PDO_FetchAll($query);
+    if($Fetch){
+        /*
+        $userinfo = new UserInfo();
+        $user = $userinfo->getName($Fetch["owner"]);
+        $Fetch["username"] = $user;
+        */
+        echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
+        exit;
+    }
+}
+
+echo json_encode(array(), JSON_UNESCAPED_UNICODE);	
+
+?>

+ 35 - 0
app/article/list_new.php

@@ -0,0 +1,35 @@
+<?php
+//
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/load_lang.php';
+require_once '../ucenter/function.php';
+
+global $PDO;
+PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
+$query = "select * from article where 1  order by create_time DESC limit 0,4";
+$Fetch = PDO_FetchAll($query);
+
+foreach($Fetch as $row){
+    echo '<div class="content_block">';
+    echo '<div class="card">';
+
+    echo '<div class="pd-10">';
+    echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../article/?id='.$row["id"].'&display=para">'.$row["title"].'</a></div>';
+    echo '<div class="summary"  style="padding-bottom:5px;color: #ad4b00;">'.$row["subtitle"].'</div>';
+    echo '<div class="author"  style="padding-bottom:5px;margin-bottom:0.4em;">';
+    echo '<a href="../uhome/course.php?userid='.$row['owner'].'">';
+    echo ucenter_getA($row["owner"]);
+    echo '</a>';
+    echo '</div>';    
+    echo '<div class="summary"  style="padding-bottom:5px;height: 4.5em;line-height: 1.5em;overflow-y: hidden;">'.$row["summary"].'</div>';
+    echo '</div>';
+    echo '<div class="pd-10" style="display:flex;justify-content: space-between;">';
+    echo '</div>';
+    
+    echo '</div>';
+    echo '</div>';
+}
+
+?>

+ 33 - 0
app/article/my_article.js

@@ -0,0 +1,33 @@
+function my_article_list() {
+  $.get(
+    "../article/list.php",
+    {
+      userid: getCookie("userid"),
+      setting: "",
+    },
+    function (data, status) {
+      if (status == "success") {
+        try {
+          let html = "";
+          let result = JSON.parse(data);
+          let key = 1;
+          for (const iterator of result) {
+            html += '<div class="file_list_row" style="padding:5px;">';
+            html +=
+              '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
+            html += "<div style='flex:1;'>" + key++ + "</div>";
+            html += "<div style='flex:2;'>" + iterator.title + "</div>";
+            html += "<div style='flex:2;'>" + "</div>";
+            html += "<div style='flex:1;'>15</div>";
+            html += "</div>";
+          }
+          $("#article_list").html(html);
+        } catch (e) {
+          console.error(e);
+        }
+      } else {
+        console.error("ajex error");
+      }
+    }
+  );
+}

+ 38 - 0
app/article/my_article_index.php

@@ -0,0 +1,38 @@
+<?php
+require_once '../studio/index_head.php';
+?>
+<body id="file_list_body" onLoad="my_article_list()">
+
+	<script language="javascript" src="../article/my_article.js"></script>
+	<script >
+	var gCurrPage="article";
+	</script>
+
+	<style>
+	#article {
+		background-color: var(--btn-border-color);
+		
+	}
+	#article:hover{
+		background-color: var(--btn-border-color);
+		color: var(--btn-color);
+		cursor:auto;
+	}
+	</style>
+
+	<?php
+	require_once '../studio/index_tool_bar.php';
+	?>
+		
+	<div class="index_inner" style="margin-left: 18em;margin-top: 5em;display:flex;">
+		<div id="article_list"  class="file_list_block" style="flex:3;">
+
+		</div>
+        <div style="flex:3;"></div>
+        <div style="flex:4;"></div>
+	</div>
+	
+<?php
+require_once '../studio/index_foot.php';
+?>
+

+ 0 - 0
app/article/my_collect_index.php


+ 1 - 0
app/path.php

@@ -69,5 +69,6 @@ define("_FILE_DB_MESSAGE_"  , __DIR__."/../tmp/user/message.db");
 define("_FILE_DB_USER_STATISTICS_"  , __DIR__."/../tmp/user/statistics.db3");
 define("_FILE_DB_CHANNAL_"  , __DIR__."/../tmp/user/channal.db3");
 define("_FILE_DB_USER_DICT_"  , __DIR__."/../tmp/user/udict.db3");
+define("_FILE_DB_USER_ARTICLE_"  , __DIR__."/../tmp/user/article.db3");
 
 ?>

+ 9 - 33
app/pcdl/index.php

@@ -55,43 +55,19 @@ require_once '../pcdl/html_head.php';
 			<span class="title_more"><a href="../palicanon">更多</a></span>
 		</div>
 		<div class="content">
-			<div class="content_inner">
-				<div class="content_block">
-					<div class="card">
+			<div id="article_new" class="content_inner">
 
-						<div class="title"><a href="#">Khudasikha</a></div>
-						<div class="summary">概要</div>
-						<div class="author">作者</div>
-					</div>
-				</div>
-				<div class="content_block">
-					<div class="card">
-
-						<div class="title pd-10">标题</div>
-						<div class="summary pd-10">概要</div>
-						<div class="author pd-10">作者</div>
-					</div>
-				</div>
-				<div class="content_block">
-					<div class="card">
-
-						<div class="title">标题</div>
-						<div class="summary">概要</div>
-						<div class="author">作者</div>
-					</div>
-				</div>
-				<div class="content_block">
-					<div class="card">
-
-						<div class="title">标题</div>
-						<div class="summary">概要</div>
-						<div class="author">作者</div>
-					</div>
-				</div>
 			</div>
 		</div>
 	</div>
-    
+	<script>
+	$.get("../article/list_new.php",function(data,status){
+		let xDiv = document.getElementById("article_new");
+		if(xDiv){
+			xDiv.innerHTML=data;
+		}
+	});
+	</script>	
 	
 	<div class="index_list_categories">
 		<div class="title_bar">

+ 5 - 1
app/public/lang/default.json

@@ -53,7 +53,7 @@
 		"content": "Content",
 		"contents": "Contents",
 		"copy": "copy",
-		"copy_to_clipboard": "copy to clipboard",
+		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
 		"created": "Created",
 		"current": "Current",
@@ -484,6 +484,10 @@
 		"in_progress": "in progress",
 		"already_over": "already over",
 		"revise": "revise",
+		"relational_map": "relational map",
+		"pp": "past participle",
+		"prp": "present participle",
+		"fpp": "Future Passive Participle",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 1
app/public/lang/en.json

@@ -53,7 +53,7 @@
 		"content": "Content",
 		"contents": "Contents",
 		"copy": "copy",
-		"copy_to_clipboard": "copy to clipboard",
+		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
 		"created": "Created",
 		"current": "Current",
@@ -483,6 +483,10 @@
 		"in_progress": "in progress",
 		"already_over": "already over",
 		"revise": "revise",
+		"relational_map": "relational map",
+		"pp": "past participle",
+		"prp": "present participle",
+		"fpp": "Future Passive Participle",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 1
app/public/lang/my.json

@@ -53,7 +53,7 @@
 		"content": "Content",
 		"contents": "Contents",
 		"copy": "copy",
-		"copy_to_clipboard": "copy to clipboard",
+		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "Creat a new file by yourself",
 		"created": "Created",
 		"current": "Current",
@@ -483,6 +483,10 @@
 		"in_progress": "in progress",
 		"already_over": "already over",
 		"revise": "revise",
+		"relational_map": "relational map",
+		"pp": "past participle",
+		"prp": "present participle",
+		"fpp": "Future Passive Participle",
 		"": "",
 		"": ""
 	},

+ 5 - 1
app/public/lang/si.json

@@ -53,7 +53,7 @@
 		"content": "පටුන",
 		"contents": "අන්තර්ගතය",
 		"copy": "copy",
-		"copy_to_clipboard": "copy to clipboard",
+		"copy_to_clipboard": "copy the link to clipboard",
 		"creat_a_new_file_by_yourself": "ඔබ කැමති පරදි නව ගොනුව සාදන්න",
 		"created": "සාදන ලදි",
 		"current": "අලුත්ම",
@@ -488,6 +488,10 @@
 		"in_progress": "in progress",
 		"already_over": "already over",
 		"revise": "revise",
+		"relational_map": "relational map",
+		"pp": "past participle",
+		"prp": "present participle",
+		"fpp": "Future Passive Participle",
 		"": "",
 		"": ""
 	},

+ 5 - 1
app/public/lang/zh-cn.json

@@ -53,7 +53,7 @@
 		"content": "目录",
 		"contents": "目录",
 		"copy": "复制",
-		"copy_to_clipboard": "复制到剪切板",
+		"copy_to_clipboard": "复制句子链接到剪切板",
 		"creat_a_new_file_by_yourself": "创建自定义文档",
 		"created": "创建",
 		"current": "当前",
@@ -485,6 +485,10 @@
 		"in_progress": "正在进行",
 		"already_over": "已经结束",
 		"revise": "润校",
+		"relational_map": "关系图",
+		"pp": "过去分词",
+		"prp": "现在分词",
+		"fpp": "未来被动分词",
 		"": ""
 	},
 	"grammastr": [

+ 5 - 1
app/public/lang/zh-tw.json

@@ -53,7 +53,7 @@
 		"content": "目錄",
 		"contents": "目錄",
 		"copy": "複製",
-		"copy_to_clipboard": "複製到剪下板",
+		"copy_to_clipboard": "複製句子連結到剪下板",
 		"creat_a_new_file_by_yourself": "新建自定檔案",
 		"created": "建立",
 		"current": "當前",
@@ -485,6 +485,10 @@
 		"in_progress": "正在進行",
 		"already_over": "已經結束",
 		"revise": "潤校",
+		"relational_map": "關係圖",
+		"pp": "過去分詞",
+		"prp": "現在分詞",
+		"fpp": "未來被動分詞",
 		"": ""
 	},
 	"grammastr": [

File diff suppressed because it is too large
+ 507 - 505
app/studio/css/style.css


+ 28 - 26
app/studio/editor.php

@@ -60,7 +60,7 @@ else{$currDevice="computer";}
 	<script language="javascript" src="../public/js/comm.js"></script>
 	<script language="javascript" src="../public/js/localforage.min.js"></script>
 	<script language="javascript" src="../public/script/my.js"></script>
-
+	<script src="../public/js/mermaid.min.js"></script>
 	
 	<script language="javascript" src="module/editor/language/default.js"></script>	
 	<script src="js/jquery-3.3.1.min.js"></script>
@@ -682,7 +682,7 @@ foreach($plugin_list as $info){
 					function edit_show_prt_prt(obj){
 						let o = obj.getElementsByTagName("svg");
 						if(document.getElementById("edit_detail_prt_prt").style.display=="none"){
-							document.getElementById("edit_detail_prt_prt").style.display="flex";
+							document.getElementById("edit_detail_prt_prt").style.display="block";
 							o[0].style.transform="rotate(90deg)";
 						}
 						else{
@@ -692,7 +692,7 @@ foreach($plugin_list as $info){
 					}
 					
 					function edit_parent_grammar_changed(obj){
-						let val = obj.innerHTML;
+						let val = obj;
 						document.getElementById("parent_grammar").innerHTML=val;
 					}
 				</script>
@@ -713,24 +713,33 @@ foreach($plugin_list as $info){
 				</div>
 				<!-- 词源 -->
 				<div id="edit_detail_prt_prt" class="edit_detail_p" style="display:none;">
-				<guide gid="studio_parent2"></guide>
-					<div class="case_dropdown" style="padding-left: 2em;width: 6em;display: flex;">
-						<span style="padding-right: 4px;">┕</span>
-						<span id="parent_grammar">.ppa.</span>
-						<div id="word_mdf_prt_prt_grammar_dropdown" class="case_dropdown-content">
-							<a onclick="edit_parent_grammar_changed(this)">.pp.</a>
-							<a onclick="edit_parent_grammar_changed(this)">.prp.</a>				
-							<a onclick="edit_parent_grammar_changed(this)">.fpp.</a>
+					<span style="display:flex;">
+						<guide gid="studio_parent2"></guide>
+						<div class="case_dropdown" style="padding-left: 2em;width: 6em;display: flex;">
+							<span style="padding-right: 4px;">┕</span>
+							<span id="parent_grammar">.ppa.</span>
+							<div id="word_mdf_prt_prt_grammar_dropdown" class="case_dropdown-content">
+								<a onclick="edit_parent_grammar_changed('.pp.')"><?php echo $_local->gui->pp; ?></a>
+								<a onclick="edit_parent_grammar_changed('.prp.')"><?php echo $_local->gui->prp; ?></a>				
+								<a onclick="edit_parent_grammar_changed('.fpp.')"><?php echo $_local->gui->fpp; ?></a>
+							</div>
 						</div>
-					</div>
-					<input type="text" id="id_text_prt_prt" class="input_bar" onkeydown="match_key(this)" onkeyup="unicode_key(this)" />
-					<div class="case_dropdown">
-						<svg class="edit_icon">
-							<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="svg/icon.svg#ic_more"></use>
-						</svg>
-						<div id="word_mdf_prt_prt_dropdown" class="case_dropdown-content">
+						<input type="text" id="id_text_prt_prt" class="input_bar" onkeydown="match_key(this)" onkeyup="unicode_key(this)" />
+						<div class="case_dropdown">
+							<svg class="edit_icon">
+								<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="svg/icon.svg#ic_more"></use>
+							</svg>
+							<div id="word_mdf_prt_prt_dropdown" class="case_dropdown-content">
+							</div>
 						</div>
-					</div>				
+					</span>
+					<div>
+						<?php echo $_local->gui->relation; ?>
+						<imput type="hidden" id="id_relation_text" value="" />
+						<button onclick="rela_add_word()">+</button>
+						<div id="relation_div">
+						</div>
+					</div>
 				</div>
 				
 			</div>
@@ -786,13 +795,6 @@ foreach($plugin_list as $info){
 				<input type="input" id="id_text_pali" onkeydown="match_key(this)" onkeyup="unicode_key(this)" /><br/>
 				<?php echo $_local->gui->spell;?><br />
 				<input type="input" id="id_text_real"  onkeydown="match_key(this)" onkeyup="unicode_key(this)" /><br/>
-				<?php echo $_local->gui->relation;?><br />
-				<div id="relation_div">
-				</div>
-				<imput type="hidden" id="id_relation_text" value="" />
-				<button onclick="rela_add_word()">
-					+
-				</button>
 				<br/>
 			</div>
 			

+ 25 - 2
app/studio/index_tool_bar.php

@@ -105,9 +105,32 @@
 					</span>	
 					<span class="navi_text">
 					<?php echo $_local->gui->wiki_term;?>
-					
 					</span>
-				</li>				
+				</li>
+
+				<li id="article"  onclick="goto_url(this,'../article/my_article_index.php')">
+					<span  class="navi_icon">
+						<svg class="icon">
+							<use xlink:href="../studio/plugin/system_term/icon.svg#icon_term"></use>
+						</svg>	
+					</span>	
+					<span class="navi_text">
+					<?php echo "作品";?>
+					</span>
+				</li>
+
+				<li id="collect"  onclick="goto_url(this,'../article/my_collect_index.php')">
+					<span  class="navi_icon">
+						<svg class="icon">
+							<use xlink:href="../studio/plugin/system_term/icon.svg#icon_term"></use>
+						</svg>	
+					</span>	
+					<span class="navi_text">
+					<?php echo "文集";?>
+					</span>
+				</li>
+
+
 			</ul>
 		</div>
 		

+ 134 - 66
app/studio/js/render.js

@@ -429,7 +429,7 @@ function updataHeadingBlockInHtml(book, par) {
   }
 }
 
-function renderBlock() {}
+function renderBlock() { }
 /*
 重绘翻译数据块
 */
@@ -634,7 +634,7 @@ function renderTranslateParBlockInner(elementBlock) {
   return output;
 }
 
-function renderTranslateParBlockInnerPreview(strText) {}
+function renderTranslateParBlockInnerPreview(strText) { }
 function updateTranslationPreview_a(blockId, text) {
   var out = "";
   var newText = text;
@@ -1307,9 +1307,9 @@ function render_sent_tool_bar(elementBlock, begin) {
     sentIdString +
     "<a onclick=\"copy_to_clipboard('" +
     sentIdStringLink +
-    "')\">[";
-  output += gLocal.gui.copy_to_clipboard;
-  output += "]</a>";
+    "')\" title=" + gLocal.gui.copy_to_clipboard + ">";
+  output += '<svg style="fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 12px;" t="1601480724259" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4644" width="16" height="16"><path d="M791.272727 93.090909H139.636364v837.818182a93.090909 93.090909 0 0 1-93.090909-93.090909V93.090909a93.090909 93.090909 0 0 1 93.090909-93.090909h558.545454a93.090909 93.090909 0 0 1 93.090909 93.090909zM232.727273 186.181818h744.727272v837.818182H232.727273V186.181818z" p-id="4645"></path></svg>';
+  output += "</a>";
   //	output += "<span>"+abook+"-"+aparagraph+"-"+iBegin+"-"+iEnd+"</span>";
   if (_display_sbs == 0) {
     //逐段模式
@@ -1318,7 +1318,7 @@ function render_sent_tool_bar(elementBlock, begin) {
       abook +
       "&para=" +
       aparagraph +
-      "' target='_blank'>";
+      "' target='_blank' title='" + gLocal.gui.scan_in_reader + "'>";
   } else {
     //逐句模式
     output +=
@@ -1330,12 +1330,23 @@ function render_sent_tool_bar(elementBlock, begin) {
       iBegin +
       "&end=" +
       iEnd +
-      "' target='_blank'>";
+      "' target='_blank' title='" + gLocal.gui.scan_in_reader + "'>";
   }
-  output += "[" + gLocal.gui.scan_in_reader + "]";
+  output += '<svg style="fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 15px;" t="1601482753387" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22291" width="200" height="200"><path d="M703.730499 544.578527a191.730499 191.730499 0 0 1 156.260356 302.806368l122.004508 122.004507a31.955083 31.955083 0 0 1-45.248398 45.184488l-121.940597-121.940598A191.730499 191.730499 0 1 1 703.730499 544.642437z m-6.391017-511.28133c38.857381 0 70.301183 30.67688 70.301183 68.511698v386.912146a255.640665 255.640665 0 1 0-69.022979 503.16474l-563.687667 0.06391c-38.857381 0-70.301183-30.67688-70.301183-68.447788V101.808895C64.628836 63.910166 96.072638 33.233286 134.930019 33.233286h562.409463z m6.391017 575.191496a127.820333 127.820333 0 1 0 0 255.640665 127.820333 127.820333 0 0 0 0-255.640665z m-351.505915 0h-127.820332a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511281h127.820332a31.955083 31.955083 0 0 0 0-63.910166z m0-191.730499h-127.820332a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511282h127.820332a31.955083 31.955083 0 0 0 0-63.910167z m191.730499-191.730499h-319.550831a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511282h319.550831a31.955083 31.955083 0 0 0 0-63.910167z" p-id="22292"></path></svg>';
   output += "</a>";
   output +=
-    "<guide gid='sent_func' style='margin:unset;'></guide></span></span>";
+    "<span title='" + gLocal.gui.relational_map + "' class='rel_map' onclick=\"sent_show_rel_map('" +
+    abook +
+    "','" +
+    aparagraph +
+    "','" +
+    iBegin +
+    "','" +
+    iEnd +
+    "')\">" + '<svg style="transform: rotate(-90deg); fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 15px;" t="1601482033694" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18290" width="16" height="16"><path d="M903.3 650.8H791.9V511.3H540.5V399.9h167.7c30.9 0 55.9-25.5 55.9-56.4V120.3c0-31.3-25.1-56.4-55.9-56.4H316.4c-30.9 0-55.5 25.1-55.5 56.4 0 0 0 222.8-0.4 223.2 0 31.3 25.1 56.4 55.9 56.4h168.2v111.4H232.8v139.6H120.9c-30.9-0.1-55.9 25-55.9 55.9v196.4c0 30.4 25.1 55.5 55.9 55.9h279.6c30.9 0 55.9-25.1 55.9-55.9V706.8c0-30.9-25.1-55.9-55.9-55.9H288.7v-83.7H736v83.7H624.2c-30.9 0-55.9 25.1-55.9 55.9v196.4c0 30.9 25.1 55.9 55.9 55.9h279.1c30.9 0 55.9-25.1 55.9-55.9V706.8c0-30.9-25-56-55.9-56z" p-id="18291"></path></svg>' + "</span>";
+  output += "</span>";
+  output += "<guide gid='sent_func' style='margin:unset;'></guide>";
+  output += "</span>";
   output +=
     "<span style='flex: 3;'><guide gid='sent_trans' style='margin:unset;'></guide></span>";
   output += "</div>";
@@ -1596,11 +1607,11 @@ function renderWordParBlockInner(elementBlock) {
           sentIdString +
           "<a onclick=\"copy_to_clipboard('" +
           sentIdStringLink +
-          "')\">[";
-        output += gLocal.gui.copy_to_clipboard;
-        output += "]</a>";
+          "')\" title=" + gLocal.gui.copy_to_clipboard + ">";
+        output += '<svg style="fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 12px;" t="1601480724259" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4644" width="16" height="16"><path d="M791.272727 93.090909H139.636364v837.818182a93.090909 93.090909 0 0 1-93.090909-93.090909V93.090909a93.090909 93.090909 0 0 1 93.090909-93.090909h558.545454a93.090909 93.090909 0 0 1 93.090909 93.090909zM232.727273 186.181818h744.727272v837.818182H232.727273V186.181818z" p-id="4645"></path></svg>';
+        output += "</a>";
         output +=
-          "<a href='../pcdl/reader.php?view=sent&book=" +
+          "<span title='" + gLocal.gui.scan_in_reader + "'><a href='../pcdl/reader.php?view=sent&book=" +
           book +
           "&para=" +
           paragraph +
@@ -1608,11 +1619,23 @@ function renderWordParBlockInner(elementBlock) {
           nextBegin +
           "&end=" +
           nextEnd +
-          "' target='_blank'>";
-        output += "[" + gLocal.gui.scan_in_reader + "]";
-        output += "</a>";
+          "' target='_blank' >";
+        output += '<svg style="fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 15px;" t="1601482753387" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22291" width="200" height="200"><path d="M703.730499 544.578527a191.730499 191.730499 0 0 1 156.260356 302.806368l122.004508 122.004507a31.955083 31.955083 0 0 1-45.248398 45.184488l-121.940597-121.940598A191.730499 191.730499 0 1 1 703.730499 544.642437z m-6.391017-511.28133c38.857381 0 70.301183 30.67688 70.301183 68.511698v386.912146a255.640665 255.640665 0 1 0-69.022979 503.16474l-563.687667 0.06391c-38.857381 0-70.301183-30.67688-70.301183-68.447788V101.808895C64.628836 63.910166 96.072638 33.233286 134.930019 33.233286h562.409463z m6.391017 575.191496a127.820333 127.820333 0 1 0 0 255.640665 127.820333 127.820333 0 0 0 0-255.640665z m-351.505915 0h-127.820332a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511281h127.820332a31.955083 31.955083 0 0 0 0-63.910166z m0-191.730499h-127.820332a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511282h127.820332a31.955083 31.955083 0 0 0 0-63.910167z m191.730499-191.730499h-319.550831a31.955083 31.955083 0 0 0-5.751915 63.398885l5.751915 0.511282h319.550831a31.955083 31.955083 0 0 0 0-63.910167z" p-id="22292"></path></svg>';
+        output += "</a></span>";
         output +=
-          "<guide gid='sent_func' style='margin:unset;'></guide></span></span>";
+          "<span title='" + gLocal.gui.relational_map + "' class='rel_map' onclick=\"sent_show_rel_map('" +
+          book +
+          "','" +
+          paragraph +
+          "','" +
+          nextBegin +
+          "','" +
+          nextEnd +
+
+          "')\">" + '<svg style="transform: rotate(-90deg); fill: var(--tool-bg-color);margin: 0 2px;  padding: 0 2px;  height: 15px;" t="1601482033694" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18290" width="16" height="16"><path d="M903.3 650.8H791.9V511.3H540.5V399.9h167.7c30.9 0 55.9-25.5 55.9-56.4V120.3c0-31.3-25.1-56.4-55.9-56.4H316.4c-30.9 0-55.5 25.1-55.5 56.4 0 0 0 222.8-0.4 223.2 0 31.3 25.1 56.4 55.9 56.4h168.2v111.4H232.8v139.6H120.9c-30.9-0.1-55.9 25-55.9 55.9v196.4c0 30.4 25.1 55.5 55.9 55.9h279.6c30.9 0 55.9-25.1 55.9-55.9V706.8c0-30.9-25.1-55.9-55.9-55.9H288.7v-83.7H736v83.7H624.2c-30.9 0-55.9 25.1-55.9 55.9v196.4c0 30.9 25.1 55.9 55.9 55.9h279.1c30.9 0 55.9-25.1 55.9-55.9V706.8c0-30.9-25-56-55.9-56z" p-id="18291"></path></svg>' + "</span>";
+        output += "</span>";
+        output += "<guide gid='sent_func' style='margin:unset;'></guide>";
+        output += "</span>";
         output +=
           "<span style='flex: 3;'><guide gid='sent_trans' style='margin:unset;'></guide></span>";
         output += "</div>";
@@ -1687,6 +1710,51 @@ function renderWordParBlockInner(elementBlock) {
   return output;
 }
 
+function sent_show_rel_map(book, para, begin, end) {
+  let wordId;
+  let memind = "graph LR\n";
+  let pali_text = "";
+  for (wordId = begin; wordId <= end; wordId++) {
+    let rel = doc_word("#p" + book + "-" + para + "-" + wordId).val("rela");
+    let pali = doc_word("#p" + book + "-" + para + "-" + wordId).val("real");
+    let type = doc_word("#p" + book + "-" + para + "-" + wordId).val("type");
+    if (type != ".ctl.") {
+      pali_text += pali + " ";
+    }
+    let wid = "p" + book + "-" + para + "-" + wordId;
+
+    if (rel != "") {
+      let relaData = JSON.parse(rel);
+      for (const iterator of relaData) {
+        let strRel = iterator.relation;
+        let dest = iterator.dest_spell;
+        let type = doc_word("#" + iterator.dest_id).val("case");
+
+        if (type.indexOf(".v.") >= 0) {
+          dest = iterator.dest_id + "[/" + dest + "/]";
+        } else {
+          dest = iterator.dest_id + "[" + dest + "]";
+        }
+        if (strRel.indexOf("SV") >= 0 || strRel.indexOf("-P") >= 0) {
+          memind +=
+            wid + "(" + pali + ")" + " ==> |" + strRel + "|" + dest + "\n";
+        } else if (strRel.indexOf("OV") >= 0 || strRel.indexOf("-S") >= 0) {
+          memind +=
+            dest + " ==> |" + strRel + "|" + wid + "(" + pali + ")" + "\n";
+        } else {
+          memind +=
+            wid + "(" + pali + ")" + " -- " + strRel + " --> " + dest + "\n";
+        }
+      }
+    }
+  }
+
+  let graph = mermaid.render("graphDiv", memind);
+  document.querySelector("#term_body").innerHTML =
+    "<h3>" + pali_text + "</h3>" + graph;
+  document.querySelector("#term_win").style.display = "flex";
+}
+
 //句子编辑块
 function render_tran_sent_block(
   book,
@@ -1898,15 +1966,15 @@ function render_tran_sent_block(
 function trans_text_save(book, para, begin, end, channal) {
   let textarea = $(
     "#trans_sent_edit_" +
-      book +
-      "_" +
-      para +
-      "_" +
-      begin +
-      "_" +
-      end +
-      "_" +
-      channal
+    book +
+    "_" +
+    para +
+    "_" +
+    begin +
+    "_" +
+    end +
+    "_" +
+    channal
   );
   if (textarea) {
     let objsent = new Object();
@@ -1927,16 +1995,16 @@ function sent_edit_click(book, para, begin, end, channal) {
   $(".trans_sent_edit").parent().hide(200);
   $(
     ".trans_sent_edit[book='" +
-      book +
-      "'][para='" +
-      para +
-      "'][begin='" +
-      begin +
-      "'][end='" +
-      end +
-      "'][channal='" +
-      channal +
-      "']"
+    book +
+    "'][para='" +
+    para +
+    "'][begin='" +
+    begin +
+    "'][end='" +
+    end +
+    "'][channal='" +
+    channal +
+    "']"
   )
     .parent()
     .show();
@@ -2685,12 +2753,12 @@ function renderWordDetailByElement(xmlElement) {
             ) {
               arrMeaning.push(
                 g_DictWordList[iDict].dictID +
-                  "$" +
-                  arrMeaning.length +
-                  "$$" +
-                  arrMean[i] +
-                  "$" +
-                  g_DictWordList[iDict].Language
+                "$" +
+                arrMeaning.length +
+                "$$" +
+                arrMean[i] +
+                "$" +
+                g_DictWordList[iDict].Language
               );
             }
           }
@@ -2740,12 +2808,12 @@ function renderWordDetailByElement(xmlElement) {
               ) {
                 arrMeaning.push(
                   g_DictWordList[iDict].dictID +
-                    "$" +
-                    arrMeaning.length +
-                    "$*$" +
-                    getLocalParentFormulaStr(wordGramma0, arrMean[i]) +
-                    "$" +
-                    g_DictWordList[iDict].Language
+                  "$" +
+                  arrMeaning.length +
+                  "$*$" +
+                  getLocalParentFormulaStr(wordGramma0, arrMean[i]) +
+                  "$" +
+                  g_DictWordList[iDict].Language
                 );
               }
             }
@@ -2795,12 +2863,12 @@ function renderWordDetailByElement(xmlElement) {
               ) {
                 arrMeaning.push(
                   g_DictWordList[iDict].dictID +
-                    "$" +
-                    arrMeaning.length +
-                    "$**$" +
-                    getLocalParentFormulaStr(wordGramma1, arrMean[i]) +
-                    "$" +
-                    g_DictWordList[iDict].Language
+                  "$" +
+                  arrMeaning.length +
+                  "$**$" +
+                  getLocalParentFormulaStr(wordGramma1, arrMean[i]) +
+                  "$" +
+                  g_DictWordList[iDict].Language
                 );
               }
             }
@@ -3275,7 +3343,7 @@ function renderWordDetailByElement(xmlElement) {
   return _txtOutDetail;
 }
 
-function renderWordNoteDivByParaNo(book, paragraph) {}
+function renderWordNoteDivByParaNo(book, paragraph) { }
 /*
 paragraph word note
 */
@@ -3474,7 +3542,7 @@ function updateWordNote(element) {
   }
 }
 
-function updateWordCommentary(element) {}
+function updateWordCommentary(element) { }
 
 //根据xmlDocument 对象中的单词序号修改单词块的显示(不含Pali)
 //返回 无
@@ -3597,13 +3665,13 @@ function prev_page() {
   gVisibleParEndOld = gVisibleParEnd;
   if (
     g_allparlen_array[gVisibleParEnd - 1] -
-      g_allparlen_array[gVisibleParBegin - 1] <=
+    g_allparlen_array[gVisibleParBegin - 1] <=
     gDisplayCapacity
   ) {
     gVisibleParBegin -= 1;
   } else if (
     g_allparlen_array[gVisibleParEnd + 1] -
-      g_allparlen_array[gVisibleParBegin - 1] >
+    g_allparlen_array[gVisibleParBegin - 1] >
     gDisplayCapacity
   ) {
     gVisibleParBegin -= 1;
@@ -3630,13 +3698,13 @@ function next_page() {
 
   if (
     g_allparlen_array[gVisibleParEnd + 1] -
-      g_allparlen_array[gVisibleParBegin + 1] <=
+    g_allparlen_array[gVisibleParBegin + 1] <=
     gDisplayCapacity
   ) {
     gVisibleParEnd += 1;
   } else if (
     g_allparlen_array[gVisibleParEnd + 1] -
-      g_allparlen_array[gVisibleParBegin + 1] >
+    g_allparlen_array[gVisibleParBegin + 1] >
     gDisplayCapacity
   ) {
     gVisibleParBegin += 1;
@@ -4073,12 +4141,12 @@ function refreshNoteNumber() {
     let id = $(this).attr("wid");
     $(this).html(
       "<a href='#word_note_root_" +
-        id +
-        "' name=\"word_note_" +
-        id +
-        '">[' +
-        (index + 1) +
-        "]</a>"
+      id +
+      "' name=\"word_note_" +
+      id +
+      '">[' +
+      (index + 1) +
+      "]</a>"
     );
   });
 

+ 26 - 3
app/term/note.js

@@ -21,7 +21,7 @@
 <note id="guid" book=203 para=1654 begin=23 end=45 author=11 lang=en tag=*></note>
 
 */
-
+var _display = "";
 var _word = "";
 var _channal = "";
 var _lang = "";
@@ -118,9 +118,32 @@ function note_refresh_new() {
             for (const iterator of arrData) {
               let id = iterator.id;
               let strHtml = "<a name='" + id + "'></a>";
-              strHtml += note_json_html(iterator);
-              $("#" + id).html(strHtml);
+              if (_display && _display == "para") {
+                let strPalitext = "<pali>" + iterator.palitext + "<pali>";
+                let divPali = $("#" + id)
+                  .parent()
+                  .children(".palitext");
+                if (divPali.length == 0) {
+                  $("#" + id)
+                    .parent()
+                    .prepend("<div class='palitext'></div>");
+                }
+                $("#" + id)
+                  .parent()
+                  .children(".palitext")
+                  .first()
+                  .append(strPalitext);
+                let htmlTran =
+                  "<span class='tran'>" +
+                  marked(term_std_str_to_tran(iterator.tran)) +
+                  "</span>";
+                $("#" + id).html(htmlTran);
+              } else {
+                strHtml += note_json_html(iterator);
+                $("#" + id).html(strHtml);
+              }
             }
+
             $(".palitext").click(function () {
               let sentid = $(this).parent().attr("info").split("-");
               window.open(

+ 14 - 6
app/term/note.php

@@ -46,12 +46,20 @@ $output = array();
 foreach ($_data as $key => $value) {
 	# code...
 	$id = $value["id"];
-	$arrInfo = str_getcsv($value["data"],"@");
-	$arrSent = str_getcsv($arrInfo[0],"-");
-	$bookId=$arrSent[0];
-	$para=$arrSent[1];
-	$begin=$arrSent[2];
-	$end=$arrSent[3];
+	$arrInfo = explode("@",$value["data"]);
+	if(isset($arrInfo[1])){
+		$sentChannal = $arrInfo[1];
+	}
+	else{
+		$sentChannal = "";
+	}
+	if(isset($arrInfo[0])){
+		$arrSent = str_getcsv($arrInfo[0],"-");
+		$bookId=$arrSent[0];
+		$para=$arrSent[1];
+		$begin=$arrSent[2];
+		$end=$arrSent[3];
+	}
 
 	$query="SELECT html FROM 'pali_sent' WHERE book = ? AND paragraph = ? AND begin = ? AND end = ? ";
 	$sth = $db_pali_sent->prepare($query);

Some files were not shown because too many files changed in this diff