Skip to content

Instantly share code, notes, and snippets.

@korden32
Created August 19, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korden32/4ede0e72d970f18919e6 to your computer and use it in GitHub Desktop.
Save korden32/4ede0e72d970f18919e6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Steam account history advanced view
// @version 0.0.1
// @author KorDen
// @grant none
// @include https://store.steampowered.com/account/history/*
// ==/UserScript==
( function() {
if($J('.wallet_table_row').length > 0) {
updateHistory();
setInterval (updateHistory, 3000);
}
$J('.wallet_history_table').before('Filter: \
<a class="btn_small btn_grey_grey" onclick="$J(\'.wallet_table_row\').show()"><span>Reset</span></a>\
<a class="btn_small btn_grey_grey" onclick="changeFilter(\'wPurchase\')"><span>Purchases</span></a>\
<a class="btn_small btn_grey_grey" onclick="changeFilter(\'wGift\')"><span>Gifts</span></a>\
<a class="btn_small btn_grey_grey" onclick="changeFilter(\'wMarket\')"><span>Market:</span></a>\
<a class="btn_small btn_grey_grey" onclick="changeFilter(\'wMarket=\\\'+\\\'\')"><span>+</span></a>\
<a class="btn_small btn_grey_grey" onclick="changeFilter(\'wMarket=\\\'-\\\'\')"><span>-</span></a>\
<br><br>');
})();
function updateHistory() {
$J('.wallet_table_row[onclick]:not([done])').each(function () {
var row = $J(this);
if(row.attr('onclick').indexOf("steamcommunity.com/market/#myhistory") > -1) {
row.css('background-color', '#113311')
if(row.find('.wht_wallet_change').html().indexOf('+') > -1) {
row.find('.wallet_column, .wht_total').css('background-color', '#115511')
row.attr('wMarket','+');
} else{
row.find('.wallet_column, .wht_total').css('background-color', '#331111')
row.attr('wMarket','-');
}
} else if(row.find('.wht_type').html().indexOf('Purchase') > -1) {
if(row.find('.wht_type').html().indexOf('Gift Purchase') > -1) {
row.css('background-color', '#113333')
row.attr('wGift','1');
} else {
row.css('background-color', '#111133')
row.attr('wPurchase','1');
}
}
row.attr('done','1');
});
}
contentEval ( function changeFilter(type) {
$J('.wallet_table_row[' + type + ']').show()
$J('.wallet_table_row:not([' + type + '])').hide();
} );
function contentEval(source) {
var script = document.createElement('script');
script.setAttribute("type", "application/javascript");
script.textContent = source;
document.body.appendChild(script);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment