CKEditor 4 Documentation

CKEDITOR.plugins.notification

Files

Notification class. Notifications are used to display short messages to the user. They might be used to show the result of asynchronous actions or information about changes in the editor content. It is recommended to use them instead of alert dialogs. They should not be used if a user response is required nor with dialog windows (e.g. in dialog validation).

There are four types of notifications available, see the type property.

Note that the notification constructor only creates a notification instance. To show it, use the show method:

var notification = new CKEDITOR.plugins.notification( editor, { message: 'Foo' } );
notification.show();

You can also use the CKEDITOR.editor.showNotification method:

editor.showNotification( 'Foo' );

All of the notification actions: (show, update and hide) fire cancelable events on the related CKEDITOR.editor instance so you can integrate editor notifications with your website notifications.

Refer to the Notifications article for more information about this feature.

Available since: 4.5

Defined By

Properties

CKEDITOR.plugins.notification
view source
: CKEDITOR.plugins.notification.areareadonly

Notification area reference.

Notification area reference.

CKEDITOR.plugins.notification
view source
: Numberreadonly
Notification duration. ...

Notification duration. Determines after how many milliseconds the notification should close automatically. 0 means that the notification will not close automatically and that the user needs to close it manually. The default value for warning and progress notifications is 0. For info and success the value can either be set through the CKEDITOR.config.notification_duration configuration option or equals 5000 if the configuration option is not set.

CKEDITOR.plugins.notification
view source
: CKEDITOR.editorreadonly

The editor instance.

The editor instance.

CKEDITOR.plugins.notification
view source
: CKEDITOR.dom.elementreadonly
Notification DOM element. ...

Notification DOM element. There is one element per notification. It is created when the notification is created, even if it is not shown. If the notification is hidden, the element is detached from the document but not deleted. It will be reused if the notification is shown again.

CKEDITOR.plugins.notification
view source
: Numberreadonly

Unique notification ID.

Unique notification ID.

CKEDITOR.plugins.notification
view source
: Stringreadonly

Message displayed in the notification.

Message displayed in the notification.

CKEDITOR.plugins.notification
view source
: Numberreadonly

If the notification type is 'progress', this is the progress from 0 to 1.

If the notification type is 'progress', this is the progress from 0 to 1.

CKEDITOR.plugins.notification
view source
: Stringreadonly
Notification type. ...

Notification type. There are four types available:

  • info (default) – Information for the user (e.g. "File is uploading.", "ACF modified content."),
  • warning – Warning or error message (e.g. "This type of file is not supported.", "You cannot paste the script."),
  • success – Information that an operation finished successfully (e.g. "File uploaded.", "Data imported.").
  • progress – Information about the progress of an operation. When the operation is done, the notification type should be changed to success.
Defined By

Methods

CKEDITOR.plugins.notification
view source
new( editor, options ) : CKEDITOR.plugins.notification
Create a notification object. ...

Create a notification object. Call show to show the created notification.

Parameters

  • editor : CKEDITOR.editor

    The editor instance.

  • options : Object
    • message : String

      The message displayed in the notification.

    • type : String (optional)

      Notification type, see type.

      Defaults to: 'info'

    • progress : Number (optional)

      If the type is progress this may be a progress from 0 to 1.

      Defaults to: 0

    • duration : Number (optional)

      How long the notification will be visible, see duration.

Returns

CKEDITOR.plugins.notification
view source
( ) : CKEDITOR.dom.elementprivate
Creates the notification DOM element. ...

Creates the notification DOM element.

Returns

CKEDITOR.plugins.notification
view source
( ) : CKEDITOR.dom.elementprivate
Creates a progress element for the notification element. ...

Creates a progress element for the notification element.

Returns

CKEDITOR.plugins.notification
view source
( ) : Stringprivate
Gets the notification CSS class. ...

Gets the notification CSS class.

Returns

  • String

    Notification CSS class.

CKEDITOR.plugins.notification
view source
( ) : Stringprivate
Gets the progress as a percentage (ex. ...

Gets the progress as a percentage (ex. 0.3 -> 30%).

Returns

  • String

    Progress as a percentage.

CKEDITOR.plugins.notification
view source
( )private
Hides the notification after a timeout. ...

Hides the notification after a timeout.

CKEDITOR.plugins.notification
view source
( )
Removes the notification element from the notification area. ...

Removes the notification element from the notification area.

Fires the CKEDITOR.editor.notificationHide event.

CKEDITOR.plugins.notification
view source
( ) : Boolean
Returns true if the notification is in the notification area. ...

Returns true if the notification is in the notification area.

Returns

  • Boolean

    true if the notification is in the notification area.

CKEDITOR.plugins.notification
view source
( )
Adds the notification element to the notification area. ...

Adds the notification element to the notification area. The notification will be hidden automatically if duration is set.

Fires the CKEDITOR.editor.notificationShow event.

CKEDITOR.plugins.notification
view source
( options )
Updates the notification object and element. ...

Updates the notification object and element.

Fires the CKEDITOR.editor.notificationUpdate event.

Parameters

  • options : Object
    • message : String (optional)
    • type : String (optional)
    • progress : Number (optional)
    • duration : Number (optional)
    • important : Boolean (optional)

      If the update is important, the notification will be shown if it was hidden and read by screen readers.

      Defaults to: false