From 8cff669de4d49036bd5b85ff21fa68c36475bbbf Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 3 Aug 2020 13:46:49 +0200 Subject: [PATCH] Added: Stickyfill v1.1.4 and v2.1.0 (#73) --- core/mappings.js | 1 + core/resources.js | 5 +++++ modules/internal/helpers.js | 5 +++++ pages/updates/updates.html | 1 + resources/stickyfill/1.1.4/stickyfill.min.jsm | 8 ++++++++ resources/stickyfill/2.1.0/stickyfill.min.jsm | 6 ++++++ 6 files changed, 26 insertions(+) create mode 100644 resources/stickyfill/1.1.4/stickyfill.min.jsm create mode 100644 resources/stickyfill/2.1.0/stickyfill.min.jsm diff --git a/core/mappings.js b/core/mappings.js index e219b3ba..eedc80b0 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -292,6 +292,7 @@ var mappings = { 'slick-carousel/{version}/slick.min.js': resources.slickCarouselJS, 'slick-carousel/{version}/slick.js': resources.slickCarouselJS, 'spin.js/{version}/spin.min.js': resources.spinJS, + 'stickyfill/{version}/stickyfill.': resources.stickyfill, 'socket.io/{version}/socket.io.': resources.socketIO, 'swfobject/{version}/swfobject.': resources.swfobject, 'Swiper/{version}/css/swiper.': resources.swiperCSS, diff --git a/core/resources.js b/core/resources.js index 9dfb682d..58310327 100644 --- a/core/resources.js +++ b/core/resources.js @@ -596,6 +596,11 @@ var resources = { 'path': 'resources/spin.js/{version}/spin.min.jsm', 'type': 'application/javascript' }, + // stickyfill + 'stickyfill': { + 'path': 'resources/stickyfill/{version}/stickyfill.min.jsm', + 'type': 'application/javascript' + }, // Store.js 'storeJS': { 'path': 'resources/store.js/{version}/store.legacy.min.jsm', diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index 71458ed1..fb1c5d21 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -484,6 +484,10 @@ helpers.setLastVersion = function (type, version) { return '2.3.0'; } else if (type.includes('/spin.js/2.')) { return '2.3.2'; + } else if (type.includes('/stickyfill/1.')) { + return '1.1.4'; + } else if (type.includes('/stickyfill/2.')) { + return '2.1.0'; } else if (type.includes('/store.js/2.')) { return '2.0.4'; } else if (type.includes('/swfobject/2.')) { @@ -545,6 +549,7 @@ helpers.compareVersion = function (v1, v2) { }; const ListOfFiles = { + 'stickyfill.min.jsm': 'Stickyfill', 'jquery.mousewheel.min.jsm': 'jQuery Mousewheel', 'a1f20be65b.css': 'Font Awesome (CSS)', 'a1f20be65b.jsm': 'Font Awesome (JS)', diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 94424221..11eeee2a 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -28,6 +28,7 @@
  • Fixed: Block Google Fonts if enabled
  • Added: Font Awesome v4.7.0 loaded by WebFontLoader (#73)
  • Added: jQuery Mousewheel v3.1.13 (#73)
  • +
  • Added: Stickyfill v1.1.4 and v2.1.0 (#73)
  • diff --git a/resources/stickyfill/1.1.4/stickyfill.min.jsm b/resources/stickyfill/1.1.4/stickyfill.min.jsm new file mode 100644 index 00000000..28021773 --- /dev/null +++ b/resources/stickyfill/1.1.4/stickyfill.min.jsm @@ -0,0 +1,8 @@ +/*! + * Stickyfill -- `position: sticky` polyfill + * v. 1.1.4 | https://github.com/wilddeer/stickyfill + * Copyright Oleg Korsunsky | http://wd.dizaina.net/ + * + * MIT License + */ +!function(a,b){function c(){y=D=z=A=B=C=K}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(){F={top:b.pageYOffset,left:b.pageXOffset}}function g(){return b.pageXOffset!=F.left?(f(),void z()):void(b.pageYOffset!=F.top&&(f(),i()))}function h(a){setTimeout(function(){b.pageYOffset!=F.top&&(F.top=b.pageYOffset,i())},0)}function i(){for(var a=H.length-1;a>=0;a--)j(H[a])}function j(a){if(a.inited){var b=F.top<=a.limit.start?0:F.top>=a.limit.end?2:1;a.mode!=b&&p(a,b)}}function k(){for(var a=H.length-1;a>=0;a--)if(H[a].inited){var b=Math.abs(t(H[a].clone)-H[a].docOffsetTop),c=Math.abs(H[a].parent.node.offsetHeight-H[a].parent.height);if(b>=2||c>=2)return!1}return!0}function l(a){isNaN(parseFloat(a.computed.top))||a.isCell||"none"==a.computed.display||(a.inited=!0,a.clone||q(a),"absolute"!=a.parent.computed.position&&"relative"!=a.parent.computed.position&&(a.parent.node.style.position="relative"),j(a),a.parent.height=a.parent.node.offsetHeight,a.docOffsetTop=t(a.clone))}function m(a){var b=!0;a.clone&&r(a),d(a.node.style,a.css);for(var c=H.length-1;c>=0;c--)if(H[c].node!==a.node&&H[c].parent.node===a.parent.node){b=!1;break}b&&(a.parent.node.style.position=a.parent.css.position),a.mode=-1}function n(){for(var a=H.length-1;a>=0;a--)l(H[a])}function o(){for(var a=H.length-1;a>=0;a--)m(H[a])}function p(a,b){var c=a.node.style;switch(b){case 0:c.position="absolute",c.left=a.offset.left+"px",c.right=a.offset.right+"px",c.top=a.offset.top+"px",c.bottom="auto",c.width="auto",c.marginLeft=0,c.marginRight=0,c.marginTop=0;break;case 1:c.position="fixed",c.left=a.box.left+"px",c.right=a.box.right+"px",c.top=a.css.top,c.bottom="auto",c.width="auto",c.marginLeft=0,c.marginRight=0,c.marginTop=0;break;case 2:c.position="absolute",c.left=a.offset.left+"px",c.right=a.offset.right+"px",c.top="auto",c.bottom=0,c.width="auto",c.marginLeft=0,c.marginRight=0}a.mode=b}function q(a){a.clone=document.createElement("div");var b=a.node.nextSibling||a.node,c=a.clone.style;c.height=a.height+"px",c.width=a.width+"px",c.marginTop=a.computed.marginTop,c.marginBottom=a.computed.marginBottom,c.marginLeft=a.computed.marginLeft,c.marginRight=a.computed.marginRight,c.padding=c.border=c.borderSpacing=0,c.fontSize="1em",c.position="static",c.cssFloat=a.computed.cssFloat,a.node.parentNode.insertBefore(a.clone,b)}function r(a){a.clone.parentNode.removeChild(a.clone),a.clone=void 0}function s(a){var b=getComputedStyle(a),c=a.parentNode,d=getComputedStyle(c),f=a.style.position;a.style.position="relative";var g={top:b.top,marginTop:b.marginTop,marginBottom:b.marginBottom,marginLeft:b.marginLeft,marginRight:b.marginRight,cssFloat:b.cssFloat,display:b.display},h={top:e(b.top),marginBottom:e(b.marginBottom),paddingLeft:e(b.paddingLeft),paddingRight:e(b.paddingRight),borderLeftWidth:e(b.borderLeftWidth),borderRightWidth:e(b.borderRightWidth)};a.style.position=f;var i={position:a.style.position,top:a.style.top,bottom:a.style.bottom,left:a.style.left,right:a.style.right,width:a.style.width,marginTop:a.style.marginTop,marginLeft:a.style.marginLeft,marginRight:a.style.marginRight},j=u(a),k=u(c),l={node:c,css:{position:c.style.position},computed:{position:d.position},numeric:{borderLeftWidth:e(d.borderLeftWidth),borderRightWidth:e(d.borderRightWidth),borderTopWidth:e(d.borderTopWidth),borderBottomWidth:e(d.borderBottomWidth)}},m={node:a,box:{left:j.win.left,right:J.clientWidth-j.win.right},offset:{top:j.win.top-k.win.top-l.numeric.borderTopWidth,left:j.win.left-k.win.left-l.numeric.borderLeftWidth,right:-j.win.right+k.win.right-l.numeric.borderRightWidth},css:i,isCell:"table-cell"==b.display,computed:g,numeric:h,width:j.win.right-j.win.left,height:j.win.bottom-j.win.top,mode:-1,inited:!1,parent:l,limit:{start:j.doc.top-h.top,end:k.doc.top+c.offsetHeight-l.numeric.borderBottomWidth-a.offsetHeight-h.top-h.marginBottom}};return m}function t(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function u(a){var c=a.getBoundingClientRect();return{doc:{top:c.top+b.pageYOffset,left:c.left+b.pageXOffset},win:c}}function v(){G=setInterval(function(){!k()&&z()},500)}function w(){clearInterval(G)}function x(){I&&(document[L]?w():v())}function y(){I||(f(),n(),b.addEventListener("scroll",g),b.addEventListener("wheel",h),b.addEventListener("resize",z),b.addEventListener("orientationchange",z),a.addEventListener(M,x),v(),I=!0)}function z(){if(I){o();for(var a=H.length-1;a>=0;a--)H[a]=s(H[a].node);n()}}function A(){b.removeEventListener("scroll",g),b.removeEventListener("wheel",h),b.removeEventListener("resize",z),b.removeEventListener("orientationchange",z),a.removeEventListener(M,x),w(),I=!1}function B(){A(),o()}function C(){for(B();H.length;)H.pop()}function D(a){for(var b=H.length-1;b>=0;b--)if(H[b].node===a)return;var c=s(a);H.push(c),I?l(c):y()}function E(a){for(var b=H.length-1;b>=0;b--)H[b].node===a&&(m(H[b]),H.splice(b,1))}var F,G,H=[],I=!1,J=a.documentElement,K=function(){},L="hidden",M="visibilitychange";void 0!==a.webkitHidden&&(L="webkitHidden",M="webkitvisibilitychange"),b.getComputedStyle||c();for(var N=["","-webkit-","-moz-","-ms-"],O=document.createElement("div"),P=N.length-1;P>=0;P--){try{O.style.position=N[P]+"sticky"}catch(Q){}""!=O.style.position&&c()}f(),b.Stickyfill={stickies:H,add:D,remove:E,init:y,rebuild:z,pause:A,stop:B,kill:C}}(document,window),window.jQuery&&!function($){$.fn.Stickyfill=function(a){return this.each(function(){Stickyfill.add(this)}),this}}(window.jQuery); diff --git a/resources/stickyfill/2.1.0/stickyfill.min.jsm b/resources/stickyfill/2.1.0/stickyfill.min.jsm new file mode 100644 index 00000000..e7cad4d4 --- /dev/null +++ b/resources/stickyfill/2.1.0/stickyfill.min.jsm @@ -0,0 +1,6 @@ +/*! + * Stickyfill – `position: sticky` polyfill + * v. 2.1.0 | https://github.com/wilddeer/stickyfill + * MIT License + */ +!function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function g(){function c(){a.pageXOffset!=m.left?(m.top=a.pageYOffset,m.left=a.pageXOffset,p.refreshAll()):a.pageYOffset!=m.top&&(m.top=a.pageYOffset,m.left=a.pageXOffset,n.forEach(function(a){return a._recalcPosition()}))}function d(){f=setInterval(function(){n.forEach(function(a){return a._fastCheck()})},500)}function e(){clearInterval(f)}if(!k){k=!0,c(),a.addEventListener("scroll",c),a.addEventListener("resize",p.refreshAll),a.addEventListener("orientationchange",p.refreshAll);var f=void 0,g=void 0,h=void 0;"hidden"in b?(g="hidden",h="visibilitychange"):"webkitHidden"in b&&(g="webkitHidden",h="webkitvisibilitychange"),h?(b[g]||d(),b.addEventListener(h,function(){b[g]?e():d()})):d()}}var h=function(){function a(a,b){for(var c=0;c=this._limits.end?"end":"middle";if(this._stickyMode!=a){switch(a){case"start":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:this._offsetToParent.top+"px",bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"middle":d(this._node.style,{position:"fixed",left:this._offsetToWindow.left+"px",right:this._offsetToWindow.right+"px",top:this._styles.top,bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"end":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:"auto",bottom:0,width:"auto",marginLeft:0,marginRight:0})}this._stickyMode=a}}}},{key:"_fastCheck",value:function(){this._active&&!this._removed&&(Math.abs(f(this._clone.node)-this._clone.docOffsetTop)>1||Math.abs(this._parent.node.offsetHeight-this._parent.offsetHeight)>1)&&this.refresh()}},{key:"_deactivate",value:function(){var a=this;this._active&&!this._removed&&(this._clone.node.parentNode.removeChild(this._clone.node),delete this._clone,d(this._node.style,this._styles),delete this._styles,n.some(function(b){return b!==a&&b._parent&&b._parent.node===a._parent.node})||d(this._parent.node.style,this._parent.styles),delete this._parent,this._stickyMode=null,this._active=!1,delete this._offsetToWindow,delete this._offsetToParent,delete this._limits)}},{key:"remove",value:function(){var a=this;this._deactivate(),n.some(function(b,c){if(b._node===a._node)return n.splice(c,1),!0}),this._removed=!0}}]),g}(),p={stickies:n,Sticky:o,forceSticky:function(){i=!1,g(),this.refreshAll()},addOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}for(var b=0;b