var dict_pre_searching=false; var dict_pre_search_curr_word=""; var dict_search_xml_http=null; function dict_search(word){ $("#pre_search_result").hide(); if(!localStorage.searchword){ localStorage.searchword=""; } let oldHistory=localStorage.searchword; let arrOldHistory=oldHistory.split(","); let isExist=false; for(let i=0;i=0){ var wordParts=word.split("+"); var strParts=""; for(var i in wordParts){ strParts+=""+wordParts[i]+""; } $("#input_parts").html(strParts); } else{ $("#input_parts").html(""); } } function dict_show_history(){ if(!localStorage.searchword){ localStorage.searchword=""; } var arrHistory=localStorage.searchword.split(","); var strHistory=""; if(arrHistory.length>0){ strHistory+="清空历史记录"; } for(var i=0;i"+word+""; strHistory+=""; } $("#dict_ref_search_result").html(strHistory); } function cls_word_search_history(){ localStorage.searchword=""; $("#dict_ref_search_result").html(""); } function trubo_split(){ $("#pre_search_result").hide(); $.post("split.php", { word:$("#dict_ref_search_input").val() }, function(data,status){ try{ let result= JSON.parse(data); let html="
"; if(result.length>0){ for( const part of result[0]["data"]){ html += ''; } } html += "
"; $("#input_parts").html(html); $(".more_button").click(function(){ $(this).parent().siblings(".menu").toggle(); } ); $(".part_list").click(function(){ let html=""+$(this).text().replace(/\+/g,"")+""; $(this).parent().parent().find(".main_view").html(html); $(this).parent().hide(); $("part").click(function(){ dict_search($(this).text()); }); } ); $("part").click(function(){ dict_search($(this).text()); } ); } catch(e){ } }); }