Skip to content

MainPageEditor

Max S edited this page Aug 28, 2015 · 4 revisions

Main Page

Overview

The main page of the editor has all of the links to core and project editor functionality plus some real-time server information. Using the API you can add links or raw HTML code to various blocks. You can also set the block titles.

Main page

There are nine blocks in the main page: top, center blocks 1-4, middle blocks 1-3 and bottom. Each of these has a unique identifier.

Adding links to blocks

Adding links to blocks is done with MainEditCore.add() method call.

Example usage (should be called in a module constructor):

  public function new(s: ServerTest)
    {
      // ...

      server.coreMainModule.add(MAIN_TOP,
        { a: "core/calendar.list", text: "Calendar" });
    }

Replacing links in blocks

Replacing links in blocks is done with MainEditCore.replace() method call.

Example usage (should be called in a module constructor):

  public function new(s: ServerTest)
    {
      // ...

      server.coreMainModule.replace(MAIN_TOP,
        { a: "core/calendar.list", text: "Calendar" });
    }

Adding HTML code to blocks

Adding HTML code to blocks is done with MainEditCore.addHTML() method call.

Example usage:

  public function new(s: ServerTest)
    {
      // ...

      server.coreMainModule.addHTML(MAIN_BLOCK3, "<b>test html code</b>");
    }

Setting block titles

Setting block title is done with MainEditCore.setTitle() method call. Only center blocks 1-3 have separate editable titles.

Example usage:

  public function new(s: ServerTest)
    {
      // ...

      server.coreMainModule.setTitle(MAIN_BLOCK3, "BLOCK TITLE");
    }
Clone this wiki locally