toolbox-team / reddit-moderator-toolbox-legacy

LEGACY VERSION do not use
http://www.reddit.com/r/toolbox
Apache License 2.0
66 stars 40 forks source link

Allow mod save button from inboxes #820

Closed eritbh closed 7 years ago

eritbh commented 7 years ago

Related to #589 and its fix d1ad5ddcf8f427ecb5c2d625a975c19076a713e5 - It appears inboxes and such were known to be excluded from this; is this by design or can I add it back in those places? I'm thinking rather than using the .moderator body class we can filter the save buttons by whether or not their thing's data-subreddit is a mod sub.

Something like this for these lines:

function addButtons () {
    var $usertextButtons = $('.commentarea>.usertext .usertext-buttons');
    $usertextButtons = $usertextButtons.filter(function () {
        return TBUtils.mySubs.indexOf($(this).closest('.thing').attr('data-subreddit')) > -1
    })

    // Add buttons to DOM...
}
TBUtils.getModSubs(addButtons)

// Click listeners...
creesch commented 7 years ago

Uh... I think they are excluded since in the inbox you can't distinguish right away. Also with how weird inboxes are on reddit there might have been some issues.

eritbh commented 7 years ago

I mean, the distinguish button is still there after you comment, so unless the mutationobserver is doing something I don't understand (which is likely) it should be fine.

creesch commented 7 years ago

Feel free to poke around, but this is probably one of those areas where in a few months we have to redo the entire thing anyway.

eritbh commented 7 years ago

If it lets me do what I think it will, this will be easy. If not I'll give up. :P

creesch commented 7 years ago

fair enough

eritbh commented 7 years ago

oh wait this is stupid. The inbox clones the reply field when you hit the "reply" button, so we can't actually make it different for each item easily. So this was intentional.