Removed the polyfill for smooth scrolling
authorAlexander Ebert <ebert@woltlab.com>
Sun, 3 Jan 2021 15:44:18 +0000 (16:44 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 3 Jan 2021 15:44:18 +0000 (16:44 +0100)
All modern browsers natively support this already.

wcfsetup/install/files/js/WCF.Assets.js

index 7ff4ca45cabaae41f873cb8824a07f4525abf761..81a01b2a3412dc8f97740704a2611c3fd4d6dbe1 100644 (file)
  * http://flaviusmatis.github.com/license.html
  */
 !function(t){var e={init:function(){var e=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight","border-top-width","border-right-width","border-bottom-width","border-left-width","-moz-box-sizing","-webkit-box-sizing","box-sizing"];return this.each(function(){function i(){for(var t=0;t<e.length;t++)s.css(e[t],r.css(e[t]))}function n(){var t=r.val().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n/g,"<br/>");s.html(t+"&nbsp;").css({width:parseInt(r.width(),10)+"px"}),o()}function o(){var t=s.height(),e="hidden",i=d?t+h+a:t+h;i>b?(i=b,e="auto"):c>i&&(i=c),r.height()!==i&&r.css({overflow:e,height:i+"px"})}if("textarea"!==this.type)return!1;var r=t(this).css({resize:"none",overflow:"hidden"}),s=t("<div></div>").css({position:"absolute",display:"none","word-wrap":"break-word","white-space":"pre-wrap","border-style":"solid"}).appendTo(document.body);i();var d="border-box"==r.css("box-sizing")||"border-box"==r.css("-moz-box-sizing")||"border-box"==r.css("-webkit-box-sizing"),a=parseInt(r.css("border-top-width"))+parseInt(r.css("padding-top"))+parseInt(r.css("padding-bottom"))+parseInt(r.css("border-bottom-width")),p=parseInt(r.css("height"),10),h=parseInt(r.css("line-height"),10)||parseInt(r.css("font-size"),10),c=2*h>p?2*h:p,b=parseInt(r.css("max-height"),10)>-1?parseInt(r.css("max-height"),10):Number.MAX_VALUE;r.bind("keyup change cut paste",function(){n()}),t(window).bind("resize",function(){s.width()!==parseInt(r.width(),10)&&n()}),r.bind("blur",function(){o()}),r.bind("updateHeight",function(){i(),n()}),t(function(){n()})})}};t.fn.flexible=function(i){return e[i]?e[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.flexible"):e.init.apply(this,arguments)}}(jQuery);
-
-/**
- * Polyfill for smooth scrolling.
- * https://github.com/iamdustan/smoothscroll
- * 
- * Copyright 2013, Dustan Kasten
- * Released under the MIT license.
- * https://github.com/iamdustan/smoothscroll/blob/master/LICENSE
- * 
- * Version below includes the fix of PR 
- */
-!function(e,t,r){"use strict";function n(){return e.performance!==r&&e.performance.now!==r?e.performance.now():Date.now()}function o(e){return.5*(1-Math.cos(Math.PI*e))}function a(e){if("object"!=typeof e||e.behavior===r||"auto"===e.behavior||"instant"===e.behavior)return!0;if("smooth"===e.behavior)return!1;throw new TypeError(e.behavior+" is not a valid value for enumeration ScrollBehavior")}function l(e,t,r){e.scrollTop=r,e.scrollLeft=t}function i(t,a){function l(){var p,g,v,h=n(),d=(h-m)/c;return d=d>1?1:d,p=o(d),g=i+(t-i)*p,v=u+(a-u)*p,f(g,v),g===t&&v===a?(i=u=m=null,e.cancelAnimationFrame(s),r):(s=e.requestAnimationFrame(l),r)}var i=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,m=n();s&&e.cancelAnimationFrame(s),s=e.requestAnimationFrame(l)}function u(a,u){function f(){var t,i,u,d=n(),y=(d-h)/c;return y=y>1?1:y,t=o(y),i=m+(g-m)*t,u=p+(v-p)*t,l(a,i,u),i===g&&u===v?(m=p=h=null,e.cancelAnimationFrame(s),r):(s=e.requestAnimationFrame(f),r)}if(a===t.documentElement||a===t.body)return i(u.left,u.top),r;var m=a.scrollLeft,p=a.scrollTop,g=u.left,v=u.top,h=n();s&&e.cancelAnimationFrame(s),s=e.requestAnimationFrame(f)}if(!("scrollBehavior"in t.documentElement.style)){var s,c=768,f=e.scrollTo,m=e.scrollBy,p=e.Element.prototype.scrollIntoView;e.scroll=e.scrollTo=function(){return a(arguments[0])?f.call(e,arguments[0].left||arguments[0],arguments[0].top||arguments[1]):i.call(e,~~arguments[0].left,~~arguments[0].top)},e.scrollBy=function(){if(a(arguments[0]))return m.call(e,arguments[0].left||arguments[0],arguments[0].top||arguments[1]);var t=e.scrollX||e.pageXOffset,r=e.scrollY||e.pageYOffset;return i(~~arguments[0].left+t,~~arguments[0].top+r)},Element.prototype.scrollIntoView=function(){var r,n,o,l;return a(arguments[0])?p.call(this,arguments[0]||!0):(l=e.getComputedStyle(t.body,null),n=parseInt(l.getPropertyValue("padding-left"),10),o=parseInt(l.getPropertyValue("padding-top"),10),r={top:this.offsetTop-2*o,left:this.offsetLeft-2*n},u(t.body,r))}}}(window,document);