Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 5b7abdb

Browse files
committed
Merge pull request #1112 from mdaliyan/gulp_support
Add Gulp support
2 parents 40f52d5 + d2242b8 commit 5b7abdb

File tree

3 files changed

+125
-1
lines changed

3 files changed

+125
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.project
2-
.settings
2+
.settings
3+
dist/

gulpfile.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* jshint node: true */
2+
/* global $: true */
3+
"use strict";
4+
5+
var gulp = require("gulp"),
6+
$ = require("gulp-load-plugins")();
7+
var config = {
8+
js: [
9+
"lib/jquery.mousewheel.pack.js",
10+
"source/jquery.fancybox.pack.js",
11+
"source/helpers/jquery.fancybox-buttons.js",
12+
"source/helpers/jquery.fancybox-thumbs.js",
13+
"source/helpers/jquery.fancybox-media.js"
14+
],
15+
css: [
16+
"source/jquery.fancybox.css",
17+
"source/helpers/jquery.fancybox-buttons.css",
18+
"source/helpers/jquery.fancybox-thumbs.css"
19+
],
20+
images: [
21+
"source/helpers/**/*.{jpg,png,svg,gif,webp,ico}",
22+
"source/*.{jpg,png,svg,gif,webp,ico}"
23+
]
24+
},
25+
dist = {
26+
images: "dist/images/fancybox",
27+
css: "dist/css",
28+
js: "dist/js"
29+
};
30+
31+
32+
/*
33+
- |--------------------------------------------------------------------------
34+
- | Gulp Front Tasks
35+
- |--------------------------------------------------------------------------
36+
- |
37+
+ *
38+
+ *
39+
*/
40+
41+
gulp.task("clean", function () {
42+
return gulp.src("dist", {read: false})
43+
.pipe($.clean());
44+
});
45+
46+
gulp.task("scripts", function () {
47+
return gulp.src(config.js)
48+
.pipe($.plumberNotifier())
49+
.pipe($.concat("jquery.fancybox.min.js"))
50+
.pipe($.uglify())
51+
.pipe(gulp.dest(dist.js));
52+
});
53+
54+
gulp.task("styles", function () {
55+
return gulp.src(config.css)
56+
.pipe($.plumberNotifier())
57+
.pipe($.concat("jquery.fancybox.min.css"))
58+
.pipe($.autoprefixer("last 5 version"))
59+
.pipe($.replace(/url\('?(.*)'?\)/g, "url('../images/fancybox/$1')"))
60+
.pipe($.replace("''", "'"))
61+
.pipe($.cleanCss({compatibility: 'ie8'}))
62+
.pipe(gulp.dest(dist.css))
63+
});
64+
65+
gulp.task("images", function () {
66+
return gulp.src(config.images)
67+
.pipe($.newer(dist.images))
68+
.pipe(gulp.dest(dist.images));
69+
});
70+
71+
72+
gulp.task('default', ["images", "styles", "scripts"]);
73+
74+
75+
76+

package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "fancybox",
3+
"title": "fancyBox",
4+
"description": "fancyBox offers an elegant way to present images, html content and multimedia for webpages",
5+
"keywords": [
6+
"lightbox",
7+
"effect",
8+
"responsive",
9+
"modal",
10+
"window",
11+
"ui"
12+
],
13+
"licenses": [
14+
{
15+
"type": "fancyBox",
16+
"url": "http://fancyapps.com/fancybox/#license"
17+
}
18+
],
19+
"version": "2.1.5",
20+
"repository": {
21+
"type": "git",
22+
"url": "https://github.com/fancyapps/fancyBox"
23+
},
24+
"dependencies": {},
25+
"devDependencies": {
26+
"del": "^0.1.2",
27+
"gulp": "^3.6.0",
28+
"gulp-autoprefixer": "0.0.7",
29+
"gulp-clean": "^0.3.2",
30+
"gulp-clean-css": "^2.0.4",
31+
"gulp-concat": "^2.3.4",
32+
"gulp-csso": "^0.2.9",
33+
"gulp-jshint": "^1.8.4",
34+
"gulp-load-plugins": "^0.5.0",
35+
"gulp-newer": "^1.1.0",
36+
"gulp-plumber": "^1.1.0",
37+
"gulp-plumber-notifier": "0.0.3",
38+
"gulp-rename": "^1.2.2",
39+
"gulp-replace": "^0.5.4",
40+
"gulp-sass": "^2.2.0",
41+
"gulp-uglify": "^1.0.0",
42+
"gulp-util": "^3.0.7"
43+
},
44+
"engines": {
45+
"node": ">=0.10.0"
46+
}
47+
}

0 commit comments

Comments
 (0)