Improve YouTube Transcript for Language learning

Improved YouTube Transcript for Language learning, click transcript to hide the element below the video.

2016-09-16 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Improve YouTube Transcript for Language learning
// @namespace    http://tampermonkey.net/
// @version      1.6
// @description  Improved YouTube Transcript for Language learning, click transcript to hide the element below the video.
// @author       AVES
// @require      https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// @require  https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @include      http*://*.youtube.com/*
// @include      http*://youtube.com/*
// @run-at       document-end
// ==/UserScript==
waitForKeyElements ("#eow-description", add);
function add(){
        if(document.getElementsByClassName("yt-ui-menu-item has-icon yt-uix-menu-close-on-select action-panel-trigger action-panel-trigger-transcript").length===0){return;}
        var $bar = document.getElementById("watch8-secondary-actions");
        var $newButton= document.createElement('div');
        $newButton.className="yt-uix-menu ";
        var $transcriptButton=document.createElement("button");
        $transcriptButton.className="yt-ui-menu-item has-icon yt-uix-menu-close-on-select action-panel-trigger action-panel-trigger-transcript";
        var $label=document.createElement("span");
        $label.className="yt-ui-menu-item-label";
        var $textTranscript = document.createTextNode("Transcript");
        $bar.appendChild($newButton);
        $newButton.appendChild($transcriptButton);
        $transcriptButton.appendChild($label);
        $label.appendChild($textTranscript);
        $transcriptButton.setAttribute("data-trigger-for","action-panel-transcript");

        var $windowTranscript=document.getElementById("watch-actions-transcript");
        var $h2Transcript= document.getElementsByClassName("yt-card-title");
        var $title=document.getElementById("watch-header");
        $transcriptButton.onclick=function(){
            $title.style.display="none";
            var sheet = document.createElement("STYLE");
            var t = document.createTextNode(".caption-line-time { display: none; }.caption-line-text { width: 100%; }");
            sheet.appendChild(t);
            document.head.appendChild(sheet);
            $h2Transcript[0].style.float="right";
            $h2Transcript[0].style.padding="0 10px";
            var $close= document.getElementById("action-panel-dismiss");



            setTimeout(function(){$close.onclick=function(){$title.style.display="block";};},10);



        };
    }