Jelajahi Sumber

意思下拉菜单增加查字典按钮

visuddhinanda 4 tahun lalu
induk
melakukan
ed62225354
1 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 9 9
      app/studio/js/editor.js

+ 9 - 9
app/studio/js/editor.js

@@ -3592,21 +3592,21 @@ function getMeaningMenuList(index, word) {
 
 	output += '<div class="case_dropdown-content" id=\'part_mean_menu_' + index + "'>";
 	//直列菜单
-	for (i in currMeaningList) {
-		output +=
-			"<a onclick='meaningPartChange(" +
-			index +
-			',"' +
-			currMeaningList[i] +
-			"\")'>" +
-			currMeaningList[i] +
-			"</a>";
+	output += "<a onclick='meaningPartLookup(\"" +word +"\")'>🔍" +gLocal.gui.dict +"</a>";	
+	for (const itMean of currMeaningList) {
+		if(itMean!="?"){
+			output += "<a onclick='meaningPartChange(" +index +	',"' +itMean +	"\")'>" +itMean +"</a>";					
+		}
+
 	}
 
 	output += "</div>";
 	output += "</div>";
 	return output;
 }
+function meaningPartLookup(word){
+	window.open("../dict/index.php?builtin=true&theme=dark&key="+word,target="dict");
+}
 function getWordMeaningList(word) {
 	var currOM = "";
 	var arrOM = new Array();