Heeyeon

Making files to show various foreign foods videos and Modifying intro page

Showing 139 changed files with 4712 additions and 45 deletions
...@@ -6,7 +6,7 @@ const fs=require('fs'); ...@@ -6,7 +6,7 @@ const fs=require('fs');
6 const router = express.Router() 6 const router = express.Router()
7 const fileStore = require('session-file-store')(session); 7 const fileStore = require('session-file-store')(session);
8 const app = express(); 8 const app = express();
9 -var flash = require('connect-flash'); 9 +var flash = require('connect-flash');
10 var NaverStrategy = require('passport-naver').Strategy; 10 var NaverStrategy = require('passport-naver').Strategy;
11 var KakaoStrategy = require('passport-kakao').Strategy; 11 var KakaoStrategy = require('passport-kakao').Strategy;
12 12
...@@ -38,7 +38,7 @@ passport.deserializeUser(function(id, done) { //읽기 ...@@ -38,7 +38,7 @@ passport.deserializeUser(function(id, done) { //읽기
38 38
39 //첫 페이지 39 //첫 페이지
40 app.get('/',(req,res)=>{ 40 app.get('/',(req,res)=>{
41 - let page = getFirstPage('Passport','This is Passport Example Page',authInfo(req)); 41 + let page = getFirstPage(' 오늘뭐먹지','아직도 먹는게<br>고민된다면..?',authInfo(req));
42 res.send(page); 42 res.send(page);
43 }); 43 });
44 44
...@@ -51,13 +51,18 @@ app.get('/main',(req,res)=>{ ...@@ -51,13 +51,18 @@ app.get('/main',(req,res)=>{
51 res.sendFile(__dirname+'/main/main.html') 51 res.sendFile(__dirname+'/main/main.html')
52 }) 52 })
53 53
54 +//youtube html
55 +app.use(express.static(__dirname + '/youtube'));
56 +
57 +
58 +
54 59
55 /*--------------------로그인 처리---------------------- */ 60 /*--------------------로그인 처리---------------------- */
56 61
57 //로그인 페이지 62 //로그인 페이지
58 app.get('/login',(req,res)=>{ 63 app.get('/login',(req,res)=>{
59 let page = getLoginButton(`<a href="/">뒤로가기</a>`); 64 let page = getLoginButton(`<a href="/">뒤로가기</a>`);
60 - res.send(page); 65 + res.send(page);
61 }); 66 });
62 67
63 68
...@@ -75,7 +80,7 @@ passport.use(new LocalStrategy({ ...@@ -75,7 +80,7 @@ passport.use(new LocalStrategy({
75 console.log(user); 80 console.log(user);
76 81
77 //아이디가 다를때 82 //아이디가 다를때
78 - if (id !== user.email){ 83 + if (id !== user.email){
79 //alert("존재하는 아이디가 없습니다.") 84 //alert("존재하는 아이디가 없습니다.")
80 return done(null, false, { message: '아이디가 다르다' });} 85 return done(null, false, { message: '아이디가 다르다' });}
81 //비밀번호가 다를때 86 //비밀번호가 다를때
...@@ -89,18 +94,18 @@ passport.use(new LocalStrategy({ ...@@ -89,18 +94,18 @@ passport.use(new LocalStrategy({
89 94
90 //로그인 처리 (Passport) 95 //로그인 처리 (Passport)
91 app.post('/login', 96 app.post('/login',
92 -passport.authenticate('local', { 97 +passport.authenticate('local', {
93 //성공시, 메인페이지 이동 98 //성공시, 메인페이지 이동
94 //실패시 로그인 페이지 이동 99 //실패시 로그인 페이지 이동
95 successRedirect: '/', 100 successRedirect: '/',
96 failureRedirect: '/login', 101 failureRedirect: '/login',
97 badRequestMessage : 'Missing username or password.', 102 badRequestMessage : 'Missing username or password.',
98 - failureFlash: true 103 + failureFlash: true
99 })); 104 }));
100 105
101 //로그 아웃 처리 106 //로그 아웃 처리
102 app.get('/logout',(req,res)=>{ 107 app.get('/logout',(req,res)=>{
103 - 108 +
104 //passport 정보 삭제 109 //passport 정보 삭제
105 req.logout(); 110 req.logout();
106 //서버측 세션 삭제 111 //서버측 세션 삭제
...@@ -124,20 +129,20 @@ const authInfo = (req)=>{ ...@@ -124,20 +129,20 @@ const authInfo = (req)=>{
124 // naver 로그인 129 // naver 로그인
125 app.get('/naverlogin', passport.authenticate('naver')); 130 app.get('/naverlogin', passport.authenticate('naver'));
126 passport.use('naver',new NaverStrategy({ 131 passport.use('naver',new NaverStrategy({
127 - clientID: 'CGVVomc0bhMhzfzbytK2', 132 + clientID: 'CGVVomc0bhMhzfzbytK2',
128 - clientSecret: 'XHylcjnZxG', 133 + clientSecret: 'XHylcjnZxG',
129 callbackURL: "http://localhost:3000/", 134 callbackURL: "http://localhost:3000/",
130 svcType: 0, 135 svcType: 0,
131 authType: 'reauthenticate' // enable re-authentication 136 authType: 'reauthenticate' // enable re-authentication
132 - }, 137 + },
133 - 138 +
134 - function(accessToken, refreshToken, profile, done) { 139 + function(accessToken, refreshToken, profile, done) {
135 var _profile = profile._json; 140 var _profile = profile._json;
136 console.log(_profile.id); 141 console.log(_profile.id);
137 console.log(_profile.properties.nickname); 142 console.log(_profile.properties.nickname);
138 - } 143 + }
139 )); 144 ));
140 - 145 +
141 146
142 // kakao 로그인 147 // kakao 로그인
143 app.get('/kakaologin', passport.authenticate('kakao-login')); 148 app.get('/kakaologin', passport.authenticate('kakao-login'));
...@@ -230,7 +235,7 @@ app.get('/join',(req,res)=>{ ...@@ -230,7 +235,7 @@ app.get('/join',(req,res)=>{
230 </style><link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> 235 </style><link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
231 <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> 236 <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
232 <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> 237 <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
233 - 238 +
234 </head> 239 </head>
235 240
236 <body> 241 <body>
...@@ -254,7 +259,7 @@ app.get('/join',(req,res)=>{ ...@@ -254,7 +259,7 @@ app.get('/join',(req,res)=>{
254 </button> 259 </button>
255 </form> 260 </form>
256 </html> 261 </html>
257 - 262 +
258 `,'<a href="/login">뒤로가기</a>'); 263 `,'<a href="/login">뒤로가기</a>');
259 res.send(page); 264 res.send(page);
260 }); 265 });
...@@ -371,7 +376,7 @@ const getLoginButton = (auth) =>{ ...@@ -371,7 +376,7 @@ const getLoginButton = (auth) =>{
371 <button type="submit" class="btn btn btn-primary"> 376 <button type="submit" class="btn btn btn-primary">
372 <a href="/join" style="color:white;text-decoration-line:none;"> 회원가입</a> 377 <a href="/join" style="color:white;text-decoration-line:none;"> 회원가입</a>
373 </form> 378 </form>
374 - 379 +
375 </div> 380 </div>
376 </div> 381 </div>
377 </div> 382 </div>
...@@ -380,8 +385,8 @@ const getLoginButton = (auth) =>{ ...@@ -380,8 +385,8 @@ const getLoginButton = (auth) =>{
380 <a href="/naverlogin" class="btn btn-block btn-lg btn-success btn_login">Naver</a> 385 <a href="/naverlogin" class="btn btn-block btn-lg btn-success btn_login">Naver</a>
381 <a href="/kakaologin" class="btn btn-block btn-lg btn-warning btn_login">KaKao</a> 386 <a href="/kakaologin" class="btn btn-block btn-lg btn-warning btn_login">KaKao</a>
382 </div> 387 </div>
383 - 388 +
384 - 389 +
385 </body> 390 </body>
386 </html> 391 </html>
387 `; 392 `;
...@@ -390,29 +395,148 @@ const getLoginButton = (auth) =>{ ...@@ -390,29 +395,148 @@ const getLoginButton = (auth) =>{
390 395
391 //첫 페이지 화면 396 //첫 페이지 화면
392 const getFirstPage =(title, content, auth) =>{ 397 const getFirstPage =(title, content, auth) =>{
393 - return ` 398 + return `
394 - <!DOCTYPE html> 399 + <!DOCTYPE html>
395 - <html lang="en"> 400 + <html lang="en">
396 - <head> 401 + <head>
397 - <meta charset="UTF-8"> 402 + <meta charset="UTF-8">
398 - <meta http-equiv="X-UA-Compatible" content="IE=edge"> 403 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
399 - <meta name="viewport" content="width=device-width, initial-scale=1.0"> 404 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
400 - <title>Passport Example</title> 405 + <title>Food_recipe_Info</title>
401 - </head> 406 + <style>
402 - <body> 407 + @import url(//fonts.googleapis.com/earlyaccess/nanumpenscript.css);
403 - ${auth} 408 + body{
404 - <h1>${title}</h1> 409 + height: 100vh;
405 - <p>${content}</p> 410 + background-image: url('https://images.unsplash.com/photo-1614548539924-5c1f205b3747?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80');
406 - <div> 411 + background-position: center;
407 - <input type="button" value="page move" onClick="movepage()"/> 412 + background-repeat: no-repeat;
408 - </div> 413 + background-size: cover;
409 - <script type="text/javascript"> 414 + background-attachment: scroll;
410 - function movepage(){ 415 + }
411 - location.href="main"; 416 +
412 - }</script> 417 + .hey {
413 - </body> 418 + position: relative;
414 - </html> 419 + left: 50%;
415 - `; 420 + top: 33%;
416 - 421 + transform: translate(-50%, -47%);
417 -} 422 + text-align: center;
418 - 423 + font-size: 8em;
424 + font-family: 'Nanum Pen Script', cursive;
425 + }
426 + p {
427 + position: relative;
428 + left: 50%;
429 + top: 31%;
430 + transform: translate(-50%, -47%);
431 + font-size: 4em;
432 + text-align: center;
433 + font-family: 'Nanum Pen Script', cursive;
434 + }
435 + div {
436 + position: relative;
437 + font-size: 1.3em;
438 + text-align: center;
439 + }
440 + .box1{
441 + position: relative;
442 + left: 50%;
443 + top: 40%;
444 + transform: translate(-50%, -50%);
445 + }
446 + .box2{
447 + position: absolute;
448 + left: 50%;
449 + top: 77%;
450 + transform: translate(-50%, -54%);
451 + }
452 + </style>
453 + <!-- Bootstrap cdn 설정 -->
454 +<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
455 +<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css">
456 +<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
457 +<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
458 +<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
459 +
460 + </head>
461 + <body>
462 + <!-- 네비게이션(nav) 컨트롤에 사요하는 드롭다운. -->
463 + <div style="margin:20px;">
464 + <nav id="navbar-example" class="navbar navbar-default navbar-static">
465 + <div class="container-fluid">
466 + <!-- 네비게이션(nav)의 기본 설정으로 모바일일 때, 메뉴 버튼이 나온다. -->
467 + <div class="navbar-header">
468 + <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".navbar-collapse">
469 + <span class="sr-only">Toggle navigation</span>
470 + <span class="icon-bar"></span>
471 + <span class="icon-bar"></span>
472 + <span class="icon-bar"></span>
473 + </button>
474 + <!-- 타이틀임. -->
475 + <a class="navbar-brand" href="#">카테고리</a>
476 + </div>
477 + <!-- 메뉴 설정 -->
478 + <div class="collapse navbar-collapse">
479 + <!-- 메뉴는 왼쪽으로 두개 설정 -->
480 + <ul class="nav navbar-nav">
481 +
482 + <li>
483 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">
484 + Asian Food
485 + <!-- 아래 화살표 -->
486 + <span class="caret"></span>
487 + </a>
488 + <ul class="dropdown-menu">
489 + <li><a href="Japan.html">Japanese Food</a></li>
490 + <li><a href="China.html">Chinese Food</a></li>
491 + <li><a href="Korea.html">Korean Food</a></li>
492 + </ul>
493 + </li>
494 +
495 + <li>
496 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">
497 + American Food
498 + <!-- 아래 화살표 -->
499 + <span class="caret"></span>
500 + </a>
501 + <ul class="dropdown-menu">
502 + <li><a href="America.html">US Food</a></li>
503 + <li><a href="Mexico.html">Mexican Food</a></li>
504 + </ul>
505 + </li>
506 + </ul>
507 + <!-- 메뉴를 오른쪽 정렬로 설정 가능 -->
508 + <ul class="nav navbar-nav navbar-right">
509 + <!-- 메뉴 이름은 Right!로 서브 옵션은 Test5와 Test6가 있다. -->
510 + <li>
511 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">
512 + European Food
513 + <!-- 아래 화살표 -->
514 + <span class="caret"></span>
515 + </a>
516 + <ul class="dropdown-menu">
517 + <li><a href="Italy.html">Italian Food</a></li>
518 + <li><a href="France.html">French Food</a></li>
519 +
520 + </ul>
521 + </li>
522 + </ul>
523 + </div>
524 + </div>
525 + </nav>
526 + </div>
527 + <div class="hey">${title}</div>
528 + <p>${content}</p>
529 + <div class="box1">
530 + ${auth}
531 + </div>
532 + <div class="box2">
533 + <input type="button" value="레시피 보러가기" onClick="movepage()"/>
534 + </div>
535 + <script type="text/javascript">
536 + function movepage(){
537 + location.href="main";
538 + }</script>
539 + </body>
540 + </html>
541 + `;
542 +}
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -69,4 +69,8 @@ section{ ...@@ -69,4 +69,8 @@ section{
69 font-size:4rem; 69 font-size:4rem;
70 color:black; 70 color:black;
71 margin-bottom:30px; 71 margin-bottom:30px;
72 +<<<<<<< HEAD
72 } 73 }
74 +=======
75 +}
76 +>>>>>>> feature/youtube
......
...@@ -30,4 +30,8 @@ ...@@ -30,4 +30,8 @@
30 <script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script> 30 <script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
31 <script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script> 31 <script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
32 </body> 32 </body>
33 +<<<<<<< HEAD
33 </html> 34 </html>
35 +=======
36 +</html>
37 +>>>>>>> feature/youtube
......
...@@ -1312,6 +1312,11 @@ ...@@ -1312,6 +1312,11 @@
1312 "node": "*" 1312 "node": "*"
1313 } 1313 }
1314 }, 1314 },
1315 + "node_modules/jquery": {
1316 + "version": "3.6.0",
1317 + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
1318 + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
1319 + },
1315 "node_modules/jsbn": { 1320 "node_modules/jsbn": {
1316 "version": "0.1.1", 1321 "version": "0.1.1",
1317 "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 1322 "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
......
This diff is collapsed. Click to expand it.
1 +Copyright OpenJS Foundation and other contributors, https://openjsf.org/
2 +
3 +Permission is hereby granted, free of charge, to any person obtaining
4 +a copy of this software and associated documentation files (the
5 +"Software"), to deal in the Software without restriction, including
6 +without limitation the rights to use, copy, modify, merge, publish,
7 +distribute, sublicense, and/or sell copies of the Software, and to
8 +permit persons to whom the Software is furnished to do so, subject to
9 +the following conditions:
10 +
11 +The above copyright notice and this permission notice shall be
12 +included in all copies or substantial portions of the Software.
13 +
14 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +# jQuery
2 +
3 +> jQuery is a fast, small, and feature-rich JavaScript library.
4 +
5 +For information on how to get started and how to use jQuery, please see [jQuery's documentation](https://api.jquery.com/).
6 +For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).
7 +
8 +If upgrading, please see the [blog post for 3.6.0](https://blog.jquery.com/2021/03/02/jquery-3-6-0-released/). This includes notable differences from the previous version and a more readable changelog.
9 +
10 +## Including jQuery
11 +
12 +Below are some of the most common ways to include jQuery.
13 +
14 +### Browser
15 +
16 +#### Script tag
17 +
18 +```html
19 +<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
20 +```
21 +
22 +#### Babel
23 +
24 +[Babel](https://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.
25 +
26 +```js
27 +import $ from "jquery";
28 +```
29 +
30 +#### Browserify/Webpack
31 +
32 +There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documentation. In the script, including jQuery will usually look like this...
33 +
34 +```js
35 +var $ = require( "jquery" );
36 +```
37 +
38 +#### AMD (Asynchronous Module Definition)
39 +
40 +AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](https://requirejs.org/docs/whyamd.html).
41 +
42 +```js
43 +define( [ "jquery" ], function( $ ) {
44 +
45 +} );
46 +```
47 +
48 +### Node
49 +
50 +To include jQuery in [Node](https://nodejs.org/), first install with npm.
51 +
52 +```sh
53 +npm install jquery
54 +```
55 +
56 +For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/jsdom/jsdom). This can be useful for testing purposes.
57 +
58 +```js
59 +const { JSDOM } = require( "jsdom" );
60 +const { window } = new JSDOM( "" );
61 +const $ = require( "jquery" )( window );
62 +```
1 +{
2 + "name": "jquery",
3 + "main": "dist/jquery.js",
4 + "license": "MIT",
5 + "ignore": [
6 + "package.json"
7 + ],
8 + "keywords": [
9 + "jquery",
10 + "javascript",
11 + "browser",
12 + "library"
13 + ]
14 +}
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 +Copyright JS Foundation and other contributors, https://js.foundation/
2 +
3 +This software consists of voluntary contributions made by many
4 +individuals. For exact contribution history, see the revision history
5 +available at https://github.com/jquery/sizzle
6 +
7 +The following license applies to all parts of this software except as
8 +documented below:
9 +
10 +====
11 +
12 +Permission is hereby granted, free of charge, to any person obtaining
13 +a copy of this software and associated documentation files (the
14 +"Software"), to deal in the Software without restriction, including
15 +without limitation the rights to use, copy, modify, merge, publish,
16 +distribute, sublicense, and/or sell copies of the Software, and to
17 +permit persons to whom the Software is furnished to do so, subject to
18 +the following conditions:
19 +
20 +The above copyright notice and this permission notice shall be
21 +included in all copies or substantial portions of the Software.
22 +
23 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 +
31 +====
32 +
33 +All files located in the node_modules and external directories are
34 +externally maintained libraries used by this software which have their
35 +own licenses; we recommend you read them, as their terms may differ from
36 +the terms above.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +{
2 + "name": "jquery",
3 + "title": "jQuery",
4 + "description": "JavaScript library for DOM operations",
5 + "version": "3.6.0",
6 + "main": "dist/jquery.js",
7 + "homepage": "https://jquery.com",
8 + "author": {
9 + "name": "OpenJS Foundation and other contributors",
10 + "url": "https://github.com/jquery/jquery/blob/3.6.0/AUTHORS.txt"
11 + },
12 + "repository": {
13 + "type": "git",
14 + "url": "https://github.com/jquery/jquery.git"
15 + },
16 + "keywords": [
17 + "jquery",
18 + "javascript",
19 + "browser",
20 + "library"
21 + ],
22 + "bugs": {
23 + "url": "https://github.com/jquery/jquery/issues"
24 + },
25 + "license": "MIT",
26 + "devDependencies": {
27 + "@babel/core": "7.3.3",
28 + "@babel/plugin-transform-for-of": "7.2.0",
29 + "commitplease": "3.2.0",
30 + "core-js": "2.6.5",
31 + "eslint-config-jquery": "3.0.0",
32 + "grunt": "1.3.0",
33 + "grunt-babel": "8.0.0",
34 + "grunt-cli": "1.3.2",
35 + "grunt-compare-size": "0.4.2",
36 + "grunt-contrib-uglify": "3.4.0",
37 + "grunt-contrib-watch": "1.1.0",
38 + "grunt-eslint": "22.0.0",
39 + "grunt-git-authors": "3.2.0",
40 + "grunt-jsonlint": "1.1.0",
41 + "grunt-karma": "4.0.0",
42 + "grunt-newer": "1.3.0",
43 + "grunt-npmcopy": "0.2.0",
44 + "gzip-js": "0.3.2",
45 + "husky": "1.3.1",
46 + "insight": "0.10.1",
47 + "jsdom": "13.2.0",
48 + "karma": "5.2.3",
49 + "karma-browserstack-launcher": "1.4.0",
50 + "karma-chrome-launcher": "2.2.0",
51 + "karma-firefox-launcher": "1.1.0",
52 + "karma-ie-launcher": "1.0.0",
53 + "karma-jsdom-launcher": "8.0.2",
54 + "karma-qunit": "3.0.0",
55 + "load-grunt-tasks": "5.1.0",
56 + "native-promise-only": "0.8.1",
57 + "promises-aplus-tests": "2.1.2",
58 + "q": "1.5.1",
59 + "qunit": "2.9.2",
60 + "raw-body": "2.3.3",
61 + "requirejs": "2.3.6",
62 + "sinon": "2.3.7",
63 + "sizzle": "2.3.6",
64 + "strip-json-comments": "2.0.1",
65 + "testswarm": "1.1.2",
66 + "uglify-js": "3.4.7"
67 + },
68 + "scripts": {
69 + "build": "npm install && grunt",
70 + "start": "grunt watch",
71 + "test:browserless": "grunt && grunt test:slow",
72 + "test:browser": "grunt && grunt karma:main",
73 + "test:amd": "grunt && grunt karma:amd",
74 + "test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main",
75 + "test:no-sizzle": "grunt test:prepare && grunt custom:-sizzle && grunt karma:main",
76 + "test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main",
77 + "test": "npm run test:slim && npm run test:no-deprecated && npm run test:no-sizzle && grunt && grunt test:slow && grunt karma:main && grunt karma:amd",
78 + "jenkins": "npm run test:browserless"
79 + },
80 + "commitplease": {
81 + "nohook": true,
82 + "components": [
83 + "Docs",
84 + "Tests",
85 + "Build",
86 + "Support",
87 + "Release",
88 + "Core",
89 + "Ajax",
90 + "Attributes",
91 + "Callbacks",
92 + "CSS",
93 + "Data",
94 + "Deferred",
95 + "Deprecated",
96 + "Dimensions",
97 + "Effects",
98 + "Event",
99 + "Manipulation",
100 + "Offset",
101 + "Queue",
102 + "Selector",
103 + "Serialize",
104 + "Traversing",
105 + "Wrap"
106 + ],
107 + "markerPattern": "^((clos|fix|resolv)(e[sd]|ing))|^(refs?)",
108 + "ticketPattern": "^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])"
109 + },
110 + "husky": {
111 + "hooks": {
112 + "commit-msg": "commitplease .git/COMMIT_EDITMSG",
113 + "pre-commit": "grunt lint:newer qunit_fixture"
114 + }
115 + }
116 +}
This diff is collapsed. Click to expand it.
1 +define( [
2 + "../core",
3 + "../var/isFunction",
4 + "./var/nonce",
5 + "./var/rquery",
6 + "../ajax"
7 +], function( jQuery, isFunction, nonce, rquery ) {
8 +
9 +"use strict";
10 +
11 +var oldCallbacks = [],
12 + rjsonp = /(=)\?(?=&|$)|\?\?/;
13 +
14 +// Default jsonp settings
15 +jQuery.ajaxSetup( {
16 + jsonp: "callback",
17 + jsonpCallback: function() {
18 + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
19 + this[ callback ] = true;
20 + return callback;
21 + }
22 +} );
23 +
24 +// Detect, normalize options and install callbacks for jsonp requests
25 +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
26 +
27 + var callbackName, overwritten, responseContainer,
28 + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
29 + "url" :
30 + typeof s.data === "string" &&
31 + ( s.contentType || "" )
32 + .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
33 + rjsonp.test( s.data ) && "data"
34 + );
35 +
36 + // Handle iff the expected data type is "jsonp" or we have a parameter to set
37 + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
38 +
39 + // Get callback name, remembering preexisting value associated with it
40 + callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
41 + s.jsonpCallback() :
42 + s.jsonpCallback;
43 +
44 + // Insert callback into url or form data
45 + if ( jsonProp ) {
46 + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
47 + } else if ( s.jsonp !== false ) {
48 + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
49 + }
50 +
51 + // Use data converter to retrieve json after script execution
52 + s.converters[ "script json" ] = function() {
53 + if ( !responseContainer ) {
54 + jQuery.error( callbackName + " was not called" );
55 + }
56 + return responseContainer[ 0 ];
57 + };
58 +
59 + // Force json dataType
60 + s.dataTypes[ 0 ] = "json";
61 +
62 + // Install callback
63 + overwritten = window[ callbackName ];
64 + window[ callbackName ] = function() {
65 + responseContainer = arguments;
66 + };
67 +
68 + // Clean-up function (fires after converters)
69 + jqXHR.always( function() {
70 +
71 + // If previous value didn't exist - remove it
72 + if ( overwritten === undefined ) {
73 + jQuery( window ).removeProp( callbackName );
74 +
75 + // Otherwise restore preexisting value
76 + } else {
77 + window[ callbackName ] = overwritten;
78 + }
79 +
80 + // Save back as free
81 + if ( s[ callbackName ] ) {
82 +
83 + // Make sure that re-using the options doesn't screw things around
84 + s.jsonpCallback = originalSettings.jsonpCallback;
85 +
86 + // Save the callback name for future use
87 + oldCallbacks.push( callbackName );
88 + }
89 +
90 + // Call if it was a function and we have a response
91 + if ( responseContainer && isFunction( overwritten ) ) {
92 + overwritten( responseContainer[ 0 ] );
93 + }
94 +
95 + responseContainer = overwritten = undefined;
96 + } );
97 +
98 + // Delegate to script
99 + return "script";
100 + }
101 +} );
102 +
103 +} );
1 +define( [
2 + "../core",
3 + "../core/stripAndCollapse",
4 + "../var/isFunction",
5 + "../core/parseHTML",
6 + "../ajax",
7 + "../traversing",
8 + "../manipulation",
9 + "../selector"
10 +], function( jQuery, stripAndCollapse, isFunction ) {
11 +
12 +"use strict";
13 +
14 +/**
15 + * Load a url into a page
16 + */
17 +jQuery.fn.load = function( url, params, callback ) {
18 + var selector, type, response,
19 + self = this,
20 + off = url.indexOf( " " );
21 +
22 + if ( off > -1 ) {
23 + selector = stripAndCollapse( url.slice( off ) );
24 + url = url.slice( 0, off );
25 + }
26 +
27 + // If it's a function
28 + if ( isFunction( params ) ) {
29 +
30 + // We assume that it's the callback
31 + callback = params;
32 + params = undefined;
33 +
34 + // Otherwise, build a param string
35 + } else if ( params && typeof params === "object" ) {
36 + type = "POST";
37 + }
38 +
39 + // If we have elements to modify, make the request
40 + if ( self.length > 0 ) {
41 + jQuery.ajax( {
42 + url: url,
43 +
44 + // If "type" variable is undefined, then "GET" method will be used.
45 + // Make value of this field explicit since
46 + // user can override it through ajaxSetup method
47 + type: type || "GET",
48 + dataType: "html",
49 + data: params
50 + } ).done( function( responseText ) {
51 +
52 + // Save response for use in complete callback
53 + response = arguments;
54 +
55 + self.html( selector ?
56 +
57 + // If a selector was specified, locate the right elements in a dummy div
58 + // Exclude scripts to avoid IE 'Permission Denied' errors
59 + jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
60 +
61 + // Otherwise use the full result
62 + responseText );
63 +
64 + // If the request succeeds, this function gets "data", "status", "jqXHR"
65 + // but they are ignored because response was set above.
66 + // If it fails, this function gets "jqXHR", "status", "error"
67 + } ).always( callback && function( jqXHR, status ) {
68 + self.each( function() {
69 + callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
70 + } );
71 + } );
72 + }
73 +
74 + return this;
75 +};
76 +
77 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "../ajax"
5 +], function( jQuery, document ) {
6 +
7 +"use strict";
8 +
9 +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
10 +jQuery.ajaxPrefilter( function( s ) {
11 + if ( s.crossDomain ) {
12 + s.contents.script = false;
13 + }
14 +} );
15 +
16 +// Install script dataType
17 +jQuery.ajaxSetup( {
18 + accepts: {
19 + script: "text/javascript, application/javascript, " +
20 + "application/ecmascript, application/x-ecmascript"
21 + },
22 + contents: {
23 + script: /\b(?:java|ecma)script\b/
24 + },
25 + converters: {
26 + "text script": function( text ) {
27 + jQuery.globalEval( text );
28 + return text;
29 + }
30 + }
31 +} );
32 +
33 +// Handle cache's special case and crossDomain
34 +jQuery.ajaxPrefilter( "script", function( s ) {
35 + if ( s.cache === undefined ) {
36 + s.cache = false;
37 + }
38 + if ( s.crossDomain ) {
39 + s.type = "GET";
40 + }
41 +} );
42 +
43 +// Bind script tag hack transport
44 +jQuery.ajaxTransport( "script", function( s ) {
45 +
46 + // This transport only deals with cross domain or forced-by-attrs requests
47 + if ( s.crossDomain || s.scriptAttrs ) {
48 + var script, callback;
49 + return {
50 + send: function( _, complete ) {
51 + script = jQuery( "<script>" )
52 + .attr( s.scriptAttrs || {} )
53 + .prop( { charset: s.scriptCharset, src: s.url } )
54 + .on( "load error", callback = function( evt ) {
55 + script.remove();
56 + callback = null;
57 + if ( evt ) {
58 + complete( evt.type === "error" ? 404 : 200, evt.type );
59 + }
60 + } );
61 +
62 + // Use native DOM manipulation to avoid our domManip AJAX trickery
63 + document.head.appendChild( script[ 0 ] );
64 + },
65 + abort: function() {
66 + if ( callback ) {
67 + callback();
68 + }
69 + }
70 + };
71 + }
72 +} );
73 +
74 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + return window.location;
5 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + return { guid: Date.now() };
5 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + return ( /\?/ );
5 +} );
1 +define( [
2 + "../core",
3 + "../var/support",
4 + "../ajax"
5 +], function( jQuery, support ) {
6 +
7 +"use strict";
8 +
9 +jQuery.ajaxSettings.xhr = function() {
10 + try {
11 + return new window.XMLHttpRequest();
12 + } catch ( e ) {}
13 +};
14 +
15 +var xhrSuccessStatus = {
16 +
17 + // File protocol always yields status code 0, assume 200
18 + 0: 200,
19 +
20 + // Support: IE <=9 only
21 + // #1450: sometimes IE returns 1223 when it should be 204
22 + 1223: 204
23 + },
24 + xhrSupported = jQuery.ajaxSettings.xhr();
25 +
26 +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
27 +support.ajax = xhrSupported = !!xhrSupported;
28 +
29 +jQuery.ajaxTransport( function( options ) {
30 + var callback, errorCallback;
31 +
32 + // Cross domain only allowed if supported through XMLHttpRequest
33 + if ( support.cors || xhrSupported && !options.crossDomain ) {
34 + return {
35 + send: function( headers, complete ) {
36 + var i,
37 + xhr = options.xhr();
38 +
39 + xhr.open(
40 + options.type,
41 + options.url,
42 + options.async,
43 + options.username,
44 + options.password
45 + );
46 +
47 + // Apply custom fields if provided
48 + if ( options.xhrFields ) {
49 + for ( i in options.xhrFields ) {
50 + xhr[ i ] = options.xhrFields[ i ];
51 + }
52 + }
53 +
54 + // Override mime type if needed
55 + if ( options.mimeType && xhr.overrideMimeType ) {
56 + xhr.overrideMimeType( options.mimeType );
57 + }
58 +
59 + // X-Requested-With header
60 + // For cross-domain requests, seeing as conditions for a preflight are
61 + // akin to a jigsaw puzzle, we simply never set it to be sure.
62 + // (it can always be set on a per-request basis or even using ajaxSetup)
63 + // For same-domain requests, won't change header if already provided.
64 + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
65 + headers[ "X-Requested-With" ] = "XMLHttpRequest";
66 + }
67 +
68 + // Set headers
69 + for ( i in headers ) {
70 + xhr.setRequestHeader( i, headers[ i ] );
71 + }
72 +
73 + // Callback
74 + callback = function( type ) {
75 + return function() {
76 + if ( callback ) {
77 + callback = errorCallback = xhr.onload =
78 + xhr.onerror = xhr.onabort = xhr.ontimeout =
79 + xhr.onreadystatechange = null;
80 +
81 + if ( type === "abort" ) {
82 + xhr.abort();
83 + } else if ( type === "error" ) {
84 +
85 + // Support: IE <=9 only
86 + // On a manual native abort, IE9 throws
87 + // errors on any property access that is not readyState
88 + if ( typeof xhr.status !== "number" ) {
89 + complete( 0, "error" );
90 + } else {
91 + complete(
92 +
93 + // File: protocol always yields status 0; see #8605, #14207
94 + xhr.status,
95 + xhr.statusText
96 + );
97 + }
98 + } else {
99 + complete(
100 + xhrSuccessStatus[ xhr.status ] || xhr.status,
101 + xhr.statusText,
102 +
103 + // Support: IE <=9 only
104 + // IE9 has no XHR2 but throws on binary (trac-11426)
105 + // For XHR2 non-text, let the caller handle it (gh-2498)
106 + ( xhr.responseType || "text" ) !== "text" ||
107 + typeof xhr.responseText !== "string" ?
108 + { binary: xhr.response } :
109 + { text: xhr.responseText },
110 + xhr.getAllResponseHeaders()
111 + );
112 + }
113 + }
114 + };
115 + };
116 +
117 + // Listen to events
118 + xhr.onload = callback();
119 + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
120 +
121 + // Support: IE 9 only
122 + // Use onreadystatechange to replace onabort
123 + // to handle uncaught aborts
124 + if ( xhr.onabort !== undefined ) {
125 + xhr.onabort = errorCallback;
126 + } else {
127 + xhr.onreadystatechange = function() {
128 +
129 + // Check readyState before timeout as it changes
130 + if ( xhr.readyState === 4 ) {
131 +
132 + // Allow onerror to be called first,
133 + // but that will not handle a native abort
134 + // Also, save errorCallback to a variable
135 + // as xhr.onerror cannot be accessed
136 + window.setTimeout( function() {
137 + if ( callback ) {
138 + errorCallback();
139 + }
140 + } );
141 + }
142 + };
143 + }
144 +
145 + // Create the abort callback
146 + callback = callback( "abort" );
147 +
148 + try {
149 +
150 + // Do send the request (this may raise an exception)
151 + xhr.send( options.hasContent && options.data || null );
152 + } catch ( e ) {
153 +
154 + // #14683: Only rethrow if this hasn't been notified as an error yet
155 + if ( callback ) {
156 + throw e;
157 + }
158 + }
159 + },
160 +
161 + abort: function() {
162 + if ( callback ) {
163 + callback();
164 + }
165 + }
166 + };
167 + }
168 +} );
169 +
170 +} );
1 +define( [
2 + "./core",
3 + "./attributes/attr",
4 + "./attributes/prop",
5 + "./attributes/classes",
6 + "./attributes/val"
7 +], function( jQuery ) {
8 +
9 +"use strict";
10 +
11 +// Return jQuery for attributes-only inclusion
12 +return jQuery;
13 +} );
1 +define( [
2 + "../core",
3 + "../core/access",
4 + "../core/nodeName",
5 + "./support",
6 + "../var/rnothtmlwhite",
7 + "../selector"
8 +], function( jQuery, access, nodeName, support, rnothtmlwhite ) {
9 +
10 +"use strict";
11 +
12 +var boolHook,
13 + attrHandle = jQuery.expr.attrHandle;
14 +
15 +jQuery.fn.extend( {
16 + attr: function( name, value ) {
17 + return access( this, jQuery.attr, name, value, arguments.length > 1 );
18 + },
19 +
20 + removeAttr: function( name ) {
21 + return this.each( function() {
22 + jQuery.removeAttr( this, name );
23 + } );
24 + }
25 +} );
26 +
27 +jQuery.extend( {
28 + attr: function( elem, name, value ) {
29 + var ret, hooks,
30 + nType = elem.nodeType;
31 +
32 + // Don't get/set attributes on text, comment and attribute nodes
33 + if ( nType === 3 || nType === 8 || nType === 2 ) {
34 + return;
35 + }
36 +
37 + // Fallback to prop when attributes are not supported
38 + if ( typeof elem.getAttribute === "undefined" ) {
39 + return jQuery.prop( elem, name, value );
40 + }
41 +
42 + // Attribute hooks are determined by the lowercase version
43 + // Grab necessary hook if one is defined
44 + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
45 + hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
46 + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
47 + }
48 +
49 + if ( value !== undefined ) {
50 + if ( value === null ) {
51 + jQuery.removeAttr( elem, name );
52 + return;
53 + }
54 +
55 + if ( hooks && "set" in hooks &&
56 + ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
57 + return ret;
58 + }
59 +
60 + elem.setAttribute( name, value + "" );
61 + return value;
62 + }
63 +
64 + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
65 + return ret;
66 + }
67 +
68 + ret = jQuery.find.attr( elem, name );
69 +
70 + // Non-existent attributes return null, we normalize to undefined
71 + return ret == null ? undefined : ret;
72 + },
73 +
74 + attrHooks: {
75 + type: {
76 + set: function( elem, value ) {
77 + if ( !support.radioValue && value === "radio" &&
78 + nodeName( elem, "input" ) ) {
79 + var val = elem.value;
80 + elem.setAttribute( "type", value );
81 + if ( val ) {
82 + elem.value = val;
83 + }
84 + return value;
85 + }
86 + }
87 + }
88 + },
89 +
90 + removeAttr: function( elem, value ) {
91 + var name,
92 + i = 0,
93 +
94 + // Attribute names can contain non-HTML whitespace characters
95 + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
96 + attrNames = value && value.match( rnothtmlwhite );
97 +
98 + if ( attrNames && elem.nodeType === 1 ) {
99 + while ( ( name = attrNames[ i++ ] ) ) {
100 + elem.removeAttribute( name );
101 + }
102 + }
103 + }
104 +} );
105 +
106 +// Hooks for boolean attributes
107 +boolHook = {
108 + set: function( elem, value, name ) {
109 + if ( value === false ) {
110 +
111 + // Remove boolean attributes when set to false
112 + jQuery.removeAttr( elem, name );
113 + } else {
114 + elem.setAttribute( name, name );
115 + }
116 + return name;
117 + }
118 +};
119 +
120 +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
121 + var getter = attrHandle[ name ] || jQuery.find.attr;
122 +
123 + attrHandle[ name ] = function( elem, name, isXML ) {
124 + var ret, handle,
125 + lowercaseName = name.toLowerCase();
126 +
127 + if ( !isXML ) {
128 +
129 + // Avoid an infinite loop by temporarily removing this function from the getter
130 + handle = attrHandle[ lowercaseName ];
131 + attrHandle[ lowercaseName ] = ret;
132 + ret = getter( elem, name, isXML ) != null ?
133 + lowercaseName :
134 + null;
135 + attrHandle[ lowercaseName ] = handle;
136 + }
137 + return ret;
138 + };
139 +} );
140 +
141 +} );
1 +define( [
2 + "../core",
3 + "../core/stripAndCollapse",
4 + "../var/isFunction",
5 + "../var/rnothtmlwhite",
6 + "../data/var/dataPriv",
7 + "../core/init"
8 +], function( jQuery, stripAndCollapse, isFunction, rnothtmlwhite, dataPriv ) {
9 +
10 +"use strict";
11 +
12 +function getClass( elem ) {
13 + return elem.getAttribute && elem.getAttribute( "class" ) || "";
14 +}
15 +
16 +function classesToArray( value ) {
17 + if ( Array.isArray( value ) ) {
18 + return value;
19 + }
20 + if ( typeof value === "string" ) {
21 + return value.match( rnothtmlwhite ) || [];
22 + }
23 + return [];
24 +}
25 +
26 +jQuery.fn.extend( {
27 + addClass: function( value ) {
28 + var classes, elem, cur, curValue, clazz, j, finalValue,
29 + i = 0;
30 +
31 + if ( isFunction( value ) ) {
32 + return this.each( function( j ) {
33 + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
34 + } );
35 + }
36 +
37 + classes = classesToArray( value );
38 +
39 + if ( classes.length ) {
40 + while ( ( elem = this[ i++ ] ) ) {
41 + curValue = getClass( elem );
42 + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
43 +
44 + if ( cur ) {
45 + j = 0;
46 + while ( ( clazz = classes[ j++ ] ) ) {
47 + if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
48 + cur += clazz + " ";
49 + }
50 + }
51 +
52 + // Only assign if different to avoid unneeded rendering.
53 + finalValue = stripAndCollapse( cur );
54 + if ( curValue !== finalValue ) {
55 + elem.setAttribute( "class", finalValue );
56 + }
57 + }
58 + }
59 + }
60 +
61 + return this;
62 + },
63 +
64 + removeClass: function( value ) {
65 + var classes, elem, cur, curValue, clazz, j, finalValue,
66 + i = 0;
67 +
68 + if ( isFunction( value ) ) {
69 + return this.each( function( j ) {
70 + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
71 + } );
72 + }
73 +
74 + if ( !arguments.length ) {
75 + return this.attr( "class", "" );
76 + }
77 +
78 + classes = classesToArray( value );
79 +
80 + if ( classes.length ) {
81 + while ( ( elem = this[ i++ ] ) ) {
82 + curValue = getClass( elem );
83 +
84 + // This expression is here for better compressibility (see addClass)
85 + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
86 +
87 + if ( cur ) {
88 + j = 0;
89 + while ( ( clazz = classes[ j++ ] ) ) {
90 +
91 + // Remove *all* instances
92 + while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
93 + cur = cur.replace( " " + clazz + " ", " " );
94 + }
95 + }
96 +
97 + // Only assign if different to avoid unneeded rendering.
98 + finalValue = stripAndCollapse( cur );
99 + if ( curValue !== finalValue ) {
100 + elem.setAttribute( "class", finalValue );
101 + }
102 + }
103 + }
104 + }
105 +
106 + return this;
107 + },
108 +
109 + toggleClass: function( value, stateVal ) {
110 + var type = typeof value,
111 + isValidValue = type === "string" || Array.isArray( value );
112 +
113 + if ( typeof stateVal === "boolean" && isValidValue ) {
114 + return stateVal ? this.addClass( value ) : this.removeClass( value );
115 + }
116 +
117 + if ( isFunction( value ) ) {
118 + return this.each( function( i ) {
119 + jQuery( this ).toggleClass(
120 + value.call( this, i, getClass( this ), stateVal ),
121 + stateVal
122 + );
123 + } );
124 + }
125 +
126 + return this.each( function() {
127 + var className, i, self, classNames;
128 +
129 + if ( isValidValue ) {
130 +
131 + // Toggle individual class names
132 + i = 0;
133 + self = jQuery( this );
134 + classNames = classesToArray( value );
135 +
136 + while ( ( className = classNames[ i++ ] ) ) {
137 +
138 + // Check each className given, space separated list
139 + if ( self.hasClass( className ) ) {
140 + self.removeClass( className );
141 + } else {
142 + self.addClass( className );
143 + }
144 + }
145 +
146 + // Toggle whole class name
147 + } else if ( value === undefined || type === "boolean" ) {
148 + className = getClass( this );
149 + if ( className ) {
150 +
151 + // Store className if set
152 + dataPriv.set( this, "__className__", className );
153 + }
154 +
155 + // If the element has a class name or if we're passed `false`,
156 + // then remove the whole classname (if there was one, the above saved it).
157 + // Otherwise bring back whatever was previously saved (if anything),
158 + // falling back to the empty string if nothing was stored.
159 + if ( this.setAttribute ) {
160 + this.setAttribute( "class",
161 + className || value === false ?
162 + "" :
163 + dataPriv.get( this, "__className__" ) || ""
164 + );
165 + }
166 + }
167 + } );
168 + },
169 +
170 + hasClass: function( selector ) {
171 + var className, elem,
172 + i = 0;
173 +
174 + className = " " + selector + " ";
175 + while ( ( elem = this[ i++ ] ) ) {
176 + if ( elem.nodeType === 1 &&
177 + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
178 + return true;
179 + }
180 + }
181 +
182 + return false;
183 + }
184 +} );
185 +
186 +} );
1 +define( [
2 + "../core",
3 + "../core/access",
4 + "./support",
5 + "../selector"
6 +], function( jQuery, access, support ) {
7 +
8 +"use strict";
9 +
10 +var rfocusable = /^(?:input|select|textarea|button)$/i,
11 + rclickable = /^(?:a|area)$/i;
12 +
13 +jQuery.fn.extend( {
14 + prop: function( name, value ) {
15 + return access( this, jQuery.prop, name, value, arguments.length > 1 );
16 + },
17 +
18 + removeProp: function( name ) {
19 + return this.each( function() {
20 + delete this[ jQuery.propFix[ name ] || name ];
21 + } );
22 + }
23 +} );
24 +
25 +jQuery.extend( {
26 + prop: function( elem, name, value ) {
27 + var ret, hooks,
28 + nType = elem.nodeType;
29 +
30 + // Don't get/set properties on text, comment and attribute nodes
31 + if ( nType === 3 || nType === 8 || nType === 2 ) {
32 + return;
33 + }
34 +
35 + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
36 +
37 + // Fix name and attach hooks
38 + name = jQuery.propFix[ name ] || name;
39 + hooks = jQuery.propHooks[ name ];
40 + }
41 +
42 + if ( value !== undefined ) {
43 + if ( hooks && "set" in hooks &&
44 + ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
45 + return ret;
46 + }
47 +
48 + return ( elem[ name ] = value );
49 + }
50 +
51 + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
52 + return ret;
53 + }
54 +
55 + return elem[ name ];
56 + },
57 +
58 + propHooks: {
59 + tabIndex: {
60 + get: function( elem ) {
61 +
62 + // Support: IE <=9 - 11 only
63 + // elem.tabIndex doesn't always return the
64 + // correct value when it hasn't been explicitly set
65 + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
66 + // Use proper attribute retrieval(#12072)
67 + var tabindex = jQuery.find.attr( elem, "tabindex" );
68 +
69 + if ( tabindex ) {
70 + return parseInt( tabindex, 10 );
71 + }
72 +
73 + if (
74 + rfocusable.test( elem.nodeName ) ||
75 + rclickable.test( elem.nodeName ) &&
76 + elem.href
77 + ) {
78 + return 0;
79 + }
80 +
81 + return -1;
82 + }
83 + }
84 + },
85 +
86 + propFix: {
87 + "for": "htmlFor",
88 + "class": "className"
89 + }
90 +} );
91 +
92 +// Support: IE <=11 only
93 +// Accessing the selectedIndex property
94 +// forces the browser to respect setting selected
95 +// on the option
96 +// The getter ensures a default option is selected
97 +// when in an optgroup
98 +// eslint rule "no-unused-expressions" is disabled for this code
99 +// since it considers such accessions noop
100 +if ( !support.optSelected ) {
101 + jQuery.propHooks.selected = {
102 + get: function( elem ) {
103 +
104 + /* eslint no-unused-expressions: "off" */
105 +
106 + var parent = elem.parentNode;
107 + if ( parent && parent.parentNode ) {
108 + parent.parentNode.selectedIndex;
109 + }
110 + return null;
111 + },
112 + set: function( elem ) {
113 +
114 + /* eslint no-unused-expressions: "off" */
115 +
116 + var parent = elem.parentNode;
117 + if ( parent ) {
118 + parent.selectedIndex;
119 +
120 + if ( parent.parentNode ) {
121 + parent.parentNode.selectedIndex;
122 + }
123 + }
124 + }
125 + };
126 +}
127 +
128 +jQuery.each( [
129 + "tabIndex",
130 + "readOnly",
131 + "maxLength",
132 + "cellSpacing",
133 + "cellPadding",
134 + "rowSpan",
135 + "colSpan",
136 + "useMap",
137 + "frameBorder",
138 + "contentEditable"
139 +], function() {
140 + jQuery.propFix[ this.toLowerCase() ] = this;
141 +} );
142 +
143 +} );
1 +define( [
2 + "../var/document",
3 + "../var/support"
4 +], function( document, support ) {
5 +
6 +"use strict";
7 +
8 +( function() {
9 + var input = document.createElement( "input" ),
10 + select = document.createElement( "select" ),
11 + opt = select.appendChild( document.createElement( "option" ) );
12 +
13 + input.type = "checkbox";
14 +
15 + // Support: Android <=4.3 only
16 + // Default value for a checkbox should be "on"
17 + support.checkOn = input.value !== "";
18 +
19 + // Support: IE <=11 only
20 + // Must access selectedIndex to make default options select
21 + support.optSelected = opt.selected;
22 +
23 + // Support: IE <=11 only
24 + // An input loses its value after becoming a radio
25 + input = document.createElement( "input" );
26 + input.value = "t";
27 + input.type = "radio";
28 + support.radioValue = input.value === "t";
29 +} )();
30 +
31 +return support;
32 +
33 +} );
1 +define( [
2 + "../core",
3 + "../core/stripAndCollapse",
4 + "./support",
5 + "../core/nodeName",
6 + "../var/isFunction",
7 +
8 + "../core/init"
9 +], function( jQuery, stripAndCollapse, support, nodeName, isFunction ) {
10 +
11 +"use strict";
12 +
13 +var rreturn = /\r/g;
14 +
15 +jQuery.fn.extend( {
16 + val: function( value ) {
17 + var hooks, ret, valueIsFunction,
18 + elem = this[ 0 ];
19 +
20 + if ( !arguments.length ) {
21 + if ( elem ) {
22 + hooks = jQuery.valHooks[ elem.type ] ||
23 + jQuery.valHooks[ elem.nodeName.toLowerCase() ];
24 +
25 + if ( hooks &&
26 + "get" in hooks &&
27 + ( ret = hooks.get( elem, "value" ) ) !== undefined
28 + ) {
29 + return ret;
30 + }
31 +
32 + ret = elem.value;
33 +
34 + // Handle most common string cases
35 + if ( typeof ret === "string" ) {
36 + return ret.replace( rreturn, "" );
37 + }
38 +
39 + // Handle cases where value is null/undef or number
40 + return ret == null ? "" : ret;
41 + }
42 +
43 + return;
44 + }
45 +
46 + valueIsFunction = isFunction( value );
47 +
48 + return this.each( function( i ) {
49 + var val;
50 +
51 + if ( this.nodeType !== 1 ) {
52 + return;
53 + }
54 +
55 + if ( valueIsFunction ) {
56 + val = value.call( this, i, jQuery( this ).val() );
57 + } else {
58 + val = value;
59 + }
60 +
61 + // Treat null/undefined as ""; convert numbers to string
62 + if ( val == null ) {
63 + val = "";
64 +
65 + } else if ( typeof val === "number" ) {
66 + val += "";
67 +
68 + } else if ( Array.isArray( val ) ) {
69 + val = jQuery.map( val, function( value ) {
70 + return value == null ? "" : value + "";
71 + } );
72 + }
73 +
74 + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
75 +
76 + // If set returns undefined, fall back to normal setting
77 + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
78 + this.value = val;
79 + }
80 + } );
81 + }
82 +} );
83 +
84 +jQuery.extend( {
85 + valHooks: {
86 + option: {
87 + get: function( elem ) {
88 +
89 + var val = jQuery.find.attr( elem, "value" );
90 + return val != null ?
91 + val :
92 +
93 + // Support: IE <=10 - 11 only
94 + // option.text throws exceptions (#14686, #14858)
95 + // Strip and collapse whitespace
96 + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
97 + stripAndCollapse( jQuery.text( elem ) );
98 + }
99 + },
100 + select: {
101 + get: function( elem ) {
102 + var value, option, i,
103 + options = elem.options,
104 + index = elem.selectedIndex,
105 + one = elem.type === "select-one",
106 + values = one ? null : [],
107 + max = one ? index + 1 : options.length;
108 +
109 + if ( index < 0 ) {
110 + i = max;
111 +
112 + } else {
113 + i = one ? index : 0;
114 + }
115 +
116 + // Loop through all the selected options
117 + for ( ; i < max; i++ ) {
118 + option = options[ i ];
119 +
120 + // Support: IE <=9 only
121 + // IE8-9 doesn't update selected after form reset (#2551)
122 + if ( ( option.selected || i === index ) &&
123 +
124 + // Don't return options that are disabled or in a disabled optgroup
125 + !option.disabled &&
126 + ( !option.parentNode.disabled ||
127 + !nodeName( option.parentNode, "optgroup" ) ) ) {
128 +
129 + // Get the specific value for the option
130 + value = jQuery( option ).val();
131 +
132 + // We don't need an array for one selects
133 + if ( one ) {
134 + return value;
135 + }
136 +
137 + // Multi-Selects return an array
138 + values.push( value );
139 + }
140 + }
141 +
142 + return values;
143 + },
144 +
145 + set: function( elem, value ) {
146 + var optionSet, option,
147 + options = elem.options,
148 + values = jQuery.makeArray( value ),
149 + i = options.length;
150 +
151 + while ( i-- ) {
152 + option = options[ i ];
153 +
154 + /* eslint-disable no-cond-assign */
155 +
156 + if ( option.selected =
157 + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
158 + ) {
159 + optionSet = true;
160 + }
161 +
162 + /* eslint-enable no-cond-assign */
163 + }
164 +
165 + // Force browsers to behave consistently when non-matching value is set
166 + if ( !optionSet ) {
167 + elem.selectedIndex = -1;
168 + }
169 + return values;
170 + }
171 + }
172 + }
173 +} );
174 +
175 +// Radios and checkboxes getter/setter
176 +jQuery.each( [ "radio", "checkbox" ], function() {
177 + jQuery.valHooks[ this ] = {
178 + set: function( elem, value ) {
179 + if ( Array.isArray( value ) ) {
180 + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
181 + }
182 + }
183 + };
184 + if ( !support.checkOn ) {
185 + jQuery.valHooks[ this ].get = function( elem ) {
186 + return elem.getAttribute( "value" ) === null ? "on" : elem.value;
187 + };
188 + }
189 +} );
190 +
191 +} );
1 +define( [
2 + "./core",
3 + "./core/toType",
4 + "./var/isFunction",
5 + "./var/rnothtmlwhite"
6 +], function( jQuery, toType, isFunction, rnothtmlwhite ) {
7 +
8 +"use strict";
9 +
10 +// Convert String-formatted options into Object-formatted ones
11 +function createOptions( options ) {
12 + var object = {};
13 + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
14 + object[ flag ] = true;
15 + } );
16 + return object;
17 +}
18 +
19 +/*
20 + * Create a callback list using the following parameters:
21 + *
22 + * options: an optional list of space-separated options that will change how
23 + * the callback list behaves or a more traditional option object
24 + *
25 + * By default a callback list will act like an event callback list and can be
26 + * "fired" multiple times.
27 + *
28 + * Possible options:
29 + *
30 + * once: will ensure the callback list can only be fired once (like a Deferred)
31 + *
32 + * memory: will keep track of previous values and will call any callback added
33 + * after the list has been fired right away with the latest "memorized"
34 + * values (like a Deferred)
35 + *
36 + * unique: will ensure a callback can only be added once (no duplicate in the list)
37 + *
38 + * stopOnFalse: interrupt callings when a callback returns false
39 + *
40 + */
41 +jQuery.Callbacks = function( options ) {
42 +
43 + // Convert options from String-formatted to Object-formatted if needed
44 + // (we check in cache first)
45 + options = typeof options === "string" ?
46 + createOptions( options ) :
47 + jQuery.extend( {}, options );
48 +
49 + var // Flag to know if list is currently firing
50 + firing,
51 +
52 + // Last fire value for non-forgettable lists
53 + memory,
54 +
55 + // Flag to know if list was already fired
56 + fired,
57 +
58 + // Flag to prevent firing
59 + locked,
60 +
61 + // Actual callback list
62 + list = [],
63 +
64 + // Queue of execution data for repeatable lists
65 + queue = [],
66 +
67 + // Index of currently firing callback (modified by add/remove as needed)
68 + firingIndex = -1,
69 +
70 + // Fire callbacks
71 + fire = function() {
72 +
73 + // Enforce single-firing
74 + locked = locked || options.once;
75 +
76 + // Execute callbacks for all pending executions,
77 + // respecting firingIndex overrides and runtime changes
78 + fired = firing = true;
79 + for ( ; queue.length; firingIndex = -1 ) {
80 + memory = queue.shift();
81 + while ( ++firingIndex < list.length ) {
82 +
83 + // Run callback and check for early termination
84 + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
85 + options.stopOnFalse ) {
86 +
87 + // Jump to end and forget the data so .add doesn't re-fire
88 + firingIndex = list.length;
89 + memory = false;
90 + }
91 + }
92 + }
93 +
94 + // Forget the data if we're done with it
95 + if ( !options.memory ) {
96 + memory = false;
97 + }
98 +
99 + firing = false;
100 +
101 + // Clean up if we're done firing for good
102 + if ( locked ) {
103 +
104 + // Keep an empty list if we have data for future add calls
105 + if ( memory ) {
106 + list = [];
107 +
108 + // Otherwise, this object is spent
109 + } else {
110 + list = "";
111 + }
112 + }
113 + },
114 +
115 + // Actual Callbacks object
116 + self = {
117 +
118 + // Add a callback or a collection of callbacks to the list
119 + add: function() {
120 + if ( list ) {
121 +
122 + // If we have memory from a past run, we should fire after adding
123 + if ( memory && !firing ) {
124 + firingIndex = list.length - 1;
125 + queue.push( memory );
126 + }
127 +
128 + ( function add( args ) {
129 + jQuery.each( args, function( _, arg ) {
130 + if ( isFunction( arg ) ) {
131 + if ( !options.unique || !self.has( arg ) ) {
132 + list.push( arg );
133 + }
134 + } else if ( arg && arg.length && toType( arg ) !== "string" ) {
135 +
136 + // Inspect recursively
137 + add( arg );
138 + }
139 + } );
140 + } )( arguments );
141 +
142 + if ( memory && !firing ) {
143 + fire();
144 + }
145 + }
146 + return this;
147 + },
148 +
149 + // Remove a callback from the list
150 + remove: function() {
151 + jQuery.each( arguments, function( _, arg ) {
152 + var index;
153 + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
154 + list.splice( index, 1 );
155 +
156 + // Handle firing indexes
157 + if ( index <= firingIndex ) {
158 + firingIndex--;
159 + }
160 + }
161 + } );
162 + return this;
163 + },
164 +
165 + // Check if a given callback is in the list.
166 + // If no argument is given, return whether or not list has callbacks attached.
167 + has: function( fn ) {
168 + return fn ?
169 + jQuery.inArray( fn, list ) > -1 :
170 + list.length > 0;
171 + },
172 +
173 + // Remove all callbacks from the list
174 + empty: function() {
175 + if ( list ) {
176 + list = [];
177 + }
178 + return this;
179 + },
180 +
181 + // Disable .fire and .add
182 + // Abort any current/pending executions
183 + // Clear all callbacks and values
184 + disable: function() {
185 + locked = queue = [];
186 + list = memory = "";
187 + return this;
188 + },
189 + disabled: function() {
190 + return !list;
191 + },
192 +
193 + // Disable .fire
194 + // Also disable .add unless we have memory (since it would have no effect)
195 + // Abort any pending executions
196 + lock: function() {
197 + locked = queue = [];
198 + if ( !memory && !firing ) {
199 + list = memory = "";
200 + }
201 + return this;
202 + },
203 + locked: function() {
204 + return !!locked;
205 + },
206 +
207 + // Call all callbacks with the given context and arguments
208 + fireWith: function( context, args ) {
209 + if ( !locked ) {
210 + args = args || [];
211 + args = [ context, args.slice ? args.slice() : args ];
212 + queue.push( args );
213 + if ( !firing ) {
214 + fire();
215 + }
216 + }
217 + return this;
218 + },
219 +
220 + // Call all the callbacks with the given arguments
221 + fire: function() {
222 + self.fireWith( this, arguments );
223 + return this;
224 + },
225 +
226 + // To know if the callbacks have already been called at least once
227 + fired: function() {
228 + return !!fired;
229 + }
230 + };
231 +
232 + return self;
233 +};
234 +
235 +return jQuery;
236 +} );
1 +/* global Symbol */
2 +// Defining this global in .eslintrc.json would create a danger of using the global
3 +// unguarded in another place, it seems safer to define global only for this module
4 +
5 +define( [
6 + "./var/arr",
7 + "./var/getProto",
8 + "./var/slice",
9 + "./var/flat",
10 + "./var/push",
11 + "./var/indexOf",
12 + "./var/class2type",
13 + "./var/toString",
14 + "./var/hasOwn",
15 + "./var/fnToString",
16 + "./var/ObjectFunctionString",
17 + "./var/support",
18 + "./var/isFunction",
19 + "./var/isWindow",
20 + "./core/DOMEval",
21 + "./core/toType"
22 +], function( arr, getProto, slice, flat, push, indexOf,
23 + class2type, toString, hasOwn, fnToString, ObjectFunctionString,
24 + support, isFunction, isWindow, DOMEval, toType ) {
25 +
26 +"use strict";
27 +
28 +var
29 + version = "3.6.0",
30 +
31 + // Define a local copy of jQuery
32 + jQuery = function( selector, context ) {
33 +
34 + // The jQuery object is actually just the init constructor 'enhanced'
35 + // Need init if jQuery is called (just allow error to be thrown if not included)
36 + return new jQuery.fn.init( selector, context );
37 + };
38 +
39 +jQuery.fn = jQuery.prototype = {
40 +
41 + // The current version of jQuery being used
42 + jquery: version,
43 +
44 + constructor: jQuery,
45 +
46 + // The default length of a jQuery object is 0
47 + length: 0,
48 +
49 + toArray: function() {
50 + return slice.call( this );
51 + },
52 +
53 + // Get the Nth element in the matched element set OR
54 + // Get the whole matched element set as a clean array
55 + get: function( num ) {
56 +
57 + // Return all the elements in a clean array
58 + if ( num == null ) {
59 + return slice.call( this );
60 + }
61 +
62 + // Return just the one element from the set
63 + return num < 0 ? this[ num + this.length ] : this[ num ];
64 + },
65 +
66 + // Take an array of elements and push it onto the stack
67 + // (returning the new matched element set)
68 + pushStack: function( elems ) {
69 +
70 + // Build a new jQuery matched element set
71 + var ret = jQuery.merge( this.constructor(), elems );
72 +
73 + // Add the old object onto the stack (as a reference)
74 + ret.prevObject = this;
75 +
76 + // Return the newly-formed element set
77 + return ret;
78 + },
79 +
80 + // Execute a callback for every element in the matched set.
81 + each: function( callback ) {
82 + return jQuery.each( this, callback );
83 + },
84 +
85 + map: function( callback ) {
86 + return this.pushStack( jQuery.map( this, function( elem, i ) {
87 + return callback.call( elem, i, elem );
88 + } ) );
89 + },
90 +
91 + slice: function() {
92 + return this.pushStack( slice.apply( this, arguments ) );
93 + },
94 +
95 + first: function() {
96 + return this.eq( 0 );
97 + },
98 +
99 + last: function() {
100 + return this.eq( -1 );
101 + },
102 +
103 + even: function() {
104 + return this.pushStack( jQuery.grep( this, function( _elem, i ) {
105 + return ( i + 1 ) % 2;
106 + } ) );
107 + },
108 +
109 + odd: function() {
110 + return this.pushStack( jQuery.grep( this, function( _elem, i ) {
111 + return i % 2;
112 + } ) );
113 + },
114 +
115 + eq: function( i ) {
116 + var len = this.length,
117 + j = +i + ( i < 0 ? len : 0 );
118 + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
119 + },
120 +
121 + end: function() {
122 + return this.prevObject || this.constructor();
123 + },
124 +
125 + // For internal use only.
126 + // Behaves like an Array's method, not like a jQuery method.
127 + push: push,
128 + sort: arr.sort,
129 + splice: arr.splice
130 +};
131 +
132 +jQuery.extend = jQuery.fn.extend = function() {
133 + var options, name, src, copy, copyIsArray, clone,
134 + target = arguments[ 0 ] || {},
135 + i = 1,
136 + length = arguments.length,
137 + deep = false;
138 +
139 + // Handle a deep copy situation
140 + if ( typeof target === "boolean" ) {
141 + deep = target;
142 +
143 + // Skip the boolean and the target
144 + target = arguments[ i ] || {};
145 + i++;
146 + }
147 +
148 + // Handle case when target is a string or something (possible in deep copy)
149 + if ( typeof target !== "object" && !isFunction( target ) ) {
150 + target = {};
151 + }
152 +
153 + // Extend jQuery itself if only one argument is passed
154 + if ( i === length ) {
155 + target = this;
156 + i--;
157 + }
158 +
159 + for ( ; i < length; i++ ) {
160 +
161 + // Only deal with non-null/undefined values
162 + if ( ( options = arguments[ i ] ) != null ) {
163 +
164 + // Extend the base object
165 + for ( name in options ) {
166 + copy = options[ name ];
167 +
168 + // Prevent Object.prototype pollution
169 + // Prevent never-ending loop
170 + if ( name === "__proto__" || target === copy ) {
171 + continue;
172 + }
173 +
174 + // Recurse if we're merging plain objects or arrays
175 + if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
176 + ( copyIsArray = Array.isArray( copy ) ) ) ) {
177 + src = target[ name ];
178 +
179 + // Ensure proper type for the source value
180 + if ( copyIsArray && !Array.isArray( src ) ) {
181 + clone = [];
182 + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
183 + clone = {};
184 + } else {
185 + clone = src;
186 + }
187 + copyIsArray = false;
188 +
189 + // Never move original objects, clone them
190 + target[ name ] = jQuery.extend( deep, clone, copy );
191 +
192 + // Don't bring in undefined values
193 + } else if ( copy !== undefined ) {
194 + target[ name ] = copy;
195 + }
196 + }
197 + }
198 + }
199 +
200 + // Return the modified object
201 + return target;
202 +};
203 +
204 +jQuery.extend( {
205 +
206 + // Unique for each copy of jQuery on the page
207 + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
208 +
209 + // Assume jQuery is ready without the ready module
210 + isReady: true,
211 +
212 + error: function( msg ) {
213 + throw new Error( msg );
214 + },
215 +
216 + noop: function() {},
217 +
218 + isPlainObject: function( obj ) {
219 + var proto, Ctor;
220 +
221 + // Detect obvious negatives
222 + // Use toString instead of jQuery.type to catch host objects
223 + if ( !obj || toString.call( obj ) !== "[object Object]" ) {
224 + return false;
225 + }
226 +
227 + proto = getProto( obj );
228 +
229 + // Objects with no prototype (e.g., `Object.create( null )`) are plain
230 + if ( !proto ) {
231 + return true;
232 + }
233 +
234 + // Objects with prototype are plain iff they were constructed by a global Object function
235 + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
236 + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
237 + },
238 +
239 + isEmptyObject: function( obj ) {
240 + var name;
241 +
242 + for ( name in obj ) {
243 + return false;
244 + }
245 + return true;
246 + },
247 +
248 + // Evaluates a script in a provided context; falls back to the global one
249 + // if not specified.
250 + globalEval: function( code, options, doc ) {
251 + DOMEval( code, { nonce: options && options.nonce }, doc );
252 + },
253 +
254 + each: function( obj, callback ) {
255 + var length, i = 0;
256 +
257 + if ( isArrayLike( obj ) ) {
258 + length = obj.length;
259 + for ( ; i < length; i++ ) {
260 + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
261 + break;
262 + }
263 + }
264 + } else {
265 + for ( i in obj ) {
266 + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
267 + break;
268 + }
269 + }
270 + }
271 +
272 + return obj;
273 + },
274 +
275 + // results is for internal usage only
276 + makeArray: function( arr, results ) {
277 + var ret = results || [];
278 +
279 + if ( arr != null ) {
280 + if ( isArrayLike( Object( arr ) ) ) {
281 + jQuery.merge( ret,
282 + typeof arr === "string" ?
283 + [ arr ] : arr
284 + );
285 + } else {
286 + push.call( ret, arr );
287 + }
288 + }
289 +
290 + return ret;
291 + },
292 +
293 + inArray: function( elem, arr, i ) {
294 + return arr == null ? -1 : indexOf.call( arr, elem, i );
295 + },
296 +
297 + // Support: Android <=4.0 only, PhantomJS 1 only
298 + // push.apply(_, arraylike) throws on ancient WebKit
299 + merge: function( first, second ) {
300 + var len = +second.length,
301 + j = 0,
302 + i = first.length;
303 +
304 + for ( ; j < len; j++ ) {
305 + first[ i++ ] = second[ j ];
306 + }
307 +
308 + first.length = i;
309 +
310 + return first;
311 + },
312 +
313 + grep: function( elems, callback, invert ) {
314 + var callbackInverse,
315 + matches = [],
316 + i = 0,
317 + length = elems.length,
318 + callbackExpect = !invert;
319 +
320 + // Go through the array, only saving the items
321 + // that pass the validator function
322 + for ( ; i < length; i++ ) {
323 + callbackInverse = !callback( elems[ i ], i );
324 + if ( callbackInverse !== callbackExpect ) {
325 + matches.push( elems[ i ] );
326 + }
327 + }
328 +
329 + return matches;
330 + },
331 +
332 + // arg is for internal usage only
333 + map: function( elems, callback, arg ) {
334 + var length, value,
335 + i = 0,
336 + ret = [];
337 +
338 + // Go through the array, translating each of the items to their new values
339 + if ( isArrayLike( elems ) ) {
340 + length = elems.length;
341 + for ( ; i < length; i++ ) {
342 + value = callback( elems[ i ], i, arg );
343 +
344 + if ( value != null ) {
345 + ret.push( value );
346 + }
347 + }
348 +
349 + // Go through every key on the object,
350 + } else {
351 + for ( i in elems ) {
352 + value = callback( elems[ i ], i, arg );
353 +
354 + if ( value != null ) {
355 + ret.push( value );
356 + }
357 + }
358 + }
359 +
360 + // Flatten any nested arrays
361 + return flat( ret );
362 + },
363 +
364 + // A global GUID counter for objects
365 + guid: 1,
366 +
367 + // jQuery.support is not used in Core but other projects attach their
368 + // properties to it so it needs to exist.
369 + support: support
370 +} );
371 +
372 +if ( typeof Symbol === "function" ) {
373 + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
374 +}
375 +
376 +// Populate the class2type map
377 +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
378 + function( _i, name ) {
379 + class2type[ "[object " + name + "]" ] = name.toLowerCase();
380 + } );
381 +
382 +function isArrayLike( obj ) {
383 +
384 + // Support: real iOS 8.2 only (not reproducible in simulator)
385 + // `in` check used to prevent JIT error (gh-2145)
386 + // hasOwn isn't used here due to false negatives
387 + // regarding Nodelist length in IE
388 + var length = !!obj && "length" in obj && obj.length,
389 + type = toType( obj );
390 +
391 + if ( isFunction( obj ) || isWindow( obj ) ) {
392 + return false;
393 + }
394 +
395 + return type === "array" || length === 0 ||
396 + typeof length === "number" && length > 0 && ( length - 1 ) in obj;
397 +}
398 +
399 +return jQuery;
400 +} );
1 +define( [
2 + "../var/document"
3 +], function( document ) {
4 + "use strict";
5 +
6 + var preservedScriptAttributes = {
7 + type: true,
8 + src: true,
9 + nonce: true,
10 + noModule: true
11 + };
12 +
13 + function DOMEval( code, node, doc ) {
14 + doc = doc || document;
15 +
16 + var i, val,
17 + script = doc.createElement( "script" );
18 +
19 + script.text = code;
20 + if ( node ) {
21 + for ( i in preservedScriptAttributes ) {
22 +
23 + // Support: Firefox 64+, Edge 18+
24 + // Some browsers don't support the "nonce" property on scripts.
25 + // On the other hand, just using `getAttribute` is not enough as
26 + // the `nonce` attribute is reset to an empty string whenever it
27 + // becomes browsing-context connected.
28 + // See https://github.com/whatwg/html/issues/2369
29 + // See https://html.spec.whatwg.org/#nonce-attributes
30 + // The `node.getAttribute` check was added for the sake of
31 + // `jQuery.globalEval` so that it can fake a nonce-containing node
32 + // via an object.
33 + val = node[ i ] || node.getAttribute && node.getAttribute( i );
34 + if ( val ) {
35 + script.setAttribute( i, val );
36 + }
37 + }
38 + }
39 + doc.head.appendChild( script ).parentNode.removeChild( script );
40 + }
41 +
42 + return DOMEval;
43 +} );
1 +define( [
2 + "../core",
3 + "../core/toType",
4 + "../var/isFunction"
5 +], function( jQuery, toType, isFunction ) {
6 +
7 +"use strict";
8 +
9 +// Multifunctional method to get and set values of a collection
10 +// The value/s can optionally be executed if it's a function
11 +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
12 + var i = 0,
13 + len = elems.length,
14 + bulk = key == null;
15 +
16 + // Sets many values
17 + if ( toType( key ) === "object" ) {
18 + chainable = true;
19 + for ( i in key ) {
20 + access( elems, fn, i, key[ i ], true, emptyGet, raw );
21 + }
22 +
23 + // Sets one value
24 + } else if ( value !== undefined ) {
25 + chainable = true;
26 +
27 + if ( !isFunction( value ) ) {
28 + raw = true;
29 + }
30 +
31 + if ( bulk ) {
32 +
33 + // Bulk operations run against the entire set
34 + if ( raw ) {
35 + fn.call( elems, value );
36 + fn = null;
37 +
38 + // ...except when executing function values
39 + } else {
40 + bulk = fn;
41 + fn = function( elem, _key, value ) {
42 + return bulk.call( jQuery( elem ), value );
43 + };
44 + }
45 + }
46 +
47 + if ( fn ) {
48 + for ( ; i < len; i++ ) {
49 + fn(
50 + elems[ i ], key, raw ?
51 + value :
52 + value.call( elems[ i ], i, fn( elems[ i ], key ) )
53 + );
54 + }
55 + }
56 + }
57 +
58 + if ( chainable ) {
59 + return elems;
60 + }
61 +
62 + // Gets
63 + if ( bulk ) {
64 + return fn.call( elems );
65 + }
66 +
67 + return len ? fn( elems[ 0 ], key ) : emptyGet;
68 +};
69 +
70 +return access;
71 +
72 +} );
1 +define( [], function() {
2 +
3 +"use strict";
4 +
5 +// Matches dashed string for camelizing
6 +var rmsPrefix = /^-ms-/,
7 + rdashAlpha = /-([a-z])/g;
8 +
9 +// Used by camelCase as callback to replace()
10 +function fcamelCase( _all, letter ) {
11 + return letter.toUpperCase();
12 +}
13 +
14 +// Convert dashed to camelCase; used by the css and data modules
15 +// Support: IE <=9 - 11, Edge 12 - 15
16 +// Microsoft forgot to hump their vendor prefix (#9572)
17 +function camelCase( string ) {
18 + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
19 +}
20 +
21 +return camelCase;
22 +
23 +} );
1 +// Initialize a jQuery object
2 +define( [
3 + "../core",
4 + "../var/document",
5 + "../var/isFunction",
6 + "./var/rsingleTag",
7 +
8 + "../traversing/findFilter"
9 +], function( jQuery, document, isFunction, rsingleTag ) {
10 +
11 +"use strict";
12 +
13 +// A central reference to the root jQuery(document)
14 +var rootjQuery,
15 +
16 + // A simple way to check for HTML strings
17 + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
18 + // Strict HTML recognition (#11290: must start with <)
19 + // Shortcut simple #id case for speed
20 + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
21 +
22 + init = jQuery.fn.init = function( selector, context, root ) {
23 + var match, elem;
24 +
25 + // HANDLE: $(""), $(null), $(undefined), $(false)
26 + if ( !selector ) {
27 + return this;
28 + }
29 +
30 + // Method init() accepts an alternate rootjQuery
31 + // so migrate can support jQuery.sub (gh-2101)
32 + root = root || rootjQuery;
33 +
34 + // Handle HTML strings
35 + if ( typeof selector === "string" ) {
36 + if ( selector[ 0 ] === "<" &&
37 + selector[ selector.length - 1 ] === ">" &&
38 + selector.length >= 3 ) {
39 +
40 + // Assume that strings that start and end with <> are HTML and skip the regex check
41 + match = [ null, selector, null ];
42 +
43 + } else {
44 + match = rquickExpr.exec( selector );
45 + }
46 +
47 + // Match html or make sure no context is specified for #id
48 + if ( match && ( match[ 1 ] || !context ) ) {
49 +
50 + // HANDLE: $(html) -> $(array)
51 + if ( match[ 1 ] ) {
52 + context = context instanceof jQuery ? context[ 0 ] : context;
53 +
54 + // Option to run scripts is true for back-compat
55 + // Intentionally let the error be thrown if parseHTML is not present
56 + jQuery.merge( this, jQuery.parseHTML(
57 + match[ 1 ],
58 + context && context.nodeType ? context.ownerDocument || context : document,
59 + true
60 + ) );
61 +
62 + // HANDLE: $(html, props)
63 + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
64 + for ( match in context ) {
65 +
66 + // Properties of context are called as methods if possible
67 + if ( isFunction( this[ match ] ) ) {
68 + this[ match ]( context[ match ] );
69 +
70 + // ...and otherwise set as attributes
71 + } else {
72 + this.attr( match, context[ match ] );
73 + }
74 + }
75 + }
76 +
77 + return this;
78 +
79 + // HANDLE: $(#id)
80 + } else {
81 + elem = document.getElementById( match[ 2 ] );
82 +
83 + if ( elem ) {
84 +
85 + // Inject the element directly into the jQuery object
86 + this[ 0 ] = elem;
87 + this.length = 1;
88 + }
89 + return this;
90 + }
91 +
92 + // HANDLE: $(expr, $(...))
93 + } else if ( !context || context.jquery ) {
94 + return ( context || root ).find( selector );
95 +
96 + // HANDLE: $(expr, context)
97 + // (which is just equivalent to: $(context).find(expr)
98 + } else {
99 + return this.constructor( context ).find( selector );
100 + }
101 +
102 + // HANDLE: $(DOMElement)
103 + } else if ( selector.nodeType ) {
104 + this[ 0 ] = selector;
105 + this.length = 1;
106 + return this;
107 +
108 + // HANDLE: $(function)
109 + // Shortcut for document ready
110 + } else if ( isFunction( selector ) ) {
111 + return root.ready !== undefined ?
112 + root.ready( selector ) :
113 +
114 + // Execute immediately if ready is not present
115 + selector( jQuery );
116 + }
117 +
118 + return jQuery.makeArray( selector, this );
119 + };
120 +
121 +// Give the init function the jQuery prototype for later instantiation
122 +init.prototype = jQuery.fn;
123 +
124 +// Initialize central reference
125 +rootjQuery = jQuery( document );
126 +
127 +return init;
128 +
129 +} );
1 +define( [
2 + "../core",
3 + "../var/documentElement",
4 + "../selector" // jQuery.contains
5 +], function( jQuery, documentElement ) {
6 + "use strict";
7 +
8 + var isAttached = function( elem ) {
9 + return jQuery.contains( elem.ownerDocument, elem );
10 + },
11 + composed = { composed: true };
12 +
13 + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
14 + // Check attachment across shadow DOM boundaries when possible (gh-3504)
15 + // Support: iOS 10.0-10.2 only
16 + // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
17 + // leading to errors. We need to check for `getRootNode`.
18 + if ( documentElement.getRootNode ) {
19 + isAttached = function( elem ) {
20 + return jQuery.contains( elem.ownerDocument, elem ) ||
21 + elem.getRootNode( composed ) === elem.ownerDocument;
22 + };
23 + }
24 +
25 + return isAttached;
26 +} );
1 +define( function() {
2 +
3 +"use strict";
4 +
5 +function nodeName( elem, name ) {
6 +
7 + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
8 +
9 +}
10 +
11 +return nodeName;
12 +
13 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "./var/rsingleTag",
5 + "../manipulation/buildFragment",
6 +
7 + // This is the only module that needs core/support
8 + "./support"
9 +], function( jQuery, document, rsingleTag, buildFragment, support ) {
10 +
11 +"use strict";
12 +
13 +// Argument "data" should be string of html
14 +// context (optional): If specified, the fragment will be created in this context,
15 +// defaults to document
16 +// keepScripts (optional): If true, will include scripts passed in the html string
17 +jQuery.parseHTML = function( data, context, keepScripts ) {
18 + if ( typeof data !== "string" ) {
19 + return [];
20 + }
21 + if ( typeof context === "boolean" ) {
22 + keepScripts = context;
23 + context = false;
24 + }
25 +
26 + var base, parsed, scripts;
27 +
28 + if ( !context ) {
29 +
30 + // Stop scripts or inline event handlers from being executed immediately
31 + // by using document.implementation
32 + if ( support.createHTMLDocument ) {
33 + context = document.implementation.createHTMLDocument( "" );
34 +
35 + // Set the base href for the created document
36 + // so any parsed elements with URLs
37 + // are based on the document's URL (gh-2965)
38 + base = context.createElement( "base" );
39 + base.href = document.location.href;
40 + context.head.appendChild( base );
41 + } else {
42 + context = document;
43 + }
44 + }
45 +
46 + parsed = rsingleTag.exec( data );
47 + scripts = !keepScripts && [];
48 +
49 + // Single tag
50 + if ( parsed ) {
51 + return [ context.createElement( parsed[ 1 ] ) ];
52 + }
53 +
54 + parsed = buildFragment( [ data ], context, scripts );
55 +
56 + if ( scripts && scripts.length ) {
57 + jQuery( scripts ).remove();
58 + }
59 +
60 + return jQuery.merge( [], parsed.childNodes );
61 +};
62 +
63 +return jQuery.parseHTML;
64 +
65 +} );
1 +define( [
2 + "../core"
3 +], function( jQuery ) {
4 +
5 +"use strict";
6 +
7 +// Cross-browser xml parsing
8 +jQuery.parseXML = function( data ) {
9 + var xml, parserErrorElem;
10 + if ( !data || typeof data !== "string" ) {
11 + return null;
12 + }
13 +
14 + // Support: IE 9 - 11 only
15 + // IE throws on parseFromString with invalid input.
16 + try {
17 + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
18 + } catch ( e ) {}
19 +
20 + parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
21 + if ( !xml || parserErrorElem ) {
22 + jQuery.error( "Invalid XML: " + (
23 + parserErrorElem ?
24 + jQuery.map( parserErrorElem.childNodes, function( el ) {
25 + return el.textContent;
26 + } ).join( "\n" ) :
27 + data
28 + ) );
29 + }
30 + return xml;
31 +};
32 +
33 +return jQuery.parseXML;
34 +
35 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "../var/isFunction"
5 +], function( jQuery, document, isFunction ) {
6 +
7 +"use strict";
8 +
9 +var readyCallbacks = [],
10 + whenReady = function( fn ) {
11 + readyCallbacks.push( fn );
12 + },
13 + executeReady = function( fn ) {
14 +
15 + // Prevent errors from freezing future callback execution (gh-1823)
16 + // Not backwards-compatible as this does not execute sync
17 + window.setTimeout( function() {
18 + fn.call( document, jQuery );
19 + } );
20 + };
21 +
22 +jQuery.fn.ready = function( fn ) {
23 + whenReady( fn );
24 + return this;
25 +};
26 +
27 +jQuery.extend( {
28 +
29 + // Is the DOM ready to be used? Set to true once it occurs.
30 + isReady: false,
31 +
32 + // A counter to track how many items to wait for before
33 + // the ready event fires. See #6781
34 + readyWait: 1,
35 +
36 + ready: function( wait ) {
37 +
38 + // Abort if there are pending holds or we're already ready
39 + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
40 + return;
41 + }
42 +
43 + // Remember that the DOM is ready
44 + jQuery.isReady = true;
45 +
46 + // If a normal DOM Ready event fired, decrement, and wait if need be
47 + if ( wait !== true && --jQuery.readyWait > 0 ) {
48 + return;
49 + }
50 +
51 + whenReady = function( fn ) {
52 + readyCallbacks.push( fn );
53 +
54 + while ( readyCallbacks.length ) {
55 + fn = readyCallbacks.shift();
56 + if ( isFunction( fn ) ) {
57 + executeReady( fn );
58 + }
59 + }
60 + };
61 +
62 + whenReady();
63 + }
64 +} );
65 +
66 +// Make jQuery.ready Promise consumable (gh-1778)
67 +jQuery.ready.then = jQuery.fn.ready;
68 +
69 +/**
70 + * The ready event handler and self cleanup method
71 + */
72 +function completed() {
73 + document.removeEventListener( "DOMContentLoaded", completed );
74 + window.removeEventListener( "load", completed );
75 + jQuery.ready();
76 +}
77 +
78 +// Catch cases where $(document).ready() is called
79 +// after the browser event has already occurred.
80 +// Support: IE9-10 only
81 +// Older IE sometimes signals "interactive" too soon
82 +if ( document.readyState === "complete" ||
83 + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
84 +
85 + // Handle it asynchronously to allow scripts the opportunity to delay ready
86 + window.setTimeout( jQuery.ready );
87 +
88 +} else {
89 +
90 + // Use the handy event callback
91 + document.addEventListener( "DOMContentLoaded", completed );
92 +
93 + // A fallback to window.onload, that will always work
94 + window.addEventListener( "load", completed );
95 +}
96 +
97 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "../core/readyException",
5 + "../deferred"
6 +], function( jQuery, document ) {
7 +
8 +"use strict";
9 +
10 +// The deferred used on DOM ready
11 +var readyList = jQuery.Deferred();
12 +
13 +jQuery.fn.ready = function( fn ) {
14 +
15 + readyList
16 + .then( fn )
17 +
18 + // Wrap jQuery.readyException in a function so that the lookup
19 + // happens at the time of error handling instead of callback
20 + // registration.
21 + .catch( function( error ) {
22 + jQuery.readyException( error );
23 + } );
24 +
25 + return this;
26 +};
27 +
28 +jQuery.extend( {
29 +
30 + // Is the DOM ready to be used? Set to true once it occurs.
31 + isReady: false,
32 +
33 + // A counter to track how many items to wait for before
34 + // the ready event fires. See #6781
35 + readyWait: 1,
36 +
37 + // Handle when the DOM is ready
38 + ready: function( wait ) {
39 +
40 + // Abort if there are pending holds or we're already ready
41 + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
42 + return;
43 + }
44 +
45 + // Remember that the DOM is ready
46 + jQuery.isReady = true;
47 +
48 + // If a normal DOM Ready event fired, decrement, and wait if need be
49 + if ( wait !== true && --jQuery.readyWait > 0 ) {
50 + return;
51 + }
52 +
53 + // If there are functions bound, to execute
54 + readyList.resolveWith( document, [ jQuery ] );
55 + }
56 +} );
57 +
58 +jQuery.ready.then = readyList.then;
59 +
60 +// The ready event handler and self cleanup method
61 +function completed() {
62 + document.removeEventListener( "DOMContentLoaded", completed );
63 + window.removeEventListener( "load", completed );
64 + jQuery.ready();
65 +}
66 +
67 +// Catch cases where $(document).ready() is called
68 +// after the browser event has already occurred.
69 +// Support: IE <=9 - 10 only
70 +// Older IE sometimes signals "interactive" too soon
71 +if ( document.readyState === "complete" ||
72 + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
73 +
74 + // Handle it asynchronously to allow scripts the opportunity to delay ready
75 + window.setTimeout( jQuery.ready );
76 +
77 +} else {
78 +
79 + // Use the handy event callback
80 + document.addEventListener( "DOMContentLoaded", completed );
81 +
82 + // A fallback to window.onload, that will always work
83 + window.addEventListener( "load", completed );
84 +}
85 +
86 +} );
1 +define( [
2 + "../core"
3 +], function( jQuery ) {
4 +
5 +"use strict";
6 +
7 +jQuery.readyException = function( error ) {
8 + window.setTimeout( function() {
9 + throw error;
10 + } );
11 +};
12 +
13 +} );
1 +define( [
2 + "../var/rnothtmlwhite"
3 +], function( rnothtmlwhite ) {
4 + "use strict";
5 +
6 + // Strip and collapse whitespace according to HTML spec
7 + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
8 + function stripAndCollapse( value ) {
9 + var tokens = value.match( rnothtmlwhite ) || [];
10 + return tokens.join( " " );
11 + }
12 +
13 + return stripAndCollapse;
14 +} );
1 +define( [
2 + "../var/document",
3 + "../var/support"
4 +], function( document, support ) {
5 +
6 +"use strict";
7 +
8 +// Support: Safari 8 only
9 +// In Safari 8 documents created via document.implementation.createHTMLDocument
10 +// collapse sibling forms: the second one becomes a child of the first one.
11 +// Because of that, this security measure has to be disabled in Safari 8.
12 +// https://bugs.webkit.org/show_bug.cgi?id=137337
13 +support.createHTMLDocument = ( function() {
14 + var body = document.implementation.createHTMLDocument( "" ).body;
15 + body.innerHTML = "<form></form><form></form>";
16 + return body.childNodes.length === 2;
17 +} )();
18 +
19 +return support;
20 +} );
1 +define( [
2 + "../var/class2type",
3 + "../var/toString"
4 +], function( class2type, toString ) {
5 +
6 +"use strict";
7 +
8 +function toType( obj ) {
9 + if ( obj == null ) {
10 + return obj + "";
11 + }
12 +
13 + // Support: Android <=2.3 only (functionish RegExp)
14 + return typeof obj === "object" || typeof obj === "function" ?
15 + class2type[ toString.call( obj ) ] || "object" :
16 + typeof obj;
17 +}
18 +
19 +return toType;
20 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + // rsingleTag matches a string consisting of a single HTML element with no attributes
5 + // and captures the element's name
6 + return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
7 +} );
This diff is collapsed. Click to expand it.
1 +define( function() {
2 +
3 +"use strict";
4 +
5 +function addGetHookIf( conditionFn, hookFn ) {
6 +
7 + // Define the hook, we'll check on the first run if it's really needed.
8 + return {
9 + get: function() {
10 + if ( conditionFn() ) {
11 +
12 + // Hook not needed (or it's not possible to use it due
13 + // to missing dependency), remove it.
14 + delete this.get;
15 + return;
16 + }
17 +
18 + // Hook needed; redefine it so that the support test is not executed again.
19 + return ( this.get = hookFn ).apply( this, arguments );
20 + }
21 + };
22 +}
23 +
24 +return addGetHookIf;
25 +
26 +} );
1 +define( [
2 + "../core",
3 + "../var/rcssNum"
4 +], function( jQuery, rcssNum ) {
5 +
6 +"use strict";
7 +
8 +function adjustCSS( elem, prop, valueParts, tween ) {
9 + var adjusted, scale,
10 + maxIterations = 20,
11 + currentValue = tween ?
12 + function() {
13 + return tween.cur();
14 + } :
15 + function() {
16 + return jQuery.css( elem, prop, "" );
17 + },
18 + initial = currentValue(),
19 + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
20 +
21 + // Starting value computation is required for potential unit mismatches
22 + initialInUnit = elem.nodeType &&
23 + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
24 + rcssNum.exec( jQuery.css( elem, prop ) );
25 +
26 + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
27 +
28 + // Support: Firefox <=54
29 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
30 + initial = initial / 2;
31 +
32 + // Trust units reported by jQuery.css
33 + unit = unit || initialInUnit[ 3 ];
34 +
35 + // Iteratively approximate from a nonzero starting point
36 + initialInUnit = +initial || 1;
37 +
38 + while ( maxIterations-- ) {
39 +
40 + // Evaluate and update our best guess (doubling guesses that zero out).
41 + // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
42 + jQuery.style( elem, prop, initialInUnit + unit );
43 + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
44 + maxIterations = 0;
45 + }
46 + initialInUnit = initialInUnit / scale;
47 +
48 + }
49 +
50 + initialInUnit = initialInUnit * 2;
51 + jQuery.style( elem, prop, initialInUnit + unit );
52 +
53 + // Make sure we update the tween properties later on
54 + valueParts = valueParts || [];
55 + }
56 +
57 + if ( valueParts ) {
58 + initialInUnit = +initialInUnit || +initial || 0;
59 +
60 + // Apply relative offset (+=/-=) if specified
61 + adjusted = valueParts[ 1 ] ?
62 + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
63 + +valueParts[ 2 ];
64 + if ( tween ) {
65 + tween.unit = unit;
66 + tween.start = initialInUnit;
67 + tween.end = adjusted;
68 + }
69 + }
70 + return adjusted;
71 +}
72 +
73 +return adjustCSS;
74 +} );
1 +define( [
2 + "../core",
3 + "../core/isAttached",
4 + "./var/rboxStyle",
5 + "./var/rnumnonpx",
6 + "./var/getStyles",
7 + "./support"
8 +], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, support ) {
9 +
10 +"use strict";
11 +
12 +function curCSS( elem, name, computed ) {
13 + var width, minWidth, maxWidth, ret,
14 +
15 + // Support: Firefox 51+
16 + // Retrieving style before computed somehow
17 + // fixes an issue with getting wrong values
18 + // on detached elements
19 + style = elem.style;
20 +
21 + computed = computed || getStyles( elem );
22 +
23 + // getPropertyValue is needed for:
24 + // .css('filter') (IE 9 only, #12537)
25 + // .css('--customProperty) (#3144)
26 + if ( computed ) {
27 + ret = computed.getPropertyValue( name ) || computed[ name ];
28 +
29 + if ( ret === "" && !isAttached( elem ) ) {
30 + ret = jQuery.style( elem, name );
31 + }
32 +
33 + // A tribute to the "awesome hack by Dean Edwards"
34 + // Android Browser returns percentage for some values,
35 + // but width seems to be reliably pixels.
36 + // This is against the CSSOM draft spec:
37 + // https://drafts.csswg.org/cssom/#resolved-values
38 + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
39 +
40 + // Remember the original values
41 + width = style.width;
42 + minWidth = style.minWidth;
43 + maxWidth = style.maxWidth;
44 +
45 + // Put in the new values to get a computed value out
46 + style.minWidth = style.maxWidth = style.width = ret;
47 + ret = computed.width;
48 +
49 + // Revert the changed values
50 + style.width = width;
51 + style.minWidth = minWidth;
52 + style.maxWidth = maxWidth;
53 + }
54 + }
55 +
56 + return ret !== undefined ?
57 +
58 + // Support: IE <=9 - 11 only
59 + // IE returns zIndex value as an integer.
60 + ret + "" :
61 + ret;
62 +}
63 +
64 +return curCSS;
65 +} );
1 +define( [
2 + "../var/document",
3 + "../core"
4 +], function( document, jQuery ) {
5 +
6 +"use strict";
7 +
8 +var cssPrefixes = [ "Webkit", "Moz", "ms" ],
9 + emptyStyle = document.createElement( "div" ).style,
10 + vendorProps = {};
11 +
12 +// Return a vendor-prefixed property or undefined
13 +function vendorPropName( name ) {
14 +
15 + // Check for vendor prefixed names
16 + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
17 + i = cssPrefixes.length;
18 +
19 + while ( i-- ) {
20 + name = cssPrefixes[ i ] + capName;
21 + if ( name in emptyStyle ) {
22 + return name;
23 + }
24 + }
25 +}
26 +
27 +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
28 +function finalPropName( name ) {
29 + var final = jQuery.cssProps[ name ] || vendorProps[ name ];
30 +
31 + if ( final ) {
32 + return final;
33 + }
34 + if ( name in emptyStyle ) {
35 + return name;
36 + }
37 + return vendorProps[ name ] = vendorPropName( name ) || name;
38 +}
39 +
40 +return finalPropName;
41 +
42 +} );
1 +define( [
2 + "../core",
3 + "../selector"
4 +], function( jQuery ) {
5 +
6 +"use strict";
7 +
8 +jQuery.expr.pseudos.hidden = function( elem ) {
9 + return !jQuery.expr.pseudos.visible( elem );
10 +};
11 +jQuery.expr.pseudos.visible = function( elem ) {
12 + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
13 +};
14 +
15 +} );
1 +define( [
2 + "../core",
3 + "../data/var/dataPriv",
4 + "../css/var/isHiddenWithinTree"
5 +], function( jQuery, dataPriv, isHiddenWithinTree ) {
6 +
7 +"use strict";
8 +
9 +var defaultDisplayMap = {};
10 +
11 +function getDefaultDisplay( elem ) {
12 + var temp,
13 + doc = elem.ownerDocument,
14 + nodeName = elem.nodeName,
15 + display = defaultDisplayMap[ nodeName ];
16 +
17 + if ( display ) {
18 + return display;
19 + }
20 +
21 + temp = doc.body.appendChild( doc.createElement( nodeName ) );
22 + display = jQuery.css( temp, "display" );
23 +
24 + temp.parentNode.removeChild( temp );
25 +
26 + if ( display === "none" ) {
27 + display = "block";
28 + }
29 + defaultDisplayMap[ nodeName ] = display;
30 +
31 + return display;
32 +}
33 +
34 +function showHide( elements, show ) {
35 + var display, elem,
36 + values = [],
37 + index = 0,
38 + length = elements.length;
39 +
40 + // Determine new display value for elements that need to change
41 + for ( ; index < length; index++ ) {
42 + elem = elements[ index ];
43 + if ( !elem.style ) {
44 + continue;
45 + }
46 +
47 + display = elem.style.display;
48 + if ( show ) {
49 +
50 + // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
51 + // check is required in this first loop unless we have a nonempty display value (either
52 + // inline or about-to-be-restored)
53 + if ( display === "none" ) {
54 + values[ index ] = dataPriv.get( elem, "display" ) || null;
55 + if ( !values[ index ] ) {
56 + elem.style.display = "";
57 + }
58 + }
59 + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
60 + values[ index ] = getDefaultDisplay( elem );
61 + }
62 + } else {
63 + if ( display !== "none" ) {
64 + values[ index ] = "none";
65 +
66 + // Remember what we're overwriting
67 + dataPriv.set( elem, "display", display );
68 + }
69 + }
70 + }
71 +
72 + // Set the display of the elements in a second loop to avoid constant reflow
73 + for ( index = 0; index < length; index++ ) {
74 + if ( values[ index ] != null ) {
75 + elements[ index ].style.display = values[ index ];
76 + }
77 + }
78 +
79 + return elements;
80 +}
81 +
82 +jQuery.fn.extend( {
83 + show: function() {
84 + return showHide( this, true );
85 + },
86 + hide: function() {
87 + return showHide( this );
88 + },
89 + toggle: function( state ) {
90 + if ( typeof state === "boolean" ) {
91 + return state ? this.show() : this.hide();
92 + }
93 +
94 + return this.each( function() {
95 + if ( isHiddenWithinTree( this ) ) {
96 + jQuery( this ).show();
97 + } else {
98 + jQuery( this ).hide();
99 + }
100 + } );
101 + }
102 +} );
103 +
104 +return showHide;
105 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "../var/documentElement",
5 + "../var/support"
6 +], function( jQuery, document, documentElement, support ) {
7 +
8 +"use strict";
9 +
10 +( function() {
11 +
12 + // Executing both pixelPosition & boxSizingReliable tests require only one layout
13 + // so they're executed at the same time to save the second computation.
14 + function computeStyleTests() {
15 +
16 + // This is a singleton, we need to execute it only once
17 + if ( !div ) {
18 + return;
19 + }
20 +
21 + container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
22 + "margin-top:1px;padding:0;border:0";
23 + div.style.cssText =
24 + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
25 + "margin:auto;border:1px;padding:1px;" +
26 + "width:60%;top:1%";
27 + documentElement.appendChild( container ).appendChild( div );
28 +
29 + var divStyle = window.getComputedStyle( div );
30 + pixelPositionVal = divStyle.top !== "1%";
31 +
32 + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
33 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
34 +
35 + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
36 + // Some styles come back with percentage values, even though they shouldn't
37 + div.style.right = "60%";
38 + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
39 +
40 + // Support: IE 9 - 11 only
41 + // Detect misreporting of content dimensions for box-sizing:border-box elements
42 + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
43 +
44 + // Support: IE 9 only
45 + // Detect overflow:scroll screwiness (gh-3699)
46 + // Support: Chrome <=64
47 + // Don't get tricked when zoom affects offsetWidth (gh-4029)
48 + div.style.position = "absolute";
49 + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
50 +
51 + documentElement.removeChild( container );
52 +
53 + // Nullify the div so it wouldn't be stored in the memory and
54 + // it will also be a sign that checks already performed
55 + div = null;
56 + }
57 +
58 + function roundPixelMeasures( measure ) {
59 + return Math.round( parseFloat( measure ) );
60 + }
61 +
62 + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
63 + reliableTrDimensionsVal, reliableMarginLeftVal,
64 + container = document.createElement( "div" ),
65 + div = document.createElement( "div" );
66 +
67 + // Finish early in limited (non-browser) environments
68 + if ( !div.style ) {
69 + return;
70 + }
71 +
72 + // Support: IE <=9 - 11 only
73 + // Style of cloned element affects source element cloned (#8908)
74 + div.style.backgroundClip = "content-box";
75 + div.cloneNode( true ).style.backgroundClip = "";
76 + support.clearCloneStyle = div.style.backgroundClip === "content-box";
77 +
78 + jQuery.extend( support, {
79 + boxSizingReliable: function() {
80 + computeStyleTests();
81 + return boxSizingReliableVal;
82 + },
83 + pixelBoxStyles: function() {
84 + computeStyleTests();
85 + return pixelBoxStylesVal;
86 + },
87 + pixelPosition: function() {
88 + computeStyleTests();
89 + return pixelPositionVal;
90 + },
91 + reliableMarginLeft: function() {
92 + computeStyleTests();
93 + return reliableMarginLeftVal;
94 + },
95 + scrollboxSize: function() {
96 + computeStyleTests();
97 + return scrollboxSizeVal;
98 + },
99 +
100 + // Support: IE 9 - 11+, Edge 15 - 18+
101 + // IE/Edge misreport `getComputedStyle` of table rows with width/height
102 + // set in CSS while `offset*` properties report correct values.
103 + // Behavior in IE 9 is more subtle than in newer versions & it passes
104 + // some versions of this test; make sure not to make it pass there!
105 + //
106 + // Support: Firefox 70+
107 + // Only Firefox includes border widths
108 + // in computed dimensions. (gh-4529)
109 + reliableTrDimensions: function() {
110 + var table, tr, trChild, trStyle;
111 + if ( reliableTrDimensionsVal == null ) {
112 + table = document.createElement( "table" );
113 + tr = document.createElement( "tr" );
114 + trChild = document.createElement( "div" );
115 +
116 + table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
117 + tr.style.cssText = "border:1px solid";
118 +
119 + // Support: Chrome 86+
120 + // Height set through cssText does not get applied.
121 + // Computed height then comes back as 0.
122 + tr.style.height = "1px";
123 + trChild.style.height = "9px";
124 +
125 + // Support: Android 8 Chrome 86+
126 + // In our bodyBackground.html iframe,
127 + // display for all div elements is set to "inline",
128 + // which causes a problem only in Android 8 Chrome 86.
129 + // Ensuring the div is display: block
130 + // gets around this issue.
131 + trChild.style.display = "block";
132 +
133 + documentElement
134 + .appendChild( table )
135 + .appendChild( tr )
136 + .appendChild( trChild );
137 +
138 + trStyle = window.getComputedStyle( tr );
139 + reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
140 + parseInt( trStyle.borderTopWidth, 10 ) +
141 + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
142 +
143 + documentElement.removeChild( table );
144 + }
145 + return reliableTrDimensionsVal;
146 + }
147 + } );
148 +} )();
149 +
150 +return support;
151 +
152 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + return [ "Top", "Right", "Bottom", "Left" ];
5 +} );
1 +define( function() {
2 + "use strict";
3 +
4 + return function( elem ) {
5 +
6 + // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
7 + // IE throws on elements created in popups
8 + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
9 + var view = elem.ownerDocument.defaultView;
10 +
11 + if ( !view || !view.opener ) {
12 + view = window;
13 + }
14 +
15 + return view.getComputedStyle( elem );
16 + };
17 +} );
1 +define( [
2 + "../../core",
3 + "../../core/isAttached"
4 +
5 + // css is assumed
6 +], function( jQuery, isAttached ) {
7 + "use strict";
8 +
9 + // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or
10 + // through the CSS cascade), which is useful in deciding whether or not to make it visible.
11 + // It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways:
12 + // * A hidden ancestor does not force an element to be classified as hidden.
13 + // * Being disconnected from the document does not force an element to be classified as hidden.
14 + // These differences improve the behavior of .toggle() et al. when applied to elements that are
15 + // detached or contained within hidden ancestors (gh-2404, gh-2863).
16 + return function( elem, el ) {
17 +
18 + // isHiddenWithinTree might be called from jQuery#filter function;
19 + // in that case, element will be second argument
20 + elem = el || elem;
21 +
22 + // Inline style trumps all
23 + return elem.style.display === "none" ||
24 + elem.style.display === "" &&
25 +
26 + // Otherwise, check computed style
27 + // Support: Firefox <=43 - 45
28 + // Disconnected elements can have computed display: none, so first confirm that elem is
29 + // in the document.
30 + isAttached( elem ) &&
31 +
32 + jQuery.css( elem, "display" ) === "none";
33 + };
34 +} );
1 +define( [
2 + "./cssExpand"
3 +], function( cssExpand ) {
4 + "use strict";
5 +
6 + return new RegExp( cssExpand.join( "|" ), "i" );
7 +} );
1 +define( [
2 + "../../var/pnum"
3 +], function( pnum ) {
4 + "use strict";
5 +
6 + return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
7 +} );
1 +define( function() {
2 +
3 +"use strict";
4 +
5 +// A method for quickly swapping in/out CSS properties to get correct calculations.
6 +return function( elem, options, callback ) {
7 + var ret, name,
8 + old = {};
9 +
10 + // Remember the old values, and insert the new ones
11 + for ( name in options ) {
12 + old[ name ] = elem.style[ name ];
13 + elem.style[ name ] = options[ name ];
14 + }
15 +
16 + ret = callback.call( elem );
17 +
18 + // Revert the old values
19 + for ( name in options ) {
20 + elem.style[ name ] = old[ name ];
21 + }
22 +
23 + return ret;
24 +};
25 +
26 +} );
1 +define( [
2 + "./core",
3 + "./core/access",
4 + "./core/camelCase",
5 + "./data/var/dataPriv",
6 + "./data/var/dataUser"
7 +], function( jQuery, access, camelCase, dataPriv, dataUser ) {
8 +
9 +"use strict";
10 +
11 +// Implementation Summary
12 +//
13 +// 1. Enforce API surface and semantic compatibility with 1.9.x branch
14 +// 2. Improve the module's maintainability by reducing the storage
15 +// paths to a single mechanism.
16 +// 3. Use the same single mechanism to support "private" and "user" data.
17 +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
18 +// 5. Avoid exposing implementation details on user objects (eg. expando properties)
19 +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
20 +
21 +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
22 + rmultiDash = /[A-Z]/g;
23 +
24 +function getData( data ) {
25 + if ( data === "true" ) {
26 + return true;
27 + }
28 +
29 + if ( data === "false" ) {
30 + return false;
31 + }
32 +
33 + if ( data === "null" ) {
34 + return null;
35 + }
36 +
37 + // Only convert to a number if it doesn't change the string
38 + if ( data === +data + "" ) {
39 + return +data;
40 + }
41 +
42 + if ( rbrace.test( data ) ) {
43 + return JSON.parse( data );
44 + }
45 +
46 + return data;
47 +}
48 +
49 +function dataAttr( elem, key, data ) {
50 + var name;
51 +
52 + // If nothing was found internally, try to fetch any
53 + // data from the HTML5 data-* attribute
54 + if ( data === undefined && elem.nodeType === 1 ) {
55 + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
56 + data = elem.getAttribute( name );
57 +
58 + if ( typeof data === "string" ) {
59 + try {
60 + data = getData( data );
61 + } catch ( e ) {}
62 +
63 + // Make sure we set the data so it isn't changed later
64 + dataUser.set( elem, key, data );
65 + } else {
66 + data = undefined;
67 + }
68 + }
69 + return data;
70 +}
71 +
72 +jQuery.extend( {
73 + hasData: function( elem ) {
74 + return dataUser.hasData( elem ) || dataPriv.hasData( elem );
75 + },
76 +
77 + data: function( elem, name, data ) {
78 + return dataUser.access( elem, name, data );
79 + },
80 +
81 + removeData: function( elem, name ) {
82 + dataUser.remove( elem, name );
83 + },
84 +
85 + // TODO: Now that all calls to _data and _removeData have been replaced
86 + // with direct calls to dataPriv methods, these can be deprecated.
87 + _data: function( elem, name, data ) {
88 + return dataPriv.access( elem, name, data );
89 + },
90 +
91 + _removeData: function( elem, name ) {
92 + dataPriv.remove( elem, name );
93 + }
94 +} );
95 +
96 +jQuery.fn.extend( {
97 + data: function( key, value ) {
98 + var i, name, data,
99 + elem = this[ 0 ],
100 + attrs = elem && elem.attributes;
101 +
102 + // Gets all values
103 + if ( key === undefined ) {
104 + if ( this.length ) {
105 + data = dataUser.get( elem );
106 +
107 + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
108 + i = attrs.length;
109 + while ( i-- ) {
110 +
111 + // Support: IE 11 only
112 + // The attrs elements can be null (#14894)
113 + if ( attrs[ i ] ) {
114 + name = attrs[ i ].name;
115 + if ( name.indexOf( "data-" ) === 0 ) {
116 + name = camelCase( name.slice( 5 ) );
117 + dataAttr( elem, name, data[ name ] );
118 + }
119 + }
120 + }
121 + dataPriv.set( elem, "hasDataAttrs", true );
122 + }
123 + }
124 +
125 + return data;
126 + }
127 +
128 + // Sets multiple values
129 + if ( typeof key === "object" ) {
130 + return this.each( function() {
131 + dataUser.set( this, key );
132 + } );
133 + }
134 +
135 + return access( this, function( value ) {
136 + var data;
137 +
138 + // The calling jQuery object (element matches) is not empty
139 + // (and therefore has an element appears at this[ 0 ]) and the
140 + // `value` parameter was not undefined. An empty jQuery object
141 + // will result in `undefined` for elem = this[ 0 ] which will
142 + // throw an exception if an attempt to read a data cache is made.
143 + if ( elem && value === undefined ) {
144 +
145 + // Attempt to get data from the cache
146 + // The key will always be camelCased in Data
147 + data = dataUser.get( elem, key );
148 + if ( data !== undefined ) {
149 + return data;
150 + }
151 +
152 + // Attempt to "discover" the data in
153 + // HTML5 custom data-* attrs
154 + data = dataAttr( elem, key );
155 + if ( data !== undefined ) {
156 + return data;
157 + }
158 +
159 + // We tried really hard, but the data doesn't exist.
160 + return;
161 + }
162 +
163 + // Set the data...
164 + this.each( function() {
165 +
166 + // We always store the camelCased key
167 + dataUser.set( this, key, value );
168 + } );
169 + }, null, value, arguments.length > 1, null, true );
170 + },
171 +
172 + removeData: function( key ) {
173 + return this.each( function() {
174 + dataUser.remove( this, key );
175 + } );
176 + }
177 +} );
178 +
179 +return jQuery;
180 +} );
1 +define( [
2 + "../core",
3 + "../core/camelCase",
4 + "../var/rnothtmlwhite",
5 + "./var/acceptData"
6 +], function( jQuery, camelCase, rnothtmlwhite, acceptData ) {
7 +
8 +"use strict";
9 +
10 +function Data() {
11 + this.expando = jQuery.expando + Data.uid++;
12 +}
13 +
14 +Data.uid = 1;
15 +
16 +Data.prototype = {
17 +
18 + cache: function( owner ) {
19 +
20 + // Check if the owner object already has a cache
21 + var value = owner[ this.expando ];
22 +
23 + // If not, create one
24 + if ( !value ) {
25 + value = {};
26 +
27 + // We can accept data for non-element nodes in modern browsers,
28 + // but we should not, see #8335.
29 + // Always return an empty object.
30 + if ( acceptData( owner ) ) {
31 +
32 + // If it is a node unlikely to be stringify-ed or looped over
33 + // use plain assignment
34 + if ( owner.nodeType ) {
35 + owner[ this.expando ] = value;
36 +
37 + // Otherwise secure it in a non-enumerable property
38 + // configurable must be true to allow the property to be
39 + // deleted when data is removed
40 + } else {
41 + Object.defineProperty( owner, this.expando, {
42 + value: value,
43 + configurable: true
44 + } );
45 + }
46 + }
47 + }
48 +
49 + return value;
50 + },
51 + set: function( owner, data, value ) {
52 + var prop,
53 + cache = this.cache( owner );
54 +
55 + // Handle: [ owner, key, value ] args
56 + // Always use camelCase key (gh-2257)
57 + if ( typeof data === "string" ) {
58 + cache[ camelCase( data ) ] = value;
59 +
60 + // Handle: [ owner, { properties } ] args
61 + } else {
62 +
63 + // Copy the properties one-by-one to the cache object
64 + for ( prop in data ) {
65 + cache[ camelCase( prop ) ] = data[ prop ];
66 + }
67 + }
68 + return cache;
69 + },
70 + get: function( owner, key ) {
71 + return key === undefined ?
72 + this.cache( owner ) :
73 +
74 + // Always use camelCase key (gh-2257)
75 + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
76 + },
77 + access: function( owner, key, value ) {
78 +
79 + // In cases where either:
80 + //
81 + // 1. No key was specified
82 + // 2. A string key was specified, but no value provided
83 + //
84 + // Take the "read" path and allow the get method to determine
85 + // which value to return, respectively either:
86 + //
87 + // 1. The entire cache object
88 + // 2. The data stored at the key
89 + //
90 + if ( key === undefined ||
91 + ( ( key && typeof key === "string" ) && value === undefined ) ) {
92 +
93 + return this.get( owner, key );
94 + }
95 +
96 + // When the key is not a string, or both a key and value
97 + // are specified, set or extend (existing objects) with either:
98 + //
99 + // 1. An object of properties
100 + // 2. A key and value
101 + //
102 + this.set( owner, key, value );
103 +
104 + // Since the "set" path can have two possible entry points
105 + // return the expected data based on which path was taken[*]
106 + return value !== undefined ? value : key;
107 + },
108 + remove: function( owner, key ) {
109 + var i,
110 + cache = owner[ this.expando ];
111 +
112 + if ( cache === undefined ) {
113 + return;
114 + }
115 +
116 + if ( key !== undefined ) {
117 +
118 + // Support array or space separated string of keys
119 + if ( Array.isArray( key ) ) {
120 +
121 + // If key is an array of keys...
122 + // We always set camelCase keys, so remove that.
123 + key = key.map( camelCase );
124 + } else {
125 + key = camelCase( key );
126 +
127 + // If a key with the spaces exists, use it.
128 + // Otherwise, create an array by matching non-whitespace
129 + key = key in cache ?
130 + [ key ] :
131 + ( key.match( rnothtmlwhite ) || [] );
132 + }
133 +
134 + i = key.length;
135 +
136 + while ( i-- ) {
137 + delete cache[ key[ i ] ];
138 + }
139 + }
140 +
141 + // Remove the expando if there's no more data
142 + if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
143 +
144 + // Support: Chrome <=35 - 45
145 + // Webkit & Blink performance suffers when deleting properties
146 + // from DOM nodes, so set to undefined instead
147 + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
148 + if ( owner.nodeType ) {
149 + owner[ this.expando ] = undefined;
150 + } else {
151 + delete owner[ this.expando ];
152 + }
153 + }
154 + },
155 + hasData: function( owner ) {
156 + var cache = owner[ this.expando ];
157 + return cache !== undefined && !jQuery.isEmptyObject( cache );
158 + }
159 +};
160 +
161 +return Data;
162 +} );
1 +define( function() {
2 +
3 +"use strict";
4 +
5 +/**
6 + * Determines whether an object can have data
7 + */
8 +return function( owner ) {
9 +
10 + // Accepts only:
11 + // - Node
12 + // - Node.ELEMENT_NODE
13 + // - Node.DOCUMENT_NODE
14 + // - Object
15 + // - Any
16 + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
17 +};
18 +
19 +} );
1 +define( [
2 + "../Data"
3 +], function( Data ) {
4 + "use strict";
5 +
6 + return new Data();
7 +} );
1 +define( [
2 + "../Data"
3 +], function( Data ) {
4 + "use strict";
5 +
6 + return new Data();
7 +} );
This diff is collapsed. Click to expand it.
1 +define( [
2 + "../core",
3 + "../deferred"
4 +], function( jQuery ) {
5 +
6 +"use strict";
7 +
8 +// These usually indicate a programmer mistake during development,
9 +// warn about them ASAP rather than swallowing them by default.
10 +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
11 +
12 +jQuery.Deferred.exceptionHook = function( error, stack ) {
13 +
14 + // Support: IE 8 - 9 only
15 + // Console exists when dev tools are open, which can happen at any time
16 + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
17 + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
18 + }
19 +};
20 +
21 +} );
1 +define( [
2 + "./core",
3 + "./core/nodeName",
4 + "./core/camelCase",
5 + "./core/toType",
6 + "./var/isFunction",
7 + "./var/isWindow",
8 + "./var/slice",
9 +
10 + "./deprecated/ajax-event-alias",
11 + "./deprecated/event"
12 +], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
13 +
14 +"use strict";
15 +
16 +// Support: Android <=4.0 only
17 +// Make sure we trim BOM and NBSP
18 +var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
19 +
20 +// Bind a function to a context, optionally partially applying any
21 +// arguments.
22 +// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
23 +// However, it is not slated for removal any time soon
24 +jQuery.proxy = function( fn, context ) {
25 + var tmp, args, proxy;
26 +
27 + if ( typeof context === "string" ) {
28 + tmp = fn[ context ];
29 + context = fn;
30 + fn = tmp;
31 + }
32 +
33 + // Quick check to determine if target is callable, in the spec
34 + // this throws a TypeError, but we will just return undefined.
35 + if ( !isFunction( fn ) ) {
36 + return undefined;
37 + }
38 +
39 + // Simulated bind
40 + args = slice.call( arguments, 2 );
41 + proxy = function() {
42 + return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
43 + };
44 +
45 + // Set the guid of unique handler to the same of original handler, so it can be removed
46 + proxy.guid = fn.guid = fn.guid || jQuery.guid++;
47 +
48 + return proxy;
49 +};
50 +
51 +jQuery.holdReady = function( hold ) {
52 + if ( hold ) {
53 + jQuery.readyWait++;
54 + } else {
55 + jQuery.ready( true );
56 + }
57 +};
58 +jQuery.isArray = Array.isArray;
59 +jQuery.parseJSON = JSON.parse;
60 +jQuery.nodeName = nodeName;
61 +jQuery.isFunction = isFunction;
62 +jQuery.isWindow = isWindow;
63 +jQuery.camelCase = camelCase;
64 +jQuery.type = toType;
65 +
66 +jQuery.now = Date.now;
67 +
68 +jQuery.isNumeric = function( obj ) {
69 +
70 + // As of jQuery 3.0, isNumeric is limited to
71 + // strings and numbers (primitives or objects)
72 + // that can be coerced to finite numbers (gh-2662)
73 + var type = jQuery.type( obj );
74 + return ( type === "number" || type === "string" ) &&
75 +
76 + // parseFloat NaNs numeric-cast false positives ("")
77 + // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
78 + // subtraction forces infinities to NaN
79 + !isNaN( obj - parseFloat( obj ) );
80 +};
81 +
82 +jQuery.trim = function( text ) {
83 + return text == null ?
84 + "" :
85 + ( text + "" ).replace( rtrim, "" );
86 +};
87 +} );
1 +define( [
2 + "../core",
3 + "../ajax",
4 + "../event"
5 +], function( jQuery ) {
6 +
7 +"use strict";
8 +
9 +jQuery.each( [
10 + "ajaxStart",
11 + "ajaxStop",
12 + "ajaxComplete",
13 + "ajaxError",
14 + "ajaxSuccess",
15 + "ajaxSend"
16 +], function( _i, type ) {
17 + jQuery.fn[ type ] = function( fn ) {
18 + return this.on( type, fn );
19 + };
20 +} );
21 +
22 +} );
1 +define( [
2 + "../core",
3 +
4 + "../event",
5 + "../event/trigger"
6 +], function( jQuery ) {
7 +
8 +"use strict";
9 +
10 +jQuery.fn.extend( {
11 +
12 + bind: function( types, data, fn ) {
13 + return this.on( types, null, data, fn );
14 + },
15 + unbind: function( types, fn ) {
16 + return this.off( types, null, fn );
17 + },
18 +
19 + delegate: function( selector, types, data, fn ) {
20 + return this.on( types, selector, data, fn );
21 + },
22 + undelegate: function( selector, types, fn ) {
23 +
24 + // ( namespace ) or ( selector, types [, fn] )
25 + return arguments.length === 1 ?
26 + this.off( selector, "**" ) :
27 + this.off( types, selector || "**", fn );
28 + },
29 +
30 + hover: function( fnOver, fnOut ) {
31 + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
32 + }
33 +} );
34 +
35 +jQuery.each(
36 + ( "blur focus focusin focusout resize scroll click dblclick " +
37 + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
38 + "change select submit keydown keypress keyup contextmenu" ).split( " " ),
39 + function( _i, name ) {
40 +
41 + // Handle event binding
42 + jQuery.fn[ name ] = function( data, fn ) {
43 + return arguments.length > 0 ?
44 + this.on( name, null, data, fn ) :
45 + this.trigger( name );
46 + };
47 + }
48 +);
49 +
50 +} );
1 +define( [
2 + "./core",
3 + "./core/access",
4 + "./var/isWindow",
5 + "./css"
6 +], function( jQuery, access, isWindow ) {
7 +
8 +"use strict";
9 +
10 +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
11 +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
12 + jQuery.each( {
13 + padding: "inner" + name,
14 + content: type,
15 + "": "outer" + name
16 + }, function( defaultExtra, funcName ) {
17 +
18 + // Margin is only for outerHeight, outerWidth
19 + jQuery.fn[ funcName ] = function( margin, value ) {
20 + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
21 + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
22 +
23 + return access( this, function( elem, type, value ) {
24 + var doc;
25 +
26 + if ( isWindow( elem ) ) {
27 +
28 + // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
29 + return funcName.indexOf( "outer" ) === 0 ?
30 + elem[ "inner" + name ] :
31 + elem.document.documentElement[ "client" + name ];
32 + }
33 +
34 + // Get document width or height
35 + if ( elem.nodeType === 9 ) {
36 + doc = elem.documentElement;
37 +
38 + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
39 + // whichever is greatest
40 + return Math.max(
41 + elem.body[ "scroll" + name ], doc[ "scroll" + name ],
42 + elem.body[ "offset" + name ], doc[ "offset" + name ],
43 + doc[ "client" + name ]
44 + );
45 + }
46 +
47 + return value === undefined ?
48 +
49 + // Get width or height on the element, requesting but not forcing parseFloat
50 + jQuery.css( elem, type, extra ) :
51 +
52 + // Set width or height on the element
53 + jQuery.style( elem, type, value, extra );
54 + }, type, chainable ? margin : undefined, chainable );
55 + };
56 + } );
57 +} );
58 +
59 +return jQuery;
60 +} );
This diff is collapsed. Click to expand it.
1 +define( [
2 + "../core",
3 + "../css/finalPropName",
4 +
5 + "../css"
6 +], function( jQuery, finalPropName ) {
7 +
8 +"use strict";
9 +
10 +function Tween( elem, options, prop, end, easing ) {
11 + return new Tween.prototype.init( elem, options, prop, end, easing );
12 +}
13 +jQuery.Tween = Tween;
14 +
15 +Tween.prototype = {
16 + constructor: Tween,
17 + init: function( elem, options, prop, end, easing, unit ) {
18 + this.elem = elem;
19 + this.prop = prop;
20 + this.easing = easing || jQuery.easing._default;
21 + this.options = options;
22 + this.start = this.now = this.cur();
23 + this.end = end;
24 + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
25 + },
26 + cur: function() {
27 + var hooks = Tween.propHooks[ this.prop ];
28 +
29 + return hooks && hooks.get ?
30 + hooks.get( this ) :
31 + Tween.propHooks._default.get( this );
32 + },
33 + run: function( percent ) {
34 + var eased,
35 + hooks = Tween.propHooks[ this.prop ];
36 +
37 + if ( this.options.duration ) {
38 + this.pos = eased = jQuery.easing[ this.easing ](
39 + percent, this.options.duration * percent, 0, 1, this.options.duration
40 + );
41 + } else {
42 + this.pos = eased = percent;
43 + }
44 + this.now = ( this.end - this.start ) * eased + this.start;
45 +
46 + if ( this.options.step ) {
47 + this.options.step.call( this.elem, this.now, this );
48 + }
49 +
50 + if ( hooks && hooks.set ) {
51 + hooks.set( this );
52 + } else {
53 + Tween.propHooks._default.set( this );
54 + }
55 + return this;
56 + }
57 +};
58 +
59 +Tween.prototype.init.prototype = Tween.prototype;
60 +
61 +Tween.propHooks = {
62 + _default: {
63 + get: function( tween ) {
64 + var result;
65 +
66 + // Use a property on the element directly when it is not a DOM element,
67 + // or when there is no matching style property that exists.
68 + if ( tween.elem.nodeType !== 1 ||
69 + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
70 + return tween.elem[ tween.prop ];
71 + }
72 +
73 + // Passing an empty string as a 3rd parameter to .css will automatically
74 + // attempt a parseFloat and fallback to a string if the parse fails.
75 + // Simple values such as "10px" are parsed to Float;
76 + // complex values such as "rotate(1rad)" are returned as-is.
77 + result = jQuery.css( tween.elem, tween.prop, "" );
78 +
79 + // Empty strings, null, undefined and "auto" are converted to 0.
80 + return !result || result === "auto" ? 0 : result;
81 + },
82 + set: function( tween ) {
83 +
84 + // Use step hook for back compat.
85 + // Use cssHook if its there.
86 + // Use .style if available and use plain properties where available.
87 + if ( jQuery.fx.step[ tween.prop ] ) {
88 + jQuery.fx.step[ tween.prop ]( tween );
89 + } else if ( tween.elem.nodeType === 1 && (
90 + jQuery.cssHooks[ tween.prop ] ||
91 + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
92 + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
93 + } else {
94 + tween.elem[ tween.prop ] = tween.now;
95 + }
96 + }
97 + }
98 +};
99 +
100 +// Support: IE <=9 only
101 +// Panic based approach to setting things on disconnected nodes
102 +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
103 + set: function( tween ) {
104 + if ( tween.elem.nodeType && tween.elem.parentNode ) {
105 + tween.elem[ tween.prop ] = tween.now;
106 + }
107 + }
108 +};
109 +
110 +jQuery.easing = {
111 + linear: function( p ) {
112 + return p;
113 + },
114 + swing: function( p ) {
115 + return 0.5 - Math.cos( p * Math.PI ) / 2;
116 + },
117 + _default: "swing"
118 +};
119 +
120 +jQuery.fx = Tween.prototype.init;
121 +
122 +// Back compat <1.8 extension point
123 +jQuery.fx.step = {};
124 +
125 +} );
1 +define( [
2 + "../core",
3 + "../selector",
4 + "../effects"
5 +], function( jQuery ) {
6 +
7 +"use strict";
8 +
9 +jQuery.expr.pseudos.animated = function( elem ) {
10 + return jQuery.grep( jQuery.timers, function( fn ) {
11 + return elem === fn.elem;
12 + } ).length;
13 +};
14 +
15 +} );
This diff is collapsed. Click to expand it.
1 +define( [
2 + "../core",
3 + "../data/var/dataPriv",
4 + "./support",
5 +
6 + "../event",
7 + "./trigger"
8 +], function( jQuery, dataPriv, support ) {
9 +
10 +"use strict";
11 +
12 +// Support: Firefox <=44
13 +// Firefox doesn't have focus(in | out) events
14 +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
15 +//
16 +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
17 +// focus(in | out) events fire after focus & blur events,
18 +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
19 +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
20 +if ( !support.focusin ) {
21 + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
22 +
23 + // Attach a single capturing handler on the document while someone wants focusin/focusout
24 + var handler = function( event ) {
25 + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
26 + };
27 +
28 + jQuery.event.special[ fix ] = {
29 + setup: function() {
30 +
31 + // Handle: regular nodes (via `this.ownerDocument`), window
32 + // (via `this.document`) & document (via `this`).
33 + var doc = this.ownerDocument || this.document || this,
34 + attaches = dataPriv.access( doc, fix );
35 +
36 + if ( !attaches ) {
37 + doc.addEventListener( orig, handler, true );
38 + }
39 + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
40 + },
41 + teardown: function() {
42 + var doc = this.ownerDocument || this.document || this,
43 + attaches = dataPriv.access( doc, fix ) - 1;
44 +
45 + if ( !attaches ) {
46 + doc.removeEventListener( orig, handler, true );
47 + dataPriv.remove( doc, fix );
48 +
49 + } else {
50 + dataPriv.access( doc, fix, attaches );
51 + }
52 + }
53 + };
54 + } );
55 +}
56 +
57 +return jQuery;
58 +} );
1 +define( [
2 + "../var/support"
3 +], function( support ) {
4 +
5 +"use strict";
6 +
7 +support.focusin = "onfocusin" in window;
8 +
9 +return support;
10 +
11 +} );
1 +define( [
2 + "../core",
3 + "../var/document",
4 + "../data/var/dataPriv",
5 + "../data/var/acceptData",
6 + "../var/hasOwn",
7 + "../var/isFunction",
8 + "../var/isWindow",
9 + "../event"
10 +], function( jQuery, document, dataPriv, acceptData, hasOwn, isFunction, isWindow ) {
11 +
12 +"use strict";
13 +
14 +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
15 + stopPropagationCallback = function( e ) {
16 + e.stopPropagation();
17 + };
18 +
19 +jQuery.extend( jQuery.event, {
20 +
21 + trigger: function( event, data, elem, onlyHandlers ) {
22 +
23 + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
24 + eventPath = [ elem || document ],
25 + type = hasOwn.call( event, "type" ) ? event.type : event,
26 + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
27 +
28 + cur = lastElement = tmp = elem = elem || document;
29 +
30 + // Don't do events on text and comment nodes
31 + if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
32 + return;
33 + }
34 +
35 + // focus/blur morphs to focusin/out; ensure we're not firing them right now
36 + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
37 + return;
38 + }
39 +
40 + if ( type.indexOf( "." ) > -1 ) {
41 +
42 + // Namespaced trigger; create a regexp to match event type in handle()
43 + namespaces = type.split( "." );
44 + type = namespaces.shift();
45 + namespaces.sort();
46 + }
47 + ontype = type.indexOf( ":" ) < 0 && "on" + type;
48 +
49 + // Caller can pass in a jQuery.Event object, Object, or just an event type string
50 + event = event[ jQuery.expando ] ?
51 + event :
52 + new jQuery.Event( type, typeof event === "object" && event );
53 +
54 + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
55 + event.isTrigger = onlyHandlers ? 2 : 3;
56 + event.namespace = namespaces.join( "." );
57 + event.rnamespace = event.namespace ?
58 + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
59 + null;
60 +
61 + // Clean up the event in case it is being reused
62 + event.result = undefined;
63 + if ( !event.target ) {
64 + event.target = elem;
65 + }
66 +
67 + // Clone any incoming data and prepend the event, creating the handler arg list
68 + data = data == null ?
69 + [ event ] :
70 + jQuery.makeArray( data, [ event ] );
71 +
72 + // Allow special events to draw outside the lines
73 + special = jQuery.event.special[ type ] || {};
74 + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
75 + return;
76 + }
77 +
78 + // Determine event propagation path in advance, per W3C events spec (#9951)
79 + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
80 + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
81 +
82 + bubbleType = special.delegateType || type;
83 + if ( !rfocusMorph.test( bubbleType + type ) ) {
84 + cur = cur.parentNode;
85 + }
86 + for ( ; cur; cur = cur.parentNode ) {
87 + eventPath.push( cur );
88 + tmp = cur;
89 + }
90 +
91 + // Only add window if we got to document (e.g., not plain obj or detached DOM)
92 + if ( tmp === ( elem.ownerDocument || document ) ) {
93 + eventPath.push( tmp.defaultView || tmp.parentWindow || window );
94 + }
95 + }
96 +
97 + // Fire handlers on the event path
98 + i = 0;
99 + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
100 + lastElement = cur;
101 + event.type = i > 1 ?
102 + bubbleType :
103 + special.bindType || type;
104 +
105 + // jQuery handler
106 + handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
107 + dataPriv.get( cur, "handle" );
108 + if ( handle ) {
109 + handle.apply( cur, data );
110 + }
111 +
112 + // Native handler
113 + handle = ontype && cur[ ontype ];
114 + if ( handle && handle.apply && acceptData( cur ) ) {
115 + event.result = handle.apply( cur, data );
116 + if ( event.result === false ) {
117 + event.preventDefault();
118 + }
119 + }
120 + }
121 + event.type = type;
122 +
123 + // If nobody prevented the default action, do it now
124 + if ( !onlyHandlers && !event.isDefaultPrevented() ) {
125 +
126 + if ( ( !special._default ||
127 + special._default.apply( eventPath.pop(), data ) === false ) &&
128 + acceptData( elem ) ) {
129 +
130 + // Call a native DOM method on the target with the same name as the event.
131 + // Don't do default actions on window, that's where global variables be (#6170)
132 + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
133 +
134 + // Don't re-trigger an onFOO event when we call its FOO() method
135 + tmp = elem[ ontype ];
136 +
137 + if ( tmp ) {
138 + elem[ ontype ] = null;
139 + }
140 +
141 + // Prevent re-triggering of the same event, since we already bubbled it above
142 + jQuery.event.triggered = type;
143 +
144 + if ( event.isPropagationStopped() ) {
145 + lastElement.addEventListener( type, stopPropagationCallback );
146 + }
147 +
148 + elem[ type ]();
149 +
150 + if ( event.isPropagationStopped() ) {
151 + lastElement.removeEventListener( type, stopPropagationCallback );
152 + }
153 +
154 + jQuery.event.triggered = undefined;
155 +
156 + if ( tmp ) {
157 + elem[ ontype ] = tmp;
158 + }
159 + }
160 + }
161 + }
162 +
163 + return event.result;
164 + },
165 +
166 + // Piggyback on a donor event to simulate a different one
167 + // Used only for `focus(in | out)` events
168 + simulate: function( type, elem, event ) {
169 + var e = jQuery.extend(
170 + new jQuery.Event(),
171 + event,
172 + {
173 + type: type,
174 + isSimulated: true
175 + }
176 + );
177 +
178 + jQuery.event.trigger( e, null, elem );
179 + }
180 +
181 +} );
182 +
183 +jQuery.fn.extend( {
184 +
185 + trigger: function( type, data ) {
186 + return this.each( function() {
187 + jQuery.event.trigger( type, data, this );
188 + } );
189 + },
190 + triggerHandler: function( type, data ) {
191 + var elem = this[ 0 ];
192 + if ( elem ) {
193 + return jQuery.event.trigger( type, data, elem, true );
194 + }
195 + }
196 +} );
197 +
198 +return jQuery;
199 +} );
1 +define( [
2 + "../core"
3 +], function( jQuery ) {
4 +
5 +"use strict";
6 +
7 +// Register as a named AMD module, since jQuery can be concatenated with other
8 +// files that may use define, but not via a proper concatenation script that
9 +// understands anonymous AMD modules. A named AMD is safest and most robust
10 +// way to register. Lowercase jquery is used because AMD module names are
11 +// derived from file names, and jQuery is normally delivered in a lowercase
12 +// file name. Do this after creating the global so that if an AMD module wants
13 +// to call noConflict to hide this version of jQuery, it will work.
14 +
15 +// Note that for maximum portability, libraries that are not jQuery should
16 +// declare themselves as anonymous modules, and avoid setting a global if an
17 +// AMD loader is present. jQuery is a special case. For more information, see
18 +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
19 +
20 +if ( typeof define === "function" && define.amd ) {
21 + define( "jquery", [], function() {
22 + return jQuery;
23 + } );
24 +}
25 +
26 +} );
1 +define( [
2 + "../core"
3 +], function( jQuery ) {
4 +
5 +"use strict";
6 +
7 +var
8 +
9 + // Map over jQuery in case of overwrite
10 + _jQuery = window.jQuery,
11 +
12 + // Map over the $ in case of overwrite
13 + _$ = window.$;
14 +
15 +jQuery.noConflict = function( deep ) {
16 + if ( window.$ === jQuery ) {
17 + window.$ = _$;
18 + }
19 +
20 + if ( deep && window.jQuery === jQuery ) {
21 + window.jQuery = _jQuery;
22 + }
23 +
24 + return jQuery;
25 +};
26 +
27 +// Expose jQuery and $ identifiers, even in AMD
28 +// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
29 +// and CommonJS for browser emulators (#13566)
30 +if ( typeof noGlobal === "undefined" ) {
31 + window.jQuery = window.$ = jQuery;
32 +}
33 +
34 +} );
1 +define( [
2 + "./core",
3 + "./selector",
4 + "./traversing",
5 + "./callbacks",
6 + "./deferred",
7 + "./deferred/exceptionHook",
8 + "./core/ready",
9 + "./data",
10 + "./queue",
11 + "./queue/delay",
12 + "./attributes",
13 + "./event",
14 + "./event/focusin",
15 + "./manipulation",
16 + "./manipulation/_evalUrl",
17 + "./wrap",
18 + "./css",
19 + "./css/hiddenVisibleSelectors",
20 + "./serialize",
21 + "./ajax",
22 + "./ajax/xhr",
23 + "./ajax/script",
24 + "./ajax/jsonp",
25 + "./ajax/load",
26 + "./core/parseXML",
27 + "./core/parseHTML",
28 + "./effects",
29 + "./effects/animatedSelector",
30 + "./offset",
31 + "./dimensions",
32 + "./deprecated",
33 + "./exports/amd",
34 + "./exports/global"
35 +], function( jQuery ) {
36 +
37 +"use strict";
38 +
39 +return jQuery;
40 +
41 +} );
This diff is collapsed. Click to expand it.
1 +define( [
2 + "../ajax"
3 +], function( jQuery ) {
4 +
5 +"use strict";
6 +
7 +jQuery._evalUrl = function( url, options, doc ) {
8 + return jQuery.ajax( {
9 + url: url,
10 +
11 + // Make this explicit, since user can override this through ajaxSetup (#11264)
12 + type: "GET",
13 + dataType: "script",
14 + cache: true,
15 + async: false,
16 + global: false,
17 +
18 + // Only evaluate the response if it is successful (gh-4126)
19 + // dataFilter is not invoked for failure responses, so using it instead
20 + // of the default converter is kludgy but it works.
21 + converters: {
22 + "text script": function() {}
23 + },
24 + dataFilter: function( response ) {
25 + jQuery.globalEval( response, options, doc );
26 + }
27 + } );
28 +};
29 +
30 +return jQuery._evalUrl;
31 +
32 +} );
1 +define( [
2 + "../core",
3 + "../core/toType",
4 + "../core/isAttached",
5 + "./var/rtagName",
6 + "./var/rscriptType",
7 + "./wrapMap",
8 + "./getAll",
9 + "./setGlobalEval"
10 +], function( jQuery, toType, isAttached, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
11 +
12 +"use strict";
13 +
14 +var rhtml = /<|&#?\w+;/;
15 +
16 +function buildFragment( elems, context, scripts, selection, ignored ) {
17 + var elem, tmp, tag, wrap, attached, j,
18 + fragment = context.createDocumentFragment(),
19 + nodes = [],
20 + i = 0,
21 + l = elems.length;
22 +
23 + for ( ; i < l; i++ ) {
24 + elem = elems[ i ];
25 +
26 + if ( elem || elem === 0 ) {
27 +
28 + // Add nodes directly
29 + if ( toType( elem ) === "object" ) {
30 +
31 + // Support: Android <=4.0 only, PhantomJS 1 only
32 + // push.apply(_, arraylike) throws on ancient WebKit
33 + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
34 +
35 + // Convert non-html into a text node
36 + } else if ( !rhtml.test( elem ) ) {
37 + nodes.push( context.createTextNode( elem ) );
38 +
39 + // Convert html into DOM nodes
40 + } else {
41 + tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
42 +
43 + // Deserialize a standard representation
44 + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
45 + wrap = wrapMap[ tag ] || wrapMap._default;
46 + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
47 +
48 + // Descend through wrappers to the right content
49 + j = wrap[ 0 ];
50 + while ( j-- ) {
51 + tmp = tmp.lastChild;
52 + }
53 +
54 + // Support: Android <=4.0 only, PhantomJS 1 only
55 + // push.apply(_, arraylike) throws on ancient WebKit
56 + jQuery.merge( nodes, tmp.childNodes );
57 +
58 + // Remember the top-level container
59 + tmp = fragment.firstChild;
60 +
61 + // Ensure the created nodes are orphaned (#12392)
62 + tmp.textContent = "";
63 + }
64 + }
65 + }
66 +
67 + // Remove wrapper from fragment
68 + fragment.textContent = "";
69 +
70 + i = 0;
71 + while ( ( elem = nodes[ i++ ] ) ) {
72 +
73 + // Skip elements already in the context collection (trac-4087)
74 + if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
75 + if ( ignored ) {
76 + ignored.push( elem );
77 + }
78 + continue;
79 + }
80 +
81 + attached = isAttached( elem );
82 +
83 + // Append to fragment
84 + tmp = getAll( fragment.appendChild( elem ), "script" );
85 +
86 + // Preserve script evaluation history
87 + if ( attached ) {
88 + setGlobalEval( tmp );
89 + }
90 +
91 + // Capture executables
92 + if ( scripts ) {
93 + j = 0;
94 + while ( ( elem = tmp[ j++ ] ) ) {
95 + if ( rscriptType.test( elem.type || "" ) ) {
96 + scripts.push( elem );
97 + }
98 + }
99 + }
100 + }
101 +
102 + return fragment;
103 +}
104 +
105 +return buildFragment;
106 +} );
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.