["+noteCounter+"]");
noteCounter++;
}
else{
if(status==0){
let myterm=term_lookup_my(termText);//我的术语字典
if(myterm){
$(this).attr("status","1");
$(this).attr("type","0");
$(this).attr("guid",myterm.guid);
$(this).attr("pali",myterm.word);
$(this).attr("mean",myterm.meaning);
$(this).attr("mean2",myterm.other_meaning);
$(this).attr("replace",myterm.meaning);
}
else{
$(this).attr("status","2");
}
}
let guid=$(this).attr("guid");
let pali=$(this).attr("pali");
let mean=$(this).attr("mean");
let mean2=$(this).attr("mean2");
var renderTo=$(this).attr("pos");
var noteText="";
if(termCounter[guid]){
termCounter[guid]=2;
}
else{
termCounter[guid]=1;
}
var myterm=term_lookup_my(pali);//我的术语字典
let linkclass="";
if(myterm){
linkclass="term_link";
}
else{
linkclass="term_link_new";
}
if(guid){
if(renderTo=="wbw"){
noteText="%note%";
}
else{
if(termCounter[guid]==1){
noteText=strTermTanslationTmp;
}
else{
noteText=strTermTanslationTmp2;
}
}
noteText=noteText.replace("[","");
noteText=noteText.replace("]","");
noteText=noteText.replace("%mean%",""+mean+"");
noteText=noteText.replace("%pali%",""+pali+"");
noteText=noteText.replace("%mean2%",""+mean2+"");
noteText=noteText.replace("%note%",""+""+"");
if(myterm){
if(myterm.meaning!=mean){
noteText=noteText.replace("%mymean%",""+myterm.meaning+"");
}
else{
noteText=noteText.replace("%mymean%","");
}
}
else{
noteText=noteText.replace("%mymean%","");
}
}
else{
noteText=""+termText+"";
}
$(this).html(noteText);
}
});
}
function term_show_win(guid,keyWord=""){
if(guid==""){
$(term_body).html("当前词条未创建。
现在创建");
}
else{
let currWord = term_lookup_my_id(guid);
if(currWord){
let termString="";
let pali=currWord.word;
let pali_1= pali.substring(0,1).toUpperCase();
pali=pali_1+pali.substring(1);
let mean=currWord.meaning;
let myterm=term_lookup_my(currWord.word);//我的术语字典
termString+=""+pali+"
";
termString+="意思:"+currWord.meaning+"
";
termString+="其他意思:"+currWord.other_meaning+"
";
termString+="我的词库:";
if(myterm){
termString+=""+myterm.meaning+" ";
}
else{
termString+="";
}
termString+="其他:";
termString+="
";
if(currWord.note){
termString+=""+currWord.note+"
";
}
else{
termString+="Loading
";
}
$(term_body).html(termString);
term_get_all_meaning(currWord.word);
if(!currWord.note){
$.get("term.php",
{
op:"load_id",
id:currWord.guid
},
function(data,status,xhr){
switch(status){
case "success":
try{
let loadWord = JSON.parse(data);
$("#term_win_note").html(loadWord[0].note);
//修改内存数据
for(let x in arrMyTerm){
if(arrMyTerm[x].guid==loadWord[0].guid){
arrMyTerm[x].note=loadWord[0].note;
return;
}
}
}
catch(e){
console.error(e+" data:"+data);
}
break;
case "error":
console.error("Error: "+xhr.status+": "+xhr.statusText);
break;
}
});
}
}
else{
$(term_body).html("undefined guid");
}
}
document.getElementById("term_win").style.display="flex";
}
function term_tmp(type,tmp){
if(tmp=="new"){
switch(type){
case "a":
strTermTanslationTmp=$("#term_my_tmp").val();
break;
case "a2":
strTermTanslationTmp2=$("#term_my_tmp").val();
break;
}
}
else{
switch(type){
case "a":
strTermTanslationTmp=tmp;
break;
case "a2":
strTermTanslationTmp2=tmp;
break;
}
}
term_updata_translation();
}
function term_add_new(keyword){
document.getElementById("term_win").style.display="none";
editor_show_right_tool_bar(true);
tab_click_b('term_dict','tab_rb_dict');
note_lookup(keyword,"term_dict");
}