Class: API¶
- new API()¶
Version: 1.2 (2014-02-03)
Space
Methods¶
- applyRichTextEditorConfig(unitId, section, config)¶
Arguments: - unitId (String) – The id of the unit
- section (String) – The name of the section
- config (Object) – The RichTextEditor config object which will be merged with the default config
Example¶
CMS.applyRichTextEditorConfig('MUNIT-9b6e6080-c9df-4754-a688-5a5c347810e7-MUNIT', 'text', {
bold: false,
italic: true,
customStyles: [{
label: 'Headline 1',
element: 'h1',
classes: ''
}, {
label: 'Headline 2',
element: 'h2',
classes: ''
}, {
label: 'API-Style',
element: 'p',
classes: 'myAPIStyle'
}]
});
// Another Example with all possible properties
CMS.applyRichTextEditorConfig('MUNIT-9b6e6080-c9df-4754-a688-5a5c347810e7-MUNIT', 'text', {
bold: true,
strikethrough: true,
italic: true,
subscript: true,
underline: true,
superscript: true,
bullist: true,
link: true,
numlist: true,
table: true,
enterKey: "paragraph", // none|paragraph|linebreak
customStyles: [{
label: "Headline 1",
element": "h1",
classes": "myClass"
}],
linkTargets: [
["", "Same Window"],
["_blank", "New Window"]
]
});
Space
- createPreviewTicket(callback, options *opt*, options.protect, options.credentials, options.credentials.username, options.credentials.password, options.ticketLifetime, options.sessionLifetime, options.remainingCalls, scope *opt*)¶
Arguments: - callback (CMS.api.API~createTicketCallback) – The callback function to be called after the ticket has been created
- optionsoptional (Object) – Configuration of the ticket, e.g. to protect it with credentials
- scopeoptional (Object) – The object in whose scope the callback function should be executed
Example¶
CMS.createPreviewTicket(function (ticket) { alert(ticket.url); }, {
protect: false,
credentials: {
username: 'test',
password: 'test'
},
ticketLifetime: 60,
sessionLifetime: 60,
remainingCalls: 1
}, this);
Space
- deselect()¶
Space
- duplicate(unitId) Boolean()¶
Arguments: - unitId (String) – The id of the unit which is to be duplicated
Space
- get(id, includeFormValues *opt* ) Object()¶
Arguments: - id (String) – The id of the unit
- includeFormValuesoptionaltrue (Boolean) – include the formValues
Space
- getAllUnitIds(moduleId) Array.String()¶
Arguments: - moduleId (String) – unit ids from the given module id
Since: 1.1 (2014-01-08)
Space
- getColorById(colorId) String()¶
Arguments: - colorId (String) – The id of the color
Space
- getCurrentResolution() String()¶
Space
- getImageUrl(mediaDbId, width *opt* , quality *opt* ) String()¶
Arguments: - mediaDbId (String) – for example: MDB-uuid-MDB
- widthoptional (Number) – width of the image; 0 = original size (height is determined automatically)
- qualityoptional (Number) – quality 0 (bad) - 100 (best) - works only on formats that support it, like jpg
Space
- getInsertable(unitId) Object()¶
Arguments: - unitId (String) – The id of the unit in whose context units are going to be inserted
Space
- getMediaUrl(mediaDbId, download *opt* ) String()¶
Arguments: - mediaDbId (String) –
- downloadoptional (Boolean) – weather the response should download the file (content-disposition: attachment)
Since: 1.2 (2014-02-03)
Space
- getModule(moduleId) Object()¶
Arguments: - moduleId (String) – The id of the module
Space
- getResolutions() Resolutions()¶
Space
- getSelected(includeFormValues *opt* ) Object()¶
Arguments: - includeFormValuesoptional (Boolean) – include the formValues; default = true
Space
- getVisualHelpersState() Object()¶
Space
- i18n(input) String|Mixed()¶
Arguments: - input (Object) – An object with texts for all available languages (e.g. {de: “Hallo Welt!”, en: “Hello World!”}
Space
- insert(unitId, position, ownerUnitId) Boolean()¶
Arguments: - unitId (String) – The id of the unit which should be inserted
- position (String) – The position where it should be inserted (above, below, inside)
- ownerUnitId (String) – The id of the unit in whose context the new unit should be inserted
Space
- moveDown(unitId) Boolean()¶
Arguments: - unitId –
Space
- moveUp(unitId) Boolean()¶
Arguments: - unitId –
Space
- on(event, filter *opt*, handler, scope *opt*)¶
Arguments: - event (String) –
- formValueChange
- unitSelect
- unitDeselect
- showEditor
- beforeRenderPage
- afterRenderPage
- beforeRenderUnit
- afterRenderUnit
- beforeInsertUnit
- beforeMoveUnit
- beforeRemoveUnit
- afterRemoveUnit
- unitTreeSelect
- unitTreeDeselect
- treeMouseEnter
- treeMouseOut
- unitFrameSelect
- unitFrameDeselect
- frameMouseEnter
- frameMouseOut
- visualHelpersStateChange
Arguments: - filteroptional (CMS.api.API~EventFilter|String) – The id of a unit or a filter object
- handler (CMS.api.API~eventListenerCallback) – The callback function
- scopeoptional (Object) – The execution context for the event handler
Space
- openFormPanel(varName *opt*, showPanel *opt*)¶
Arguments: - varNameoptional (String) – The name of the unit property whose form group has to be opened
- showPaneloptionaltrue (Boolean) – <tt>false</tt> to prevent activation of the containing form panel.
Space
- openInsertWindow(unitId *opt*, position *opt*)¶
Arguments: - unitIdoptional (String) – The id of the unit in whose context the insert window should be opened
- positionoptional (Integer) –
- -1 - above
- 0 - inside
- 1 - below (default)
Space
- openTreePanel()¶
Space
- preventRendering()¶
Space
- processInsertedUnits(filter *opt* , callback *opt* , scope *opt* ) Array()¶
Arguments: - filteroptional (Object) – A filter object, e.g. to filter by moduleId
- callbackoptional (function) – The callback function to be called for each inserted unit
- scopeoptional (Object) – The object in whose scope the callback function should be executed
Deprecated: Use http://developers.rukzuk.com/js_module_api.html#getAllUnitIds after a reload
Space
- refresh(unitId *opt*)¶
Arguments: - unitIdoptional (String) – The id of the unit which should be re-rendered
Space
- remove(unitId, showConfirmation *opt*, callback *opt*, scope *opt*)¶
Arguments: - unitId (String) – The id of the unit which is to be deleted.
- showConfirmationoptional (Boolean) – Whether the CMS should ask the user for confirmation before removing the unit
- callbackoptional (Boolean) – The function which will be executed when the unit is actually deleted or not
- scopeoptional (Object) – The object in whose scope the callback function should be executed
Space
- select(unitId)¶
Arguments: - unitId (String) – The id of the unit which should be selected
Space
- set(id, key, value) Boolean()¶
Arguments: - id (String) – The id of the unit
- key (String) – The name of the unit property which is changed
- value (Mixed) – The new value of the unit property
Space
- setInfo(id, key, value) Boolean()¶
Arguments: - id (String) – The id of the unit
- key (String) – The name of the meta property which is changed
- value (Mixed) – The new value of the meta property
Space
- setName(id, name) Boolean()¶
Arguments: - id (String) – The id of the unit
- name (String) – The new name of the unit
Deprecated: Does not effect the unit's name anymore; Use http://developers.rukzuk.com/js_module_api.html#setInfo visualize unit settings
Space
- un(event)¶
Arguments: - event (String) – The name of the event
Space
- updateFormFieldConfig(unitId, key, config)¶
Arguments: - unitId (String) – The id of the unit
- key (String) – The variable name of the form field
- config (Object) – The form field config object
Example¶
CMS.updateFormFieldConfig(unitId, 'additionalSelector', {
fieldLabel: 'Filter',
options: [
['.text a', 'Link'],
['.text p', 'Text']
]
});
Space
Type Definitions¶
- createTicketCallback(ticket, ticket.id, ticket.url, ticket.protect, ticket.credentials, ticket.credentials.username, ticket.credentials.password, ticket.ticketLifetime, ticket.sessionLifetime, ticket.remainingCalls)¶
Arguments: - ticket (Object) – resulting ticket object
Space
- Object EventFilter()¶
Event filter
- eventListenerCallback(config)¶
Arguments: - config (Object) – config object depends on type of event
Space
Events¶
- afterRemoveUnit()¶
Arguments: - unitId (String) – id of the unit which is open in editor
Space
- afterRenderPage()¶
Deprecated: Use http://developers.rukzuk.com/js_module_api.html#getAllUnitIds after a reload
Space
- afterRenderUnit()¶
Arguments: - unitId (String) – id of the unit which is open in editor
Space
- beforeInsertUnit()¶
Arguments: - config (Object) – Config Object
Space
- beforeMoveUnit()¶
Arguments: - config (Object) – Config Object
Space
- beforeRemoveUnit()¶
Arguments: - unitId (String) – id of the unit which is open in editor
Space
- beforeRenderPage()¶
Space
- beforeRenderUnit()¶
Arguments: - unitId (String) – id of the unit which is open in editor
Space
- formValueChange()¶
Arguments: - config (Object) – Config Object
Space
- frameMouseEnter()¶
Arguments: - config (Object) – Config Object
Space
- frameMouseOut()¶
Arguments: - config (Object) – Config Object
Space
- resolutionChange()¶
Arguments: - config (Object) – A configuration Object
Since: 2014-1-21
Space
- showEditor()¶
Arguments: - unitId (String) – id of the unit which is open in editor
Space
- treeMouseEnter()¶
Arguments: - config (Object) – Config Object
Space
- treeMouseOut()¶
Arguments: - config (Object) – Config Object
Space
- unitDeselect()¶
Arguments: - config (Object) – Config Object
Space
- unitFrameDeselect()¶
Arguments: - config (Object) – Config Object
Space
- unitFrameSelect()¶
Arguments: - config (Object) – Config Object
Space
- unitSelect()¶
Arguments: - config (Object) – Config Object
Space
- unitTreeDeselect()¶
Arguments: - config (Object) – Config Object
Space
- unitTreeSelect()¶
Arguments: - config (Object) – Config Object
Space
- visualHelpersStateChange()¶
Arguments: - config (Object) – Config Object
Since: 8db1dfb (2013-03-11)
Space