General information:
made with XML messages
"afterAutosave""beforeAutosave"
Important Update:
IntervalChange counter@lsdzung
License
GPLLGPLMPL
Installation:
/ckeditor/plugins//ckeditor/_source/plugins/ckeditor_source.jsckeditor.js
Download
Autosave Plugin
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=autosave_1.0.2.zip
Sample Java Application
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=test_java_application1.0.2.zip
Sample PHP Connector
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=autosave_php_connector.zip
Your Contribution
Updates
- Change counter - Optional trigger which sends data to server only after specified amount changes was made in the editor.
- Interval - Optional trigger which sends data to server after specified amount of time.
-
Toolbar button - sends data to server when user click on a button (This is not quite automatic
). As of version 1.0.2 it is possible to assign keystroke to button.
made with XML messages
"afterAutosave""beforeAutosave"
Important Update:
IntervalChange counter@lsdzung
License
GPLLGPLMPL
Installation:
/ckeditor/plugins//ckeditor/_source/plugins/ckeditor_source.jsckeditor.js
-
Register the plugin -
config.extraPlugins = 'autosave';
-
Add new toolbar button -
config.toolbar = [['Source','Save','Preview','-', 'Autosave']];
-
Specify URL for the data saving server-side script -
config.autosaveTargetUrl = 'http://example.com/path_to_script_that_saves_data';
Download
Autosave Plugin
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=autosave_1.0.2.zip
Sample Java Application
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=test_java_application1.0.2.zip
Sample PHP Connector
http://code.google.com/p/ckeditor-ajax-autosave-plugin/downloads/detail?name=autosave_php_connector.zip
Your Contribution
Updates
- Version 1.0.1 - It is now possible to use this plugin as manual AJAX save by simply setting autosaveSensitivity and autosaveRefreshTime configuration properties to 0. Special thanks to @lsdzung for bringing this up.
- Version 1.0.2 - It is now possible to define user specific request parameters with configuration option autosaveRequestParams, assign key shortcut to autosave button with configuration option autosaveKeystroke and execute user specific functions on two events fired by the plugin (afterAutosave and beforeAutosave). Special thanks to @petr82 for bringing this up.

