TUM eAccess Redirector

Automatically redirect to the proxified equivalent as provided by the libary of the Technische Universitaet Muenchen via the eAccess-System. TUM credentials required.

Versione datata 29/07/2016. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         TUM eAccess Redirector
// @name:de      TUM eAccess Redirector
// @version      0.2.1
// @description  Automatically redirect to the proxified equivalent as provided by the libary of the Technische Universitaet Muenchen via the eAccess-System. TUM credentials required.
// @description:de   Userscript, dass auf einigen Seiten, mit denen die Universitätsbiblothek der Technischen Universität München kooperiert, die eAccess-Version aufruft.
// @author       zsewa
// @namespace https://greatest.deepsurf.us/users/57483

// @match *://opac.ub.tum.de/InfoGuideClient.tumsis/*
// @match *://bvb-new-primo.hosted.exlibrisgroup.com/primo_library/libweb/action/search.do*vid=49BVB_TUM01_VU1*
// @match *://bvb-new-primo.hosted.exlibrisgroup.com/primo_library/libweb/action/dlSearch.do*vid=49BVB_TUM01_VU1*
// @match *://mediatum.ub.tum.de/*
// @match *://sfx.bib-bvb.de/*
// @match *://ezb.uni-regensburg.de/ezeit/*bibid=TUM*
// @match *://ezb.uni-regensburg.de/index.phtml*bibid=TUM*
// @match *://rzblx1.uni-regensburg.de/ezeit/ezb.phtml*bibid=TUM*
// @match *://rzblx10.uni-regensburg.de/dbinfo/*
// @match *://dbis.uni-regensburg.de/dbinfo/dbliste.php*bibid=TUM*

// @match *://science.sciencemag.org/*
// @match *://www.sciencedirect.com/*
// @match *://www.nature.com/*
// @match *://pubchem.ncbi.nlm.nih.gov/*

// @match *://*thieme-connect.de/*
// @match *://link.springer.com/*
// @match *://springer.com/*
// @match *://apps.webofknowledge.com/*
// @match *://www.emeraldinsight.com/*
// @match *://www.degruyter.com/*
// @match *://ieeexplore.ieee.org/*
// @match *://onlinelibrary.wiley.com/*
// @match *://www.worldscientific.com/*
// @match *://ebooks.worldscinet.com/*

// @match *://www.video2brain.com/*

// @grant			GM_setValue
// @grant			GM_getValue
// ==/UserScript==

/*
CHANGELOG
v 0.1: initial version
v 0.2: Modes added
*/

function set_usermode(value){
    GM_setValue('eAccess_reloader_mode', value);
}

(function() {
    'use strict';
    //modes:
    //0: Default, show redirect page
    //1: Confirmation, ask always before reload
    //2: Silent, redirect without showing html page
    set_usermode(0);
    var usemode = GM_getValue('eAccess_reloader_mode', 0);
    var html = '<center><img src="http://www.ub.tum.de/files/eacessbutton.jpg" height="40" width="40"></div><br><br>Resource is reloaded via TUM eAccess...<br><br>You are redirected form '+window.location.hostname+' to the fitting resource in the TUM eAccess system. Login may be required.<br><br>To change the behavior of this userscript open it in your Tapermonkey or Greasemonkey extention. You can specify a mode there.<br><br><br><br><br><br>Thanks for using TUM eAccess Redirector.</center>';
    switch(usemode) {
        case 1:
            //confirmation mode
            if (window.confirm("Redirect to TUM eAccess?")){document.write(html); void(location.href='https://eaccess.ub.tum.de/login?url='+location.href);}
            break;
        case 2:
            //silent mode
            void(location.href='https://eaccess.ub.tum.de/login?url='+location.href); //default way to reload via eacess
            break;
        default:
            //default mode
            document.write(html);
            var a = document.createElement('a');
            a.appendChild(document.createTextNode('Config 1'));
            a.href = '#';
            a.addEventListener('click', function(){GM_setValue('config',1);}, false);
            void(location.href='https://eaccess.ub.tum.de/login?url='+location.href); //default way to reload via eacess
    }
})();