diff --git a/media/config.icons.json b/media/config.icons.json deleted file mode 100644 index 2160538..0000000 --- a/media/config.icons.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "default": { - "512": "media/icons/logo_tiny.png", - "1024": "media/icons/logo.png" - }, - "disabled": { - "512": "media/icons/logo_no_tiny.png", - "1024": "media/icons/logo_no.png" - }, - "good": { - "512": "media/icons/good_tiny.png", - "1024": "media/icons/good.png" - }, - "bad": { - "512": "media/icons/bad_tiny.png", - "1024": "media/icons/bad.png" - } -} \ No newline at end of file diff --git a/scripts/mapping/image.js b/scripts/mapping/image.js deleted file mode 100644 index b0cc943..0000000 --- a/scripts/mapping/image.js +++ /dev/null @@ -1,37 +0,0 @@ - -const CONFIG = chrome.runtime.getURL("media/config.icons.json"); - -class Image { - /* Get the appropriate image path from the configuration. - - @param {string} name The name of the image. - */ - static get(name, size) { - return (fetch(CONFIG) - .then((response) => response.json()) - .then((jsonData) => { - let image = {'raw': jsonData[name]}; - image[`filtered`] = (image[`raw`] && size) ? image[`raw`][String(size)] : image[`raw`]; - - // Set the appropriate URL. - if (typeof image[`filtered`] == `string` && !image[`filtered`].includes(`://`)) { - image[`filtered`] = chrome.runtime.getURL(image[`filtered`]); - } else if (((typeof image[`filtered`]).includes(`obj`) && image[`filtered`] != null && !Array.isArray(image[`filtered`])) ? (Object.keys(image[`filtered`]).length) : false) { - Object.keys(image[`filtered`]).forEach((key) => { - image[`filtered`][key] = (!image[`filtered`][key].includes(`://`)) ? chrome.runtime.getURL(image[`filtered`][key]) : image[`filtered`][key]; - }); - } else if (Array.isArray(image[`filtered`])) { - image[`filtered`] = image[`filtered`].map((element) => { - return chrome.runtime.getURL(element); - }); - }; - - return image[`filtered`]; - }) - .catch((error) => { - console.error(error); - })); - }; -} - -export {Image as default}; \ No newline at end of file