From 4d7686eccd9e63c03b75f13621875b47451f962e Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Thu, 26 Oct 2017 07:12:01 -0500 Subject: [PATCH] Back to new layout, again Revert "amaz-giveaway: Get title on old layout" This reverts commit ab8566ebd95952f69836d07ec4e8a96e47acb817. Revert "Back to old layout" This reverts commit 1ac07bcb58461aa5ac77758d6f87948ea06d3d99. --- amaz.giveaway.user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/amaz.giveaway.user.js b/amaz.giveaway.user.js index 13be54a..7c7f319 100644 --- a/amaz.giveaway.user.js +++ b/amaz.giveaway.user.js @@ -4,7 +4,7 @@ // @description Allow removal of visited links on Amazon Giveaway Listing // @include https://smile.amazon.com/ga/giveaways* // @include https://www.amazon.com/ga/giveaways* -// @version 1.7.2 +// @version 1.7.3 // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js // ==/UserScript== @@ -16,12 +16,12 @@ var getSmallUrl = function(fullUrl) { }; 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) { checked = $(this).prop('checked'); - var $links = $('.landingPageSpacings a[href*="amazon.com/ga"]'); + var $links = $('#giveaway-grid a[href*="amazon.com/ga"]'); var hide = regex_hide ? new RegExp(regex_hide, 'i') : null; @@ -31,7 +31,7 @@ var hideVisited = function(evt) { hideOne(this); } - var title= $(this).parent('.a-row').siblings('.ellipsis-1-line').text(); + var title = $(this).find('.giveawayPrizeNameContainer').text(); if (hide && title && hide.test(title)) { hideOne(this); } @@ -39,7 +39,7 @@ var hideVisited = function(evt) { }; $(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')); localStorage[href] = "visited"; @@ -48,9 +48,9 @@ $(document).ready(function() { regex_hide = localStorage.getItem('regex_hide') || ''; - $('h1:contains("Giveaways")') - .after('') - .after(``); + $('#giveaway-result-info-bar-content') + .append('') + .append(``); $('#hide_visited').on('click', hideVisited); $('#hide_regex').on('change', function() {