X Pornteengirl - Better Alias List (with IA Help)

Reformat the Alias list with an space after each comma and correction for bad formatting of names (IA)

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         X Pornteengirl - Better Alias List (with IA Help)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Reformat the Alias list with an space after each comma and correction for bad formatting of names (IA)
// @author       Janvier57
// @icon         https://external-content.duckduckgo.com/ip3/www.pornteengirl.com.ico
// @match        https://www.pornteengirl.com/model/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var listeNoms = document.querySelector('.model-detail .model-detail-info span[aria-haspopup="true"][style="color:#506173;"] + .uk-dropdown');
    if (listeNoms) {
        var texte = listeNoms.textContent;
        var noms = texte.split(',');
        var nouvelleListe = noms.map(function(nom) {
            return nom.trim().replace(/(\w)\s+(\w)/g, '$1$2').replace(/([A-Z])/g, ' $1');
        }).join(', ');
        // Supprimer la virgule en début de liste si elle existe
        if (nouvelleListe.startsWith(',')) {
            nouvelleListe = nouvelleListe.substring(1);
        }
        // Supprimer l'espace en début de chaque nom si il existe
        nouvelleListe = nouvelleListe.replace(/^\s+/, '');
        listeNoms.textContent = nouvelleListe;
    }
})();