KittyCatS Enter Interceptor for Naming

Intercepts [Enter] keypress on the KittyCatS name field to submit

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         KittyCatS Enter Interceptor for Naming
// @namespace    es.jessjon.kittycats.nameenter
// @version      1.1.20251205
// @description  Intercepts [Enter] keypress on the KittyCatS name field to submit
// @author       Jessica Jones
// @match        https://kittycats.ws/online/*
// @match        https://kittycats.ws/pedigree/*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kittycats.ws
// @grant        GM_info
// @license      MIT
// ==/UserScript==

/* global $ */
var version = GM_info.script.version;

$(document).ready(function() {
    $('body').on('keydown', '#text_name', function (e) {
        const enter = /enter/i; // regex used to match NumpadEnter and other "Enter" keys
        if (enter.test(e.code)) {
            new_name();
            return false;
        }
    });
});