Information Classification: External Restricted.
See https://www.chili-publish.com/security

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Once you have received an editor instance, you can register to events and get callbacks in the "OnEditorEvent" function:

function EditorLoaded(jsInterface)
{
    editor = frameWindow.editorObject;
    editor.AddListener("CursorChanged");
}

function OnEditorEvent(type,targetID)
{
    switch (type)
    {
        case "SelectedPageChanged":
            ShowSelectedPage();
            break;
        case "CursorChanged":
            alert("new cursor selected!");
            break;
    }
}

function ShowSelectedPage()
{
  pg = editor.GetSelectedPageName() + " / " + editor.GetNumPages();
  document.getElementById("pageDisplay").innerText = pg;
}

The "DocumentFullyLoaded", "SelectedPageChanged" and "DocumentSaved" events are always dispatched to the containing HTML page.

See /wiki/spaces/CPDOC/pages/1413282 for a list of all available events

  • No labels