BreizhGaming / Smileys Firefox

// ==UserScript==
// @name         Smileys Firefox
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  35 Smileys supplémentaires, rien que pour vous !
// @author       BreizhGaming, un grand merci à TheMent0r pour avoir entièrement retravaillé mon script !
// @match        https://community.funcraft.net/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==
 
var smileys = [
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471537291-bag.png", "title": "Honte"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474665-decu.png", "title": "décu"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454410-wtf.png", "title": "WTF"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474665-dodo.png", "title": "dodo"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-siffle.png", "title": "siffle"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-non.png", "title": "Contre"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-oui.png", "title": "Pour !"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474665-mesquin.png", "title": "Machiavélique"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454410-woot.png", "title": "Très content"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454409-sorry.png", "title": "Désolé"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454407-happy.png", "title": "Joyeux"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454406-dead.png", "title": "Mort"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471537291-breizhgaming.png", "title": "BreizhGaming"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471453542-angelic.png", "title": "Ange"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454991-wacky.png", "title": "Dingo"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454409-sour.png", "title": "Grincheux"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454405-bawling.png", "title": "Pleure"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471453542-artist.png", "title": "Artiste"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454991-hungry.png", "title": "Miam"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454409-smug.png", "title": "Fier"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454408-shifty.png", "title": "Tu te fous de moi"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-soupcon.png", "title": "suspicieux"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454763-hilarious.png", "title": "Mort de rire"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-mort-de-rire-3.png", "title": "Mort de rire 3"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471453542-arghh.png", "title": "Argh"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454410-walkingdead.png", "title": "Apeuré"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454408-playful.png", "title": "Content 3"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474665-amoureux.png", "title": "amoureux"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454407-joyful.png", "title": "Content"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454405-bored.png", "title": "Hein ?"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454406-depressed.png", "title": "Malade"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474665-malade.png", "title": "Malade 3"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454407-hungover.png", "title": "Malade 2"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471453542-android.png", "title": "Android"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471454410-wideyed.png", "title": "Etonné"},
    {"url": "http://image.noelshack.com/fichiers/2016/33/1471474666-mort-de-rire-2.png", "title": "mort de rire 2"}
];
 
function wait_for_list(ms){
    setTimeout(function(){
        if($(".smilieContainer ul").length > 0) load_smileys();
        else wait_for_list();
    }, 1000)
}
 
function load_smileys(){
    var list = $(".smilieContainer ul");
    for(i in smileys){
        var smiley = smileys[i];
        list.append('<li class="Smilie" data-text=""><img src="' + smiley["url"] + '" title="' + smiley["title"] + '"></li>');
    }
}
function main(){
    $(".redactor_btn_smilies").one("click", wait_for_list);
}
         
 
 
window.addEventListener("load", main);