Krajee

Markdown Editor Events

Thankful to Krajee! BUY A COFFEEor to get more out of us.

The following events are supported by the krajee-markdown-editor plugin. The plugin events can be listened on the source textarea element on which the plugin was originally initialized. All the plugin events are listed alphabetically on this page. All the events use the namespace ".markdownEditor".

Tip

Not seeing the updated content on this page! Hard refresh your browser to clean cache for this page (e.g. SHIFT-F5 on Windows Chrome)

beforeExportHtm


This event is triggered before exporting the HTML file using AJAX call mode and is applicable only when parserUrl is set to a server based markdown parsing ajax action.

NOTE ajax configuration and settings are applicable only when you wish to convert the Markdown Content to TEXT/HTML via a server based parsing action (set via parserUrl), instead of using the markdown-it JS Library.

The following parameters are recognized by this event:

  • jqXhr: jQuery XMLHttpRequest, object used for this transaction

Usage:
$('#editor-id').on('beforeExportHtm.markdownEditor', function (e, jqXhr) {
    // do something
});

changeMode


This event is triggered on changing the modes to one of editor, preview, or split.

The following parameters are recognized by this event:

  • mode: string, the mode selected (one of 'editor', 'preview', or 'split').

Usage:
$('#editor-id').on('changeMode.markdownEditor', function (e, mode) {
    // do something
});

clickButton


This event is triggered on clicking any of the toolbar buttons in the editor (other than the emoji and export buttons). The emoji button click can be trapped with the clickEmoji event, and the export button click can be trapped with the clickExport event.

The following parameters are recognized by this event:

  • $btn: jQuery Object, the jQuery object identifying the clicked button element. For example, if you want to listen to the click of the BOLD editor button, you could set this to $('.md-editor .md-btn-bold').

Usage:
$('#editor-id').on('changeMode.markdownEditor', function (e, $btn) {
    // do something
});

clickEmoji


This event is triggered on clicking each emoji icon in the toolbar within the emoji dropdown button.

The following parameters are recognized by this event:

  • key: string, the key identifying the emoji. These keys are set for each emoji within the markdown-it-emoji plugin loaded as part of the markdownItPlugins setting. For example, the grinning smiley emoji will have the key named — grinning.

  • markup: string, the markdown text markup that will represent the smiley and will be inserted within them editor on the emoji icon click. For example, the grinning smiley emoji will have the markup — :grinning:.

Usage:
$('#editor-id').on('clickEmoji.markdownEditor', function (e, key, markup) {
    // do something
});

clickExport


This event is triggered on clicking the export HTML or export TEXT icon in the toolbar within the export dropdown button.

The following parameters are recognized by this event:

  • key: string, the key identifying the export type clicked. The values for key are exportHtml or exportText.

Usage:
$('#editor-id').on('clickExport.markdownEditor', function (e, key) {
    // do something
});

errorExport


This event is triggered when an export error is received on clicking the export HTML or export TEXT icon in the toolbar within the export dropdown button.

The following parameters are recognized by this event:

  • key: string, the key identifying the export type clicked. The values for key are exportHtml or exportText.

Usage:
$('#editor-id').on('errorExport.markdownEditor', function (e, key) {
    // do something
});

errorExportHtm


This event is triggered when an export AJAX error is received on clicking the export HTML the toolbar within the export dropdown button. This event is applicable and rasied only when parserUrl is set to a server based markdown parsing ajax action.

NOTE ajax configuration and settings are applicable only when you wish to convert the Markdown Content to TEXT/HTML via a server based parsing action (set via parserUrl), instead of using the markdown-it JS Library.

The following parameters are recognized by this event:

  • data: string, the markdown converted data returned by the AJAX call parser.

  • textStatus: string, ajax error status e.g. success, notmodified, nocontent, timeout, error, abort, and parsererror.

  • jqXhr: jQuery XMLHttpRequest, object used for this transaction

Usage:
$('#editor-id').on('errorExportHtm.markdownEditor', function (e, data, textStatus, jqXhr) {
    // do something
});

errorToggleMode


TBD

exceptionExportHtm


TBD

fullScreen


TBD

normalScreen


TBD

redo


TBD

successExportHtm


TBD

undo


TBD

Note

You can now visit the Krajee Webtips Q & A forum for searching OR asking questions OR helping programmers with answers on these extensions and plugins. For asking a question click here. Select the appropriate question category (i.e. Krajee Plugins) and choose this current page plugin in the question related to field.

The comments and discussion section below are intended for generic discussions or feedback for this plugin. Developers may not be able to search or lookup here specific questions or tips on usage for this plugin.

 
visitors to Krajee Jquery Plugins since 22-May-2017