MCPcopy Create free account
hub / github.com/ActiveState/code / do_search

Function do_search

recipes/JavaScript/578517_Music_player/recipe-578517.js:724–889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

722
723
724function do_search()
725{
726 var ed=document.getElementById("songsrch");
727 var s=ed.value;
728 var s_clean_str="";
729 var d_start_time = new Date();
730 var n_start_time = Date.parse(d_start_time);
731
732 if (g_busy_searching==false && g_busy_sorting==false)
733 {
734 g_search_string="";
735 a_indexes=new Array();
736 a_scores=new Array();
737
738 if (s=="admin")
739 {
740 ed.value="";
741 show_feedback_data();
742 return;
743 }
744
745 s=s.toLowerCase();
746 s_clean_str=censored_str(s);
747 ed.value=s_clean_str;
748
749 s=convert_input_string(s);
750 s=trim_str(s);
751 if (s=="") return;
752
753 check_search_words(s);
754 g_search_string=s;
755 g_srch_ptr=0;
756
757 // Show the progress bar.
758 var epr=document.getElementById("spnprog");
759 epr.style.display="block";
760 var esrch=document.getElementById("btnsrch");
761 esrch.value="Cancel";
762 g_busy_searching=true;
763 g_busy_sorting=false;
764 g_sort_cycle_count=0;
765 }
766
767 var i=g_srch_ptr;
768 var n_srch_loop_count=0;
769
770 if (g_cancel_search==false)
771 {
772 var epr=document.getElementById("spnprog");
773 if (g_busy_searching==true)
774 {
775 for (i=g_srch_ptr;i<a_songs.length;i++)
776 {
777 var n_score=0;
778 if (g_artist_search=="")
779 {
780 n_score=search_score(a_caps[i],g_search_string);
781 }

Callers 1

init_new_searchFunction · 0.70

Calls 11

show_feedback_dataFunction · 0.85
censored_strFunction · 0.85
convert_input_stringFunction · 0.85
trim_strFunction · 0.85
check_search_wordsFunction · 0.85
search_scoreFunction · 0.85
draw_search_tableFunction · 0.85
show_playlistFunction · 0.85
change_soundFunction · 0.85
parseMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected