Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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);});
share|improve this question
Wait, one of the most requested features is actually possible? WHY is there no UI for this?!?! +1 – Doorknob Jan 5 '14 at 4:44
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.) – Ilmari Karonen Jan 26 '14 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 – Manishearth Jan 26 '14 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. :) – Ilmari Karonen Jan 26 '14 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 – Manishearth Jan 26 '14 at 21:00
@IlmariKaronen (working on this in a fork) – Manishearth Jan 26 '14 at 21:08
@IlmariKaronen pull requested the improvement. Tested. – Manishearth Jan 26 '14 at 21:16
Thanks! I merged your pull request and added some rudimentary error handling. Can you give it another try? – Ilmari Karonen Jan 26 '14 at 22:11
@IlmariKaronen got some work and sleep, ping me tomorrow :) – Manishearth Jan 26 '14 at 22:12

You must log in to answer this question.

Browse other questions tagged .