/* {{203-1654-23-45@11@en@*}} 203-1654-23-45@11@en@* pali text */ /* 解析百科字符串 {{203-1654-23-45@11@en@*}} */ function note_init(input) { let output = ""; let arrInput = input.split("\n"); for (x in arrInput) { if (arrInput[x].slice(0, 2) == "==" && arrInput[x].slice(-2) == "==") { output += ""; output += ''; output += ''; output += arrInput[x].slice(2, -2); output += ''; output += ''; output += ""; output += ""; output += ''; } else { let row = arrInput[x]; row = row.replace(/\{\{/g, ''); if (row.match("{") && row.match("}")) { row = row.replace("{", ""); row = row.replace("}", ""); } output += row; } } output += ""; return output; } // function note_refresh_new() { let objNotes = document.querySelectorAll("note"); let arrSentInfo = new Array(); for (const iterator of objNotes) { let id = iterator.id; if (id == null || id == "") { id = com_guid(); iterator.id = id; let info = iterator.getAttributeNode("info").value; if (info && info != "") { arrSentInfo.push({ id: id, data: info }); } } { $.post( "../term/note.php", { data: JSON.stringify(arrSentInfo), }, function (data, status) { if (status == "success") { try { let arrData = JSON.parse(data); for (const iterator of arrData) { let id = iterator.id; let strHtml = note_json_html(iterator); $("#" + id).html(strHtml); } note_ref_init(); term_get_dict(); } catch (e) { console.error(e); } } } ); } } } function note_ref_init() { $("chapter").click(function () { let bookid = $(this).attr("book"); let para = $(this).attr("para"); window.open( "../pcdl/reader.php?view=chapter&book=" + bookid + "¶=" + para, "_blank" ); }); $("para").click(function () { let bookid = $(this).attr("book"); let para = $(this).attr("para"); window.open( "../pcdl/reader.php?view=para&book=" + bookid + "¶=" + para, "_blank" ); }); } /* id palitext tran ref */ function note_json_html(in_json) { let output = ""; output += "" + in_json.palitext + ""; output += "" + term_std_str_to_tran(in_json.tran) + ""; output += "" + in_json.ref + ""; return output; }
'; output += arrInput[x].slice(2, -2); output += ''; output += ''; output += ""; output += "