Amazon - Hide delivered items from open orders

Hides all delivered items from your open orders.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Amazon - Hide delivered items from open orders
// @description  Hides all delivered items from your open orders.
// @author       Daku ([email protected])
// @namespace    https://github.com/DakuTree/userscripts
// @homepage     https://github.com/DakuTree/userscripts
// @homepageURL  https://github.com/DakuTree/userscripts
// @supportURL   https://github.com/DakuTree/userscripts/issues
// @icon         https://www.amazon.co.uk/favicon.ico
// @match        https://www.amazon.co.uk/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.co.jp/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.com/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.es/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.de/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.it/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.fr/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.ca/gp/*/order-history/*orderFilter=open*
// @match        https://www.amazon.cn/gp/*/order-history/*orderFilter=open*
// @version      1.0.2

// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js
// ==/UserScript==


// (?:co(?:m|\.(?:uk|jp))|es|de|it|fr|ca|cn)
'use strict';

//Hide delivered items.
$(/* Delivered items */'.shipment-is-delivered').add(
	$(/* Dispatched items */'.a-color-success:contains(Dispatched)').parents('.shipment')
).add(
	$(/* Irregular delivered items, but not marked as such */'.shipment:not(:has(.shipment-top-row))')
).hide();

//Generate link to show hidden items.
$('#controlsContainer').after(
	$('<div/>', {style: 'text-align: center'}).append(
		$('<a/>', {id: 'show-hidden', href: '#', text: 'Click to show delivered items'})
	)
);
$('body').on('click', 'a#show-hidden', function() {
	$('.shipment-is-delivered').add($('.a-color-success:contains(Dispatched)').parents('.shipment')).show();
	$(this).hide();
});