Proxer Remember

Schnellauswahl für das letzte Medium

As of 2017-01-07. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Proxer Remember
// @namespace    https://greasyfork.org/de/users/83349-deimos
// @version      0.2
// @description  Schnellauswahl für das letzte Medium
// @author       Deimos
// @include      http://proxer.me/*
// @include      https://proxer.me/*
// @include      http://www.proxer.me/*
// @include      https://www.proxer.me/*        
// @grant        none
// ==/UserScript==

var ul = document.getElementById("leftNav");
var li = document.createElement("li");
li.setAttribute("class","topmenu");
li.setAttribute("id","RememberNav");
li.addEventListener("mouseover",  open);
ul.appendChild(li);
document.getElementById("RememberNav").innerHTML = '<a href="javascript:;">Lesezeichen ▾</a><ul id="RememberUl"></ul>';
addElement("A:","RememberA");
addElement("M:","RememberM" );

function addElement(name,id)
{
    var ul = document.getElementById("RememberUl");
    var element = document.createElement("li");
    element.setAttribute("id",id);
    element.innerHTML = '<a href="javascript:;">'+name+'</a>';
    ul.appendChild(element);
}

function open()
{
    document.getElementById("RememberNav").removeEventListener("mouseover",  open);
    
    if(window.location.origin.includes("https"))
       var url = "https://proxer.me/ucp?s=history&p=1#top";
    else
       var url = "http://proxer.me/ucp?s=history&p=1#top";

    if (window.XMLHttpRequest) // AJAX nutzen mit IE7+, Chrome, Firefox, Safari, Opera
        xmlhttp=new XMLHttpRequest();
    else // AJAX mit IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            if(xmlhttp.responseText[0] == "<")
            {
                find("Animeserie");
                find("Mangaserie");
            }    
        }   
    };
    
    xmlhttp.open("GET",url);
    xmlhttp.send();
}

function find(typ)
{
    var doc = xmlhttp.responseText;
    doc = doc.slice(doc.indexOf(typ)-90);
    var name = doc.slice(doc.indexOf(">")+1,doc.indexOf("<"));

    doc = doc.slice(doc.indexOf("<td>")+4);
    var episode = doc.slice(0,doc.indexOf("</td>"));

    var href = doc.slice(doc.indexOf("<a")+9);
    href = href.slice(0,href.indexOf('"'));

    var member_name = typ[0]+": "+ name+" Ep. "+episode;

    document.getElementById("Remember"+typ[0]).innerHTML = '<a href='+href+'>'+member_name+'</a>';
}