Revert "Revert "💪 Support new layout""
This reverts commit 5352f0bb2f.
Back to new design, again
	
	
This commit is contained in:
		
					parent
					
						
							
								7239c6cad6
							
						
					
				
			
			
				commit
				
					
						eba9c3bdac
					
				
			
		
					 1 changed files with 5 additions and 5 deletions
				
			
		|  | @ -4,7 +4,7 @@ | ||||||
| // @description Allow removal of visited links on Amazon Giveaway Listing
 | // @description Allow removal of visited links on Amazon Giveaway Listing
 | ||||||
| // @include https://smile.amazon.com/ga/giveaways*
 | // @include https://smile.amazon.com/ga/giveaways*
 | ||||||
| // @include https://www.amazon.com/ga/giveaways*
 | // @include https://www.amazon.com/ga/giveaways*
 | ||||||
| // @version 1.6
 | // @version 1.6.5
 | ||||||
| // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
 | // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
 | ||||||
| // ==/UserScript==
 | // ==/UserScript==
 | ||||||
| 
 | 
 | ||||||
|  | @ -15,12 +15,12 @@ var getSmallUrl = function(fullUrl) { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| var hideOne = function(el) { | var hideOne = function(el) { | ||||||
|   $(el).parents('div.a-spacing-base').css('display', checked ? 'none' : 'block'); |   $(el).parents('.giveawayItemContainer').css('display', checked ? 'none' : 'block'); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| var hideVisited = function(evt) { | var hideVisited = function(evt) { | ||||||
|   checked = $(this).prop('checked'); |   checked = $(this).prop('checked'); | ||||||
|   var $links = $('.landingPageSpacings a[href*="amazon.com/ga"]'); |   var $links = $('#giveaway-grid a[href*="amazon.com/ga"]'); | ||||||
| 
 | 
 | ||||||
|   $links.each(function() { |   $links.each(function() { | ||||||
|     var href = getSmallUrl($(this).attr('href')); |     var href = getSmallUrl($(this).attr('href')); | ||||||
|  | @ -31,13 +31,13 @@ var hideVisited = function(evt) { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| $(document).ready(function() { | $(document).ready(function() { | ||||||
|   $('.landingPageSpacings').on('click', 'a[href*="amazon.com/ga"]', function(evt) { |   $('#giveaway-grid').on('click', 'a[href*="amazon.com/ga"]', function(evt) { | ||||||
| 
 | 
 | ||||||
|     var href = getSmallUrl($(this).attr('href')); |     var href = getSmallUrl($(this).attr('href')); | ||||||
|     localStorage[href] = "visited"; |     localStorage[href] = "visited"; | ||||||
|     hideOne(this); |     hideOne(this); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   $('h1:contains("Giveaways")').after('<label><input type="checkbox" id="hide_visited"/> Visited</label>'); |   $('#giveaway-result-info-bar-content').append('<label><input type="checkbox" id="hide_visited"/> Visited</label>'); | ||||||
|   $('#hide_visited').on('click', hideVisited); |   $('#hide_visited').on('click', hideVisited); | ||||||
| }); | }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue