From 0f2421d007c7462ec1414d77431c455dccbac754 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio.bekerle@tugraz.at> Date: Wed, 2 Jun 2021 14:17:29 +0200 Subject: [PATCH] Remove deprecated icon override code --- packages/common/src/icon.js | 44 ------------------------------------- 1 file changed, 44 deletions(-) diff --git a/packages/common/src/icon.js b/packages/common/src/icon.js index c8f17e24..95b0371c 100644 --- a/packages/common/src/icon.js +++ b/packages/common/src/icon.js @@ -18,14 +18,6 @@ const errorIcon = ` </svg> `; -// // This variable holds overrides for icons -// // Example: {"cloud": "/new/path/to/icon.svg"} -// let iconOverride = null; - -// This variable holds the base path -// Example: "/dist" -// let basePath = null; - function getCSSVariable(name) { let value = window.getComputedStyle(document.documentElement).getPropertyValue(name); @@ -58,17 +50,6 @@ export function getIconSVGURL(name) { return path; } - // if (iconOverride && iconOverride[name]) { - // let path = iconOverride[name]; - // - // // try to take care of relative paths - // if (!path.startsWith('/') && !path.startsWith('http://') && !path.startsWith('https://') && basePath) { - // path = basePath + path; - // } - // - // return path; - // } - return commonUtils.getAssetURL(pkgName, 'icons/' + encodeURI(name) + '.svg'); } @@ -106,31 +87,6 @@ async function getSVGTextElement(name) { return unsafeHTML(text); } -// /** -// * Fetch and interpret the icon override data -// * -// * @param path -// * @returns {Promise<{}|any>} json object -// */ -// async function fetchIconOverrideData(path) { -// // try to take care of relative paths -// if (!path.startsWith('/') && !path.startsWith('http://') && !path.startsWith('https://') && basePath) { -// path = basePath + path; -// } -// -// const response = await fetch(path); -// -// if (!response.ok) { -// return {}; -// } -// -// try { -// return JSON.parse(await response.text()); -// } catch(e) { -// return {}; -// } -// } - const iconCache = {}; /** -- GitLab