6

Sparked by this comment

Strictly-speaking, any moderator can leave a message along with Helpful, @Bill - there's just no UI for it.

The following bookmarklet, when clicked after loading the mod flag dashboard, will give an additional option (with a textbox) "custom helpful" which lets the moderator mark a flag as helpful and leave a message (similar to a decline message) with the flag.

javascript:function manishCustomHelpfulappendPopup(postid){$('<div id=manishCustomHelpful><input id=manishCustomHelpfulText type=text style="width:90%"></input><br><input id=manishCustomHelpfulButton type=button value="Custom Helpful"></input></div>').insertBefore('input[type=button][value=helpful]');$('#manishCustomHelpfulButton').click(function(){$.post("/messages/delete-moderator-messages/"+postid+"/"+renderTimeTicks+"?valid=true",{fkey:StackExchange.options.user.fkey,comment:$('#manishCustomHelpfulText').val()});$('[title="close this popup (or hit Esc)"]').click();$('#flagged-'+postid).hide();});};$("table.flagged-posts.moderator .dismiss-all").click(function(){var  postid =($(this).closest('tr[id^="flagged-"]').attr('id').replace("flagged-", ""));setTimeout(function(){manishCustomHelpfulappendPopup(postid)},200);});
9
  • 1
    Wait, one of the most requested features is actually possible? WHY is there no UI for this?!?! +1
    – Doorknob
    Commented Jan 5, 2014 at 4:44
  • 1
    Nice! May I steal this for SOUP? And if yes, would you mind helping me test it before it's released to make sure it really works? (It turns out that I can actually trick the SE UI into thinking I'm a mod well enough to test this code, but only up to a point -- probably fortunately, it doesn't let me actually dismiss any flags.) Commented Jan 26, 2014 at 20:01
  • @IlmariKaronen Sure. I don't mind helping out on the SOUP project either, I have a bunch of suggestions/snippets of my own Commented Jan 26, 2014 at 20:07
  • Excellent. I made a few tweaks to you code while I was at it (the most visible one being that I moved the custom button and text field below the normal "helpful" button). Can you test this version of SOUP (v1.5.1+) (source) and tell me a) if it works, and b) if you think the changes I made are improvements or not? (Also, feel free to steal any improvements you do like. :) Commented Jan 26, 2014 at 20:54
  • @IlmariKaronen it works (ui ). Maybe a better UI would be where there is only one helpful button, and if the reason box is empty it uses the normal helpful (using $.click(), because the normal helpful has a load of error checking magic that mine doesn't). All you have to do is .hide() the normal helpful and .click() it for empty text Commented Jan 26, 2014 at 21:00
  • @IlmariKaronen (working on this in a fork) Commented Jan 26, 2014 at 21:08
  • @IlmariKaronen pull requested the improvement. Tested. Commented Jan 26, 2014 at 21:16
  • Thanks! I merged your pull request and added some rudimentary error handling. Can you give it another try? Commented Jan 26, 2014 at 22:11
  • 1
    @IlmariKaronen got some work and sleep, ping me tomorrow :) Commented Jan 26, 2014 at 22:12

0

You must log in to answer this question.

Browse other questions tagged .