├── .babelrc
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── __webp__.js
├── config.js
├── dev-easy.md
├── gulpfile.js
├── package-lock.json
├── package.json
├── rev-manifest-css.json
├── rev-manifest-js.json
├── sprites
└── icons
│ ├── a.png
│ ├── b.png
│ ├── c.png
│ └── d.png
├── src-1
├── _modules
│ ├── footer
│ │ ├── footer.pug
│ │ └── footer.scss
│ └── header
│ │ ├── header.pug
│ │ └── header.scss
├── _pug
│ └── page.pug
├── about.pug
├── index.pug
└── static
│ ├── _vendor
│ └── jquery-3.3.1.min.js
│ ├── img
│ └── test.jpg
│ ├── pages
│ ├── about
│ │ ├── about.js
│ │ └── about.scss
│ └── index
│ │ ├── index.js
│ │ └── index.scss
│ └── public
│ ├── css
│ └── public.scss
│ └── js
│ └── public.js
└── src
├── about.html
├── index.html
└── static
├── _vendor
└── jquery-3.3.1.min.js
├── img
└── test.jpg
├── pages
├── about
│ ├── about.css
│ └── about.js
└── index
│ ├── index.css
│ └── index.js
├── public
├── css
│ └── public.css
└── js
│ └── public.js
└── sprites
├── icons.css
└── icons.png
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "latest"
4 | ]
5 | }
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | /**/_vendor
2 | /dist/
3 | *.html
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [
3 | 'eslint-config-alloy',
4 | ],
5 | globals: {
6 | // 这里填入你的项目需要的全局变量
7 | // 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
8 | jQuery: false,
9 | $: false,
10 | define: false,
11 | requirejs: false,
12 | seajs: false,
13 | Base: false
14 | },
15 | rules: {
16 | // 这里填入你的项目需要的个性化配置,比如:
17 | //
18 | // // @fixable 一个缩进必须用两个空格替代
19 | semi: ['error', 'never'], // 不要分号
20 | quotes: ["error", "single"], // 单引号
21 | 'no-var': 0,
22 | 'indent': [
23 | 'error',
24 | 2,
25 | {
26 | SwitchCase: 1,
27 | flatTernaryExpressions: true
28 | }
29 | ]
30 | }
31 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | // to edit target browsers: use "browserslist" field in package.json
6 | "autoprefixer": {
7 | browsers: ['last 10 versions','Android >= 4.0']
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 lfy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # gulp-easy [github](https://github.com/lfyfly/gulp-easy.git)
2 |
3 | ## 1、简介
4 | 使用gulp搭建一个传统的多页面前端项目的开发环境
5 |
6 | - 支持`pug` `scss` `es6`编译支持
7 | - 支持开发环境和打包生成`sourceMap`
8 | - 支持文件变动自动刷新浏览器,css是热更新(css改动无需刷新浏览器即可更新)
9 | - 支持新增文件没无需重启gulp,即可改动自动刷新浏览器
10 | - 支持命令生成雪碧图和对应css
11 | - 支持eslint,使用的eslint插件是[eslint-config-alloy](https://github.com/AlloyTeam/eslint-config-alloy)
12 | - 支持打包html,css,js图片压缩,css中小图片转base64
13 | - 支持css,js文件版本hash值,文件无变动则版本hash不会改变,更好利用缓存
14 | - 支持html中的css,js,img路径添加cdn域名前缀,css中的图片链接建议使用`相对路径`
15 | - 支持代理,便于跨域调试
16 |
17 | ## 2、如何使用
18 | ### 2.1 下载项目
19 | (1) `git clone https://github.com/lfyfly/dev-easy.git`或者下载 `zip包`
20 |
21 | (2)删除项目下的因此目录`.git`文件夹,这是我的commit记录,所以删除
22 |
23 | (3)`npm install` 安装依赖
24 |
25 | (4)`npm run dev`
26 |
27 | ### 2.2 命令
28 | ### `npm run dev`
29 | 进入开发模式
30 |
31 | ### `npm run build`
32 | 打包命令
33 |
34 | ### `npm run start`
35 | 打包并且以`dist`为根目录开启服务器查看效果
36 |
37 | ### `npm run sp`
38 | 把根目录下的sprites文件夹下的子目录内的所有文件夹中的png和jpg的图片,以子文件夹目录为单位生产雪碧图,文件名为子目录名
39 |
40 | ### 在执行完`npm run build`后执行`npm run webp`
41 | #### 默认情况下html中的`img[src]`会被处理成`img[data-src]`
42 | - 当img的src为`http`开头则会被忽略该处理
43 | - 当img的className中包含`not-webp`开头则会被忽略该处理
44 |
45 | ### `npm run lint`
46 | eslint检测
47 |
48 | ### `npm run fix`
49 | eslint修复
50 |
51 | ## 3、 约定的目录
52 | > src是源码目录,可以通过`config.srcPath`进行配置,以下src只目录只是个例子,代表源码目录
53 | #### 3.1 `src/static`
54 | 静态文件目录
55 | #### 3.2 `src/static/_vendor`
56 | 第三方js,css,iconfont等
57 | #### 3.3 `src/_scss`
58 | scss模块目录,里面的`.scss`文件不会被单独编译成css文件
59 | #### 3.4`src/_pug`
60 | pug模块目录,里面的`.pug`文件不会被单独编译成html文件
61 |
62 | #### 4.5 `src/_modules`
63 | 该目录里面的`.pug`,`.scss`文件不会被单独编译成html文件
64 |
65 | ## 4、功能配置文件
66 | 根目录下的`config.js`
67 | ```
68 | module.exports = {
69 | srcPath: 'src',
70 | pug: true,
71 | scss: true,
72 | babel: true,
73 | tmpPath: 'node_modules/__tmp__',
74 | build: {
75 | htmlmin: true,
76 | cssmin: true,
77 | jsmin: true,
78 | base64: 10 * 1024, // (bytes) 使用css中图片使用相对路径,否者无效
79 | cssSourcemap: true,
80 | jsSourcemap: true,
81 | cdn: 'http://your/cdn/url/',
82 | versionHash: true, // 版本hash
83 | },
84 | proxyTable: {
85 | '/api': 'http://localhost:3000',
86 | '/hehe': {
87 | target: 'http://localhost:3000',
88 | pathRewrite: {
89 | // 地址重写
90 | '^/hehe': '/api'
91 | }
92 | }
93 | }
94 | }
95 | ```
96 | ## 5、功能配置项详解
97 | > **如不需要使用某个配置项目,直接将其注释即可**
98 | ### srcPath
99 |
100 | 配置目录源文件目录,默认为`'src'`
101 |
102 | ### pug
103 |
104 | - 值为`true`时,会开启对`src`目录内所有的`.pug`文件(除`src/_pug/`外)编译成html
105 | - `src/_pug`作为pug的模块目录,不会被单独编译为html文件
106 |
107 | ### scss
108 |
109 | - 值为`true`时,会开启对src内所有的`.scss`,`.sass`文件(除`src/_scss`外)编译成scss
110 | - `src/_scss/`作为scss的模块目录,不会被单独编译为css文件
111 |
112 |
113 | ### babel
114 |
115 | - 值为`true`时,会开启对`src`目录内所有的`.js`文件(除`src/static/vendor/`外)编译成es5
116 | - babel配置文件,根目录下`.babelrc`文件
117 |
118 | ### tmpPath
119 |
120 | - 默认值为 `'node_modules/__tmp__'`
121 | - `npm run dev`作为`.pug`,`.scss`,`.js`文件编译的临时文件目录,和`src`同为静态文件目录,且优先级高于src目录
122 |
123 | ```
124 | browserSync.init({
125 | server: {
126 | baseDir: [config.tmpPath, 'src'],
127 | },
128 | middleware,
129 | port: 9000,
130 | online: false
131 | })
132 |
133 | ```
134 | - 编译后文件访问:`src/static/public/public.scss`在html的访问路径为`/static/public/public.css`
135 | - 每次运行`npm run dev` `config.tmpPath`都会被清理
136 |
137 | ### 打包配置项
138 |
139 | config.build | 描述
140 | ---|---
141 | htmlmin | 值为`true`时开启html压缩
142 | cssmin | 值为`true`时开启css压缩
143 | jsmin | 值为`true`时开启js压缩
144 | base64 | Number类型,单位(bytes),当css图片大小小于该值时将转base64
`css中图片地址必须为相对路径才会生效`
145 | cssSourcemap | 值为`true`时,生成cssSourcemap文件
146 | jsSourcemap | 值为`true`时,生成jsSourcemap文件
147 | cdn | 值为你的cdn地址
148 | versionHash | 值为`true`时,生成css js文件版本hash值
149 | proxyTable | 代理配置,[http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
150 |
151 | #### proxyTable配置实例
152 | ```
153 | proxyTable: {
154 | '/api': 'http://localhost:3000',
155 | '/hehe': {
156 | target: 'http://localhost:3000',
157 | pathRewrite: {
158 | // 地址重写
159 | '^/hehe': '/api'
160 | }
161 | }
162 | }
163 | ```
164 | ## 6、项目目录构建示例
165 | ### 6.1 Deom-0 见`src`目录
166 | 使用html,css,js构建项目
167 |
168 | ### 6.2 Deom-1 见`src-1`目录
169 | 使用pug(可选用),scss,js构建项目
170 | 将`config.srcPath`值设为`src-1`即可切换到该项目
171 |
172 | ## 7、其他
173 | ### 7.1 模块化?
174 | 推荐使用`sea.js`或`require.js`进行模块管理
175 |
176 | ### 7.2 为什么不在gulp中配置eslint?
177 | 推荐使用编辑器插件进行提示,还可以配置保存时自动修复eslint
178 |
179 | ### 7.3 js中如何判断是否为开发模式
180 |
181 | ```
182 | // 当前环境为开发环境
183 | var isDev = !!document.getElementById('__bs_script__')
184 | ```
185 | **注意:** isDev只能在body标签内的js中这样获取,或者在`DOMContenLoaded`或`load`事件回调中初始化 isDev
186 |
187 |
--------------------------------------------------------------------------------
/__webp__.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | function checkWebp() {
4 | try {
5 | return (document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') == 0)
6 | } catch (err) {
7 | return false
8 | }
9 | }
10 | var supportWebp = checkWebp()
11 | if (supportWebp) document.querySelector('html').className = document.querySelector('html').className + ' __webp__'
12 | window.addEventListener('DOMContentLoaded', function () {
13 | var imgEls = document.querySelectorAll('img[data-src]')
14 | for (var i = 0; i < imgEls.length; i++) {
15 | var imgSrc = imgEls[i].getAttribute('data-src')
16 | imgEls[i].removeAttribute('data-src')
17 | if (supportWebp) imgSrc = imgSrc.replace(/(\.[^\.]+)$/, '.webp')
18 | imgEls[i].src = imgSrc
19 | imgEls[i].style.visibility = 'visible'
20 | }
21 | })
22 | })()
23 |
24 |
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | srcPath: 'src',
3 | tmpPath: 'node_modules/__tmp__',
4 | pug: true,
5 | scss: true,
6 | babel: true,
7 | build: {
8 | htmlmin: true,
9 | cssmin: true,
10 | jsmin: true,
11 | base64: 4 * 1024, // (bytes) 使用css中图片使用相对路径,否者无效
12 | // cssSourcemap: true,
13 | // jsSourcemap: true,
14 | // cdn: 'http://your/cdn/url',
15 | versionHash: true, // 版本hash
16 | },
17 | // proxyTable: {
18 | // '/api': 'http://localhost:3000',
19 | // '/hehe': {
20 | // target: 'http://localhost:3000',
21 | // pathRewrite: {
22 | // // 地址重写
23 | // '^/hehe': '/api'
24 | // }
25 | // }
26 | // }
27 | }
--------------------------------------------------------------------------------
/dev-easy.md:
--------------------------------------------------------------------------------
1 | # dev-easy需求
2 | ## level1最低需求
3 | - 文件变动刷新浏览器(css 热更新)
4 | - css兼容性处理(postcss)
5 | - 打包压缩 图片 js css html
6 | - 雪碧图
7 | - 相对路径与绝对路径问题
8 |
9 | ## level2 前后端调试需求
10 | - proxy
11 | - mock
12 |
13 | ## level3 进阶
14 | - pug编译
15 | - scss编译
16 | - es6编译
17 | - sourcemap
18 | - 生成未压缩代码(以便于后端二次修改)
19 | - 文件合并
20 |
21 | ## level4 优化
22 | - eslint
23 | - stylint
24 | - cdn
25 | - webp
26 | - 图片转base64
27 | - 版本hash值
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | const gulp = require('gulp')
2 | const browserSync = require('browser-sync').create()
3 | const reload = browserSync.reload
4 | const postcss = require('gulp-postcss')
5 | const plumber = require('gulp-plumber')
6 | const fs = require('fs')
7 | const path = require('path')
8 | const gulpIf = require('gulp-if')
9 | // 压缩
10 | const htmlmin = require('gulp-htmlmin')
11 | const cleanCSS = require('gulp-clean-css')
12 | const uglify = require('gulp-uglify')
13 | const del = require('del')
14 | const chokidar = require('chokidar')
15 | // dev
16 |
17 | const config = require('./config')
18 | config.tmpPath = config.tmpPath || 'node_modules/__tmp__'
19 | config.srcPath = config.srcPath || 'src'
20 | gulp.task('del_tmp', function () {
21 | del.sync(path.resolve(__dirname, config.tmpPath))
22 | })
23 |
24 |
25 | const proxyMiddleware = require('http-proxy-middleware')
26 | const middleware = config.proxyTable && Object.prototype.toString.call(config.proxyTable) === '[object Object]' ? Object.keys(config.proxyTable).map(key => proxyMiddleware(key, typeof config.proxyTable[key] === 'string' ? { target: config.proxyTable[key] } : config.proxyTable[key])) : []
27 |
28 | gulp.task('dev', ['del_tmp'].concat(config.pug ? ['pug'] : []).concat((config.sass || config.scss) ? ['scss'] : []).concat(config.babel ? ['babel'] : []), function () {
29 | browserSync.init({
30 | server: {
31 | baseDir: [config.tmpPath, config.srcPath],
32 | },
33 | middleware,
34 | port: 9000,
35 | online: false,
36 | })
37 |
38 |
39 | // 监听缓存文件夹
40 | chokidar.watch([config.tmpPath, `${config.srcPath}/**/*.html`, `${config.srcPath}/**/*.css`], { ignoreInitial: true, ignorePermissionErrors: true })
41 | .on('all', function (event, filePath) {
42 | console.log('【dev】', event, filePath)
43 | if (/\.css$/.test(filePath)) {
44 | gulp.start('css')
45 | return
46 | }
47 | reload()
48 | })
49 |
50 | chokidar.watch(config.srcPath, { ignoreInitial: true, ignorePermissionErrors: true })
51 | .on('all', (event, filePath) => {
52 | let task
53 | let deleteFilePath
54 | try {
55 | console.log('【 src 】', event, path.resolve(__dirname, filePath))
56 | // 删除文件时,删除缓存
57 | if (event === 'change' || event === 'add') {
58 | if (/\.js$/.test(filePath)) {
59 | if (!config.babel) {
60 | reload()
61 | return
62 | }
63 | task = 'babel'
64 | } else if ((config.scss || config.sass) && /(\.scss|\.sass)$/.test(filePath)) {
65 | task = 'scss'
66 | } else if (config.pug && /(\.pug)$/.test(filePath)) {
67 | task = 'pug'
68 | }
69 | if (!task) return
70 |
71 | // mock
72 | if (event === 'change') {
73 | gulp.start(task)
74 | } else { // add
75 | setTimeout(() => {
76 | gulp.start(task)
77 | // 这100ms的延迟是为了,在拖动文件夹(文件)的时候,可以让unlink优先在babel触发,unlink钩子中删除文件缓存
78 | // 否者在执行task scripts时,由于缓存文件没有清楚,那么其实已经被删除的文件又会生成
79 | }, 100)
80 | }
81 | } else if (event === 'unlink' || event === 'unlinkDir') {
82 |
83 | if (event === 'unlink') {
84 |
85 | // 要删除的dev目录下的文件的后缀替换
86 | deleteFilePath = filePath.replace(/(\.scss|\.sass)$/, '.css')
87 | deleteFilePath = deleteFilePath.replace(/\.pug$/, '.html')
88 |
89 | } else {
90 | deleteFilePath = filePath // 删除的是文件夹
91 | }
92 |
93 | // 同步删除dev的文件
94 | // 文件名后缀替换
95 | deleteFilePath = path.resolve(__dirname, deleteFilePath.replace(config.srcPath, config.tmpPath))
96 |
97 | console.log('deleteFilePath= ', deleteFilePath)
98 | del.sync(deleteFilePath)
99 | reload()
100 | }
101 | } catch (err) {
102 | console.log('chokidar 事件函数内 错误:', err)
103 | }
104 |
105 | })
106 | })
107 |
108 | // css 热更新
109 | gulp.task('css', function () {
110 | return gulp.src([`${config.srcPath}/**/*.css`, `${config.tmpPath}/**/*.css`, `!${config.srcPath}/_vendor/**/*.css`])
111 | .pipe(plumber())
112 | // .pipe(postcss()) 报错就无法自动刷新了
113 | .pipe(reload({ stream: true }))
114 | })
115 |
116 | const changed = require('gulp-changed')
117 | const sourcemaps = require('gulp-sourcemaps')
118 |
119 | const pug = require('gulp-pug')
120 | gulp.task('pug', function () {
121 | return gulp.src([`${config.srcPath}/**/*.pug`, `!${config.srcPath}/_pug/**/*.pug`, `!${config.srcPath}/_modules/**/*.pug`])
122 | .pipe(plumber())
123 | // .pipe(changed(config.tmpPath, { extension: '.html' }))
124 | .pipe(pug({ pretty: true }))
125 | .pipe(gulp.dest(config.tmpPath))
126 | })
127 |
128 | const sass = require('gulp-sass')
129 | gulp.task('scss', function () {
130 | return gulp.src([`${config.srcPath}/**/*.{scss,sass}`, `!${config.srcPath}/_scss/**/*.{scss,sass}`, `!${config.srcPath}/_modules/**/*.{scss,sass}`])
131 | .pipe(plumber())
132 | // .pipe(changed(config.tmpPath, { extension: '.css' }))
133 | .pipe(sourcemaps.init())
134 | .pipe(sass({ outputStyle: 'expanded' }).on('error', sass.logError))
135 | .pipe(sourcemaps.write())
136 | .pipe(gulp.dest(config.tmpPath))
137 | })
138 |
139 | const babel = require('gulp-babel')
140 | gulp.task('babel', function () {
141 | return gulp.src([`${config.srcPath}/**/*.js`, `!${config.srcPath}/static/_vendor/**/*.js`])
142 | .pipe(plumber())
143 | .pipe(sourcemaps.init())
144 | .pipe(changed(config.tmpPath, { extension: '.js' }))
145 | .pipe(babel())
146 | .pipe(sourcemaps.write())
147 | .pipe(gulp.dest(config.tmpPath))
148 | })
149 | // build
150 | gulp.task('build', ['del_dist', 'move__vendor', 'copy', 'build_css', 'build_js', 'imgmin'], function () {
151 | gulp.start('build_html')
152 | })
153 |
154 |
155 | gulp.task('del_dist', function () {
156 | del.sync('dist')
157 | })
158 |
159 | gulp.task('move__vendor', function () {
160 | gulp.src(`${config.srcPath}/static/_vendor/**/*.*`)
161 | .pipe(gulp.dest('dist/static/_vendor'))
162 | })
163 |
164 | gulp.task('copy', function () {
165 | gulp.src([`${config.srcPath}/**/*.{ico,svg,gif,woff2,eot,ttf,otf,mp4,webm,ogg,mp3,wav,flac,aac}`])
166 | .pipe(gulp.dest('dist'))
167 | })
168 |
169 | const htmlminConfig = {
170 | // removeComments: true,//清除HTML注释
171 | collapseWhitespace: true, // 压缩HTML
172 | // collapseBooleanAttributes: true,//省略布尔属性的值 ==>
173 | // removeEmptyAttributes: true,//删除所有空格作属性值 ==>
174 | // removeScriptTypeAttributes: true,//删除`)
302 |
303 | $('img[src]:not(.not-webp)').each(function () {
304 | var imgEl = $(this)
305 | var src = imgEl.attr('src')
306 | if (/^http|\.(gif|svg)$/.test(src)) return
307 |
308 | imgEl.css('visibility', 'hidden')
309 | imgEl.removeAttr('src')
310 | imgEl.attr('data-src', src)
311 | })
312 |
313 | if ($('#__webp__').length > 0) return
314 | }))
315 | .pipe(gulp.dest('dist'))
316 | })
317 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dev-easy",
3 | "version": "1.0.0",
4 | "description": "gulp dev-easy",
5 | "main": "index.js",
6 | "scripts": {
7 | "dev": "gulp dev",
8 | "build": "gulp build",
9 | "start": "gulp start",
10 | "webp": "gulp webp",
11 | "sp": "gulp sprites",
12 | "lint": "eslint src",
13 | "fix": "eslint src --fix"
14 | },
15 | "author": "lfyfly",
16 | "license": "MIT",
17 | "repository": {
18 | "type": "git",
19 | "url": ""
20 | },
21 | "keywords": [
22 | "gulp",
23 | "development",
24 | "dev-easy"
25 | ],
26 | "devDependencies": {
27 | "autoprefixer": "^8.6.2",
28 | "babel-core": "^6.26.3",
29 | "babel-eslint": "^8.2.5",
30 | "babel-preset-latest": "^6.24.1",
31 | "browser-sync": "^2.24.4",
32 | "chokidar": "^2.0.4",
33 | "del": "^3.0.0",
34 | "eslint": "^5.0.1",
35 | "eslint-config-alloy": "^1.4.2",
36 | "gulp": "^3.9.1",
37 | "gulp-babel": "^7.0.1",
38 | "gulp-base64": "^0.1.3",
39 | "gulp-cache": "^1.0.2",
40 | "gulp-changed": "^3.2.0",
41 | "gulp-cheerio": "^0.6.3",
42 | "gulp-clean-css": "^3.9.4",
43 | "gulp-copy": "^1.1.0",
44 | "gulp-cssnano": "^2.1.3",
45 | "gulp-htmlmin": "^4.0.0",
46 | "gulp-if": "^2.0.2",
47 | "gulp-imagemin": "^4.1.0",
48 | "gulp-plumber": "^1.2.0",
49 | "gulp-postcss": "^7.0.1",
50 | "gulp-prefix": "0.0.15",
51 | "gulp-pug": "^4.0.1",
52 | "gulp-rev": "^8.1.1",
53 | "gulp-rev-replace": "^0.4.4",
54 | "gulp-sass": "^4.0.1",
55 | "gulp-sourcemaps": "^2.6.4",
56 | "gulp-tinypng-nokey": "^1.1.0",
57 | "gulp-uglify": "^3.0.0",
58 | "gulp-webp": "^3.0.0",
59 | "gulp-webpcss": "^1.1.1",
60 | "gulp.spritesmith": "^6.9.0",
61 | "http-proxy-middleware": "^0.18.0",
62 | "imagemin-mozjpeg": "^7.0.0",
63 | "imagemin-pngquant": "^6.0.0",
64 | "node-sass": "^4.9.3"
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/rev-manifest-css.json:
--------------------------------------------------------------------------------
1 | {
2 | "static/pages/about/about.css": "static/pages/about/about-d41d8cd98f.css",
3 | "static/pages/index/index.css": "static/pages/index/index-d41d8cd98f.css",
4 | "static/public/css/public.css": "static/public/css/public-9d26224afb.css",
5 | "static/sprites/icons.css": "static/sprites/icons-3c252d258c.css"
6 | }
--------------------------------------------------------------------------------
/rev-manifest-js.json:
--------------------------------------------------------------------------------
1 | {
2 | "static/pages/about/about.js": "static/pages/about/about-e179dbac85.js",
3 | "static/pages/index/index.js": "static/pages/index/index-c3c3c72ae3.js",
4 | "static/public/js/public.js": "static/public/js/public-fb6a2866c8.js"
5 | }
--------------------------------------------------------------------------------
/sprites/icons/a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/gulp-easy/28ca83dee64f3216a3dd32a352fcd9c357935423/sprites/icons/a.png
--------------------------------------------------------------------------------
/sprites/icons/b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/gulp-easy/28ca83dee64f3216a3dd32a352fcd9c357935423/sprites/icons/b.png
--------------------------------------------------------------------------------
/sprites/icons/c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/gulp-easy/28ca83dee64f3216a3dd32a352fcd9c357935423/sprites/icons/c.png
--------------------------------------------------------------------------------
/sprites/icons/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lfyfly/gulp-easy/28ca83dee64f3216a3dd32a352fcd9c357935423/sprites/icons/d.png
--------------------------------------------------------------------------------
/src-1/_modules/footer/footer.pug:
--------------------------------------------------------------------------------
1 | footer
2 | h1 footer footer footer
--------------------------------------------------------------------------------
/src-1/_modules/footer/footer.scss:
--------------------------------------------------------------------------------
1 | footer{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/src-1/_modules/header/header.pug:
--------------------------------------------------------------------------------
1 | header
2 | h1 header header header
--------------------------------------------------------------------------------
/src-1/_modules/header/header.scss:
--------------------------------------------------------------------------------
1 |
2 | header{
3 | background: #000;
4 | color: #fff;
5 | }
--------------------------------------------------------------------------------
/src-1/_pug/page.pug:
--------------------------------------------------------------------------------
1 | doctype html
2 | html
3 | head
4 | meta(charset='UTF-8')
5 | meta(name='viewport', content='width=device-width, initial-scale=1.0')
6 | meta(http-equiv='X-UA-Compatible', content='ie=edge')
7 | link(rel="stylesheet", href="static/public/css/public.css")
8 | block head
9 | body
10 | block header
11 | block main
12 | block footer
13 | script(src="static/_vendor/jquery-3.3.1.min.js")
14 | script(src="static/public/js/public.js")
15 | block scripts
16 |
--------------------------------------------------------------------------------
/src-1/about.pug:
--------------------------------------------------------------------------------
1 |
2 | extends ./_pug/page.pug
3 | block head
4 | title 关于我们
5 | link(rel="stylesheet", href="static/pages/about/about.css")
6 |
7 | block header
8 | include ./_modules/header/header.pug
9 |
10 | block main
11 | main
12 | h1 about-main
13 | a(href="index.html") to-index-page
14 | block footer
15 | include ./_modules/footer/footer.pug
16 |
17 | block scripts
18 | script(src="static/pages/about/about.js")
--------------------------------------------------------------------------------
/src-1/index.pug:
--------------------------------------------------------------------------------
1 |
2 | extends ./_pug/page.pug
3 | block head
4 | title 关于我们
5 | link(rel="stylesheet", href="static/pages/index/index.css")
6 |
7 | block header
8 | include ./_modules/header/header.pug
9 |
10 | block main
11 | main
12 | h1 index-main
13 | a(href="about.html") to-about-page
14 | block footer
15 | include ./_modules/footer/footer.pug
16 |
17 | block scripts
18 | script(src="static/pages/index/index.js")
--------------------------------------------------------------------------------
/src-1/static/_vendor/jquery-3.3.1.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/
16 |
17 |
18 |