jellyfin-web/dashboard-ui/bower_components/Swiper/gulpfile.js

1 line
7.3 KiB
JavaScript
Raw Normal View History

2017-01-27 16:07:14 -07:00
!function(){"use strict";function addJSIndent(file,t,minusIndent){var addIndent=" ",filename=file.path.split("src/js/")[1];if(["wrap-start.js","wrap-start-umd.js","wrap-end.js","wrap-end-umd.js","amd.js"].indexOf(filename)!==-1&&(addIndent=""),"swiper-intro.js"!==filename&&"swiper-intro-f7.js"!==filename&&"swiper-outro.js"!==filename&&"dom.js"!==filename&&"get-dom-lib.js"!==filename&&"get-jquery.js"!==filename&&"dom-plugins.js"!==filename&&"swiper-proto.js"!==filename||(addIndent=" "),minusIndent&&(addIndent=addIndent.substring(4)),""!==addIndent){for(var fileLines=fs.readFileSync(file.path).toString().split("\n"),newFileContents="",i=0;i<fileLines.length;i++)newFileContents+=addIndent+fileLines[i]+(i===fileLines.length?"":"\n");file.contents=new Buffer(newFileContents)}}var gulp=require("gulp"),connect=require("gulp-connect"),open=require("gulp-open"),less=require("gulp-less"),rename=require("gulp-rename"),header=require("gulp-header"),path=require("path"),uglify=require("gulp-uglify"),sourcemaps=require("gulp-sourcemaps"),minifyCSS=require("gulp-minify-css"),tap=require("gulp-tap"),concat=require("gulp-concat"),jshint=require("gulp-jshint"),stylish=require("jshint-stylish"),fs=require("fs"),paths={root:"./",build:{root:"build/",styles:"build/css/",scripts:"build/js/"},dist:{root:"dist/",styles:"dist/css/",scripts:"dist/js/"},playground:{root:"playground/"},source:{root:"src/",styles:"src/less/",scripts:"src/js/*.js"}},swiper={filename:"swiper",jsFiles:["src/js/wrap-start.js","src/js/swiper-intro.js","src/js/core.js","src/js/effects.js","src/js/lazy-load.js","src/js/scrollbar.js","src/js/controller.js","src/js/hashnav.js","src/js/keyboard.js","src/js/mousewheel.js","src/js/parallax.js","src/js/plugins.js","src/js/emitter.js","src/js/a11y.js","src/js/init.js","src/js/swiper-outro.js","src/js/swiper-proto.js","src/js/dom.js","src/js/get-dom-lib.js","src/js/dom-plugins.js","src/js/wrap-end.js","src/js/amd.js"],jQueryFiles:["src/js/wrap-start.js","src/js/swiper-intro.js","src/js/core.js","src/js/effects.js","src/js/lazy-load.js","src/js/scrollbar.js","src/js/controller.js","src/js/hashnav.js","src/js/keyboard.js","src/js/mousewheel.js","src/js/parallax.js","src/js/plugins.js","src/js/emitter.js","src/js/a11y.js","src/js/init.js","src/js/swiper-outro.js","src/js/swiper-proto.js","src/js/get-dom-lib.js","src/js/dom-plugins.js","src/js/wrap-end.js","src/js/amd.js"],jQueryUMDFiles:["src/js/wrap-start-umd.js","src/js/swiper-intro.js","src/js/core.js","src/js/effects.js","src/js/lazy-load.js","src/js/scrollbar.js","src/js/controller.js","src/js/hashnav.js","src/js/keyboard.js","src/js/mousewheel.js","src/js/parallax.js","src/js/plugins.js","src/js/emitter.js","src/js/a11y.js","src/js/init.js","src/js/swiper-outro.js","src/js/swiper-proto.js","src/js/get-jquery.js","src/js/dom-plugins.js","src/js/wrap-end-umd.js"],Framework7Files:["src/js/swiper-intro-f7.js","src/js/core.js","src/js/effects.js","src/js/lazy-load.js","src/js/scrollbar.js","src/js/controller.js","src/js/parallax.js","src/js/plugins.js","src/js/emitter.js","src/js/a11y.js","src/js/init.js","src/js/swiper-outro.js","src/js/swiper-proto.js"],pkg:require("./bower.json"),banner:["/**"," * Swiper <%= pkg.version %>"," * <%= pkg.description %>"," * "," * <%= pkg.homepage %>"," * "," * Copyright <%= date.year %>, <%= pkg.author %>"," * The iDangero.us"," * http://www.idangero.us/"," * ",' * Licensed under <%= pkg.license.join(" & ") %>'," * "," * Released on: <%= date.month %> <%= date.day %>, <%= date.year %>"," */",""].join("\n"),date:{year:(new Date).getFullYear(),month:"January February March April May June July August September October November December".split(" ")[(new Date).getMonth()],day:(new Date).getDate()}};gulp.task("scripts",function(cb){gulp.src(swiper.jsFiles).pipe(tap(function(file,t){addJSIndent(file,t)})).pipe(sourcemaps.init()).pipe(concat(swiper.filename+".js")).pipe(header(swiper.banner,{pkg:swiper.pkg,date:swiper.date})).pipe(jshint()).pipe(jshint.reporter(stylish)).pipe(sourcemaps.write("./maps/")).pipe(gulp.dest(paths.build.scripts)),gulp