Skip to content

Commit b67921a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
2 parents dccd653 + de13b24 commit b67921a

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
.tt-show-fill-max [class*="rowWrapper__"] [class*="available__"] {
2-
align-items: flex-start;
3-
padding-top: 5px;
4-
}
5-
6-
.tt-show-fill-max [class*="rowWrapper__"] [class*="available__"]::after {
7-
content: "Fill Max";
8-
position: absolute;
9-
top: 20px;
10-
color: var(--tt-color-green);
11-
cursor: pointer;
12-
width: calc(100px - 2 * 7px);
13-
text-align: right;
14-
}
15-
16-
body:not(.tt-mobile):not(.tt-tablet) .tt-show-fill-max [class*="rowWrapper__"] [class*="available__"]:hover::after {
17-
color: #fff;
18-
background-color: var(--tt-color-green);
19-
}
1+
.tt-show-fill-max [class*="rowWrapper__"] [class*="available__"] {
2+
align-items: flex-start;
3+
padding-top: 5px;
4+
}
5+
6+
.tt-show-fill-max [class*="rowWrapper__"] [class*="available__"]::after {
7+
content: "Fill Max";
8+
position: absolute;
9+
top: 20px;
10+
color: var(--tt-color-green);
11+
cursor: pointer;
12+
width: calc(100px - 2 * 7px);
13+
text-align: right;
14+
}
15+
16+
body:not(.tt-mobile):not(.tt-tablet) .tt-show-fill-max [class*="rowWrapper__"] [class*="available__"]:hover::after {
17+
color: #fff;
18+
background-color: var(--tt-color-green);
19+
}
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
"use strict";
2-
3-
(async () => {
4-
const { mobile, tablet } = await checkDevice();
5-
6-
const feature = featureManager.registerFeature(
7-
"Item Market Fill Max",
8-
"item market",
9-
() => settings.pages.itemmarket.fillMax,
10-
addListener,
11-
addButton,
12-
removeButton,
13-
{ storage: ["settings.pages.itemmarket.fillMax"] },
14-
() => {
15-
if (!hasAPIData()) return "No API access.";
16-
}
17-
);
18-
19-
function addListener() {
20-
document.addEventListener("click", (event) => {
21-
if (!event.target.matches("[class*='rowWrapper__'] [class*='available__']")) return;
22-
23-
if (!feature.enabled()) return;
24-
25-
const listing = event.target.closest("li");
26-
// The purchase amount input is not visible in mobiles and tablets until
27-
// the Buy icon is clicked. Hence exit early.
28-
if ((mobile || tablet) && !listing.children[0].matches("[class*='sellerRow__'][class*='expanded__']")) return;
29-
30-
const quantityAvailable = listing.find("[class*='available__']").textContent.getNumber();
31-
const moneyOnHand = document.find("#user-money").dataset.money.getNumber();
32-
const itemPrice = listing.find("[class*='price__']").textContent.getNumber();
33-
const purchasableQuantity = Math.min(quantityAvailable, Math.floor(moneyOnHand / itemPrice));
34-
35-
const quantityInput = listing.find(".input-money-group input:not([type])");
36-
updateReactInput(quantityInput, purchasableQuantity);
37-
});
38-
}
39-
40-
async function addButton() {
41-
const itemMarketRoot = await requireElement("#item-market-root");
42-
43-
itemMarketRoot.classList.add("tt-show-fill-max");
44-
}
45-
46-
function removeButton() {
47-
document.findAll(".tt-show-fill-max").forEach((x) => x.classList.remove("tt-show-fill-max"));
48-
}
49-
})();
1+
"use strict";
2+
3+
(async () => {
4+
const { mobile, tablet } = await checkDevice();
5+
6+
const feature = featureManager.registerFeature(
7+
"Item Market Fill Max",
8+
"item market",
9+
() => settings.pages.itemmarket.fillMax,
10+
addListener,
11+
addButton,
12+
removeButton,
13+
{ storage: ["settings.pages.itemmarket.fillMax"] },
14+
() => {
15+
if (!hasAPIData()) return "No API access.";
16+
}
17+
);
18+
19+
function addListener() {
20+
document.addEventListener("click", (event) => {
21+
if (!event.target.matches("[class*='rowWrapper__'] [class*='available__']")) return;
22+
23+
if (!feature.enabled()) return;
24+
25+
const listing = event.target.closest("li");
26+
// The purchase amount input is not visible in mobiles and tablets until
27+
// the Buy icon is clicked. Hence exit early.
28+
if ((mobile || tablet) && !listing.children[0].matches("[class*='sellerRow__'][class*='expanded__']")) return;
29+
30+
const quantityAvailable = listing.find("[class*='available__']").textContent.getNumber();
31+
const moneyOnHand = document.find("#user-money").dataset.money.getNumber();
32+
const itemPrice = listing.find("[class*='price__']").textContent.getNumber();
33+
const purchasableQuantity = Math.min(quantityAvailable, Math.floor(moneyOnHand / itemPrice));
34+
35+
const quantityInput = listing.find(".input-money-group input:not([type])");
36+
updateReactInput(quantityInput, purchasableQuantity);
37+
});
38+
}
39+
40+
async function addButton() {
41+
const itemMarketRoot = await requireElement("#item-market-root");
42+
43+
itemMarketRoot.classList.add("tt-show-fill-max");
44+
}
45+
46+
function removeButton() {
47+
document.findAll(".tt-show-fill-max").forEach((x) => x.classList.remove("tt-show-fill-max"));
48+
}
49+
})();

0 commit comments

Comments
 (0)