Youtube Timelord

Adds a text input and button so you can set the time on youtube videos easy

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Youtube Timelord
// @namespace    nulledroot
// @version      0.1
// @description  Adds a text input and button so you can set the time on youtube videos easy
// @author       Nulled Root
// @include http://www.youtube.com/*
// @include https://www.youtube.com/*
// @grant        none
// @downloadURL
// ==/UserScript==


(function() {
    'use strict';
    var onclickvalue = "timeValues = document.getElementById(\"yt-timelord\").value.split(\":\"); secondsValue = parseInt(timeValues[0])*60 + parseInt(timeValues[1]); newurl = document.URL.replace(/(&t=[0-9]*s)/g, '') + \"&t=\"+ secondsValue + \"s\"; window.location.href = newurl"
    var div = document.createElement("div")
    var input = document.createElement("input")
    var button = document.createElement("button")
    var id = document.createAttribute("id")
    var onClick = document.createAttribute("onclick")
    var size = document.createAttribute("size")
    var placeholder = document.createAttribute("placeholder")
    var dStyle = document.createAttribute("style")
    var iStyle = document.createAttribute("style")
    var bStyle = document.createAttribute("style")

    onClick.value = onclickvalue
    placeholder.value = "00:00"
    id.value = "yt-timelord"
    size.value = "4"
    iStyle.value = "background-color: hsla(0, 0%, 100%, .15); color:lightgray; border-color:transparent;"
    bStyle.value = "background-color: hsla(0, 0%, 100%, .08); color:lightgray; border-color:transparent;"
    dStyle.value = "float: right;"
    input.setAttributeNode(iStyle)
    input.setAttributeNode(placeholder)
    input.setAttributeNode(id)
    input.setAttributeNode(size)
    button.setAttributeNode(bStyle)
    button.setAttributeNode(onClick)
    button.innerHTML = 'Set Time';
    div.setAttributeNode(dStyle)
    div.appendChild(input)
    div.appendChild(button)
    document.getElementById('info').appendChild(div)
})();