Opened 6 years ago

Closed 18 months 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 5 years ago.
patch for #4507

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by fredck

  • Milestone changed from CKEditor 3.2 to CKEditor 3.3

Changed 5 years ago by Dekel

patch for #4507

comment:2 Changed 5 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 5 years ago by fredck

  • Keywords HasPatch added
  • Milestone changed from CKEditor 3.3 to CKEditor 3.x

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

comment:4 Changed 5 years ago by 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 5 years ago by fredck

  • Milestone CKEditor 3.x deleted

Milestone CKEditor 3.x deleted

comment:6 Changed 5 years ago by wwalc

  • Milestone set to CKEditor 3.6
  • Status changed from new to confirmed

comment:7 Changed 5 years ago by tobiasz.cudnik

  • Owner set to tobiasz.cudnik
  • Status changed from confirmed to assigned

comment:8 Changed 5 years ago by wwalc

  • Version set to 3.0

comment:9 Changed 4 years ago by garry.yao

  • Keywords HasPatch removed
  • Status changed from assigned to pending

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 4 years ago by fredck

  • Keywords HasPatch added
  • Status changed from pending to confirmed

@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 4 years ago by fredck

  • Milestone CKEditor 3.6 deleted

comment:12 Changed 18 months ago by Reinmar

  • Resolution set to fixed
  • Status changed from confirmed to closed
Note: See TracTickets for help on using tickets.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy