DestinyLFG.com refresher

Refreshes the DestinyLFG.com list automatically

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

You will need to install an extension such as Tampermonkey to install this 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       DestinyLFG.com refresher
// @version    0.1
// @description  Refreshes the DestinyLFG.com list automatically
// @match      http://www.destinylfg.com
// @copyright  2014+, You
// @namespace https://greasyfork.org/users/2353
// ==/UserScript==

var d = document;
function main () {
    var t=10000, f = function () {
        if(!$(".modal-dialog").is(":visible") && $(".AutoRefresh").is(":checked")){
            $(".refreshTime").text(tf())
        	$("#refresh").click();
        }
        setTimeout(f, t);
    }, tf = function (){
        var d = new Date(), h = d.getHours(), m = String(d.getMinutes()), s = String(d.getSeconds()),
        	st = (h > 12 ? h - 12 : h) + ":" + (m.length == 1 ? "0" + m : m) + ":" + (s.length == 1 ? "0" + s : s) + " " + (h > 12 ? "pm" : "am");
        return st;
    }
    
    $(".panel-body>.row:first-child").clone().empty()
    	.append("<span style='padding-left:15px'><input type='checkbox' class='AutoRefresh' checked='true'/> Auto Refresh (Last refresh: <span class='refreshTime'>"+tf()+"</span>)</span>")
    	.insertAfter(".panel-body>.row:nth-child(2)");
    
    setTimeout(f, t);
}

var s = d.createElement("script");
s.appendChild(d.createTextNode('('+main+')()'));
(d.head || d.body || d.documentElement).appendChild(s);