Move javascript files into their own folder

This commit is contained in:
b 2021-10-17 18:21:02 -07:00
parent 9602bd49c0
commit 28a1e81a6c
40 changed files with 181 additions and 1142 deletions

View file

@ -37,8 +37,8 @@
</div> </div>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="atlas.js"></script> <script type="text/javascript" src="/js/atlas.js"></script>
</body> </body>
</html> </html>

View file

@ -982,20 +982,20 @@
</div> </div>
</footer> </footer>
</div> </div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="powders.js"></script> <script type="text/javascript" src="/js/powders.js"></script>
<script type="text/javascript" src="skillpoints.js"></script> <script type="text/javascript" src="/js/skillpoints.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>
<script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="/js/custom.js"></script>
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="build2.js"></script> <script type="text/javascript" src="/js/build2.js"></script>
<script type="text/javascript" src="builder.js"></script> <script type="text/javascript" src="/js/builder.js"></script>
</body> </body>
</html> </html>

View file

@ -213,17 +213,17 @@
</div> </div>
</footer> </footer>
</div> </div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="powders.js"></script> <script type="text/javascript" src="/js/powders.js"></script>
<script type="text/javascript" src="skillpoints.js"></script> <script type="text/javascript" src="/js/skillpoints.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="crafter.js"></script> <script type="text/javascript" src="/js/crafter.js"></script>
</body> </body>
</html> </html>

View file

@ -1874,20 +1874,20 @@
</div> </div>
</footer> </footer>
</div> </div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="powders.js"></script> <script type="text/javascript" src="/js/powders.js"></script>
<script type="text/javascript" src="skillpoints.js"></script> <script type="text/javascript" src="/js/skillpoints.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>
<script type="text/javascript" src="crafter.js"></script> <script type="text/javascript" src="/js/crafter.js"></script>
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="/js/custom.js"></script>
<script type="text/javascript" src="customizer.js"></script> <script type="text/javascript" src="/js/customizer.js"></script>
</body> </body>
</html> </html>

View file

@ -64,9 +64,9 @@
</p> </p>
<script src="https://d3js.org/d3.v7.js"></script> <script src="https://d3js.org/d3.v7.js"></script>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="dps_vis.js"></script> <script type="text/javascript" src="/js/dps_vis.js"></script>
</body> </body>
</html> </html>

View file

@ -1012,20 +1012,20 @@
</div> </div>
</footer> </footer>
</div> </div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="powders.js"></script> <script type="text/javascript" src="/js/powders.js"></script>
<script type="text/javascript" src="skillpoints.js"></script> <script type="text/javascript" src="/js/skillpoints.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>
<script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="/js/custom.js"></script>
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="build.js"></script> <script type="text/javascript" src="/js/build.js"></script>
<script type="text/javascript" src="builder.js"></script> <script type="text/javascript" src="/js/builder.js"></script>
</body> </body>
</html> </html>

View file

@ -52,20 +52,20 @@
</div> </div>
</div> </div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="powders.js"></script> <script type="text/javascript" src="/js/powders.js"></script>
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>
<script type="text/javascript" src="crafter.js"></script> <script type="text/javascript" src="/js/crafter.js"></script>
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="/js/craft.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="/js/custom.js"></script>
<script type="text/javascript" src="customizer.js"></script> <script type="text/javascript" src="/js/customizer.js"></script>
<script type="text/javascript" src = "item.js"></script> <script type="text/javascript" src="/js/item.js"></script>
</body> </body>
</html> </html>

View file

@ -122,15 +122,15 @@
<div class="center items" id="main"> <div class="center items" id="main">
</div> </div>
</div> </div>
<script type="text/javascript" src="/utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="/damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="/display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="/query.js"></script> <script type="text/javascript" src="/js/query.js"></script>
<script type="text/javascript" src="/load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="/items.js"></script> <script type="text/javascript" src="/js/items.js"></script>
</body> </body>
</html> </html>

View file

@ -59,16 +59,16 @@
</div> </div>
</div> </div>
<div id="scroll-up">&uparrow;</div> <div id="scroll-up">&uparrow;</div>
<script type="text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="display_constants.js"></script> <script type="text/javascript" src="/js/display_constants.js"></script>
<script type="text/javascript" src="display.js"></script> <script type="text/javascript" src="/js/display.js"></script>
<script type="text/javascript" src="query_2.js"></script> <script type="text/javascript" src="/js/query_2.js"></script>
<script type="text/javascript" src="expr_parser.js"></script> <script type="text/javascript" src="/js/expr_parser.js"></script>
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="items_2.js"></script> <script type="text/javascript" src="/js/items_2.js"></script>
</body> </body>
</html> </html>

View file

