--- regenerate: false --- {% capture cache %} {% comment %} # ----------------------------------------------------------------------------- # J1: ~/assets/themes/j1/j1/js/adapters/owl_carousel.js # Liquid JS template to create the J1 Adapter for the Owl Carousel # # Product/Info: # http://jekyll.one # # Copyright (C) 2016 Juergen Adams # Copyright (C) 2016 Bartosz Wojciechowski # # J1 Template is licensed under the MIT License. # Owl Carousel is licensed under the MIT License. # For details, see https://jekyll.one # # ----------------------------------------------------------------------------- # Test data: # {{ config | debug }} # ----------------------------------------------------------------------------- {% endcomment %} /* # ----------------------------------------------------------------------------- # J1: ~/assets/themes/j1/j1/js/adapters/owl_carousel.js # JS Adapter for the Owl Carousel # # Product/Info: # http://jekyll.one # # Copyright (C) 2016 Juergen Adams # Copyright (C) 2016 Bartosz Wojciechowski # # J1 Template is licensed under the MIT License. # Owl Carousel is licensed under the MIT License. # For details, see https://jekyll.one # # ----------------------------------------------------------------------------- # Adapter generated: {{site.time}} # ----------------------------------------------------------------------------- */ {% assign environment = site.environment %} {% assign config = site.data.modules.j1_owl_carousel %} {% assign default_options = site.data.modules.j1_owl_carousel.default %} {% if config.enabled %} {% assign slider_id = '' %} var J1OwlCarousel = function () { return { // Initialize init: function () { // jQuery slider options {% for item in config.carousel %} {% if item.show.enabled %} {% assign slider_id = item.show.id %} {% assign slider_title = item.show.title %} {% assign slider_type = item.show.type %} {% assign css_classes = item.show.css_classes %} {% assign lazyLoad = item.show.lightbox %} // Create an Carousel INSTANCE if slider on id: {{ slider_id }} exists if ( $('#{{slider_id}}').length ) { {% if environment == 'development' %} var start = moment(); var finished = ''; var elapsed = ''; var log_text = "[" +start.format("HH:mm:ss.SSS")+ "] J1 ADAPTER: Owl Carousel Slider for ID {{ slider_id }} being initialized .." console.log( log_text ); {% endif %} {% if item.show.slide_height != null %} // Set slide_height: {{item.show.slide_height}}vh {% assign slide_height = item.show.slide_height %} $('head').append(""); {% endif %} {% if item.show.slide_space_between %} {% assign slide_space = item.show.slide_space_between %} {% else %} {% assign slide_space = 3 %} {% endif %} {% if item.show.slide_border %} {% assign slide_border = "thumbnail" %} {% else %} {% assign slide_border = "" %} {% endif %} {% if slider_title %} var slider_title = '
' +text+ '
' + '' +text+ '
' + '