Skip to content
Snippets Groups Projects
Commit 342ec390 authored by Chris Gross's avatar Chris Gross
Browse files

7.x-1.18 Release Candidate 1

parent 90f3357c
No related branches found
No related tags found
No related merge requests found
Showing
with 1138 additions and 0 deletions
WCM Base 7.x-1.18-rc1, 2019-10-16
---------------------------------
- WCM Base: Added WCM Slide Gallery to code base.
- WCM URL Aliases: Transliterate node path aliases.
WCM Base 7.x-1.17, 2019-10-11
-----------------------------
- WCM Base: Enabled WCM Timeline module.
......
/node_modules/
jQuery Easing - http://gsgd.co.uk/sandbox/jquery/easing/
Uses the built in easing capabilities added In jQuery 1.1
to offer multiple easing options
TERMS OF USE - jQuery Easing
Open source under the 3-Clause BSD License.
Copyright © 2008 George McGinley Smith
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution. Neither the name of the author nor the
names of contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
TERMS OF USE - EASING EQUATIONS
Open source under the MIT License and the 3-Clause BSD License.
MIT License
Copyright © 2001 Robert Penner
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.
BSD License
Copyright © 2001 Robert Penner
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution. Neither the name of the author nor the
names of contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
# jQuery Easing Plugin
What is it? A jQuery plugin from GSGD to give advanced easing options. More info [here](http://gsgd.co.uk/sandbox/jquery/easing)
For CDN please use CloudFlare [`https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js`](https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js) to help my host. Thank you.
# AMD or CommonJS usage
```js
// CommonJS
var jQuery = require('jquery');
require('jquery.easing')(jQuery);
// AMD
define(['jquery', 'jquery.easing'], function (jQuery, easing) {
easing(jQuery)
})
```
# Building and testing
* Clone the repo
* `npm install`
* Make changes
* Test against files in `/examples`
* Build minified version with `npm run build`
{
"name": "jquery.easing",
"main": "jquery.easing.js",
"version": "1.4.1",
"homepage": "https://github.com/gdsmith/jquery.easing",
"authors": [
"George McGinley Smith <george@gsgd.co.uk>"
],
"description": "A jQuery plugin from GSGD to give advanced easing options",
"keywords": [
"easing",
"ease",
"tween",
"keyframe",
"timeline",
"animation",
"jquery-plugin",
"ecosystem:jquery"
],
"dependencies": {
"jquery": ">= 1.3.0"
},
"license": "BSD-3-Clause",
"ignore": [
"**/.*",
"example"
]
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Demo of all easing styles</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.3.js"></script>
<script type="text/javascript" src="../jquery.easing.js"></script>
<style type="text/css" media="screen">
#bounds {
width: 250px;
height: 250px;
border: 1px solid #888;
}
#box {
height: 50px;
width: 50px;
background: black;
}
</style>
<script type="text/javascript">
$(function() {
var easings = $.map( $.easing, function( fn, key ) {
return jQuery.isFunction( fn ) ?
"<option value='" + key + "'>" + key + "</option>" :
null;
}),
current = 0,
positions = [
{
marginTop: "0px",
marginLeft: "0px"
}, {
marginTop: "200px",
marginLeft: "200px"
}
];
$( "#easing" ).html( easings );
$( "#run" ).on( "click", function() {
var duration = +$( "#duration" ).val(),
easing = $( "#easing" ).val(),
start = Date.now();
if ( Number.isNaN( duration ) ) {
duration = 1000;
$( "#duration" ).val( duration );
}
$( "#status" ).text( "Animating..." );
// Alternate positions
current = current ^ 1;
$( "#box" ).animate( positions[current], duration, easing,
function() {
$( "#status" ).text( "Done (" + (Date.now() - start)/1000 + " seconds)" );
}
);
});
});
</script>
</head>
<body>
<h1>Demo of all easing styles</h1>
<p id=status>Choose an easing method and press Run</p>
<p>
<label for=easing>Easing: </label>
<select id=easing></select><br />
<label for=duration> Duration (seconds): </label>
<input type=text id=duration size=10 value=1000 /><br />
<button id=run>Run</button>
</p>
<div id=bounds>
<div id="box"></div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="../jquery.easing.js"></script>
<script type="text/javascript" src="../jquery.easing.compatibility.js"></script>
<script type="text/javascript">
$(function() {
var boing = function() {
$('#boxing')
.animate({marginLeft: '50px' }, 1000, 'easeOutElastic')
.animate({marginTop: '50px' }, 1000, 'easeOutBounce')
.animate({marginLeft: '-150px'}, 1000, 'easeOutQuad')
.animate({marginTop: '-150px'}, 1000, 'easeInOutBack');
};
var squish = function() {
$('#box')
.animate({height: '100px', marginTop: '0px', width: '50px' }, 1000, 'easeOutElastic')
.animate({height: '50px' , marginTop: '25px', width: '50px' }, 1000, 'easeOutBounce')
.animate({height: '50px' , marginTop: '25px', width: '100px'}, 1000, 'easeOutQuad')
.animate({height:'100px' , marginTop: '0px', width: '100px'}, 1000, 'easeInOutBack');
}
setInterval(boing, 4000);
setInterval(squish, 4000);
setTimeout(function() {
boing();
squish();
}, 500);
})
</script>
<style type="text/css" media="screen">
#boxing {
height:100px;
width:100px;
position:absolute;
top:50%;left:50%;
margin-left:-150px;
margin-top:-150px;
}
#box {
height:100px;
width:100px;
background:#000;
margin:0 auto;
}
</style>
</head>
<body>
<div id="boxing"><div id="box"></div></div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Verify results agains Easing 1.3 plugin</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.3.js"></script>
<script>
var origEasing = $.extend(true, {}, $.easing);
</script>
<script type="text/javascript" src="../jquery.easing.js"></script>
<script>
var newEasing = $.extend(true, {}, $.easing);
</script>
<!-- loaded last because it refers back to the $.easing fns it defines -->
<script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
<script>
var oldEasing = $.easing;
</script>
<style type="text/css" media="screen">
#bounds {
width: 250px;
height: 250px;
border: 1px solid #888;
}
#box {
height: 50px;
width: 50px;
background: black;
}
</style>
<script type="text/javascript">
$(function() {
var times = [
0, 0.09, 0.15, 0.24, 0.37, 0.43, 0.50,
0.58, 0.64, 0.76, 0.89, 0.92, 0.98, 1
];
$.each( oldEasing, function( name ) {
var oldfn = oldEasing[ name ],
newfn = newEasing[ name ];
if ( typeof oldfn !== "function" || name === "swing" || name === "jswing" ) {
return;
}
$( "#results").append( "<br />--- Testing " + name + " " );
try {
times.forEach( function( time ) {
var ov = oldfn(time, time*1000, 0, 1, 1000),
nv = newfn(time),
diff = Math.abs(ov - nv);
if ( Number.isNaN(diff) || diff > 0.001 ) {
$( "#results").append("<br />at " + time + ": old " + ov + " new " + nv );
}
});
$( "#results").append( "Done" );
} catch ( err ) {
$( "#results").append( err );
}
});
});
</script>
</head>
<body>
<h1>Easing function comparison</h1>
<p id=results></p>
</body>
</html>
\ No newline at end of file
/*
* Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery/easing
*
* Adds compatibility for applications that use the pre 1.2 easing names
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
(function($){
$.extend( $.easing,
{
easeIn: function (x, t, b, c, d) {
return $.easing.easeInQuad(x, t, b, c, d);
},
easeOut: function (x, t, b, c, d) {
return $.easing.easeOutQuad(x, t, b, c, d);
},
easeInOut: function (x, t, b, c, d) {
return $.easing.easeInOutQuad(x, t, b, c, d);
},
expoin: function(x, t, b, c, d) {
return $.easing.easeInExpo(x, t, b, c, d);
},
expoout: function(x, t, b, c, d) {
return $.easing.easeOutExpo(x, t, b, c, d);
},
expoinout: function(x, t, b, c, d) {
return $.easing.easeInOutExpo(x, t, b, c, d);
},
bouncein: function(x, t, b, c, d) {
return $.easing.easeInBounce(x, t, b, c, d);
},
bounceout: function(x, t, b, c, d) {
return $.easing.easeOutBounce(x, t, b, c, d);
},
bounceinout: function(x, t, b, c, d) {
return $.easing.easeInOutBounce(x, t, b, c, d);
},
elasin: function(x, t, b, c, d) {
return $.easing.easeInElastic(x, t, b, c, d);
},
elasout: function(x, t, b, c, d) {
return $.easing.easeOutElastic(x, t, b, c, d);
},
elasinout: function(x, t, b, c, d) {
return $.easing.easeInOutElastic(x, t, b, c, d);
},
backin: function(x, t, b, c, d) {
return $.easing.easeInBack(x, t, b, c, d);
},
backout: function(x, t, b, c, d) {
return $.easing.easeOutBack(x, t, b, c, d);
},
backinout: function(x, t, b, c, d) {
return $.easing.easeInOutBack(x, t, b, c, d);
}
});})(jQuery);
/*
* jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/
* Open source under the BSD License.
* Copyright © 2008 George McGinley Smith
* All rights reserved.
* https://raw.github.com/gdsmith/jquery.easing/master/LICENSE
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(['jquery'], function ($) {
return factory($);
});
} else if (typeof module === "object" && typeof module.exports === "object") {
exports = factory(require('jquery'));
} else {
factory(jQuery);
}
})(function($){
// Preserve the original jQuery "swing" easing as "jswing"
if (typeof $.easing !== 'undefined') {
$.easing['jswing'] = $.easing['swing'];
}
var pow = Math.pow,
sqrt = Math.sqrt,
sin = Math.sin,
cos = Math.cos,
PI = Math.PI,
c1 = 1.70158,
c2 = c1 * 1.525,
c3 = c1 + 1,
c4 = ( 2 * PI ) / 3,
c5 = ( 2 * PI ) / 4.5;
// x is the fraction of animation progress, in the range 0..1
function bounceOut(x) {
var n1 = 7.5625,
d1 = 2.75;
if ( x < 1/d1 ) {
return n1*x*x;
} else if ( x < 2/d1 ) {
return n1*(x-=(1.5/d1))*x + .75;
} else if ( x < 2.5/d1 ) {
return n1*(x-=(2.25/d1))*x + .9375;
} else {
return n1*(x-=(2.625/d1))*x + .984375;
}
}
$.extend( $.easing,
{
def: 'easeOutQuad',
swing: function (x) {
return $.easing[$.easing.def](x);
},
easeInQuad: function (x) {
return x * x;
},
easeOutQuad: function (x) {
return 1 - ( 1 - x ) * ( 1 - x );
},
easeInOutQuad: function (x) {
return x < 0.5 ?
2 * x * x :
1 - pow( -2 * x + 2, 2 ) / 2;
},
easeInCubic: function (x) {
return x * x * x;
},
easeOutCubic: function (x) {
return 1 - pow( 1 - x, 3 );
},
easeInOutCubic: function (x) {
return x < 0.5 ?
4 * x * x * x :
1 - pow( -2 * x + 2, 3 ) / 2;
},
easeInQuart: function (x) {
return x * x * x * x;
},
easeOutQuart: function (x) {
return 1 - pow( 1 - x, 4 );
},
easeInOutQuart: function (x) {
return x < 0.5 ?
8 * x * x * x * x :
1 - pow( -2 * x + 2, 4 ) / 2;
},
easeInQuint: function (x) {
return x * x * x * x * x;
},
easeOutQuint: function (x) {
return 1 - pow( 1 - x, 5 );
},
easeInOutQuint: function (x) {
return x < 0.5 ?
16 * x * x * x * x * x :
1 - pow( -2 * x + 2, 5 ) / 2;
},
easeInSine: function (x) {
return 1 - cos( x * PI/2 );
},
easeOutSine: function (x) {
return sin( x * PI/2 );
},
easeInOutSine: function (x) {
return -( cos( PI * x ) - 1 ) / 2;
},
easeInExpo: function (x) {
return x === 0 ? 0 : pow( 2, 10 * x - 10 );
},
easeOutExpo: function (x) {
return x === 1 ? 1 : 1 - pow( 2, -10 * x );
},
easeInOutExpo: function (x) {
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
pow( 2, 20 * x - 10 ) / 2 :
( 2 - pow( 2, -20 * x + 10 ) ) / 2;
},
easeInCirc: function (x) {
return 1 - sqrt( 1 - pow( x, 2 ) );
},
easeOutCirc: function (x) {
return sqrt( 1 - pow( x - 1, 2 ) );
},
easeInOutCirc: function (x) {
return x < 0.5 ?
( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 :
( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2;
},
easeInElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 :
-pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 );
},
easeOutElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 :
pow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1;
},
easeInOutElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
-( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 :
pow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1;
},
easeInBack: function (x) {
return c3 * x * x * x - c1 * x * x;
},
easeOutBack: function (x) {
return 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 );
},
easeInOutBack: function (x) {
return x < 0.5 ?
( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 :
( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2;
},
easeInBounce: function (x) {
return 1 - bounceOut( 1 - x );
},
easeOutBounce: bounceOut,
easeInOutBounce: function (x) {
return x < 0.5 ?
( 1 - bounceOut( 1 - 2 * x ) ) / 2 :
( 1 + bounceOut( 2 * x - 1 ) ) / 2;
}
});
});
!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,c=1.70158,o=1.525*c,s=2*a/3,f=2*a/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-(t(2,20*n-10)*r((20*n-11.125)*f))/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return(c+1)*n*n*n-c*n*n},easeOutBack:function(n){return 1+(c+1)*t(n-1,3)+c*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-o)/2:(t(2*n-2,2)*((o+1)*(2*n-2)+o)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}})});
{
"name": "jquery.easing",
"version": "1.4.1",
"homepage": "https://github.com/gdsmith/jquery.easing",
"description": "A jQuery plugin from GSGD to give advanced easing options",
"author": {
"name": "George McGinley Smith",
"email": "george@gsgd.co.uk",
"url": "http://gsgd.co.uk/"
},
"repository": {
"type": "git",
"url": "git://github.com/gdsmith/jquery.easing.git"
},
"bugs": {
"url": "https://github.com/gdsmith/jquery.easing/issues"
},
"main": "jquery.easing.js",
"directories": {
"example": "example"
},
"scripts": {
"test": "echo \"Use tests in the examples directory\" && exit 1",
"build": "uglifyjs jquery.easing.js --compress --mangle -o jquery.easing.min.js"
},
"devDependencies": {
"jquery": ">=1.3.0",
"uglify-js": "^2.6.2"
},
"keywords": [
"jquery-plugin",
"ecosystem:jquery"
],
"license": "BSD-3-Clause"
}
module.exports = {
root: true,
// Support: IE11 without transpilation
"parserOptions": {
"ecmaVersion": 5
},
// Support: Non-browser envs like jsdom
"env": {},
"extends": "jquery",
"globals": {
"window": "readonly",
"define": "readonly",
"module": "readonly",
"jQuery": "readonly"
},
"rules": {
}
};
\ No newline at end of file
.DS_Store
/npm-debug.log
/node_modules
# Mouse Wheel ChangeLog
## 3.1.13
* Update copyright notice and license to remove years
* Create the correct compressed version
* Remove the obsolete jQuery Plugin Registry file
## 3.1.12
* Fix possible 0 value for line height when in delta mode 1
## 3.1.11
* Fix version number for package managers...
## 3.1.10
* Fix issue with calculating line height when using older versions of jQuery
* Add offsetX/Y normalization with setting to turn it off
* Cleans up data on teardown
## 3.1.9
* Fix bower.json file
* Updated how the deltas are adjusted for older mousewheel based events that have deltas that are factors of 120.
* Add $.event.special.mousewheel.settings.adjustOldDeltas (defaults to true) to turn off adjusting of old deltas that are factors of 120. You'd turn this off if you want to be as close to native scrolling as possible.
## 3.1.8
* Even better handling of older browsers that use a wheelDelta based on 120
* And fix version reported by `$.event.special.mousewheel`
## 3.1.7
* Better handle the `deltaMode` values 1 (lines) and 2 (pages)
* Attempt to better handle older browsers that use a wheelDelta based on 120
## 3.1.6
* Deprecating `delta`, `deltaX`, and `deltaY` event handler arguments
* Update actual event object with normalized `deltaX `and `deltaY` values (`event.deltaX`, `event.deltaY`)
* Add `deltaFactor` to the event object (`event.deltaFactor`)
* Handle `> 0` but `< 1` deltas better
* Do not fire the event if `deltaX` and `deltaY` are `0`
* Better handle different devices that give different `lowestDelta` values
* Add `$.event.special.mousewheel.version`
* Some clean up
## 3.1.5
* Bad release because I did not update the new `$.event.special.mousewheel.version`
## 3.1.4
* Always set the `deltaY`
* Add back in the `deltaX` and `deltaY` support for older Firefox versions
## 3.1.3
* Include `MozMousePixelScroll` in the to fix list to avoid inconsistent behavior in older Firefox
## 3.1.2
* Include grunt utilities for development purposes (jshint and uglify)
* Include support for browserify
* Some basic cleaning up
## 3.1.1
* Fix rounding issue with deltas less than zero
## 3.1.0
* Fix Firefox 17+ issues by using new wheel event
* Normalize delta values
* Adds horizontal support for IE 9+ by using new wheel event
* Support AMD loaders
## 3.0.6
* Fix issue with delta being 0 in Firefox
## 3.0.5
* jQuery 1.7 compatibility
## 3.0.4
* Fix IE issue
## 3.0.3
* Added `deltaX` and `deltaY` for horizontal scrolling support (Thanks to Seamus Leahy)
## 3.0.2
* Fixed delta being opposite value in latest Opera
* No longer fix `pageX`, `pageY` for older Mozilla browsers
* Removed browser detection
* Cleaned up the code
## 3.0.1
* Bad release... creating a new release due to plugins.jquery.com issue :(
## 3.0
* Uses new special events API in jQuery 1.2.2+
* You can now treat `mousewheel` as a normal event and use `.bind`, `.unbind` and `.trigger`
* Using jQuery.data API for expandos
## 2.2
* Fixed `pageX`, `pageY`, `clientX` and `clientY` event properties for Mozilla based browsers
## 2.1.1
* Updated to work with jQuery 1.1.3
* Used one instead of bind to do unload event for clean up
## 2.1
* Fixed an issue with the unload handler
## 2.0
* Major reduction in code size and complexity (internals have change a whole lot)
## 1.0
* Fixed Opera issue
* Fixed an issue with children elements that also have a mousewheel handler
* Added ability to handle multiple handlers
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-mousewheel
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.
# jQuery Mouse Wheel Plugin
A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support with delta normalization.
In order to use the plugin, simply bind the `mousewheel` event to an element.
It also provides two helper methods called `mousewheel` and `unmousewheel`
that act just like other event helper methods in jQuery.
The event object is updated with the normalized `deltaX` and `deltaY` properties.
In addition there is a new property on the event object called `deltaFactor`. Multiply
the `deltaFactor` by `deltaX` or `deltaY` to get the scroll distance that the browser
has reported.
Here is an example of using both the bind and helper method syntax:
```js
// using on
$('#my_elem').on('mousewheel', function(event) {
console.log(event.deltaX, event.deltaY, event.deltaFactor);
});
// using the event helper
$('#my_elem').mousewheel(function(event) {
console.log(event.deltaX, event.deltaY, event.deltaFactor);
});
```
The old behavior of adding three arguments (`delta`, `deltaX`, and `deltaY`) to the
event handler is now deprecated and will be removed in later releases.
## The Deltas...
The combination of browsers, operating systems, and devices offer a huge range of possible delta values. In fact if the user
uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
acceleration that is used. This number has the potential to be in the thousands depending on the device.
Check out some of the data collected from users [here](http://mousewheeldatacollector.herokuapp.com/).
### Getting the scroll distance
In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
scroll based on the users input. This can be done by multiplying the `deltaFactor` by the `deltaX` or `deltaY`
event property to find the scroll distance the browser reported.
The `deltaFactor` property was added to the event object in 3.1.5 so that the actual reported delta value can be
extracted. This is a non-standard property.
## Building the code in the repo
```sh
$ git clone git@github.com:jquery/jquery-mousewheel.git
$ cd jquery-mousewheel/
$ npm install
$ npm run build
$ npm run karma
```
The unit tests run by karma are _very_ basic sanity checks; improvements welcome.
To fully test the plugin, load [test/index.html](test/index.html) in each supported
browser and follow the instructions at the top of the file after the unit tests finish.
{
"name": "jquery-mousewheel",
"main": "./jquery.mousewheel.js",
"ignore": [
"*.json",
"*.markdown",
"*.txt",
".*",
"!LICENSE.txt",
"test"
],
"dependencies": {
"jquery": ">=1.7.2"
}
}
/*!
* jQuery Mousewheel 3.1.13
* Copyright OpenJS Foundation and other contributors
*/
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "jquery" ], factory );
} else if ( typeof exports === "object" ) {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory( jQuery );
}
} )( function( $ ) {
var toFix = [ "wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll" ],
toBind = ( "onwheel" in window.document || window.document.documentMode >= 9 ) ?
[ "wheel" ] : [ "mousewheel", "DomMouseScroll", "MozMousePixelScroll" ],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[ --i ] ] = $.event.mouseHooks;
}
}
var special = $.event.special.mousewheel = {
version: "3.1.12",
setup: function() {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[ --i ], handler, false );
}
} else {
this.onmousewheel = handler;
}
// Store the line height and page height for this particular element
$.data( this, "mousewheel-line-height", special.getLineHeight( this ) );
$.data( this, "mousewheel-page-height", special.getPageHeight( this ) );
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[ --i ], handler, false );
}
} else {
this.onmousewheel = null;
}
// Clean up the data we added to the element
$.removeData( this, "mousewheel-line-height" );
$.removeData( this, "mousewheel-page-height" );
},
getLineHeight: function( elem ) {
var $elem = $( elem ),
$parent = $elem[ "offsetParent" in $.fn ? "offsetParent" : "parent" ]();
if ( !$parent.length ) {
$parent = $( "body" );
}
return parseInt( $parent.css( "fontSize" ), 10 ) ||
parseInt( $elem.css( "fontSize" ), 10 ) || 16;
},
getPageHeight: function( elem ) {
return $( elem ).height();
},
settings: {
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
normalizeOffset: true // calls getBoundingClientRect for each event
}
};
$.fn.extend( {
mousewheel: function( fn ) {
return fn ? this.on( "mousewheel", fn ) : this.trigger( "mousewheel" );
},
unmousewheel: function( fn ) {
return this.off( "mousewheel", fn );
}
} );
function handler( event ) {
var orgEvent = event || window.event,
args = slice.call( arguments, 1 ),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0;
event = $.event.fix( orgEvent );
event.type = "mousewheel";
// Old school scrollwheel delta
if ( "detail" in orgEvent ) {
deltaY = orgEvent.detail * -1;
}
if ( "wheelDelta" in orgEvent ) {
deltaY = orgEvent.wheelDelta;
}
if ( "wheelDeltaY" in orgEvent ) {
deltaY = orgEvent.wheelDeltaY;
}
if ( "wheelDeltaX" in orgEvent ) {
deltaX = orgEvent.wheelDeltaX * -1;
}
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( "axis" in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( "deltaY" in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( "deltaX" in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) {
delta = deltaX * -1;
}
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) {
return;
}
// Need to convert lines and pages to pixels if we aren't already in pixels
// There are three delta modes:
// * deltaMode 0 is by pixels, nothing to do
// * deltaMode 1 is by lines
// * deltaMode 2 is by pages
if ( orgEvent.deltaMode === 1 ) {
var lineHeight = $.data( this, "mousewheel-line-height" );
delta *= lineHeight;
deltaY *= lineHeight;
deltaX *= lineHeight;
} else if ( orgEvent.deltaMode === 2 ) {
var pageHeight = $.data( this, "mousewheel-page-height" );
delta *= pageHeight;
deltaY *= pageHeight;
deltaX *= pageHeight;
}
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs( deltaY ), Math.abs( deltaX ) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas( orgEvent, absDelta ) ) {
lowestDelta /= 40;
}
}
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas( orgEvent, absDelta ) ) {
// Divide all the things by 40!
delta /= 40;
deltaX /= 40;
deltaY /= 40;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? "floor" : "ceil" ]( delta / lowestDelta );
deltaX = Math[ deltaX >= 1 ? "floor" : "ceil" ]( deltaX / lowestDelta );
deltaY = Math[ deltaY >= 1 ? "floor" : "ceil" ]( deltaY / lowestDelta );
// Normalise offsetX and offsetY properties
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
var boundingRect = this.getBoundingClientRect();
event.offsetX = event.clientX - boundingRect.left;
event.offsetY = event.clientY - boundingRect.top;
}
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
// Go ahead and set deltaMode to 0 since we converted to pixels
// Although this is a little odd since we overwrite the deltaX/Y
// properties with normalized deltas.
event.deltaMode = 0;
// Add event and delta to the front of the arguments
args.unshift( event, delta, deltaX, deltaY );
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if ( nullLowestDeltaTimeout ) {
window.clearTimeout( nullLowestDeltaTimeout );
}
nullLowestDeltaTimeout = window.setTimeout( nullLowestDelta, 200 );
return ( $.event.dispatch || $.event.handle ).apply( this, args );
}
function nullLowestDelta() {
lowestDelta = null;
}
function shouldAdjustOldDeltas( orgEvent, absDelta ) {
// If this is an older event and the delta is divisable by 120,
// then we are assuming that the browser is treating this as an
// older mouse wheel event and that we should divide the deltas
// by 40 to try and get a more usable deltaFactor.
// Side note, this actually impacts the reported scroll distance
// in older browsers and can cause scrolling to be slower than native.
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
return special.settings.adjustOldDeltas && orgEvent.type === "mousewheel" &&
absDelta % 120 === 0;
}
} );
/*!
* jQuery Mousewheel 3.1.13
* Copyright OpenJS Foundation and other contributors
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(u){var f,d,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in window.document||9<=window.document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],w=Array.prototype.slice;if(u.event.fixHooks)for(var i=e.length;i;)u.event.fixHooks[e[--i]]=u.event.mouseHooks;var c=u.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;u.data(this,"mousewheel-line-height",c.getLineHeight(this)),u.data(this,"mousewheel-page-height",c.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;u.removeData(this,"mousewheel-line-height"),u.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=u(e),i=t["offsetParent"in u.fn?"offsetParent":"parent"]();return i.length||(i=u("body")),parseInt(i.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return u(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,i=e||window.event,n=w.call(arguments,1),o=0,l=0,s=0;if((e=u.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(l=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(l=-1*s,s=0),o=0===s?l:s,"deltaY"in i&&(o=s=-1*i.deltaY),"deltaX"in i&&(l=i.deltaX,0===s&&(o=-1*l)),0!==s||0!==l){if(1===i.deltaMode){var a=u.data(this,"mousewheel-line-height");o*=a,s*=a,l*=a}else if(2===i.deltaMode){var h=u.data(this,"mousewheel-page-height");o*=h,s*=h,l*=h}if(t=Math.max(Math.abs(s),Math.abs(l)),(!d||t<d)&&g(i,d=t)&&(d/=40),g(i,t)&&(o/=40,l/=40,s/=40),o=Math[1<=o?"floor":"ceil"](o/d),l=Math[1<=l?"floor":"ceil"](l/d),s=Math[1<=s?"floor":"ceil"](s/d),c.settings.normalizeOffset&&this.getBoundingClientRect){var r=this.getBoundingClientRect();e.offsetX=e.clientX-r.left,e.offsetY=e.clientY-r.top}return e.deltaX=l,e.deltaY=s,e.deltaFactor=d,e.deltaMode=0,n.unshift(e,o,l,s),f&&window.clearTimeout(f),f=window.setTimeout(m,200),(u.event.dispatch||u.event.handle).apply(this,n)}}function m(){d=null}function g(e,t){return c.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}u.fn.extend({mousewheel:function(e){return e?this.on("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.off("mousewheel",e)}})});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment