Dieses Script ermöglicht die Löschung von Mangas und Animes direkt aus dem UCP heraus
目前為
// ==UserScript==
// @name Proxer-Delete-Tool
// @namespace
// @version 1.0
// @description Dieses Script ermöglicht die Löschung von Mangas und Animes direkt aus dem UCP heraus
// @author Dominik Bissinger alias Nihongasuki
// @include http://proxer.me/*
// @include https://proxer.me/*
// @include http://www.proxer.me/*
// @include https://www.proxer.me/*
// @run-at document-start
// ==/UserScript==
//Starte die Funktion "addAnker" beim Laden der Seite
var location;
document.addEventListener('DOMContentLoaded', function(event) {
location = window.location.href;
$(document).ajaxComplete (function () {
if (location === window.location.href) {
return;
};
location = window.location.href;
addButtons();
});
addButtons();
});
var addButtons = function () {
var checkTrue = false;
if (window.location.href.indexOf('anime') > -1 || window.location.href.indexOf('manga') > -1) {
checkTrue = true;
};
if (window.location.href.indexOf('ucp') === -1 || checkTrue === false || window.location.href.indexOf('forum') > -1) {
return;
};
var table = document.getElementById("box-table-a").parentNode.getElementsByTagName("table");
for (var i = 0; i < 4; i++) {
for (var j = 2; j < table[i].rows.length; j++) {
var trId = table[i].rows[j].id;
var id = trId.match(/\d+/);
var parent = document.getElementById(trId).lastChild;
var a = document.createElement("a");
a.setAttribute("href","javascript:;");
a.setAttribute("id","delete"+id);
a.setAttribute("onclick","return false;");
parent.appendChild(a);
var aSet = document.getElementById('delete'+id);
aSet.innerHTML = "[Löschen]"
aSet.addEventListener("click",function (event) {
var x = this.id.match(/\d+/);
iFrameFunction(x);
});
};
};
};
var lasttop;
var iFrameFunction = function (id) {
var iframes = document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
iframes[i].parentNode.removeChild(iframes[i]);
};
var iF = document.createElement('iframe');
iF.style.display = 'none';
iF.src = 'http://proxer.me/comment?id=' +id+ '&s=edit#top';
iF.onload = function() { deleteEntry(); };
iF.id = "iFrame";
lasttop = $(window).scrollTop();
document.body.appendChild(iF);
};
var deleteEntry = function () {
$(window).scrollTop(lasttop);
var iframe = document.getElementById('iFrame');
var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
var button = innerDoc.getElementsByClassName('delete');
button[0].click();
};