PageSourceSearch

https://www.froggy929.com/wp-content/plugins/wpb-show-core/modules…?v=2024_mar_16&ver=1.1.1

js froggy929.com collected 2026-09-26 11:08:39 UTC 5,174 bytes, 148 lines download raw bytes

1// Js funcs for frotnend.
2function openEpisodeNotesTranscript(evt, tabName, id_unique_flag) {
3  var i, tabcontent, tablinks;
4  var episode_notes_transcript_wrapper_obj = document.getElementById('episode_notes_transcript_wrapper_'+id_unique_flag);
5
6  tabcontent = episode_notes_transcript_wrapper_obj.getElementsByClassName("tabcontent_episode");
7  for (i = 0; i < tabcontent.length; i++) {
8	tabcontent[i].style.display = "none";
9  }
10  tablinks = episode_notes_transcript_wrapper_obj.getElementsByClassName("tablinks_episode");
11  for (i = 0; i < tablinks.length; i++) {
12	tablinks[i].className = tablinks[i].className.replace(" active", "");
13  }
14  document.getElementById(tabName).style.display = "block";
15  evt.currentTarget.className += " active";
16}//End of func openEpisodeNotesTranscript
17
18// ---------------------------------------------------
19function sToTime(t) {
20  return padZero(parseInt((t / (60 * 60)) % 24)) + ":" +
21         padZero(parseInt((t / (60)) % 60)) + ":" + 
22         padZero(parseInt((t) % 60));
23}
24function padZero(v) {
25  return (v < 10) ? "0" + v : v;
26}
27
28function remove_play_icon_from_time(saved_time) {
29	saved_time = saved_time.replace(' <i class="fa fa-play-circle-o"></i> ', "");
30	saved_time = saved_time.replace('<i class="fa fa-play-circle-o"></i>', "");
31	saved_time = saved_time.replace(' <i class="fa fa-play-circle-o" style="color: rgb(250, 250, 250);"></i> ', "");
32
33	return saved_time;
34}
35
36function trim_js_value(str_val) {
37	var trim_val = jQuery.trim(str_val.replace(/[\t\n\r]+/g, ' '));
38	return trim_val;
39}
40
41function get_unique_id_from_object(obj_chk) {
42	var span_action_col_obj = obj_chk.parentNode;
43	var span_action_col_id = span_action_col_obj.id;
44	var temp_id_arr = span_action_col_id.split('_');
45	var unique_id = temp_id_arr[temp_id_arr.length - 1];
46	return unique_id;
47}
48function get_actual_audio_mp3_file(player_unique_id) {
49	var actual_mp3_url = ''; var preroll_url = '';
50	var playlists_arr = JPlayer.playlists;
51
52	try {
53		var player_info_data_json_obj = eval('player_info_data_'+player_unique_id);
54		actual_mp3_url = player_info_data_json_obj.audio_mp3;
55		preroll_url = player_info_data_json_obj.preroll_mp3;
56	}
57	catch(e){ }
58
59	var return_arr = new Array();
60  return_arr['actual_mp3_url'] = actual_mp3_url;
61  return_arr['preroll_url'] = preroll_url;
62
63	return return_arr;
64}
65function go_to_time_stamp_audio_to_play(span_link_obj, player_unique_id = 0, full_time_val) {
66	var unique_id = get_unique_id_from_object(span_link_obj);
67	var time = jQuery("#span_time_link_"+unique_id).html();
68	time = remove_play_icon_from_time(time);
69	time = trim_js_value(time);
70	if (full_time_val) {
71		time = full_time_val;
72	}
73
74	var actualTime = time.split(':');
75	var totalSeconds = (+actualTime[0]) * 60 * 60 + (+actualTime[1]) * 60 + (+actualTime[2]);
76	var audio_cur_time = sToTime(totalSeconds);
77	if (totalSeconds >= 0) {
78		
79	}
80	else {
81		return;
82	}
83
84	var aud_chapter = document.getElementById("jp_audio_"+player_unique_id);
85	if (aud_chapter && aud_chapter != 'undefined') {
86		// ---------------------------.
87		var change_preroll_mp3_to_actual_mp3 = false;
88		var return_arr = get_actual_audio_mp3_file(player_unique_id);
89		if (return_arr) {
90			if (return_arr['actual_mp3_url'] && return_arr['preroll_url']) {
91				// This is special case when both set to audio player single player only.
92				aud_chapter.src = return_arr['actual_mp3_url'];
93				change_preroll_mp3_to_actual_mp3 = true;
94			}
95		}
96		// ---------------------------.
97
98	  //if preroll not set then play as usual without setting .src above code.
99		aud_chapter.currentTime = totalSeconds; //chapter marker second.
100		aud_chapter.play();
101		jQuery('#pause-btn-'+player_unique_id).removeClass('hidden');
102
103		if (change_preroll_mp3_to_actual_mp3) {
104			// after play button check.
105			aud_chapter.onplay = function() {
106			   set_progress_bar_width(player_unique_id, 'onplay_event'); // only once
107			};
108			aud_chapter.ontimeupdate = function() {
109				
110			};
111			//set_progress_bar_width(player_unique_id);
112			//setTimeout(function(){ set_progress_bar_width(player_unique_id, 'settimeout_fun'); }, 2000); // after 2 seconds
113		}
114		
115	}
116	return false;
117}
118// WPB-6045.
119function set_progress_bar_width(player_unique_id, flag_chk = '') {
120	try {
121		var style_chk = jQuery("#wpb-jp-play-bar-"+player_unique_id).attr("style");
122		var progress_bar_width_value = 0;
123		var style_arr = style_chk.split(';');
124
125		for (let i = 0; i < style_arr.length; i++) {
126			var individual_ele = style_arr[i];
127			if (individual_ele) {
128				 var temp_arr = individual_ele.split(':');
129				 if (temp_arr.length == 2) {
130				 		var field_name = temp_arr[0];
131				 		var field_value = temp_arr[1];
132				 		if (field_name == 'width') {
133				 			progress_bar_width_value = field_value;
134				 		}
135				 }
136			}
137		}
138
139		var width_val = parseInt(progress_bar_width_value.replace("%", ""));
140		//var width_value = jQuery("#wpb-jp-play-bar-"+player_unique_id).css("width");
141
142		if (width_val > 100) {
143			jQuery("#wpb-jp-play-bar-"+player_unique_id).css({ 'width' : '0%' }); // more than one set to style attributes.
144		}
145		//width_value = jQuery("#wpb-jp-play-bar-"+player_unique_id).css("width");
146	}catch(e) { }
147}
148// ---------------------------------------------------

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.