From 312f098649b7a53de33fec80249b2a7d8fcecb3e Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Fri, 16 Jun 2023 23:53:11 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Attorney?= =?UTF-8?q?Online/webDownloader@4d46cb2a5173d53478935d4e7b08becf0dc8a8af?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 40f5238..c34c827 100644 --- a/index.js +++ b/index.js @@ -191,7 +191,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 */ 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 _downloadandzip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../downloadandzip */ \"./downloadandzip.js\");\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.css */ \"./public/index.css\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_downloadandzip__WEBPACK_IMPORTED_MODULE_1__]);\n_downloadandzip__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\nconst hintedCharacters = document.getElementById('hintedCharacters')\nconst hintedBackgrounds = document.getElementById('hintedBackgrounds')\n// const parse = import('parse-apache-directory-index');\nconst BASE_URL = \"https://attorneyoffline.de/base/\"\nconst BASE_CHARACTERS_URL = BASE_URL + \"characters/\"\nconst BASE_BACKGROUND_URL = BASE_URL + \"background/\"\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 await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_1__.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_1__.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_1__.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 */ 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 _downloadandzip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../downloadandzip */ \"./downloadandzip.js\");\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.css */ \"./public/index.css\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_downloadandzip__WEBPACK_IMPORTED_MODULE_1__]);\n_downloadandzip__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\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 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 await (0,_downloadandzip__WEBPACK_IMPORTED_MODULE_1__.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_1__.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_1__.downloadAndZip)(characterName, validUrls);\n}\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://lib/./public/index.js?"); /***/ }),