Edenya-Script

Addon Edenya

目前為 2017-03-09 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Edenya-Script
// @namespace    http://tampermonkey.net/
// @version      0.100008
// @description  Addon Edenya
// @author       Valkazaar
// @match        http://www.edenya.net/_vahal/*
// @grant        none
// @include        http://www.edenya.net/_vahal/*
// @include        https://www.edenya.net/_vahal/*
// ==/UserScript==

(function() {
    'use strict';
    var z = localStorage.getItem('EdenyaColor');
    if (z === null){
        var zz = {'cadre2':'#dda0dd'};
        zz['ligneA'] = '#000000';
        zz['dialogue'] = '#ffffff';
        zz['narration'] = '#ffd700';
        zz['cri'] = '#9acd32';
        zz['hj'] = '#FFDAB9';
        z = localStorage.setItem('EdenyaColor',JSON.stringify(zz));
        z = localStorage.getItem('EdenyaColor');
    }
    z = JSON.parse(z);
    for (var item in z){
         var x = document.getElementsByClassName(item);
        for (var j = 0; j < x.length; j++){
            x[j].style.color = z[item];
        }
    }
    var x = document.getElementsByTagName("font");
    for (var i = 0;i < x.length;i++)
    {
        if(x[i].getAttribute('color')!= null)
           {
           x[i].setAttribute('color',(x[i].getAttribute('color')).replace('#000000','#B09070'));
           x[i].setAttribute('color',(x[i].getAttribute('color')).replace('\\"',''));
           x[i].setAttribute('color',(x[i].getAttribute('color')).replace('\\"',''));
           }
    }
    var x = document.querySelector(".menu");
    if (x != null){
        var y = document.createElement("div");
        var z = localStorage.getItem('EdenyaShortcut');
        if (z === null){
            var zz = {'accueil':'https://www.edenya.net/_vahal/'};
            z = localStorage.setItem('EdenyaShortcut',JSON.stringify(zz));
            z = localStorage.getItem('EdenyaShortcut');
        }
        var zzz= document.createElement("p");
        var zzzz = document.createElement("span");
        
        zzzz.innerHTML = "<a href='#'> Ajouter </a>";
        zzzz.setAttribute("onclick", "var nom=prompt('Nom du shortcut ?');z = localStorage.getItem('EdenyaShortcut');z = JSON.parse(z);z[nom]=document.URL;localStorage.setItem('EdenyaShortcut',JSON.stringify(z));location.href = location.href;");
        zzz.innerText = "Raccourcis : ";
        zzz.appendChild(zzzz);
        y.appendChild(zzz);
        z = JSON.parse(z);
        for(var item in z){
            var zzzz =document.createElement("img");
            zzzz.setAttribute('src','../images/bad.gif');
            zzzz.setAttribute('onclick','z = localStorage.getItem("EdenyaShortcut");z = JSON.parse(z);delete z["'+ item +'"];localStorage.setItem("EdenyaShortcut",JSON.stringify(z));location.href = location.href;');
            var zzz= document.createElement("span");
            zzz.setAttribute('style','display:block;');
            var zz = document.createElement("a");
            zz.setAttribute('href',z[item]);
            zz.innerText = item + " ";
            zzz.appendChild(zz);
            zzz.appendChild(zzzz);
            y.appendChild(zzz);    
        }
        y.className = "cadre";
        y.style = "width:200";
        x.appendChild(y);
        var z = document.createElement("p");
        z.innerText = "Couleurs utilisées :";
        y.appendChild(z);
        var zz = localStorage.getItem('EdenyaColor');
        zz = JSON.parse(zz);
        for (var item in zz){
            var z= document.createElement("input");
            z.setAttribute("id",item);
            z.setAttribute("type", "color");
            z.setAttribute("class", "bouton");
            z.setAttribute("value",zz[item]);
            z.setAttribute("style","width:25");
            z.setAttribute("onChange","z = localStorage.getItem('EdenyaColor');z = JSON.parse(z);z['"+z.getAttribute("id")+"'] = document.getElementById('"+z.getAttribute("id")+"').value; localStorage.setItem('EdenyaColor',JSON.stringify(z));location.href = location.href;");
            y.appendChild(z);
            }
    }
        
})();