diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5fdd0..3ad2ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -279,4 +279,8 @@ ## [2.2.0] - 2023-12-25 ### Added - Halloween 2023 effects. -- Smissmas 2023 effects. \ No newline at end of file +- Smissmas 2023 effects. + +## [2.2.1] - 2024-05-26 +### Fixed +- A potential issue where items display the wrong item. \ No newline at end of file diff --git a/package.json b/package.json index 6db742c..69adea7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "steam-trade-offer-enhancer", - "version": "2.2.0", + "version": "2.2.1", "description": "Fork of [Steam Trade Offer Enhancer by scholtzm](https://github.com/scholtzm/steam-trade-offer-enhancer) with extra features and performance enhancements. This userscript has many features useful for Team Fortress 2 trading.", "main": "steam.trade.offer.enhancer.user.js", "dependencies": { diff --git a/src/js/steamcommunity.com.profiles.tradeoffers.js b/src/js/steamcommunity.com.profiles.tradeoffers.js index a3a3483..bef3cfe 100644 --- a/src/js/steamcommunity.com.profiles.tradeoffers.js +++ b/src/js/steamcommunity.com.profiles.tradeoffers.js @@ -79,18 +79,7 @@ function({ $, VERSION, WINDOW, addAttributesToHoverItems }) { Array.from(itemsList).forEach((itemsEl) => { const itemsArr = Array.from(itemsEl.getElementsByClassName('trade_item')); const getClassInfo = (itemEl) => { - const classinfo = itemEl.getAttribute('data-economy-item'); - // I believe item classes always remain static - const translateClass = { - 'classinfo/440/339892/11040578': 'classinfo/440/101785959/11040578', - 'classinfo/440/339892/11040559': 'classinfo/440/101785959/11040578', - 'classinfo/440/107348667/11040578': 'classinfo/440/101785959/11040578' - }; - - return ( - translateClass[classinfo] || - classinfo - ); + return itemEl.getAttribute('data-economy-item'); }; // has multiples of the same item const hasMultipleSameItems = Boolean(function() { diff --git a/src/meta.js b/src/meta.js index 631acac..cdd9466 100644 --- a/src/meta.js +++ b/src/meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Steam Trade Offer Enhancer // @description Browser script to enhance Steam trade offers. -// @version 2.2.0 +// @version 2.2.1 // @author Julia // @namespace http://steamcommunity.com/profiles/76561198080179568/ // @updateURL https://github.com/juliarose/steam-trade-offer-enhancer/raw/master/steam.trade.offer.enhancer.meta.js diff --git a/steam.trade.offer.enhancer.meta.js b/steam.trade.offer.enhancer.meta.js index f549009..6e39857 100755 --- a/steam.trade.offer.enhancer.meta.js +++ b/steam.trade.offer.enhancer.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Steam Trade Offer Enhancer // @description Browser script to enhance Steam trade offers. -// @version 2.2.0 +// @version 2.2.1 // @author Julia // @namespace http://steamcommunity.com/profiles/76561198080179568/ // @updateURL https://github.com/juliarose/steam-trade-offer-enhancer/raw/master/steam.trade.offer.enhancer.meta.js diff --git a/steam.trade.offer.enhancer.user.js b/steam.trade.offer.enhancer.user.js index cbf1ed2..e7c2005 100644 --- a/steam.trade.offer.enhancer.user.js +++ b/steam.trade.offer.enhancer.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Steam Trade Offer Enhancer // @description Browser script to enhance Steam trade offers. -// @version 2.2.0 +// @version 2.2.1 // @author Julia // @namespace http://steamcommunity.com/profiles/76561198080179568/ // @updateURL https://github.com/juliarose/steam-trade-offer-enhancer/raw/master/steam.trade.offer.enhancer.meta.js @@ -1075,18 +1075,7 @@ Array.from(itemsList).forEach((itemsEl) => { const itemsArr = Array.from(itemsEl.getElementsByClassName('trade_item')); const getClassInfo = (itemEl) => { - const classinfo = itemEl.getAttribute('data-economy-item'); - // I believe item classes always remain static - const translateClass = { - 'classinfo/440/339892/11040578': 'classinfo/440/101785959/11040578', - 'classinfo/440/339892/11040559': 'classinfo/440/101785959/11040578', - 'classinfo/440/107348667/11040578': 'classinfo/440/101785959/11040578' - }; - - return ( - translateClass[classinfo] || - classinfo - ); + return itemEl.getAttribute('data-economy-item'); }; // has multiples of the same item const hasMultipleSameItems = Boolean(function() { @@ -2447,7 +2436,12 @@ // perform actions // add elements to page (function() { - const controlsHTML = ` + const $tradeBox = page.$tradeBoxContents; + // clearfix to add after inventories to fix height bug in firefox + const $clear = $('
'); + + // add summary and control HTML to the trade box + $tradeBox.append(`