From 0551a8c1b19f46fcd62909c379b0eaa888bc6c1d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 16 Oct 2021 15:13:53 +0200 Subject: [PATCH] remove polyfills (this is the task of babel, not ours) remove unused portal-vue library --- frontend/package.json | 1 - frontend/src/plugins/dashboard-plugin.js | 4 - frontend/src/polyfills.js | 96 ------------------------ 3 files changed, 101 deletions(-) delete mode 100644 frontend/src/polyfills.js diff --git a/frontend/package.json b/frontend/package.json index 038bf8816..80b4ded54 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,7 +54,6 @@ "nouislider": "^12.1.0", "particles-bg-vue": "1.2.3", "perfect-scrollbar": "^1.3.0", - "portal-vue": "^2.1.7", "prettier": "^2.2.1", "qrcode": "^1.4.4", "quill": "^1.3.6", diff --git a/frontend/src/plugins/dashboard-plugin.js b/frontend/src/plugins/dashboard-plugin.js index 448675d20..892a2d93c 100755 --- a/frontend/src/plugins/dashboard-plugin.js +++ b/frontend/src/plugins/dashboard-plugin.js @@ -1,10 +1,7 @@ -import '@/polyfills' import GlobalComponents from './globalComponents' import GlobalDirectives from './globalDirectives' import SideBar from '@/components/SidebarPlugin' -import PortalVue from 'portal-vue' - import Toasted from 'vue-toasted' // vue-bootstrap @@ -32,7 +29,6 @@ export default { Vue.use(GlobalComponents) Vue.use(GlobalDirectives) Vue.use(SideBar) - Vue.use(PortalVue) Vue.use(BootstrapVue) Vue.use(IconsPlugin) Vue.use(VueMoment) diff --git a/frontend/src/polyfills.js b/frontend/src/polyfills.js deleted file mode 100644 index a743ee3e3..000000000 --- a/frontend/src/polyfills.js +++ /dev/null @@ -1,96 +0,0 @@ -/* eslint-disable */ -import 'es6-promise/auto' - -export default (function initPollyFills () { - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, 'find', { - value: function (predicate) { - // 1. Let O be ? ToObject(this value). - if (this == null) { - throw new TypeError('"this" is null or not defined'); - } - - var o = Object(this); - - // 2. Let len be ? ToLength(? Get(O, "length")). - var len = o.length >>> 0; - - // 3. If IsCallable(predicate) is false, throw a TypeError exception. - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - - // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. - var thisArg = arguments[1]; - - // 5. Let k be 0. - var k = 0; - - // 6. Repeat, while k < len - while (k < len) { - // a. Let Pk be ! ToString(k). - // b. Let kValue be ? Get(O, Pk). - // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). - // d. If testResult is true, return kValue. - var kValue = o[k]; - if (predicate.call(thisArg, kValue, k, o)) { - return kValue; - } - // e. Increase k by 1. - k++; - } - - // 7. Return undefined. - return undefined; - } - }); - } - if (typeof Object.assign !== 'function') { - // Must be writable: true, enumerable: false, configurable: true - Object.defineProperty(Object, "assign", { - value: function assign (target, varArgs) { // .length of function is 2 - 'use strict'; - if (target == null) { // TypeError if undefined or null - throw new TypeError('Cannot convert undefined or null to object'); - } - - var to = Object(target); - - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; - - if (nextSource != null) { // Skip over if undefined or null - for (var nextKey in nextSource) { - // Avoid bugs when hasOwnProperty is shadowed - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - to[nextKey] = nextSource[nextKey]; - } - } - } - } - return to; - }, - writable: true, - configurable: true - }); - } - if (!String.prototype.startsWith) { - String.prototype.startsWith = function(search, pos) { - return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; - }; - } - if (!String.prototype.includes) { - String.prototype.includes = function(search, start) { - 'use strict'; - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > this.length) { - return false; - } else { - return this.indexOf(search, start) !== -1; - } - }; - } -}())