Lutendo Amazon Links

Add Amazon product links to offers

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Lutendo Amazon Links
// @namespace   https://greasyfork.org/de/users/456963-kobi-wan
// @author      kobi-wan
// @description Add Amazon product links to offers
// @include     *://app.lutendo.com/offers*
// @include     *://app.lutendo.com/dashboard*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
// @require     https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// @run-at      document-idle
// @version     1
// @grant       none
// ==/UserScript==

function addAmazonLink (jNode)
{
	// console.log (jNode.html());
	if (jNode.html().search('btn-success')==-1)
	{
		var campaignId = jNode.attr('id').substr(5);
		var aTag = document.createElement('a');
		var iTag = document.createElement('i');
		iTag.setAttribute('class', 'fa fa-amazon');
		aTag.setAttribute('href', '/amz/?m=&campaign=' + campaignId);
		aTag.setAttribute('class', 'btn btn-success');
		aTag.setAttribute('target', '_blank');
		aTag.setAttribute('title', 'Bei Amazon aufrufen');
		// aTag.innerText = 'Amz';
		aTag.appendChild(iTag);
		jNode.prepend(aTag);
	}
}

waitForKeyElements('.btn-group', addAmazonLink);