Back to old layout

Revert "Revert "Revert "💪 Support new layout"""

This reverts commit eba9c3bdac.
This commit is contained in:
Dan Jones 2017-10-23 07:15:33 -05:00
commit 1ac07bcb58

View file

@ -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.7 // @version 1.7.1
// @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==
@ -16,12 +16,12 @@ var getSmallUrl = function(fullUrl) {
}; };
var hideOne = function(el) { var hideOne = function(el) {
$(el).parents('.giveawayItemContainer').css('display', checked ? 'none' : 'block'); $(el).parents('div.a-spacing-base').css('display', checked ? 'none' : 'block');
}; };
var hideVisited = function(evt) { var hideVisited = function(evt) {
checked = $(this).prop('checked'); checked = $(this).prop('checked');
var $links = $('#giveaway-grid a[href*="amazon.com/ga"]'); var $links = $('.landingPageSpacings a[href*="amazon.com/ga"]');
var hide = regex_hide ? new RegExp(regex_hide, 'i') : null; var hide = regex_hide ? new RegExp(regex_hide, 'i') : null;
@ -39,7 +39,7 @@ var hideVisited = function(evt) {
}; };
$(document).ready(function() { $(document).ready(function() {
$('#giveaway-grid').on('click', 'a[href*="amazon.com/ga"]', function(evt) { $('.landingPageSpacings').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";
@ -48,9 +48,9 @@ $(document).ready(function() {
regex_hide = localStorage.getItem('regex_hide') || ''; regex_hide = localStorage.getItem('regex_hide') || '';
$('#giveaway-result-info-bar-content') $('h1:contains("Giveaways")')
.append('<label><input type="checkbox" id="hide_visited"/> Visited</label>') .after('<label><input type="checkbox" id="hide_visited"/> Visited</label>')
.append(`<input id="hide_regex" value="${regex_hide}"/>`); .after(`<input id="hide_regex" value="${regex_hide}"/>`);
$('#hide_visited').on('click', hideVisited); $('#hide_visited').on('click', hideVisited);
$('#hide_regex').on('change', function() { $('#hide_regex').on('change', function() {