HFR form

Affiche un formulaire de réponse standardisé dans le champ réponse d'HFR

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         HFR form
// @namespace    HFR_form
// @include      https://forum.hardware.fr/message.php*
// @version      0.1
// @description  Affiche un formulaire de réponse standardisé dans le champ réponse d'HFR
// @grant         GM.xmlHttpRequest
// ==/UserScript==


if (document.URL.indexOf("post=110935") !== -1)
{

    var addFormButton = document.createElement('input');
    addFormButton.setAttribute('type', 'button');
    addFormButton.setAttribute('id', 'fuckYeah');
    addFormButton.setAttribute('value', 'Poster un rapport de make');

    var postButton = document.getElementById('addCommentMessage');
    postButton.parentNode.insertBefore(addFormButton, postButton);

    document.getElementById ("fuckYeah").addEventListener (
        "click", postShit, false
    );
}

function postShit()
{
    var tab = document.getElementById('pseudoform');
    var pseudo = tab.children[1].children[0].value;

    GM.xmlHttpRequest({
        method: "GET",
        url: "https://raw.githubusercontent.com/Niks4925/hfr-forms/master/make",
        onload: function(response) {
            var newContent = response.responseText.replace("$pseudo$", pseudo);
            var content = document.getElementById("content_form").value = newContent;
        }
    });


}