Marktplaats Exchanger

Exchange Marktplaats.nl

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name             Marktplaats Exchanger
// @id               Marktplaats_Exchanger@https://github.com/jerone/UserScripts
// @namespace        https://github.com/jerone/UserScripts
// @description      Exchange Marktplaats.nl
// @author           jerone
// @copyright        2015+, jerone (https://github.com/jerone)
// @license          CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
// @license          GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @homepage         https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger#readme
// @homepageURL      https://github.com/jerone/UserScripts/tree/master/Marktplaats_Exchanger#readme
// @supportURL       https://github.com/jerone/UserScripts/issues
// @contributionURL  https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW
// @version          1.0.1
// @grant            none
// @run-at           document-end
// @include          https://www.marktplaats.*
// ==/UserScript==

// cSpell:ignore Roboto

(function Marktplaats_Exchanger() {
	var selectAll = document.getElementById("select-all-container");
	if (!selectAll) {
		return;
	}

	var button = document.createElement("div");
	button.setAttribute("title", "Selecteer alle verkochte advertenties");
	button.style.background = "#F7F7F6";
	button.style.border = "1px solid #A1A1A1";
	button.style.cssFloat = "left";
	button.style.cursor = "default";
	button.style.height = "30px";
	button.style.marginRight = "5px";
	button.style.padding = "0 8px";
	button.style.fontFamily = "Roboto";
	selectAll.parentNode.insertBefore(button, selectAll.nextSibling);

	var selectInput = document.createElement("input");
	selectInput.setAttribute("type", "checkbox");
	selectInput.addEventListener("change", function selectInputChange() {
		var checked = selectInput.checked;
		Array.prototype.forEach.call(
			document.querySelectorAll(".ad-listing"),
			function (row) {
				var isRemoved = row.classList.contains("removed");
				var checkbox = row.querySelector("input.kopen-select");
				if (checkbox.checked !== (checked && isRemoved)) {
					checkbox.click();
				}
			},
		);
	});
	button.appendChild(selectInput);

	button.appendChild(document.createTextNode(" Verkocht"));
})();