Re: Ajax Autosave
Your solution is what I am looking for. But I develop in ASP.NET and C#.
Can you suggest a sample for ASP.NET and C# to use your plugin.
Can I use your plugin for many CKEditor instances in one page.
Thank you in advance.
Re: Ajax Autosave
Re: Ajax Autosave
Re: AJAX Autosave \ AJAX Save
@lsdzung thanks for idea on how to improve this plugin.
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
I thought this was being handled by assigning request params to URL. I thought that my plugin handles all the rest but it does handle it only for GET requests (which probably no one uses) and not for POST.
I think I will treat it as bug and will try to fix it this week. I'm also working on other change suggested by @robC user so I'm not yet sure If I will make two releases or just one.
Although I hate to bring another config option I think that this will be the only solution here. Of course I could tell user to simply add his params to URL in form of queryString but in case of POST request it does not seam right even if plugin could done all the queryString stripping in background.
@petr82 what do you think?
Re: Autosave \ Manual Save with AJAX
I was testing the plugin a bit more and was wondering if there's a way to intercept when content has been saved, e.g. via an event handler. So i can display a message to the user (in addition to the tick symbol). Something on the lines of :
CKEDITOR.instances.editor_id.on('autosave', ...)I also haven't found a way to fire the autosave plugin using a shortcut. For standard save I've been able to configure Ctrl+S this way:But if a try to change 'save' for 'autosave' or 'Autosave' it doesn't work. Could you please try if this also doesn't work for you.
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
There was no code to handle extra parameters so I think new config option is something that allows for adding new (even generated) parameters without modifying the code.
No, plugin does not fire it's own event. This is however something to consider. I'm not sure though when to fire such event. The content is being saved in asynchronous way - in callback function... it's to late. The first thing that comes to my mind is just before making AJAX request call.
But plugin displays it's own messages in form of tooltip. Just hover the cross or tick and you will see. You can also change/add new messages.
Plugin does not have such option, yet again this is something to consider.
It does not break it. It uses it. I guess that this is the main drawback of this plugin - checking and resetting dirty state. As I was saying in previous post I'm working on a way to change it but I'm not sure if this will work.
Re: Autosave \ Manual Save with AJAX
The tick / cross icons are really nice but a normal user might not understand that. I'd like to show my own messages to ensure the user the content has been saved successfully.
I thought that ckeditor itself is handling that. Anyway that would be very useful if shortcuts could trigger autosave. Many users (incl. me) have the habit of using Ctrl+S when writing longer documents:-)
I see you're resetting in order to count changes. Wouldn't it be enough to count key presses? Surely, you'll miss using mouse events changing the style for example but I think the main proportion of editing a document will still be key presses.
Thanks for your response and also thanks for the work on this plugin, it's one of the most useful ones in CKEditor!
Re: Autosave \ Manual Save with AJAX
Messages:"messaging system"
To see the message you have to put mouse cursor over the icon.
Shotcut
Re: Autosave \ Manual Save with AJAX
var currentLength = getCurrentLength(); // just a mock method if ( lastLength != currentLength ) { autosaveCounter++ ; lastLength = currentLength; // change Icon to saveDirty autosaveChangeIcon( editor, autosaveIcons[1].path, autosaveIcons[1].title ); }It's just my guess because i'm not aware of the inner logic of the plugin that much, but do you think it might work or is there some catch to it?Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
It is now possible to define user specific request parameters, assign key shortcut to autosave button and execute user specific functions on two events fired by the plugin.
@petr82 thanks for the tips.
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
That is why I had to add this extra check to see if editor was "really dirty".
Re: Autosave \ Manual Save with AJAX
<%@ WebHandler Language="VB" Class="AutoSave" %> Public Class AutoSave Implements IHttpHandler, IRequiresSessionState Public Sub ProcessRequest(ByVal context As HttpContext) _ Implements IHttpHandler.ProcessRequest ' Do something with the data IO.File.WriteAllText("d:\path\to\save\content.txt", _ context.Request.Form("Content").ToString) context.Response.Clear() context.Response.ContentType = "text/xml;charset=UTF-8" context.Response.StatusCode = 200 context.Response.Write("<result status=""ok"" />") context.Response.Flush() End Sub Public ReadOnly Property IsReusable() As Boolean _ Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class<%@ WebHandler Language="C#" Class="AutoSave" %> public class AutoSave : IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { // Do something with the data IO.File.WriteAllText("d:\path\to\save\content.txt", context.Request.Form("Content").ToString); context.Response.Clear(); context.Response.ContentType = "text/xml;charset=UTF-8"; context.Response.StatusCode = 200; context.Response.Write("<result status=\"ok\" />"); context.Response.Flush(); } public bool IsReusable { get { return false; } } }Autosave, callback only
$('#editor').ckeditor(config).ckeditorGet().on('autosave', function(event) { // Backbone Model .save() method will take care of hitting my API event.editor.config.model.save({content: event.editor.getData()}); // return true/false so the plugin knows if saving was successful return true; });Re: Autosave \ Manual Save with AJAX
viewtopic.php?f=18&t=23605
http://alfonsoml.blogspot.com/2011/03/o ... ditor.html
Re: Autosave \ Manual Save with AJAX
http://github.com/narfdotpl/jquery-typing
Re: Autosave \ Manual Save with AJAX
And it doesn't take into account just keypresses but it tries to detect any change to the content (formatting, inserting elements, etc...)
Re: Autosave \ Manual Save with AJAX
Ooh nice. I hadn't considered the formatting stuff. I'll give the onChange plugin another go. Thanks
Re: Autosave \ Manual Save with AJAX
I have an odd behavior in Internet Explorer (9.0.8112.16421). When pressing any CKeditor button (e.g. Bold or Italic), the plugin shows the message about abandon the page: "You will lose changes you have made in the editor since last save". Both Firefox and Chrome works without any problem.
To warn if there are unsaved modifications is a great functionality, so I wouldn't want to disable it.
Thanks in advance for any hint!
Re: Autosave \ Manual Save with AJAX
@ leocofre I have just tried this plugin and didn't get behaviour you were talking about.
Could you perhaps send me private message explaining in more detail how you are getting this problem.
Re: Autosave \ Manual Save with AJAX
http://code.google.com/p/ckeditor-ajax- ... _1.0.2.zip
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { config.font_names = 'Arial/Arial, Helvetica, sans-serif;' + 'Courier New/Courier New, Courier, monospace;' + 'Times New Roman/Times New Roman, Times, serif;'; config.resize_enabled = false; config.width = '96%'; config.disableNativeSpellChecker = false; // Lignes à rajouter : config.extraPlugins = 'autosave'; config.toolbar = [['Source','Save','Preview','-', 'Autosave']]; config.autosaveTargetUrl = 'http://mywebsite.fr/media/autosave/save/'; config.filebrowserUploadUrl = 'media/kcfinder/upload.php?type=files'; config.filebrowserImageUploadUrl = 'media/kcfinder/upload.php?type=images'; config.filebrowserFlashUploadUrl = 'media/kcfinder/upload.php?type=flash'; // Fin Lignes à rajouter // ADVANCED EDITOR || DESACTIVED : SAVE - FORM,CHECKBOX,RADIO,TEXTFILED,TEXTAREA,SELECT,BUTTON,IMAGEBUTTON,HIDDENFIELD - FLASH - ABOUT config.toolbar_Full = [ { name: 'document', items : [ 'Source','-','NewPage','DocProps','Preview','Print','-','Templates' ] }, { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] }, { name: 'tools', items : [ 'Maximize', 'ShowBlocks' ] }, { name: 'insert', items : [ 'Video','syntaxhighlight' ] }, '/', { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] }, { name: 'colors', items : [ 'TextColor','BGColor' ] }, { name: 'insert', items : [ 'Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ] }, ]; // BASIC EDITOR config.toolbar_Basic = [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', '-', 'Image', 'Link', 'Smiley', '-', 'TextColor', 'RemoveFormat', '-', 'Scayt' ] ]; };http://www.nuked-klan.org/
Re: Autosave \ Manual Save with AJAX
Re: Autosave \ Manual Save with AJAX
the button was not there while the autosave plugin tried to access it
https://github.com/ebrahim/redmine_ckeditor
Re: Autosave \ Manual Save with AJAX
config.forcePasteAsPlainText = true;
And then I try to make a "paste" in the editor, this results in duplicate information.