1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-23 00:25:15 +01:00

Added: jQuery.scrollTo v2.1.3 (#1070)

This commit is contained in:
nobody 2022-07-22 05:27:16 +02:00
parent 81148421e5
commit 5940a840da
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
6 changed files with 17 additions and 0 deletions

View File

@ -1223,6 +1223,7 @@ https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.css
https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery.scrollbar/0.2.11/jquery.scrollbar.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.3/jquery.scrollTo.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.6.7/jquery.timeago.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery-tiny-pubsub/0.7.0/ba-tiny-pubsub.min.js

View File

@ -361,6 +361,7 @@ mappings.cdn = {
'jquery-cookie/{version}/jquery.cookie.': resources.jqueryCookie,
'jquery.scrollbar/{version}/jquery.scrollbar.min.js': resources.jQueryScrollbar,
'jquery.scrollbar/{version}/jquery.scrollbar.js': resources.jQueryScrollbar,
'jquery.scrollTo/{version}/jquery.scrollTo.': resources.jQueryScrollTo,
'jquery-timeago/{version}/jquery.timeago.min.js': resources.jqueryTimeago,
'jquery-timeago/{version}/jquery.timeago.js': resources.jqueryTimeago,
'jquery-tiny-pubsub/{version}/ba-tiny-pubsub.': resources.jQueryTinyPubsub,
@ -604,6 +605,7 @@ mappings.cdn = {
'instantsearch.css@{version}': resources.InstantSearchCSS,
'jquery@{version}/dist/jquery.': resources.jQuery,
'jquery@{version}/dist/jquery.min.': resources.jQuery,
'jquery.scrollto@{version}/jquery.scrollTo.': resources.jQueryScrollTo,
'jquery-ui@{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui@{version}/jquery-ui.min.js': resources.jQueryUI,
'jquery-ui-dist@{version}/jquery-ui.js': resources.jQueryUI,

View File

@ -592,6 +592,10 @@ var resources = {
'jQueryScrollbar': {
'path': 'resources/jquery.scrollbar/{version}/jquery.scrollbar.min.jsm'
},
// jQuery-scrollTo
'jQueryScrollTo': {
'path': 'resources/jquery-scrollTo/{version}/jquery.scrollTo.min.jsm'
},
// jQuery Tablesorter
'jQueryTablesorter': {
'path': 'resources/jquery.tablesorter/{version}/jquery.tablesorter.min.jsm'

View File

@ -286,6 +286,7 @@ targets.setLastVersion = function (type, version) {
if (type.startsWith('/jquery.scrollbar/0.')) return '0.2.11';
if (type.startsWith('/jquery-validation-unobtrusive/3.')) return '3.2.12';
if (type.startsWith('/jquery.tablesorter/2.')) return '2.31.3';
if (type.startsWith('/jquery-scrollTo/2.')) return '2.1.3';
if (type.startsWith('/jquery-timeago/1.')) return '1.6.7';
if (type.startsWith('/jquery-tiny-pubsub/0.')) return '0.7.0';
if (type.startsWith('/jquery-ujs/1.')) return '1.2.3';
@ -467,6 +468,7 @@ targets.determineResourceName = function (filename) {
};
const ListOfFiles = {
'jquery.scrollTo.min.jsm': 'jQuery.scrollTo',
'twix.min.jsm': 'twix.js',
'angular-locale_en-us.min.jsm': 'angular-i18n',
'angular-translate-loader-partial.min.jsm': 'angular-translate-loader-partial',

View File

@ -48,6 +48,7 @@
<ul>
<li>jQuery Mobile CSS v1.4.5 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1063">#1063</a>)</li>
<li>jQuery Mobile CSS & JS v1.3.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1063">#1063</a>)</li>
<li>jQuery.scrollTo v2.1.3 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1070">#1070</a>)</li>
</ul>
<p>Improved</p>
<ul>

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) 2007 Ariel Flesler - aflesler gmail com | https://github.com/flesler
* Licensed under MIT
* @author Ariel Flesler
* @version 2.1.3
*/
;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'))}else{factory(jQuery)}})(function($){'use strict';var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1}function isFunction(obj){return typeof obj==='function'}$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0}if(typeof settings==='function'){settings={onAfter:settings}}if(target==='max'){target=9e9}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2}settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null){return}var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case 'number':case 'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,elem);case 'object':if(targ.length===0){return}if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}var offset=isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0}attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos]}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val}if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={}}else if(queue){animate(settings.onAfterFirst);attr={}}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings)}});$elem.animate(attr,opts)}})};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem)){return elem[scroll]-$(elem)[Dim.toLowerCase()]()}var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val}}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]()},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop()}var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t)}}};return $scrollTo});