mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°5621 Move jquery-migrate 3.1.0 to NPM
This commit is contained in:
@@ -86,9 +86,9 @@
|
||||
{% block pPageScripts %}
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'node_modules/jquery/dist/jquery.min.js'|add_itop_version }}"></script>
|
||||
{% if is_development_environment() %}
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/jquery-migrate.dev.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'node_modules/jquery-migrate/dist/jquery-migrate.js'|add_itop_version }}"></script>
|
||||
{% else %}
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/jquery-migrate.prod.min.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'node_modules/jquery-migrate/dist/jquery-migrate.min.js'|add_itop_version }}"></script>
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'node_modules/jquery-ui-dist/jquery-ui.min.js'|add_itop_version }}"></script>
|
||||
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'node_modules/magnific-popup/dist/jquery.magnific-popup.min.js'|add_itop_version }}"></script>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @deprecated 3.2.0 N°5621 Moved to NPM
|
||||
*/
|
||||
|
||||
/*!
|
||||
* jQuery Migrate - v3.1.0 - 2019-06-08
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
|
||||
4
js/jquery-migrate.prod.min.js
vendored
4
js/jquery-migrate.prod.min.js
vendored
File diff suppressed because one or more lines are too long
8
node_modules/.package-lock.json
generated
vendored
8
node_modules/.package-lock.json
generated
vendored
@@ -230,6 +230,14 @@
|
||||
"jquery": ">=1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery-migrate": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.1.0.tgz",
|
||||
"integrity": "sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ==",
|
||||
"peerDependencies": {
|
||||
"jquery": ">=3 <4"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery-ui-dist": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
|
||||
|
||||
16
node_modules/jquery-migrate/.editorconfig
generated
vendored
Normal file
16
node_modules/jquery-migrate/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
8
node_modules/jquery-migrate/.eslintignore
generated
vendored
Normal file
8
node_modules/jquery-migrate/.eslintignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
coverage
|
||||
external
|
||||
node_modules
|
||||
*.min.js
|
||||
src/intro.js
|
||||
src/outro.js
|
||||
test/data/jquery-*.js
|
||||
test/data/jquery.mobile-*.js
|
||||
8
node_modules/jquery-migrate/.eslintrc.json
generated
vendored
Normal file
8
node_modules/jquery-migrate/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "jquery",
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": false,
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
6
node_modules/jquery-migrate/.gitattributes
generated
vendored
Normal file
6
node_modules/jquery-migrate/.gitattributes
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# JS files must always use LF for tools to work
|
||||
*.js eol=lf
|
||||
*.json eol=lf
|
||||
2
node_modules/jquery-migrate/.mailmap
generated
vendored
Normal file
2
node_modules/jquery-migrate/.mailmap
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Igor Kalashnikov <igor.kalashnikov@me.com>
|
||||
Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
|
||||
7
node_modules/jquery-migrate/.travis.yml
generated
vendored
Normal file
7
node_modules/jquery-migrate/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "8"
|
||||
addons:
|
||||
chrome: stable
|
||||
script: "npm run ci"
|
||||
200
node_modules/jquery-migrate/CONTRIBUTING.md
generated
vendored
Normal file
200
node_modules/jquery-migrate/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
# Contributing to jQuery
|
||||
|
||||
1. [Getting Involved](#getting-involved)
|
||||
2. [Discussion](#discussion)
|
||||
3. [How To Report Bugs](#how-to-report-bugs)
|
||||
4. [Core Style Guide](#jquery-core-style-guide)
|
||||
5. [Tips For Bug Patching](#tips-for-jquery-bug-patching)
|
||||
|
||||
|
||||
|
||||
## Getting Involved
|
||||
|
||||
There are a number of ways to get involved with the development of jQuery core. Even if you've never contributed code to an Open Source project before, we're always looking for help identifying bugs, writing and reducing test cases and documentation.
|
||||
|
||||
This is the best way to contribute to jQuery core. Please read through the full guide detailing [How to Report Bugs](#How-to-Report-Bugs).
|
||||
|
||||
## Discussion
|
||||
|
||||
### Forum and IRC
|
||||
|
||||
The jQuery core development team frequently tracks posts on the [jQuery Development Forum](http://forum.jquery.com/developing-jquery-core). If you have longer posts or questions please feel free to post them there. If you think you've found a bug please [file it in the bug tracker](#How-to-Report-Bugs).
|
||||
|
||||
Additionally most of the jQuery core development team can be found in the [#jquery-dev](http://webchat.freenode.net/?channels=jquery-dev) IRC channel on irc.freenode.net.
|
||||
|
||||
### Weekly Status Meetings
|
||||
|
||||
Every week (unless otherwise noted) the jQuery core dev team has a meeting to discuss the progress of current work and to bring forward possible new blocker bugs for discussion.
|
||||
|
||||
The meeting is held in the [#jquery-meeting](http://webchat.freenode.net/?channels=jquery-meeting) IRC channel on irc.freenode.net at [Noon EST](http://www.timeanddate.com/worldclock/fixedtime.html?month=1&day=17&year=2011&hour=12&min=0&sec=0&p1=43) on Mondays.
|
||||
|
||||
[Past Meeting Notes](https://docs.google.com/document/d/1MrLFvoxW7GMlH9KK-bwypn77cC98jUnz7sMW1rg_TP4/edit?hl=en)
|
||||
|
||||
|
||||
## How to Report Bugs
|
||||
|
||||
### Make sure it is a jQuery bug
|
||||
|
||||
Many bugs reported to our bug tracker are actually bugs in user code, not in jQuery code. Keep in mind that just because your code throws an error and the console points to a line number inside of jQuery, this does *not* mean the bug is a jQuery bug; more often than not, these errors result from providing incorrect arguments when calling a jQuery function.
|
||||
|
||||
If you are new to jQuery, it is usually a much better idea to ask for help first in the [Using jQuery Forum](http://forum.jquery.com/using-jquery) or the [jQuery IRC channel](http://webchat.freenode.net/?channels=%23jquery). You will get much quicker support, and you will help avoid tying up the jQuery team with invalid bug reports. These same resources can also be useful if you want to confirm that your bug is indeed a bug in jQuery before filing any tickets.
|
||||
|
||||
|
||||
### Disable any browser extensions
|
||||
|
||||
Make sure you have reproduced the bug with all browser extensions and add-ons disabled, as these can sometimes cause things to break in interesting and unpredictable ways. Try using incognito, stealth or anonymous browsing modes.
|
||||
|
||||
|
||||
### Try the latest version of jQuery
|
||||
|
||||
Bugs in old versions of jQuery may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](http://code.jquery.com/jquery.js).
|
||||
|
||||
### Try an older version of jQuery
|
||||
|
||||
Sometimes, bugs are introduced in newer versions of jQuery that do not exist in previous versions. When possible, it can be useful to try testing with an older release.
|
||||
|
||||
### Reduce, reduce, reduce!
|
||||
|
||||
When you are experiencing a problem, the most useful thing you can possibly do is to [reduce your code](http://webkit.org/quality/reduction.html) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs that are reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible.
|
||||
|
||||
## jQuery Core Style Guide
|
||||
|
||||
See: [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines)
|
||||
|
||||
## Tips For Bug Patching
|
||||
|
||||
|
||||
### Environment: localhost
|
||||
|
||||
To test the plugin you will need:
|
||||
|
||||
* Some kind of localhost server(any will do)
|
||||
* Node.js
|
||||
* NPM (comes with the latest version of Node.js)
|
||||
* Grunt (install with: `npm install grunt -g`)
|
||||
|
||||
|
||||
### Build a Local Copy of the plugin
|
||||
|
||||
Create a fork of the plugin repo on github at http://github.com/jquery/jquery-migrate
|
||||
|
||||
Change directory to your web root directory, whatever that might be:
|
||||
|
||||
```bash
|
||||
$ cd /path/to/your/www/root/
|
||||
```
|
||||
|
||||
Clone your plugin fork to work locally
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:username/jquery-migrate.git
|
||||
```
|
||||
|
||||
Change directory to the newly created dir jquery-migrate/
|
||||
|
||||
```bash
|
||||
$ cd jquery-migrate
|
||||
```
|
||||
|
||||
Add the jquery-migrate master as a remote. I label mine "upstream"
|
||||
|
||||
```bash
|
||||
$ git remote add upstream git://github.com/jquery/jquery-migrate.git
|
||||
```
|
||||
|
||||
Get in the habit of pulling in the "upstream" master to stay up to date as jQuery receives new commits
|
||||
|
||||
```bash
|
||||
$ git pull upstream master
|
||||
```
|
||||
|
||||
Run the Grunt tools:
|
||||
|
||||
```bash
|
||||
$ grunt && grunt watch
|
||||
```
|
||||
|
||||
Now open the jQuery test suite in a browser at http://localhost/test. If there is a port, be sure to include it.
|
||||
|
||||
Success! You just built and tested jQuery!
|
||||
|
||||
|
||||
### Fix a bug from a ticket filed at bugs.jquery.com:
|
||||
|
||||
**NEVER write your patches to the master branch**
|
||||
|
||||
**ALWAYS USE A "TOPIC" BRANCH!** Like so (#### = the ticket #)...
|
||||
|
||||
Make sure you start with your up-to-date master:
|
||||
|
||||
```bash
|
||||
$ git checkout master
|
||||
```
|
||||
|
||||
Create and checkout a new branch that includes the ticket #
|
||||
|
||||
```bash
|
||||
$ git checkout -b bug_####
|
||||
|
||||
# ( Explanation: this useful command will:
|
||||
# "checkout" a "-b" (branch) by the name of "bug_####"
|
||||
# or create it if it doesn't exist )
|
||||
```
|
||||
|
||||
Now you're on branch: bug_####
|
||||
|
||||
Determine the module/file you'll be working in...
|
||||
|
||||
Open up the corresponding /test/unit/?????.js and add the initial failing unit tests. This may seem awkward at first, but in the long run it will make sense. To truly and efficiently patch a bug, you need to be working against that bug.
|
||||
|
||||
Next, open the module files and make your changes
|
||||
|
||||
Run http://localhost/test --> **ALL TESTS MUST PASS**
|
||||
|
||||
Once you're satisfied with your patch...
|
||||
|
||||
Stage the files to be tracked:
|
||||
|
||||
```bash
|
||||
$ git add filename
|
||||
# (you can use "git status" to list the files you've changed)
|
||||
```
|
||||
|
||||
|
||||
( I recommend NEVER, EVER using "git add . " )
|
||||
|
||||
Once you've staged all of your changed files, go ahead and commit them
|
||||
|
||||
```bash
|
||||
$ git commit -m "Brief description of fix. Fixes #0000"
|
||||
```
|
||||
|
||||
For a multiple line commit message, leave off the `-m "description"`.
|
||||
|
||||
You will then be led into vi (or the text editor that you have set up) to complete your commit message.
|
||||
|
||||
Then, push your branch with the bug fix commits to your github fork
|
||||
|
||||
```bash
|
||||
$ git push origin -u bug_####
|
||||
```
|
||||
|
||||
Before you tackle your next bug patch, return to the master:
|
||||
|
||||
```bash
|
||||
$ git checkout master
|
||||
```
|
||||
|
||||
|
||||
### Test Suite Tips...
|
||||
|
||||
By default the plugin runs against the current (jquery-git WIP) version of jQuery. You can select a different version by specifying it in the URL. Files are always retrieved from code.jquery.com.
|
||||
|
||||
Example:
|
||||
|
||||
http://localhost/jquery-migrate/test/?jquery=1.7.2
|
||||
|
||||
This will run the plugin with version 1.7.2 of jQuery, taken from http://code.jquery.com/jquery-1.7.2.js.
|
||||
|
||||
**ALWAYS RUN THE FULL TEST SUITE BEFORE COMMITTING AND PUSHING A PATCH!**
|
||||
|
||||
204
node_modules/jquery-migrate/Gruntfile.js
generated
vendored
Normal file
204
node_modules/jquery-migrate/Gruntfile.js
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
/*global module:false*/
|
||||
module.exports = function( grunt ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var isTravis = process.env.TRAVIS;
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig( {
|
||||
pkg: grunt.file.readJSON( "package.json" ),
|
||||
files: [
|
||||
"src/intro.js",
|
||||
"src/version.js",
|
||||
"src/compareVersions.js",
|
||||
"src/migrate.js",
|
||||
"src/core.js",
|
||||
"src/ajax.js",
|
||||
"src/attributes.js",
|
||||
"src/css.js",
|
||||
"src/data.js",
|
||||
"src/effects.js",
|
||||
"src/event.js",
|
||||
"src/offset.js",
|
||||
"src/serialize.js",
|
||||
"src/traversing.js",
|
||||
"src/deferred.js",
|
||||
"src/outro.js"
|
||||
],
|
||||
tests: {
|
||||
jquery: [
|
||||
"dev+3.x-git",
|
||||
"min+3.x-git.min",
|
||||
"dev+3.4.1",
|
||||
"dev+3.3.1",
|
||||
"dev+3.2.1",
|
||||
"dev+3.1.1",
|
||||
"dev+3.0.0"
|
||||
]
|
||||
},
|
||||
banners: {
|
||||
tiny: "/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.homepage %> */"
|
||||
},
|
||||
concat: {
|
||||
options: {
|
||||
banner: "/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
|
||||
"<%= grunt.template.today('yyyy-mm-dd') %>\n" +
|
||||
" * Copyright <%= pkg.author.name %>\n */\n"
|
||||
},
|
||||
dist: {
|
||||
src: "<%= files %>",
|
||||
dest: "dist/<%= pkg.name %>.js"
|
||||
}
|
||||
},
|
||||
qunit: {
|
||||
files: [ "test/**/index.html" ]
|
||||
},
|
||||
eslint: {
|
||||
options: {
|
||||
|
||||
// See https://github.com/sindresorhus/grunt-eslint/issues/119
|
||||
quiet: true
|
||||
},
|
||||
|
||||
dist: {
|
||||
src: "dist/jquery-migrate.js"
|
||||
},
|
||||
dev: {
|
||||
src: [
|
||||
"Gruntfile.js",
|
||||
"build/**/*.js",
|
||||
"src/**/*.js",
|
||||
"test/**/*.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
all: {
|
||||
files: {
|
||||
"dist/jquery-migrate.min.js":
|
||||
[ "src/migratemute.js", "dist/jquery-migrate.js" ]
|
||||
},
|
||||
options: {
|
||||
preserveComments: false,
|
||||
sourceMap: true,
|
||||
sourceMapName: "dist/jquery-migrate.min.map",
|
||||
report: "min",
|
||||
output: {
|
||||
"ascii_only": true,
|
||||
|
||||
// Support: Android 4.0 only
|
||||
// UglifyJS 3 breaks Android 4.0 if this option is not enabled.
|
||||
// This is in lieu of setting ie8 for all of mangle, compress, and output
|
||||
"ie8": true
|
||||
},
|
||||
banner: "/*! jQuery Migrate v<%= pkg.version %>" +
|
||||
" | (c) <%= pkg.author.name %> | jquery.org/license */",
|
||||
compress: {
|
||||
"hoist_funs": false,
|
||||
loops: false,
|
||||
|
||||
// Support: IE <11
|
||||
// typeofs transformation is unsafe for IE9-10
|
||||
// See https://github.com/mishoo/UglifyJS2/issues/2198
|
||||
typeofs: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
karma: {
|
||||
options: {
|
||||
customLaunchers: {
|
||||
ChromeHeadlessNoSandbox: {
|
||||
base: "ChromeHeadless",
|
||||
flags: [ "--no-sandbox" ]
|
||||
}
|
||||
},
|
||||
frameworks: [ "qunit" ],
|
||||
files: [
|
||||
"https://code.jquery.com/jquery-3.x-git.min.js",
|
||||
"dist/jquery-migrate.min.js",
|
||||
"src/compareVersions.js",
|
||||
|
||||
"test/testinit.js",
|
||||
"test/migrate.js",
|
||||
"test/core.js",
|
||||
"test/ajax.js",
|
||||
"test/attributes.js",
|
||||
"test/css.js",
|
||||
"test/data.js",
|
||||
"test/deferred.js",
|
||||
"test/effects.js",
|
||||
"test/event.js",
|
||||
"test/offset.js",
|
||||
"test/serialize.js",
|
||||
"test/traversing.js",
|
||||
|
||||
{ pattern: "dist/jquery-migrate.js", included: false, served: true },
|
||||
{ pattern: "test/**/*.@(js|css|jpg|html|xml)", included: false, served: true }
|
||||
],
|
||||
client: {
|
||||
clearContext: false,
|
||||
qunit: {
|
||||
showUI: true,
|
||||
testTimeout: 5000
|
||||
}
|
||||
},
|
||||
reporters: [ "dots" ],
|
||||
autoWatch: false,
|
||||
concurrency: 3,
|
||||
captureTimeout: 20 * 1000,
|
||||
singleRun: true
|
||||
},
|
||||
main: {
|
||||
|
||||
// The Chrome sandbox doesn't work on Travis.
|
||||
browsers: [ isTravis ? "ChromeHeadlessNoSandbox" : "ChromeHeadless" ]
|
||||
},
|
||||
|
||||
// To debug tests with Karma:
|
||||
// 1. Run 'grunt karma:chrome-debug' or 'grunt karma:firefox-debug'
|
||||
// (any karma subtask that has singleRun=false)
|
||||
// 2. Press "Debug" in the opened browser window to start
|
||||
// the tests. Unlike the other karma tasks, the debug task will
|
||||
// keep the browser window open.
|
||||
"chrome-debug": {
|
||||
browsers: [ "Chrome" ],
|
||||
singleRun: false
|
||||
},
|
||||
"firefox-debug": {
|
||||
browsers: [ "Firefox" ],
|
||||
singleRun: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
files: [ "src/*.js", "test/*.js" ],
|
||||
tasks: [ "build" ]
|
||||
}
|
||||
} );
|
||||
|
||||
// Load grunt tasks from NPM packages
|
||||
require( "load-grunt-tasks" )( grunt );
|
||||
|
||||
// Integrate jQuery migrate specific tasks
|
||||
grunt.loadTasks( "build/tasks" );
|
||||
|
||||
// Just an alias
|
||||
grunt.registerTask( "test", [ "karma:main" ] );
|
||||
|
||||
grunt.registerTask( "lint", [
|
||||
|
||||
// Running the full eslint task without breaking it down to targets
|
||||
// would run the dist target first which would point to errors in the built
|
||||
// file, making it harder to fix them. We want to check the built file only
|
||||
// if we already know the source files pass the linter.
|
||||
"eslint:dev",
|
||||
"eslint:dist"
|
||||
] );
|
||||
grunt.registerTask( "build", [ "concat", "uglify", "lint" ] );
|
||||
|
||||
grunt.registerTask( "default", [ "build", "test" ] );
|
||||
|
||||
// For CI
|
||||
grunt.registerTask( "ci", [ "build", "test" ] );
|
||||
};
|
||||
36
node_modules/jquery-migrate/LICENSE.txt
generated
vendored
Normal file
36
node_modules/jquery-migrate/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/jquery/jquery-migrate
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
All files located in the node_modules and external directories are
|
||||
externally maintained libraries used by this software which have their
|
||||
own licenses; we recommend you read them, as their terms may differ from
|
||||
the terms above.
|
||||
96
node_modules/jquery-migrate/README.md
generated
vendored
Normal file
96
node_modules/jquery-migrate/README.md
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
[](https://travis-ci.org/jquery/jquery-migrate)
|
||||
|
||||
#### NOTE: To upgrade to jQuery 3.0, you first need version 1.12.x or 2.2.x. If you're using an older version, first upgrade to one of these versions using [jQuery Migrate 1.x](https://github.com/jquery/jquery-migrate/tree/1.x-stable#readme), to resolve any compatibility issues. For more information about the changes made in jQuery 3.0, see the [upgrade guide](https://jquery.com/upgrade-guide/3.0/) and [blog post](https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/).
|
||||
|
||||
# jQuery Migrate
|
||||
Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used.
|
||||
|
||||
That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.
|
||||
|
||||
## Usage
|
||||
|
||||
In your web page, load this plugin *after* the script tag for jQuery, for example:
|
||||
|
||||
```html
|
||||
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-migrate-3.1.0.js"></script>
|
||||
```
|
||||
|
||||
## Download
|
||||
|
||||
### Development vs. Production versions
|
||||
|
||||
The production build is minified and does not generate console warnings. It will only generate a console log message upon loading, or if it detects an error such as an outdated version of jQuery that it does not support. Do not use this file for development or debugging, it will make your life miserable.
|
||||
|
||||
| | Development | Production |
|
||||
|--|-------------|------------|
|
||||
| Debugging enabled | <p align="center">✓</p> | |
|
||||
| Minified | | <p align="center">✓</p> |
|
||||
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.1.0.js](https://code.jquery.com/jquery-migrate-3.1.0.js) | [jquery-migrate-3.1.0.min.js](https://code.jquery.com/jquery-migrate-3.1.0.min.js) |
|
||||
| \* Latest work-in-progress build | [jquery-migrate-git.js](https://code.jquery.com/jquery-migrate-git.js) | [jquery-migrate-git.min.js](https://code.jquery.com/jquery-migrate-git.min.js) |
|
||||
|
||||
|
||||
\* **Work-in-progress build:** Although this file represents the most recent updates to the plugin, it may not have been thoroughly tested. We do not recommend using this file on production sites since it may be unstable; use the released production version instead.
|
||||
|
||||
|
||||
## Debugging
|
||||
|
||||
The development version of the plugin displays warnings in the browser console. Older browsers such as IE9 doesn't support the console interface. No messages will be generated unless you include a debugging library such as [Firebug Lite](https://getfirebug.com/firebuglite) before including the jQuery Migrate plugin. Developers can also inspect the `jQuery.migrateWarnings` array to see what error messages have been generated.
|
||||
|
||||
All warnings generated by this plugin start with the string "JQMIGRATE". A list of the warnings you may see are in [warnings.md](https://github.com/jquery/jquery-migrate/blob/master/warnings.md).
|
||||
|
||||
|
||||
## Migrate Plugin API
|
||||
|
||||
This plugin adds some properties to the `jQuery` object that can be used to programmatically control and examine its behavior:
|
||||
|
||||
`jQuery.migrateWarnings`: This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless `jQuery.migrateReset()` is called.
|
||||
|
||||
`jQuery.migrateMute`: Set this property to `true` to prevent console warnings from being generated in the development version. The `jQuery.migrateWarnings` array is still maintained when this property is set, which allows programmatic inspection without console output.
|
||||
|
||||
`jQuery.migrateTrace`: Set this property to `false` if you want warnings but do not want stack traces to appear on the console.
|
||||
|
||||
`jQuery.migrateReset()`: This method clears the `jQuery.migrateWarnings` array and "forgets" the list of messages that have been seen already.
|
||||
|
||||
`jQuery.migrateVersion`: This string property indicates the version of Migrate in use.
|
||||
|
||||
## Reporting problems
|
||||
|
||||
Bugs that only occur when the jQuery Migrate plugin is used should be reported in the [jQuery Migrate Issue Tracker](https://github.com/jquery/jquery-migrate/issues) and should be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as [jsFiddle.net](https://jsFiddle.net/) or [jsbin.com](https://jsbin.com). Use the development version when you are reporting bugs.
|
||||
|
||||
Bugs in jQuery itself should be reported on the [jQuery Core bug tracker](https://bugs.jquery.com/) and again should be accompanied by a test case from [jsFiddle.net](https://jsFiddle.net/) or [jsbin.com](http://jsbin.com) so that we can reproduce the issue.
|
||||
|
||||
For other questions about the plugin that aren't bugs, ask on the [jQuery Forum](http://forum.jquery.com).
|
||||
|
||||
Build and run tests:
|
||||
====================================================
|
||||
|
||||
## Build with `npm` commands
|
||||
```sh
|
||||
$ git clone git://github.com/jquery/jquery-migrate.git
|
||||
$ cd jquery-migrate
|
||||
$ npm install
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
## Build with [`grunt`](http://gruntjs.com/)
|
||||
|
||||
```sh
|
||||
$ git clone git://github.com/jquery/jquery-migrate.git
|
||||
$ cd jquery-migrate
|
||||
$ npm install
|
||||
$ npm install -g grunt-cli
|
||||
$ grunt build
|
||||
```
|
||||
|
||||
### Run tests
|
||||
|
||||
```sh
|
||||
$ npm test
|
||||
```
|
||||
|
||||
### Or
|
||||
|
||||
```sh
|
||||
$ grunt test
|
||||
```
|
||||
7
node_modules/jquery-migrate/build/copygit.sh
generated
vendored
Normal file
7
node_modules/jquery-migrate/build/copygit.sh
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
scp ../dist/jquery-migrate.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.js
|
||||
curl http://code.origin.jquery.com/jquery-migrate-git.js?reload
|
||||
|
||||
scp ../dist/jquery-migrate.min.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.min.js
|
||||
curl http://code.origin.jquery.com/jquery-migrate-git.min.js?reload
|
||||
|
||||
343
node_modules/jquery-migrate/build/release.js
generated
vendored
Normal file
343
node_modules/jquery-migrate/build/release.js
generated
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
* JQuery Migrate Plugin Release Management
|
||||
*/
|
||||
|
||||
// Debugging variables
|
||||
var dryrun = false,
|
||||
skipRemote = false;
|
||||
|
||||
var fs = require( "fs" ),
|
||||
child = require( "child_process" ),
|
||||
path = require( "path" ),
|
||||
chalk = require( "chalk" );
|
||||
|
||||
var releaseVersion,
|
||||
nextVersion,
|
||||
isBeta,
|
||||
pkg,
|
||||
|
||||
repoURL = "git@github.com:jquery/jquery-migrate.git",
|
||||
branch = "master",
|
||||
|
||||
// Windows needs the .cmd version but will find the non-.cmd
|
||||
// On Windows, also ensure the HOME environment variable is set
|
||||
gruntCmd = process.platform === "win32" ? "grunt.cmd" : "grunt",
|
||||
npmCmd = process.platform === "win32" ? "npm.cmd" : "npm",
|
||||
|
||||
readmeFile = "README.md",
|
||||
packageFile = "package.json",
|
||||
versionFile = path.join( "src", "version.js" ),
|
||||
|
||||
releaseDir = "CDN",
|
||||
distDir = "dist";
|
||||
|
||||
steps(
|
||||
initialize,
|
||||
checkGitStatus,
|
||||
gruntBuild,
|
||||
updateVersions,
|
||||
tagReleaseVersion,
|
||||
gruntBuild,
|
||||
makeReleaseCopies,
|
||||
publishToNPM,
|
||||
setNextVersion,
|
||||
pushToRemote,
|
||||
remindAboutCDN,
|
||||
remindAboutSites,
|
||||
exit
|
||||
);
|
||||
|
||||
function initialize( next ) {
|
||||
|
||||
// -d dryrun mode, no commands are executed at all
|
||||
if ( process.argv[ 2 ] === "-d" ) {
|
||||
process.argv.shift();
|
||||
dryrun = true;
|
||||
console.warn( "=== DRY RUN MODE ===" );
|
||||
}
|
||||
|
||||
// -r skip remote mode, no remote commands are executed
|
||||
// (git push, npm publish, cdn copy)
|
||||
// Reset with `git reset --hard HEAD~2 && git tag -d (version) && grunt`
|
||||
if ( process.argv[ 2 ] === "-r" ) {
|
||||
process.argv.shift();
|
||||
skipRemote = true;
|
||||
console.warn( "=== SKIPREMOTE MODE ===" );
|
||||
}
|
||||
|
||||
// First arg should be the version number being released; this is a proper subset
|
||||
// of a full semver, see https://github.com/mojombo/semver/issues/32
|
||||
// Examples: 1.0.1, 1.0.1-pre, 1.0.1-rc1, 1.0.1-rc1.1
|
||||
var newver, oldver,
|
||||
rsemver = /^(\d+)\.(\d+)\.(\d+)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/,
|
||||
version = rsemver.exec( process.argv[ 2 ] || "" ) || [],
|
||||
major = version[ 1 ],
|
||||
minor = version[ 2 ],
|
||||
patch = version[ 3 ],
|
||||
xbeta = version[ 4 ];
|
||||
|
||||
releaseVersion = process.argv[ 2 ];
|
||||
isBeta = !!xbeta;
|
||||
|
||||
if ( !releaseVersion ) {
|
||||
log( "Usage: release [ -d -r ] releaseVersion" );
|
||||
log( " -d Dry-run; no commands are executed at all" );
|
||||
log( " -r Skip-remote; nothing is pushed externally" );
|
||||
die( "Invalid args" );
|
||||
}
|
||||
if ( !version.length ) {
|
||||
die( "'" + releaseVersion + "' is not a valid semver!" );
|
||||
}
|
||||
if ( xbeta === "pre" ) {
|
||||
die( "Cannot release a 'pre' version!" );
|
||||
}
|
||||
if ( !( fs.existsSync || path.existsSync )( packageFile ) ) {
|
||||
die( "No " + packageFile + " in this directory" );
|
||||
}
|
||||
pkg = JSON.parse( fs.readFileSync( packageFile ) );
|
||||
|
||||
status( "Current version is " + pkg.version + "; generating release " + releaseVersion );
|
||||
version = rsemver.exec( pkg.version );
|
||||
oldver = ( +version[ 1 ] ) * 10000 + ( +version[ 2 ] * 100 ) + ( +version[ 3 ] );
|
||||
newver = ( +major ) * 10000 + ( +minor * 100 ) + ( +patch );
|
||||
if ( newver < oldver ) {
|
||||
die( "Next version is older than current version!" );
|
||||
}
|
||||
|
||||
nextVersion = major + "." + minor + "." + ( isBeta ? patch : +patch + 1 ) + "-pre";
|
||||
next();
|
||||
}
|
||||
|
||||
//TODO: Check that remote doesn't have newer commits:
|
||||
// git fetch repoURL
|
||||
// git remote show repoURL
|
||||
// (look for " BRANCH pushes to BRANCH (up to date)")
|
||||
|
||||
function checkGitStatus( next ) {
|
||||
child.execFile( "git", [ "status" ], function( error, stdout ) {
|
||||
if ( error ) {
|
||||
throw error;
|
||||
}
|
||||
var onBranch = ( ( stdout || "" ).match( /On branch (\S+)/ ) || [] )[ 1 ];
|
||||
if ( onBranch !== branch ) {
|
||||
die( "Branches don't match: Wanted " + branch + ", got " + onBranch );
|
||||
}
|
||||
if ( /Changes to be committed/i.test( stdout ) ) {
|
||||
die( "Please commit changed files before attemping to push a release." );
|
||||
}
|
||||
if ( /Changes not staged for commit/i.test( stdout ) ) {
|
||||
die( "Please stash files before attempting to push a release." );
|
||||
}
|
||||
next();
|
||||
} );
|
||||
}
|
||||
|
||||
function tagReleaseVersion( next ) {
|
||||
git( [ "commit", "-a", "--no-verify", "-m", "Tagging the " + releaseVersion + " release." ],
|
||||
function() {
|
||||
git( [ "tag", releaseVersion ], next );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function updateVersions( next ) {
|
||||
updateSourceVersion( releaseVersion );
|
||||
updateReadmeVersion( releaseVersion );
|
||||
updatePackageVersion( releaseVersion );
|
||||
next();
|
||||
}
|
||||
|
||||
function gruntBuild( next ) {
|
||||
exec( gruntCmd, [], function( error, stdout, stderr ) {
|
||||
if ( error ) {
|
||||
die( error + stderr );
|
||||
}
|
||||
log( stdout || "(no output)" );
|
||||
next();
|
||||
} );
|
||||
}
|
||||
|
||||
function makeReleaseCopies( next ) {
|
||||
if ( !fs.existsSync( releaseDir ) ) {
|
||||
fs.mkdirSync( releaseDir );
|
||||
}
|
||||
var passThrough = function( t ) {
|
||||
return t;
|
||||
};
|
||||
var releaseFiles = {
|
||||
"jquery-migrate-VER.js": passThrough,
|
||||
"jquery-migrate-VER.min.js": fixMinRef,
|
||||
"jquery-migrate-VER.min.map": fixMapRef
|
||||
};
|
||||
Object.keys( releaseFiles ).forEach( function( key ) {
|
||||
var distFile = key.replace( /-VER/g, "" ),
|
||||
distPath = path.join( distDir, distFile ),
|
||||
releaseFile = key.replace( /VER/g, releaseVersion ),
|
||||
releasePath = path.join( releaseDir, releaseFile );
|
||||
|
||||
// Remove Windows CRLF if it's there, on *nix this is a no-op
|
||||
log( "Processing " + distPath + " => " + releasePath );
|
||||
var distText = fs.readFileSync( distPath, "utf8" ).replace( /\r\n/g, "\n" );
|
||||
var releaseText = releaseFiles[ key ]( distText, releaseFile );
|
||||
if ( !dryrun ) {
|
||||
fs.writeFileSync( releasePath, releaseText );
|
||||
}
|
||||
} );
|
||||
next();
|
||||
}
|
||||
|
||||
function publishToNPM( next ) {
|
||||
|
||||
// Don't update "latest" if this is a beta
|
||||
if ( isBeta ) {
|
||||
exec( npmCmd, [ "publish", "--tag", "beta" ], next, skipRemote );
|
||||
} else {
|
||||
exec( npmCmd, [ "publish" ], next, skipRemote );
|
||||
}
|
||||
}
|
||||
|
||||
function setNextVersion( next ) {
|
||||
updateSourceVersion( nextVersion );
|
||||
updatePackageVersion( nextVersion, "master" );
|
||||
git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ],
|
||||
next );
|
||||
}
|
||||
|
||||
function pushToRemote( next ) {
|
||||
git( [ "push", "--tags", repoURL, branch ], next, skipRemote );
|
||||
}
|
||||
|
||||
function remindAboutCDN( next ) {
|
||||
console.log( chalk.red( "TODO: Update CDN with jquery-migrate." +
|
||||
releaseVersion + " files (min and regular)" ) );
|
||||
console.log( chalk.red( " clone codeorigin.jquery.com, git add files, commit, push" ) );
|
||||
next();
|
||||
}
|
||||
|
||||
function remindAboutSites( next ) {
|
||||
console.log( chalk.red( "TODO: Update jquery.com download page to " + releaseVersion ) );
|
||||
next();
|
||||
}
|
||||
|
||||
//==============================
|
||||
|
||||
function steps() {
|
||||
var cur = 0,
|
||||
steps = arguments;
|
||||
( function next() {
|
||||
process.nextTick( function() {
|
||||
steps[ cur++ ]( next );
|
||||
} );
|
||||
} )();
|
||||
}
|
||||
|
||||
function updatePackageVersion( ver, blobVer ) {
|
||||
status( "Updating " + packageFile + " version to " + ver );
|
||||
blobVer = blobVer || ver;
|
||||
pkg.version = ver;
|
||||
pkg.author.url = setBlobVersion( pkg.author.url, blobVer );
|
||||
writeJsonSync( packageFile, pkg );
|
||||
}
|
||||
|
||||
function updateSourceVersion( ver ) {
|
||||
var stmt = "\njQuery.migrateVersion = \"" + ver + "\";\n";
|
||||
|
||||
status( "Updating " + stmt.replace( /\n/g, "" ) );
|
||||
if ( !dryrun ) {
|
||||
fs.writeFileSync( versionFile, stmt );
|
||||
}
|
||||
}
|
||||
|
||||
function updateReadmeVersion() {
|
||||
var readme = fs.readFileSync( readmeFile, "utf8" );
|
||||
|
||||
// Change version references from the old version to the new one.
|
||||
// The regex can update beta versions in case it was changed manually.
|
||||
if ( isBeta ) {
|
||||
status( "Skipping " + readmeFile + " update (beta release)" );
|
||||
} else {
|
||||
status( "Updating " + readmeFile );
|
||||
readme = readme.replace(
|
||||
/jquery-migrate-\d+\.\d+\.\d+(?:-\w+)?/g,
|
||||
"jquery-migrate-" + releaseVersion
|
||||
);
|
||||
if ( !dryrun ) {
|
||||
fs.writeFileSync( readmeFile, readme );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setBlobVersion( s, v ) {
|
||||
return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|master)/, "/blob/" + v );
|
||||
}
|
||||
|
||||
function writeJsonSync( fname, json ) {
|
||||
if ( dryrun ) {
|
||||
console.log( JSON.stringify( json, null, " " ) );
|
||||
} else {
|
||||
fs.writeFileSync( fname, JSON.stringify( json, null, "\t" ) + "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
function fixMinRef( oldText ) {
|
||||
var mapRef = new RegExp( "^//# sourceMappingURL=jquery-migrate.min.map\\n?", "m" );
|
||||
|
||||
// Remove the ref for now rather than try to fix it
|
||||
var newText = oldText.replace( mapRef, "" );
|
||||
if ( oldText === newText ) {
|
||||
throw Error( "fixMinRef: Unable to find the sourceMappingURL" );
|
||||
}
|
||||
return newText;
|
||||
}
|
||||
|
||||
function fixMapRef( oldText, newFile ) {
|
||||
var mapJSON = JSON.parse( oldText );
|
||||
var sources = mapJSON.sources;
|
||||
if ( sources.join() !== "../src/migratemute.js,jquery-migrate.js" ) {
|
||||
throw Error( "fixMapRef: Unexpected sources entry: " + sources );
|
||||
}
|
||||
|
||||
// This file isn't published, not sure the best way to deal with that
|
||||
sources[ 0 ] = "migratemute.js";
|
||||
sources[ 1 ] = newFile.replace( /\.map$/, ".js" );
|
||||
return JSON.stringify( mapJSON );
|
||||
}
|
||||
|
||||
function git( args, fn, skip ) {
|
||||
exec( "git", args, fn, skip );
|
||||
}
|
||||
|
||||
function exec( cmd, args, fn, skip ) {
|
||||
if ( dryrun || skip ) {
|
||||
log( chalk.black.bgBlue( "# " + cmd + " " + args.join( " " ) ) );
|
||||
fn();
|
||||
} else {
|
||||
log( chalk.green( cmd + " " + args.join( " " ) ) );
|
||||
child.execFile( cmd, args, { env: process.env },
|
||||
function( err, stdout, stderr ) {
|
||||
if ( err ) {
|
||||
die( stderr || stdout || err );
|
||||
}
|
||||
fn();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function status( msg ) {
|
||||
console.log( chalk.black.bgGreen( msg ) );
|
||||
}
|
||||
|
||||
function log( msg ) {
|
||||
console.log( msg );
|
||||
}
|
||||
|
||||
function die( msg ) {
|
||||
console.error( chalk.red( "ERROR: " + msg ) );
|
||||
process.exit( 1 );
|
||||
}
|
||||
|
||||
function exit() {
|
||||
process.exit( 0 );
|
||||
}
|
||||
62
node_modules/jquery-migrate/build/tasks/testswarm.js
generated
vendored
Normal file
62
node_modules/jquery-migrate/build/tasks/testswarm.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function( grunt ) {
|
||||
grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
|
||||
timeout ) {
|
||||
var jobName, config, tests,
|
||||
testswarm = require( "testswarm" ),
|
||||
runs = {},
|
||||
done = this.async(),
|
||||
pull = /PR-(\d+)/.exec( commit );
|
||||
|
||||
projectName = projectName || "jquerymigrate";
|
||||
config = grunt.file.readJSON( configFile )[ projectName ];
|
||||
browserSets = browserSets || config.browserSets;
|
||||
|
||||
if ( browserSets[ 0 ] === "[" ) {
|
||||
|
||||
// We got an array, parse it
|
||||
browserSets = JSON.parse( browserSets );
|
||||
}
|
||||
timeout = timeout || 1000 * 60 * 15;
|
||||
tests = grunt.config( "tests" ).jquery;
|
||||
|
||||
if ( pull ) {
|
||||
jobName = "Pull <a href='https://github.com/jquery/jquery-migrate/pull/" +
|
||||
pull[ 1 ] + "'>#" + pull[ 1 ] + "</a>";
|
||||
} else {
|
||||
jobName = "Commit <a href='https://github.com/jquery/jquery-migrate/commit/" +
|
||||
commit + "'>" + commit.substr( 0, 10 ) + "</a>";
|
||||
}
|
||||
|
||||
tests.forEach( function( test ) {
|
||||
var pluginjQuery = test.split( "+" );
|
||||
runs[ test ] = config.testUrl + commit + "/test/index.html?plugin=" +
|
||||
pluginjQuery[ 0 ] + "&jquery=" + pluginjQuery[ 1 ];
|
||||
} );
|
||||
|
||||
// TODO: create separate job for git so we can do different browsersets
|
||||
testswarm.createClient( {
|
||||
url: config.swarmUrl
|
||||
} )
|
||||
.addReporter( testswarm.reporters.cli )
|
||||
.auth( {
|
||||
id: config.authUsername,
|
||||
token: config.authToken
|
||||
} )
|
||||
.addjob(
|
||||
{
|
||||
name: jobName,
|
||||
runs: runs,
|
||||
runMax: config.runMax,
|
||||
browserSets: browserSets,
|
||||
timeout: timeout
|
||||
}, function( err, passed ) {
|
||||
if ( err ) {
|
||||
grunt.log.error( err );
|
||||
}
|
||||
done( passed );
|
||||
}
|
||||
);
|
||||
} );
|
||||
};
|
||||
8
node_modules/jquery-migrate/dist/.eslintrc.json
generated
vendored
Normal file
8
node_modules/jquery-migrate/dist/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../src/.eslintrc.json",
|
||||
"root": true,
|
||||
"rules": {
|
||||
// That is okay for the built version
|
||||
"no-multiple-empty-lines": "off"
|
||||
}
|
||||
}
|
||||
678
node_modules/jquery-migrate/dist/jquery-migrate.js
generated
vendored
Normal file
678
node_modules/jquery-migrate/dist/jquery-migrate.js
generated
vendored
Normal file
@@ -0,0 +1,678 @@
|
||||
/*!
|
||||
* jQuery Migrate - v3.1.0 - 2019-06-08
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
*/
|
||||
;( function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery" ], function ( jQuery ) {
|
||||
return factory( jQuery, window );
|
||||
} );
|
||||
} else if ( typeof module === "object" && module.exports ) {
|
||||
|
||||
// Node/CommonJS
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = factory( require( "jquery" ), window );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery, window );
|
||||
}
|
||||
} )( function( jQuery, window ) {
|
||||
"use strict";
|
||||
|
||||
|
||||
jQuery.migrateVersion = "3.1.0";
|
||||
|
||||
/* exported jQueryVersionSince, compareVersions */
|
||||
|
||||
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
|
||||
function compareVersions( v1, v2 ) {
|
||||
var rVersionParts = /^(\d+)\.(\d+)\.(\d+)/,
|
||||
v1p = rVersionParts.exec( v1 ) || [ ],
|
||||
v2p = rVersionParts.exec( v2 ) || [ ];
|
||||
|
||||
for ( var i = 1; i <= 3; i++ ) {
|
||||
if ( +v1p[ i ] > +v2p[ i ] ) {
|
||||
return 1;
|
||||
}
|
||||
if ( +v1p[ i ] < +v2p[ i ] ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function jQueryVersionSince( version ) {
|
||||
return compareVersions( jQuery.fn.jquery, version ) >= 0;
|
||||
}
|
||||
|
||||
/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */
|
||||
|
||||
( function() {
|
||||
|
||||
// Support: IE9 only
|
||||
// IE9 only creates console object when dev tools are first opened
|
||||
// IE9 console is a host object, callable but doesn't have .apply()
|
||||
if ( !window.console || !window.console.log ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Need jQuery 3.0.0+ and no older Migrate loaded
|
||||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
|
||||
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
|
||||
}
|
||||
if ( jQuery.migrateWarnings ) {
|
||||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
|
||||
}
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
window.console.log( "JQMIGRATE: Migrate is installed" +
|
||||
( jQuery.migrateMute ? "" : " with logging active" ) +
|
||||
", version " + jQuery.migrateVersion );
|
||||
|
||||
} )();
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg ) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
function migrateWarnFunc( obj, prop, newFunc, msg ) {
|
||||
obj[ prop ] = function() {
|
||||
migrateWarn( msg );
|
||||
return newFunc.apply( this, arguments );
|
||||
};
|
||||
}
|
||||
|
||||
if ( window.document.compatMode === "BackCompat" ) {
|
||||
|
||||
// JQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
|
||||
|
||||
var oldInit = jQuery.fn.init,
|
||||
oldIsNumeric = jQuery.isNumeric,
|
||||
oldFind = jQuery.find,
|
||||
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
|
||||
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g;
|
||||
|
||||
jQuery.fn.init = function( arg1 ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
if ( typeof arg1 === "string" && arg1 === "#" ) {
|
||||
|
||||
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
||||
migrateWarn( "jQuery( '#' ) is not a valid selector" );
|
||||
args[ 0 ] = [];
|
||||
}
|
||||
|
||||
return oldInit.apply( this, args );
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
jQuery.find = function( selector ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Support: PhantomJS 1.x
|
||||
// String#match fails to match when used with a //g RegExp, only on some strings
|
||||
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// First see if qS thinks it's a valid selector, if so avoid a false positive
|
||||
try {
|
||||
window.document.querySelector( selector );
|
||||
} catch ( err1 ) {
|
||||
|
||||
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
|
||||
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
|
||||
return "[" + attr + op + "\"" + value + "\"]";
|
||||
} );
|
||||
|
||||
// If the regexp *may* have created an invalid selector, don't update it
|
||||
// Note that there may be false alarms if selector uses jQuery extensions
|
||||
try {
|
||||
window.document.querySelector( selector );
|
||||
migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
|
||||
args[ 0 ] = selector;
|
||||
} catch ( err2 ) {
|
||||
migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oldFind.apply( this, args );
|
||||
};
|
||||
|
||||
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
|
||||
var findProp;
|
||||
for ( findProp in oldFind ) {
|
||||
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
|
||||
jQuery.find[ findProp ] = oldFind[ findProp ];
|
||||
}
|
||||
}
|
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() {
|
||||
migrateWarn( "jQuery.fn.size() is deprecated and removed; use the .length property" );
|
||||
return this.length;
|
||||
};
|
||||
|
||||
jQuery.parseJSON = function() {
|
||||
migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" );
|
||||
return JSON.parse.apply( null, arguments );
|
||||
};
|
||||
|
||||
jQuery.isNumeric = function( val ) {
|
||||
|
||||
// The jQuery 2.2.3 implementation of isNumeric
|
||||
function isNumeric2( obj ) {
|
||||
var realStringObj = obj && obj.toString();
|
||||
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
|
||||
}
|
||||
|
||||
var newValue = oldIsNumeric( val ),
|
||||
oldValue = isNumeric2( val );
|
||||
|
||||
if ( newValue !== oldValue ) {
|
||||
migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" );
|
||||
}
|
||||
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
if ( jQueryVersionSince( "3.3.0" ) ) {
|
||||
migrateWarnFunc( jQuery, "isWindow",
|
||||
function( obj ) {
|
||||
return obj != null && obj === obj.window;
|
||||
},
|
||||
"jQuery.isWindow() is deprecated"
|
||||
);
|
||||
}
|
||||
|
||||
migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady,
|
||||
"jQuery.holdReady is deprecated" );
|
||||
|
||||
migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
|
||||
"jQuery.unique is deprecated; use jQuery.uniqueSort" );
|
||||
|
||||
// Now jQuery.expr.pseudos is the standard incantation
|
||||
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
|
||||
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
|
||||
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
|
||||
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
|
||||
|
||||
// Prior to jQuery 3.2 there were internal refs so we don't warn there
|
||||
if ( jQueryVersionSince( "3.2.0" ) ) {
|
||||
migrateWarnFunc( jQuery, "nodeName", jQuery.nodeName,
|
||||
"jQuery.nodeName is deprecated" );
|
||||
}
|
||||
|
||||
|
||||
var oldAjax = jQuery.ajax;
|
||||
|
||||
jQuery.ajax = function( ) {
|
||||
var jQXHR = oldAjax.apply( this, arguments );
|
||||
|
||||
// Be sure we got a jQXHR (e.g., not sync)
|
||||
if ( jQXHR.promise ) {
|
||||
migrateWarnFunc( jQXHR, "success", jQXHR.done,
|
||||
"jQXHR.success is deprecated and removed" );
|
||||
migrateWarnFunc( jQXHR, "error", jQXHR.fail,
|
||||
"jQXHR.error is deprecated and removed" );
|
||||
migrateWarnFunc( jQXHR, "complete", jQXHR.always,
|
||||
"jQXHR.complete is deprecated and removed" );
|
||||
}
|
||||
|
||||
return jQXHR;
|
||||
};
|
||||
|
||||
|
||||
var oldRemoveAttr = jQuery.fn.removeAttr,
|
||||
oldToggleClass = jQuery.fn.toggleClass,
|
||||
rmatchNonSpace = /\S+/g;
|
||||
|
||||
jQuery.fn.removeAttr = function( name ) {
|
||||
var self = this;
|
||||
|
||||
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
|
||||
if ( jQuery.expr.match.bool.test( attr ) ) {
|
||||
migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
|
||||
self.prop( attr, false );
|
||||
}
|
||||
} );
|
||||
|
||||
return oldRemoveAttr.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.fn.toggleClass = function( state ) {
|
||||
|
||||
// Only deprecating no-args or single boolean arg
|
||||
if ( state !== undefined && typeof state !== "boolean" ) {
|
||||
return oldToggleClass.apply( this, arguments );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" );
|
||||
|
||||
// Toggle entire class name of each element
|
||||
return this.each( function() {
|
||||
var className = this.getAttribute && this.getAttribute( "class" ) || "";
|
||||
|
||||
if ( className ) {
|
||||
jQuery.data( this, "__className__", className );
|
||||
}
|
||||
|
||||
// If the element has a class name or if we're passed `false`,
|
||||
// then remove the whole classname (if there was one, the above saved it).
|
||||
// Otherwise bring back whatever was previously saved (if anything),
|
||||
// falling back to the empty string if nothing was stored.
|
||||
if ( this.setAttribute ) {
|
||||
this.setAttribute( "class",
|
||||
className || state === false ?
|
||||
"" :
|
||||
jQuery.data( this, "__className__" ) || ""
|
||||
);
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
|
||||
var internalSwapCall = false;
|
||||
|
||||
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
||||
if ( jQuery.swap ) {
|
||||
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
|
||||
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
|
||||
|
||||
if ( oldHook ) {
|
||||
jQuery.cssHooks[ name ].get = function() {
|
||||
var ret;
|
||||
|
||||
internalSwapCall = true;
|
||||
ret = oldHook.apply( this, arguments );
|
||||
internalSwapCall = false;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
jQuery.swap = function( elem, options, callback, args ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
if ( !internalSwapCall ) {
|
||||
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.apply( elem, args || [] );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
var oldData = jQuery.data;
|
||||
|
||||
jQuery.data = function( elem, name, value ) {
|
||||
var curData;
|
||||
|
||||
// Name can be an object, and each entry in the object is meant to be set as data
|
||||
if ( name && typeof name === "object" && arguments.length === 2 ) {
|
||||
curData = jQuery.hasData( elem ) && oldData.call( this, elem );
|
||||
var sameKeys = {};
|
||||
for ( var key in name ) {
|
||||
if ( key !== jQuery.camelCase( key ) ) {
|
||||
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key );
|
||||
curData[ key ] = name[ key ];
|
||||
} else {
|
||||
sameKeys[ key ] = name[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
oldData.call( this, elem, sameKeys );
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// If the name is transformed, look for the un-transformed name in the data object
|
||||
if ( name && typeof name === "string" && name !== jQuery.camelCase( name ) ) {
|
||||
curData = jQuery.hasData( elem ) && oldData.call( this, elem );
|
||||
if ( curData && name in curData ) {
|
||||
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name );
|
||||
if ( arguments.length > 2 ) {
|
||||
curData[ name ] = value;
|
||||
}
|
||||
return curData[ name ];
|
||||
}
|
||||
}
|
||||
|
||||
return oldData.apply( this, arguments );
|
||||
};
|
||||
|
||||
var oldTweenRun = jQuery.Tween.prototype.run;
|
||||
var linearEasing = function( pct ) {
|
||||
return pct;
|
||||
};
|
||||
|
||||
jQuery.Tween.prototype.run = function( ) {
|
||||
if ( jQuery.easing[ this.easing ].length > 1 ) {
|
||||
migrateWarn(
|
||||
"'jQuery.easing." + this.easing.toString() + "' should use only one argument"
|
||||
);
|
||||
|
||||
jQuery.easing[ this.easing ] = linearEasing;
|
||||
}
|
||||
|
||||
oldTweenRun.apply( this, arguments );
|
||||
};
|
||||
|
||||
var intervalValue = jQuery.fx.interval || 13,
|
||||
intervalMsg = "jQuery.fx.interval is deprecated";
|
||||
|
||||
// Support: IE9, Android <=4.4
|
||||
// Avoid false positives on browsers that lack rAF
|
||||
// Don't warn if document is hidden, jQuery uses setTimeout (#292)
|
||||
if ( window.requestAnimationFrame ) {
|
||||
Object.defineProperty( jQuery.fx, "interval", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
if ( !window.document.hidden ) {
|
||||
migrateWarn( intervalMsg );
|
||||
}
|
||||
return intervalValue;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( intervalMsg );
|
||||
intervalValue = newValue;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
var oldLoad = jQuery.fn.load,
|
||||
oldEventAdd = jQuery.event.add,
|
||||
originalFix = jQuery.event.fix;
|
||||
|
||||
jQuery.event.props = [];
|
||||
jQuery.event.fixHooks = {};
|
||||
|
||||
migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat,
|
||||
"jQuery.event.props.concat() is deprecated and removed" );
|
||||
|
||||
jQuery.event.fix = function( originalEvent ) {
|
||||
var event,
|
||||
type = originalEvent.type,
|
||||
fixHook = this.fixHooks[ type ],
|
||||
props = jQuery.event.props;
|
||||
|
||||
if ( props.length ) {
|
||||
migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() );
|
||||
while ( props.length ) {
|
||||
jQuery.event.addProp( props.pop() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fixHook && !fixHook._migrated_ ) {
|
||||
fixHook._migrated_ = true;
|
||||
migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type );
|
||||
if ( ( props = fixHook.props ) && props.length ) {
|
||||
while ( props.length ) {
|
||||
jQuery.event.addProp( props.pop() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event = originalFix.call( this, originalEvent );
|
||||
|
||||
return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
|
||||
};
|
||||
|
||||
jQuery.event.add = function( elem, types ) {
|
||||
|
||||
// This misses the multiple-types case but that seems awfully rare
|
||||
if ( elem === window && types === "load" && window.document.readyState === "complete" ) {
|
||||
migrateWarn( "jQuery(window).on('load'...) called after load event occurred" );
|
||||
}
|
||||
return oldEventAdd.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
|
||||
|
||||
jQuery.fn[ name ] = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0 );
|
||||
|
||||
// If this is an ajax load() the first arg should be the string URL;
|
||||
// technically this could also be the "Anything" arg of the event .load()
|
||||
// which just goes to show why this dumb signature has been deprecated!
|
||||
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
||||
if ( name === "load" && typeof args[ 0 ] === "string" ) {
|
||||
return oldLoad.apply( this, args );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn." + name + "() is deprecated" );
|
||||
|
||||
args.splice( 0, 0, name );
|
||||
if ( arguments.length ) {
|
||||
return this.on.apply( this, args );
|
||||
}
|
||||
|
||||
// Use .triggerHandler here because:
|
||||
// - load and unload events don't need to bubble, only applied to window or image
|
||||
// - error event should not bubble to window, although it does pre-1.7
|
||||
// See http://bugs.jquery.com/ticket/11820
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
} );
|
||||
|
||||
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
|
||||
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
||||
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
|
||||
function( _i, name ) {
|
||||
|
||||
// Handle event binding
|
||||
jQuery.fn[ name ] = function( data, fn ) {
|
||||
migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" );
|
||||
return arguments.length > 0 ?
|
||||
this.on( name, null, data, fn ) :
|
||||
this.trigger( name );
|
||||
};
|
||||
} );
|
||||
|
||||
// Trigger "ready" event only once, on document ready
|
||||
jQuery( function() {
|
||||
jQuery( window.document ).triggerHandler( "ready" );
|
||||
} );
|
||||
|
||||
jQuery.event.special.ready = {
|
||||
setup: function() {
|
||||
if ( this === window.document ) {
|
||||
migrateWarn( "'ready' event is deprecated" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
jQuery.fn.extend( {
|
||||
|
||||
bind: function( types, data, fn ) {
|
||||
migrateWarn( "jQuery.fn.bind() is deprecated" );
|
||||
return this.on( types, null, data, fn );
|
||||
},
|
||||
unbind: function( types, fn ) {
|
||||
migrateWarn( "jQuery.fn.unbind() is deprecated" );
|
||||
return this.off( types, null, fn );
|
||||
},
|
||||
delegate: function( selector, types, data, fn ) {
|
||||
migrateWarn( "jQuery.fn.delegate() is deprecated" );
|
||||
return this.on( types, selector, data, fn );
|
||||
},
|
||||
undelegate: function( selector, types, fn ) {
|
||||
migrateWarn( "jQuery.fn.undelegate() is deprecated" );
|
||||
return arguments.length === 1 ?
|
||||
this.off( selector, "**" ) :
|
||||
this.off( types, selector || "**", fn );
|
||||
},
|
||||
hover: function( fnOver, fnOut ) {
|
||||
migrateWarn( "jQuery.fn.hover() is deprecated" );
|
||||
return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
var oldOffset = jQuery.fn.offset;
|
||||
|
||||
jQuery.fn.offset = function() {
|
||||
var docElem,
|
||||
elem = this[ 0 ],
|
||||
origin = { top: 0, left: 0 };
|
||||
|
||||
if ( !elem || !elem.nodeType ) {
|
||||
migrateWarn( "jQuery.fn.offset() requires a valid DOM element" );
|
||||
return origin;
|
||||
}
|
||||
|
||||
docElem = ( elem.ownerDocument || window.document ).documentElement;
|
||||
if ( !jQuery.contains( docElem, elem ) ) {
|
||||
migrateWarn( "jQuery.fn.offset() requires an element connected to a document" );
|
||||
return origin;
|
||||
}
|
||||
|
||||
return oldOffset.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var oldParam = jQuery.param;
|
||||
|
||||
jQuery.param = function( data, traditional ) {
|
||||
var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
||||
|
||||
if ( traditional === undefined && ajaxTraditional ) {
|
||||
|
||||
migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
|
||||
traditional = ajaxTraditional;
|
||||
}
|
||||
|
||||
return oldParam.call( this, data, traditional );
|
||||
};
|
||||
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var oldDeferred = jQuery.Deferred,
|
||||
tuples = [
|
||||
|
||||
// Action, add listener, callbacks, .then handlers, final state
|
||||
[ "resolve", "done", jQuery.Callbacks( "once memory" ),
|
||||
jQuery.Callbacks( "once memory" ), "resolved" ],
|
||||
[ "reject", "fail", jQuery.Callbacks( "once memory" ),
|
||||
jQuery.Callbacks( "once memory" ), "rejected" ],
|
||||
[ "notify", "progress", jQuery.Callbacks( "memory" ),
|
||||
jQuery.Callbacks( "memory" ) ]
|
||||
];
|
||||
|
||||
jQuery.Deferred = function( func ) {
|
||||
var deferred = oldDeferred(),
|
||||
promise = deferred.promise();
|
||||
|
||||
deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
|
||||
var fns = arguments;
|
||||
|
||||
migrateWarn( "deferred.pipe() is deprecated" );
|
||||
|
||||
return jQuery.Deferred( function( newDefer ) {
|
||||
jQuery.each( tuples, function( i, tuple ) {
|
||||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
||||
|
||||
// Deferred.done(function() { bind to newDefer or newDefer.resolve })
|
||||
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
||||
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
||||
deferred[ tuple[ 1 ] ]( function() {
|
||||
var returned = fn && fn.apply( this, arguments );
|
||||
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
||||
returned.promise()
|
||||
.done( newDefer.resolve )
|
||||
.fail( newDefer.reject )
|
||||
.progress( newDefer.notify );
|
||||
} else {
|
||||
newDefer[ tuple[ 0 ] + "With" ](
|
||||
this === promise ? newDefer.promise() : this,
|
||||
fn ? [ returned ] : arguments
|
||||
);
|
||||
}
|
||||
} );
|
||||
} );
|
||||
fns = null;
|
||||
} ).promise();
|
||||
|
||||
};
|
||||
|
||||
if ( func ) {
|
||||
func.call( deferred, deferred );
|
||||
}
|
||||
|
||||
return deferred;
|
||||
};
|
||||
|
||||
// Preserve handler of uncaught exceptions in promise chains
|
||||
jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
|
||||
|
||||
return jQuery;
|
||||
} );
|
||||
3
node_modules/jquery-migrate/dist/jquery-migrate.min.js
generated
vendored
Normal file
3
node_modules/jquery-migrate/dist/jquery-migrate.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/jquery-migrate/dist/jquery-migrate.min.map
generated
vendored
Normal file
1
node_modules/jquery-migrate/dist/jquery-migrate.min.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
82
node_modules/jquery-migrate/package.json
generated
vendored
Normal file
82
node_modules/jquery-migrate/package.json
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"name": "jquery-migrate",
|
||||
"title": "jQuery Migrate",
|
||||
"description": "Migrate older jQuery code to jQuery 3.0+",
|
||||
"main": "dist/jquery-migrate.js",
|
||||
"version": "3.1.0",
|
||||
"homepage": "https://github.com/jquery/jquery-migrate",
|
||||
"author": {
|
||||
"name": "OpenJS Foundation and other contributors",
|
||||
"url": "https://openjsf.org"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jquery/jquery-migrate.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://bugs.jquery.com/"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "grunt build",
|
||||
"test": "grunt test",
|
||||
"ci": "grunt ci"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"jquery": ">=3 <4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chalk": "2.4.2",
|
||||
"commitplease": "3.2.0",
|
||||
"eslint-config-jquery": "2.0.0",
|
||||
"grunt": "1.0.4",
|
||||
"grunt-cli": "1.3.2",
|
||||
"grunt-contrib-concat": "1.0.1",
|
||||
"grunt-contrib-uglify": "4.0.1",
|
||||
"grunt-contrib-watch": "1.1.0",
|
||||
"grunt-eslint": "21.0.0",
|
||||
"grunt-karma": "3.0.2",
|
||||
"karma": "4.1.0",
|
||||
"karma-browserstack-launcher": "1.5.1",
|
||||
"karma-chrome-launcher": "2.2.0",
|
||||
"karma-firefox-launcher": "1.1.0",
|
||||
"karma-qunit": "3.1.2",
|
||||
"jquery": "3.4.1",
|
||||
"load-grunt-tasks": "5.0.0",
|
||||
"qunit": "2.4.1",
|
||||
"testswarm": "1.1.0"
|
||||
},
|
||||
"keywords": [
|
||||
"jquery",
|
||||
"javascript",
|
||||
"browser",
|
||||
"plugin",
|
||||
"migrate"
|
||||
],
|
||||
"commitplease": {
|
||||
"components": [
|
||||
"Docs",
|
||||
"Tests",
|
||||
"Build",
|
||||
"Release",
|
||||
"Core",
|
||||
"Ajax",
|
||||
"Attributes",
|
||||
"Callbacks",
|
||||
"CSS",
|
||||
"Data",
|
||||
"Deferred",
|
||||
"Deprecated",
|
||||
"Dimensions",
|
||||
"Effects",
|
||||
"Event",
|
||||
"Manipulation",
|
||||
"Offset",
|
||||
"Queue",
|
||||
"Selector",
|
||||
"Serialize",
|
||||
"Traversing",
|
||||
"Wrap"
|
||||
]
|
||||
}
|
||||
}
|
||||
26
node_modules/jquery-migrate/src/.eslintrc.json
generated
vendored
Normal file
26
node_modules/jquery-migrate/src/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": false,
|
||||
"node": false
|
||||
},
|
||||
// Support: IE <=9 only, Android <=4.0 only
|
||||
// The above browsers are failing a lot of tests in the ES5
|
||||
// test suite at http://test262.ecmascript.org.
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 3
|
||||
},
|
||||
"globals": {
|
||||
"window": true,
|
||||
|
||||
"define": true,
|
||||
"module": true,
|
||||
|
||||
"jQuery": true,
|
||||
"migrateWarn": true,
|
||||
"migrateWarnFunc": true,
|
||||
"migrateWarnProp": true,
|
||||
"jQueryVersionSince": true,
|
||||
|
||||
"noGlobal": true
|
||||
}
|
||||
}
|
||||
18
node_modules/jquery-migrate/src/ajax.js
generated
vendored
Normal file
18
node_modules/jquery-migrate/src/ajax.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
var oldAjax = jQuery.ajax;
|
||||
|
||||
jQuery.ajax = function( ) {
|
||||
var jQXHR = oldAjax.apply( this, arguments );
|
||||
|
||||
// Be sure we got a jQXHR (e.g., not sync)
|
||||
if ( jQXHR.promise ) {
|
||||
migrateWarnFunc( jQXHR, "success", jQXHR.done,
|
||||
"jQXHR.success is deprecated and removed" );
|
||||
migrateWarnFunc( jQXHR, "error", jQXHR.fail,
|
||||
"jQXHR.error is deprecated and removed" );
|
||||
migrateWarnFunc( jQXHR, "complete", jQXHR.always,
|
||||
"jQXHR.complete is deprecated and removed" );
|
||||
}
|
||||
|
||||
return jQXHR;
|
||||
};
|
||||
48
node_modules/jquery-migrate/src/attributes.js
generated
vendored
Normal file
48
node_modules/jquery-migrate/src/attributes.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
var oldRemoveAttr = jQuery.fn.removeAttr,
|
||||
oldToggleClass = jQuery.fn.toggleClass,
|
||||
rmatchNonSpace = /\S+/g;
|
||||
|
||||
jQuery.fn.removeAttr = function( name ) {
|
||||
var self = this;
|
||||
|
||||
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
|
||||
if ( jQuery.expr.match.bool.test( attr ) ) {
|
||||
migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
|
||||
self.prop( attr, false );
|
||||
}
|
||||
} );
|
||||
|
||||
return oldRemoveAttr.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.fn.toggleClass = function( state ) {
|
||||
|
||||
// Only deprecating no-args or single boolean arg
|
||||
if ( state !== undefined && typeof state !== "boolean" ) {
|
||||
return oldToggleClass.apply( this, arguments );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" );
|
||||
|
||||
// Toggle entire class name of each element
|
||||
return this.each( function() {
|
||||
var className = this.getAttribute && this.getAttribute( "class" ) || "";
|
||||
|
||||
if ( className ) {
|
||||
jQuery.data( this, "__className__", className );
|
||||
}
|
||||
|
||||
// If the element has a class name or if we're passed `false`,
|
||||
// then remove the whole classname (if there was one, the above saved it).
|
||||
// Otherwise bring back whatever was previously saved (if anything),
|
||||
// falling back to the empty string if nothing was stored.
|
||||
if ( this.setAttribute ) {
|
||||
this.setAttribute( "class",
|
||||
className || state === false ?
|
||||
"" :
|
||||
jQuery.data( this, "__className__" ) || ""
|
||||
);
|
||||
}
|
||||
} );
|
||||
};
|
||||
22
node_modules/jquery-migrate/src/compareVersions.js
generated
vendored
Normal file
22
node_modules/jquery-migrate/src/compareVersions.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/* exported jQueryVersionSince, compareVersions */
|
||||
|
||||
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
|
||||
function compareVersions( v1, v2 ) {
|
||||
var rVersionParts = /^(\d+)\.(\d+)\.(\d+)/,
|
||||
v1p = rVersionParts.exec( v1 ) || [ ],
|
||||
v2p = rVersionParts.exec( v2 ) || [ ];
|
||||
|
||||
for ( var i = 1; i <= 3; i++ ) {
|
||||
if ( +v1p[ i ] > +v2p[ i ] ) {
|
||||
return 1;
|
||||
}
|
||||
if ( +v1p[ i ] < +v2p[ i ] ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function jQueryVersionSince( version ) {
|
||||
return compareVersions( jQuery.fn.jquery, version ) >= 0;
|
||||
}
|
||||
117
node_modules/jquery-migrate/src/core.js
generated
vendored
Normal file
117
node_modules/jquery-migrate/src/core.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
|
||||
var oldInit = jQuery.fn.init,
|
||||
oldIsNumeric = jQuery.isNumeric,
|
||||
oldFind = jQuery.find,
|
||||
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
|
||||
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g;
|
||||
|
||||
jQuery.fn.init = function( arg1 ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
if ( typeof arg1 === "string" && arg1 === "#" ) {
|
||||
|
||||
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
||||
migrateWarn( "jQuery( '#' ) is not a valid selector" );
|
||||
args[ 0 ] = [];
|
||||
}
|
||||
|
||||
return oldInit.apply( this, args );
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
jQuery.find = function( selector ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Support: PhantomJS 1.x
|
||||
// String#match fails to match when used with a //g RegExp, only on some strings
|
||||
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// First see if qS thinks it's a valid selector, if so avoid a false positive
|
||||
try {
|
||||
window.document.querySelector( selector );
|
||||
} catch ( err1 ) {
|
||||
|
||||
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
|
||||
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
|
||||
return "[" + attr + op + "\"" + value + "\"]";
|
||||
} );
|
||||
|
||||
// If the regexp *may* have created an invalid selector, don't update it
|
||||
// Note that there may be false alarms if selector uses jQuery extensions
|
||||
try {
|
||||
window.document.querySelector( selector );
|
||||
migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
|
||||
args[ 0 ] = selector;
|
||||
} catch ( err2 ) {
|
||||
migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oldFind.apply( this, args );
|
||||
};
|
||||
|
||||
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
|
||||
var findProp;
|
||||
for ( findProp in oldFind ) {
|
||||
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
|
||||
jQuery.find[ findProp ] = oldFind[ findProp ];
|
||||
}
|
||||
}
|
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() {
|
||||
migrateWarn( "jQuery.fn.size() is deprecated and removed; use the .length property" );
|
||||
return this.length;
|
||||
};
|
||||
|
||||
jQuery.parseJSON = function() {
|
||||
migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" );
|
||||
return JSON.parse.apply( null, arguments );
|
||||
};
|
||||
|
||||
jQuery.isNumeric = function( val ) {
|
||||
|
||||
// The jQuery 2.2.3 implementation of isNumeric
|
||||
function isNumeric2( obj ) {
|
||||
var realStringObj = obj && obj.toString();
|
||||
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
|
||||
}
|
||||
|
||||
var newValue = oldIsNumeric( val ),
|
||||
oldValue = isNumeric2( val );
|
||||
|
||||
if ( newValue !== oldValue ) {
|
||||
migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" );
|
||||
}
|
||||
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
if ( jQueryVersionSince( "3.3.0" ) ) {
|
||||
migrateWarnFunc( jQuery, "isWindow",
|
||||
function( obj ) {
|
||||
return obj != null && obj === obj.window;
|
||||
},
|
||||
"jQuery.isWindow() is deprecated"
|
||||
);
|
||||
}
|
||||
|
||||
migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady,
|
||||
"jQuery.holdReady is deprecated" );
|
||||
|
||||
migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
|
||||
"jQuery.unique is deprecated; use jQuery.uniqueSort" );
|
||||
|
||||
// Now jQuery.expr.pseudos is the standard incantation
|
||||
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
|
||||
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
|
||||
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
|
||||
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
|
||||
|
||||
// Prior to jQuery 3.2 there were internal refs so we don't warn there
|
||||
if ( jQueryVersionSince( "3.2.0" ) ) {
|
||||
migrateWarnFunc( jQuery, "nodeName", jQuery.nodeName,
|
||||
"jQuery.nodeName is deprecated" );
|
||||
}
|
||||
44
node_modules/jquery-migrate/src/css.js
generated
vendored
Normal file
44
node_modules/jquery-migrate/src/css.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
var internalSwapCall = false;
|
||||
|
||||
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
||||
if ( jQuery.swap ) {
|
||||
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
|
||||
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
|
||||
|
||||
if ( oldHook ) {
|
||||
jQuery.cssHooks[ name ].get = function() {
|
||||
var ret;
|
||||
|
||||
internalSwapCall = true;
|
||||
ret = oldHook.apply( this, arguments );
|
||||
internalSwapCall = false;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
jQuery.swap = function( elem, options, callback, args ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
if ( !internalSwapCall ) {
|
||||
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.apply( elem, args || [] );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
37
node_modules/jquery-migrate/src/data.js
generated
vendored
Normal file
37
node_modules/jquery-migrate/src/data.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
var oldData = jQuery.data;
|
||||
|
||||
jQuery.data = function( elem, name, value ) {
|
||||
var curData;
|
||||
|
||||
// Name can be an object, and each entry in the object is meant to be set as data
|
||||
if ( name && typeof name === "object" && arguments.length === 2 ) {
|
||||
curData = jQuery.hasData( elem ) && oldData.call( this, elem );
|
||||
var sameKeys = {};
|
||||
for ( var key in name ) {
|
||||
if ( key !== jQuery.camelCase( key ) ) {
|
||||
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key );
|
||||
curData[ key ] = name[ key ];
|
||||
} else {
|
||||
sameKeys[ key ] = name[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
oldData.call( this, elem, sameKeys );
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// If the name is transformed, look for the un-transformed name in the data object
|
||||
if ( name && typeof name === "string" && name !== jQuery.camelCase( name ) ) {
|
||||
curData = jQuery.hasData( elem ) && oldData.call( this, elem );
|
||||
if ( curData && name in curData ) {
|
||||
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name );
|
||||
if ( arguments.length > 2 ) {
|
||||
curData[ name ] = value;
|
||||
}
|
||||
return curData[ name ];
|
||||
}
|
||||
}
|
||||
|
||||
return oldData.apply( this, arguments );
|
||||
};
|
||||
58
node_modules/jquery-migrate/src/deferred.js
generated
vendored
Normal file
58
node_modules/jquery-migrate/src/deferred.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
var oldDeferred = jQuery.Deferred,
|
||||
tuples = [
|
||||
|
||||
// Action, add listener, callbacks, .then handlers, final state
|
||||
[ "resolve", "done", jQuery.Callbacks( "once memory" ),
|
||||
jQuery.Callbacks( "once memory" ), "resolved" ],
|
||||
[ "reject", "fail", jQuery.Callbacks( "once memory" ),
|
||||
jQuery.Callbacks( "once memory" ), "rejected" ],
|
||||
[ "notify", "progress", jQuery.Callbacks( "memory" ),
|
||||
jQuery.Callbacks( "memory" ) ]
|
||||
];
|
||||
|
||||
jQuery.Deferred = function( func ) {
|
||||
var deferred = oldDeferred(),
|
||||
promise = deferred.promise();
|
||||
|
||||
deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
|
||||
var fns = arguments;
|
||||
|
||||
migrateWarn( "deferred.pipe() is deprecated" );
|
||||
|
||||
return jQuery.Deferred( function( newDefer ) {
|
||||
jQuery.each( tuples, function( i, tuple ) {
|
||||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
||||
|
||||
// Deferred.done(function() { bind to newDefer or newDefer.resolve })
|
||||
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
||||
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
||||
deferred[ tuple[ 1 ] ]( function() {
|
||||
var returned = fn && fn.apply( this, arguments );
|
||||
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
||||
returned.promise()
|
||||
.done( newDefer.resolve )
|
||||
.fail( newDefer.reject )
|
||||
.progress( newDefer.notify );
|
||||
} else {
|
||||
newDefer[ tuple[ 0 ] + "With" ](
|
||||
this === promise ? newDefer.promise() : this,
|
||||
fn ? [ returned ] : arguments
|
||||
);
|
||||
}
|
||||
} );
|
||||
} );
|
||||
fns = null;
|
||||
} ).promise();
|
||||
|
||||
};
|
||||
|
||||
if ( func ) {
|
||||
func.call( deferred, deferred );
|
||||
}
|
||||
|
||||
return deferred;
|
||||
};
|
||||
|
||||
// Preserve handler of uncaught exceptions in promise chains
|
||||
jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
|
||||
39
node_modules/jquery-migrate/src/effects.js
generated
vendored
Normal file
39
node_modules/jquery-migrate/src/effects.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var oldTweenRun = jQuery.Tween.prototype.run;
|
||||
var linearEasing = function( pct ) {
|
||||
return pct;
|
||||
};
|
||||
|
||||
jQuery.Tween.prototype.run = function( ) {
|
||||
if ( jQuery.easing[ this.easing ].length > 1 ) {
|
||||
migrateWarn(
|
||||
"'jQuery.easing." + this.easing.toString() + "' should use only one argument"
|
||||
);
|
||||
|
||||
jQuery.easing[ this.easing ] = linearEasing;
|
||||
}
|
||||
|
||||
oldTweenRun.apply( this, arguments );
|
||||
};
|
||||
|
||||
var intervalValue = jQuery.fx.interval || 13,
|
||||
intervalMsg = "jQuery.fx.interval is deprecated";
|
||||
|
||||
// Support: IE9, Android <=4.4
|
||||
// Avoid false positives on browsers that lack rAF
|
||||
// Don't warn if document is hidden, jQuery uses setTimeout (#292)
|
||||
if ( window.requestAnimationFrame ) {
|
||||
Object.defineProperty( jQuery.fx, "interval", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
if ( !window.document.hidden ) {
|
||||
migrateWarn( intervalMsg );
|
||||
}
|
||||
return intervalValue;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( intervalMsg );
|
||||
intervalValue = newValue;
|
||||
}
|
||||
} );
|
||||
}
|
||||
129
node_modules/jquery-migrate/src/event.js
generated
vendored
Normal file
129
node_modules/jquery-migrate/src/event.js
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
var oldLoad = jQuery.fn.load,
|
||||
oldEventAdd = jQuery.event.add,
|
||||
originalFix = jQuery.event.fix;
|
||||
|
||||
jQuery.event.props = [];
|
||||
jQuery.event.fixHooks = {};
|
||||
|
||||
migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat,
|
||||
"jQuery.event.props.concat() is deprecated and removed" );
|
||||
|
||||
jQuery.event.fix = function( originalEvent ) {
|
||||
var event,
|
||||
type = originalEvent.type,
|
||||
fixHook = this.fixHooks[ type ],
|
||||
props = jQuery.event.props;
|
||||
|
||||
if ( props.length ) {
|
||||
migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() );
|
||||
while ( props.length ) {
|
||||
jQuery.event.addProp( props.pop() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fixHook && !fixHook._migrated_ ) {
|
||||
fixHook._migrated_ = true;
|
||||
migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type );
|
||||
if ( ( props = fixHook.props ) && props.length ) {
|
||||
while ( props.length ) {
|
||||
jQuery.event.addProp( props.pop() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event = originalFix.call( this, originalEvent );
|
||||
|
||||
return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
|
||||
};
|
||||
|
||||
jQuery.event.add = function( elem, types ) {
|
||||
|
||||
// This misses the multiple-types case but that seems awfully rare
|
||||
if ( elem === window && types === "load" && window.document.readyState === "complete" ) {
|
||||
migrateWarn( "jQuery(window).on('load'...) called after load event occurred" );
|
||||
}
|
||||
return oldEventAdd.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
|
||||
|
||||
jQuery.fn[ name ] = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0 );
|
||||
|
||||
// If this is an ajax load() the first arg should be the string URL;
|
||||
// technically this could also be the "Anything" arg of the event .load()
|
||||
// which just goes to show why this dumb signature has been deprecated!
|
||||
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
||||
if ( name === "load" && typeof args[ 0 ] === "string" ) {
|
||||
return oldLoad.apply( this, args );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn." + name + "() is deprecated" );
|
||||
|
||||
args.splice( 0, 0, name );
|
||||
if ( arguments.length ) {
|
||||
return this.on.apply( this, args );
|
||||
}
|
||||
|
||||
// Use .triggerHandler here because:
|
||||
// - load and unload events don't need to bubble, only applied to window or image
|
||||
// - error event should not bubble to window, although it does pre-1.7
|
||||
// See http://bugs.jquery.com/ticket/11820
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
} );
|
||||
|
||||
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
|
||||
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
||||
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
|
||||
function( _i, name ) {
|
||||
|
||||
// Handle event binding
|
||||
jQuery.fn[ name ] = function( data, fn ) {
|
||||
migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" );
|
||||
return arguments.length > 0 ?
|
||||
this.on( name, null, data, fn ) :
|
||||
this.trigger( name );
|
||||
};
|
||||
} );
|
||||
|
||||
// Trigger "ready" event only once, on document ready
|
||||
jQuery( function() {
|
||||
jQuery( window.document ).triggerHandler( "ready" );
|
||||
} );
|
||||
|
||||
jQuery.event.special.ready = {
|
||||
setup: function() {
|
||||
if ( this === window.document ) {
|
||||
migrateWarn( "'ready' event is deprecated" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
jQuery.fn.extend( {
|
||||
|
||||
bind: function( types, data, fn ) {
|
||||
migrateWarn( "jQuery.fn.bind() is deprecated" );
|
||||
return this.on( types, null, data, fn );
|
||||
},
|
||||
unbind: function( types, fn ) {
|
||||
migrateWarn( "jQuery.fn.unbind() is deprecated" );
|
||||
return this.off( types, null, fn );
|
||||
},
|
||||
delegate: function( selector, types, data, fn ) {
|
||||
migrateWarn( "jQuery.fn.delegate() is deprecated" );
|
||||
return this.on( types, selector, data, fn );
|
||||
},
|
||||
undelegate: function( selector, types, fn ) {
|
||||
migrateWarn( "jQuery.fn.undelegate() is deprecated" );
|
||||
return arguments.length === 1 ?
|
||||
this.off( selector, "**" ) :
|
||||
this.off( types, selector || "**", fn );
|
||||
},
|
||||
hover: function( fnOver, fnOut ) {
|
||||
migrateWarn( "jQuery.fn.hover() is deprecated" );
|
||||
return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
|
||||
}
|
||||
} );
|
||||
19
node_modules/jquery-migrate/src/intro.js
generated
vendored
Normal file
19
node_modules/jquery-migrate/src/intro.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
;( function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery" ], function ( jQuery ) {
|
||||
return factory( jQuery, window );
|
||||
} );
|
||||
} else if ( typeof module === "object" && module.exports ) {
|
||||
|
||||
// Node/CommonJS
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = factory( require( "jquery" ), window );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery, window );
|
||||
}
|
||||
} )( function( jQuery, window ) {
|
||||
"use strict";
|
||||
83
node_modules/jquery-migrate/src/migrate.js
generated
vendored
Normal file
83
node_modules/jquery-migrate/src/migrate.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */
|
||||
|
||||
( function() {
|
||||
|
||||
// Support: IE9 only
|
||||
// IE9 only creates console object when dev tools are first opened
|
||||
// IE9 console is a host object, callable but doesn't have .apply()
|
||||
if ( !window.console || !window.console.log ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Need jQuery 3.0.0+ and no older Migrate loaded
|
||||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
|
||||
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
|
||||
}
|
||||
if ( jQuery.migrateWarnings ) {
|
||||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
|
||||
}
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
window.console.log( "JQMIGRATE: Migrate is installed" +
|
||||
( jQuery.migrateMute ? "" : " with logging active" ) +
|
||||
", version " + jQuery.migrateVersion );
|
||||
|
||||
} )();
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg ) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
function migrateWarnFunc( obj, prop, newFunc, msg ) {
|
||||
obj[ prop ] = function() {
|
||||
migrateWarn( msg );
|
||||
return newFunc.apply( this, arguments );
|
||||
};
|
||||
}
|
||||
|
||||
if ( window.document.compatMode === "BackCompat" ) {
|
||||
|
||||
// JQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
5
node_modules/jquery-migrate/src/migratemute.js
generated
vendored
Normal file
5
node_modules/jquery-migrate/src/migratemute.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// Included only in the minified build, via Uglify2
|
||||
// Only turn warnings off if not already overridden
|
||||
if ( typeof jQuery.migrateMute === "undefined" ) {
|
||||
jQuery.migrateMute = true;
|
||||
}
|
||||
21
node_modules/jquery-migrate/src/offset.js
generated
vendored
Normal file
21
node_modules/jquery-migrate/src/offset.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
var oldOffset = jQuery.fn.offset;
|
||||
|
||||
jQuery.fn.offset = function() {
|
||||
var docElem,
|
||||
elem = this[ 0 ],
|
||||
origin = { top: 0, left: 0 };
|
||||
|
||||
if ( !elem || !elem.nodeType ) {
|
||||
migrateWarn( "jQuery.fn.offset() requires a valid DOM element" );
|
||||
return origin;
|
||||
}
|
||||
|
||||
docElem = ( elem.ownerDocument || window.document ).documentElement;
|
||||
if ( !jQuery.contains( docElem, elem ) ) {
|
||||
migrateWarn( "jQuery.fn.offset() requires an element connected to a document" );
|
||||
return origin;
|
||||
}
|
||||
|
||||
return oldOffset.apply( this, arguments );
|
||||
};
|
||||
2
node_modules/jquery-migrate/src/outro.js
generated
vendored
Normal file
2
node_modules/jquery-migrate/src/outro.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
return jQuery;
|
||||
} );
|
||||
14
node_modules/jquery-migrate/src/serialize.js
generated
vendored
Normal file
14
node_modules/jquery-migrate/src/serialize.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
var oldParam = jQuery.param;
|
||||
|
||||
jQuery.param = function( data, traditional ) {
|
||||
var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
||||
|
||||
if ( traditional === undefined && ajaxTraditional ) {
|
||||
|
||||
migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
|
||||
traditional = ajaxTraditional;
|
||||
}
|
||||
|
||||
return oldParam.call( this, data, traditional );
|
||||
};
|
||||
6
node_modules/jquery-migrate/src/traversing.js
generated
vendored
Normal file
6
node_modules/jquery-migrate/src/traversing.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
2
node_modules/jquery-migrate/src/version.js
generated
vendored
Normal file
2
node_modules/jquery-migrate/src/version.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
jQuery.migrateVersion = "3.1.0";
|
||||
34
node_modules/jquery-migrate/test/.eslintrc.json
generated
vendored
Normal file
34
node_modules/jquery-migrate/test/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"extends": "../src/.eslintrc.json",
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": false
|
||||
},
|
||||
// Support: IE <=9 only, Android <=4.0 only
|
||||
// The above browsers are failing a lot of tests in the ES5
|
||||
// test suite at http://test262.ecmascript.org.
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 3
|
||||
},
|
||||
"globals": {
|
||||
"expectWarning": true,
|
||||
"expectNoWarning": true,
|
||||
"TestManager": true,
|
||||
|
||||
"jQuery": true,
|
||||
"QUnit": true,
|
||||
"module": true,
|
||||
"ok": true,
|
||||
"equal": true,
|
||||
"test": true,
|
||||
"asyncTest": true,
|
||||
"notEqual": true,
|
||||
"deepEqual": true,
|
||||
"strictEqual": true,
|
||||
"notStrictEqual": true,
|
||||
"start": true,
|
||||
"stop": true,
|
||||
"expect": true
|
||||
}
|
||||
}
|
||||
24
node_modules/jquery-migrate/test/ajax.js
generated
vendored
Normal file
24
node_modules/jquery-migrate/test/ajax.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
QUnit.module( "ajax" );
|
||||
|
||||
QUnit.test( "jQuery.ajax() deprecations on jqXHR", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var done = assert.async();
|
||||
|
||||
expectWarning( assert, ".success(), .error(), .compete() calls", 3, function() {
|
||||
|
||||
jQuery.ajax( "/not-found.404" )
|
||||
.success( jQuery.noop )
|
||||
.error( function( jQXHR ) {
|
||||
|
||||
// Local file errors returns 0, pretend it's a 404
|
||||
assert.equal( jQXHR.status || 404, 404, "ajax error" );
|
||||
} )
|
||||
.complete( function() {
|
||||
assert.ok( true, "ajax complete" );
|
||||
// Wait for expectWarning to complete
|
||||
setTimeout(done, 1);
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
87
node_modules/jquery-migrate/test/attributes.js
generated
vendored
Normal file
87
node_modules/jquery-migrate/test/attributes.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
|
||||
QUnit.module( "attributes" );
|
||||
|
||||
QUnit.test( ".removeAttr( boolean attribute )", function( assert ) {
|
||||
assert.expect( 8 );
|
||||
|
||||
expectNoWarning( assert, "non-boolean attr", function() {
|
||||
var $div = jQuery( "<div />" )
|
||||
.attr( "quack", "duck" )
|
||||
.removeAttr( "quack" );
|
||||
|
||||
assert.equal( $div.attr( "quack" ), null, "non-boolean attribute was removed" );
|
||||
assert.equal( $div.prop( "quack" ), undefined, "property was not set" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, "boolean attr", function() {
|
||||
var $inp = jQuery( "<input type=checkbox/>" )
|
||||
.attr( "checked", "checked" )
|
||||
.prop( "checked", true )
|
||||
.removeAttr( "checked" );
|
||||
|
||||
assert.equal( $inp.attr( "checked" ), null, "boolean attribute was removed" );
|
||||
assert.equal( $inp.prop( "checked" ), false, "property was changed" );
|
||||
} );
|
||||
|
||||
// One warning per attribute name
|
||||
expectWarning( assert, "multiple boolean attr", 2, function() {
|
||||
jQuery( "<input type=checkbox/>" )
|
||||
.attr( "checked", "checked" )
|
||||
.attr( "readonly", "readonly" )
|
||||
.removeAttr( "checked readonly" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, "mixed attr, one boolean", function() {
|
||||
jQuery( "<input />" )
|
||||
.attr( "type", "text" )
|
||||
.attr( "size", "15" )
|
||||
.attr( "disabled", "disabled" )
|
||||
.removeAttr( "disabled" )
|
||||
.removeAttr( "size" );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
QUnit.test( ".toggleClass( boolean )", function( assert ) {
|
||||
assert.expect( 14 );
|
||||
|
||||
var e = jQuery( "<div />" ).appendTo( "#qunit-fixture" );
|
||||
|
||||
expectWarning( assert, "toggling initially empty class", function() {
|
||||
e.toggleClass( true );
|
||||
assert.equal( e[ 0 ].className, "", "Assert class is empty (data was empty)" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, ".toggleClass( string ) not full className", function() {
|
||||
e.attr( "class", "" );
|
||||
e.toggleClass( "classy" );
|
||||
assert.equal( e.attr( "class" ), "classy", "class was toggle-set" );
|
||||
e.toggleClass( "classy", false );
|
||||
assert.equal( e.attr( "class" ), "", "class was toggle-removed" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".toggleClass() save and clear", 1, function() {
|
||||
e.addClass( "testD testE" );
|
||||
assert.ok( e.is( ".testD.testE" ), "Assert class present" );
|
||||
e.toggleClass();
|
||||
assert.ok( !e.is( ".testD.testE" ), "Assert class not present" );
|
||||
|
||||
// N.B.: Store should have "testD testE" now, next test will assert that
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".toggleClass() restore", 1, function() {
|
||||
e.toggleClass();
|
||||
assert.ok( e.is( ".testD.testE" ), "Assert class present (restored from data)" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".toggleClass( boolean )", 1, function() {
|
||||
e.toggleClass( false );
|
||||
assert.ok( !e.is( ".testD.testE" ), "Assert class not present" );
|
||||
e.toggleClass( true );
|
||||
assert.ok( e.is( ".testD.testE" ), "Assert class present (restored from data)" );
|
||||
e.toggleClass();
|
||||
e.toggleClass( false );
|
||||
e.toggleClass();
|
||||
assert.ok( e.is( ".testD.testE" ), "Assert class present (restored from data)" );
|
||||
} );
|
||||
} );
|
||||
23
node_modules/jquery-migrate/test/core-jquery2.html
generated
vendored
Normal file
23
node_modules/jquery-migrate/test/core-jquery2.html
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate old-jQuery initialization test</title>
|
||||
|
||||
<!-- Load older jQuery, then jquery-migrate plugin file based on URL -->
|
||||
<script src="./data/jquery-2.2.3.js"></script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<script>
|
||||
// Should have logged during initialization
|
||||
startIframeTest();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>jQuery Migrate old-jQuery initialization test</p>
|
||||
</body>
|
||||
</html>
|
||||
328
node_modules/jquery-migrate/test/core.js
generated
vendored
Normal file
328
node_modules/jquery-migrate/test/core.js
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
|
||||
QUnit.module( "core" );
|
||||
|
||||
QUnit.test( "jQuery.migrateVersion", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
assert.ok( /^\d+\.\d+\.[\w\-]+/.test( jQuery.migrateVersion ), "Version property" );
|
||||
} );
|
||||
|
||||
QUnit.test( "compareVersions and jQueryVersionSince", function( assert ) {
|
||||
assert.expect( 9 );
|
||||
|
||||
assert.equal( compareVersions( "3.0.1", "3.0.0" ), 1, "greater than 1" );
|
||||
assert.equal( compareVersions( "3.0.1", "2.10.0" ), 1, "greater than 2" );
|
||||
assert.equal( compareVersions( "3.2.1", "3.3.0" ), -1, "less than 1" );
|
||||
assert.equal( compareVersions( "3.2.1", "4.1.3" ), -1, "less than 2" );
|
||||
assert.equal( compareVersions( "3.2.2", "3.11.1" ), -1, "less than 3");
|
||||
assert.equal( compareVersions( "3.4.1", "3.4.1" ), 0, "equal" );
|
||||
|
||||
|
||||
// Test against live jQuery version with suitably generous comparisons
|
||||
assert.equal( jQueryVersionSince( "1.4.2" ), true, "since - past version" );
|
||||
assert.equal( jQueryVersionSince( "8.0.3" ), false, "since - future version" );
|
||||
assert.equal( jQueryVersionSince( jQuery.fn.jquery ), true, "since - equal" );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery(html, props)", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var $el = jQuery( "<input/>", { name: "name", val: "value", size: 42 } );
|
||||
|
||||
assert.equal( $el.attr( "name" ), "name", "Name attribute" );
|
||||
assert.equal( $el.attr( "size" ),
|
||||
jQuery.isEmptyObject( jQuery.attrFn ) ? undefined : "42", "Size attribute" );
|
||||
assert.equal( $el.val(), "value", "Call setter method" );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery( '#' )", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
expectWarning( assert, "Selector, through the jQuery constructor, nothing but hash", function() {
|
||||
var set = jQuery( "#" );
|
||||
assert.equal( set.length, 0, "empty set" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "Attribute selectors with unquoted hashes", function( assert ) {
|
||||
assert.expect( 31 );
|
||||
|
||||
var markup = jQuery(
|
||||
"<div>" +
|
||||
"<div data-selector='a[href=#main]'></div>" +
|
||||
"<a href='space#junk'>test</a>" +
|
||||
"<link rel='good#stuff' />" +
|
||||
"<p class='space #junk'>" +
|
||||
"<a href='#some-anchor'>anchor2</a>" +
|
||||
"<input value='[strange*=#stuff]' />" +
|
||||
"<a href='#' data-id='#junk'>anchor</a>" +
|
||||
"</p>" +
|
||||
"</div>" ).appendTo( "#qunit-fixture" ),
|
||||
|
||||
// No warning, no need to fix
|
||||
okays = [
|
||||
"a[href='#some-anchor']",
|
||||
"[data-id=\"#junk\"]",
|
||||
"div[data-selector='a[href=#main]']",
|
||||
"input[value~= '[strange*=#stuff]']"
|
||||
],
|
||||
|
||||
// Fixable, and gives warning
|
||||
fixables = [
|
||||
"a[href=#]",
|
||||
"a[href*=#]:not([href=#]):first-child",
|
||||
".space a[href=#]",
|
||||
"a[href=#some-anchor]",
|
||||
"link[rel*=#stuff]",
|
||||
"p[class *= #junk]",
|
||||
"a[href=space#junk]"
|
||||
],
|
||||
|
||||
// False positives that still work
|
||||
positives = [
|
||||
"div[data-selector='a[href=#main]']:first",
|
||||
"input[value= '[strange*=#stuff]']:eq(0)"
|
||||
],
|
||||
|
||||
// Failures due to quotes and jQuery extensions combined
|
||||
failures = [
|
||||
"p[class ^= #junk]:first",
|
||||
"a[href=space#junk]:eq(1)"
|
||||
];
|
||||
|
||||
expectNoWarning( assert, "Perfectly cromulent selectors are unchanged", function() {
|
||||
okays.forEach( function( okay ) {
|
||||
assert.equal( jQuery( okay, markup ).length, 1, okay );
|
||||
assert.equal( markup.find( okay ).length, 1, okay );
|
||||
} );
|
||||
} );
|
||||
|
||||
expectWarning( assert, "Values with unquoted hashes are quoted", fixables.length, function() {
|
||||
fixables.forEach( function( fixable ) {
|
||||
assert.equal( jQuery( fixable, markup ).length, 1, fixable );
|
||||
assert.equal( markup.find( fixable ).length, 1, fixable );
|
||||
} );
|
||||
} );
|
||||
|
||||
expectWarning( assert, "False positives", positives.length, function() {
|
||||
positives.forEach( function( positive ) {
|
||||
assert.equal( jQuery( positive, markup ).length, 1, positive );
|
||||
assert.equal( markup.find( positive ).length, 1, positive );
|
||||
} );
|
||||
} );
|
||||
|
||||
expectWarning( assert, "Unfixable cases", failures.length, function() {
|
||||
failures.forEach( function( failure ) {
|
||||
try {
|
||||
jQuery( failure, markup );
|
||||
assert.ok( false, "Expected jQuery() to die!" );
|
||||
} catch ( err1 ) { }
|
||||
try {
|
||||
markup.find( failure );
|
||||
assert.ok( false, "Expected .find() to die!" );
|
||||
} catch ( err2 ) { }
|
||||
} );
|
||||
} );
|
||||
|
||||
// Ensure we don't process jQuery( x ) when x is a function
|
||||
expectNoWarning( assert, "ready function with attribute selector", function() {
|
||||
try {
|
||||
jQuery( function() {
|
||||
if ( jQuery.thisIsNeverTrue ) {
|
||||
jQuery( "a[href=#]" );
|
||||
}
|
||||
} );
|
||||
} catch ( e ) {}
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "XSS injection (leading hash)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
jQuery( "#yeah<p>RIGHT</p>" );
|
||||
} catch ( e ) {
|
||||
threw = true;
|
||||
}
|
||||
|
||||
assert.equal( threw, true, "Throw on leading-hash HTML (treated as selector)" );
|
||||
} );
|
||||
|
||||
QUnit.test( "XSS injection (XSS via script tag)", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var threw = false;
|
||||
window.XSS = false;
|
||||
try {
|
||||
jQuery( "#<script>window.XSS=true<" + "/script>" );
|
||||
} catch ( e ) {
|
||||
threw = true;
|
||||
}
|
||||
assert.equal( threw, true, "Throw on leading-hash HTML (treated as selector)" );
|
||||
assert.equal( window.XSS, false, "XSS" );
|
||||
} );
|
||||
|
||||
QUnit.test( "XSS injection (XSS with hash and leading space)", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var threw = false;
|
||||
window.XSS = false;
|
||||
try {
|
||||
jQuery( " \n#<script>window.XSS=true<" + "/script>" );
|
||||
} catch ( e ) {
|
||||
threw = true;
|
||||
}
|
||||
assert.equal( threw, true, "Throw on leading-hash HTML and space (treated as selector)" );
|
||||
assert.equal( window.XSS, false, "XSS" );
|
||||
} );
|
||||
|
||||
QUnit.test( "XSS injection (XSS via onerror inline handler)", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var start,
|
||||
threw = false;
|
||||
|
||||
window.XSS = false;
|
||||
try {
|
||||
jQuery( "#<img src=haha onerror='window.XSS=true' />" );
|
||||
} catch ( e ) {
|
||||
threw = true;
|
||||
}
|
||||
assert.equal( threw, true, "Throw on leading-hash HTML (treated as selector)" );
|
||||
|
||||
start = assert.async();
|
||||
setTimeout( function() {
|
||||
assert.equal( window.XSS, false, "XSS" );
|
||||
start();
|
||||
}, 1000 );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery( '<element>' ) usable on detached elements (#128)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
jQuery( "<a>" ).outerWidth();
|
||||
assert.ok( true, "No crash when operating on detached elements with window" );
|
||||
} );
|
||||
|
||||
QUnit.test( ".size", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
expectWarning( assert, "size", function() {
|
||||
jQuery( "<div />" ).size();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.parseJSON", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
expectWarning( assert, "jQuery.parseJSON", function() {
|
||||
assert.deepEqual(
|
||||
jQuery.parseJSON( "{\"a\":1}" ),
|
||||
{ a: 1 },
|
||||
"jQuery.parseJSON output"
|
||||
);
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.isNumeric", function( assert ) {
|
||||
assert.expect( 8 );
|
||||
|
||||
var ToString = function( value ) {
|
||||
this.toString = function() {
|
||||
return String( value );
|
||||
};
|
||||
};
|
||||
|
||||
expectWarning( assert, "changed cases", function() {
|
||||
assert.equal( jQuery.isNumeric( new ToString( "42" ) ), true,
|
||||
"Custom .toString returning number" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "unchanged cases", function() {
|
||||
assert.equal( jQuery.isNumeric( 42 ), true, "number" );
|
||||
assert.equal( jQuery.isNumeric( "42" ), true, "number string" );
|
||||
assert.equal( jQuery.isNumeric( "devo" ), false, "non-numeric string" );
|
||||
assert.equal( jQuery.isNumeric( [ 2, 4 ] ), false, "array" );
|
||||
assert.equal( jQuery.isNumeric( new ToString( "devo" ) ), false,
|
||||
"Custom .toString returning non-number" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit[ jQueryVersionSince( "3.3.0" ) ? "test" : "skip" ]( "jQuery.isWindow", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
expectWarning( assert, "isWindow", 1, function() {
|
||||
assert.equal( jQuery.isWindow( [] ), false, "array" );
|
||||
assert.equal( jQuery.isWindow( window ), true, "window" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.unique", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
expectWarning( assert, "jQuery.unique", function() {
|
||||
var body = jQuery( "body" )[ 0 ],
|
||||
head = jQuery( "head" )[ 0 ];
|
||||
assert.deepEqual(
|
||||
jQuery.unique( [ body, head, body ] ),
|
||||
[ head, body ],
|
||||
"unique sorted" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.expr.pseudos aliases", function( assert ) {
|
||||
assert.expect( 7 );
|
||||
|
||||
expectWarning( assert, "jQuery.expr.filters", function() {
|
||||
jQuery.expr.filters.mazda = function( elem ) {
|
||||
return elem.style.zoom === "3";
|
||||
};
|
||||
} );
|
||||
|
||||
expectWarning( assert, "jQuery.expr[':']", function() {
|
||||
jQuery.expr[ ":" ].marginal = function( elem ) {
|
||||
return parseInt( elem.style.marginLeftWidth ) > 20;
|
||||
};
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "jQuery.expr.pseudos", function() {
|
||||
var fixture = jQuery( "#qunit-fixture" ).prepend( "<p>hello</p>" );
|
||||
|
||||
assert.ok( jQuery.expr.pseudos.mazda, "filters assigned" );
|
||||
assert.ok( jQuery.expr.pseudos.marginal, "[':'] assigned" );
|
||||
fixture.find( "p" ).first().css( "marginLeftWidth", "40px" );
|
||||
assert.equal( fixture.find( "p:marginal" ).length, 1, "One marginal element" );
|
||||
assert.equal( fixture.find( "div:mazda" ).length, 0, "No mazda elements" );
|
||||
delete jQuery.expr.pseudos.mazda;
|
||||
delete jQuery.expr.pseudos.marginal;
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.holdReady (warn only)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
expectWarning( assert, "jQuery.holdReady", 1, function() {
|
||||
jQuery.holdReady( true );
|
||||
jQuery.holdReady( false );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit[ jQueryVersionSince( "3.2.0" ) ? "test" : "skip" ]( "jQuery.nodeName", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
expectWarning( assert, "jQuery.nodeName", function() {
|
||||
var div = document.createElement( "div" );
|
||||
|
||||
assert.equal( jQuery.nodeName( div, "div" ), true, "it's a div" );
|
||||
})
|
||||
});
|
||||
|
||||
TestManager.runIframeTest( "old pre-3.0 jQuery", "core-jquery2.html",
|
||||
function( assert, jQuery, window, document, log ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
assert.ok( /jQuery 3/.test( log ), "logged: " + log );
|
||||
} );
|
||||
27
node_modules/jquery-migrate/test/css.js
generated
vendored
Normal file
27
node_modules/jquery-migrate/test/css.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
QUnit.module( "css" );
|
||||
|
||||
QUnit.test( "jQuery.swap()", function( assert ) {
|
||||
assert.expect( 6 );
|
||||
|
||||
var div = document.createElement( "div" );
|
||||
div.style.borderWidth = "4px";
|
||||
|
||||
expectWarning( assert, "External swap() call", function() {
|
||||
jQuery.swap( div, { borderRightWidth: "5px" }, function( arg ) {
|
||||
|
||||
assert.equal( this.style.borderRightWidth, "5px", "style was changed" );
|
||||
assert.equal( arg, 42, "arg was passed" );
|
||||
|
||||
}, [ 42 ] );
|
||||
} );
|
||||
assert.equal( div.style.borderRightWidth, "4px", "style was restored" );
|
||||
|
||||
expectNoWarning( assert, "Internal swap() call", function() {
|
||||
var $fp = jQuery( "#firstp" ).width( "10em" ),
|
||||
width = $fp.width();
|
||||
|
||||
assert.equal( $fp.hide().width(), width, "correct width" );
|
||||
} );
|
||||
|
||||
} );
|
||||
104
node_modules/jquery-migrate/test/data.js
generated
vendored
Normal file
104
node_modules/jquery-migrate/test/data.js
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
QUnit.module( "data" );
|
||||
|
||||
QUnit.test( "jQuery.data() camelCased names", function( assert ) {
|
||||
|
||||
var sames = [
|
||||
"datum",
|
||||
"ropeAdope",
|
||||
"Олег\u0007Michał",
|
||||
"already-Big",
|
||||
"number-2",
|
||||
"unidash-"
|
||||
],
|
||||
diffs = [
|
||||
"dat-data",
|
||||
"hangy-dasher-",
|
||||
"-dashy-hanger"
|
||||
];
|
||||
|
||||
assert.expect( 16 );
|
||||
|
||||
var curData,
|
||||
div = document.createElement( "div" );
|
||||
|
||||
// = .hasData + noWarning
|
||||
expectNoWarning( assert, "No existing data object", function() {
|
||||
sames.concat( diffs ).forEach( function( name ) {
|
||||
jQuery.data( div, name );
|
||||
} );
|
||||
assert.equal( jQuery.hasData( div ), false, "data probes did not fill a data object" );
|
||||
} );
|
||||
|
||||
// = sames.length + diffs.length + noWarning
|
||||
expectNoWarning( assert, "Data set/get without warning via API", function() {
|
||||
sames.concat( diffs ).forEach( function( name, index ) {
|
||||
jQuery.data( div, name, index );
|
||||
assert.equal( jQuery.data( div, name ), index, name + "=" + index );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Camelized values set for all names above, get the data object
|
||||
curData = jQuery.data( div );
|
||||
|
||||
// = diffs.length + warning
|
||||
expectWarning( assert, "Dashed name conflicts", diffs.length, function() {
|
||||
diffs.forEach( function( name, index ) {
|
||||
curData[ name ] = index;
|
||||
assert.equal( jQuery.data( div, name ), curData[ name ],
|
||||
name + " respects data object" );
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.data() camelCased names (mass setter)", function( assert ) {
|
||||
var sames = [
|
||||
"datum",
|
||||
"ropeAdope",
|
||||
"Олег\u0007Michał",
|
||||
"already-Big",
|
||||
"number-2",
|
||||
"unidash-"
|
||||
],
|
||||
diffs = [
|
||||
"dat-data",
|
||||
"hangy-dasher-",
|
||||
"-dashy-hanger"
|
||||
];
|
||||
|
||||
assert.expect( 11 );
|
||||
|
||||
var div = document.createElement( "div" );
|
||||
|
||||
// = sames.length + noWarning
|
||||
expectNoWarning( assert, "Data set as an object and get without warning via API", function() {
|
||||
var testData = {};
|
||||
|
||||
sames.forEach( function( name, index ) {
|
||||
testData[ name ] = index;
|
||||
} );
|
||||
|
||||
jQuery.data( div, testData );
|
||||
|
||||
sames.forEach( function( name, index ) {
|
||||
assert.equal( jQuery.data( div, name ), index, name + "=" + index );
|
||||
} );
|
||||
} );
|
||||
|
||||
// = diffs.length + warning
|
||||
expectWarning( assert, "Data set as an object and get without warning via API", function() {
|
||||
var testData = {};
|
||||
|
||||
diffs.forEach( function( name, index ) {
|
||||
testData[ name ] = index;
|
||||
} );
|
||||
|
||||
jQuery.data( div, testData );
|
||||
|
||||
diffs.forEach( function( name, index ) {
|
||||
assert.equal( jQuery.data( div, name ), index, name + "=" + index );
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
BIN
node_modules/jquery-migrate/test/data/1x1.jpg
generated
vendored
Normal file
BIN
node_modules/jquery-migrate/test/data/1x1.jpg
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
0
node_modules/jquery-migrate/test/data/empty.json
generated
vendored
Normal file
0
node_modules/jquery-migrate/test/data/empty.json
generated
vendored
Normal file
9842
node_modules/jquery-migrate/test/data/jquery-2.2.3.js
generated
vendored
Normal file
9842
node_modules/jquery-migrate/test/data/jquery-2.2.3.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/jquery-migrate/test/data/null.json
generated
vendored
Normal file
1
node_modules/jquery-migrate/test/data/null.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
null
|
||||
1
node_modules/jquery-migrate/test/data/simple.json
generated
vendored
Normal file
1
node_modules/jquery-migrate/test/data/simple.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"foo":"bar","gibson":42}
|
||||
157
node_modules/jquery-migrate/test/deferred.js
generated
vendored
Normal file
157
node_modules/jquery-migrate/test/deferred.js
generated
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
QUnit.module( "deferred" );
|
||||
|
||||
QUnit.test( "jQuery.Deferred.exceptionHook", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
// Make sure our shimming didn't clobber the default hook
|
||||
assert.ok ( typeof jQuery.Deferred.exceptionHook === "function", "hook is present" );
|
||||
} );
|
||||
|
||||
QUnit.test( ".pipe() warnings", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
|
||||
var d = jQuery.Deferred(),
|
||||
p = d.promise();
|
||||
|
||||
function checkValue( v ) {
|
||||
assert.equal( v, 1, "got correct value" );
|
||||
}
|
||||
|
||||
// Deferred
|
||||
expectWarning( assert, "pipe", function() {
|
||||
d.pipe( checkValue );
|
||||
} );
|
||||
|
||||
// Deferred's promise object
|
||||
expectWarning( assert, "pipe", function() {
|
||||
p.pipe( checkValue );
|
||||
} );
|
||||
|
||||
// Should happen synchronously for .pipe()
|
||||
d.resolve( 1 );
|
||||
} );
|
||||
|
||||
QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - filtering (fail)", function( assert ) {
|
||||
|
||||
assert.expect( 4 );
|
||||
|
||||
var value1, value2, value3,
|
||||
defer = jQuery.Deferred(),
|
||||
piped = defer.pipe( null, function( a, b ) {
|
||||
return a * b;
|
||||
} ),
|
||||
done = jQuery.map( new Array( 3 ), function() {
|
||||
return assert.async();
|
||||
} );
|
||||
|
||||
piped.fail( function( result ) {
|
||||
value3 = result;
|
||||
} );
|
||||
|
||||
defer.fail( function( a, b ) {
|
||||
value1 = a;
|
||||
value2 = b;
|
||||
} );
|
||||
|
||||
defer.reject( 2, 3 ).pipe( null, function() {
|
||||
assert.strictEqual( value1, 2, "first reject value ok" );
|
||||
assert.strictEqual( value2, 3, "second reject value ok" );
|
||||
assert.strictEqual( value3, 6, "result of filter ok" );
|
||||
done.pop().call();
|
||||
} );
|
||||
|
||||
jQuery.Deferred().resolve().pipe( null, function() {
|
||||
assert.ok( false, "then should not be called on resolve" );
|
||||
} ).then( done.pop() );
|
||||
|
||||
jQuery.Deferred().reject().pipe( null, jQuery.noop ).fail( function( value ) {
|
||||
assert.strictEqual( value, undefined, "then fail callback can return undefined/null" );
|
||||
done.pop().call();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - deferred (progress)", function( assert ) {
|
||||
|
||||
assert.expect( 3 );
|
||||
|
||||
var value1, value2, value3,
|
||||
defer = jQuery.Deferred(),
|
||||
piped = defer.pipe( null, null, function( a, b ) {
|
||||
return jQuery.Deferred( function( defer ) {
|
||||
defer.resolve( a * b );
|
||||
} );
|
||||
} ),
|
||||
done = assert.async();
|
||||
|
||||
piped.done( function( result ) {
|
||||
value3 = result;
|
||||
} );
|
||||
|
||||
defer.progress( function( a, b ) {
|
||||
value1 = a;
|
||||
value2 = b;
|
||||
} );
|
||||
|
||||
defer.notify( 2, 3 );
|
||||
|
||||
piped.done( function() {
|
||||
assert.strictEqual( value1, 2, "first progress value ok" );
|
||||
assert.strictEqual( value2, 3, "second progress value ok" );
|
||||
assert.strictEqual( value3, 6, "result of filter ok" );
|
||||
done();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "[PIPE ONLY] jQuery.Deferred.pipe - context", function( assert ) {
|
||||
|
||||
assert.expect( 5 );
|
||||
|
||||
var defer, piped, defer2, piped2,
|
||||
context = {},
|
||||
done = jQuery.map( new Array( 4 ), function() {
|
||||
return assert.async();
|
||||
} );
|
||||
|
||||
jQuery.Deferred().resolveWith( context, [ 2 ] ).pipe( function( value ) {
|
||||
return value * 3;
|
||||
} ).done( function( value ) {
|
||||
assert.strictEqual( this, context, "[PIPE ONLY] custom context correctly propagated" );
|
||||
assert.strictEqual( value, 6, "proper value received" );
|
||||
done.pop().call();
|
||||
} );
|
||||
|
||||
jQuery.Deferred().resolve().pipe( function() {
|
||||
return jQuery.Deferred().resolveWith( context );
|
||||
} ).done( function() {
|
||||
assert.strictEqual( this, context,
|
||||
"custom context of returned deferred correctly propagated" );
|
||||
done.pop().call();
|
||||
} );
|
||||
|
||||
defer = jQuery.Deferred();
|
||||
piped = defer.pipe( function( value ) {
|
||||
return value * 3;
|
||||
} );
|
||||
|
||||
defer.resolve( 2 );
|
||||
|
||||
piped.done( function( value ) {
|
||||
|
||||
// `this` result changed between 1.8 and 1.9, so don't check it
|
||||
assert.strictEqual( value, 6, "proper value received" );
|
||||
done.pop().call();
|
||||
} );
|
||||
|
||||
defer2 = jQuery.Deferred();
|
||||
piped2 = defer2.pipe();
|
||||
|
||||
defer2.resolve( 2 );
|
||||
|
||||
piped2.done( function( value ) {
|
||||
|
||||
// `this` result changed between 1.8 and 1.9, so don't check it
|
||||
assert.strictEqual( value, 2, "proper value received (without passing function)" );
|
||||
done.pop().call();
|
||||
} );
|
||||
} );
|
||||
86
node_modules/jquery-migrate/test/effects.js
generated
vendored
Normal file
86
node_modules/jquery-migrate/test/effects.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
QUnit.module( "effects" );
|
||||
|
||||
QUnit.test( "jQuery.easing", function( assert ) {
|
||||
var lastP = -0.1,
|
||||
easingCallCount = 0,
|
||||
animComplete = assert.async();
|
||||
|
||||
assert.expect( 4 );
|
||||
|
||||
jQuery.easing.testOld = function( p, n, firstNum, diff ) {
|
||||
assert.ok( false, "should not have been called" );
|
||||
};
|
||||
|
||||
jQuery.easing.testNew = function( p ) {
|
||||
if ( ++easingCallCount < 3 ) {
|
||||
if ( p === 0 && p === lastP ) {
|
||||
assert.ok( true, "p===0 called twice before jQuery 3.2.0" );
|
||||
} else {
|
||||
assert.ok( p > lastP, "called, percentage is increasing" );
|
||||
lastP = p;
|
||||
}
|
||||
}
|
||||
|
||||
// Linear
|
||||
return p;
|
||||
};
|
||||
|
||||
var div = jQuery( "<div>test</div>" )
|
||||
.css( "width", "30px" )
|
||||
.appendTo( "#qunit-fixture" );
|
||||
|
||||
// Can't use expectWarning since this is async
|
||||
div;
|
||||
jQuery.migrateReset();
|
||||
div.animate( { width: "20px" }, {
|
||||
duration: 50,
|
||||
easing: "testOld",
|
||||
complete: function() {
|
||||
assert.equal( jQuery.migrateWarnings.length, 1, "warned" );
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
div.animate( { width: "10px" }, {
|
||||
duration: 50,
|
||||
easing: "testNew",
|
||||
complete: function() {
|
||||
assert.equal( jQuery.migrateWarnings.length, 0, "did not warn" );
|
||||
animComplete();
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
// If the browser has requestAnimationFrame, jQuery won't touch fx.interval
|
||||
QUnit.test( "jQuery.fx.interval - no warning on animations", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var start = assert.async();
|
||||
|
||||
// Can't use expectNoWarning since this is async
|
||||
jQuery.migrateReset();
|
||||
jQuery( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.animate( { opacity: 0.5 }, 50, function() {
|
||||
assert.equal( jQuery.migrateWarnings.length, 0, "no warning" );
|
||||
start();
|
||||
} );
|
||||
} );
|
||||
|
||||
// Only rAF browsers implement the interval warning
|
||||
QUnit.test( "jQuery.fx.interval - user change", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var oldInterval,
|
||||
warner = window.requestAnimationFrame ? expectWarning : expectNoWarning;
|
||||
|
||||
assert.ok( true, "requestAnimationFrame is " +
|
||||
( window.requestAnimationFrame ? "present" : "absent" ) );
|
||||
warner( assert, "read fx.interval", function() {
|
||||
oldInterval = jQuery.fx.interval;
|
||||
} );
|
||||
warner( assert, "write fx.interval", function() {
|
||||
jQuery.fx.interval = 13;
|
||||
} );
|
||||
|
||||
jQuery.fx.interval = oldInterval;
|
||||
} );
|
||||
75
node_modules/jquery-migrate/test/event-fixHooks.html
generated
vendored
Normal file
75
node_modules/jquery-migrate/test/event-fixHooks.html
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate event fixHooks iframe test</title>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
</script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<script>
|
||||
function dispatchEvent( elem, type ) {
|
||||
var e = document.createEvent( "HTMLEvents" );
|
||||
e.initEvent( type, true, true );
|
||||
elem.dispatchEvent( e );
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var div = document.createElement( "div" ),
|
||||
$div = jQuery( div ).appendTo( document.body );
|
||||
|
||||
jQuery.event.fixHooks[ "excite" ] = {
|
||||
props: [ "reallyHappy", "reallySad" ],
|
||||
filter: function( event, original ) {
|
||||
if ( "reallySad" in event ) {
|
||||
event.gotSad = 1;
|
||||
}
|
||||
if ( "reallyHappy" in event ) {
|
||||
event.gotHappy = 2;
|
||||
}
|
||||
return event;
|
||||
}
|
||||
};
|
||||
jQuery.event.fixHooks[ "thrill" ] = {
|
||||
filter: function( event, original ) {
|
||||
event.thrilled = "MJ";
|
||||
return event;
|
||||
}
|
||||
};
|
||||
$div.on( "excite", function( event ) {
|
||||
var test1 =
|
||||
// Hooks were called
|
||||
event.gotSad === 1 &&
|
||||
event.gotHappy === 2 &&
|
||||
|
||||
jQuery.event.props.length === 0 &&
|
||||
jQuery.event.fixHooks[ "excite" ].props.length === 0;
|
||||
|
||||
var test2 = $div.triggerHandler( "thrill" );
|
||||
|
||||
// Second thrill should not give another warning
|
||||
$div.triggerHandler( "thrill" );
|
||||
|
||||
startIframeTest( test1, test2 );
|
||||
} );
|
||||
$div.on( "thrill", function( event ) {
|
||||
return event.thrilled === "MJ";
|
||||
} );
|
||||
|
||||
dispatchEvent( div, "excite" );
|
||||
}
|
||||
|
||||
jQuery( runTest );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>jQuery Migrate</p>
|
||||
</body>
|
||||
</html>
|
||||
37
node_modules/jquery-migrate/test/event-lateload.html
generated
vendored
Normal file
37
node_modules/jquery-migrate/test/event-lateload.html
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate late load event binding test</title>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
</script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<script>
|
||||
var loaded = jQuery.Deferred();
|
||||
|
||||
// No warning here, document isn't yet loaded
|
||||
jQuery( window ).on( "load", function() {
|
||||
loaded.resolve();
|
||||
});
|
||||
|
||||
jQuery.when( jQuery.ready, loaded ).then( function() {
|
||||
|
||||
// This .on() call should warn
|
||||
jQuery( window ).on( "load", jQuery.noop );
|
||||
|
||||
startIframeTest();
|
||||
} );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>jQuery Migrate late load event binding test</p>
|
||||
</body>
|
||||
</html>
|
||||
40
node_modules/jquery-migrate/test/event-props-concat.html
generated
vendored
Normal file
40
node_modules/jquery-migrate/test/event-props-concat.html
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate test for event.props.concat() compat</title>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
</script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<!-- Keep these two in separate script tags so Migrate loads first -->
|
||||
<script>
|
||||
startIframeTest( jQuery.event.props.concat([ "TESTING" ]) );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div data-role="page">
|
||||
|
||||
<div data-role="header">
|
||||
<h1>jQuery Migrate test for jQuery.event.props.concat() compat</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<p>Page content</p>
|
||||
</div><!-- /content -->
|
||||
|
||||
<div data-role="footer">
|
||||
<h4>Footer</h4>
|
||||
</div><!-- /footer -->
|
||||
</div><!-- /page -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
55
node_modules/jquery-migrate/test/event-props.html
generated
vendored
Normal file
55
node_modules/jquery-migrate/test/event-props.html
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate event props iframe test</title>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
</script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<script>
|
||||
function dispatchEvent( elem, type ) {
|
||||
var e = document.createEvent( "HTMLEvents" );
|
||||
e.initEvent( type, true, true );
|
||||
elem.dispatchEvent( e );
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var test1, test2,
|
||||
div = document.createElement( "div" ),
|
||||
$div = jQuery( div ).appendTo( document.body );
|
||||
|
||||
$div.on( "blend", function( event ) {
|
||||
test1 = ( "whip" in event ) && ( "chop" in event );
|
||||
|
||||
// Props added later are also processed
|
||||
jQuery.event.props.push( "frappe" );
|
||||
dispatchEvent( div, "puree" );
|
||||
} );
|
||||
|
||||
$div.on( "puree", function( event ) {
|
||||
test2 = ( "whip" in event ) && ( "frappe" in event );
|
||||
|
||||
// 2 prop warnings ( chop+whip and frappe )
|
||||
startIframeTest( test1, test2 );
|
||||
} );
|
||||
|
||||
// Multiple props, processed with a single warning
|
||||
jQuery.event.props.push( "chop", "whip" );
|
||||
dispatchEvent( div, "blend" );
|
||||
}
|
||||
|
||||
jQuery( runTest );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>jQuery Migrate</p>
|
||||
</body>
|
||||
</html>
|
||||
27
node_modules/jquery-migrate/test/event-ready.html
generated
vendored
Normal file
27
node_modules/jquery-migrate/test/event-ready.html
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate `ready` event iframe test</title>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
</script>
|
||||
<script src="iframeTest.js"></script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "dev", true );
|
||||
</script>
|
||||
<script>
|
||||
// This should warn when the handler runs
|
||||
jQuery( document ).on( "ready", function() {
|
||||
startIframeTest();
|
||||
} );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>jQuery Migrate `ready` event iframe test</p>
|
||||
</body>
|
||||
</html>
|
||||
190
node_modules/jquery-migrate/test/event.js
generated
vendored
Normal file
190
node_modules/jquery-migrate/test/event.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
|
||||
QUnit.module( "event" );
|
||||
|
||||
QUnit.test( "error() event method", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
expectWarning( assert, "jQuery.fn.error()", function() {
|
||||
jQuery( "<img />" )
|
||||
.error( function() {
|
||||
assert.ok( true, "Triggered error event" );
|
||||
} )
|
||||
.error()
|
||||
.off( "error" )
|
||||
.error()
|
||||
.remove();
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "load() and unload() event methods", function( assert ) {
|
||||
assert.expect( 5 );
|
||||
|
||||
expectWarning( assert, "jQuery.fn.load()", function() {
|
||||
jQuery( "<img />" )
|
||||
.load( function() {
|
||||
assert.ok( true, "Triggered load event" );
|
||||
} )
|
||||
.load()
|
||||
.off( "load" )
|
||||
.load()
|
||||
.remove();
|
||||
} );
|
||||
|
||||
expectWarning( assert, "jQuery.fn.unload()", function() {
|
||||
jQuery( "<img />" )
|
||||
.unload( function() {
|
||||
assert.ok( true, "Triggered unload event" );
|
||||
} )
|
||||
.unload()
|
||||
.off( "unload" )
|
||||
.unload()
|
||||
.remove();
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "ajax load", function() {
|
||||
var start = assert.async();
|
||||
jQuery( "<div id=load138></div>" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.load( "not-found.file", function() {
|
||||
jQuery( "#load138" ).remove();
|
||||
start();
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( ".bind() and .unbind()", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var $elem = jQuery( "<div />" ).appendTo( "#qunit-fixture" );
|
||||
|
||||
expectWarning( assert, ".bind()", 1, function() {
|
||||
$elem
|
||||
.bind( "click", function() {
|
||||
assert.ok( true, "click fired" );
|
||||
} )
|
||||
.trigger( "click" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".unbind()", 1, function() {
|
||||
$elem
|
||||
.unbind( "click" )
|
||||
.trigger( "click" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( ".delegate() and .undelegate()", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var $div = jQuery( "<div />" ).appendTo( "#qunit-fixture" );
|
||||
|
||||
jQuery( "<p />" ).appendTo( $div );
|
||||
|
||||
expectWarning( assert, ".delegate()", 1, function() {
|
||||
$div
|
||||
.delegate( "p", "click", function() {
|
||||
assert.ok( true, "delegated click fired" );
|
||||
} )
|
||||
.find( "p" ).trigger( "click" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".undelegate()", 1, function() {
|
||||
$div
|
||||
.undelegate( "p", "click" )
|
||||
.find( "p" ).trigger( "click" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "Event aliases", function( assert ) {
|
||||
assert.expect( 14 );
|
||||
|
||||
var $div = jQuery( "<div />" );
|
||||
|
||||
"scroll click submit keydown".split( " " ).forEach( function( name ) {
|
||||
expectWarning( assert, "." + name + "()", 1, function() {
|
||||
$div[ name ]( function( event ) {
|
||||
assert.equal( event.type, name, name );
|
||||
$div.off( event );
|
||||
} )[ name ]();
|
||||
} );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".hover() one-arg", 1, function() {
|
||||
$div.hover( function( event ) {
|
||||
assert.ok( /mouseenter|mouseleave/.test( event.type ), event.type );
|
||||
$div.off( event );
|
||||
} ).trigger( "mouseenter" ).trigger( "mouseleave" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".hover() two-arg", 1, function() {
|
||||
$div.hover(
|
||||
function( event ) {
|
||||
assert.equal( "mouseenter", event.type, event.type );
|
||||
},
|
||||
function( event ) {
|
||||
assert.equal( "mouseleave", event.type, event.type );
|
||||
}
|
||||
).trigger( "mouseenter" ).trigger( "mouseleave" );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "custom ready", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
jQuery("#qunit-fixture").append("<div id='foo'>bar</div>");
|
||||
|
||||
expectNoWarning( assert, "Custom ready event not on document", 1, function() {
|
||||
jQuery( "#foo" ).on( "ready", function() {
|
||||
assert.ok( true, "custom ready event was triggered" );
|
||||
} )
|
||||
.trigger( "ready" )
|
||||
.off( "ready" );
|
||||
} );
|
||||
} );
|
||||
|
||||
TestManager.runIframeTest( "document ready", "event-ready.html",
|
||||
function( assert, jQuery ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
assert.equal( jQuery.migrateWarnings.length, 1, "warnings: " +
|
||||
JSON.stringify( jQuery.migrateWarnings ) );
|
||||
} );
|
||||
|
||||
TestManager.runIframeTest( "jQuery.event.props.concat", "event-props-concat.html",
|
||||
function( assert, jQuery, window, document, log, props ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var warns = JSON.stringify( jQuery.migrateWarnings );
|
||||
|
||||
assert.equal( jQuery.migrateWarnings.length, 1, "one warning" );
|
||||
assert.ok( warns.indexOf( "props.concat" ) >= 0, "warnings: " + warns );
|
||||
assert.equal( props[0], "TESTING", "used the empty props" )
|
||||
} );
|
||||
|
||||
// Do this as iframe because there is no way to undo prop addition
|
||||
TestManager.runIframeTest( "jQuery.event.props", "event-props.html",
|
||||
function( assert, jQuery, window, document, log, test1, test2 ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
assert.ok( test1 && test2, "props were processed" );
|
||||
assert.equal( jQuery.migrateWarnings.length, 2, "warnings: " +
|
||||
JSON.stringify( jQuery.migrateWarnings ) );
|
||||
} );
|
||||
|
||||
// Do this as iframe because there is no way to undo prop addition
|
||||
TestManager.runIframeTest( "jQuery.event.fixHooks", "event-fixHooks.html",
|
||||
function( assert, jQuery, window, document, log, test1, test2 ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
assert.ok( test1 && test2, "hooks were processed" );
|
||||
assert.equal( jQuery.migrateWarnings.length, 2, "warnings: " +
|
||||
JSON.stringify( jQuery.migrateWarnings ) );
|
||||
} );
|
||||
|
||||
TestManager.runIframeTest( "Load within a ready handler", "event-lateload.html",
|
||||
function( assert, jQuery, window, document, log ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
assert.equal( jQuery.migrateWarnings.length, 1, "warnings: " +
|
||||
JSON.stringify( jQuery.migrateWarnings ) );
|
||||
assert.ok( /load/.test( jQuery.migrateWarnings[ 0 ] ), "message ok" );
|
||||
} );
|
||||
32
node_modules/jquery-migrate/test/iframeTest.js
generated
vendored
Normal file
32
node_modules/jquery-migrate/test/iframeTest.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Iframe-based unit tests support
|
||||
* Load this file immediately after jQuery, before jQuery Migrate
|
||||
*/
|
||||
|
||||
// Don't spew on in the console window when we build
|
||||
// Warning messages are available to parent test in jQuery.migrateWarnings
|
||||
if ( navigator.userAgent.indexOf( "PhantomJS" ) >= 0 ) {
|
||||
jQuery.migrateMute = true;
|
||||
}
|
||||
|
||||
// Support: IE9 only (no console at times)
|
||||
if ( !window.console ) {
|
||||
window.console = {};
|
||||
}
|
||||
|
||||
// Capture output so the test in the parent window can inspect it, and so the
|
||||
// initialization for the iframe doesn't show another Migrate startup header.
|
||||
var logOutput = "";
|
||||
|
||||
window.console.log = function() {
|
||||
logOutput += Array.prototype.join.call( arguments, " " ) + "\n";
|
||||
};
|
||||
|
||||
// Callback gets ( jQuery, window, document, log [, startIframe args ] )
|
||||
window.startIframeTest = function() {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Note: jQuery may be undefined if page did not load it
|
||||
args.unshift( window.jQuery, window, document, logOutput );
|
||||
window.parent.TestManager.iframeCallback.apply( null, args );
|
||||
};
|
||||
46
node_modules/jquery-migrate/test/index.html
generated
vendored
Normal file
46
node_modules/jquery-migrate/test/index.html
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery Migrate Test Suite</title>
|
||||
<!-- // Support: IE <= 10 only -->
|
||||
<!-- Ensure IE doesn't fall back into oldIE modes -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
|
||||
<!-- QUnit -->
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css" media="screen">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
|
||||
<!-- Load a jQuery and jquery-migrate plugin file based on URL -->
|
||||
<script src="testinit.js"></script>
|
||||
<script>
|
||||
TestManager.loadProject( "jquery", "git" );
|
||||
// Close this script tag so file will load
|
||||
</script>
|
||||
<script>
|
||||
jQuery.noConflict();
|
||||
TestManager.loadProject( "jquery-migrate", "min", true );
|
||||
</script>
|
||||
|
||||
<!-- Version comparisons -->
|
||||
<script src="../src/compareVersions.js"></script>
|
||||
|
||||
<!-- Unit test files -->
|
||||
<script src="migrate.js"></script>
|
||||
<script src="core.js"></script>
|
||||
<script src="ajax.js"></script>
|
||||
<script src="attributes.js"></script>
|
||||
<script src="css.js"></script>
|
||||
<script src="data.js"></script>
|
||||
<script src="event.js"></script>
|
||||
<script src="offset.js"></script>
|
||||
<script src="serialize.js"></script>
|
||||
<script src="traversing.js"></script>
|
||||
<script src="deferred.js"></script>
|
||||
<script src="effects.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
</body>
|
||||
</html>
|
||||
40
node_modules/jquery-migrate/test/migrate.js
generated
vendored
Normal file
40
node_modules/jquery-migrate/test/migrate.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/* exported expectWarning, expectNoWarning */
|
||||
|
||||
// Don't spew on in the console window when we build
|
||||
if ( navigator.userAgent.indexOf( "PhantomJS" ) >= 0 ) {
|
||||
jQuery.migrateMute = true;
|
||||
}
|
||||
|
||||
function expectWarning( assert, name, expected, fn ) {
|
||||
if ( !fn ) {
|
||||
fn = expected;
|
||||
expected = null;
|
||||
}
|
||||
jQuery.migrateReset();
|
||||
fn();
|
||||
|
||||
// Special-case for 0 warnings expected
|
||||
if ( expected === 0 ) {
|
||||
assert.deepEqual( jQuery.migrateWarnings, [], name + ": did not warn" );
|
||||
|
||||
// Simple numeric equality assertion for warnings matching an explicit count
|
||||
} else if ( expected && jQuery.migrateWarnings.length === expected ) {
|
||||
assert.equal( jQuery.migrateWarnings.length, expected, name + ": warned" );
|
||||
|
||||
// Simple ok assertion when we saw at least one warning and weren't looking for an explict count
|
||||
} else if ( !expected && jQuery.migrateWarnings.length ) {
|
||||
assert.ok( true, name + ": warned" );
|
||||
|
||||
// Failure; use deepEqual to show the warnings that *were* generated and the expectation
|
||||
} else {
|
||||
assert.deepEqual( jQuery.migrateWarnings,
|
||||
"<warnings: " + ( expected || "1+" ) + ">", name + ": warned"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function expectNoWarning( assert, name, expected, fn ) {
|
||||
|
||||
// Expected is present only for signature compatibility with expectWarning
|
||||
return expectWarning( assert, name, 0, fn || expected );
|
||||
}
|
||||
47
node_modules/jquery-migrate/test/offset.js
generated
vendored
Normal file
47
node_modules/jquery-migrate/test/offset.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
QUnit.module( "offset" );
|
||||
|
||||
QUnit.test( ".offset()", function( assert ) {
|
||||
assert.expect( 12 );
|
||||
|
||||
var bogus = { top: 0, left: 0 };
|
||||
|
||||
expectNoWarning( assert, ".offset() on body", function() {
|
||||
var offset = jQuery( "body" ).offset();
|
||||
|
||||
assert.ok( offset.top > 1, "non-zero top offset" );
|
||||
assert.ok( offset.left > 1, "non-zero left offset" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, ".offset() as setter", function() {
|
||||
var $elem = jQuery( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.css( "position", "absolute" )
|
||||
.offset( { top: 42, left: 99 } ),
|
||||
offset = $elem.offset();
|
||||
|
||||
assert.equal( offset.top, 42, "non-zero top offset" );
|
||||
assert.equal( offset.left, 99, "non-zero left offset" );
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".offset() on window", function() {
|
||||
assert.deepEqual(
|
||||
jQuery( window ).offset(),
|
||||
bogus, "window bogus top/left 0"
|
||||
);
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".offset() on disconnected node", function() {
|
||||
assert.deepEqual(
|
||||
jQuery( document.createElement( "div" ) ).offset(),
|
||||
bogus, "disconnected bogus top/left 0"
|
||||
);
|
||||
} );
|
||||
|
||||
expectWarning( assert, ".offset() on plain object", function() {
|
||||
assert.deepEqual(
|
||||
jQuery( { space: "junk", zero: 0 } ).offset(),
|
||||
bogus, "plain object bogus top/left 0"
|
||||
);
|
||||
} );
|
||||
} );
|
||||
51
node_modules/jquery-migrate/test/serialize.js
generated
vendored
Normal file
51
node_modules/jquery-migrate/test/serialize.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
QUnit.module( "serialize" );
|
||||
|
||||
QUnit.test( "jQuery.param( x, traditional)", function( assert ) {
|
||||
assert.expect( 12 );
|
||||
|
||||
var savedTraditional = jQuery.ajaxSettings.traditional,
|
||||
data = { a: [ 1, 2 ] },
|
||||
standardResult = "a%5B%5D=1&a%5B%5D=2",
|
||||
traditionalResult = "a=1&a=2";
|
||||
|
||||
expectNoWarning( assert, "default, traditional default", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data ), standardResult,
|
||||
"default, traditional default" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "explicit true, traditional default", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data, true ), traditionalResult,
|
||||
"explicit true, traditional default" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "explicit false, traditional default", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data, false ), standardResult,
|
||||
"explicit false, traditional default" );
|
||||
} );
|
||||
|
||||
jQuery.ajaxSettings.traditional = true;
|
||||
|
||||
expectWarning( assert, "default, traditional true", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data ), traditionalResult,
|
||||
"default, traditional true" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "explicit true, traditional true", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data, true ), traditionalResult,
|
||||
"explicit true, traditional true" );
|
||||
} );
|
||||
|
||||
expectNoWarning( assert, "explicit false, traditional true", function() {
|
||||
assert.equal(
|
||||
jQuery.param( data, false ), standardResult,
|
||||
"explicit false, traditional true" );
|
||||
} );
|
||||
|
||||
jQuery.ajaxSettings.traditional = savedTraditional;
|
||||
} );
|
||||
164
node_modules/jquery-migrate/test/testinit.js
generated
vendored
Normal file
164
node_modules/jquery-migrate/test/testinit.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
TestManager = {
|
||||
|
||||
/*
|
||||
* Load a version of a file based on URL parameters.
|
||||
*
|
||||
* dev Uncompressed development version: source files in the project /dist dir
|
||||
* raw Non-combined dev version: source files from the project /src dir
|
||||
* min Minified version in the project /dist dir
|
||||
* VER Version from code.jquery.com, e.g.: git, 1.8.2.min or 1.7rc1
|
||||
* else Full or relative path to be used for script src
|
||||
*/
|
||||
loadProject: function( projectName, defaultVersion, isSelf ) {
|
||||
var file, i,
|
||||
lines = "",
|
||||
urlTag = this.projects[ projectName ].urlTag,
|
||||
matcher = new RegExp( "\\b" + urlTag + "=([^&]+)" ),
|
||||
projectRoot = this.baseURL + ( isSelf ? ".." : "../../" + projectName ),
|
||||
version = ( matcher.exec( document.location.search ) || {} )[ 1 ] || defaultVersion;
|
||||
|
||||
if ( window.__karma__ && isSelf ) {
|
||||
projectRoot = "/base";
|
||||
}
|
||||
if ( version === "raw" ) {
|
||||
|
||||
// Order is important
|
||||
file = [
|
||||
"version",
|
||||
"migrate",
|
||||
"core",
|
||||
"ajax",
|
||||
"attributes",
|
||||
"css",
|
||||
"data",
|
||||
"effects",
|
||||
"event",
|
||||
"offset",
|
||||
"serialize",
|
||||
"traversing",
|
||||
"deferred"
|
||||
];
|
||||
|
||||
for ( i = 0; i < file.length; i++ ) {
|
||||
file[ i ] = projectRoot + "/src/" + file[ i ] + ".js";
|
||||
}
|
||||
} else if ( version === "dev" ) {
|
||||
file = projectRoot + "/dist/" + projectName + ".js";
|
||||
} else if ( version === "min" ) {
|
||||
file = projectRoot + "/dist/" + projectName + ".min.js";
|
||||
} else if ( /^[\w\.\-]+$/.test( version ) ) {
|
||||
file = "http://code.jquery.com/" + projectName + "-" + version + ".js";
|
||||
} else {
|
||||
file = version;
|
||||
}
|
||||
this.loaded.push( {
|
||||
projectName: projectName,
|
||||
tag: version,
|
||||
file: file
|
||||
} );
|
||||
|
||||
if ( typeof file === "string" ) {
|
||||
document.write( "<script src='" + file + "'></script>" );
|
||||
|
||||
} else {
|
||||
for ( i = 0; i < file.length; i++ ) {
|
||||
lines += "<script src='" + file[ i ] + "'></script>";
|
||||
}
|
||||
|
||||
document.write( lines );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Iframe tests that require setup not covered in the standard unit test
|
||||
*
|
||||
* Note that options passed into the standard unit tests will also be passed to
|
||||
* the iframe, but the iframe html page is responsible for processing them
|
||||
* as appropriate (for example by calling TestManager.loadProject)
|
||||
*/
|
||||
runIframeTest: function( title, url, func ) {
|
||||
var self = this;
|
||||
QUnit.test( title, function( assert ) {
|
||||
var iframe,
|
||||
query = window.location.search.slice( 1 ),
|
||||
done = assert.async();
|
||||
|
||||
self.iframeCallback = function() {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
args.unshift( assert );
|
||||
|
||||
setTimeout( function() {
|
||||
self.iframeCallback = undefined;
|
||||
|
||||
func.apply( this, args );
|
||||
func = function() {};
|
||||
iframe.remove();
|
||||
|
||||
done();
|
||||
} );
|
||||
};
|
||||
iframe = jQuery( "<div/>" )
|
||||
.css( { position: "absolute", width: "500px", left: "-600px" } )
|
||||
.append( jQuery( "<iframe/>" ).attr( "src", self.baseURL + url +
|
||||
( query && ( /\?/.test( url ) ? "&" : "?" ) ) + query ) )
|
||||
.appendTo( "#qunit-fixture" );
|
||||
} );
|
||||
},
|
||||
iframeCallback: undefined,
|
||||
baseURL: window.__karma__ ? "base/test/" : "./",
|
||||
init: function( projects ) {
|
||||
var p, project;
|
||||
|
||||
this.projects = projects;
|
||||
this.loaded = [];
|
||||
|
||||
// Do QUnit setup if QUnit is loaded (could be an iframe page)
|
||||
if ( !window.QUnit ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Max time for async tests until it aborts test
|
||||
// and start()'s the next test.
|
||||
QUnit.config.testTimeout = 20 * 1000; // 20 seconds
|
||||
|
||||
// Enforce an "expect" argument or expect() call in all test bodies.
|
||||
QUnit.config.requireExpects = true;
|
||||
|
||||
// Set the list of projects, including the project version choices.
|
||||
for ( p in projects ) {
|
||||
project = projects[ p ];
|
||||
QUnit.config.urlConfig.push( {
|
||||
label: p,
|
||||
id: project.urlTag,
|
||||
value: project.choices.split( "," )
|
||||
} );
|
||||
}
|
||||
}
|
||||
};
|
||||
TestManager.init( {
|
||||
"jquery": {
|
||||
urlTag: "jquery",
|
||||
choices: "dev,min,git,3.x-git,3.4.1,3.3.1,3.2.1,3.1.1,3.0.0"
|
||||
},
|
||||
"jquery-migrate": {
|
||||
urlTag: "plugin",
|
||||
choices: "dev,min,raw,git,3.0.1,3.0.0"
|
||||
}
|
||||
} );
|
||||
|
||||
/**
|
||||
* Load the TestSwarm listener if swarmURL is in the address.
|
||||
*/
|
||||
( function() {
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
|
||||
|
||||
if ( !url || url.indexOf( "http" ) !== 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.write( "<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" +
|
||||
( new Date() ).getTime() + "'></scr" + "ipt>" );
|
||||
} )();
|
||||
|
||||
10
node_modules/jquery-migrate/test/traversing.js
generated
vendored
Normal file
10
node_modules/jquery-migrate/test/traversing.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
QUnit.module( "traversing" );
|
||||
|
||||
QUnit.test( ".andSelf", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
expectWarning( assert, "andSelf", function() {
|
||||
jQuery( "<div id='outer'><div id='inner'></div></div>" ).find( ".inner" ).andSelf();
|
||||
} );
|
||||
} );
|
||||
231
node_modules/jquery-migrate/warnings.md
generated
vendored
Normal file
231
node_modules/jquery-migrate/warnings.md
generated
vendored
Normal file
@@ -0,0 +1,231 @@
|
||||
# jQuery Migrate Plugin - Warning Messages
|
||||
|
||||
**NOTE: This page lists the messages for jQuery Migrate 3.0. If you are using an earlier version, see the documentation on [the 1.x-stable branch](https://github.com/jquery/jquery-migrate/blob/1.x-stable/warnings.md).**
|
||||
|
||||
To allow developers to identify and fix compatibility issues when migrating older jQuery code, the development (uncompressed) version of the plugin generates console warning messages whenever any of its functionality is called. The messages only appear once on the console for each unique message.
|
||||
|
||||
**In most cases these messages are simply _warnings_; code should continue to work properly with later versions of jQuery as long as the jQuery Migrate plugin is used, but we recommend changing the code where possible to eliminate warnings so that the plugin does not need to be used.**
|
||||
|
||||
The production (compressed) version of the plugin does not generate warnings. To continue using jQuery code that has compatibility issues without making any changes and without console messages, simply include the production version in the file rather than the development version. See the [README](README.md) for download instructions.
|
||||
|
||||
All messages generated by this plugin start with the text "JQMIGRATE" for easy identification. The warning messages, causes, and remediation instructions are listed below. Items listed as **deprecated and removed** must be changed before the code will work properly without the Migrate plugin. Items listed as only **deprecated** are still supported by the current version but no longer considered a good practice, and may be removed in the future.
|
||||
|
||||
### JQMIGRATE: Migrate is installed, version X
|
||||
### JQMIGRATE: Migrate is installed with logging active, version X
|
||||
|
||||
This is _not_ a warning, but a console log message the plugin shows when it first loads to indicate whether warnings will be shown on the console when appropriate. As of version 1.4.0 this message is also shown with production builds. The use jQuery Migrate in production has performance impacts and can complicate debugging as it modifies the normal behavior of the version of jQuery being used.
|
||||
|
||||
### JQMIGRATE: jQuery 3.0.0+ REQUIRED
|
||||
|
||||
**Cause:** The page does not have a version of jQuery installed, or is using a version of jQuery older than 3.0.0. The jQuery Migrate plugin is not intended to be used for those cases. Any messages that follow this one may not be accurate, or the page may not run properly at all.
|
||||
|
||||
**Solution:** See the [README](https://github.com/jquery/jquery-migrate/#readme) for more information on usage and upgrading from older versions.
|
||||
|
||||
### JQMIGRATE: Migrate plugin loaded multiple times
|
||||
|
||||
**Cause:** The plugin detected that some version of jQuery Migrate is already loaded. Loading multiple versions can cause unpredictable behavior.
|
||||
|
||||
**Solution:** Remove all but the latest version of the jQuery Migrate plugin. See the [README](https://github.com/jquery/jquery-migrate/#readme) for more information on usage and upgrading from older versions.
|
||||
|
||||
### JQMIGRATE: Attribute selector with '#' must be quoted
|
||||
### JQMIGRATE: Attribute selector with '#' was not fixed
|
||||
|
||||
**Cause:** Selectors such as `a[href=#main]` are not valid CSS syntax because the value contains special characters that are not quoted. Until jQuery 1.11.3/2.1.4 this was accepted, but the behavior is non-standard and was never documented. In later versions this selector throws an error. *In some cases with complex selectors, Migrate may not attempt a repair.* In those cases a fatal error will be logged on the console and you will need to fix the selector manually.
|
||||
|
||||
**Solution**: Put quotes around any attribute values that have special characters, e.g. `a[href="#main"]`. The warning message contains the selector that caused the problem, use that to find the selector in the source files.
|
||||
|
||||
### JQMIGRATE: jQuery is not compatible with Quirks Mode
|
||||
|
||||
**Cause:** A browser runs in "quirks mode" when the HTML document does not have a `<!doctype ...>` as its first non-blank line, or when the doctype in the file is invalid. This mode causes the browser to emulate 1990s-era (HTML3) behavior. In Internet Explorer, it also causes many high-performance APIs to be hidden in order to better emulate ancient browsers. jQuery has never been compatible with, or tested in, quirks mode.
|
||||
|
||||
**Solution:** Put a [valid doctype](http://www.w3.org/QA/2002/04/valid-dtd-list.html) in the document and ensure that the document is rendering in standards mode. The simplest valid doctype is the HTML5 one, which we highly recommend: `<!doctype html>` . The jQuery Migrate plugin does not attempt to fix issues related to quirks mode.
|
||||
|
||||
### JQMIGRATE: jQXHR.success is deprecated and removed
|
||||
### JQMIGRATE: jQXHR.error is deprecated and removed
|
||||
### JQMIGRATE: jQXHR.complete is deprecated and removed
|
||||
|
||||
**Cause:** The `.success()`, `.error()`, and `.complete()` methods of the `jQXHR` object returned from `jQuery.ajax()` have been deprecated since jQuery 1.8 and were removed in jQuery 3.0.
|
||||
|
||||
**Solution:** Replace the use of these methods with the standard Deferred methods: `.success()` becomes `.done()`, `.error()` becomes `.fail()`, and `.complete()` becomes `.always()`.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.error() is deprecated
|
||||
|
||||
**Cause:** The `$().error()` method was used to attach an "error" event to an element but has been removed in 1.9 to reduce confusion with the `$.error()` method which is unrelated and has not been deprecated. It also serves to discourage the temptation to use `$(window).error()` which does not work because `window.onerror` does not follow standard event handler conventions. The `$().error()` method was removed in jQuery 3.0.
|
||||
|
||||
**Solution:** Change any use of `$().error(fn)` to `$().on("error", fn)`.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.load() is deprecated
|
||||
### JQMIGRATE: jQuery.fn.unload() is deprecated
|
||||
|
||||
**Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it.
|
||||
|
||||
**Solution:** Change any use of `$().load(fn)` to `$().on("load", fn)` and `$().unload(fn)` to `$().on("unload", fn)`.
|
||||
|
||||
### JQMIGRATE: deferred.pipe() is deprecated
|
||||
|
||||
**Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function.
|
||||
|
||||
**Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0.
|
||||
|
||||
### JQMIGRATE: jQuery.fx.interval is deprecated
|
||||
|
||||
**Cause**: As of jQuery 3.0 the `jQuery.fx.interval` property can be used to change the animation interval _only_ on browsers that do not support the `window.requestAnimationFrame()` method. That is currently only Internet Explorer 9 and the Android Browser. Once support is dropped for these browsers, the property will serve no purpose and it will be removed.
|
||||
|
||||
**Solution**: Find and remove code that changes or uses `jQuery.fx.interval`. If the value is being used by code in your page or a plugin, the code may be making assumptions that are no longer valid. The default value of `jQuery.fx.interval` is `13` (milliseconds), which could be used instead of accessing this property.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()
|
||||
|
||||
**Cause**: The `.andSelf()` method has been renamed to `.addBack()` as of jQuery 1.9 to better reflect its purpose of adding back the previous set of results. The old alias was removed in jQuery 3.0.
|
||||
|
||||
**Solution**: Replace any use of `.andSelf()` with `.addBack()`.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.size() is deprecated and removed; use the .length property
|
||||
|
||||
**Cause**: The `.size()` method returns the number of elements in the current jQuery object, but duplicates the more-efficient `.length` property which provides the same functionality. As of jQuery 1.9 the `.length` property is the preferred way to retrieve this value. jQuery 3.0 no longer contains the `.size()` method.
|
||||
|
||||
**Solution**: Replace any use of `.size()` with `.length`.
|
||||
|
||||
### JQMIGRATE: jQuery.data() always sets/gets camelCased names
|
||||
|
||||
**Cause:** The page is attempting to set or get a jQuery data item using kebab case, e.g. `my-data`, when a `my-data` item has been set directly on the jQuery data object. jQuery 3.0 always exclusively uses camel case, e.g., `myData`, when it accesses data items via the `.data()` API and does not find kebab case data in that object.
|
||||
|
||||
**Solution:** Either 1) Always use the `.data()` API to set or get data items, 2) Always use camelCase names when also setting properties directly on jQuery's data object, or 3) Always set properties directly on the data object without using the API call to set or get data by name. Never mix direct access to the data object and API calls with kebab case names.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties
|
||||
|
||||
**Cause**: Prior to jQuery 3.0, using `.removeAttr()` on a boolean attribute such as `checked`, `selected`, or `readonly` would also set the corresponding named *property* to `false`. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value.
|
||||
|
||||
**Solution**: It is almost always a mistake to use `.removeAttr( "checked" )` on a DOM element. The only time it might be useful is if the DOM is later going to be serialized back to an HTML string. In all other cases, `.prop( "checked", false )` should be used instead.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.offset() requires a valid DOM element
|
||||
### JQMIGRATE: jQuery.fn.offset() requires an element connected to a document
|
||||
|
||||
**Cause:** In earlier versions of jQuery, the `.offset()` method would return a value of `{ top: 0, left: 0 }` for some cases of invalid input. jQuery 3.0 throws errors in some of these cases. The selected element in the jQuery collection must be a DOM element that is currently in a document. Text nodes, the `window` object, plain JavaScript objects, and disconnected elements are not valid input to the `.offset()` method. jQuery *may* throw an error in those cases but in general does not guarantee specific results with invalid inputs.
|
||||
|
||||
**Solution**: Do not attempt to get or set the offset information of invalid input.
|
||||
|
||||
### JQMIGRATE: jQuery.param() no longer uses jQuery.ajaxSettings.traditional
|
||||
|
||||
**Cause:** As of jQuery 3.0, the serialization method `jQuery.param` is fully independent of jQuery's ajax module. As a result, it does not look at the `jQuery.ajaxSettings.traditional` flag that affects how form data is encoded. Note that the `jQuery.ajax()` method still honors this flag if you make a request through it.
|
||||
|
||||
**Solution:** To continue using the `traditional` flag, pass it explicitly: `jQuery.data( myData, jQuery.ajaxSettings.traditional )`.
|
||||
|
||||
### JQMIGRATE: jQuery.swap() is undocumented and deprecated
|
||||
|
||||
**Cause**: The `jQuery.swap()` method temporarily exchanges a set of CSS properties. It was never documented as part of jQuery's public API and should not be used because it can cause performance problems due to forced layout. This method has been removed in jQuery 3.0.
|
||||
|
||||
**Solution**: Rework the code to avoid calling `jQuery.swap()`, or explicitly set and restore the properties you need to change.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.bind() is deprecated
|
||||
### JQMIGRATE: jQuery.fn.unbind() is deprecated
|
||||
### JQMIGRATE: jQuery.fn.delegate() is deprecated
|
||||
### JQMIGRATE: jQuery.fn.undelegate() is deprecated
|
||||
|
||||
**Cause:**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update.
|
||||
|
||||
**Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical.
|
||||
|
||||
### JQMIGRATE: 'ready' event is deprecated
|
||||
|
||||
**Cause**: Using one of jQuery's API methods to bind a "ready" event, e.g. `$( document ).on( "ready", fn )`, will cause the function to be called when the document is ready, but only if it is attached before the browser fires its own `DOMContentLoaded` event. That makes it unreliable for many uses, particularly ones where jQuery or its plugins are loaded asynchronously after page load.
|
||||
|
||||
**Solution**: Replace any use of `$( document ).on( "ready", fn )` with `$( fn )`. This approach works reliably even when the document is already loaded.
|
||||
|
||||
### JQMIGRATE: 'jQuery.easing.NAME' should use only one argument
|
||||
|
||||
**Cause**: Additional arguments for `jQuery.easing` methods were never documented and are redundant since the same behavior can be easily achieved without them. When Migrate detects this case, the specified easing function is not used and `"linear"` easing is used instead for the animation.
|
||||
|
||||
**Solution**: Rewrite the easing function to only use one argument. If you are using the [jQuery Easing plugin](http://gsgd.co.uk/sandbox/jquery/easing), upgrade to [version 1.4.0 or higher](https://github.com/gdsmith/jquery.easing/releases).
|
||||
|
||||
For example, to implement [Cubic](https://en.wikipedia.org/wiki/Cubic_function) easing, the old function might be:
|
||||
|
||||
```js
|
||||
jQuery.easing.easeInCubic = function ( p, t, b, c, d ) {
|
||||
return c * ( t /= d ) * t * t + b;
|
||||
}
|
||||
```
|
||||
|
||||
You can achive same effect with this:
|
||||
|
||||
```js
|
||||
jQuery.easing.easeInCubic = function ( p ) {
|
||||
return Math.pow( p, 3 );
|
||||
}
|
||||
```
|
||||
|
||||
See jQuery-ui [commit](https://github.com/jquery/jquery-ui/commit/c0093b599fcd58b6ad122ab425c4cc1a4da4a520#diff-9cd789a170c765edcf0f4854db386e1a) for other possible cases.
|
||||
|
||||
### JQMIGRATE: jQuery.parseJSON is deprecated; use JSON.parse
|
||||
|
||||
**Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated.
|
||||
|
||||
**Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`.
|
||||
|
||||
### JQMIGRATE: jQuery.isNumeric() should not be called on constructed objects
|
||||
|
||||
**Cause**: The intended use case of `jQuery.isNumeric` is to see if its argument is either already a number, or a string that can be converted to a number. In jQuery 3.0 some edge cases changed to not return the same values. In particular, a constructed object (one created with `new MyObject()`) that contains a `.toString()` method is never considered to be numeric, even if that method returns a string that could be converted to a number. Please do not taunt this method.
|
||||
|
||||
**Solution**: Either use a different test for being numeric, or call the object's `.toString()` method before calling the jQuery method: `jQuery.isNumeric( myObject.toString() )`.
|
||||
|
||||
### JQMIGRATE: jQuery.unique is deprecated; use jQuery.uniqueSort
|
||||
|
||||
**Cause**: The fact that `jQuery.unique` sorted its results in DOM order was surprising to many who did not read the documentation carefully. As of jQuery 3.0 this function is being renamed to make it clear.
|
||||
|
||||
**Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
|
||||
|
||||
### JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos
|
||||
### JQMIGRATE: jQuery.expr.filters is deprecated; use jQuery.expr.pseudos
|
||||
|
||||
**Cause:** The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0.
|
||||
|
||||
**Solution:** Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.toggleClass( [ boolean ] ) is deprecated
|
||||
|
||||
**Cause:** Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current `class` value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specificially trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes.
|
||||
|
||||
**Solution:** If this functionality is still needed, save the current full `.attr( "class" )` value in a data item and restore it when required.
|
||||
|
||||
### JQMIGRATE: jQuery.event.props are deprecated and removed
|
||||
### JQMIGRATE: jQuery.event.props.concat() is deprecated and removed
|
||||
### JQMIGRATE: jQuery.event.fixHooks are deprecated and removed
|
||||
|
||||
**Cause:** The code on the page has used the `jQuery.event.props` or `jQuery.event.fixHooks` data structures. These were used in previous versions to affect the properties that are copied from the native event to the jQuery event each time an event is delivered, but they had the potential to create performance issues. Versions of jQuery Mobile before 1.5 make use of this API and require jQuery Migrate to run properly.
|
||||
|
||||
**Solution:** The most popular use of these data structures are to add properties for touch or pointer events, and those properties are now supported by default with a newer high-performance approach in jQuery 3.0 that only retrieves the properties on first access. If you are using jQuery Mobile, check the [jquerymobile.com](https://jquerymobile.com) site for updates. If you are using plugins such as [pointerTouch](https://github.com/timmywil/jquery.event.pointertouch) or [touchHooks](https://github.com/aarongloege/jquery.touchHooks), simply remove them as they are no longer needed.
|
||||
|
||||
### JQMIGRATE: jQuery(window).on('load'...) called after load event occurred
|
||||
|
||||
**Cause:** The calling code has attempted to attach a `load` event to `window` after the page has already loaded. That means the handler will never run and so is probably not what the caller intended. This can occur when the event attachment is made too late, for example, in a jQuery ready handler. It can also occur when a file is loaded dynamically with jQuery after the page has loaded, for example using the `$.getScript()` method.
|
||||
|
||||
**Solution:** If a function `fn` does not actually depend on all page assets being fully loaded, switch to a ready handler `$( fn )` which runs earlier and will aways run `fn` even if the script that contains the code loads long after the page has fully loaded. If `fn` actually does depend on the script being fully loaded, check `document.readyState`. If the value is `"complete"` run the function immediately, otherwise use `$(window).on( "load", fn )`.
|
||||
|
||||
### JQMIGRATE: jQuery.holdReady() is deprecated
|
||||
|
||||
**Cause:** The `jQuery.holdReady()` method has been deprecated due to its detrimental effect on the global performance of the page. This method can prevent all the code on the page from initializing for extended lengths of time.
|
||||
|
||||
**Solution:** Rewrite the page so that it does not require all jQuery ready handlers to be delayed. This might be accomplished, for example, by late-loading only the code that requires the delay when it is safe to run. Due to the complexity of this method, jQuery Migrate does not attempt to fill the functionality. If the underlying version of jQuery used with jQuery Migrate no longer contains `jQuery.holdReady()` the code will fail shortly after this warning appears.
|
||||
|
||||
### JQMIGRATE: jQuery.isWindow() is deprecated
|
||||
|
||||
**Cause:** This method returns `true` if its argument is thought to be a `window` element. It was created for internal use and is not a reliable way of detecting `window` for public needs.
|
||||
|
||||
**Solution:** Remove any use of `jQuery.isWindow()` from code. If it is truly needed it can be replaced with a check for `obj != null && obj === obj.window` which was the test used inside this method.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.click() event shorthand is deprecated
|
||||
|
||||
**Cause:** The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu.
|
||||
|
||||
**Solution:** Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`.
|
||||
|
||||
### JQMIGRATE: jQuery.fn.hover() is deprecated
|
||||
|
||||
**Cause:** The `.hover()` method is a shorthand for the use of the `mouseover`/`mouseout` events. It is often a poor user interface choice because it does not allow for any small amounts of delay between when the mouse enters or exits an area and when the event fires. This can make it quite difficult to use with UI widgets such as drop-down menus. For more information on the problems of hovering, see the [hoverIntent plugin](http://cherne.net/brian/resources/jquery.hoverIntent.html).
|
||||
|
||||
**Solution:** Review uses of `.hover()` to determine if they are appropriate, and consider use of plugins such as `hoverIntent` as an alternative. The direct replacement for `.hover(fn1, fn2)`, is `.on("mouseenter", fn1).on("mouseleave", fn2)`.
|
||||
|
||||
### JQMIGRATE: jQuery.nodeName() is deprecated
|
||||
|
||||
**Cause:** This public but never-documented method has been deprecated as of jQuery 3.2.0.
|
||||
|
||||
**Solution:** Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`.
|
||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -20,6 +20,7 @@
|
||||
"datatables.net-select": "^1.2.0",
|
||||
"jquery": "^3.5.1",
|
||||
"jquery-contextmenu": "^1.6.7",
|
||||
"jquery-migrate": "^3.1.0",
|
||||
"jquery-ui-dist": "^1.12.1",
|
||||
"magnific-popup": "^1.0.0",
|
||||
"mousetrap": "^1.6.5",
|
||||
@@ -257,6 +258,14 @@
|
||||
"jquery": ">=1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery-migrate": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.1.0.tgz",
|
||||
"integrity": "sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ==",
|
||||
"peerDependencies": {
|
||||
"jquery": ">=3 <4"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery-ui-dist": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
|
||||
@@ -598,6 +607,12 @@
|
||||
"jquery": ">=1.7.0"
|
||||
}
|
||||
},
|
||||
"jquery-migrate": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.1.0.tgz",
|
||||
"integrity": "sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"jquery-ui-dist": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"datatables.net-select": "^1.2.0",
|
||||
"jquery": "^3.5.1",
|
||||
"jquery-contextmenu": "^1.6.7",
|
||||
"jquery-migrate": "^3.1.0",
|
||||
"jquery-ui-dist": "^1.12.1",
|
||||
"magnific-popup": "^1.0.0",
|
||||
"mousetrap": "^1.6.5",
|
||||
|
||||
@@ -157,9 +157,9 @@ JS
|
||||
if (utils::IsDevelopmentEnvironment()) // Needed since many other plugins still rely on oldies like $.browser
|
||||
{
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.dev-params.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.dev.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/jquery-migrate/dist/jquery-migrate.js');
|
||||
} else {
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.prod.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/jquery-migrate/dist/jquery-migrate.min.js');
|
||||
}
|
||||
$this->LinkScriptFromAppRoot('node_modules/jquery-ui-dist/jquery-ui.min.js');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user