From fa8e8673b0b133311cc2821e664ec994b8171f9a Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Sun, 3 May 2020 12:02:17 +0300 Subject: [PATCH] Cleaned up sb-admin-2.js code - Removed redundant for-i loops for readability - Renamed some variables to be easier to read. - Removed jquery-easing - Removed sb-admin-2.min.js (not up to date) - Fixed an issue with network/server plugins-overview tab id with no data. - Fixed an issue with player plugins tab id with no data. Affects issues: - Fixed #1409 --- .../delivery/export/NetworkPageExporter.java | 1 - .../delivery/export/PlayerPageExporter.java | 1 - .../delivery/export/PlayersPageExporter.java | 1 - .../delivery/export/ServerPageExporter.java | 1 - .../rendering/pages/PlayerPluginTab.java | 2 +- .../rendering/pages/ServerPluginTabs.java | 2 +- .../main/resources/assets/plan/web/error.html | 3 - .../assets/plan/web/js/sb-admin-2.js | 215 ++++++++---------- .../assets/plan/web/js/sb-admin-2.min.js | 7 - .../main/resources/assets/plan/web/login.html | 4 - .../resources/assets/plan/web/network.html | 3 - .../resources/assets/plan/web/player.html | 3 - .../resources/assets/plan/web/players.html | 3 - .../resources/assets/plan/web/register.html | 4 - .../resources/assets/plan/web/server.html | 3 - .../jquery.easing.compatibility.js | 60 ----- .../web/vendor/jquery-easing/jquery.easing.js | 166 -------------- .../vendor/jquery-easing/jquery.easing.min.js | 1 - 18 files changed, 94 insertions(+), 386 deletions(-) delete mode 100644 Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.min.js delete mode 100644 Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.compatibility.js delete mode 100644 Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.js delete mode 100644 Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.min.js diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java index a413e9e1f..6c6d405b3 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java @@ -170,7 +170,6 @@ public class NetworkPageExporter extends FileExporter { "./css/style.css", "./vendor/jquery/jquery.min.js", "./vendor/bootstrap/js/bootstrap.bundle.min.js", - "./vendor/jquery-easing/jquery.easing.min.js", "./vendor/datatables/jquery.dataTables.min.js", "./vendor/datatables/dataTables.bootstrap4.min.js", "./vendor/highcharts/highstock.js", diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java index cc15528db..c4f117480 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java @@ -143,7 +143,6 @@ public class PlayerPageExporter extends FileExporter { "../css/style.css", "../vendor/jquery/jquery.min.js", "../vendor/bootstrap/js/bootstrap.bundle.min.js", - "../vendor/jquery-easing/jquery.easing.min.js", "../vendor/datatables/jquery.dataTables.min.js", "../vendor/datatables/dataTables.bootstrap4.min.js", "../vendor/highcharts/highstock.js", diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java index cc2933ba8..49ecc1fb2 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java @@ -132,7 +132,6 @@ public class PlayersPageExporter extends FileExporter { "css/style.css", "vendor/jquery/jquery.min.js", "vendor/bootstrap/js/bootstrap.bundle.min.js", - "vendor/jquery-easing/jquery.easing.min.js", "vendor/datatables/jquery.dataTables.min.js", "vendor/datatables/dataTables.bootstrap4.min.js", "vendor/fontawesome-free/css/all.min.css", diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java index 862534cb5..e4f6a6b28 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java @@ -182,7 +182,6 @@ public class ServerPageExporter extends FileExporter { "../css/style.css", "../vendor/jquery/jquery.min.js", "../vendor/bootstrap/js/bootstrap.bundle.min.js", - "../vendor/jquery-easing/jquery.easing.min.js", "../vendor/datatables/jquery.dataTables.min.js", "../vendor/datatables/dataTables.bootstrap4.min.js", "../vendor/highcharts/highstock.js", diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPluginTab.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPluginTab.java index 28ff9fbeb..ee09b7ecb 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPluginTab.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPluginTab.java @@ -85,7 +85,7 @@ public class PlayerPluginTab implements Comparable { private void generate() { if (playerData.isEmpty()) { - nav = NavLink.collapsed(Icon.called("cubes").build(), "plugins-" + serverName, serverName + " (No Data)").toHtml(); + nav = NavLink.collapsed(Icon.called("cubes").build(), "plugins-" + serverName + " (No Data)", serverName + " (No Data)").toHtml(); tab = wrapInWideTab( serverName + " (No Data)", "

