PageSourceSearch

https://timesca.com/wp-content/themes/woodmart-child/wp-backend/assets/js/innerpage-scroll.js?ver=1790911392

js timesca.com collected 2026-10-02 03:29:35 UTC 13,924 bytes, 384 lines download raw bytes

1jQuery(document).ready(function ($) {
2  setTimeout(function () {
3    // Inner page line breck
4    var rightsideline = jQuery(".custom_main_bdy_inr_main").height();
5    var authordata = jQuery(".cstm-author-detail").height();
6    var dynamicHeight = rightsideline - authordata - 18;
7    var cssRule =
8      ".custom_main_bdy_inr_main::before { height: " +
9      dynamicHeight +
10      "px !important; }";
11    var styleElement = "<style type='text/css'>" + cssRule + "</style>";
12    jQuery("head").append(styleElement);
13  }, 1000);
14
15  setTimeout(function () {
16    var homefirstcontentHeight = jQuery("#main-banner-sec").outerHeight(true);
17    var homesecondcontentHeight = jQuery("#features").outerHeight(true);
18    var desktop_podcast = jQuery(".desktop_podcast").height();
19    var podcast_ctm_main_wrap = jQuery(".podcast_ctm_main_wrap").outerHeight(
20      true
21    );
22    var totalheight = homefirstcontentHeight + homesecondcontentHeight;
23    var leftsidetotalheight = desktop_podcast + 46;
24
25    if (jQuery(".home").length > 0) {
26      //jQuery("#cstm-post-list").addClass("addSidebarScrollhome");
27      jQuery(".demopodcast")
28        .siblings("#cstm-post-list")
29        .addClass("addSidebarScrollhome");
30      jQuery(".demopodcast")
31        .next("#cstm-post-list")
32        .addClass("addSidebarScrollhome");
33      jQuery(".demopodcast")
34        .parent()
35        .find("#cstm-post-list")
36        .addClass("addSidebarScrollhome");
37      if (jQuery(".podcast_ctm_main_right").length) {
38        jQuery(".podcast_ctm_main_right")
39          .find("h3")
40          .each(function () {
41            console.log("hasclass11");
42            jQuery(".addSidebarScrollhome").css(
43              "height",
44              totalheight - leftsidetotalheight
45            );
46          });
47      } else {
48        console.log("nothingskdnfhasclass");
49        jQuery(".addSidebarScrollhome").css("height", totalheight - 42);
50      }
51    } else {
52      // jQuery("#cstm-post-list").addClass("addSidebarScrollhome");
53      jQuery(".demopodcast")
54        .siblings("#cstm-post-list")
55        .addClass("addSidebarScrollhome");
56      jQuery(".demopodcast")
57        .next("#cstm-post-list")
58        .addClass("addSidebarScrollhome");
59      jQuery(".demopodcast")
60        .parent()
61        .find("#cstm-post-list")
62        .addClass("addSidebarScrollhome");
63      if (jQuery(".podcast_ctm_main_right").length) {
64        jQuery(".podcast_ctm_main_right")
65          .find("h3")
66          .each(function () {
67            console.log("hasclass");
68            jQuery(".addSidebarScrollhome").css(
69              "height",
70              totalheight - leftsidetotalheight
71            );
72          });
73      } else {
74        console.log("nothingskdnfhasclass");
75        jQuery(".addSidebarScrollhome").css("height", totalheight - 42);
76      }
77    }
78
79    jQuery(".addSidebarScrollhome").mCustomScrollbar({ theme: "minimal-dark" });
80  }, 1000);
81  setTimeout(function () {
82    // Article details page sidebar height dynamic
83    var sidebarHeight = jQuery(".widget-area").height();
84    var contentHeight = jQuery(".article-inner").height();
85    var tagHeight = jQuery(".post-tags").height();
86
87    if (sidebarHeight > contentHeight) {
88      setInterval(function () {
89        if (jQuery(".biography-dropmenu").hasClass("visible")) {
90          var authorbios = jQuery(".biography-dropmenu.visible").outerHeight(
91            true
92          );
93          var newContentHeight = authorbios + contentHeight;
94          var tagHeighttotal = tagHeight + 118;
95          jQuery(".wpb_raw_html").addClass("addSidebarScroll");
96          jQuery(".addSidebarScroll").css(
97            "height",
98            newContentHeight - tagHeighttotal
99          );
100          jQuery(".addSidebarScroll").mCustomScrollbar({
101            theme: "minimal-dark",
102          });
103        } else {
104          jQuery(".wpb_raw_html").addClass("addSidebarScroll");
105          var tagHeighttotal1 = tagHeight + 118;
106          jQuery(".addSidebarScroll").css(
107            "height",
108            contentHeight - tagHeighttotal1
109          );
110          jQuery(".addSidebarScroll").mCustomScrollbar({
111            theme: "minimal-dark",
112          });
113        }
114      }, 1000);
115    }
116  }, 1000);
117  // Hover Home page
118  jQuery(".cstm-lead-story-img-wrapper").mouseenter(function () {
119    jQuery(".home-banner-section-wrap").addClass("stoy_main_lead_hvr");
120  });
121
122  jQuery(".cstm-lead-story-img-wrapper")
123    .parent()
124    .mouseleave(function () {
125      jQuery(".home-banner-section-wrap").removeClass("stoy_main_lead_hvr");
126    });
127
128  // Text clear
129  jQuery(".cstm-opinion-title").css("text-transform", "none");
130});
131
132jQuery(document).ready(function ($) {
133  $(".article-body-container .entry-content img").each(function () {
134    if (!$(this).parent().hasClass("wp-caption")) {
135      var wpCaptionDiv = $(
136        '<div class="wp-caption alignnone no-captiontimeca"></div>'
137      );
138      // Insert the wp-caption div before the image
139      $(this).before(wpCaptionDiv);
140      // Move the image into the wp-caption div
141      wpCaptionDiv.append($(this));
142    }
143  });
144});
145
146jQuery(document).ready(function () {
147  jQuery(".entry-header img").each(function () {
148    var img = new Image();
149    img.src = jQuery(this).attr("src");
150    img.onload = function () {
151      var naturalWidth = this.naturalWidth;
152      var naturalHeight = this.naturalHeight;
153      var HeightWidthdiff = naturalWidth - naturalHeight;
154      var widhtdifftent = naturalWidth - naturalHeight;
155      if (naturalHeight > naturalWidth) {
156        if (naturalHeight - naturalWidth > 35) {
157          jQuery(".size-post-thumbnail").addClass("portraitsetwh");
158        }
159      } else {
160        if (widhtdifftent >= 100 && widhtdifftent <= 125) {
161          jQuery(".size-post-thumbnail").eq(index).addClass("portraitsetwh");
162        }
163      }
164    };
165  });
166
167  jQuery(".article-body-container .entry-content img").each(function (index) {
168    var img = new Image();
169    img.src = jQuery(this).attr("src");
170    img.onload = function () {
171      var naturalWidth = this.naturalWidth;
172      var naturalHeight = this.naturalHeight;
173
174      if (naturalHeight > naturalWidth) {
175        if (naturalHeight - naturalWidth > 180) {
176          jQuery(".article-body-container .entry-content img")
177            .eq(index)
178            .addClass("portraitsetwh");
179        }
180      }
181    };
182  });
183
184  jQuery(".gt_selector").on("select2:select", function (e) {
185    var evt = document.createEvent("HTMLEvents");
186    evt.initEvent("change", true, true);
187    document.querySelector("select.gt_selector").dispatchEvent(evt);
188  });
189});
190
191jQuery(document).ready(function () {
192  jQuery(".gt_selector").select2({
193    minimumResultsForSearch: -1,
194  });
195});
196
197// jQuery(document).ready(function () {
198//   jQuery(".play-button").click(function () {
199//     console.log("playbutton");
200//     var postId = jQuery(this).data("postid");
201//     var audio = jQuery("#audio-" + postId)[0];
202//     var progressBar = jQuery("#progress-bar-" + postId);
203//     var playButton = jQuery(this);
204
205//     if (audio.paused) {
206//       audio.play();
207//       playButton.html(
208//         '<svg width="22" height="27" viewBox="0 0 22 27" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.0307617" y="0.615479" width="7.07692" height="26.1846" fill="#F3F4EF"/><rect x="14.8923" y="0.615479" width="7.07692" height="26.1846" fill="#F3F4EF"/></svg>'
209//       );
210//       jQuery(".podcast_ctm_main_player").addClass("show_podcast");
211
212//       setInterval(function () {
213//         var progress = (audio.currentTime / audio.duration) * 100;
214//         progressBar.css("width", progress + "%");
215//       }, 1000);
216//     } else {
217//       audio.pause();
218//       jQuery(".podcast_ctm_main_player").removeClass("show_podcast");
219//       playButton.html(
220//         '<svg width="26" height="29" viewBox="0 0 26 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M25.8824 12.6471L0.176514 0.470589V28.8824L25.8824 12.6471Z" fill="currentColor"/></svg>'
221//       );
222//     }
223//   });
224// });
225
226jQuery(document).ready(function () {
227  // Function to format time in MM:SS format
228  function formatTime(time) {
229    var minutes = Math.floor(time / 60);
230    var seconds = Math.floor(time % 60);
231    return ("0" + minutes).slice(-2) + ":" + ("0" + seconds).slice(-2);
232  }
233
234  // Update duration display for each audio element
235  jQuery("audio").each(function () {
236    var audio = this;
237    var postId = jQuery(audio).data("postid");
238    var durationDisplay = jQuery(".total-duration");
239
240    // When audio is loaded, update duration display
241    audio.onloadedmetadata = function () {
242      var duration = audio.duration;
243      var durationFormatted = formatTime(duration);
244      durationDisplay.text(durationFormatted);
245    };
246
247    // If audio is already loaded (cached), trigger the event manually
248    if (audio.readyState > 0) {
249      audio.dispatchEvent(new Event("loadedmetadata"));
250    }
251  });
252
253  // Click event handler for play buttons
254  jQuery(".play-button").click(function () {
255    var postId = jQuery(this).data("postid");
256    var audio = jQuery("#audio-" + postId)[0];
257    var progressBar = jQuery(".one-progress-bar-" + postId);
258    var playButton = jQuery(this);
259    var currentTimeDisplay = jQuery(".current-time");
260
261    // Toggle play/pause functionality
262    if (audio.paused) {
263      jQuery(".podcast_ctm_main_player").addClass("show_podcast");
264      audio.play();
265      playButton.html(
266        '<svg width="22" height="27" viewBox="0 0 22 27" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.0307617" y="0.615479" width="7.07692" height="26.1846" fill="#F3F4EF"/><rect x="14.8923" y="0.615479" width="7.07692" height="26.1846" fill="#F3F4EF"/></svg>'
267      );
268    } else {
269      jQuery(".podcast_ctm_main_player").removeClass("show_podcast");
270      audio.pause();
271      playButton.html(
272        '<svg width="26" height="29" viewBox="0 0 26 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M25.8824 12.6471L0.176514 0.470589V28.8824L25.8824 12.6471Z" fill="currentColor"/></svg>'
273      );
274    }
275
276    // Update current time display during playback
277    audio.addEventListener("timeupdate", function () {
278      var currentTime = audio.currentTime;
279      var duration = audio.duration;
280      var progress = (currentTime / duration) * 100;
281      progressBar.css("width", progress + "%");
282      currentTimeDisplay.text(formatTime(currentTime));
283    });
284  });
285
286  // Click event handler for progress bar
287  // jQuery(".progress-bar").click(function (event) {
288  jQuery(document).on("click", ".progress-container", function (e) {
289    var postId = jQuery(this).data("postid");
290    var progressBar = jQuery(this);
291    var audio = jQuery("audio")[0];
292
293    // Calculate seek position
294    var progressWidth = progressBar.width();
295    var clickX = e.pageX - progressBar.offset().left;
296    var duration = audio.duration;
297    var seekTime = (clickX / progressWidth) * duration;
298
299    // Seek to the calculated time
300    audio.currentTime = seekTime;
301  });
302});
303
304jQuery(document).ready(function () {
305  setTimeout(function () {
306    if (
307      jQuery(".cstm-lead-story-content.col-md-6 .sub-lead.lead1.hidden")
308        .length > 0
309    ) {
310      jQuery(".home-banner-section-wrap").addClass("hide-background");
311
312      jQuery(".hide-background").css("background-image", "none");
313
314      var cstmdataheight = jQuery(".home-banner-section-wrap").height();
315
316      jQuery(".post-thumbnail").addClass("new_height_class");
317      jQuery(".new_height_class").css("height", cstmdataheight);
318      jQuery(".new_height_class").css("width", "100% !important");
319      if (jQuery(".post-thumbnail").hasClass("new_height_class")) {
320        var cstmdataheight = jQuery(".home-banner-section-wrap").height();
321        jQuery(".new_height_class img").css({
322          "object-fit": "cover",
323          width: "100%",
324          height: cstmdataheight,
325        });
326      }
327    } else {
328      jQuery(".home-banner-section-wrap").removeClass("hide-background");
329    }
330  }, 1000);
331  setTimeout(function () {
332    if (
333      jQuery(".cstm-lead-story-content.col-md-6 .sub-lead.lead2.hidden")
334        .length > 0
335    ) {
336      jQuery(".home-banner-section-wrap").addClass("hide-background");
337
338      jQuery(".hide-background").css("background-image", "none");
339
340      var cstmdataheight = jQuery(".home-banner-section-wrap").height();
341
342      jQuery(".post-thumbnail").addClass("new_height_class");
343      jQuery(".new_height_class").css("height", cstmdataheight);
344      jQuery(".new_height_class").css("width", "100% !important");
345      if (jQuery(".post-thumbnail").hasClass("new_height_class")) {
346        var cstmdataheight = jQuery(".home-banner-section-wrap").height();
347        jQuery(".new_height_class img").css({
348          "object-fit": "cover",
349          width: "100%",
350          height: cstmdataheight,
351        });
352      }
353    } else {
354      jQuery(".home-banner-section-wrap").removeClass("hide-background");
355    }
356  }, 1000);
357});
358
359jQuery(document).ready(function () {
360  // Initially hide .mobile-sidebar-recent-posts
361  jQuery(".mobile-sidebar-recent-posts").hide();
362
363  // Click event handler for #mobile_sidebar_section
364  jQuery(".mobile-sidebar-infobox").click(function (event) {
365    event.stopPropagation(); // Prevent event from bubbling up
366    jQuery(".mobile-sidebar-recent-posts").toggle();
367    jQuery(".mobile-sidebar-infobox").toggleClass("mobile_recent_select_open");
368  });
369
370  // Click event handler for closing .mobile-sidebar-recent-posts
371  jQuery(".mobile-sidebar-recent-posts").click(function (event) {
372    event.stopPropagation(); // Prevent event from bubbling up
373  });
374
375  // Click event handler for document to close .mobile-sidebar-recent-posts
376  jQuery(document).click(function (event) {
377    if (jQuery(".mobile-sidebar-recent-posts").is(":visible")) {
378      jQuery(".mobile-sidebar-recent-posts").hide();
379      jQuery(".mobile-sidebar-infobox").removeClass(
380        "mobile_recent_select_open"
381      );
382    }
383  });
384});

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.