Delete Friend Link *OLD*

Adds a "delete friend" link on their profiles

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          Delete Friend Link *OLD*
// @namespace     ventero.de
// @description   Adds a "delete friend" link on their profiles
// @include       http://www.kongregate.com/accounts/*
// @author        Ventero
// @version       1.0
// @date          03/21/2010
// @License       Public domain
// ==/UserScript==

// Written by Ventero (http://www.kongregate.com/accounts/Ventero) 06/22/10
// Licensed under MIT/X11 license
// Copyright (c) 2010 Ventero
// Full text of license here:
// http://www.opensource.org/licenses/mit-license.php

if(document.getElementById('add_as_friend')){
	var k = document.getElementById('add_as_friend').firstChild;

	if (k.innerHTML.match(/is a friend/)){
		var z = document.getElementById('relationship_links'),
				l = document.createElement('li'),
				a = document.createElement('a');
		a.setAttribute('onclick', "if (confirm('Really remove this friend?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);f.submit(); };return false;");
		a.setAttribute('href', k.href+"/"+location.pathname.split("/")[2]);
		a.innerHTML = 'delete friend';
		l.appendChild(a)
		z.appendChild(l);
	}
}