Skip to content

Commit 9682318

Browse files
authored
Merge pull request #200 from csfloat/feature/tradeoffer-id-annotate
Shows Trade Offer ID In Trades Page
2 parents 9eb6847 + 5608bc2 commit 9682318

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"matches": ["*://*.steamcommunity.com/tradeoffer/*"],
3333
"js": ["src/lib/page_scripts/trade_offer.js"],
3434
"css": ["src/global.css"]
35+
},
36+
{
37+
"matches": ["*://*.steamcommunity.com/*/tradeoffers/*"],
38+
"js": ["src/lib/page_scripts/trade_offers.js"],
39+
"css": ["src/global.css"]
3540
}
3641
],
3742
"background": {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import {html} from 'lit';
2+
3+
import {CustomElement, InjectBefore, InjectionMode} from '../injectors';
4+
import {FloatElement} from '../custom';
5+
import '../common/ui/steam-button';
6+
import {cache} from 'decorator-cache-getter';
7+
8+
@CustomElement()
9+
@InjectBefore('.tradeoffer .tradeoffer_items_ctn', InjectionMode.CONTINUOUS)
10+
export class ShowTradeOfferId extends FloatElement {
11+
@cache
12+
get tradeOfferID(): string {
13+
const rawId = $J(this).parent().attr('id');
14+
if (!rawId) {
15+
return '';
16+
}
17+
18+
return rawId.replace('tradeofferid_', '');
19+
}
20+
21+
async connectedCallback() {
22+
super.connectedCallback();
23+
}
24+
25+
render() {
26+
return html` <span>Trade Offer ID: ${this.tradeOfferID}</span>`;
27+
}
28+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {init} from './utils';
2+
import '../components/trade_offers/offer_id';
3+
4+
init('src/lib/page_scripts/trade_offers.js', main);
5+
6+
function main() {}

0 commit comments

Comments
 (0)