PageSourceSearch

https://organicthemes.com/wp-content/plugins/organic-blocks-bundle/js/flexslider-setup.js?ver=1690302143

js organicthemes.com collected 2026-10-02 04:29:29 UTC 6,075 bytes, 158 lines download raw bytes

1(function ($) {
2  'use strict'
3
4  /* Flexslider --------------------- */
5  function obbFlexSliderSetup () {
6    $('.obb-slideshow').each(function (index, obj) {
7      var slideshowID = obj.getAttribute('data-slide-id')
8      var slideCount = $('#' + slideshowID + ' .obb-flexslider').data('per-slide')
9      var smoothHeight = $('#' + slideshowID + ' .obb-flexslider').data('type') == 'testimonials' ? false : $('#' + slideshowID + ' .obb-flexslider').data('height')
10      // var slideshowID = $('.obb-content-slideshow').data('slide-id')
11      if (($).flexslider) {
12        if ($(window).width() <= 1024) {
13          $('#' + slideshowID + ' .obb-flexslider').flexslider({
14            slideshowSpeed: $('#' + slideshowID + ' .obb-flexslider').data('speed'),
15            animationDuration: 800,
16            animation: $('#' + slideshowID + ' .obb-flexslider').data('transition'),
17            video: false,
18            useCSS: false,
19            prevText: '<i class="fa fa-angle-left"></i>',
20            nextText: '<i class="fa fa-angle-right"></i>',
21            touch: false,
22            controlNav: true,
23            animationLoop: true,
24            smoothHeight: $('#' + slideshowID + ' .obb-flexslider').data('height'),
25            pauseOnAction: true,
26            pauseOnHover: true,
27            itemMargin: 0,
28            maxItems: 1,
29            minItems: 1,
30
31            start: function (slider) {
32              slider.removeClass('loading')
33              $('.preloader').hide()
34              $('.obb-flexslider').resize()
35              // $(window).trigger('resize')
36            }
37          })
38        } else if (slideCount !== 1) {
39          $('#' + slideshowID + ' .obb-flexslider').flexslider({
40            slideshowSpeed: $('#' + slideshowID + ' .obb-flexslider').data('speed'),
41            animationDuration: 800,
42            animation: $('#' + slideshowID + ' .obb-flexslider').data('transition'),
43            video: false,
44            useCSS: false,
45            prevText: '<i class="fa fa-angle-left"></i>',
46            nextText: '<i class="fa fa-angle-right"></i>',
47            touch: false,
48            controlNav: true,
49            animationLoop: true,
50            smoothHeight: smoothHeight,
51            pauseOnAction: true,
52            pauseOnHover: true,
53            itemWidth: 320, // Causes width load issue.
54            itemMargin: 0,
55            maxItems: $('#' + slideshowID + ' .obb-flexslider').data('per-slide'),
56            minItems: 1,
57            move: 1,
58
59            start: function (slider) {
60              slider.removeClass('loading')
61              slider.doMath()
62              $('.preloader').hide()
63              $('.obb-flexslider').resize()
64              // $(window).trigger('resize')
65            }
66          })
67        } else {
68          $('#' + slideshowID + ' .obb-flexslider').flexslider({
69            slideshowSpeed: $('#' + slideshowID + ' .obb-flexslider').data('speed'),
70            animationDuration: 800,
71            animation: $('#' + slideshowID + ' .obb-flexslider').data('transition'),
72            video: false,
73            useCSS: false,
74            prevText: '<i class="fa fa-angle-left"></i>',
75            nextText: '<i class="fa fa-angle-right"></i>',
76            touch: false,
77            controlNav: true,
78            animationLoop: true,
79            smoothHeight: smoothHeight,
80            pauseOnAction: true,
81            pauseOnHover: true,
82            itemWidth: 320, // Fixes width load issue.
83            itemMargin: 0,
84            maxItems: $('#' + slideshowID + ' .obb-flexslider').data('per-slide'),
85            minItems: 1,
86
87            start: function (slider) {
88              slider.removeClass('loading')
89              $('.preloader').hide()
90              $('.obb-flexslider').resize()
91              // $(window).trigger('resize')
92            }
93          })
94        }
95      }
96    })
97  }
98
99  function modifyStyles () {
100    $('.obb-slideshow').each(function (index, obj) {
101      var slideshowID = obj.getAttribute('data-slide-id')
102      var slideNav = $('#' + slideshowID).data('slide-nav')
103      var slideArrows = $('#' + slideshowID).data('slide-arrows')
104      var slideCount = $('#' + slideshowID + ' .obb-flexslider').data('per-slide')
105      if (slideNav === '') {
106        $('#' + slideshowID + ' .flex-control-nav').css('display', 'none')
107      }
108      if (slideArrows === '') {
109        $('#' + slideshowID + ' .flex-direction-nav').css('display', 'none')
110      }
111      if (slideCount === 1) {
112        $('#' + slideshowID).removeClass('obb-multi-posts-slide')
113      }
114    })
115  }
116
117  // When certain blocks are clicked or after a delay, trigger the window resize event
118  function resizeSlider() {
119    $('.wp-block[data-type="obb/slideshow-block"], .wp-block[data-type="obb/testimonial-block"], .edit-post-visual-editor .organic-slideshow-block, .edit-post-visual-editor .organic-testimonial-block')
120      .on('click', function () {
121        $(window).trigger('resize');
122    });
123  }
124
125  $(window).on('load', obbFlexSliderSetup)
126  $(window).on('resize', obbFlexSliderSetup)
127  $(window).on('load', modifyStyles)
128  $(window).on('resize', modifyStyles)
129  $(document).ready(resizeSlider)
130
131  // Load flexslider in FSE. Hacky, but necessary until editor improves.
132  // $('iframe.edit-site-visual-editor__editor-canvas').ready(function (e) {
133  //   // On initial load.
134  //   setTimeout(function () {
135  //     // console.log('I loaded!')
136  //     resizeSlider()
137  //   }, 4500)
138  //   // On scroll within FSE iframe.
139  //   $(this).on('scroll', function () {
140  //     // console.log('I scrolled!')
141  //     resizeSlider()
142  //   })
143  //   // On click within FSE iframe.
144  //   $(this).contents().bind('click', function (e) {
145  //     setTimeout(function () {
146  //       // console.log('I clicked!')
147  //       window.triggerReload = function () {
148  //         resizeSlider()
149  //       }
150  //       window.triggerReload()
151  //     }, 1500)
152  //   })
153  //   // $(this).contents().bind('keyup', function (e) {
154  //   //   console.log('I changed!')
155  //   //   obbFlexSliderSetup()
156  //   // })
157  // })
158})(jQuery)

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.