Skip to content

Commit

Permalink
Fixes broken links inside the slider - #1282
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenwanderski committed May 22, 2024
1 parent 80b5a47 commit 89da106
Show file tree
Hide file tree
Showing 7 changed files with 5,353 additions and 30 deletions.
25 changes: 16 additions & 9 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,63 @@ var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
var rename = require('gulp-rename');

gulp.task('js-minify', function () {
gulp.task('js-minify', function (done) {
gulp.src('./src/js/jquery.bxslider.js')
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./dist'));
done();
});

gulp.task('js-copy-src', function () {
gulp.task('js-copy-src', function (done) {
gulp.src('./src/js/jquery.bxslider.js')
.pipe(gulp.dest('./dist'));
done();
});

gulp.task('css-minify', function () {
gulp.task('css-minify', function (done) {
gulp.src('./src/css/jquery.bxslider.css')
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./dist'));
done();
});

gulp.task('css-copy-src', function () {
gulp.task('css-copy-src', function (done) {
gulp.src('./src/css/jquery.bxslider.css')
.pipe(gulp.dest('./dist'));
done();
});

gulp.task('vendor-copy-src', function () {
gulp.task('vendor-copy-src', function (done) {
gulp.src('./src/vendor/*')
.pipe(gulp.dest('./dist/vendor'));
done();
});

gulp.task('images-copy-src', function () {
gulp.task('images-copy-src', function (done) {
gulp.src('./src/images/*')
.pipe(gulp.dest('./dist/images'));
done();
});

gulp.task('docs-copy-src', function () {
gulp.task('docs-copy-src', function (done) {
gulp.src([
'./readme.md',
'./LICENSE.md'
])
.pipe(gulp.dest('./dist'));
done();
});

gulp.task('default', [
gulp.task('default', gulp.series(
'js-minify',
'js-copy-src',
'css-minify',
'css-copy-src',
'vendor-copy-src',
'images-copy-src',
'docs-copy-src'
]);
));
7 changes: 7 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ First and most important, the jQuery library needs to be included (no need to do
<link href="/lib/jquery.bxslider.css" rel="stylesheet" />
```

Or, if you prefer, you can get the bxSlider's resources from the **CDN**:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.15/jquery.bxslider.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.15/jquery.bxslider.min.css" rel="stylesheet" />
```

### Step 2: Create HTML markup

Create a `<ul class="bxslider">` element, with a `<li>` for each slide. Slides can contain images, video, or any other HTML content!
Expand Down
22 changes: 14 additions & 8 deletions dist/jquery.bxslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@
// if video is true, set up the fitVids plugin
if (slider.settings.video) { el.fitVids(); }
//preloadImages
if (slider.settings.preloadImages === 'none') {
preloadSelector = null;
if (slider.settings.preloadImages === 'none') {
preloadSelector = null;
}
else if (slider.settings.preloadImages === 'all' || slider.settings.ticker) {
preloadSelector = slider.children;
else if (slider.settings.preloadImages === 'all' || slider.settings.ticker) {
preloadSelector = slider.children;
}
// only check for control addition if not in "ticker" mode
if (!slider.settings.ticker) {
Expand Down Expand Up @@ -1101,6 +1101,12 @@
* - DOM event object
*/
var onTouchStart = function(e) {
// if the target is a link allow it to click through and
// follow the URL
if ($(e.target).is('a')) {
return;
}

// watch only for left mouse, touch contact and pen contact
// touchstart event object doesn`t have button property
if (e.type !== 'touchstart' && e.button !== 0) {
Expand All @@ -1117,11 +1123,11 @@
slider.touch.originalPos = el.position();
var orig = e.originalEvent,
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
var chromePointerEvents = typeof PointerEvent === 'function';
if (chromePointerEvents) {
if (orig.pointerId === undefined) {
var chromePointerEvents = typeof PointerEvent === 'function';
if (chromePointerEvents) {
if (orig.pointerId === undefined) {
return;
}
}
}
// record the starting touch x, y coordinates
slider.touch.start.x = touchPoints[0].pageX;
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.bxslider.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 89da106

Please sign in to comment.