| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- /*
- function wiki_load(word){
- $("#wiki_contents").load("../term/term.php?op=search&word="+word,function(responseTxt,statusTxt,xhr){
- if(statusTxt=="success"){
- $(".note").each(function(index,element){
- $(this).html(note_init($(this).html()));
- $(this).attr("status",1);
- note_refresh_new();
- });
- }
- else if(statusTxt=="error"){
- console.error("Error: "+xhr.status+": "+xhr.statusText);
- }
- });
- }
- */
- function wiki_index_init(){
- }
- function wiki_load_id(guid){
- note_lookup_guid_json(guid,"wiki_contents");
- }
- function wiki_load_word(word){
- term_get_word_to_div(word,"wiki_contents",wiki_word_loaded);
- }
- function wiki_goto_word(guid,strWord){
- window.open("wiki.php?word="+strWord,"_blank");
- }
- function wiki_word_loaded(wordlist){
- $("#doc_title").text(wordlist[0].word+"["+wordlist[0].meaning+"]-圣典百科");
- }
- function run(){
- $("chapter").click(function(){
- let bookid = $(this).attr("book");
- let paragraph = $(this).attr("para");
- window.open("../pcdl/reader.php?book="+bookid+"¶graph="+paragraph,"_blank");
- });
-
- }
- function run2(){
- var wordlist = new Array();
- $("term").each(function(index,element){
- wordlist.push($(this).attr("pali"));
- }
- );
-
- var wordquery ="('" + wordlist.join("','")+"')";
- $.post("../term/term.php",
- {
- op:"extract",
- words:wordquery
- },
- function(data,status){
- if(data.length>0){
- try{
- arrMyTerm = JSON.parse(data);
- term_updata_translation();
- }
- catch(e){
- console.error(e.error+" data:"+data);
- }
- }
- });
- }
- function term_show_win(guid,word){
- window.location.assign("wiki.php?word="+word);
- }
- function wiki_search_keyup(e,obj){
- var keynum
- var keychar
- var numcheck
- if($("#wiki_search_input").val()==""){
- $("#search_result").html("");
- return;
- }
-
- if(window.event) // IE
- {
- keynum = e.keyCode
- }
- else if(e.which) // Netscape/Firefox/Opera
- {
- keynum = e.which
- }
- var keychar = String.fromCharCode(keynum)
- if(keynum==13){
- //dict_search(obj.value);
- }
- else{
- wiki_pre_search(obj.value);
- }
- }
- function wiki_pre_search(keyword){
- $.get("../term/term.php",
- {
- op:"pre",
- word:keyword,
- format:"json"
- },
- function(data,status){
- let result= JSON.parse(data);
- let html="<ul class='wiki_search_list'>";
- if(result.length>0){
- for(x in result){
- html += "<li><a href='wiki.php?op=get&word="+result[x].word+"'>"+result[x].word+"["+result[x].meaning+"]</a></li>";
- }
- }
- html += "</ul>";
- $("#search_result").html(html);
- });
- }
|