This script adds a little 'auto' link next to all comments boxes. When you click the link, you see a popup with 6 configurable auto-comments canned responses , which you can easily click to insert.
This script was inspired by answers to this question on meta. Note that the dialog only inserts the text, it doesn't send the comment, nor does it flag anything; this is so that you can check the text before posting!
Simply double click on a comment text or description in order to customize it. Hit the 'reset' button if you screw up. This customization is currently per-site. The dialog also includes a mini-summary of the user's activity because if they haven't been back in months, there's no point writing them a comment.
This helps with transferring custom comments between sites. Note that you can also use the Import to create an arbitrary number of comments the default is 6. See here for more details. If you prefix your comment title with [Q] , it will be only displayed for questions [A] for answers.
Non-prefixed comments are displayed for both. If the text [type here] is included in a comment, it will be automatically selected for completion when inserted. By clicking on the 'welcome' link at the bottom of the popup, you can opt to change this message, or leave it empty to show no messages at all.
You can also 'force' the message for older users on a one-off basis. This is per-site. Development of this app is being coordinated over on GitHub. Please see the relevant sections over there to:. You may also download the code and run the build process yourself to generate the userscript version as well as Chrome, Firefox and Opera extensions that you can install locally if you'd rather not use the store versions.
Note: Can be used in tandem with my other user script. The work on making this a full-blown GitHub based project originally outlined in this answer is now complete.
All further feature requests and bug reports should be directed at the GitHub issue tracker. And if you had raised an issue in the comments or answers below, and it's still unresolved, please open an issue on the GitHub project page. I have created a full blown Github repo here. The master branch is the latest from benjol's gist and all commit history is included. The master branch can be installed from this alternate location as a userscript using this url. This should make it easier for others to fork and send pull requests with changes back upstream.
I have created branches that include all the gists that had been forked off of this and merged in those commits. Most of these are behind master and would need rebasing, but at least no work will be lost in the shuffle and this should make it easier to review and integrate their work.
I have created a fork of my own and selectively merged in changes from the branch that came from Izzy's work in gist. His work includes changes so that custom comments are stored and retrieved per-site, but it also included his default comments hard coded in. I cherry-picked just the functional stuff and made a few tweaks. I have tentatively called this 1. There are some known bugs still but when it's ready I'll submit a pull request and maybe these can be merged into master.
This was just leg work to get everything cleaned up and manageable using a full repo instead of gists which were git ting out of hand. With this modification, there is no longer any reason that this userscript should be strictly limited to 'review'. Some people are experiencing a problem where the auto link does not appear.
This has to do with the fact that the DOM elements on which the selector is based are dynamically loaded into the DOM. Basically this is just a minor time out before trying to add the link, which should not be noticeable. If it still doesn't appear for you try milliseconds or something like that. Can we have the auto link appear when completing a custom "off-topic" closure reason?
Bonus points if we can declare certain auto-comments to apply in this scenario e. Perhaps "C" for closure reasons? You can now define an external source for your comments, and 'import' them. This means that you don't have to manually copy comments from site to site and PC to PC. To do this, you click on the 'remote' link; enter the url for your data source; then click on 'get now'. The data source must be formatted as jsonp. It is also possible to automatically invoke it every time you open the dialog, by selecting the auto-get checkbox.
I'm interested in feedback on this. I've added a function to be able to 'broadcast' messages without changing the code. The intended use for this will be to ask for feedback on proposed future changes. Taken this off-line again, it was not completely thought-through and you had to dismiss on every site This would work kind of like the 'more info' link in the faq which pops out when you click it.
My dialog is getting pretty big now and this would really help! Head list items are intended for users , sub list items are intended for developers. Allow the user to enter an unlimited amount of comments. Improved see-through behavior by hiding title and buttons and making it more transparent. Fixed invalid info : "User info detection doesn't work on CW answers, nor with deleted users.
Download Old Version Source. Doesn't work on superuser. The definitions of the sites are not all-inclusive. For instance, the link doesn't show up on stackapps ;. I see a couple of comments here suggesting that Benjol is thinking of making the Welcome message configurable. On Skeptics. SE differs from other Stack Exchanges. I have experimentally forked this code, just to make the Welcome message include a link to this meta-post. Unfortunately, my JavaScript skills are too dodgy to make it customisable and offer it back to you as a patch.
The customisation strikes me as particularly tricky for the troublesome few that moderate multiple Stack Exchanges. This is only a suggestion - incorporate it into the existing options file. It is a bit ugly, but I think better than having a whole separate config system. An alternative would be to put it all on one line, but then the [qualifier] notation would conflict with the [link] notation.
I forked the script to create some quick-insert buttons. Especially when going through the "not an answer" flags there are tons of "thanks" and "question instead of answer" posts. Small bug: I haven't figured out at which point this happens exactly, but the script seems to be over-enthusiastic adding the "Welcome" prefix:. The code you show is vulnerable to SQL injection. Future idea: include an 'auto-update' function which polls for new versions and notifies user with anti-nagging functionality.
Request: I see a lot of newbies post a comment saying "Thanks this worked perfect for me. It's exactly what I need" on an answer to their question, yet they do not mark the answer as accepted. This is also a polite way to thank the person answering your question for helping you out.
Here's what a comment to a new user reads:. Which sounds pretty creepy. For one thing, most folks who stumble into the site are already affiliated with some faith, which might or might not be Christianity.
For another, it sounds like we are a cult or a church. We aren't. I haven't tried to adjust the messages myself, but besides being a bit tedious, it probably would be best to not have new users of the script sending the wrong signals. I forked a version and made the following changes at line Welcome to Christianity—Stack Exchange! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Christianity.
SE way of saying thank you. Welcome to Stack Overflow! Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Stack Overflow way of saying thank you. Can you add multiple pages of comments? Currently if you have a lot of auto comments, you have to scroll to see them, but it would be nice to be able to click next and previous to see lists of about 5 comments.
Also, the "see through" feature is cool, but it should be activated by a click, instead of on mouse over. Benjol You could add the extra set of comments that I use in-tandem with Phrase Express :. Every post you make is already "signed" with your standard user card, which links directly back to your user page. Shopping questions are off-topic as per the FAQ : it is not about a shopping or buying recommendation.
It would be nice to have a place other than in these answers for us to share setups. Could you provide one and link it to the main post? I thought about posting another question to deal with this, but wasn't sure if it belonged in stackapps or meta. They are no longer maintained and the deprecation process has begun on it. See the red box? You can add Questions, Answers, and Articles to a single Collection for easy finding and sharing. We use Collections for new teammate onboarding as well as keeping product information within reach.
We have help documentation right here if you want to learn how the platform works. If you have questions that are specific to your team and how you should use the platform, please reach out to your administrator. Home By product. By topic. Where do I post my question? Frame your question in the title Make sure you use common terminology so that others searching will understand and find it easily. Add context to your question The question box below your title allows you more space to explain your question.
Add things like: How did you come to this question? What problem are you trying to solve? Does this pertain to a specific business unit, product, or technology? Do you have any assumptions or hypotheses? Add tags for better organization Tags are great for the organization of content - but they also trigger the alerts for email and chat notifications. Use all lowercase letters. You can set up Slack alerts when certain tags are used. Other helpful resources about tags and tag notifications: Use and manage tags Manage Slack notifications.
Answering a question See a question that you know the answer to? What are comments? How do I comment? The following community members will be automatically notified of your comment: the owner of the post you're commenting on one additional user when your comment contains a username 1 reply 1 You can only reply to users who have already left a comment, or edited the post.
When should I comment? You should submit a comment if you want to: Request clarification from the author; Leave constructive criticism that guides the author in improving the post; Add relevant but minor or transient information to a post e.
When shouldn't I comment? Stack Overflow works best with JavaScript enabled. Will be even funnier if a customer sees the class name in a stack trace. Show 34 more comments. There is nothing as permanent as temporary!!! That is ridiculous, who writes comments when they're drunk. Jiminy: Seriously! When I code drunk, I wake up with magnificent code that I, unfortunately, do not understand. If you don't understand it, it has to be magnificent! I made this just for fun: grepped my local subversion repo for 'drunk', and found one commit comment I wouldn't remember: "Works again, somehow.
I'm drunk! Show 6 more comments. Do not touch. Jason Sundram. Reminds me of this: catb. I've had to write that so many times - mostly to remind myself that "If you touch the following code without really knowing what you're doing, bad things will happen! I still remember being taught CS in high school, where our stupid questions were answered with "Magic! Show 11 more comments. Bart: You can't have half parens in your code, but you could do define if x if! As given this would actually work though: the comment-till-end-of-line characters make sure that likely lines where this macro is used will not compile.
The code that followed made me cry. Go in peace my son. Show 3 more comments. I wish comments like that were unfamiliar to me. I've seen this a lot. Makes it very easy to write large business functions, but you end up with some rather detailed comments at times.
Be more specific. Show 9 more comments. I once hit a situation with loops nested 8 deep. The runtime was measured in hours. I had a O n algorithm with a ms network RTT in its inner loop. There is a redeeming quality: they know what big O terminology is at least. Hopefully each loop is running over very small N :-D — Jon Smock. This should go on a t-shirt or something :- — Rook. Dr Seuss writes code? Needs two more syllables at the end Just opened the comments to say that it needs two more syllables, but apparently I beat myself by three months.
I disagree with the need to additional syllables, the meter is perfect as is. Five groups of three syllables each. I completely agree with your comment that comments are rarely needed. Depends on the comments. Even "self-documenting" languages can benefit from comments, such as Python. I hate having to slog through the code to figure out what is happening, when a simple sentence can tell me. I disagree re: comments being unnecessary.
There are times when a simple "framing" comment can make sense of a whole slew of code. For example, if you are using a sophisticated algorithm to escape the time complexity of a brute force algorithm, a reference can be essential. The code says what I couldn't agree more with "Richard E".
I'm not for littering comments all over the place, but sometimes they should be mandatory. Show 12 more comments. Pure corn. That's why I like it.
0コメント