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

JavaScript Navigation

While all of CHILI Editors Document Object Model is exposed using object descriptors (and the possibility to call functions and set properties based on that), certain areas are even more simplified. Navigation is one such area where a series of helper functions has been created to allow even faster integration.

HTML navigation can be included as follows:

 <p>
     <a href="javascript:editor.SetSelectedPage(1)">First Page</a>
     <a href="javascript:editor.PreviousPage()">Previous page</a>
     <a href="javascript:editor.NextPage()">Next page</a>
     <a href="javascript:editor.SetSelectedPage(editor.GetNumPages())">Last Page</a>

  <span id="pageDisplay"></span>
</p>

Display of the selected page can be done by using the "?/wiki/spaces/CPDOC/pages/1413235" event:

var frameWindow;
var editor;

function GetEditor()
{
    if (document.getElementsByTagName(iframe).length > 0)
    {
      if (document.getElementsByTagName(iframe)[0].src != "")
      {
         frameWindow = document.getElementsByTagName(iframe)[0].contentWindow;
         frameWindow.GetEditor(EditorLoaded);
      }
    }
}

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

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

function OnEditorEvent(type,targetID)
{
    switch (type)
    {
         case "SelectedPageChanged":
            ShowSelectedPage();
            break;
    }
}

All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security