Opened 8 years ago

Closed 4 years ago

#4507 closed New Feature (fixed)

Adding a new 'save' event

Reported by: Garry Yao Owned by: Tobiasz Cudnik
Priority: Normal Milestone:
Component: Core : Output Data Version: 3.0
Keywords: HasPatch Cc:

Description

Many users are looking for a easy way to override the default save button behavior, i.e. ajax post. A new 'save' event could be fired by save plugin on editor instance level to make this customization happen.

Attachments (1)

4507.patch (909 bytes) - added by Dekel 8 years ago.
patch for #4507

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.2CKEditor 3.3

Changed 8 years ago by Dekel

Attachment: 4507.patch added

patch for #4507

comment:2 Changed 8 years ago by Dekel

patch attached.

usage (In the configuration file) :

/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
	
	config.saveFunction = function(data) {
		alert(data)
	}
};

comment:3 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: HasPatch added
Milestone: CKEditor 3.3CKEditor 3.x

We should simply use our standard event system here on the CKEDITOR.editor class.

comment:4 Changed 7 years ago by Scott Bronson

fredck, true, but right now the button is grayed out if the editor isn't in a form. How would you enable it so the callback could fire?

It would be OK by me if the save button was always enabled and didn't check to see if the editor was in a form or not... not sure if this has legacy issues though.

comment:5 Changed 7 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:6 Changed 7 years ago by Wiktor Walc

Milestone: CKEditor 3.6
Status: newconfirmed

comment:7 Changed 7 years ago by Tobiasz Cudnik

Owner: set to Tobiasz Cudnik
Status: confirmedassigned

comment:8 Changed 7 years ago by Wiktor Walc

Version: 3.0

comment:9 Changed 7 years ago by Garry Yao

Keywords: HasPatch removed
Status: assignedpending

I don't see there a necessary for this into core now, as an ajax save could be instead provided by a custom save plugin (resolves the form sensitive state problem also).

comment:10 Changed 7 years ago by Frederico Caldeira Knabben

Keywords: HasPatch added
Status: pendingconfirmed

@bronson, you're right. At this point, maybe the configuration option would do it well.

@garry.yao, the idea is making it deadly simple, so it's definitely a valid need.

comment:11 Changed 7 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.6

comment:12 Changed 4 years ago by Piotrek Koszuliński

Resolution: fixed
Status: confirmedclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy