youtuberepeat

Youtube Repeat Tool

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        youtuberepeat
// @namespace   qqboxy
// @description Youtube Repeat Tool
// @match     http://www.youtube.com/*
// @match     https://www.youtube.com/*
// @version     2.3.3
// ==/UserScript==
(function () {
    window.onload = function() {
        var BUTTON_TEXT = {
            'zh-TW':'重複播放',
            'en' : 'Repeat'
        };
        var BUTTON_TOOLTIP = {
            'zh-TW':'自動重複播放此影片',
            'en' : 'Repeat videos automatically'
        };
        var url = "http://youtuberepeat.blogspot.com/?" + location.href;
        var language = document.documentElement.getAttribute('lang');
        var buttonText = (BUTTON_TEXT[language])?BUTTON_TEXT[language]:BUTTON_TEXT['en'];
        var buttonTootip = (BUTTON_TOOLTIP[language])?BUTTON_TOOLTIP[language]:BUTTON_TOOLTIP['en'];
        //document.getElementById("top-level-buttons").innerHTML += "<span><a href=\""+url+"\"><button class=\"yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-tooltip\" data-tooltip-text=\""+buttonTootip+"\" title=\""+buttonTootip+"\"><span class=\"yt-uix-button-content\">↺ "+buttonText+"</span></button></a></span>";
        var span = document.createElement("span");
        span.innerHTML = "<a href=\""+url+"\"><button title=\""+buttonTootip+"\"><span>↺ "+buttonText+"</span></button></a>";
        document.getElementById("count").appendChild(span);
    };
})();