Flashii Chat Userscripts
#16752
it would have actually been more useful to have a shortcut for it, but the terminal to bbcode thing is just a sidebar button. the chatbox button i have is [P], for Pomf, because it's what i used to use before szyup before eeprom
#17506

i am here once again with a usage survey

Does anyone use the umi:message_add event in general, or the message field of the umi:ui:message_add event at all?

If so, can you modify it to just use the element field of umi:ui:message_add instead? (please do not use the dataset fields and expect them to exist in the future, they are subject to change)

If not, what data from the message object are you using?

https://sig.flash.moe/signature.png
#17955
i dont know if there's a better way to do this, but ui for deleting message


// ==UserScript==
// @name         Flashii Delete Message Button
// @namespace    http://no.com
// @version      1.3
// @description  Adds a delete button to each of your own message in Flashii Chat
// @author       no
// @match        *://chat.flashii.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Ensures chat is loaded
    window.addEventListener('umi:connect', function(ev) {

        // Function to add delete button to your own messages
        function addDeleteButtons() {
            const userId = Umi.User.getCurrentUser().id;
            const messages = document.querySelectorAll('.message');

            messages.forEach(message => {
                const messageId = message.getAttribute('data-id');
                const messageAuthor = message.getAttribute('data-author');
                const messageBody = message.getAttribute('data-body');

                // Exclude messages containing join and leave phrases, and with the class message-tiny
                const excludedPhrases = ["has disconnected", "has joined"];
                const containsExcludedPhrase = excludedPhrases.some(phrase => messageBody.includes(phrase));
                const isTinyMessage = message.classList.contains('message-tiny');

                if ((messageAuthor === userId && !containsExcludedPhrase && !message.querySelector('.delete-button')) ||
                    (isTinyMessage && messageAuthor === userId && !containsExcludedPhrase && !message.querySelector('.delete-button'))) {
                    const deleteButton = document.createElement('button');
                    deleteButton.innerHTML = '×'; // Cross symbol
                    deleteButton.className = 'delete-button';
                    deleteButton.style.position = 'absolute';
                    deleteButton.style.right = '10px';
                    deleteButton.style.top = '50%';
                    deleteButton.style.transform = 'translateY(-50%)';
                    deleteButton.style.backgroundColor = '#333';
                    deleteButton.style.color = '#fff';
                    deleteButton.style.border = 'none';
                    deleteButton.style.padding = '2px 5px';
                    deleteButton.style.borderRadius = '1px';
                    deleteButton.style.cursor = 'pointer';

                    deleteButton.addEventListener('click', () => {
                        Umi.Server.SendMessage(`/delete ${messageId}`);
                        }
                    );

                    message.style.position = 'relative';
                    message.appendChild(deleteButton);
                }
            });
        }

        // Add delete buttons when the script is loaded
        addDeleteButtons();

        // Observe mutations to add delete buttons to new messages
        const observer = new MutationObserver(addDeleteButtons);
        observer.observe(document.body, { childList: true, subtree: true });
    });
})();
---
https://lester.page/88x31/lester.gifhttps://lester.page/88x31/madewithnotepad.gifhttps://lester.page/88x31/webinter.gifhttps://lester.page/88x31/bestviewedwitheyes.gif
#18754
nook remover

// ==UserScript==
// @name         Nook Remover Reimagined
// @namespace    https://saikuru.net/
// @version      2024-11-24
// @description  Automatically removes embeds from nook
// @author       You
// @match        https://chat.flashii.net/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=flashii.net
// @grant        none
// ==/UserScript==

(function () {
  'use strict';
  const observer = new MutationObserver((mutationsList) => {
    mutationsList.forEach((mutation) => {
      mutation.addedNodes.forEach((node) => {
        if (node.nodeType === Node.ELEMENT_NODE) {
          const element = node;
          if (element.matches && element.matches('div.message--user-2')) {
            element.querySelectorAll('embed, iframe, object, img, video, audio').forEach((embeddable) => {
              embeddable.remove();
            });
          }
        }
      });
    });
  });

  observer.observe(document.body, { childList: true, subtree: true });
})();
https://saikuru.net/sig
#18756
im going to reroll his user id every time he logs in
https://sig.flash.moe/signature.png