atcoder_all_open

問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい

Versione datata 08/05/2021. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo 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     atcoder_all_open
// @namespace jp.misw
// @author hotman
// @description 問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい
// @version  1.0.7
// @include  https://atcoder.jp/contests/*
// @exclude  https://atcoder.jp/contests/
// @exclude  https://atcoder.jp/contests/archive
// @grant    none
// @description 問題Tabの隣に全ての問題を(ワンクリックで)開く全ての問題Tabを作成します。うまく動かない場合はatcoder上でのポップアップ制限を外して下さい
// ==/UserScript==
 
 
function toURL(){
    var url=location.href;
    var test_name=location.href.split('/')[4];
    if(url.match(/atcoder.jp\/contests\/..*\/tasks/) != null ) {
        var cnt=document.getElementsByClassName("table table-bordered table-striped")[0].children[1].childElementCount;
        for(var i=0;i<cnt;i++){
            window.open('https://atcoder.jp/contests/'+test_name+'/tasks/'+test_name+'_'+String.fromCharCode('a'.charCodeAt(0)+i));
        }
    }else{
        window.open('https://atcoder.jp/contests/'+test_name+'/tasks\/?all_open=yes');
    }
}
 
 
function all_open(){
    var url=location.href;
    console.log(url);
    if(url.match(/all_open=yes/) != null ){
        toURL();
        window.open('about:blank','_self').close();
    }else{
        var parent=document.getElementsByClassName("nav nav-tabs")[0];
        var add=document.createElement("li");
        parent.insertBefore(add,parent.children[2]);
        var a=document.createElement("a");
        add.appendChild(a);
        a.textContent="全ての問題";
        a.setAttribute("href","javascript:void(0);");
        a.addEventListener('click',toURL, false);
    }
}
all_open();