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

Merge pull request #547 from visuddhinanda/master

article 阅读手机优化
visuddhinanda 4 лет назад
Родитель
Сommit
fb22b7a2d8
6 измененных файлов с 82 добавлено и 10 удалено
  1. 13 4
      app/article/index.php
  2. 19 2
      app/article/mobile.css
  3. 42 1
      app/article/style.css
  4. 3 0
      app/reader/get_para1.php
  5. 1 1
      app/studio/project.php
  6. 4 2
      package.json

+ 13 - 4
app/article/index.php

@@ -61,6 +61,9 @@ require_once "../pcdl/html_head.php";
 	if(isset($_GET["start"])){
 	if(isset($_GET["start"])){
 		echo "_start=".$_GET["start"].";";
 		echo "_start=".$_GET["start"].";";
 	}
 	}
+	if(isset($_GET["begin"])){
+		echo "_start=".$_GET["begin"].";";
+	}
 	if(isset($_GET["end"])){
 	if(isset($_GET["end"])){
 		echo "_end=".$_GET["end"].";";
 		echo "_end=".$_GET["end"].";";
 	}
 	}
@@ -145,6 +148,7 @@ require_once "../pcdl/html_head.php";
 <style>
 <style>
 ul.fancytree-container{
 ul.fancytree-container{
 	border:unset;
 	border:unset;
+	width: max-content;
 }
 }
 .fancytree-container .active {
 .fancytree-container .active {
     font-weight: 700;
     font-weight: 700;
@@ -284,7 +288,7 @@ function set_toc_visible(isVisible){
 				echo "&start=".$_GET["start"];
 				echo "&start=".$_GET["start"];
 			}
 			}
 			if(isset($_GET["end"])){
 			if(isset($_GET["end"])){
-				echo "$end=".$_GET["end"];
+				echo "&end=".$_GET["end"];
 			}
 			}
 			echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";	
 			echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";	
 				
 				
@@ -369,11 +373,16 @@ function set_toc_visible(isVisible){
 
 
 <script>
 <script>
 	$(document).ready(function(){
 	$(document).ready(function(){
-		if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
-			set_toc_visible(false);
+		if(window.innerWidth>800){
+			if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
+				set_toc_visible(false);
+			}else{
+				set_toc_visible(true);
+			}			
 		}else{
 		}else{
-			set_toc_visible(true);
+			set_toc_visible(false);
 		}
 		}
+
 		
 		
 		article_add_dlg_init("article_add_div");
 		article_add_dlg_init("article_add_div");
 	ntf_init();				
 	ntf_init();				

+ 19 - 2
app/article/mobile.css

@@ -39,7 +39,7 @@ note:hover .ref {
 }
 }
 
 
 #left_pannal{
 #left_pannal{
-	display:none;
+	/*display:none;*/
 }
 }
 
 
 .main_view {
 .main_view {
@@ -57,5 +57,22 @@ note:hover .ref {
 	width: 100%;
 	width: 100%;
 }
 }
 #toc_content{
 #toc_content{
-	width: 100%;
+    width: 100%;
+    max-width: unset;
+    max-height: unset;
+    height: 100%;
+}
+#right_float_pannal {
+	position: fixed;
+	height: 70%;
+	top: 100%;
+	left: 0;
+	width:100%
+}
+.right_float_min #right_float_pannal {
+    position: fixed;
+    top: 30%;
+    left: 0;
+    width: 100%;
+    height: 70%;
 }
 }

+ 42 - 1
app/article/style.css

@@ -51,7 +51,7 @@
     height: 100%;
     height: 100%;
 	/*width:300px;*/
 	/*width:300px;*/
 	overflow-x: hidden;
 	overflow-x: hidden;
-	overflow-y: hidden;
+	overflow-y: scroll;
 }
 }
 
 
 #toc_content{
 #toc_content{
@@ -60,6 +60,7 @@
 	max-width:270px;
 	max-width:270px;
 	background-color: var(--bg-color);
 	background-color: var(--bg-color);
     border-bottom: 1px solid var(--border-line-color);
     border-bottom: 1px solid var(--border-line-color);
