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

:bug: 章节路径链接相应点击实践,弹出阅读章节窗口

visuddhinanda пре 4 година
родитељ
комит
bf3f41d160
1 измењених фајлова са 21 додато и 0 уклоњено
  1. 21 0
      public/app/search/paliword.js

+ 21 - 0
public/app/search/paliword.js

@@ -67,9 +67,30 @@ function paliword_search(keyword, words = new Array(), book = new Array()) {
 			}
 			$("#book_list").html(html);
 			$("#contents_nav").html(render_nav(result));
+			//章节路径链接相应点击实践,弹出阅读章节窗口
+			chapter_onclick_init();
 		}
 	);
 }
+
+/*
+  |---------------------------------------
+  |章节路径链接相应点击实践,弹出阅读章节窗口
+  |---------------------------------------
+*/
+function chapter_onclick_init() {
+	$("chapter").click(function () {
+		let bookid = $(this).attr("book");
+		let para = $(this).attr("para");
+		window.open("../reader/?view=chapter&book=" + bookid + "&par=" + para, "_blank");
+	});
+
+	$("para").click(function () {
+		let bookid = $(this).attr("book");
+		let para = $(this).attr("para");
+		window.open("../reader/?view=para&book=" + bookid + "&par=" + para, "_blank");
+	});
+}
 function highlightWords(line, word) {
 	if (line && line.length > 0) {
 		let output = line;