Janitor AI - Automatic Message Formatting Corrector (Drag & Drop button)

Draggable button with visual feedback! Remembers its position, adapts to screen size, and can't be dragged off-screen. Formats narration/dialogues.

< Σχολιασμός για τον κώδικα Janitor AI - Automatic Message Formatting Corrector (Drag & Drop button)

Αναφορά: Καλός - ο κώδικας λειτουργεί

MWH
§
Δημοσιεύτηκε: 12/10/2025

Script works perfectly! No problems whatsoever! But I noticed that you have two scripts for mobile and PC, and the only difference between the two is the styling. Use @media for it so you don't have to maintain two scripts.

At the bottom is my snippet of CSS. It's mobile first, since I use janitorAI mostly on my phone. I also attached two screenshots of mobile and the desktop sizes.

My rationale for the mobile button style: Personal preference, mostly.

I moved the button that the middle left since, there are a lot of empty space on the left side, space taken by the bot avatars. On the right, it will conflict with the other buttons and I fat finger it, lol.

  // --- STYLES ---
  GM_addStyle(`
    /* Mobile styles (default) */
    #janitor-editor-buttons button {
      position: fixed; z-index: 9999;
      width: 40px; height: 40px;
      color: white; border: none;
      border-radius: 0 50% 50% 0;
      font-size: 16px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
      cursor: pointer; transition: all 0.2s ease;
    }

    #formatterTrigger {
      left: 0%; bottom: 50%;
      background-color: #c9226e;
      transform: translateY(50%);
    }

    /* Desktop styles */
    @media (min-width: 800px) {
      #janitor-editor-buttons button {
        width: 50px; height: 50px;
        border-radius: 50%; font-size: 24px;
      }

      #formatterTrigger {
        /* 42rem is the width of the message textbox */
        left: calc(50% + (42rem / 2) + 5px);
        bottom: 15%; transform: none;
      }
    }
  `);
MWH
§
Δημοσιεύτηκε: 12/10/2025

I also tweaked your script so I can edit past messages to match the formatting: https://gist.github.com/rp-coderer/b8782ce06b6d0eed2e2a5e7a6923ca19

Basically, if I "edit" a message by clicking on the pencil and triggering your script, it will prioritize it.

Code is shotty, but it works (in my machine, at least)

accforfacietΔημιουργός
§
Δημοσιεύτηκε: 13/10/2025

Thank you for your feedback!

I modified the code and now it's one universal script! Also I added a feature to Drag & Drop the button.

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.