+	overflow-y: unset;
 }
 }
 
 
 .fun_frame {
 .fun_frame {
@@ -226,4 +227,44 @@ img {
 #article_path chapter:hover {
 #article_path chapter:hover {
     color: var(--link-hover-color);
     color: var(--link-hover-color);
     text-decoration: underline;
     text-decoration: underline;
+}
+.right_float_min #right_float_pannal {
+	left: calc(100% - 30vw + 0.6em);
+}
+#right_float_pannal {
+	position: fixed;
+	height: calc(100% - 7.3em);
+	top: 7.3em;
+	left: 100%;
+	width: calc(30vw - 0.6em);
+	min-width: 20vw;
+	color: var(--btn-color);
+	background-color: var(--tool-bg-color);
+	z-index: 20;
+	-webkit-transition-duration: 0.4s;
+	transition-duration: 0.4s;
+	-webkit-contain: strict;
+	contain: strict;
+	z-index: 51;
+}
+#right_float_pannal > iframe {
+	width: 100%;
+	height: 100%;
+}
+.right_float_max #right_float_pannal {
+	left: 50%;
+	width: 50%;
+}
+
+
+#right_float_pannal > #tool_bar {
+	/*position: absolute;*/
+	display: flex;
+	width: 100%;
+	justify-content: space-between;
+}
+#right_float_pannal > #tool_bar svg {
+	fill: var(--bg-color);
+	height: 2em;
+	width: 2em;
 }
 }

+ 3 - 0
app/reader/get_para1.php

@@ -23,6 +23,9 @@ if (isset($_GET["par"])) {
 if (isset($_GET["start"])) {
 if (isset($_GET["start"])) {
     $_start = $_GET["start"];
     $_start = $_GET["start"];
 }
 }
+if (isset($_GET["begin"])) {
+    $_start = $_GET["begin"];
+}
 if (isset($_GET["end"])) {
 if (isset($_GET["end"])) {
     $_end = $_GET["end"];
     $_end = $_GET["end"];
 }
 }

+ 1 - 1
app/studio/project.php

@@ -275,7 +275,7 @@ switch ($op) {
                                 mTime(),
                                 mTime(),
                                 mTime(),
                                 mTime(),
                                 mTime(),
                                 mTime(),
-                                $filesize,
+                                0,
                                 0,
                                 0,
                                 $doc_head,
                                 $doc_head,
                                 json_encode($block_list, JSON_UNESCAPED_UNICODE),
                                 json_encode($block_list, JSON_UNESCAPED_UNICODE),

+ 4 - 2
package.json

@@ -2,16 +2,18 @@
 	"requires": true,
 	"requires": true,
 	"lockfileVersion": 1,
 	"lockfileVersion": 1,
 	"dependencies": {
 	"dependencies": {
+		"bootstrap": "^5.1.1",
+		"bootstrap-icons": "^1.5.0",
 		"diff": "^5.0.0",
 		"diff": "^5.0.0",
 		"editor.md": "^1.5.0",
 		"editor.md": "^1.5.0",
 		"fullcalendar": "^5.9.0",
 		"fullcalendar": "^5.9.0",
 		"highcharts": "^9.2.2",
 		"highcharts": "^9.2.2",
 		"jquery": "^3.6.0",
 		"jquery": "^3.6.0",
 		"jquery-ui": "^1.12.1",
 		"jquery-ui": "^1.12.1",
+		"jquery.fancytree": "^2.38.0",
 		"marked": "^2.1.3",
 		"marked": "^2.1.3",
 		"mermaid": "^8.12.0",
 		"mermaid": "^8.12.0",
 		"tributejs": "^5.1.3",
 		"tributejs": "^5.1.3",
-		"vue": "^3.2.8",
-		"jquery.fancytree": "^2.38.0"
+		"vue": "^3.2.8"
 	}
 	}
 }
 }