From bf25f91efe203eebcf078b68edcad4042d4bd64c Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 23 Nov 2023 12:42:23 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Attorney?= =?UTF-8?q?Online/webDownloader@16ad20b05cbeb936245132e615735b835a939478?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 9 +++++++-- index.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index eb4b276..f847cc9 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,12 @@

WebAO Character Downloader

-

Loading characters...

+
+

Loading characters...

+
+
@@ -86,4 +91,4 @@

WebAO Background Downloader

- \ No newline at end of file + diff --git a/index.js b/index.js index b37208d..e8ccfdc 100644 --- a/index.js +++ b/index.js @@ -201,7 +201,7 @@ eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElem /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BASE_BACKGROUND_URL: () => (/* binding */ BASE_BACKGROUND_URL),\n/* harmony export */ BASE_CHARACTERS_URL: () => (/* binding */ BASE_CHARACTERS_URL),\n/* harmony export */ BASE_SOUNDS_URL: () => (/* binding */ BASE_SOUNDS_URL),\n/* harmony export */ BASE_URL: () => (/* binding */ BASE_URL),\n/* harmony export */ getBackgroundUrls: () => (/* binding */ getBackgroundUrls),\n/* harmony export */ getCharacterUrls: () => (/* binding */ getCharacterUrls),\n/* harmony export */ searchForBackgrounds: () => (/* binding */ searchForBackgrounds),\n/* harmony export */ searchForCharacters: () => (/* binding */ searchForCharacters)\n/* harmony export */ });\n/* harmony import */ var fuzzy_search__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fuzzy-search */ \"./node_modules/fuzzy-search/src/FuzzySearch.js\");\n/* harmony import */ var ini__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ini */ \"./node_modules/ini/lib/ini.js\");\n/* harmony import */ var ini__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(ini__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _downloadandzip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../downloadandzip */ \"./downloadandzip.js\");\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.css */ \"./public/index.css\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_downloadandzip__WEBPACK_IMPORTED_MODULE_2__]);\n_downloadandzip__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst hintedCharacters = document.getElementById('hintedCharacters')\nconst hintedBackgrounds = document.getElementById('hintedBackgrounds')\n\nconst BASE_URL = \"https://attorneyoffline.de/base/\"\nconst BASE_CHARACTERS_URL = BASE_URL + \"characters/\"\nconst BASE_BACKGROUND_URL = BASE_URL + \"background/\"\nconst BASE_SOUNDS_URL = BASE_URL + \"sounds/\"\nconst IGNORE_VALUES = new Set([\n \"Name\",\n \"Last modified\",\n \"Size\",\n \"Description\",\n \"Parent Directory\"\n])\nconst crawl = async (url, currentDepth, maximumDepth) => {\n if (currentDepth > maximumDepth) {\n return\n }\n const response = await fetch(`${url}`)\n if (response.status === 404) {\n return\n }\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n const newUrl = url + aTagValue\n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(...await crawl(newUrl, currentDepth+1, maximumDepth))\n } else {\n validLinks.push(newUrl)\n } \n }\n return validLinks\n}\n\nconst getAllCharacterNames = async () => {\n const response = await fetch(`${BASE_CHARACTERS_URL}`)\n if (response.status === 404) {\n return\n }\n\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(decodeURI(aTagValue.slice(0,-1)))\n } \n \n }\n return validLinks\n}\nconst getAllBackgroundNames = async () => {\n const response = await fetch(`${BASE_BACKGROUND_URL}`)\n if (response.status === 404) {\n return\n }\n\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(decodeURI(aTagValue.slice(0,-1)))\n } \n \n }\n return validLinks\n}\n\nconst failureText = document.getElementById('downloadFeedback')\nconst getCharacterUrls = async () => {\n failureText.innerHTML = \"\"\n const characterName = document.getElementById('characterNameInput').value\n if (window.sortedCharacters.length === 0) {\n failureText.innerHTML = \"Please select a valid character name\" \n return\n } else if (!window.sortedCharacters.includes(characterName)) {\n failureText.innerHTML = \"Please choose a valid name from the dropdown provided.\"\n return\n }\n // Disable button so cant click multiple times\n document.getElementById('downloadButton').disabled = true\n document.getElementById('buttonText').style.display = 'none'\n document.getElementById('buttonLoading').style.display = 'block';\n const validUrls = await crawl(`${BASE_CHARACTERS_URL}${characterName}/`, 0, 99)\n\n // include blip sound, SoundN and frameSFX files\n await fetch(`${BASE_CHARACTERS_URL}${characterName}/char.ini`).then(resp => resp.blob()).then(blob => blob.text()).then(text => {\n const charIni = ini__WEBPACK_IMPORTED_MODULE_1___default().parse(text.toLowerCase());\n\n const blip = (charIni.options.blips != null) ? charIni.options.blips : (charIni.options.gender != null) ? charIni.options.gender : null;\n if (blip !== null)\n validUrls.push(`${BASE_SOUNDS_URL}` + \"blips/\" + blip + \".opus\");\n\n for (const key in charIni) {\n if (key !== \"soundn\" && !key.endsWith(\"_framesfx\"))\n continue;\n\n for (const value in charIni[key]) {\n const sfx = charIni[key][value];\n const sfxUrl = `${BASE_SOUNDS_URL}` + \"general/\" + sfx + \".opus\";\n if (sfx != null && sfx.length > 1 && !validUrls.find((existing) => existing == sfxUrl))\n validUrls.push(sfxUrl);\n }\n }\n });\n\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZip)(characterName, validUrls);\n return\n}\ndocument.getElementById('downloadButton').onclick = getCharacterUrls\n\nwindow.characters = []\nconst createCharactersForDropdown = async () => {\n const allCharacterNames = await getAllCharacterNames()\n const uniqueNames = new Set(allCharacterNames)\n\n window.characters = Array.from(uniqueNames)\n document.getElementById('loadingContainer').style.display = 'none'\n document.getElementById('searchCharacter').style.display = \"block\"\n}\nwindow.backgrounds = []\nconst createBackgroundsForDropdown = async () => {\n const allBackgroundNames = await getAllBackgroundNames()\n const uniqueNames = new Set(allBackgroundNames)\n\n window.backgrounds = Array.from(uniqueNames)\n document.getElementById('loadingBackgroundContainer').style.display = 'none'\n document.getElementById('searchBackground').style.display = \"block\"\n}\n\nwindow.sortedCharacters = []\nconst searchForCharacters = () => {\n const userInput = document.getElementById('characterNameInput').value\n const searcher = new fuzzy_search__WEBPACK_IMPORTED_MODULE_0__[\"default\"](window.characters)\n window.sortedCharacters = searcher.search(userInput)\n hintedCharacters.innerHTML = \"\"\n document.getElementById('characterSearchResults').innerHTML = `${window.sortedCharacters.length} / ${window.characters.length}`\n if (window.sortedCharacters.length < 100) {\n window.sortedCharacters.forEach(character => {\n hintedCharacters.innerHTML += ``\n });\n } else if (window.sortedCharacters.length > 100){\n hintedCharacters.innerHTML = \"Too many characters like this! Filter better.\"\n } else if (window.sortedCharacters.length === 0) {\n hintedCharacters.innerHTML = \"We cant find any characters with that name.\"\n } \n}\nwindow.sortedBackgrounds = []\nconst searchForBackgrounds = () => {\n const userInput = document.getElementById('backgroundNameInput').value\n const searcher = new fuzzy_search__WEBPACK_IMPORTED_MODULE_0__[\"default\"](window.backgrounds)\n window.sortedBackgrounds = searcher.search(userInput)\n hintedBackgrounds.innerHTML = \"\"\n document.getElementById('backgroundSearchResults').innerHTML = `${window.sortedBackgrounds.length} / ${window.backgrounds.length}`\n if (window.sortedBackgrounds.length < 100) {\n window.sortedBackgrounds.forEach(background => {\n hintedBackgrounds.innerHTML += ``\n });\n } else if (window.sortedBackgrounds.length > 100){\n hintedBackgrounds.innerHTML = \"Too many backgrounds like this! Filter better.\"\n } else if (window.sortedBackgrounds.length === 0) {\n hintedBackgrounds.innerHTML = \"We cant find any backgrounds with that name.\"\n } \n}\nconst backgroundsFailureDiv = document.getElementById('backgroundDownloadFeedback')\nconst getBackgroundUrls = async () => {\n backgroundsFailureDiv.innerHTML = \"\"\n const backgroundName = document.getElementById('backgroundNameInput').value\n if (window.sortedBackgrounds.length === 0) {\n backgroundsFailureDiv.innerHTML = \"Please select a valid background name\" \n return\n } else if (!window.sortedBackgrounds.includes(backgroundName)) {\n backgroundsFailureDiv.innerHTML = \"Please choose a valid background from the dropdown provided.\"\n return\n }\n // Disable button so cant click multiple times\n document.getElementById('downloadBackgroundsButton').disabled = true\n document.getElementById('backgroundButtonText').style.display = 'none'\n document.getElementById('backgourndButtonLoading').style.display = 'block';\n const validUrls = await crawl(`${BASE_BACKGROUND_URL}${backgroundName}/`, 0, 99)\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZipBackgrounds)(backgroundName, validUrls);\n return\n}\ndocument.getElementById('downloadBackgroundsButton').onclick = getBackgroundUrls\n\ndocument.getElementById('characterNameInput').oninput = searchForCharacters\ndocument.getElementById('backgroundNameInput').oninput = searchForBackgrounds\n\ncreateCharactersForDropdown()\ncreateBackgroundsForDropdown()\n\nconst queryString = window.location.search;\nconst urlParams = new URLSearchParams(queryString);\nif(urlParams.has('char')) {\n const characterName = urlParams.get('char')\n document.getElementById('characterNameInput').value = characterName\n const validUrls = await crawl(`${BASE_CHARACTERS_URL}${characterName}/`, 0, 99)\n document.getElementById('downloadButton').disabled = true\n document.getElementById('buttonText').style.display = 'none'\n document.getElementById('buttonLoading').style.display = 'block';\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZip)(characterName, validUrls);\n}\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://lib/./public/index.js?"); +eval("__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BASE_BACKGROUND_URL: () => (/* binding */ BASE_BACKGROUND_URL),\n/* harmony export */ BASE_CHARACTERS_URL: () => (/* binding */ BASE_CHARACTERS_URL),\n/* harmony export */ BASE_SOUNDS_URL: () => (/* binding */ BASE_SOUNDS_URL),\n/* harmony export */ BASE_URL: () => (/* binding */ BASE_URL),\n/* harmony export */ getBackgroundUrls: () => (/* binding */ getBackgroundUrls),\n/* harmony export */ getCharacterUrls: () => (/* binding */ getCharacterUrls),\n/* harmony export */ searchForBackgrounds: () => (/* binding */ searchForBackgrounds),\n/* harmony export */ searchForCharacters: () => (/* binding */ searchForCharacters)\n/* harmony export */ });\n/* harmony import */ var fuzzy_search__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fuzzy-search */ \"./node_modules/fuzzy-search/src/FuzzySearch.js\");\n/* harmony import */ var ini__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ini */ \"./node_modules/ini/lib/ini.js\");\n/* harmony import */ var ini__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(ini__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _downloadandzip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../downloadandzip */ \"./downloadandzip.js\");\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.css */ \"./public/index.css\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_downloadandzip__WEBPACK_IMPORTED_MODULE_2__]);\n_downloadandzip__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst hintedCharacters = document.getElementById('hintedCharacters')\nconst hintedBackgrounds = document.getElementById('hintedBackgrounds')\n\nconst BASE_URL = \"https://attorneyoffline.de/base/\"\nconst BASE_CHARACTERS_URL = BASE_URL + \"characters/\"\nconst BASE_BACKGROUND_URL = BASE_URL + \"background/\"\nconst BASE_SOUNDS_URL = BASE_URL + \"sounds/\"\nconst IGNORE_VALUES = new Set([\n \"Name\",\n \"Last modified\",\n \"Size\",\n \"Description\",\n \"Parent Directory\"\n])\nconst crawl = async (url, currentDepth, maximumDepth) => {\n if (currentDepth > maximumDepth) {\n return\n }\n const response = await fetch(`${url}`)\n if (response.status === 404) {\n return\n }\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n const newUrl = url + aTagValue\n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(...await crawl(newUrl, currentDepth+1, maximumDepth))\n } else {\n validLinks.push(newUrl)\n } \n }\n return validLinks\n}\n\nconst getAllCharacterNames = async () => {\n const response = await fetch(`${BASE_CHARACTERS_URL}`)\n if (response.status === 404) {\n return\n }\n\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(decodeURI(aTagValue.slice(0,-1)))\n } \n \n }\n return validLinks\n}\nconst getAllSfxs = async (url) => {\n const response = await fetch(url)\n if (response.status === 404) {\n return\n }\n\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n var validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML) || aTagValue == \"music/\") {\n continue\n }\n\n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n const extraLinks = await getAllSfxs(url + aTagValue);\n if (extraLinks != null)\n validLinks = validLinks.concat(extraLinks);\n } else\n validLinks.push(decodeURI(aTagValue));\n }\n return validLinks\n}\n\nconst getAllBackgroundNames = async () => {\n const response = await fetch(`${BASE_BACKGROUND_URL}`)\n if (response.status === 404) {\n return\n }\n\n // Create a fake webpage\n const websiteDirectoryPage = await response.text()\n const tempPage = document.createElement(\"html\");\n tempPage.innerHTML = websiteDirectoryPage;\n\n const tags = tempPage.getElementsByTagName('a')\n const validLinks = []\n for (const link of tags) {\n const aTagValue = link.getAttribute('href')\n if (IGNORE_VALUES.has(link.innerHTML)) {\n continue\n }\n \n // Crawl all directories,\n if (aTagValue.endsWith('/')) {\n validLinks.push(decodeURI(aTagValue.slice(0,-1)))\n } \n \n }\n return validLinks\n}\n\nconst failureText = document.getElementById('downloadFeedback')\nconst getCharacterUrls = async () => {\n failureText.innerHTML = \"\"\n const characterName = document.getElementById('characterNameInput').value\n if (window.sortedCharacters.length === 0) {\n failureText.innerHTML = \"Please select a valid character name\" \n return\n } else if (!window.sortedCharacters.includes(characterName)) {\n failureText.innerHTML = \"Please choose a valid name from the dropdown provided.\"\n return\n }\n // Disable button so cant click multiple times\n document.getElementById('downloadButton').disabled = true\n document.getElementById('buttonText').style.display = 'none'\n document.getElementById('buttonLoading').style.display = 'block';\n const validUrls = await crawl(`${BASE_CHARACTERS_URL}${characterName}/`, 0, 99)\n\n // include blip sound, SoundN and frameSFX files\n await fetch(`${BASE_CHARACTERS_URL}${characterName}/char.ini`).then(resp => resp.blob()).then(blob => blob.text()).then(text => {\n const charIni = ini__WEBPACK_IMPORTED_MODULE_1___default().parse(text.toLowerCase());\n\n const blip = (charIni.options.blips != null) ? charIni.options.blips : (charIni.options.gender != null) ? charIni.options.gender : null;\n if (blip !== null && window.sfx.find((element) => element.includes(blip)))\n validUrls.push(`${BASE_SOUNDS_URL}` + \"blips/\" + blip + \".opus\");\n\n for (const key in charIni) {\n if (key !== \"soundn\" && !key.endsWith(\"_framesfx\"))\n continue;\n\n for (const value in charIni[key]) {\n const sfx = charIni[key][value];\n const sfxUrl = `${BASE_SOUNDS_URL}` + \"general/\" + sfx + \".opus\";\n\n if (sfx != null && sfx.length > 1 && !validUrls.find((existing) => existing == sfxUrl) && window.sfx.find((element) => element.includes(sfx)))\n {\n validUrls.push(sfxUrl);\n }\n }\n }\n });\n\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZip)(characterName, validUrls);\n return\n}\ndocument.getElementById('downloadButton').onclick = getCharacterUrls\n\nwindow.characters = []\nwindow.sfx = []\nconst createCharactersForDropdown = async () => {\n const allCharacterNames = await getAllCharacterNames()\n const uniqueNames = new Set(allCharacterNames)\n\n document.getElementById('loadingCharactersText').style.display = \"none\";\n document.getElementById('loadingSfxText').style.display = \"block\";\n const allSfxNames = await getAllSfxs(`${BASE_SOUNDS_URL}`)\n const uniqueSfx = new Set(allSfxNames)\n\n window.characters = Array.from(uniqueNames)\n window.sfx = Array.from(uniqueSfx)\n document.getElementById('loadingContainer').style.display = 'none'\n document.getElementById('searchCharacter').style.display = \"block\"\n}\nwindow.backgrounds = []\nconst createBackgroundsForDropdown = async () => {\n const allBackgroundNames = await getAllBackgroundNames()\n const uniqueNames = new Set(allBackgroundNames)\n\n window.backgrounds = Array.from(uniqueNames)\n document.getElementById('loadingBackgroundContainer').style.display = 'none'\n document.getElementById('searchBackground').style.display = \"block\"\n}\n\nwindow.sortedCharacters = []\nconst searchForCharacters = () => {\n const userInput = document.getElementById('characterNameInput').value\n const searcher = new fuzzy_search__WEBPACK_IMPORTED_MODULE_0__[\"default\"](window.characters)\n window.sortedCharacters = searcher.search(userInput)\n hintedCharacters.innerHTML = \"\"\n document.getElementById('characterSearchResults').innerHTML = `${window.sortedCharacters.length} / ${window.characters.length}`\n if (window.sortedCharacters.length < 100) {\n window.sortedCharacters.forEach(character => {\n hintedCharacters.innerHTML += ``\n });\n } else if (window.sortedCharacters.length > 100){\n hintedCharacters.innerHTML = \"Too many characters like this! Filter better.\"\n } else if (window.sortedCharacters.length === 0) {\n hintedCharacters.innerHTML = \"We cant find any characters with that name.\"\n } \n}\nwindow.sortedBackgrounds = []\nconst searchForBackgrounds = () => {\n const userInput = document.getElementById('backgroundNameInput').value\n const searcher = new fuzzy_search__WEBPACK_IMPORTED_MODULE_0__[\"default\"](window.backgrounds)\n window.sortedBackgrounds = searcher.search(userInput)\n hintedBackgrounds.innerHTML = \"\"\n document.getElementById('backgroundSearchResults').innerHTML = `${window.sortedBackgrounds.length} / ${window.backgrounds.length}`\n if (window.sortedBackgrounds.length < 100) {\n window.sortedBackgrounds.forEach(background => {\n hintedBackgrounds.innerHTML += ``\n });\n } else if (window.sortedBackgrounds.length > 100){\n hintedBackgrounds.innerHTML = \"Too many backgrounds like this! Filter better.\"\n } else if (window.sortedBackgrounds.length === 0) {\n hintedBackgrounds.innerHTML = \"We cant find any backgrounds with that name.\"\n } \n}\nconst backgroundsFailureDiv = document.getElementById('backgroundDownloadFeedback')\nconst getBackgroundUrls = async () => {\n backgroundsFailureDiv.innerHTML = \"\"\n const backgroundName = document.getElementById('backgroundNameInput').value\n if (window.sortedBackgrounds.length === 0) {\n backgroundsFailureDiv.innerHTML = \"Please select a valid background name\" \n return\n } else if (!window.sortedBackgrounds.includes(backgroundName)) {\n backgroundsFailureDiv.innerHTML = \"Please choose a valid background from the dropdown provided.\"\n return\n }\n // Disable button so cant click multiple times\n document.getElementById('downloadBackgroundsButton').disabled = true\n document.getElementById('backgroundButtonText').style.display = 'none'\n document.getElementById('backgourndButtonLoading').style.display = 'block';\n const validUrls = await crawl(`${BASE_BACKGROUND_URL}${backgroundName}/`, 0, 99)\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZipBackgrounds)(backgroundName, validUrls);\n return\n}\ndocument.getElementById('downloadBackgroundsButton').onclick = getBackgroundUrls\n\ndocument.getElementById('characterNameInput').oninput = searchForCharacters\ndocument.getElementById('backgroundNameInput').oninput = searchForBackgrounds\n\ncreateCharactersForDropdown()\ncreateBackgroundsForDropdown()\n\nconst queryString = window.location.search;\nconst urlParams = new URLSearchParams(queryString);\nif(urlParams.has('char')) {\n const characterName = urlParams.get('char')\n document.getElementById('characterNameInput').value = characterName\n const validUrls = await crawl(`${BASE_CHARACTERS_URL}${characterName}/`, 0, 99)\n document.getElementById('downloadButton').disabled = true\n document.getElementById('buttonText').style.display = 'none'\n document.getElementById('buttonLoading').style.display = 'block';\n await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_2__.downloadAndZip)(characterName, validUrls);\n}\n\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://lib/./public/index.js?"); /***/ }),