Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Screenshot

for drafts for edits

About

This is a simple Greasemonkey script which adds Save and Clear buttons for use when composing question/answer drafts. Otherwise when editing a post, it checks for updates from concurrent edits. As an added bonus, the Save hotkey (Ctrl+S) returns along with a Clear hotkey (Ctrl+Backspace) and a "Return to Question" link has been added when editing questions, useful if you want to open the question in a separate tab after having started editing.

This is an alternative implementation of the script found here from which the code was inspired by. It unfortunately didn't handle certain use cases well, this aimed to improve on it.

There are primarily 2 aspects of the original script that I wanted to improve on:

  1. Control when the links would be included and what type of link it was.
    You can save drafts of new questions or answers but not when edits are made as far as I can tell. So the appropriate link names are used for each view.
  2. It was impossible to clear the contents until you pressed a keyboard key within the editor.
    This will simulate a key press prior to attempting to save or clear so the changes go through.

Download

Platform

Written for and tested on Firefox 4.0 on Windows 7. I will be trying to maintain compatibility with Chrome in future releases. Specifically on Chrome 11.0 on Windows XP. Hopefully combinations of either browser and OS will still work.

Contact

Please use this page as means of contact. This is part of a personal learning exercise using Javascript so support will be limited as I have no practical experience with it. Feedback and improvement suggestions would be appreciated.

Future

This will be part of a larger project which is a collection of scripts to enhance Stack Exchange if and when I figure out how to do it.

share|improve this question
    
I'm the author of the original script and I would love to hear what improvements you've made :) –  Nathan Osman Apr 30 '11 at 23:01
    
@George: I have included the "improvements made" in the description. –  Jeff Mercado Apr 30 '11 at 23:22
    
Ah, thanks. –  Nathan Osman Apr 30 '11 at 23:24
    
Updated: Added hotkeys! –  Jeff Mercado May 3 '11 at 22:24
add comment

2 Answers

I'll use this answer to keep track of progress such as bugs and plans. That way it will be able to keep everyone up to date on the progress.

Acknowledged Bugs

  • Does not work on other browsers like Chrome (fixed)
  • Ctrl+S keyboard shortcut not working on Chrome. (fixed)

Future Plans

  • Add keyboard shortcuts for these links (implemented)
  • Add delays between consecutive save/clear attempts (implemented)
  • Remove links when saving is not possible (implemented)
share|improve this answer
add comment

Doesn't work on Chrome (don't think it works on any browser). The beat function is no longer in heartbeat but hidden in StackExchange.cardiologist

share|improve this answer
    
Yeah it's been broken since they've revamped the question pages. I haven't had the chance to update it. Thanks for pointing out the change, hopefully the fix will just be a matter of changing those variables. –  Jeff Mercado Mar 26 '12 at 13:33
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .