linkToDub

Add Links to Dub Projects

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         linkToDub
// @namespace    https://shikimori.one
// @version      0.2
// @description  Add Links to Dub Projects
// @author       grin3671
// @match        https://shikimori.one/*
// @match        https://shikimori.org/*
// @grant        none
// ==/UserScript==

'use strict';

var links = {
  'Crunchyroll': 'https://www.crunchyroll.com/ru',
  'YakuSub Studio': 'https://vk.com/yakusub_studio',
  'Японская Таверна': 'https://vk.com/nippontavern',
  'Akari GROUP': 'https://akari-anime.com/',
  'Amazing Dubbing': 'https://vk.com/amazing_dubbing',
  'AniDUB': 'https://vk.com/anidub',
  'AniFilm': 'https://anifilm.tv/',
  'AniLibria': 'https://www.anilibria.tv/',
  'AniMaunt': 'https://animaunt.tv/',
  'AniMedia': 'https://online.animedia.tv/',
  'AnimeVost': 'http://animevost.club/',
  'AniStar': 'https://anistar2.org/',
  'AniPlay': 'https://aniplay.tv/',
  'Anything Group': 'https://a-g.site/',
  'New Dawn Studio': 'https://vk.com/club181824650',
  'Onibaku Group': 'https://vk.com/onibaku_group',
  'Risens Team': 'https://risens.team/',
  'SEKAI PROJECT': 'https://vk.com/sekaiproject',
  'SovetRomantica': 'https://sovetromantica.com/',
  'SHIZA Project': 'http://shiza-project.com/',
  'Wakanim': 'https://www.wakanim.tv/ru/v2',
  'XDUB DORAMA': 'https://vk.com/xdubdorama',
  'youmiteru': 'https://youmiteru.ru/',
}

function createLink (link, text) {
  var l = document.createElement('a'),
      t = document.createTextNode(text);
  l.href= link;
  l.appendChild(t);
  return l;
}

function linkToDub () {
  var menuLines = document.querySelectorAll('.b-menu-line');

  for (var i = 0; i < menuLines.length; i++) {
    var title = menuLines[i].title;
    if (links.hasOwnProperty(title)) {
      menuLines[i].innerHTML = '';
      menuLines[i].appendChild(createLink(links[title], title));
    }
  }
}

function ready (f) {
  document.addEventListener('page:load', f);
  document.addEventListener('turbolinks:load', f);

  if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
    f();
  } else {
    document.addEventListener('DOMContentLoaded', f);
  }
}

ready(linkToDub);