Namespace content-studio
The content-studio namespace provides an object which provides a lot of features directly connected to running inside an instance of Content Studio. The content-studio instance instance itself is an EventEmitter which emits events when editors are opened and focused, and you can tell Content Studio to open side panels and even editors.
Constructor Attributes | Constructor Name and Description |
---|---|
<inner> |
The 'content-studio' namespace
|
Method Attributes | Method Name and Description |
---|---|
<static> |
content-studio.browse(uri)
Opens a stand-alone browser window with the specified URI.
|
<static> |
content-studio.createPanel(uri, name, shortcut)
Create a panel in Content Studio with the given
uri . |
<static> |
content-studio.disableDrop(mimeType)
Disables drop support for a specified
mimeType in Content Studio
(previously enabled using enableDrop ). |
<static> |
content-studio.enableDrop(mimeType)
Enables drop support for a specified
mimeType in Content Studio. |
<static> |
content-studio.openEditor(uri)
Open or focus the editor identified by the given
uri . |
<static> |
content-studio.openPanel(uri)
Opens the panel in Content Studio with the given
uri |
<static> |
content-studio.removePanel(uri)
Remove the panel from Content Studio with the given
uri . |
<static> |
content-studio.requestCloseEditor(uri)
Request to close the editor identified by the given
uri ,
if it exists. |
Event Attributes | Event Name and Description |
---|---|
<static> |
content-studio.drop-listen(dropcontrol)
This event is fired whenever an object of a supported MIME type is dropped in
Content Studio.
|
<static> |
content-studio.editor-active(editor)
The
editor-active event is fired whenever a content
editor has been brought up to the front. |
<static> |
content-studio.editor-inactive(editor)
The
editor-inactive event is fired whenever a content
editor that used to be the "active" editor is replaced. |
<static> |
content-studio.panel-destroy(panel)
The
panel-destroy event is fired whenever a panel is
destroyed. |
<static> |
content-studio.panel-hide(panel)
The
panel-hide event is fired whenever a panel has been
hidden. |
<static> |
content-studio.panel-init(panel)
The
panel-init event is fired whenever a panel has been
created and is about to be initialized. |
<static> |
content-studio.panel-show(panel)
The
panel-show event is fired whenever a panel has been
shown. |
var CS = require("content-studio");
- Parameters:
- uri
- The web page to open
uri
.
A side panel will be created and associated with a URI. The URI is
later used in events, to recognise the "initialisation"
The panel will be created, and an EventEmitter will be returned which
can emit the action
event. This event will be fired
typically whenever the user activates (double clicks) on something
in the panel.
- Parameters:
- uri
- The urn of the panel. This will be used to identify the panel.
- name
- The label of the panel
- shortcut
- The shortcut of the panel
mimeType
in Content Studio
(previously enabled using enableDrop
). Content Studio will no longer
fire a content-studio.drop-listen
event when an object of
the specified MIME type is dropped into the Content Studio window.
- Parameters:
- mimeType
- The MIME type for which drop support is to be disabled.
mimeType
in Content Studio.
When an object of the specified MIME type is dropped into the
Content Studio window, a content-studio.drop-listen
event will be fired.
- Parameters:
- mimeType
- The MIME type for which drop support is to be enabled.
uri
.
This will open a new editor tab, and will attempt to dereference
the given URI. The URI should be on the same server as
the user is currently logged in, and should use the same
endpoint (i.e. exactly the same host name and port number), in
order for Content Studio to correctly identify the content item.
CS.openEditor("https://example.com/webservice/content/article/123");
- Parameters:
- uri
- The uri of the editor to open/focus
uri
- Parameters:
- uri
- The urn of the panel
uri
.
- Parameters:
- uri
- The urn of the panel
uri
,
if it exists. This may result in the user wanting to save their
changes, or a close of the editor with no prompt if there were no
modifications done by the user.
- Parameters:
- uri
- The uri of the editor to close
The event passes a DropControl
object that provides the event handler
with access to the dropped object.
- Parameters:
- {DropControl} dropcontrol
- A DropControl object that can be used to access the dropped object.
editor-active
event is fired whenever a content
editor has been brought up to the front. It does not necessarily
mean that the editor has focus, since the user might be busy in the
search area, but the event does mean that the "current editor" has
changed.
The event is passed with an object of type EditorControl which allows further interaction with the editor.
- Parameters:
- {EditorControl} editor
- An EditorControl instance used to interact with the editor.
editor-inactive
event is fired whenever a content
editor that used to be the "active" editor is replaced.
The event means that the "current editor" has changed.
The event is passed with an object of type EditorControl which allows identification of the editor.
- Parameters:
- {EditorControl} editor
- An EditorControl instance used to identify the editor.
panel-destroy
event is fired whenever a panel is
destroyed.
The event is passed with an object of type PanelControl which allows identification of the panel that was destroyed.
- Parameters:
- {PanelControl} panel
- A PanelControl instance used to identify the panel.
panel-hide
event is fired whenever a panel has been
hidden. This can be used to stop unnecessary background tasks
associated with the panel.
The event is passed with an object of type PanelControl which allows further interaction with the panel.
- Parameters:
- {PanelControl} panel
- A PanelControl instance used to interact with the panel.
panel-init
event is fired whenever a panel has been
created and is about to be initialized. Typically only the plug-in
that created the panel should continue to initialize it (by adding a
user interface to the panel) but the event mechanism allows plug-ins
to cooperate to share panels, if so desired.
The event is passed with an object of type PanelControl which allows further interaction with the panel.
- Parameters:
- {PanelControl} panel
- A PanelControl instance used to interact with the panel.
panel-show
event is fired whenever a panel has been
shown. This can be used to start background tasks to refresh the
contents of the panel.
The event is passed with an object of type PanelControl which allows further interaction with the panel.
- Parameters:
- {PanelControl} panel
- A PanelControl instance used to interact with the panel.