Text-to-Image

Re-enable Text-to-Image in GameFAQs signatures

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Text-to-Image
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Re-enable Text-to-Image in GameFAQs signatures
// @author       Brock Adams with SUPER MINOR edits by -l_____________l-
// @match        https://gamefaqs.gamespot.com/boards/*
// @grant        none
// ==/UserScript==

// most of this is from https://stackoverflow.com/questions/18709491/use-greasemonkey-to-change-text-to-images-on-a-static-site lol


(function() {
    'use strict';
    var $ = window.$;
    var imageExtensions = ["gif", "png", "jpg", "bmp"];
    var imgExtRegex = new RegExp(
    '\\.(' + imageExtensions.join('|') + ')$', 'i'
    );
   // console.log(imgExtRegex);

     //-- This jQuery selector is custom for each new site...
     var imgLinks = $(".sig_text > a");
    // console.log(imgLinks);


    //-- Also custom for the site...
    var urlBase = "";

    //-- Remove non-image links.
    var finalLinks = imgLinks.filter(function () {
    // console.log(imgExtRegex.test(this.textContent));
    return imgExtRegex.test(this.textContent);
    });

    finalLinks.each(function () {
        var jThis = $(this); // This is one of the links
        var filename = $.trim(jThis.text());
     //   console.log(filename);

    //-- Rreplace link content with image:
    jThis.html(
        '<img src="' + urlBase + filename + '" height="200" />'
    );
    });

    }
)();