<commit_before>'use strict';

(function()
{
	var i,
	    link,
	    homepage = document.getElementById( 'steamdb_inventory_hook' ).dataset.homepage,
	    originalPopulateActions = window.PopulateActions;
	
	window.PopulateActions = function( elActions, rgActions, item )
	{
		var foundState = 0;
		
		try
		{
			if( item.appid == 753 )
			{
				if( item.type === 'Coupon' && rgActions )
				{
					var couponLink, pos;
					
					for( i = 0; i < rgActions.length; i++ )
					{
						link = rgActions[ i ];
						
						if( link.steamdb )
						{
							foundState = 2;
							
							break;
						}
						else if( link.link )
						{
							pos = link.link.indexOf( 'list_of_subs=' );
							
							if( pos > 0 )
							{
								couponLink = link.link;
								
								foundState = 1;
							}
						}
					}
					
					if( foundState === 1 )
					{
						var subs = couponLink.substring( pos + 'list_of_subs='.length ).split( ',' );
						
						for( i = 0; i < subs.length; i++ )
						{
							rgActions.push( {
								steamdb: true,
								link: homepage + 'sub/' + subs[ i ] + '/',
								name: 'View ' + subs[ i ] + ' on Steam Database'
							} );
						}
						
						foundState = 2;
					}
				}
				else if( rgActions )
				{
					for( i = 0; i < rgActions.length; i++ )
					{
						link = rgActions[ i ];
						
						if( link.steamdb )
						{
							foundState = 2;
							break;
						}
						else if( link.link && link.link.match( /\.com\/(app|sub)\// ) )
						{
							foundState = 1;
						}
					}
					
					if( foundState === 1 )
					{
						for( i = 0; i < rgActions.length; i++ )
						{
							link = rgActions[ i ].link;
							
							if( !link )
							{
								continue;
							}
							
							link = link.match( /\.com\/(app|sub)\/([0-9]{1,6})/ );
							
							if( link )
							{
								rgActions.push( {
									steamdb: true,
									link: homepage + link[ 1 ] + '/' + link[ 2 ] + '/',
									name: 'View on Steam Database'
								} );
								
								foundState = 2;
								
								break;
							}
						}
					}
				}
				else if( !item.actions && item.type === 'Gift' ) // This function gets called with owner_actions too
				{
					item.actions = rgActions = [ {
						steamdb: true,
						link: homepage + 'search/?a=sub&q=' + encodeURIComponent( item.name ),
						name: 'Search on Steam Database'
					} ];
					
					foundState = 2;
				}
				
				if( item.tags )
				{
					for( i = 0; i < item.tags.length; i++ )
					{
						link = item.tags[ i ];
						
						if( ( link.internal_name === 'cardborder_1' || link.internal_name === 'droprate_1' || link.internal_name === 'droprate_2' ) && link.name.substring( 0, 5 ) !== '<span' )
						{
							item.tags[ i ].name = '<span style="color:#f39c12">' + link.name + '</span>';
						}
					}
				}
			}
		}
		catch( e )
		{
			// Don't break website functionality if something fails above<commit_msg>Remove tag coloring as Valve no longer inserts tags as HTML<commit_after>'use strict';

(function()
{
	var i,
	    link,
	    homepage = document.getElementById( 'steamdb_inventory_hook' ).dataset.homepage,
	    originalPopulateActions = window.PopulateActions;
	
	window.PopulateActions = function( elActions, rgActions, item )
	{
		var foundState = 0;
		
		try
		{
			if( item.appid == 753 )
			{
				if( item.type === 'Coupon' && rgActions )
				{
					var couponLink, pos;
					
					for( i = 0; i < rgActions.length; i++ )
					{
						link = rgActions[ i ];
						
						if( link.steamdb )
						{
							foundState = 2;
							
							break;
						}
						else if( link.link )
						{
							pos = link.link.indexOf( 'list_of_subs=' );
							
							if( pos > 0 )
							{
								couponLink = link.link;
								
								foundState = 1;
							}
						}
					}
					
					if( foundState === 1 )
					{
						var subs = couponLink.substring( pos + 'list_of_subs='.length ).split( ',' );
						
						for( i = 0; i < subs.length; i++ )
						{
							rgActions.push( {
								steamdb: true,
								link: homepage + 'sub/' + subs[ i ] + '/',
								name: 'View ' + subs[ i ] + ' on Steam Database'
							} );
						}
						
						foundState = 2;
					}
				}
				else if( rgActions )
				{
					for( i = 0; i < rgActions.length; i++ )
					{
						link = rgActions[ i ];
						
						if( link.steamdb )
						{
							foundState = 2;
							break;
						}
						else if( link.link && link.link.match( /\.com\/(app|sub)\// ) )
						{
							foundState = 1;
						}
					}
					
					if( foundState === 1 )
					{
						for( i = 0; i < rgActions.length; i++ )
						{
							link = rgActions[ i ].link;
							
							if( !link )
							{
								continue;
							}
							
							link = link.match( /\.com\/(app|sub)\/([0-9]{1,6})/ );
							
							if( link )
							{
								rgActions.push( {
									steamdb: true,
									link: homepage + link[ 1 ] + '/' + link[ 2 ] + '/',
									name: 'View on Steam Database'
								} );
								
								foundState = 2;
								
								break;
							}
						}
					}
				}
				else if( !item.actions && item.type === 'Gift' ) // This function gets called with owner_actions too
				{
					item.actions = rgActions = [ {
						steamdb: true,
						link: homepage + 'search/?a=sub&q=' + encodeURIComponent( item.name ),
						name: 'Search on Steam Database'
					} ];
					
					foundState = 2;
				}
			}
		}
		catch( e )
		{
			// Don't break website functionality if something fails above
{'fraction_non_alphanumeric': 0.14694027116159766, 'fraction_numerical': 0.010626603151337486, 'mean_word_length': 1.416555998229305, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6532605', 'n_tokens_mistral': 3053, 'n_tokens_neox': 1819, 'n_words': 418}