PageSourceSearch

https://kunnamas.com/wp-content/plugins/c0HI0zyPYBpG-dzs-videogallery/libs/ultibox/ultibox.js?ver=12.26

js kunnamas.com collected 2026-10-07 18:54:16 UTC 43,878 bytes, 1,479 lines download raw bytes

1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2var svg_close_btn = '<svg enable-background="new 0 0 40 40" id="" version="1.1" viewBox="0 0 40 40" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M28.1,26.8c0.4,0.4,0.4,1,0,1.4c-0.2,0.2-0.5,0.3-0.7,0.3s-0.5-0.1-0.7-0.3l-6.8-6.8l-6.8,6.8c-0.2,0.2-0.5,0.3-0.7,0.3   s-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l6.8-6.8l-6.8-6.8c-0.4-0.4-0.4-1,0-1.4c0.4-0.4,1-0.4,1.4,0l6.8,6.8l6.8-6.8   c0.4-0.4,1-0.4,1.4,0c0.4,0.4,0.4,1,0,1.4L21.3,20L28.1,26.8z"/></g><g><path d="M19.9,40c-11,0-20-9-20-20s9-20,20-20c4.5,0,8.7,1.5,12.3,4.2c0.4,0.3,0.5,1,0.2,1.4c-0.3,0.4-1,0.5-1.4,0.2   c-3.2-2.5-7-3.8-11-3.8c-9.9,0-18,8.1-18,18s8.1,18,18,18s18-8.1,18-18c0-3.2-0.9-6.4-2.5-9.2c-0.3-0.5-0.1-1.1,0.3-1.4   c0.5-0.3,1.1-0.1,1.4,0.3c1.8,3.1,2.8,6.6,2.8,10.2C39.9,31,30.9,40,19.9,40z"/></g></svg>';
3var svg_right_arrow = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 22.062 22.062" style="enable-background:new 0 0 22.062 22.062;" xml:space="preserve" width="512px" height="512px"> <g> <path d="M10.544,11.031l6.742-6.742c0.81-0.809,0.81-2.135,0-2.944l-0.737-0.737 c-0.81-0.811-2.135-0.811-2.945,0L4.769,9.443c-0.435,0.434-0.628,1.017-0.597,1.589c-0.031,0.571,0.162,1.154,0.597,1.588 l8.835,8.834c0.81,0.811,2.135,0.811,2.945,0l0.737-0.737c0.81-0.808,0.81-2.134,0-2.943L10.544,11.031z" fill="#696969"/> </g> </svg> ';
4
5window.get_query_arg = function (purl, key) {
6  if (purl.indexOf(key + '=') > -1) {
7    var regexS = "[?&]" + key + "(.+?)(?=&|$)";
8    var regex = new RegExp(regexS);
9    var regtest = regex.exec(purl);
10
11    if (regtest != null) {
12      if (regtest[1]) {
13        var aux = regtest[1].replace(/=/g, '');
14        return aux;
15      } else {
16        return '';
17      }
18    }
19  }
20};
21
22window.add_query_arg = function (purl, key, value) {
23  key = encodeURIComponent(key);
24  value = encodeURIComponent(value);
25  var s = purl;
26  var pair = key + "=" + value;
27  var r = new RegExp("(&|\\?)" + key + "=[^\&]*");
28  s = s.replace(r, "$1" + pair);
29  var addition = '';
30
31  if (s.indexOf(key + '=') > -1) {} else {
32    if (s.indexOf('?') > -1) {
33      addition = '&' + pair;
34    } else {
35      addition = '?' + pair;
36    }
37
38    s += addition;
39  } //if value NaN we remove this field from the url
40
41
42  if (value == 'NaN') {
43    var regex_attr = new RegExp('[\?|\&]' + key + '=' + value);
44    s = s.replace(regex_attr, '');
45  }
46
47  return s;
48};
49
50function init_jquery_helpers() {
51  jQuery.fn.outerHTML = function (e) {
52    return e ? this.before(e).remove() : jQuery("<p>").append(this.eq(0).clone()).html();
53  };
54
55  jQuery.fn.prependOnce = function (arg, argfind) {
56    var _t = jQuery(this); // It's your element
57
58
59    if (typeof argfind == 'undefined') {
60      var regex = new RegExp('class="(.*?)"');
61      var auxarr = regex.exec(arg);
62
63      if (typeof auxarr[1] != 'undefined') {
64        argfind = '.' + auxarr[1];
65      }
66    } // we compromise chaining for returning the success
67
68
69    if (_t.children(argfind).length < 1) {
70      _t.prepend(arg);
71
72      return true;
73    } else {
74      return false;
75    }
76  };
77
78  jQuery.fn.appendOnce = function (arg, argfind) {
79    var _t = jQuery(this); // It's your element
80
81
82    if (typeof argfind == 'undefined') {
83      var regex = new RegExp('class="(.*?)"');
84      var auxarr = regex.exec(arg);
85
86      if (typeof auxarr[1] != 'undefined') {
87        argfind = '.' + auxarr[1];
88      }
89    }
90
91    if (_t.children(argfind).length < 1) {
92      _t.append(arg);
93
94      return true;
95    } else {
96      return false;
97    }
98  };
99}
100
101module.exports.detect_ultibox_media_type = function (arg, suggestedMediaType = 'image') {
102  var type = suggestedMediaType;
103
104  if (arg) {
105    if (arg.indexOf('.mp4') >= arg.length - 4 || arg.indexOf('.m4v') >= arg.length - 4) {
106      type = 'video';
107    }
108
109    if (arg.indexOf('.mp3') >= arg.length - 4 || arg.indexOf('.m4a') >= arg.length - 4) {
110      type = 'audio';
111    }
112
113    if (arg.indexOf('#') === 0 || arg.indexOf('.') === 0) {
114      type = 'inlinecontent';
115    }
116  }
117
118  return type;
119};
120
121module.exports.svg_close_btn = svg_close_btn;
122module.exports.svg_right_arrow = svg_right_arrow;
123module.exports.init_jquery_helpers = init_jquery_helpers;
124
125},{}],2:[function(require,module,exports){
126// -- DZS Ultibox
127// @version 1.23
128// @this is not free software
129// -- DZS Ultibox == copyright == http://digitalzoomstudio.net
130"use strict";
131
132const ultiboxHelpers = require('./jsinc/_ultibox_helpers');
133
134Object.size = function (obj) {
135  var size = 0,
136      key;
137
138  for (key in obj) {
139    if (obj.hasOwnProperty(key)) size++;
140  }
141
142  return size;
143};
144
145if (window.jQuery == undefined) {
146  console.log("jquery not detected ? ");
147  setTimeout(() => {
148    ultiboxHelpers.init_jquery_helpers();
149  }, 500);
150} else {
151  ultiboxHelpers.init_jquery_helpers();
152}
153
154window.dzstaa_self_options = {};
155window.dzsulb_inited = false;
156
157Math.easeIn = function (t, b, c, d) {
158  return -c * (t /= d) * (t - 2) + b;
159};
160
161(function ($) {
162  var svg_close_btn = ultiboxHelpers.svg_close_btn;
163  var svg_right_arrow = ultiboxHelpers.svg_right_arrow;
164  var _maincon = null,
165      _boxMainsCon = null,
166      _galleryClipCon = null,
167      _galleryItemsCon = null,
168      _boxMain = null,
169      _boxMainMediaCon = null,
170      _boxMainMedia = null,
171      _boxMainRealMedia = null // -- temp, the real media
172  ,
173      _boxMainUnder = null;
174  var id_main = '';
175  var media_ratio_w_h = 0,
176      media_w = 0,
177      media_h = 0,
178      media_finalw = 0,
179      media_finalh = 0,
180      media_has_under_description = false,
181      opts_max_width = 0,
182      currNr_gal = -1,
183      bmc_w = 0 // -- box-mains-con width
184  ,
185      bmc_h = 0 // -- box-mains-con height
186  ,
187      scaling = 'proportional' // -- proportional or fill
188  ,
189      ww = 0,
190      wh = 0,
191      gallery_setup = '' // -- the gallery curently setup
192  ,
193      $ultibox_items_arr = [],
194      theurl = window.location.href;
195  var lastargs = null,
196      lastlastargs = null;
197  var padding_hor = 30,
198      padding_ver = 30,
199      offset_v = 30;
200  var inter_calculate_dims_light = 0; // Starting time and duration.
201
202  var _inline_content_orig_parent = null,
203      _inline_content_orig_prev = null,
204      _inline_content_orig_parent_last = null,
205      _inline_content_orig_prev_last = null;
206  var func_callback = null;
207  var ultibox_curr_margs = {};
208  var ultibox_options = {
209    'transition': 'slideup',
210    'transition_out': 'same-as-in',
211    'skin': 'skin-default',
212    settings_deeplinking: "on",
213    nav_mode: "thumbs" // -- thumbs or none
214    ,
215    settings_enable_arrows: "auto",
216    extra_classes: "",
217    gallery_type: "skin-default",
218    videoplayer_settings: {
219      'autoplay': 'off',
220      'design_skin': 'skin_reborn',
221      settings_youtube_usecustomskin: 'on',
222      'cue': 'on'
223    },
224    audioplayer_settings: {}
225  };
226  var svg_play = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="13.75px" height="12.982px" viewBox="0 0 13.75 12.982" enable-background="new 0 0 13.75 12.982" xml:space="preserve"> <path d="M11.889,5.71L3.491,0.108C3.389,0.041,3.284,0,3.163,0C2.834,0,2.565,0.304,2.565,0.676H2.562v11.63h0.003 c0,0.372,0.269,0.676,0.597,0.676c0.124,0,0.227-0.047,0.338-0.115l8.389-5.595c0.199-0.186,0.326-0.467,0.326-0.781 S12.088,5.899,11.889,5.71z"/> </svg>';
227
228  var _body = $('body').eq(0);
229
230  var _html = $('html').eq(0);
231
232  window.dzsulb_main_init = dzsulb_main_init;
233
234  function dzsulb_main_init() {
235    if (_maincon) {
236      return false;
237    }
238
239    _body = $('body').eq(0);
240    _html = $('html').eq(0);
241
242    if (window.ultibox_options_init) {
243      ultibox_options = $.extend(ultibox_options, window.ultibox_options_init);
244    }
245
246    offset_v = ultibox_options.offset_v;
247    var aux = '<div class="dzsulb-main-con ' + ultibox_options.skin + ' ' + ultibox_options.extra_classes + ' gallery-' + ultibox_options.gallery_type + '">';
248
249    if (ultibox_options.skin == 'skin-default') {
250      if (ultibox_options.settings_enable_arrows == 'auto') {}
251    }
252
253    aux += '<div class="overlay-background"></div>';
254    aux += '<div class="dzsulb-preloader preloader-fountain" > <div id="fountainG_1" class="fountainG"></div> <div id="fountainG_2" class="fountainG"></div> <div id="fountainG_3" class="fountainG"></div> <div id="fountainG_4" class="fountainG"></div> </div>';
255    aux += '<div class="box-mains-con">';
256    aux += '</div><!-- end .box-mains-con-->';
257
258    if (ultibox_options.nav_mode == 'thumbs') {
259      aux += '<div class="gallery-clip-con"><div class="gallery-items-con">';
260      aux += '</div></div><!-- end .gallery-clip-con-->';
261    }
262
263    aux += '</div>';
264
265    _body.append(aux);
266
267    _maincon = _body.children('.dzsulb-main-con').eq(0);
268    _boxMainsCon = _maincon.find('.box-mains-con').eq(0);
269    _galleryClipCon = _maincon.find('.gallery-clip-con').eq(0);
270    _galleryItemsCon = _maincon.find('.gallery-items-con').eq(0);
271
272    if (ultibox_options.transition == 'default') {
273      ultibox_options.transition = 'fade';
274    }
275
276    if (ultibox_options.transition_out == 'same-as-in') {
277      ultibox_options.transition_out = ultibox_options.transition;
278    }
279
280    _maincon.addClass('transition-' + ultibox_options.transition);
281
282    _maincon.on('click', '>.overlay-background, .close-btn-con, .ultibox-close-btn, .gallery-items-con > .gallery-thumb, .ultibox-gallery-arrow,.ultibox-prev-btn,.ultibox-next-btn', handle_mouse);
283
284    _maincon.on('wheel', '.box-main.scroll-mode,.gallery-items-con.scroll-mode', handle_scroll);
285
286    check_deeplink();
287    window.close_ultibox = close_ultibox;
288
289    window.api_ultibox_set_callback_func = function (argo) {
290      func_callback = argo;
291    };
292
293    $(window).on('resize', handle_resize);
294    handle_resize();
295  }
296
297  function check_deeplink() {
298    if (theurl.indexOf('ultibox=') > -1) {
299      if (get_query_arg(theurl, 'ultibox')) {
300        var tempNr = parseInt(get_query_arg(theurl, 'ultibox'), 10);
301
302        if (String(tempNr) !== 'NaN') {
303          // -- if it is a number
304          if (tempNr > -1) {
305            // -- lets see if we have it .. if we don t
306            if ($('.ultibox-item,.ultibox-item-delegated').eq(tempNr).length) {
307              open_ultibox($('.ultibox-item,.ultibox-item-delegated').eq(tempNr), null, {
308                from_deeplink: tempNr,
309                call_from: 'check_deeplink'
310              });
311            } else {
312              setTimeout(function () {
313                open_ultibox($('.ultibox-item,.ultibox-item-delegated').eq(tempNr), null, {
314                  from_deeplink: tempNr,
315                  call_from: 'check_deeplink'
316                });
317              }, 1500);
318            } // -- let us try again
319
320          }
321        } else {
322          var auxobj = $('#' + get_query_arg(theurl, 'ultibox'));
323          open_ultibox(auxobj, null, {
324            from_deeplink: '#' + get_query_arg(theurl, 'ultibox'),
325            call_from: 'check_deeplink'
326          });
327        }
328      }
329    }
330  }
331
332  function handle_scroll(e) {
333    var _t = $(this); // -- this is where the scrolling happens
334
335
336    if (_t.hasClass('box-main')) {
337      var ch = wh;
338
339      var th = _boxMain.children('.box-main-media-con').eq(0).outerHeight();
340
341      var auxY = parseInt(_boxMain.css('top')) + Number(e.originalEvent.wheelDelta) * 10;
342
343      if (auxY > offset_v) {
344        auxY = offset_v;
345      }
346
347      if (auxY < ch - th - offset_v - (wh - _boxMain.parent().outerHeight())) {
348        auxY = ch - th - offset_v - (wh - _boxMain.parent().outerHeight());
349      }
350
351      _boxMain.css({});
352    }
353
354    if (_t.hasClass('gallery-items-con')) {
355      var cw = ww;
356
357      var tw = _galleryItemsCon.outerWidth();
358
359      var auxX = parseInt(_galleryItemsCon.css('left')) + Number(e.originalEvent.wheelDelta) * 10;
360
361      if (auxX > 30) {
362        auxX = 30;
363      }
364
365      if (auxX < cw - tw - 30) {
366        auxX = cw - tw - 30;
367      }
368
369      _galleryItemsCon.css({
370        'left': auxX
371      });
372    }
373  }
374
375  function handle_mouse(e) {
376    var _t = $(this);
377
378    if (e.type === 'click') {
379      if (_t.hasClass('overlay-background')) {
380        close_ultibox();
381      }
382
383      if (_t.hasClass('close-btn-con') || _t.hasClass('ultibox-close-btn')) {
384        close_ultibox();
385      }
386
387      if (_t.hasClass('gallery-thumb')) {
388        var ind = _t.parent().children().index(_t);
389
390        goto_gallery_item(ind);
391      }
392
393      if (_t.hasClass('ultibox-gallery-arrow--left')) {
394        goto_gallery_item_prev();
395      }
396
397      if (_t.hasClass('ultibox-gallery-arrow--right')) {
398        goto_gallery_item_next();
399      } // -- loaded-item next, .zoomed next
400
401    }
402  }
403
404  function handle_mouse_item(e) {
405    var _t = $(this);
406
407    if (e.type === 'click') {
408      if (_t.hasClass('')) {}
409
410      open_ultibox(_t, null); // -- loaded-item next, .zoomed next
411    }
412  }
413
414  function goto_gallery_item_prev() {
415    var tempNr = currNr_gal;
416    tempNr--;
417    var gal_nr_items = 0;
418
419    if (_galleryItemsCon.length) {
420      gal_nr_items = _galleryItemsCon.children().length;
421    } else {
422      gal_nr_items = $('*[data-biggallery="' + ultibox_curr_margs.biggallery + '"]').length;
423    }
424
425    if (tempNr < 0) {
426      tempNr = gal_nr_items - 1;
427    }
428
429    goto_gallery_item(tempNr);
430    return false;
431  }
432
433  function goto_gallery_item_next() {
434    var tempNr = currNr_gal;
435    tempNr++;
436    var gal_nr_items = 0;
437
438    if (_galleryItemsCon.length) {
439      gal_nr_items = _galleryItemsCon.children().length;
440    } else {
441      gal_nr_items = $('*[data-biggallery="' + ultibox_curr_margs.biggallery + '"]').length;
442    }
443
444    if (tempNr >= gal_nr_items) {
445      tempNr = 0;
446    }
447
448    goto_gallery_item(tempNr);
449    return false;
450  }
451
452  function goto_gallery_item(arg) {
453    var _c = null;
454    var gallery_selection_mode = 'gallery-items';
455
456    if (_galleryItemsCon.length && _galleryItemsCon.children().length) {
457      _c = _galleryItemsCon.children().eq(arg);
458      gallery_selection_mode = 'gallery-items';
459    } else {
460      _c = $('*[data-biggallery="' + ultibox_curr_margs.biggallery + '"]').eq(arg);
461      gallery_selection_mode = 'this is the item';
462    }
463
464    if (_c) {}
465
466    if (currNr_gal > -1) {
467      if (arg < currNr_gal) {
468        _maincon.addClass('gallery-direction-reverse');
469      }
470
471      if (arg === currNr_gal) {
472        return false;
473      }
474    } // -- if we have _c parent-item property
475
476
477    if (_c) {
478      window.ultibox_countdown = false;
479
480      if (gallery_selection_mode === 'gallery-items') {
481        if (_c.data('parent-item')) {
482          open_ultibox(_c.data('parent-item'), {
483            'call_from': 'gallery_item'
484          });
485        }
486      }
487
488      if (gallery_selection_mode === 'this is the item') {
489        open_ultibox(_c, {
490          'call_from': 'gallery_item'
491        });
492      }
493
494      currNr_gal = arg;
495      restore_target_div();
496
497      if (_galleryItemsCon) {
498        _galleryItemsCon.children().removeClass('active');
499
500        setTimeout(function () {
501          _galleryItemsCon.children().eq(currNr_gal).addClass('active');
502        }, 100);
503      }
504    }
505  }
506
507  window.ultibox_reset_cooldown = function () {};
508  /**
509   * main open ultibox
510   * @param _arg
511   * @param pargs
512   * @returns {boolean}
513   */
514
515
516  window.open_ultibox = function (_arg, pargs) {
517    var margs = {
518      type: 'detect',
519      video_type: 'detect',
520      audio_type: 'detect',
521      audio_thumb: '',
522      source: '',
523      max_width: 'default' // -- this is useful for under description feed and is mandatory actually
524      ,
525      under_description: '' // -- this is the under description
526      ,
527      right_description: '' // -- this is the under description
528      ,
529      scaling: 'proportional' // -- this is the under description
530      ,
531      inline_content_move: 'off',
532      suggested_width: '',
533      suggested_height: '',
534      box_bg: '',
535      biggallery: '',
536      call_from: 'default',
537      forcenodeeplink: 'off',
538      _targetDiv: null,
539      item: null // -- we can pass the items from here too
540
541    };
542
543    if (pargs) {
544      margs = $.extend(margs, pargs);
545    }
546
547    if (window.ultibox_countdown) {
548      return false;
549    }
550
551    window.ultibox_countdown = true;
552    setTimeout(function () {
553      window.ultibox_reset_cooldown();
554    }, 100);
555    let suggestedMediaType = 'image';
556
557    if (_arg) {
558      if (_arg.attr('data-source')) {
559        margs.source = _arg.attr('data-source');
560      } else {
561        if (_arg.attr('data-src')) {
562          margs.source = _arg.attr('data-src');
563        } else {
564          if (_arg.attr('data-sourcevp')) {
565            // -- if it's video we might be looking for data-sourcevp
566            margs.source = _arg.attr('data-sourcevp');
567            suggestedMediaType = 'video';
568          } else {
569            if (_arg.attr('href')) {
570              margs.source = _arg.attr('href');
571              suggestedMediaType = 'iframe';
572            }
573          }
574        }
575      }
576
577      if (_arg.attr('data-type')) {
578        margs.type = _arg.attr('data-type');
579
580        if (margs.type === 'vimeo') {
581          margs.type = 'video';
582          margs.video_type = 'vimeo';
583        }
584
585        if (margs.type === 'youtube') {
586          margs.type = 'video';
587          margs.video_type = 'youtube';
588        }
589      } else {
590        margs.type = ultiboxHelpers.detect_ultibox_media_type(margs.source, suggestedMediaType);
591      }
592
593      if (_arg.attr('data-scaling')) {
594        margs.scaling = _arg.attr('data-scaling');
595      }
596
597      if (_arg.attr('data-box-bg')) {
598        margs.box_bg = _arg.attr('data-box-bg');
599      }
600
601      if (_arg.attr('data-audio-thumb')) {
602        margs.audio_thumb = _arg.attr('data-audio-thumb');
603      }
604
605      if (_arg.attr('data-inline-move')) {
606        margs.inline_content_move = _arg.attr('data-inline-move');
607      }
608
609      if (_arg.next().hasClass('feed-ultibox-desc') || _arg.children().hasClass('feed-ultibox-desc')) {
610        var _c = null;
611
612        if (_arg.next().hasClass('feed-ultibox-desc')) {
613          _c = _arg.next();
614        }
615
616        if (_arg.children('.feed-ultibox-desc').length) {
617          _c = _arg.children('.feed-ultibox-desc').eq(0);
618        }
619
620        margs.under_description = _c.html();
621      }
622
623      if (_arg.attr('data-suggested-width')) {
624        margs.suggested_width = _arg.attr('data-suggested-width');
625      }
626
627      if (_arg.attr('data-force-nodeeplink')) {
628        margs.forcenodeeplink = _arg.attr('data-force-nodeeplink');
629      }
630
631      if (_arg.attr('data-suggested-height')) {
632        margs.suggested_height = _arg.attr('data-suggested-height');
633      }
634
635      if (typeof _arg != 'string') {
636        margs.item = _arg;
637      }
638
639      if (_arg.attr('data-biggallery')) {
640        margs.biggallery = _arg.attr('data-biggallery');
641      }
642    }
643
644    if (margs.type === 'video') {
645      if (margs.video_type === 'detect') {
646        if (margs.item && margs.item.attr('data-video-type')) {
647          margs.video_type = margs.item.attr('data-video-type');
648        }
649      }
650
651      if (margs.video_type === 'detect') {
652        if (margs.source.indexOf('youtube.com/') > -1) {
653          margs.video_type = 'youtube';
654          margs.source = get_query_arg(margs.source, 'v');
655        }
656      }
657
658      if (margs.video_type === 'detect') {
659        margs.video_type = 'video';
660      }
661    }
662
663    if (margs.type === 'audio') {
664      if (margs.audio_type === 'detect') {
665        margs.audio_type = 'audio';
666      }
667    }
668
669    if (margs.type === 'inlinecontent') {
670      margs._targetDiv = $(margs.source).eq(0);
671    }
672
673    if (margs.under_description) {
674      if (margs.max_width === 'default') {
675        margs.max_width = 400;
676      }
677    }
678
679    if (margs.biggallery) {}
680
681    ultibox_curr_margs = $.extend({}, margs);
682
683    _maincon.removeClass('disabled');
684
685    _html.addClass('ultibox-opened');
686
687    setTimeout(function () {
688      _maincon.addClass('loading-item');
689
690      if (margs.type === 'image') {
691        var newImg = new Image();
692
693        newImg.onload = function () {
694          media_w = this.naturalWidth;
695          media_h = this.naturalHeight;
696          setup_media(margs);
697        };
698
699        newImg.src = margs.source;
700      }
701
702      if (margs.type === 'video') {
703        media_w = 800;
704        media_h = 454;
705
706        if (margs.video_type === 'video' || margs.video_type === 'youtube' || margs.video_type === 'vimeo') {
707          if ($.fn.vPlayer) {
708            setup_media(margs);
709          } else {
710            console.warn("You need videogallery embedded");
711            close_ultibox();
712          }
713        }
714      }
715
716      if (margs.type === 'audio') {
717        media_w = 800;
718        media_h = 'auto';
719
720        if (margs.audio_type === 'audio') {
721          if ($.fn.audioplayer) {
722            setup_media(margs);
723          } else {
724            console.warn("You need zoomsounds embedded");
725            close_ultibox();
726          }
727        }
728      }
729
730      if (margs.type === 'iframe') {
731        media_w = 800;
732        media_h = 600;
733        setup_media(margs);
734      }
735
736      if (margs.type === 'inlinecontent') {
737        media_w = 800;
738        media_h = 'auto';
739        setup_media(margs);
740      }
741    }, 100);
742
743    if (ultibox_options.settings_deeplinking === 'on' && can_history_api() === true && margs.forcenodeeplink !== 'on') {
744      $ultibox_items_arr = $('.ultibox-item,.ultibox-item-delegated');
745
746      if (margs.item && margs.item.attr('data-ultibox-sort')) {}
747
748      var ind = $ultibox_items_arr.index(margs.item);
749
750      if (typeof $(margs.item).attr('id') != 'undefined') {
751        var aux = encodeURIComponent($(margs.item).attr('id'));
752        aux = aux.replace(/%/g, "8767");
753        ind = aux;
754      }
755
756      theurl = window.location.href;
757      var newurl = add_query_arg(theurl, 'ultibox', ind);
758
759      if (newurl.indexOf(' ') > -1) {
760        newurl = newurl.replace(' ', '%20');
761      }
762
763      theurl = newurl;
764      history.pushState({}, "", newurl);
765    }
766  };
767
768  function setup_media(margs) {
769    // -- appends the item to the DOM but does not necesarrly append the loaded event , that is appended only when the media is ( allegedly )
770    if (margs.suggested_width) {
771      if (isNaN(Number(margs.suggested_width)) === false) {
772        media_w = Number(margs.suggested_width);
773      } else {
774        media_w = margs.suggested_width;
775      }
776    }
777
778    if (margs.suggested_height) {
779      if (isNaN(Number(margs.suggested_height)) === false) {
780        media_h = Number(margs.suggested_height);
781      } else {
782        media_h = margs.suggested_height;
783      }
784    }
785
786    if (isNaN(Number(margs.suggested_height)) === false) {
787      media_ratio_w_h = media_w / media_h;
788    } else {
789      media_ratio_w_h = 1;
790    }
791
792    scaling = margs.scaling;
793    var structureBoxMain = '';
794
795    if (margs.call_from == 'gallery_item') {
796      _boxMain.addClass('gallery-transitioning-out');
797    } else {
798      if (_boxMain) {
799        _boxMain.addClass('transitioning-out');
800      }
801    }
802
803    structureBoxMain += '<div class="box-main type-' + margs.type;
804
805    if (margs.call_from == 'gallery_item') {
806      structureBoxMain += ' gallery-preparing-transitioning-in';
807      setTimeout(function () {
808        _boxMain.addClass('gallery-transitioning-in');
809      }, 10);
810      setTimeout(function () {
811        _maincon.find('.box-main.gallery-transitioning-out').remove();
812
813        _boxMain.removeClass('gallery-transitioning-in');
814
815        _boxMain.removeClass('gallery-preparing-transitioning-in');
816
817        _maincon.removeClass('gallery-direction-reverse');
818      }, 500);
819    }
820
821    structureBoxMain += '">';
822    structureBoxMain += '<div class="box-main-media-con transition-target">';
823    structureBoxMain += '<div class="close-btn-con"> ' + svg_close_btn + '</div>';
824    structureBoxMain += '<div class="box-main-media type-' + margs.type + '" style="';
825
826    if (margs.box_bg) {
827      structureBoxMain += 'background-color: ' + margs.box_bg + ';';
828    }
829
830    structureBoxMain += '"></div><div class="box-main-under"></div>';
831
832    if (ultibox_options.settings_enable_arrows === 'on') {
833      structureBoxMain += '<div class="ultibox-gallery-arrow ultibox-gallery-arrow--left">' + svg_right_arrow + '</div>';
834      structureBoxMain += '<div class="ultibox-gallery-arrow ultibox-gallery-arrow--right">' + svg_right_arrow + '</div>';
835    }
836
837    structureBoxMain += '</div></div>';
838
839    _boxMainsCon.append(structureBoxMain);
840
841    _boxMain = _maincon.find('.box-main:not(.gallery-transitioning-out)').eq(0);
842    _boxMainMediaCon = _boxMain.find('.box-main-media-con').eq(0);
843    _boxMainMedia = _boxMain.find('.box-main-media').eq(0);
844    _boxMainUnder = _boxMain.find('.box-main-under').eq(0);
845
846    if (margs.type === 'image') {
847      _boxMainMedia.append('<div class="imagediv real-media" style="background-image: url(' + margs.source + ') "></div>');
848
849      setTimeout(function () {
850        media_ready(margs);
851      }, 50);
852    }
853
854    if (margs.type === 'video') {
855      if (ultibox_options.videoplayer_settings.settings_youtube_usecustomskin === 'off' && (margs.video_type === 'youtube' || margs.video_type === 'vimeo')) {
856        if (margs.video_type === 'youtube') {
857          _boxMainMedia.append('<iframe class="real-media" width="100%" height="100%" src="https://www.youtube.com/embed/' + margs.source + '" frameborder="0" allowfullscreen allow="fullscreen"></iframe>');
858        }
859
860        if (margs.video_type === 'vimeo') {
861          _boxMainMedia.append('<iframe src="https://player.vimeo.com/video/' + margs.source + '" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="fullscreen"></iframe>');
862        }
863      } else {
864        if (margs.video_type === 'video' || margs.video_type === 'youtube' || margs.video_type === 'vimeo') {
865          if ($.fn.vPlayer) {
866            var video_title = '';
867
868            if (margs.item && margs.item.attr('data-videotitle')) {
869              video_title = margs.item.attr('data-videotitle');
870            }
871
872            var aux_str_videoplayer = '<div class="vplayer-tobe auto-init   real-media " data-videoTitle="' + video_title + '"  data-src="' + margs.source + '"';
873            aux_str_videoplayer += ' data-type="' + margs.video_type + '"';
874            aux_str_videoplayer += '></div>';
875
876            _boxMainMedia.append(aux_str_videoplayer);
877
878            var args = {
879              'autoplay': 'off',
880              'cue': 'on'
881            };
882
883            if (ultibox_options.videoplayer_settings) {
884              args = $.extend(args, ultibox_options.videoplayer_settings);
885            }
886
887            var autoplay_it = args.autoplay;
888
889            if (margs.item && margs.item.attr('data-player-id')) {
890              _boxMainMedia.find('.real-media').eq(0).attr('data-player-id', margs.item.attr('data-player-id'));
891            }
892
893            window.dzsvp_init(_boxMainMedia.find('.real-media').eq(0), args);
894          }
895        }
896      }
897
898      setTimeout(function () {
899        _maincon.addClass('loaded-item');
900      }, 50);
901    }
902
903    if (margs.type === 'audio') {
904      if (margs.audio_type === 'youtube') {
905        _boxMainMedia.append('<iframe class="real-media" width="100%" height="100%" src="https://www.youtube.com/embed/' + margs.source + '" frameborder="0" allowfullscreen></iframe>');
906      }
907
908      if (margs.audio_type === 'audio') {
909        if ($.fn.audioplayer) {
910          var structAudioPlayer = '<div class="audioplayer-tobe skin-wave real-media  button-aspect-noir button-aspect-noir--filled "   data-source="' + margs.source + '" ';
911
912          if (margs.audio_thumb) {
913            structAudioPlayer += ' data-thumb="' + margs.audio_thumb + '"';
914          }
915
916          structAudioPlayer += '></div>';
917
918          _boxMainMedia.append(structAudioPlayer);
919
920          var argsApSettings = $.extend({
921            'autoplay': 'off',
922            'cue': 'on',
923            skinwave_mode: 'small'
924          }, ultibox_options.audioplayer_settings);
925
926          _boxMainMedia.find('.real-media').eq(0).audioplayer(argsApSettings);
927
928          setTimeout(function () {
929            _boxMainRealMedia.get(0).api_play_media();
930          }, 300);
931        }
932      }
933
934      setTimeout(function () {
935        media_ready(margs);
936      }, 50);
937    }
938
939    if (margs.type === 'iframe') {
940      _boxMainMedia.append('<div class=" real-media" style=""><iframe class="ultibox--real-media--iframe" src="' + margs.source + '" style="" width="100%" height="100%"></iframe></div>');
941
942      setTimeout(function () {
943        media_ready(margs);
944      }, 1500);
945    }
946
947    if (margs.type === 'inlinecontent') {
948      _boxMainMedia.append('<div class=" real-media" style=""></div>');
949
950      _inline_content_orig_prev = null;
951      _inline_content_orig_parent = null;
952
953      if (margs.inline_content_move === 'on') {
954        if (margs._targetDiv.prev().length > 0) {
955          _inline_content_orig_prev = margs._targetDiv.prev();
956        } else {
957          _inline_content_orig_parent = margs._targetDiv.parent();
958        }
959      }
960
961      if (margs.inline_content_move === 'on') {
962        _boxMainMedia.find('.real-media').append(margs._targetDiv);
963      } else {
964        _boxMainMedia.find('.real-media').append(margs._targetDiv.clone());
965      }
966
967      if (margs._targetDiv.hasClass('cancel-inlinecontent-padding')) {
968        _boxMainMedia.addClass('cancel-inlinecontent-padding');
969      } else {
970        _boxMainMedia.removeClass('cancel-inlinecontent-padding');
971      }
972
973      if (_boxMainMedia.find('.auto-init-from-ultibox').length) {
974        if (window.dzsvg_init) {
975          _boxMainMedia.find('.videogallery.auto-init-from-ultibox:not(.inited)').each(function () {
976            var _t2 = $(this);
977
978            dzsvg_init(_t2, {
979              init_each: true
980            });
981          });
982        }
983      }
984
985      _boxMainMedia.find('.toexecute, .to-execute--from-ultibox').each(function () {
986        var _t2 = $(this);
987
988        if (_t2.hasClass('executed') === false) {
989          eval(_t2.text());
990
991          _t2.addClass('executed');
992        }
993      });
994
995      setTimeout(function () {
996        media_ready(margs);
997      }, 200); // -- we leave 1500 ms time to load any iframe
998    }
999
1000    _boxMainRealMedia = _boxMainMedia.find('.real-media').eq(0);
1001
1002    if (margs.under_description) {
1003      _boxMainUnder.append(margs.under_description);
1004
1005      _boxMainMedia.width('100%');
1006
1007      media_has_under_description = true;
1008
1009      _boxMain.addClass('with-description');
1010    } else {
1011      media_has_under_description = false;
1012    }
1013
1014    if (margs.biggallery) {
1015      if (margs.biggallery !== gallery_setup) {
1016        if (ultibox_options.nav_mode !== 'none') {
1017          _maincon.addClass('has-gallery');
1018        }
1019
1020        var i5 = 0;
1021        $('*[data-biggallery="' + margs.biggallery + '"]').each(function () {
1022          var _t = $(this); // -- we check if
1023
1024
1025          if (margs.item && margs.item.get && margs.item.get(0)) {
1026            if (margs.item.get(0) === _t.get(0)) {
1027              currNr_gal = i5;
1028            }
1029          }
1030
1031          var thumb_src = '';
1032
1033          if (_t.attr('data-thumb-for-gallery')) {
1034            thumb_src = _t.attr('data-thumb-for-gallery');
1035          } else {
1036            if (_t.attr('data-source')) {
1037              thumb_src = _t.attr('data-source');
1038            }
1039
1040            if (_t.get(0) && _t.get(0).nodeName === "IMG") {
1041              thumb_src = _t.attr('src');
1042            }
1043          }
1044
1045          if (thumb_src) {
1046            var aux = '<div class="gallery-thumb"><div class="gallery-thumb--image" style="background-image: url(' + thumb_src + ');"></div><div class="gallery-thumb--icon">';
1047
1048            if (_t.attr('data-type') === 'video' || _t.attr('data-type') === 'audio') {
1049              aux += svg_play;
1050            }
1051
1052            aux += '</div></div>';
1053
1054            _galleryItemsCon.append(aux);
1055
1056            _galleryItemsCon.children().last().data('parent-item', _t);
1057          }
1058
1059          i5++;
1060        }); // -- end for
1061
1062        gallery_setup = margs.biggallery;
1063        setTimeout(function () {
1064          _galleryClipCon.addClass('gallery-loaded');
1065
1066          _galleryItemsCon.children().eq(currNr_gal).addClass('active');
1067        }, 100);
1068      } else {
1069        _galleryClipCon.addClass('gallery-loaded');
1070      }
1071    } else {
1072      _maincon.removeClass('has-gallery');
1073
1074      _galleryClipCon.removeClass('gallery-loaded');
1075
1076      gallery_setup = '';
1077    }
1078
1079    if (margs.max_width) {
1080      opts_max_width = margs.max_width;
1081    } else {
1082      opts_max_width = 0;
1083    }
1084
1085    handle_resize(null, {
1086      call_calculate_dims_light: false
1087    });
1088    calculate_dims_light({
1089      'call_from': "setup_media",
1090      'calculate_main_con': true
1091    });
1092    lastargs = margs;
1093
1094    if (func_callback) {
1095      func_callback(margs);
1096    } // -- just want to cancel the default click behaviour on links
1097
1098  }
1099
1100  function media_ready(margs) {
1101    _maincon.addClass('loaded-item');
1102
1103    if (margs.type === 'inlinecontent') {
1104      if (_boxMainMedia.find('.contentscroller').length) {
1105        _boxMainMedia.find('.contentscroller').each(function () {
1106          var $t2 = $(this);
1107
1108          if ($t2.get(0).api_handleResize) {
1109            $t2.get(0).api_handleResize();
1110          }
1111        });
1112      }
1113
1114      if (_boxMainMedia.find('.videogallery').length) {
1115        _boxMainMedia.find('.videogallery').each(function () {
1116          var $t2 = $(this);
1117
1118          if ($t2.get(0).api_handleResize) {
1119            $t2.get(0).api_handleResize(null, {
1120              force_resize_gallery: true
1121            });
1122          }
1123        });
1124      }
1125
1126      if (_boxMainMedia.find('.ultibox-close-btn').length) {
1127        _boxMain.find('.close-btn-con').fadeOut('fast');
1128      } else {
1129        _boxMain.find('.close-btn-con').fadeIn('fast');
1130      }
1131
1132      setTimeout(function () {
1133        calculate_dims_light();
1134      }, 500);
1135    }
1136  }
1137
1138  function restore_target_div() {
1139    if (lastargs && lastargs.inline_content_move === 'on') {
1140      _inline_content_orig_prev_last = _inline_content_orig_prev;
1141      _inline_content_orig_parent_last = _inline_content_orig_parent;
1142      lastlastargs = $.extend({}, lastargs);
1143      setTimeout(function () {
1144        if (_inline_content_orig_prev_last) {
1145          _inline_content_orig_prev_last.after(lastlastargs._targetDiv);
1146        }
1147
1148        if (_inline_content_orig_parent_last) {
1149          _inline_content_orig_parent_last.prepend(lastlastargs._targetDiv);
1150        } // -- TODO: maybe resize content scroller
1151
1152      }, 300);
1153    }
1154  }
1155
1156  function close_ultibox() {
1157    if (_maincon.find('.show-only-in-ultibox').length === 0) {
1158      _maincon.removeClass('loading-item');
1159    }
1160
1161    _maincon.removeClass('loaded-item');
1162
1163    _html.removeClass('ultibox-opened');
1164
1165    _galleryClipCon.removeClass('gallery-loaded');
1166
1167    if (_maincon.find('.show-only-in-ultibox').length) {
1168      setTimeout(function () {
1169        _maincon.removeClass('loading-item');
1170      }, 500);
1171    }
1172
1173    _maincon.addClass('closing-ultibox'); // -- leave it a bit so we can make sure that the hiding for show-only-in-ultibox is not instant
1174
1175
1176    setTimeout(function () {
1177      _maincon.removeClass('loading-item');
1178
1179      _maincon.removeClass('closing-ultibox');
1180    }, 500);
1181    restore_target_div();
1182
1183    if (ultibox_options.settings_deeplinking == 'on' && can_history_api() == true) {
1184      var newurl = add_query_arg(theurl, 'ultibox', "NaN");
1185      theurl = newurl;
1186      history.pushState({}, "", newurl);
1187    }
1188
1189    setTimeout(function () {
1190      _maincon.addClass('disabled');
1191
1192      if (_boxMainRealMedia) {
1193        _boxMainRealMedia.remove();
1194      }
1195
1196      if (_boxMainUnder) {
1197        _boxMainUnder.html('');
1198      }
1199
1200      _boxMainsCon.html('');
1201
1202      window.ultibox_countdown = false;
1203    }, 300);
1204  }
1205
1206  function handle_resize(e, pargs) {
1207    var margs = {
1208      'call_from': 'default',
1209      'call_calculate_dims_light': true
1210    };
1211
1212    if (pargs) {
1213      margs = $.extend(margs, pargs);
1214    }
1215
1216    ww = $(window).width();
1217    wh = window.innerHeight;
1218    bmc_w = _boxMainsCon.width();
1219    bmc_h = _boxMainsCon.height();
1220
1221    if (margs.call_calculate_dims_light) {
1222      if (inter_calculate_dims_light) {
1223        clearTimeout(inter_calculate_dims_light);
1224      }
1225
1226      inter_calculate_dims_light = setTimeout(calculate_dims_light, 100);
1227    }
1228
1229    if (_boxMainMedia && _boxMainMedia.hasClass('type-inlinecontent')) {}
1230  }
1231
1232  function calculate_dims_light(pargs) {
1233    var margs = {
1234      'call_from': 'default',
1235      'calculate_main_con': true
1236    };
1237
1238    if (pargs) {
1239      margs = $.extend(margs, pargs);
1240    }
1241
1242    if (margs.calculate_main_con) {
1243      media_finalw = media_w;
1244      media_finalh = media_h;
1245
1246      if (opts_max_width) {
1247        if (media_finalw > opts_max_width) {
1248          media_finalw = opts_max_width;
1249
1250          if (scaling !== 'fill') {
1251            media_finalh = media_finalw / media_ratio_w_h;
1252          }
1253        }
1254      }
1255
1256      if (media_finalw > bmc_w - padding_hor) {
1257        media_finalw = bmc_w - padding_hor;
1258
1259        if (scaling !== 'fill') {
1260          media_finalh = media_finalw / media_ratio_w_h;
1261        }
1262      }
1263
1264      if (media_finalh > bmc_h - padding_ver) {
1265        media_finalh = bmc_h - padding_ver;
1266
1267        if (scaling !== 'fill') {
1268          media_finalw = media_finalh * media_ratio_w_h;
1269        }
1270      }
1271
1272      if (opts_max_width) {
1273        if (media_has_under_description) {
1274          _boxMainMediaCon.width(media_finalw);
1275        }
1276      }
1277
1278      if (_boxMainMedia) {
1279        if (media_has_under_description) {
1280          _boxMainMedia.width('100%');
1281        } else {
1282          _boxMainMedia.width(media_finalw);
1283        }
1284
1285        setTimeout(function () {}, 5000);
1286
1287        _boxMainMedia.height(media_finalh);
1288
1289        _boxMain.css({
1290          'max-height': 'none',
1291          'height': 'auto'
1292        });
1293
1294        if (_boxMain) {
1295          setTimeout(function () {
1296            if (_boxMain.outerHeight() > _boxMain.parent().outerHeight()) {
1297              // 0 = padding
1298              _boxMain.addClass('scroll-mode');
1299
1300              if (offset_v !== 30) {
1301                _boxMain.css('top', offset_v);
1302              }
1303            } else {
1304              _boxMain.removeClass('scroll-mode');
1305
1306              _boxMain.css({
1307                'top': ''
1308              });
1309            }
1310
1311            _boxMain.css({
1312              'max-height': '',
1313              'height': ''
1314            });
1315          }, 100);
1316        }
1317
1318        if (_galleryItemsCon) {
1319          if (_galleryItemsCon.outerWidth() > ww - 0) {
1320            // 0 = padding
1321            _galleryItemsCon.addClass('scroll-mode');
1322          } else {
1323            _galleryItemsCon.removeClass('scroll-mode');
1324
1325            _galleryItemsCon.css({
1326              'left': ''
1327            });
1328          }
1329
1330          _galleryItemsCon.css({
1331            'max-height': '',
1332            'height': ''
1333          });
1334        }
1335      }
1336    }
1337  } // -- item
1338
1339
1340  $.fn.dzsulb = function (o) {
1341    //==default options
1342    var defaults = {
1343      settings_slideshowTime: '5' //in seconds
1344      ,
1345      settings_enable_linking: 'off' // enable deeplinking on tabs
1346      ,
1347      settings_contentHeight: '0' //set the fixed tab height
1348      ,
1349      settings_scroll_to_start: 'off' //scroll to start when a tab menu is clicked
1350      ,
1351      settings_startTab: 'default' // -- the start tab, default or a fixed number
1352      ,
1353      design_skin: 'skin-default' // -- skin-default, skin-boxed, skin-melbourne or skin-blue
1354      ,
1355      design_transition: 'default' // default, fade or slide
1356      ,
1357      design_tabsposition: 'top' // -- set top, right, bottom or left
1358      ,
1359      design_tabswidth: 'default' // -- set the tabs width for position left or right, if tabs position top or bottom and this is set to fullwidth, then the tabs will cover all the width
1360      ,
1361      design_maxwidth: '4000',
1362      settings_makeFunctional: false,
1363      settings_appendWholeContent: false // -- take the whole tab content and append it into the dzs tabs, this makes complex scripts like sliders still work inside of tabs
1364      ,
1365      toggle_breakpoint: '320' //  -- a number at which bellow the tabs will trasform to toggles
1366      ,
1367      toggle_type: 'accordion' // -- normally, the  toggles act like accordions, but they can act like traditional toggles if this is set to toggle
1368      ,
1369      refresh_tab_height: '0' // -- normally, the  toggles act like accordions, but they can act like traditional toggles if this is set to toggle
1370      ,
1371      outer_menu: null // -- normally, the  toggles act like accordions, but they can act like traditional toggles if this is set to toggle
1372      ,
1373      action_gotoItem: null // -- set a external javascript action that happens when a item is selected
1374      ,
1375      vc_editable: false // -- add some extra classes for the visual composer frontend edit
1376
1377    };
1378
1379    if (typeof o == 'undefined') {
1380      if (typeof $(this).attr('data-options') != 'undefined' && $(this).attr('data-options') != '') {
1381        var aux = $(this).attr('data-options');
1382        aux = 'window.dzstaa_self_options = ' + aux;
1383        eval(aux);
1384        o = $.extend({}, window.dzstaa_self_options);
1385        window.dzstaa_self_options = $.extend({}, {});
1386      }
1387    }
1388
1389    o = $.extend(defaults, o);
1390    this.each(function () {
1391      var cthis = $(this);
1392
1393      if (isNaN(Number(o.settings_startTab)) === false) {
1394        o.settings_startTab = parseInt(o.settings_startTab, 10);
1395      }
1396
1397      if (can_history_api() === false) {
1398        o.settings_enable_linking = 'off';
1399      }
1400
1401      o.toggle_breakpoint = parseInt(o.toggle_breakpoint, 10);
1402
1403      if (window.dzsulb_inited === false) {
1404        dzsulb_init();
1405      } // -- item
1406
1407
1408      init(); // -- init item !
1409
1410      function init() {
1411        if (cthis.attr('data-source')) {} else {
1412          if (cthis.attr('href')) {
1413            cthis.attr('data-source', cthis.attr('href'));
1414          }
1415        }
1416
1417        var src = cthis.attr('data-source');
1418
1419        if (!cthis.attr('data-type') || cthis.attr('data-type') === 'detect') {
1420          cthis.attr('data-type', ultiboxHelpers.detect_ultibox_media_type(src));
1421        } else {}
1422
1423        cthis.off('click', handle_mouse_item);
1424        cthis.on('click', handle_mouse_item);
1425      }
1426
1427      return this;
1428    });
1429  };
1430
1431  window.dzsulb_init = function (selector, settings) {
1432    if (typeof settings != "undefined" && typeof settings.init_each != "undefined" && settings.init_each === true) {
1433      var element_count = 0;
1434
1435      for (var e in settings) {
1436        element_count++;
1437      }
1438
1439      if (element_count == 1) {
1440        settings = undefined;
1441      }
1442
1443      $(selector).each(function () {
1444        var _t = $(this);
1445
1446        _t.dzsulb(settings);
1447      });
1448    } else {
1449      $(selector).dzsulb(settings);
1450    }
1451
1452    if (get_query_arg(window.location.href, 'ultibox') || get_query_arg(window.location.href, 'ultibox') === '0') {
1453      $(window).scrollTop(0);
1454    }
1455  };
1456})(jQuery);
1457
1458function can_history_api() {
1459  return !!(window.history && history.pushState);
1460}
1461
1462jQuery(document).ready(function ($) {
1463  dzsulb_init('.ultibox-item', {
1464    init_each: true
1465  });
1466  window.dzsulb_main_init();
1467  $(document).off('click', '.ultibox-item-delegated');
1468  $(document).on('click', '.ultibox-item-delegated', function (e) {
1469    window.open_ultibox($(this));
1470    e.stopPropagation();
1471    e.preventDefault();
1472    return false;
1473  });
1474});
1475
1476},{"./jsinc/_ultibox_helpers":1}]},{},[2])
1477
1478
1479//# sourceMappingURL=ultibox.js.map

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.