[editor's note, by ct] At long last, the new story editor. Here's an explanation from the guy who designed the ajaxy part of it. -ct
Following up the tremendous success of the Ajax Comments System that is unique to Daily Kos, we're happy to introduce new tools for diary authors here that offer the same leaps in performance, ease, and fluidity that you've been enjoying for comments. In fact, writing and editing diaries now looks and works just like posting comments—so you'll feel right at home.
We've also added some powerful new features just for diaries, which unlike comments, are editable. There's an automatic draft saving system, for instance, to prevent you from losing your work by accident. And with nifty new Ajax polls, visible directly on the front page, and an in-place Tag Editor for trusted users on all pages, Daily Kos is set to be more vibrant and fun than ever!
A few highlights:
- Looks and works just like the comment editor, with all the great formatting buttons and tools included, free of charge!
- Edits the page directly with WYSIWYG, rather than filling out some clunky form for a database.
- Fast, client-side autoformatted preview of both intro and body sections, with a rapid edit-test-debug cycle.
- Editor is always at the ready and doesn't require visiting another page.
- Autorefresh updates diary text, titles, poll results and tags, instantly with no need to press reload!
- The notifier tab in the lower right corner reports when the story is updated just as it reports new comments.
- When you edit the diary, you edit what you originally typed in, not some HTML garbled version of it.
- Diary Drafts menu keeps convenient track of drafts you are working on; you have three weeks to publish them.
- Drafts are automatically saved several times a minute; there is a Save as Draft button to be sure.
- Ajax Tag Editor provided to TU's makes tag editing easy on all diaries.
- Ajax polls, embedded right on the front page or diaries page, with nifty animations and no need to visit some other page and find your way back.
First thing to do, hold down the shift key and press your browser's reload button! That'll make everything work...please do that for both the front page and one story or diary page .
Read on (clicking There's more...) for all the great new features!
The key advance Ajax offers over the old "Web 1.0" form interface is that rather than editing fields in a database, you're now directly editing the page, right on the page. So when you create a new diary, you now go directly to that diary's page, with its actual, final URL in place in your browser's address bar. No other user can see your diary until you publish it; until then, it is merely a draft you're working on privately.
When you publish it, it's like opening up the doors to let other users read and comment on the diary. You don't even need to reload the page after publishing. Your view of your own diary, whether you reload or not, will always include the editors, ready to quickly allow you to edit and broadcast those edits to the other users via Autorefresh. Other users won't get the editors of course (although they may get the Ajax Tag Editor).
Previewing diaries has been greatly advanced in this upgrade. The client-side autoformatter from the comment editor is used for diaries too, meaning you don't have to wait for the server to generate your preview for you. What's more, the "edit-test-debug" cycle has been dramatically accelerated. The editors for both intro and body are now located right beneath the sections they edit, and each features its own Preview function, enabling you to see the effects of changes to text and markup instantly. To make further changes, not only do you not have to scroll very far to get back to the editor, the editor text itself will not have scrolled as a result of previewing, meaning you no longer have to hunt for where you were.
Since you are now editing the page, rather than fields in a database, all the elements of the page are present at all times. This gives you a WYSIWYG (What You See Is What You Get) preview and keeps you from getting lost on the page. You are able to scroll down and directly quote user comments simply by highlighting the comment text and pressing the Blockquote button on the intro or body editor. The editors all appear directly below what they edit when in edit mode (the title simply gets placed in an edit box).
If you forget to change the title, add a tag, or if you have too small or too large an intro section, you are notified of the error instantly upon previewing. If there is an error in your markup, the server will notify you of it before allowing you to publish. The error messages come out in red above the editor fields containing the errors. Note that the HTML filter is located on the server, and it may be possible to preview HTML that will not be accepted by the server.
Once you are done editing, simply scroll down and press Preview Diary. A draft is always saved upon previewing; there's no need to press Save as Draft at the same time. In Preview Mode, all the editors disappear, and you have an actual WYSIWYG preview of the diary (but for the preview warning at the top and the publishing control bar below). If you need to make further changes, simply press Edit Diary in the control bar; otherwise press Publish Diary to publish.
After a quick confirmation dialog, users will start streaming in, commenting, recommending, sparring with each other over details, and suggesting corrections and elaborations. Since editing is now so easy, please view diaries as an opportunity for dialog with other Daily Kos contributors. To edit the diary, press any of the three Edit Diary links positioned at the byline or in either of the gray bars above and below the comments. You won't even need to reload the page; the editors will just appear.
When you make edits after publishing, those edits are also saved as a draft even if you don't publish them right away. You can start on a new version, save the draft, and return to it later, even if you've closed your browser in the meantime. When you have an unpublished draft, you will always be in edit mode. The previews you will see as grayed out when loading a draft are what you have published already for your reference.
Of course critical to the editing process is the fact that the text you edit after publishing the diary is now the same as what you entered. In the old Scoop implementation, it became garbled with HTML tags, and would no longer do autoformatting. That's now fixed, even for users of the legacy editor who aren't able to run Ajax. (If you're unable to run Ajax, a notice will appear with a link to the legacy editor for your diary...don't worry, it still works!)
If you get lots of drafts building up in your Diary Drafts menu that you're never going to publish, just click on them and Delete them. They will be deleted automatically 21 days after you started them if you don't publish them, so quit procrastinating!
Geek note! =)
Now this product wouldn't be complete without some whiz-bang, hi-tech derring-do, of course. In this case, it comes in the form of the "version collision detector". This helps solve the problem of having two people, or two browser windows, editing the same diary at once. By using the Autorefresh system, the version collision detector compares incoming text with what it last saw from, or posted to, the server. If it doesn't match, it means that the diary has been edited from another window...perhaps by an administrator.
When this occurs, and the author isn't in the middle of editing anything, the page is instantly reloaded to load the latest content into the editors. If the author is editing something, a dialog appears urging them to save their edits onto a file on their computer and manually reload the page. That way, they will avoid overwriting what the administrator (or they themselves) posted into the diary and without losing their own changes. It's a simple, completely transparent, elegant solution to version control that should prevent overwriting problems at least 90% of the times they may become an issue, which itself is very rare.
Deleting diaries has also been Ajaxified, even though you are urged to consider the fact you may be deleting worthwhile comments from other users when you do so. It may be better to simply edit the text of the diary and allow it to be absorbed by the sands of time.
The Ajax Tag Editor is now included in-place on all diaries for all users who can edit tags (currently TUs), and it also uses Ajax to enable instant submission.
Polls have been moved up to make them visible on the front page or the diaries page. They are now uneditable and unremovable once published (that way, you can't do a switcheroo and argue that most Kossites favor Y when they all voted for X). You can add polls to your diary at any time, however. They now support a much improved, animated appearance, and offer instant, in-place voting and viewing of results without having to navigate to another page.
Unfortunately, you won't be able to edit diaries posted before this upgrade...the changes are too drastic and there's little demand for editing diaries that have already scrolled away. Of course you can't edit diaries once they are archived in any case. (If you absolutely have to edit an older diary, you'll need to paste the diary text into the new editors by hand.)
We anticipate that most potential bugs with the Ajax implementation were fixed when the Ajax Comments System came out in March. However, we urge you to report any problems you might be having so that we may address them. The most efficient way might be to post comments in the latest diary on the topic, which can be found using the tag "ajax".
I can't wait to see the quality and quantity of new diaries we get on Daily Kos after this upgrade; the Ajax Comments system instantly more than doubled the number of comments posted here!