Naviga Writer
6.3.3
6.3.3
  • Naviga Writer
  • Release notes
    • 6.3.3
    • 6.3.2
    • 6.3.1
    • 6.2.1
    • 6.2.0
    • 6.1.2
    • 6.1.1
    • 6.1.0
    • 6.0.0
    • 5.3.0
  • Introduction
    • Authoring
    • Developing
    • Publishing
    • User stories and reference cases
  • User Guide
    • Writer User Guide
      • The Content Area and Tabs
        • Help menu
        • Language menu
        • Article name
        • Writing teasers
        • Content area
        • Information
        • Search and replace words
        • History Button
        • Save and publish flow
        • Tabs
          • Meta Tab
            • Author
            • Channels
          • Integrations Tab
          • Image and Article search Tab
        • Locked article
      • Text management
      • Writer Keyboard Shortcuts
      • Personal Writer template
      • Channels to control access
      • Images User Guide
      • Common questions when starting using Writer
  • Admin Guide
    • Configuration files
    • Configurations Guide
    • Configuration of Writer templates
    • Publish Flow
      • Default configuration definitions
      • Starting part of the configuration
      • Publish flow config details
      • Configuration of calendarLocale
      • Preconditions for roles in the publish flow
    • Generic properties for Objects
      • Generic properties configuration
    • Image Services
      • Photo uploader
      • Binary Service Light
      • ImEngine
      • Imgix
    • Available Plugins
      • Naviga developed plugins
        • Plugins in earlier versions of Writer
      • Third-party plugins
  • Developer guide
    • Writer plugin development
      • Quickstart
      • Plugin overview
      • Creating an content object plugin
      • Validation and hooks
      • Interacting with external resources
    • Writer Plugin Building Blocks
      • Package
      • Component
      • Node
      • Converter
      • Events
    • Writer plugin style guide
      • CSS Guidelines
      • CSS variables, colors and fonts
      • UI Components
    • Tutorials
      • Popover & text analysis
      • Search & replace
      • Concept interaction
    • Infomaker NewsML
      • Overview
      • Document relations and types
      • Extensions XSD
      • NewsItem
      • ConceptItem
      • PlanningItem
      • Examples
        • NewsItem - Text
        • NewsItem - Picture
        • NewsItem - PDF
        • ConceptItem - Author
        • ConceptItem - Category
        • ConceptItem - Channel
        • ConceptItem - Content Profile
        • ConceptItem - Event
        • ConceptItem - Organisation
        • ConceptItem - Person
        • ConceptItem - Place (point)](point)](point)](point)](point)](point)](point)](point)](point)](point)]
        • ConceptItem - Place (polygon)](polygon)](polygon)](polygon)](polygon)](polygon)](polygon)](polygon)]
        • ConceptItem - Section
        • ConceptItem - Story
        • ConceptItem - Topic
        • PlanningItem
    • Media Enrichment
      • Images
  • API Reference
    • Writer Api
      • Api
      • Article
      • Browser
      • Concept
      • ConceptService
      • Document
      • Events
      • NewsItem
      • Router
      • Ui
      • Upload
      • User
      • settings
    • UI Components
      • UIAvatar
      • UIButton
      • UIByline
      • UICheckbox
      • UIChip
      • UIDatePicker
      • UIDatetimeFieldEditor
      • UIDropdown
      • UIFieldEditor
      • UIIconButton
      • UIInlineImage
      • UIPagination
      • UISelect
      • UITimePicker
      • UIToggle
      • UITooltip
      • UIInputText
      • UITextarea
Powered by GitBook
On this page
  • removeAllEventListeners()
  • on(name, eventType, func)
  • Parameters
  • Example
  • off(name, eventType)
  • Parameters
  • Example
  • trigger(name, eventType, [data])
  • Parameters
  • Example
  • ~~triggerEvent() ~~
  • ~~documentChanged() ~~
  • ~~externalUpdate() ~~
  • ~~documentReplaced() ~~
  • ~~documentSaved() ~~
  • ~~documentSaveFailed() ~~
  • ~~userActionSave() ~~
  • ~~userActionCancelSave() ~~
  • ~~userActionLock() ~~
  • ~~userActionUnlock() ~~
  • ~~languageChanged() ~~
  • ~~onDocumentStartSaving() ~~

Was this helpful?

  1. API Reference
  2. Writer Api

Events

Registering and triggering events

removeAllEventListeners()

Remove all registered events

on(name, eventType, func)

Register event listener for a specific plugin

Parameters

Param

Type

Description

name

string

Required - The plugin which listens for the event.

eventType

string

Required - The event to listen for.

func

function

Required - Function to call when event is triggered.

Example

import {api, event} from 'writer'
api.events.on('myplugin', Event.DOCUMENT_CHANGED, (event) => {
   // React on event
})

off(name, eventType)

Unregister event listener for a specific plugin.

Parameters

Param

Type

Description

name

string

Required - The plugin which listens for the event.

eventType

string

Required - The event to stop listening for.

Example

import {api, event} from 'writer'
api.events.off('myplugin', Event.DOCUMENT_CHANGED)

trigger(name, eventType, [data])

Trigger an event of specified type with optional specified data

Parameters

Param

Type

Default

Description

name

string

Required - Plugin name or originator of event

eventType

string

Required - Event type to trigger (mandatory)

data

object

Optional data structure to send with event

Example

import {api, event} from 'writer'
api.events.trigger(
   'myplugin',
   Event.DOCUMENT_CHANGED,
   {
      type: 'edit',
      action: 'edit',
      data: {
         key: 'strange things'
      }
   }
)

~~triggerEvent() ~~

Deprecated

Use api.events.trigger() instead, deprecated. Deprecated since 2018-11-20.

~~documentChanged() ~~

Deprecated

Use api.events.trigger() with Event.DOCUMENT_CHANGED instead. Deprecated since 2018-11-20.

~~externalUpdate() ~~

Deprecated

Use api.events.trigger() with Event.DOCUMENT_CHANGED_EXTERNAL instead. Deprecated since 2018-11-20.

~~documentReplaced() ~~

Deprecated

Use api.events.trigger() with Event.DOCUMENT_REPLACED instead. Deprecated since 2018-11-20.

~~documentSaved() ~~

Deprecated

Use api.events.trigger() with Event.DOCUMENT_SAVED instead. Deprecated since 2018-11-20.

~~documentSaveFailed() ~~

Deprecated

Use api.events.trigger() with Event.DOCUMENT_SAVE_FAILED instead. Deprecated since 2018-11-20.

~~userActionSave() ~~

Deprecated

Use api.events.trigger() with Event.USERACTION_SAVE instead. Deprecated since 2018-11-20.

~~userActionCancelSave() ~~

Deprecated

Use api.events.trigger() with Event.USERACTION_CANCEL_SAVE instead. Deprecated since 2018-11-20.

~~userActionLock() ~~

Deprecated

Use api.events.trigger() with Event.USERACTION_LOCK instead. Deprecated since 2018-11-20.

~~userActionUnlock() ~~

Deprecated

Use api.events.trigger() with Event.USERACTION_UNLOCK instead. Deprecated since 2018-11-20.

~~languageChanged() ~~

Deprecated

Use api.events.trigger() with Event.ARTICLELANGUAGE_CHANGED instead. Deprecated since 2018-11-20.

~~onDocumentStartSaving() ~~

Deprecated

Use api.events.trigger() with "document:startsaving" instead. Deprecated since 2018-11-20.

PreviousDocumentNextNewsItem

Last updated 5 years ago

Was this helpful?