[UserScript] More Comment Style Buttons


#1

More buttons


#2

Nice work!

Also useful: https://superuser.com/editing-help


#3

@DaisukeJigen uhhh, any progress on this? I was looking forward to it


#4

Oh dang. I completely forgot about this…
Remember I was having some sort of issue, so took a breather… And forgot apparently. Whoops.


#5

Apparently I removed it from greasyfork, and didn’t have the source myself anymore.
So, complete rewrite. Works much better this time. So far: underline, strikethrough, superscript, and subscript.


#6

Can you also bring out the details, spoiler, and poll, from the menu? Clicking that thing is always annoying


#7

Well that was a bigger pain in the butt than I expected, but there ya go.:crazy_face:
Basically had to make buttons that open the menu and click the real button (menu and real button: display = none, so invisibly). Not too bad of code in the end, but figuring out that’s how it needed to be done…
Other paths were close, and would ‘work’ but for whatever reason, wipe everything in the textarea first :unamused:


#8

You’re doing the Crabigator’s work :crabigator:


#9

I have some feedback. It’s great! However

  1. There are still debuggers in there, hehe
  2. Sometimes the buttons to the rightmost don’t load. I know it’s consistent when you load the window with a reply open, but I think there are other situations where it happens too.
  3. The .focus() in the following part makes it so you can’t select any other text field. Not the search and not the poll options.
    $('.d-editor-container textarea').focusout(function(){
        $('.d-editor-container textarea').focus();
        //selectedText = getSelectedText();
    });

#10

Man, I am awful at remembering to remove debuggers;
Good point on the focus. Issue was I need focus to be on the textarea in order to know what text is selected. But, can probably add some code in there so it only does to auto-refocusing if I’m still inside the reply area somewhere…
And damn Discourse and its failing to firing things all the time :rage:


#11

I need an auto-table-of-contents button :wink:


#12

1 and 3 are taken care of.

#2 though


#13

You know what’s causing it?