174 changed files with 0 additions and 39361 deletions
@ -1,3 +0,0 @@
|
||||
{ |
||||
"directory": "gh-pages/bower_components" |
||||
} |
||||
@ -1 +0,0 @@
|
||||
Issue tracker is used **only for reporting issues**. For support, go to [Stack Overflow](https://stackoverflow.com/) or similar. |
||||
@ -1,13 +0,0 @@
|
||||
node_modules |
||||
src/bower_components/slick-carousel/* |
||||
src/bower_components/slick-carousel/**/* |
||||
!src/bower_components/slick-carousel/slick/slick-theme.css |
||||
!src/bower_components/slick-carousel/slick |
||||
src/bower_components/jquery/* |
||||
!src/bower_components/jquery/dist |
||||
|
||||
*.sublime-* |
||||
|
||||
test/tmp/*.js |
||||
|
||||
/test/tests.js |
||||
@ -1,58 +0,0 @@
|
||||
# Change Log |
||||
All notable changes to this project will be documented in this file. |
||||
This project adheres to [Semantic Versioning](http://semver.org/). Changelog muster from [olivierlacan/keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog). |
||||
|
||||
## [0.2.12] - 2017-10-10 |
||||
### Fixed |
||||
- Handle slick clones on click. Thanks @IrvingArmenta and @othbert |
||||
|
||||
## [0.2.11] - 2017-10-10 |
||||
### Fixed |
||||
- Fixed images option. Thanks @Vesna031 |
||||
|
||||
## [0.2.10] - 2017-06-04 |
||||
### Added |
||||
- Fixed captions. Thanks @AntoineBoulanger |
||||
|
||||
## [0.2.9] - 2017-05-07 |
||||
### Added |
||||
- Added lazyload support. Thanks @avbobylev |
||||
|
||||
## [0.2.8] - 2017-04-03 |
||||
### Added |
||||
- Added the `info` argument to the `getElementCaption` function. |
||||
- Blur clicked element so that pressing Enter doesn't cause issues. |
||||
|
||||
## [0.2.7] - 2016-01-02 |
||||
### Added |
||||
- Added the `event` argument to the `shouldOpen` callback. |
||||
|
||||
## [0.2.6] - 2016-12-16 |
||||
### Added |
||||
- Added `.slickLightbox` to the bound element. |
||||
|
||||
## [0.2.5] - 2016-12-09 |
||||
### Added |
||||
- Added the `imageMaxHeight` option. |
||||
|
||||
## [0.2.4] - 2016-10-14 |
||||
### Removed |
||||
- Removed npm-shrinkwrap as there are only dev dependencies. |
||||
|
||||
## [0.2.3] - 2016-10-06 |
||||
### Added |
||||
- Added the `shouldOpen` option. |
||||
|
||||
## [0.2.2] - 2016-09-26 |
||||
### Added |
||||
- Use the same slide index numbers as an 'Existing Slick', fixes #25 |
||||
|
||||
## [0.2.1] - 2016-07-29 |
||||
### Fixed |
||||
- fix multiple matching groups using `.each`, fixes #21 |
||||
|
||||
## [0.2.0] - 2016-07-29 |
||||
### Added |
||||
- this CHANGELOG.md |
||||
- the `layouts` option object for specifying the HTML code used for parts of the lightbox, thanks @CHEWX for the idea |
||||
- close button layout `layouts.closeButton` |
||||
@ -1,95 +0,0 @@
|
||||
############################# |
||||
|
||||
gulp = require 'gulp' |
||||
coffee = require 'gulp-coffee' |
||||
cssmin = require 'gulp-cssmin' |
||||
concat = require 'gulp-concat' |
||||
clean = require 'gulp-clean' |
||||
ecstatic = require 'ecstatic' |
||||
gutil = require 'gulp-util' |
||||
http = require 'http' |
||||
sass = require 'gulp-sass' |
||||
shell = require 'gulp-shell' |
||||
uglify = require 'gulp-uglifyjs' |
||||
qunit = require 'node-qunit-phantomjs' |
||||
wrapJS = require 'gulp-wrap-js' |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'coffee', -> |
||||
gulp |
||||
.src 'src/scripts/slick-lightbox.coffee' |
||||
.pipe coffee( bare: true ).on('error', gutil.log) |
||||
.pipe wrapJS("""'use strict'; |
||||
(function($) { |
||||
|
||||
%= body % |
||||
|
||||
}(jQuery));""") |
||||
.pipe gulp.dest 'dist/' |
||||
|
||||
gulp.task 'sass', -> |
||||
gulp |
||||
.src 'src/styles/slick-lightbox.sass' |
||||
.pipe sass(outputStyle: 'compressed').on('error', sass.logError) |
||||
.pipe gulp.dest 'dist/' |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'uglify', -> |
||||
gulp |
||||
.src 'dist/slick-lightbox.js' |
||||
.pipe uglify 'slick-lightbox.min.js', outSourceMap: true |
||||
.pipe gulp.dest 'dist/' |
||||
|
||||
gulp.task 'coffeedoc', shell.task(['coffeedoc src/scripts/slick-lightbox.coffee']) |
||||
|
||||
gulp.task 'buildGHPages', shell.task(['jade index.jade']) |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'testClean', -> |
||||
gulp |
||||
.src './test/tmp' |
||||
.pipe clean() |
||||
|
||||
gulp.task 'testCoffee', ['testClean'], -> |
||||
gulp |
||||
.src ['./test/boilerplate.coffee', './test/tests/*.coffee'] |
||||
.pipe coffee( bare: true ).on('error', gutil.log) |
||||
.pipe gulp.dest('./test/tmp/') |
||||
|
||||
gulp.task 'testConcat', ['testCoffee'], -> |
||||
gulp |
||||
.src './test/tmp/*.js' |
||||
.pipe concat('tests.js') |
||||
.pipe gulp.dest('./test/') |
||||
|
||||
gulp.task 'test', ['testConcat', 'base'], -> |
||||
qunit './test/test.html', { verbose: true } |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'watch', -> |
||||
gulp.watch 'src/scripts/*.coffee', ['coffee', 'coffeedoc'] |
||||
gulp.watch 'src/styles/*.sass', ['sass'] |
||||
gulp.watch ['index.jade', 'README.md'], ['buildGHPages'] |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'base', -> |
||||
gulp.start 'coffee', 'coffeedoc', 'sass', 'uglify' |
||||
|
||||
gulp.task 'build', -> |
||||
gulp.start 'base', 'buildGHPages' |
||||
|
||||
gulp.task 'server', -> |
||||
gulp.start 'base', 'watch' |
||||
http |
||||
.createServer ecstatic( root: __dirname ) |
||||
.listen 9000 |
||||
|
||||
############################# |
||||
|
||||
gulp.task 'default', -> |
||||
gulp.start 'server' |
||||
@ -1,20 +0,0 @@
|
||||
The MIT License (MIT) |
||||
|
||||
Copyright (c) 2014 |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of |
||||
this software and associated documentation files (the "Software"), to deal in |
||||
the Software without restriction, including without limitation the rights to |
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||||
the Software, and to permit persons to whom the Software is furnished to do so, |
||||
subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||
@ -1,133 +0,0 @@
|
||||
# slick-lightbox |
||||
|
||||
[](https://cdnjs.com/libraries/slick-lightbox) |
||||
|
||||
A lightbox wrapper for Ken's amazing slick carousel. Credits go to [kenwheeler](https://github.com/kenwheeler) for doing the [hard work](https://github.com/kenwheeler/slick). |
||||
|
||||
## Setup |
||||
|
||||
### Bower |
||||
|
||||
``` |
||||
bower install -S slick-lightbox |
||||
``` |
||||
|
||||
### Ruby on Rails |
||||
|
||||
Use the [slick-lightbox-rails](https://github.com/jwir3/slick-lightbox-rails) gem. Add to Gemfile. |
||||
|
||||
``` |
||||
gem 'slick-lightbox-rails', '>= 0.0.1' |
||||
``` |
||||
|
||||
Run bundler. |
||||
|
||||
``` |
||||
bundle install |
||||
``` |
||||
|
||||
## Usage |
||||
|
||||
Make sure you include CSS for both slick and slick-lightbox. Example HTML: |
||||
|
||||
```html |
||||
<!DOCTYPE html> |
||||
<html> |
||||
<head> |
||||
<title>slick lightbox</title> |
||||
<meta name="viewport" content="width=device-width"> |
||||
<link rel="stylesheet" type="text/css" href="bower_components/slick-carousel/slick/slick.css"> |
||||
<link rel="stylesheet" type="text/css" href="bower_components/slick-carousel/slick/slick-theme.css"> |
||||
<link rel="stylesheet" type="text/css" href="styles/slick-lightbox.css"> |
||||
</head> |
||||
<body> |
||||
<div> |
||||
<ul> |
||||
<li><a href="http://placekitten.com/1600/1300" data-caption="Lorem ipsum 1600x1300">http://placekitten.com/1600/1300</a></li> |
||||
<li><a href="http://placekitten.com/1630/1280" data-caption="Lorem ipsum 1630x1280">http://placekitten.com/1630/1280</a></li> |
||||
<li><a href="http://placekitten.com/1500/1250" data-caption="Lorem ipsum 1500x1250">http://placekitten.com/1500/1250</a></li> |
||||
</ul> |
||||
</div> |
||||
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script> |
||||
<script type="text/javascript" src="bower_components/slick-carousel/slick/slick.min.js"></script> |
||||
<script type="text/javascript" src="scripts/slick-lightbox.js"></script> |
||||
<script type="text/javascript"> |
||||
$(document).ready(function(){ |
||||
$('ul').slickLightbox({ |
||||
itemSelector: '> li > a' |
||||
}); |
||||
}); |
||||
</script> |
||||
</body> |
||||
</html> |
||||
``` |
||||
|
||||
## Options |
||||
|
||||
Option | Type | Default | Description |
||||
------ | ---- | ------- | ----------- |
||||
background | string | `rgba(0,0,0,.8)` | Background for the lightbox. Is used directly as a CSS `background` statement so that color and/or an image can be used. |
||||
closeOnEscape | boolean | `true` | Should the lightbox close upon pressing ESC? |
||||
closeOnBackdropClick | boolean | `true` | Should the lightbox close upon clicking on backdrop? |
||||
destroyTimeout | number | `500` | How many ms should we wait before actually removing the lightbox from the DOM? The default is used so that a 0.5s opacity transition can take place. |
||||
itemSelector | string | `a` | jQuery-like selector for the carousel-to-create items. The items should be anchors with `href` attribute aiming at the desired lightbox image. If that's not the case, you should specify the `src` option. |
||||
navigateByKeyboard | boolean | `true` | Can you use keyboard arrows to navigate the carousel? |
||||
slick | object | `{}` | Slick options to pass to the carousel. |
||||
caption | various | `false` | Should the images be captioned? If `false`, no caption is created. You can pass your own **function** accepting the `element` and `info` attributes (e.g. `function(element, info) { return $(element).doSomething(); }`, with `info` being an `{ index: itemIndex, length: itemCount }` object) or a **string** with the name of the `data-attribute` to be fetched (`my-caption` will get the value of `data-my-caption` attribute). |
||||
src | various | `false` | How to get the image urls? If `false`, no src is taken as the `href` attribute. You can pass your own **function** accepting the element as an attribute (e.g. `function(element) { return $(element).doSomething(); }`) or a **string** with the name of the attribute to be fetched (`src` will get the value of `element.src` attribute). |
||||
captionPosition | various | `'dynamic'` | Where should the caption be placed? When set to 'dynamic', the caption is displayed right under the image. When 'bottom', the caption is on the bottom of the screen independent to the image size. |
||||
images | various | `false` | When passed an array, slick lightbox doesn't scan the elements for image URLs and uses array's values instead. |
||||
useHistoryApi | boolean | `false` | When `true`, opening the lightbox does a `history.pushState`. The plugin then listens for the `popstate` event to close the lightbox. |
||||
layouts | object | | See [Layouts](#layouts) |
||||
shouldOpen | function | `null` | Given a function, checks the return value before opening. If the function returns a falsy value, the lightbox is not opened upon clicking on the items. Accepts three arguments - the slick lightbox instance as the first, the clicked element as the second and the click event as the last. |
||||
imageMaxHeight | number | `0.9` | Maximum height of the lightbox images. Relative to the window height. |
||||
lazy | boolean | `false` | Should the images be lazyloaded? |
||||
lazyPlaceholder | string | `null` | Path to lazyloading placeholder. Defaults to a blank gif. |
||||
|
||||
## Events |
||||
|
||||
Events are triggered on the source element. Example: |
||||
|
||||
```javascript |
||||
$(document).ready(function(){ |
||||
$('ul').slickLightbox().on({ |
||||
'show.slickLightbox': function(){ console.log('A `show.slickLightbox` event triggered.'); },1 |
||||
'shown.slickLightbox': function(){ console.log('A `shown.slickLightbox` event triggered.'); }, |
||||
'hide.slickLightbox': function(){ console.log('A `hide.slickLightbox` event triggered.'); }, |
||||
'hidden.slickLightbox': function(){ console.log('A `hidden.slickLightbox` event triggered.'); } |
||||
}); |
||||
}); |
||||
``` |
||||
|
||||
Event | Description |
||||
------ | ---- |
||||
show.slickLightbox | Triggered when the lightbox is opened. |
||||
shown.slickLightbox | Triggered when the lightbox is opened, after the transitions took place. |
||||
hide.slickLightbox | Triggered when the lightbox is closed. |
||||
hidden.slickLightbox | Triggered when the lightbox is closed, after the transitions took place. |
||||
|
||||
|
||||
## Layouts |
||||
|
||||
The layout is customizable using the `layouts` option object. |
||||
|
||||
- `layouts.closeButton`, which defaults to `<button type="button" class="slick-lightbox-close"></button>` |
||||
|
||||
## Lightbox instance |
||||
|
||||
You can access the lightbox instance through the bound element. It's assigned to `.slickLightbox`. Example: |
||||
|
||||
```javascript |
||||
$('#my-element').slickLightbox() |
||||
console.log('My slickLightbox instance:', $('#my-element')[0].slickLightbox) |
||||
// once a lightbox is opened |
||||
console.log('My slick instance:', $('#my-element')[0].slickLightbox.slick) |
||||
``` |
||||
|
||||
## Demos |
||||
|
||||
The [slick-lightbox demo page](https://mreq.github.io/slick-lightbox/demo/) contains various setups of slick lightbox. |
||||
|
||||
## Contributing |
||||
|
||||
Edit the coffee source please. Use gulp to build. |
||||
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
./node_modules/gulp/bin/gulp.js $* |
||||
@ -1,21 +0,0 @@
|
||||
{ |
||||
"name": "slick-lightbox", |
||||
"version": "0.2.12", |
||||
"ignore": [ |
||||
"node_modules", |
||||
"gh-pages", |
||||
"docs", |
||||
"demo", |
||||
"src/bower_components", |
||||
"src/index.html" |
||||
], |
||||
"main": [ |
||||
"dist/slick-lightbox.js", |
||||
"dist/slick-lightbox.min.js", |
||||
"dist/slick-lightbox.css" |
||||
], |
||||
"dependencies": { |
||||
"jquery": "~1", |
||||
"slick-carousel": "~1.4.1" |
||||
} |
||||
} |
||||
@ -1,235 +0,0 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
<title>Slick-lightbox by mreq</title> |
||||
<link href="../gh-pages/stylesheets/bootstrap.css" rel="stylesheet"> |
||||
<link href="../gh-pages/stylesheets/bootstrap-theme.css" rel="stylesheet"> |
||||
<link href="../gh-pages/stylesheets/github-highlight.css" rel="stylesheet"> |
||||
<link href="../gh-pages/bower_components/slick-carousel/slick/slick.css" rel="stylesheet"> |
||||
<link href="../gh-pages/bower_components/slick-carousel/slick/slick-theme.css" rel="stylesheet"> |
||||
<link href="../dist/slick-lightbox.css" rel="stylesheet"> |
||||
<style> |
||||
.thumbnail img { width: 100%; display: block; } |
||||
h2 { margin-top: 30px; } |
||||
.container { max-width: 750px; } |
||||
</style> |
||||
<!--if lt IE 9 |
||||
script(src='https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js') |
||||
script(src='https://oss.maxcdn.com/respond/1.4.2/respond.min.js') |
||||
--> |
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
||||
<script src="../gh-pages/javascripts/bootstrap.min.js"></script> |
||||
<script src="../gh-pages/bower_components/slick-carousel/slick/slick.js"></script> |
||||
<script src="../dist/slick-lightbox.js"></script> |
||||
</head> |
||||
<body> |
||||
<nav class="navbar navbar-default"> |
||||
<div class="container-fluid"> |
||||
<div class="navbar-header"> |
||||
<button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="/slick-lightbox/demo/" class="navbar-brand">Slick lightbox demo</a> |
||||
</div> |
||||
<div id="bs-example-navbar-collapse-1" class="collapse navbar-collapse"> |
||||
<ul class="nav navbar-nav"> |
||||
<li><a href="../">Slick lightbox</a></li> |
||||
<li><a href="../docs/">Docs</a></li> |
||||
</ul> |
||||
<ul class="nav navbar-nav navbar-right"> |
||||
<li><a href="#default">Default</a></li> |
||||
<li><a href="#captions">Captions</a></li> |
||||
<li><a href="#images">Images</a></li> |
||||
<li><a href="#slick">Slick</a></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</nav> |
||||
<div class="container"> |
||||
<h1>Demo page</h1> |
||||
<p>This page contains various setups of slick lightbox.</p> |
||||
|
||||
<h2 id="default">Default</h2> |
||||
<div class="row" id="default-demo"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#default-demo').slickLightbox(); |
||||
</script> |
||||
<pre><code class="lang-html"><div class="row" id="default-demo"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
|
||||
<script type="text/javascript"> |
||||
$('#default-demo').slickLightbox(); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="captions">Captions and history API</h2> |
||||
<p>You can close the lightbox by navigating "back" in the browser.</p> |
||||
<div class="row" id="captions-demo"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/700" data-caption="Lorem ipsum 1000/700" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/700" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/706" data-caption="Lorem ipsum 1010/706" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/706" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/736" data-caption="Lorem ipsum 1060/736" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/736" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#captions-demo').slickLightbox({ |
||||
caption: 'caption', |
||||
useHistoryApi: true |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div class="row" id="captions-demo"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/700" data-caption="Lorem ipsum 1000/700" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/700" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/706" data-caption="Lorem ipsum 1010/706" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/706" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/736" data-caption="Lorem ipsum 1060/736" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/736" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#captions-demo').slickLightbox({ |
||||
caption: 'caption' |
||||
useHistoryApi: 'true' |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="images">Array of images</h2> |
||||
<div class="row" id="images-demo"> |
||||
<div class="col-xs-12" style="text-align: center; margin-bottom: 20px;"><a class="btn btn-primary" href="#">Open lightbox</a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#images-demo').slickLightbox({ |
||||
images: ['http://placekitten.com/1000/600', 'http://placekitten.com/1010/606', 'http://placekitten.com/1060/636'] |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div class="row" id="images-demo"> |
||||
<div class="col-xs-12" style="text-align: center; margin-bottom: 20px;"><a class="btn btn-primary" href="#">Open lightbox</a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#images-demo').slickLightbox({ |
||||
images: ['http://placekitten.com/1000/600', 'http://placekitten.com/1010/606', 'http://placekitten.com/1060/636'] |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="slick">Existing slick</h2> |
||||
<div id="slick-demo"> |
||||
<div class="item"><img src="http://placekitten.com/1000/600" alt="" width="480" height="300"></div> |
||||
<div class="item"><img src="http://placekitten.com/1010/606" alt="" width="480" height="300"></div> |
||||
<div class="item"><img src="http://placekitten.com/1060/636" alt="" width="480" height="300"></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#slick-demo').slick(); |
||||
$('#slick-demo').slickLightbox({ |
||||
src: 'src', |
||||
itemSelector: '.item img' |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div id="slick-demo"> |
||||
<div class="item"><img src="http://placekitten.com/1000/600" alt="" width="480" height="300"></div> |
||||
<div class="item"><img src="http://placekitten.com/1010/606" alt="" width="480" height="300"></div> |
||||
<div class="item"><img src="http://placekitten.com/1060/636" alt="" width="480" height="300"></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#slick-demo').slick(); |
||||
$('#slick-demo').slickLightbox({ |
||||
src: 'src', |
||||
itemSelector: '.item img' |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="custom-layout">Custom layout</h2> |
||||
<div id="custom-layout-demo" class="row"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#custom-layout-demo').slickLightbox({ |
||||
layouts: { |
||||
closeButton: '<span style="position: absolute; top: 10px; right: 10px; color: red;">aww yeah</span>' |
||||
} |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div id="custom-layout-demo" class="row"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#custom-layout-demo').slickLightbox({ |
||||
layouts: { |
||||
closeButton: '<span style="position: absolute; top: 10px; right: 10px; color: red;">aww yeah</span>' |
||||
} |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="prevent-opening">Prevent opening</h2> |
||||
<div id="prevent-opening-demo" class="row"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail do-not-open" style="opacity: 0.5; cursor: not-allowed;"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#prevent-opening-demo').slickLightbox({ |
||||
shouldOpen: function(slickLightbox, $clickedElement){ |
||||
if ($clickedElement.hasClass('do-not-open')) { |
||||
alert('Will not open on .do-not-open!'); |
||||
return false; |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div id="prevent-opening-demo" class="row"> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1000/600" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1010/606" target="_blank" class="thumbnail do-not-open" style="opacity: 0.5; cursor: not-allowed;"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-4"><a href="http://placekitten.com/1060/636" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#prevent-opening-demo').slickLightbox({ |
||||
shouldOpen: function(slickLightbox, $clickedElement){ |
||||
if ($clickedElement.hasClass('do-not-open')) { |
||||
alert('Will not open on .do-not-open!'); |
||||
return false; |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
<h2 id="lazy">Lazyloading</h2> |
||||
<div id="lazy-demo" class="row"> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1000/600?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1010/606?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1060/636?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1080/600?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1080/600" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1100/606?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1100/606" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1200/636?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1200/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#lazy-demo').slickLightbox({ |
||||
lazy: true |
||||
}); |
||||
</script> |
||||
<pre><code class="lang-html"><div id="lazy-demo" class="row"> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1000/600?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1000/600" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1010/606?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1010/606" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1060/636?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1060/636" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1080/600?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1080/600" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1100/606?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1100/606" alt=""></a></div> |
||||
<div class="col-xs-2"><a href="http://placekitten.com/1200/636?foo=bar" target="_blank" class="thumbnail"><img src="http://placekitten.com/1200/636" alt=""></a></div> |
||||
</div> |
||||
<script type="text/javascript"> |
||||
$('#lazy-demo').slickLightbox({ |
||||
lazy: true |
||||
}); |
||||
</script></code></pre> |
||||
|
||||
</div> |
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script> |
||||
<script type="text/javascript">hljs.initHighlightingOnLoad();</script> |
||||
</body> |
||||
</html> |
||||
@ -1 +0,0 @@
|
||||
.slick-lightbox{position:fixed;top:0;left:0;z-index:9999;width:100%;height:100%;background:black;-webkit-transition:opacity 0.5s ease;transition:opacity 0.5s ease}.slick-lightbox .slick-loading .slick-list{background-color:transparent}.slick-lightbox .slick-prev{left:15px}.slick-lightbox .slick-next{right:15px}.slick-lightbox-hide{opacity:0}.slick-lightbox-hide.slick-lightbox-ie{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0)}.slick-lightbox-hide-init{position:absolute;top:-9999px;opacity:0}.slick-lightbox-hide-init.slick-lightbox-ie{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0)}.slick-lightbox-inner{position:fixed;top:0;left:0;width:100%;height:100%}.slick-lightbox-slick-item{text-align:center;overflow:hidden}.slick-lightbox-slick-item:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-0.25em}.slick-caption-bottom .slick-lightbox-slick-item .slick-lightbox-slick-item .slick-lightbox-slick-caption{position:absolute;bottom:0;left:0;text-align:center;width:100%;margin-bottom:20px}.slick-caption-dynamic .slick-lightbox-slick-item .slick-lightbox-slick-item .slick-lightbox-slick-caption{display:block;text-align:center}.slick-lightbox-slick-item-inner{display:inline-block;vertical-align:middle;max-width:90%;max-height:90%}.slick-lightbox-slick-img{margin:0 auto;display:block;max-width:90%;max-height:90%}.slick-lightbox-slick-caption{margin:10px 0 0;color:white}.slick-lightbox-close{position:absolute;top:15px;right:15px;display:block;height:20px;width:20px;line-height:0;font-size:0;cursor:pointer;background:transparent;color:transparent;padding:0;border:none}.slick-lightbox-close:focus{outline:none}.slick-lightbox-close:before{font-family:"slick";font-size:20px;line-height:1;color:white;opacity:0.85;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:'×'} |
||||
@ -1,353 +0,0 @@
|
||||
'use strict'; |
||||
(function ($) { |
||||
var SlickLightbox, defaults; |
||||
SlickLightbox = function () { |
||||
/* |
||||
The core class. |
||||
*/ |
||||
function SlickLightbox(element, options1) { |
||||
var slickLightbox; |
||||
this.options = options1; |
||||
/* Binds the plugin. */ |
||||
this.$element = $(element); |
||||
this.didInit = false; |
||||
slickLightbox = this; |
||||
this.$element.on('click.slickLightbox', this.options.itemSelector, function (e) { |
||||
var $clickedItem, $items; |
||||
e.preventDefault(); |
||||
$clickedItem = $(this); |
||||
$clickedItem.blur(); |
||||
if (typeof slickLightbox.options.shouldOpen === 'function') { |
||||
if (!slickLightbox.options.shouldOpen(slickLightbox, $clickedItem, e)) { |
||||
return; |
||||
} |
||||
} |
||||
$items = slickLightbox.$element.find(slickLightbox.options.itemSelector); |
||||
if (slickLightbox.elementIsSlick()) { |
||||
$items = slickLightbox.filterOutSlickClones($items); |
||||
$clickedItem = slickLightbox.handlePossibleCloneClick($clickedItem, $items); |
||||
} |
||||
return slickLightbox.init($items.index($clickedItem)); |
||||
}); |
||||
} |
||||
SlickLightbox.prototype.init = function (index) { |
||||
/* Creates the lightbox, opens it, binds events and calls `slick`. Accepts `index` of the element, that triggered it (so that we know, on which slide to start slick). */ |
||||
this.didInit = true; |
||||
this.detectIE(); |
||||
this.createModal(); |
||||
this.bindEvents(); |
||||
this.initSlick(index); |
||||
return this.open(); |
||||
}; |
||||
SlickLightbox.prototype.createModalItems = function () { |
||||
/* Creates individual slides to be used with slick. If `options.images` array is specified, it uses it's contents, otherwise loops through elements' `options.itemSelector`. */ |
||||
var $items, createItem, itemTemplate, lazyPlaceholder, length, links; |
||||
lazyPlaceholder = this.options.lazyPlaceholder || 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; |
||||
itemTemplate = function (source, caption, lazy) { |
||||
var imgSourceParams; |
||||
if (lazy === true) { |
||||
imgSourceParams = ' data-lazy="' + source + '" src="' + lazyPlaceholder + '" '; |
||||
} else { |
||||
imgSourceParams = ' src="' + source + '" '; |
||||
} |
||||
return '<div class="slick-lightbox-slick-item">\n <div class="slick-lightbox-slick-item-inner">\n <img class="slick-lightbox-slick-img" ' + imgSourceParams + ' />\n ' + caption + '\n </div>\n</div>'; |
||||
}; |
||||
if (this.options.images) { |
||||
links = $.map(this.options.images, function (_this) { |
||||
return function (img) { |
||||
return itemTemplate(img, _this.options.lazy); |
||||
}; |
||||
}(this)); |
||||
} else { |
||||
$items = this.filterOutSlickClones(this.$element.find(this.options.itemSelector)); |
||||
length = $items.length; |
||||
createItem = function (_this) { |
||||
return function (el, index) { |
||||
var caption, info, src; |
||||
info = { |
||||
index: index, |
||||
length: length |
||||
}; |
||||
caption = _this.getElementCaption(el, info); |
||||
src = _this.getElementSrc(el); |
||||
return itemTemplate(src, caption, _this.options.lazy); |
||||
}; |
||||
}(this); |
||||
links = $.map($items, createItem); |
||||
} |
||||
return links; |
||||
}; |
||||
SlickLightbox.prototype.createModal = function () { |
||||
/* Creates a `slick`-friendly modal. */ |
||||
var html, links; |
||||
links = this.createModalItems(); |
||||
html = '<div class="slick-lightbox slick-lightbox-hide-init' + (this.isIE ? ' slick-lightbox-ie' : '') + '" style="background: ' + this.options.background + ';">\n <div class="slick-lightbox-inner">\n <div class="slick-lightbox-slick slick-caption-' + this.options.captionPosition + '">' + links.join('') + '</div>\n <div>\n<div>'; |
||||
this.$modalElement = $(html); |
||||
this.$parts = {}; |
||||
this.$parts['closeButton'] = $(this.options.layouts.closeButton); |
||||
this.$modalElement.find('.slick-lightbox-inner').append(this.$parts['closeButton']); |
||||
return $('body').append(this.$modalElement); |
||||
}; |
||||
SlickLightbox.prototype.initSlick = function (index) { |
||||
/* Runs slick by default, using `options.slick` if provided. If `options.slick` is a function, it gets fired instead of us initializing slick. Merges in initialSlide option. */ |
||||
var additional; |
||||
additional = { initialSlide: index }; |
||||
if (this.options.lazy) { |
||||
additional.lazyLoad = 'ondemand'; |
||||
} |
||||
if (this.options.slick != null) { |
||||
if (typeof this.options.slick === 'function') { |
||||
this.slick = this.options.slick(this.$modalElement); |
||||
} else { |
||||
this.slick = this.$modalElement.find('.slick-lightbox-slick').slick($.extend({}, this.options.slick, additional)); |
||||
} |
||||
} else { |
||||
this.slick = this.$modalElement.find('.slick-lightbox-slick').slick(additional); |
||||
} |
||||
return this.$modalElement.trigger('init.slickLightbox'); |
||||
}; |
||||
SlickLightbox.prototype.open = function () { |
||||
/* Opens the lightbox. */ |
||||
if (this.options.useHistoryApi) { |
||||
this.writeHistory(); |
||||
} |
||||
this.$element.trigger('show.slickLightbox'); |
||||
setTimeout(function (_this) { |
||||
return function () { |
||||
return _this.$element.trigger('shown.slickLightbox'); |
||||
}; |
||||
}(this), this.getTransitionDuration()); |
||||
return this.$modalElement.removeClass('slick-lightbox-hide-init'); |
||||
}; |
||||
SlickLightbox.prototype.close = function () { |
||||
/* Closes the lightbox and destroys it, maintaining the original element bindings. */ |
||||
this.$element.trigger('hide.slickLightbox'); |
||||
setTimeout(function (_this) { |
||||
return function () { |
||||
return _this.$element.trigger('hidden.slickLightbox'); |
||||
}; |
||||
}(this), this.getTransitionDuration()); |
||||
this.$modalElement.addClass('slick-lightbox-hide'); |
||||
return this.destroy(); |
||||
}; |
||||
SlickLightbox.prototype.bindEvents = function () { |
||||
/* Binds global events. */ |
||||
var resizeSlides; |
||||
resizeSlides = function (_this) { |
||||
return function () { |
||||
var h; |
||||
h = _this.$modalElement.find('.slick-lightbox-inner').height(); |
||||
_this.$modalElement.find('.slick-lightbox-slick-item').height(h); |
||||
return _this.$modalElement.find('.slick-lightbox-slick-img, .slick-lightbox-slick-item-inner').css('max-height', Math.round(_this.options.imageMaxHeight * h)); |
||||
}; |
||||
}(this); |
||||
$(window).on('orientationchange.slickLightbox resize.slickLightbox', resizeSlides); |
||||
if (this.options.useHistoryApi) { |
||||
$(window).on('popstate.slickLightbox', function (_this) { |
||||
return function () { |
||||
return _this.close(); |
||||
}; |
||||
}(this)); |
||||
} |
||||
this.$modalElement.on('init.slickLightbox', resizeSlides); |
||||
this.$modalElement.on('destroy.slickLightbox', function (_this) { |
||||
return function () { |
||||
return _this.destroy(); |
||||
}; |
||||
}(this)); |
||||
this.$element.on('destroy.slickLightbox', function (_this) { |
||||
return function () { |
||||
return _this.destroy(true); |
||||
}; |
||||
}(this)); |
||||
this.$parts['closeButton'].on('click.slickLightbox touchstart.slickLightbox', function (_this) { |
||||
return function (e) { |
||||
e.preventDefault(); |
||||
return _this.close(); |
||||
}; |
||||
}(this)); |
||||
if (this.options.closeOnEscape || this.options.navigateByKeyboard) { |
||||
$(document).on('keydown.slickLightbox', function (_this) { |
||||
return function (e) { |
||||
var code; |
||||
code = e.keyCode ? e.keyCode : e.which; |
||||
if (_this.options.navigateByKeyboard) { |
||||
if (code === 37) { |
||||
_this.slideSlick('left'); |
||||
} else if (code === 39) { |
||||
_this.slideSlick('right'); |
||||
} |
||||
} |
||||
if (_this.options.closeOnEscape) { |
||||
if (code === 27) { |
||||
return _this.close(); |
||||
} |
||||
} |
||||
}; |
||||
}(this)); |
||||
} |
||||
if (this.options.closeOnBackdropClick) { |
||||
this.$modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-img', function (e) { |
||||
return e.stopPropagation(); |
||||
}); |
||||
return this.$modalElement.on('click.slickLightbox', '.slick-lightbox-slick-item', function (_this) { |
||||
return function (e) { |
||||
e.preventDefault(); |
||||
return _this.close(); |
||||
}; |
||||
}(this)); |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.slideSlick = function (direction) { |
||||
/* Moves the slick prev or next. */ |
||||
if (direction === 'left') { |
||||
return this.slick.slick('slickPrev'); |
||||
} else { |
||||
return this.slick.slick('slickNext'); |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.detectIE = function () { |
||||
/* Detects usage of IE8 and lower. */ |
||||
var ieversion; |
||||
this.isIE = false; |
||||
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { |
||||
ieversion = new Number(RegExp.$1); |
||||
if (ieversion < 9) { |
||||
return this.isIE = true; |
||||
} |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.getElementCaption = function (el, info) { |
||||
/* Returns caption for each slide based on the type of `options.caption`. */ |
||||
var c; |
||||
if (!this.options.caption) { |
||||
return ''; |
||||
} |
||||
c = function () { |
||||
switch (typeof this.options.caption) { |
||||
case 'function': |
||||
return this.options.caption(el, info); |
||||
case 'string': |
||||
return $(el).data(this.options.caption); |
||||
} |
||||
}.call(this); |
||||
return '<span class="slick-lightbox-slick-caption">' + c + '</span>'; |
||||
}; |
||||
SlickLightbox.prototype.getElementSrc = function (el) { |
||||
/* Returns src for each slide image based on the type of `options.src`. */ |
||||
switch (typeof this.options.src) { |
||||
case 'function': |
||||
return this.options.src(el); |
||||
case 'string': |
||||
return $(el).attr(this.options.src); |
||||
default: |
||||
return el.href; |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.unbindEvents = function () { |
||||
/* Unbinds global events. */ |
||||
$(window).off('.slickLightbox'); |
||||
$(document).off('.slickLightbox'); |
||||
return this.$modalElement.off('.slickLightbox'); |
||||
}; |
||||
SlickLightbox.prototype.destroy = function (unbindAnchors) { |
||||
if (unbindAnchors == null) { |
||||
unbindAnchors = false; |
||||
} |
||||
/* Destroys the lightbox and unbinds global events. If `true` is passed as an argument, unbinds the original element as well. */ |
||||
if (this.didInit) { |
||||
this.unbindEvents(); |
||||
setTimeout(function (_this) { |
||||
return function () { |
||||
return _this.$modalElement.remove(); |
||||
}; |
||||
}(this), this.options.destroyTimeout); |
||||
} |
||||
if (unbindAnchors) { |
||||
this.$element.off('.slickLightbox'); |
||||
return this.$element.off('.slickLightbox', this.options.itemSelector); |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.destroyPrevious = function () { |
||||
/* Destroys lightboxes currently in DOM. */ |
||||
return $('body').children('.slick-lightbox').trigger('destroy.slickLightbox'); |
||||
}; |
||||
SlickLightbox.prototype.getTransitionDuration = function () { |
||||
/* Detects the transition duration to know when to remove stuff from DOM etc. */ |
||||
var duration; |
||||
if (this.transitionDuration) { |
||||
return this.transitionDuration; |
||||
} |
||||
duration = this.$modalElement.css('transition-duration'); |
||||
if (typeof duration === 'undefined') { |
||||
return this.transitionDuration = 500; |
||||
} else { |
||||
return this.transitionDuration = duration.indexOf('ms') > -1 ? parseFloat(duration) : parseFloat(duration) * 1000; |
||||
} |
||||
}; |
||||
SlickLightbox.prototype.writeHistory = function () { |
||||
/* Writes an empty state to the history API if supported. */ |
||||
return typeof history !== 'undefined' && history !== null ? typeof history.pushState === 'function' ? history.pushState(null, null, '') : void 0 : void 0; |
||||
}; |
||||
SlickLightbox.prototype.filterOutSlickClones = function ($items) { |
||||
/* Removes all slick clones from the set of elements. Only does so, if the target element is a slick slider. */ |
||||
if (!this.elementIsSlick()) { |
||||
return $items; |
||||
} |
||||
return $items = $items.filter(function () { |
||||
var $item; |
||||
$item = $(this); |
||||
return !$item.hasClass('slick-cloned') && $item.parents('.slick-cloned').length === 0; |
||||
}); |
||||
}; |
||||
SlickLightbox.prototype.handlePossibleCloneClick = function ($clickedItem, $items) { |
||||
var href; |
||||
if (!this.elementIsSlick()) { |
||||
return $clickedItem; |
||||
} |
||||
if (!$clickedItem.closest('.slick-slide').hasClass('slick-cloned')) { |
||||
return $clickedItem; |
||||
} |
||||
href = $clickedItem.attr('href'); |
||||
return $items.filter(function () { |
||||
return $(this).attr('href') === href; |
||||
}).first(); |
||||
}; |
||||
SlickLightbox.prototype.elementIsSlick = function () { |
||||
return this.$element.hasClass('slick-slider'); |
||||
}; |
||||
return SlickLightbox; |
||||
}(); |
||||
defaults = { |
||||
background: 'rgba(0,0,0,.8)', |
||||
closeOnEscape: true, |
||||
closeOnBackdropClick: true, |
||||
destroyTimeout: 500, |
||||
itemSelector: 'a', |
||||
navigateByKeyboard: true, |
||||
src: false, |
||||
caption: false, |
||||
captionPosition: 'dynamic', |
||||
images: false, |
||||
slick: {}, |
||||
useHistoryApi: false, |
||||
layouts: { closeButton: '<button type="button" class="slick-lightbox-close"></button>' }, |
||||
shouldOpen: null, |
||||
imageMaxHeight: 0.9, |
||||
lazy: false |
||||
}; |
||||
$.fn.slickLightbox = function (options) { |
||||
/* Fires the plugin. */ |
||||
options = $.extend({}, defaults, options); |
||||
$(this).each(function () { |
||||
return this.slickLightbox = new SlickLightbox(this, options); |
||||
}); |
||||
return this; |
||||
}; |
||||
$.fn.unslickLightbox = function () { |
||||
/* Removes everything. */ |
||||
return $(this).trigger('destroy.slickLightbox').each(function () { |
||||
return this.slickLightbox = null; |
||||
}); |
||||
}; |
||||
}(jQuery)); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,65 +0,0 @@
|
||||
<!doctype html> |
||||
|
||||
<!-- Documentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc) --> |
||||
|
||||
<html> |
||||
<head> |
||||
<title>CoffeeDoc</title> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
<link rel="stylesheet" media="all" href="resources/base.css" /> |
||||
</head> |
||||
<body> |
||||
<header> |
||||
<h1>CoffeeDoc — Module Index</h1> |
||||
</header> |
||||
<div class="container"> |
||||
<div class="sidebar column"> |
||||
<ul id="modulelist"> |
||||
|
||||
<li><a href="src/scripts/slick-lightbox.coffee.html">src/scripts/slick-lightbox.coffee</a></li> |
||||
|
||||
</ul> |
||||
</div> |
||||
<div class="content column"> |
||||
|
||||
<div class="module"> |
||||
<div class="header"> |
||||
<a href="src/scripts/slick-lightbox.coffee.html"><h1>slick-lightbox.coffee</h1></a> |
||||
</div> |
||||
<div class="module-content"> |
||||
<p>Slick Lightbox jQuery plugin |
||||
<a href="http://mreq.github.io/slick-lightbox/">http://mreq.github.io/slick-lightbox/</a></p> |
||||
<p>Copyright 2014-2016 mreq <a href="https://github.com/mreq">https://github.com/mreq</a></p> |
||||
<p>Released under the MIT license</p> |
||||
<p>Documentation generated by <a href="http://github.com/omarkhan/coffeedoc">CoffeeDoc</a></p> |
||||
<p><a href="http://mreq.github.io/slick-lightbox/docs/">http://mreq.github.io/slick-lightbox/docs/</a></p> |
||||
|
||||
|
||||
<h3>Classes</h3> |
||||
<ul class="classlist"> |
||||
|
||||
<li><a href="src/scripts/slick-lightbox.coffee.html#SlickLightbox">SlickLightbox</a></li> |
||||
|
||||
</ul> |
||||
|
||||
|
||||
<h3>Functions</h3> |
||||
<ul class="functionlist"> |
||||
|
||||
<li><a href="src/scripts/slick-lightbox.coffee.html#$.fn.slickLightbox">$.fn.slickLightbox(options)</a></li> |
||||
|
||||
<li><a href="src/scripts/slick-lightbox.coffee.html#$.fn.unslickLightbox">$.fn.unslickLightbox()</a></li> |
||||
|
||||
|
||||
|
||||
|
||||
</ul> |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
||||
@ -1,396 +0,0 @@
|
||||
/* |
||||
* Skeleton V1.1 |
||||
* Copyright 2011, Dave Gamache |
||||
* www.getskeleton.com |
||||
* Free to use under the MIT license. |
||||
* http://www.opensource.org/licenses/mit-license.php |
||||
* 8/17/2011 |
||||
*/ |
||||
|
||||
|
||||
/* #Reset & Basics (Inspired by E. Meyers) |
||||
================================================== */ |
||||
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { |
||||
margin: 0; |
||||
padding: 0; |
||||
border: 0; |
||||
font-size: 100%; |
||||
font: inherit; |
||||
vertical-align: baseline; } |
||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { |
||||
display: block; } |
||||
body { |
||||
line-height: 1; } |
||||
ol, ul { |
||||
list-style: none; } |
||||
blockquote, q { |
||||
quotes: none; } |
||||
blockquote:before, blockquote:after, |
||||
q:before, q:after { |
||||
content: ''; |
||||
content: none; } |
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; } |
||||
|
||||
|
||||
/* #Basic Styles |
||||
================================================== */ |
||||
body { |
||||
background: #fff; |
||||
font: 14px/21px "Helvetica Neue", Helvetica, Arial, sans-serif; |
||||
color: #444; |
||||
-webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ |
||||
-webkit-text-size-adjust: 100%; |
||||
} |
||||
|
||||
|
||||
/* #Typography |
||||
================================================== */ |
||||
h1, h2, h3, h4, h5, h6 { |
||||
font-family: "Georgia", serif; |
||||
font-weight: normal; } |
||||
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } |
||||
h1 { font-size: 34px; line-height: 50px; margin-bottom: 14px;} |
||||
h2 { font-size: 28px; line-height: 40px; margin-bottom: 10px; } |
||||
h3 { font-size: 23px; line-height: 34px; margin-bottom: 8px; } |
||||
h4 { font-size: 19px; line-height: 30px; margin-bottom: 4px; } |
||||
h5 { font-size: 16px; line-height: 24px; } |
||||
h6 { font-size: 14px; line-height: 21px; } |
||||
|
||||
p { margin: 0 0 20px 0; } |
||||
p img { margin: 0; } |
||||
|
||||
em { font-style: italic; } |
||||
strong { font-weight: bold; color: #333; } |
||||
small { font-size: 80%; } |
||||
|
||||
/* Blockquotes */ |
||||
blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; } |
||||
blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; } |
||||
blockquote cite { display: block; font-size: 12px; color: #555; } |
||||
blockquote cite:before { content: "\2014 \0020"; } |
||||
blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; } |
||||
|
||||
hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 10px 0 30px; height: 0; } |
||||
|
||||
|
||||
/* #Links |
||||
================================================== */ |
||||
a, a:visited { |
||||
color: #2d81c5; |
||||
text-decoration: none; outline: 0; |
||||
-webkit-transition: color 250ms ease-in-out; |
||||
-moz-transition: color 250ms ease-in-out; |
||||
transition: color 250ms ease-in-out; |
||||
} |
||||
a:hover, a:focus { |
||||
color: #2569a0; |
||||
} |
||||
p a, p a:visited { line-height: inherit; } |
||||
|
||||
|
||||
/* #Lists |
||||
================================================== */ |
||||
ul, ol { margin-bottom: 20px; } |
||||
ul { list-style: none outside; } |
||||
ol { list-style: decimal; } |
||||
ol, ul.square, ul.circle, ul.disc { margin-left: 30px; } |
||||
ul.square { list-style: square outside; } |
||||
ul.circle { list-style: circle outside; } |
||||
ul.disc { list-style: disc outside; } |
||||
ul ul, ul ol, |
||||
ol ol, ol ul { margin: 4px 0 5px 30px; font-size: 90%; } |
||||
ul ul li, ul ol li, |
||||
ol ol li, ol ul li { margin-bottom: 6px; } |
||||
li { line-height: 18px; margin-bottom: 12px; } |
||||
ul.large li { line-height: 21px; } |
||||
li p { line-height: 21px; } |
||||
|
||||
|
||||
/* #Images |
||||
================================================== */ |
||||
|
||||
img.scale-with-grid { |
||||
max-width: 100%; |
||||
height: auto; } |
||||
|
||||
|
||||
/* #Misc |
||||
================================================== */ |
||||
.remove-bottom { margin-bottom: 0 !important; } |
||||
.half-bottom { margin-bottom: 10px !important; } |
||||
.add-bottom { margin-bottom: 20px !important; } |
||||
|
||||
|
||||
/* #Base 960 Grid |
||||
================================================== */ |
||||
|
||||
.container { position: relative; width: 960px; margin: 0 auto; padding: 0; } |
||||
.container .column { float: left; display: inline; margin-left: 10px; margin-right: 10px; } |
||||
.row { margin-bottom: 20px; } |
||||
|
||||
/* Base Grid */ |
||||
.container .sidebar.column { width: 220px; } |
||||
.container .content.column { width: 700px; } |
||||
|
||||
|
||||
/* #Tablet (Portrait) |
||||
================================================== */ |
||||
|
||||
/* Note: Design for a width of 768px */ |
||||
|
||||
@media only screen and (min-width: 768px) and (max-width: 959px) { |
||||
.container { width: 768px; } |
||||
.container .column { margin-left: 10px; margin-right: 10px; } |
||||
|
||||
.container .sidebar.column { width: 172px; } |
||||
.container .content.column { width: 556px; } |
||||
} |
||||
|
||||
|
||||
/* #Mobile (Portrait) |
||||
================================================== */ |
||||
|
||||
/* Note: Design for a width of 320px */ |
||||
|
||||
@media only screen and (max-width: 767px) { |
||||
.container { width: 300px; } |
||||
.container .column { margin: 0; } |
||||
|
||||
.container .sidebar.column, |
||||
.container .content.column { width: 300px; } |
||||
} |
||||
|
||||
|
||||
/* #Mobile (Landscape) |
||||
================================================== */ |
||||
|
||||
/* Note: Design for a width of 480px */ |
||||
|
||||
@media only screen and (min-width: 480px) and (max-width: 767px) { |
||||
.container { width: 420px; } |
||||
.container .column { margin: 0; } |
||||
|
||||
.container .sidebar.column, |
||||
.container .content.column { width: 420px; } |
||||
} |
||||
|
||||
|
||||
/* #Clearing |
||||
================================================== */ |
||||
|
||||
/* Self Clearing Goodness */ |
||||
.container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } |
||||
|
||||
|
||||
/* #CoffeeDoc styles |
||||
================================================== */ |
||||
|
||||
code { |
||||
color: #000; |
||||
background: #f6f6f6; |
||||
padding: 2px 4px; |
||||
border: 1px solid #ccc; |
||||
font-size: 12px; line-height: 18px; |
||||
font-family: Monaco, Consolas, "Lucida Console", monospace; |
||||
border-radius: 2px; |
||||
} |
||||
pre code { |
||||
display: block; |
||||
border-radius: 4px; |
||||
margin-bottom: 20px; |
||||
padding: 10px; |
||||
} |
||||
header { |
||||
width: 100%; |
||||
border-bottom: 1px solid #bbb; |
||||
margin-bottom: 20px; |
||||
background-image: -webkit-linear-gradient(top, #fff, #d0d0d0); |
||||
background-image: -moz-linear-gradient(top, #fff, #d0d0d0); |
||||
background-image: linear-gradient(top, #fff, #d0d0d0); |
||||
} |
||||
header h1 { |
||||
margin: 0; |
||||
line-height: 50px; |
||||
font-size: 20px; |
||||
text-align: center; |
||||
} |
||||
h1, h2 { |
||||
border-bottom: 1px solid #ccc; |
||||
} |
||||
h3 { |
||||
border-bottom: 1px solid #ddd; |
||||
} |
||||
|
||||
|
||||
/* #Module index |
||||
================================================== */ |
||||
|
||||
.module { |
||||
margin-bottom: 25px; |
||||
} |
||||
.module .header h1 { |
||||
margin-bottom: 20px; |
||||
border-bottom: none; |
||||
box-shadow: 0 5px 5px -6px rgba(45, 129, 197, 0.4); |
||||
-webkit-transition: box-shadow 250ms ease-in-out; |
||||
-moz-transition: box-shadow 250ms ease-in-out; |
||||
transition: box-shadow 250ms ease-in-out; |
||||
} |
||||
.module .header h1:hover { |
||||
box-shadow: 0 5px 5px -6px rgb(45, 129, 197); |
||||
} |
||||
.module-content h1 { |
||||
font-size: 30px; |
||||
line-height: 44px; |
||||
} |
||||
|
||||
|
||||
/* #Module pages |
||||
================================================== */ |
||||
|
||||
.function, .class { |
||||
margin-bottom: 30px; |
||||
} |
||||
.method { |
||||
margin-bottom: 20px; |
||||
} |
||||
.class .header { |
||||
border-bottom: 1px solid #ccc; |
||||
margin-bottom: 10px; |
||||
} |
||||
.class .header h3 { |
||||
display: inline; |
||||
border: none; |
||||
} |
||||
.class .header .parent { |
||||
color: #aaa; |
||||
} |
||||
.class .header .parent:hover { |
||||
color: #2569a0; |
||||
} |
||||
|
||||
|
||||
/* #Syntax highlighting |
||||
============================================================== */ |
||||
|
||||
/* github.com style (c) Vasily Polovnyov <vast@whiteants.net> */ |
||||
|
||||
pre .comment, |
||||
pre .template_comment, |
||||
pre .diff .header, |
||||
pre .javadoc { |
||||
color: #998; |
||||
font-style: italic |
||||
} |
||||
|
||||
pre .keyword, |
||||
pre .css .rule .keyword, |
||||
pre .winutils, |
||||
pre .javascript .title, |
||||
pre .lisp .title, |
||||
pre .subst { |
||||
color: #000; |
||||
font-weight: bold |
||||
} |
||||
|
||||
pre .number, |
||||
pre .hexcolor { |
||||
color: #40a070 |
||||
} |
||||
|
||||
pre .string, |
||||
pre .tag .value, |
||||
pre .phpdoc, |
||||
pre .tex .formula { |
||||
color: #d14 |
||||
} |
||||
|
||||
pre .title, |
||||
pre .id { |
||||
color: #900; |
||||
font-weight: bold |
||||
} |
||||
|
||||
pre .javascript .title, |
||||
pre .lisp .title, |
||||
pre .subst { |
||||
font-weight: normal |
||||
} |
||||
|
||||
pre .class .title, |
||||
pre .haskell .label, |
||||
pre .tex .command { |
||||
color: #458; |
||||
font-weight: bold |
||||
} |
||||
|
||||
pre .tag, |
||||
pre .tag .title, |
||||
pre .rules .property, |
||||
pre .django .tag .keyword { |
||||
color: #000080; |
||||
font-weight: normal |
||||
} |
||||
|
||||
pre .attribute, |
||||
pre .variable, |
||||
pre .instancevar, |
||||
pre .lisp .body { |
||||
color: #008080 |
||||
} |
||||
|
||||
pre .regexp { |
||||
color: #009926 |
||||
} |
||||
|
||||
pre .class { |
||||
color: #458; |
||||
font-weight: bold |
||||
} |
||||
|
||||
pre .symbol, |
||||
pre .ruby .symbol .string, |
||||
pre .ruby .symbol .keyword, |
||||
pre .ruby .symbol .keymethods, |
||||
pre .lisp .keyword, |
||||
pre .tex .special, |
||||
pre .input_number { |
||||
color: #990073 |
||||
} |
||||
|
||||
pre .builtin, |
||||
pre .built_in, |
||||
pre .lisp .title { |
||||
color: #0086b3 |
||||
} |
||||
|
||||
pre .preprocessor, |
||||
pre .pi, |
||||
pre .doctype, |
||||
pre .shebang, |
||||
pre .cdata { |
||||
color: #999; |
||||
font-weight: bold |
||||
} |
||||
|
||||
pre .deletion { |
||||
background: #fdd |
||||
} |
||||
|
||||
pre .addition { |
||||
background: #dfd |
||||
} |
||||
|
||||
pre .diff .change { |
||||
background: #0086b3 |
||||
} |
||||
|
||||
pre .chunk { |
||||
color: #aaa |
||||
} |
||||
|
||||
pre .tex .formula { |
||||
opacity: 0.5; |
||||
} |
||||
@ -1,230 +0,0 @@
|
||||
<!doctype html> |
||||
|
||||
<!-- Documentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc) --> |
||||
|
||||
<html> |
||||
<head> |
||||
<title>CoffeeDoc | slick-lightbox.coffee</title> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
<link rel="stylesheet" media="all" href="../../resources/base.css" /> |
||||
</head> |
||||
<body> |
||||
<header> |
||||
<h1>slick-lightbox.coffee</h1> |
||||
</header> |
||||
<div class="container"> |
||||
<div class="sidebar column"> |
||||
|
||||
<h4>Classes</h4> |
||||
<ul class="classlist"> |
||||
|
||||
<li><a href="#SlickLightbox">SlickLightbox</a></li> |
||||
|
||||
</ul> |
||||
|
||||
|
||||
<h4>Functions</h4> |
||||
<ul class="functionlist"> |
||||
|
||||
<li><a href="#$.fn.slickLightbox">$.fn.slickLightbox</a></li> |
||||
|
||||
<li><a href="#$.fn.unslickLightbox">$.fn.unslickLightbox</a></li> |
||||
|
||||
</ul> |
||||
|
||||
</div> |
||||
<div class="content column"> |
||||
|
||||
<div id="module-docstring"> |
||||
<p>Slick Lightbox jQuery plugin |
||||
<a href="http://mreq.github.io/slick-lightbox/">http://mreq.github.io/slick-lightbox/</a></p> |
||||
<p>Copyright 2014-2016 mreq <a href="https://github.com/mreq">https://github.com/mreq</a></p> |
||||
<p>Released under the MIT license</p> |
||||
<p>Documentation generated by <a href="http://github.com/omarkhan/coffeedoc">CoffeeDoc</a></p> |
||||
<p><a href="http://mreq.github.io/slick-lightbox/docs/">http://mreq.github.io/slick-lightbox/docs/</a></p> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div id="classes"> |
||||
<h2>Classes</h2> |
||||
|
||||
<div class="class"> |
||||
<div class="header"> |
||||
<a id="SlickLightbox"><h3>SlickLightbox</h3></a> |
||||
|
||||
</div> |
||||
<div class="class-content"> |
||||
<p>The core class.</p> |
||||
|
||||
<div class="methods"> |
||||
|
||||
|
||||
<div class="instancemethods"> |
||||
<h3>Instance Methods</h3> |
||||
|
||||
<div class="method"> |
||||
<h4>constructor(element, @options)</h4> |
||||
<p>Binds the plugin. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>init(index)</h4> |
||||
<p>Creates the lightbox, opens it, binds events and calls <code>slick</code>. Accepts <code>index</code> of the element, that triggered it (so that we know, on which slide to start slick). </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>createModalItems()</h4> |
||||
<p>Creates individual slides to be used with slick. If <code>options.images</code> array is specified, it uses it's contents, otherwise loops through elements' <code>options.itemSelector</code>. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>createModal()</h4> |
||||
<p>Creates a <code>slick</code>-friendly modal. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>initSlick(index)</h4> |
||||
<p>Runs slick by default, using <code>options.slick</code> if provided. If <code>options.slick</code> is a function, it gets fired instead of us initializing slick. Merges in initialSlide option. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>open()</h4> |
||||
<p>Opens the lightbox. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>close()</h4> |
||||
<p>Closes the lightbox and destroys it, maintaining the original element bindings. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>bindEvents()</h4> |
||||
<p>Binds global events. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>slideSlick(direction)</h4> |
||||
<p>Moves the slick prev or next. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>detectIE()</h4> |
||||
<p>Detects usage of IE8 and lower. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>getElementCaption(el, info)</h4> |
||||
<p>Returns caption for each slide based on the type of <code>options.caption</code>. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>getElementSrc(el)</h4> |
||||
<p>Returns src for each slide image based on the type of <code>options.src</code>. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>unbindEvents()</h4> |
||||
<p>Unbinds global events. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>destroy(unbindAnchors)</h4> |
||||
<p>Destroys the lightbox and unbinds global events. If <code>true</code> is passed as an argument, unbinds the original element as well. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>destroyPrevious()</h4> |
||||
<p>Destroys lightboxes currently in DOM. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>getTransitionDuration()</h4> |
||||
<p>Detects the transition duration to know when to remove stuff from DOM etc. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>writeHistory()</h4> |
||||
<p>Writes an empty state to the history API if supported. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>filterOutSlickClones($items)</h4> |
||||
<p>Removes all slick clones from the set of elements. Only does so, if the target element is a slick slider. </p> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>handlePossibleCloneClick($clickedItem, $items)</h4> |
||||
|
||||
</div> |
||||
|
||||
<div class="method"> |
||||
<h4>elementIsSlick()</h4> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div id="functions"> |
||||
<h2>Functions</h2> |
||||
|
||||
<div class="function"> |
||||
<div class="header"> |
||||
<a id="$.fn.slickLightbox"><h3>$.fn.slickLightbox(options)</h3></a> |
||||
</div> |
||||
|
||||
<div> |
||||
<p>Fires the plugin. </p> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="function"> |
||||
<div class="header"> |
||||
<a id="$.fn.unslickLightbox"><h3>$.fn.unslickLightbox()</h3></a> |
||||
</div> |
||||
|
||||
<div> |
||||
<p>Removes everything. </p> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
||||
@ -1,38 +0,0 @@
|
||||
{ |
||||
"name": "jquery", |
||||
"version": "1.11.3", |
||||
"main": "dist/jquery.js", |
||||
"license": "MIT", |
||||
"ignore": [ |
||||
"**/.*", |
||||
"build", |
||||
"dist/cdn", |
||||
"speed", |
||||
"test", |
||||
"*.md", |
||||
"AUTHORS.txt", |
||||
"Gruntfile.js", |
||||
"package.json" |
||||
], |
||||
"devDependencies": { |
||||
"sizzle": "2.1.1-jquery.2.1.2", |
||||
"requirejs": "2.1.10", |
||||
"qunit": "1.14.0", |
||||
"sinon": "1.8.1" |
||||
}, |
||||
"keywords": [ |
||||
"jquery", |
||||
"javascript", |
||||
"library" |
||||
], |
||||
"homepage": "https://github.com/jquery/jquery", |
||||
"_release": "1.11.3", |
||||
"_resolution": { |
||||
"type": "version", |
||||
"tag": "1.11.3", |
||||
"commit": "1472290917f17af05e98007136096784f9051fab" |
||||
}, |
||||
"_source": "git://github.com/jquery/jquery.git", |
||||
"_target": "~1", |
||||
"_originalSource": "jquery" |
||||
} |
||||
@ -1,21 +0,0 @@
|
||||
Copyright 2014 jQuery Foundation and other contributors |
||||
http://jquery.com/ |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining |
||||
a copy of this software and associated documentation files (the |
||||
"Software"), to deal in the Software without restriction, including |
||||
without limitation the rights to use, copy, modify, merge, publish, |
||||
distribute, sublicense, and/or sell copies of the Software, and to |
||||
permit persons to whom the Software is furnished to do so, subject to |
||||
the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be |
||||
included in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||
@ -1,28 +0,0 @@
|
||||
{ |
||||
"name": "jquery", |
||||
"version": "1.11.3", |
||||
"main": "dist/jquery.js", |
||||
"license": "MIT", |
||||
"ignore": [ |
||||
"**/.*", |
||||
"build", |
||||
"dist/cdn", |
||||
"speed", |
||||
"test", |
||||
"*.md", |
||||
"AUTHORS.txt", |
||||
"Gruntfile.js", |
||||
"package.json" |
||||
], |
||||
"devDependencies": { |
||||
"sizzle": "2.1.1-jquery.2.1.2", |
||||
"requirejs": "2.1.10", |
||||
"qunit": "1.14.0", |
||||
"sinon": "1.8.1" |
||||
}, |
||||
"keywords": [ |
||||
"jquery", |
||||
"javascript", |
||||
"library" |
||||
] |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,801 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/rnotwhite", |
||||
"./ajax/var/nonce", |
||||
"./ajax/var/rquery", |
||||
"./core/init", |
||||
"./ajax/parseJSON", |
||||
"./ajax/parseXML", |
||||
"./deferred" |
||||
], function( jQuery, rnotwhite, nonce, rquery ) { |
||||
|
||||
var |
||||
// Document location
|
||||
ajaxLocParts, |
||||
ajaxLocation, |
||||
|
||||
rhash = /#.*$/, |
||||
rts = /([?&])_=[^&]*/, |
||||
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
||||
// #7653, #8125, #8152: local protocol detection
|
||||
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, |
||||
rnoContent = /^(?:GET|HEAD)$/, |
||||
rprotocol = /^\/\//, |
||||
rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, |
||||
|
||||
/* Prefilters |
||||
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) |
||||
* 2) These are called: |
||||
* - BEFORE asking for a transport |
||||
* - AFTER param serialization (s.data is a string if s.processData is true) |
||||
* 3) key is the dataType |
||||
* 4) the catchall symbol "*" can be used |
||||
* 5) execution will start with transport dataType and THEN continue down to "*" if needed |
||||
*/ |
||||
prefilters = {}, |
||||
|
||||
/* Transports bindings |
||||
* 1) key is the dataType |
||||
* 2) the catchall symbol "*" can be used |
||||
* 3) selection will start with transport dataType and THEN go to "*" if needed |
||||
*/ |
||||
transports = {}, |
||||
|
||||
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
||||
allTypes = "*/".concat("*"); |
||||
|
||||
// #8138, IE may throw an exception when accessing
|
||||
// a field from window.location if document.domain has been set
|
||||
try { |
||||
ajaxLocation = location.href; |
||||
} catch( e ) { |
||||
// Use the href attribute of an A element
|
||||
// since IE will modify it given document.location
|
||||
ajaxLocation = document.createElement( "a" ); |
||||
ajaxLocation.href = ""; |
||||
ajaxLocation = ajaxLocation.href; |
||||
} |
||||
|
||||
// Segment location into parts
|
||||
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; |
||||
|
||||
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
||||
function addToPrefiltersOrTransports( structure ) { |
||||
|
||||
// dataTypeExpression is optional and defaults to "*"
|
||||
return function( dataTypeExpression, func ) { |
||||
|
||||
if ( typeof dataTypeExpression !== "string" ) { |
||||
func = dataTypeExpression; |
||||
dataTypeExpression = "*"; |
||||
} |
||||
|
||||
var dataType, |
||||
i = 0, |
||||
dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; |
||||
|
||||
if ( jQuery.isFunction( func ) ) { |
||||
// For each dataType in the dataTypeExpression
|
||||
while ( (dataType = dataTypes[i++]) ) { |
||||
// Prepend if requested
|
||||
if ( dataType.charAt( 0 ) === "+" ) { |
||||
dataType = dataType.slice( 1 ) || "*"; |
||||
(structure[ dataType ] = structure[ dataType ] || []).unshift( func ); |
||||
|
||||
// Otherwise append
|
||||
} else { |
||||
(structure[ dataType ] = structure[ dataType ] || []).push( func ); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
|
||||
// Base inspection function for prefilters and transports
|
||||
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { |
||||
|
||||
var inspected = {}, |
||||
seekingTransport = ( structure === transports ); |
||||
|
||||
function inspect( dataType ) { |
||||
var selected; |
||||
inspected[ dataType ] = true; |
||||
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { |
||||
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); |
||||
if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { |
||||
options.dataTypes.unshift( dataTypeOrTransport ); |
||||
inspect( dataTypeOrTransport ); |
||||
return false; |
||||
} else if ( seekingTransport ) { |
||||
return !( selected = dataTypeOrTransport ); |
||||
} |
||||
}); |
||||
return selected; |
||||
} |
||||
|
||||
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); |
||||
} |
||||
|
||||
// A special extend for ajax options
|
||||
// that takes "flat" options (not to be deep extended)
|
||||
// Fixes #9887
|
||||
function ajaxExtend( target, src ) { |
||||
var deep, key, |
||||
flatOptions = jQuery.ajaxSettings.flatOptions || {}; |
||||
|
||||
for ( key in src ) { |
||||
if ( src[ key ] !== undefined ) { |
||||
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; |
||||
} |
||||
} |
||||
if ( deep ) { |
||||
jQuery.extend( true, target, deep ); |
||||
} |
||||
|
||||
return target; |
||||
} |
||||
|
||||
/* Handles responses to an ajax request: |
||||
* - finds the right dataType (mediates between content-type and expected dataType) |
||||
* - returns the corresponding response |
||||
*/ |
||||
function ajaxHandleResponses( s, jqXHR, responses ) { |
||||
var firstDataType, ct, finalDataType, type, |
||||
contents = s.contents, |
||||
dataTypes = s.dataTypes; |
||||
|
||||
// Remove auto dataType and get content-type in the process
|
||||
while ( dataTypes[ 0 ] === "*" ) { |
||||
dataTypes.shift(); |
||||
if ( ct === undefined ) { |
||||
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); |
||||
} |
||||
} |
||||
|
||||
// Check if we're dealing with a known content-type
|
||||
if ( ct ) { |
||||
for ( type in contents ) { |
||||
if ( contents[ type ] && contents[ type ].test( ct ) ) { |
||||
dataTypes.unshift( type ); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Check to see if we have a response for the expected dataType
|
||||
if ( dataTypes[ 0 ] in responses ) { |
||||
finalDataType = dataTypes[ 0 ]; |
||||
} else { |
||||
// Try convertible dataTypes
|
||||
for ( type in responses ) { |
||||
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { |
||||
finalDataType = type; |
||||
break; |
||||
} |
||||
if ( !firstDataType ) { |
||||
firstDataType = type; |
||||
} |
||||
} |
||||
// Or just use first one
|
||||
finalDataType = finalDataType || firstDataType; |
||||
} |
||||
|
||||
// If we found a dataType
|
||||
// We add the dataType to the list if needed
|
||||
// and return the corresponding response
|
||||
if ( finalDataType ) { |
||||
if ( finalDataType !== dataTypes[ 0 ] ) { |
||||
dataTypes.unshift( finalDataType ); |
||||
} |
||||
return responses[ finalDataType ]; |
||||
} |
||||
} |
||||
|
||||
/* Chain conversions given the request and the original response |
||||
* Also sets the responseXXX fields on the jqXHR instance |
||||
*/ |
||||
function ajaxConvert( s, response, jqXHR, isSuccess ) { |
||||
var conv2, current, conv, tmp, prev, |
||||
converters = {}, |
||||
// Work with a copy of dataTypes in case we need to modify it for conversion
|
||||
dataTypes = s.dataTypes.slice(); |
||||
|
||||
// Create converters map with lowercased keys
|
||||
if ( dataTypes[ 1 ] ) { |
||||
for ( conv in s.converters ) { |
||||
converters[ conv.toLowerCase() ] = s.converters[ conv ]; |
||||
} |
||||
} |
||||
|
||||
current = dataTypes.shift(); |
||||
|
||||
// Convert to each sequential dataType
|
||||
while ( current ) { |
||||
|
||||
if ( s.responseFields[ current ] ) { |
||||
jqXHR[ s.responseFields[ current ] ] = response; |
||||
} |
||||
|
||||
// Apply the dataFilter if provided
|
||||
if ( !prev && isSuccess && s.dataFilter ) { |
||||
response = s.dataFilter( response, s.dataType ); |
||||
} |
||||
|
||||
prev = current; |
||||
current = dataTypes.shift(); |
||||
|
||||
if ( current ) { |
||||
|
||||
// There's only work to do if current dataType is non-auto
|
||||
if ( current === "*" ) { |
||||
|
||||
current = prev; |
||||
|
||||
// Convert response if prev dataType is non-auto and differs from current
|
||||
} else if ( prev !== "*" && prev !== current ) { |
||||
|
||||
// Seek a direct converter
|
||||
conv = converters[ prev + " " + current ] || converters[ "* " + current ]; |
||||
|
||||
// If none found, seek a pair
|
||||
if ( !conv ) { |
||||
for ( conv2 in converters ) { |
||||
|
||||
// If conv2 outputs current
|
||||
tmp = conv2.split( " " ); |
||||
if ( tmp[ 1 ] === current ) { |
||||
|
||||
// If prev can be converted to accepted input
|
||||
conv = converters[ prev + " " + tmp[ 0 ] ] || |
||||
converters[ "* " + tmp[ 0 ] ]; |
||||
if ( conv ) { |
||||
// Condense equivalence converters
|
||||
if ( conv === true ) { |
||||
conv = converters[ conv2 ]; |
||||
|
||||
// Otherwise, insert the intermediate dataType
|
||||
} else if ( converters[ conv2 ] !== true ) { |
||||
current = tmp[ 0 ]; |
||||
dataTypes.unshift( tmp[ 1 ] ); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Apply converter (if not an equivalence)
|
||||
if ( conv !== true ) { |
||||
|
||||
// Unless errors are allowed to bubble, catch and return them
|
||||
if ( conv && s[ "throws" ] ) { |
||||
response = conv( response ); |
||||
} else { |
||||
try { |
||||
response = conv( response ); |
||||
} catch ( e ) { |
||||
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
return { state: "success", data: response }; |
||||
} |
||||
|
||||
jQuery.extend({ |
||||
|
||||
// Counter for holding the number of active queries
|
||||
active: 0, |
||||
|
||||
// Last-Modified header cache for next request
|
||||
lastModified: {}, |
||||
etag: {}, |
||||
|
||||
ajaxSettings: { |
||||
url: ajaxLocation, |
||||
type: "GET", |
||||
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), |
||||
global: true, |
||||
processData: true, |
||||
async: true, |
||||
contentType: "application/x-www-form-urlencoded; charset=UTF-8", |
||||
/* |
||||
timeout: 0, |
||||
data: null, |
||||
dataType: null, |
||||
username: null, |
||||
password: null, |
||||
cache: null, |
||||
throws: false, |
||||
traditional: false, |
||||
headers: {}, |
||||
*/ |
||||
|
||||
accepts: { |
||||
"*": allTypes, |
||||
text: "text/plain", |
||||
html: "text/html", |
||||
xml: "application/xml, text/xml", |
||||
json: "application/json, text/javascript" |
||||
}, |
||||
|
||||
contents: { |
||||
xml: /xml/, |
||||
html: /html/, |
||||
json: /json/ |
||||
}, |
||||
|
||||
responseFields: { |
||||
xml: "responseXML", |
||||
text: "responseText", |
||||
json: "responseJSON" |
||||
}, |
||||
|
||||
// Data converters
|
||||
// Keys separate source (or catchall "*") and destination types with a single space
|
||||
converters: { |
||||
|
||||
// Convert anything to text
|
||||
"* text": String, |
||||
|
||||
// Text to html (true = no transformation)
|
||||
"text html": true, |
||||
|
||||
// Evaluate text as a json expression
|
||||
"text json": jQuery.parseJSON, |
||||
|
||||
// Parse text as xml
|
||||
"text xml": jQuery.parseXML |
||||
}, |
||||
|
||||
// For options that shouldn't be deep extended:
|
||||
// you can add your own custom options here if
|
||||
// and when you create one that shouldn't be
|
||||
// deep extended (see ajaxExtend)
|
||||
flatOptions: { |
||||
url: true, |
||||
context: true |
||||
} |
||||
}, |
||||
|
||||
// Creates a full fledged settings object into target
|
||||
// with both ajaxSettings and settings fields.
|
||||
// If target is omitted, writes into ajaxSettings.
|
||||
ajaxSetup: function( target, settings ) { |
||||
return settings ? |
||||
|
||||
// Building a settings object
|
||||
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : |
||||
|
||||
// Extending ajaxSettings
|
||||
ajaxExtend( jQuery.ajaxSettings, target ); |
||||
}, |
||||
|
||||
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), |
||||
ajaxTransport: addToPrefiltersOrTransports( transports ), |
||||
|
||||
// Main method
|
||||
ajax: function( url, options ) { |
||||
|
||||
// If url is an object, simulate pre-1.5 signature
|
||||
if ( typeof url === "object" ) { |
||||
options = url; |
||||
url = undefined; |
||||
} |
||||
|
||||
// Force options to be an object
|
||||
options = options || {}; |
||||
|
||||
var // Cross-domain detection vars
|
||||
parts, |
||||
// Loop variable
|
||||
i, |
||||
// URL without anti-cache param
|
||||
cacheURL, |
||||
// Response headers as string
|
||||
responseHeadersString, |
||||
// timeout handle
|
||||
timeoutTimer, |
||||
|
||||
// To know if global events are to be dispatched
|
||||
fireGlobals, |
||||
|
||||
transport, |
||||
// Response headers
|
||||
responseHeaders, |
||||
// Create the final options object
|
||||
s = jQuery.ajaxSetup( {}, options ), |
||||
// Callbacks context
|
||||
callbackContext = s.context || s, |
||||
// Context for global events is callbackContext if it is a DOM node or jQuery collection
|
||||
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? |
||||
jQuery( callbackContext ) : |
||||
jQuery.event, |
||||
// Deferreds
|
||||
deferred = jQuery.Deferred(), |
||||
completeDeferred = jQuery.Callbacks("once memory"), |
||||
// Status-dependent callbacks
|
||||
statusCode = s.statusCode || {}, |
||||
// Headers (they are sent all at once)
|
||||
requestHeaders = {}, |
||||
requestHeadersNames = {}, |
||||
// The jqXHR state
|
||||
state = 0, |
||||
// Default abort message
|
||||
strAbort = "canceled", |
||||
// Fake xhr
|
||||
jqXHR = { |
||||
readyState: 0, |
||||
|
||||
// Builds headers hashtable if needed
|
||||
getResponseHeader: function( key ) { |
||||
var match; |
||||
if ( state === 2 ) { |
||||
if ( !responseHeaders ) { |
||||
responseHeaders = {}; |
||||
while ( (match = rheaders.exec( responseHeadersString )) ) { |
||||
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; |
||||
} |
||||
} |
||||
match = responseHeaders[ key.toLowerCase() ]; |
||||
} |
||||
return match == null ? null : match; |
||||
}, |
||||
|
||||
// Raw string
|
||||
getAllResponseHeaders: function() { |
||||
return state === 2 ? responseHeadersString : null; |
||||
}, |
||||
|
||||
// Caches the header
|
||||
setRequestHeader: function( name, value ) { |
||||
var lname = name.toLowerCase(); |
||||
if ( !state ) { |
||||
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; |
||||
requestHeaders[ name ] = value; |
||||
} |
||||
return this; |
||||
}, |
||||
|
||||
// Overrides response content-type header
|
||||
overrideMimeType: function( type ) { |
||||
if ( !state ) { |
||||
s.mimeType = type; |
||||
} |
||||
return this; |
||||
}, |
||||
|
||||
// Status-dependent callbacks
|
||||
statusCode: function( map ) { |
||||
var code; |
||||
if ( map ) { |
||||
if ( state < 2 ) { |
||||
for ( code in map ) { |
||||
// Lazy-add the new callback in a way that preserves old ones
|
||||
statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; |
||||
} |
||||
} else { |
||||
// Execute the appropriate callbacks
|
||||
jqXHR.always( map[ jqXHR.status ] ); |
||||
} |
||||
} |
||||
return this; |
||||
}, |
||||
|
||||
// Cancel the request
|
||||
abort: function( statusText ) { |
||||
var finalText = statusText || strAbort; |
||||
if ( transport ) { |
||||
transport.abort( finalText ); |
||||
} |
||||
done( 0, finalText ); |
||||
return this; |
||||
} |
||||
}; |
||||
|
||||
// Attach deferreds
|
||||
deferred.promise( jqXHR ).complete = completeDeferred.add; |
||||
jqXHR.success = jqXHR.done; |
||||
jqXHR.error = jqXHR.fail; |
||||
|
||||
// Remove hash character (#7531: and string promotion)
|
||||
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
||||
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
||||
// We also use the url parameter if available
|
||||
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); |
||||
|
||||
// Alias method option to type as per ticket #12004
|
||||
s.type = options.method || options.type || s.method || s.type; |
||||
|
||||
// Extract dataTypes list
|
||||
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; |
||||
|
||||
// A cross-domain request is in order when we have a protocol:host:port mismatch
|
||||
if ( s.crossDomain == null ) { |
||||
parts = rurl.exec( s.url.toLowerCase() ); |
||||
s.crossDomain = !!( parts && |
||||
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || |
||||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== |
||||
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) |
||||
); |
||||
} |
||||
|
||||
// Convert data if not already a string
|
||||
if ( s.data && s.processData && typeof s.data !== "string" ) { |
||||
s.data = jQuery.param( s.data, s.traditional ); |
||||
} |
||||
|
||||
// Apply prefilters
|
||||
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); |
||||
|
||||
// If request was aborted inside a prefilter, stop there
|
||||
if ( state === 2 ) { |
||||
return jqXHR; |
||||
} |
||||
|
||||
// We can fire global events as of now if asked to
|
||||
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
|
||||
fireGlobals = jQuery.event && s.global; |
||||
|
||||
// Watch for a new set of requests
|
||||
if ( fireGlobals && jQuery.active++ === 0 ) { |
||||
jQuery.event.trigger("ajaxStart"); |
||||
} |
||||
|
||||
// Uppercase the type
|
||||
s.type = s.type.toUpperCase(); |
||||
|
||||
// Determine if request has content
|
||||
s.hasContent = !rnoContent.test( s.type ); |
||||
|
||||
// Save the URL in case we're toying with the If-Modified-Since
|
||||
// and/or If-None-Match header later on
|
||||
cacheURL = s.url; |
||||
|
||||
// More options handling for requests with no content
|
||||
if ( !s.hasContent ) { |
||||
|
||||
// If data is available, append data to url
|
||||
if ( s.data ) { |
||||
cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); |
||||
// #9682: remove data so that it's not used in an eventual retry
|
||||
delete s.data; |
||||
} |
||||
|
||||
// Add anti-cache in url if needed
|
||||
if ( s.cache === false ) { |
||||
s.url = rts.test( cacheURL ) ? |
||||
|
||||
// If there is already a '_' parameter, set its value
|
||||
cacheURL.replace( rts, "$1_=" + nonce++ ) : |
||||
|
||||
// Otherwise add one to the end
|
||||
cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; |
||||
} |
||||
} |
||||
|
||||
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
||||
if ( s.ifModified ) { |
||||
if ( jQuery.lastModified[ cacheURL ] ) { |
||||
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); |
||||
} |
||||
if ( jQuery.etag[ cacheURL ] ) { |
||||
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); |
||||
} |
||||
} |
||||
|
||||
// Set the correct header, if data is being sent
|
||||
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { |
||||
jqXHR.setRequestHeader( "Content-Type", s.contentType ); |
||||
} |
||||
|
||||
// Set the Accepts header for the server, depending on the dataType
|
||||
jqXHR.setRequestHeader( |
||||
"Accept", |
||||
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? |
||||
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : |
||||
s.accepts[ "*" ] |
||||
); |
||||
|
||||
// Check for headers option
|
||||
for ( i in s.headers ) { |
||||
jqXHR.setRequestHeader( i, s.headers[ i ] ); |
||||
} |
||||
|
||||
// Allow custom headers/mimetypes and early abort
|
||||
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { |
||||
// Abort if not done already and return
|
||||
return jqXHR.abort(); |
||||
} |
||||
|
||||
// aborting is no longer a cancellation
|
||||
strAbort = "abort"; |
||||
|
||||
// Install callbacks on deferreds
|
||||
for ( i in { success: 1, error: 1, complete: 1 } ) { |
||||
jqXHR[ i ]( s[ i ] ); |
||||
} |
||||
|
||||
// Get transport
|
||||
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); |
||||
|
||||
// If no transport, we auto-abort
|
||||
if ( !transport ) { |
||||
done( -1, "No Transport" ); |
||||
} else { |
||||
jqXHR.readyState = 1; |
||||
|
||||
// Send global event
|
||||
if ( fireGlobals ) { |
||||
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); |
||||
} |
||||
// Timeout
|
||||
if ( s.async && s.timeout > 0 ) { |
||||
timeoutTimer = setTimeout(function() { |
||||
jqXHR.abort("timeout"); |
||||
}, s.timeout ); |
||||
} |
||||
|
||||
try { |
||||
state = 1; |
||||
transport.send( requestHeaders, done ); |
||||
} catch ( e ) { |
||||
// Propagate exception as error if not done
|
||||
if ( state < 2 ) { |
||||
done( -1, e ); |
||||
// Simply rethrow otherwise
|
||||
} else { |
||||
throw e; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Callback for when everything is done
|
||||
function done( status, nativeStatusText, responses, headers ) { |
||||
var isSuccess, success, error, response, modified, |
||||
statusText = nativeStatusText; |
||||
|
||||
// Called once
|
||||
if ( state === 2 ) { |
||||
return; |
||||
} |
||||
|
||||
// State is "done" now
|
||||
state = 2; |
||||
|
||||
// Clear timeout if it exists
|
||||
if ( timeoutTimer ) { |
||||
clearTimeout( timeoutTimer ); |
||||
} |
||||
|
||||
// Dereference transport for early garbage collection
|
||||
// (no matter how long the jqXHR object will be used)
|
||||
transport = undefined; |
||||
|
||||
// Cache response headers
|
||||
responseHeadersString = headers || ""; |
||||
|
||||
// Set readyState
|
||||
jqXHR.readyState = status > 0 ? 4 : 0; |
||||
|
||||
// Determine if successful
|
||||
isSuccess = status >= 200 && status < 300 || status === 304; |
||||
|
||||
// Get response data
|
||||
if ( responses ) { |
||||
response = ajaxHandleResponses( s, jqXHR, responses ); |
||||
} |
||||
|
||||
// Convert no matter what (that way responseXXX fields are always set)
|
||||
response = ajaxConvert( s, response, jqXHR, isSuccess ); |
||||
|
||||
// If successful, handle type chaining
|
||||
if ( isSuccess ) { |
||||
|
||||
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
||||
if ( s.ifModified ) { |
||||
modified = jqXHR.getResponseHeader("Last-Modified"); |
||||
if ( modified ) { |
||||
jQuery.lastModified[ cacheURL ] = modified; |
||||
} |
||||
modified = jqXHR.getResponseHeader("etag"); |
||||
if ( modified ) { |
||||
jQuery.etag[ cacheURL ] = modified; |
||||
} |
||||
} |
||||
|
||||
// if no content
|
||||
if ( status === 204 || s.type === "HEAD" ) { |
||||
statusText = "nocontent"; |
||||
|
||||
// if not modified
|
||||
} else if ( status === 304 ) { |
||||
statusText = "notmodified"; |
||||
|
||||
// If we have data, let's convert it
|
||||
} else { |
||||
statusText = response.state; |
||||
success = response.data; |
||||
error = response.error; |
||||
isSuccess = !error; |
||||
} |
||||
} else { |
||||
// We extract error from statusText
|
||||
// then normalize statusText and status for non-aborts
|
||||
error = statusText; |
||||
if ( status || !statusText ) { |
||||
statusText = "error"; |
||||
if ( status < 0 ) { |
||||
status = 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Set data for the fake xhr object
|
||||
jqXHR.status = status; |
||||
jqXHR.statusText = ( nativeStatusText || statusText ) + ""; |
||||
|
||||
// Success/Error
|
||||
if ( isSuccess ) { |
||||
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); |
||||
} else { |
||||
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); |
||||
} |
||||
|
||||
// Status-dependent callbacks
|
||||
jqXHR.statusCode( statusCode ); |
||||
statusCode = undefined; |
||||
|
||||
if ( fireGlobals ) { |
||||
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", |
||||
[ jqXHR, s, isSuccess ? success : error ] ); |
||||
} |
||||
|
||||
// Complete
|
||||
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); |
||||
|
||||
if ( fireGlobals ) { |
||||
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); |
||||
// Handle the global AJAX counter
|
||||
if ( !( --jQuery.active ) ) { |
||||
jQuery.event.trigger("ajaxStop"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return jqXHR; |
||||
}, |
||||
|
||||
getJSON: function( url, data, callback ) { |
||||
return jQuery.get( url, data, callback, "json" ); |
||||
}, |
||||
|
||||
getScript: function( url, callback ) { |
||||
return jQuery.get( url, undefined, callback, "script" ); |
||||
} |
||||
}); |
||||
|
||||
jQuery.each( [ "get", "post" ], function( i, method ) { |
||||
jQuery[ method ] = function( url, data, callback, type ) { |
||||
// shift arguments if data argument was omitted
|
||||
if ( jQuery.isFunction( data ) ) { |
||||
type = type || callback; |
||||
callback = data; |
||||
data = undefined; |
||||
} |
||||
|
||||
return jQuery.ajax({ |
||||
url: url, |
||||
type: method, |
||||
dataType: type, |
||||
data: data, |
||||
success: callback |
||||
}); |
||||
}; |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,89 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"./var/nonce", |
||||
"./var/rquery", |
||||
"../ajax" |
||||
], function( jQuery, nonce, rquery ) { |
||||
|
||||
var oldCallbacks = [], |
||||
rjsonp = /(=)\?(?=&|$)|\?\?/; |
||||
|
||||
// Default jsonp settings
|
||||
jQuery.ajaxSetup({ |
||||
jsonp: "callback", |
||||
jsonpCallback: function() { |
||||
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); |
||||
this[ callback ] = true; |
||||
return callback; |
||||
} |
||||
}); |
||||
|
||||
// Detect, normalize options and install callbacks for jsonp requests
|
||||
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { |
||||
|
||||
var callbackName, overwritten, responseContainer, |
||||
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? |
||||
"url" : |
||||
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" |
||||
); |
||||
|
||||
// Handle iff the expected data type is "jsonp" or we have a parameter to set
|
||||
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { |
||||
|
||||
// Get callback name, remembering preexisting value associated with it
|
||||
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? |
||||
s.jsonpCallback() : |
||||
s.jsonpCallback; |
||||
|
||||
// Insert callback into url or form data
|
||||
if ( jsonProp ) { |
||||
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); |
||||
} else if ( s.jsonp !== false ) { |
||||
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; |
||||
} |
||||
|
||||
// Use data converter to retrieve json after script execution
|
||||
s.converters["script json"] = function() { |
||||
if ( !responseContainer ) { |
||||
jQuery.error( callbackName + " was not called" ); |
||||
} |
||||
return responseContainer[ 0 ]; |
||||
}; |
||||
|
||||
// force json dataType
|
||||
s.dataTypes[ 0 ] = "json"; |
||||
|
||||
// Install callback
|
||||
overwritten = window[ callbackName ]; |
||||
window[ callbackName ] = function() { |
||||
responseContainer = arguments; |
||||
}; |
||||
|
||||
// Clean-up function (fires after converters)
|
||||
jqXHR.always(function() { |
||||
// Restore preexisting value
|
||||
window[ callbackName ] = overwritten; |
||||
|
||||
// Save back as free
|
||||
if ( s[ callbackName ] ) { |
||||
// make sure that re-using the options doesn't screw things around
|
||||
s.jsonpCallback = originalSettings.jsonpCallback; |
||||
|
||||
// save the callback name for future use
|
||||
oldCallbacks.push( callbackName ); |
||||
} |
||||
|
||||
// Call if it was a function and we have a response
|
||||
if ( responseContainer && jQuery.isFunction( overwritten ) ) { |
||||
overwritten( responseContainer[ 0 ] ); |
||||
} |
||||
|
||||
responseContainer = overwritten = undefined; |
||||
}); |
||||
|
||||
// Delegate to script
|
||||
return "script"; |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,75 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../core/parseHTML", |
||||
"../ajax", |
||||
"../traversing", |
||||
"../manipulation", |
||||
"../selector", |
||||
// Optional event/alias dependency
|
||||
"../event/alias" |
||||
], function( jQuery ) { |
||||
|
||||
// Keep a copy of the old load method
|
||||
var _load = jQuery.fn.load; |
||||
|
||||
/** |
||||
* Load a url into a page |
||||
*/ |
||||
jQuery.fn.load = function( url, params, callback ) { |
||||
if ( typeof url !== "string" && _load ) { |
||||
return _load.apply( this, arguments ); |
||||
} |
||||
|
||||
var selector, response, type, |
||||
self = this, |
||||
off = url.indexOf(" "); |
||||
|
||||
if ( off >= 0 ) { |
||||
selector = jQuery.trim( url.slice( off, url.length ) ); |
||||
url = url.slice( 0, off ); |
||||
} |
||||
|
||||
// If it's a function
|
||||
if ( jQuery.isFunction( params ) ) { |
||||
|
||||
// We assume that it's the callback
|
||||
callback = params; |
||||
params = undefined; |
||||
|
||||
// Otherwise, build a param string
|
||||
} else if ( params && typeof params === "object" ) { |
||||
type = "POST"; |
||||
} |
||||
|
||||
// If we have elements to modify, make the request
|
||||
if ( self.length > 0 ) { |
||||
jQuery.ajax({ |
||||
url: url, |
||||
|
||||
// if "type" variable is undefined, then "GET" method will be used
|
||||
type: type, |
||||
dataType: "html", |
||||
data: params |
||||
}).done(function( responseText ) { |
||||
|
||||
// Save response for use in complete callback
|
||||
response = arguments; |
||||
|
||||
self.html( selector ? |
||||
|
||||
// If a selector was specified, locate the right elements in a dummy div
|
||||
// Exclude scripts to avoid IE 'Permission Denied' errors
|
||||
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : |
||||
|
||||
// Otherwise use the full result
|
||||
responseText ); |
||||
|
||||
}).complete( callback && function( jqXHR, status ) { |
||||
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); |
||||
}); |
||||
} |
||||
|
||||
return this; |
||||
}; |
||||
|
||||
}); |
||||
@ -1,51 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; |
||||
|
||||
jQuery.parseJSON = function( data ) { |
||||
// Attempt to parse using the native JSON parser first
|
||||
if ( window.JSON && window.JSON.parse ) { |
||||
// Support: Android 2.3
|
||||
// Workaround failure to string-cast null input
|
||||
return window.JSON.parse( data + "" ); |
||||
} |
||||
|
||||
var requireNonComma, |
||||
depth = null, |
||||
str = jQuery.trim( data + "" ); |
||||
|
||||
// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
|
||||
// after removing valid tokens
|
||||
return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { |
||||
|
||||
// Force termination if we see a misplaced comma
|
||||
if ( requireNonComma && comma ) { |
||||
depth = 0; |
||||
} |
||||
|
||||
// Perform no more replacements after returning to outermost depth
|
||||
if ( depth === 0 ) { |
||||
return token; |
||||
} |
||||
|
||||
// Commas must not follow "[", "{", or ","
|
||||
requireNonComma = open || comma; |
||||
|
||||
// Determine new depth
|
||||
// array/object open ("[" or "{"): depth += true - false (increment)
|
||||
// array/object close ("]" or "}"): depth += false - true (decrement)
|
||||
// other cases ("," or primitive): depth += true - true (numeric cast)
|
||||
depth += !close - !open; |
||||
|
||||
// Remove this token
|
||||
return ""; |
||||
}) ) ? |
||||
( Function( "return " + str ) )() : |
||||
jQuery.error( "Invalid JSON: " + data ); |
||||
}; |
||||
|
||||
return jQuery.parseJSON; |
||||
|
||||
}); |
||||
@ -1,31 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
// Cross-browser xml parsing
|
||||
jQuery.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; |
||||
}; |
||||
|
||||
return jQuery.parseXML; |
||||
|
||||
}); |
||||
@ -1,93 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../ajax" |
||||
], function( jQuery ) { |
||||
|
||||
// Install script dataType
|
||||
jQuery.ajaxSetup({ |
||||
accepts: { |
||||
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" |
||||
}, |
||||
contents: { |
||||
script: /(?:java|ecma)script/ |
||||
}, |
||||
converters: { |
||||
"text script": function( text ) { |
||||
jQuery.globalEval( text ); |
||||
return text; |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Handle cache's special case and global
|
||||
jQuery.ajaxPrefilter( "script", function( s ) { |
||||
if ( s.cache === undefined ) { |
||||
s.cache = false; |
||||
} |
||||
if ( s.crossDomain ) { |
||||
s.type = "GET"; |
||||
s.global = false; |
||||
} |
||||
}); |
||||
|
||||
// Bind script tag hack transport
|
||||
jQuery.ajaxTransport( "script", function(s) { |
||||
|
||||
// This transport only deals with cross domain requests
|
||||
if ( s.crossDomain ) { |
||||
|
||||
var script, |
||||
head = document.head || jQuery("head")[0] || document.documentElement; |
||||
|
||||
return { |
||||
|
||||
send: function( _, callback ) { |
||||
|
||||
script = document.createElement("script"); |
||||
|
||||
script.async = true; |
||||
|
||||
if ( s.scriptCharset ) { |
||||
script.charset = s.scriptCharset; |
||||
} |
||||
|
||||
script.src = s.url; |
||||
|
||||
// Attach handlers for all browsers
|
||||
script.onload = script.onreadystatechange = function( _, isAbort ) { |
||||
|
||||
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { |
||||
|
||||
// Handle memory leak in IE
|
||||
script.onload = script.onreadystatechange = null; |
||||
|
||||
// Remove the script
|
||||
if ( script.parentNode ) { |
||||
script.parentNode.removeChild( script ); |
||||
} |
||||
|
||||
// Dereference the script
|
||||
script = null; |
||||
|
||||
// Callback if not abort
|
||||
if ( !isAbort ) { |
||||
callback( 200, "success" ); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
|
||||
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
||||
head.insertBefore( script, head.firstChild ); |
||||
}, |
||||
|
||||
abort: function() { |
||||
if ( script ) { |
||||
script.onload( undefined, true ); |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"../../core" |
||||
], function( jQuery ) { |
||||
return jQuery.now(); |
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return (/\?/); |
||||
}); |
||||
@ -1,197 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/support", |
||||
"../ajax" |
||||
], function( jQuery, support ) { |
||||
|
||||
// Create the request object
|
||||
// (This is still attached to ajaxSettings for backward compatibility)
|
||||
jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? |
||||
// Support: IE6+
|
||||
function() { |
||||
|
||||
// XHR cannot access local files, always use ActiveX for that case
|
||||
return !this.isLocal && |
||||
|
||||
// Support: IE7-8
|
||||
// oldIE XHR does not support non-RFC2616 methods (#13240)
|
||||
// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
|
||||
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
|
||||
// Although this check for six methods instead of eight
|
||||
// since IE also does not support "trace" and "connect"
|
||||
/^(get|post|head|put|delete|options)$/i.test( this.type ) && |
||||
|
||||
createStandardXHR() || createActiveXHR(); |
||||
} : |
||||
// For all other browsers, use the standard XMLHttpRequest object
|
||||
createStandardXHR; |
||||
|
||||
var xhrId = 0, |
||||
xhrCallbacks = {}, |
||||
xhrSupported = jQuery.ajaxSettings.xhr(); |
||||
|
||||
// Support: IE<10
|
||||
// Open requests must be manually aborted on unload (#5280)
|
||||
// See https://support.microsoft.com/kb/2856746 for more info
|
||||
if ( window.attachEvent ) { |
||||
window.attachEvent( "onunload", function() { |
||||
for ( var key in xhrCallbacks ) { |
||||
xhrCallbacks[ key ]( undefined, true ); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// Determine support properties
|
||||
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); |
||||
xhrSupported = support.ajax = !!xhrSupported; |
||||
|
||||
// Create transport if the browser can provide an xhr
|
||||
if ( xhrSupported ) { |
||||
|
||||
jQuery.ajaxTransport(function( options ) { |
||||
// Cross domain only allowed if supported through XMLHttpRequest
|
||||
if ( !options.crossDomain || support.cors ) { |
||||
|
||||
var callback; |
||||
|
||||
return { |
||||
send: function( headers, complete ) { |
||||
var i, |
||||
xhr = options.xhr(), |
||||
id = ++xhrId; |
||||
|
||||
// Open the socket
|
||||
xhr.open( options.type, options.url, options.async, options.username, options.password ); |
||||
|
||||
// Apply custom fields if provided
|
||||
if ( options.xhrFields ) { |
||||
for ( i in options.xhrFields ) { |
||||
xhr[ i ] = options.xhrFields[ i ]; |
||||
} |
||||
} |
||||
|
||||
// Override mime type if needed
|
||||
if ( options.mimeType && xhr.overrideMimeType ) { |
||||
xhr.overrideMimeType( options.mimeType ); |
||||
} |
||||
|
||||
// X-Requested-With header
|
||||
// For cross-domain requests, seeing as conditions for a preflight are
|
||||
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
||||
// (it can always be set on a per-request basis or even using ajaxSetup)
|
||||
// For same-domain requests, won't change header if already provided.
|
||||
if ( !options.crossDomain && !headers["X-Requested-With"] ) { |
||||
headers["X-Requested-With"] = "XMLHttpRequest"; |
||||
} |
||||
|
||||
// Set headers
|
||||
for ( i in headers ) { |
||||
// Support: IE<9
|
||||
// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
|
||||
// request header to a null-value.
|
||||
//
|
||||
// To keep consistent with other XHR implementations, cast the value
|
||||
// to string and ignore `undefined`.
|
||||
if ( headers[ i ] !== undefined ) { |
||||
xhr.setRequestHeader( i, headers[ i ] + "" ); |
||||
} |
||||
} |
||||
|
||||
// Do send the request
|
||||
// This may raise an exception which is actually
|
||||
// handled in jQuery.ajax (so no try/catch here)
|
||||
xhr.send( ( options.hasContent && options.data ) || null ); |
||||
|
||||
// Listener
|
||||
callback = function( _, isAbort ) { |
||||
var status, statusText, responses; |
||||
|
||||
// Was never called and is aborted or complete
|
||||
if ( callback && ( isAbort || xhr.readyState === 4 ) ) { |
||||
// Clean up
|
||||
delete xhrCallbacks[ id ]; |
||||
callback = undefined; |
||||
xhr.onreadystatechange = jQuery.noop; |
||||
|
||||
// Abort manually if needed
|
||||
if ( isAbort ) { |
||||
if ( xhr.readyState !== 4 ) { |
||||
xhr.abort(); |
||||
} |
||||
} else { |
||||
responses = {}; |
||||
status = xhr.status; |
||||
|
||||
// Support: IE<10
|
||||
// Accessing binary-data responseText throws an exception
|
||||
// (#11426)
|
||||
if ( typeof xhr.responseText === "string" ) { |
||||
responses.text = xhr.responseText; |
||||
} |
||||
|
||||
// Firefox throws an exception when accessing
|
||||
// statusText for faulty cross-domain requests
|
||||
try { |
||||
statusText = xhr.statusText; |
||||
} catch( e ) { |
||||
// We normalize with Webkit giving an empty statusText
|
||||
statusText = ""; |
||||
} |
||||
|
||||
// Filter status for non standard behaviors
|
||||
|
||||
// If the request is local and we have data: assume a success
|
||||
// (success with no data won't get notified, that's the best we
|
||||
// can do given current implementations)
|
||||
if ( !status && options.isLocal && !options.crossDomain ) { |
||||
status = responses.text ? 200 : 404; |
||||
// IE - #1450: sometimes returns 1223 when it should be 204
|
||||
} else if ( status === 1223 ) { |
||||
status = 204; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Call complete if needed
|
||||
if ( responses ) { |
||||
complete( status, statusText, responses, xhr.getAllResponseHeaders() ); |
||||
} |
||||
}; |
||||
|
||||
if ( !options.async ) { |
||||
// if we're in sync mode we fire the callback
|
||||
callback(); |
||||
} else if ( xhr.readyState === 4 ) { |
||||
// (IE6 & IE7) if it's in cache and has been
|
||||
// retrieved directly we need to fire the callback
|
||||
setTimeout( callback ); |
||||
} else { |
||||
// Add to the list of active xhr callbacks
|
||||
xhr.onreadystatechange = xhrCallbacks[ id ] = callback; |
||||
} |
||||
}, |
||||
|
||||
abort: function() { |
||||
if ( callback ) { |
||||
callback( undefined, true ); |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// Functions to create xhrs
|
||||
function createStandardXHR() { |
||||
try { |
||||
return new window.XMLHttpRequest(); |
||||
} catch( e ) {} |
||||
} |
||||
|
||||
function createActiveXHR() { |
||||
try { |
||||
return new window.ActiveXObject( "Microsoft.XMLHTTP" ); |
||||
} catch( e ) {} |
||||
} |
||||
|
||||
}); |
||||
@ -1,11 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./attributes/val", |
||||
"./attributes/attr", |
||||
"./attributes/prop", |
||||
"./attributes/classes" |
||||
], function( jQuery ) { |
||||
|
||||
// Return jQuery for attributes-only inclusion
|
||||
return jQuery; |
||||
}); |
||||
@ -1,271 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/rnotwhite", |
||||
"../var/strundefined", |
||||
"../core/access", |
||||
"./support", |
||||
"./val", |
||||
"../selector" |
||||
], function( jQuery, rnotwhite, strundefined, access, support ) { |
||||
|
||||
var nodeHook, boolHook, |
||||
attrHandle = jQuery.expr.attrHandle, |
||||
ruseDefault = /^(?:checked|selected)$/i, |
||||
getSetAttribute = support.getSetAttribute, |
||||
getSetInput = support.input; |
||||
|
||||
jQuery.fn.extend({ |
||||
attr: function( name, value ) { |
||||
return access( this, jQuery.attr, name, value, arguments.length > 1 ); |
||||
}, |
||||
|
||||
removeAttr: function( name ) { |
||||
return this.each(function() { |
||||
jQuery.removeAttr( this, name ); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
jQuery.extend({ |
||||
attr: function( elem, name, value ) { |
||||
var hooks, ret, |
||||
nType = elem.nodeType; |
||||
|
||||
// don't get/set attributes on text, comment and attribute nodes
|
||||
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
||||
return; |
||||
} |
||||
|
||||
// Fallback to prop when attributes are not supported
|
||||
if ( typeof elem.getAttribute === strundefined ) { |
||||
return jQuery.prop( elem, name, value ); |
||||
} |
||||
|
||||
// All attributes are lowercase
|
||||
// Grab necessary hook if one is defined
|
||||
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { |
||||
name = name.toLowerCase(); |
||||
hooks = jQuery.attrHooks[ name ] || |
||||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); |
||||
} |
||||
|
||||
if ( value !== undefined ) { |
||||
|
||||
if ( value === null ) { |
||||
jQuery.removeAttr( elem, name ); |
||||
|
||||
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { |
||||
return ret; |
||||
|
||||
} else { |
||||
elem.setAttribute( name, value + "" ); |
||||
return value; |
||||
} |
||||
|
||||
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { |
||||
return ret; |
||||
|
||||
} else { |
||||
ret = jQuery.find.attr( elem, name ); |
||||
|
||||
// Non-existent attributes return null, we normalize to undefined
|
||||
return ret == null ? |
||||
undefined : |
||||
ret; |
||||
} |
||||
}, |
||||
|
||||
removeAttr: function( elem, value ) { |
||||
var name, propName, |
||||
i = 0, |
||||
attrNames = value && value.match( rnotwhite ); |
||||
|
||||
if ( attrNames && elem.nodeType === 1 ) { |
||||
while ( (name = attrNames[i++]) ) { |
||||
propName = jQuery.propFix[ name ] || name; |
||||
|
||||
// Boolean attributes get special treatment (#10870)
|
||||
if ( jQuery.expr.match.bool.test( name ) ) { |
||||
// Set corresponding property to false
|
||||
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { |
||||
elem[ propName ] = false; |
||||
// Support: IE<9
|
||||
// Also clear defaultChecked/defaultSelected (if appropriate)
|
||||
} else { |
||||
elem[ jQuery.camelCase( "default-" + name ) ] = |
||||
elem[ propName ] = false; |
||||
} |
||||
|
||||
// See #9699 for explanation of this approach (setting first, then removal)
|
||||
} else { |
||||
jQuery.attr( elem, name, "" ); |
||||
} |
||||
|
||||
elem.removeAttribute( getSetAttribute ? name : propName ); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
attrHooks: { |
||||
type: { |
||||
set: function( elem, value ) { |
||||
if ( !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 default in case type is set after value during creation
|
||||
var val = elem.value; |
||||
elem.setAttribute( "type", value ); |
||||
if ( val ) { |
||||
elem.value = val; |
||||
} |
||||
return value; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Hook for boolean attributes
|
||||
boolHook = { |
||||
set: function( elem, value, name ) { |
||||
if ( value === false ) { |
||||
// Remove boolean attributes when set to false
|
||||
jQuery.removeAttr( elem, name ); |
||||
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { |
||||
// IE<8 needs the *property* name
|
||||
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); |
||||
|
||||
// Use defaultChecked and defaultSelected for oldIE
|
||||
} else { |
||||
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; |
||||
} |
||||
|
||||
return name; |
||||
} |
||||
}; |
||||
|
||||
// Retrieve booleans specially
|
||||
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { |
||||
|
||||
var getter = attrHandle[ name ] || jQuery.find.attr; |
||||
|
||||
attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? |
||||
function( elem, name, isXML ) { |
||||
var ret, handle; |
||||
if ( !isXML ) { |
||||
// Avoid an infinite loop by temporarily removing this function from the getter
|
||||
handle = attrHandle[ name ]; |
||||
attrHandle[ name ] = ret; |
||||
ret = getter( elem, name, isXML ) != null ? |
||||
name.toLowerCase() : |
||||
null; |
||||
attrHandle[ name ] = handle; |
||||
} |
||||
return ret; |
||||
} : |
||||
function( elem, name, isXML ) { |
||||
if ( !isXML ) { |
||||
return elem[ jQuery.camelCase( "default-" + name ) ] ? |
||||
name.toLowerCase() : |
||||
null; |
||||
} |
||||
}; |
||||
}); |
||||
|
||||
// fix oldIE attroperties
|
||||
if ( !getSetInput || !getSetAttribute ) { |
||||
jQuery.attrHooks.value = { |
||||
set: function( elem, value, name ) { |
||||
if ( jQuery.nodeName( elem, "input" ) ) { |
||||
// Does not return so that setAttribute is also used
|
||||
elem.defaultValue = value; |
||||
} else { |
||||
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
|
||||
return nodeHook && nodeHook.set( elem, value, name ); |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
|
||||
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
||||
if ( !getSetAttribute ) { |
||||
|
||||
// Use this for any attribute in IE6/7
|
||||
// This fixes almost every IE6/7 issue
|
||||
nodeHook = { |
||||
set: function( elem, value, name ) { |
||||
// Set the existing or create a new attribute node
|
||||
var ret = elem.getAttributeNode( name ); |
||||
if ( !ret ) { |
||||
elem.setAttributeNode( |
||||
(ret = elem.ownerDocument.createAttribute( name )) |
||||
); |
||||
} |
||||
|
||||
ret.value = value += ""; |
||||
|
||||
// Break association with cloned elements by also using setAttribute (#9646)
|
||||
if ( name === "value" || value === elem.getAttribute( name ) ) { |
||||
return value; |
||||
} |
||||
} |
||||
}; |
||||
|
||||
// Some attributes are constructed with empty-string values when not defined
|
||||
attrHandle.id = attrHandle.name = attrHandle.coords = |
||||
function( elem, name, isXML ) { |
||||
var ret; |
||||
if ( !isXML ) { |
||||
return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? |
||||
ret.value : |
||||
null; |
||||
} |
||||
}; |
||||
|
||||
// Fixing value retrieval on a button requires this module
|
||||
jQuery.valHooks.button = { |
||||
get: function( elem, name ) { |
||||
var ret = elem.getAttributeNode( name ); |
||||
if ( ret && ret.specified ) { |
||||
return ret.value; |
||||
} |
||||
}, |
||||
set: nodeHook.set |
||||
}; |
||||
|
||||
// Set contenteditable to false on removals(#10429)
|
||||
// Setting to empty string throws an error as an invalid value
|
||||
jQuery.attrHooks.contenteditable = { |
||||
set: function( elem, value, name ) { |
||||
nodeHook.set( elem, value === "" ? false : value, name ); |
||||
} |
||||
}; |
||||
|
||||
// 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 ] = { |
||||
set: function( elem, value ) { |
||||
if ( value === "" ) { |
||||
elem.setAttribute( name, "auto" ); |
||||
return value; |
||||
} |
||||
} |
||||
}; |
||||
}); |
||||
} |
||||
|
||||
if ( !support.style ) { |
||||
jQuery.attrHooks.style = { |
||||
get: function( elem ) { |
||||
// Return undefined in the case of empty string
|
||||
// Note: IE uppercases css property names, but if we were to .toLowerCase()
|
||||
// .cssText, that would destroy case senstitivity in URL's, like in "background"
|
||||
return elem.style.cssText || undefined; |
||||
}, |
||||
set: function( elem, value ) { |
||||
return ( elem.style.cssText = value + "" ); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
}); |
||||
@ -1,157 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/rnotwhite", |
||||
"../var/strundefined", |
||||
"../core/init" |
||||
], function( jQuery, rnotwhite, strundefined ) { |
||||
|
||||
var rclass = /[\t\r\n\f]/g; |
||||
|
||||
jQuery.fn.extend({ |
||||
addClass: function( value ) { |
||||
var classes, elem, cur, clazz, j, finalValue, |
||||
i = 0, |
||||
len = this.length, |
||||
proceed = typeof value === "string" && value; |
||||
|
||||
if ( jQuery.isFunction( value ) ) { |
||||
return this.each(function( j ) { |
||||
jQuery( this ).addClass( value.call( this, j, this.className ) ); |
||||
}); |
||||
} |
||||
|
||||
if ( proceed ) { |
||||
// The disjunction here is for better compressibility (see removeClass)
|
||||
classes = ( value || "" ).match( rnotwhite ) || []; |
||||
|
||||
for ( ; i < len; i++ ) { |
||||
elem = this[ i ]; |
||||
cur = elem.nodeType === 1 && ( elem.className ? |
||||
( " " + elem.className + " " ).replace( rclass, " " ) : |
||||
" " |
||||
); |
||||
|
||||
if ( cur ) { |
||||
j = 0; |
||||
while ( (clazz = classes[j++]) ) { |
||||
if ( cur.indexOf( " " + clazz + " " ) < 0 ) { |
||||
cur += clazz + " "; |
||||
} |
||||
} |
||||
|
||||
// only assign if different to avoid unneeded rendering.
|
||||
finalValue = jQuery.trim( cur ); |
||||
if ( elem.className !== finalValue ) { |
||||
elem.className = finalValue; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
}, |
||||
|
||||
removeClass: function( value ) { |
||||
var classes, elem, cur, clazz, j, finalValue, |
||||
i = 0, |
||||
len = this.length, |
||||
proceed = arguments.length === 0 || typeof value === "string" && value; |
||||
|
||||
if ( jQuery.isFunction( value ) ) { |
||||
return this.each(function( j ) { |
||||
jQuery( this ).removeClass( value.call( this, j, this.className ) ); |
||||
}); |
||||
} |
||||
if ( proceed ) { |
||||
classes = ( value || "" ).match( rnotwhite ) || []; |
||||
|
||||
for ( ; i < len; i++ ) { |
||||
elem = this[ i ]; |
||||
// This expression is here for better compressibility (see addClass)
|
||||
cur = elem.nodeType === 1 && ( elem.className ? |
||||
( " " + elem.className + " " ).replace( rclass, " " ) : |
||||
"" |
||||
); |
||||
|
||||
if ( cur ) { |
||||
j = 0; |
||||
while ( (clazz = classes[j++]) ) { |
||||
// Remove *all* instances
|
||||
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { |
||||
cur = cur.replace( " " + clazz + " ", " " ); |
||||
} |
||||
} |
||||
|
||||
// only assign if different to avoid unneeded rendering.
|
||||
finalValue = value ? jQuery.trim( cur ) : ""; |
||||
if ( elem.className !== finalValue ) { |
||||
elem.className = finalValue; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
}, |
||||
|
||||
toggleClass: function( value, stateVal ) { |
||||
var type = typeof value; |
||||
|
||||
if ( typeof stateVal === "boolean" && type === "string" ) { |
||||
return stateVal ? this.addClass( value ) : this.removeClass( value ); |
||||
} |
||||
|
||||
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 ), |
||||
classNames = value.match( rnotwhite ) || []; |
||||
|
||||
while ( (className = classNames[ i++ ]) ) { |
||||
// check each className given, space separated list
|
||||
if ( self.hasClass( className ) ) { |
||||
self.removeClass( className ); |
||||
} else { |
||||
self.addClass( className ); |
||||
} |
||||
} |
||||
|
||||
// Toggle whole class name
|
||||
} else if ( type === strundefined || type === "boolean" ) { |
||||
if ( this.className ) { |
||||
// store className if set
|
||||
jQuery._data( this, "__className__", this.className ); |
||||
} |
||||
|
||||
// If the element has a class name or if we're passed "false",
|
||||
// then remove the whole classname (if there was one, the above saved it).
|
||||
// Otherwise bring back whatever was previously saved (if anything),
|
||||
// falling back to the empty string if nothing was stored.
|
||||
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; |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,134 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../core/access", |
||||
"./support" |
||||
], function( jQuery, access, support ) { |
||||
|
||||
var rfocusable = /^(?:input|select|textarea|button|object)$/i, |
||||
rclickable = /^(?:a|area)$/i; |
||||
|
||||
jQuery.fn.extend({ |
||||
prop: function( name, value ) { |
||||
return 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 ) {} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
jQuery.extend({ |
||||
propFix: { |
||||
"for": "htmlFor", |
||||
"class": "className" |
||||
}, |
||||
|
||||
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 ) { |
||||
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? |
||||
ret : |
||||
( elem[ name ] = value ); |
||||
|
||||
} else { |
||||
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? |
||||
ret : |
||||
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/
|
||||
// Use proper attribute retrieval(#12072)
|
||||
var tabindex = jQuery.find.attr( elem, "tabindex" ); |
||||
|
||||
return tabindex ? |
||||
parseInt( tabindex, 10 ) : |
||||
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? |
||||
0 : |
||||
-1; |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Some attributes require a special call on IE
|
||||
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
||||
if ( !support.hrefNormalized ) { |
||||
// href/src property should get the full normalized URL (#10299/#12915)
|
||||
jQuery.each([ "href", "src" ], function( i, name ) { |
||||
jQuery.propHooks[ name ] = { |
||||
get: function( elem ) { |
||||
return elem.getAttribute( name, 4 ); |
||||
} |
||||
}; |
||||
}); |
||||
} |
||||
|
||||
// Support: Safari, IE9+
|
||||
// mis-reports the default selected property of an option
|
||||
// Accessing the parent's selectedIndex property fixes it
|
||||
if ( !support.optSelected ) { |
||||
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; |
||||
} |
||||
}; |
||||
} |
||||
|
||||
jQuery.each([ |
||||
"tabIndex", |
||||
"readOnly", |
||||
"maxLength", |
||||
"cellSpacing", |
||||
"cellPadding", |
||||
"rowSpan", |
||||
"colSpan", |
||||
"useMap", |
||||
"frameBorder", |
||||
"contentEditable" |
||||
], function() { |
||||
jQuery.propFix[ this.toLowerCase() ] = this; |
||||
}); |
||||
|
||||
// IE6/7 call enctype encoding
|
||||
if ( !support.enctype ) { |
||||
jQuery.propFix.enctype = "encoding"; |
||||
} |
||||
|
||||
}); |
||||
@ -1,62 +0,0 @@
|
||||
define([ |
||||
"../var/support" |
||||
], function( support ) { |
||||
|
||||
(function() { |
||||
// Minified: var a,b,c,d,e
|
||||
var input, div, select, a, opt; |
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" ); |
||||
div.setAttribute( "className", "t" ); |
||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; |
||||
a = div.getElementsByTagName("a")[ 0 ]; |
||||
|
||||
// First batch of tests.
|
||||
select = document.createElement("select"); |
||||
opt = select.appendChild( document.createElement("option") ); |
||||
input = div.getElementsByTagName("input")[ 0 ]; |
||||
|
||||
a.style.cssText = "top:1px"; |
||||
|
||||
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
||||
support.getSetAttribute = div.className !== "t"; |
||||
|
||||
// Get the style information from getAttribute
|
||||
// (IE uses .cssText instead)
|
||||
support.style = /top/.test( a.getAttribute("style") ); |
||||
|
||||
// Make sure that URLs aren't manipulated
|
||||
// (IE normalizes it by default)
|
||||
support.hrefNormalized = a.getAttribute("href") === "/a"; |
||||
|
||||
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
||||
support.checkOn = !!input.value; |
||||
|
||||
// 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)
|
||||
support.optSelected = opt.selected; |
||||
|
||||
// Tests for enctype support on a form (#6743)
|
||||
support.enctype = !!document.createElement("form").enctype; |
||||
|
||||
// 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; |
||||
|
||||
// Support: IE8 only
|
||||
// Check if we can trust getAttribute("value")
|
||||
input = document.createElement( "input" ); |
||||
input.setAttribute( "value", "" ); |
||||
support.input = input.getAttribute( "value" ) === ""; |
||||
|
||||
// Check if an input maintains its value after becoming a radio
|
||||
input.value = "t"; |
||||
input.setAttribute( "type", "radio" ); |
||||
support.radioValue = input.value === "t"; |
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
@ -1,178 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"./support", |
||||
"../core/init" |
||||
], function( jQuery, support ) { |
||||
|
||||
var rreturn = /\r/g; |
||||
|
||||
jQuery.fn.extend({ |
||||
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; |
||||
|
||||
if ( this.nodeType !== 1 ) { |
||||
return; |
||||
} |
||||
|
||||
if ( isFunction ) { |
||||
val = value.call( this, i, jQuery( this ).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 ) { |
||||
var val = jQuery.find.attr( elem, "value" ); |
||||
return val != null ? |
||||
val : |
||||
// Support: IE10-11+
|
||||
// option.text throws exceptions (#14686, #14858)
|
||||
jQuery.trim( jQuery.text( elem ) ); |
||||
} |
||||
}, |
||||
select: { |
||||
get: function( elem ) { |
||||
var value, option, |
||||
options = elem.options, |
||||
index = elem.selectedIndex, |
||||
one = elem.type === "select-one" || index < 0, |
||||
values = one ? null : [], |
||||
max = one ? index + 1 : options.length, |
||||
i = index < 0 ? |
||||
max : |
||||
one ? index : 0; |
||||
|
||||
// Loop through all the selected options
|
||||
for ( ; i < max; i++ ) { |
||||
option = options[ i ]; |
||||
|
||||
// oldIE doesn't update selected after form reset (#2551)
|
||||
if ( ( option.selected || i === index ) && |
||||
// Don't return options that are disabled or in a disabled optgroup
|
||||
( 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 ); |
||||
} |
||||
} |
||||
|
||||
return values; |
||||
}, |
||||
|
||||
set: function( elem, value ) { |
||||
var optionSet, option, |
||||
options = elem.options, |
||||
values = jQuery.makeArray( value ), |
||||
i = options.length; |
||||
|
||||
while ( i-- ) { |
||||
option = options[ i ]; |
||||
|
||||
if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) { |
||||
|
||||
// Support: IE6
|
||||
// When new option element is added to select box we need to
|
||||
// force reflow of newly added node in order to workaround delay
|
||||
// of initialization properties
|
||||
try { |
||||
option.selected = optionSet = true; |
||||
|
||||
} catch ( _ ) { |
||||
|
||||
// Will be executed only in IE6
|
||||
option.scrollHeight; |
||||
} |
||||
|
||||
} else { |
||||
option.selected = false; |
||||
} |
||||
} |
||||
|
||||
// Force browsers to behave consistently when non-matching value is set
|
||||
if ( !optionSet ) { |
||||
elem.selectedIndex = -1; |
||||
} |
||||
|
||||
return options; |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Radios and checkboxes getter/setter
|
||||
jQuery.each([ "radio", "checkbox" ], function() { |
||||
jQuery.valHooks[ this ] = { |
||||
set: function( elem, value ) { |
||||
if ( jQuery.isArray( value ) ) { |
||||
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); |
||||
} |
||||
} |
||||
}; |
||||
if ( !support.checkOn ) { |
||||
jQuery.valHooks[ this ].get = function( elem ) { |
||||
// Support: Webkit
|
||||
// "" is returned instead of "on" if a value isn't specified
|
||||
return elem.getAttribute("value") === null ? "on" : elem.value; |
||||
}; |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,205 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/rnotwhite" |
||||
], function( jQuery, rnotwhite ) { |
||||
|
||||
// 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.match( rnotwhite ) || [], 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 // Flag to know if list is currently firing
|
||||
firing, |
||||
// Last fire value (for non-forgettable lists)
|
||||
memory, |
||||
// Flag to know if list was already fired
|
||||
fired, |
||||
// End of the loop when firing
|
||||
firingLength, |
||||
// Index of currently firing callback (modified by remove if needed)
|
||||
firingIndex, |
||||
// First callback to fire (used internally by add and fireWith)
|
||||
firingStart, |
||||
// 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" ) { |
||||
if ( !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; |
||||
}, |
||||
// Check if a given callback is in the list.
|
||||
// If no argument is given, return whether or not list has callbacks attached.
|
||||
has: function( fn ) { |
||||
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); |
||||
}, |
||||
// Remove all callbacks from the list
|
||||
empty: function() { |
||||
list = []; |
||||
firingLength = 0; |
||||
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 ) { |
||||
if ( list && ( !fired || stack ) ) { |
||||
args = args || []; |
||||
args = [ context, args.slice ? args.slice() : args ]; |
||||
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; |
||||
}; |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,540 +0,0 @@
|
||||
define([ |
||||
"./var/deletedIds", |
||||
"./var/slice", |
||||
"./var/concat", |
||||
"./var/push", |
||||
"./var/indexOf", |
||||
"./var/class2type", |
||||
"./var/toString", |
||||
"./var/hasOwn", |
||||
"./var/support" |
||||
], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { |
||||
|
||||
var |
||||
version = "@VERSION", |
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) { |
||||
// The jQuery object is actually just the init constructor 'enhanced'
|
||||
// Need init if jQuery is called (just allow error to be thrown if not included)
|
||||
return new jQuery.fn.init( selector, context ); |
||||
}, |
||||
|
||||
// Support: Android<4.1, IE<9
|
||||
// Make sure we trim BOM and NBSP
|
||||
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/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(); |
||||
}; |
||||
|
||||
jQuery.fn = jQuery.prototype = { |
||||
// The current version of jQuery being used
|
||||
jquery: version, |
||||
|
||||
constructor: jQuery, |
||||
|
||||
// Start with an empty selector
|
||||
selector: "", |
||||
|
||||
// The default length of a jQuery object is 0
|
||||
length: 0, |
||||
|
||||
toArray: function() { |
||||
return 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 just the one element from the set
|
||||
( num < 0 ? this[ num + this.length ] : this[ num ] ) : |
||||
|
||||
// Return all the elements in a clean array
|
||||
slice.call( this ); |
||||
}, |
||||
|
||||
// Take an array of elements and push it onto the stack
|
||||
// (returning the new matched element set)
|
||||
pushStack: function( elems ) { |
||||
|
||||
// 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; |
||||
|
||||
// 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 ); |
||||
}, |
||||
|
||||
map: function( callback ) { |
||||
return this.pushStack( jQuery.map(this, function( elem, i ) { |
||||
return callback.call( elem, i, elem ); |
||||
})); |
||||
}, |
||||
|
||||
slice: function() { |
||||
return this.pushStack( slice.apply( this, arguments ) ); |
||||
}, |
||||
|
||||
first: function() { |
||||
return this.eq( 0 ); |
||||
}, |
||||
|
||||
last: function() { |
||||
return this.eq( -1 ); |
||||
}, |
||||
|
||||
eq: function( i ) { |
||||
var len = this.length, |
||||
j = +i + ( i < 0 ? len : 0 ); |
||||
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); |
||||
}, |
||||
|
||||
end: function() { |
||||
return this.prevObject || this.constructor(null); |
||||
}, |
||||
|
||||
// For internal use only.
|
||||
// Behaves like an Array's method, not like a jQuery method.
|
||||
push: push, |
||||
sort: deletedIds.sort, |
||||
splice: deletedIds.splice |
||||
}; |
||||
|
||||
jQuery.extend = jQuery.fn.extend = function() { |
||||
var src, copyIsArray, copy, name, options, clone, |
||||
target = arguments[0] || {}, |
||||
i = 1, |
||||
length = arguments.length, |
||||
deep = false; |
||||
|
||||
// Handle a deep copy situation
|
||||
if ( typeof target === "boolean" ) { |
||||
deep = target; |
||||
|
||||
// skip the boolean and the target
|
||||
target = arguments[ i ] || {}; |
||||
i++; |
||||
} |
||||
|
||||
// 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 ( i === length ) { |
||||
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({ |
||||
// Unique for each copy of jQuery on the page
|
||||
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), |
||||
|
||||
// Assume jQuery is ready without the ready module
|
||||
isReady: true, |
||||
|
||||
error: function( msg ) { |
||||
throw new Error( msg ); |
||||
}, |
||||
|
||||
noop: function() {}, |
||||
|
||||
// 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 ) { |
||||
/* jshint eqeqeq: false */ |
||||
return obj != null && obj == obj.window; |
||||
}, |
||||
|
||||
isNumeric: function( obj ) { |
||||
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
||||
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
||||
// subtraction forces infinities to NaN
|
||||
// adding 1 corrects loss of precision from parseFloat (#15100)
|
||||
return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; |
||||
}, |
||||
|
||||
isEmptyObject: function( obj ) { |
||||
var name; |
||||
for ( name in obj ) { |
||||
return false; |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
isPlainObject: function( obj ) { |
||||
var key; |
||||
|
||||
// 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 && |
||||
!hasOwn.call(obj, "constructor") && |
||||
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { |
||||
return false; |
||||
} |
||||
} catch ( e ) { |
||||
// IE8,9 Will throw exceptions on certain host objects #9897
|
||||
return false; |
||||
} |
||||
|
||||
// Support: IE<9
|
||||
// Handle iteration over inherited properties before own properties.
|
||||
if ( support.ownLast ) { |
||||
for ( key in obj ) { |
||||
return hasOwn.call( obj, key ); |
||||
} |
||||
} |
||||
|
||||
// Own properties are enumerated firstly, so to speed up,
|
||||
// if last one is own, then all properties are own.
|
||||
for ( key in obj ) {} |
||||
|
||||
return key === undefined || hasOwn.call( obj, key ); |
||||
}, |
||||
|
||||
type: function( obj ) { |
||||
if ( obj == null ) { |
||||
return obj + ""; |
||||
} |
||||
return typeof obj === "object" || typeof obj === "function" ? |
||||
class2type[ toString.call(obj) ] || "object" : |
||||
typeof obj; |
||||
}, |
||||
|
||||
// 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 && jQuery.trim( 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 value, |
||||
i = 0, |
||||
length = obj.length, |
||||
isArray = isArraylike( obj ); |
||||
|
||||
if ( args ) { |
||||
if ( isArray ) { |
||||
for ( ; i < length; i++ ) { |
||||
value = callback.apply( obj[ i ], args ); |
||||
|
||||
if ( value === false ) { |
||||
break; |
||||
} |
||||
} |
||||
} else { |
||||
for ( i in obj ) { |
||||
value = callback.apply( obj[ i ], args ); |
||||
|
||||
if ( value === false ) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// A special, fast, case for the most common use of each
|
||||
} else { |
||||
if ( isArray ) { |
||||
for ( ; i < length; i++ ) { |
||||
value = callback.call( obj[ i ], i, obj[ i ] ); |
||||
|
||||
if ( value === false ) { |
||||
break; |
||||
} |
||||
} |
||||
} else { |
||||
for ( i in obj ) { |
||||
value = callback.call( obj[ i ], i, obj[ i ] ); |
||||
|
||||
if ( value === false ) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
return obj; |
||||
}, |
||||
|
||||
// Support: Android<4.1, IE<9
|
||||
trim: function( text ) { |
||||
return text == null ? |
||||
"" : |
||||
( text + "" ).replace( rtrim, "" ); |
||||
}, |
||||
|
||||
// results is for internal usage only
|
||||
makeArray: function( arr, results ) { |
||||
var ret = results || []; |
||||
|
||||
if ( arr != null ) { |
||||
if ( isArraylike( Object(arr) ) ) { |
||||
jQuery.merge( ret, |
||||
typeof arr === "string" ? |
||||
[ arr ] : arr |
||||
); |
||||
} else { |
||||
push.call( ret, arr ); |
||||
} |
||||
} |
||||
|
||||
return ret; |
||||
}, |
||||
|
||||
inArray: function( elem, arr, i ) { |
||||
var len; |
||||
|
||||
if ( arr ) { |
||||
if ( indexOf ) { |
||||
return 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 len = +second.length, |
||||
j = 0, |
||||
i = first.length; |
||||
|
||||
while ( j < len ) { |
||||
first[ i++ ] = second[ j++ ]; |
||||
} |
||||
|
||||
// Support: IE<9
|
||||
// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
|
||||
if ( len !== len ) { |
||||
while ( second[j] !== undefined ) { |
||||
first[ i++ ] = second[ j++ ]; |
||||
} |
||||
} |
||||
|
||||
first.length = i; |
||||
|
||||
return first; |
||||
}, |
||||
|
||||
grep: function( elems, callback, invert ) { |
||||
var callbackInverse, |
||||
matches = [], |
||||
i = 0, |
||||
length = elems.length, |
||||
callbackExpect = !invert; |
||||
|
||||
// Go through the array, only saving the items
|
||||
// that pass the validator function
|
||||
for ( ; i < length; i++ ) { |
||||
callbackInverse = !callback( elems[ i ], i ); |
||||
if ( callbackInverse !== callbackExpect ) { |
||||
matches.push( elems[ i ] ); |
||||
} |
||||
} |
||||
|
||||
return matches; |
||||
}, |
||||
|
||||
// arg is for internal usage only
|
||||
map: function( elems, callback, arg ) { |
||||
var value, |
||||
i = 0, |
||||
length = elems.length, |
||||
isArray = isArraylike( elems ), |
||||
ret = []; |
||||
|
||||
// Go through the array, translating each of the items to their new values
|
||||
if ( isArray ) { |
||||
for ( ; i < length; i++ ) { |
||||
value = callback( elems[ i ], i, arg ); |
||||
|
||||
if ( value != null ) { |
||||
ret.push( value ); |
||||
} |
||||
} |
||||
|
||||
// Go through every key on the object,
|
||||
} else { |
||||
for ( i in elems ) { |
||||
value = callback( elems[ i ], i, arg ); |
||||
|
||||
if ( value != null ) { |
||||
ret.push( value ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Flatten any nested arrays
|
||||
return 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 args, proxy, tmp; |
||||
|
||||
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 = slice.call( arguments, 2 ); |
||||
proxy = function() { |
||||
return fn.apply( context || this, args.concat( 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; |
||||
}, |
||||
|
||||
now: function() { |
||||
return +( new Date() ); |
||||
}, |
||||
|
||||
// jQuery.support is not used in Core but other projects attach their
|
||||
// properties to it so it needs to exist.
|
||||
support: support |
||||
}); |
||||
|
||||
// Populate the class2type map
|
||||
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { |
||||
class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
||||
}); |
||||
|
||||
function isArraylike( obj ) { |
||||
|
||||
// Support: iOS 8.2 (not reproducible in simulator)
|
||||
// `in` check used to prevent JIT error (gh-2145)
|
||||
// hasOwn isn't used here due to false negatives
|
||||
// regarding Nodelist length in IE
|
||||
var length = "length" in obj && obj.length, |
||||
type = jQuery.type( obj ); |
||||
|
||||
if ( type === "function" || jQuery.isWindow( obj ) ) { |
||||
return false; |
||||
} |
||||
|
||||
if ( obj.nodeType === 1 && length ) { |
||||
return true; |
||||
} |
||||
|
||||
return type === "array" || length === 0 || |
||||
typeof length === "number" && length > 0 && ( length - 1 ) in obj; |
||||
} |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,60 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
// Multifunctional method to get and set values of a collection
|
||||
// The value/s can optionally be executed if it's a function
|
||||
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { |
||||
var i = 0, |
||||
length = elems.length, |
||||
bulk = key == null; |
||||
|
||||
// Sets many values
|
||||
if ( jQuery.type( key ) === "object" ) { |
||||
chainable = true; |
||||
for ( i in key ) { |
||||
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); |
||||
} |
||||
|
||||
// Sets one value
|
||||
} else if ( value !== undefined ) { |
||||
chainable = true; |
||||
|
||||
if ( !jQuery.isFunction( value ) ) { |
||||
raw = true; |
||||
} |
||||
|
||||
if ( bulk ) { |
||||
// Bulk operations run against the entire set
|
||||
if ( raw ) { |
||||
fn.call( elems, value ); |
||||
fn = null; |
||||
|
||||
// ...except when executing function values
|
||||
} else { |
||||
bulk = fn; |
||||
fn = function( elem, key, value ) { |
||||
return bulk.call( jQuery( elem ), value ); |
||||
}; |
||||
} |
||||
} |
||||
|
||||
if ( fn ) { |
||||
for ( ; i < length; i++ ) { |
||||
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return chainable ? |
||||
elems : |
||||
|
||||
// Gets
|
||||
bulk ? |
||||
fn.call( elems ) : |
||||
length ? fn( elems[0], key ) : emptyGet; |
||||
}; |
||||
|
||||
return access; |
||||
|
||||
}); |
||||
@ -1,132 +0,0 @@
|
||||
// Initialize a jQuery object
|
||||
define([ |
||||
"../core", |
||||
"./var/rsingleTag", |
||||
"../traversing/findFilter" |
||||
], function( jQuery, rsingleTag ) { |
||||
|
||||
// A central reference to the root jQuery(document)
|
||||
var rootjQuery, |
||||
|
||||
// Use the correct document accordingly with window argument (sandbox)
|
||||
document = window.document, |
||||
|
||||
// A simple way to check for HTML strings
|
||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||
// Strict HTML recognition (#11290: must start with <)
|
||||
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, |
||||
|
||||
init = jQuery.fn.init = function( selector, context ) { |
||||
var match, elem; |
||||
|
||||
// HANDLE: $(""), $(null), $(undefined), $(false)
|
||||
if ( !selector ) { |
||||
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; |
||||
|
||||
// scripts is true for back-compat
|
||||
// Intentionally let the error be thrown if parseHTML is not present
|
||||
jQuery.merge( this, jQuery.parseHTML( |
||||
match[1], |
||||
context && context.nodeType ? context.ownerDocument || context : document, |
||||
true |
||||
) ); |
||||
|
||||
// HANDLE: $(html, props)
|
||||
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { |
||||
for ( match in context ) { |
||||
// Properties of context are called as methods if possible
|
||||
if ( jQuery.isFunction( this[ match ] ) ) { |
||||
this[ match ]( context[ match ] ); |
||||
|
||||
// ...and otherwise set as attributes
|
||||
} else { |
||||
this.attr( match, context[ match ] ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
|
||||
// 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: $(DOMElement)
|
||||
} else if ( selector.nodeType ) { |
||||
this.context = this[0] = selector; |
||||
this.length = 1; |
||||
return this; |
||||
|
||||
// HANDLE: $(function)
|
||||
// Shortcut for document ready
|
||||
} else if ( jQuery.isFunction( selector ) ) { |
||||
return typeof rootjQuery.ready !== "undefined" ? |
||||
rootjQuery.ready( selector ) : |
||||
// Execute immediately if ready is not present
|
||||
selector( jQuery ); |
||||
} |
||||
|
||||
if ( selector.selector !== undefined ) { |
||||
this.selector = selector.selector; |
||||
this.context = selector.context; |
||||
} |
||||
|
||||
return jQuery.makeArray( selector, this ); |
||||
}; |
||||
|
||||
// Give the init function the jQuery prototype for later instantiation
|
||||
init.prototype = jQuery.fn; |
||||
|
||||
// Initialize central reference
|
||||
rootjQuery = jQuery( document ); |
||||
|
||||
return init; |
||||
|
||||
}); |
||||
@ -1,39 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"./var/rsingleTag", |
||||
"../manipulation" // buildFragment
|
||||
], function( jQuery, rsingleTag ) { |
||||
|
||||
// data: string of html
|
||||
// context (optional): If specified, the fragment will be created in this context, defaults to document
|
||||
// keepScripts (optional): If true, will include scripts passed in the html string
|
||||
jQuery.parseHTML = function( data, context, keepScripts ) { |
||||
if ( !data || typeof data !== "string" ) { |
||||
return null; |
||||
} |
||||
if ( typeof context === "boolean" ) { |
||||
keepScripts = context; |
||||
context = false; |
||||
} |
||||
context = context || document; |
||||
|
||||
var parsed = rsingleTag.exec( data ), |
||||
scripts = !keepScripts && []; |
||||
|
||||
// Single tag
|
||||
if ( parsed ) { |
||||
return [ context.createElement( parsed[1] ) ]; |
||||
} |
||||
|
||||
parsed = jQuery.buildFragment( [ data ], context, scripts ); |
||||
|
||||
if ( scripts && scripts.length ) { |
||||
jQuery( scripts ).remove(); |
||||
} |
||||
|
||||
return jQuery.merge( [], parsed.childNodes ); |
||||
}; |
||||
|
||||
return jQuery.parseHTML; |
||||
|
||||
}); |
||||
@ -1,152 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../core/init", |
||||
"../deferred" |
||||
], function( jQuery ) { |
||||
|
||||
// The deferred used on DOM ready
|
||||
var readyList; |
||||
|
||||
jQuery.fn.ready = function( fn ) { |
||||
// Add the callback
|
||||
jQuery.ready.promise().done( fn ); |
||||
|
||||
return this; |
||||
}; |
||||
|
||||
jQuery.extend({ |
||||
// 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 ); |
||||
} |
||||
|
||||
// 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.triggerHandler ) { |
||||
jQuery( document ).triggerHandler( "ready" ); |
||||
jQuery( document ).off( "ready" ); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
/** |
||||
* Clean-up method for dom ready events |
||||
*/ |
||||
function detach() { |
||||
if ( document.addEventListener ) { |
||||
document.removeEventListener( "DOMContentLoaded", completed, false ); |
||||
window.removeEventListener( "load", completed, false ); |
||||
|
||||
} else { |
||||
document.detachEvent( "onreadystatechange", completed ); |
||||
window.detachEvent( "onload", completed ); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* The ready event handler and self cleanup method |
||||
*/ |
||||
function completed() { |
||||
// readyState === "complete" is good enough for us to call the dom ready in oldIE
|
||||
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { |
||||
detach(); |
||||
jQuery.ready(); |
||||
} |
||||
} |
||||
|
||||
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 ); |
||||
|
||||
// Standards-based browsers support DOMContentLoaded
|
||||
} else if ( document.addEventListener ) { |
||||
// Use the handy event callback
|
||||
document.addEventListener( "DOMContentLoaded", completed, false ); |
||||
|
||||
// A fallback to window.onload, that will always work
|
||||
window.addEventListener( "load", completed, false ); |
||||
|
||||
// If IE event model is used
|
||||
} else { |
||||
// Ensure firing before onload, maybe late but safe also for iframes
|
||||
document.attachEvent( "onreadystatechange", completed ); |
||||
|
||||
// A fallback to window.onload, that will always work
|
||||
window.attachEvent( "onload", completed ); |
||||
|
||||
// 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 ); |
||||
} |
||||
|
||||
// detach all dom ready events
|
||||
detach(); |
||||
|
||||
// and execute any waiting functions
|
||||
jQuery.ready(); |
||||
} |
||||
})(); |
||||
} |
||||
} |
||||
} |
||||
return readyList.promise( obj ); |
||||
}; |
||||
|
||||
}); |
||||
@ -1,4 +0,0 @@
|
||||
define(function() { |
||||
// Match a standalone tag
|
||||
return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); |
||||
}); |
||||
@ -1,504 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/pnum", |
||||
"./core/access", |
||||
"./css/var/rmargin", |
||||
"./css/var/rnumnonpx", |
||||
"./css/var/cssExpand", |
||||
"./css/var/isHidden", |
||||
"./css/curCSS", |
||||
"./css/defaultDisplay", |
||||
"./css/addGetHookIf", |
||||
"./css/support", |
||||
|
||||
"./core/init", |
||||
"./css/swap", |
||||
"./core/ready", |
||||
"./selector" // contains
|
||||
], function( jQuery, pnum, access, rmargin, rnumnonpx, cssExpand, isHidden, |
||||
curCSS, defaultDisplay, addGetHookIf, support ) { |
||||
|
||||
var |
||||
// BuildExclude
|
||||
getStyles = curCSS.getStyles, |
||||
ralpha = /alpha\([^)]*\)/i, |
||||
ropacity = /opacity\s*=\s*([^)]*)/, |
||||
|
||||
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
|
||||
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
rdisplayswap = /^(none|table(?!-c[ea]).+)/, |
||||
rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), |
||||
rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), |
||||
|
||||
cssShow = { position: "absolute", visibility: "hidden", display: "block" }, |
||||
cssNormalTransform = { |
||||
letterSpacing: "0", |
||||
fontWeight: "400" |
||||
}, |
||||
|
||||
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; |
||||
|
||||
// BuildExclude
|
||||
curCSS = curCSS.curCSS; |
||||
|
||||
// return a css property mapped to a potentially vendor prefixed property
|
||||
function vendorPropName( style, name ) { |
||||
|
||||
// shortcut for names that are not vendor prefixed
|
||||
if ( name in style ) { |
||||
return name; |
||||
} |
||||
|
||||
// check for vendor prefixed names
|
||||
var capName = name.charAt(0).toUpperCase() + name.slice(1), |
||||
origName = name, |
||||
i = cssPrefixes.length; |
||||
|
||||
while ( i-- ) { |
||||
name = cssPrefixes[ i ] + capName; |
||||
if ( name in style ) { |
||||
return name; |
||||
} |
||||
} |
||||
|
||||
return origName; |
||||
} |
||||
|
||||
function showHide( elements, show ) { |
||||
var display, elem, hidden, |
||||
values = [], |
||||
index = 0, |
||||
length = elements.length; |
||||
|
||||
for ( ; index < length; index++ ) { |
||||
elem = elements[ index ]; |
||||
if ( !elem.style ) { |
||||
continue; |
||||
} |
||||
|
||||
values[ index ] = jQuery._data( elem, "olddisplay" ); |
||||
display = elem.style.display; |
||||
if ( show ) { |
||||
// Reset the inline display of this element to learn if it is
|
||||
// being hidden by cascaded rules or not
|
||||
if ( !values[ index ] && display === "none" ) { |
||||
elem.style.display = ""; |
||||
} |
||||
|
||||
// Set elements which have been overridden with display: none
|
||||
// in a stylesheet to whatever the default browser style is
|
||||
// for such an element
|
||||
if ( elem.style.display === "" && isHidden( elem ) ) { |
||||
values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); |
||||
} |
||||
} else { |
||||
hidden = isHidden( elem ); |
||||
|
||||
if ( display && display !== "none" || !hidden ) { |
||||
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Set the display of most of the elements in a second loop
|
||||
// to avoid the constant reflow
|
||||
for ( index = 0; index < length; index++ ) { |
||||
elem = elements[ index ]; |
||||
if ( !elem.style ) { |
||||
continue; |
||||
} |
||||
if ( !show || elem.style.display === "none" || elem.style.display === "" ) { |
||||
elem.style.display = show ? values[ index ] || "" : "none"; |
||||
} |
||||
} |
||||
|
||||
return elements; |
||||
} |
||||
|
||||
function setPositiveNumber( elem, value, subtract ) { |
||||
var matches = rnumsplit.exec( value ); |
||||
return matches ? |
||||
// Guard against undefined "subtract", e.g., when used as in cssHooks
|
||||
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : |
||||
value; |
||||
} |
||||
|
||||
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { |
||||
var i = extra === ( isBorderBox ? "border" : "content" ) ? |
||||
// If we already have the right measurement, avoid augmentation
|
||||
4 : |
||||
// Otherwise initialize for horizontal or vertical properties
|
||||
name === "width" ? 1 : 0, |
||||
|
||||
val = 0; |
||||
|
||||
for ( ; i < 4; i += 2 ) { |
||||
// both box models exclude margin, so add it if we want it
|
||||
if ( extra === "margin" ) { |
||||
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); |
||||
} |
||||
|
||||
if ( isBorderBox ) { |
||||
// border-box includes padding, so remove it if we want content
|
||||
if ( extra === "content" ) { |
||||
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
||||
} |
||||
|
||||
// at this point, extra isn't border nor margin, so remove border
|
||||
if ( extra !== "margin" ) { |
||||
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
||||
} |
||||
} else { |
||||
// at this point, extra isn't content, so add padding
|
||||
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
||||
|
||||
// at this point, extra isn't content nor padding, so add border
|
||||
if ( extra !== "padding" ) { |
||||
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return val; |
||||
} |
||||
|
||||
function getWidthOrHeight( elem, name, extra ) { |
||||
|
||||
// Start with offset property, which is equivalent to the border-box value
|
||||
var valueIsBorderBox = true, |
||||
val = name === "width" ? elem.offsetWidth : elem.offsetHeight, |
||||
styles = getStyles( elem ), |
||||
isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; |
||||
|
||||
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
||||
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
||||
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
||||
if ( val <= 0 || val == null ) { |
||||
// Fall back to computed then uncomputed css if necessary
|
||||
val = curCSS( elem, name, styles ); |
||||
if ( val < 0 || val == null ) { |
||||
val = elem.style[ name ]; |
||||
} |
||||
|
||||
// Computed unit is not pixels. Stop here and return.
|
||||
if ( rnumnonpx.test(val) ) { |
||||
return val; |
||||
} |
||||
|
||||
// we need the check for style in case a browser which returns unreliable values
|
||||
// for getComputedStyle silently falls back to the reliable elem.style
|
||||
valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); |
||||
|
||||
// Normalize "", auto, and prepare for extra
|
||||
val = parseFloat( val ) || 0; |
||||
} |
||||
|
||||
// use the active box-sizing model to add/subtract irrelevant styles
|
||||
return ( val + |
||||
augmentWidthOrHeight( |
||||
elem, |
||||
name, |
||||
extra || ( isBorderBox ? "border" : "content" ), |
||||
valueIsBorderBox, |
||||
styles |
||||
) |
||||
) + "px"; |
||||
} |
||||
|
||||
jQuery.extend({ |
||||
// Add in style property hooks for overriding the default
|
||||
// behavior of getting and setting a style property
|
||||
cssHooks: { |
||||
opacity: { |
||||
get: function( elem, computed ) { |
||||
if ( computed ) { |
||||
// We should always get a number back from opacity
|
||||
var ret = curCSS( elem, "opacity" ); |
||||
return ret === "" ? "1" : ret; |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
|
||||
// Don't automatically add "px" to these possibly-unitless properties
|
||||
cssNumber: { |
||||
"columnCount": true, |
||||
"fillOpacity": true, |
||||
"flexGrow": true, |
||||
"flexShrink": true, |
||||
"fontWeight": true, |
||||
"lineHeight": true, |
||||
"opacity": true, |
||||
"order": true, |
||||
"orphans": true, |
||||
"widows": true, |
||||
"zIndex": true, |
||||
"zoom": true |
||||
}, |
||||
|
||||
// Add in properties whose names you wish to fix before
|
||||
// setting or getting the value
|
||||
cssProps: { |
||||
// normalize float css property
|
||||
"float": support.cssFloat ? "cssFloat" : "styleFloat" |
||||
}, |
||||
|
||||
// Get and set the style property on a DOM Node
|
||||
style: function( elem, name, value, extra ) { |
||||
// Don't set styles on text and comment nodes
|
||||
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { |
||||
return; |
||||
} |
||||
|
||||
// Make sure that we're working with the right name
|
||||
var ret, type, hooks, |
||||
origName = jQuery.camelCase( name ), |
||||
style = elem.style; |
||||
|
||||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); |
||||
|
||||
// gets hook for the prefixed version
|
||||
// followed by the unprefixed version
|
||||
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
||||
|
||||
// Check if we're setting a value
|
||||
if ( value !== undefined ) { |
||||
type = typeof value; |
||||
|
||||
// convert relative number strings (+= or -=) to relative numbers. #7345
|
||||
if ( type === "string" && (ret = rrelNum.exec( value )) ) { |
||||
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); |
||||
// Fixes bug #9237
|
||||
type = "number"; |
||||
} |
||||
|
||||
// Make sure that null and NaN values aren't set. See: #7116
|
||||
if ( value == null || value !== value ) { |
||||
return; |
||||
} |
||||
|
||||
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
||||
if ( type === "number" && !jQuery.cssNumber[ origName ] ) { |
||||
value += "px"; |
||||
} |
||||
|
||||
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
|
||||
// but it would mean to define eight (for every problematic property) identical functions
|
||||
if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { |
||||
style[ name ] = "inherit"; |
||||
} |
||||
|
||||
// If a hook was provided, use that value, otherwise just set the specified value
|
||||
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { |
||||
|
||||
// Support: IE
|
||||
// Swallow errors from 'invalid' CSS values (#5509)
|
||||
try { |
||||
style[ name ] = value; |
||||
} catch(e) {} |
||||
} |
||||
|
||||
} else { |
||||
// If a hook was provided get the non-computed value from there
|
||||
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { |
||||
return ret; |
||||
} |
||||
|
||||
// Otherwise just get the value from the style object
|
||||
return style[ name ]; |
||||
} |
||||
}, |
||||
|
||||
css: function( elem, name, extra, styles ) { |
||||
var num, val, hooks, |
||||
origName = jQuery.camelCase( name ); |
||||
|
||||
// Make sure that we're working with the right name
|
||||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); |
||||
|
||||
// gets hook for the prefixed version
|
||||
// followed by the unprefixed version
|
||||
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
||||
|
||||
// If a hook was provided get the computed value from there
|
||||
if ( hooks && "get" in hooks ) { |
||||
val = hooks.get( elem, true, extra ); |
||||
} |
||||
|
||||
// Otherwise, if a way to get the computed value exists, use that
|
||||
if ( val === undefined ) { |
||||
val = curCSS( elem, name, styles ); |
||||
} |
||||
|
||||
//convert "normal" to computed value
|
||||
if ( val === "normal" && name in cssNormalTransform ) { |
||||
val = cssNormalTransform[ name ]; |
||||
} |
||||
|
||||
// Return, converting to number if forced or a qualifier was provided and val looks numeric
|
||||
if ( extra === "" || extra ) { |
||||
num = parseFloat( val ); |
||||
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; |
||||
} |
||||
return val; |
||||
} |
||||
}); |
||||
|
||||
jQuery.each([ "height", "width" ], function( i, name ) { |
||||
jQuery.cssHooks[ name ] = { |
||||
get: function( elem, computed, extra ) { |
||||
if ( computed ) { |
||||
// certain elements can have dimension info if we invisibly show them
|
||||
// however, it must have a current display style that would benefit from this
|
||||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? |
||||
jQuery.swap( elem, cssShow, function() { |
||||
return getWidthOrHeight( elem, name, extra ); |
||||
}) : |
||||
getWidthOrHeight( elem, name, extra ); |
||||
} |
||||
}, |
||||
|
||||
set: function( elem, value, extra ) { |
||||
var styles = extra && getStyles( elem ); |
||||
return setPositiveNumber( elem, value, extra ? |
||||
augmentWidthOrHeight( |
||||
elem, |
||||
name, |
||||
extra, |
||||
support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", |
||||
styles |
||||
) : 0 |
||||
); |
||||
} |
||||
}; |
||||
}); |
||||
|
||||
if ( !support.opacity ) { |
||||
jQuery.cssHooks.opacity = { |
||||
get: function( elem, computed ) { |
||||
// IE uses filters for opacity
|
||||
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? |
||||
( 0.01 * parseFloat( RegExp.$1 ) ) + "" : |
||||
computed ? "1" : ""; |
||||
}, |
||||
|
||||
set: function( elem, value ) { |
||||
var style = elem.style, |
||||
currentStyle = elem.currentStyle, |
||||
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", |
||||
filter = currentStyle && currentStyle.filter || style.filter || ""; |
||||
|
||||
// IE has trouble with opacity if it does not have layout
|
||||
// Force it by setting the zoom level
|
||||
style.zoom = 1; |
||||
|
||||
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
||||
// if value === "", then remove inline opacity #12685
|
||||
if ( ( value >= 1 || value === "" ) && |
||||
jQuery.trim( filter.replace( ralpha, "" ) ) === "" && |
||||
style.removeAttribute ) { |
||||
|
||||
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
||||
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
||||
// style.removeAttribute is IE Only, but so apparently is this code path...
|
||||
style.removeAttribute( "filter" ); |
||||
|
||||
// if there is no filter style applied in a css rule or unset inline opacity, we are done
|
||||
if ( value === "" || currentStyle && !currentStyle.filter ) { |
||||
return; |
||||
} |
||||
} |
||||
|
||||
// otherwise, set new filter values
|
||||
style.filter = ralpha.test( filter ) ? |
||||
filter.replace( ralpha, opacity ) : |
||||
filter + " " + opacity; |
||||
} |
||||
}; |
||||
} |
||||
|
||||
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, |
||||
function( elem, computed ) { |
||||
if ( computed ) { |
||||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
||||
// Work around by temporarily setting element display to inline-block
|
||||
return jQuery.swap( elem, { "display": "inline-block" }, |
||||
curCSS, [ elem, "marginRight" ] ); |
||||
} |
||||
} |
||||
); |
||||
|
||||
// These hooks are used by animate to expand properties
|
||||
jQuery.each({ |
||||
margin: "", |
||||
padding: "", |
||||
border: "Width" |
||||
}, function( prefix, suffix ) { |
||||
jQuery.cssHooks[ prefix + suffix ] = { |
||||
expand: function( value ) { |
||||
var i = 0, |
||||
expanded = {}, |
||||
|
||||
// assumes a single number if not a string
|
||||
parts = typeof value === "string" ? value.split(" ") : [ value ]; |
||||
|
||||
for ( ; i < 4; i++ ) { |
||||
expanded[ prefix + cssExpand[ i ] + suffix ] = |
||||
parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; |
||||
} |
||||
|
||||
return expanded; |
||||
} |
||||
}; |
||||
|
||||
if ( !rmargin.test( prefix ) ) { |
||||
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; |
||||
} |
||||
}); |
||||
|
||||
jQuery.fn.extend({ |
||||
css: function( name, value ) { |
||||
return access( this, function( elem, name, value ) { |
||||
var styles, len, |
||||
map = {}, |
||||
i = 0; |
||||
|
||||
if ( jQuery.isArray( name ) ) { |
||||
styles = getStyles( elem ); |
||||
len = name.length; |
||||
|
||||
for ( ; i < len; i++ ) { |
||||
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); |
||||
} |
||||
|
||||
return map; |
||||
} |
||||
|
||||
return value !== undefined ? |
||||
jQuery.style( elem, name, value ) : |
||||
jQuery.css( elem, name ); |
||||
}, name, value, arguments.length > 1 ); |
||||
}, |
||||
show: function() { |
||||
return showHide( this, true ); |
||||
}, |
||||
hide: function() { |
||||
return showHide( this ); |
||||
}, |
||||
toggle: function( state ) { |
||||
if ( typeof state === "boolean" ) { |
||||
return state ? this.show() : this.hide(); |
||||
} |
||||
|
||||
return this.each(function() { |
||||
if ( isHidden( this ) ) { |
||||
jQuery( this ).show(); |
||||
} else { |
||||
jQuery( this ).hide(); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,32 +0,0 @@
|
||||
define(function() { |
||||
|
||||
function addGetHookIf( conditionFn, hookFn ) { |
||||
// Define the hook, we'll check on the first run if it's really needed.
|
||||
return { |
||||
get: function() { |
||||
var condition = conditionFn(); |
||||
|
||||
if ( condition == null ) { |
||||
// The test was not ready at this point; screw the hook this time
|
||||
// but check again when needed next time.
|
||||
return; |
||||
} |
||||
|
||||
if ( condition ) { |
||||
// Hook not needed (or it's not possible to use it due to missing dependency),
|
||||
// remove it.
|
||||
// Since there are no other hooks for marginRight, remove the whole object.
|
||||
delete this.get; |
||||
return; |
||||
} |
||||
|
||||
// Hook needed; redefine it so that the support test is not executed again.
|
||||
|
||||
return (this.get = hookFn).apply( this, arguments ); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
return addGetHookIf; |
||||
|
||||
}); |
||||
@ -1,124 +0,0 @@
|
||||
define([ |
||||
"exports", |
||||
"../core", |
||||
"./var/rnumnonpx", |
||||
"./var/rmargin", |
||||
"../selector" // contains
|
||||
], function( exports, jQuery, rnumnonpx, rmargin ) { |
||||
|
||||
var getStyles, curCSS, |
||||
rposition = /^(top|right|bottom|left)$/; |
||||
|
||||
if ( window.getComputedStyle ) { |
||||
getStyles = function( elem ) { |
||||
// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
|
||||
// IE throws on elements created in popups
|
||||
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
|
||||
if ( elem.ownerDocument.defaultView.opener ) { |
||||
return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); |
||||
} |
||||
|
||||
return window.getComputedStyle( elem, null ); |
||||
}; |
||||
|
||||
curCSS = function( elem, name, computed ) { |
||||
var width, minWidth, maxWidth, ret, |
||||
style = elem.style; |
||||
|
||||
computed = computed || getStyles( elem ); |
||||
|
||||
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
|
||||
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; |
||||
|
||||
if ( computed ) { |
||||
|
||||
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { |
||||
ret = jQuery.style( elem, name ); |
||||
} |
||||
|
||||
// A tribute to the "awesome hack by Dean Edwards"
|
||||
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
|
||||
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
|
||||
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
|
||||
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { |
||||
|
||||
// Remember the original values
|
||||
width = style.width; |
||||
minWidth = style.minWidth; |
||||
maxWidth = style.maxWidth; |
||||
|
||||
// Put in the new values to get a computed value out
|
||||
style.minWidth = style.maxWidth = style.width = ret; |
||||
ret = computed.width; |
||||
|
||||
// Revert the changed values
|
||||
style.width = width; |
||||
style.minWidth = minWidth; |
||||
style.maxWidth = maxWidth; |
||||
} |
||||
} |
||||
|
||||
// Support: IE
|
||||
// IE returns zIndex value as an integer.
|
||||
return ret === undefined ? |
||||
ret : |
||||
ret + ""; |
||||
}; |
||||
} else if ( document.documentElement.currentStyle ) { |
||||
getStyles = function( elem ) { |
||||
return elem.currentStyle; |
||||
}; |
||||
|
||||
curCSS = function( elem, name, computed ) { |
||||
var left, rs, rsLeft, ret, |
||||
style = elem.style; |
||||
|
||||
computed = computed || getStyles( elem ); |
||||
ret = computed ? computed[ name ] : undefined; |
||||
|
||||
// Avoid setting ret to empty string here
|
||||
// so we don't default to auto
|
||||
if ( ret == null && style && style[ name ] ) { |
||||
ret = style[ name ]; |
||||
} |
||||
|
||||
// From the awesome hack by Dean Edwards
|
||||
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
||||
|
||||
// If we're not dealing with a regular pixel number
|
||||
// but a number that has a weird ending, we need to convert it to pixels
|
||||
// but not position css attributes, as those are proportional to the parent element instead
|
||||
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
|
||||
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { |
||||
|
||||
// Remember the original values
|
||||
left = style.left; |
||||
rs = elem.runtimeStyle; |
||||
rsLeft = rs && rs.left; |
||||
|
||||
// Put in the new values to get a computed value out
|
||||
if ( rsLeft ) { |
||||
rs.left = elem.currentStyle.left; |
||||
} |
||||
style.left = name === "fontSize" ? "1em" : ret; |
||||
ret = style.pixelLeft + "px"; |
||||
|
||||
// Revert the changed values
|
||||
style.left = left; |
||||
if ( rsLeft ) { |
||||
rs.left = rsLeft; |
||||
} |
||||
} |
||||
|
||||
// Support: IE
|
||||
// IE returns zIndex value as an integer.
|
||||
return ret === undefined ? |
||||
ret : |
||||
ret + "" || "auto"; |
||||
}; |
||||
} |
||||
|
||||
exports.getStyles = getStyles; |
||||
exports.curCSS = curCSS; |
||||
|
||||
}); |
||||
@ -1,69 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../manipulation" // appendTo
|
||||
], function( jQuery ) { |
||||
|
||||
var iframe, |
||||
elemdisplay = {}; |
||||
|
||||
/** |
||||
* Retrieve the actual display of a element |
||||
* @param {String} name nodeName of the element |
||||
* @param {Object} doc Document object |
||||
*/ |
||||
// Called only from within defaultDisplay
|
||||
function actualDisplay( name, doc ) { |
||||
var style, |
||||
elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), |
||||
|
||||
// getDefaultComputedStyle might be reliably used only on attached element
|
||||
display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? |
||||
|
||||
// Use of this method is a temporary fix (more like optmization) until something better comes along,
|
||||
// since it was removed from specification and supported only in FF
|
||||
style.display : jQuery.css( elem[ 0 ], "display" ); |
||||
|
||||
// We don't have any data stored on the element,
|
||||
// so use "detach" method as fast way to get rid of the element
|
||||
elem.detach(); |
||||
|
||||
return display; |
||||
} |
||||
|
||||
/** |
||||
* Try to determine the default display value of an element |
||||
* @param {String} nodeName |
||||
*/ |
||||
function defaultDisplay( nodeName ) { |
||||
var doc = document, |
||||
display = elemdisplay[ nodeName ]; |
||||
|
||||
if ( !display ) { |
||||
display = actualDisplay( nodeName, doc ); |
||||
|
||||
// If the simple way fails, read from inside an iframe
|
||||
if ( display === "none" || !display ) { |
||||
|
||||
// Use the already-created iframe if possible
|
||||
iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); |
||||
|
||||
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
|
||||
doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; |
||||
|
||||
// Support: IE
|
||||
doc.write(); |
||||
doc.close(); |
||||
|
||||
display = actualDisplay( nodeName, doc ); |
||||
iframe.detach(); |
||||
} |
||||
|
||||
// Store the correct default display
|
||||
elemdisplay[ nodeName ] = display; |
||||
} |
||||
|
||||
return display; |
||||
} |
||||
|
||||
return defaultDisplay; |
||||
}); |
||||
@ -1,20 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"./support", |
||||
"../selector", |
||||
"../css" |
||||
], function( jQuery, support ) { |
||||
|
||||
jQuery.expr.filters.hidden = function( elem ) { |
||||
// Support: Opera <= 12.12
|
||||
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
||||
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || |
||||
(!support.reliableHiddenOffsets() && |
||||
((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); |
||||
}; |
||||
|
||||
jQuery.expr.filters.visible = function( elem ) { |
||||
return !jQuery.expr.filters.hidden( elem ); |
||||
}; |
||||
|
||||
}); |
||||
@ -1,151 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/support" |
||||
], function( jQuery, support ) { |
||||
|
||||
(function() { |
||||
// Minified: var b,c,d,e,f,g, h,i
|
||||
var div, style, a, pixelPositionVal, boxSizingReliableVal, |
||||
reliableHiddenOffsetsVal, reliableMarginRightVal; |
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" ); |
||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; |
||||
a = div.getElementsByTagName( "a" )[ 0 ]; |
||||
style = a && a.style; |
||||
|
||||
// Finish early in limited (non-browser) environments
|
||||
if ( !style ) { |
||||
return; |
||||
} |
||||
|
||||
style.cssText = "float:left;opacity:.5"; |
||||
|
||||
// Support: IE<9
|
||||
// Make sure that element opacity exists (as opposed to filter)
|
||||
support.opacity = style.opacity === "0.5"; |
||||
|
||||
// Verify style float existence
|
||||
// (IE uses styleFloat instead of cssFloat)
|
||||
support.cssFloat = !!style.cssFloat; |
||||
|
||||
div.style.backgroundClip = "content-box"; |
||||
div.cloneNode( true ).style.backgroundClip = ""; |
||||
support.clearCloneStyle = div.style.backgroundClip === "content-box"; |
||||
|
||||
// Support: Firefox<29, Android 2.3
|
||||
// Vendor-prefix box-sizing
|
||||
support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || |
||||
style.WebkitBoxSizing === ""; |
||||
|
||||
jQuery.extend(support, { |
||||
reliableHiddenOffsets: function() { |
||||
if ( reliableHiddenOffsetsVal == null ) { |
||||
computeStyleTests(); |
||||
} |
||||
return reliableHiddenOffsetsVal; |
||||
}, |
||||
|
||||
boxSizingReliable: function() { |
||||
if ( boxSizingReliableVal == null ) { |
||||
computeStyleTests(); |
||||
} |
||||
return boxSizingReliableVal; |
||||
}, |
||||
|
||||
pixelPosition: function() { |
||||
if ( pixelPositionVal == null ) { |
||||
computeStyleTests(); |
||||
} |
||||
return pixelPositionVal; |
||||
}, |
||||
|
||||
// Support: Android 2.3
|
||||
reliableMarginRight: function() { |
||||
if ( reliableMarginRightVal == null ) { |
||||
computeStyleTests(); |
||||
} |
||||
return reliableMarginRightVal; |
||||
} |
||||
}); |
||||
|
||||
function computeStyleTests() { |
||||
// Minified: var b,c,d,j
|
||||
var div, body, container, contents; |
||||
|
||||
body = document.getElementsByTagName( "body" )[ 0 ]; |
||||
if ( !body || !body.style ) { |
||||
// Test fired too early or in an unsupported environment, exit.
|
||||
return; |
||||
} |
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" ); |
||||
container = document.createElement( "div" ); |
||||
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; |
||||
body.appendChild( container ).appendChild( div ); |
||||
|
||||
div.style.cssText = |
||||
// Support: Firefox<29, Android 2.3
|
||||
// Vendor-prefix box-sizing
|
||||
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + |
||||
"box-sizing:border-box;display:block;margin-top:1%;top:1%;" + |
||||
"border:1px;padding:1px;width:4px;position:absolute"; |
||||
|
||||
// Support: IE<9
|
||||
// Assume reasonable values in the absence of getComputedStyle
|
||||
pixelPositionVal = boxSizingReliableVal = false; |
||||
reliableMarginRightVal = true; |
||||
|
||||
// Check for getComputedStyle so that this code is not run in IE<9.
|
||||
if ( window.getComputedStyle ) { |
||||
pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; |
||||
boxSizingReliableVal = |
||||
( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; |
||||
|
||||
// Support: Android 2.3
|
||||
// Div with explicit width and no margin-right incorrectly
|
||||
// gets computed margin-right based on width of container (#3333)
|
||||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
||||
contents = div.appendChild( document.createElement( "div" ) ); |
||||
|
||||
// Reset CSS: box-sizing; display; margin; border; padding
|
||||
contents.style.cssText = div.style.cssText = |
||||
// Support: Firefox<29, Android 2.3
|
||||
// Vendor-prefix box-sizing
|
||||
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + |
||||
"box-sizing:content-box;display:block;margin:0;border:0;padding:0"; |
||||
contents.style.marginRight = contents.style.width = "0"; |
||||
div.style.width = "1px"; |
||||
|
||||
reliableMarginRightVal = |
||||
!parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); |
||||
|
||||
div.removeChild( contents ); |
||||
} |
||||
|
||||
// Support: IE8
|
||||
// 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).
|
||||
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; |
||||
contents = div.getElementsByTagName( "td" ); |
||||
contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; |
||||
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; |
||||
if ( reliableHiddenOffsetsVal ) { |
||||
contents[ 0 ].style.display = ""; |
||||
contents[ 1 ].style.display = "none"; |
||||
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; |
||||
} |
||||
|
||||
body.removeChild( container ); |
||||
} |
||||
|
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
@ -1,28 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
||||
jQuery.swap = function( elem, options, callback, args ) { |
||||
var ret, name, |
||||
old = {}; |
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) { |
||||
old[ name ] = elem.style[ name ]; |
||||
elem.style[ name ] = options[ name ]; |
||||
} |
||||
|
||||
ret = callback.apply( elem, args || [] ); |
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) { |
||||
elem.style[ name ] = old[ name ]; |
||||
} |
||||
|
||||
return ret; |
||||
}; |
||||
|
||||
return jQuery.swap; |
||||
|
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return [ "Top", "Right", "Bottom", "Left" ]; |
||||
}); |
||||
@ -1,13 +0,0 @@
|
||||
define([ |
||||
"../../core", |
||||
"../../selector" |
||||
// css is assumed
|
||||
], function( jQuery ) { |
||||
|
||||
return function( elem, el ) { |
||||
// isHidden might be called from jQuery#filter function;
|
||||
// in that case, element will be second argument
|
||||
elem = el || elem; |
||||
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); |
||||
}; |
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return (/^margin/); |
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"../../var/pnum" |
||||
], function( pnum ) { |
||||
return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); |
||||
}); |
||||
@ -1,335 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/deletedIds", |
||||
"./data/support", |
||||
"./data/accepts" |
||||
], function( jQuery, deletedIds, support ) { |
||||
|
||||
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, |
||||
rmultiDash = /([A-Z])/g; |
||||
|
||||
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; |
||||
} |
||||
|
||||
function internalData( elem, name, data, pvt /* Internal Use Only */ ) { |
||||
if ( !jQuery.acceptData( elem ) ) { |
||||
return; |
||||
} |
||||
|
||||
var ret, thisCache, |
||||
internalKey = jQuery.expando, |
||||
|
||||
// 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)) && data === undefined && typeof name === "string" ) { |
||||
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 ) { |
||||
id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; |
||||
} else { |
||||
id = internalKey; |
||||
} |
||||
} |
||||
|
||||
if ( !cache[ id ] ) { |
||||
// Avoid exposing jQuery metadata on plain JS objects when the object
|
||||
// is serialized using JSON.stringify
|
||||
cache[ id ] = isNode ? {} : { 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 ( typeof name === "string" ) { |
||||
|
||||
// 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; |
||||
} |
||||
|
||||
function internalRemoveData( elem, name, pvt ) { |
||||
if ( !jQuery.acceptData( elem ) ) { |
||||
return; |
||||
} |
||||
|
||||
var thisCache, i, |
||||
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(" "); |
||||
} |
||||
} |
||||
} else { |
||||
// If "name" is an array of keys...
|
||||
// When data is initially created, via ("key", "val") signature,
|
||||
// keys will be converted to camelCase.
|
||||
// Since there is no way to tell _how_ a key was added, remove
|
||||
// both plain key and camelCase key. #12786
|
||||
// This will only penalize the array argument path.
|
||||
name = name.concat( jQuery.map( name, jQuery.camelCase ) ); |
||||
} |
||||
|
||||
i = name.length; |
||||
while ( 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(thisCache) : !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)
|
||||
/* jshint eqeqeq: false */ |
||||
} else if ( support.deleteExpando || cache != cache.window ) { |
||||
/* jshint eqeqeq: true */ |
||||
delete cache[ id ]; |
||||
|
||||
// When all else fails, null
|
||||
} else { |
||||
cache[ id ] = null; |
||||
} |
||||
} |
||||
|
||||
jQuery.extend({ |
||||
cache: {}, |
||||
|
||||
// The following elements (space-suffixed to avoid Object.prototype collisions)
|
||||
// throw uncatchable exceptions if you attempt to set expando properties
|
||||
noData: { |
||||
"applet ": true, |
||||
"embed ": true, |
||||
// ...but Flash objects (which have this classid) *can* handle expandos
|
||||
"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
||||
}, |
||||
|
||||
hasData: function( elem ) { |
||||
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; |
||||
return !!elem && !isEmptyDataObject( elem ); |
||||
}, |
||||
|
||||
data: function( elem, name, data ) { |
||||
return internalData( elem, name, data ); |
||||
}, |
||||
|
||||
removeData: function( elem, name ) { |
||||
return internalRemoveData( elem, name ); |
||||
}, |
||||
|
||||
// For internal use only.
|
||||
_data: function( elem, name, data ) { |
||||
return internalData( elem, name, data, true ); |
||||
}, |
||||
|
||||
_removeData: function( elem, name ) { |
||||
return internalRemoveData( elem, name, true ); |
||||
} |
||||
}); |
||||
|
||||
jQuery.fn.extend({ |
||||
data: function( key, value ) { |
||||
var i, name, data, |
||||
elem = this[0], |
||||
attrs = elem && elem.attributes; |
||||
|
||||
// Special expections of .data basically thwart jQuery.access,
|
||||
// so implement the relevant behavior ourselves
|
||||
|
||||
// Gets all values
|
||||
if ( key === undefined ) { |
||||
if ( this.length ) { |
||||
data = jQuery.data( elem ); |
||||
|
||||
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { |
||||
i = attrs.length; |
||||
while ( i-- ) { |
||||
|
||||
// Support: IE11+
|
||||
// The attrs elements can be null (#14894)
|
||||
if ( attrs[ i ] ) { |
||||
name = attrs[ i ].name; |
||||
if ( name.indexOf( "data-" ) === 0 ) { |
||||
name = jQuery.camelCase( name.slice(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 ); |
||||
}); |
||||
} |
||||
|
||||
return arguments.length > 1 ? |
||||
|
||||
// Sets one value
|
||||
this.each(function() { |
||||
jQuery.data( this, key, value ); |
||||
}) : |
||||
|
||||
// Gets one value
|
||||
// Try to fetch any internally stored data first
|
||||
elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; |
||||
}, |
||||
|
||||
removeData: function( key ) { |
||||
return this.each(function() { |
||||
jQuery.removeData( this, key ); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,21 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
/** |
||||
* Determines whether an object can have data |
||||
*/ |
||||
jQuery.acceptData = function( elem ) { |
||||
var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], |
||||
nodeType = +elem.nodeType || 1; |
||||
|
||||
// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
|
||||
return nodeType !== 1 && nodeType !== 9 ? |
||||
false : |
||||
|
||||
// Nodes accept data unless otherwise specified; rejection can be conditional
|
||||
!noData || noData !== true && elem.getAttribute("classid") === noData; |
||||
}; |
||||
|
||||
return jQuery.acceptData; |
||||
}); |
||||
@ -1,25 +0,0 @@
|
||||
define([ |
||||
"../var/support" |
||||
], function( support ) { |
||||
|
||||
(function() { |
||||
var div = document.createElement( "div" ); |
||||
|
||||
// Execute the test only if not already executed in another module.
|
||||
if (support.deleteExpando == null) { |
||||
// Support: IE<9
|
||||
support.deleteExpando = true; |
||||
try { |
||||
delete div.test; |
||||
} catch( e ) { |
||||
support.deleteExpando = false; |
||||
} |
||||
} |
||||
|
||||
// Null elements to avoid leaks in IE.
|
||||
div = null; |
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
@ -1,150 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/slice", |
||||
"./callbacks" |
||||
], function( jQuery, slice ) { |
||||
|
||||
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 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; |
||||
// deferred[ done | fail | progress ] for forwarding actions to newDefer
|
||||
deferred[ tuple[1] ](function() { |
||||
var returned = fn && fn.apply( this, arguments ); |
||||
if ( returned && jQuery.isFunction( returned.promise ) ) { |
||||
returned.promise() |
||||
.done( newDefer.resolve ) |
||||
.fail( newDefer.reject ) |
||||
.progress( newDefer.notify ); |
||||
} else { |
||||
newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); |
||||
} |
||||
}); |
||||
}); |
||||
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 ]
|
||||
deferred[ tuple[0] ] = function() { |
||||
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); |
||||
return this; |
||||
}; |
||||
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 = 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 ? 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(); |
||||
} |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,13 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./traversing" |
||||
], function( jQuery ) { |
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() { |
||||
return this.length; |
||||
}; |
||||
|
||||
jQuery.fn.andSelf = jQuery.fn.addBack; |
||||
|
||||
}); |
||||
@ -1,50 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./core/access", |
||||
"./css" |
||||
], function( jQuery, access ) { |
||||
|
||||
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
|
||||
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { |
||||
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { |
||||
// margin is only for outerHeight, outerWidth
|
||||
jQuery.fn[ funcName ] = function( margin, value ) { |
||||
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), |
||||
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); |
||||
|
||||
return access( this, function( elem, type, value ) { |
||||
var doc; |
||||
|
||||
if ( jQuery.isWindow( elem ) ) { |
||||
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
|
||||
// isn't a whole lot we can do. See pull request at this URL for discussion:
|
||||
// https://github.com/jquery/jquery/pull/764
|
||||
return elem.document.documentElement[ "client" + name ]; |
||||
} |
||||
|
||||
// Get document width or height
|
||||
if ( elem.nodeType === 9 ) { |
||||
doc = elem.documentElement; |
||||
|
||||
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
|
||||
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
|
||||
return Math.max( |
||||
elem.body[ "scroll" + name ], doc[ "scroll" + name ], |
||||
elem.body[ "offset" + name ], doc[ "offset" + name ], |
||||
doc[ "client" + name ] |
||||
); |
||||
} |
||||
|
||||
return value === undefined ? |
||||
// Get width or height on the element, requesting but not forcing parseFloat
|
||||
jQuery.css( elem, type, extra ) : |
||||
|
||||
// Set width or height on the element
|
||||
jQuery.style( elem, type, value, extra ); |
||||
}, type, chainable ? margin : undefined, chainable, null ); |
||||
}; |
||||
}); |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,656 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/pnum", |
||||
"./css/var/cssExpand", |
||||
"./css/var/isHidden", |
||||
"./css/defaultDisplay", |
||||
"./effects/support", |
||||
|
||||
"./core/init", |
||||
"./effects/Tween", |
||||
"./queue", |
||||
"./css", |
||||
"./deferred", |
||||
"./traversing" |
||||
], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay, support ) { |
||||
|
||||
var |
||||
fxNow, timerId, |
||||
rfxtypes = /^(?:toggle|show|hide)$/, |
||||
rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), |
||||
rrun = /queueHooks$/, |
||||
animationPrefilters = [ defaultPrefilter ], |
||||
tweeners = { |
||||
"*": [ function( prop, value ) { |
||||
var tween = this.createTween( prop, value ), |
||||
target = tween.cur(), |
||||
parts = rfxnum.exec( value ), |
||||
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), |
||||
|
||||
// Starting value computation is required for potential unit mismatches
|
||||
start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && |
||||
rfxnum.exec( jQuery.css( tween.elem, prop ) ), |
||||
scale = 1, |
||||
maxIterations = 20; |
||||
|
||||
if ( start && start[ 3 ] !== unit ) { |
||||
// Trust units reported by jQuery.css
|
||||
unit = unit || start[ 3 ]; |
||||
|
||||
// Make sure we update the tween properties later on
|
||||
parts = parts || []; |
||||
|
||||
// Iteratively approximate from a nonzero starting point
|
||||
start = +target || 1; |
||||
|
||||
do { |
||||
// If previous iteration zeroed out, double until we get *something*
|
||||
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
|
||||
scale = scale || ".5"; |
||||
|
||||
// Adjust and apply
|
||||
start = start / scale; |
||||
jQuery.style( tween.elem, prop, start + unit ); |
||||
|
||||
// Update scale, tolerating zero or NaN from tween.cur()
|
||||
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
|
||||
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); |
||||
} |
||||
|
||||
// Update tween properties
|
||||
if ( parts ) { |
||||
start = tween.start = +start || +target || 0; |
||||
tween.unit = unit; |
||||
// If a +=/-= token was provided, we're doing a relative animation
|
||||
tween.end = parts[ 1 ] ? |
||||
start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : |
||||
+parts[ 2 ]; |
||||
} |
||||
|
||||
return tween; |
||||
} ] |
||||
}; |
||||
|
||||
// Animations created synchronously will run synchronously
|
||||
function createFxNow() { |
||||
setTimeout(function() { |
||||
fxNow = undefined; |
||||
}); |
||||
return ( fxNow = jQuery.now() ); |
||||
} |
||||
|
||||
// Generate parameters to create a standard animation
|
||||
function genFx( type, includeWidth ) { |
||||
var which, |
||||
attrs = { height: type }, |
||||
i = 0; |
||||
|
||||
// if we include width, step value is 1 to do all cssExpand values,
|
||||
// if we don't include width, step value is 2 to skip over Left and Right
|
||||
includeWidth = includeWidth ? 1 : 0; |
||||
for ( ; i < 4 ; i += 2 - includeWidth ) { |
||||
which = cssExpand[ i ]; |
||||
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; |
||||
} |
||||
|
||||
if ( includeWidth ) { |
||||
attrs.opacity = attrs.width = type; |
||||
} |
||||
|
||||
return attrs; |
||||
} |
||||
|
||||
function createTween( value, prop, animation ) { |
||||
var tween, |
||||
collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), |
||||
index = 0, |
||||
length = collection.length; |
||||
for ( ; index < length; index++ ) { |
||||
if ( (tween = collection[ index ].call( animation, prop, value )) ) { |
||||
|
||||
// we're done with this property
|
||||
return tween; |
||||
} |
||||
} |
||||
} |
||||
|
||||
function defaultPrefilter( elem, props, opts ) { |
||||
/* jshint validthis: true */ |
||||
var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, |
||||
anim = this, |
||||
orig = {}, |
||||
style = elem.style, |
||||
hidden = elem.nodeType && isHidden( elem ), |
||||
dataShow = jQuery._data( elem, "fxshow" ); |
||||
|
||||
// handle queue: false promises
|
||||
if ( !opts.queue ) { |
||||
hooks = jQuery._queueHooks( elem, "fx" ); |
||||
if ( hooks.unqueued == null ) { |
||||
hooks.unqueued = 0; |
||||
oldfire = hooks.empty.fire; |
||||
hooks.empty.fire = function() { |
||||
if ( !hooks.unqueued ) { |
||||
oldfire(); |
||||
} |
||||
}; |
||||
} |
||||
hooks.unqueued++; |
||||
|
||||
anim.always(function() { |
||||
// doing this makes sure that the complete handler will be called
|
||||
// before this completes
|
||||
anim.always(function() { |
||||
hooks.unqueued--; |
||||
if ( !jQuery.queue( elem, "fx" ).length ) { |
||||
hooks.empty.fire(); |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
// height/width overflow pass
|
||||
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { |
||||
// Make sure that nothing sneaks out
|
||||
// Record all 3 overflow attributes because IE does not
|
||||
// change the overflow attribute when overflowX and
|
||||
// overflowY are set to the same value
|
||||
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; |
||||
|
||||
// Set display property to inline-block for height/width
|
||||
// animations on inline elements that are having width/height animated
|
||||
display = jQuery.css( elem, "display" ); |
||||
|
||||
// Test default display if display is currently "none"
|
||||
checkDisplay = display === "none" ? |
||||
jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; |
||||
|
||||
if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { |
||||
|
||||
// inline-level elements accept inline-block;
|
||||
// block-level elements need to be inline with layout
|
||||
if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { |
||||
style.display = "inline-block"; |
||||
} else { |
||||
style.zoom = 1; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if ( opts.overflow ) { |
||||
style.overflow = "hidden"; |
||||
if ( !support.shrinkWrapBlocks() ) { |
||||
anim.always(function() { |
||||
style.overflow = opts.overflow[ 0 ]; |
||||
style.overflowX = opts.overflow[ 1 ]; |
||||
style.overflowY = opts.overflow[ 2 ]; |
||||
}); |
||||
} |
||||
} |
||||
|
||||
// show/hide pass
|
||||
for ( prop in props ) { |
||||
value = props[ prop ]; |
||||
if ( rfxtypes.exec( value ) ) { |
||||
delete props[ prop ]; |
||||
toggle = toggle || value === "toggle"; |
||||
if ( value === ( hidden ? "hide" : "show" ) ) { |
||||
|
||||
// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
|
||||
if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { |
||||
hidden = true; |
||||
} else { |
||||
continue; |
||||
} |
||||
} |
||||
orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); |
||||
|
||||
// Any non-fx value stops us from restoring the original display value
|
||||
} else { |
||||
display = undefined; |
||||
} |
||||
} |
||||
|
||||
if ( !jQuery.isEmptyObject( orig ) ) { |
||||
if ( dataShow ) { |
||||
if ( "hidden" in dataShow ) { |
||||
hidden = dataShow.hidden; |
||||
} |
||||
} else { |
||||
dataShow = jQuery._data( elem, "fxshow", {} ); |
||||
} |
||||
|
||||
// store state if its toggle - enables .stop().toggle() to "reverse"
|
||||
if ( toggle ) { |
||||
dataShow.hidden = !hidden; |
||||
} |
||||
if ( hidden ) { |
||||
jQuery( elem ).show(); |
||||
} else { |
||||
anim.done(function() { |
||||
jQuery( elem ).hide(); |
||||
}); |
||||
} |
||||
anim.done(function() { |
||||
var prop; |
||||
jQuery._removeData( elem, "fxshow" ); |
||||
for ( prop in orig ) { |
||||
jQuery.style( elem, prop, orig[ prop ] ); |
||||
} |
||||
}); |
||||
for ( prop in orig ) { |
||||
tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); |
||||
|
||||
if ( !( prop in dataShow ) ) { |
||||
dataShow[ prop ] = tween.start; |
||||
if ( hidden ) { |
||||
tween.end = tween.start; |
||||
tween.start = prop === "width" || prop === "height" ? 1 : 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// If this is a noop like .hide().hide(), restore an overwritten display value
|
||||
} else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { |
||||
style.display = display; |
||||
} |
||||
} |
||||
|
||||
function propFilter( props, specialEasing ) { |
||||
var index, name, easing, value, hooks; |
||||
|
||||
// camelCase, specialEasing and expand cssHook pass
|
||||
for ( index in props ) { |
||||
name = jQuery.camelCase( index ); |
||||
easing = specialEasing[ name ]; |
||||
value = props[ index ]; |
||||
if ( jQuery.isArray( value ) ) { |
||||
easing = value[ 1 ]; |
||||
value = props[ index ] = value[ 0 ]; |
||||
} |
||||
|
||||
if ( index !== name ) { |
||||
props[ name ] = value; |
||||
delete props[ index ]; |
||||
} |
||||
|
||||
hooks = jQuery.cssHooks[ name ]; |
||||
if ( hooks && "expand" in hooks ) { |
||||
value = hooks.expand( value ); |
||||
delete props[ name ]; |
||||
|
||||
// not quite $.extend, this wont overwrite keys already present.
|
||||
// also - reusing 'index' from above because we have the correct "name"
|
||||
for ( index in value ) { |
||||
if ( !( index in props ) ) { |
||||
props[ index ] = value[ index ]; |
||||
specialEasing[ index ] = easing; |
||||
} |
||||
} |
||||
} else { |
||||
specialEasing[ name ] = easing; |
||||
} |
||||
} |
||||
} |
||||
|
||||
function Animation( elem, properties, options ) { |
||||
var result, |
||||
stopped, |
||||
index = 0, |
||||
length = animationPrefilters.length, |
||||
deferred = jQuery.Deferred().always( function() { |
||||
// don't match elem in the :animated selector
|
||||
delete tick.elem; |
||||
}), |
||||
tick = function() { |
||||
if ( stopped ) { |
||||
return false; |
||||
} |
||||
var currentTime = fxNow || createFxNow(), |
||||
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), |
||||
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
|
||||
temp = remaining / animation.duration || 0, |
||||
percent = 1 - temp, |
||||
index = 0, |
||||
length = animation.tweens.length; |
||||
|
||||
for ( ; index < length ; index++ ) { |
||||
animation.tweens[ index ].run( percent ); |
||||
} |
||||
|
||||
deferred.notifyWith( elem, [ animation, percent, remaining ]); |
||||
|
||||
if ( percent < 1 && length ) { |
||||
return remaining; |
||||
} else { |
||||
deferred.resolveWith( elem, [ animation ] ); |
||||
return false; |
||||
} |
||||
}, |
||||
animation = deferred.promise({ |
||||
elem: elem, |
||||
props: jQuery.extend( {}, properties ), |
||||
opts: jQuery.extend( true, { specialEasing: {} }, options ), |
||||
originalProperties: properties, |
||||
originalOptions: options, |
||||
startTime: fxNow || createFxNow(), |
||||
duration: options.duration, |
||||
tweens: [], |
||||
createTween: function( prop, end ) { |
||||
var tween = jQuery.Tween( elem, animation.opts, prop, end, |
||||
animation.opts.specialEasing[ prop ] || animation.opts.easing ); |
||||
animation.tweens.push( tween ); |
||||
return tween; |
||||
}, |
||||
stop: function( gotoEnd ) { |
||||
var index = 0, |
||||
// if we are going to the end, we want to run all the tweens
|
||||
// otherwise we skip this part
|
||||
length = gotoEnd ? animation.tweens.length : 0; |
||||
if ( stopped ) { |
||||
return this; |
||||
} |
||||
stopped = true; |
||||
for ( ; index < length ; index++ ) { |
||||
animation.tweens[ index ].run( 1 ); |
||||
} |
||||
|
||||
// resolve when we played the last frame
|
||||
// otherwise, reject
|
||||
if ( gotoEnd ) { |
||||
deferred.resolveWith( elem, [ animation, gotoEnd ] ); |
||||
} else { |
||||
deferred.rejectWith( elem, [ animation, gotoEnd ] ); |
||||
} |
||||
return this; |
||||
} |
||||
}), |
||||
props = animation.props; |
||||
|
||||
propFilter( props, animation.opts.specialEasing ); |
||||
|
||||
for ( ; index < length ; index++ ) { |
||||
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); |
||||
if ( result ) { |
||||
return result; |
||||
} |
||||
} |
||||
|
||||
jQuery.map( props, createTween, animation ); |
||||
|
||||
if ( jQuery.isFunction( animation.opts.start ) ) { |
||||
animation.opts.start.call( elem, animation ); |
||||
} |
||||
|
||||
jQuery.fx.timer( |
||||
jQuery.extend( tick, { |
||||
elem: elem, |
||||
anim: animation, |
||||
queue: animation.opts.queue |
||||
}) |
||||
); |
||||
|
||||
// attach callbacks from options
|
||||
return animation.progress( animation.opts.progress ) |
||||
.done( animation.opts.done, animation.opts.complete ) |
||||
.fail( animation.opts.fail ) |
||||
.always( animation.opts.always ); |
||||
} |
||||
|
||||
jQuery.Animation = jQuery.extend( Animation, { |
||||
tweener: function( props, callback ) { |
||||
if ( jQuery.isFunction( props ) ) { |
||||
callback = props; |
||||
props = [ "*" ]; |
||||
} else { |
||||
props = props.split(" "); |
||||
} |
||||
|
||||
var prop, |
||||
index = 0, |
||||
length = props.length; |
||||
|
||||
for ( ; index < length ; index++ ) { |
||||
prop = props[ index ]; |
||||
tweeners[ prop ] = tweeners[ prop ] || []; |
||||
tweeners[ prop ].unshift( callback ); |
||||
} |
||||
}, |
||||
|
||||
prefilter: function( callback, prepend ) { |
||||
if ( prepend ) { |
||||
animationPrefilters.unshift( callback ); |
||||
} else { |
||||
animationPrefilters.push( callback ); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
jQuery.speed = function( speed, easing, fn ) { |
||||
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { |
||||
complete: fn || !fn && easing || |
||||
jQuery.isFunction( speed ) && speed, |
||||
duration: speed, |
||||
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing |
||||
}; |
||||
|
||||
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
||||
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; |
||||
|
||||
// normalize opt.queue - true/undefined/null -> "fx"
|
||||
if ( opt.queue == null || opt.queue === true ) { |
||||
opt.queue = "fx"; |
||||
} |
||||
|
||||
// Queueing
|
||||
opt.old = opt.complete; |
||||
|
||||
opt.complete = function() { |
||||
if ( jQuery.isFunction( opt.old ) ) { |
||||
opt.old.call( this ); |
||||
} |
||||
|
||||
if ( opt.queue ) { |
||||
jQuery.dequeue( this, opt.queue ); |
||||
} |
||||
}; |
||||
|
||||
return opt; |
||||
}; |
||||
|
||||
jQuery.fn.extend({ |
||||
fadeTo: function( speed, to, easing, callback ) { |
||||
|
||||
// show any hidden elements after setting opacity to 0
|
||||
return this.filter( isHidden ).css( "opacity", 0 ).show() |
||||
|
||||
// animate to the value specified
|
||||
.end().animate({ opacity: to }, speed, easing, callback ); |
||||
}, |
||||
animate: function( prop, speed, easing, callback ) { |
||||
var empty = jQuery.isEmptyObject( prop ), |
||||
optall = jQuery.speed( speed, easing, callback ), |
||||
doAnimation = function() { |
||||
// Operate on a copy of prop so per-property easing won't be lost
|
||||
var anim = Animation( this, jQuery.extend( {}, prop ), optall ); |
||||
|
||||
// Empty animations, or finishing resolves immediately
|
||||
if ( empty || jQuery._data( this, "finish" ) ) { |
||||
anim.stop( true ); |
||||
} |
||||
}; |
||||
doAnimation.finish = doAnimation; |
||||
|
||||
return empty || optall.queue === false ? |
||||
this.each( doAnimation ) : |
||||
this.queue( optall.queue, doAnimation ); |
||||
}, |
||||
stop: function( type, clearQueue, gotoEnd ) { |
||||
var stopQueue = function( hooks ) { |
||||
var stop = hooks.stop; |
||||
delete hooks.stop; |
||||
stop( gotoEnd ); |
||||
}; |
||||
|
||||
if ( typeof type !== "string" ) { |
||||
gotoEnd = clearQueue; |
||||
clearQueue = type; |
||||
type = undefined; |
||||
} |
||||
if ( clearQueue && type !== false ) { |
||||
this.queue( type || "fx", [] ); |
||||
} |
||||
|
||||
return this.each(function() { |
||||
var dequeue = true, |
||||
index = type != null && type + "queueHooks", |
||||
timers = jQuery.timers, |
||||
data = jQuery._data( this ); |
||||
|
||||
if ( index ) { |
||||
if ( data[ index ] && data[ index ].stop ) { |
||||
stopQueue( data[ index ] ); |
||||
} |
||||
} else { |
||||
for ( index in data ) { |
||||
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { |
||||
stopQueue( data[ index ] ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
for ( index = timers.length; index--; ) { |
||||
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { |
||||
timers[ index ].anim.stop( gotoEnd ); |
||||
dequeue = false; |
||||
timers.splice( index, 1 ); |
||||
} |
||||
} |
||||
|
||||
// start the next in the queue if the last step wasn't forced
|
||||
// timers currently will call their complete callbacks, which will dequeue
|
||||
// but only if they were gotoEnd
|
||||
if ( dequeue || !gotoEnd ) { |
||||
jQuery.dequeue( this, type ); |
||||
} |
||||
}); |
||||
}, |
||||
finish: function( type ) { |
||||
if ( type !== false ) { |
||||
type = type || "fx"; |
||||
} |
||||
return this.each(function() { |
||||
var index, |
||||
data = jQuery._data( this ), |
||||
queue = data[ type + "queue" ], |
||||
hooks = data[ type + "queueHooks" ], |
||||
timers = jQuery.timers, |
||||
length = queue ? queue.length : 0; |
||||
|
||||
// enable finishing flag on private data
|
||||
data.finish = true; |
||||
|
||||
// empty the queue first
|
||||
jQuery.queue( this, type, [] ); |
||||
|
||||
if ( hooks && hooks.stop ) { |
||||
hooks.stop.call( this, true ); |
||||
} |
||||
|
||||
// look for any active animations, and finish them
|
||||
for ( index = timers.length; index--; ) { |
||||
if ( timers[ index ].elem === this && timers[ index ].queue === type ) { |
||||
timers[ index ].anim.stop( true ); |
||||
timers.splice( index, 1 ); |
||||
} |
||||
} |
||||
|
||||
// look for any animations in the old queue and finish them
|
||||
for ( index = 0; index < length; index++ ) { |
||||
if ( queue[ index ] && queue[ index ].finish ) { |
||||
queue[ index ].finish.call( this ); |
||||
} |
||||
} |
||||
|
||||
// turn off finishing flag
|
||||
delete data.finish; |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { |
||||
var cssFn = jQuery.fn[ name ]; |
||||
jQuery.fn[ name ] = function( speed, easing, callback ) { |
||||
return speed == null || typeof speed === "boolean" ? |
||||
cssFn.apply( this, arguments ) : |
||||
this.animate( genFx( name, true ), speed, easing, callback ); |
||||
}; |
||||
}); |
||||
|
||||
// Generate shortcuts for custom animations
|
||||
jQuery.each({ |
||||
slideDown: genFx("show"), |
||||
slideUp: genFx("hide"), |
||||
slideToggle: genFx("toggle"), |
||||
fadeIn: { opacity: "show" }, |
||||
fadeOut: { opacity: "hide" }, |
||||
fadeToggle: { opacity: "toggle" } |
||||
}, function( name, props ) { |
||||
jQuery.fn[ name ] = function( speed, easing, callback ) { |
||||
return this.animate( props, speed, easing, callback ); |
||||
}; |
||||
}); |
||||
|
||||
jQuery.timers = []; |
||||
jQuery.fx.tick = function() { |
||||
var timer, |
||||
timers = jQuery.timers, |
||||
i = 0; |
||||
|
||||
fxNow = jQuery.now(); |
||||
|
||||
for ( ; i < timers.length; i++ ) { |
||||
timer = timers[ i ]; |
||||
// Checks the timer has not already been removed
|
||||
if ( !timer() && timers[ i ] === timer ) { |
||||
timers.splice( i--, 1 ); |
||||
} |
||||
} |
||||
|
||||
if ( !timers.length ) { |
||||
jQuery.fx.stop(); |
||||
} |
||||
fxNow = undefined; |
||||
}; |
||||
|
||||
jQuery.fx.timer = function( timer ) { |
||||
jQuery.timers.push( timer ); |
||||
if ( timer() ) { |
||||
jQuery.fx.start(); |
||||
} else { |
||||
jQuery.timers.pop(); |
||||
} |
||||
}; |
||||
|
||||
jQuery.fx.interval = 13; |
||||
|
||||
jQuery.fx.start = function() { |
||||
if ( !timerId ) { |
||||
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); |
||||
} |
||||
}; |
||||
|
||||
jQuery.fx.stop = function() { |
||||
clearInterval( timerId ); |
||||
timerId = null; |
||||
}; |
||||
|
||||
jQuery.fx.speeds = { |
||||
slow: 600, |
||||
fast: 200, |
||||
// Default speed
|
||||
_default: 400 |
||||
}; |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,114 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../css" |
||||
], function( jQuery ) { |
||||
|
||||
function Tween( elem, options, prop, end, easing ) { |
||||
return new Tween.prototype.init( elem, options, prop, end, easing ); |
||||
} |
||||
jQuery.Tween = Tween; |
||||
|
||||
Tween.prototype = { |
||||
constructor: Tween, |
||||
init: function( elem, options, prop, end, easing, unit ) { |
||||
this.elem = elem; |
||||
this.prop = prop; |
||||
this.easing = easing || "swing"; |
||||
this.options = options; |
||||
this.start = this.now = this.cur(); |
||||
this.end = end; |
||||
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); |
||||
}, |
||||
cur: function() { |
||||
var hooks = Tween.propHooks[ this.prop ]; |
||||
|
||||
return hooks && hooks.get ? |
||||
hooks.get( this ) : |
||||
Tween.propHooks._default.get( this ); |
||||
}, |
||||
run: function( percent ) { |
||||
var eased, |
||||
hooks = Tween.propHooks[ this.prop ]; |
||||
|
||||
if ( this.options.duration ) { |
||||
this.pos = eased = jQuery.easing[ this.easing ]( |
||||
percent, this.options.duration * percent, 0, 1, this.options.duration |
||||
); |
||||
} else { |
||||
this.pos = eased = percent; |
||||
} |
||||
this.now = ( this.end - this.start ) * eased + this.start; |
||||
|
||||
if ( this.options.step ) { |
||||
this.options.step.call( this.elem, this.now, this ); |
||||
} |
||||
|
||||
if ( hooks && hooks.set ) { |
||||
hooks.set( this ); |
||||
} else { |
||||
Tween.propHooks._default.set( this ); |
||||
} |
||||
return this; |
||||
} |
||||
}; |
||||
|
||||
Tween.prototype.init.prototype = Tween.prototype; |
||||
|
||||
Tween.propHooks = { |
||||
_default: { |
||||
get: function( tween ) { |
||||
var result; |
||||
|
||||
if ( tween.elem[ tween.prop ] != null && |
||||
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { |
||||
return tween.elem[ tween.prop ]; |
||||
} |
||||
|
||||
// passing an empty string as a 3rd parameter to .css will automatically
|
||||
// attempt a parseFloat and fallback to a string if the parse fails
|
||||
// so, simple values such as "10px" are parsed to Float.
|
||||
// complex values such as "rotate(1rad)" are returned as is.
|
||||
result = jQuery.css( tween.elem, tween.prop, "" ); |
||||
// Empty strings, null, undefined and "auto" are converted to 0.
|
||||
return !result || result === "auto" ? 0 : result; |
||||
}, |
||||
set: function( tween ) { |
||||
// use step hook for back compat - use cssHook if its there - use .style if its
|
||||
// available and use plain properties where available
|
||||
if ( jQuery.fx.step[ tween.prop ] ) { |
||||
jQuery.fx.step[ tween.prop ]( tween ); |
||||
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { |
||||
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); |
||||
} else { |
||||
tween.elem[ tween.prop ] = tween.now; |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
|
||||
// Support: IE <=9
|
||||
// Panic based approach to setting things on disconnected nodes
|
||||
|
||||
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { |
||||
set: function( tween ) { |
||||
if ( tween.elem.nodeType && tween.elem.parentNode ) { |
||||
tween.elem[ tween.prop ] = tween.now; |
||||
} |
||||
} |
||||
}; |
||||
|
||||
jQuery.easing = { |
||||
linear: function( p ) { |
||||
return p; |
||||
}, |
||||
swing: function( p ) { |
||||
return 0.5 - Math.cos( p * Math.PI ) / 2; |
||||
} |
||||
}; |
||||
|
||||
jQuery.fx = Tween.prototype.init; |
||||
|
||||
// Back Compat <1.8 extension point
|
||||
jQuery.fx.step = {}; |
||||
|
||||
}); |
||||
@ -1,13 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../selector", |
||||
"../effects" |
||||
], function( jQuery ) { |
||||
|
||||
jQuery.expr.filters.animated = function( elem ) { |
||||
return jQuery.grep(jQuery.timers, function( fn ) { |
||||
return elem === fn.elem; |
||||
}).length; |
||||
}; |
||||
|
||||
}); |
||||
@ -1,55 +0,0 @@
|
||||
define([ |
||||
"../var/strundefined", |
||||
"../var/support" |
||||
], function( strundefined, support ) { |
||||
|
||||
(function() { |
||||
var shrinkWrapBlocksVal; |
||||
|
||||
support.shrinkWrapBlocks = function() { |
||||
if ( shrinkWrapBlocksVal != null ) { |
||||
return shrinkWrapBlocksVal; |
||||
} |
||||
|
||||
// Will be changed later if needed.
|
||||
shrinkWrapBlocksVal = false; |
||||
|
||||
// Minified: var b,c,d
|
||||
var div, body, container; |
||||
|
||||
body = document.getElementsByTagName( "body" )[ 0 ]; |
||||
if ( !body || !body.style ) { |
||||
// Test fired too early or in an unsupported environment, exit.
|
||||
return; |
||||
} |
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" ); |
||||
container = document.createElement( "div" ); |
||||
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; |
||||
body.appendChild( container ).appendChild( div ); |
||||
|
||||
// Support: IE6
|
||||
// Check if elements with layout shrink-wrap their children
|
||||
if ( typeof div.style.zoom !== strundefined ) { |
||||
// Reset CSS: box-sizing; display; margin; border
|
||||
div.style.cssText = |
||||
// Support: Firefox<29, Android 2.3
|
||||
// Vendor-prefix box-sizing
|
||||
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + |
||||
"box-sizing:content-box;display:block;margin:0;border:0;" + |
||||
"padding:1px;width:1px;zoom:1"; |
||||
div.appendChild( document.createElement( "div" ) ).style.width = "5px"; |
||||
shrinkWrapBlocksVal = div.offsetWidth !== 3; |
||||
} |
||||
|
||||
body.removeChild( container ); |
||||
|
||||
return shrinkWrapBlocksVal; |
||||
}; |
||||
|
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../event" |
||||
], function( jQuery ) { |
||||
|
||||
// Attach a bunch of functions for handling common AJAX events
|
||||
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { |
||||
jQuery.fn[ type ] = function( fn ) { |
||||
return this.on( type, fn ); |
||||
}; |
||||
}); |
||||
|
||||
}); |
||||
@ -1,39 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../event" |
||||
], function( jQuery ) { |
||||
|
||||
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 ) { |
||||
return arguments.length > 0 ? |
||||
this.on( name, null, data, fn ) : |
||||
this.trigger( name ); |
||||
}; |
||||
}); |
||||
|
||||
jQuery.fn.extend({ |
||||
hover: function( fnOver, fnOut ) { |
||||
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
||||
}, |
||||
|
||||
bind: function( types, data, fn ) { |
||||
return this.on( types, null, data, fn ); |
||||
}, |
||||
unbind: function( types, fn ) { |
||||
return this.off( types, null, fn ); |
||||
}, |
||||
|
||||
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 ); |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,26 +0,0 @@
|
||||
define([ |
||||
"../var/support" |
||||
], function( support ) { |
||||
|
||||
(function() { |
||||
var i, eventName, |
||||
div = document.createElement( "div" ); |
||||
|
||||
// Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
|
||||
for ( i in { submit: true, change: true, focusin: true }) { |
||||
eventName = "on" + i; |
||||
|
||||
if ( !(support[ i + "Bubbles" ] = eventName in window) ) { |
||||
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
|
||||
div.setAttribute( eventName, "t" ); |
||||
support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; |
||||
} |
||||
} |
||||
|
||||
// Null elements to avoid leaks in IE.
|
||||
div = null; |
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
@ -1,24 +0,0 @@
|
||||
define([ |
||||
"../core" |
||||
], function( jQuery ) { |
||||
|
||||
// Register as a named AMD module, since jQuery can be concatenated with other
|
||||
// files that may use define, but not via a proper concatenation script that
|
||||
// understands anonymous AMD modules. A named AMD is safest and most robust
|
||||
// way to register. Lowercase jquery is used because AMD module names are
|
||||
// derived from file names, and jQuery is normally delivered in a lowercase
|
||||
// file name. Do this after creating the global so that if an AMD module wants
|
||||
// to call noConflict to hide this version of jQuery, it will work.
|
||||
|
||||
// Note that for maximum portability, libraries that are not jQuery should
|
||||
// declare themselves as anonymous modules, and avoid setting a global if an
|
||||
// AMD loader is present. jQuery is a special case. For more information, see
|
||||
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
|
||||
|
||||
if ( typeof define === "function" && define.amd ) { |
||||
define( "jquery", [], function() { |
||||
return jQuery; |
||||
}); |
||||
} |
||||
|
||||
}); |
||||
@ -1,32 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/strundefined" |
||||
], function( jQuery, strundefined ) { |
||||
|
||||
var |
||||
// Map over jQuery in case of overwrite
|
||||
_jQuery = window.jQuery, |
||||
|
||||
// Map over the $ in case of overwrite
|
||||
_$ = window.$; |
||||
|
||||
jQuery.noConflict = function( deep ) { |
||||
if ( window.$ === jQuery ) { |
||||
window.$ = _$; |
||||
} |
||||
|
||||
if ( deep && window.jQuery === jQuery ) { |
||||
window.jQuery = _jQuery; |
||||
} |
||||
|
||||
return jQuery; |
||||
}; |
||||
|
||||
// Expose jQuery and $ identifiers, even in
|
||||
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
||||
// and CommonJS for browser emulators (#13566)
|
||||
if ( typeof noGlobal === strundefined ) { |
||||
window.jQuery = window.$ = jQuery; |
||||
} |
||||
|
||||
}); |
||||
@ -1,44 +0,0 @@
|
||||
/*! |
||||
* jQuery JavaScript Library v@VERSION |
||||
* http://jquery.com/
|
||||
* |
||||
* Includes Sizzle.js |
||||
* http://sizzlejs.com/
|
||||
* |
||||
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors |
||||
* Released under the MIT license |
||||
* http://jquery.org/license
|
||||
* |
||||
* Date: @DATE |
||||
*/ |
||||
|
||||
(function( global, factory ) { |
||||
|
||||
if ( typeof module === "object" && typeof module.exports === "object" ) { |
||||
// For CommonJS and CommonJS-like environments where a proper window is present,
|
||||
// execute the factory and get jQuery
|
||||
// For environments that do not inherently posses a window with a document
|
||||
// (such as Node.js), expose a jQuery-making factory as module.exports
|
||||
// This accentuates the need for the creation of a real window
|
||||
// e.g. var jQuery = require("jquery")(window);
|
||||
// See ticket #14549 for more info
|
||||
module.exports = global.document ? |
||||
factory( global, true ) : |
||||
function( w ) { |
||||
if ( !w.document ) { |
||||
throw new Error( "jQuery requires a window with a document" ); |
||||
} |
||||
return factory( w ); |
||||
}; |
||||
} else { |
||||
factory( global ); |
||||
} |
||||
|
||||
// Pass this if window is not defined yet
|
||||
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { |
||||
|
||||
// Can't do this because several apps including ASP.NET trace
|
||||
// the stack via arguments.caller.callee and Firefox dies if
|
||||
// you try to trace through "use strict" call chains. (#13335)
|
||||
// Support: Firefox 18+
|
||||
//"use strict";
|
||||
@ -1,38 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./selector", |
||||
"./traversing", |
||||
"./callbacks", |
||||
"./deferred", |
||||
"./core/ready", |
||||
"./support", |
||||
"./data", |
||||
"./queue", |
||||
"./queue/delay", |
||||
"./attributes", |
||||
"./event", |
||||
"./event/alias", |
||||
"./manipulation", |
||||
"./manipulation/_evalUrl", |
||||
"./wrap", |
||||
"./css", |
||||
"./css/hiddenVisibleSelectors", |
||||
"./serialize", |
||||
"./ajax", |
||||
"./ajax/xhr", |
||||
"./ajax/script", |
||||
"./ajax/jsonp", |
||||
"./ajax/load", |
||||
"./event/ajax", |
||||
"./effects", |
||||
"./effects/animatedSelector", |
||||
"./offset", |
||||
"./dimensions", |
||||
"./deprecated", |
||||
"./exports/amd", |
||||
"./exports/global" |
||||
], function( jQuery ) { |
||||
|
||||
return jQuery; |
||||
|
||||
}); |
||||
@ -1,744 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/strundefined", |
||||
"./var/concat", |
||||
"./var/push", |
||||
"./var/deletedIds", |
||||
"./core/access", |
||||
"./manipulation/var/rcheckableType", |
||||
"./manipulation/support", |
||||
|
||||
"./core/init", |
||||
"./data/accepts", |
||||
"./traversing", |
||||
"./selector", |
||||
"./event" |
||||
], function( jQuery, strundefined, concat, push, deletedIds, access, rcheckableType, support ) { |
||||
|
||||
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, |
||||
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), |
||||
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, |
||||
// checked="checked" or checked
|
||||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, |
||||
rscriptType = /^$|\/(?:java|ecma)script/i, |
||||
rscriptTypeMasked = /^true\/(.*)/, |
||||
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, |
||||
|
||||
// We have to close these tags to support XHTML (#13200)
|
||||
wrapMap = { |
||||
option: [ 1, "<select multiple='multiple'>", "</select>" ], |
||||
legend: [ 1, "<fieldset>", "</fieldset>" ], |
||||
area: [ 1, "<map>", "</map>" ], |
||||
param: [ 1, "<object>", "</object>" ], |
||||
thead: [ 1, "<table>", "</table>" ], |
||||
tr: [ 2, "<table><tbody>", "</tbody></table>" ], |
||||
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], |
||||
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], |
||||
|
||||
// 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.
|
||||
_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] |
||||
}, |
||||
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; |
||||
|
||||
function getAll( context, tag ) { |
||||
var elems, elem, |
||||
i = 0, |
||||
found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : |
||||
typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : |
||||
undefined; |
||||
|
||||
if ( !found ) { |
||||
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { |
||||
if ( !tag || jQuery.nodeName( elem, tag ) ) { |
||||
found.push( elem ); |
||||
} else { |
||||
jQuery.merge( found, getAll( elem, tag ) ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return tag === undefined || tag && jQuery.nodeName( context, tag ) ? |
||||
jQuery.merge( [ context ], found ) : |
||||
found; |
||||
} |
||||
|
||||
// Used in buildFragment, fixes the defaultChecked property
|
||||
function fixDefaultChecked( elem ) { |
||||
if ( rcheckableType.test( elem.type ) ) { |
||||
elem.defaultChecked = elem.checked; |
||||
} |
||||
} |
||||
|
||||
// Support: IE<8
|
||||
// Manipulating tables requires a tbody
|
||||
function manipulationTarget( elem, content ) { |
||||
return jQuery.nodeName( elem, "table" ) && |
||||
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? |
||||
|
||||
elem.getElementsByTagName("tbody")[0] || |
||||
elem.appendChild( elem.ownerDocument.createElement("tbody") ) : |
||||
elem; |
||||
} |
||||
|
||||
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
||||
function disableScript( elem ) { |
||||
elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; |
||||
return elem; |
||||
} |
||||
function restoreScript( elem ) { |
||||
var match = rscriptTypeMasked.exec( elem.type ); |
||||
if ( match ) { |
||||
elem.type = match[1]; |
||||
} else { |
||||
elem.removeAttribute("type"); |
||||
} |
||||
return elem; |
||||
} |
||||
|
||||
// Mark scripts as having already been evaluated
|
||||
function setGlobalEval( elems, refElements ) { |
||||
var elem, |
||||
i = 0; |
||||
for ( ; (elem = elems[i]) != null; i++ ) { |
||||
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); |
||||
} |
||||
} |
||||
|
||||
function cloneCopyEvent( src, dest ) { |
||||
|
||||
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { |
||||
return; |
||||
} |
||||
|
||||
var type, i, l, |
||||
oldData = jQuery._data( src ), |
||||
curData = jQuery._data( dest, oldData ), |
||||
events = oldData.events; |
||||
|
||||
if ( events ) { |
||||
delete curData.handle; |
||||
curData.events = {}; |
||||
|
||||
for ( type in events ) { |
||||
for ( i = 0, l = events[ type ].length; i < l; i++ ) { |
||||
jQuery.event.add( dest, type, events[ type ][ i ] ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// make the cloned public data object a copy from the original
|
||||
if ( curData.data ) { |
||||
curData.data = jQuery.extend( {}, curData.data ); |
||||
} |
||||
} |
||||
|
||||
function fixCloneNodeIssues( src, dest ) { |
||||
var nodeName, e, data; |
||||
|
||||
// We do not need to do anything for non-Elements
|
||||
if ( dest.nodeType !== 1 ) { |
||||
return; |
||||
} |
||||
|
||||
nodeName = dest.nodeName.toLowerCase(); |
||||
|
||||
// IE6-8 copies events bound via attachEvent when using cloneNode.
|
||||
if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { |
||||
data = jQuery._data( dest ); |
||||
|
||||
for ( e in data.events ) { |
||||
jQuery.removeEvent( dest, e, data.handle ); |
||||
} |
||||
|
||||
// Event data gets referenced instead of copied if the expando gets copied too
|
||||
dest.removeAttribute( jQuery.expando ); |
||||
} |
||||
|
||||
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
|
||||
if ( nodeName === "script" && dest.text !== src.text ) { |
||||
disableScript( dest ).text = src.text; |
||||
restoreScript( dest ); |
||||
|
||||
// IE6-10 improperly clones children of object elements using classid.
|
||||
// IE10 throws NoModificationAllowedError if parent is null, #12132.
|
||||
} else if ( nodeName === "object" ) { |
||||
if ( dest.parentNode ) { |
||||
dest.outerHTML = src.outerHTML; |
||||
} |
||||
|
||||
// This path appears unavoidable for IE9. When cloning an object
|
||||
// element in IE9, the outerHTML strategy above is not sufficient.
|
||||
// If the src has innerHTML and the destination does not,
|
||||
// copy the src.innerHTML into the dest.innerHTML. #10324
|
||||
if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { |
||||
dest.innerHTML = src.innerHTML; |
||||
} |
||||
|
||||
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { |
||||
// IE6-8 fails to persist the checked state of a cloned checkbox
|
||||
// or radio button. Worse, IE6-7 fail to give the cloned element
|
||||
// a checked appearance if the defaultChecked value isn't also set
|
||||
|
||||
dest.defaultChecked = dest.checked = src.checked; |
||||
|
||||
// IE6-7 get confused and end up setting the value of a cloned
|
||||
// checkbox/radio button to an empty string instead of "on"
|
||||
if ( dest.value !== src.value ) { |
||||
dest.value = src.value; |
||||
} |
||||
|
||||
// IE6-8 fails to return the selected option to the default selected
|
||||
// state when cloning options
|
||||
} else if ( nodeName === "option" ) { |
||||
dest.defaultSelected = dest.selected = src.defaultSelected; |
||||
|
||||
// IE6-8 fails to set the defaultValue to the correct value when
|
||||
// cloning other types of input fields
|
||||
} else if ( nodeName === "input" || nodeName === "textarea" ) { |
||||
dest.defaultValue = src.defaultValue; |
||||
} |
||||
} |
||||
|
||||
jQuery.extend({ |
||||
clone: function( elem, dataAndEvents, deepDataAndEvents ) { |
||||
var destElements, node, clone, i, srcElements, |
||||
inPage = jQuery.contains( elem.ownerDocument, elem ); |
||||
|
||||
if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { |
||||
clone = elem.cloneNode( true ); |
||||
|
||||
// IE<=8 does not properly clone detached, unknown element nodes
|
||||
} else { |
||||
fragmentDiv.innerHTML = elem.outerHTML; |
||||
fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); |
||||
} |
||||
|
||||
if ( (!support.noCloneEvent || !support.noCloneChecked) && |
||||
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { |
||||
|
||||
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
|
||||
destElements = getAll( clone ); |
||||
srcElements = getAll( elem ); |
||||
|
||||
// Fix all IE cloning issues
|
||||
for ( i = 0; (node = srcElements[i]) != null; ++i ) { |
||||
// Ensure that the destination node is not null; Fixes #9587
|
||||
if ( destElements[i] ) { |
||||
fixCloneNodeIssues( node, destElements[i] ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Copy the events from the original to the clone
|
||||
if ( dataAndEvents ) { |
||||
if ( deepDataAndEvents ) { |
||||
srcElements = srcElements || getAll( elem ); |
||||
destElements = destElements || getAll( clone ); |
||||
|
||||
for ( i = 0; (node = srcElements[i]) != null; i++ ) { |
||||
cloneCopyEvent( node, destElements[i] ); |
||||
} |
||||
} else { |
||||
cloneCopyEvent( elem, clone ); |
||||
} |
||||
} |
||||
|
||||
// Preserve script evaluation history
|
||||
destElements = getAll( clone, "script" ); |
||||
if ( destElements.length > 0 ) { |
||||
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); |
||||
} |
||||
|
||||
destElements = srcElements = node = null; |
||||
|
||||
// Return the cloned set
|
||||
return clone; |
||||
}, |
||||
|
||||
buildFragment: function( elems, context, scripts, selection ) { |
||||
var j, elem, contains, |
||||
tmp, tag, tbody, wrap, |
||||
l = elems.length, |
||||
|
||||
// Ensure a safe fragment
|
||||
safe = createSafeFragment( context ), |
||||
|
||||
nodes = [], |
||||
i = 0; |
||||
|
||||
for ( ; i < l; i++ ) { |
||||
elem = elems[ i ]; |
||||
|
||||
if ( elem || elem === 0 ) { |
||||
|
||||
// Add nodes directly
|
||||
if ( jQuery.type( elem ) === "object" ) { |
||||
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); |
||||
|
||||
// Convert non-html into a text node
|
||||
} else if ( !rhtml.test( elem ) ) { |
||||
nodes.push( context.createTextNode( elem ) ); |
||||
|
||||
// Convert html into DOM nodes
|
||||
} else { |
||||
tmp = tmp || safe.appendChild( context.createElement("div") ); |
||||
|
||||
// Deserialize a standard representation
|
||||
tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); |
||||
wrap = wrapMap[ tag ] || wrapMap._default; |
||||
|
||||
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; |
||||
|
||||
// Descend through wrappers to the right content
|
||||
j = wrap[0]; |
||||
while ( j-- ) { |
||||
tmp = tmp.lastChild; |
||||
} |
||||
|
||||
// Manually add leading whitespace removed by IE
|
||||
if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { |
||||
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); |
||||
} |
||||
|
||||
// Remove IE's autoinserted <tbody> from table fragments
|
||||
if ( !support.tbody ) { |
||||
|
||||
// String was a <table>, *may* have spurious <tbody>
|
||||
elem = tag === "table" && !rtbody.test( elem ) ? |
||||
tmp.firstChild : |
||||
|
||||
// String was a bare <thead> or <tfoot>
|
||||
wrap[1] === "<table>" && !rtbody.test( elem ) ? |
||||
tmp : |
||||
0; |
||||
|
||||
j = elem && elem.childNodes.length; |
||||
while ( j-- ) { |
||||
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { |
||||
elem.removeChild( tbody ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
jQuery.merge( nodes, tmp.childNodes ); |
||||
|
||||
// Fix #12392 for WebKit and IE > 9
|
||||
tmp.textContent = ""; |
||||
|
||||
// Fix #12392 for oldIE
|
||||
while ( tmp.firstChild ) { |
||||
tmp.removeChild( tmp.firstChild ); |
||||
} |
||||
|
||||
// Remember the top-level container for proper cleanup
|
||||
tmp = safe.lastChild; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Fix #11356: Clear elements from fragment
|
||||
if ( tmp ) { |
||||
safe.removeChild( tmp ); |
||||
} |
||||
|
||||
// Reset defaultChecked for any radios and checkboxes
|
||||
// about to be appended to the DOM in IE 6/7 (#8060)
|
||||
if ( !support.appendChecked ) { |
||||
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); |
||||
} |
||||
|
||||
i = 0; |
||||
while ( (elem = nodes[ i++ ]) ) { |
||||
|
||||
// #4087 - If origin and destination elements are the same, and this is
|
||||
// that element, do not do anything
|
||||
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { |
||||
continue; |
||||
} |
||||
|
||||
contains = jQuery.contains( elem.ownerDocument, elem ); |
||||
|
||||
// Append to fragment
|
||||
tmp = getAll( safe.appendChild( elem ), "script" ); |
||||
|
||||
// Preserve script evaluation history
|
||||
if ( contains ) { |
||||
setGlobalEval( tmp ); |
||||
} |
||||
|
||||
// Capture executables
|
||||
if ( scripts ) { |
||||
j = 0; |
||||
while ( (elem = tmp[ j++ ]) ) { |
||||
if ( rscriptType.test( elem.type || "" ) ) { |
||||
scripts.push( elem ); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
tmp = null; |
||||
|
||||
return safe; |
||||
}, |
||||
|
||||
cleanData: function( elems, /* internal */ acceptData ) { |
||||
var elem, type, id, data, |
||||
i = 0, |
||||
internalKey = jQuery.expando, |
||||
cache = jQuery.cache, |
||||
deleteExpando = support.deleteExpando, |
||||
special = jQuery.event.special; |
||||
|
||||
for ( ; (elem = elems[i]) != null; i++ ) { |
||||
if ( acceptData || jQuery.acceptData( elem ) ) { |
||||
|
||||
id = elem[ internalKey ]; |
||||
data = id && cache[ id ]; |
||||
|
||||
if ( data ) { |
||||
if ( data.events ) { |
||||
for ( type in data.events ) { |
||||
if ( special[ type ] ) { |
||||
jQuery.event.remove( elem, type ); |
||||
|
||||
// This is a shortcut to avoid jQuery.event.remove's overhead
|
||||
} else { |
||||
jQuery.removeEvent( elem, type, data.handle ); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Remove cache only if it was not already removed by jQuery.event.remove
|
||||
if ( cache[ id ] ) { |
||||
|
||||
delete cache[ id ]; |
||||
|
||||
// IE does not allow us to delete expando properties from nodes,
|
||||
// nor does it have a removeAttribute function on Document nodes;
|
||||
// we must handle all of these cases
|
||||
if ( deleteExpando ) { |
||||
delete elem[ internalKey ]; |
||||
|
||||
} else if ( typeof elem.removeAttribute !== strundefined ) { |
||||
elem.removeAttribute( internalKey ); |
||||
|
||||
} else { |
||||
elem[ internalKey ] = null; |
||||
} |
||||
|
||||
deletedIds.push( id ); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
jQuery.fn.extend({ |
||||
text: function( value ) { |
||||
return 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 ); |
||||
}, |
||||
|
||||
append: function() { |
||||
return this.domManip( arguments, function( elem ) { |
||||
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { |
||||
var target = manipulationTarget( this, elem ); |
||||
target.appendChild( elem ); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
prepend: function() { |
||||
return this.domManip( arguments, function( elem ) { |
||||
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { |
||||
var target = manipulationTarget( this, elem ); |
||||
target.insertBefore( elem, target.firstChild ); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
before: function() { |
||||
return this.domManip( arguments, function( elem ) { |
||||
if ( this.parentNode ) { |
||||
this.parentNode.insertBefore( elem, this ); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
after: function() { |
||||
return this.domManip( arguments, function( elem ) { |
||||
if ( this.parentNode ) { |
||||
this.parentNode.insertBefore( elem, this.nextSibling ); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
remove: function( selector, keepData /* Internal Use Only */ ) { |
||||
var elem, |
||||
elems = selector ? jQuery.filter( selector, this ) : this, |
||||
i = 0; |
||||
|
||||
for ( ; (elem = elems[i]) != null; i++ ) { |
||||
|
||||
if ( !keepData && elem.nodeType === 1 ) { |
||||
jQuery.cleanData( getAll( elem ) ); |
||||
} |
||||
|
||||
if ( elem.parentNode ) { |
||||
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { |
||||
setGlobalEval( getAll( elem, "script" ) ); |
||||
} |
||||
elem.parentNode.removeChild( elem ); |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
}, |
||||
|
||||
empty: function() { |
||||
var elem, |
||||
i = 0; |
||||
|
||||
for ( ; (elem = this[i]) != null; i++ ) { |
||||
// Remove element nodes and prevent memory leaks
|
||||
if ( elem.nodeType === 1 ) { |
||||
jQuery.cleanData( getAll( elem, false ) ); |
||||
} |
||||
|
||||
// Remove any remaining nodes
|
||||
while ( elem.firstChild ) { |
||||
elem.removeChild( elem.firstChild ); |
||||
} |
||||
|
||||
// If this is a select, ensure that it displays empty (#12336)
|
||||
// Support: IE<9
|
||||
if ( elem.options && jQuery.nodeName( elem, "select" ) ) { |
||||
elem.options.length = 0; |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
}, |
||||
|
||||
clone: function( dataAndEvents, deepDataAndEvents ) { |
||||
dataAndEvents = dataAndEvents == null ? false : dataAndEvents; |
||||
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; |
||||
|
||||
return this.map(function() { |
||||
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); |
||||
}); |
||||
}, |
||||
|
||||
html: function( value ) { |
||||
return access( this, function( value ) { |
||||
var elem = this[ 0 ] || {}, |
||||
i = 0, |
||||
l = this.length; |
||||
|
||||
if ( value === undefined ) { |
||||
return elem.nodeType === 1 ? |
||||
elem.innerHTML.replace( rinlinejQuery, "" ) : |
||||
undefined; |
||||
} |
||||
|
||||
// See if we can take a shortcut and just use innerHTML
|
||||
if ( typeof value === "string" && !rnoInnerhtml.test( value ) && |
||||
( support.htmlSerialize || !rnoshimcache.test( value ) ) && |
||||
( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && |
||||
!wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { |
||||
|
||||
value = value.replace( rxhtmlTag, "<$1></$2>" ); |
||||
|
||||
try { |
||||
for (; i < l; i++ ) { |
||||
// Remove element nodes and prevent memory leaks
|
||||
elem = this[i] || {}; |
||||
if ( elem.nodeType === 1 ) { |
||||
jQuery.cleanData( getAll( elem, false ) ); |
||||
elem.innerHTML = value; |
||||
} |
||||
} |
||||
|
||||
elem = 0; |
||||
|
||||
// If using innerHTML throws an exception, use the fallback method
|
||||
} catch(e) {} |
||||
} |
||||
|
||||
if ( elem ) { |
||||
this.empty().append( value ); |
||||
} |
||||
}, null, value, arguments.length ); |
||||
}, |
||||
|
||||
replaceWith: function() { |
||||
var arg = arguments[ 0 ]; |
||||
|
||||
// Make the changes, replacing each context element with the new content
|
||||
this.domManip( arguments, function( elem ) { |
||||
arg = this.parentNode; |
||||
|
||||
jQuery.cleanData( getAll( this ) ); |
||||
|
||||
if ( arg ) { |
||||
arg.replaceChild( elem, this ); |
||||
} |
||||
}); |
||||
|
||||
// Force removal if there was no new content (e.g., from empty arguments)
|
||||
return arg && (arg.length || arg.nodeType) ? this : this.remove(); |
||||
}, |
||||
|
||||
detach: function( selector ) { |
||||
return this.remove( selector, true ); |
||||
}, |
||||
|
||||
domManip: function( args, callback ) { |
||||
|
||||
// Flatten any nested arrays
|
||||
args = concat.apply( [], args ); |
||||
|
||||
var first, node, hasScripts, |
||||
scripts, doc, fragment, |
||||
i = 0, |
||||
l = this.length, |
||||
set = this, |
||||
iNoClone = l - 1, |
||||
value = args[0], |
||||
isFunction = jQuery.isFunction( value ); |
||||
|
||||
// We can't cloneNode fragments that contain checked, in WebKit
|
||||
if ( isFunction || |
||||
( l > 1 && typeof value === "string" && |
||||
!support.checkClone && rchecked.test( value ) ) ) { |
||||
return this.each(function( index ) { |
||||
var self = set.eq( index ); |
||||
if ( isFunction ) { |
||||
args[0] = value.call( this, index, self.html() ); |
||||
} |
||||
self.domManip( args, callback ); |
||||
}); |
||||
} |
||||
|
||||
if ( l ) { |
||||
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); |
||||
first = fragment.firstChild; |
||||
|
||||
if ( fragment.childNodes.length === 1 ) { |
||||
fragment = first; |
||||
} |
||||
|
||||
if ( first ) { |
||||
scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); |
||||
hasScripts = scripts.length; |
||||
|
||||
// Use the original fragment for the last item instead of the first because it can end up
|
||||
// being emptied incorrectly in certain situations (#8070).
|
||||
for ( ; i < l; i++ ) { |
||||
node = fragment; |
||||
|
||||
if ( i !== iNoClone ) { |
||||
node = jQuery.clone( node, true, true ); |
||||
|
||||
// Keep references to cloned scripts for later restoration
|
||||
if ( hasScripts ) { |
||||
jQuery.merge( scripts, getAll( node, "script" ) ); |
||||
} |
||||
} |
||||
|
||||
callback.call( this[i], node, i ); |
||||
} |
||||
|
||||
if ( hasScripts ) { |
||||
doc = scripts[ scripts.length - 1 ].ownerDocument; |
||||
|
||||
// Reenable scripts
|
||||
jQuery.map( scripts, restoreScript ); |
||||
|
||||
// Evaluate executable scripts on first document insertion
|
||||
for ( i = 0; i < hasScripts; i++ ) { |
||||
node = scripts[ i ]; |
||||
if ( rscriptType.test( node.type || "" ) && |
||||
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { |
||||
|
||||
if ( node.src ) { |
||||
// Optional AJAX dependency, but won't run scripts if not present
|
||||
if ( jQuery._evalUrl ) { |
||||
jQuery._evalUrl( node.src ); |
||||
} |
||||
} else { |
||||
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Fix #11809: Avoid leaking memory
|
||||
fragment = first = null; |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
}); |
||||
|
||||
jQuery.each({ |
||||
appendTo: "append", |
||||
prependTo: "prepend", |
||||
insertBefore: "before", |
||||
insertAfter: "after", |
||||
replaceAll: "replaceWith" |
||||
}, function( name, original ) { |
||||
jQuery.fn[ name ] = function( selector ) { |
||||
var elems, |
||||
i = 0, |
||||
ret = [], |
||||
insert = jQuery( selector ), |
||||
last = insert.length - 1; |
||||
|
||||
for ( ; i <= last; i++ ) { |
||||
elems = i === last ? this : this.clone(true); |
||||
jQuery( insert[i] )[ original ]( elems ); |
||||
|
||||
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
|
||||
push.apply( ret, elems.get() ); |
||||
} |
||||
|
||||
return this.pushStack( ret ); |
||||
}; |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,18 +0,0 @@
|
||||
define([ |
||||
"../ajax" |
||||
], function( jQuery ) { |
||||
|
||||
jQuery._evalUrl = function( url ) { |
||||
return jQuery.ajax({ |
||||
url: url, |
||||
type: "GET", |
||||
dataType: "script", |
||||
async: false, |
||||
global: false, |
||||
"throws": true |
||||
}); |
||||
}; |
||||
|
||||
return jQuery._evalUrl; |
||||
|
||||
}); |
||||
@ -1,76 +0,0 @@
|
||||
define([ |
||||
"../var/support" |
||||
], function( support ) { |
||||
|
||||
(function() { |
||||
// Minified: var a,b,c
|
||||
var input = document.createElement( "input" ), |
||||
div = document.createElement( "div" ), |
||||
fragment = document.createDocumentFragment(); |
||||
|
||||
// Setup
|
||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; |
||||
|
||||
// IE strips leading whitespace when .innerHTML is used
|
||||
support.leadingWhitespace = div.firstChild.nodeType === 3; |
||||
|
||||
// Make sure that tbody elements aren't automatically inserted
|
||||
// IE will insert them into empty tables
|
||||
support.tbody = !div.getElementsByTagName( "tbody" ).length; |
||||
|
||||
// Make sure that link elements get serialized correctly by innerHTML
|
||||
// This requires a wrapper element in IE
|
||||
support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; |
||||
|
||||
// Makes sure cloning an html5 element does not cause problems
|
||||
// Where outerHTML is undefined, this still works
|
||||
support.html5Clone = |
||||
document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; |
||||
|
||||
// Check if a disconnected checkbox will retain its checked
|
||||
// value of true after appended to the DOM (IE6/7)
|
||||
input.type = "checkbox"; |
||||
input.checked = true; |
||||
fragment.appendChild( input ); |
||||
support.appendChecked = input.checked; |
||||
|
||||
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
||||
// Support: IE6-IE11+
|
||||
div.innerHTML = "<textarea>x</textarea>"; |
||||
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; |
||||
|
||||
// #11217 - WebKit loses check when the name is after the checked attribute
|
||||
fragment.appendChild( div ); |
||||
div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; |
||||
|
||||
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
|
||||
// old WebKit doesn't clone checked state correctly in fragments
|
||||
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; |
||||
|
||||
// Support: IE<9
|
||||
// Opera does not clone events (and typeof div.attachEvent === undefined).
|
||||
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
|
||||
support.noCloneEvent = true; |
||||
if ( div.attachEvent ) { |
||||
div.attachEvent( "onclick", function() { |
||||
support.noCloneEvent = false; |
||||
}); |
||||
|
||||
div.cloneNode( true ).click(); |
||||
} |
||||
|
||||
// Execute the test only if not already executed in another module.
|
||||
if (support.deleteExpando == null) { |
||||
// Support: IE<9
|
||||
support.deleteExpando = true; |
||||
try { |
||||
delete div.test; |
||||
} catch( e ) { |
||||
support.deleteExpando = false; |
||||
} |
||||
} |
||||
})(); |
||||
|
||||
return support; |
||||
|
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return (/^(?:checkbox|radio)$/i); |
||||
}); |
||||
@ -1,211 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/strundefined", |
||||
"./core/access", |
||||
"./css/var/rnumnonpx", |
||||
"./css/curCSS", |
||||
"./css/addGetHookIf", |
||||
"./css/support", |
||||
|
||||
"./core/init", |
||||
"./css", |
||||
"./selector" // contains
|
||||
], function( jQuery, strundefined, access, rnumnonpx, curCSS, addGetHookIf, support ) { |
||||
|
||||
// BuildExclude
|
||||
curCSS = curCSS.curCSS; |
||||
|
||||
var docElem = window.document.documentElement; |
||||
|
||||
/** |
||||
* Gets a window from an element |
||||
*/ |
||||
function getWindow( elem ) { |
||||
return jQuery.isWindow( elem ) ? |
||||
elem : |
||||
elem.nodeType === 9 ? |
||||
elem.defaultView || elem.parentWindow : |
||||
false; |
||||
} |
||||
|
||||
jQuery.offset = { |
||||
setOffset: function( elem, options, i ) { |
||||
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, |
||||
position = jQuery.css( elem, "position" ), |
||||
curElem = jQuery( elem ), |
||||
props = {}; |
||||
|
||||
// set position first, in-case top/left are set even on static elem
|
||||
if ( position === "static" ) { |
||||
elem.style.position = "relative"; |
||||
} |
||||
|
||||
curOffset = curElem.offset(); |
||||
curCSSTop = jQuery.css( elem, "top" ); |
||||
curCSSLeft = jQuery.css( elem, "left" ); |
||||
calculatePosition = ( position === "absolute" || position === "fixed" ) && |
||||
jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; |
||||
|
||||
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
||||
if ( calculatePosition ) { |
||||
curPosition = curElem.position(); |
||||
curTop = curPosition.top; |
||||
curLeft = curPosition.left; |
||||
} else { |
||||
curTop = parseFloat( curCSSTop ) || 0; |
||||
curLeft = parseFloat( curCSSLeft ) || 0; |
||||
} |
||||
|
||||
if ( jQuery.isFunction( options ) ) { |
||||
options = options.call( elem, i, curOffset ); |
||||
} |
||||
|
||||
if ( options.top != null ) { |
||||
props.top = ( options.top - curOffset.top ) + curTop; |
||||
} |
||||
if ( options.left != null ) { |
||||
props.left = ( options.left - curOffset.left ) + curLeft; |
||||
} |
||||
|
||||
if ( "using" in options ) { |
||||
options.using.call( elem, props ); |
||||
} else { |
||||
curElem.css( props ); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
jQuery.fn.extend({ |
||||
offset: function( options ) { |
||||
if ( arguments.length ) { |
||||
return options === undefined ? |
||||
this : |
||||
this.each(function( i ) { |
||||
jQuery.offset.setOffset( this, options, i ); |
||||
}); |
||||
} |
||||
|
||||
var docElem, win, |
||||
box = { top: 0, left: 0 }, |
||||
elem = this[ 0 ], |
||||
doc = elem && elem.ownerDocument; |
||||
|
||||
if ( !doc ) { |
||||
return; |
||||
} |
||||
|
||||
docElem = doc.documentElement; |
||||
|
||||
// Make sure it's not a disconnected DOM node
|
||||
if ( !jQuery.contains( docElem, elem ) ) { |
||||
return box; |
||||
} |
||||
|
||||
// If we don't have gBCR, just use 0,0 rather than error
|
||||
// BlackBerry 5, iOS 3 (original iPhone)
|
||||
if ( typeof elem.getBoundingClientRect !== strundefined ) { |
||||
box = elem.getBoundingClientRect(); |
||||
} |
||||
win = getWindow( doc ); |
||||
return { |
||||
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), |
||||
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) |
||||
}; |
||||
}, |
||||
|
||||
position: function() { |
||||
if ( !this[ 0 ] ) { |
||||
return; |
||||
} |
||||
|
||||
var offsetParent, offset, |
||||
parentOffset = { top: 0, left: 0 }, |
||||
elem = this[ 0 ]; |
||||
|
||||
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
|
||||
if ( jQuery.css( elem, "position" ) === "fixed" ) { |
||||
// we assume that getBoundingClientRect is available when computed position is fixed
|
||||
offset = elem.getBoundingClientRect(); |
||||
} else { |
||||
// Get *real* offsetParent
|
||||
offsetParent = this.offsetParent(); |
||||
|
||||
// Get correct offsets
|
||||
offset = this.offset(); |
||||
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { |
||||
parentOffset = offsetParent.offset(); |
||||
} |
||||
|
||||
// Add offsetParent borders
|
||||
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); |
||||
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); |
||||
} |
||||
|
||||
// Subtract parent offsets and element margins
|
||||
// note: when an element has margin: auto the offsetLeft and marginLeft
|
||||
// are the same in Safari causing offset.left to incorrectly be 0
|
||||
return { |
||||
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), |
||||
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) |
||||
}; |
||||
}, |
||||
|
||||
offsetParent: function() { |
||||
return this.map(function() { |
||||
var offsetParent = this.offsetParent || docElem; |
||||
|
||||
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { |
||||
offsetParent = offsetParent.offsetParent; |
||||
} |
||||
return offsetParent || docElem; |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
// Create scrollLeft and scrollTop methods
|
||||
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { |
||||
var top = /Y/.test( prop ); |
||||
|
||||
jQuery.fn[ method ] = function( val ) { |
||||
return access( this, function( elem, method, val ) { |
||||
var win = getWindow( elem ); |
||||
|
||||
if ( val === undefined ) { |
||||
return win ? (prop in win) ? win[ prop ] : |
||||
win.document.documentElement[ method ] : |
||||
elem[ method ]; |
||||
} |
||||
|
||||
if ( win ) { |
||||
win.scrollTo( |
||||
!top ? val : jQuery( win ).scrollLeft(), |
||||
top ? val : jQuery( win ).scrollTop() |
||||
); |
||||
|
||||
} else { |
||||
elem[ method ] = val; |
||||
} |
||||
}, method, val, arguments.length, null ); |
||||
}; |
||||
}); |
||||
|
||||
// Add the top/left cssHooks using jQuery.fn.position
|
||||
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
|
||||
// getComputedStyle returns percent when specified for top/left/bottom/right
|
||||
// rather than make the css module depend on the offset module, we just check for it here
|
||||
jQuery.each( [ "top", "left" ], function( i, prop ) { |
||||
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, |
||||
function( elem, computed ) { |
||||
if ( computed ) { |
||||
computed = curCSS( elem, prop ); |
||||
// if curCSS returns percentage, fallback to offset
|
||||
return rnumnonpx.test( computed ) ? |
||||
jQuery( elem ).position()[ prop ] + "px" : |
||||
computed; |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1 +0,0 @@
|
||||
})); |
||||
@ -1,142 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./deferred", |
||||
"./callbacks" |
||||
], function( jQuery ) { |
||||
|
||||
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" ); |
||||
jQuery._removeData( elem, key ); |
||||
}) |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
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 ); |
||||
}); |
||||
}, |
||||
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 ); |
||||
} |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,22 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../queue", |
||||
"../effects" // Delay is optional because of this dependency
|
||||
], function( jQuery ) { |
||||
|
||||
// Based off of the plugin by Clint Helfers, with permission.
|
||||
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
||||
jQuery.fn.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 ); |
||||
}; |
||||
}); |
||||
}; |
||||
|
||||
return jQuery.fn.delay; |
||||
}); |
||||
@ -1,14 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"sizzle" |
||||
], function( jQuery, Sizzle ) { |
||||
|
||||
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; |
||||
|
||||
}); |
||||
@ -1 +0,0 @@
|
||||
define([ "./selector-sizzle" ]); |
||||
@ -1,110 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./manipulation/var/rcheckableType", |
||||
"./core/init", |
||||
"./traversing", // filter
|
||||
"./attributes/prop" |
||||
], function( jQuery, rcheckableType ) { |
||||
|
||||
var r20 = /%20/g, |
||||
rbracket = /\[\]$/, |
||||
rCRLF = /\r?\n/g, |
||||
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, |
||||
rsubmittable = /^(?:input|select|textarea|keygen)/i; |
||||
|
||||
function buildParams( prefix, obj, traditional, add ) { |
||||
var name; |
||||
|
||||
if ( jQuery.isArray( obj ) ) { |
||||
// Serialize array item.
|
||||
jQuery.each( obj, function( i, v ) { |
||||
if ( traditional || rbracket.test( prefix ) ) { |
||||
// Treat each array item as a scalar.
|
||||
add( prefix, v ); |
||||
|
||||
} else { |
||||
// Item is non-scalar (array or object), encode its numeric index.
|
||||
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); |
||||
} |
||||
}); |
||||
|
||||
} else if ( !traditional && jQuery.type( obj ) === "object" ) { |
||||
// Serialize object item.
|
||||
for ( name in obj ) { |
||||
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
||||
} |
||||
|
||||
} else { |
||||
// Serialize scalar item.
|
||||
add( prefix, obj ); |
||||
} |
||||
} |
||||
|
||||
// Serialize an array of form elements or a set of
|
||||
// key/values into a query string
|
||||
jQuery.param = function( a, traditional ) { |
||||
var prefix, |
||||
s = [], |
||||
add = function( key, value ) { |
||||
// If value is a function, invoke it and return its value
|
||||
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); |
||||
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); |
||||
}; |
||||
|
||||
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
||||
if ( traditional === undefined ) { |
||||
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; |
||||
} |
||||
|
||||
// If an array was passed in, assume that it is an array of form elements.
|
||||
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { |
||||
// Serialize the form elements
|
||||
jQuery.each( a, function() { |
||||
add( this.name, this.value ); |
||||
}); |
||||
|
||||
} else { |
||||
// If traditional, encode the "old" way (the way 1.3.2 or older
|
||||
// did it), otherwise encode params recursively.
|
||||
for ( prefix in a ) { |
||||
buildParams( prefix, a[ prefix ], traditional, add ); |
||||
} |
||||
} |
||||
|
||||
// Return the resulting serialization
|
||||
return s.join( "&" ).replace( r20, "+" ); |
||||
}; |
||||
|
||||
jQuery.fn.extend({ |
||||
serialize: function() { |
||||
return jQuery.param( this.serializeArray() ); |
||||
}, |
||||
serializeArray: function() { |
||||
return this.map(function() { |
||||
// Can add propHook for "elements" to filter or add form elements
|
||||
var elements = jQuery.prop( this, "elements" ); |
||||
return elements ? jQuery.makeArray( elements ) : this; |
||||
}) |
||||
.filter(function() { |
||||
var type = this.type; |
||||
// Use .is(":disabled") so that fieldset[disabled] works
|
||||
return this.name && !jQuery( this ).is( ":disabled" ) && |
||||
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && |
||||
( this.checked || !rcheckableType.test( type ) ); |
||||
}) |
||||
.map(function( i, elem ) { |
||||
var val = jQuery( this ).val(); |
||||
|
||||
return val == null ? |
||||
null : |
||||
jQuery.isArray( val ) ? |
||||
jQuery.map( val, function( val ) { |
||||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
||||
}) : |
||||
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
||||
}).get(); |
||||
} |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,58 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./var/strundefined", |
||||
"./var/support", |
||||
"./core/init", // Needed for hasOwn support test
|
||||
// This is listed as a dependency for build order, but it's still optional in builds
|
||||
"./core/ready" |
||||
], function( jQuery, strundefined, support ) { |
||||
|
||||
// Support: IE<9
|
||||
// Iteration over object's inherited properties before its own
|
||||
var i; |
||||
for ( i in jQuery( support ) ) { |
||||
break; |
||||
} |
||||
support.ownLast = i !== "0"; |
||||
|
||||
// Note: most support tests are defined in their respective modules.
|
||||
// false until the test is run
|
||||
support.inlineBlockNeedsLayout = false; |
||||
|
||||
// Execute ASAP in case we need to set body.style.zoom
|
||||
jQuery(function() { |
||||
// Minified: var a,b,c,d
|
||||
var val, div, body, container; |
||||
|
||||
body = document.getElementsByTagName( "body" )[ 0 ]; |
||||
if ( !body || !body.style ) { |
||||
// Return for frameset docs that don't have a body
|
||||
return; |
||||
} |
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" ); |
||||
container = document.createElement( "div" ); |
||||
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; |
||||
body.appendChild( container ).appendChild( div ); |
||||
|
||||
if ( typeof div.style.zoom !== strundefined ) { |
||||
// Support: IE<8
|
||||
// Check if natively block-level elements act like inline-block
|
||||
// elements when setting their display to 'inline' and giving
|
||||
// them layout
|
||||
div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; |
||||
|
||||
support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; |
||||
if ( val ) { |
||||
// Prevent IE 6 from affecting layout for positioned elements #11048
|
||||
// Prevent IE from shrinking the body in IE 7 mode #12869
|
||||
// Support: IE<8
|
||||
body.style.zoom = 1; |
||||
} |
||||
} |
||||
|
||||
body.removeChild( container ); |
||||
}); |
||||
|
||||
}); |
||||
@ -1,200 +0,0 @@
|
||||
define([ |
||||
"./core", |
||||
"./traversing/var/rneedsContext", |
||||
"./core/init", |
||||
"./traversing/findFilter", |
||||
"./selector" |
||||
], function( jQuery, rneedsContext ) { |
||||
|
||||
var rparentsprev = /^(?:parents|prev(?:Until|All))/, |
||||
// methods guaranteed to produce a unique set when starting from a unique set
|
||||
guaranteedUnique = { |
||||
children: true, |
||||
contents: true, |
||||
next: true, |
||||
prev: true |
||||
}; |
||||
|
||||
jQuery.extend({ |
||||
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; |
||||
} |
||||
}); |
||||
|
||||
jQuery.fn.extend({ |
||||
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; |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
closest: function( selectors, context ) { |
||||
var cur, |
||||
i = 0, |
||||
l = this.length, |
||||
matched = [], |
||||
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? |
||||
jQuery( selectors, context || this.context ) : |
||||
0; |
||||
|
||||
for ( ; i < l; i++ ) { |
||||
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { |
||||
// Always skip document fragments
|
||||
if ( cur.nodeType < 11 && (pos ? |
||||
pos.index(cur) > -1 : |
||||
|
||||
// Don't pass non-elements to Sizzle
|
||||
cur.nodeType === 1 && |
||||
jQuery.find.matchesSelector(cur, selectors)) ) { |
||||
|
||||
matched.push( cur ); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); |
||||
}, |
||||
|
||||
// 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.first().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 ) { |
||||
return this.pushStack( |
||||
jQuery.unique( |
||||
jQuery.merge( this.get(), jQuery( selector, context ) ) |
||||
) |
||||
); |
||||
}, |
||||
|
||||
addBack: function( selector ) { |
||||
return this.add( selector == null ? |
||||
this.prevObject : this.prevObject.filter(selector) |
||||
); |
||||
} |
||||
}); |
||||
|
||||
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 ( name.slice( -5 ) !== "Until" ) { |
||||
selector = until; |
||||
} |
||||
|
||||
if ( selector && typeof selector === "string" ) { |
||||
ret = jQuery.filter( selector, ret ); |
||||
} |
||||
|
||||
if ( this.length > 1 ) { |
||||
// Remove duplicates
|
||||
if ( !guaranteedUnique[ name ] ) { |
||||
ret = jQuery.unique( ret ); |
||||
} |
||||
|
||||
// Reverse order for parents* and prev-derivatives
|
||||
if ( rparentsprev.test( name ) ) { |
||||
ret = ret.reverse(); |
||||
} |
||||
} |
||||
|
||||
return this.pushStack( ret ); |
||||
}; |
||||
}); |
||||
|
||||
return jQuery; |
||||
}); |
||||
@ -1,100 +0,0 @@
|
||||
define([ |
||||
"../core", |
||||
"../var/indexOf", |
||||
"./var/rneedsContext", |
||||
"../selector" |
||||
], function( jQuery, indexOf, rneedsContext ) { |
||||
|
||||
var risSimple = /^.[^:#\[\.,]*$/; |
||||
|
||||
// Implement the identical functionality for filter and not
|
||||
function winnow( elements, qualifier, not ) { |
||||
if ( jQuery.isFunction( qualifier ) ) { |
||||
return jQuery.grep( elements, function( elem, i ) { |
||||
/* jshint -W018 */ |
||||
return !!qualifier.call( elem, i, elem ) !== not; |
||||
}); |
||||
|
||||
} |
||||
|
||||
if ( qualifier.nodeType ) { |
||||
return jQuery.grep( elements, function( elem ) { |
||||
return ( elem === qualifier ) !== not; |
||||
}); |
||||
|
||||
} |
||||
|
||||
if ( typeof qualifier === "string" ) { |
||||
if ( risSimple.test( qualifier ) ) { |
||||
return jQuery.filter( qualifier, elements, not ); |
||||
} |
||||
|
||||
qualifier = jQuery.filter( qualifier, elements ); |
||||
} |
||||
|
||||
return jQuery.grep( elements, function( elem ) { |
||||
return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; |
||||
}); |
||||
} |
||||
|
||||
jQuery.filter = function( expr, elems, not ) { |
||||
var elem = elems[ 0 ]; |
||||
|
||||
if ( not ) { |
||||
expr = ":not(" + expr + ")"; |
||||
} |
||||
|
||||
return elems.length === 1 && elem.nodeType === 1 ? |
||||
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : |
||||
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { |
||||
return elem.nodeType === 1; |
||||
})); |
||||
}; |
||||
|
||||
jQuery.fn.extend({ |
||||
find: function( selector ) { |
||||
var i, |
||||
ret = [], |
||||
self = this, |
||||
len = self.length; |
||||
|
||||
if ( typeof selector !== "string" ) { |
||||
return this.pushStack( jQuery( selector ).filter(function() { |
||||
for ( i = 0; i < len; i++ ) { |
||||
if ( jQuery.contains( self[ i ], this ) ) { |
||||
return true; |
||||
} |
||||
} |
||||
}) ); |
||||
} |
||||
|
||||
for ( i = 0; i < len; i++ ) { |
||||
jQuery.find( selector, self[ i ], ret ); |
||||
} |
||||
|
||||
// Needed because $( selector, context ) becomes $( context ).find( selector )
|
||||
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); |
||||
ret.selector = this.selector ? this.selector + " " + selector : selector; |
||||
return ret; |
||||
}, |
||||
filter: function( selector ) { |
||||
return this.pushStack( winnow(this, selector || [], false) ); |
||||
}, |
||||
not: function( selector ) { |
||||
return this.pushStack( winnow(this, selector || [], true) ); |
||||
}, |
||||
is: function( selector ) { |
||||
return !!winnow( |
||||
this, |
||||
|
||||
// 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".
|
||||
typeof selector === "string" && rneedsContext.test( selector ) ? |
||||
jQuery( selector ) : |
||||
selector || [], |
||||
false |
||||
).length; |
||||
} |
||||
}); |
||||
|
||||
}); |
||||
@ -1,6 +0,0 @@
|
||||
define([ |
||||
"../../core", |
||||
"../../selector" |
||||
], function( jQuery ) { |
||||
return jQuery.expr.match.needsContext; |
||||
}); |
||||
@ -1,4 +0,0 @@
|
||||
define(function() { |
||||
// [[Class]] -> type pairs
|
||||
return {}; |
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"./deletedIds" |
||||
], function( deletedIds ) { |
||||
return deletedIds.concat; |
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return []; |
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"./class2type" |
||||
], function( class2type ) { |
||||
return class2type.hasOwnProperty; |
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"./deletedIds" |
||||
], function( deletedIds ) { |
||||
return deletedIds.indexOf; |
||||
}); |
||||
@ -1,3 +0,0 @@
|
||||
define(function() { |
||||
return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; |
||||
}); |
||||
@ -1,5 +0,0 @@
|
||||
define([ |
||||
"./deletedIds" |
||||
], function( deletedIds ) { |
||||
return deletedIds.push; |
||||
}); |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue