Get the JWT as defined on DrPublish publication config. This token can be used to authenticate the request.
String
Name | Type | Description | |
---|---|---|---|
tag | String |
The tag to create | |
callback | Function |
function(Boolean) |
Void
Creates a new tag
Name | Type | Description | |
---|---|---|---|
tag | String |
The tag to create | |
callback | Function |
function(Boolean) |
Void
Reloads the plugins's iframe
Void
Get the name of the loaded plugin
String
The name of the plugin, or false if it couldn't be detected
Get the name of the loaded plugin
String
The name of the plugin, or false if it couldn't be detected
Set the name of the plugin
Name | Type | Description | |
---|---|---|---|
name | String |
The name of the plugin |
Void
Set the name of the plugin
Name | Type | Description | |
---|---|---|---|
name | String |
The name of the plugin |
Void
Show info-message to the user
Name | Type | Description | |
---|---|---|---|
msg | String |
Message to be displayed |
Void
Show warning-message to the user
Name | Type | Description | |
---|---|---|---|
msg | String |
Message to be displayed |
Void
Show error-message to the user
Name | Type | Description | |
---|---|---|---|
msg | String |
Message to be displayed |
Void
Show the loader
Name | Type | Description | |
---|---|---|---|
msg | String |
Message to display in progress loader |
Void
Hide the loader
Void
Loads an old revision of an article
Name | Type | Description | |
---|---|---|---|
id | Number |
The id of the revision to load | |
callback | Function |
The function to call when the new revision has been loaded |
Void
Creates a new tag
Name | Type | Description | |
---|---|---|---|
tag | String |
JSON object with the tag to create, must contain tagTypeId and name properties | |
callback | Function |
function(Boolean) |
Void
Sends a query to DrLib
Name | Type | Description | |
---|---|---|---|
data | Object |
Object with three properties; 'query' which is the query to send to DrLib, 'success' which is the callback to execute on success, and 'secure' a boolean to add the internal API key to the query and thus allow searching on unpublished article. This callback's parameter is an object which is the query result as an object. See the json output of DrLib to learn more about this object | |
callback | Function |
function(Boolean) |
PluginAPI.searchDrLib({
query: 'articles.json?q=awesome',
secure: true,
success: function(data) {
data.items.forEach(doStuffWithArticle);
},
error: function(data) {
console.warn('something went wrong');
}
})
Void
Generates an url to a published article
Name | Type | Description | |
---|---|---|---|
id | String |
The id of the article to generate url for | |
callback | Function |
function(String), where the parameter is the generated url |
Void
Extends the PluginAPI with custom functionality that other plugins can use
Name | Type | Description | |
---|---|---|---|
group | String |
Group name for functionality to add | |
name | String |
Name of the specific function to add | |
action | Function |
function(Object) Function to call when the API is invoked, recieves one parameter as given in PluginAPI.callExtendedApi and return value is passed back to the caller |
Void
Call the extended PluginAPI
Name | Type | Description | |
---|---|---|---|
group | String |
Group name for functionality to call | |
name | String |
Name of the specific function to call | |
data | Object |
Data object to pass as parameter to the api call | |
callback | Function |
function(Object) Function to recieve the API response, parameter is the response from the API call |
Void
Gets logged in user
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) |
Void
Get configuration information about the plugin
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) |
Void
Get DrPublish configuration
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) |
Void
Set configuration information about the plugin
Name | Type | Description | |
---|---|---|---|
config | Object |
The configuration object to save | |
options | Object |
Object, can have three keys. 'onlyPublication' (boolean) If true the configuration is set for the current publication only 'success' (function) Called if the configuration was saved successfully 'error' (function) Called if there was an error, recieves and error object as first parameter |
|
callback | Function |
function() |
Void
Emits an event to DrPublish, and possibly other apps
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the event | |
data | String |
Data object to send with the event |
Void
Listen for an event. If the callback returns false the event may cancel continued actions, e.g beforeSave can cancel article save. Look at documentation for Listeners to learn more.
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the event | |
callback | Function |
function(Object) Function to call when the event is triggered. Recieves one data object parameter of the form {source: |
Void
Increase the counter of actions required by the user, used to tell the user that the plugin requires input of some kind
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) function to call once the counter has been increased, returns the new counter value |
Void
Decrease the counter of actions required by the user, used to tell the user that the plugin requires input of some kind
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) function to call once the counter has been decrease, returns current counter value |
Void
Clear the counter of actions required by the user, used to tell the user that the plugin requires input of some kind
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object) function to call once the counter has been cleared |
Void
Set the counter of actions required by the user, used to tell the user that the plugin requires input of some kind
Name | Type | Description | |
---|---|---|---|
count | Number |
The value to set the counter to | |
callback | Function |
function(Object) function to call once the counter has been cleared |
Void
Create a new instance of the Api class
Object
Create an embedded object of the given type
Name | Type | Description | |
---|---|---|---|
typeId | Number |
Type Id of the embedded object to create | |
callback | Function |
function(embeddedObjectId) called once the object has been created, first parameter is the new embedded object id |
Void
Get information about the available embedded object types
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([Object]) recieves an array with objects describing the available embedded object types in the form of {typeId: 'embedded object type id', cssClass: 'css class used to style the objects'} |
Void
Gives focus to another plugin
Name | Type | Description | |
---|---|---|---|
pluginName | String |
The name of the plugin to recieve focus | |
argument | Object |
Optional option argument to pass along to the plugin recieving focus | |
start | Boolean |
Flag to decide if the plugin should be started if it has not been loaded previously, default true |
Boolean
Hide the plugin, so it is no longer visible on the list of open plugins
Boolean
Creates a jQuery UI modal in the main editor window, detached from the plugin itself. Modals are unique on a per-plugin basis, meaning that a plugin can only have a single modal at a time. Creating a new modal will overwrite the previous.
See the official documentation for a list of available options.
Note that you do not have direct access to the DOM of the modal. Use the provided helper methods to manipulate or read from the modal:
Name | Type | Description | |
---|---|---|---|
content | String |
An HTML string | |
options | Object |
A standard jQuery UI options object. |
PluginAPI.createModal('<h1>This is a modal</h1>', {
buttons: {
Ok: function () {
alert('Ok!');
}
}
});
PluginAPI.updateModal('<h1>This is the same modal</h1>');
PluginAPI.createModal('<h1>This is a brand new modal</h1>', {
buttons: {
cancel: function() {
PluginAPI.closeModal(true);
}
}
});
Boolean
Updates the HTML content of a live modal. Has no effect if the modal does not exist.
Name | Type | Description | |
---|---|---|---|
content | String |
An HTML string |
Boolean
Closes and optionally deletes the modal. Has no effect if the modal does not exists.
Name | Type | Description | |
---|---|---|---|
destroy | Boolean |
Whether or not to delete the modal |
Boolean
Returns the values of all input or select elements within a modal.
The values are keyed by one of the following properties in order of priority: element ID, element name or input type + index.
Name | Type | Description | |
---|---|---|---|
callback | Function |
Given a modal with the following HTML content:
<form>
<input type="number">
<input name="name" type="text">
<select id="languages">
<option selected>en</option>
<option>no</option>
</select>
</form>
getModalInputs would return:
{
"number-0": {VALUE}
"name": {VALUE},
"languages": "en"
}
Void
Name | Type | Description | |
---|---|---|---|
PluginAPI | Api |
AH5Communicator
Void
Name | Type | Description | |
---|---|---|---|
elementData | selectedPluginElementData |
Void
Get name of current active editor
Name | Type | Description | |
---|---|---|---|
callback | function |
function(String) |
Void
Registers/Modifies a context menu items for a plugin element The object send should have the following structure
Name | Type | Description | |
---|---|---|---|
action | Object |
The action object | |
callback | function |
function() |
PluginAPI.Editor.registerMenuAction({
label: 'label in the menu',
icon: '[Optional] url to possible icon image',
trigger: '[Optional] css selector, only show menu element when this matches the element',
callback: function(id, clickedElementId) {
// callback function
// first parameter is id of the plugin element
// second paramter is id of closest element to the trigger element that has an id
// in code: $(event.triggerElement).closest('[id]').attr('id');
}
})
Void
Adds a mouseover action to plugin elements
Name | Type | Description | |
---|---|---|---|
action | function |
to perform | |
callback | function |
function(String) |
Void
Gets the selected plugin element from the editor
Name | Type | Description | |
---|---|---|---|
callback | function |
function(String) |
Void
Swap positions between the provided element and the adjacent one in the specified direction PluginAPI.Editor.directionalCastle({ elementId: 'the provided element id', direction: 'forward/backward' })
Name | Type | Description | |
---|---|---|---|
elementId | String |
DOM element id | |
direction | String |
Direction | |
callback | function |
Void
Registers/Modifies a group of items to in the context menu The object send should have the following structure
Name | Type | Description | |
---|---|---|---|
group | Object |
The action object | |
callback | function |
function() |
PluginAPI.Editor.registerMenuActionGroup({
label: 'label for the group in the menu',
icon: '[Optional] url to possible icon image',
actions: [
{
label: 'label for the action #1',
callback: function(id, clickedElementId) {
// same as for registerMenuAction
}
},
{
label: 'label for the action #2',
callback: function(id, clickedElementId) {
// same as for registerMenuAction
}
}
]
})
Void
Retrieves the type of editor that currently has focus
Name | Type | Description | |
---|---|---|---|
callback | function |
function(String) |
Void
Replace an element in the article
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
element | String |
The new element | |
callback | function |
function(Boolean), called after replacement is done |
Void
Replace a plugin element in the article
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
element | String |
The new element | |
callback | function |
function(Boolean), called after replacement is done |
Void
Set the content of an element in the article
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
content | String |
The new content | |
callback | function |
function(Boolean), called when done |
Void
Delete an element in the article
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
callback | function |
function(Boolean), called after deletion is done |
Void
Get HTML code of an element
Name | Type | Description | |
---|---|---|---|
id | String |
The element id | |
callback | function |
function(String), html content of the element |
Void
Get HTML code of all elements that match the selector
Name | Type | Description | |
---|---|---|---|
selector | String |
The CSS selector | |
callback | function |
function([String]), html content of matching elements |
Void
Get all categories
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([Object Category]), list of Category objects with id, name and pid |
Void
Returns all the parent categories of the given category
Name | Type | Description | |
---|---|---|---|
category | Object |
The category to find parents of | |
callback | Function |
function([Object Category]), array of parent Category objects |
Void
Returns all the parent elements that match the selector
Name | Type | Description | |
---|---|---|---|
id | String |
Id of element to find parents of | |
selector | String |
Selector to filter parent elements with | |
callback | Function |
function([String]), array of ids |
Void
Retrieve information about all tagtypes
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([Object Tagtype]), array of tagtypes with id, name and config object |
Void
Get information about the given tagtype
Name | Type | Description | |
---|---|---|---|
id | String |
The element id | |
callback | Function |
function(Object Tagtype), tagtype object with id, name and config object |
Void
Clears the editor contents
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Boolean) |
Void
Insert a string into the editor
Name | Type | Description | |
---|---|---|---|
string | String |
The string that should be inserted | |
callback | Function |
function(String), id of the newly inserted element if it has one |
Void
Insert an element into the editor
Note that the HTML of the element is what will be transferred, and nothing else! The element will be given the class dp-plugin-element, and given a unique ID (if none is present)
Name | Type | Description | |
---|---|---|---|
element | Element |
The element that should be inserted | |
options | Object Function |
(can be omitted) Options object, supports option 'select' - set to true to automatically select the inserted element | |
callback | Function |
function(String), id of the newly inserted element | Optional |
Void
Remove classes from the element an element in the article
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
classes | Array |
Array of class names | |
callback | function |
function(Boolean) |
Void
Add new classes to an element
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
classes | Array |
Array of class names | |
callback | function |
function(Boolean) |
Void
Mark an element as currently selected (green border with default styling)
Name | Type | Description | |
---|---|---|---|
id | String |
Id of the element | |
callback | function |
function(Boolean) |
Void
Sets the attribute of the element with the given ID to value
Name | Type | Description | |
---|---|---|---|
id | String |
The ID of the element to set the attribute on | |
attribute | String |
The attribute to set | |
value | String |
What to set the attribute to | |
callback | Function |
function(Boolean) |
Void
Sets a style of the element with the given ID to value
Name | Type | Description | |
---|---|---|---|
id | String |
The ID of the element to set the attribute on | |
attribute | String |
The style attribute to set | |
value | String |
What to set the attribute to | |
callback | Function |
function(Boolean) |
Void
Initialize pre registered menus
Available options are: simplePluginMenu, editContext, deleteButton, floatButtons
Name | Type | Description | |
---|---|---|---|
menus | Array |
Array of menu names | |
callback | Function |
function(Boolean) |
Void
Opens the plugin editor for a given element.
Name | Type | Description | |
---|---|---|---|
id | String |
Plugin element ID |
Void
Returns the total number of words in the currently open article.
Name | Type | Description | |
---|---|---|---|
callback | Function |
Receives the total word count as its single parameter |
Void
Returns the total number of characters in the currently open article.
Name | Type | Description | |
---|---|---|---|
callback | Function |
Receives the total character count as its single parameter |
Void
Update one data option of the referenced embedded asset
Name | Type | Description | |
---|---|---|---|
dpArticleId | Number |
DrPublish's embedded asset id | |
key | String |
Name of the property | |
value | String |
Value of the property | |
callback | Function |
Receives the total character count as its single parameter |
Void
Update all asset data of the referenced embedded asset
Name | Type | Description | |
---|---|---|---|
data | Object |
Updated data | |
callback | Function |
Receives the total character count as its single parameter |
var data = {
internalId: assetDpArticleId,
assetElementId: activeAssetId,
assetType: 'picture',
assetSource: PluginAPI.getPluginName(),
resourceUri: fullsizeUrl,
previewUri: fullsizeUrl,
renditions: {
highRes: {uri: fullsizeUrl},
thumbnail: {uri: thumbnailUrl}
},
options: {}
}
PluginAPI.Editor.updateAssetData(data);
Void
Get all data option of the referenced embedded asset
Name | Type | Description | |
---|---|---|---|
dpArticleId | Number |
DrPublish's embedded asset id | |
callback | Function |
Receives the total character count as its single parameter |
Void
Insert an embedded asset inside of an existing one
Name | Type | Description | |
---|---|---|---|
parentElementId | Number |
DOM element id of the receiving asset | |
markup | String |
HTML to inject | |
data | Object |
Asset data | |
callback | Function |
Receives the total character count as its single parameter |
var title = response.data.title ? response.data.title : '';
var caption = response.data.description ? response.data.description : '';
var credit = response.data.byline ? response.data.byline : '';
var source = response.data.source ? response.data.source : '';
var markup = '<div class="dp-article-image-container"><img src="' + fullsizeUrl + '" /></div>';
markup += '<div class="dp-article-image-headline" data-dp-editable-type="textfield" data-dp-editable-name="headline">' + title + '</div>';
markup += '<div class="dp-article-image-caption" data-dp-editable-type="html" data-dp-editable-name="caption">' + caption + '</div>';
markup += '<div class="dp-article-image-credit" data-dp-editable-type="textfield" data-dp-editable-name="credit">' + credit + '</div>';
markup += '<div class="dp-article-image-source" data-dp-editable-type="textfield" data-dp-editable-name="source">' + source + '</div>';
var options = response.data.options ? response.data.options : {};
var callback = function () {
// do something here
};
var rends = renditions || {};
rends.highRes = {uri: fullsizeUrl};
rends.preview = {uri: fullsizeUrl};
var drpdata = {
embeddedTypeId: 5,
isMultiple: true,
assetType: 'picture',
externalId: id,
assetClass: 'dp-picture',
assetSource: 'images',
resourceUri: fullsizeUrl,
previewUri: fullsizeUrl,
renditions: rends,
options: options
};
var insertNested = function () {
PluginAPI.Editor.insertNestedAsset(
selectedSlideshowAsset.id,
markup,
drpdata
};
PluginAPI.Editor.getSelectedPluginElement(insertNested);
Void
Insert an embedded asset
Name | Type | Description | |
---|---|---|---|
markup | String |
HTML to inject | |
data | Object |
Asset data | |
callback | Function |
Receives the total character count as its single parameter |
var title = response.data.title ? response.data.title : '';
var caption = response.data.description ? response.data.description : '';
var credit = response.data.byline ? response.data.byline : '';
var source = response.data.source ? response.data.source : '';
var markup = '<div class="dp-article-image-container"><img src="' + fullsizeUrl + '" /></div>';
markup += '<div class="dp-article-image-headline" data-dp-editable-type="textfield" data-dp-editable-name="headline">' + title + '</div>';
markup += '<div class="dp-article-image-caption" data-dp-editable-type="html" data-dp-editable-name="caption">' + caption + '</div>';
markup += '<div class="dp-article-image-credit" data-dp-editable-type="textfield" data-dp-editable-name="credit">' + credit + '</div>';
markup += '<div class="dp-article-image-source" data-dp-editable-type="textfield" data-dp-editable-name="source">' + source + '</div>';
var options = response.data.options ? response.data.options : {};
var callback = function () {
// do something here
};
var rends = renditions || {};
rends.highRes = {uri: fullsizeUrl};
rends.preview = {uri: fullsizeUrl};
var drpdata = {
embeddedTypeId: 5,
isMultiple: true,
assetType: 'picture',
externalId: id,
assetClass: 'dp-picture',
assetSource: 'images',
resourceUri: fullsizeUrl,
previewUri: fullsizeUrl,
renditions: rends,
options: options
};
PluginAPI.Editor.insertEmbeddedAsset(markup, drpdata, callback);
Void
This class is used for communicating with the article, typically setting and getting values of metadata or in the article content itself.
Void
Give focus to yourself
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Boolean), called as the plugin gets focus |
Void
Give focus to yourself
Void
Start the given plugin
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the plugin as defined on publication settings | |
options | Object |
Options for initializing the plugin | |
callback | Function |
function(Boolean), called after plugin is started |
Void
Void
Stop the given plugin
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the plugin, as defined on publication config |
Void
Void
Get the id of the article currently edited
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Int), id of the current article |
Void
Get the guid of the article package currently edited
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Int), id of the current article |
Void
Get the guid of the article package currently edited
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Int), id of the current article |
Void
Clear the meta information summary
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Boolean), called when meta data has been cleared |
Void
Get tags used in the article
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([Object Tag]), array with tags connected to an article |
Void
Retrieve custom meta value for the article
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the custom meta value | |
callback | Function |
function(Object), the parameter is an object containing the given custom meta value |
Void
Set custom meta value for the article
Name | Type | Description | |
---|---|---|---|
name | String |
Name of the meta value | |
value | Object |
Value to set | |
callback | Function |
function() |
Void
Marks article model as having meta data changes
Name | Type | Description | |
---|---|---|---|
callback | Function |
function() |
Void
Set tags for the article
Name | Type | Description | |
---|---|---|---|
tags | Array |
List of tags that should be set | |
save | Boolean |
Set to true to force save once the tags are updated | |
callback | Function |
function(Boolean), called when tags have been set |
Void
Add tag for the article
Name | Type | Description | |
---|---|---|---|
tags | Array |
Tags to be added | |
errorFunction | Function |
called if error | |
callback | Function |
function(Boolean), called when tag has been set |
Void
Add tag for the article
Name | Type | Description | |
---|---|---|---|
tag | String |
Tag to be added | |
errorFunction | Function |
called if error | |
callback | Function |
function(Boolean), called when tag has been set |
Void
Add tags for the article
Name | Type | Description | |
---|---|---|---|
tags | String |
Tags to be added | |
errorFunction | Function |
called if error | |
callback | Function |
function(Boolean), called when tag has been set |
Void
Remove tag from article
Name | Type | Description | |
---|---|---|---|
tag | String |
Tag to remove | |
callback | Function |
function(Boolean), called when tag has been removed |
Void
Get the selected categories
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([String]), array with category ids |
Void
Save the currently selected categories
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Boolean), called when categories has been saved |
Void
Set selected categories
Name | Type | Description | |
---|---|---|---|
categories | Array |
List of category IDs that should be set | |
callback | Function |
function(Boolean), called when categories have been set |
Void
Add the given categories to the list of categories
Name | Type | Description | |
---|---|---|---|
categories | Array |
List of category IDs to add | |
callback | Function |
function(Boolean), called when the categories have been set |
Void
Remove the given categories from the list of categories
Name | Type | Description | |
---|---|---|---|
categories | Array |
List of category IDs to remove | |
callback | Function |
function(Boolean), called when the categories have been removed |
Void
Set the main category of the current article
Name | Type | Description | |
---|---|---|---|
category | Number |
The ID of the category to set as the main category | |
callback | Function |
function(Boolean), called when the main category has been set |
Void
Get the source set for the article
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(String), name of the source |
Void
Set the source for the article
Name | Type | Description | |
---|---|---|---|
value | String |
The new value to be set as source | |
callback | Function |
function(Boolean), called when the source has been set |
Void
Get the status for the article
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(String), current status |
Void
Set the status for the article
Name | Type | Description | |
---|---|---|---|
status | String |
The new status to be set (draft, waiting, published) | |
callback | Function |
function(Boolean), called when the source has been set |
Void
Get the published-date
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(String), current published datetime |
Void
Set the published-date
Name | Type | Description | |
---|---|---|---|
published | String |
Date to be set (YYYY-MM-DD HH:MM:SS) | |
callback | Function |
function(Boolean), called when done |
Void
Get the authors set in the article
Name | Type | Description | |
---|---|---|---|
callback | Function |
function([String]), currently set authors |
Void
Set authors for the article
Name | Type | Description | |
---|---|---|---|
authors | Array |
List of authors that should be set | |
callback | Function |
function(Boolean), called when it has been set |
Void
Add the given authors to the list of authors
Name | Type | Description | |
---|---|---|---|
authors | Array |
List of authors to add | |
callback | Function |
function(Boolean), called when it has been set |
Void
Remove the given authors from the list of authors
Name | Type | Description | |
---|---|---|---|
authors | Array |
List of authors to remove | |
callback | Function |
function([String]), author list as it is after the authors has been removed |
Void
Set the keyword-list on the article
Name | Type | Description | |
---|---|---|---|
keywords | Array |
List of keywords to add | |
callback | Function |
Function to call when keywords have been set |
Void
Get the current set of keywords on the article
Name | Type | Description | |
---|---|---|---|
callback | Function |
Function to call with the result |
Void
Gets the current article content
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object Content) |
Void
Updates current article content
Name | Type | Description | |
---|---|---|---|
content | String |
The new content for the article | |
callback | Function |
function(Boolean), called when it has been set |
Void
Get the article type of the current article
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Int) |
Void
Set the article type of the current article
Name | Type | Description | |
---|---|---|---|
articletypeId | Number |
The new article type of the article | |
callback | Function |
function(Boolean), called when it has been set |
Void
Maximize the plugin view
Name | Type | Description | |
---|---|---|---|
title | String |
Title to give the maximized view | |
onClose | function |
Function to call when the window is closed/minimized |
Void
Void
Restore the plugin pane to the default size
Name | Type | Description | |
---|---|---|---|
callback | function |
Callback to call after everything is done |
Void
Restore the plugin pane to the default size
Void
Get the current byline
Name | Type | Description | |
---|---|---|---|
callback | function |
function(String), xml string with the current byline |
Void
Set the byline
Name | Type | Description | |
---|---|---|---|
byline | String |
XML version of byline to use | |
save | Boolean |
If true, force save after updating byline information | |
callback | Function |
function(Boolean), called when it has been set |
Void
Set geolocation
Name | Type | Description | |
---|---|---|---|
geolocations | Object |
The location to set | |
callback | Function |
function(Boolean), called when it has been set |
Void
Get geolocation
Name | Type | Description | |
---|---|---|---|
callback | Function |
function(Object), retrieves the currently set geo location |
Void
Fetches a list of all properties available to an article.
Name | Type | Description | |
---|---|---|---|
callback | Function |
Callback called with an array of property objects. |
Void
Updates and saves one or more property values. The input is a simple object with property names and their new value. The supplied callback is called with an updated list of properties.
Name | Type | Description | |
---|---|---|---|
properties | Object |
An object of property names and corresponding values. | |
callback | Function |
Callback called with an updated list of properties. |
PluginAPI.Article.setProperties({
fooProperty: "bar",
barProperty: "foo"
}, function(properties) {
// Returns a complete and updated list of properties.
})
Void
Updates and saves a single property.
Name | Type | Description | |
---|---|---|---|
name | String |
The property to update. | |
value | Object |
The updated value. | |
callback | Function |
Callback called with an updated list of properties. |
Void
Documentation generated with doxdox.