diff --git a/enhancedsteam.js b/enhancedsteam.js index 08d2b5d4..ca3cbb40 100644 --- a/enhancedsteam.js +++ b/enhancedsteam.js @@ -8590,6 +8590,49 @@ function market_popular_refresh_toggle() { } } + + +function add_token_buttons() { + + $(".content").find(".btnv6_blue_hoverfade").first().after(` Revoke All Invites`); + + runInPageContext(` + function() { + CreateInvite = function() { + $J( '#invite_throbber' ).show(); + $J.ajax({ + url: 'https://steamcommunity.com/invites/ajaxcreate', + type: 'POST', + data: { + sessionid: g_sessionID, + steamid_user: g_steamID + } + }).fail(function (jqxhr) { + $J( '#invite_throbber' ).hide(); + }).done(function (data) { + $J( '#invite_throbber' ).hide(); + if ( data.success == 1 ) { + $J( '#invite_throbber' ).hide(); + AppendInvite( data.invite, '#invite_container' ); + g_rgTokens.push(data.invite); + } + }); + }; + }`); + + $("#es-removeTokens").on('click', function () { + runInPageContext(` + function(){ + for (i = 0; i < g_rgTokens.length; i++){ + if (g_rgTokens[i].valid) { RevokeToken(g_rgTokens[i].invite_token); } + } + }`); + }); + +} + + + $(document).ready(function(){ var path = window.location.pathname.replace(/\/+/g, "/"); @@ -8842,6 +8885,7 @@ $(document).ready(function(){ case /^\/(?:id|profiles)\/.+\/friends(?:[/#?]|$)/.test(path): add_friends_sort(); + add_token_buttons(); break; case /^\/(?:id|profiles)\/.+\/tradeoffers/.test(path):