No Extension Data

" diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/ServerPluginTabs.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/ServerPluginTabs.java index c3467881e..9a8ee1e60 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/ServerPluginTabs.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/ServerPluginTabs.java @@ -89,7 +89,7 @@ public class ServerPluginTabs { if (serverData.isEmpty()) { nav = new StringBuilder(NavLink.main(Icon.called("cubes").build(), tabID, "Overview (No Data)").toHtml()); tab = wrapInWideColumnTab( - tabID, "

No Extension Data

" + "overview", "

No Extension Data

" ); } else { nav = new StringBuilder(NavLink.main(Icon.called("cubes").build(), tabID, "Overview").toHtml()); diff --git a/Plan/common/src/main/resources/assets/plan/web/error.html b/Plan/common/src/main/resources/assets/plan/web/error.html index c37c03968..6ff100757 100644 --- a/Plan/common/src/main/resources/assets/plan/web/error.html +++ b/Plan/common/src/main/resources/assets/plan/web/error.html @@ -241,9 +241,6 @@ - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.js b/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.js index bc762acb0..4c6a24fbf 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.js @@ -1,147 +1,116 @@ -function openTab(i) { - var x = document.getElementById("content"); - var navButtons = document.getElementsByClassName("nav-button"); - var max = navButtons.length; - for (var j = 0; j < max; j++) { - if (navButtons[j].classList.contains('active')) { - navButtons[j].classList.remove('active'); - } - if (j === i) { - navButtons[j].classList.add('active'); +const content = document.getElementById("content"); +const navButtons = Array.from(document.getElementsByClassName("nav-button")); +const tabs = Array.from(document.getElementsByClassName("tab")).filter(tab => tab.id); +const tabCount = tabs.length; + +function openTab(openIndex) { + for (let navButton of navButtons) { + if (navButton.classList.contains('active')) { + navButton.classList.remove('active'); } } - var percent = -100 / navButtons.length; - slideIndex = i; - if (slideIndex > max) { - slideIndex = 0 - } - if (slideIndex < 0) { - slideIndex = max - } - window.scrollTo(0, 0); - var value = slideIndex * percent; - x.style.transition = "0.5s"; - x.style.transform = "translate3d(" + value + "%,0px,0)"; + + const outOfRange = openIndex < 0 || tabCount < openIndex; + const slideIndex = outOfRange ? 0 : openIndex; + + navButtons[slideIndex].classList.add('active'); + + window.scrollTo(0, 0); // Scroll to top + const tabWidthPercent = -100 / tabCount; + const verticalScrollPercent = slideIndex * tabWidthPercent; + content.style.transition = "0.5s"; + content.style.transform = "translate3d(" + verticalScrollPercent + "%,0px,0)"; } function openPage() { - var params = (window.location.hash.substr(5)).split("&"); + // substr removes tab- from the id + const uriHash = (window.location.hash.substr(5)).split("&").filter(part => part); - if (!params.length) { + if (!uriHash.length) { openTab(0); return; } - // window.sessionStorage.setItem("server_slide_index", slideIndex); - var tabID = params[0]; - var button = $('.nav-button[href="#' + tabID + '"]'); + const tabId = uriHash[0]; + const openIndex = tabs.map(tab => tab.id).indexOf(tabId); + openTab(openIndex); - var tabs = document.getElementsByClassName("tab"); - for (var i = 0; i < tabs.length; i++) { - if (tabs[i].id === tabID) openTab(i); + if (uriHash.length > 1) { + const bootstrapTabId = uriHash[1]; + $('a[href="#' + bootstrapTabId + '"]').tab('show'); } +} - if (params.length <= 1) { +// Prepare tabs for display +content.style.transform = "translate3d(0px,0px,0)"; +content.style.width = (tabCount * 100) + "%"; +content.style.opacity = "1"; +for (let tab of tabs) { + tab.style.width = (100 / tabCount) + "%"; +} + +window.addEventListener('hashchange', openPage); + +// Persistent Bootstrap tabs +$('.nav-tabs a.nav-link').click(event => { + const uriHash = (window.location.hash).split("&"); + if (!uriHash) return; + const currentTab = uriHash[0]; + const originalTargetId = event.target.href.split('#')[1]; + window.location.hash = currentTab + '&' + originalTargetId; +}); + +let oldWidth = null; + +function reduceSidebar() { + const newWidth = $(window).width(); + if (oldWidth && oldWidth === newWidth) { return; } - var graphTabID = params[1]; - $('a[href="#' + graphTabID + '"]').tab('show'); + const $sidebar = $('.sidebar'); + const closeModal = $('.sidebar-close-modal'); + if ($(window).width() < 1350) { + if (!$sidebar.hasClass('hidden')) $sidebar.addClass('hidden'); + if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); + + // Close any open menu accordions when window is resized + $('.sidebar .collapse').collapse('hide'); + } else if ($(window).width() > 1400 && $sidebar.hasClass('hidden')) { + $sidebar.removeClass('hidden'); + if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); + } + oldWidth = newWidth; } -(function ($) { - "use strict"; // Start of use strict +reduceSidebar(); +$(window).resize(reduceSidebar); - var x = document.getElementById("content"); - // Prepare tabs for display - var navButtons = document.getElementsByClassName("nav-button"); - var tabs = document.getElementsByClassName("tab"); - x.style.transform = "translate3d(0px,0px,0)"; - x.style.width = "" + navButtons.length * 100 + "%"; - for (var i = 0; i < navButtons.length; i++) { - tabs[i].style.width = "" + 100 / navButtons.length + "%"; +function toggleSidebar() { + $('.sidebar').toggleClass('hidden'); + $('.sidebar .collapse').collapse('hide'); + + const closeModal = $('.sidebar-close-modal'); + if ($(window).width() < 900) { + closeModal.toggleClass('hidden'); + } else { + if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); } - x.style.opacity = "1"; +} - window.addEventListener('hashchange', function (e) { - openPage(); - }); +$('.sidebar-toggler,.sidebar-close-modal').on('click', toggleSidebar); - // Persistent Bootstrap tabs - $('.nav-tabs a.nav-link').click(function (e) { - var params = (window.location.hash).split("&"); - if (!params) return; - window.location.hash = params[0] + '&' + e.target.href.split('#')[1]; - }); - - var oldWidth = null; - - function reduceSidebar() { - var newWidth = $(window).width(); - if (oldWidth && oldWidth === newWidth) { - return; - } - - var $sidebar = $('.sidebar'); - var closeModal = $('.sidebar-close-modal'); - if ($(window).width() < 1350) { - if (!$sidebar.hasClass('hidden')) $sidebar.addClass('hidden'); - if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); - - $('.sidebar .collapse').collapse('hide'); - } else if ($(window).width() > 1400 && $sidebar.hasClass('hidden')) { - $sidebar.removeClass('hidden'); - if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); - } - oldWidth = newWidth; +// Scroll to top button appear +$(document).on('scroll', () => { + const scrollDistance = $(this).scrollTop(); + if (scrollDistance > 100) { + $('.scroll-to-top').fadeIn(); + } else { + $('.scroll-to-top').fadeOut(); } +}); - reduceSidebar(); - - function toggleSidebar() { - $('.sidebar').toggleClass('hidden'); - $('.sidebar .collapse').collapse('hide'); - - var closeModal = $('.sidebar-close-modal'); - if ($(window).width() < 900) { - closeModal.toggleClass('hidden'); - } else { - if (!closeModal.hasClass('hidden')) closeModal.addClass('hidden'); - } - } - - $('.sidebar-toggler,.sidebar-close-modal').on('click', toggleSidebar); - - // Close any open menu accordions when window is resized below 924px - $(window).resize(reduceSidebar); - - // Prevent the content wrapper from scrolling when the fixed side navigation hovered over - $('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function (e) { - if ($(window).width() > 924) { - var e0 = e.originalEvent, - delta = e0.wheelDelta || -e0.detail; - this.scrollTop += (delta < 0 ? 1 : -1) * 30; - e.preventDefault(); - } - }); - - // Scroll to top button appear - $(document).on('scroll', function () { - var scrollDistance = $(this).scrollTop(); - if (scrollDistance > 100) { - $('.scroll-to-top').fadeIn(); - } else { - $('.scroll-to-top').fadeOut(); - } - }); - - // Smooth scrolling using jQuery easing - $(document).on('click', 'a.scroll-to-top', function (e) { - var $anchor = $(this); - $('html, body').stop().animate({ - scrollTop: ($($anchor.attr('href')).offset().top) - }, 1000, 'easeInOutExpo'); - e.preventDefault(); - }); - -})(jQuery); // End of use strict +$('.scroll-to-top').on('click', 'a.scroll-to-top', event => { + window.scrollTo(0, 0); // Scroll to top + event.preventDefault(); +}); diff --git a/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.min.js b/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.min.js deleted file mode 100644 index 1ea3e4e0c..000000000 --- a/Plan/common/src/main/resources/assets/plan/web/js/sb-admin-2.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Start Bootstrap - SB Admin 2 v4.0.0 (https://startbootstrap.com/template-overviews/sb-admin-2) - * Copyright 2013-2019 Start Bootstrap - * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/master/LICENSE) - */ - -!function(t){"use strict";t("#sidebarToggle, #sidebarToggleTop").on("click",function(o){t("body").toggleClass("sidebar-toggled"),t(".sidebar").toggleClass("toggled"),t(".sidebar").hasClass("toggled")&&t(".sidebar .collapse").collapse("hide")}),t(window).resize(function(){t(window).width()<768&&t(".sidebar .collapse").collapse("hide")}),t("body.fixed-nav .sidebar").on("mousewheel DOMMouseScroll wheel",function(o){if(768 - - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/network.html b/Plan/common/src/main/resources/assets/plan/web/network.html index f7586f6a7..cc217b9fa 100644 --- a/Plan/common/src/main/resources/assets/plan/web/network.html +++ b/Plan/common/src/main/resources/assets/plan/web/network.html @@ -783,9 +783,6 @@ - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/player.html b/Plan/common/src/main/resources/assets/plan/web/player.html index c584bbb47..2974023b4 100644 --- a/Plan/common/src/main/resources/assets/plan/web/player.html +++ b/Plan/common/src/main/resources/assets/plan/web/player.html @@ -705,9 +705,6 @@ - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/players.html b/Plan/common/src/main/resources/assets/plan/web/players.html index 8c87be8c9..4ab21d581 100644 --- a/Plan/common/src/main/resources/assets/plan/web/players.html +++ b/Plan/common/src/main/resources/assets/plan/web/players.html @@ -251,9 +251,6 @@ - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/register.html b/Plan/common/src/main/resources/assets/plan/web/register.html index be6b4b8cb..27f0bf068 100644 --- a/Plan/common/src/main/resources/assets/plan/web/register.html +++ b/Plan/common/src/main/resources/assets/plan/web/register.html @@ -178,11 +178,7 @@ - - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/server.html b/Plan/common/src/main/resources/assets/plan/web/server.html index 5bc6cfbe4..218d08865 100644 --- a/Plan/common/src/main/resources/assets/plan/web/server.html +++ b/Plan/common/src/main/resources/assets/plan/web/server.html @@ -1258,9 +1258,6 @@ - - - diff --git a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.compatibility.js b/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.compatibility.js deleted file mode 100644 index 69d3f2df9..000000000 --- a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.compatibility.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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); diff --git a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.js b/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.js deleted file mode 100644 index 528b96934..000000000 --- a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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" - $.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 + 0.75; - } else if (x < 2.5 / d1) { - return n1 * (x -= (2.25 / d1)) * x + 0.9375; - } else { - return n1 * (x -= (2.625 / d1)) * x + 0.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; - } - }); - -}); diff --git a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.min.js b/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.min.js deleted file mode 100644 index c5157b7b7..000000000 --- a/Plan/common/src/main/resources/assets/plan/web/vendor/jquery-easing/jquery.easing.min.js +++ /dev/null @@ -1 +0,0 @@ -(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($){$.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;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<.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<.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<.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<.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<.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<.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-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.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<.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<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})}); \ No newline at end of file