Sergey Schmidt - Labels YT

Hides instuctions, chooses off topic.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Sergey Schmidt - Labels YT
// @namespace    http://kadauchi.com/
// @version      1.4.1
// @description  Hides instuctions, chooses off topic.
// @author       Kadauchi
// @icon         http://kadauchi.com/avatar.jpg
// @include      https://s3.amazonaws.com/*
// @grant        GM_log
// @require      https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==

$(function(){
    var hitcheck = $("a[class='jumper'][data-target='#desc-off-topic']");
    if (hitcheck.length){ 
        console.log("Hit Check for [Sergey Schmidt - Labels YT]: Success!!!");

        $("#instructions").before('<button id="toggle" type="button"><span>Show Instructions</span></button>');
        $("#toggle").click(function() {
            $("#instructions, #sample-task, #delete-history").toggle();
            $("#toggle").text() == "Show Instructions" ? str = "Hide Instructions" : str = "Show Instructions";
            $("#toggle span").html(str);
        });  

        $("#instructions, #sample-task, #delete-history").hide();
        $("input[value='OFF_TOPIC']").click();
        $("input[value='OFF_TOPIC']:visible").eq(0).focus();

        $(window).on("beforeunload", function(){
            var topics = $("input[value='OFF_TOPIC']:visible").length;
            var checked = $("input:radio:checked:visible").length;
            if (checked !== topics){
                return "You are missing a checked radio.";
            }
        });
    }
    else {
        console.log("Hit Check for [Sergey Schmidt - Labels YT]: Fail!!!");
    }
});