PageSourceSearch

https://www.hankfmreno.com/wp-content/plugins/wpb-super-gallery/public/inc/js/wpb-slider.js

js hankfmreno.com collected 2026-10-10 01:26:10 UTC 8,486 bytes, 282 lines download raw bytes

1/*(function($){
2      $('.flexslider').flexslider({
3        animation: "slide",
4        animationLoop: false,
5        pauseOnHover: true,
6        smoothHeight: true,
7        start: function(slider){
8          $('body').removeClass('loading');
9        }
10      });
11})(jQuery);*/
12
13//WPB-536 -- changed all $ to jQuery and stop jquery old version as its common for all.
14(function($){
15  
16  console.log("super gallery >> wpb-slider.js........");
17
18var tag = document.createElement('script');
19  tag.id = 'iframe-demo';
20  tag.src = 'https://www.youtube.com/iframe_api';
21  var firstScriptTag = document.getElementsByTagName('script')[0];
22  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
23
24  var player;
25  function onYouTubeIframeAPIReady() {
26    player = new YT.Player('existing-iframe-example', {
27        events: {
28          'onReady': onPlayerReady,
29          'onStateChange': onPlayerStateChange
30        }
31    });
32
33  }
34  function onPlayerReady(event) {
35   event.target.playVideo();
36  }
37  function changeBorderColor(playerStatus) {
38    var color;
39    if (playerStatus == -1) {
40      color = "#37474F"; // unstarted = gray
41    } else if (playerStatus == 0) {
42      color = "#FFFF00"; // ended = yellow
43    } else if (playerStatus == 1) {
44      color = "#33691E"; // playing = green
45    } else if (playerStatus == 2) {
46      color = "#DD2C00"; // paused = red
47    } else if (playerStatus == 3) {
48      color = "#AA00FF"; // buffering = purple
49    } else if (playerStatus == 5) {
50      color = "#FF6DOO"; // video cued = orange
51    }
52    if (color) {
53      document.getElementById('existing-iframe-example').style.borderColor = color;
54    }
55  }
56  function onPlayerStateChange(event) {
57    changeBorderColor(event.data);
58  }
59
60  function getUrlVars() {
61    var url = window.location.href;
62    var hashes = url.split("?")[1];
63    var hash = hashes.split('&');
64
65    for (var i = 0; i < hash.length; i++) {
66      params=hash[i].split("=");
67      if(params[0] == 'slideid')
68        return true;
69    }
70    return false;
71  }
72
73  //console.log(wpbsliderobj);
74
75  if(getUrlVars){
76      console.log("flexslider here 1");
77
78      jQuery('.flexslider').flexslider({
79        animation: "slide",
80        pauseOnHover: true,
81        slideshowSpeed: wpbsliderobj.sliderSpeed,
82        smoothHeight: true,
83        animationDuration: 200,
84        animateHeight: false,
85        //slideshow:false,
86        slideshow:wpbsliderobj.autoSlide, //WPB-4534
87        startAt:wpbsliderobj.slideid,
88        controlNav: false,
89        start: function(){
90             jQuery('.flexImages').show(); 
91        },
92        /* after: function(slider){ 
93            slider.pause(); 
94            slider.play(); 
95        },*/
96      });
97    } else {
98
99       console.log("flexslider here 2");
100
101       jQuery('.flexslider').flexslider({
102        animation: "slide",
103        pauseOnHover: true,
104        slideshowSpeed: wpbsliderobj.sliderSpeed,
105        smoothHeight: true,
106        animationDuration: 200,
107        animateHeight: false,
108        slideshow:wpbsliderobj.autoSlide,
109        startAt:wpbsliderobj.slideid,
110        controlNav: false,
111        start: function(){
112             jQuery('.flexImages').show(); 
113        },
114         /*after: function(slider){ 
115            slider.pause(); 
116            slider.play(); 
117        },*/
118      });
119    }
120
121    jQuery('.flexslider ul.slides > li > img').each(function(){
122        var maxWidth = 0;
123        jQuery(this).find('.content img').each(function(){
124            var w = jQuery(this).width();
125            if (w > maxWidth) { 
126              maxWidth = w;
127            }
128        });
129        if (maxWidth) {
130          jQuery(this).css({width:maxWidth});
131        }
132    });  
133
134    //console.log('width'+$('.flex-viewport').width())
135    var flexContainerWidth = jQuery('.flex-viewport').width();
136    //console.log('flexContainerWidth : '+flexContainerWidth);
137
138    if(flexContainerWidth > 0){
139      var flexContainerHeight = flexContainerWidth*9/15;
140      jQuery(".flexslider .flex-viewport").css("height", flexContainerHeight);
141      jQuery(".flexslider .slides li").css("height", flexContainerHeight);
142      jQuery(".flexslider .slides li img").css("max-height", flexContainerHeight);
143    }
144
145    jQuery( window ).resize(function() {
146      var flexContainerWidth = jQuery('.flex-viewport').width();
147      if(flexContainerWidth > 0){
148        var flexContainerHeight = flexContainerWidth*9/15;
149        jQuery(".flexslider .flex-viewport").css("height", flexContainerHeight);
150        jQuery(".flexslider .slides li").css("height", flexContainerHeight);
151        jQuery(".flexslider .slides li img").css("max-height", flexContainerHeight);
152      }
153    });
154
155})(jQuery);
156
157
158//============================================================================
159
160//WPB-4265 --forcefully called on pjax end from podcast.js , bundle.js file.
161function pjax_check_supergallery_slider( $ ) {
162  
163  console.log("flexslider : pjax_check_supergallery_slider");
164
165  jQuery('.flexslider').flexslider({
166        animation: "slide",
167        pauseOnHover: true,
168        slideshowSpeed: wpbsliderobj.sliderSpeed,
169        smoothHeight: true,
170        animationDuration: 200,
171        animateHeight: false,
172        slideshow:false,
173        startAt:wpbsliderobj.slideid,
174        controlNav: false,
175        start: function(){
176             jQuery('.flexImages').show(); 
177        },
178  });
179
180}
181
182//WPB-4265
183function pjax_supergallery_flexslider_height( $ ) {
184
185  //<link rel='stylesheet' id='wpbg-flexslider-css-css'  href='/wp-content/plugins/wpb-super-gallery/public/inc/css/flexslider.css?ver=5.6.2' type='text/css' media='all' />
186  /*var tag = document.createElement('link');
187  tag.href = '/wp-content/plugins/wpb-super-gallery/public/inc/css/flexslider.css';
188  var firstStyleTag = document.getElementsByTagName('link')[0];
189  firstStyleTag.parentNode.insertBefore(tag, firstStyleTag);*/
190
191  console.log('Here >> pjax_supergallery_flexslider_height() func called now.....');
192
193  var flexContainerWidth = jQuery('.flex-viewport').width();
194  console.log('pjax_supergallery_flexslider_height() >> flexContainerWidth : '+flexContainerWidth);
195  if(flexContainerWidth > 0){
196    var flexContainerHeight = flexContainerWidth*9/15;
197    jQuery(".flexslider .flex-viewport").css("height", flexContainerHeight);
198    jQuery(".flexslider .slides li").css("height", flexContainerHeight);
199    jQuery(".flexslider .slides li img").css("max-height", flexContainerHeight);
200
201    //window.focus();
202  }
203
204  /*jQuery( window ).focus( function ( e ) {
205    //console.log('window focus.......');
206  });*/
207
208  jQuery('.flexslider ul.slides > li').each(function(){
209    var idOfLi = jQuery(this).attr('id');
210    //console.log(idOfLi);
211
212    //var maxWidth = '725px';
213    //jQuery(this).css({width:maxWidth});
214
215    //jQuery(this).css('width', '725.999px');
216
217    jQuery(this).css('width', flexContainerWidth+'px'); //we may need this.....
218
219  });
220
221  jQuery( window ).focus(); //need this for pjax.
222
223  jQuery('.flex-prev').on('click', function(){
224    console.log('here flex prev.......');
225    jQuery( window ).focus();
226
227    //jQuery('.flexslider').flexslider('prev');
228
229    //var href = jQuery(this).attr('href');
230    //jQuery('.flexslider').flexslider(href);
231
232    return false;
233  });
234
235  jQuery('.flex-next').on('click', function(){
236     console.log('here flex next.......');
237     jQuery( window ).focus();
238
239     //jQuery('.flexslider').flexslider('next');
240
241     //var href = jQuery(this).attr('href');
242     //jQuery('.flexslider').flexslider(href);
243
244     return false;
245  });
246
247  //jQuery('.flexImages').show();
248
249  //setTimeout(function(){ try { jQuery('.flexImages').show(); }catch(e){ } }, 1000);
250  //console.log('Here >> show flexImages.......');
251
252}//End of function pjax_supergallery_flexslider_height
253//============================================================================
254
255
256     /*function setEqualHeight(selector) {
257        var heights = new Array();
258
259        $(selector).each(function() {
260
261            $(this).css('min-height', '0');
262            $(this).css('max-height', 'none');
263            $(this).css('height', 'auto');
264
265            heights.push($(this).height());
266        });
267
268        var max = Math.max.apply( Math, heights );
269        console.log("max-"+max);
270    $(selector).each(function() {
271            $(this).css('height', max + 'px');
272        }); 
273    }
274
275        //setEqualHeight('.slides li');
276
277        $(window).resize(function() {
278
279            setTimeout(function() {
280                //setEqualHeight('.slides li');
281            }, 120);
282        });*/

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.