Namespace: author

Granite. author

Granite author namespace contains all scripts and object for the Authoring Editor

Contains members of the editor; entry point of the Core Authoring Editor functionalities

Source:
declaration.js

Classes

Component
Editable
Inspectable
Layer
LayerManager
PageInfoHelper
PreviewLayer
ScaffoldingLayer

Namespaces

components
ContentFrame
design
developer
DialogFrame
edit
editableHelper
editables
editor
EditorFrame
overlayManager
OverlayWrapper
pageDesign
pageInfo
responsive
selection
ui

Members


<static> ns.pageInfoHelper :Granite.author.PageInfoHelper

Instantiated page info helper providing utilitary functions to read the pageInfo object

Type:
Source:
storage/pageInfo.js

Methods


<static> getPageDesignLocation()

Returns the relative URL location of the page design

Source:
editor.js

<static> getPageInfoLocation()

Returns the resource location where to get the page info from

Source:
editor.js

<static> init(config)

Initializes and starts the editor with the given config

Herein are initialized all the core modules of the editor

Parameters:
Name Type Description
config Object

Configuration object

Properties
Name Type Argument Description
name string

Name of the editor

tourUrl string <optional>

Relative url from where to load the content of the tour

layerManager Granite.author.LayerManager <optional>

Extension of Granite.author.LayerManager

layers Array.<Granite.author.Layer> <optional>

List of Granite.author.Layer

layerOrder Array.<string> <optional>

List of Granite.author.Layer.name default behavior is register order. Use it to enforce the layer order

loaders Array.<function()> <optional>

List of Loaders function returning $.Promise to be executed

dropControllers Array.<Object> <optional>

List of dropControllers

Source:
editor.js

<static> loadComponents()

Loads all components that could be used on the page

This function uses the component servlet specified by the current page info object (or uses the default components provider)

Source:
editor.js
See:
Fires:
Returns:

An array of all components (not filtered) to be used on the page

Type
$.Promise

<static> loadPageDesign()

Loads the design object from the design path provided by the page info object

Relies on the existence of the pageInfo

Source:
editor.js
See:
Fires:
Returns:

The design info JSON object corresponding of the current page info object

Type
$.Promise

<static> loadPageInfo(cache)

Loads the page info object from the server corresponding to the current ContentFrame location

Parameters:
Name Type Description
cache boolean

Should the page info be fetched from the cache

Source:
editor.js
See:
Fires:
Returns:

The page info JSON object corresponding to the current ContentFrame location

Type
$.Promise

Type Definitions


EditorConfig

Type:
  • Object
Properties:
Name Type Argument Default Description
layerManager Granite.author.LayerManager <optional>
Granite.author.LayerManager

The constructor of your Layer Manager

layers Array.<Granite.author.Layer> <optional>
[Granite.author.edit.Layer, Granite.author.PreviewLayer]

The list of your layer's constructors

loaders Array.<function()> <optional>
[Granite.author.loadPageInfo,Granite.author.loadPageDesign,Granite.author.loadComponents,Granite.author.loadEditables]

The list of your loader functions

dropControllers Array.<object> <optional>
[Granite.author.ui.ComponentDragAndDrop, Granite.author.ui.assetFinder.AssetDragAndDrop, Granite.author.ui.EditableDragAndDrop]

List of drop controllers

Source:
editor.js