From ef7c58099c21427403feddec0a7d456d95e61f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Ko=CC=88nemann?= Date: Wed, 25 Jan 2017 10:24:08 +0100 Subject: [PATCH] Removing Owl Carousel dependency --- gulpfile.js | 16 ---------------- inc/enqueue.php | 27 --------------------------- js/slider_settings.js | 24 ------------------------ package.json | 1 - sass/understrap/understrap.scss | 1 + 5 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 js/slider_settings.js diff --git a/gulpfile.js b/gulpfile.js index 2fec5db..dafb3c4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -146,7 +146,6 @@ gulp.task('watch-bs', ['browser-sync', 'watch', 'cssnano', 'scripts'], function // Uglifies and concat all JS files into one gulp.task('scripts', function() { var scripts = [ - basePaths.dev + 'js/owl.carousel.min.js', // Must be loaded before BS4 basePaths.dev + 'js/tether.js', // Must be loaded before BS4 // Start - All BS4 stuff @@ -198,21 +197,6 @@ gulp.task('copy-assets', ['clean-source'], function() { gulp.src(basePaths.node + 'font-awesome/scss/*.scss') .pipe(gulp.dest(basePaths.dev + '/sass/fontawesome')); - -// owl JS files - gulp.src(basePaths.node + 'owl.carousel/dist/*.js') - .pipe(gulp.dest(basePaths.dev + '/js')); - - -// Copy all Owl2 SCSS files - gulp.src(basePaths.node + 'owl.carousel/src/scss/*.scss') - .pipe(gulp.dest(basePaths.dev + '/sass/owl-carousel2')); - -// Copy all Owl2 CSS files - gulp.src(basePaths.node + 'owl.carousel/dist/assets/*.css') - .pipe(gulp.dest(basePaths.dev + '/css')); - - // Copy jQuery gulp.src(basePaths.node + 'jquery/dist/*.js') .pipe(gulp.dest(basePaths.dev + '/js')); diff --git a/inc/enqueue.php b/inc/enqueue.php index a6a04b5..ef91222 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -22,30 +22,3 @@ if ( ! function_exists( 'understrap_scripts' ) ) { } // endif function_exists( 'understrap_scripts' ). add_action( 'wp_enqueue_scripts', 'understrap_scripts' ); - -/** - *Loading slider script conditionally - */ - -if ( is_active_sidebar( 'hero' ) ) : - add_action( 'wp_enqueue_scripts', 'understrap_slider' ); - - if ( ! function_exists( 'understrap_slider' ) ) { - /** - * Setup slider. - */ - function understrap_slider() { - if ( is_front_page() ) { - $data = array( - 'timeout' => intval( get_theme_mod( 'understrap_theme_slider_time_setting', 5000 ) ), - 'items' => intval( get_theme_mod( 'understrap_theme_slider_count_setting', 1 ) ), - ); - - wp_enqueue_script( 'understrap-slider-script', - get_stylesheet_directory_uri() . '/js/slider_settings.js', array() ); - wp_localize_script( 'understrap-slider-script', 'understrap_slider_variables', $data ); - } - } - } -endif; - diff --git a/js/slider_settings.js b/js/slider_settings.js deleted file mode 100644 index 603bb81..0000000 --- a/js/slider_settings.js +++ /dev/null @@ -1,24 +0,0 @@ - - jQuery(document).ready(function() { - var owl = jQuery('.owl-carousel'); - owl.owlCarousel({ - items:1, - loop:true, - autoplay:true, - autoplayTimeout:5000, - animateOut: 'fadeOut', - animateIn: 'fadeIn', - nav: false, - dots: true, - autoplayHoverPause:true, - margin:0, - autoHeight:true - }); - - jQuery('.play').on('click',function(){ - owl.trigger('autoplay.play.owl',[1000]) - }); - jQuery('.stop').on('click',function(){ - owl.trigger('autoplay.stop.owl') - }); - }); diff --git a/package.json b/package.json index 6c413f1..39da7df 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "gulp-uglify": "^2.0.0", "gulp-watch": "^4.3.11", "merge2": "^1.0.3", - "owl.carousel": "^2.2.0", "run-sequence": "^1.2.2", "undescores-for-npm": "^1.0.0" }, diff --git a/sass/understrap/understrap.scss b/sass/understrap/understrap.scss index b48af7c..6156646 100644 --- a/sass/understrap/understrap.scss +++ b/sass/understrap/understrap.scss @@ -127,6 +127,7 @@ button, // Clearing after widget aside.widget{clear:both;} +// Makes widgets in hero slider 100% width #wrapper-hero .carousel-inner .textwidget { width:100%; } \ No newline at end of file