Toggle Dlsite language

Switch between ecchi-eng and maniax in circle, and RJ and RE

Verze ze dne 15. 05. 2020. Zobrazit nejnovější verzi.

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

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 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        Toggle Dlsite language
// @namespace   zero.toogledlsitelan
// @description Switch between ecchi-eng and maniax in circle, and RJ and RE
// @include     *://www.dlsite.com/*
// @version     1.2
// @grant       none
// ==/UserScript==

var url = window.location.href;

if (url.includes("maniax") || url.includes("ecchi-eng")){
  var navlink = document.getElementsByClassName("eisysGroupHeaderAccount");
  
  navlink[0].innerHTML = " <li class='eisysGroupHeaderAccount-link'><a id='toggle' "
    + "class='eisysGroupRegist-link' style='font-weight:bold;text-decoration:underline' "
    + ">Toggle Site</a></li> " + navlink[0].innerHTML;
}

document.addEventListener("DOMContentLoaded", function(){
  var toggle = document.getElementById("toggle");

  if (url.includes("circle") && url.includes("maniax")){
    url = url.replace("maniax", "ecchi-eng");
    toggle.href = url;
  }else if (url.includes("circle") && url.includes("ecchi-eng")){
    url = url.replace("ecchi-eng", "maniax");
    toggle.href = url;
  }
  
  if (url.includes("product_id") && url.includes("RJ")){
    url = url.replace("RJ", "RE");
    toggle.href = url;
  }else if (url.includes("product_id") && url.includes("RE")){
    url = url.replace("RE", "RJ");
    toggle.href = url;
  }
});