Fix advanced searcher functionality (#205)
* Fix advanced searcher functionality some visual tuneup may be in order * Refactor `items_2` to `items_adv` Co-authored-by: hppeng <hppeng>
This commit is contained in:
parent
874b8b1746
commit
0c3ad58966
4 changed files with 14 additions and 6 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../css/sq2bs.css">
|
<link rel="stylesheet" href="../css/sq2bs.css">
|
||||||
<link rel="stylesheet" href="../css/items_2.css">
|
<link rel="stylesheet" href="../css/items_adv.css">
|
||||||
<link rel="stylesheet" href="../css/sidebar.css">
|
<link rel="stylesheet" href="../css/sidebar.css">
|
||||||
<link rel="stylesheet" href="../css/wynnstyles.css">
|
<link rel="stylesheet" href="../css/wynnstyles.css">
|
||||||
</head>
|
</head>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
<a href="../credits.txt" class="link">Additional credits</a>
|
<a href="../credits.txt" class="link">Additional credits</a>
|
||||||
</div>
|
</div>
|
||||||
<div class = "col text-center" id = "help">
|
<div class = "col text-center" id = "help">
|
||||||
<a href="items_2_help.html" class="link" target="_blank">Search Guide</a>
|
<a href="items_adv_help.html" class="link" target="_blank">Search Guide</a>
|
||||||
</div>
|
</div>
|
||||||
<div class = "col text-end">
|
<div class = "col text-end">
|
||||||
<a href = "../items/">Basic Item Search</a>
|
<a href = "../items/">Basic Item Search</a>
|
||||||
|
@ -77,12 +77,13 @@
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/build_utils.js"></script>
|
<script type="text/javascript" src="/js/build_utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/icons.js"></script>
|
<script type="text/javascript" src="/js/icons.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/powders.js"></script>
|
||||||
<script type="text/javascript" src="/js/damage_calc.js"></script>
|
<script type="text/javascript" src="/js/damage_calc.js"></script>
|
||||||
<script type="text/javascript" src="/js/display_constants.js"></script>
|
<script type="text/javascript" src="/js/display_constants.js"></script>
|
||||||
<script type="text/javascript" src="/js/display.js"></script>
|
<script type="text/javascript" src="/js/display.js"></script>
|
||||||
<script type="text/javascript" src="/js/query.js"></script>
|
<script type="text/javascript" src="/js/query.js"></script>
|
||||||
<script type="text/javascript" src="/js/expr_parser.js"></script>
|
<script type="text/javascript" src="/js/expr_parser.js"></script>
|
||||||
<script type="text/javascript" src="/js/load.js"></script>
|
<script type="text/javascript" src="/js/load.js"></script>
|
||||||
<script type="text/javascript" src="/js/items_2.js"></script>
|
<script type="text/javascript" src="/js/items_adv.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -234,7 +234,7 @@ function stringify(v) {
|
||||||
return typeof v === 'number' ? (Math.round(v * 100) / 100).toString() : v;
|
return typeof v === 'number' ? (Math.round(v * 100) / 100).toString() : v;
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_items2() {
|
function init_items_adv() {
|
||||||
const itemList = document.getElementById('item-list');
|
const itemList = document.getElementById('item-list');
|
||||||
const itemListFooter = document.getElementById('item-list-footer');
|
const itemListFooter = document.getElementById('item-list-footer');
|
||||||
|
|
||||||
|
@ -328,7 +328,11 @@ function init_items2() {
|
||||||
for (let i = 0; i < searchMax; i++) {
|
for (let i = 0; i < searchMax; i++) {
|
||||||
const result = searchResults[i];
|
const result = searchResults[i];
|
||||||
itemEntries[i].classList.add('visible');
|
itemEntries[i].classList.add('visible');
|
||||||
displaysq2ExpandedItem(result.itemExp, `item-entry-${i}`);
|
result.itemExp.set("powders", []);
|
||||||
|
if (result.itemExp.get("category") == "weapon") {
|
||||||
|
apply_weapon_powders(result.itemExp);
|
||||||
|
}
|
||||||
|
displayExpandedItem(result.itemExp, `item-entry-${i}`);
|
||||||
if (result.sortKeys.length > 0) {
|
if (result.sortKeys.length > 0) {
|
||||||
const sortKeyListContainer = document.createElement('div');
|
const sortKeyListContainer = document.createElement('div');
|
||||||
sortKeyListContainer.classList.add('row');
|
sortKeyListContainer.classList.add('row');
|
||||||
|
@ -391,4 +395,7 @@ function init_items2() {
|
||||||
.addEventListener('mousedown', e => scrollTo({ top: 0, behavior: 'smooth' }));
|
.addEventListener('mousedown', e => scrollTo({ top: 0, behavior: 'smooth' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
load_init(init_items2);
|
(async function() {
|
||||||
|
await Promise.resolve(load_init());
|
||||||
|
init_items_adv();
|
||||||
|
})();
|
Loading…
Reference in a new issue