Showing preview only (1,828K chars total). Download the full file or copy to clipboard to get everything.
Repository: raychenfj/vue-uweb
Branch: master
Commit: 579605e9a6ed
Files: 79
Total size: 1.7 MB
Directory structure:
gitextract_yj9gbp5a/
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── .stylelintrc
├── .travis.yml
├── .vscode/
│ └── settings.json
├── LICENSE
├── README.md
├── README_EN.md
├── build/
│ ├── build.js
│ ├── utils/
│ │ ├── index.js
│ │ ├── log.js
│ │ ├── style.js
│ │ └── write.js
│ ├── webpack.config.base.js
│ ├── webpack.config.dev.js
│ └── webpack.config.dll.js
├── dist/
│ ├── vue-uweb.common.js
│ ├── vue-uweb.esm.js
│ └── vue-uweb.js
├── examples/
│ ├── simple/
│ │ ├── index.html
│ │ ├── prism.css
│ │ ├── prism.js
│ │ ├── script.js
│ │ └── styles.css
│ └── webpack/
│ ├── .babelrc
│ ├── .editorconfig
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .postcssrc.js
│ ├── .vscode/
│ │ └── settings.json
│ ├── README.md
│ ├── build/
│ │ ├── build.js
│ │ ├── check-versions.js
│ │ ├── dev-client.js
│ │ ├── dev-server.js
│ │ ├── utils.js
│ │ ├── vue-loader.conf.js
│ │ ├── webpack.base.conf.js
│ │ ├── webpack.dev.conf.js
│ │ └── webpack.prod.conf.js
│ ├── config/
│ │ ├── dev.env.js
│ │ ├── index.js
│ │ └── prod.env.js
│ ├── index.html
│ ├── package.json
│ ├── src/
│ │ ├── app.css
│ │ ├── app.js
│ │ ├── app.vue
│ │ ├── main.js
│ │ └── uweb.js
│ └── static/
│ └── .gitkeep
├── package.json
├── src/
│ ├── directives/
│ │ ├── auto-pageview.js
│ │ ├── track-event.js
│ │ ├── track-pageview.js
│ │ └── util.js
│ ├── index.js
│ └── install.js
└── test/
├── .eslintrc
├── dist/
│ ├── vuePluginTemplateDeps.dll.js
│ └── vuePluginTemplateDeps.json
├── helpers/
│ ├── Test.vue
│ ├── index.js
│ ├── utils.js
│ └── wait-for-update.js
├── index.js
├── karma.conf.js
├── mocks.js
├── specs/
│ ├── directives/
│ │ ├── auto-pageview.spec.js
│ │ ├── track-event.spec.js
│ │ ├── track-pageview.spec.js
│ │ └── util.spec.js
│ └── index.spec.js
└── visual.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": [
[
"env",
{
"targets": {
"browsers": [
"last 2 versions"
]
}
}
]
],
"plugins": [
"transform-vue-jsx",
"transform-object-rest-spread",
"transform-runtime"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .eslintignore
================================================
dist/*.js
build/*
================================================
FILE: .eslintrc.js
================================================
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'vue',
// add your custom rules here
'rules': {
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
},
globals: {
requestAnimationFrame: true,
performance: true
}
}
================================================
FILE: .gitignore
================================================
.DS_Store
node_modules/
npm-debug.log
yarn-error.log
test/coverage
*.tgz
package
================================================
FILE: .postcssrc.js
================================================
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserlist" field in package.json
"autoprefixer": {}
}
}
================================================
FILE: .stylelintrc
================================================
{
"processors": ["stylelint-processor-html"],
"extends": "stylelint-config-standard",
"rules": {
"no-empty-source": null
}
}
================================================
FILE: .travis.yml
================================================
language: node_js
node_js: "node"
================================================
FILE: .vscode/settings.json
================================================
{
"vsicons.presets.angular": false
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017 Ray Chen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# vue-uweb
[](https://travis-ci.org/raychenfj/vue-uweb)
> vuejs 友盟统计埋点插件
## 1. 安装
```shell
npm install vue-uweb --save
```
直接在页面中引用
```html
<script src="./node_modules/vue-uweb/dist/vue-uweb.min.js"><script>
```
或通过es6模块加载
```javascript
import uweb from 'vue-uweb'
```
使用 vue-uweb 插件
```javascript
Vue.use(uweb,'YOUR_SITEID_HERE')
```
通过传递 options 参数进行更多设置
```javascript
Vue.use(uweb,options)
```
**options**
| 参数 | 必输 | 默认 | 说明 | 备注 |
|-----|------|-----|-----|------|
| siteId | 是 | | 绑定要接受API请求的统计代码siteid| |
| debug | 否 | false | 调试模式下将在控制台中输出调用 window._czc.push 时传递的参数 | **请不要在生产环境中使用,避免造成安全隐患** |
| autoPageview | 否 | true | 是否开启自动统计PV | |
| src | 否 | 精简代码 http://s11.cnzz.com/z_stat.php?id=SITEID&web_id=SITEID | 指定统计脚本标签的 src 属性 | |
## 2. uweb API
[查看官方文档](http://open.cnzz.com/a/new/procedure/)
**注意:** 所有 this 均为 Vue 实例
### 2.1 ready
当需要严格控制加载时序时,可使用 ready 方法。该方法返回一个 promise,当外部统计脚本加载完毕,全局 _czc 对象存在时,promise 被 resolve。
**用法**
```javascript
this.$uweb.ready().then(() => {
...
}).catch(() => {
... // error handling here
})
// 使用 async await, 建议使用 try/catch 避免加载失败影响主程序
async SOME_METHOD () {
try {
await this.$uweb.ready()
...
} catch (e){
... // error handling here
}
}
```
### 2.2 trackPageview
用于发送某个URL的PV统计请求,适用于统计AJAX、异步加载页面,友情链接,下载链接的流量。
**用法**
```javascript
this.$uweb.trackPageview(content_url[, referer_url])
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| content_url | 是 | string | 自定义虚拟PV页面的URL地址,填写以斜杠‘/’开头的相对路径,系统会自动补全域名 |
| referer_url | 否 | string | 自定义该受访页面的来源页URL地址,建议填写该异步加载页面的母页面。不填,则来路按母页面的来路计算。填为“空”,即"",则来路按“直接输入网址或书签”计算。 |
### 2.3 trackEvent
用于发送页面上按钮等交互元素被触发时的事件统计请求。如视频的“播放、暂停、调整音量”,页面上的“返回顶部”、“赞”、“收藏”等。也可用于发送Flash事件统计请求。
**用法**
```javascript
this.$uweb.trackEvent(category, action[, label, value, nodeid])
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| category | 是 | string | 表示事件发生在谁身上,如“视频”、“小说”、“轮显层”等等。 |
| action | 是 | string | 表示访客跟元素交互的行为动作,如"播放"、"收藏"、"翻层"等等。|
| label | 否 | string | 用于更详细的描述事件,如具体是哪个视频,哪部小说。|
| value | 否 | int | 用于填写打分型事件的分值,加载时间型事件的时长,订单型事件的价格。请填写整数数值,如果填写为其他形式,系统将按0处理。若填写为浮点小数,系统会自动取整,去掉小数点。|
| nodeid | 否 | string | 填写事件元素的div元素id。请填写class id,暂不支持name。|
### 2.4 setCustomVar
用于发送为访客打自定义标记的请求,用来统计会员访客、登录访客、不同来源访客的浏览数据。
**用法**
```javascript
this.$uweb.setCustomVar(name, value[, time])
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| name | 是 | string | 自定义访客种类,用来描述观察访客的角度,如“会员级别”、“访客来源”等等。 |
| value | 是 | string | 自定义访客值,表示对访客类型的具体描述,如"VIP1"、"VIP2"等等。|
| time | 否 | int | 有效时长,表示本自定义访客标记的生效时长。 不填或填“1”表示长期有效。填“0”表示仅在发包页面有效。填“2”表示仅在本访次有效。填具体数值,表示生效时长,单位“秒”。|
### 2.5 setAccount
当您的页面上添加了多个CNZZ统计代码时,需要用到本方法绑定需要哪个siteid对应的统计代码来接受API发送的请求。未绑定的siteid将忽略相关请求。
**备注:** 一般情况下无需调用该方法,只需调用 Vue.use 时直接传递 siteId 或通过 options.siteId 传递即可
**用法**
```javascript
this.$uweb.setAccount(siteid)
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| siteid | 是 | int | 绑定要接受API请求的统计代码siteid。 |
### 2.6 setAutoPageview
如果您使用_trackPageview改写了已有页面的URL,那么建议您在CNZZ的JS统计代码执行前先调用_setAutoPageview,将该页面的自动PV统计关闭,防止页面的流量被统计双倍。
**备注:** 在调用 Vue.use 时可通过 options.autoPageview 设置初始值,默认为 true
**用法**
```javascript
this.$uweb.setAutoPageview(autopageview)
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| autopageview | 是 | boolean | 是否自动发送页面PV的统计请求。关闭自动发送,填false开启自动发送,为true,不调用时默认为true。 |
### 2.7 deleteCustomVar ###
发送删除自定义访客标签的请求。将访客身上已被标记的自定义访客类型去掉,去掉后不再继续统计。
**用法**
```javascript
his.$uweb.deleteCustomVar(name)
```
**参数**
| 参数 | 必输 | 类型 | 说明 |
|-----|------|-----|-----|
| name | 是 | string | 需要被删除的自定义访客类型。 填写自定义访客类型种类名name。 |
## 3. uweb 指令
vue-uweb 提供 track-event,track-pageview 和 auto-pageview 三个指令,开发者可以直接在 html 模版中使用来统计网站数据
### 3.1 track-event
使用指令 v-track-event 监听事件, 通过 modifiers 指定事件类型,将自动为绑定元素添加事件监听,当事件触发调用统计代码。 如不指定事件,默认监听 click 事件。
可通过逗号分隔的字符串或对象字面量传递参数,以字符串传递时请注意参数顺序,可参考trackEvent API。
**用法**
```html
<button v-track-event.click="'category, action''"></button> // 统计click事件
<button v-track-event="'category, action'"></button> // 统计click事件简写
<input v-track-event.keypress="'category, action'"> // 统计keypress事件
<button v-track-event="'category, action, label, value, nodeid'"><button> // 以字符串传递参数
<button v-track-event="{category:'event', action:'click'}"></button> // 以对象字面量传递参数
```
### 3.2 track-pageview
使用指令 track-pageview 统计虚拟 PV ,一般可以配合 v-show 或 v-if 来统计局部动态视图的 PV。
可通过逗号分隔的字符串或对象字面量传递参数,以字符串传递时请注意参数顺序,可参考trackPageview API。
**用法**
```html
<div v-show="show" v-track-pageview="'/bar'">bar</div> // 跟踪 v-show 绑定元素的虚拟pv
<div v-if="show" v-track-pageview="'/foo'">foo</div> // 跟踪 v-if 绑定元素的虚拟pv
<div v-track-pageview="'/tar, https://github.com/raychenfj'"></div> // 以字符串指定受访页面和来源
<div v-track-pageview="{content_url:'/zoo', referer_url:'https://github.com/raychenfj'}"></div> // 以对象字面量指定受访页面和来源
```
### 3.3 auto-pageview
使用指令 auto-pageview 开关自动统计
**用法**
``` html
<div v-auto-pageview=true></div> // 启用 auto-pageview
<div v-auto-pageview=false></div> // 停止 auto-pageview
```
## 4. 默认参数和改变参数顺序
认情况下,vue-uweb 并不提供默认参数和参数顺序的设置,但开发者可以根据需求,使用装饰器模式,来提供默认参数和改变参数顺序。
例如:我们想在监听事件时默认category,只需要传递action,则代码如下
```javascript
let trackEvent = uweb.trackEvent
uweb.trackEvent = (action, category='default') => {
trackEvent.call(uweb, category, action, '', '', '')
}
Vue.use(uweb)
```
================================================
FILE: README_EN.md
================================================
================================================
FILE: build/build.js
================================================
const mkdirp = require('mkdirp')
const rollup = require('rollup').rollup
const vue = require('rollup-plugin-vue')
const jsx = require('rollup-plugin-jsx')
const buble = require('rollup-plugin-buble')
const replace = require('rollup-plugin-replace')
const cjs = require('rollup-plugin-commonjs')
const node = require('rollup-plugin-node-resolve')
const uglify = require('uglify-js')
const CleanCSS = require('clean-css')
// Make sure dist dir exists
mkdirp('dist')
const {
logError,
write,
banner,
name,
moduleName,
version,
processStyle
} = require('./utils')
function rollupBundle ({ env }) {
return rollup({
entry: 'src/index.js',
plugins: [
node({
extensions: ['.js', '.jsx', '.vue']
}),
cjs(),
vue({
compileTemplate: true,
css (styles, stylesNodes) {
// Only generate the styles once
if (env['process.env.NODE_ENV'] === '"production"') {
Promise.all(
stylesNodes.map(processStyle)
).then(css => {
const result = css.map(c => c.css).join('')
// write the css for every component
// TODO add it back if we extract all components to individual js
// files too
// css.forEach(writeCss)
if(result){
write(`dist/${name}.css`, result)
write(`dist/${name}.min.css`, new CleanCSS().minify(result).styles)
}
}).catch(logError)
}
}
}),
jsx({ factory: 'h' }),
replace(Object.assign({
__VERSION__: version
}, env)),
buble({
objectAssign: 'Object.assign'
})
]
})
}
const bundleOptions = {
banner,
exports: 'named',
format: 'umd',
moduleName
}
function createBundle ({ name, env, format }) {
return rollupBundle({
env
}).then(function (bundle) {
const options = Object.assign({}, bundleOptions)
if (format) options.format = format
const code = bundle.generate(options).code
if (/min$/.test(name)) {
const minified = uglify.minify(code, {
output: {
preamble: banner,
ascii_only: true // eslint-disable-line camelcase
}
}).code
return write(`dist/${name}.js`, minified)
} else {
return write(`dist/${name}.js`, code)
}
}).catch(logError)
}
// Browser bundle (can be used with script)
createBundle({
name: `${name}`,
env: {
'process.env.NODE_ENV': '"development"'
}
})
// Commonjs bundle (preserves process.env.NODE_ENV) so
// the user can replace it in dev and prod mode
createBundle({
name: `${name}.common`,
env: {},
format: 'cjs'
})
// uses export and import syntax. Should be used with modern bundlers
// like rollup and webpack 2
createBundle({
name: `${name}.esm`,
env: {},
format: 'es'
})
// Minified version for browser
createBundle({
name: `${name}.min`,
env: {
'process.env.NODE_ENV': '"production"'
}
})
================================================
FILE: build/utils/index.js
================================================
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const { join } = require('path')
const {
red,
logError
} = require('./log')
const {
processStyle
} = require('./style')
const uppercamelcase = require('uppercamelcase')
exports.write = require('./write')
const {
author,
name,
version,
dllPlugin
} = require('../../package.json')
const authorName = author.replace(/\s+<.*/, '')
const minExt = process.env.NODE_ENV === 'production' ? '.min' : ''
exports.author = authorName
exports.version = version
exports.dllName = dllPlugin.name
exports.moduleName = uppercamelcase(name)
exports.name = name
exports.filename = name + minExt
exports.banner = `/*!
* ${name} v${version}
* (c) ${new Date().getFullYear()} ${authorName}
* Released under the MIT License.
*/
`
// log.js
exports.red = red
exports.logError = logError
// It'd be better to add a sass property to the vue-loader options
// but it simply don't work
const sassOptions = {
includePaths: [
join(__dirname, '../../node_modules')
]
}
// don't extract css in test mode
const nullLoader = process.env.NODE_ENV === 'common' ? 'null-loader!' : ''
exports.vueLoaders =
process.env.BABEL_ENV === 'test' ? {
css: 'css-loader',
scss: `css-loader!sass-loader?${JSON.stringify(sassOptions)}`
} : {
css: ExtractTextPlugin.extract(`${nullLoader}css-loader`),
scss: ExtractTextPlugin.extract(
`${nullLoader}css-loader!sass-loader?${JSON.stringify(sassOptions)}`
)
}
// style.js
exports.processStyle = processStyle
================================================
FILE: build/utils/log.js
================================================
function logError (e) {
console.log(e)
}
function blue (str) {
return `\x1b[1m\x1b[34m${str}\x1b[39m\x1b[22m`
}
function green (str) {
return `\x1b[1m\x1b[32m${str}\x1b[39m\x1b[22m`
}
function red (str) {
return `\x1b[1m\x1b[31m${str}\x1b[39m\x1b[22m`
}
function yellow (str) {
return `\x1b[1m\x1b[33m${str}\x1b[39m\x1b[22m`
}
module.exports = {
blue,
green,
red,
yellow,
logError
}
================================================
FILE: build/utils/style.js
================================================
const path = require('path')
const postcss = require('postcss')
const cssnext = require('postcss-cssnext')
const CleanCSS = require('clean-css')
const { logError } = require('./log.js')
const write = require('./write.js')
function processCss (style) {
const componentName = path.basename(style.id, '.vue')
return postcss([cssnext()])
.process(style.code, {})
.then(result => {
return {
name: componentName,
css: result.css,
map: result.map
}
})
}
let stylus
function processStylus (style) {
try {
stylus = stylus || require('stylus')
} catch (e) {
logError(e)
}
const componentName = path.basename(style.id, '.vue')
return new Promise((resolve, reject) => {
stylus.render(style.code, function (err, css) {
if (err) return reject(err)
resolve({
original: {
code: style.code,
ext: 'styl'
},
name: componentName,
css
})
})
})
}
function processStyle (style) {
if (style.lang === 'css') {
return processCss(style)
} else if (style.lang === 'stylus') {
return processStylus(style)
} else {
throw new Error(`Unknown style language '${style.lang}'`)
}
}
function writeCss (style) {
write(`dist/${style.name}.css`, style.css)
if (style.original) {
write(`dist/${style.name}.${style.original.ext}`, style.original.code)
}
if (style.map) write(`dist/${style.name}.css.map`, style.map)
write(`dist/${style.name}.min.css`, new CleanCSS().minify(style.css).styles)
}
module.exports = {
writeCss,
processStyle
}
================================================
FILE: build/utils/write.js
================================================
const fs = require('fs')
const { blue } = require('./log.js')
function write (dest, code) {
return new Promise(function (resolve, reject) {
fs.writeFile(dest, code, function (err) {
if (err) return reject(err)
console.log(blue(dest) + ' ' + getSize(code))
resolve(code)
})
})
}
function getSize (code) {
return (code.length / 1024).toFixed(2) + 'kb'
}
module.exports = write
================================================
FILE: build/webpack.config.base.js
================================================
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const { resolve } = require('path')
const {
banner,
filename,
version,
vueLoaders
} = require('./utils')
const plugins = [
new webpack.DefinePlugin({
'__VERSION__': JSON.stringify(version),
'process.env.NODE_ENV': '"test"'
}),
new webpack.BannerPlugin({ banner, raw: true, entryOnly: true }),
new ExtractTextPlugin({
filename: `${filename}.css`,
// Don't extract css in test mode
disable: /^(common|test)$/.test(process.env.NODE_ENV)
})
]
module.exports = {
output: {
path: resolve(__dirname, '../dist'),
filename: `${filename}.common.js`
},
entry: './src/index.js',
resolve: {
extensions: ['.js', '.vue', '.jsx', 'css'],
alias: {
'src': resolve(__dirname, '../src')
}
},
module: {
rules: [
{
test: /.jsx?$/,
use: 'babel-loader',
include: [
resolve(__dirname, '../node_modules/@material'),
resolve(__dirname, '../src'),
resolve(__dirname, '../test')
]
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: vueLoaders,
postcss: [require('postcss-cssnext')()]
}
}
]
},
plugins
}
================================================
FILE: build/webpack.config.dev.js
================================================
const webpack = require('webpack')
const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const DashboardPlugin = require('webpack-dashboard/plugin')
const base = require('./webpack.config.base')
const { resolve, join } = require('path')
const { existsSync } = require('fs')
const {
dllName,
logError,
red,
vueLoaders
} = require('./utils')
const rootDir = resolve(__dirname, '../test')
const buildPath = resolve(rootDir, 'dist')
if (!existsSync(join(buildPath, dllName) + '.dll.js')) {
logError(red('The DLL manifest is missing. Please run `npm run build:dll` (Quit this with `q`)'))
process.exit(1)
}
const dllManifest = require(
join(buildPath, dllName) + '.json'
)
module.exports = merge(base, {
entry: {
tests: resolve(rootDir, 'visual.js')
},
output: {
path: buildPath,
filename: '[name].js',
chunkFilename: '[id].js'
},
module: {
rules: [
{
test: /.scss$/,
loader: vueLoaders.scss,
include: [
resolve(__dirname, '../node_modules/@material'),
resolve(__dirname, '../src')
]
}
]
},
plugins: [
new webpack.DllReferencePlugin({
context: join(__dirname, '..'),
manifest: dllManifest
}),
new HtmlWebpackPlugin({
chunkSortMode: 'dependency'
}),
new AddAssetHtmlPlugin({
filepath: require.resolve(
join(buildPath, dllName) + '.dll.js'
)
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module, count) {
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(join(__dirname, '../node_modules/')) === 0
)
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
new DashboardPlugin(),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
reportFilename: resolve(__dirname, `../reports/${process.env.NODE_ENV}.html`)
})
],
devtool: '#eval-source-map',
devServer: {
inline: true,
stats: {
colors: true,
chunks: false,
cached: false
},
contentBase: buildPath
},
performance: {
hints: false
}
})
================================================
FILE: build/webpack.config.dll.js
================================================
const { resolve, join } = require('path')
const webpack = require('webpack')
const pkg = require('../package.json')
const rootDir = resolve(__dirname, '../test')
const buildPath = resolve(rootDir, 'dist')
const entry = {}
entry[pkg.dllPlugin.name] = pkg.dllPlugin.include
module.exports = {
devtool: '#source-map',
entry,
output: {
path: buildPath,
filename: '[name].dll.js',
library: '[name]'
},
plugins: [
new webpack.DllPlugin({
name: '[name]',
path: join(buildPath, '[name].json')
})
],
performance: {
hints: false
}
}
================================================
FILE: dist/vue-uweb.common.js
================================================
/*!
* vue-uweb v0.2.2
* (c) 2019 raychenfj
* Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var toStr = Object.prototype.toString;
var isArguments = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr.call(value.callee) === '[object Function]';
}
return isArgs;
};
var keysShim$1;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr$1 = Object.prototype.toString;
var isArgs = isArguments; // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim$1 = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr$1.call(object) === '[object Function]';
var isArguments$$1 = isArgs(object);
var isString = isObject && toStr$1.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments$$1) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments$$1 && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
var implementation = keysShim$1;
var slice = Array.prototype.slice;
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation;
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
var args = Object.keys(arguments);
return args && args.length === arguments.length;
}(1, 2));
if (!keysWorksWithArguments) {
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
if (isArguments(object)) {
return originalKeys(slice.call(object));
}
return originalKeys(object);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
var objectKeys = keysShim;
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var toStr$2 = Object.prototype.toString;
var isStandardArguments = function isArguments(value) {
if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
return false;
}
return toStr$2.call(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
if (isStandardArguments(value)) {
return true;
}
return value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr$2.call(value) !== '[object Array]' &&
toStr$2.call(value.callee) === '[object Function]';
};
var supportsStandardArguments = (function () {
return isStandardArguments(arguments);
}());
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
var isArguments$2 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */
var NumberIsNaN = function (value) {
return value !== value;
};
var objectIs = function is(a, b) {
if (a === 0 && b === 0) {
return 1 / a === 1 / b;
} else if (a === b) {
return true;
} else if (NumberIsNaN(a) && NumberIsNaN(b)) {
return true;
}
return false;
};
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice$1 = Array.prototype.slice;
var toStr$4 = Object.prototype.toString;
var funcType = '[object Function]';
var implementation$2 = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr$4.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice$1.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice$1.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice$1.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
var functionBind = Function.prototype.bind || implementation$2;
var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;
var tryRegexExecCall = function tryRegexExec(value) {
try {
var lastIndex = value.lastIndex;
value.lastIndex = 0;
regexExec.call(value);
return true;
} catch (e) {
return false;
} finally {
value.lastIndex = lastIndex;
}
};
var toStr$3 = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isRegex = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
if (!hasToStringTag$1) {
return toStr$3.call(value) === regexClass;
}
var descriptor = gOPD(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
return tryRegexExecCall(value);
};
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr$5 = Object.prototype.toString;
var concat = Array.prototype.concat;
var origDefineProperty = Object.defineProperty;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr$5.call(fn) === '[object Function]';
};
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
return false;
}
return obj.x === obj;
} catch (e) { /* this is IE 8. */
return false;
}
};
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
var defineProperty = function (object, name, value, predicate) {
if (name in object && (!isFunction(predicate) || !predicate())) {
return;
}
if (supportsDescriptors) {
origDefineProperty(object, name, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[name] = value;
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = objectKeys(map);
if (hasSymbols) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
var defineProperties_1 = defineProperties;
var toObject = Object;
var TypeErr = TypeError;
var implementation$5 = function flags() {
if (this != null && this !== toObject(this)) {
throw new TypeErr('RegExp.prototype.flags getter called on non-object');
}
var result = '';
if (this.global) {
result += 'g';
}
if (this.ignoreCase) {
result += 'i';
}
if (this.multiline) {
result += 'm';
}
if (this.dotAll) {
result += 's';
}
if (this.unicode) {
result += 'u';
}
if (this.sticky) {
result += 'y';
}
return result;
};
var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
var gOPD$1 = Object.getOwnPropertyDescriptor;
var TypeErr$1 = TypeError;
var polyfill = function getPolyfill() {
if (!supportsDescriptors$1) {
throw new TypeErr$1('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
if (/a/mig.flags === 'gim') {
var descriptor = gOPD$1(RegExp.prototype, 'flags');
if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
return descriptor.get;
}
}
return implementation$5;
};
var supportsDescriptors$2 = defineProperties_1.supportsDescriptors;
var gOPD$2 = Object.getOwnPropertyDescriptor;
var defineProperty$1 = Object.defineProperty;
var TypeErr$2 = TypeError;
var getProto = Object.getPrototypeOf;
var regex = /a/;
var shim = function shimFlags() {
if (!supportsDescriptors$2 || !getProto) {
throw new TypeErr$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
var polyfill$$1 = polyfill();
var proto = getProto(regex);
var descriptor = gOPD$2(proto, 'flags');
if (!descriptor || descriptor.get !== polyfill$$1) {
defineProperty$1(proto, 'flags', {
configurable: true,
enumerable: false,
get: polyfill$$1
});
}
return polyfill$$1;
};
var flagsBound = Function.call.bind(implementation$5);
defineProperties_1(flagsBound, {
getPolyfill: polyfill,
implementation: implementation$5,
shim: shim
});
var regexp_prototype_flags = flagsBound;
var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateObject(value) {
try {
getDay.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr$6 = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isDateObject = function isDateObject(value) {
if (typeof value !== 'object' || value === null) { return false; }
return hasToStringTag$2 ? tryDateObject(value) : toStr$6.call(value) === dateClass;
};
var getTime = Date.prototype.getTime;
function deepEqual(actual, expected, options) {
var opts = options || {};
// 7.1. All identical values are equivalent, as determined by ===.
if (opts.strict ? objectIs(actual, expected) : actual === expected) {
return true;
}
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
return opts.strict ? objectIs(actual, expected) : actual == expected;
}
/*
* 7.4. For all other Object pairs, including Array objects, equivalence is
* determined by having the same number of owned properties (as verified
* with Object.prototype.hasOwnProperty.call), the same set of keys
* (although not necessarily the same order), equivalent values for every
* corresponding key, and an identical 'prototype' property. Note: this
* accounts for both named and indexed properties on Arrays.
*/
// eslint-disable-next-line no-use-before-define
return objEquiv(actual, expected, opts);
}
function isUndefinedOrNull(value) {
return value === null || value === undefined;
}
function isBuffer(x) {
if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
return false;
}
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
return false;
}
if (x.length > 0 && typeof x[0] !== 'number') {
return false;
}
return true;
}
function objEquiv(a, b, opts) {
/* eslint max-statements: [2, 50] */
var i, key;
if (typeof a !== typeof b) { return false; }
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
// an identical 'prototype' property.
if (a.prototype !== b.prototype) { return false; }
if (isArguments$2(a) !== isArguments$2(b)) { return false; }
var aIsRegex = isRegex(a);
var bIsRegex = isRegex(b);
if (aIsRegex !== bIsRegex) { return false; }
if (aIsRegex || bIsRegex) {
return a.source === b.source && regexp_prototype_flags(a) === regexp_prototype_flags(b);
}
if (isDateObject(a) && isDateObject(b)) {
return getTime.call(a) === getTime.call(b);
}
var aIsBuffer = isBuffer(a);
var bIsBuffer = isBuffer(b);
if (aIsBuffer !== bIsBuffer) { return false; }
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
if (a.length !== b.length) { return false; }
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) { return false; }
}
return true;
}
if (typeof a !== typeof b) { return false; }
try {
var ka = objectKeys(a);
var kb = objectKeys(b);
} catch (e) { // happens when one is a string literal and the other isn't
return false;
}
// having the same number of owned properties (keys incorporates hasOwnProperty)
if (ka.length !== kb.length) { return false; }
// the same set of keys (although not necessarily the same order),
ka.sort();
kb.sort();
// ~~~cheap key test
for (i = ka.length - 1; i >= 0; i--) {
if (ka[i] != kb[i]) { return false; }
}
// equivalent values for every corresponding key, and ~~~possibly expensive deep test
for (i = ka.length - 1; i >= 0; i--) {
key = ka[i];
if (!deepEqual(a[key], b[key], opts)) { return false; }
}
return true;
}
var deepEqual_1 = deepEqual;
/**
* if the binding value is equal to oldeValue
*/
function notChanged (binding) {
if (binding.oldValue !== undefined) {
if (typeof binding.value === 'object') {
return deepEqual_1(binding.value, binding.oldValue)
} else {
return binding.value === binding.oldValue
}
} else {
return false
}
}
/**
* if the binding value is empty
*/
function isEmpty (binding) {
return binding.value === '' || binding.value === undefined || binding.value === null
}
var autoPageview = function (el, binding) {
if (notChanged(binding)) { return }
var args = [];
if (binding.value === false || binding.value === 'false') { args.push(false); }
else { args.push(true); }
uweb.setAutoPageview.apply(uweb, args);
};
var trackEvent = function (el, binding) {
if (notChanged(binding) || isEmpty(binding)) { return }
if (el.removeEventListeners && typeof el.removeEventListeners === 'function') {
el.removeEventListeners();
}
var args = [];
// use modifier as events
var events = Object.keys(binding.modifiers).map(function (modifier) {
if (binding.modifiers[modifier]) {
return modifier
}
});
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.category) { args.push(value.category); }
if (value.action) { args.push(value.action); }
if (value.label) { args.push(value.label); }
if (value.value) { args.push(value.value); }
if (value.nodeid) { args.push(value.nodeid); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string') {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
if (!events.length) { events.push('click'); } // listen click event by default
// addEventListener for each event, call trackEvent api
var listeners = [];
events.forEach(function (event, index) {
listeners[index] = function () { return uweb.trackEvent.apply(uweb, args); };
el.addEventListener(event, listeners[index], false);
});
// a function to remove all previous event listeners in update cycle to prevent duplication
el.removeEventListeners = function () {
events.forEach(function (event, index) {
el.removeEventListener(event, listeners[index]);
});
};
};
var watch = [];
var trackPageview = {
bind: function bind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
var isWatched = index !== -1;
// watch for a v-show binded element, push it to watch queue when v-show is false
if (el.style.display === 'none') {
if (!isWatched) { watch.push(el); }
return
} else {
// remove from watch queue when v-show is true
if (isWatched) { watch.splice(index, 1); }
}
if (!isWatched && (notChanged(binding) || isEmpty(binding))) { return }
var args = [];
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.content_url) { args.push(value.content_url); }
if (value.referer_url) { args.push(value.referer_url); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string' && binding.value) {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
uweb.trackPageview.apply(uweb, args);
},
unbind: function unbind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
if (index !== -1) { watch.splice(index, 1); }
}
};
trackPageview.update = trackPageview.bind;
/**
* install
*
* @param {Vue} Vue
* @param {Object} options
* @returns
*/
function install (Vue, options) {
var this$1 = this;
if (!window) {
if (process.env.NODE_ENV !== 'production') {
console.warn('vue-uweb can only be used in browser');
}
return
}
if (this.install.installed) { return }
if (options.debug) {
this.debug = console.debug;
} else {
this.debug = function () {};
}
var siteId = null;
// passsing siteId through object or string
if (typeof options === 'object') {
siteId = options.siteId;
if (options.autoPageview !== false) {
options.autoPageview = true;
}
} else {
siteId = options;
}
if (!siteId) {
return console.error('siteId is missing')
}
this.install.installed = true;
// insert u-web statistics script
var script = document.createElement('script');
var src = "https://s11.cnzz.com/z_stat.php?id=" + siteId + "&web_id=" + siteId;
script.src = options.src || src;
// callback when the script is loaded
script.onload = function () {
// if the global object is exist, resolve the promise, otherwise reject it
if (window._czc) {
this$1._resolve();
} else {
console.error('loading uweb statistics script failed, please check src and siteId');
return this$1._reject()
}
// load from cache
this$1._cache.forEach(function (cache) {
window._czc.push(cache);
});
this$1._cache = [];
};
this.setAccount(options.siteId);
this.setAutoPageview(options.autoPageview);
document.body.appendChild(script);
// store into cache when the script is not fully loaded
// add $czc to Vue prototype
Object.defineProperty(Vue.prototype, '$uweb', {
get: function () { return this$1; }
});
Vue.directive('auto-pageview', autoPageview);
Vue.directive('track-event', trackEvent);
Vue.directive('track-pageview', trackPageview);
}
// deferred promise
var deferred = {};
deferred.promise = new Promise(function (resolve, reject) {
deferred.resolve = resolve;
deferred.reject = reject;
});
// uweb apis
var methods = [
'trackPageview', // http://open.cnzz.com/a/api/trackpageview/
'trackEvent', // http://open.cnzz.com/a/api/trackevent/
'setCustomVar', // http://open.cnzz.com/a/api/setcustomvar/
'setAccount', // http://open.cnzz.com/a/api/setaccount/
'setAutoPageview', // http://open.cnzz.com/a/api/setautopageview/
'deleteCustomVar' // http://open.cnzz.com/a/api/deletecustomvar/
];
var uweb = {
/**
* internal user only
*/
_cache: [],
/**
* internal user only, resolve the promise
*/
_resolve: function _resolve () {
deferred.resolve();
},
/**
* internal user only, reject the promise
*/
_reject: function _reject () {
deferred.reject();
},
/**
* push the args into _czc, or _cache if the script is not loaded yet
*/
_push: function _push () {
this.debug(arguments);
if (window._czc) {
window._czc.push.apply(window._czc, arguments);
} else {
this._cache.push.apply(this._cache, arguments);
}
},
/**
* general method to create uweb apis
*/
_createMethod: function _createMethod (method) {
return function () {
var args = Array.prototype.slice.apply(arguments);
this._push([("_" + method) ].concat( args));
}
},
/**
* debug
*/
debug: function debug () {},
/**
* the plugins is ready when the script is loaded
*/
ready: function ready () {
return deferred.promise
},
/**
* install function
*/
install: install,
/**
* patch up to create new api
*/
patch: function patch (method) {
this[method] = this._createMethod(method);
}
};
// uweb apis
methods.forEach(function (method) { return (uweb[method] = uweb._createMethod(method)); });
if (window.Vue) {
window.uweb = uweb;
}
exports['default'] = uweb;
================================================
FILE: dist/vue-uweb.esm.js
================================================
/*!
* vue-uweb v0.2.2
* (c) 2019 raychenfj
* Released under the MIT License.
*/
var toStr = Object.prototype.toString;
var isArguments = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr.call(value.callee) === '[object Function]';
}
return isArgs;
};
var keysShim$1;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr$1 = Object.prototype.toString;
var isArgs = isArguments; // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim$1 = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr$1.call(object) === '[object Function]';
var isArguments$$1 = isArgs(object);
var isString = isObject && toStr$1.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments$$1) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments$$1 && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
var implementation = keysShim$1;
var slice = Array.prototype.slice;
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation;
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
var args = Object.keys(arguments);
return args && args.length === arguments.length;
}(1, 2));
if (!keysWorksWithArguments) {
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
if (isArguments(object)) {
return originalKeys(slice.call(object));
}
return originalKeys(object);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
var objectKeys = keysShim;
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var toStr$2 = Object.prototype.toString;
var isStandardArguments = function isArguments(value) {
if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
return false;
}
return toStr$2.call(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
if (isStandardArguments(value)) {
return true;
}
return value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr$2.call(value) !== '[object Array]' &&
toStr$2.call(value.callee) === '[object Function]';
};
var supportsStandardArguments = (function () {
return isStandardArguments(arguments);
}());
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
var isArguments$2 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */
var NumberIsNaN = function (value) {
return value !== value;
};
var objectIs = function is(a, b) {
if (a === 0 && b === 0) {
return 1 / a === 1 / b;
} else if (a === b) {
return true;
} else if (NumberIsNaN(a) && NumberIsNaN(b)) {
return true;
}
return false;
};
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice$1 = Array.prototype.slice;
var toStr$4 = Object.prototype.toString;
var funcType = '[object Function]';
var implementation$2 = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr$4.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice$1.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice$1.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice$1.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
var functionBind = Function.prototype.bind || implementation$2;
var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;
var tryRegexExecCall = function tryRegexExec(value) {
try {
var lastIndex = value.lastIndex;
value.lastIndex = 0;
regexExec.call(value);
return true;
} catch (e) {
return false;
} finally {
value.lastIndex = lastIndex;
}
};
var toStr$3 = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isRegex = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
if (!hasToStringTag$1) {
return toStr$3.call(value) === regexClass;
}
var descriptor = gOPD(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
return tryRegexExecCall(value);
};
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr$5 = Object.prototype.toString;
var concat = Array.prototype.concat;
var origDefineProperty = Object.defineProperty;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr$5.call(fn) === '[object Function]';
};
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
return false;
}
return obj.x === obj;
} catch (e) { /* this is IE 8. */
return false;
}
};
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
var defineProperty = function (object, name, value, predicate) {
if (name in object && (!isFunction(predicate) || !predicate())) {
return;
}
if (supportsDescriptors) {
origDefineProperty(object, name, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[name] = value;
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = objectKeys(map);
if (hasSymbols) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
var defineProperties_1 = defineProperties;
var toObject = Object;
var TypeErr = TypeError;
var implementation$5 = function flags() {
if (this != null && this !== toObject(this)) {
throw new TypeErr('RegExp.prototype.flags getter called on non-object');
}
var result = '';
if (this.global) {
result += 'g';
}
if (this.ignoreCase) {
result += 'i';
}
if (this.multiline) {
result += 'm';
}
if (this.dotAll) {
result += 's';
}
if (this.unicode) {
result += 'u';
}
if (this.sticky) {
result += 'y';
}
return result;
};
var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
var gOPD$1 = Object.getOwnPropertyDescriptor;
var TypeErr$1 = TypeError;
var polyfill = function getPolyfill() {
if (!supportsDescriptors$1) {
throw new TypeErr$1('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
if (/a/mig.flags === 'gim') {
var descriptor = gOPD$1(RegExp.prototype, 'flags');
if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
return descriptor.get;
}
}
return implementation$5;
};
var supportsDescriptors$2 = defineProperties_1.supportsDescriptors;
var gOPD$2 = Object.getOwnPropertyDescriptor;
var defineProperty$1 = Object.defineProperty;
var TypeErr$2 = TypeError;
var getProto = Object.getPrototypeOf;
var regex = /a/;
var shim = function shimFlags() {
if (!supportsDescriptors$2 || !getProto) {
throw new TypeErr$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
var polyfill$$1 = polyfill();
var proto = getProto(regex);
var descriptor = gOPD$2(proto, 'flags');
if (!descriptor || descriptor.get !== polyfill$$1) {
defineProperty$1(proto, 'flags', {
configurable: true,
enumerable: false,
get: polyfill$$1
});
}
return polyfill$$1;
};
var flagsBound = Function.call.bind(implementation$5);
defineProperties_1(flagsBound, {
getPolyfill: polyfill,
implementation: implementation$5,
shim: shim
});
var regexp_prototype_flags = flagsBound;
var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateObject(value) {
try {
getDay.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr$6 = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isDateObject = function isDateObject(value) {
if (typeof value !== 'object' || value === null) { return false; }
return hasToStringTag$2 ? tryDateObject(value) : toStr$6.call(value) === dateClass;
};
var getTime = Date.prototype.getTime;
function deepEqual(actual, expected, options) {
var opts = options || {};
// 7.1. All identical values are equivalent, as determined by ===.
if (opts.strict ? objectIs(actual, expected) : actual === expected) {
return true;
}
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
return opts.strict ? objectIs(actual, expected) : actual == expected;
}
/*
* 7.4. For all other Object pairs, including Array objects, equivalence is
* determined by having the same number of owned properties (as verified
* with Object.prototype.hasOwnProperty.call), the same set of keys
* (although not necessarily the same order), equivalent values for every
* corresponding key, and an identical 'prototype' property. Note: this
* accounts for both named and indexed properties on Arrays.
*/
// eslint-disable-next-line no-use-before-define
return objEquiv(actual, expected, opts);
}
function isUndefinedOrNull(value) {
return value === null || value === undefined;
}
function isBuffer(x) {
if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
return false;
}
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
return false;
}
if (x.length > 0 && typeof x[0] !== 'number') {
return false;
}
return true;
}
function objEquiv(a, b, opts) {
/* eslint max-statements: [2, 50] */
var i, key;
if (typeof a !== typeof b) { return false; }
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
// an identical 'prototype' property.
if (a.prototype !== b.prototype) { return false; }
if (isArguments$2(a) !== isArguments$2(b)) { return false; }
var aIsRegex = isRegex(a);
var bIsRegex = isRegex(b);
if (aIsRegex !== bIsRegex) { return false; }
if (aIsRegex || bIsRegex) {
return a.source === b.source && regexp_prototype_flags(a) === regexp_prototype_flags(b);
}
if (isDateObject(a) && isDateObject(b)) {
return getTime.call(a) === getTime.call(b);
}
var aIsBuffer = isBuffer(a);
var bIsBuffer = isBuffer(b);
if (aIsBuffer !== bIsBuffer) { return false; }
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
if (a.length !== b.length) { return false; }
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) { return false; }
}
return true;
}
if (typeof a !== typeof b) { return false; }
try {
var ka = objectKeys(a);
var kb = objectKeys(b);
} catch (e) { // happens when one is a string literal and the other isn't
return false;
}
// having the same number of owned properties (keys incorporates hasOwnProperty)
if (ka.length !== kb.length) { return false; }
// the same set of keys (although not necessarily the same order),
ka.sort();
kb.sort();
// ~~~cheap key test
for (i = ka.length - 1; i >= 0; i--) {
if (ka[i] != kb[i]) { return false; }
}
// equivalent values for every corresponding key, and ~~~possibly expensive deep test
for (i = ka.length - 1; i >= 0; i--) {
key = ka[i];
if (!deepEqual(a[key], b[key], opts)) { return false; }
}
return true;
}
var deepEqual_1 = deepEqual;
/**
* if the binding value is equal to oldeValue
*/
function notChanged (binding) {
if (binding.oldValue !== undefined) {
if (typeof binding.value === 'object') {
return deepEqual_1(binding.value, binding.oldValue)
} else {
return binding.value === binding.oldValue
}
} else {
return false
}
}
/**
* if the binding value is empty
*/
function isEmpty (binding) {
return binding.value === '' || binding.value === undefined || binding.value === null
}
var autoPageview = function (el, binding) {
if (notChanged(binding)) { return }
var args = [];
if (binding.value === false || binding.value === 'false') { args.push(false); }
else { args.push(true); }
uweb.setAutoPageview.apply(uweb, args);
};
var trackEvent = function (el, binding) {
if (notChanged(binding) || isEmpty(binding)) { return }
if (el.removeEventListeners && typeof el.removeEventListeners === 'function') {
el.removeEventListeners();
}
var args = [];
// use modifier as events
var events = Object.keys(binding.modifiers).map(function (modifier) {
if (binding.modifiers[modifier]) {
return modifier
}
});
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.category) { args.push(value.category); }
if (value.action) { args.push(value.action); }
if (value.label) { args.push(value.label); }
if (value.value) { args.push(value.value); }
if (value.nodeid) { args.push(value.nodeid); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string') {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
if (!events.length) { events.push('click'); } // listen click event by default
// addEventListener for each event, call trackEvent api
var listeners = [];
events.forEach(function (event, index) {
listeners[index] = function () { return uweb.trackEvent.apply(uweb, args); };
el.addEventListener(event, listeners[index], false);
});
// a function to remove all previous event listeners in update cycle to prevent duplication
el.removeEventListeners = function () {
events.forEach(function (event, index) {
el.removeEventListener(event, listeners[index]);
});
};
};
var watch = [];
var trackPageview = {
bind: function bind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
var isWatched = index !== -1;
// watch for a v-show binded element, push it to watch queue when v-show is false
if (el.style.display === 'none') {
if (!isWatched) { watch.push(el); }
return
} else {
// remove from watch queue when v-show is true
if (isWatched) { watch.splice(index, 1); }
}
if (!isWatched && (notChanged(binding) || isEmpty(binding))) { return }
var args = [];
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.content_url) { args.push(value.content_url); }
if (value.referer_url) { args.push(value.referer_url); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string' && binding.value) {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
uweb.trackPageview.apply(uweb, args);
},
unbind: function unbind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
if (index !== -1) { watch.splice(index, 1); }
}
};
trackPageview.update = trackPageview.bind;
/**
* install
*
* @param {Vue} Vue
* @param {Object} options
* @returns
*/
function install (Vue, options) {
var this$1 = this;
if (!window) {
if (process.env.NODE_ENV !== 'production') {
console.warn('vue-uweb can only be used in browser');
}
return
}
if (this.install.installed) { return }
if (options.debug) {
this.debug = console.debug;
} else {
this.debug = function () {};
}
var siteId = null;
// passsing siteId through object or string
if (typeof options === 'object') {
siteId = options.siteId;
if (options.autoPageview !== false) {
options.autoPageview = true;
}
} else {
siteId = options;
}
if (!siteId) {
return console.error('siteId is missing')
}
this.install.installed = true;
// insert u-web statistics script
var script = document.createElement('script');
var src = "https://s11.cnzz.com/z_stat.php?id=" + siteId + "&web_id=" + siteId;
script.src = options.src || src;
// callback when the script is loaded
script.onload = function () {
// if the global object is exist, resolve the promise, otherwise reject it
if (window._czc) {
this$1._resolve();
} else {
console.error('loading uweb statistics script failed, please check src and siteId');
return this$1._reject()
}
// load from cache
this$1._cache.forEach(function (cache) {
window._czc.push(cache);
});
this$1._cache = [];
};
this.setAccount(options.siteId);
this.setAutoPageview(options.autoPageview);
document.body.appendChild(script);
// store into cache when the script is not fully loaded
// add $czc to Vue prototype
Object.defineProperty(Vue.prototype, '$uweb', {
get: function () { return this$1; }
});
Vue.directive('auto-pageview', autoPageview);
Vue.directive('track-event', trackEvent);
Vue.directive('track-pageview', trackPageview);
}
// deferred promise
var deferred = {};
deferred.promise = new Promise(function (resolve, reject) {
deferred.resolve = resolve;
deferred.reject = reject;
});
// uweb apis
var methods = [
'trackPageview', // http://open.cnzz.com/a/api/trackpageview/
'trackEvent', // http://open.cnzz.com/a/api/trackevent/
'setCustomVar', // http://open.cnzz.com/a/api/setcustomvar/
'setAccount', // http://open.cnzz.com/a/api/setaccount/
'setAutoPageview', // http://open.cnzz.com/a/api/setautopageview/
'deleteCustomVar' // http://open.cnzz.com/a/api/deletecustomvar/
];
var uweb = {
/**
* internal user only
*/
_cache: [],
/**
* internal user only, resolve the promise
*/
_resolve: function _resolve () {
deferred.resolve();
},
/**
* internal user only, reject the promise
*/
_reject: function _reject () {
deferred.reject();
},
/**
* push the args into _czc, or _cache if the script is not loaded yet
*/
_push: function _push () {
this.debug(arguments);
if (window._czc) {
window._czc.push.apply(window._czc, arguments);
} else {
this._cache.push.apply(this._cache, arguments);
}
},
/**
* general method to create uweb apis
*/
_createMethod: function _createMethod (method) {
return function () {
var args = Array.prototype.slice.apply(arguments);
this._push([("_" + method) ].concat( args));
}
},
/**
* debug
*/
debug: function debug () {},
/**
* the plugins is ready when the script is loaded
*/
ready: function ready () {
return deferred.promise
},
/**
* install function
*/
install: install,
/**
* patch up to create new api
*/
patch: function patch (method) {
this[method] = this._createMethod(method);
}
};
// uweb apis
methods.forEach(function (method) { return (uweb[method] = uweb._createMethod(method)); });
if (window.Vue) {
window.uweb = uweb;
}
export default uweb;
================================================
FILE: dist/vue-uweb.js
================================================
/*!
* vue-uweb v0.2.2
* (c) 2019 raychenfj
* Released under the MIT License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.VueUweb = global.VueUweb || {})));
}(this, (function (exports) { 'use strict';
var toStr = Object.prototype.toString;
var isArguments = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr.call(value.callee) === '[object Function]';
}
return isArgs;
};
var keysShim$1;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr$1 = Object.prototype.toString;
var isArgs = isArguments; // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim$1 = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr$1.call(object) === '[object Function]';
var isArguments$$1 = isArgs(object);
var isString = isObject && toStr$1.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments$$1) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments$$1 && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
var implementation = keysShim$1;
var slice = Array.prototype.slice;
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation;
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
var args = Object.keys(arguments);
return args && args.length === arguments.length;
}(1, 2));
if (!keysWorksWithArguments) {
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
if (isArguments(object)) {
return originalKeys(slice.call(object));
}
return originalKeys(object);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
var objectKeys = keysShim;
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var toStr$2 = Object.prototype.toString;
var isStandardArguments = function isArguments(value) {
if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
return false;
}
return toStr$2.call(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
if (isStandardArguments(value)) {
return true;
}
return value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr$2.call(value) !== '[object Array]' &&
toStr$2.call(value.callee) === '[object Function]';
};
var supportsStandardArguments = (function () {
return isStandardArguments(arguments);
}());
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
var isArguments$2 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */
var NumberIsNaN = function (value) {
return value !== value;
};
var objectIs = function is(a, b) {
if (a === 0 && b === 0) {
return 1 / a === 1 / b;
} else if (a === b) {
return true;
} else if (NumberIsNaN(a) && NumberIsNaN(b)) {
return true;
}
return false;
};
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice$1 = Array.prototype.slice;
var toStr$4 = Object.prototype.toString;
var funcType = '[object Function]';
var implementation$2 = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr$4.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice$1.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice$1.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice$1.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
var functionBind = Function.prototype.bind || implementation$2;
var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;
var tryRegexExecCall = function tryRegexExec(value) {
try {
var lastIndex = value.lastIndex;
value.lastIndex = 0;
regexExec.call(value);
return true;
} catch (e) {
return false;
} finally {
value.lastIndex = lastIndex;
}
};
var toStr$3 = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isRegex = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
if (!hasToStringTag$1) {
return toStr$3.call(value) === regexClass;
}
var descriptor = gOPD(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
return tryRegexExecCall(value);
};
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr$5 = Object.prototype.toString;
var concat = Array.prototype.concat;
var origDefineProperty = Object.defineProperty;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr$5.call(fn) === '[object Function]';
};
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
return false;
}
return obj.x === obj;
} catch (e) { /* this is IE 8. */
return false;
}
};
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
var defineProperty = function (object, name, value, predicate) {
if (name in object && (!isFunction(predicate) || !predicate())) {
return;
}
if (supportsDescriptors) {
origDefineProperty(object, name, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[name] = value;
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = objectKeys(map);
if (hasSymbols) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
var defineProperties_1 = defineProperties;
var toObject = Object;
var TypeErr = TypeError;
var implementation$5 = function flags() {
if (this != null && this !== toObject(this)) {
throw new TypeErr('RegExp.prototype.flags getter called on non-object');
}
var result = '';
if (this.global) {
result += 'g';
}
if (this.ignoreCase) {
result += 'i';
}
if (this.multiline) {
result += 'm';
}
if (this.dotAll) {
result += 's';
}
if (this.unicode) {
result += 'u';
}
if (this.sticky) {
result += 'y';
}
return result;
};
var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
var gOPD$1 = Object.getOwnPropertyDescriptor;
var TypeErr$1 = TypeError;
var polyfill = function getPolyfill() {
if (!supportsDescriptors$1) {
throw new TypeErr$1('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
if (/a/mig.flags === 'gim') {
var descriptor = gOPD$1(RegExp.prototype, 'flags');
if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
return descriptor.get;
}
}
return implementation$5;
};
var supportsDescriptors$2 = defineProperties_1.supportsDescriptors;
var gOPD$2 = Object.getOwnPropertyDescriptor;
var defineProperty$1 = Object.defineProperty;
var TypeErr$2 = TypeError;
var getProto = Object.getPrototypeOf;
var regex = /a/;
var shim = function shimFlags() {
if (!supportsDescriptors$2 || !getProto) {
throw new TypeErr$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
}
var polyfill$$1 = polyfill();
var proto = getProto(regex);
var descriptor = gOPD$2(proto, 'flags');
if (!descriptor || descriptor.get !== polyfill$$1) {
defineProperty$1(proto, 'flags', {
configurable: true,
enumerable: false,
get: polyfill$$1
});
}
return polyfill$$1;
};
var flagsBound = Function.call.bind(implementation$5);
defineProperties_1(flagsBound, {
getPolyfill: polyfill,
implementation: implementation$5,
shim: shim
});
var regexp_prototype_flags = flagsBound;
var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateObject(value) {
try {
getDay.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr$6 = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isDateObject = function isDateObject(value) {
if (typeof value !== 'object' || value === null) { return false; }
return hasToStringTag$2 ? tryDateObject(value) : toStr$6.call(value) === dateClass;
};
var getTime = Date.prototype.getTime;
function deepEqual(actual, expected, options) {
var opts = options || {};
// 7.1. All identical values are equivalent, as determined by ===.
if (opts.strict ? objectIs(actual, expected) : actual === expected) {
return true;
}
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
return opts.strict ? objectIs(actual, expected) : actual == expected;
}
/*
* 7.4. For all other Object pairs, including Array objects, equivalence is
* determined by having the same number of owned properties (as verified
* with Object.prototype.hasOwnProperty.call), the same set of keys
* (although not necessarily the same order), equivalent values for every
* corresponding key, and an identical 'prototype' property. Note: this
* accounts for both named and indexed properties on Arrays.
*/
// eslint-disable-next-line no-use-before-define
return objEquiv(actual, expected, opts);
}
function isUndefinedOrNull(value) {
return value === null || value === undefined;
}
function isBuffer(x) {
if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
return false;
}
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
return false;
}
if (x.length > 0 && typeof x[0] !== 'number') {
return false;
}
return true;
}
function objEquiv(a, b, opts) {
/* eslint max-statements: [2, 50] */
var i, key;
if (typeof a !== typeof b) { return false; }
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
// an identical 'prototype' property.
if (a.prototype !== b.prototype) { return false; }
if (isArguments$2(a) !== isArguments$2(b)) { return false; }
var aIsRegex = isRegex(a);
var bIsRegex = isRegex(b);
if (aIsRegex !== bIsRegex) { return false; }
if (aIsRegex || bIsRegex) {
return a.source === b.source && regexp_prototype_flags(a) === regexp_prototype_flags(b);
}
if (isDateObject(a) && isDateObject(b)) {
return getTime.call(a) === getTime.call(b);
}
var aIsBuffer = isBuffer(a);
var bIsBuffer = isBuffer(b);
if (aIsBuffer !== bIsBuffer) { return false; }
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
if (a.length !== b.length) { return false; }
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) { return false; }
}
return true;
}
if (typeof a !== typeof b) { return false; }
try {
var ka = objectKeys(a);
var kb = objectKeys(b);
} catch (e) { // happens when one is a string literal and the other isn't
return false;
}
// having the same number of owned properties (keys incorporates hasOwnProperty)
if (ka.length !== kb.length) { return false; }
// the same set of keys (although not necessarily the same order),
ka.sort();
kb.sort();
// ~~~cheap key test
for (i = ka.length - 1; i >= 0; i--) {
if (ka[i] != kb[i]) { return false; }
}
// equivalent values for every corresponding key, and ~~~possibly expensive deep test
for (i = ka.length - 1; i >= 0; i--) {
key = ka[i];
if (!deepEqual(a[key], b[key], opts)) { return false; }
}
return true;
}
var deepEqual_1 = deepEqual;
/**
* if the binding value is equal to oldeValue
*/
function notChanged (binding) {
if (binding.oldValue !== undefined) {
if (typeof binding.value === 'object') {
return deepEqual_1(binding.value, binding.oldValue)
} else {
return binding.value === binding.oldValue
}
} else {
return false
}
}
/**
* if the binding value is empty
*/
function isEmpty (binding) {
return binding.value === '' || binding.value === undefined || binding.value === null
}
var autoPageview = function (el, binding) {
if (notChanged(binding)) { return }
var args = [];
if (binding.value === false || binding.value === 'false') { args.push(false); }
else { args.push(true); }
uweb.setAutoPageview.apply(uweb, args);
};
var trackEvent = function (el, binding) {
if (notChanged(binding) || isEmpty(binding)) { return }
if (el.removeEventListeners && typeof el.removeEventListeners === 'function') {
el.removeEventListeners();
}
var args = [];
// use modifier as events
var events = Object.keys(binding.modifiers).map(function (modifier) {
if (binding.modifiers[modifier]) {
return modifier
}
});
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.category) { args.push(value.category); }
if (value.action) { args.push(value.action); }
if (value.label) { args.push(value.label); }
if (value.value) { args.push(value.value); }
if (value.nodeid) { args.push(value.nodeid); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string') {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
if (!events.length) { events.push('click'); } // listen click event by default
// addEventListener for each event, call trackEvent api
var listeners = [];
events.forEach(function (event, index) {
listeners[index] = function () { return uweb.trackEvent.apply(uweb, args); };
el.addEventListener(event, listeners[index], false);
});
// a function to remove all previous event listeners in update cycle to prevent duplication
el.removeEventListeners = function () {
events.forEach(function (event, index) {
el.removeEventListener(event, listeners[index]);
});
};
};
var watch = [];
var trackPageview = {
bind: function bind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
var isWatched = index !== -1;
// watch for a v-show binded element, push it to watch queue when v-show is false
if (el.style.display === 'none') {
if (!isWatched) { watch.push(el); }
return
} else {
// remove from watch queue when v-show is true
if (isWatched) { watch.splice(index, 1); }
}
if (!isWatched && (notChanged(binding) || isEmpty(binding))) { return }
var args = [];
// passing parameters as object
if (typeof binding.value === 'object') {
var value = binding.value;
if (value.content_url) { args.push(value.content_url); }
if (value.referer_url) { args.push(value.referer_url); }
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string' && binding.value) {
args = binding.value.split(',');
args.forEach(function (arg, i) { return (args[i] = arg.trim()); });
}
uweb.trackPageview.apply(uweb, args);
},
unbind: function unbind (el, binding) {
var index = watch.findIndex(function (element) { return element === el; });
if (index !== -1) { watch.splice(index, 1); }
}
};
trackPageview.update = trackPageview.bind;
/**
* install
*
* @param {Vue} Vue
* @param {Object} options
* @returns
*/
function install (Vue, options) {
var this$1 = this;
if (!window) {
{
console.warn('vue-uweb can only be used in browser');
}
return
}
if (this.install.installed) { return }
if (options.debug) {
this.debug = console.debug;
} else {
this.debug = function () {};
}
var siteId = null;
// passsing siteId through object or string
if (typeof options === 'object') {
siteId = options.siteId;
if (options.autoPageview !== false) {
options.autoPageview = true;
}
} else {
siteId = options;
}
if (!siteId) {
return console.error('siteId is missing')
}
this.install.installed = true;
// insert u-web statistics script
var script = document.createElement('script');
var src = "https://s11.cnzz.com/z_stat.php?id=" + siteId + "&web_id=" + siteId;
script.src = options.src || src;
// callback when the script is loaded
script.onload = function () {
// if the global object is exist, resolve the promise, otherwise reject it
if (window._czc) {
this$1._resolve();
} else {
console.error('loading uweb statistics script failed, please check src and siteId');
return this$1._reject()
}
// load from cache
this$1._cache.forEach(function (cache) {
window._czc.push(cache);
});
this$1._cache = [];
};
this.setAccount(options.siteId);
this.setAutoPageview(options.autoPageview);
document.body.appendChild(script);
// store into cache when the script is not fully loaded
// add $czc to Vue prototype
Object.defineProperty(Vue.prototype, '$uweb', {
get: function () { return this$1; }
});
Vue.directive('auto-pageview', autoPageview);
Vue.directive('track-event', trackEvent);
Vue.directive('track-pageview', trackPageview);
}
// deferred promise
var deferred = {};
deferred.promise = new Promise(function (resolve, reject) {
deferred.resolve = resolve;
deferred.reject = reject;
});
// uweb apis
var methods = [
'trackPageview', // http://open.cnzz.com/a/api/trackpageview/
'trackEvent', // http://open.cnzz.com/a/api/trackevent/
'setCustomVar', // http://open.cnzz.com/a/api/setcustomvar/
'setAccount', // http://open.cnzz.com/a/api/setaccount/
'setAutoPageview', // http://open.cnzz.com/a/api/setautopageview/
'deleteCustomVar' // http://open.cnzz.com/a/api/deletecustomvar/
];
var uweb = {
/**
* internal user only
*/
_cache: [],
/**
* internal user only, resolve the promise
*/
_resolve: function _resolve () {
deferred.resolve();
},
/**
* internal user only, reject the promise
*/
_reject: function _reject () {
deferred.reject();
},
/**
* push the args into _czc, or _cache if the script is not loaded yet
*/
_push: function _push () {
this.debug(arguments);
if (window._czc) {
window._czc.push.apply(window._czc, arguments);
} else {
this._cache.push.apply(this._cache, arguments);
}
},
/**
* general method to create uweb apis
*/
_createMethod: function _createMethod (method) {
return function () {
var args = Array.prototype.slice.apply(arguments);
this._push([("_" + method) ].concat( args));
}
},
/**
* debug
*/
debug: function debug () {},
/**
* the plugins is ready when the script is loaded
*/
ready: function ready () {
return deferred.promise
},
/**
* install function
*/
install: install,
/**
* patch up to create new api
*/
patch: function patch (method) {
this[method] = this._createMethod(method);
}
};
// uweb apis
methods.forEach(function (method) { return (uweb[method] = uweb._createMethod(method)); });
if (window.Vue) {
window.uweb = uweb;
}
exports['default'] = uweb;
Object.defineProperty(exports, '__esModule', { value: true });
})));
================================================
FILE: examples/simple/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>vue-uweb</title>
<link rel="stylesheet" href="./prism.css">
<link rel="stylesheet" href="./styles.css">
<script src="./prism.js"></script>
<script src="./vue.min.js"></script>
<script src="../../dist/index.js"></script>
</head>
<body>
<div id="app">
<img id="logo" src="./images/logo.png" alt="Vue logo">
<h1>欢迎使用vue-uweb插件</h1>
<h2>1. 安装</h2>
<h3>npm</h3>
<pre><code class="language-html">npm install vue-uweb --save</code></pre>
<h3>直接在页面中引用</h3>
<pre><code class="language-html"><script src="../node_modules/vue-uweb/dist/index.js"></script></code></pre>
<h3>通过es6模块加载</h3>
<pre><code class="language-javascript">import uweb from 'vue-uweb'</code></pre>
<h3>使用 vue-uweb</h3>
<pre><code class="language-javascript">Vue.use(uweb,'YOUR_SITEID_HERE')</code></pre>
<h3>通过传递 options 参数进行更多设置</h3>
<pre><code class="language-javascript">Vue.use(uweb,options)</code></pre>
<div>options</div>
<ul>
<li>debug,可选,调试模式下将在控制台中输出调用 window._czc.push 时传递的参数,默认为 false,<b>请不要在生产环境中使用</b>,避免造成安全隐患</li>
<li>siteId,必填,绑定要接受API请求的统计代码siteid</li>
<li>autoPageview,可选,是否开启自动统计PV,默认为 true</li>
<li>src,可选,指定统计脚本标签的 src 属性,默认为 http://s11.cnzz.com/z_stat.php?id=SITEID&web_id=SITEID</li>
</ul>
<h2>2. uweb API</h2>
<a href="http://open.cnzz.com/a/new/procedure/">查看官方文档</a>
<div>
<b>注意:</b> 所有this均为 Vue 实例
</div>
<h3>2.1 ready</h3>
<div>当需要严格控制加载时序时,可使用 ready 方法。该方法返回一个 promise,当外部统计脚本加载完毕,全局 _czc 对象存在时,promise 被 resolve。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.ready().then(() => {
...
}).catch(() => {
... // error handling here
})
// 使用 async await, 建议使用 try/catch 避免加载失败影响主程序
async SOME_METHOD () {
try {
await this.$uweb.ready()
...
} catch (e){
... // error handling here
}
}</code></pre>
</li>
</ul>
<h3>2.2 trackPageview</h3>
<div>用于发送某个URL的PV统计请求,适用于统计AJAX、异步加载页面,友情链接,下载链接的流量。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.trackPageview(content_url[, referer_url])</code></pre>
</li>
<li>参数
<ul>
<li>content_url,必填, string,自定义虚拟PV页面的URL地址,填写以斜杠‘/’开头的相对路径,系统会自动补全域名</li>
<li>referer_url,选填, string,自定义该受访页面的来源页URL地址,建议填写该异步加载页面的母页面。不填,则来路按母页面的来路计算。填为“空”,即"",则来路按“直接输入网址或书签”计算。</li>
</ul>
</li>
</ul>
<h3>2.3 trackEvent</h3>
<div>用于发送页面上按钮等交互元素被触发时的事件统计请求。如视频的“播放、暂停、调整音量”,页面上的“返回顶部”、“赞”、“收藏”等。也可用于发送Flash事件统计请求。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.trackEvent(category, action[, label, value, nodeid])</code></pre>
</li>
<li>参数
<ul>
<li>category,必填,string,表示事件发生在谁身上,如“视频”、“小说”、“轮显层”等等。</li>
<li>action,必填,string,表示访客跟元素交互的行为动作,如"播放"、"收藏"、"翻层"等等。</li>
<li>label,选填,string,用于更详细的描述事件,如具体是哪个视频,哪部小说。</li>
<li>value,选填,int,用于填写打分型事件的分值,加载时间型事件的时长,订单型事件的价格。请填写整数数值,如果填写为其他形式,系统将按0处理。若填写为浮点小数,系统会自动取整,去掉小数点。</li>
<li>nodeid,选填,string,填写事件元素的div元素id。请填写class id,暂不支持name。</li>
</ul>
</li>
</ul>
<h3>2.4 setCustomVar</h3>
<div>用于发送为访客打自定义标记的请求,用来统计会员访客、登录访客、不同来源访客的浏览数据。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.setCustomVar(name, value[, time])</code></pre>
</li>
<li>参数
<ul>
<li>name,必填,string,自定义访客种类,用来描述观察访客的角度,如“会员级别”、“访客来源”等等。</li>
<li>value,必填,string,自定义访客值,表示对访客类型的具体描述,如"VIP1"、"VIP2"等等。</li>
<li>time,选填,int,有效时长,表示本自定义访客标记的生效时长。 不填或填“1”表示长期有效。填“0”表示仅在发包页面有效。填“2”表示仅在本访次有效。填具体数值,表示生效时长,单位“秒”。</li>
</ul>
</li>
</ul>
<h3>2.5 setAccount</h3>
<div>当您的页面上添加了多个CNZZ统计代码时,需要用到本方法绑定需要哪个siteid对应的统计代码来接受API发送的请求。未绑定的siteid将忽略相关请求。</div>
<ul>
<li>备注: 一般情况下无需调用该方法,只需调用 Vue.use 时直接传递 siteId 或通过 options.siteId 传递即可
</li>
<li>用法
<pre><code class="language-javascript">this.$uweb.setAccount(siteid)</code></pre>
</li>
<li>参数
<ul>
<li>siteid,必填,int,绑定要接受API请求的统计代码siteid。</li>
</ul>
</li>
</ul>
<h3>2.6 setAutoPageview</h3>
<div>如果您使用_trackPageview改写了已有页面的URL,那么建议您在CNZZ的JS统计代码执行前先调用_setAutoPageview,将该页面的自动PV统计关闭,防止页面的流量被统计双倍。</div>
<ul>
<li>备注: 在调用 Vue.use 时可通过通过 options.autoPageview 设置初始值,默认为 true
</li>
<li>用法
<pre><code class="language-javascript">this.$uweb.setAutoPageview(autopageview)</code></pre>
</li>
<li>参数
<ul>
<li>autopageview,必填,boolean,是否自动发送页面PV的统计请求。关闭自动发送,填false开启自动发送,为true,不调用时默认为true</li>
</ul>
</li>
</ul>
<h3>2.7 deleteCustomVar</h3>
<div>发送删除自定义访客标签的请求。将访客身上已被标记的自定义访客类型去掉,去掉后不再继续统计。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.deleteCustomVar(name)</code></pre>
</li>
<li>参数
<ul>
<li>name,必填,string,需要被删除的自定义访客类型。 填写自定义访客类型种类名name。</li>
</ul>
</li>
</ul>
<h2>3. uweb 指令</h2>
<h3>3.1 track-event</h3>
<div>
使用指令 v-track-event 监听事件, 通过modifiers指定事件类型,将自动为绑定元素添加事件监听,当事件触发调用统计代码。 如不指定,默认监听 click 事件。 可通过逗号分隔的字符串或对象字面量传递参数,以字符串传递时请注意参数顺序,可参考
trackEvent API
</div><br>
<button v-track-event.click="'event, click'">统计click事件</button>
<pre><code class="language-html"><button v-track-event.click="'event, click''"></button></code></pre>
<button v-track-event="'event, shortcut'">统计click事件简写</button>
<pre><code class="language-html"><button v-track-event="'event, shortcut'"></button></code></pre>
<input v-track-event.keypress="'event, keypress'" placeholder="统计keypress事件" v-model="content"></input>
<pre><code class="language-html"><input v-track-event.keypress="'event, keypress'"></code></pre>
<button v-track-event="'event, click'">以字符串传递参数</button>
<a href="http://open.cnzz.com/a/api/trackevent/">关于参数和顺序</a>
<pre><code class="language-html"><button v-track-event="'event, click'"></button></code></pre>
<button v-track-event="{category:'event', action:'click'}">以对象字面量传递参数</button>
<pre><code class="language-html"><button v-track-event="{category:'event', action:'click'}"></button></code></pre>
<h3>3.2 track-pageview</h3>
<div>
使用 v-show 跟踪虚拟pv
<input type="checkbox" v-model="vshow"></input>
</div>
<div v-show="vshow" v-track-pageview="'/bar'">bar</div>
<pre><code class="language-html"><div v-show="vshow" v-track-pageview="'/bar'"></div></code></pre>
<div>
使用 v-if 跟踪虚拟pv
<input type="checkbox" v-model="vif"></input>
</div>
<div v-if="vif" v-track-pageview="'/foo'">foo</div>
<pre><code class="language-html"><div v-if="vif" v-track-pageview="'/foo'"></div></code></pre>
<div v-track-pageview="'/tar, https://github.com/raychenfj'">以字符串指定受访页面和来源</div>
<pre><code class="language-html"><div v-track-pageview="'/tar, https://github.com/raychenfj'"></div></code></pre>
<div v-track-pageview="{content_url:'/zoo', referer_url:'https://github.com/raychenfj'}">以对象字面量指定受访页面和来源</div>
<pre><code class="language-html"><div v-track-pageview="{content_url:'/zoo', referer_url:'https://github.com/raychenfj'}"></div></code></pre>
<h3>3.3 auto-pageview</h3>
<span v-auto-pageview="auto">autoPageView: {{auto}}</span>
<input type="checkbox" v-model="auto">
<div>启用 auto-pageview</div>
<pre><code class="language-html"><div v-auto-pageview=true></div></code></pre>
<div>停止 auto-pageview</div>
<pre><code class="language-html"><div v-auto-pageview=false></div></code></pre>
<h1>4. 默认参数和改变参数顺序</h1>
<div>默认情况下,vue-uweb 并不提供默认参数和参数顺序的设置,但开发者可以根据需求,使用装饰器模式,来提供默认参数和改变参数顺序。例如:我们想在监听事件时默认category,只需要传递action,则代码如下</div>
<pre><code class="language-javascript">import uweb from 'vue-uweb'
let trackEvent = uweb.trackEvent
uweb.trackEvent = (action, category='default'') => {
trackEvent.call(uweb, category, action, '', '', '')
}
Vue.use(uweb)
</code></pre>
<div><b>注意:</b>由于所有 uweb指令 最终都将调用 uweb api 中的方法,所以对默认参数和参数顺序的修改同样会影响指令的参数和顺序</div>
</div>
</body>
<script src="./script.js"></script>
</html>
================================================
FILE: examples/simple/prism.css
================================================
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=toolbar+highlight-keywords+show-language */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
pre.code-toolbar {
position: relative;
}
pre.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}
pre.code-toolbar:hover > .toolbar {
opacity: 1;
}
pre.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}
pre.code-toolbar > .toolbar a {
cursor: pointer;
}
pre.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}
pre.code-toolbar > .toolbar a,
pre.code-toolbar > .toolbar button,
pre.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: .5em;
}
pre.code-toolbar > .toolbar a:hover,
pre.code-toolbar > .toolbar a:focus,
pre.code-toolbar > .toolbar button:hover,
pre.code-toolbar > .toolbar button:focus,
pre.code-toolbar > .toolbar span:hover,
pre.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}
================================================
FILE: examples/simple/prism.js
================================================
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=highlight-keywords */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){var t=n.util.type(e);switch(t){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=n.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return n.util.clone(e)})}return e}},languages:{extend:function(e,t){var a=n.util.clone(n.languages[e]);for(var r in t)a[r]=t[r];return a},insertBefore:function(e,t,a,r){r=r||n.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==t)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return n.languages.DFS(n.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,t,a,r){r=r||{};for(var l in e)e.hasOwnProperty(l)&&(t.call(e,l,e[l],a||l),"Object"!==n.util.type(e[l])||r[n.util.objId(e[l])]?"Array"!==n.util.type(e[l])||r[n.util.objId(e[l])]||(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,l,r)):(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,null,r)))}},plugins:{},highlightAll:function(e,t){var a={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",a);for(var r,l=a.elements||document.querySelectorAll(a.selector),i=0;r=l[i++];)n.highlightElement(r,e===!0,a.callback)},highlightElement:function(t,a,r){for(var l,i,o=t;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,""])[1].toLowerCase(),i=n.languages[l]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,o=t.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var s=t.textContent,u={element:t,language:l,grammar:i,code:s};if(n.hooks.run("before-sanity-check",u),!u.code||!u.grammar)return u.code&&(u.element.textContent=u.code),n.hooks.run("complete",u),void 0;if(n.hooks.run("before-highlight",u),a&&_self.Worker){var g=new Worker(n.filename);g.onmessage=function(e){u.highlightedCode=e.data,n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=n.highlight(u.code,u.grammar,u.language),n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(t),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},highlight:function(e,t,r){var l=n.tokenize(e,t);return a.stringify(n.util.encode(l),r)},tokenize:function(e,t){var a=n.Token,r=[e],l=t.rest;if(l){for(var i in l)t[i]=l[i];delete t.rest}e:for(var i in t)if(t.hasOwnProperty(i)&&t[i]){var o=t[i];o="Array"===n.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,h=!!u.greedy,f=0,d=u.alias;if(h&&!u.pattern.global){var p=u.pattern.toString().match(/[imuy]*$/)[0];u.pattern=RegExp(u.pattern.source,p+"g")}u=u.pattern||u;for(var m=0,y=0;m<r.length;y+=r[m].length,++m){var v=r[m];if(r.length>e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(c?b[1].length:0),_=b.index+b[0].length,P=m,A=y,j=r.length;j>P&&_>A;++P)A+=r[P].length,w>=A&&(++m,y=A);if(r[m]instanceof a||r[P-1].greedy)continue;k=P-m,v=e.slice(y,A),b.index-=y}if(b){c&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),S=[m,k];x&&S.push(x);var N=new a(i,g?n.tokenize(b,g):b,d,b,h);S.push(N),O&&S.push(O),Array.prototype.splice.apply(r,S)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+"</"+l.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/i,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
!function(){"undefined"!=typeof self&&!self.Prism||"undefined"!=typeof global&&!global.Prism||Prism.hooks.add("wrap",function(e){"keyword"===e.type&&e.classes.push("keyword-"+e.content)})}();
================================================
FILE: examples/simple/script.js
================================================
var Vue = window.Vue
var uweb = window.uweb
Vue.use(uweb, '1261414301')
new Vue({
el: '#app',
data: {
content: '',
auto: true,
vshow: false,
vif: false
},
methods: {
humanizeURL: function (url) {
return url
.replace(/^https?:\/\//, '')
.replace(/\/$/, '')
}
}
})
================================================
FILE: examples/simple/styles.css
================================================
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
color: #34495e;
background-color: #fff;
font-size: 14px;
}
#app {
width: 800px;
min-width: 800px;
max-width: 800px;
overflow-x: hidden;
margin: 0 auto;
}
#logo {
width: 400px;
margin: 0 auto;
display: block;
}
a {
color: #34495e
}
================================================
FILE: examples/webpack/.babelrc
================================================
{
"presets": [
["env", { "modules": false }],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
}
}
}
================================================
FILE: examples/webpack/.editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: examples/webpack/.eslintignore
================================================
build/*.js
config/*.js
================================================
FILE: examples/webpack/.eslintrc.js
================================================
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}
================================================
FILE: examples/webpack/.gitignore
================================================
.DS_Store
node_modules/
dist/
npm-debug.log
yarn-error.log
================================================
FILE: examples/webpack/.postcssrc.js
================================================
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserlist" field in package.json
"autoprefixer": {}
}
}
================================================
FILE: examples/webpack/.vscode/settings.json
================================================
{
"vsicons.presets.angular": false
}
================================================
FILE: examples/webpack/README.md
================================================
# vue-uweb-webpack
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
```
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
================================================
FILE: examples/webpack/build/build.js
================================================
require('./check-versions')()
process.env.NODE_ENV = 'production'
var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
================================================
FILE: examples/webpack/build/check-versions.js
================================================
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
{
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
}
]
module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
================================================
FILE: examples/webpack/build/dev-client.js
================================================
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
================================================
FILE: examples/webpack/build/dev-server.js
================================================
require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
var opn = require('opn')
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// automatically open browser, if not set will be false
var autoOpenBrowser = !!config.dev.autoOpenBrowser
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(options.filter || context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
var uri = 'http://localhost:' + port
devMiddleware.waitUntilValid(function () {
console.log('> Listening at ' + uri + '\n')
})
module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
})
================================================
FILE: examples/webpack/build/utils.js
================================================
var path = require('path')
var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
================================================
FILE: examples/webpack/build/vue-loader.conf.js
================================================
var utils = require('./utils')
var config = require('../config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
}
================================================
FILE: examples/webpack/build/webpack.base.conf.js
================================================
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: "pre",
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
}
}
================================================
FILE: examples/webpack/build/webpack.dev.conf.js
================================================
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
new FriendlyErrorsPlugin()
]
})
================================================
FILE: examples/webpack/build/webpack.prod.conf.js
================================================
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin(),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
================================================
FILE: examples/webpack/config/dev.env.js
================================================
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
================================================
FILE: examples/webpack/config/index.js
================================================
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
================================================
FILE: examples/webpack/config/prod.env.js
================================================
module.exports = {
NODE_ENV: '"production"'
}
================================================
FILE: examples/webpack/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-uweb-webpack</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
================================================
FILE: examples/webpack/package.json
================================================
{
"name": "vue-uweb-webpack",
"version": "1.0.0",
"description": "vue uweb webpack example",
"author": "raychenfj",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js",
"lint": "eslint --ext .js,.vue src"
},
"dependencies": {
"prismjs": "^1.6.0",
"vue": "^2.2.2",
"vue-uweb": "0.0.3"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.2.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"eslint": "^4.18.2",
"eslint-config-standard": "^6.2.1",
"eslint-config-vue": "^2.0.2",
"eslint-friendly-formatter": "^2.0.7",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^4.0.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.10.0",
"friendly-errors-webpack-plugin": "^1.1.3",
"function-bind": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.1.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"url-loader": "^0.5.7",
"vue-loader": "^11.1.4",
"vue-style-loader": "^2.0.0",
"vue-template-compiler": "^2.2.4",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
================================================
FILE: examples/webpack/src/app.css
================================================
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
color: #34495e;
background-color: #fff;
font-size: 14px;
}
#app {
width: 800px;
min-width: 800px;
max-width: 800px;
overflow-x: hidden;
margin: 0 auto;
}
#logo {
width: 400px;
margin: 0 auto;
display: block;
}
a {
color: #34495e
}
================================================
FILE: examples/webpack/src/app.js
================================================
export default {
name: 'app',
data () {
return {
content: '',
auto: true,
vshow: false,
vif: false
}
}
}
================================================
FILE: examples/webpack/src/app.vue
================================================
<template>
<div id="app">
<img id="logo" src="./assets/logo.png" alt="Vue logo">
<h1>欢迎使用vue-uweb插件</h1>
<h2>1. 安装</h2>
<h3>npm</h3>
<pre><code class="language-html">npm install vue-uweb --save</code></pre>
<h3>直接在页面中引用</h3>
<pre><code class="language-html"><script src="../node_modules/vue-uweb/dist/index.js"></script></code></pre>
<h3>通过es6模块加载</h3>
<pre><code class="language-javascript">import uweb from 'vue-uweb'</code></pre>
<h3>使用 vue-uweb</h3>
<pre><code class="language-javascript">Vue.use(uweb,'YOUR_SITEID_HERE')</code></pre>
<h3>通过传递 options 参数进行更多设置</h3>
<pre><code class="language-javascript">Vue.use(uweb,options)</code></pre>
<div>options</div>
<ul>
<li>debug,可选,调试模式下将在控制台中输出调用 window._czc.push 时传递的参数,默认为 false,<b>请不要在生产环境中使用</b>,避免造成安全隐患</li>
<li>siteId,必填,绑定要接受API请求的统计代码siteid</li>
<li>autoPageview,可选,是否开启自动统计PV,默认为 true</li>
<li>src,可选,指定统计脚本标签的 src 属性,默认为 http://s11.cnzz.com/z_stat.php?id=SITEID&web_id=SITEID</li>
</ul>
<h2>2. uweb API</h2>
<a href="http://open.cnzz.com/a/new/procedure/">查看官方文档</a>
<div>
<b>注意:</b> 所有this均为 Vue 实例
</div>
<h3>2.1 ready</h3>
<div>当需要严格控制加载时序时,可使用 ready 方法。该方法返回一个 promise,当外部统计脚本加载完毕,全局 _czc 对象存在时,promise 被 resolve。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.ready().then(() => {
...
}).catch(() => {
... // error handling here
})
// 使用 async await, 建议使用 try/catch 避免加载失败影响主程序
async SOME_METHOD () {
try {
await this.$uweb.ready()
...
} catch (e){
... // error handling here
}
}</code></pre>
</li>
</ul>
<h3>2.2 trackPageview</h3>
<div>用于发送某个URL的PV统计请求,适用于统计AJAX、异步加载页面,友情链接,下载链接的流量。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.trackPageview(content_url[, referer_url])</code></pre>
</li>
<li>参数
<ul>
<li>content_url,必填, string,自定义虚拟PV页面的URL地址,填写以斜杠‘/’开头的相对路径,系统会自动补全域名</li>
<li>referer_url,选填, string,自定义该受访页面的来源页URL地址,建议填写该异步加载页面的母页面。不填,则来路按母页面的来路计算。填为“空”,即"",则来路按“直接输入网址或书签”计算。</li>
</ul>
</li>
</ul>
<h3>2.3 trackEvent</h3>
<div>用于发送页面上按钮等交互元素被触发时的事件统计请求。如视频的“播放、暂停、调整音量”,页面上的“返回顶部”、“赞”、“收藏”等。也可用于发送Flash事件统计请求。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.trackEvent(category, action[, label, value, nodeid])</code></pre>
</li>
<li>参数
<ul>
<li>category,必填,string,表示事件发生在谁身上,如“视频”、“小说”、“轮显层”等等。</li>
<li>action,必填,string,表示访客跟元素交互的行为动作,如"播放"、"收藏"、"翻层"等等。</li>
<li>label,选填,string,用于更详细的描述事件,如具体是哪个视频,哪部小说。</li>
<li>value,选填,int,用于填写打分型事件的分值,加载时间型事件的时长,订单型事件的价格。请填写整数数值,如果填写为其他形式,系统将按0处理。若填写为浮点小数,系统会自动取整,去掉小数点。</li>
<li>nodeid,选填,string,填写事件元素的div元素id。请填写class id,暂不支持name。</li>
</ul>
</li>
</ul>
<h3>2.4 setCustomVar</h3>
<div>用于发送为访客打自定义标记的请求,用来统计会员访客、登录访客、不同来源访客的浏览数据。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.setCustomVar(name, value[, time])</code></pre>
</li>
<li>参数
<ul>
<li>name,必填,string,自定义访客种类,用来描述观察访客的角度,如“会员级别”、“访客来源”等等。</li>
<li>value,必填,string,自定义访客值,表示对访客类型的具体描述,如"VIP1"、"VIP2"等等。</li>
<li>time,选填,int,有效时长,表示本自定义访客标记的生效时长。 不填或填“1”表示长期有效。填“0”表示仅在发包页面有效。填“2”表示仅在本访次有效。填具体数值,表示生效时长,单位“秒”。</li>
</ul>
</li>
</ul>
<h3>2.5 setAccount</h3>
<div>当您的页面上添加了多个CNZZ统计代码时,需要用到本方法绑定需要哪个siteid对应的统计代码来接受API发送的请求。未绑定的siteid将忽略相关请求。</div>
<ul>
<li>备注: 一般情况下无需调用该方法,只需调用 Vue.use 时直接传递 siteId 或通过 options.siteId 传递即可
</li>
<li>用法
<pre><code class="language-javascript">this.$uweb.setAccount(siteid)</code></pre>
</li>
<li>参数
<ul>
<li>siteid,必填,int,绑定要接受API请求的统计代码siteid。</li>
</ul>
</li>
</ul>
<h3>2.6 setAutoPageview</h3>
<div>如果您使用_trackPageview改写了已有页面的URL,那么建议您在CNZZ的JS统计代码执行前先调用_setAutoPageview,将该页面的自动PV统计关闭,防止页面的流量被统计双倍。</div>
<ul>
<li>备注: 在调用 Vue.use 时可通过通过 options.autoPageview 设置初始值,默认为 true
</li>
<li>用法
<pre><code class="language-javascript">this.$uweb.setAutoPageview(autopageview)</code></pre>
</li>
<li>参数
<ul>
<li>autopageview,必填,boolean,是否自动发送页面PV的统计请求。关闭自动发送,填false开启自动发送,为true,不调用时默认为true</li>
</ul>
</li>
</ul>
<h3>2.7 deleteCustomVar</h3>
<div>发送删除自定义访客标签的请求。将访客身上已被标记的自定义访客类型去掉,去掉后不再继续统计。</div>
<ul>
<li>用法
<pre><code class="language-javascript">this.$uweb.deleteCustomVar(name)</code></pre>
</li>
<li>参数
<ul>
<li>name,必填,string,需要被删除的自定义访客类型。 填写自定义访客类型种类名name。</li>
</ul>
</li>
</ul>
<h2>3. uweb 指令</h2>
<h3>3.1 track-event</h3>
<div>
使用指令 v-track-event 监听事件, 通过modifiers指定事件类型,将自动为绑定元素添加事件监听,当事件触发调用统计代码。 如不指定,默认监听 click 事件。 可通过逗号分隔的字符串或对象字面量传递参数,以字符串传递时请注意参数顺序,可参考
trackEvent API
</div><br>
<button v-track-event.click="'event, click'">统计click事件</button>
<pre><code class="language-html"><button v-track-event.click="'event, click''"></button></code></pre>
<button v-track-event="'event, shortcut'">统计click事件简写</button>
<pre><code class="language-html"><button v-track-event="'event, shortcut'"></button></code></pre>
<input v-track-event.keypress="'event, keypress'" placeholder="统计keypress事件" v-model="content"></input>
<pre><code class="language-html"><input v-track-event.keypress="'event, keypress'"></code></pre>
<button v-track-event="'event, click'">以字符串传递参数</button>
<a href="http://open.cnzz.com/a/api/trackevent/">关于参数和顺序</a>
<pre><code class="language-html"><button v-track-event="'event, click'"></button></code></pre>
<button v-track-event="{category:'event', action:'click'}">以对象字面量传递参数</button>
<pre><code class="language-html"><button v-track-event="{category:'event', action:'click'}"></button></code></pre>
<h3>3.2 track-pageview</h3>
<div>
使用 v-show 跟踪虚拟pv
<input type="checkbox" v-model="vshow"></input>
</div>
<div v-show="vshow" v-track-pageview="'/bar'">bar</div>
<pre><code class="language-html"><div v-show="vshow" v-track-pageview="'/bar'"></div></code></pre>
<div>
使用 v-if 跟踪虚拟pv
<input type="checkbox" v-model="vif"></input>
</div>
<div v-if="vif" v-track-pageview="'/foo'">foo</div>
<pre><code class="language-html"><div v-if="vif" v-track-pageview="'/foo'"></div></code></pre>
<div v-track-pageview="'/tar, https://github.com/raychenfj'">以字符串指定受访页面和来源</div>
<pre><code class="language-html"><div v-track-pageview="'/tar, https://github.com/raychenfj'"></div></code></pre>
<div v-track-pageview="{content_url:'/zoo', referer_url:'https://github.com/raychenfj'}">以对象字面量指定受访页面和来源</div>
<pre><code class="language-html"><div v-track-pageview="{content_url:'/zoo', referer_url:'https://github.com/raychenfj'}"></div></code></pre>
<h3>3.3 auto-pageview</h3>
<span v-auto-pageview="auto">autoPageView: {{auto}}</span>
<input type="checkbox" v-model="auto">
<div>启用 auto-pageview</div>
<pre><code class="language-html"><div v-auto-pageview=true></div></code></pre>
<div>停止 auto-pageview</div>
<pre><code class="language-html"><div v-auto-pageview=false></div></code></pre>
<h1>4. 默认参数和改变参数顺序</h1>
<div>默认情况下,vue-uweb 并不提供默认参数和参数顺序的设置,但开发者可以根据需求,使用装饰器模式,来提供默认参数和改变参数顺序。例如:我们想在监听事件时默认category,只需要传递action,则代码如下</div>
<pre><code class="language-javascript">import uweb from 'vue-uweb'
let trackEvent = uweb.trackEvent
uweb.trackEvent = (action, category='default'') => {
trackEvent.call(uweb, category, action, '', '', '')
}
Vue.use(uweb)
</code></pre>
<div><b>注意:</b>由于所有 uweb指令 最终都将调用 uweb api 中的方法,所以对默认参数和参数顺序的修改同样会影响指令的参数和顺序</div>
</div>
</template>
<script src="./app.js">
</script>
<style src="./app.css">
</style>
================================================
FILE: examples/webpack/src/main.js
================================================
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './app.vue'
import './uweb'
import 'prismjs'
import '../node_modules/prismjs/themes/prism.css'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
template: '<App/>',
components: { App }
})
================================================
FILE: examples/webpack/src/uweb.js
================================================
import uweb from 'vue-uweb'
import Vue from 'vue'
Vue.use(uweb, '1261414301')
================================================
FILE: examples/webpack/static/.gitkeep
================================================
================================================
FILE: package.json
================================================
{
"name": "vue-uweb",
"version": "0.2.2",
"description": "A vuejs plugin for uweb statistics",
"author": "raychenfj",
"main": "dist/vue-uweb.common.js",
"module": "dist/vue-uweb.esm.js",
"browser": "dist/vue-uweb.js",
"unpkg": "dist/vue-uweb.js",
"homepage": "https://github.com/raychenfj/vue-uweb",
"keywords": [
"uweb",
"statistics",
"vue-plugin"
],
"repository": {
"type": "git",
"url": "https://github.com/raychenfj/vue-uweb.git"
},
"url": "https://github.com/raychenfj/vue-uweb/issues",
"email": "raychenfj@gmail.com",
"files": [
"dist",
"src"
],
"scripts": {
"clean": "rimraf dist",
"build": "node build/build.js",
"build:dll": "webpack --progress --config build/webpack.config.dll.js",
"lint": "yon run lint:js",
"lint:js": "eslint --ext js --ext jsx --ext vue src test/**/*.spec.js test/*.js build",
"lint:js:fix": "yon run lint:js -- --fix",
"lint:staged": "lint-staged",
"pretest": "yon run lint",
"test": "cross-env BABEL_ENV=test karma start test/karma.conf.js --single-run",
"dev": "webpack-dashboard -- webpack-dev-server --config build/webpack.config.dev.js --open",
"dev:coverage": "cross-env BABEL_ENV=test karma start test/karma.conf.js",
"prepublishOnly": "yon run build"
},
"dependencies": {
"deep-equal": "^1.0.1"
},
"devDependencies": {
"add-asset-html-webpack-plugin": "^2.0.0",
"babel-core": "^6.24.0",
"babel-eslint": "^7.2.0",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
"babel-loader": "^7.0.0",
"babel-plugin-istanbul": "^4.1.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.4.0",
"babel-preset-env": "^1.4.0",
"buble": "^0.15.2",
"chai": "^3.5.0",
"chai-dom": "^1.4.0",
"clean-css": "^4.0.0",
"cross-env": "^4.0.0",
"css-loader": "^0.28.0",
"eslint": "^4.18.2",
"eslint-config-vue": "^2.0.0",
"eslint-plugin-vue": "^2.0.0",
"extract-text-webpack-plugin": "^2.1.0",
"html-webpack-plugin": "^2.28.0",
"karma": "^1.7.0",
"karma-chai-dom": "^1.1.0",
"karma-chrome-launcher": "^2.1.0",
"karma-coverage": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-sinon-chai": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.31",
"karma-webpack": "^2.0.0",
"lint-staged": "^3.4.0",
"mkdirp": "^0.5.1",
"mocha": "^3.3.0",
"mocha-css": "^1.0.1",
"phantomjs-polyfill-find": "github:ptim/phantomjs-polyfill-find",
"phantomjs-polyfill-find-index": "^1.0.1",
"postcss": "^6.0.0",
"postcss-cssnext": "^2.10.0",
"pre-commit": "^1.2.0",
"rimraf": "^2.6.0",
"rollup": "^0.41.6",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-commonjs": "^8.0.0",
"rollup-plugin-jsx": "^1.0.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-postcss": "^0.4.1",
"rollup-plugin-replace": "^1.1.0",
"rollup-plugin-vue": "^2.3.0",
"sinon": "2.2.0",
"sinon-chai": "^2.10.0",
"style-loader": "^0.17.0",
"stylefmt": "^5.3.0",
"stylelint": "^7.10.0",
"stylelint-config-standard": "^16.0.0",
"stylelint-processor-html": "^1.0.0",
"uglify-js": "^3.0.0",
"uppercamelcase": "^3.0.0",
"vue": "^2.3.0",
"vue-loader": "^12.0.0",
"vue-template-compiler": "^2.3.0",
"webpack": "^2.5.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dashboard": "^0.4.0",
"webpack-dev-server": "^3.1.11",
"webpack-merge": "^4.0.0",
"yarn-or-npm": "^2.0.0"
},
"peerDependencies": {
"vue": "^2.3.0"
},
"dllPlugin": {
"name": "vuePluginTemplateDeps",
"include": [
"mocha/mocha.js",
"style-loader!css-loader!mocha-css",
"html-entities",
"vue/dist/vue.js",
"chai",
"core-js/library",
"url",
"sockjs-client",
"vue-style-loader/lib/addStylesClient.js",
"events",
"ansi-html",
"style-loader/addStyles.js"
]
},
"license": "MIT"
}
================================================
FILE: src/directives/auto-pageview.js
================================================
import uweb from '../index'
import { notChanged } from './util'
export default function (el, binding) {
if (notChanged(binding)) return
const args = []
if (binding.value === false || binding.value === 'false') args.push(false)
else args.push(true)
uweb.setAutoPageview(...args)
}
================================================
FILE: src/directives/track-event.js
================================================
import uweb from '../index'
import { notChanged, isEmpty } from './util'
export default function (el, binding) {
if (notChanged(binding) || isEmpty(binding)) return
if (el.removeEventListeners && typeof el.removeEventListeners === 'function') {
el.removeEventListeners()
}
let args = []
// use modifier as events
const events = Object.keys(binding.modifiers).map(modifier => {
if (binding.modifiers[modifier]) {
return modifier
}
})
// passing parameters as object
if (typeof binding.value === 'object') {
const value = binding.value
if (value.category) args.push(value.category)
if (value.action) args.push(value.action)
if (value.label) args.push(value.label)
if (value.value) args.push(value.value)
if (value.nodeid) args.push(value.nodeid)
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string') {
args = binding.value.split(',')
args.forEach((arg, i) => (args[i] = arg.trim()))
}
if (!events.length) events.push('click') // listen click event by default
// addEventListener for each event, call trackEvent api
const listeners = []
events.forEach((event, index) => {
listeners[index] = () => uweb.trackEvent(...args)
el.addEventListener(event, listeners[index], false)
})
// a function to remove all previous event listeners in update cycle to prevent duplication
el.removeEventListeners = () => {
events.forEach((event, index) => {
el.removeEventListener(event, listeners[index])
})
}
}
================================================
FILE: src/directives/track-pageview.js
================================================
import uweb from '../index'
import { notChanged, isEmpty } from './util'
export const watch = []
const trackPageview = {
bind (el, binding) {
const index = watch.findIndex(element => element === el)
const isWatched = index !== -1
// watch for a v-show binded element, push it to watch queue when v-show is false
if (el.style.display === 'none') {
if (!isWatched) watch.push(el)
return
} else {
// remove from watch queue when v-show is true
if (isWatched) watch.splice(index, 1)
}
if (!isWatched && (notChanged(binding) || isEmpty(binding))) return
let args = []
// passing parameters as object
if (typeof binding.value === 'object') {
const value = binding.value
if (value.content_url) args.push(value.content_url)
if (value.referer_url) args.push(value.referer_url)
// passing parameters as string separate by comma
} else if (typeof binding.value === 'string' && binding.value) {
args = binding.value.split(',')
args.forEach((arg, i) => (args[i] = arg.trim()))
}
uweb.trackPageview(...args)
},
unbind (el, binding) {
const index = watch.findIndex(element => element === el)
if (index !== -1) watch.splice(index, 1)
}
}
trackPageview.update = trackPageview.bind
export default trackPageview
================================================
FILE: src/directives/util.js
================================================
import deepEqual from 'deep-equal'
/**
* if the binding value is equal to oldeValue
*/
export function notChanged (binding) {
if (binding.oldValue !== undefined) {
if (typeof binding.value === 'object') {
return deepEqual(binding.value, binding.oldValue)
} else {
return binding.value === binding.oldValue
}
} else {
return false
}
}
/**
* if the binding value is empty
*/
export function isEmpty (binding) {
return binding.value === '' || binding.value === undefined || binding.value === null
}
================================================
FILE: src/index.js
================================================
import install from './install'
// deferred promise
const deferred = {}
deferred.promise = new Promise((resolve, reject) => {
deferred.resolve = resolve
deferred.reject = reject
})
// uweb apis
const methods = [
'trackPageview', // http://open.cnzz.com/a/api/trackpageview/
'trackEvent', // http://open.cnzz.com/a/api/trackevent/
'setCustomVar', // http://open.cnzz.com/a/api/setcustomvar/
'setAccount', // http://open.cnzz.com/a/api/setaccount/
'setAutoPageview', // http://open.cnzz.com/a/api/setautopageview/
'deleteCustomVar' // http://open.cnzz.com/a/api/deletecustomvar/
]
const uweb = {
/**
* internal user only
*/
_cache: [],
/**
* internal user only, resolve the promise
*/
_resolve () {
deferred.resolve()
},
/**
* internal user only, reject the promise
*/
_reject () {
deferred.reject()
},
/**
* push the args into _czc, or _cache if the script is not loaded yet
*/
_push () {
this.debug(arguments)
if (window._czc) {
window._czc.push.apply(window._czc, arguments)
} else {
this._cache.push.apply(this._cache, arguments)
}
},
/**
* general method to create uweb apis
*/
_createMethod (method) {
return function () {
const args = Array.prototype.slice.apply(arguments)
this._push([`_${method}`, ...args])
}
},
/**
* debug
*/
debug () {},
/**
* the plugins is ready when the script is loaded
*/
ready () {
return deferred.promise
},
/**
* install function
*/
install,
/**
* patch up to create new api
*/
patch (method) {
this[method] = this._createMethod(method)
}
}
// uweb apis
methods.forEach((method) => (uweb[method] = uweb._createMethod(method)))
if (window.Vue) {
window.uweb = uweb
}
export default uweb
================================================
FILE: src/install.js
================================================
import autoPageview from './directives/auto-pageview'
import trackEvent from '././directives/track-event'
import trackPageview from '././directives/track-pageview'
/**
* install
*
* @param {Vue} Vue
* @param {Object} options
* @returns
*/
export default function install (Vue, options) {
if (!window) {
if (process.env.NODE_ENV !== 'production') {
console.warn('vue-uweb can only be used in browser')
}
return
}
if (this.install.installed) return
if (options.debug) {
this.debug = console.debug
} else {
this.debug = () => {}
}
let siteId = null
// passsing siteId through object or string
if (typeof options === 'object') {
siteId = options.siteId
if (options.autoPageview !== false) {
options.autoPageview = true
}
} else {
siteId = options
}
if (!siteId) {
return console.error('siteId is missing')
}
this.install.installed = true
// insert u-web statistics script
const script = document.createElement('script')
const src = `https://s11.cnzz.com/z_stat.php?id=${siteId}&web_id=${siteId}`
script.src = options.src || src
// callback when the script is loaded
script.onload = () => {
// if the global object is exist, resolve the promise, otherwise reject it
if (window._czc) {
this._resolve()
} else {
console.error('loading uweb statistics script failed, please check src and siteId')
return this._reject()
}
// load from cache
this._cache.forEach((cache) => {
window._czc.push(cache)
})
this._cache = []
}
this.setAccount(options.siteId)
this.setAutoPageview(options.autoPageview)
document.body.appendChild(script)
// store into cache when the script is not fully loaded
// add $czc to Vue prototype
Object.defineProperty(Vue.prototype, '$uweb', {
get: () => this
})
Vue.directive('auto-pageview', autoPageview)
Vue.directive('track-event', trackEvent)
Vue.directive('track-pageview', trackPageview)
}
================================================
FILE: test/.eslintrc
================================================
{
"env": {
"mocha": true
},
"globals": {
"expect": true,
"sinon": true
}
}
================================================
FILE: test/dist/vuePluginTemplateDeps.dll.js
================================================
var vuePluginTemplateDeps =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 463);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(2);
var core = __webpack_require__(15);
var ctx = __webpack_require__(20);
var hide = __webpack_require__(22);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && key in exports) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 2 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 4 */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ }),
/* 5 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 6 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(29);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(73)('wks');
var uid = __webpack_require__(52);
var Symbol = __webpack_require__(2).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = __webpack_require__(417);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(1);
var IE8_DOM_DEFINE = __webpack_require__(131);
var toPrimitive = __webpack_require__(40);
var dP = Object.defineProperty;
exports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(5)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(30);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 14 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 15 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.5.3' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(56);
var defined = __webpack_require__(30);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var inherits = __webpack_require__(4)
, EventTarget = __webpack_require__(158)
;
function EventEmitter() {
EventTarget.call(this);
}
inherits(EventEmitter, EventTarget);
EventEmitter.prototype.removeAllListeners = function(type) {
if (type) {
delete this._listeners[type];
} else {
this._listeners = {};
}
};
EventEmitter.prototype.once = function(type, listener) {
var self = this
, fired = false;
function g() {
self.removeListener(type, g);
if (!fired) {
fired = true;
listener.apply(this, arguments);
}
}
this.on(type, g);
};
EventEmitter.prototype.emit = function() {
var type = arguments[0];
var listeners = this._listeners[type];
if (!listeners) {
return;
}
// equivalent of Array.prototype.slice.call(arguments, 1);
var l = arguments.length;
var args = new Array(l - 1);
for (var ai = 1; ai < l; ai++) {
args[ai - 1] = arguments[ai];
}
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(this, args);
}
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener;
EventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener;
module.exports.EventEmitter = EventEmitter;
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(21);
var toObject = __webpack_require__(13);
var IE_PROTO = __webpack_require__(98)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var fails = __webpack_require__(5);
var defined = __webpack_require__(30);
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function (string, tag, attribute, value) {
var S = String(defined(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function (NAME, exec) {
var O = {};
O[NAME] = exec(createHTML);
$export($export.P + $export.F * fails(function () {
var test = ''[NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
}), 'String', O);
};
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(14);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 21 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(11);
var createDesc = __webpack_require__(39);
module.exports = __webpack_require__(12) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(58);
var createDesc = __webpack_require__(39);
var toIObject = __webpack_require__(16);
var toPrimitive = __webpack_require__(40);
var has = __webpack_require__(21);
var IE8_DOM_DEFINE = __webpack_require__(131);
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var URL = __webpack_require__(172);
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(10)('sockjs-client:utils:url');
}
module.exports = {
getOrigin: function(url) {
if (!url) {
return null;
}
var p = new URL(url);
if (p.protocol === 'file:') {
return null;
}
var port = p.port;
if (!port) {
port = (p.protocol === 'https:') ? '443' : '80';
}
return p.protocol + '//' + p.hostname + ':' + port;
}
, isOriginEqual: function(a, b) {
var res = this.getOrigin(a) === this.getOrigin(b);
debug('same', a, b, res);
return res;
}
, isSchemeEqual: function(a, b) {
return (a.split(':')[0] === b.split(':')[0]);
}
, addPath: function (url, path) {
var qs = url.split('?');
return qs[0] + path + (qs[1] ? '?' + qs[1] : '');
}
, addQuery: function (url, q) {
return url + (url.indexOf('?') === -1 ? ('?' + q) : ('&' + q));
}
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(20);
var IObject = __webpack_require__(56);
var toObject = __webpack_require__(13);
var toLength = __webpack_require__(8);
var asc = __webpack_require__(80);
module.exports = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || asc;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IObject(O);
var f = ctx(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__(5);
module.exports = function (method, arg) {
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
});
};
/***/ }),
/* 27 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(0);
var core = __webpack_require__(15);
var fails = __webpack_require__(5);
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/* 29 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 30 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var Map = __webpack_require__(154);
var $export = __webpack_require__(0);
var shared = __webpack_require__(73)('metadata');
var store = shared.store || (shared.store = new (__webpack_require__(156))());
var getOrCreateMetadataMap = function (target, targetKey, create) {
var targetMetadata = store.get(target);
if (!targetMetadata) {
if (!create) return undefined;
store.set(target, targetMetadata = new Map());
}
var keyMetadata = targetMetadata.get(targetKey);
if (!keyMetadata) {
if (!create) return undefined;
targetMetadata.set(targetKey, keyMetadata = new Map());
} return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
var keys = [];
if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
return keys;
};
var toMetaKey = function (it) {
return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function (O) {
$export($export.S, 'Reflect', O);
};
module.exports = {
store: store,
map: getOrCreateMetadataMap,
has: ordinaryHasOwnMetadata,
get: ordinaryGetOwnMetadata,
set: ordinaryDefineOwnMetadata,
keys: ordinaryOwnMetadataKeys,
key: toMetaKey,
exp: exp
};
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (__webpack_require__(12)) {
var LIBRARY = __webpack_require__(46);
var global = __webpack_require__(2);
var fails = __webpack_require__(5);
var $export = __webpack_require__(0);
var $typed = __webpack_require__(75);
var $buffer = __webpack_require__(104);
var ctx = __webpack_require__(20);
var anInstance = __webpack_require__(43);
var propertyDesc = __webpack_require__(39);
var hide = __webpack_require__(22);
var redefineAll = __webpack_require__(47);
var toInteger = __webpack_require__(29);
var toLength = __webpack_require__(8);
var toIndex = __webpack_require__(151);
var toAbsoluteIndex = __webpack_require__(49);
var toPrimitive = __webpack_require__(40);
var has = __webpack_require__(21);
var classof = __webpack_require__(44);
var isObject = __webpack_require__(3);
var toObject = __webpack_require__(13);
var isArrayIter = __webpack_require__(87);
var create = __webpack_require__(37);
var getPrototypeOf = __webpack_require__(18);
var gOPN = __webpack_require__(57).f;
var getIterFn = __webpack_require__(60);
var uid = __webpack_require__(52);
var wks = __webpack_require__(9);
var createArrayMethod = __webpack_require__(25);
var createArrayIncludes = __webpack_require__(64);
var speciesConstructor = __webpack_require__(74);
var ArrayIterators = __webpack_require__(107);
var Iterators = __webpack_require__(45);
var $iterDetect = __webpack_require__(88);
var setSpecies = __webpack_require__(48);
var arrayFill = __webpack_require__(79);
var arrayCopyWithin = __webpack_require__(122);
var $DP = __webpack_require__(11);
var $GOPD = __webpack_require__(23);
var dP = $DP.f;
var gOPD = $GOPD.f;
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var Uint8Array = global.Uint8Array;
var ARRAY_BUFFER = 'ArrayBuffer';
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var PROTOTYPE = 'prototype';
var ArrayProto = Array[PROTOTYPE];
var $ArrayBuffer = $buffer.ArrayBuffer;
var $DataView = $buffer.DataView;
var arrayForEach = createArrayMethod(0);
var arrayFilter = createArrayMethod(2);
var arraySome = createArrayMethod(3);
var arrayEvery = createArrayMethod(4);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var arrayIncludes = createArrayIncludes(true);
var arrayIndexOf = createArrayIncludes(false);
var arrayValues = ArrayIterators.values;
var arrayKeys = ArrayIterators.keys;
var arrayEntries = ArrayIterators.entries;
var arrayLastIndexOf = ArrayProto.lastIndexOf;
var arrayReduce = ArrayProto.reduce;
var arrayReduceRight = ArrayProto.reduceRight;
var arrayJoin = ArrayProto.join;
var arraySort = ArrayProto.sort;
var arraySlice = ArrayProto.slice;
var arrayToString = ArrayProto.toString;
var arrayToLocaleString = ArrayProto.toLocaleString;
var ITERATOR = wks('iterator');
var TAG = wks('toStringTag');
var TYPED_CONSTRUCTOR = uid('typed_constructor');
var DEF_CONSTRUCTOR = uid('def_constructor');
var ALL_CONSTRUCTORS = $typed.CONSTR;
var TYPED_ARRAY = $typed.TYPED;
var VIEW = $typed.VIEW;
var WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function (O, length) {
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function () {
// eslint-disable-next-line no-undef
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
new Uint8Array(1).set({});
});
var toOffset = function (it, BYTES) {
var offset = toInteger(it);
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
return offset;
};
var validate = function (it) {
if (isObject(it) && TYPED_ARRAY in it) return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function (C, length) {
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function (O, list) {
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function (C, list) {
var index = 0;
var length = list.length;
var result = allocate(C, length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key, internal) {
dP(it, key, { get: function () { return this._d[internal]; } });
};
var $from = function from(source /* , mapfn, thisArg */) {
var O = toObject(source);
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iterFn = getIterFn(O);
var i, length, values, result, step, iterator;
if (iterFn != undefined && !isArrayIter(iterFn)) {
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
values.push(step.value);
} O = values;
}
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/* ...items */) {
var index = 0;
var length = arguments.length;
var result = allocate(this, length);
while (length > index) result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString() {
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /* , thisArg */) {
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /* , thisArg */) {
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /* , thisArg */) {
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /* , thisArg */) {
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /* , thisArg */) {
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /* , fromIndex */) {
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /* , fromIndex */) {
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator) { // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /* , thisArg */) {
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse() {
var that = this;
var length = validate(that).length;
var middle = Math.floor(length / 2);
var index = 0;
var value;
while (index < middle) {
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /* , thisArg */) {
return arraySome(validate(this), callb
gitextract_yj9gbp5a/
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── .stylelintrc
├── .travis.yml
├── .vscode/
│ └── settings.json
├── LICENSE
├── README.md
├── README_EN.md
├── build/
│ ├── build.js
│ ├── utils/
│ │ ├── index.js
│ │ ├── log.js
│ │ ├── style.js
│ │ └── write.js
│ ├── webpack.config.base.js
│ ├── webpack.config.dev.js
│ └── webpack.config.dll.js
├── dist/
│ ├── vue-uweb.common.js
│ ├── vue-uweb.esm.js
│ └── vue-uweb.js
├── examples/
│ ├── simple/
│ │ ├── index.html
│ │ ├── prism.css
│ │ ├── prism.js
│ │ ├── script.js
│ │ └── styles.css
│ └── webpack/
│ ├── .babelrc
│ ├── .editorconfig
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .postcssrc.js
│ ├── .vscode/
│ │ └── settings.json
│ ├── README.md
│ ├── build/
│ │ ├── build.js
│ │ ├── check-versions.js
│ │ ├── dev-client.js
│ │ ├── dev-server.js
│ │ ├── utils.js
│ │ ├── vue-loader.conf.js
│ │ ├── webpack.base.conf.js
│ │ ├── webpack.dev.conf.js
│ │ └── webpack.prod.conf.js
│ ├── config/
│ │ ├── dev.env.js
│ │ ├── index.js
│ │ └── prod.env.js
│ ├── index.html
│ ├── package.json
│ ├── src/
│ │ ├── app.css
│ │ ├── app.js
│ │ ├── app.vue
│ │ ├── main.js
│ │ └── uweb.js
│ └── static/
│ └── .gitkeep
├── package.json
├── src/
│ ├── directives/
│ │ ├── auto-pageview.js
│ │ ├── track-event.js
│ │ ├── track-pageview.js
│ │ └── util.js
│ ├── index.js
│ └── install.js
└── test/
├── .eslintrc
├── dist/
│ ├── vuePluginTemplateDeps.dll.js
│ └── vuePluginTemplateDeps.json
├── helpers/
│ ├── Test.vue
│ ├── index.js
│ ├── utils.js
│ └── wait-for-update.js
├── index.js
├── karma.conf.js
├── mocks.js
├── specs/
│ ├── directives/
│ │ ├── auto-pageview.spec.js
│ │ ├── track-event.spec.js
│ │ ├── track-pageview.spec.js
│ │ └── util.spec.js
│ └── index.spec.js
└── visual.js
SYMBOL INDEX (1041 symbols across 22 files)
FILE: build/build.js
function rollupBundle (line 25) | function rollupBundle ({ env }) {
function createBundle (line 72) | function createBundle ({ name, env, format }) {
FILE: build/utils/log.js
function logError (line 1) | function logError (e) {
function blue (line 5) | function blue (str) {
function green (line 9) | function green (str) {
function red (line 13) | function red (str) {
function yellow (line 17) | function yellow (str) {
FILE: build/utils/style.js
function processCss (line 8) | function processCss (style) {
function processStylus (line 22) | function processStylus (style) {
function processStyle (line 44) | function processStyle (style) {
function writeCss (line 54) | function writeCss (style) {
FILE: build/utils/write.js
function write (line 5) | function write (dest, code) {
function getSize (line 15) | function getSize (code) {
FILE: build/webpack.config.dev.js
method minChunks (line 65) | minChunks (module, count) {
FILE: dist/vue-uweb.common.js
function deepEqual (line 476) | function deepEqual(actual, expected, options) {
function isUndefinedOrNull (line 501) | function isUndefinedOrNull(value) {
function isBuffer (line 505) | function isBuffer(x) {
function objEquiv (line 518) | function objEquiv(a, b, opts) {
function notChanged (line 583) | function notChanged (binding) {
function isEmpty (line 598) | function isEmpty (binding) {
function install (line 704) | function install (Vue, options) {
FILE: dist/vue-uweb.esm.js
function deepEqual (line 472) | function deepEqual(actual, expected, options) {
function isUndefinedOrNull (line 497) | function isUndefinedOrNull(value) {
function isBuffer (line 501) | function isBuffer(x) {
function objEquiv (line 514) | function objEquiv(a, b, opts) {
function notChanged (line 579) | function notChanged (binding) {
function isEmpty (line 594) | function isEmpty (binding) {
function install (line 700) | function install (Vue, options) {
FILE: dist/vue-uweb.js
function deepEqual (line 478) | function deepEqual(actual, expected, options) {
function isUndefinedOrNull (line 503) | function isUndefinedOrNull(value) {
function isBuffer (line 507) | function isBuffer(x) {
function objEquiv (line 520) | function objEquiv(a, b, opts) {
function notChanged (line 585) | function notChanged (binding) {
function isEmpty (line 600) | function isEmpty (binding) {
function install (line 706) | function install (Vue, options) {
FILE: examples/webpack/build/check-versions.js
function exec (line 5) | function exec (cmd) {
FILE: examples/webpack/build/utils.js
function generateLoaders (line 24) | function generateLoaders (loader, loaderOptions) {
FILE: examples/webpack/build/webpack.base.conf.js
function resolve (line 6) | function resolve (dir) {
FILE: examples/webpack/src/app.js
method data (line 3) | data () {
FILE: src/directives/track-pageview.js
method bind (line 7) | bind (el, binding) {
method unbind (line 36) | unbind (el, binding) {
FILE: src/directives/util.js
function notChanged (line 6) | function notChanged (binding) {
function isEmpty (line 21) | function isEmpty (binding) {
FILE: src/index.js
method _resolve (line 29) | _resolve () {
method _reject (line 36) | _reject () {
method _push (line 43) | _push () {
method _createMethod (line 55) | _createMethod (method) {
method debug (line 65) | debug () {}
method ready (line 70) | ready () {
method patch (line 83) | patch (method) {
FILE: src/install.js
function install (line 12) | function install (Vue, options) {
FILE: test/dist/vuePluginTemplateDeps.dll.js
function __webpack_require__ (line 7) | function __webpack_require__(moduleId) {
function defaultSetTimout (line 253) | function defaultSetTimout() {
function defaultClearTimeout (line 256) | function defaultClearTimeout () {
function runTimeout (line 279) | function runTimeout(fun) {
function runClearTimeout (line 304) | function runClearTimeout(marker) {
function cleanUpNextTick (line 336) | function cleanUpNextTick() {
function drainQueue (line 351) | function drainQueue() {
function Item (line 389) | function Item(fun, array) {
function noop (line 403) | function noop() {}
function useColors (line 499) | function useColors() {
function formatArgs (line 538) | function formatArgs(args) {
function log (line 578) | function log() {
function save (line 593) | function save(namespaces) {
function load (line 610) | function load() {
function localstorage (line 641) | function localstorage() {
function EventEmitter (line 733) | function EventEmitter() {
function g (line 751) | function g() {
function runInContext (line 1649) | function runInContext(context, exports) {
function createAjaxSender (line 3050) | function createAjaxSender(AjaxObject) {
function AjaxBasedTransport (line 3080) | function AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) {
function XHRLocalObject (line 3219) | function XHRLocalObject(method, url, payload /*, opts */) {
function XhrReceiver (line 3818) | function XhrReceiver(url, AjaxObject) {
function XHRCorsObject (line 3891) | function XHRCorsObject(method, url, payload, opts) {
function inspect (line 3928) | function inspect(obj, showHidden, depth, colors) {
function formatValue (line 3949) | function formatValue(ctx, value, recurseTimes) {
function formatPrimitive (line 4089) | function formatPrimitive(ctx, value) {
function formatError (line 4116) | function formatError(value) {
function formatArray (line 4121) | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
function formatProperty (line 4141) | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, arra...
function reduceToSingleString (line 4201) | function reduceToSingleString(output, base, braces) {
function isArray (line 4221) | function isArray(ar) {
function isRegExp (line 4226) | function isRegExp(re) {
function isDate (line 4230) | function isDate(d) {
function isError (line 4234) | function isError(e) {
function objectToString (line 4238) | function objectToString(o) {
function PromiseCapability (line 4524) | function PromiseCapability(C) {
function packIEEE754 (line 4829) | function packIEEE754(value, mLen, nBytes) {
function unpackIEEE754 (line 4877) | function unpackIEEE754(buffer, mLen, nBytes) {
function unpackI32 (line 4902) | function unpackI32(bytes) {
function packI8 (line 4905) | function packI8(it) {
function packI16 (line 4908) | function packI16(it) {
function packI32 (line 4911) | function packI32(it) {
function packF64 (line 4914) | function packF64(it) {
function packF32 (line 4917) | function packF32(it) {
function addGetter (line 4921) | function addGetter(C, key, internal) {
function get (line 4925) | function get(view, bytes, index, isLittleEndian) {
function set (line 4934) | function set(view, bytes, index, conversion, value, isLittleEndian) {
function Event (line 5139) | function Event(eventType) {
function IframeWrapTransport (line 5175) | function IframeWrapTransport(transUrl, baseUrl) {
function XDRObject (line 5225) | function XDRObject(method, url, payload) {
function addStylesToDom (line 5435) | function addStylesToDom(styles, options) {
function listToStyles (line 5457) | function listToStyles(list, options) {
function insertStyleElement (line 5475) | function insertStyleElement(options, styleElement) {
function removeStyleElement (line 5497) | function removeStyleElement(styleElement) {
function createStyleElement (line 5505) | function createStyleElement(options) {
function createLinkElement (line 5514) | function createLinkElement(options) {
function attachTagAttrs (line 5524) | function attachTagAttrs(element, attrs) {
function addStyle (line 5530) | function addStyle(obj, options) {
function applyToSingletonTag (line 5598) | function applyToSingletonTag(styleElement, index, remove, obj) {
function applyToTag (line 5615) | function applyToTag(styleElement, obj) {
function updateLink (line 5633) | function updateLink(linkElement, options, obj) {
function exclude (line 5683) | function exclude () {
function AssertionError (line 5722) | function AssertionError (message, _props, ssf) {
function parsePath (line 5908) | function parsePath (path) {
function _getPathValue (line 5935) | function _getPathValue (parsed, obj, index) {
function flattenIntoArray (line 6561) | function flattenIntoArray(target, original, source, sourceLen, start, de...
function Html5Entities (line 7136) | function Html5Entities() {}
function createIndexes (line 7291) | function createIndexes(alphaIndex, charIndex) {
function EventTarget (line 7329) | function EventTarget() {
function InfoAjax (line 7405) | function InfoAjax(url, AjaxObject) {
function InfoReceiverIframe (line 7458) | function InfoReceiverIframe(transUrl) {
function AbstractXHRObject (line 7521) | function AbstractXHRObject(method, url, payload, opts) {
function EventSourceTransport (line 7725) | function EventSourceTransport(transUrl) {
function HtmlFileTransport (line 7758) | function HtmlFileTransport(transUrl) {
function IframeTransport (line 7807) | function IframeTransport(transport, transUrl, baseUrl) {
function SenderReceiver (line 7944) | function SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxO...
function XdrStreamingTransport (line 7996) | function XdrStreamingTransport(transUrl) {
function XhrPollingTransport (line 8032) | function XhrPollingTransport(transUrl) {
function Timeout (line 8086) | function Timeout(id, clearFn) {
function lolcation (line 8180) | function lolcation(loc) {
function extractProtocol (line 8221) | function extractProtocol(address) {
function resolve (line 8239) | function resolve(relative, base) {
function URL (line 8276) | function URL(address, location, parser) {
function set (line 8417) | function set(part, value, fn) {
function toString (line 8503) | function toString(stringify) {
function ansiHTML (line 8629) | function ansiHTML (text) {
function _setTags (line 8735) | function _setTags (colors) {
function EventEmitter (line 8809) | function EventEmitter() {
function g (line 8947) | function g() {
function isFunction (line 9075) | function isFunction(arg) {
function isNumber (line 9079) | function isNumber(arg) {
function isObject (line 9083) | function isObject(arg) {
function isUndefined (line 9087) | function isUndefined(arg) {
function s (line 9108) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function timeslice (line 9186) | function timeslice () {
function noop (line 9302) | function noop () {}
function isArray (line 9329) | function isArray (val) {
function EventEmitter (line 9338) | function EventEmitter () {}
function on (line 9377) | function on () {
function Progress (line 9517) | function Progress () {
function Context (line 9663) | function Context () {}
function Hook (line 9780) | function Hook (title, fn) {
function visit (line 10116) | function visit (obj, file) {
function image (line 10421) | function image (name) {
function Mocha (line 10444) | function Mocha (options) {
function done (line 10909) | function done (failures) {
function parse (line 10962) | function parse (str) {
function shortFormat (line 11004) | function shortFormat (ms) {
function longFormat (line 11027) | function longFormat (ms) {
function plural (line 11043) | function plural (ms, n, name) {
function Pending (line 11067) | function Pending (message) {
function Base (line 11313) | function Base (runner) {
function pad (line 11419) | function pad (str, len) {
function inlineDiff (line 11432) | function inlineDiff (err, escape) {
function unifiedDiff (line 11466) | function unifiedDiff (err, escape) {
function errorDiff (line 11507) | function errorDiff (err, type, escape) {
function escapeInvisibles (line 11528) | function escapeInvisibles (line) {
function colorLines (line 11542) | function colorLines (name, str) {
function sameType (line 11561) | function sameType (a, b) {
function Doc (line 11588) | function Doc (runner) {
function Dot (line 11656) | function Dot (runner) {
function HTML (line 11757) | function HTML (runner) {
function makeUrl (line 11927) | function makeUrl (s) {
function error (line 11979) | function error (msg) {
function fragment (line 11988) | function fragment (html) {
function hideSuitesWithout (line 12010) | function hideSuitesWithout (classname) {
function unhide (line 12023) | function unhide () {
function text (line 12036) | function text (el, contents) {
function on (line 12047) | function on (el, event, fn) {
function List (line 12100) | function List (runner) {
function clean (line 12134) | function clean (test) {
function JSONReporter (line 12166) | function JSONReporter (runner) {
function clean (line 12214) | function clean (test) {
function errorJSON (line 12231) | function errorJSON (err) {
function Landing (line 12283) | function Landing (runner) {
function List (line 12363) | function List (runner) {
function Markdown (line 12434) | function Markdown (runner) {
function Min (line 12531) | function Min (runner) {
function NyanCat (line 12574) | function NyanCat (runner) {
function draw (line 12644) | function draw (type, n) {
function write (line 12812) | function write (string) {
function Progress (line 12849) | function Progress (runner, options) {
function Spec (line 12935) | function Spec (runner) {
function TAP (line 13016) | function TAP (runner) {
function title (line 13063) | function title (test) {
function XUnit (line 13107) | function XUnit (runner, options) {
function tag (line 13220) | function tag (name, attrs, close, content) {
function Runnable (line 13288) | function Runnable (title, fn) {
function multiple (line 13510) | function multiple (err) {
function done (line 13519) | function done (err) {
function callFn (line 13587) | function callFn (fn) {
function callFnAsync (line 13610) | function callFnAsync (fn) {
function Runner (line 13699) | function Runner (suite, delay) {
function next (line 13925) | function next (i) {
function next (line 13989) | function next (suite) {
function hookErr (line 14094) | function hookErr (_, errSuite, after) {
function next (line 14120) | function next (err, errSuite) {
function next (line 14243) | function next (errSuite) {
function done (line 14277) | function done (errSuite) {
function cleanSuiteReferences (line 14387) | function cleanSuiteReferences (suite) {
function uncaught (line 14436) | function uncaught (err) {
function start (line 14440) | function start () {
function filterOnly (line 14502) | function filterOnly (suite) {
function hasOnly (line 14533) | function hasOnly (suite) {
function filterLeaks (line 14545) | function filterLeaks (ok, globals) {
function extraGlobals (line 14586) | function extraGlobals () {
function Suite (line 14649) | function Suite (title, parentContext) {
function Test (line 15032) | function Test (title, fn) {
function pad (line 15071) | function pad(number) {
function toISOString (line 15084) | function toISOString(date) {
function ignored (line 15332) | function ignored (path) {
function highlight (line 15438) | function highlight (js) {
function emptyRepresentation (line 15477) | function emptyRepresentation (value, typeHint) {
function jsonStringify (line 15581) | function jsonStringify (object, spaces, depth) {
function withStack (line 15690) | function withStack (value, fn) {
function isMochaInternal (line 15851) | function isMochaInternal (line) {
function isNodeInternal (line 15858) | function isNodeInternal (line) {
function placeHoldersCount (line 15929) | function placeHoldersCount (b64) {
function byteLength (line 15943) | function byteLength (b64) {
function toByteArray (line 15948) | function toByteArray (b64) {
function tripletToBase64 (line 15979) | function tripletToBase64 (num) {
function encodeChunk (line 15983) | function encodeChunk (uint8, start, end) {
function fromByteArray (line 15993) | function fromByteArray (uint8) {
function BrowserStdout (line 16037) | function BrowserStdout(opts) {
function typedArraySupport (line 16111) | function typedArraySupport () {
function kMaxLength (line 16123) | function kMaxLength () {
function createBuffer (line 16129) | function createBuffer (that, length) {
function Buffer (line 16158) | function Buffer (arg, encodingOrOffset, length) {
function from (line 16183) | function from (that, value, encodingOrOffset, length) {
function assertSize (line 16224) | function assertSize (size) {
function alloc (line 16232) | function alloc (that, size, fill, encoding) {
function allocUnsafe (line 16256) | function allocUnsafe (that, size) {
function fromString (line 16280) | function fromString (that, string, encoding) {
function fromArrayLike (line 16304) | function fromArrayLike (that, array) {
function fromArrayBuffer (line 16313) | function fromArrayBuffer (that, array, byteOffset, length) {
function fromObject (line 16343) | function fromObject (that, obj) {
function checked (line 16373) | function checked (length) {
function SlowBuffer (line 16383) | function SlowBuffer (length) {
function byteLength (line 16466) | function byteLength (string, encoding) {
function slowToString (line 16511) | function slowToString (encoding, start, end) {
function swap (line 16585) | function swap (b, n, m) {
function bidirectionalIndexOf (line 16719) | function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 16776) | function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
function hexWrite (line 16844) | function hexWrite (buf, string, offset, length) {
function utf8Write (line 16871) | function utf8Write (buf, string, offset, length) {
function asciiWrite (line 16875) | function asciiWrite (buf, string, offset, length) {
function latin1Write (line 16879) | function latin1Write (buf, string, offset, length) {
function base64Write (line 16883) | function base64Write (buf, string, offset, length) {
function ucs2Write (line 16887) | function ucs2Write (buf, string, offset, length) {
function base64Slice (line 16970) | function base64Slice (buf, start, end) {
function utf8Slice (line 16978) | function utf8Slice (buf, start, end) {
function decodeCodePointsArray (line 17056) | function decodeCodePointsArray (codePoints) {
function asciiSlice (line 17074) | function asciiSlice (buf, start, end) {
function latin1Slice (line 17084) | function latin1Slice (buf, start, end) {
function hexSlice (line 17094) | function hexSlice (buf, start, end) {
function utf16leSlice (line 17107) | function utf16leSlice (buf, start, end) {
function checkOffset (line 17155) | function checkOffset (offset, ext, length) {
function checkInt (line 17316) | function checkInt (buf, value, offset, ext, max, min) {
function objectWriteUInt16 (line 17369) | function objectWriteUInt16 (buf, value, offset, littleEndian) {
function objectWriteUInt32 (line 17403) | function objectWriteUInt32 (buf, value, offset, littleEndian) {
function checkIEEE754 (line 17553) | function checkIEEE754 (buf, value, offset, ext, max, min) {
function writeFloat (line 17558) | function writeFloat (buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 17574) | function writeDouble (buf, value, offset, littleEndian, noAssert) {
function base64clean (line 17707) | function base64clean (str) {
function stringtrim (line 17719) | function stringtrim (str) {
function toHex (line 17724) | function toHex (n) {
function utf8ToBytes (line 17729) | function utf8ToBytes (string, units) {
function asciiToBytes (line 17809) | function asciiToBytes (str) {
function utf16leToBytes (line 17818) | function utf16leToBytes (str, units) {
function base64ToBytes (line 17834) | function base64ToBytes (str) {
function blitBuffer (line 17838) | function blitBuffer (src, dst, offset, length) {
function isnan (line 17846) | function isnan (val) {
function isArray (line 17877) | function isArray(arg) {
function isBoolean (line 17885) | function isBoolean(arg) {
function isNull (line 17890) | function isNull(arg) {
function isNullOrUndefined (line 17895) | function isNullOrUndefined(arg) {
function isNumber (line 17900) | function isNumber(arg) {
function isString (line 17905) | function isString(arg) {
function isSymbol (line 17910) | function isSymbol(arg) {
function isUndefined (line 17915) | function isUndefined(arg) {
function isRegExp (line 17920) | function isRegExp(re) {
function isObject (line 17925) | function isObject(arg) {
function isDate (line 17930) | function isDate(d) {
function isError (line 17935) | function isError(e) {
function isFunction (line 17940) | function isFunction(arg) {
function isPrimitive (line 17945) | function isPrimitive(arg) {
function objectToString (line 17957) | function objectToString(o) {
function convertChangesToDMP (line 17968) | function convertChangesToDMP(changes) {
function convertChangesToXML (line 17993) | function convertChangesToXML(changes) {
function escapeHTML (line 18014) | function escapeHTML(s) {
function _interopRequireDefault (line 18037) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffArrays (line 18044) | function diffArrays(oldArr, newArr, callback) {
function Diff (line 18054) | function Diff() {}
function done (line 18069) | function done(value) {
function execEditLength (line 18101) | function execEditLength() {
function buildValues (line 18224) | function buildValues(diff, components, newString, oldString, useLongestT...
function clonePath (line 18276) | function clonePath(path) {
function _interopRequireDefault (line 18293) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffChars (line 18296) | function diffChars(oldStr, newStr, callback) {
function _interopRequireDefault (line 18313) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffCss (line 18320) | function diffCss(oldStr, newStr, callback) {
function _interopRequireDefault (line 18345) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffJson (line 18374) | function diffJson(oldObj, newObj, options) {
function canonicalize (line 18380) | function canonicalize(obj, stack, replacementStack) {
function _interopRequireDefault (line 18453) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffLines (line 18482) | function diffLines(oldStr, newStr, callback) {
function diffTrimmedLines (line 18485) | function diffTrimmedLines(oldStr, newStr, callback) {
function _interopRequireDefault (line 18503) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffSentences (line 18510) | function diffSentences(oldStr, newStr, callback) {
function _interopRequireDefault (line 18532) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function diffWords (line 18578) | function diffWords(oldStr, newStr, callback) {
function diffWordsWithSpace (line 18582) | function diffWordsWithSpace(oldStr, newStr, callback) {
function _interopRequireDefault (line 18624) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _interopRequireDefault (line 18676) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function applyPatch (line 18678) | function applyPatch(source, uniDiff) {
function applyPatches (line 18810) | function applyPatches(uniDiff, options) {
function _toConsumableArray (line 18852) | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i ...
function structuredPatch (line 18854) | function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHe...
function createTwoFilesPatch (line 18974) | function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, o...
function createPatch (line 18994) | function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, opt...
function parsePatch (line 19004) | function parsePatch(uniDiff) {
function generateOptions (line 19198) | function generateOptions(options, defaults) {
function EventEmitter (line 19248) | function EventEmitter() {
function g (line 19386) | function g() {
function isFunction (line 19514) | function isFunction(arg) {
function isNumber (line 19518) | function isNumber(arg) {
function isObject (line 19522) | function isObject(arg) {
function isUndefined (line 19526) | function isUndefined(arg) {
function which (line 19546) | function which(name) {
function growl (line 19695) | function growl(msg, options, fn) {
function isBuffer (line 20293) | function isBuffer (obj) {
function isSlowBuffer (line 20298) | function isSlowBuffer (obj) {
function runInContext (line 20339) | function runInContext(context, exports) {
function baseAssign (line 21237) | function baseAssign(object, source) {
function baseCopy (line 21264) | function baseCopy(source, props, object) {
function object (line 21298) | function object() {}
function isObject (line 21329) | function isObject(value) {
function isObjectLike (line 21361) | function isObjectLike(value) {
function getNative (line 21394) | function getNative(object, key) {
function isFunction (line 21415) | function isFunction(value) {
function isObject (line 21442) | function isObject(value) {
function isNative (line 21465) | function isNative(value) {
function baseProperty (line 21503) | function baseProperty(key) {
function isArrayLike (line 21528) | function isArrayLike(value) {
function isIndex (line 21540) | function isIndex(value, length) {
function isIterateeCall (line 21555) | function isIterateeCall(value, index, object) {
function isLength (line 21578) | function isLength(value) {
function isObject (line 21602) | function isObject(value) {
function create (line 21658) | function create(prototype, properties, guard) {
function isArguments (line 21720) | function isArguments(value) {
function isArrayLike (line 21751) | function isArrayLike(value) {
function isArrayLikeObject (line 21780) | function isArrayLikeObject(value) {
function isFunction (line 21801) | function isFunction(value) {
function isLength (line 21834) | function isLength(value) {
function isObject (line 21864) | function isObject(value) {
function isObjectLike (line 21893) | function isObjectLike(value) {
function isObjectLike (line 21923) | function isObjectLike(value) {
function getNative (line 21965) | function getNative(object, key) {
function isLength (line 21979) | function isLength(value) {
function isFunction (line 22019) | function isFunction(value) {
function isObject (line 22046) | function isObject(value) {
function isNative (line 22069) | function isNative(value) {
function baseProperty (line 22119) | function baseProperty(key) {
function isArrayLike (line 22144) | function isArrayLike(value) {
function isIndex (line 22156) | function isIndex(value, length) {
function isLength (line 22171) | function isLength(value) {
function shimKeys (line 22183) | function shimKeys(object) {
function isObject (line 22223) | function isObject(value) {
function keysIn (line 22288) | function keysIn(object) {
function mkdirP (line 22327) | function mkdirP (p, opts, f, made) {
function nextTick (line 22480) | function nextTick(fn, arg1, arg2, arg3) {
function defaultSetTimout (line 22527) | function defaultSetTimout() {
function defaultClearTimeout (line 22530) | function defaultClearTimeout () {
function runTimeout (line 22553) | function runTimeout(fun) {
function runClearTimeout (line 22578) | function runClearTimeout(marker) {
function cleanUpNextTick (line 22610) | function cleanUpNextTick() {
function drainQueue (line 22625) | function drainQueue() {
function Item (line 22663) | function Item(fun, array) {
function noop (line 22677) | function noop() {}
function Duplex (line 22744) | function Duplex(options) {
function onend (line 22761) | function onend() {
function onEndNT (line 22771) | function onEndNT(self) {
function forEach (line 22775) | function forEach(xs, f) {
function PassThrough (line 22798) | function PassThrough(options) {
function prependListener (line 22865) | function prependListener(emitter, event, fn) {
function ReadableState (line 22879) | function ReadableState(options, stream) {
function Readable (line 22948) | function Readable(options) {
function readableAddChunk (line 22991) | function readableAddChunk(stream, state, chunk, encoding, addToFront) {
function needMoreData (line 23046) | function needMoreData(state) {
function computeNewHighWaterMark (line 23060) | function computeNewHighWaterMark(n) {
function howMuchToRead (line 23079) | function howMuchToRead(n, state) {
function chunkInvalid (line 23198) | function chunkInvalid(state, chunk) {
function onEofChunk (line 23206) | function onEofChunk(stream, state) {
function emitReadable (line 23224) | function emitReadable(stream) {
function emitReadable_ (line 23234) | function emitReadable_(stream) {
function maybeReadMore (line 23246) | function maybeReadMore(stream, state) {
function maybeReadMore_ (line 23253) | function maybeReadMore_(stream, state) {
function onunpipe (line 23297) | function onunpipe(readable) {
function onend (line 23304) | function onend() {
function cleanup (line 23317) | function cleanup() {
function ondata (line 23345) | function ondata(chunk) {
function onerror (line 23365) | function onerror(er) {
function onclose (line 23376) | function onclose() {
function onfinish (line 23381) | function onfinish() {
function unpipe (line 23388) | function unpipe() {
function pipeOnDrain (line 23405) | function pipeOnDrain(src) {
function nReadingNextTick (line 23491) | function nReadingNextTick(self) {
function resume (line 23508) | function resume(stream, state) {
function resume_ (line 23515) | function resume_(stream, state) {
function flow (line 23538) | function flow(stream) {
function fromList (line 23613) | function fromList(n, state) {
function fromListPartial (line 23633) | function fromListPartial(n, list, hasStrings) {
function copyFromBufferString (line 23653) | function copyFromBufferString(n, list) {
function copyFromBuffer (line 23682) | function copyFromBuffer(n, list) {
function endReadable (line 23709) | function endReadable(stream) {
function endReadableNT (line 23722) | function endReadableNT(state, stream) {
function forEach (line 23731) | function forEach(xs, f) {
function indexOf (line 23737) | function indexOf(xs, x) {
function TransformState (line 23800) | function TransformState(stream) {
function afterTransform (line 23812) | function afterTransform(stream, er, data) {
function Transform (line 23834) | function Transform(options) {
function done (line 23911) | function done(stream, er, data) {
function nop (line 23972) | function nop() {}
function WriteReq (line 23974) | function WriteReq(chunk, encoding, cb) {
function WritableState (line 23981) | function WritableState(options, stream) {
function Writable (line 24115) | function Writable(options) {
function writeAfterEnd (line 24148) | function writeAfterEnd(stream, cb) {
function validChunk (line 24158) | function validChunk(stream, state, chunk, cb) {
function decodeChunk (line 24221) | function decodeChunk(state, chunk, encoding) {
function writeOrBuffer (line 24231) | function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
function doWrite (line 24260) | function doWrite(stream, state, writev, len, chunk, encoding, cb) {
function onwriteError (line 24269) | function onwriteError(stream, state, sync, er, cb) {
function onwriteStateUpdate (line 24277) | function onwriteStateUpdate(state) {
function onwrite (line 24284) | function onwrite(stream, er) {
function afterWrite (line 24309) | function afterWrite(stream, state, finished, cb) {
function onwriteDrain (line 24319) | function onwriteDrain(stream, state) {
function clearBuffer (line 24327) | function clearBuffer(stream, state) {
function needFinish (line 24414) | function needFinish(state) {
function prefinish (line 24418) | function prefinish(stream, state) {
function finishMaybe (line 24425) | function finishMaybe(stream, state) {
function endWritable (line 24439) | function endWritable(stream, state, cb) {
function CorkedRequest (line 24451) | function CorkedRequest(state) {
function BufferList (line 24483) | function BufferList() {
function Stream (line 24604) | function Stream() {
function ondata (line 24611) | function ondata(chunk) {
function ondrain (line 24621) | function ondrain() {
function onend (line 24637) | function onend() {
function onclose (line 24645) | function onclose() {
function onerror (line 24653) | function onerror(er) {
function cleanup (line 24664) | function cleanup() {
function _normalizeEncoding (line 24706) | function _normalizeEncoding(enc) {
function normalizeEncoding (line 24736) | function normalizeEncoding(enc) {
function StringDecoder (line 24746) | function StringDecoder(encoding) {
function utf8CheckByte (line 24807) | function utf8CheckByte(byte) {
function utf8CheckIncomplete (line 24815) | function utf8CheckIncomplete(self, buf, i) {
function utf8CheckExtraBytes (line 24848) | function utf8CheckExtraBytes(self, buf, p) {
function utf8FillLast (line 24868) | function utf8FillLast(buf) {
function utf8Text (line 24883) | function utf8Text(buf, i) {
function utf8End (line 24894) | function utf8End(buf) {
function utf16Text (line 24904) | function utf16Text(buf, i) {
function utf16End (line 24927) | function utf16End(buf) {
function base64Text (line 24936) | function base64Text(buf, i) {
function base64End (line 24950) | function base64End(buf) {
function simpleWrite (line 24957) | function simpleWrite(buf) {
function simpleEnd (line 24961) | function simpleEnd(buf) {
function copyProps (line 24970) | function copyProps (src, dst) {
function SafeBuffer (line 24983) | function SafeBuffer (arg, encodingOrOffset, length) {
function deprecate (line 25055) | function deprecate (fn, msg) {
function config (line 25086) | function config (name) {
function deprecated (line 25187) | function deprecated() {
function inspect (line 25234) | function inspect(obj, opts) {
function stylizeWithColor (line 25292) | function stylizeWithColor(str, styleType) {
function stylizeNoColor (line 25304) | function stylizeNoColor(str, styleType) {
function arrayToHash (line 25309) | function arrayToHash(array) {
function formatValue (line 25320) | function formatValue(ctx, value, recurseTimes) {
function formatPrimitive (line 25433) | function formatPrimitive(ctx, value) {
function formatError (line 25452) | function formatError(value) {
function formatArray (line 25457) | function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
function formatProperty (line 25477) | function formatProperty(ctx, value, recurseTimes, visibleKeys, key, arra...
function reduceToSingleString (line 25536) | function reduceToSingleString(output, base, braces) {
function isArray (line 25559) | function isArray(ar) {
function isBoolean (line 25564) | function isBoolean(arg) {
function isNull (line 25569) | function isNull(arg) {
function isNullOrUndefined (line 25574) | function isNullOrUndefined(arg) {
function isNumber (line 25579) | function isNumber(arg) {
function isString (line 25584) | function isString(arg) {
function isSymbol (line 25589) | function isSymbol(arg) {
function isUndefined (line 25594) | function isUndefined(arg) {
function isRegExp (line 25599) | function isRegExp(re) {
function isObject (line 25604) | function isObject(arg) {
function isDate (line 25609) | function isDate(d) {
function isError (line 25614) | function isError(e) {
function isFunction (line 25620) | function isFunction(arg) {
function isPrimitive (line 25625) | function isPrimitive(arg) {
function objectToString (line 25637) | function objectToString(o) {
function pad (line 25642) | function pad(n) {
function timestamp (line 25651) | function timestamp() {
function hasOwnProperty (line 25693) | function hasOwnProperty(obj, prop) {
function Url (line 25789) | function Url() {
function urlParse (line 25857) | function urlParse(url, parseQueryString, slashesDenoteHost) {
function urlFormat (line 26127) | function urlFormat(obj) {
function urlResolve (line 26193) | function urlResolve(source, relative) {
function urlResolveObject (line 26201) | function urlResolveObject(source, relative) {
function isUndef (line 26511) | function isUndef (v) {
function isDef (line 26515) | function isDef (v) {
function isTrue (line 26519) | function isTrue (v) {
function isFalse (line 26523) | function isFalse (v) {
function isPrimitive (line 26530) | function isPrimitive (value) {
function isObject (line 26545) | function isObject (obj) {
function toRawType (line 26554) | function toRawType (value) {
function isPlainObject (line 26562) | function isPlainObject (obj) {
function isRegExp (line 26566) | function isRegExp (v) {
function isValidArrayIndex (line 26573) | function isValidArrayIndex (val) {
function toString (line 26581) | function toString (val) {
function toNumber (line 26593) | function toNumber (val) {
function makeMap (line 26602) | function makeMap (
function remove (line 26629) | function remove (arr, item) {
function hasOwn (line 26642) | function hasOwn (obj, key) {
function cached (line 26649) | function cached (fn) {
function bind (line 26683) | function bind (fn, ctx) {
function toArray (line 26700) | function toArray (list, start) {
function extend (line 26713) | function extend (to, _from) {
function toObject (line 26723) | function toObject (arr) {
function noop (line 26738) | function noop (a, b, c) {}
function genStaticKeys (line 26753) | function genStaticKeys (modules) {
function looseEqual (line 26763) | function looseEqual (a, b) {
function looseIndexOf (line 26796) | function looseIndexOf (arr, val) {
function once (line 26806) | function once (fn) {
function isReserved (line 26933) | function isReserved (str) {
function def (line 26941) | function def (obj, key, val, enumerable) {
function parsePath (line 26954) | function parsePath (path) {
function isNative (line 27024) | function isNative (Ctor) {
function Set (line 27040) | function Set () {
function pushTarget (line 27193) | function pushTarget (_target) {
function popTarget (line 27198) | function popTarget () {
function createTextVNode (line 27258) | function createTextVNode (val) {
function cloneVNode (line 27266) | function cloneVNode (vnode, deep) {
function cloneVNodes (line 27297) | function cloneVNodes (vnodes, deep) {
function protoAugment (line 27409) | function protoAugment (target, src, keys) {
function copyAugment (line 27420) | function copyAugment (target, src, keys) {
function observe (line 27432) | function observe (value, asRootData) {
function defineReactive (line 27457) | function defineReactive (
function set (line 27518) | function set (target, key, val) {
function del (line 27548) | function del (target, key) {
function dependArray (line 27575) | function dependArray (value) {
function mergeData (line 27612) | function mergeData (to, from) {
function mergeDataOrFn (line 27632) | function mergeDataOrFn (
function mergeHook (line 27699) | function mergeHook (
function mergeAssets (line 27723) | function mergeAssets (
function checkComponents (line 27813) | function checkComponents (options) {
function validateComponentName (line 27819) | function validateComponentName (name) {
function normalizeProps (line 27839) | function normalizeProps (options, vm) {
function normalizeInject (line 27876) | function normalizeInject (options, vm) {
function normalizeDirectives (line 27903) | function normalizeDirectives (options) {
function assertObjectType (line 27915) | function assertObjectType (name, value, vm) {
function mergeOptions (line 27929) | function mergeOptions (
function resolveAsset (line 27976) | function resolveAsset (
function validateProp (line 28006) | function validateProp (
function getPropDefaultValue (line 28042) | function getPropDefaultValue (vm, prop, key) {
function assertProp (line 28075) | function assertProp (
function assertType (line 28127) | function assertType (value, type) {
function getType (line 28155) | function getType (fn) {
function isType (line 28160) | function isType (type, fn) {
function handleError (line 28175) | function handleError (err, vm, info) {
function globalHandleError (line 28195) | function globalHandleError (err, vm, info) {
function logError (line 28206) | function logError (err, vm, info) {
function flushCallbacks (line 28224) | function flushCallbacks () {
function withMacroTask (line 28294) | function withMacroTask (fn) {
function nextTick (line 28303) | function nextTick (cb, ctx) {
function traverse (line 28442) | function traverse (val) {
function _traverse (line 28447) | function _traverse (val, seen) {
function createFnInvoker (line 28487) | function createFnInvoker (fns) {
function updateListeners (line 28506) | function updateListeners (
function mergeVNodeHook (line 28544) | function mergeVNodeHook (def, hookKey, hook) {
function extractPropsFromVNodeData (line 28579) | function extractPropsFromVNodeData (
function checkProp (line 28620) | function checkProp (
function simpleNormalizeChildren (line 28659) | function simpleNormalizeChildren (children) {
function normalizeChildren (line 28672) | function normalizeChildren (children) {
function isTextNode (line 28680) | function isTextNode (node) {
function normalizeArrayChildren (line 28684) | function normalizeArrayChildren (children, nestedIndex) {
function ensureCtor (line 28734) | function ensureCtor (comp, base) {
function createAsyncPlaceholder (line 28746) | function createAsyncPlaceholder (
function resolveAsyncComponent (line 28759) | function resolveAsyncComponent (
function isAsyncPlaceholder (line 28861) | function isAsyncPlaceholder (node) {
function getFirstComponentChild (line 28867) | function getFirstComponentChild (children) {
function initEvents (line 28882) | function initEvents (vm) {
function add (line 28894) | function add (event, fn, once) {
function remove$1 (line 28902) | function remove$1 (event, fn) {
function updateComponentListeners (line 28906) | function updateComponentListeners (
function eventsMixin (line 28916) | function eventsMixin (Vue) {
function resolveSlots (line 29025) | function resolveSlots (
function isWhitespace (line 29065) | function isWhitespace (node) {
function resolveScopedSlots (line 29069) | function resolveScopedSlots (
function initLifecycle (line 29089) | function initLifecycle (vm) {
function lifecycleMixin (line 29115) | function lifecycleMixin (Vue) {
function mountComponent (line 29209) | function mountComponent (
function updateChildComponent (line 29277) | function updateChildComponent (
function isInInactiveTree (line 29342) | function isInInactiveTree (vm) {
function activateChildComponent (line 29349) | function activateChildComponent (vm, direct) {
function deactivateChildComponent (line 29367) | function deactivateChildComponent (vm, direct) {
function callHook (line 29383) | function callHook (vm, hook) {
function resetSchedulerState (line 29415) | function resetSchedulerState () {
function flushSchedulerQueue (line 29427) | function flushSchedulerQueue () {
function callUpdatedHooks (line 29482) | function callUpdatedHooks (queue) {
function queueActivatedComponent (line 29497) | function queueActivatedComponent (vm) {
function callActivatedHooks (line 29504) | function callActivatedHooks (queue) {
function queueWatcher (line 29516) | function queueWatcher (watcher) {
function proxy (line 29759) | function proxy (target, sourceKey, key) {
function initState (line 29769) | function initState (vm) {
function initProps (line 29785) | function initProps (vm, propsOptions) {
function initData (line 29831) | function initData (vm) {
function getData (line 29873) | function getData (data, vm) {
function initComputed (line 29884) | function initComputed (vm, computed) {
function defineComputed (line 29925) | function defineComputed (
function createComputedGetter (line 29958) | function createComputedGetter (key) {
function initMethods (line 29973) | function initMethods (vm, methods) {
function initWatch (line 30001) | function initWatch (vm, watch) {
function createWatcher (line 30014) | function createWatcher (
function stateMixin (line 30030) | function stateMixin (Vue) {
function initProvide (line 30079) | function initProvide (vm) {
function initInjections (line 30088) | function initInjections (vm) {
function resolveInject (line 30109) | function resolveInject (inject, vm) {
function renderList (line 30151) | function renderList (
function renderSlot (line 30185) | function renderSlot (
function resolveFilter (line 30234) | function resolveFilter (id) {
function checkKeyCodes (line 30245) | function checkKeyCodes (
function bindObjectProps (line 30268) | function bindObjectProps (
function renderStatic (line 30322) | function renderStatic (
function markOnce (line 30349) | function markOnce (
function markStatic (line 30358) | function markStatic (
function markStaticNode (line 30374) | function markStaticNode (node, key, isOnce) {
function bindObjectListeners (line 30382) | function bindObjectListeners (data, value) {
function installRenderHelpers (line 30403) | function installRenderHelpers (target) {
function FunctionalRenderContext (line 30423) | function FunctionalRenderContext (
function createFunctionalComponent (line 30470) | function createFunctionalComponent (
function mergeProps (line 30510) | function mergeProps (to, from) {
function createComponent (line 30607) | function createComponent (
function createComponentInstanceForVnode (line 30710) | function createComponentInstanceForVnode (
function mergeHooks (line 30732) | function mergeHooks (data) {
function mergeHook$1 (line 30744) | function mergeHook$1 (one, two) {
function transformModel (line 30753) | function transformModel (options, data) {
function createElement (line 30771) | function createElement (
function _createElement (line 30790) | function _createElement (
function applyNS (line 30872) | function applyNS (vnode, ns, force) {
function initRender (line 30891) | function initRender (vm) {
function renderMixin (line 30923) | function renderMixin (Vue) {
function initMixin (line 30998) | function initMixin (Vue) {
function initInternalComponent (line 31055) | function initInternalComponent (vm, options) {
function resolveConstructorOptions (line 31076) | function resolveConstructorOptions (Ctor) {
function resolveModifiedOptions (line 31100) | function resolveModifiedOptions (Ctor) {
function dedupe (line 31114) | function dedupe (latest, extended, sealed) {
function Vue$3 (line 31133) | function Vue$3 (options) {
function initUse (line 31150) | function initUse (Vue) {
function initMixin$1 (line 31172) | function initMixin$1 (Vue) {
function initExtend (line 31181) | function initExtend (Vue) {
function initProps$1 (line 31257) | function initProps$1 (Comp) {
function initComputed$1 (line 31264) | function initComputed$1 (Comp) {
function initAssetRegisters (line 31273) | function initAssetRegisters (Vue) {
function getComponentName (line 31305) | function getComponentName (opts) {
function matches (line 31309) | function matches (pattern, name) {
function pruneCache (line 31321) | function pruneCache (keepAliveInstance, filter) {
function pruneCacheEntry (line 31336) | function pruneCacheEntry (
function initGlobalAPI (line 31437) | function initGlobalAPI (Vue) {
function genClassForVnode (line 31540) | function genClassForVnode (vnode) {
function mergeClassData (line 31558) | function mergeClassData (child, parent) {
function renderClass (line 31567) | function renderClass (
function concat (line 31578) | function concat (a, b) {
function stringifyClass (line 31582) | function stringifyClass (value) {
function stringifyArray (line 31596) | function stringifyArray (value) {
function stringifyObject (line 31608) | function stringifyObject (value) {
function getTagNamespace (line 31655) | function getTagNamespace (tag) {
function isUnknownElement (line 31667) | function isUnknownElement (tag) {
function query (line 31699) | function query (el) {
function createElement$1 (line 31716) | function createElement$1 (tagName, vnode) {
function createElementNS (line 31728) | function createElementNS (namespace, tagName) {
function createTextNode (line 31732) | function createTextNode (text) {
function createComment (line 31736) | function createComment (text) {
function insertBefore (line 31740) | function insertBefore (parentNode, newNode, referenceNode) {
function removeChild (line 31744) | function removeChild (node, child) {
function appendChild (line 31748) | function appendChild (node, child) {
function parentNode (line 31752) | function parentNode (node) {
function nextSibling (line 31756) | function nextSibling (node) {
function tagName (line 31760) | function tagName (node) {
function setTextContent (line 31764) | function setTextContent (node, text) {
function setAttribute (line 31768) | function setAttribute (node, key, val) {
function registerRef (line 31805) | function registerRef (vnode, isRemoval) {
function sameVnode (line 31848) | function sameVnode (a, b) {
function sameInputType (line 31865) | function sameInputType (a, b) {
function createKeyToOldIdx (line 31873) | function createKeyToOldIdx (children, beginIdx, endIdx) {
function createPatchFunction (line 31883) | function createPatchFunction (backend) {
function updateDirectives (line 32578) | function updateDirectives (oldVnode, vnode) {
function _update (line 32584) | function _update (oldVnode, vnode) {
function normalizeDirectives$1 (line 32646) | function normalizeDirectives$1 (
function getRawDirName (line 32669) | function getRawDirName (dir) {
function callHook$1 (line 32673) | function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
function updateAttrs (line 32691) | function updateAttrs (oldVnode, vnode) {
function setAttr (line 32732) | function setAttr (el, key, value) {
function updateClass (line 32787) | function updateClass (oldVnode, vnode) {
function parseFilters (line 32827) | function parseFilters (exp) {
function wrapFilter (line 32909) | function wrapFilter (exp, filter) {
function baseWarn (line 32923) | function baseWarn (msg) {
function pluckModuleFunction (line 32927) | function pluckModuleFunction (
function addProp (line 32936) | function addProp (el, name, value) {
function addAttr (line 32941) | function addAttr (el, name, value) {
function addRawAttr (line 32947) | function addRawAttr (el, name, value) {
function addDirective (line 32952) | function addDirective (
function addHandler (line 32964) | function addHandler (
function getBindingAttr (line 33038) | function getBindingAttr (
function getAndRemoveAttr (line 33060) | function getAndRemoveAttr (
function genComponentModel (line 33086) | function genComponentModel (
function genAssignmentCode (line 33118) | function genAssignmentCode (
function parseModel (line 33154) | function parseModel (val) {
function next (line 33191) | function next () {
function eof (line 33195) | function eof () {
function isStringStart (line 33199) | function isStringStart (chr) {
function parseBracket (line 33203) | function parseBracket (chr) {
function parseString (line 33221) | function parseString (chr) {
function model (line 33240) | function model (
function genCheckboxModel (line 33291) | function genCheckboxModel (
function genRadioModel (line 33322) | function genRadioModel (
function genSelect (line 33334) | function genSelect (
function genDefaultModel (line 33351) | function genDefaultModel (
function normalizeEvents (line 33407) | function normalizeEvents (on) {
function createOnceHandler (line 33426) | function createOnceHandler (handler, event, capture) {
function add$1 (line 33436) | function add$1 (
function remove$2 (line 33454) | function remove$2 (
function updateDOMListeners (line 33467) | function updateDOMListeners (oldVnode, vnode) {
function updateDOMProps (line 33486) | function updateDOMProps (oldVnode, vnode) {
function shouldUpdateValue (line 33537) | function shouldUpdateValue (elm, checkVal) {
function isNotInFocusAndDirty (line 33545) | function isNotInFocusAndDirty (elm, checkVal) {
function isDirtyWithModifiers (line 33555) | function isDirtyWithModifiers (elm, newVal) {
function normalizeStyleData (line 33594) | function normalizeStyleData (data) {
function normalizeStyleBinding (line 33604) | function normalizeStyleBinding (bindingStyle) {
function getStyle (line 33618) | function getStyle (vnode, checkChild) {
function updateStyle (line 33691) | function updateStyle (oldVnode, vnode) {
function addClass (line 33745) | function addClass (el, cls) {
function removeClass (line 33770) | function removeClass (el, cls) {
function resolveTransition (line 33803) | function resolveTransition (def) {
function nextFrame (line 33863) | function nextFrame (fn) {
function addTransitionClass (line 33869) | function addTransitionClass (el, cls) {
function removeTransitionClass (line 33877) | function removeTransitionClass (el, cls) {
function whenTransitionEnds (line 33884) | function whenTransitionEnds (
function getTransitionInfo (line 33917) | function getTransitionInfo (el, expectedType) {
function getTimeout (line 33966) | function getTimeout (delays, durations) {
function toMs (line 33977) | function toMs (s) {
function enter (line 33983) | function enter (vnode, toggleDisplay) {
function leave (line 34132) | function leave (vnode, rm) {
function checkDuration (line 34235) | function checkDuration (val, name, vnode) {
function isValidDuration (line 34251) | function isValidDuration (val) {
function getHookArgumentsLength (line 34261) | function getHookArgumentsLength (fn) {
function _enter (line 34278) | function _enter (_, vnode) {
function setSelected (line 34385) | function setSelected (el, binding, vm) {
function actuallySetSelected (line 34395) | function actuallySetSelected (el, binding, vm) {
function hasNoMatchingOption (line 34428) | function hasNoMatchingOption (value, options) {
function getValue (line 34432) | function getValue (option) {
function onCompositionStart (line 34438) | function onCompositionStart (e) {
function onCompositionEnd (line 34442) | function onCompositionEnd (e) {
function trigger (line 34449) | function trigger (el, type) {
function locateNode (line 34458) | function locateNode (vnode) {
function getRealChild (line 34549) | function getRealChild (vnode) {
function extractTransitionData (line 34558) | function extractTransitionData (comp) {
function placeholder (line 34574) | function placeholder (h, rawChild) {
function hasParentTransition (line 34582) | function hasParentTransition (vnode) {
function isSameChild (line 34590) | function isSameChild (child, oldChild) {
function callPendingCbs (line 34854) | function callPendingCbs (c) {
function recordPosition (line 34865) | function recordPosition (c) {
function applyTranslation (line 34869) | function applyTranslation (c) {
function parseText (line 34950) | function parseText (
function transformNode (line 34987) | function transformNode (el, options) {
function genData (line 35010) | function genData (el) {
function transformNode$1 (line 35029) | function transformNode$1 (el, options) {
function genData$1 (line 35054) | function genData$1 (el) {
function decodeAttr (line 35154) | function decodeAttr (value, shouldDecodeNewlines) {
function parseHTML (line 35159) | function parseHTML (html, options) {
function createASTElement (line 35439) | function createASTElement (
function parse (line 35457) | function parse (
function processPre (line 35685) | function processPre (el) {
function processRawAttrs (line 35691) | function processRawAttrs (el) {
function processElement (line 35707) | function processElement (element, options) {
function processKey (line 35723) | function processKey (el) {
function processRef (line 35733) | function processRef (el) {
function processFor (line 35741) | function processFor (el) {
function parseFor (line 35755) | function parseFor (exp) {
function processIf (line 35774) | function processIf (el) {
function processIfConditions (line 35793) | function processIfConditions (el, parent) {
function findPrevElement (line 35808) | function findPrevElement (children) {
function addIfCondition (line 35825) | function addIfCondition (el, condition) {
function processOnce (line 35832) | function processOnce (el) {
function processSlot (line 35839) | function processSlot (el) {
function processComponent (line 35888) | function processComponent (el) {
function processAttrs (line 35898) | function processAttrs (el) {
function checkInFor (line 35981) | function checkInFor (el) {
function parseModifiers (line 35992) | function parseModifiers (name) {
function makeAttrsMap (line 36001) | function makeAttrsMap (attrs) {
function isTextTag (line 36016) | function isTextTag (el) {
function isForbiddenTag (line 36020) | function isForbiddenTag (el) {
function guardIESVGBug (line 36034) | function guardIESVGBug (attrs) {
function checkForAliasModel (line 36046) | function checkForAliasModel (el, value) {
function preTransformNode (line 36074) | function preTransformNode (el, options) {
function cloneASTElement (line 36125) | function cloneASTElement (el) {
function text (line 36141) | function text (el, dir) {
function html (line 36149) | function html (el, dir) {
function optimize (line 36194) | function optimize (root, options) {
function genStaticKeys$1 (line 36204) | function genStaticKeys$1 (keys) {
function markStatic$1 (line 36211) | function markStatic$1 (node) {
function markStaticRoots (line 36243) | function markStaticRoots (node, isInFor) {
function isStatic (line 36273) | function isStatic (node) {
function isDirectChildOfTemplateFor (line 36290) | function isDirectChildOfTemplateFor (node) {
function genHandlers (line 36339) | function genHandlers (
function genHandler (line 36351) | function genHandler (
function genKeyFilter (line 36412) | function genKeyFilter (keys) {
function genFilterCode (line 36416) | function genFilterCode (key) {
function on (line 36432) | function on (el, dir) {
function bind$1 (line 36441) | function bind$1 (el, dir) {
function generate (line 36471) | function generate (
function genElement (line 36483) | function genElement (el, state) {
function genStatic (line 36516) | function genStatic (el, state) {
function genOnce (line 36523) | function genOnce (el, state) {
function genIf (line 36549) | function genIf (
function genIfConditions (line 36559) | function genIfConditions (
function genFor (line 36586) | function genFor (
function genData$2 (line 36618) | function genData$2 (el, state) {
function genDirectives (line 36696) | function genDirectives (el, state) {
function genInlineTemplate (line 36721) | function genInlineTemplate (el, state) {
function genScopedSlots (line 36734) | function genScopedSlots (
function genScopedSlot (line 36743) | function genScopedSlot (
function genForScopedSlot (line 36760) | function genForScopedSlot (
function genChildren (line 36776) | function genChildren (
function getNormalizationType (line 36806) | function getNormalizationType (
function needsNormalization (line 36829) | function needsNormalization (el) {
function genNode (line 36833) | function genNode (node, state) {
function genText (line 36843) | function genText (text) {
function genComment (line 36849) | function genComment (comment) {
function genSlot (line 36853) | function genSlot (el, state) {
function genComponent (line 36872) | function genComponent (
function genProps (line 36881) | function genProps (props) {
function transformSpecialNewlines (line 36894) | function transformSpecialNewlines (text) {
function detectErrors (line 36919) | function detectErrors (ast) {
function checkNode (line 36927) | function checkNode (node, errors) {
function checkEvent (line 36953) | function checkEvent (exp, text, errors) {
function checkFor (line 36965) | function checkFor (node, text, errors) {
function checkIdentifier (line 36972) | function checkIdentifier (
function checkExpression (line 36987) | function checkExpression (exp, text, errors) {
function createFunction (line 37009) | function createFunction (code, errors) {
function createCompileToFunctionFn (line 37018) | function createCompileToFunctionFn (compile) {
function createCompilerCreator (line 37106) | function createCompilerCreator (baseCompile) {
function getShouldDecode (line 37186) | function getShouldDecode (href) {
function getOuterHTML (line 37277) | function getOuterHTML (el) {
function placeHoldersCount (line 37319) | function placeHoldersCount (b64) {
function byteLength (line 37333) | function byteLength (b64) {
function toByteArray (line 37338) | function toByteArray (b64) {
function tripletToBase64 (line 37369) | function tripletToBase64 (num) {
function encodeChunk (line 37373) | function encodeChunk (uint8, start, end) {
function fromByteArray (line 37383) | function fromByteArray (uint8) {
function typedArraySupport (line 37472) | function typedArraySupport () {
function kMaxLength (line 37484) | function kMaxLength () {
function createBuffer (line 37490) | function createBuffer (that, length) {
function Buffer (line 37519) | function Buffer (arg, encodingOrOffset, length) {
function from (line 37544) | function from (that, value, encodingOrOffset, length) {
function assertSize (line 37585) | function assertSize (size) {
function alloc (line 37593) | function alloc (that, size, fill, encoding) {
function allocUnsafe (line 37617) | function allocUnsafe (that, size) {
function fromString (line 37641) | function fromString (that, string, encoding) {
function fromArrayLike (line 37665) | function fromArrayLike (that, array) {
function fromArrayBuffer (line 37674) | function fromArrayBuffer (that, array, byteOffset, length) {
function fromObject (line 37704) | function fromObject (that, obj) {
function checked (line 37734) | function checked (length) {
function SlowBuffer (line 37744) | function SlowBuffer (length) {
function byteLength (line 37827) | function byteLength (string, encoding) {
function slowToString (line 37872) | function slowToString (encoding, start, end) {
function swap (line 37946) | function swap (b, n, m) {
function bidirectionalIndexOf (line 38080) | function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 38137) | function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
function hexWrite (line 38205) | function hexWrite (buf, string, offset, length) {
function utf8Write (line 38232) | function utf8Write (buf, string, offset, length) {
function asciiWrite (line 38236) | function asciiWrite (buf, string, offset, length) {
function latin1Write (line 38240) | function latin1Write (buf, string, offset, length) {
function base64Write (line 38244) | function base64Write (buf, string, offset, length) {
function ucs2Write (line 38248) | function ucs2Write (buf, string, offset, length) {
function base64Slice (line 38331) | function base64Slice (buf, start, end) {
function utf8Slice (line 38339) | function utf8Slice (buf, start, end) {
function decodeCodePointsArray (line 38417) | function decodeCodePointsArray (codePoints) {
function asciiSlice (line 38435) | function asciiSlice (buf, start, end) {
function latin1Slice (line 38445) | function latin1Slice (buf, start, end) {
function hexSlice (line 38455) | function hexSlice (buf, start, end) {
function utf16leSlice (line 38468) | function utf16leSlice (buf, start, end) {
function checkOffset (line 38516) | function checkOffset (offset, ext, length) {
function checkInt (line 38677) | function checkInt (buf, value, offset, ext, max, min) {
function objectWriteUInt16 (line 38730) | function objectWriteUInt16 (buf, value, offset, littleEndian) {
function objectWriteUInt32 (line 38764) | function objectWriteUInt32 (buf, value, offset, littleEndian) {
function checkIEEE754 (line 38914) | function checkIEEE754 (buf, value, offset, ext, max, min) {
function writeFloat (line 38919) | function writeFloat (buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 38935) | function writeDouble (buf, value, offset, littleEndian, noAssert) {
function base64clean (line 39068) | function base64clean (str) {
function stringtrim (line 39080) | function stringtrim (str) {
function toHex (line 39085) | function toHex (n) {
function utf8ToBytes (line 39090) | function utf8ToBytes (string, units) {
function asciiToBytes (line 39170) | function asciiToBytes (str) {
function utf16leToBytes (line 39179) | function utf16leToBytes (str, units) {
function base64ToBytes (line 39195) | function base64ToBytes (str) {
function blitBuffer (line 39199) | function blitBuffer (src, dst, offset, length) {
function isnan (line 39207) | function isnan (val) {
function Assertion (line 39347) | function Assertion (obj, msg, stack) {
function an (line 39615) | function an (type, msg) {
function includeChainingBehavior (line 39653) | function includeChainingBehavior () {
function include (line 39657) | function include (val, msg) {
function checkArguments (line 39897) | function checkArguments () {
function assertEqual (line 39933) | function assertEqual (val, msg) {
function assertEql (line 39970) | function assertEql(obj, msg) {
function assertAbove (line 40009) | function assertAbove (n, msg) {
function assertLeast (line 40058) | function assertLeast (n, msg) {
function assertBelow (line 40107) | function assertBelow (n, msg) {
function assertMost (line 40156) | function assertMost (n, msg) {
function assertInstanceOf (line 40244) | function assertInstanceOf (constructor, msg) {
function assertOwnProperty (line 40385) | function assertOwnProperty (name, msg) {
function assertOwnPropertyDescriptor (line 40418) | function assertOwnPropertyDescriptor (name, descriptor, msg) {
function assertLengthChain (line 40487) | function assertLengthChain () {
function assertLength (line 40491) | function assertLength (n, msg) {
function assertMatch (line 40523) | function assertMatch(re, msg) {
function assertKeys (line 40602) | function assertKeys (keys) {
function assertThrows (line 40722) | function assertThrows (constructor, errMsg, msg) {
function respondTo (line 40866) | function respondTo (method, msg) {
function satisfy (line 40920) | function satisfy (matcher, msg) {
function closeTo (line 40952) | function closeTo(expected, delta, msg) {
function isSubsetOf (line 40971) | function isSubsetOf(subset, superset, cmp) {
function oneOf (line 41054) | function oneOf (list, msg) {
function assertChanges (line 41092) | function assertChanges (object, prop, msg) {
function assertIncreases (line 41130) | function assertIncreases (object, prop, msg) {
function assertDecreases (line 41168) | function assertDecreases (object, prop, msg) {
function loadShould (line 43019) | function loadShould () {
function addProperty (line 43647) | function addProperty(property) {
function Dict (line 44209) | function Dict(iterable) {
function reduce (line 44222) | function reduce(object, mapfn, init) {
function includes (line 44239) | function includes(object, el) {
function get (line 44247) | function get(object, key) {
function set (line 44250) | function set(object, key, value) {
function isDict (line 44256) | function isDict(it) {
function F (line 44686) | function F() { /* empty */ }
function asinh (line 44954) | function asinh(x) {
function F (line 45998) | function F() { /* empty */ }
function get (line 46157) | function get(target, propertyKey /* , receiver */) {
function set (line 46270) | function set(target, propertyKey, V /* , receiver */) {
function cssWithMappingToString (line 48561) | function cssWithMappingToString(item, useSourceMap) {
function toComment (line 48581) | function toComment(sourceMap) {
function selectColor (line 48637) | function selectColor(namespace) {
function createDebug (line 48656) | function createDebug(namespace) {
function enable (line 48731) | function enable(namespaces) {
function disable (line 48757) | function disable() {
function enabled (line 48769) | function enabled(name) {
function coerce (line 48792) | function coerce(val) {
function deepEqual (line 48848) | function deepEqual(a, b, m) {
function sameValue (line 48878) | function sameValue(a, b) {
function typeEqual (line 48894) | function typeEqual(a, b) {
function dateEqual (line 48907) | function dateEqual(a, b) {
function regexpEqual (line 48921) | function regexpEqual(a, b) {
function argumentsEqual (line 48937) | function argumentsEqual(a, b, m) {
function enumerable (line 48951) | function enumerable(a) {
function iterableEqual (line 48966) | function iterableEqual(a, b) {
function bufferEqual (line 48991) | function bufferEqual(a, b) {
function isValue (line 49004) | function isValue(a) {
function objectEqual (line 49019) | function objectEqual(a, b, m) {
function getType (line 49115) | function getType (obj) {
function Library (line 49137) | function Library () {
function Html4Entities (line 49246) | function Html4Entities() {}
function XmlEntities (line 49412) | function XmlEntities() {}
function parse (line 49688) | function parse(str) {
function fmtShort (line 49749) | function fmtShort(ms) {
function fmtLong (line 49773) | function fmtLong(ms) {
function plural (line 49785) | function plural(ms, n, name) {
function error (line 49865) | function error(type) {
function map (line 49877) | function map(array, fn) {
function mapDomain (line 49896) | function mapDomain(string, fn) {
function ucs2decode (line 49925) | function ucs2decode(string) {
function ucs2encode (line 49959) | function ucs2encode(array) {
function basicToDigit (line 49981) | function basicToDigit(codePoint) {
function digitToBasic (line 50005) | function digitToBasic(digit, flag) {
function adapt (line 50016) | function adapt(delta, numPoints, firstTime) {
function decode (line 50033) | function decode(input) {
function encode (line 50134) | function encode(input) {
function toUnicode (line 50252) | function toUnicode(input) {
function toASCII (line 50271) | function toASCII(input) {
function hasOwnProperty (line 50366) | function hasOwnProperty(obj, prop) {
function map (line 50500) | function map (xs, f) {
function setImmediate (line 50591) | function setImmediate(callback) {
function clearImmediate (line 50608) | function clearImmediate(handle) {
function run (line 50612) | function run(task) {
function runIfPresent (line 50634) | function runIfPresent(handle) {
function installNextTickImplementation (line 50655) | function installNextTickImplementation() {
function canUsePostMessage (line 50661) | function canUsePostMessage() {
function installPostMessageImplementation (line 50676) | function installPostMessageImplementation() {
function installMessageChannelImplementation (line 50701) | function installMessageChannelImplementation() {
function installReadyStateChangeImplementation (line 50713) | function installReadyStateChangeImplementation() {
function installSetTimeoutImplementation (line 50729) | function installSetTimeoutImplementation() {
function CloseEvent (line 50778) | function CloseEvent() {
function TransportMessageEvent (line 50802) | function TransportMessageEvent(data) {
function FacadeJS (line 50824) | function FacadeJS(transport) {
function InfoIframe (line 50977) | function InfoIframe(baseUrl, url) {
function InfoReceiver (line 51057) | function InfoReceiver(baseUrl, urlInfo) {
function SockJS (line 51167) | function SockJS(url, protocols, options) {
function userSetCode (line 51262) | function userSetCode(code) {
function toInteger (line 51600) | function toInteger(num) {
function ToUint32 (line 51610) | function ToUint32(x) {
function Empty (line 51622) | function Empty() {}
function JsonPTransport (line 52043) | function JsonPTransport(transUrl) {
function BufferedSender (line 52080) | function BufferedSender(url, sender) {
function Polling (line 52175) | function Polling(Receiver, receiveUrl, AjaxObject) {
function EventSourceReceiver (line 52241) | function EventSourceReceiver(url) {
function HtmlfileReceiver (line 52314) | function HtmlfileReceiver(url) {
function JsonpReceiver (line 52410) | function JsonpReceiver(url) {
function createIframe (line 52599) | function createIframe(id) {
function createForm (line 52611) | function createForm() {
function XHRFake (line 52699) | function XHRFake(/* method, url, payload, opts */) {
function WebSocketTransport (line 52738) | function WebSocketTransport(transUrl, ignore, options) {
function XdrPollingTransport (line 52840) | function XdrPollingTransport(transUrl) {
function XhrStreamingTransport (line 52871) | function XhrStreamingTransport(transUrl) {
function getType (line 53195) | function getType(obj) {
function Library (line 53219) | function Library() {
function decode (line 53322) | function decode(input) {
function querystring (line 53333) | function querystring(query) {
function querystringify (line 53359) | function querystringify(obj, prefix) {
FILE: test/helpers/index.js
function dataPropagationTest (line 5) | function dataPropagationTest (Component) {
function attrTest (line 20) | function attrTest (it, base, Component, attr) {
FILE: test/helpers/utils.js
function createVM (line 7) | function createVM (context, template, opts = {}) {
function createKarmaTest (line 36) | function createKarmaTest (context, template, opts) {
function createVisualTest (line 50) | function createVisualTest (context, template, opts) {
function register (line 85) | function register (name, component) {
FILE: test/helpers/wait-for-update.js
function nextTick (line 10) | function nextTick () {
FILE: test/mocks.js
function htmlElement (line 1) | function htmlElement () {
FILE: test/specs/directives/track-event.spec.js
function hasEvent (line 5) | function hasEvent (listeners, event) {
function getEventListener (line 9) | function getEventListener (listeners, event) {
Condensed preview — 79 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,897K chars).
[
{
"path": ".babelrc",
"chars": 334,
"preview": "{\n \"presets\": [\n [\n \"env\",\n {\n \"targets\": {\n \"browsers\": [\n \"last 2 versions\"\n ]"
},
{
"path": ".editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": ".eslintignore",
"chars": 18,
"preview": "dist/*.js\nbuild/*\n"
},
{
"path": ".eslintrc.js",
"chars": 414,
"preview": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n extends: '"
},
{
"path": ".gitignore",
"chars": 81,
"preview": ".DS_Store\nnode_modules/\nnpm-debug.log\nyarn-error.log\ntest/coverage\n*.tgz\npackage\n"
},
{
"path": ".postcssrc.js",
"chars": 196,
"preview": "// https://github.com/michael-ciniawsky/postcss-load-config\n\nmodule.exports = {\n \"plugins\": {\n // to edit target bro"
},
{
"path": ".stylelintrc",
"chars": 137,
"preview": "{\n \"processors\": [\"stylelint-processor-html\"],\n \"extends\": \"stylelint-config-standard\",\n \"rules\": {\n \"no-empty-sou"
},
{
"path": ".travis.yml",
"chars": 33,
"preview": "language: node_js\nnode_js: \"node\""
},
{
"path": ".vscode/settings.json",
"chars": 38,
"preview": "{\n \"vsicons.presets.angular\": false\n}"
},
{
"path": "LICENSE",
"chars": 1065,
"preview": "MIT License\n\nCopyright (c) 2017 Ray Chen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "README.md",
"chars": 5367,
"preview": "# vue-uweb \n[](https://travis-ci.org/raychenf"
},
{
"path": "README_EN.md",
"chars": 0,
"preview": ""
},
{
"path": "build/build.js",
"chars": 2993,
"preview": "const mkdirp = require('mkdirp')\nconst rollup = require('rollup').rollup\nconst vue = require('rollup-plugin-vue')\nconst "
},
{
"path": "build/utils/index.js",
"chars": 1539,
"preview": "const ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst { join } = require('path')\n\nconst {\n red,\n logE"
},
{
"path": "build/utils/log.js",
"chars": 408,
"preview": "function logError (e) {\n console.log(e)\n}\n\nfunction blue (str) {\n return `\\x1b[1m\\x1b[34m${str}\\x1b[39m\\x1b[22m`\n}\n\nfu"
},
{
"path": "build/utils/style.js",
"chars": 1591,
"preview": "const path = require('path')\nconst postcss = require('postcss')\nconst cssnext = require('postcss-cssnext')\nconst CleanCS"
},
{
"path": "build/utils/write.js",
"chars": 411,
"preview": "const fs = require('fs')\n\nconst { blue } = require('./log.js')\n\nfunction write (dest, code) {\n return new Promise(funct"
},
{
"path": "build/webpack.config.base.js",
"chars": 1315,
"preview": "const webpack = require('webpack')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst { resolve } = "
},
{
"path": "build/webpack.config.dev.js",
"chars": 2446,
"preview": "const webpack = require('webpack')\nconst merge = require('webpack-merge')\nconst HtmlWebpackPlugin = require('html-webpac"
},
{
"path": "build/webpack.config.dll.js",
"chars": 578,
"preview": "const { resolve, join } = require('path')\nconst webpack = require('webpack')\nconst pkg = require('../package.json')\n\ncon"
},
{
"path": "dist/vue-uweb.common.js",
"chars": 23402,
"preview": "/*!\n * vue-uweb v0.2.2\n * (c) 2019 raychenfj\n * Released under the MIT License.\n */\n\n'use strict';\n\nObject.definePropert"
},
{
"path": "dist/vue-uweb.esm.js",
"chars": 23317,
"preview": "/*!\n * vue-uweb v0.2.2\n * (c) 2019 raychenfj\n * Released under the MIT License.\n */\n\nvar toStr = Object.prototype.toStri"
},
{
"path": "dist/vue-uweb.js",
"chars": 23639,
"preview": "/*!\n * vue-uweb v0.2.2\n * (c) 2019 raychenfj\n * Released under the MIT License.\n */\n\n(function (global, factory) {\n\ttype"
},
{
"path": "examples/simple/index.html",
"chars": 8261,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <title>vue-uweb</title>\n <link rel=\"stylesheet\" href=\"./prism.css\">\n <link rel=\"style"
},
{
"path": "examples/simple/prism.css",
"chars": 3527,
"preview": "/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=toolbar+highlight-keyword"
},
{
"path": "examples/simple/prism.js",
"chars": 10105,
"preview": "/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=highlight-keywords */\nvar"
},
{
"path": "examples/simple/script.js",
"chars": 321,
"preview": "var Vue = window.Vue\nvar uweb = window.uweb\n\nVue.use(uweb, '1261414301')\n\nnew Vue({\n el: '#app',\n data: {\n content:"
},
{
"path": "examples/simple/styles.css",
"chars": 374,
"preview": "body {\n font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n c"
},
{
"path": "examples/webpack/.babelrc",
"chars": 234,
"preview": "{\n \"presets\": [\n [\"env\", { \"modules\": false }],\n \"stage-2\"\n ],\n \"plugins\": [\"transform-runtime\"],\n \"comments\":"
},
{
"path": "examples/webpack/.editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": "examples/webpack/.eslintignore",
"chars": 23,
"preview": "build/*.js\nconfig/*.js\n"
},
{
"path": "examples/webpack/.eslintrc.js",
"chars": 642,
"preview": "// http://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOpt"
},
{
"path": "examples/webpack/.gitignore",
"chars": 59,
"preview": ".DS_Store\nnode_modules/\ndist/\nnpm-debug.log\nyarn-error.log\n"
},
{
"path": "examples/webpack/.postcssrc.js",
"chars": 196,
"preview": "// https://github.com/michael-ciniawsky/postcss-load-config\n\nmodule.exports = {\n \"plugins\": {\n // to edit target bro"
},
{
"path": "examples/webpack/.vscode/settings.json",
"chars": 38,
"preview": "{\n \"vsicons.presets.angular\": false\n}"
},
{
"path": "examples/webpack/README.md",
"chars": 470,
"preview": "# vue-uweb-webpack\n\n> A Vue.js project\n\n## Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot re"
},
{
"path": "examples/webpack/build/build.js",
"chars": 953,
"preview": "require('./check-versions')()\n\nprocess.env.NODE_ENV = 'production'\n\nvar ora = require('ora')\nvar rm = require('rimraf')\n"
},
{
"path": "examples/webpack/build/check-versions.js",
"chars": 1172,
"preview": "var chalk = require('chalk')\nvar semver = require('semver')\nvar packageConfig = require('../package.json')\n\nfunction exe"
},
{
"path": "examples/webpack/build/dev-client.js",
"chars": 245,
"preview": "/* eslint-disable */\nrequire('eventsource-polyfill')\nvar hotClient = require('webpack-hot-middleware/client?noInfo=true&"
},
{
"path": "examples/webpack/build/dev-server.js",
"chars": 2304,
"preview": "require('./check-versions')()\n\nvar config = require('../config')\nif (!process.env.NODE_ENV) {\n process.env.NODE_ENV = J"
},
{
"path": "examples/webpack/build/utils.js",
"chars": 1954,
"preview": "var path = require('path')\nvar config = require('../config')\nvar ExtractTextPlugin = require('extract-text-webpack-plugi"
},
{
"path": "examples/webpack/build/vue-loader.conf.js",
"chars": 307,
"preview": "var utils = require('./utils')\nvar config = require('../config')\nvar isProduction = process.env.NODE_ENV === 'production"
},
{
"path": "examples/webpack/build/webpack.base.conf.js",
"chars": 1545,
"preview": "var path = require('path')\nvar utils = require('./utils')\nvar config = require('../config')\nvar vueLoaderConfig = requir"
},
{
"path": "examples/webpack/build/webpack.dev.conf.js",
"chars": 1225,
"preview": "var utils = require('./utils')\nvar webpack = require('webpack')\nvar config = require('../config')\nvar merge = require('w"
},
{
"path": "examples/webpack/build/webpack.prod.conf.js",
"chars": 3679,
"preview": "var path = require('path')\nvar utils = require('./utils')\nvar webpack = require('webpack')\nvar config = require('../conf"
},
{
"path": "examples/webpack/config/dev.env.js",
"chars": 139,
"preview": "var merge = require('webpack-merge')\nvar prodEnv = require('./prod.env')\n\nmodule.exports = merge(prodEnv, {\n NODE_ENV: "
},
{
"path": "examples/webpack/config/index.js",
"chars": 1437,
"preview": "// see http://vuejs-templates.github.io/webpack for documentation.\nvar path = require('path')\n\nmodule.exports = {\n buil"
},
{
"path": "examples/webpack/config/prod.env.js",
"chars": 48,
"preview": "module.exports = {\n NODE_ENV: '\"production\"'\n}\n"
},
{
"path": "examples/webpack/index.html",
"chars": 204,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <title>vue-uweb-webpack</title>\n </head>\n <body>\n <d"
},
{
"path": "examples/webpack/package.json",
"chars": 1991,
"preview": "{\n \"name\": \"vue-uweb-webpack\",\n \"version\": \"1.0.0\",\n \"description\": \"vue uweb webpack example\",\n \"author\": \"raychenf"
},
{
"path": "examples/webpack/src/app.css",
"chars": 374,
"preview": "body {\n font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n c"
},
{
"path": "examples/webpack/src/app.js",
"chars": 143,
"preview": "export default {\n name: 'app',\n data () {\n return {\n content: '',\n auto: true,\n vshow: false,\n "
},
{
"path": "examples/webpack/src/app.vue",
"chars": 8014,
"preview": "<template>\n <div id=\"app\">\n <img id=\"logo\" src=\"./assets/logo.png\" alt=\"Vue logo\">\n <h1>欢迎使用vue-uweb插件</h1>\n\n "
},
{
"path": "examples/webpack/src/main.js",
"chars": 407,
"preview": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base."
},
{
"path": "examples/webpack/src/uweb.js",
"chars": 79,
"preview": "import uweb from 'vue-uweb'\nimport Vue from 'vue'\n\nVue.use(uweb, '1261414301')\n"
},
{
"path": "examples/webpack/static/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "package.json",
"chars": 4172,
"preview": "{\n \"name\": \"vue-uweb\",\n \"version\": \"0.2.2\",\n \"description\": \"A vuejs plugin for uweb statistics\",\n \"author\": \"rayche"
},
{
"path": "src/directives/auto-pageview.js",
"chars": 293,
"preview": "import uweb from '../index'\nimport { notChanged } from './util'\n\nexport default function (el, binding) {\n if (notChange"
},
{
"path": "src/directives/track-event.js",
"chars": 1554,
"preview": "import uweb from '../index'\nimport { notChanged, isEmpty } from './util'\n\nexport default function (el, binding) {\n if ("
},
{
"path": "src/directives/track-pageview.js",
"chars": 1328,
"preview": "import uweb from '../index'\nimport { notChanged, isEmpty } from './util'\n\nexport const watch = []\n\nconst trackPageview ="
},
{
"path": "src/directives/util.js",
"chars": 538,
"preview": "import deepEqual from 'deep-equal'\n\n/**\n * if the binding value is equal to oldeValue\n */\nexport function notChanged (bi"
},
{
"path": "src/index.js",
"chars": 1819,
"preview": "import install from './install'\n\n// deferred promise\nconst deferred = {}\ndeferred.promise = new Promise((resolve, reject"
},
{
"path": "src/install.js",
"chars": 1996,
"preview": "import autoPageview from './directives/auto-pageview'\nimport trackEvent from '././directives/track-event'\nimport trackPa"
},
{
"path": "test/.eslintrc",
"chars": 95,
"preview": "{\n \"env\": {\n \"mocha\": true\n },\n \"globals\": {\n \"expect\": true,\n \"sinon\": true\n }\n}\n"
},
{
"path": "test/dist/vuePluginTemplateDeps.dll.js",
"chars": 1593276,
"preview": "var vuePluginTemplateDeps =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tva"
},
{
"path": "test/dist/vuePluginTemplateDeps.json",
"chars": 36521,
"preview": "{\"name\":\"vuePluginTemplateDeps\",\"content\":{\"./node_modules/core-js/library/modules/_export.js\":{\"id\":0,\"meta\":{}},\"./nod"
},
{
"path": "test/helpers/Test.vue",
"chars": 1815,
"preview": "<template>\n <div :class=\"containerClasses\">\n <div role=\"button\"\n @click=\"toggle\"\n class=\"test-dom-co"
},
{
"path": "test/helpers/index.js",
"chars": 1240,
"preview": "import camelcase from 'camelcase'\nimport { createVM, Vue } from './utils'\nimport { nextTick } from './wait-for-update'\n\n"
},
{
"path": "test/helpers/utils.js",
"chars": 2348,
"preview": "import Vue from 'vue/dist/vue.js'\nimport Test from './Test.vue'\n\nVue.config.productionTip = false\nconst isKarma = !!wind"
},
{
"path": "test/helpers/wait-for-update.js",
"chars": 1100,
"preview": "import Vue from 'vue/dist/vue.js'\n\n// Testing helper\n// nextTick().then(() => {\n//\n// Automatically waits for nextTick\n/"
},
{
"path": "test/index.js",
"chars": 1058,
"preview": "// Polyfill fn.bind() for PhantomJS\nimport bind from 'function-bind'\n/* eslint-disable no-extend-native */\nFunction.prot"
},
{
"path": "test/karma.conf.js",
"chars": 1263,
"preview": "const merge = require('webpack-merge')\nconst baseConfig = require('../build/webpack.config.dev.js')\n\nconst webpackConfig"
},
{
"path": "test/mocks.js",
"chars": 422,
"preview": "export function htmlElement () {\n return {\n listeners: [],\n tagName: 'HTML',\n addEventListener (event, fn) {\n "
},
{
"path": "test/specs/directives/auto-pageview.spec.js",
"chars": 1436,
"preview": "import autoPageview from 'src/directives/auto-pageview'\nimport uweb from 'src/index'\nimport { htmlElement } from '../../"
},
{
"path": "test/specs/directives/track-event.spec.js",
"chars": 3836,
"preview": "import trackEvent from 'src/directives/track-event'\nimport uweb from 'src/index'\nimport { htmlElement } from '../../mock"
},
{
"path": "test/specs/directives/track-pageview.spec.js",
"chars": 2205,
"preview": "import trackPageview, { watch } from 'src/directives/track-pageview'\nimport uweb from 'src/index'\nimport { htmlElement }"
},
{
"path": "test/specs/directives/util.spec.js",
"chars": 1240,
"preview": "import { isEmpty, notChanged } from 'src/directives/util'\n\ndescribe('directives.util', () => {\n describe('skip', () => "
},
{
"path": "test/specs/index.spec.js",
"chars": 4180,
"preview": "import Vue from 'vue'\nimport uweb from 'src/index'\nimport chai from 'chai'\n\ndescribe('vue-uweb', () => {\n let sandbox ="
},
{
"path": "test/visual.js",
"chars": 1674,
"preview": "import 'style-loader!css-loader!mocha-css'\n\n// create a div where mocha can add its stuff\nconst mochaDiv = document.crea"
}
]
About this extraction
This page contains the full source code of the raychenfj/vue-uweb GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 79 files (1.7 MB), approximately 508.7k tokens, and a symbol index with 1041 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.