Delete Friend Link *OLD*

Adds a "delete friend" link on their profiles

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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);
	}
}