Facebook clock
目前為
// ==UserScript==
// @name clock barra Facebook
// @namespace https://greasyfork.org/users/237458
// @description Facebook clock
// @include http://*.facebook.com/*
// @include https://*.facebook.com/*
// @author figuccio
// @version 0.6
// @grant GM_addStyle
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_registerMenuCommand
// ==/UserScript==
/*_2t-f originale _2s1y time spostato ha destra */
var blueBar = document.getElementsByClassName("_2s1y")[0];
var A = document.createElement("button");
A.title ='1click per salire in alto doppio click per post recenti';
var e ='background-color:green;color:red!important;border:1px solid yellow;font-size:16px;border-radius:12px;height:40px;margin-Top:0px;';
A.style.cssText = e;
blueBar.appendChild(A);
function clockTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
var milli = today.getMilliseconds()
var options = {'day':'2-digit','year':'numeric','month':'2-digit','weekday':'short'};
var date = new Date().toLocaleDateString('it-IT', options);
if (h < 10) h = "0" + h;
if (m < 10) m = "0" + m;
if (s < 10) s = "0" + s;
A.innerText = h + ":" + m + ":" + s+ ":" +milli+ " "+date;;
setTimeout(clockTime, 70);
}
clockTime();
//funzione torna il alto
A.addEventListener('click', function(){ window.scrollTo(0,0);});
//funzione ordina facebook recenti fare doppio click
A.addEventListener('dblclick', function(){ window.location.href = "https://www.facebook.com/?sk=h_chr";});
function myFunctionclock() {
if (A.style.display === 'none') {
A.style.display = 'block';
} else {
A.style.display = 'none';
}
}
GM_registerMenuCommand("mostra/nascondi",myFunctionclock);