@ -72,7 +72,7 @@
</div> </div>
<div class="section"> <div class="section">
<h2>Is there a formal specification?</h2> <h2>Is there a formal specification?</h2>
<p>You can check out the <a class="link" href="https://github.com/wynnbuilder/wynnbuilder.github.io/blob/master/expr_parser.md" target="_blank" rel="noreferrer">implementation notes</a> for the expression parser, as well as the <a class="link" href="https://github.com/wynnbuilder/wynnbuilder.github.io/blob/master/expr_parser.js" target="_blank" rel="noreferrer">parser code itself</a>, over at the WynnBuilder GitHub repository. You can also ask around on the Atlas Inc. Discord server if you want more details.</p> <p>You can check out the <a class="link" href="https://github.com/wynnbuilder/wynnbuilder.github.io/blob/master/expr_parser.md" target="_blank" rel="noreferrer">implementation notes</a> for the expression parser, as well as the <a class="link" href="https://github.com/wynnbuilder/wynnbuilder.github.io/blob/master/js/expr_parser.js" target="_blank" rel="noreferrer">parser code itself</a>, over at the WynnBuilder GitHub repository. You can also ask around on the Atlas Inc. Discord server if you want more details.</p>
</div> </div>
<div class="section"> <div class="section">
<div class="footer">Written by <strong class="heart">Phanta</strong>, the same person who designed the advanced search system!</div> <div class="footer">Written by <strong class="heart">Phanta</strong>, the same person who designed the advanced search system!</div>
@ -208,7 +208,7 @@
docsFns.append(genDocEntry(entry[0], entry[1], null, entry[2])); docsFns.append(genDocEntry(entry[0], entry[1], null, entry[2]));
} }
</script> </script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
</body> </body>
</html> </html>

View file

View file

@ -136,6 +136,77 @@ function displayItems(items_copy) {
let items_expanded; let items_expanded;
// updates the current search state from the search query input boxes
function updateSearch() {
// compile query expressions, aborting if nothing has changed or either fails to compile
const changed = searchFilterField.compile() | searchSortField.compile();
if (!changed || searchFilterField.output === null || searchSortField.output === null) return;
// update url query string
const newUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}`
+ `?f=${encodeURIComponent(searchFilterField.value)}&s=${encodeURIComponent(searchSortField.value)}`;
window.history.pushState({ path: newUrl }, '', newUrl);
// hide old search results
itemListFooter.innerText = '';
for (const itemEntry of itemEntries) itemEntry.classList.remove('visible');
// index and sort search results
const searchResults = [];
try {
for (let i = 0; i < searchDb.length; i++) {
const item = searchDb[i][0], itemExp = searchDb[i][1];
if (checkBool(searchFilterField.output.resolve(item, itemExp))) {
searchResults.push({ item, itemExp, sortKeys: searchSortField.output.resolve(item, itemExp) });
}
}
} catch (e) {
searchFilterField.errorText.innerText = e.message;
return;
}
if (searchResults.length === 0) {
itemListFooter.innerText = 'No results!';
return;
}
try {
searchResults.sort((a, b) => {
try {
return compareLexico(a.item, a.sortKeys, b.item, b.sortKeys);
} catch (e) {
console.log(a.item, b.item);
throw e;
}
});
} catch (e) {
searchSortField.errorText.innerText = e.message;
return;
}
// display search results
const searchMax = Math.min(searchResults.length, ITEM_LIST_SIZE);
for (let i = 0; i < searchMax; i++) {
const result = searchResults[i];
itemEntries[i].classList.add('visible');
displayExpandedItem(result.itemExp, `item-entry-${i}`);
if (result.sortKeys.length > 0) {
const sortKeyListContainer = document.createElement('div');
sortKeyListContainer.classList.add('itemleft');
const sortKeyList = document.createElement('ul');
sortKeyList.classList.add('item-entry-sort-key', 'itemp', 'T0');
sortKeyListContainer.append(sortKeyList);
for (let j = 0; j < result.sortKeys.length; j++) {
const sortKeyElem = document.createElement('li');
sortKeyElem.innerText = stringify(result.sortKeys[j]);
sortKeyList.append(sortKeyElem);
}
itemEntries[i].append(sortKeyListContainer);
}
}
if (searchMax < searchResults.length) {
itemListFooter.innerText = `${searchResults.length - searchMax} more...`;
}
}
function doItemSearch() { function doItemSearch() {
window.scrollTo(0, 0); window.scrollTo(0, 0);
let queries = []; let queries = [];

View file

View file

@ -19,8 +19,7 @@
<img src = "/media/icons/new/custom.png" class = "left linkoptions headericon"> <img src = "/media/icons/new/custom.png" class = "left linkoptions headericon">
<div class = "tooltiptext center">WynnCustom</div> <div class = "tooltiptext center">WynnCustom</div>
</img> </img>
</a> </a> <a href = "./map.html" class = "nomarginp iconlink tooltip">
<a href = "./map.html" class = "nomarginp iconlink tooltip">
<img src = "/media/icons/new/compass.png" class = "left linkoptions headericon"> <img src = "/media/icons/new/compass.png" class = "left linkoptions headericon">
</img> </img>
<div class = "tooltiptext center">WynnGPS</div> <div class = "tooltiptext center">WynnGPS</div>
@ -100,4 +99,4 @@ function setHeaders() {
} }
setHeaders(); setHeaders();

View file

View file

@ -123,10 +123,10 @@
</div> </div>
<script type = "text/javascript" src="utils.js"></script> <script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="loadheader.js"></script> <script type="text/javascript" src="/js/loadheader.js"></script>
<script type="text/javascript" src="icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type = "text/javascript" src="load_map.js"></script> <script type="text/javascript" src="/js/load_map.js"></script>
<script type = "text/javascript" src="map.js"></script> <script type="text/javascript" src="/js/map.js"></script>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load diff