CDT

Script CDT pour Instant-Hack.io

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        CDT
// @namespace   CDT
// @include     https://instant-hack.io/threads/*
// @include     https://instant-hack.io/conversations/*
// @version     1.0
// @description Script CDT pour Instant-Hack.io
// @grant       none
// ==/UserScript==
// Kiru

$(document).ready(function(){
    var d = new Date();
    var heure = d.getHours();

    $('#QuickReply').find('.submitUnit').children('input').eq(1).after('<input class="button primary" id="cdtjs" value="Cordialement" accesskey="c" type="button">');
    var rl = '<br/>\n';

    var signature = "";
    if (heure >= 0 && heure < 5) {
        signature = 'Bonne fin de nuit,' + rl + '<i>{username}</i>';
    }
    else if (heure >= 5 && heure < 12) {
        signature = 'Bonne journée,' + rl + '<i>{username}</i>';
    }
    else if (heure >= 12 && heure < 15) {
        signature = 'Bonne après-midi,' + rl + '<i>{username}</i>';
    }
    else if (heure >= 15 && heure < 18) {
        signature = 'Bonne fin d\'après-midi,' + rl + '<i>{username}</i>';
    }
    else if (heure >= 18 && heure < 21) {
        signature = 'Bonne soirée,' + rl + '<i>{username}</i>';
    }
    else if (heure >= 21 && heure < 24) {
        signature = 'Bonne fin de soirée,' + rl + '<i>{username}</i>';
    }
    else {
        signature = 'A bientôt !' + rl + '<i>{username}</i>';
    }

    $('#cdtjs').on('click', function(){
        var actual_txt = $('iframe.redactor_textCtrl').contents().find('body').html();
        var username = $('.accountUsername').text();
        $('iframe.redactor_textCtrl').contents().find('body').html(actual_txt + rl + signature.replace('{username}', username));
        $('iframe.redactor_textCtrl').contents().find('body').select();
        $('iframe.redactor_textCtrl').contents().find('body').focus();
    });
});