Showing preview only (4,287K chars total). Download the full file or copy to clipboard to get everything.
Repository: ruanyf/jstraining
Branch: master
Commit: 9dadb09aeaef
Files: 91
Total size: 4.1 MB
Directory structure:
gitextract_8xrdat_v/
├── .gitignore
├── README.md
├── demos/
│ ├── README.md
│ ├── angular-demo/
│ │ └── index.html
│ ├── backbone-demo/
│ │ ├── index.html
│ │ └── js/
│ │ ├── backbone.js
│ │ ├── jquery.js
│ │ ├── main.js
│ │ └── underscore.js
│ ├── eslint-demo/
│ │ ├── index.js
│ │ └── package.json
│ ├── express-demo/
│ │ ├── app1.js
│ │ ├── app2.js
│ │ ├── app3.js
│ │ ├── app4.js
│ │ └── package.json
│ ├── jsx-demo/
│ │ ├── index.html
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── mobx-demo/
│ │ ├── .babelrc
│ │ ├── .eslintignore
│ │ ├── .eslintrc
│ │ ├── .gitignore
│ │ ├── .jshintignore
│ │ ├── .jshintrc
│ │ ├── app/
│ │ │ ├── index.html
│ │ │ ├── main.css
│ │ │ ├── main.jsx
│ │ │ └── store.js
│ │ ├── browser-demo/
│ │ │ ├── index.html
│ │ │ ├── mobx-react.js
│ │ │ ├── mobx.umd.js
│ │ │ ├── react-15.1.0.js
│ │ │ └── react-dom-15.1.0.js
│ │ ├── package.json
│ │ ├── webpack.config.js
│ │ └── webpack.production.config.js
│ ├── mocha-demo/
│ │ ├── add.js
│ │ └── package.json
│ ├── nightmare-demo/
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── react-dom.js
│ │ ├── react.js
│ │ ├── server.js
│ │ ├── taobao.test.js
│ │ └── test.js
│ ├── react-component-demo/
│ │ ├── index1.html
│ │ ├── index2.html
│ │ ├── index3.html
│ │ ├── index4.html
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── react-lifecycle-demo/
│ │ ├── index.html
│ │ ├── jquery.js
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── recharts-demo/
│ │ ├── index.html
│ │ └── react-dom.js
│ ├── redux-demo/
│ │ ├── .babelrc
│ │ ├── .eslintignore
│ │ ├── .eslintrc
│ │ ├── .gitignore
│ │ ├── .jshintignore
│ │ ├── .jshintrc
│ │ ├── app/
│ │ │ ├── App.js
│ │ │ ├── index.html
│ │ │ ├── main.css
│ │ │ ├── main.jsx
│ │ │ ├── myComponent.js
│ │ │ └── reducer.js
│ │ ├── package.json
│ │ ├── webpack.config.js
│ │ └── webpack.production.config.js
│ ├── rest-api-demo/
│ │ ├── db.json
│ │ └── package.json
│ ├── simple-app-demo/
│ │ ├── app.js
│ │ ├── bundle.js
│ │ ├── index.html
│ │ └── package.json
│ └── vue-demo/
│ ├── app1.js
│ ├── app2.js
│ ├── app3.js
│ ├── index1.html
│ ├── index2.html
│ └── index3.html
├── docs/
│ ├── engineering.md
│ ├── history.md
│ ├── node.md
│ ├── preparation.md
│ └── react.md
└── ppt/
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
node_modules
instructor.md
================================================
FILE: README.md
================================================
全栈工程师培训材料,帮助学习者掌握 JavaScript 全栈开发的基本知识,承担简单 Web 应用的前后端开发。
一共四讲,适合两天的训练营。
## 学员要求
本培训不是零基础的,要求学员具备互联网开发的基本知识。
- HTML
- JavaScript
- CSS
- 命令行
以上技术,只要懂得基本语法和如何使用即可。
## 环境准备
参加培训之前,请按照[文档](docs/preparation.md)安装软件,做好环境准备。
## 课堂练习
培训时,需要完成[课堂练习](demos)。
## 第一讲:[前端开发的历史和趋势](./docs/history.md)
1. 前端开发的历史演变
2. 前端 MVC 框架的兴起
3. 前后端分离
4. 全栈工程师
5. 前端开发的未来
## 第二讲:[React 技术栈](./docs/react.md)
1. React 的基本用法
2. React 应用的架构
## 第三讲:[Node 应用开发](./docs/node.md)
1. Node 的基本用法
2. Restful API
3. Express 框架搭建 Web 应用
## 第四讲:[前端工程简介](./docs/engineering.md)
1. 持续集成
1. 静态代码检查
1. 单元测试
1. 功能测试
1. 持续集成服务 Travis CI
## License
GPL v3
================================================
FILE: demos/README.md
================================================
# 课堂练习的操作指导
## 目录
- 前端开发的历史和趋势
- [Backbone](#backbone)
- [Angular](#angular)
- [Vue](#vue)
- React 技术栈
- [JSX](#jsx)
- [React 组件语法](#react-组件语法)
- [React 组件的参数](#react-组件的参数)
- [React 组件的状态](#react-组件的状态)
- [React 组件实战](#react-组件实战)
- [React 组件的生命周期](#react-组件的生命周期)
- [ReCharts](#recharts)
- [MobX](#mobx)
- [Redux](#redux)
- Node 开发
- [Simple App](#simple-app)
- [REST API](#rest-api)
- [Express](#express)
- 前端工程简介
- [ESLint](#eslint)
- [Mocha](#mocha)
- [Nightmare](#nightmare)
- [Travis CI](#travis-ci)
## Backbone
### 实验目的
1. 理解前端框架的路由组件(`router`)的作用
### 操作步骤
1. 浏览器打开[`demos/backbone-demo/index.html`](./backbone-demo/index.html)
1. 点击页面上的链接,注意浏览器 URL 的变化
1. 仔细查看[`js/main.js`](./backbone-demo/js/main.js)的源码,看懂 Router 组件的使用方式
## Angular
### 实验目的
1. 理解 Angular 的双向绑定机制
### 操作步骤
1. 浏览器打开[`demos/angular-demo/index.html`](./angular-demo/index.html)
1. 在输入框填入内容,注意页面变化
1. 查看[`index.html`](./angular-demo/index.html)的源码,理解 Angular 对 HTML 标签的增强
## Vue
### 实验目的
1. 理解 Vue 的模板与数据的双向绑定
### 操作步骤
1. 浏览器打开[`demos/vue-demo/index1.html`](./vue-demo/index1.html)
1. 在输入框填入内容,注意页面变化
1. 查看[`app1.js`](./vue-demo/app1.js),理解 Vue 组件的基本写法
### 注意事项
1. [`index2.html`](./vue-demo/index2.html)是一个稍微复杂的例子,模板如何绑定数据对象的一个字段。
2. [`index3.html`](./vue-demo/index3.html)是事件绑定模板的例子。
## JSX
### 实验目的
1. 掌握 JSX 基本语法
### 操作步骤
1. 浏览器打开`demos/jsx-demo/index.html`,仔细查看源码。
### 注意事项
1. `ReactDOM.render`方法接受两个参数:一个虚拟 DOM 节点和一个真实 DOM 节点,作用是将虚拟 DOM 挂载到真实 DOM。
### 练习
1. 修改源码,将显示文字变为 “Hello React!”。
## React 组件语法
### 实验目的
1. 掌握 React 组件的基本写法
### 操作步骤
1. 浏览器打开`demos/react-component-demo/index1.html`,仔细查看源码。
### 注意事项
1. `class MyTitle extends React.Component`是 ES6 语法,表示自定义一个`MyTitle`类,该类继承了基类`React.Component`的所有属性和方法。
1. React 规定,自定义组件的第一个字母必须大写,比如`MyTitle`不能写成`myTitle`,以便与内置的原生类相区分。
1. 每个组件都必须有`render`方法,定义输出的样式。
1. `<MyTitle/>`表示生成一个组件类的实例,每个实例一定要有闭合标签,写成`<MyTilte></MyTitle>`也可。
## React 组件的参数
### 实验目的
1. 学会向 React 组件传参数
### 操作步骤
1. 浏览器打开`demos/react-component-demo/index2.html`,仔细查看源码。
### 注意事项
1. 组件内部通过`this.props`对象获取参数。
### 练习
1. 将组件的颜色,从红色(`red`)换成黄色(`yellow`)。
## React 组件的状态
### 实验目的
1. 学会通过状态变动,引发组件的重新渲染。
### 操作步骤
1. 浏览器打开`demos/react-component-demo/index3.html`,仔细查看源码。
### 注意事项
```javascript
class MyTitle extends React.Component {
constructor(...args) {
super(...args);
this.state = {
name: '访问者'
};
}
// ...
```
`constructor`是组件的构造函数,会在创建实例时自动调用。`...args`表示组件参数,`super(...args)`是 ES6 规定的写法。`this.state`对象用来存放内部状态,这里是定义初始状态。
```html
<div>
<input
type="text"
onChange={this.handleChange.bind(this)}
/>
<p>你好,{this.state.name}</p>
</div>;
```
`this.state.name`表示读取`this.state`的`name`属性。每当输入框有变动,就会自动调用`onChange`指定的监听函数,这里是`this.handleChange`,`.bind(this)`表示该方法内部的`this`,绑定当前组件。
```javascript
handleChange(e) {
let name = e.target.value;
this.setState({
name: name
});
}
```
`this.setState`方法用来重置`this.state`,每次调用这个方法,就会引发组件的重新渲染。
## React 组件实战
### 实验目的
1. 学会自己写简单的 React 组件。
### 操作步骤
1. 浏览器打开`demos/react-component-demo/index4.html`。
1. 点击`Hello World`,看看会发生什么。
### 练习
1. 修改源码,使得点击`Hello World`后,会显示当前的日期,比如`Hello 2016年1月1日`。
2. 请在上一步练习的基础上,进一步修改。现在`Hello World`点击一次,会改变内容,再点击就不会有反应了。请将其改成,再点击一次变回原样。
### 提示
练习一、下面的代码可以得到当前日期。
```javascript
var d = new Date();
d.getFullYear() // 当前年份
d.getMonth() + 1 // 当前月份
d.getDate() // 当前是每个月的几号
```
练习二、可以在`this.state`里面设置一个开关变量`isClicked`。
```javascript
this.state = {
text: 'World',
isClicked: false
};
```
然后,在`this.handleClick`方法里面,做一个`toggle`效果。
```javascript
let isClicked = !this.state.isClicked;
this.setState({
isClicked: isClicked,
text: isClicked ? 'Clicked' : 'World'
});
```
## React 组件的生命周期
### 实验目的
1. 掌握钩子方法的基本用法
1. 掌握组件如何通过 Ajax 请求获取数据,并对数据进行处理
### 操作步骤
1. 打开`demos/react-lifecycle-demo/index.html`,仔细查看源码。
### 注意事项
```javascript
componentDidMount() {
const url = '...';
$.getJSON(url)
.done()
.fail();
}
```
- `componentDidMount`方法在组件加载后执行,只执行一次。本例在这个方法里向服务器请求数据,操作结束前,组件都显示`Loading`。
- `$.getJSON`方法用于向服务器请求 JSON 数据。本例的数据从 Github API 获取,可以打开源码里面的链接,看看原始的数据结构。
### 练习
1. 本例的 JSON 数据是 Github 上面最受欢迎的 JavaScript 项目。请在网页上显示一个列表,列出这些项目。
### 提示
(1) `this.state.loading`记录数据加载是否结束。只要数据请求没有结束,`this.state.loading`就一直是`true`,网页上显示`loading`。
(2) `this.state.error`保存数据请求失败时的错误信息。如果请求失败,`this.state.error`就是返回的错误对象,网页上显示报错信息。
(3) `this.state.data`保存从服务器获取的数据。如果请求成功,可以先用`console.log`方法,将它在控制台里打印出来,看看数据结构。
```javascript
render() {
// 加一行打印命令,看看数据结构
console.log(this.state.data);
return {
// ...
```
(4) `this.state.data`里面的`this.state.data.items`应该是一个数组,保存着每个项目的具体信息。可以使用`forEach`方法进行遍历处理。
```javascript
var projects = this.state.data.items;
var results = [];
projects.forEach(p => {
var item = <li>{p.name}</li>;
results.push(item);
});
```
(5)然后,将上一步的`results`插入网页即可。
```javascript
<div>
<ul>{results}</ul>
</div>
```
## ReCharts
### 实验目的
1. 了解如何使用第三方组件库。
### 操作步骤
1. 浏览器打开`demos/recharts-demo/index.html`,查看效果。
## MobX
### 实验目的
1. 理解 MobX 框架
### 操作步骤
(1)浏览器打开`demos/mobx-demo/browser-demo/index.html`,仔细查看源码
(2) 命令行进入`demos/mobx-demo/`目录,执行如下的命令。
```bash
$ npm install
$ npm start
```
(3) 打开浏览器,访问 http://localhost:8080 ,查看结果,并仔细研究`app/`目录下面的代码。
### 注意事项
```javascript
@observer
class App extends React.Component {
render() {
// ...
}
}
```
`@observer`是一种新的语法,叫做“装饰器”,表示对整个类的行为进行修改,即将`App`类作为参数传入`observer`函数。这里的意思是,整个`App`类都是一个“观察者”,观察`store`的变化,只要一有变化,立刻重新渲染。
数据保存在`Store`里面。`Store`的属性分成两种:被观察的属性(`@observable`),和自动计算得到的属性`@computed`。
```javascript
class Store {
@observable name = 'Bartek';
@computed get decorated() {
return `${this.name} is awesome!`;
}
}
```
`Store`的变化由用户引发。组件观察到`Store`的变化,自动重新渲染。
```javascript
<p>
{this.props.store.decorated}
</p>
<input
defaultValue={this.props.store.name}
onChange={
(event) =>
this.props.store.name = event.currentTarget.value
}
/>
```
## Redux
### 实验目的
1. 理解 Redux 架构
### 操作步骤
(1) 命令行下进入`demos/redux-demo`目录,执行如下的命令。
```bash
$ npm install
$ npm start
```
(2)打开浏览器,访问 http://localhost:8080 ,查看结果,并仔细研究代码。
### 注意事项
(1) Redux 要求 UI 的渲染组件都是纯组件,即不包含任何状态(`this.state`)的组件。
```javascript
<div className="index">
<p>{this.props.text}</p>
<input
defaultValue={this.props.name}
onChange={this.props.onChange}
/>
</div>
```
(2) 进行数据处理、并包含状态的组件,称为“容器组件”。Redux 使用`connect`方法,自动生成 UI 组件对应的“容器组件”。
```javascript、
// MyComponent 是纯的 UI 组件
const App = connect(
mapStateToProps,
mapDispatchToProps
)(MyComponent);
```
(3) `mapStateToProps`函数返回一个对象,表示一种映射关系,将 UI 组件的参数映射到`state`。
```javascript
function mapStateToProps(state) {
return {
text: state.text,
name: state.name
};
}
```
(4) `mapDispatchToProps`函数也是返回一个对象,表示一种映射关系,但定义的是哪些用户的操作应该当作`Action`,传给`Store`。
```javascript
function mapDispatchToProps(dispatch) {
return {
onChange: (e) => dispatch({
type: 'change',
payload: e.target.value
})
}
}
```
(5) `reducer`函数用来接收`action`,算出新的`state`。
```javascript
function reducer(state = {
text: '你好,访问者',
name: '访问者'
}, action) {
switch (action.type) {
case 'change':
return {
name: action.payload,
text: '你好,' + action.payload
};
}
}
```
`Store`由 Redux 提供的`createStore`方法生成,该方法接受`reducer`作为参数。
```javascript
const store = createStore(reducer);
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.body.appendChild(document.createElement('div'))
);
```
为了把`Store`传入组件,必须使用 Redux 提供的`Provider`组件在应用的最外面,包裹一层。
## Simple App
### 实验目的
1. 学会使用 Node 编写简单的前端应用。
### 操作步骤
(1)新建一个目录
```bash
$ mkdir simple-app-demo
$ cd simple-app-demo
```
(2)在该目录下,新建一个`package.json`文件。
```bash
$ npm init -y
```
`package.json`是项目的配置文件。
(3)安装`jquery`、`webpack`、`webpack-cli`这三个模块。
```bash
$ npm install -S jquery
$ npm install -S webpack webpack-cli
```
打开`package.json`文件,会发现`jquery`、`webpack`和`webpack-cli`都加入了`dependencies`字段,并且带有版本号。
(4)在项目根目录下,新建一个网页文件`index.html`。
```html
<html>
<body>
<h1>Hello World</h1>
<script src="bundle.js"></script>
</body>
</html>
```
(5)在项目根目录下,新建一个脚本文件`app.js`。
```javascript
const $ = require('jquery');
$('h1').css({ color: 'red'});
```
上面代码中,`require`方法是 Node 特有的模块加载命令。
(6)打开`package.json`,在`scripts`字段里面,添加一行。
```javascript
"scripts": {
"build": "webpack --mode production ./app.js -o ./bundle.js",
"test": "...."
},
```
(7) 在项目根目录下,执行下面的命令,将脚本打包。
```bash
$ npm run build
```
执行完成,可以发现项目根目录下,新生成了一个文件`bundle.js`。
(8)浏览器打开`index.html`,可以发现`Hello World`变成了红色。
### 练习
1. 修改样式,将标题变为蓝色,然后重新编译生成打包文件。
## REST API
### 实验目的
1. 熟悉 REST API 的基本用法
### 操作步骤
(1) 命令行进入`demos/rest-api-demo`目录,执行下面的命令。
```bash
$ npm install -S json-server
```
(2) 在项目根目录下,新建一个 JSON 文件`db.json`。
```javascript
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
```
(3) 打开`package.json`,在`scripts`字段添加一行。
```javascript
"scripts": {
"server": "json-server db.json",
"test": "..."
},
```
(4) 命令行下执行下面的命令,启动服务。
```bash
$ npm run server
```
(5)打开 Chrome 浏览器的 Postman 应用。依次向`http://127.0.0.1:3000/posts`、`http://127.0.0.1:3000/posts/1`发出`GET`请求,查看结果。
(6)向`http://127.0.0.1:3000/comments`发出`POST`请求。注意,数据体`Body`要选择`x-www-form-urlencoded`编码,然后依次添加下面两个字段。
```javascript
body: "hello world"
postId: 1
```
发出该请求后,再向`http://127.0.0.1:3000/comments`发出`GET`请求,查看结果。
(7) 向`http://127.0.0.1:3000/comments/2`发出`PUT`请求,数据体`Body`要选择`x-www-form-urlencoded`编码,然后添加下面的字段。
```javascript
body: "hello react"
```
发出该请求后,再向`http://127.0.0.1:3000/comments`发出`GET`请求,查看结果。
(8)向`http://127.0.0.1:3000/comments/2`发出`delete`请求。
发出该请求后,再向`http://127.0.0.1:3000/comments`发出`GET`请求,查看结果。
## Express
### 实验目的
1. 学会 Express 搭建 Web 应用的基本用法。
### 操作步骤
(1)进入`demos/express-demo`目录,命令行执行下面的命令,安装依赖。
```bash
$ cd demos/express-demo
$ npm install
```
(2)打开`app1.js`,尝试看懂这个脚本。
```javascript
var express = require('express');
var app = express();
```
上面代码调用`express`,生成一个 Web 应用的实例。
```javascript
var router = express.Router();
router.get('/', function(req, res) {
res.send('<h1>Hello World</h1>');
});
app.use('/home', router);
```
上面代码新建了一个路由对象,该对象指定访问根路由(`/`)时,返回`Hello World`。然后,将该路由加载在`/home`路径,也就是说,访问`/home`会返回`Hello World`。
`router.get`方法的第二个参数是一个回调函数,当符合指定路由的请求进来,会被这个函数处理。该函数的两个参数,`req`和`res`都是Express 内置的对象,分别表示用户的请求和 Web 服务器的回应。`res.send`方法就表示服务器回应所送出的内容。
```javascript
var port = process.env.PORT || 8080;
app.listen(port);
console.log('Magic happens on port ' + port);
```
上面代码指定了外部访问的端口,如果环境变量没有指定,则端口默认为`8080`。最后两行是启动应用,并输出一行提示文字。
(3)在命令行下,启动这个应用。
```bash
$ node app1.js
```
浏览器访问`localhost:8080/home`,看看是否输出`Hello World`。
然后,命令行下按 Ctrl + C,退出这个进程。
(4)通过环境变量,自定义启动端口。
假定我们指定必须启动在`7070`端口,命令行可以这样操作。
```bash
# Linux & Mac
$ PORT=7070 node app1.js
# windows cmd / (git cmd)
$ set PORT=7070
$ node app1.js
# windows powershell
$ $env:PORT=7070
$ node app1.js
```
浏览器就可以访问`localhost:7070/home`了。
然后,命令行下按 Ctrl + C,退出这个进程。
思考题:Node 应用能否直接在`80`端口启动?
(5)打开`app2.js`,查看新增的那个路由。
```javascript
router.get('/:name', function(req, res) {
res.send('<h1>Hello ' + req.params.name + '</h1>');
});
```
上面代码新增了一个路由,这个路由的路径是一个命名参数`:name`,可以从`req.params.name`拿到这个传入的参数。
在命令行下,启动这个应用。
```bash
$ node app2.js
```
浏览器访问`localhost:8080/home/张三`,看看是否输出`Hello 张三`。
然后,命令行下按 Ctrl + C,退出这个进程。
(6)打开`app3.js`,先查看页面头部新增的两行代码。
```javascript
var express = require('express');
var app = express();
// 新增代码...
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
// ...
```
上面代码中,`body-parser`模块的作用,是对`POST`、`PUT`、`DELETE`等 HTTP 方法的数据体进行解析。`app.use`用来将这个模块加载到当前应用。有了这两句,就可以处理`POST`、`PUT`、`DELETE`等请求了。
下面查看新增的那个路由。
```javascript
router.post('/', function (req, res) {
var name = req.body.name;
res.json({message: 'Hello ' + name});
});
```
上面代码表示,如果收到了`/`路径(实际上是`/home`路径)的`POST`请求,先从数据体拿到`name`字段,然后返回一段 JSON 信息。
在命令行下,启动这个应用。
```bash
$ node app3.js
```
然后,在 Chrome 浏览器的 Postman 插件里面,向`http://127.0.0.1:8080/home`发出一个`POST`请求。数据体的编码方法设为`x-www-form-urlencoded`,里面设置一个`name`字段,值可以随便取,假定设为`Alice`。也就是说,发出这样一个请求。
```
POST /home HTTP/1.1
Host: 127.0.0.1:8080
Content-Type: application/x-www-form-urlencoded
name=Alice
```
如果一切正常,服务器会返回一段 JSON 信息。
```javascript
{
"message": "Hello Alice"
}
```
(7)打开`app4.js`,查看在所有路由之前新增的那个函数。
```javascript
var router = express.Router();
// 新增的代码
router.use(function(req, res, next) {
console.log('There is a requesting.');
next();
});
router.get('/', function(req, res) {
// ...
```
`router.use`的作用是加载一个函数。这个函数被称为中间件,作用是在请求被路由匹配之前,先进行一些处理。上面这个中间件起到 logging 的作用,每收到一个请求,就在命令行输出一条记录。请特别注意,这个函数内部的`next()`,它代表下一个中间件,表示将处理过的请求传递给下一个中间件。这个例子只有一个中间件,就进入路由匹配处理(实际上,`bodyparser`、`router`本质都是中间件,整个 Express 的设计哲学就是不断对 HTTP 请求加工,然后返回一个 HTTP 回应)。
### 练习
1. 请增加一个中间件,服务器每次收到用户请求,会在服务器的控制台打印出收到请求的时间。
2. URL 的查询字符串,比如`localhost:8080?name=Alice`里面的`name`,可以用`req.query.name`拿到。请修改一个路由,使之可以收到查询字符串,然后输出`'Hello ' + req.query.name`。
## ESLint
### 实验目的
1. 学会使用 ESLint 进行代码检查。
### 操作步骤
(1)进入`demos/eslint-demo`目录,安装 ESLint。
```bash
$ cd demos/eslint-demo
$ npm install eslint --save-dev
```
(2)通常,我们会使用别人已经写好的代码检查规则,这里使用的是 Airbnb 公司的规则。所以,还要安装 ESLint 这个规则模块。
```bash
$ npm install eslint-plugin-import eslint-config-airbnb-base --save-dev
```
上面代码中,`eslint-plugin-import`是运行这个规则集必须的,所以也要一起安装。
(3)ESLint 的配置文件是`.eslintrc.json`,放置在项目的根目录下面。新建这个文件,在里面指定使用 Airbnb 的规则。
```javascript
{
"extends": "airbnb-base"
}
```
(4)打开项目的`package.json`,在`scripts`字段里面添加三个脚本。
```javascript
{
// ...
"scripts" : {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint **/*.js",
"lint-html": "eslint **/*.js -f html -o ./reports/lint-results.html",
"lint-fix": "eslint --fix **/*.js"
},
// ...
}
```
除了原有的`test`脚本,上面代码新定义了三个脚本,它们的作用如下。
- `lint`:检查所有`js`文件的代码
- `lint-html`:将检查结果写入一个网页文件`./reports/lint-results.html`
- `lint-fix`:自动修正某些不规范的代码
(5)运行静态检查命令。
```bash
$ npm run lint
1:5 error Unexpected var, use let or const instead no-var
2:5 warning Unexpected console statement no-console
✖ 2 problems (1 error, 1 warning)
```
正常情况下,该命令会从`index.js`脚本里面,检查出来两个错误:一个是不应该使用`var`命令,另一个是不应该在生产环境使用`console.log`方法。
(6)修正错误。
```bash
$ npm run lint-fix
```
运行上面的命令以后,再查看`index.js`,可以看到`var x = 1;`被自动改成了`const x = 1;`。这样就消除了一个错误,但是还留下一个错误。
(7)修改规则。
由于我们想要允许使用`console.log`方法,因此可以修改`.eslintrc.json`,改变`no-console`规则。请将`.eslintrc.json`改成下面的样子。
```javascript
{
"extends": "airbnb-base",
"rules": {
"no-console": "off"
}
}
```
再运行`npm run lint`,就不会报错了。
```bash
$ npm run lint
```
## Mocha
### 实验目的
1. 学会使用 Mocha 进行单元测试。
### 操作步骤
(1) 进入`demos/mocha-demo`目录,安装 Mocha 和 Chai。
```bash
$ cd demos/mocha-demo
$ npm install -D mocha
$ npm install -D chai
```
(2)打开`add.js`文件,查看源码,我们要测试的就是这个脚本。
```javascript
function add(x, y) {
return x + y;
}
module.exports = add;
```
(3)编写一个测试脚本`add.test.js`。
```javascript
var add = require('./add.js');
var expect = require('chai').expect;
describe('加法函数的测试', function() {
it('1 加 1 应该等于 2', function() {
expect(add(1, 1)).to.be.equal(2);
});
});
```
测试脚本与所要测试的源码脚本同名,但是后缀名为`.test.js`(表示测试)或者`.spec.js`(表示规格)。比如,`add.js`的测试脚本名字就是`add.test.js`。
测试脚本里面应该包括一个或多个`describe`块,每个`describe`块应该包括一个或多个`it`块。
`describe`块称为"测试套件"(test suite),表示一组相关的测试。它是一个函数,第一个参数是测试套件的名称("加法函数的测试"),第二个参数是一个实际执行的函数。
`it`块称为"测试用例"(test case),表示一个单独的测试,是测试的最小单位。它也是一个函数,第一个参数是测试用例的名称("1 加 1 应该等于 2"),第二个参数是一个实际执行的函数。
上面的测试脚本里面,有一句断言。
```javascript
expect(add(1, 1)).to.be.equal(2);
```
所谓"断言",就是判断源码的实际执行结果与预期结果是否一致,如果不一致就抛出一个错误。上面这句断言的意思是,调用`add(1, 1)`,结果应该等于`2`。
所有的测试用例(`it`块)都应该含有一句或多句的断言。它是编写测试用例的关键。断言功能由断言库来实现,Mocha本身不带断言库,所以必须先引入断言库。
```javascript
var expect = require('chai').expect;
```
断言库有很多种,Mocha并不限制使用哪一种。上面代码引入的断言库是`chai`,并且指定使用它的`expect`断言风格。
(4)打开`package.json`文件,改写`scripts`字段的`test`脚本。
```javascript
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
// 改成
"scripts": {
"test": "mocha *.test.js"
},
```
(5)命令行下,执行下面的命令,运行测试用例。
```bash
$ npm test
```
正常情况下,命令行会有提示,表示测试用例已经通过了。
### 练习
1. 请在`add.test.js`里面添加一个测试用例,测试`3`加上`-3`,`add`函数应该返回`0`。
## Nightmare
### 实验目的
1. 学会使用 Nightmare 完成功能测试。
### 操作步骤
(1)进入`./demos/nightmare-demo`目录,安装依赖。
```bash
$ cd demos/nightmare-demo
# Linux & Mac
$ env ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ npm install
# Windows
$ set ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/
$ npm install
```
注意,Nightmare 会先安装 Electron,而 Electron 的安装需要下载境外的包,有时会连不上,导致安装失败。所以,这里先设置了环境变量,指定使用国内的 Electron 源,然后才执行安装命令。
(2)查看一下浏览器自动化脚本`taobao.test.js`。
```javascript
var Nightmare = require('nightmare');
var nightmare = Nightmare({ show: true });
```
上面代码表示新建一个 Nightmare 实例,并且运行功能中,自动打开浏览器窗口。
```javascript
nightmare
.goto('https://www.taobao.com/')
.type('#q', '电视机')
.click('form[action*="/search"] [type=submit]')
.wait('#spulist-grid')
.evaluate(function () {
return document.querySelector('#spulist-grid .grid-item .info-cont')
.textContent.trim();
})
.end()
```
上面代码表示,打开淘宝首页,在搜索框键入`电视机`,点击“搜索”按钮,等待`#spulist-grid`元素出现,在页面内注入(`evaluate`)代码,将执行结果返回。
```javascript
.then(function (result) {
console.log(result);
})
.catch(function (error) {
console.error('Search failed:', error);
});
```
Nightmare 会返回一个 Promise 对象,`then`方法指定操作成功的回调函数,`catch`方法指定操作失败的回调函数。
(3)命令行下运行这个示例脚本。
```bash
$ node taobao.test.js
```
正常情况下,运行结束后,命令行会显示淘宝“电视机”搜索结果的第一项。
(4)浏览器打开`index.html`文件,这是 React 练习时做过的一个例子,点击`Hello World`,标题会变成`Hello Clicked`。我们就要编写测试脚本,测试这个功能。
(5)打开测试脚本`test.js`。
```javascript
var Nightmare = require('nightmare');
var expect = require('chai').expect;
var fork = require('child_process').fork;
describe('test index.html', function() {
var child;
before(function (done) {
child = fork('./server.js');
child.on('message', function (msg) {
if (msg === 'listening') {
done();
}
});
});
after(function () {
child.kill();
});
```
上面代码中,`before`和`after`是 Mocha 提供的两个钩子方法,分别在所有测试开始前和结束后运行。这里,我们在`before`方法里面,新建一个子进程,用来启动 HTTP 服务器;测试结束后,再杀掉这个子进程。
注意,`before`方法的参数是一个函数,它接受`done`作为参数。`done`是 Mocha 提供的一个函数,用来表示异步操作完成。如果不调用`done`,Mocha 就会认为异步操作没有结束,一直停在这一步,不往下执行,从而导致超时错误。
子进程脚本`server.js`的代码非常简单,只有四行。
```javascript
var httpServer = require('http-server');
var server = httpServer.createServer();
server.listen(8080);
process.send('listening');
```
上面代码中,我们在`8080`端口启动 HTTP 服务器,然后向父进程发消息,表示启动完成。
(6)真正的自动化测试脚本如下。
```javascript
it('点击后标题改变', function(done) {
var nightmare = Nightmare({ show: true });
nightmare
.goto('http://127.0.0.1:8080/index.html')
.click('h1')
.wait(1000)
.evaluate(function () {
return document.querySelector('h1').textContent;
})
.end()
.then(function(text) {
expect(text).to.equal('Hello Clicked');
done();
})
});
```
上面代码中,首先打开网页,点击`h1`元素,然后等待 1 秒钟,注入脚本获取`h1`元素的文本内容。接着,在`then`方法里面,做一个断言,判断获取的文本是否正确。
(7)运行这个测试脚本。
```bash
$ npm test
```
如果一切正常,命令行下会显示测试通过。
### 练习
1. 请写一个测试用例,验证`<h1>`的字体颜色是红色。(提示:可以使用`Window.getComputedStyle()`方法,获取元素的最终样式。)
## Travis CI
### 实验目的
1. 了解持续集成的做法,学会使用 Travis CI。
### 操作步骤
(1)注册 [Github](https://github.com) 的账户。如果你已经注册过,跳过这一步。
(2)访问这个代码库[`github.com/ruanyf/travis-ci-demo`](https://github.com/ruanyf/travis-ci-demo),点击右上角的`Fork`按钮,将它克隆到你自己的空间里面。
(3)将你`fork`的代码库,克隆到本地。注意,要将下面网址之中的`[your_username]`改成你的 Github 用户名。
```bash
// Linux & Mac
$ git clone git@github.com:[your_username]/travis-ci-demo.git
// Windows
$ git clone https://github.com:[your_username]/travis-ci-demo
```
(4)使用你的 Github 账户,登录 [Travis CI](https://travis-ci.org/auth) 的首页。然后,访问 [Profile](https://travis-ci.org/profile) 页面,选定`travis-ci-demo`代码库运行自动构建。
(5)回到命令行,进入你本地的`travis-ci-demo`目录,切换到`demo01`分支。
```bash
$ cd travis-ci-demo
$ git checkout demo01
```
项目根目录下面有一个`.travis.yml`文件,这是 Travis CI 的配置文件。如果没有这个文件,就不会触发 Travis CI 的自动构建。打开看一下。
```bash
language: node_js
node_js:
- "node"
```
上面代码指定,使用 Node 完成构建,版本是最新的稳定版。
指定 Node 的版本号也是可以的。
```javascript
language: node_js
node_js:
- "4.1"
```
上面代码指定使用 Node 4.1 版。
(6)Travis CI 默认依次执行以下九个脚本。
- `before_install`
- `install`
- `before_script`
- `script`
- `after_success` 或者 `after_failure`
- `after_script`
- `before_deploy`(可选)
- `deploy`(可选)
- `after_deploy`(可选)
用户需要用到哪个脚本,就需要提供该脚本的内容。
对于 Node 项目,以下两个脚本有默认值,可以不用自己设定。
```javascript
"install": "npm install",
"script": "npm test"
```
(7)打开当前分支的`package.json`,可以发现它的`test`脚本是一个`lint`命令。
```javascript
"scripts": {
"test": "jshint hello.js"
},
```
(8)在项目根目录下,新建一个新文件`NewUser.txt`,内容是你的用户名。提交这个文件,就会触发 Travis CI 的自动构建。
```bash
$ git add -A
$ git commit -m 'Testing Travis CI'
$ git push
```
(9)等到 Travis CI 完成自动构建,到页面上[检查](https://travis-ci.org/repositories)构建结果。
(10)切换到`demo02`分支,打开`package.json`,可以看到`test`脚本,现在需要完成两步操作了。
```javascript
"scripts": {
"lint": "jshint hello.js hello.test.js",
"test": "npm run lint && mocha hello.test.js"
},
```
(11)重复上面第 8 步和第 9 步。
### 练习
1. 修改`hello.js`,让其输出`Hello Node`。并修改测试用例`hello.test.js`,使之能够通过 Travis CI 的自动构建。
================================================
FILE: demos/angular-demo/index.html
================================================
<!DOCTYPE html>
<html>
<meta charset="UTF-8"/>
<script src="angular.1.4.8.min.js"></script>
<body>
<div ng-app="">
<p>姓名 : <input type="text" ng-model="name" placeholder="在这里输入您的大名"></p>
<h1>你好,{{name}}</h1>
</div>
</body>
</html>
================================================
FILE: demos/backbone-demo/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Backbone Demo</title>
</head>
<body>
<h1>Backbone Routing Demo</h1>
<ul id="menu">
<li><a href="#">Index</a></li>
<li><a href="#show/1">Show</a></li>
<li><a href="#download/1">Download</a></li>
<li><a href="#search/1">Search</a></li>
<li><a href="#other">Other</a></li>
</ul>
<script src="js/underscore.js"></script>
<script src="js/jquery.js"></script>
<script src="js/backbone.js"></script>
<script src="js/main.js"></script>
</body>
</html>
================================================
FILE: demos/backbone-demo/js/backbone.js
================================================
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
!1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
================================================
FILE: demos/backbone-demo/js/jquery.js
================================================
/*!
* jQuery JavaScript Library v1.8.2
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
*/
(function( window, undefined ) {
var
// A central reference to the root jQuery(document)
rootjQuery,
// The deferred used on DOM ready
readyList,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
navigator = window.navigator,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// Save a reference to some core methods
core_push = Array.prototype.push,
core_slice = Array.prototype.slice,
core_indexOf = Array.prototype.indexOf,
core_toString = Object.prototype.toString,
core_hasOwn = Object.prototype.hasOwnProperty,
core_trim = String.prototype.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
// Used for detecting and trimming whitespace
core_rnotwhite = /\S/,
core_rspace = /\s+/,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + "" ).toUpperCase();
},
// The ready event handler and self cleanup method
DOMContentLoaded = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
} else if ( document.readyState === "complete" ) {
// we're here because readyState === "complete" in oldIE
// which is good enough for us to call the dom ready!
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
},
// [[Class]] -> type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
// Handle $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
doc = ( context && context.nodeType ? context.ownerDocument || context : document );
// scripts is true for back-compat
selector = jQuery.parseHTML( match[1], doc, true );
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
this.attr.call( selector, context, true );
}
return jQuery.merge( this, selector );
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.8.2",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
eq: function( i ) {
i = +i;
return i === -1 ?
this.slice( i ) :
this.slice( i, i + 1 );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
slice: function() {
return this.pushStack( core_slice.apply( this, arguments ),
"slice", core_slice.call(arguments).join(",") );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
isWindow: function( obj ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ core_toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
try {
// Not own constructor property must be Object
if ( obj.constructor &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// scripts (optional): If true, will include scripts passed in the html string
parseHTML: function( data, context, scripts ) {
var parsed;
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
scripts = context;
context = 0;
}
context = context || document;
// Single tag
if ( (parsed = rsingleTag.exec( data )) ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
return jQuery.merge( [],
(parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
},
parseJSON: function( data ) {
if ( !data || typeof data !== "string") {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} else { // IE
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch( e ) {
xml = undefined;
}
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && core_rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
each: function( obj, callback, args ) {
var name,
i = 0,
length = obj.length,
isObj = length === undefined || jQuery.isFunction( obj );
if ( args ) {
if ( isObj ) {
for ( name in obj ) {
if ( callback.apply( obj[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( obj[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in obj ) {
if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
break;
}
}
}
}
return obj;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var type,
ret = results || [];
if ( arr != null ) {
// The window, strings (and functions) also have 'length'
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
type = jQuery.type( arr );
if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
core_push.call( ret, arr );
} else {
jQuery.merge( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
},
merge: function( first, second ) {
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value, key,
ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( key in elems ) {
value = callback( elems[ key ], key, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return ret.concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var tmp, args, proxy;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
var exec,
bulk = key == null,
i = 0,
length = elems.length;
// Sets many values
if ( key && typeof key === "object" ) {
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
}
chainable = 1;
// Sets one value
} else if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = pass === undefined && jQuery.isFunction( value );
if ( bulk ) {
// Bulk operations only iterate when executing function values
if ( exec ) {
exec = fn;
fn = function( elem, key, value ) {
return exec.call( jQuery( elem ), value );
};
// Otherwise they run against the entire set
} else {
fn.call( elems, value );
fn = null;
}
}
if ( fn ) {
for (; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
}
chainable = 1;
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
}
});
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready, 1 );
// Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch(e) {}
if ( top && top.doScroll ) {
(function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left");
} catch(e) {
return setTimeout( doScrollCheck, 50 );
}
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.split( core_rspace ), function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {
list.push( arg );
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Control if a given callback is in the list
has: function( fn ) {
return jQuery.inArray( fn, list ) > -1;
},
// Remove all callbacks from the list
empty: function() {
list = [];
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
jQuery.extend({
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
[ "notify", "progress", jQuery.Callbacks("memory") ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
then: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
fn = fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
function() {
var returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.done( newDefer.resolve )
.fail( newDefer.reject )
.progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
}
} :
newDefer[ action ]
);
});
fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Keep pipe for back-compat
promise.pipe = promise.then;
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 3 ];
// promise[ done | fail | progress ] = list.add
promise[ tuple[1] ] = list.add;
// Handle state
if ( stateString ) {
list.add(function() {
// state = [ resolved | rejected ]
state = stateString;
// [ reject_list | resolve_list ].disable; progress_list.lock
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
}
// deferred[ resolve | reject | notify ] = list.fire
deferred[ tuple[0] ] = list.fire;
deferred[ tuple[0] + "With" ] = list.fireWith;
});
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = core_slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
// Update function for both resolve and progress values
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
if( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
}
};
},
progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
progressValues = new Array( length );
progressContexts = new Array( length );
resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) )
.fail( deferred.reject )
.progress( updateFunc( i, progressContexts, progressValues ) );
} else {
--remaining;
}
}
}
// if we're not waiting on anything, resolve the master
if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues );
}
return deferred.promise();
}
});
jQuery.support = (function() {
var support,
all,
a,
select,
opt,
input,
fragment,
eventName,
i,
isSupported,
clickFn,
div = document.createElement("div");
// Preliminary tests
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
// Can't get basic test support
if ( !all || !all.length ) {
return {};
}
// First batch of supports tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: ( a.getAttribute("href") === "/a" ),
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: ( input.value === "on" ),
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// Tests for enctype support on a form(#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: ( document.compatMode === "CSS1Compat" ),
// Will be defined later
submitBubbles: true,
changeBubbles: true,
focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( "onclick", clickFn = function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
});
div.cloneNode( true ).fireEvent("onclick");
div.detachEvent( "onclick", clickFn );
}
// Check if a radio maintains its value
// after being appended to the DOM
input = document.createElement("input");
input.value = "t";
input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t";
input.setAttribute( "checked", "checked" );
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "name", "t" );
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
fragment.removeChild( input );
fragment.appendChild( div );
// Technique from Juriy Zaytsev
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for ( i in {
submit: true,
change: true,
focusin: true
}) {
eventName = "on" + i;
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, "return;" );
isSupported = ( typeof div[ eventName ] === "function" );
}
support[ i + "Bubbles" ] = isSupported;
}
}
// Run tests that need a body at doc ready
jQuery(function() {
var container, div, tds, marginDiv,
divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
body.insertBefore( container, body.firstChild );
// Construct the test element
div = document.createElement("div");
container.appendChild( div );
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Check if empty table cells still have offsetWidth/Height
// (IE <= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// NOTE: To any future maintainer, we've window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = document.createElement("div");
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
div.appendChild( marginDiv );
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== "undefined" ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "block";
div.style.overflow = "visible";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
container.style.zoom = 1;
}
// Null elements to avoid leaks in IE
body.removeChild( container );
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
fragment.removeChild( div );
all = a = select = opt = input = fragment = div = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
jQuery.extend({
cache: {},
deletedIds: [],
// Remove at next major release (1.9/2.0)
uuid: 0,
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ] = jQuery.extend( cache[ id ], name );
} else {
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
}
}
thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// data.
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
}
} else {
ret = thisCache;
}
return ret;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, i, l,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
thisCache = pvt ? cache[ id ] : cache[ id ].data;
if ( thisCache ) {
// Support array or space separated string names for data keys
if ( !jQuery.isArray( name ) ) {
// try the string as a key before any manipulation
if ( name in thisCache ) {
name = [ name ];
} else {
// split the camel cased version by spaces unless a key with the spaces exists
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split(" ");
}
}
}
for ( i = 0, l = name.length; i < l; i++ ) {
delete thisCache[ name[i] ];
}
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
return;
}
}
}
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].data;
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject( cache[ id ] ) ) {
return;
}
}
// Destroy the cache
if ( isNode ) {
jQuery.cleanData( [ elem ], true );
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
},
// For internal use only.
_data: function( elem, name, data ) {
return jQuery.data( elem, name, data, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var parts, part, attr, name, l,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attr = elem.attributes;
for ( l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( elem, name, data[ name ] );
}
}
jQuery._data( elem, "parsedAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
parts = key.split( ".", 2 );
parts[1] = parts[1] ? "." + parts[1] : "";
part = parts[1] + "!";
return jQuery.access( this, function( value ) {
if ( value === undefined ) {
data = this.triggerHandler( "getData" + part, [ parts[0] ] );
// Try to fetch any internally stored data first
if ( data === undefined && elem ) {
data = jQuery.data( elem, key );
data = dataAttr( elem, key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
}
parts[1] = value;
this.each(function() {
var self = jQuery( this );
self.triggerHandler( "setData" + part, parts );
jQuery.data( this, key, value );
self.triggerHandler( "changeData" + part, parts );
});
}, null, value, arguments.length > 1, null, false );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
var name;
for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
jQuery.extend({
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray(data) ) {
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// not intended for public consumption - generates a queueHooks object, or returns the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
jQuery.removeData( elem, type + "queue", true );
jQuery.removeData( elem, key, true );
})
});
}
});
jQuery.fn.extend({
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
return data === undefined ?
this :
this.each(function() {
var queue = jQuery.queue( this, type, data );
// ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while( i-- ) {
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
});
var nodeHook, boolHook, fixSpecified,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea|)$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classNames, i, l, elem,
setClass, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
classNames = value.split( core_rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 ) {
if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
var removes, className, elem, c, cl, i, l;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
removes = ( value || "" ).split( core_rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
className = (" " + elem.className + " ").replace( rclass, " " );
// loop over each item in the removal list
for ( c = 0, cl = removes.length; c < cl; c++ ) {
// Remove until there is nothing to remove,
while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
className = className.replace( " " + removes[ c ] + " " , " " );
}
}
elem.className = value ? jQuery.trim( className ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( core_rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
return false;
},
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, i, max, option,
index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
i = one ? index : 0;
max = one ? index + 1 : options.length;
for ( ; i < max; i++ ) {
option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
if ( one && !values.length && options.length ) {
return jQuery( options[ index ] ).val();
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
// Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
attrFn: {},
attr: function( elem, name, value, pass ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
return jQuery( elem )[ name ]( value );
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === "undefined" ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
return;
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return ret === null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var propName, attrNames, name, isBool,
i = 0;
if ( value && elem.nodeType === 1 ) {
attrNames = value.split( core_rspace );
for ( ; i < attrNames.length; i++ ) {
name = attrNames[ i ];
if ( name ) {
propName = jQuery.propFix[ name ] || name;
isBool = rboolean.test( name );
// See #9699 for explanation of this approach (setting first, then removal)
// Do not do this for boolean attributes (see #10870)
if ( !isBool ) {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
// Set corresponding property to false for boolean attributes
if ( isBool && propName in elem ) {
elem[ propName ] = false;
}
}
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
},
// Use the value property for back compat
// Use the nodeHook for button elements in IE6/7 (#1954)
value: {
get: function( elem, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.get( elem, name );
}
return name in elem ?
elem.value :
null;
},
set: function( elem, value, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.set( elem, value, name );
}
// Does not return so that setAttribute is also used
elem.value = value;
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
// Align boolean attributes with corresponding properties
// Fall back to attribute presence where some booleans are not supported
var attrNode,
property = jQuery.prop( elem, name );
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
var propName;
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
// value is true since we know at this point it's type boolean and not false
// Set boolean attributes to the same name and set the DOM property
propName = jQuery.propFix[ name ] || name;
if ( propName in elem ) {
// Only set the IDL specifically if it already exists on the element
elem[ propName ] = true;
}
elem.setAttribute( name, name.toLowerCase() );
}
return name;
}
};
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
fixSpecified = {
name: true,
id: true,
coords: true
};
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
ret = document.createAttribute( name );
elem.setAttributeNode( ret );
}
return ( ret.value = value + "" );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
if ( value === "" ) {
value = "false";
}
nodeHook.set( elem, value, name );
}
};
}
// Some attributes require a special call on IE
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret === null ? undefined : ret;
}
});
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Normalize to lowercase since IE uppercases css property names
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
return null;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:textarea|input|select)$/i,
rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
hoverHack = function( events ) {
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
};
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, handlers, special;
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
events = elemData.events;
if ( !events ) {
elemData.events = events = {};
}
eventHandle = elemData.handle;
if ( !eventHandle ) {
elemData.handle = eventHandle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = jQuery.trim( hoverHack(types) ).split( " " );
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = tns[1];
namespaces = ( tns[2] || "" ).split( "." ).sort();
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: tns[1],
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
handlers = events[ type ];
if ( !handlers ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener/attachEvent if the special events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var t, tns, type, origType, namespaces, origCount,
j, events, special, eventType, handleObj,
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = origType = tns[1];
namespaces = tns[2];
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector? special.delegateType : special.bindType ) || type;
eventType = events[ type ] || [];
origCount = eventType.length;
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
// Remove matching events
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
eventType.splice( j--, 1 );
if ( handleObj.selector ) {
eventType.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( eventType.length === 0 && origCount !== eventType.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
delete elemData.handle;
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery.removeData( elem, "events", true );
}
},
// Events that are safe to short-circuit if no handlers are attached.
// Native DOM events should not be added, they may have inline handlers.
customEvent: {
"getData": true,
"setData": true,
"changeData": true
},
trigger: function( event, data, elem, onlyHandlers ) {
// Don't do events on text and comment nodes
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
return;
}
// Event object or event type
var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
type = event.type || event,
namespaces = [];
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf( "!" ) >= 0 ) {
// Exclusive events trigger only for the exact event (no namespaces)
type = type.slice(0, -1);
exclusive = true;
}
if ( type.indexOf( "." ) >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
// No jQuery handlers for this event type, and it can't have inline handlers
return;
}
// Caller can pass in an Event, Object, or just an event type string
event = typeof event === "object" ?
// jQuery.Event object
event[ jQuery.expando ] ? event :
// Object literal
new jQuery.Event( type, event ) :
// Just the event type (string)
new jQuery.Event( type );
event.type = type;
event.isTrigger = true;
event.exclusive = exclusive;
event.namespace = namespaces.join( "." );
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
// Handle a global trigger
if ( !elem ) {
// TODO: Stop taunting the data cache; remove global events and always attach to document
cache = jQuery.cache;
for ( i in cache ) {
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
}
}
return;
}
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data != null ? jQuery.makeArray( data ) : [];
data.unshift( event );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
eventPath = [[ elem, special.bindType || type ]];
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
for ( old = elem; cur; cur = cur.parentNode ) {
eventPath.push([ cur, bubbleType ]);
old = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( old === (elem.ownerDocument || document) ) {
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
}
}
// Fire handlers on the event path
for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
cur = eventPath[i][0];
event.type = eventPath[i][1];
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Note that this is a bare JS function and not a jQuery handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
// IE<9 dies on focus/blur to hidden element (#1486)
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
if ( old ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
elem[ type ]();
jQuery.event.triggered = undefined;
if ( old ) {
elem[ ontype ] = old;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
args = core_slice.call( arguments ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {},
handlerQueue = [];
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers that should run if there are delegated events
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !(event.button && event.type === "click") ) {
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.disabled !== true || event.type !== "click" ) {
selMatch = {};
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) {
selMatch[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, matches: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( handlers.length > delegateCount ) {
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
}
// Run delegates first; they may want to stop propagation beneath us
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
matched = handlerQueue[ i ];
event.currentTarget = matched.elem;
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
handleObj = matched.matches[ j ];
// Triggered event must either 1) be non-exclusive and have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
event.data = handleObj.data;
event.handleObj = handleObj;
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
.apply( matched.elem, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
// Includes some event props shared by KeyEvent and MouseEvent
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function( event, original ) {
var eventDoc, doc, body,
button = original.button,
fromElement = original.fromElement;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && fromElement ) {
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop,
originalEvent = event,
fixHook = jQuery.event.fixHooks[ event.type ] || {},
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = jQuery.Event( originalEvent );
for ( i = copy.length; i; ) {
prop = copy[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Target should not be a text node (#504, Safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
event.metaKey = !!event.metaKey;
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
focus: {
delegateType: "focusin"
},
blur: {
delegateType: "focusout"
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
var e = jQuery.extend(
new jQuery.Event(),
event,
{ type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
// Some plugins are using, but it's undocumented/deprecated and will be removed.
// The 1.7 special event interface should provide all the hooks needed now.
jQuery.event.handle = jQuery.event.dispatch;
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
var name = "on" + type;
if ( elem.detachEvent ) {
// #8545, #7054, preventing memory leaks for custom events in IE6-8 –
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if ( typeof elem[ name ] === "undefined" ) {
elem[ name ] = null;
}
elem.detachEvent( name, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !(this instanceof jQuery.Event) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj,
selector = handleObj.selector;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
});
// IE submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !jQuery._data( form, "_submit_attached" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submit_bubble = true;
});
jQuery._data( form, "_submit_attached", true );
}
});
// return undefined since we don't need an event listener
},
postDispatch: function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( event._submit_bubble ) {
delete event._submit_bubble;
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
}
},
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery.event.remove( this, "._submit" );
}
};
}
// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if ( this.type === "checkbox" || this.type === "radio" ) {
jQuery.event.add( this, "propertychange._change", function( event ) {
if ( event.originalEvent.propertyName === "checked" ) {
this._just_changed = true;
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
}
// Allow triggered, simulated change events (#11500)
jQuery.event.simulate( "change", this, event, true );
});
}
return false;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
jQuery._data( elem, "_change_attached", true );
}
});
},
handle: function( event ) {
var elem = event.target;
// Swallow native change events from checkbox/radio, we already triggered them above
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
return event.handleObj.handler.apply( this, arguments );
}
},
teardown: function() {
jQuery.event.remove( this, "._change" );
return !rformElems.test( this.nodeName );
}
};
}
// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) { // && selector != null
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
live: function( types, data, fn ) {
jQuery( this.context ).on( types, this.selector, data, fn );
return this;
},
die: function( types, fn ) {
jQuery( this.context ).off( types, this.selector || "**", fn );
return this;
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
return jQuery.event.trigger( type, data, this[0], true );
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments,
guid = fn.guid || jQuery.guid++,
i = 0,
toggler = function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
};
// link all the functions, so any of them can unbind this click handler
toggler.guid = guid;
while ( i < args.length ) {
args[ i++ ].guid = guid;
}
return this.click( toggler );
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
if ( fn == null ) {
fn = data;
data = null;
}
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var cachedruns,
assertGetIdNotName,
Expr,
getText,
isXML,
contains,
compile,
sortOrder,
hasDuplicate,
outermostContext,
baseHasDuplicate = true,
strundefined = "undefined",
expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
Token = String,
document = window.document,
docElem = document.documentElement,
dirruns = 0,
done = 0,
pop = [].pop,
push = [].push,
slice = [].slice,
// Use a stripped-down indexOf if a native one is unavailable
indexOf = [].indexOf || function( elem ) {
var i = 0,
len = this.length;
for ( ; i < len; i++ ) {
if ( this[i] === elem ) {
return i;
}
}
return -1;
},
// Augment a function for special use by Sizzle
markFunction = function( fn, value ) {
fn[ expando ] = value == null || value;
return fn;
},
createCache = function() {
var cache = {},
keys = [];
return markFunction(function( key, value ) {
// Only keep the most recent entries
if ( keys.push( key ) > Expr.cacheLength ) {
delete cache[ keys.shift() ];
}
return (cache[ key ] = value);
}, cache );
},
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// Regex
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/css3-syntax/#characters
characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
// Loosely modeled on CSS identifier characters
// An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments not in parens/brackets,
// then attribute selectors and non-pseudos (denoted by :),
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
// For matchExpr.POS and matchExpr.needsContext
pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
rnot = /^:not/,
rsibling = /[\x20\t\r\n\f]*[+~]/,
rendsWithNot = /:not\($/,
rheader = /h\d/i,
rinputs = /input|select|textarea|button/i,
rbackslash = /\\(?!\\)/g,
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"POS": new RegExp( pos, "i" ),
"CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is()
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
},
// Support
// Used for testing something on an element
assert = function( fn ) {
var div = document.createElement("div");
try {
return fn( div );
} catch (e) {
return false;
} finally {
// release memory in IE
div = null;
}
},
// Check if getElementsByTagName("*") returns only elements
assertTagNameNoComments = assert(function( div ) {
div.appendChild( document.createComment("") );
return !div.getElementsByTagName("*").length;
}),
// Check if getAttribute returns normalized href attributes
assertHrefNotNormalized = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}),
// Check if attributes should be retrieved by attribute nodes
assertAttributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
}),
// Check if getElementsByClassName can be trusted
assertUsableClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
}),
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
assertUsableName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = document.getElementsByName &&
// buggy browsers will return fewer than the correct 2
document.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
document.getElementsByName( expando + 0 ).length;
assertGetIdNotName = !document.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// If slice is not available, provide a backup
try {
slice.call( docElem.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
for ( ; (elem = this[i]); i++ ) {
results.push( elem );
}
return results;
};
}
function Sizzle( selector, context, results, seed ) {
results = results || [];
context = context || document;
var match, elem, xml, m,
nodeType = context.nodeType;
if ( !selector || typeof selector !== "string" ) {
return results;
}
if ( nodeType !== 1 && nodeType !== 9 ) {
return [];
}
xml = isXML( context );
if ( !xml && !seed ) {
if ( (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
elem = context.getElementById( m );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
} else {
// Context is not a document
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
contains( context, elem ) && elem.id === m ) {
results.push( elem );
return results;
}
}
// Speed-up: Sizzle("TAG")
} else if ( match[2] ) {
push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
}
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
return Sizzle( expr, null, null, [ elem ] ).length > 0;
};
// Returns a function to use in pseudos for input types
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
// Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
}
// Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ (j = matchIndexes[i]) ] ) {
seed[j] = !(matches[j] = seed[j]);
}
}
});
});
}
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( nodeType ) {
if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
} else {
// If no nodeType, this is expected to be an array
for ( ; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
ret += getText( node );
}
}
return ret;
};
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
// Element contains another
contains = Sizzle.contains = docElem.contains ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
} :
docElem.compareDocumentPosition ?
function( a, b ) {
return b && !!( a.compareDocumentPosition( b ) & 16 );
} :
function( a, b ) {
while ( (b = b.parentNode) ) {
if ( b === a ) {
return true;
}
}
return false;
};
Sizzle.attr = function( elem, name ) {
var val,
xml = isXML( elem );
if ( !xml ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( xml || assertAttributes ) {
return elem.getAttribute( name );
}
val = elem.getAttributeNode( name );
return val ?
typeof elem[ name ] === "boolean" ?
elem[ name ] ? name : null :
val.specified ? val.value : null :
null;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
// IE6/7 return a modified href
attrHandle: assertHrefNotNormalized ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
},
find: {
"ID": assertGetIdNotName ?
function( id, context, xml ) {
if ( typeof context.getElementById !== strundefined && !xml ) {
var m = context.getElementById( id );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
} :
function( id, context, xml ) {
if ( typeof context.getElementById !== strundefined && !xml ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
},
"TAG": assertTagNameNoComments ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== strundefined ) {
return context.getElementsByTagName( tag );
}
} :
function( tag, context ) {
var results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
var elem,
tmp = [],
i = 0;
for ( ; (elem = results[i]); i++ ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
},
"NAME": assertUsableName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
},
"CLASS": assertUsableClassName && function( className, context, xml ) {
if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
return context.getElementsByClassName( className );
}
}
},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[1] = match[1].replace( rbackslash, "" );
// Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
3 xn-component of xn+y argument ([+-]?\d*n|)
4 sign of xn-component
5 x of xn-component
6 sign of y-component
7 y of y-component
*/
match[1] = match[1].toLowerCase();
if ( match[1] === "nth" ) {
// nth-child requires argument
if ( !match[2] ) {
Sizzle.error( match[0] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
// other types prohibit arguments
} else if ( match[2] ) {
Sizzle.error( match[0] );
}
return match;
},
"PSEUDO": function( match ) {
var unquoted, excess;
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
if ( match[3] ) {
match[2] = match[3];
} else if ( (unquoted = match[4]) ) {
// Only check arguments that contain a pseudo
if ( rpseudo.test(unquoted) &&
// Get excess from tokenize (recursively)
(excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
// excess is a negative index
unquoted = unquoted.slice( 0, excess );
match[0] = match[0].slice( 0, excess );
}
match[2] = unquoted;
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"ID": assertGetIdNotName ?
function( id ) {
id = id.replace( rbackslash, "" );
return function( elem ) {
return elem.getAttribute("id") === id;
};
} :
function( id ) {
id = id.replace( rbackslash, "" );
return function( elem ) {
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
return node && node.value === id;
};
},
"TAG": function( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
return function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ expando ][ className ];
if ( !pattern ) {
pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
}
return function( elem ) {
return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
};
},
"ATTR": function( name, operator, check ) {
return function( elem, context ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.substr( result.length - check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
false;
};
},
"CHILD": function( type, argument, first, last ) {
if ( type === "nth" ) {
return function( elem ) {
var node, diff,
parent = elem.parentNode;
if ( first === 1 && last === 0 ) {
return true;
}
if ( parent ) {
diff = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
diff++;
if ( elem === node ) {
break;
}
}
}
}
// Incorporate the offset (or cast to NaN), then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
};
}
return function( elem ) {
var node = elem;
switch ( type ) {
case "only":
case "first":
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
/* falls through */
case "last":
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction(function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf.call( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
"not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction(function( seed, matches, context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( (elem = unmatched[i]) ) {
seed[i] = !(matches[i] = elem);
}
}
}) :
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
return !results.pop();
};
}),
"has": markFunction(function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
}),
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
"enabled": function( elem ) {
return elem.disabled === false;
},
"disabled": function( elem ) {
return elem.disabled === true;
},
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
"parent": function( elem ) {
return !Expr.pseudos["empty"]( elem );
},
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
var nodeType;
elem = elem.firstChild;
while ( elem ) {
if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
return false;
}
elem = elem.nextSibling;
}
return true;
},
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"text": function( elem ) {
var type, attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
(type = elem.type) === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
},
// Input types
"radio": createInputPseudo("radio"),
"checkbox": createInputPseudo("checkbox"),
"file": createInputPseudo("file"),
"password": createInputPseudo("password"),
"image": createInputPseudo("image"),
"submit": createButtonPseudo("submit"),
"reset": createButtonPseudo("reset"),
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"focus": function( elem ) {
var doc = elem.ownerDocument;
return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
},
"active": function( elem ) {
return elem === elem.ownerDocument.activeElement;
},
// Positional types
"first": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ 0 ];
}),
"last": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ length - 1 ];
}),
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
}),
"even": createPositionalPseudo(function( matchIndexes, length, argument ) {
for ( var i = 0; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
for ( var i = 1; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
})
}
};
function siblingCheck( a, b, ret ) {
if ( a === b ) {
return ret;
}
var cur = a.nextSibling;
while ( cur ) {
if ( cur === b ) {
return -1;
}
cur = cur.nextSibling;
}
return 1;
}
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
a.compareDocumentPosition :
a.compareDocumentPosition(b) & 4
) ? -1 : 1;
} :
function( a, b ) {
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;
}
var al, bl,
ap = [],
bp = [],
aup = a.parentNode,
bup = b.parentNode,
cur = aup;
// If the nodes are siblings (or identical) we can do a quick check
if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
} else if ( !aup ) {
return -1;
} else if ( !bup ) {
return 1;
}
// Otherwise they're somewhere else in the tree so we need
// to build up a full list of the parentNodes for comparison
while ( cur ) {
ap.unshift( cur );
cur = cur.parentNode;
}
cur = bup;
while ( cur ) {
bp.unshift( cur );
cur = cur.parentNode;
}
al = ap.length;
bl = bp.length;
// Start walking down the tree looking for a discrepancy
for ( var i = 0; i < al && i < bl; i++ ) {
if ( ap[i] !== bp[i] ) {
return siblingCheck( ap[i], bp[i] );
}
}
// We ended someplace up the tree so do a sibling check
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
[0, 0].sort( sortOrder );
baseHasDuplicate = !hasDuplicate;
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
i = 1;
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
return results;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type, soFar, groups, preFilters,
cached = tokenCache[ expando ][ selector ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
soFar = soFar.slice( match[0].length );
}
groups.push( tokens = [] );
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
tokens.push( matched = new Token( match.shift() ) );
soFar = soFar.slice( matched.length );
// Cast descendant combinators to space
matched.type = match[0].replace( rtrim, " " );
}
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
// The last two arguments here are (context, xml) for backCompat
(match = preFilters[ type ]( match, document, true ))) ) {
tokens.push( matched = new Token( match.shift() ) );
soFar = soFar.slice( matched.length );
matched.type = type;
matched.matches = match;
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && combinator.dir === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( checkNonElements || elem.nodeType === 1 ) {
return matcher( elem, context, xml );
}
}
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
if ( !xml ) {
var cache,
dirkey = dirruns + " " + doneName + " ",
cachedkey = dirkey + cachedruns;
while ( (elem = elem[ dir ]) ) {
if ( checkNonElements || elem.nodeType === 1 ) {
if ( (cache = elem[ expando ]) === cachedkey ) {
return elem.sizset;
} else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
if ( elem.sizset ) {
return elem;
}
} else {
elem[ expando ] = cachedkey;
if ( matcher( elem, context, xml ) ) {
elem.sizset = true;
return elem;
}
elem.sizset = false;
}
}
}
} else {
while ( (elem = elem[ dir ]) ) {
if ( checkNonElements || elem.nodeType === 1 ) {
if ( matcher( elem, context, xml ) ) {
return elem;
}
}
}
}
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
// Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
if ( seed && postFinder ) {
return;
}
var i, elem, postFilterIn,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
postFilterIn = condense( matcherOut, postMap );
postFilter( postFilterIn, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = postFilterIn.length;
while ( i-- ) {
if ( (elem = postFilterIn[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
// Keep seed and results synchronized
if ( seed ) {
// Ignore postFinder because it can't coexist with seed
i = preFilter && matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) ) {
seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
}
}
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
});
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
} ];
for ( ; i < len; i++ ) {
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
} else {
// The concatenated values are (context, xml) for backCompat
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
j < len && tokens.join("")
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Nested matchers should use non-integer dirruns
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = superMatcher.el;
}
// Add elements passing elementMatchers directly to results
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++superMatcher.el;
}
}
// Track unmatched elements for set filters
if ( bySet ) {
// They will have gone through all possible matchers
if ( (elem = !matcher && elem) ) {
matchedCount--;
}
// Lengthen the array for every element, matched or not
if ( seed ) {
unmatched.push( elem );
}
}
}
// Apply set filters to unmatched elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
for ( j = 0; (matcher = setMatchers[j]); j++ ) {
matcher( unmatched, setMatched, context, xml );
}
if ( seed ) {
// Reintegrate element matches to eliminate the need for sorting
if ( matchedCount > 0 ) {
while ( i-- ) {
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
}
}
// Discard index placeholder values to get only actual matches
setMatched = condense( setMatched );
}
// Add matches to results
push.apply( results, setMatched );
// Seedless set matches succeeding multiple successful matchers stipulate sorting
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
Sizzle.uniqueSort( results );
}
}
// Override manipulation of globals by nested matchers
if ( outermost ) {
dirruns = dirrunsUnique;
outermostContext = contextBackup;
}
return unmatched;
};
superMatcher.el = 0;
return bySet ?
markFunction( superMatcher ) :
superMatcher;
}
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
cached = compilerCache[ expando ][ selector ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
if ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results, seed ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results, seed );
}
return results;
}
function select( selector, context, results, seed, xml ) {
var i, tokens, token, type, find,
match = tokenize( selector ),
j = match.length;
if ( !seed ) {
// Try to minimize operations if there is only one group
if ( match.length === 1 ) {
// Take a shortcut and set the context if the root selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && !xml &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().length );
}
// Fetch a seed set for right-to-left matching
for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( rbackslash, "" ),
rsibling.test( tokens[0].type ) && context.parentNode || context,
xml
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && tokens.join("");
if ( !selector ) {
push.apply( results, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
xml,
results,
rsibling.test( selector )
);
return results;
}
if ( document.querySelectorAll ) {
(function() {
var disconnectedMatch,
oldSelect = select,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// qSa(:focus) reports false when true (Chrome 21),
// A support test would require too much code (would include document ready)
rbuggyQSA = [":focus"],
// matchesSelector(:focus) reports false when true (Chrome 21),
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
// A support test would require too much code (would include document ready)
// just skip matchesSelector for :active
rbuggyMatches = [ ":active", ":focus" ],
matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector;
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert(function( div ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here (do not put tests after this one)
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
});
assert(function( div ) {
// Opera 10-12/IE9 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<p test=''></p>";
if ( div.querySelectorAll("[test^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here (do not put tests after this one)
div.innerHTML = "<input type='hidden'/>";
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push(":enabled", ":disabled");
}
});
// rbuggyQSA always contains :focus, so no need for a length check
rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
select = function( selector, context, results, seed, xml ) {
// Only use querySelectorAll when not filtering,
// when this is not xml,
// and when no QSA bugs apply
if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
var groups, i,
old = true,
nid = expando,
newContext = context,
newSelector = context.nodeType === 9 && selector;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
groups = tokenize( selector );
if ( (old = context.getAttribute("id")) ) {
nid = old.replace( rescape, "\\$&" );
} else {
context.setAttribute( "id", nid );
}
nid = "[id='" + nid + "'] ";
i = groups.length;
while ( i-- ) {
groups[i] = nid + groups[i].join("");
}
newContext = rsibling.test( selector ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
return oldSelect( selector, context, results, seed, xml );
};
if ( matches ) {
assert(function( div ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
disconnectedMatch = matches.call( div, "div" );
// This should fail with an exception
// Gecko does not error, returns false instead
try {
matches.call( div, "[test!='']:sizzle" );
rbuggyMatches.push( "!=", pseudos );
} catch ( e ) {}
});
// rbuggyMatches always contains :active and :focus, so no need for a length check
rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
Sizzle.matchesSelector = function( elem, expr ) {
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
// rbuggyMatches always contains :active, so no need for an existence check
if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch(e) {}
}
return Sizzle( expr, null, null, [ elem ] ).length > 0;
};
}
})();
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Back-compat
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, l, length, n, r, ret,
self = this;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
for ( i = 0, l = self.length; i < l; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
});
}
ret = this.pushStack( "", "find", selector );
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( n = length; n < ret.length; n++ ) {
for ( r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var i,
targets = jQuery( target, this ),
len = targets.length;
return this.filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
return this.pushStack( ret, "closest", selectors );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return jQuery.inArray( this[0], jQuery( elem ) );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
function sibling( cur, dir ) {
do {
cur = cur[ dir ];
} while ( cur && cur.nodeType !== 1 );
return cur;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style|link)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
rcheckableType = /^(?:checkbox|radio)$/,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "X<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( value ) {
return jQuery.access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
}, null, value, arguments.length );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this
gitextract_8xrdat_v/
├── .gitignore
├── README.md
├── demos/
│ ├── README.md
│ ├── angular-demo/
│ │ └── index.html
│ ├── backbone-demo/
│ │ ├── index.html
│ │ └── js/
│ │ ├── backbone.js
│ │ ├── jquery.js
│ │ ├── main.js
│ │ └── underscore.js
│ ├── eslint-demo/
│ │ ├── index.js
│ │ └── package.json
│ ├── express-demo/
│ │ ├── app1.js
│ │ ├── app2.js
│ │ ├── app3.js
│ │ ├── app4.js
│ │ └── package.json
│ ├── jsx-demo/
│ │ ├── index.html
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── mobx-demo/
│ │ ├── .babelrc
│ │ ├── .eslintignore
│ │ ├── .eslintrc
│ │ ├── .gitignore
│ │ ├── .jshintignore
│ │ ├── .jshintrc
│ │ ├── app/
│ │ │ ├── index.html
│ │ │ ├── main.css
│ │ │ ├── main.jsx
│ │ │ └── store.js
│ │ ├── browser-demo/
│ │ │ ├── index.html
│ │ │ ├── mobx-react.js
│ │ │ ├── mobx.umd.js
│ │ │ ├── react-15.1.0.js
│ │ │ └── react-dom-15.1.0.js
│ │ ├── package.json
│ │ ├── webpack.config.js
│ │ └── webpack.production.config.js
│ ├── mocha-demo/
│ │ ├── add.js
│ │ └── package.json
│ ├── nightmare-demo/
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── react-dom.js
│ │ ├── react.js
│ │ ├── server.js
│ │ ├── taobao.test.js
│ │ └── test.js
│ ├── react-component-demo/
│ │ ├── index1.html
│ │ ├── index2.html
│ │ ├── index3.html
│ │ ├── index4.html
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── react-lifecycle-demo/
│ │ ├── index.html
│ │ ├── jquery.js
│ │ ├── react-dom.js
│ │ └── react.js
│ ├── recharts-demo/
│ │ ├── index.html
│ │ └── react-dom.js
│ ├── redux-demo/
│ │ ├── .babelrc
│ │ ├── .eslintignore
│ │ ├── .eslintrc
│ │ ├── .gitignore
│ │ ├── .jshintignore
│ │ ├── .jshintrc
│ │ ├── app/
│ │ │ ├── App.js
│ │ │ ├── index.html
│ │ │ ├── main.css
│ │ │ ├── main.jsx
│ │ │ ├── myComponent.js
│ │ │ └── reducer.js
│ │ ├── package.json
│ │ ├── webpack.config.js
│ │ └── webpack.production.config.js
│ ├── rest-api-demo/
│ │ ├── db.json
│ │ └── package.json
│ ├── simple-app-demo/
│ │ ├── app.js
│ │ ├── bundle.js
│ │ ├── index.html
│ │ └── package.json
│ └── vue-demo/
│ ├── app1.js
│ ├── app2.js
│ ├── app3.js
│ ├── index1.html
│ ├── index2.html
│ └── index3.html
├── docs/
│ ├── engineering.md
│ ├── history.md
│ ├── node.md
│ ├── preparation.md
│ └── react.md
└── ppt/
└── README.md
SYMBOL INDEX (1851 symbols across 17 files)
FILE: demos/backbone-demo/js/jquery.js
function createOptions (line 911) | function createOptions( options ) {
function dataAttr (line 1800) | function dataAttr( elem, key, data ) {
function isEmptyDataObject (line 1832) | function isEmptyDataObject( obj ) {
function returnFalse (line 3279) | function returnFalse() {
function returnTrue (line 3282) | function returnTrue() {
function Sizzle (line 3884) | function Sizzle( selector, context, results, seed ) {
function createInputPseudo (line 3953) | function createInputPseudo( type ) {
function createButtonPseudo (line 3961) | function createButtonPseudo( type ) {
function createPositionalPseudo (line 3969) | function createPositionalPseudo( fn ) {
function siblingCheck (line 4564) | function siblingCheck( a, b, ret ) {
function tokenize (line 4682) | function tokenize( selector, parseOnly ) {
function addCombinator (line 4744) | function addCombinator( matcher, combinator, base ) {
function elementMatcher (line 4796) | function elementMatcher( matchers ) {
function condense (line 4810) | function condense( unmatched, map, filter, context, xml ) {
function setMatcher (line 4831) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
function matcherFromTokens (line 4911) | function matcherFromTokens( tokens ) {
function matcherFromGroupMatchers (line 4964) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
function multipleContexts (line 5088) | function multipleContexts( selector, contexts, results, seed ) {
function select (line 5097) | function select( selector, context, results, seed, xml ) {
function setFilters (line 5325) | function setFilters() {}
function isDisconnected (line 5491) | function isDisconnected( node ) {
function sibling (line 5495) | function sibling( cur, dir ) {
function winnow (line 5603) | function winnow( elements, qualifier, keep ) {
function createSafeFragment (line 5636) | function createSafeFragment( document ) {
function findOrAppend (line 6020) | function findOrAppend( elem, tag ) {
function cloneCopyEvent (line 6024) | function cloneCopyEvent( src, dest ) {
function cloneFixAttributes (line 6052) | function cloneFixAttributes( src, dest ) {
function getAll (line 6195) | function getAll( elem ) {
function fixDefaultChecked (line 6208) | function fixDefaultChecked( elem ) {
function jQuerySub (line 6504) | function jQuerySub( selector, context ) {
function vendorPropName (line 6550) | function vendorPropName( style, name ) {
function isHidden (line 6572) | function isHidden( elem, el ) {
function showHide (line 6577) | function showHide( elements, show ) {
function setPositiveNumber (line 6885) | function setPositiveNumber( elem, value, subtract ) {
function augmentWidthOrHeight (line 6892) | function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
function getWidthOrHeight (line 6934) | function getWidthOrHeight( elem, name, extra ) {
function css_defaultDisplay (line 6977) | function css_defaultDisplay( nodeName ) {
function buildParams (line 7231) | function buildParams( prefix, obj, traditional, add ) {
function addToPrefiltersOrTransports (line 7320) | function addToPrefiltersOrTransports( structure ) {
function inspectPrefiltersOrTransports (line 7354) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
function ajaxExtend (line 7396) | function ajaxExtend( target, src ) {
function done (line 7707) | function done( status, nativeStatusText, responses, headers ) {
function ajaxHandleResponses (line 7997) | function ajaxHandleResponses( s, jqXHR, responses ) {
function ajaxConvert (line 8059) | function ajaxConvert( s, response ) {
function createStandardXHR (line 8326) | function createStandardXHR() {
function createActiveXHR (line 8332) | function createActiveXHR() {
function createFxNow (line 8586) | function createFxNow() {
function createTweens (line 8593) | function createTweens( animation, props ) {
function Animation (line 8608) | function Animation( elem, properties, options ) {
function propFilter (line 8704) | function propFilter( props, specialEasing ) {
function defaultPrefilter (line 8771) | function defaultPrefilter( elem, props, opts ) {
function Tween (line 8886) | function Tween( elem, options, prop, end, easing ) {
function genFx (line 9070) | function genFx( type, includeWidth ) {
function getWindow (line 9373) | function getWindow( elem ) {
FILE: demos/jsx-demo/react.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 805) | function CallbackQueue() {
function shouldUseChangeEvent (line 930) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 941) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 959) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 964) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 970) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 979) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 984) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1027) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1047) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1071) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1087) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1095) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1118) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1140) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1147) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1230) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1254) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1258) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1266) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1276) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1288) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1300) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1437) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1470) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1475) | function queueChild(parentTree, childTree) {
function queueHTML (line 1483) | function queueHTML(tree, html) {
function queueText (line 1491) | function queueText(tree, text) {
function toString (line 1499) | function toString() {
function DOMLazyTree (line 1503) | function DOMLazyTree(node) {
function checkMask (line 1559) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1774) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1790) | function shouldIgnoreValue(propertyInfo, value) {
function recomputePluginOrdering (line 2584) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2613) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2641) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2848) | function isEndish(topLevelType) {
function isMoveish (line 2852) | function isMoveish(topLevelType) {
function isStartish (line 2855) | function isStartish(topLevelType) {
function executeDispatch (line 2882) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2896) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 2924) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 2951) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 2967) | function executeDirectDispatch(event) {
function hasDispatches (line 2986) | function hasDispatches(event) {
function listenerAtPhase (line 3058) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3069) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3088) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3097) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3110) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3126) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3132) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3136) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3140) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3144) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3198) | function FallbackCompositionState(root) {
function escape (line 3494) | function escape(key) {
function unescape (line 3513) | function unescape(key) {
function _assertSingleLink (line 3564) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3567) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3572) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3594) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 4037) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4218) | function instantiateChild(childInstances, child, name, selfDebugID) {
function escapeUserProvidedKey (line 4355) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4367) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4379) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4398) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4416) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4432) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4453) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4476) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4485) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4498) | function countChildren(children, context) {
function toArray (line 4508) | function toArray(children) {
function validateTypeDef (line 4881) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4891) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4909) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 4984) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 5010) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 5030) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 5054) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 5068) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 5105) | function bindAutoBindMethods(component) {
function ReactComponent (line 5275) | function ReactComponent(props, context, updater) {
function updateTree (line 5487) | function updateTree(id, update) {
function purgeDeep (line 5503) | function purgeDeep(id) {
function describeComponentFrame (line 5513) | function describeComponentFrame(name, source, ownerName) {
function describeID (line 5517) | function describeID(id) {
function StatelessComponent (line 5715) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5723) | function warnIfInvalidElement(Component, element) {
function invokeComponentDidMountWithTimer (line 5730) | function invokeComponentDidMountWithTimer() {
function invokeComponentDidUpdateWithTimer (line 5741) | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevCon...
function shouldConstruct (line 5752) | function shouldConstruct(Component) {
function getDeclarationErrorAddendum (line 6804) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6817) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6843) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6873) | function assertValidProps(component, props) {
function enqueuePutListener (line 6893) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6913) | function putListener() {
function inputPostMount (line 6918) | function inputPostMount() {
function textareaPostMount (line 6923) | function textareaPostMount() {
function optionPostMount (line 6928) | function optionPostMount() {
function trapBubbledEventsLocal (line 6994) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 7035) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 7082) | function validateDangerousTag(tag) {
function isCustomComponent (line 7089) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 7109) | function ReactDOMComponent(element) {
function getRenderedHostOrTextFromComponent (line 7790) | function getRenderedHostOrTextFromComponent(component) {
function precacheNode (line 7802) | function precacheNode(inst, node) {
function uncacheNode (line 7808) | function uncacheNode(inst) {
function precacheChildNodes (line 7830) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7863) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7897) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7910) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7964) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 8003) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 8133) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 8373) | function forceUpdateIfMounted() {
function isControlled (line 8380) | function isControlled(props) {
function _handleChange (line 8536) | function _handleChange(event) {
function handleElement (line 8627) | function handleElement(debugID, element) {
function flattenChildren (line 8674) | function flattenChildren(children) {
function updateOptionsIfPendingUpdateAndMounted (line 8801) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8814) | function getDeclarationErrorAddendum(owner) {
function checkSelectPropTypes (line 8830) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8858) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8964) | function _handleChange(event) {
function isCollapsed (line 9000) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 9018) | function getIEOffsets(node) {
function getModernOffsets (line 9041) | function getModernOffsets(node) {
function setIEOffsets (line 9103) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 9137) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 9416) | function forceUpdateIfMounted() {
function _handleChange (line 9536) | function _handleChange(event) {
function getLowestCommonAncestor (line 9566) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 9606) | function isAncestor(instA, instB) {
function getParentInstance (line 9622) | function getParentInstance(inst) {
function traverseTwoPhase (line 9631) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9653) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function handleElement (line 9774) | function handleElement(debugID, element) {
function emitEvent (line 9819) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function clearHistory (line 9843) | function clearHistory() {
function getTreeSnapshot (line 9848) | function getTreeSnapshot(registeredIDs) {
function resetMeasurements (line 9865) | function resetMeasurements() {
function checkDebugID (line 9892) | function checkDebugID(debugID) {
function beginLifeCycleTimer (line 9896) | function beginLifeCycleTimer(debugID, timerType) {
function endLifeCycleTimer (line 9907) | function endLifeCycleTimer(debugID, timerType) {
function pauseCurrentLifeCycleTimer (line 9925) | function pauseCurrentLifeCycleTimer() {
function resumeCurrentLifeCycleTimer (line 9939) | function resumeCurrentLifeCycleTimer() {
function ReactDefaultBatchingStrategyTransaction (line 10133) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 10202) | function inject() {
function hasValidRef (line 10287) | function hasValidRef(config) {
function hasValidKey (line 10299) | function hasValidKey(config) {
function getDeclarationErrorAddendum (line 10637) | function getDeclarationErrorAddendum() {
function getCurrentComponentErrorInfo (line 10654) | function getCurrentComponentErrorInfo(parentType) {
function validateExplicitKey (line 10677) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 10712) | function validateChildKeys(node, parentType) {
function validatePropTypes (line 10751) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10887) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10956) | function runEventQueueInBatch(events) {
function findParent (line 11004) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 11017) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 11031) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 11051) | function scrollValueMonitor(cb) {
function createInternalComponent (line 11203) | function createInternalComponent(element) {
function createInstanceForText (line 11212) | function createInstanceForText(text) {
function isTextComponent (line 11220) | function isTextComponent(component) {
function isInDocument (line 11327) | function isInDocument(node) {
function firstDifferenceIndex (line 11645) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11660) | function getReactRootElementInContainer(container) {
function internalGetID (line 11672) | function internalGetID(node) {
function mountComponentIntoNode (line 11687) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11713) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11730) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11759) | function hasNonRootReactChild(container) {
function getHostRootInstanceInContainer (line 11767) | function getHostRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11773) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 12127) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 12146) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 12164) | function makeRemove(child, node) {
function makeSetMarkup (line 12182) | function makeSetMarkup(markup) {
function makeTextContent (line 12200) | function makeTextContent(textContent) {
function enqueue (line 12216) | function enqueue(queue, update) {
function processQueue (line 12229) | function processQueue(inst, updateQueue) {
function warnNoop (line 12632) | function warnNoop(publicInstance, callerName) {
function is (line 12950) | function is(x, y) {
function createChainableTypeChecker (line 12963) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12984) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 13002) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 13006) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 13028) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 13039) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 13052) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 13074) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 13098) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 13119) | function createNodeChecker() {
function createShapeTypeChecker (line 13130) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 13153) | function isNode(propValue) {
function isSymbol (line 13200) | function isSymbol(propType, propValue) {
function getPropType (line 13220) | function getPropType(propValue) {
function getPreciseType (line 13239) | function getPreciseType(propValue) {
function getClassName (line 13252) | function getClassName(propValue) {
function ReactReconcileTransaction (line 13373) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13464) | function attachRefs() {
function attachRef (line 13634) | function attachRef(ref, component, owner) {
function detachRef (line 13643) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13751) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13782) | function renderToString(element) {
function renderToStaticMarkup (line 13792) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13844) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function _classCallCheck (line 13907) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function warnNoop (line 13913) | function warnNoop(publicInstance, callerName) {
function ReactServerUpdateQueue (line 13931) | function ReactServerUpdateQueue(transaction) {
function enqueueUpdate (line 14085) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 14089) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 14102) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 14319) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 14353) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 14383) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 14395) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 14399) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 14478) | function enqueueUpdate(component) {
function asap (line 14502) | function asap(callback, context) {
function getSelection (line 14914) | function getSelection(node) {
function constructSelectEvent (line 14945) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15715) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15754) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15791) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15828) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15898) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 16070) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 16126) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 16164) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 16249) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 16322) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 16368) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 16408) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 16468) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 16523) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16824) | function accumulateInto(current, next) {
function adler32 (line 16873) | function adler32(data) {
function checkReactTypeSpec (line 16956) | function checkReactTypeSpec(typeSpecs, values, location, componentName, ...
function dangerousStyleValue (line 17058) | function dangerousStyleValue(name, value, component) {
function escapeHtml (line 17163) | function escapeHtml(string) {
function escapeTextContentForBrowser (line 17220) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 17263) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 17317) | function flattenSingleChildIntoContext(traverseContext, child, name, sel...
function flattenChildren (line 17337) | function flattenChildren(children, selfDebugID) {
function forEachAccumulated (line 17377) | function forEachAccumulated(arr, cb, scope) {
function getEventCharCode (line 17411) | function getEventCharCode(nativeEvent) {
function getEventKey (line 17510) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 17569) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 17579) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 17606) | function getEventTarget(nativeEvent) {
function getHostComponentFromComposite (line 17636) | function getHostComponentFromComposite(inst) {
function getIteratorFn (line 17685) | function getIteratorFn(maybeIterable) {
function getLeafNode (line 17714) | function getLeafNode(node) {
function getSiblingNode (line 17728) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 17744) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 17792) | function getTextContentAccessor() {
function makePrefixMap (line 17825) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17885) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17937) | function getDeclarationErrorAddendum(owner) {
function getDisplayName (line 17947) | function getDisplayName(instance) {
function isInternalComponentType (line 17969) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17983) | function instantiateReactComponent(node, shouldHaveDebugID) {
function isEventSupported (line 18089) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 18149) | function isTextInputElement(elem) {
function onlyChild (line 18197) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 18225) | function quoteAttributeValueForBrowser(value) {
function reactProdInvariant (line 18251) | function reactProdInvariant(code) {
function shouldUpdateReactComponent (line 18461) | function shouldUpdateReactComponent(prevElement, nextElement) {
function getComponentKey (line 18519) | function getComponentKey(component, index) {
function traverseAllChildrenImpl (line 18538) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 18630) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 19154) | function camelize(string) {
function camelizeStyleName (line 19196) | function camelizeStyleName(string) {
function containsNode (line 19222) | function containsNode(outerNode, innerNode) {
function toArray (line 19266) | function toArray(obj) {
function hasArrayNature (line 19314) | function hasArrayNature(obj) {
function createArrayFromMixed (line 19357) | function createArrayFromMixed(obj) {
function getNodeName (line 19406) | function getNodeName(markup) {
function createNodesFromMarkup (line 19421) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 19466) | function makeEmptyFunction(arg) {
function focusNode (line 19528) | function focusNode(node) {
function getActiveElement (line 19561) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 19651) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 19693) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 19735) | function hyphenate(string) {
function hyphenateStyleName (line 19774) | function hyphenateStyleName(string) {
function invariant (line 19803) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 19847) | function isNode(object) {
function isTextNode (line 19872) | function isTextNode(object) {
function mapObject (line 19997) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 20030) | function memoizeStringOnly(callback) {
function is (line 20121) | function is(x, y) {
function shallowEqual (line 20138) | function shallowEqual(objA, objB) {
function toObject (line 20228) | function toObject(val) {
function shouldUseNative (line 20236) | function shouldUseNative() {
FILE: demos/mobx-demo/app/main.jsx
class App (line 7) | @observer
method render (line 9) | render() {
FILE: demos/mobx-demo/app/store.js
class Store (line 3) | class Store {
method decorated (line 5) | @computed get decorated() {
FILE: demos/mobx-demo/browser-demo/mobx-react.js
function mrFactory (line 2) | function mrFactory(mobx, React, ReactDOM) {
FILE: demos/mobx-demo/browser-demo/mobx.umd.js
function s (line 1) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function __ (line 5) | function __() { this.constructor = d; }
function autorun (line 20) | function autorun(view, scope) {
function when (line 36) | function when(predicate, effect, scope) {
function autorunUntil (line 52) | function autorunUntil(predicate, effect, scope) {
function autorunAsync (line 57) | function autorunAsync(func, delay, scope) {
function computed (line 76) | function computed(target, key, baseDescriptor, options) {
function throwingComputedValueSetter (line 107) | function throwingComputedValueSetter() {
function createTransformer (line 110) | function createTransformer(transformer, onCleanup) {
function getMemoizationId (line 139) | function getMemoizationId(object) {
function expr (line 147) | function expr(expr, scope) {
function extendObservable (line 153) | function extendObservable(target) {
function extendObservableHelper (line 168) | function extendObservableHelper(target, properties, mode, name) {
function allowStateChanges (line 178) | function allowStateChanges(allowStateChanges, func) {
function reportTransition (line 186) | function reportTransition(node, state, changed) {
function getDependencyTree (line 195) | function getDependencyTree(thing) {
function nodeToDependencyTree (line 198) | function nodeToDependencyTree(node) {
function getObserverTree (line 207) | function getObserverTree(thing) {
function nodeToObserverTree (line 210) | function nodeToObserverTree(node) {
function createConsoleReporter (line 219) | function createConsoleReporter(extensive) {
function trackTransitions (line 235) | function trackTransitions(extensive, onReport) {
function isObservable (line 252) | function isObservable(value, property) {
function observableDecorator (line 267) | function observableDecorator(target, key, baseDescriptor) {
function observable (line 305) | function observable(v, keyOrScope) {
function observableIsDeprecated (line 331) | function observableIsDeprecated() {
function getTypeOfValue (line 343) | function getTypeOfValue(value) {
function observe (line 354) | function observe(thing, propOrCb, cbOrFire, fireImmediately) {
function observeObservable (line 361) | function observeObservable(thing, listener, fireImmediately) {
function observeObservableProperty (line 374) | function observeObservableProperty(thing, property, listener, fireImmedi...
function toJSON (line 394) | function toJSON(source, detectCycles, __alreadySeen) {
function propagateAtomReady (line 433) | function propagateAtomReady(atom) {
function Atom (line 440) | function Atom(name, onBecomeObserved, onBecomeUnobserved) {
function ComputedValue (line 484) | function ComputedValue(derivation, scope, compareStructural, name) {
function isComputingDerivation (line 572) | function isComputingDerivation() {
function checkIfStateModificationsAreAllowed (line 575) | function checkIfStateModificationsAreAllowed() {
function notifyDependencyStale (line 578) | function notifyDependencyStale(derivation) {
function notifyDependencyReady (line 584) | function notifyDependencyReady(derivation, dependencyDidChange) {
function trackDerivedFunction (line 601) | function trackDerivedFunction(derivation, f) {
function bindDependencies (line 609) | function bindDependencies(derivation, prevObserving) {
function findCycle (line 620) | function findCycle(needle, node) {
function MobXGlobals (line 632) | function MobXGlobals() {
function getNextId (line 656) | function getNextId() {
function registerGlobals (line 659) | function registerGlobals() {
function resetGlobalState (line 661) | function resetGlobalState() {
function addObserver (line 666) | function addObserver(observable, node) {
function removeObserver (line 672) | function removeObserver(observable, node) {
function reportObserved (line 679) | function reportObserved(observable) {
function propagateStaleness (line 690) | function propagateStaleness(observable) {
function propagateReadiness (line 695) | function propagateReadiness(observable, valueDidActuallyChange) {
function untracked (line 698) | function untracked(action) {
function Reaction (line 707) | function Reaction(name, onInvalidate) {
function runReactions (line 764) | function runReactions() {
function transaction (line 779) | function transaction(action, thisArg) {
function asReference (line 798) | function asReference(value) {
function asStructure (line 802) | function asStructure(value) {
function asFlat (line 806) | function asFlat(value) {
function AsReference (line 811) | function AsReference(value) {
function AsStructure (line 818) | function AsStructure(value) {
function AsFlat (line 825) | function AsFlat(value) {
function getValueModeFromValue (line 831) | function getValueModeFromValue(value, defaultMode) {
function getValueModeFromModifierFunc (line 840) | function getValueModeFromModifierFunc(func) {
function makeChildObservable (line 850) | function makeChildObservable(value, parentMode, name) {
function assertUnwrapped (line 878) | function assertUnwrapped(value, message) {
function StubArray (line 884) | function StubArray() {
function getArrayLength (line 889) | function getArrayLength(adm) {
function setArrayLength (line 893) | function setArrayLength(adm, newLength) {
function updateArrayLength (line 904) | function updateArrayLength(adm, oldLength, delta) {
function spliceWithArray (line 912) | function spliceWithArray(adm, index, deleteCount, newItems) {
function makeReactiveArrayItem (line 939) | function makeReactiveArrayItem(value) {
function notifyArrayChildUpdate (line 945) | function notifyArrayChildUpdate(adm, index, oldValue) {
function notifyArraySplice (line 950) | function notifyArraySplice(adm, index, deleted, added) {
function ObservableArray (line 959) | function ObservableArray(initialValues, mode, name) {
function createArrayBufferItem (line 1130) | function createArrayBufferItem(index) {
function reserveArrayBuffer (line 1162) | function reserveArrayBuffer(max) {
function createObservableArray (line 1168) | function createObservableArray(initialValues, mode, name) {
function fastArray (line 1171) | function fastArray(initialValues) {
function isObservableArray (line 1176) | function isObservableArray(thing) {
function ObservableMap (line 1182) | function ObservableMap(initialData, valueModeFunc) {
function map (line 1339) | function map(initialValues, valueModifier) {
function isObservableMap (line 1343) | function isObservableMap(thing) {
function asObservableObject (line 1348) | function asObservableObject(target, name, mode) {
function setObservableObjectProperty (line 1371) | function setObservableObjectProperty(adm, propName, value) {
function defineObservableProperty (line 1377) | function defineObservableProperty(adm, propName, value) {
function observeObservableObject (line 1415) | function observeObservableObject(object, callback, fireImmediately) {
function isObservableObject (line 1423) | function isObservableObject(thing) {
function ObservableValue (line 1429) | function ObservableValue(value, mode, name) {
function SimpleEventEmitter (line 1471) | function SimpleEventEmitter() {
function invariant (line 1504) | function invariant(check, message, thing) {
function deprecated (line 1509) | function deprecated(msg) {
function once (line 1515) | function once(func) {
function unique (line 1525) | function unique(list) {
function isPlainObject (line 1533) | function isPlainObject(value) {
function valueDidChange (line 1536) | function valueDidChange(compareStructural, oldValue, newValue) {
function makeNonEnumerable (line 1541) | function makeNonEnumerable(object, props) {
function isPropertyConfigurable (line 1551) | function isPropertyConfigurable(object, prop) {
function assertPropertyConfigurable (line 1555) | function assertPropertyConfigurable(object, prop) {
function deepEquals (line 1558) | function deepEquals(a, b) {
function quickDiff (line 1590) | function quickDiff(current, base) {
FILE: demos/mobx-demo/browser-demo/react-15.1.0.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 804) | function CallbackQueue() {
function shouldUseChangeEvent (line 929) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 940) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 958) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 963) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 969) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 978) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 983) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1026) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1046) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1070) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1086) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1094) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1117) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1139) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1146) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1229) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1253) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1257) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1265) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1275) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1287) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1299) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1435) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1468) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1473) | function queueChild(parentTree, childTree) {
function queueHTML (line 1481) | function queueHTML(tree, html) {
function queueText (line 1489) | function queueText(tree, text) {
function toString (line 1497) | function toString() {
function DOMLazyTree (line 1501) | function DOMLazyTree(node) {
function checkMask (line 1555) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1779) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1795) | function shouldIgnoreValue(propertyInfo, value) {
function getNodeName (line 2012) | function getNodeName(markup) {
function recomputePluginOrdering (line 2671) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2700) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2728) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2929) | function isEndish(topLevelType) {
function isMoveish (line 2933) | function isMoveish(topLevelType) {
function isStartish (line 2936) | function isStartish(topLevelType) {
function executeDispatch (line 2963) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2977) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 3005) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 3032) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 3048) | function executeDirectDispatch(event) {
function hasDispatches (line 3067) | function hasDispatches(event) {
function listenerAtPhase (line 3139) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3150) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3169) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3178) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3191) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3207) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3213) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3217) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3221) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3225) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3279) | function FallbackCompositionState(root) {
function escape (line 3575) | function escape(key) {
function unescape (line 3594) | function unescape(key) {
function _assertSingleLink (line 3643) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3646) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3651) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3673) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 4114) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4295) | function instantiateChild(childInstances, child, name) {
function escapeUserProvidedKey (line 4423) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4435) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4447) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4466) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4484) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4500) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4521) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4544) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4553) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4566) | function countChildren(children, context) {
function toArray (line 4576) | function toArray(children) {
function validateTypeDef (line 4948) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4958) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4976) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 5051) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 5077) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 5097) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 5121) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 5135) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 5172) | function bindAutoBindMethods(component) {
function ReactComponent (line 5341) | function ReactComponent(props, context, updater) {
function updateTree (line 5549) | function updateTree(id, update) {
function purgeDeep (line 5564) | function purgeDeep(id) {
function getDeclarationErrorAddendum (line 5709) | function getDeclarationErrorAddendum(component) {
function StatelessComponent (line 5720) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5728) | function warnIfInvalidElement(Component, element) {
function invokeComponentDidMountWithTimer (line 5734) | function invokeComponentDidMountWithTimer() {
function invokeComponentDidUpdateWithTimer (line 5745) | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevCon...
function shouldConstruct (line 5756) | function shouldConstruct(Component) {
function getDeclarationErrorAddendum (line 6828) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6841) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6867) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6897) | function assertValidProps(component, props) {
function enqueuePutListener (line 6917) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6937) | function putListener() {
function optionPostMount (line 6942) | function optionPostMount() {
function trapBubbledEventsLocal (line 6988) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 7027) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 7074) | function validateDangerousTag(tag) {
function isCustomComponent (line 7081) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 7101) | function ReactDOMComponent(element) {
function getRenderedNativeOrTextFromComponent (line 7759) | function getRenderedNativeOrTextFromComponent(component) {
function precacheNode (line 7771) | function precacheNode(inst, node) {
function uncacheNode (line 7777) | function uncacheNode(inst) {
function precacheChildNodes (line 7799) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7832) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7866) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7879) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7933) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 7970) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 8097) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 8336) | function forceUpdateIfMounted() {
function warnIfValueIsNull (line 8343) | function warnIfValueIsNull(props) {
function _handleChange (line 8461) | function _handleChange(event) {
function updateOptionsIfPendingUpdateAndMounted (line 8664) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8677) | function getDeclarationErrorAddendum(owner) {
function warnIfValueIsNull (line 8687) | function warnIfValueIsNull(props) {
function checkSelectPropTypes (line 8701) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8729) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8839) | function _handleChange(event) {
function isCollapsed (line 8875) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 8893) | function getIEOffsets(node) {
function getModernOffsets (line 8916) | function getModernOffsets(node) {
function setIEOffsets (line 8978) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 9012) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 9291) | function forceUpdateIfMounted() {
function warnIfValueIsNull (line 9298) | function warnIfValueIsNull(props) {
function _handleChange (line 9397) | function _handleChange(event) {
function getLowestCommonAncestor (line 9425) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 9465) | function isAncestor(instA, instB) {
function getParentInstance (line 9481) | function getParentInstance(inst) {
function traverseTwoPhase (line 9490) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9512) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function emitEvent (line 9627) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function clearHistory (line 9651) | function clearHistory() {
function getTreeSnapshot (line 9656) | function getTreeSnapshot(registeredIDs) {
function resetMeasurements (line 9673) | function resetMeasurements() {
function checkDebugID (line 9702) | function checkDebugID(debugID) {
function ReactDefaultBatchingStrategyTransaction (line 9891) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 9960) | function inject() {
function getDeclarationErrorAddendum (line 10355) | function getDeclarationErrorAddendum() {
function validateExplicitKey (line 10384) | function validateExplicitKey(element, parentType) {
function getAddendaForKeyUse (line 10408) | function getAddendaForKeyUse(messageType, element, parentType) {
function validateChildKeys (line 10449) | function validateChildKeys(node, parentType) {
function checkPropTypes (line 10491) | function checkPropTypes(componentName, propTypes, props, location) {
function validatePropTypes (line 10525) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10661) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10730) | function runEventQueueInBatch(events) {
function findParent (line 10778) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 10791) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 10805) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 10825) | function scrollValueMonitor(cb) {
function isInDocument (line 10985) | function isInDocument(node) {
function firstDifferenceIndex (line 11295) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11310) | function getReactRootElementInContainer(container) {
function internalGetID (line 11322) | function internalGetID(node) {
function mountComponentIntoNode (line 11337) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11363) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11380) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11403) | function hasNonRootReactChild(container) {
function getNativeRootInstanceInContainer (line 11411) | function getNativeRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11417) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 11771) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 11790) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 11808) | function makeRemove(child, node) {
function makeSetMarkup (line 11826) | function makeSetMarkup(markup) {
function makeTextContent (line 11844) | function makeTextContent(textContent) {
function enqueue (line 11860) | function enqueue(queue, update) {
function processQueue (line 11873) | function processQueue(inst, updateQueue) {
function getComponentClassForElement (line 12243) | function getComponentClassForElement(element) {
function createInternalComponent (line 12261) | function createInternalComponent(element) {
function createInstanceForText (line 12270) | function createInstanceForText(text) {
function isTextComponent (line 12278) | function isTextComponent(component) {
function warnTDZ (line 12383) | function warnTDZ(publicInstance, callerName) {
function is (line 12697) | function is(x, y) {
function createChainableTypeChecker (line 12710) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12731) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 12749) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 12753) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 12775) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 12786) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 12799) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 12821) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 12845) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 12866) | function createNodeChecker() {
function createShapeTypeChecker (line 12877) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 12900) | function isNode(propValue) {
function getPropType (line 12948) | function getPropType(propValue) {
function getPreciseType (line 12964) | function getPreciseType(propValue) {
function getClassName (line 12977) | function getClassName(propValue) {
function ReactReconcileTransaction (line 13089) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13171) | function attachRefs() {
function attachRef (line 13338) | function attachRef(ref, component, owner) {
function detachRef (line 13347) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13453) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13488) | function renderToString(element) {
function renderToStaticMarkup (line 13498) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13541) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function enqueueUpdate (line 13629) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 13633) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 13646) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 13856) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 13890) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 13920) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 13932) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 13936) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 14023) | function enqueueUpdate(component) {
function asap (line 14047) | function asap(callback, context) {
function getSelection (line 14459) | function getSelection(node) {
function constructSelectEvent (line 14490) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15258) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15297) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15334) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15371) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15441) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 15614) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 15670) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 15708) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 15793) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 15866) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 15912) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 15952) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 16012) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 16067) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16364) | function accumulateInto(current, next) {
function adler32 (line 16415) | function adler32(data) {
function dangerousStyleValue (line 16526) | function dangerousStyleValue(name, value, component) {
function escaper (line 16598) | function escaper(match) {
function escapeTextContentForBrowser (line 16608) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 16643) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 16695) | function flattenSingleChildIntoContext(traverseContext, child, name) {
function flattenChildren (line 16712) | function flattenChildren(children) {
function getEventCharCode (line 16778) | function getEventCharCode(nativeEvent) {
function getEventKey (line 16877) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 16936) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 16946) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 16973) | function getEventTarget(nativeEvent) {
function getIteratorFn (line 17020) | function getIteratorFn(maybeIterable) {
function getNativeComponentFromComposite (line 17044) | function getNativeComponentFromComposite(inst) {
function getLeafNode (line 17080) | function getLeafNode(node) {
function getSiblingNode (line 17094) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 17110) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 17158) | function getTextContentAccessor() {
function makePrefixMap (line 17191) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17251) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17302) | function getDeclarationErrorAddendum(owner) {
function getDisplayName (line 17312) | function getDisplayName(instance) {
function isInternalComponentType (line 17334) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17347) | function instantiateReactComponent(node) {
function isEventSupported (line 17453) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 17512) | function isTextInputElement(elem) {
function onlyChild (line 17549) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 17577) | function quoteAttributeValueForBrowser(value) {
function shouldUpdateReactComponent (line 17749) | function shouldUpdateReactComponent(prevElement, nextElement) {
function getComponentKey (line 17805) | function getComponentKey(component, index) {
function traverseAllChildrenImpl (line 17824) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 17916) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 18440) | function camelize(string) {
function camelizeStyleName (line 18482) | function camelizeStyleName(string) {
function containsNode (line 18512) | function containsNode(outerNode, innerNode) {
function toArray (line 18556) | function toArray(obj) {
function hasArrayNature (line 18604) | function hasArrayNature(obj) {
function createArrayFromMixed (line 18647) | function createArrayFromMixed(obj) {
function getNodeName (line 18696) | function getNodeName(markup) {
function createNodesFromMarkup (line 18711) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 18755) | function makeEmptyFunction(arg) {
function emptyFunction (line 18766) | function emptyFunction() {}
function focusNode (line 18817) | function focusNode(node) {
function getActiveElement (line 18850) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 18940) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 18982) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 19024) | function hyphenate(string) {
function hyphenateStyleName (line 19063) | function hyphenateStyleName(string) {
function invariant (line 19092) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 19136) | function isNode(object) {
function isTextNode (line 19161) | function isTextNode(object) {
function mapObject (line 19286) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 19321) | function memoizeStringOnly(callback) {
function is (line 19412) | function is(x, y) {
function shallowEqual (line 19429) | function shallowEqual(objA, objB) {
function toObject (line 19519) | function toObject(val) {
function shouldUseNative (line 19527) | function shouldUseNative() {
FILE: demos/mocha-demo/add.js
function add (line 1) | function add(x, y) {
FILE: demos/nightmare-demo/react.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 805) | function CallbackQueue() {
function shouldUseChangeEvent (line 930) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 941) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 959) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 964) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 970) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 979) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 984) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1027) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1047) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1071) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1087) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1095) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1118) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1140) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1147) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1230) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1254) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1258) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1266) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1276) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1288) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1300) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1437) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1470) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1475) | function queueChild(parentTree, childTree) {
function queueHTML (line 1483) | function queueHTML(tree, html) {
function queueText (line 1491) | function queueText(tree, text) {
function toString (line 1499) | function toString() {
function DOMLazyTree (line 1503) | function DOMLazyTree(node) {
function checkMask (line 1559) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1774) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1790) | function shouldIgnoreValue(propertyInfo, value) {
function recomputePluginOrdering (line 2584) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2613) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2641) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2848) | function isEndish(topLevelType) {
function isMoveish (line 2852) | function isMoveish(topLevelType) {
function isStartish (line 2855) | function isStartish(topLevelType) {
function executeDispatch (line 2882) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2896) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 2924) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 2951) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 2967) | function executeDirectDispatch(event) {
function hasDispatches (line 2986) | function hasDispatches(event) {
function listenerAtPhase (line 3058) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3069) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3088) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3097) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3110) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3126) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3132) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3136) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3140) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3144) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3198) | function FallbackCompositionState(root) {
function escape (line 3494) | function escape(key) {
function unescape (line 3513) | function unescape(key) {
function _assertSingleLink (line 3564) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3567) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3572) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3594) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 4037) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4218) | function instantiateChild(childInstances, child, name, selfDebugID) {
function escapeUserProvidedKey (line 4355) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4367) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4379) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4398) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4416) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4432) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4453) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4476) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4485) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4498) | function countChildren(children, context) {
function toArray (line 4508) | function toArray(children) {
function validateTypeDef (line 4881) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4891) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4909) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 4984) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 5010) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 5030) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 5054) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 5068) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 5105) | function bindAutoBindMethods(component) {
function ReactComponent (line 5275) | function ReactComponent(props, context, updater) {
function updateTree (line 5487) | function updateTree(id, update) {
function purgeDeep (line 5503) | function purgeDeep(id) {
function describeComponentFrame (line 5513) | function describeComponentFrame(name, source, ownerName) {
function describeID (line 5517) | function describeID(id) {
function StatelessComponent (line 5715) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5723) | function warnIfInvalidElement(Component, element) {
function invokeComponentDidMountWithTimer (line 5730) | function invokeComponentDidMountWithTimer() {
function invokeComponentDidUpdateWithTimer (line 5741) | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevCon...
function shouldConstruct (line 5752) | function shouldConstruct(Component) {
function getDeclarationErrorAddendum (line 6804) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6817) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6843) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6873) | function assertValidProps(component, props) {
function enqueuePutListener (line 6893) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6913) | function putListener() {
function inputPostMount (line 6918) | function inputPostMount() {
function textareaPostMount (line 6923) | function textareaPostMount() {
function optionPostMount (line 6928) | function optionPostMount() {
function trapBubbledEventsLocal (line 6994) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 7035) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 7082) | function validateDangerousTag(tag) {
function isCustomComponent (line 7089) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 7109) | function ReactDOMComponent(element) {
function getRenderedHostOrTextFromComponent (line 7790) | function getRenderedHostOrTextFromComponent(component) {
function precacheNode (line 7802) | function precacheNode(inst, node) {
function uncacheNode (line 7808) | function uncacheNode(inst) {
function precacheChildNodes (line 7830) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7863) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7897) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7910) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7964) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 8003) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 8133) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 8373) | function forceUpdateIfMounted() {
function isControlled (line 8380) | function isControlled(props) {
function _handleChange (line 8536) | function _handleChange(event) {
function handleElement (line 8627) | function handleElement(debugID, element) {
function flattenChildren (line 8674) | function flattenChildren(children) {
function updateOptionsIfPendingUpdateAndMounted (line 8801) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8814) | function getDeclarationErrorAddendum(owner) {
function checkSelectPropTypes (line 8830) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8858) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8964) | function _handleChange(event) {
function isCollapsed (line 9000) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 9018) | function getIEOffsets(node) {
function getModernOffsets (line 9041) | function getModernOffsets(node) {
function setIEOffsets (line 9103) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 9137) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 9416) | function forceUpdateIfMounted() {
function _handleChange (line 9536) | function _handleChange(event) {
function getLowestCommonAncestor (line 9566) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 9606) | function isAncestor(instA, instB) {
function getParentInstance (line 9622) | function getParentInstance(inst) {
function traverseTwoPhase (line 9631) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9653) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function handleElement (line 9774) | function handleElement(debugID, element) {
function emitEvent (line 9819) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function clearHistory (line 9843) | function clearHistory() {
function getTreeSnapshot (line 9848) | function getTreeSnapshot(registeredIDs) {
function resetMeasurements (line 9865) | function resetMeasurements() {
function checkDebugID (line 9892) | function checkDebugID(debugID) {
function beginLifeCycleTimer (line 9896) | function beginLifeCycleTimer(debugID, timerType) {
function endLifeCycleTimer (line 9907) | function endLifeCycleTimer(debugID, timerType) {
function pauseCurrentLifeCycleTimer (line 9925) | function pauseCurrentLifeCycleTimer() {
function resumeCurrentLifeCycleTimer (line 9939) | function resumeCurrentLifeCycleTimer() {
function ReactDefaultBatchingStrategyTransaction (line 10133) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 10202) | function inject() {
function hasValidRef (line 10287) | function hasValidRef(config) {
function hasValidKey (line 10299) | function hasValidKey(config) {
function getDeclarationErrorAddendum (line 10637) | function getDeclarationErrorAddendum() {
function getCurrentComponentErrorInfo (line 10654) | function getCurrentComponentErrorInfo(parentType) {
function validateExplicitKey (line 10677) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 10712) | function validateChildKeys(node, parentType) {
function validatePropTypes (line 10751) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10887) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10956) | function runEventQueueInBatch(events) {
function findParent (line 11004) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 11017) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 11031) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 11051) | function scrollValueMonitor(cb) {
function createInternalComponent (line 11203) | function createInternalComponent(element) {
function createInstanceForText (line 11212) | function createInstanceForText(text) {
function isTextComponent (line 11220) | function isTextComponent(component) {
function isInDocument (line 11327) | function isInDocument(node) {
function firstDifferenceIndex (line 11645) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11660) | function getReactRootElementInContainer(container) {
function internalGetID (line 11672) | function internalGetID(node) {
function mountComponentIntoNode (line 11687) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11713) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11730) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11759) | function hasNonRootReactChild(container) {
function getHostRootInstanceInContainer (line 11767) | function getHostRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11773) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 12127) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 12146) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 12164) | function makeRemove(child, node) {
function makeSetMarkup (line 12182) | function makeSetMarkup(markup) {
function makeTextContent (line 12200) | function makeTextContent(textContent) {
function enqueue (line 12216) | function enqueue(queue, update) {
function processQueue (line 12229) | function processQueue(inst, updateQueue) {
function warnNoop (line 12632) | function warnNoop(publicInstance, callerName) {
function is (line 12950) | function is(x, y) {
function createChainableTypeChecker (line 12963) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12984) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 13002) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 13006) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 13028) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 13039) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 13052) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 13074) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 13098) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 13119) | function createNodeChecker() {
function createShapeTypeChecker (line 13130) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 13153) | function isNode(propValue) {
function isSymbol (line 13200) | function isSymbol(propType, propValue) {
function getPropType (line 13220) | function getPropType(propValue) {
function getPreciseType (line 13239) | function getPreciseType(propValue) {
function getClassName (line 13252) | function getClassName(propValue) {
function ReactReconcileTransaction (line 13373) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13464) | function attachRefs() {
function attachRef (line 13634) | function attachRef(ref, component, owner) {
function detachRef (line 13643) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13751) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13782) | function renderToString(element) {
function renderToStaticMarkup (line 13792) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13844) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function _classCallCheck (line 13907) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function warnNoop (line 13913) | function warnNoop(publicInstance, callerName) {
function ReactServerUpdateQueue (line 13931) | function ReactServerUpdateQueue(transaction) {
function enqueueUpdate (line 14085) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 14089) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 14102) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 14319) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 14353) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 14383) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 14395) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 14399) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 14478) | function enqueueUpdate(component) {
function asap (line 14502) | function asap(callback, context) {
function getSelection (line 14914) | function getSelection(node) {
function constructSelectEvent (line 14945) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15715) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15754) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15791) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15828) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15898) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 16070) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 16126) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 16164) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 16249) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 16322) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 16368) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 16408) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 16468) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 16523) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16824) | function accumulateInto(current, next) {
function adler32 (line 16873) | function adler32(data) {
function checkReactTypeSpec (line 16956) | function checkReactTypeSpec(typeSpecs, values, location, componentName, ...
function dangerousStyleValue (line 17058) | function dangerousStyleValue(name, value, component) {
function escapeHtml (line 17163) | function escapeHtml(string) {
function escapeTextContentForBrowser (line 17220) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 17263) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 17317) | function flattenSingleChildIntoContext(traverseContext, child, name, sel...
function flattenChildren (line 17337) | function flattenChildren(children, selfDebugID) {
function forEachAccumulated (line 17377) | function forEachAccumulated(arr, cb, scope) {
function getEventCharCode (line 17411) | function getEventCharCode(nativeEvent) {
function getEventKey (line 17510) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 17569) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 17579) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 17606) | function getEventTarget(nativeEvent) {
function getHostComponentFromComposite (line 17636) | function getHostComponentFromComposite(inst) {
function getIteratorFn (line 17685) | function getIteratorFn(maybeIterable) {
function getLeafNode (line 17714) | function getLeafNode(node) {
function getSiblingNode (line 17728) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 17744) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 17792) | function getTextContentAccessor() {
function makePrefixMap (line 17825) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17885) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17937) | function getDeclarationErrorAddendum(owner) {
function getDisplayName (line 17947) | function getDisplayName(instance) {
function isInternalComponentType (line 17969) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17983) | function instantiateReactComponent(node, shouldHaveDebugID) {
function isEventSupported (line 18089) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 18149) | function isTextInputElement(elem) {
function onlyChild (line 18197) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 18225) | function quoteAttributeValueForBrowser(value) {
function reactProdInvariant (line 18251) | function reactProdInvariant(code) {
function shouldUpdateReactComponent (line 18461) | function shouldUpdateReactComponent(prevElement, nextElement) {
function getComponentKey (line 18519) | function getComponentKey(component, index) {
function traverseAllChildrenImpl (line 18538) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 18630) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 19154) | function camelize(string) {
function camelizeStyleName (line 19196) | function camelizeStyleName(string) {
function containsNode (line 19222) | function containsNode(outerNode, innerNode) {
function toArray (line 19266) | function toArray(obj) {
function hasArrayNature (line 19314) | function hasArrayNature(obj) {
function createArrayFromMixed (line 19357) | function createArrayFromMixed(obj) {
function getNodeName (line 19406) | function getNodeName(markup) {
function createNodesFromMarkup (line 19421) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 19466) | function makeEmptyFunction(arg) {
function focusNode (line 19528) | function focusNode(node) {
function getActiveElement (line 19561) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 19651) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 19693) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 19735) | function hyphenate(string) {
function hyphenateStyleName (line 19774) | function hyphenateStyleName(string) {
function invariant (line 19803) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 19847) | function isNode(object) {
function isTextNode (line 19872) | function isTextNode(object) {
function mapObject (line 19997) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 20030) | function memoizeStringOnly(callback) {
function is (line 20121) | function is(x, y) {
function shallowEqual (line 20138) | function shallowEqual(objA, objB) {
function toObject (line 20228) | function toObject(val) {
function shouldUseNative (line 20236) | function shouldUseNative() {
FILE: demos/react-component-demo/react.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 805) | function CallbackQueue() {
function shouldUseChangeEvent (line 930) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 941) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 959) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 964) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 970) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 979) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 984) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1027) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1047) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1071) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1087) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1095) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1118) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1140) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1147) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1230) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1254) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1258) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1266) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1276) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1288) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1300) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1437) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1470) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1475) | function queueChild(parentTree, childTree) {
function queueHTML (line 1483) | function queueHTML(tree, html) {
function queueText (line 1491) | function queueText(tree, text) {
function toString (line 1499) | function toString() {
function DOMLazyTree (line 1503) | function DOMLazyTree(node) {
function checkMask (line 1559) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1774) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1790) | function shouldIgnoreValue(propertyInfo, value) {
function recomputePluginOrdering (line 2584) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2613) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2641) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2848) | function isEndish(topLevelType) {
function isMoveish (line 2852) | function isMoveish(topLevelType) {
function isStartish (line 2855) | function isStartish(topLevelType) {
function executeDispatch (line 2882) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2896) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 2924) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 2951) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 2967) | function executeDirectDispatch(event) {
function hasDispatches (line 2986) | function hasDispatches(event) {
function listenerAtPhase (line 3058) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3069) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3088) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3097) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3110) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3126) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3132) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3136) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3140) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3144) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3198) | function FallbackCompositionState(root) {
function escape (line 3494) | function escape(key) {
function unescape (line 3513) | function unescape(key) {
function _assertSingleLink (line 3564) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3567) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3572) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3594) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 4037) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4218) | function instantiateChild(childInstances, child, name, selfDebugID) {
function escapeUserProvidedKey (line 4355) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4367) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4379) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4398) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4416) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4432) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4453) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4476) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4485) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4498) | function countChildren(children, context) {
function toArray (line 4508) | function toArray(children) {
function validateTypeDef (line 4881) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4891) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4909) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 4984) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 5010) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 5030) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 5054) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 5068) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 5105) | function bindAutoBindMethods(component) {
function ReactComponent (line 5275) | function ReactComponent(props, context, updater) {
function updateTree (line 5487) | function updateTree(id, update) {
function purgeDeep (line 5503) | function purgeDeep(id) {
function describeComponentFrame (line 5513) | function describeComponentFrame(name, source, ownerName) {
function describeID (line 5517) | function describeID(id) {
function StatelessComponent (line 5715) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5723) | function warnIfInvalidElement(Component, element) {
function invokeComponentDidMountWithTimer (line 5730) | function invokeComponentDidMountWithTimer() {
function invokeComponentDidUpdateWithTimer (line 5741) | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevCon...
function shouldConstruct (line 5752) | function shouldConstruct(Component) {
function getDeclarationErrorAddendum (line 6804) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6817) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6843) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6873) | function assertValidProps(component, props) {
function enqueuePutListener (line 6893) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6913) | function putListener() {
function inputPostMount (line 6918) | function inputPostMount() {
function textareaPostMount (line 6923) | function textareaPostMount() {
function optionPostMount (line 6928) | function optionPostMount() {
function trapBubbledEventsLocal (line 6994) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 7035) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 7082) | function validateDangerousTag(tag) {
function isCustomComponent (line 7089) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 7109) | function ReactDOMComponent(element) {
function getRenderedHostOrTextFromComponent (line 7790) | function getRenderedHostOrTextFromComponent(component) {
function precacheNode (line 7802) | function precacheNode(inst, node) {
function uncacheNode (line 7808) | function uncacheNode(inst) {
function precacheChildNodes (line 7830) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7863) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7897) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7910) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7964) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 8003) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 8133) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 8373) | function forceUpdateIfMounted() {
function isControlled (line 8380) | function isControlled(props) {
function _handleChange (line 8536) | function _handleChange(event) {
function handleElement (line 8627) | function handleElement(debugID, element) {
function flattenChildren (line 8674) | function flattenChildren(children) {
function updateOptionsIfPendingUpdateAndMounted (line 8801) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8814) | function getDeclarationErrorAddendum(owner) {
function checkSelectPropTypes (line 8830) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8858) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8964) | function _handleChange(event) {
function isCollapsed (line 9000) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 9018) | function getIEOffsets(node) {
function getModernOffsets (line 9041) | function getModernOffsets(node) {
function setIEOffsets (line 9103) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 9137) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 9416) | function forceUpdateIfMounted() {
function _handleChange (line 9536) | function _handleChange(event) {
function getLowestCommonAncestor (line 9566) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 9606) | function isAncestor(instA, instB) {
function getParentInstance (line 9622) | function getParentInstance(inst) {
function traverseTwoPhase (line 9631) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9653) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function handleElement (line 9774) | function handleElement(debugID, element) {
function emitEvent (line 9819) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function clearHistory (line 9843) | function clearHistory() {
function getTreeSnapshot (line 9848) | function getTreeSnapshot(registeredIDs) {
function resetMeasurements (line 9865) | function resetMeasurements() {
function checkDebugID (line 9892) | function checkDebugID(debugID) {
function beginLifeCycleTimer (line 9896) | function beginLifeCycleTimer(debugID, timerType) {
function endLifeCycleTimer (line 9907) | function endLifeCycleTimer(debugID, timerType) {
function pauseCurrentLifeCycleTimer (line 9925) | function pauseCurrentLifeCycleTimer() {
function resumeCurrentLifeCycleTimer (line 9939) | function resumeCurrentLifeCycleTimer() {
function ReactDefaultBatchingStrategyTransaction (line 10133) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 10202) | function inject() {
function hasValidRef (line 10287) | function hasValidRef(config) {
function hasValidKey (line 10299) | function hasValidKey(config) {
function getDeclarationErrorAddendum (line 10637) | function getDeclarationErrorAddendum() {
function getCurrentComponentErrorInfo (line 10654) | function getCurrentComponentErrorInfo(parentType) {
function validateExplicitKey (line 10677) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 10712) | function validateChildKeys(node, parentType) {
function validatePropTypes (line 10751) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10887) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10956) | function runEventQueueInBatch(events) {
function findParent (line 11004) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 11017) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 11031) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 11051) | function scrollValueMonitor(cb) {
function createInternalComponent (line 11203) | function createInternalComponent(element) {
function createInstanceForText (line 11212) | function createInstanceForText(text) {
function isTextComponent (line 11220) | function isTextComponent(component) {
function isInDocument (line 11327) | function isInDocument(node) {
function firstDifferenceIndex (line 11645) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11660) | function getReactRootElementInContainer(container) {
function internalGetID (line 11672) | function internalGetID(node) {
function mountComponentIntoNode (line 11687) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11713) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11730) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11759) | function hasNonRootReactChild(container) {
function getHostRootInstanceInContainer (line 11767) | function getHostRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11773) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 12127) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 12146) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 12164) | function makeRemove(child, node) {
function makeSetMarkup (line 12182) | function makeSetMarkup(markup) {
function makeTextContent (line 12200) | function makeTextContent(textContent) {
function enqueue (line 12216) | function enqueue(queue, update) {
function processQueue (line 12229) | function processQueue(inst, updateQueue) {
function warnNoop (line 12632) | function warnNoop(publicInstance, callerName) {
function is (line 12950) | function is(x, y) {
function createChainableTypeChecker (line 12963) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12984) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 13002) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 13006) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 13028) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 13039) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 13052) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 13074) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 13098) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 13119) | function createNodeChecker() {
function createShapeTypeChecker (line 13130) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 13153) | function isNode(propValue) {
function isSymbol (line 13200) | function isSymbol(propType, propValue) {
function getPropType (line 13220) | function getPropType(propValue) {
function getPreciseType (line 13239) | function getPreciseType(propValue) {
function getClassName (line 13252) | function getClassName(propValue) {
function ReactReconcileTransaction (line 13373) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13464) | function attachRefs() {
function attachRef (line 13634) | function attachRef(ref, component, owner) {
function detachRef (line 13643) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13751) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13782) | function renderToString(element) {
function renderToStaticMarkup (line 13792) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13844) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function _classCallCheck (line 13907) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function warnNoop (line 13913) | function warnNoop(publicInstance, callerName) {
function ReactServerUpdateQueue (line 13931) | function ReactServerUpdateQueue(transaction) {
function enqueueUpdate (line 14085) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 14089) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 14102) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 14319) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 14353) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 14383) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 14395) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 14399) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 14478) | function enqueueUpdate(component) {
function asap (line 14502) | function asap(callback, context) {
function getSelection (line 14914) | function getSelection(node) {
function constructSelectEvent (line 14945) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15715) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15754) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15791) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15828) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15898) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 16070) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 16126) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 16164) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 16249) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 16322) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 16368) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 16408) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 16468) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 16523) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16824) | function accumulateInto(current, next) {
function adler32 (line 16873) | function adler32(data) {
function checkReactTypeSpec (line 16956) | function checkReactTypeSpec(typeSpecs, values, location, componentName, ...
function dangerousStyleValue (line 17058) | function dangerousStyleValue(name, value, component) {
function escapeHtml (line 17163) | function escapeHtml(string) {
function escapeTextContentForBrowser (line 17220) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 17263) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 17317) | function flattenSingleChildIntoContext(traverseContext, child, name, sel...
function flattenChildren (line 17337) | function flattenChildren(children, selfDebugID) {
function forEachAccumulated (line 17377) | function forEachAccumulated(arr, cb, scope) {
function getEventCharCode (line 17411) | function getEventCharCode(nativeEvent) {
function getEventKey (line 17510) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 17569) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 17579) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 17606) | function getEventTarget(nativeEvent) {
function getHostComponentFromComposite (line 17636) | function getHostComponentFromComposite(inst) {
function getIteratorFn (line 17685) | function getIteratorFn(maybeIterable) {
function getLeafNode (line 17714) | function getLeafNode(node) {
function getSiblingNode (line 17728) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 17744) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 17792) | function getTextContentAccessor() {
function makePrefixMap (line 17825) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17885) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17937) | function getDeclarationErrorAddendum(owner) {
function getDisplayName (line 17947) | function getDisplayName(instance) {
function isInternalComponentType (line 17969) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17983) | function instantiateReactComponent(node, shouldHaveDebugID) {
function isEventSupported (line 18089) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 18149) | function isTextInputElement(elem) {
function onlyChild (line 18197) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 18225) | function quoteAttributeValueForBrowser(value) {
function reactProdInvariant (line 18251) | function reactProdInvariant(code) {
function shouldUpdateReactComponent (line 18461) | function shouldUpdateReactComponent(prevElement, nextElement) {
function getComponentKey (line 18519) | function getComponentKey(component, index) {
function traverseAllChildrenImpl (line 18538) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 18630) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 19154) | function camelize(string) {
function camelizeStyleName (line 19196) | function camelizeStyleName(string) {
function containsNode (line 19222) | function containsNode(outerNode, innerNode) {
function toArray (line 19266) | function toArray(obj) {
function hasArrayNature (line 19314) | function hasArrayNature(obj) {
function createArrayFromMixed (line 19357) | function createArrayFromMixed(obj) {
function getNodeName (line 19406) | function getNodeName(markup) {
function createNodesFromMarkup (line 19421) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 19466) | function makeEmptyFunction(arg) {
function focusNode (line 19528) | function focusNode(node) {
function getActiveElement (line 19561) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 19651) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 19693) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 19735) | function hyphenate(string) {
function hyphenateStyleName (line 19774) | function hyphenateStyleName(string) {
function invariant (line 19803) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 19847) | function isNode(object) {
function isTextNode (line 19872) | function isTextNode(object) {
function mapObject (line 19997) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 20030) | function memoizeStringOnly(callback) {
function is (line 20121) | function is(x, y) {
function shallowEqual (line 20138) | function shallowEqual(objA, objB) {
function toObject (line 20228) | function toObject(val) {
function shouldUseNative (line 20236) | function shouldUseNative() {
FILE: demos/react-lifecycle-demo/jquery.js
function isArraylike (line 571) | function isArraylike( obj ) {
function Sizzle (line 788) | function Sizzle( selector, context, results, seed ) {
function createCache (line 902) | function createCache() {
function markFunction (line 920) | function markFunction( fn ) {
function assert (line 929) | function assert( fn ) {
function addHandle (line 951) | function addHandle( attrs, handler ) {
function siblingCheck (line 966) | function siblingCheck( a, b ) {
function createInputPseudo (line 993) | function createInputPseudo( type ) {
function createButtonPseudo (line 1004) | function createButtonPseudo( type ) {
function createPositionalPseudo (line 1015) | function createPositionalPseudo( fn ) {
function testContext (line 1038) | function testContext( context ) {
function setFilters (line 2047) | function setFilters() {}
function toSelector (line 2118) | function toSelector( tokens ) {
function addCombinator (line 2128) | function addCombinator( matcher, combinator, base ) {
function elementMatcher (line 2181) | function elementMatcher( matchers ) {
function multipleContexts (line 2195) | function multipleContexts( selector, contexts, results ) {
function condense (line 2204) | function condense( unmatched, map, filter, context, xml ) {
function setMatcher (line 2225) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
function matcherFromTokens (line 2318) | function matcherFromTokens( tokens ) {
function matcherFromGroupMatchers (line 2376) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
function winnow (line 2672) | function winnow( elements, qualifier, not ) {
function sibling (line 3002) | function sibling( cur, dir ) {
function createOptions (line 3085) | function createOptions( options ) {
function detach (line 3485) | function detach() {
function completed (line 3499) | function completed() {
function dataAttr (line 3662) | function dataAttr( elem, key, data ) {
function isEmptyDataObject (line 3694) | function isEmptyDataObject( obj ) {
function internalData (line 3710) | function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
function internalRemoveData (line 3799) | function internalRemoveData( elem, name, pvt ) {
function returnTrue (line 4284) | function returnTrue() {
function returnFalse (line 4288) | function returnFalse() {
function safeActiveElement (line 4292) | function safeActiveElement() {
function createSafeFragment (line 5301) | function createSafeFragment( document ) {
function getAll (line 5353) | function getAll( context, tag ) {
function fixDefaultChecked (line 5376) | function fixDefaultChecked( elem ) {
function manipulationTarget (line 5384) | function manipulationTarget( elem, content ) {
function disableScript (line 5394) | function disableScript( elem ) {
function restoreScript (line 5398) | function restoreScript( elem ) {
function setGlobalEval (line 5409) | function setGlobalEval( elems, refElements ) {
function cloneCopyEvent (line 5417) | function cloneCopyEvent( src, dest ) {
function fixCloneNodeIssues (line 5445) | function fixCloneNodeIssues( src, dest ) {
function actualDisplay (line 6036) | function actualDisplay( name, doc ) {
function defaultDisplay (line 6058) | function defaultDisplay( nodeName ) {
function addGetHookIf (line 6257) | function addGetHookIf( conditionFn, hookFn ) {
function computeStyleTests (line 6351) | function computeStyleTests() {
function vendorPropName (line 6471) | function vendorPropName( style, name ) {
function showHide (line 6493) | function showHide( elements, show ) {
function setPositiveNumber (line 6544) | function setPositiveNumber( elem, value, subtract ) {
function augmentWidthOrHeight (line 6552) | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
function getWidthOrHeight (line 6591) | function getWidthOrHeight( elem, name, extra ) {
function Tween (line 6930) | function Tween( elem, options, prop, end, easing ) {
function createFxNow (line 7099) | function createFxNow() {
function genFx (line 7107) | function genFx( type, includeWidth ) {
function createTween (line 7127) | function createTween( value, prop, animation ) {
function defaultPrefilter (line 7141) | function defaultPrefilter( elem, props, opts ) {
function propFilter (line 7283) | function propFilter( props, specialEasing ) {
function Animation (line 7320) | function Animation( elem, properties, options ) {
function addToPrefiltersOrTransports (line 8634) | function addToPrefiltersOrTransports( structure ) {
function inspectPrefiltersOrTransports (line 8666) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
function ajaxExtend (line 8693) | function ajaxExtend( target, src ) {
function ajaxHandleResponses (line 8713) | function ajaxHandleResponses( s, jqXHR, responses ) {
function ajaxConvert (line 8768) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
function done (line 9228) | function done( status, nativeStatusText, responses, headers ) {
function buildParams (line 9473) | function buildParams( prefix, obj, traditional, add ) {
function createStandardXHR (line 9746) | function createStandardXHR() {
function createActiveXHR (line 9752) | function createActiveXHR() {
function getWindow (line 10057) | function getWindow( elem ) {
FILE: demos/react-lifecycle-demo/react.js
function s (line 4) | function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&re...
function isPresto (line 76) | function isPresto() {
function isKeypressCommand (line 126) | function isKeypressCommand(nativeEvent) {
function getCompositionEventType (line 138) | function getCompositionEventType(topLevelType) {
function isFallbackCompositionStart (line 157) | function isFallbackCompositionStart(topLevelType, nativeEvent) {
function isFallbackCompositionEnd (line 168) | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
function getDataFromCustomEvent (line 196) | function getDataFromCustomEvent(nativeEvent) {
function extractCompositionEvent (line 210) | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, ...
function getNativeBeforeInputChars (line 262) | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
function getFallbackBeforeInputChars (line 316) | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
function extractBeforeInputEvent (line 368) | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, ...
function prefixKey (line 481) | function prefixKey(prefix, key) {
function CallbackQueue (line 805) | function CallbackQueue() {
function shouldUseChangeEvent (line 930) | function shouldUseChangeEvent(elem) {
function manualDispatchChangeEvent (line 941) | function manualDispatchChangeEvent(nativeEvent) {
function runEventInBatch (line 959) | function runEventInBatch(event) {
function startWatchingForChangeEventIE8 (line 964) | function startWatchingForChangeEventIE8(target, targetInst) {
function stopWatchingForChangeEventIE8 (line 970) | function stopWatchingForChangeEventIE8() {
function getTargetInstForChangeEvent (line 979) | function getTargetInstForChangeEvent(topLevelType, targetInst) {
function handleEventsForChangeEventIE8 (line 984) | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
function startWatchingForValueChange (line 1027) | function startWatchingForValueChange(target, targetInst) {
function stopWatchingForValueChange (line 1047) | function stopWatchingForValueChange() {
function handlePropertyChange (line 1071) | function handlePropertyChange(nativeEvent) {
function getTargetInstForInputEvent (line 1087) | function getTargetInstForInputEvent(topLevelType, targetInst) {
function handleEventsForInputEventIE (line 1095) | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
function getTargetInstForInputEventIE (line 1118) | function getTargetInstForInputEventIE(topLevelType, targetInst) {
function shouldUseClickEvent (line 1140) | function shouldUseClickEvent(elem) {
function getTargetInstForClickEvent (line 1147) | function getTargetInstForClickEvent(topLevelType, targetInst) {
function getNodeAfter (line 1230) | function getNodeAfter(parentNode, node) {
function insertLazyTreeChildAt (line 1254) | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
function moveChild (line 1258) | function moveChild(parentNode, childNode, referenceNode) {
function removeChild (line 1266) | function removeChild(parentNode, childNode) {
function moveDelimitedText (line 1276) | function moveDelimitedText(parentNode, openingComment, closingComment, r...
function removeDelimitedText (line 1288) | function removeDelimitedText(parentNode, startNode, closingComment) {
function replaceDelimitedText (line 1300) | function replaceDelimitedText(openingComment, closingComment, stringText) {
function insertTreeChildren (line 1437) | function insertTreeChildren(tree) {
function replaceChildWithTree (line 1470) | function replaceChildWithTree(oldNode, newTree) {
function queueChild (line 1475) | function queueChild(parentTree, childTree) {
function queueHTML (line 1483) | function queueHTML(tree, html) {
function queueText (line 1491) | function queueText(tree, text) {
function toString (line 1499) | function toString() {
function DOMLazyTree (line 1503) | function DOMLazyTree(node) {
function checkMask (line 1559) | function checkMask(value, bitmask) {
function isAttributeNameSafe (line 1774) | function isAttributeNameSafe(attributeName) {
function shouldIgnoreValue (line 1790) | function shouldIgnoreValue(propertyInfo, value) {
function recomputePluginOrdering (line 2584) | function recomputePluginOrdering() {
function publishEventForPlugin (line 2613) | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
function publishRegistrationName (line 2641) | function publishRegistrationName(registrationName, PluginModule, eventNa...
function isEndish (line 2848) | function isEndish(topLevelType) {
function isMoveish (line 2852) | function isMoveish(topLevelType) {
function isStartish (line 2855) | function isStartish(topLevelType) {
function executeDispatch (line 2882) | function executeDispatch(event, simulated, listener, inst) {
function executeDispatchesInOrder (line 2896) | function executeDispatchesInOrder(event, simulated) {
function executeDispatchesInOrderStopAtTrueImpl (line 2924) | function executeDispatchesInOrderStopAtTrueImpl(event) {
function executeDispatchesInOrderStopAtTrue (line 2951) | function executeDispatchesInOrderStopAtTrue(event) {
function executeDirectDispatch (line 2967) | function executeDirectDispatch(event) {
function hasDispatches (line 2986) | function hasDispatches(event) {
function listenerAtPhase (line 3058) | function listenerAtPhase(inst, event, propagationPhase) {
function accumulateDirectionalDispatches (line 3069) | function accumulateDirectionalDispatches(inst, upwards, event) {
function accumulateTwoPhaseDispatchesSingle (line 3088) | function accumulateTwoPhaseDispatchesSingle(event) {
function accumulateTwoPhaseDispatchesSingleSkipTarget (line 3097) | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
function accumulateDispatches (line 3110) | function accumulateDispatches(inst, ignoredDirection, event) {
function accumulateDirectDispatchesSingle (line 3126) | function accumulateDirectDispatchesSingle(event) {
function accumulateTwoPhaseDispatches (line 3132) | function accumulateTwoPhaseDispatches(events) {
function accumulateTwoPhaseDispatchesSkipTarget (line 3136) | function accumulateTwoPhaseDispatchesSkipTarget(events) {
function accumulateEnterLeaveDispatches (line 3140) | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
function accumulateDirectDispatches (line 3144) | function accumulateDirectDispatches(events) {
function FallbackCompositionState (line 3198) | function FallbackCompositionState(root) {
function escape (line 3494) | function escape(key) {
function unescape (line 3513) | function unescape(key) {
function _assertSingleLink (line 3564) | function _assertSingleLink(inputProps) {
function _assertValueLink (line 3567) | function _assertValueLink(inputProps) {
function _assertCheckedLink (line 3572) | function _assertCheckedLink(inputProps) {
function getDeclarationErrorAddendum (line 3594) | function getDeclarationErrorAddendum(owner) {
function getListeningForDocument (line 4037) | function getListeningForDocument(mountAt) {
function instantiateChild (line 4218) | function instantiateChild(childInstances, child, name, selfDebugID) {
function escapeUserProvidedKey (line 4355) | function escapeUserProvidedKey(text) {
function ForEachBookKeeping (line 4367) | function ForEachBookKeeping(forEachFunction, forEachContext) {
function forEachSingleChild (line 4379) | function forEachSingleChild(bookKeeping, child, name) {
function forEachChildren (line 4398) | function forEachChildren(children, forEachFunc, forEachContext) {
function MapBookKeeping (line 4416) | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
function mapSingleChildIntoContext (line 4432) | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
function mapIntoWithKeyPrefixInternal (line 4453) | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, con...
function mapChildren (line 4476) | function mapChildren(children, func, context) {
function forEachSingleChildDummy (line 4485) | function forEachSingleChildDummy(traverseContext, child, name) {
function countChildren (line 4498) | function countChildren(children, context) {
function toArray (line 4508) | function toArray(children) {
function validateTypeDef (line 4881) | function validateTypeDef(Constructor, typeDef, location) {
function validateMethodOverride (line 4891) | function validateMethodOverride(isAlreadyDefined, name) {
function mixSpecIntoComponent (line 4909) | function mixSpecIntoComponent(Constructor, spec) {
function mixStaticSpecIntoComponent (line 4984) | function mixStaticSpecIntoComponent(Constructor, statics) {
function mergeIntoWithNoDuplicateKeys (line 5010) | function mergeIntoWithNoDuplicateKeys(one, two) {
function createMergedResultFunction (line 5030) | function createMergedResultFunction(one, two) {
function createChainedFunction (line 5054) | function createChainedFunction(one, two) {
function bindAutoBindMethod (line 5068) | function bindAutoBindMethod(component, method) {
function bindAutoBindMethods (line 5105) | function bindAutoBindMethods(component) {
function ReactComponent (line 5275) | function ReactComponent(props, context, updater) {
function updateTree (line 5487) | function updateTree(id, update) {
function purgeDeep (line 5503) | function purgeDeep(id) {
function describeComponentFrame (line 5513) | function describeComponentFrame(name, source, ownerName) {
function describeID (line 5517) | function describeID(id) {
function StatelessComponent (line 5715) | function StatelessComponent(Component) {}
function warnIfInvalidElement (line 5723) | function warnIfInvalidElement(Component, element) {
function invokeComponentDidMountWithTimer (line 5730) | function invokeComponentDidMountWithTimer() {
function invokeComponentDidUpdateWithTimer (line 5741) | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevCon...
function shouldConstruct (line 5752) | function shouldConstruct(Component) {
function getDeclarationErrorAddendum (line 6804) | function getDeclarationErrorAddendum(internalInstance) {
function friendlyStringify (line 6817) | function friendlyStringify(obj) {
function checkAndWarnForMutatedStyle (line 6843) | function checkAndWarnForMutatedStyle(style1, style2, component) {
function assertValidProps (line 6873) | function assertValidProps(component, props) {
function enqueuePutListener (line 6893) | function enqueuePutListener(inst, registrationName, listener, transactio...
function putListener (line 6913) | function putListener() {
function inputPostMount (line 6918) | function inputPostMount() {
function textareaPostMount (line 6923) | function textareaPostMount() {
function optionPostMount (line 6928) | function optionPostMount() {
function trapBubbledEventsLocal (line 6994) | function trapBubbledEventsLocal() {
function postUpdateSelectWrapper (line 7035) | function postUpdateSelectWrapper() {
function validateDangerousTag (line 7082) | function validateDangerousTag(tag) {
function isCustomComponent (line 7089) | function isCustomComponent(tagName, props) {
function ReactDOMComponent (line 7109) | function ReactDOMComponent(element) {
function getRenderedHostOrTextFromComponent (line 7790) | function getRenderedHostOrTextFromComponent(component) {
function precacheNode (line 7802) | function precacheNode(inst, node) {
function uncacheNode (line 7808) | function uncacheNode(inst) {
function precacheChildNodes (line 7830) | function precacheChildNodes(inst, node) {
function getClosestInstanceFromNode (line 7863) | function getClosestInstanceFromNode(node) {
function getInstanceFromNode (line 7897) | function getInstanceFromNode(node) {
function getNodeFromInstance (line 7910) | function getNodeFromInstance(inst) {
function ReactDOMContainerInfo (line 7964) | function ReactDOMContainerInfo(topLevelWrapper, node) {
function emitEvent (line 8003) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function createDOMFactory (line 8133) | function createDOMFactory(tag) {
function forceUpdateIfMounted (line 8373) | function forceUpdateIfMounted() {
function isControlled (line 8380) | function isControlled(props) {
function _handleChange (line 8536) | function _handleChange(event) {
function handleElement (line 8627) | function handleElement(debugID, element) {
function flattenChildren (line 8674) | function flattenChildren(children) {
function updateOptionsIfPendingUpdateAndMounted (line 8801) | function updateOptionsIfPendingUpdateAndMounted() {
function getDeclarationErrorAddendum (line 8814) | function getDeclarationErrorAddendum(owner) {
function checkSelectPropTypes (line 8830) | function checkSelectPropTypes(inst, props) {
function updateOptions (line 8858) | function updateOptions(inst, multiple, propValue) {
function _handleChange (line 8964) | function _handleChange(event) {
function isCollapsed (line 9000) | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
function getIEOffsets (line 9018) | function getIEOffsets(node) {
function getModernOffsets (line 9041) | function getModernOffsets(node) {
function setIEOffsets (line 9103) | function setIEOffsets(node, offsets) {
function setModernOffsets (line 9137) | function setModernOffsets(node, offsets) {
function forceUpdateIfMounted (line 9416) | function forceUpdateIfMounted() {
function _handleChange (line 9536) | function _handleChange(event) {
function getLowestCommonAncestor (line 9566) | function getLowestCommonAncestor(instA, instB) {
function isAncestor (line 9606) | function isAncestor(instA, instB) {
function getParentInstance (line 9622) | function getParentInstance(inst) {
function traverseTwoPhase (line 9631) | function traverseTwoPhase(inst, fn, arg) {
function traverseEnterLeave (line 9653) | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
function handleElement (line 9774) | function handleElement(debugID, element) {
function emitEvent (line 9819) | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
function clearHistory (line 9843) | function clearHistory() {
function getTreeSnapshot (line 9848) | function getTreeSnapshot(registeredIDs) {
function resetMeasurements (line 9865) | function resetMeasurements() {
function checkDebugID (line 9892) | function checkDebugID(debugID) {
function beginLifeCycleTimer (line 9896) | function beginLifeCycleTimer(debugID, timerType) {
function endLifeCycleTimer (line 9907) | function endLifeCycleTimer(debugID, timerType) {
function pauseCurrentLifeCycleTimer (line 9925) | function pauseCurrentLifeCycleTimer() {
function resumeCurrentLifeCycleTimer (line 9939) | function resumeCurrentLifeCycleTimer() {
function ReactDefaultBatchingStrategyTransaction (line 10133) | function ReactDefaultBatchingStrategyTransaction() {
function inject (line 10202) | function inject() {
function hasValidRef (line 10287) | function hasValidRef(config) {
function hasValidKey (line 10299) | function hasValidKey(config) {
function getDeclarationErrorAddendum (line 10637) | function getDeclarationErrorAddendum() {
function getCurrentComponentErrorInfo (line 10654) | function getCurrentComponentErrorInfo(parentType) {
function validateExplicitKey (line 10677) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 10712) | function validateChildKeys(node, parentType) {
function validatePropTypes (line 10751) | function validatePropTypes(element) {
function invokeGuardedCallback (line 10887) | function invokeGuardedCallback(name, func, a, b) {
function runEventQueueInBatch (line 10956) | function runEventQueueInBatch(events) {
function findParent (line 11004) | function findParent(inst) {
function TopLevelCallbackBookKeeping (line 11017) | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
function handleTopLevelImpl (line 11031) | function handleTopLevelImpl(bookKeeping) {
function scrollValueMonitor (line 11051) | function scrollValueMonitor(cb) {
function createInternalComponent (line 11203) | function createInternalComponent(element) {
function createInstanceForText (line 11212) | function createInstanceForText(text) {
function isTextComponent (line 11220) | function isTextComponent(component) {
function isInDocument (line 11327) | function isInDocument(node) {
function firstDifferenceIndex (line 11645) | function firstDifferenceIndex(string1, string2) {
function getReactRootElementInContainer (line 11660) | function getReactRootElementInContainer(container) {
function internalGetID (line 11672) | function internalGetID(node) {
function mountComponentIntoNode (line 11687) | function mountComponentIntoNode(wrapperInstance, container, transaction,...
function batchedMountComponentIntoNode (line 11713) | function batchedMountComponentIntoNode(componentInstance, container, sho...
function unmountComponentFromNode (line 11730) | function unmountComponentFromNode(instance, container, safely) {
function hasNonRootReactChild (line 11759) | function hasNonRootReactChild(container) {
function getHostRootInstanceInContainer (line 11767) | function getHostRootInstanceInContainer(container) {
function getTopLevelWrapperInContainer (line 11773) | function getTopLevelWrapperInContainer(container) {
function makeInsertMarkup (line 12127) | function makeInsertMarkup(markup, afterNode, toIndex) {
function makeMove (line 12146) | function makeMove(child, afterNode, toIndex) {
function makeRemove (line 12164) | function makeRemove(child, node) {
function makeSetMarkup (line 12182) | function makeSetMarkup(markup) {
function makeTextContent (line 12200) | function makeTextContent(textContent) {
function enqueue (line 12216) | function enqueue(queue, update) {
function processQueue (line 12229) | function processQueue(inst, updateQueue) {
function warnNoop (line 12632) | function warnNoop(publicInstance, callerName) {
function is (line 12950) | function is(x, y) {
function createChainableTypeChecker (line 12963) | function createChainableTypeChecker(validate) {
function createPrimitiveTypeChecker (line 12984) | function createPrimitiveTypeChecker(expectedType) {
function createAnyTypeChecker (line 13002) | function createAnyTypeChecker() {
function createArrayOfTypeChecker (line 13006) | function createArrayOfTypeChecker(typeChecker) {
function createElementTypeChecker (line 13028) | function createElementTypeChecker() {
function createInstanceTypeChecker (line 13039) | function createInstanceTypeChecker(expectedClass) {
function createEnumTypeChecker (line 13052) | function createEnumTypeChecker(expectedValues) {
function createObjectOfTypeChecker (line 13074) | function createObjectOfTypeChecker(typeChecker) {
function createUnionTypeChecker (line 13098) | function createUnionTypeChecker(arrayOfTypeCheckers) {
function createNodeChecker (line 13119) | function createNodeChecker() {
function createShapeTypeChecker (line 13130) | function createShapeTypeChecker(shapeTypes) {
function isNode (line 13153) | function isNode(propValue) {
function isSymbol (line 13200) | function isSymbol(propType, propValue) {
function getPropType (line 13220) | function getPropType(propValue) {
function getPreciseType (line 13239) | function getPreciseType(propValue) {
function getClassName (line 13252) | function getClassName(propValue) {
function ReactReconcileTransaction (line 13373) | function ReactReconcileTransaction(useCreateElement) {
function attachRefs (line 13464) | function attachRefs() {
function attachRef (line 13634) | function attachRef(ref, component, owner) {
function detachRef (line 13643) | function detachRef(ref, component, owner) {
function renderToStringImpl (line 13751) | function renderToStringImpl(element, makeStaticMarkup) {
function renderToString (line 13782) | function renderToString(element) {
function renderToStaticMarkup (line 13792) | function renderToStaticMarkup(element) {
function ReactServerRenderingTransaction (line 13844) | function ReactServerRenderingTransaction(renderToStaticMarkup) {
function _classCallCheck (line 13907) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function warnNoop (line 13913) | function warnNoop(publicInstance, callerName) {
function ReactServerUpdateQueue (line 13931) | function ReactServerUpdateQueue(transaction) {
function enqueueUpdate (line 14085) | function enqueueUpdate(internalInstance) {
function formatUnexpectedArgument (line 14089) | function formatUnexpectedArgument(arg) {
function getInternalInstanceReadyForUpdate (line 14102) | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
function ensureInjected (line 14319) | function ensureInjected() {
function ReactUpdatesFlushTransaction (line 14353) | function ReactUpdatesFlushTransaction() {
function batchedUpdates (line 14383) | function batchedUpdates(callback, a, b, c, d, e) {
function mountOrderComparator (line 14395) | function mountOrderComparator(c1, c2) {
function runBatchedUpdates (line 14399) | function runBatchedUpdates(transaction) {
function enqueueUpdate (line 14478) | function enqueueUpdate(component) {
function asap (line 14502) | function asap(callback, context) {
function getSelection (line 14914) | function getSelection(node) {
function constructSelectEvent (line 14945) | function constructSelectEvent(nativeEvent, nativeEventTarget) {
function SyntheticAnimationEvent (line 15715) | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticClipboardEvent (line 15754) | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE...
function SyntheticCompositionEvent (line 15791) | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativ...
function SyntheticDragEvent (line 15828) | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,...
function SyntheticEvent (line 15898) | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE...
function getPooledWarningPropertyDefinition (line 16070) | function getPooledWarningPropertyDefinition(propName, getVal) {
function SyntheticFocusEvent (line 16126) | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticInputEvent (line 16164) | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticKeyboardEvent (line 16249) | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv...
function SyntheticMouseEvent (line 16322) | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTouchEvent (line 16368) | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent...
function SyntheticTransitionEvent (line 16408) | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native...
function SyntheticUIEvent (line 16468) | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, n...
function SyntheticWheelEvent (line 16523) | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent...
function accumulateInto (line 16824) | function accumulateInto(current, next) {
function adler32 (line 16873) | function adler32(data) {
function checkReactTypeSpec (line 16956) | function checkReactTypeSpec(typeSpecs, values, location, componentName, ...
function dangerousStyleValue (line 17058) | function dangerousStyleValue(name, value, component) {
function escapeHtml (line 17163) | function escapeHtml(string) {
function escapeTextContentForBrowser (line 17220) | function escapeTextContentForBrowser(text) {
function findDOMNode (line 17263) | function findDOMNode(componentOrElement) {
function flattenSingleChildIntoContext (line 17317) | function flattenSingleChildIntoContext(traverseContext, child, name, sel...
function flattenChildren (line 17337) | function flattenChildren(children, selfDebugID) {
function forEachAccumulated (line 17377) | function forEachAccumulated(arr, cb, scope) {
function getEventCharCode (line 17411) | function getEventCharCode(nativeEvent) {
function getEventKey (line 17510) | function getEventKey(nativeEvent) {
function modifierStateGetter (line 17569) | function modifierStateGetter(keyArg) {
function getEventModifierState (line 17579) | function getEventModifierState(nativeEvent) {
function getEventTarget (line 17606) | function getEventTarget(nativeEvent) {
function getHostComponentFromComposite (line 17636) | function getHostComponentFromComposite(inst) {
function getIteratorFn (line 17685) | function getIteratorFn(maybeIterable) {
function getLeafNode (line 17714) | function getLeafNode(node) {
function getSiblingNode (line 17728) | function getSiblingNode(node) {
function getNodeForCharacterOffset (line 17744) | function getNodeForCharacterOffset(root, offset) {
function getTextContentAccessor (line 17792) | function getTextContentAccessor() {
function makePrefixMap (line 17825) | function makePrefixMap(styleProp, eventName) {
function getVendorPrefixedEventName (line 17885) | function getVendorPrefixedEventName(eventName) {
function getDeclarationErrorAddendum (line 17937) | function getDeclarationErrorAddendum(owner) {
function getDisplayName (line 17947) | function getDisplayName(instance) {
function isInternalComponentType (line 17969) | function isInternalComponentType(type) {
function instantiateReactComponent (line 17983) | function instantiateReactComponent(node, shouldHaveDebugID) {
function isEventSupported (line 18089) | function isEventSupported(eventNameSuffix, capture) {
function isTextInputElement (line 18149) | function isTextInputElement(elem) {
function onlyChild (line 18197) | function onlyChild(children) {
function quoteAttributeValueForBrowser (line 18225) | function quoteAttributeValueForBrowser(value) {
function reactProdInvariant (line 18251) | function reactProdInvariant(code) {
function shouldUpdateReactComponent (line 18461) | function shouldUpdateReactComponent(prevElement, nextElement) {
function getComponentKey (line 18519) | function getComponentKey(component, index) {
function traverseAllChildrenImpl (line 18538) | function traverseAllChildrenImpl(children, nameSoFar, callback, traverse...
function traverseAllChildren (line 18630) | function traverseAllChildren(children, callback, traverseContext) {
function camelize (line 19154) | function camelize(string) {
function camelizeStyleName (line 19196) | function camelizeStyleName(string) {
function containsNode (line 19222) | function containsNode(outerNode, innerNode) {
function toArray (line 19266) | function toArray(obj) {
function hasArrayNature (line 19314) | function hasArrayNature(obj) {
function createArrayFromMixed (line 19357) | function createArrayFromMixed(obj) {
function getNodeName (line 19406) | function getNodeName(markup) {
function createNodesFromMarkup (line 19421) | function createNodesFromMarkup(markup, handleScript) {
function makeEmptyFunction (line 19466) | function makeEmptyFunction(arg) {
function focusNode (line 19528) | function focusNode(node) {
function getActiveElement (line 19561) | function getActiveElement() /*?DOMElement*/{
function getMarkupWrap (line 19651) | function getMarkupWrap(nodeName) {
function getUnboundedScrollPosition (line 19693) | function getUnboundedScrollPosition(scrollable) {
function hyphenate (line 19735) | function hyphenate(string) {
function hyphenateStyleName (line 19774) | function hyphenateStyleName(string) {
function invariant (line 19803) | function invariant(condition, format, a, b, c, d, e, f) {
function isNode (line 19847) | function isNode(object) {
function isTextNode (line 19872) | function isTextNode(object) {
function mapObject (line 19997) | function mapObject(object, callback, context) {
function memoizeStringOnly (line 20030) | function memoizeStringOnly(callback) {
function is (line 20121) | function is(x, y) {
function shallowEqual (line 20138) | function shallowEqual(objA, objB) {
function toObject (line 20228) | function toObject(val) {
function shouldUseNative (line 20236) | function shouldUseNative() {
FILE: demos/redux-demo/app/App.js
function mapStateToProps (line 5) | function mapStateToProps(state) {
function mapDispatchToProps (line 13) | function mapDispatchToProps(dispatch) {
FILE: demos/redux-demo/app/myComponent.js
class MyComponent (line 4) | class MyComponent extends React.Component {
method render (line 5) | render() {
FILE: demos/redux-demo/app/reducer.js
function reducer (line 1) | function reducer(state = {
FILE: demos/simple-app-demo/bundle.js
function n (line 1) | function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{...
function w (line 28) | function w(e,t,n){var r,i=(t=t||a).createElement("script");if(i.text=e,n...
function T (line 28) | function T(e){return null==e?e+"":"object"==typeof e||"function"==typeof...
function S (line 28) | function S(e){var t=!!e&&"length"in e&&e.length,n=T(e);return!m(e)&&!x(e...
function oe (line 39) | function oe(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,T=t?t.nodeTy...
function ae (line 39) | function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cac...
function se (line 39) | function se(e){return e[b]=!0,e}
function ue (line 39) | function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(...
function le (line 39) | function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i...
function ce (line 39) | function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourc...
function fe (line 39) | function fe(e){return function(t){return"input"===t.nodeName.toLowerCase...
function pe (line 39) | function pe(e){return function(t){var n=t.nodeName.toLowerCase();return(...
function de (line 39) | function de(e){return function(t){return"form"in t?t.parentNode&&!1===t....
function he (line 39) | function he(e){return se(function(t){return t=+t,se(function(n,r){for(va...
function ge (line 39) | function ge(e){return e&&void 0!==e.getElementsByTagName&&e}
function ve (line 39) | function ve(){}
function ye (line 39) | function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}
function me (line 39) | function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C...
function xe (line 39) | function xe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;...
function be (line 39) | function be(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(...
function we (line 39) | function we(e,t,n,r,i,o){return r&&!r[b]&&(r=we(r)),i&&!i[b]&&(i=we(i,o)...
function Te (line 39) | function Te(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.r...
function A (line 39) | function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerC...
function L (line 39) | function L(e,t,n){return m(t)?C.grep(e,function(e,r){return!!t.call(e,r,...
function R (line 39) | function R(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}
function W (line 39) | function W(e){return e}
function $ (line 39) | function $(e){throw e}
function B (line 39) | function B(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n...
function a (line 39) | function a(e,t,r,i){return function(){var s=this,u=arguments,l=function(...
function z (line 39) | function z(){a.removeEventListener("DOMContentLoaded",z),n.removeEventLi...
function G (line 39) | function G(e,t){return t.toUpperCase()}
function Y (line 39) | function Y(e){return e.replace(U,"ms-").replace(V,G)}
function J (line 39) | function J(){this.expando=C.expando+J.uid++}
function ne (line 39) | function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.re...
function ue (line 39) | function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:functio...
function ce (line 39) | function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t...
function fe (line 39) | function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&...
function ve (line 39) | function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getEle...
function ye (line 39) | function ye(e,t){for(var n=0,r=e.length;n<r;n++)K.set(e[n],"globalEval",...
function xe (line 39) | function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),...
function Ee (line 39) | function Ee(){return!0}
function Se (line 39) | function Se(){return!1}
function ke (line 39) | function ke(){try{return a.activeElement}catch(e){}}
function je (line 39) | function je(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"...
function Le (line 39) | function Le(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"...
function He (line 39) | function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}
function Oe (line 39) | function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.sli...
function Pe (line 39) | function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(K.hasData(e)&...
function Me (line 39) | function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.t...
function Re (line 39) | function Re(e,t,n,r){t=l.apply([],t);var i,o,a,s,u,c,f=0,p=e.length,d=p-...
function Ie (line 39) | function Ie(e,t,n){for(var r,i=t?C.filter(t,e):e,o=0;null!=(r=i[o]);o++)...
function Fe (line 39) | function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n....
function _e (line 39) | function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(...
function e (line 39) | function e(){if(c){l.style.cssText="position:absolute;left:-11111px;widt...
function t (line 39) | function t(e){return Math.round(parseFloat(e))}
function Qe (line 39) | function Qe(e){var t=C.cssProps[e];return t||(t=C.cssProps[e]=function(e...
function Je (line 39) | function Je(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[...
function Ke (line 39) | function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border...
function Ze (line 39) | function Ze(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===C.css(e,"box...
function et (line 39) | function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}
function ot (line 39) | function ot(){nt&&(!1===a.hidden&&n.requestAnimationFrame?n.requestAnima...
function at (line 39) | function at(){return n.setTimeout(function(){tt=void 0}),tt=Date.now()}
function st (line 39) | function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin...
function ut (line 39) | function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["...
function lt (line 39) | function lt(e,t,n){var r,i,o=0,a=lt.prefilters.length,s=C.Deferred().alw...
function ht (line 39) | function ht(e){return(e.match(I)||[]).join(" ")}
function gt (line 39) | function gt(e){return e.getAttribute&&e.getAttribute("class")||""}
function vt (line 39) | function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)|...
function jt (line 39) | function jt(e,t,n,r){var i;if(Array.isArray(t))C.each(t,function(t,i){n|...
function It (line 39) | function It(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var ...
function Wt (line 39) | function Wt(e,t,n,r){var i={},o=e===Pt;function a(s){var u;return i[s]=!...
function $t (line 39) | function $t(e,t){var n,r,i=C.ajaxSettings.flatOptions||{};for(n in t)voi...
function S (line 39) | function S(e,t,a,s){var l,p,d,b,w,T=t;c||(c=!0,u&&n.clearTimeout(u),r=vo...
FILE: demos/vue-demo/app3.js
method increment (line 7) | increment() {
Condensed preview — 91 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,470K chars).
[
{
"path": ".gitignore",
"chars": 27,
"preview": "node_modules\ninstructor.md\n"
},
{
"path": "README.md",
"chars": 630,
"preview": "全栈工程师培训材料,帮助学习者掌握 JavaScript 全栈开发的基本知识,承担简单 Web 应用的前后端开发。\n\n一共四讲,适合两天的训练营。\n\n## 学员要求\n\n本培训不是零基础的,要求学员具备互联网开发的基本知识。\n\n- HTML\n"
},
{
"path": "demos/README.md",
"chars": 21096,
"preview": "# 课堂练习的操作指导\n\n## 目录\n\n- 前端开发的历史和趋势\n - [Backbone](#backbone)\n - [Angular](#angular)\n - [Vue](#vue)\n- React 技术栈\n - [JSX]"
},
{
"path": "demos/angular-demo/index.html",
"chars": 235,
"preview": "<!DOCTYPE html>\n<html>\n<meta charset=\"UTF-8\"/>\n<script src=\"angular.1.4.8.min.js\"></script>\n<body>\n<div ng-app=\"\">\n <p>"
},
{
"path": "demos/backbone-demo/index.html",
"chars": 536,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Backbone Demo</title>\n</head>\n<body>\n\n<h1>Backbone Routi"
},
{
"path": "demos/backbone-demo/js/backbone.js",
"chars": 16463,
"preview": "// Backbone.js 0.9.2\n\n// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.\n// Backbone may be freely distributed under t"
},
{
"path": "demos/backbone-demo/js/jquery.js",
"chars": 265215,
"preview": "/*!\n * jQuery JavaScript Library v1.8.2\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Cop"
},
{
"path": "demos/backbone-demo/js/main.js",
"chars": 782,
"preview": "(function() {\n\nwindow.App = {\n\tModels: {},\n\tCollections: {},\n\tViews: {},\n\tRouter: {}\n};\n\nApp.Router = Backbone.Router.ex"
},
{
"path": "demos/backbone-demo/js/underscore.js",
"chars": 40966,
"preview": "// Underscore.js 1.4.2\n// http://underscorejs.org\n// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n// "
},
{
"path": "demos/eslint-demo/index.js",
"chars": 35,
"preview": "var x = 1;\nconsole.log('x is', x);\n"
},
{
"path": "demos/eslint-demo/package.json",
"chars": 225,
"preview": "{\n \"name\": \"eslint-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \""
},
{
"path": "demos/express-demo/app1.js",
"chars": 304,
"preview": "var express = require('express');\nvar app = express();\n\nvar port = process.env.PORT || 8080;\nvar router = expr"
},
{
"path": "demos/express-demo/app2.js",
"chars": 405,
"preview": "var express = require('express');\nvar app = express();\n\nvar port = process.env.PORT || 8080;\nvar router = expr"
},
{
"path": "demos/express-demo/app3.js",
"chars": 611,
"preview": "var express = require('express');\nvar app = express();\nvar bodyParser = require('body-parser');\n\napp.use(bodyP"
},
{
"path": "demos/express-demo/app4.js",
"chars": 705,
"preview": "var express = require('express');\nvar app = express();\nvar bodyParser = require('body-parser');\n\napp.use(bodyP"
},
{
"path": "demos/express-demo/package.json",
"chars": 143,
"preview": "{\n \"name\": \"node-api\",\n \"main\": \"server.js\",\n \"dependencies\": {\n \"express\": \"~4.17.1\",\n \"body-par"
},
{
"path": "demos/jsx-demo/index.html",
"chars": 375,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/jsx-demo/react-dom.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.2.1\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/jsx-demo/react.js",
"chars": 691206,
"preview": " /**\n * React v15.2.1\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demos/mobx-demo/.babelrc",
"chars": 296,
"preview": "{\n \"presets\": [ \"es2015\", \"stage-0\", \"react\"],\n\n /* if you want to use babel runtime, uncomment the following line */\n"
},
{
"path": "demos/mobx-demo/.eslintignore",
"chars": 35,
"preview": "node_modules/**\n**/*.css\n**/*.html\n"
},
{
"path": "demos/mobx-demo/.eslintrc",
"chars": 258,
"preview": "{\n \"env\": {\n \"node\": true\n },\n ecmaFeatures: {\n jsx: true\n },\n \"globals\": {\n },\n \"plugins\": [\n ],\n \"exten"
},
{
"path": "demos/mobx-demo/.gitignore",
"chars": 34,
"preview": "node_modules\nbuild/\nnpm-debug.log\n"
},
{
"path": "demos/mobx-demo/.jshintignore",
"chars": 13,
"preview": "node_modules\n"
},
{
"path": "demos/mobx-demo/.jshintrc",
"chars": 131,
"preview": "{\n \"node\": true,\n\n \"curly\": true,\n \"latedef\": true,\n \"quotmark\": true,\n \"undef\": true,\n \"unused\": true,\n \"trailin"
},
{
"path": "demos/mobx-demo/app/index.html",
"chars": 201,
"preview": "<html>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\">\n <title>React-Babel-Webpack Boileplate</title>\n <body"
},
{
"path": "demos/mobx-demo/app/main.css",
"chars": 0,
"preview": ""
},
{
"path": "demos/mobx-demo/app/main.jsx",
"chars": 591,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { observer } from 'mobx-react';\n\nimport Store from '"
},
{
"path": "demos/mobx-demo/app/store.js",
"chars": 189,
"preview": "import { observable, computed } from 'mobx';\n\nclass Store {\n @observable name = 'Bartek';\n @computed get decorated() {"
},
{
"path": "demos/mobx-demo/browser-demo/index.html",
"chars": 764,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width\">\n <title>Mo"
},
{
"path": "demos/mobx-demo/browser-demo/mobx-react.js",
"chars": 8503,
"preview": "(function() {\n function mrFactory(mobx, React, ReactDOM) {\n if (!mobx)\n throw new Error(\"mobx-react"
},
{
"path": "demos/mobx-demo/browser-demo/mobx.umd.js",
"chars": 62435,
"preview": "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"func"
},
{
"path": "demos/mobx-demo/browser-demo/react-15.1.0.js",
"chars": 668793,
"preview": " /**\n * React v15.1.0\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demos/mobx-demo/browser-demo/react-dom-15.1.0.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.1.0\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/mobx-demo/package.json",
"chars": 1236,
"preview": "{\n \"name\": \"mobx-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"app/main.jsx\",\n \"scripts\": {\n \"test\":"
},
{
"path": "demos/mobx-demo/webpack.config.js",
"chars": 972,
"preview": "var webpack = require('webpack');\nvar path = require('path');\nvar OpenBrowserPlugin = require('open-browser-webpack-plug"
},
{
"path": "demos/mobx-demo/webpack.production.config.js",
"chars": 978,
"preview": "var webpack = require('webpack');\nvar path = require('path');\nvar uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;\nvar "
},
{
"path": "demos/mocha-demo/add.js",
"chars": 62,
"preview": "function add(x, y) {\n return x + y;\n}\n\nmodule.exports = add;\n"
},
{
"path": "demos/mocha-demo/package.json",
"chars": 296,
"preview": "{\n \"name\": \"mocha-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"e"
},
{
"path": "demos/nightmare-demo/index.html",
"chars": 780,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/nightmare-demo/package.json",
"chars": 339,
"preview": "{\n \"name\": \"nightmare-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"babel.min.js\",\n \"scripts\": {\n \"t"
},
{
"path": "demos/nightmare-demo/react-dom.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.2.1\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/nightmare-demo/react.js",
"chars": 691206,
"preview": " /**\n * React v15.2.1\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demos/nightmare-demo/server.js",
"chars": 129,
"preview": "var httpServer = require('http-server');\nvar server = httpServer.createServer();\nserver.listen(8080);\nprocess.send('list"
},
{
"path": "demos/nightmare-demo/taobao.test.js",
"chars": 542,
"preview": "var Nightmare = require('nightmare');\nvar nightmare = Nightmare({ show: true });\n\nnightmare\n .goto('https://www.taobao."
},
{
"path": "demos/nightmare-demo/test.js",
"chars": 796,
"preview": "var Nightmare = require('nightmare');\nvar expect = require('chai').expect;\nvar fork = require('child_process').fork;\n\nde"
},
{
"path": "demos/react-component-demo/index1.html",
"chars": 472,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/react-component-demo/index2.html",
"chars": 519,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/react-component-demo/index3.html",
"chars": 795,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/react-component-demo/index4.html",
"chars": 734,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/react-component-demo/react-dom.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.2.1\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/react-component-demo/react.js",
"chars": 691206,
"preview": " /**\n * React v15.2.1\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demos/react-lifecycle-demo/index.html",
"chars": 1352,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react.js\"></script>\n <script src=\"react-d"
},
{
"path": "demos/react-lifecycle-demo/jquery.js",
"chars": 284394,
"preview": "/*!\n * jQuery JavaScript Library v1.11.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Co"
},
{
"path": "demos/react-lifecycle-demo/react-dom.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.2.1\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/react-lifecycle-demo/react.js",
"chars": 691206,
"preview": " /**\n * React v15.2.1\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}e"
},
{
"path": "demos/recharts-demo/index.html",
"chars": 1351,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"react-with-addons.min.js\"></script>\n <scr"
},
{
"path": "demos/recharts-demo/react-dom.js",
"chars": 1174,
"preview": "/**\n * ReactDOM v15.2.1\n *\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is l"
},
{
"path": "demos/redux-demo/.babelrc",
"chars": 296,
"preview": "{\n \"presets\": [ \"es2015\", \"stage-0\", \"react\"],\n\n /* if you want to use babel runtime, uncomment the following line */\n"
},
{
"path": "demos/redux-demo/.eslintignore",
"chars": 35,
"preview": "node_modules/**\n**/*.css\n**/*.html\n"
},
{
"path": "demos/redux-demo/.eslintrc",
"chars": 258,
"preview": "{\n \"env\": {\n \"node\": true\n },\n ecmaFeatures: {\n jsx: true\n },\n \"globals\": {\n },\n \"plugins\": [\n ],\n \"exten"
},
{
"path": "demos/redux-demo/.gitignore",
"chars": 34,
"preview": "node_modules\nbuild/\nnpm-debug.log\n"
},
{
"path": "demos/redux-demo/.jshintignore",
"chars": 13,
"preview": "node_modules\n"
},
{
"path": "demos/redux-demo/.jshintrc",
"chars": 131,
"preview": "{\n \"node\": true,\n\n \"curly\": true,\n \"latedef\": true,\n \"quotmark\": true,\n \"undef\": true,\n \"unused\": true,\n \"trailin"
},
{
"path": "demos/redux-demo/app/App.js",
"chars": 525,
"preview": "import { connect } from 'react-redux';\nimport MyComponent from './myComponent';\n\n// Map Redux state to component props\nf"
},
{
"path": "demos/redux-demo/app/index.html",
"chars": 201,
"preview": "<html>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\">\n <title>React-Babel-Webpack Boileplate</title>\n <body"
},
{
"path": "demos/redux-demo/app/main.css",
"chars": 0,
"preview": ""
},
{
"path": "demos/redux-demo/app/main.jsx",
"chars": 375,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { createStore } from 'redux'\nimport { Provider } fro"
},
{
"path": "demos/redux-demo/app/myComponent.js",
"chars": 330,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\n\nclass MyComponent extends React.Component {\n render() {\n "
},
{
"path": "demos/redux-demo/app/reducer.js",
"chars": 271,
"preview": "function reducer(state = {\n text: '你好,访问者',\n name: '访问者'\n}, action) {\n switch (action.type) {\n case 'change':\n "
},
{
"path": "demos/redux-demo/package.json",
"chars": 1239,
"preview": "{\n \"name\": \"redux-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"app/main.jsx\",\n \"scripts\": {\n \"test\""
},
{
"path": "demos/redux-demo/webpack.config.js",
"chars": 972,
"preview": "var webpack = require('webpack');\nvar path = require('path');\nvar OpenBrowserPlugin = require('open-browser-webpack-plug"
},
{
"path": "demos/redux-demo/webpack.production.config.js",
"chars": 978,
"preview": "var webpack = require('webpack');\nvar path = require('path');\nvar uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;\nvar "
},
{
"path": "demos/rest-api-demo/db.json",
"chars": 194,
"preview": "{\n \"posts\": [\n { \"id\": 1, \"title\": \"json-server\", \"author\": \"typicode\" }\n ],\n \"comments\": [\n { \"id\": 1, \"body\":"
},
{
"path": "demos/rest-api-demo/package.json",
"chars": 264,
"preview": "{\n \"name\": \"rest-api-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"server"
},
{
"path": "demos/simple-app-demo/app.js",
"chars": 59,
"preview": "const $ = require('jquery');\n$('h1').css({ color: 'red'});\n"
},
{
"path": "demos/simple-app-demo/bundle.js",
"chars": 88203,
"preview": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.expo"
},
{
"path": "demos/simple-app-demo/index.html",
"chars": 97,
"preview": "<html>\n <body>\n <h1>Hello World</h1>\n <script src=\"bundle.js\"></script>\n </body>\n</html>\n"
},
{
"path": "demos/simple-app-demo/package.json",
"chars": 396,
"preview": "{\n \"name\": \"simple-app-demo\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"app.js\",\n \"scripts\": {\n \"build\""
},
{
"path": "demos/vue-demo/app1.js",
"chars": 92,
"preview": "var journal = new Vue({\n el: '#journal',\n data: {\n message: 'Your first entry'\n }\n});\n"
},
{
"path": "demos/vue-demo/app2.js",
"chars": 251,
"preview": "var myModel = {\n name: 'Ashley',\n age: 24,\n friends: [{\n name: 'Bob',\n age: 21\n }, {\n name: 'Jane',\n age"
},
{
"path": "demos/vue-demo/app3.js",
"chars": 121,
"preview": "new Vue({\n el: '#app',\n data: {\n counter: 0\n },\n methods: {\n increment() {\n this.counter++;\n }\n }\n});"
},
{
"path": "demos/vue-demo/index1.html",
"chars": 306,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Vue Demo</title>\n </head>\n <body>\n <div id=\"j"
},
{
"path": "demos/vue-demo/index2.html",
"chars": 390,
"preview": "<!DOCTYPE html>\n<html >\n <head>\n <meta charset=\"UTF-8\">\n <title>Vue Demo</title>\n </head>\n <body>\n <div id=\""
},
{
"path": "demos/vue-demo/index3.html",
"chars": 317,
"preview": "<!DOCTYPE html>\n<html >\n <head>\n <meta charset=\"UTF-8\">\n <title>Vue Demo</title>\n </head>\n <body>\n <div id=\""
},
{
"path": "docs/engineering.md",
"chars": 2099,
"preview": "# 前端工程简介\n\n---\n\n## 持续集成流程\n\n前端开发转移到后端环境,意味着可以适用标准的软件工程流程。\n\n1. 本地开发(developing)\n1. 静态代码检查(linting)\n1. 单元测试(testing)\n1. 合并进入"
},
{
"path": "docs/history.md",
"chars": 4921,
"preview": "# 前端开发的历史和趋势\n\n---\n\n## 什么是前端\n\n- 前端:针对浏览器的开发,代码在浏览器运行\n- 后端:针对服务器的开发,代码在服务器运行\n\n\n\n---\n\n## 前后端不分的时代"
},
{
"path": "docs/node.md",
"chars": 1959,
"preview": "# Node 应用开发\n\n---\n\n## Node 简介\n\nNode 是服务器的 JavaScript 运行环境,提供 API 与操作系统互动。\n\n主要用途:\n\n- 开发前端应用\n- 快速搭建服务\n- 架设网站\n\n---\n\n## npm\n\n"
},
{
"path": "docs/preparation.md",
"chars": 955,
"preview": "# 环境准备\n\n参加培训的学员,事先应该准备好开发环境。\n\n## 安装 Git\n\n请到官网 [git-scm.com](https://git-scm.com/) 或国内的下载站,下载安装包。\n\n## 安装 Node\n\n请到 Node 官网"
},
{
"path": "docs/react.md",
"chars": 6909,
"preview": "# React 技术栈\n\n---\n\nReact 是目前最热门的前端框架。\n\n- Facebook 公司2013年推出\n- 现在最好的社区支持和生态圈\n- 大量的第三方工具\n\n\n\n---"
},
{
"path": "ppt/README.md",
"chars": 51,
"preview": "本目录下的演示文件,不会随着文档及时更新。\n\n以[`docs`](../docs)目录下的文档为准。\n"
}
]
About this extraction
This page contains the full source code of the ruanyf/jstraining GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 91 files (4.1 MB), approximately 1.1M tokens, and a symbol index with 1851 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.