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)

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Pornteengirl - Better Alias List (with IA Help)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @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;
    }
})();