Monday, March 9, 2009
The JavaScript API documentation on the support wiki has been updated to reflect many new additions that have been made available over the past few months. Most significantly, these include methods and properties to access and manage page relationships from the Organize tab of the editing screen, the new fields on the Properties tab of the editing screen, and the ability to resize images.
The following new properties and functions are now documented for these classes:
Page Class
- addChild() - Adds a page to the current page's list of children.
- allowRelations - Access to the new page property.
- children - Returns the array of child pages.
- excerpt - Access to the new page property.
- pageDate - Access to the new page property.
- parents - Returns the array of parent pages.
- redirect - Access to the new page property.
- versionChildren - Returns the version-specific list of child pages.
- overwriteChildren() - Provides the ability to set all child pages with one call.
- removeChild() - Removes a single page from the list of child pages.
Site Class
- eventPages - Returns an array of all EditMeScriptEvent pages.
- pageDates() - Returns the list of distinct page dates for the whole site or among a set of child pages.
- getPageMonths() - Returns the list of distinct months in page dates for the whole site or a set of child pages.
- getPagesByDate() - Provides a flexible filter to retrieve a list of pages by page date value.
- getPagesByType() - Returns a list of pages with the specified MIME type.
- getPagesStartingWith() - Returns a list of pages with a specified name prefix.
- getRootPages() - Returns a list of pages that have one or more child pages but no parent pages.
- getSpecialPages() - Returns the list of pages managed by the Templates and Special Pages screen.
Util Class
- contains() - Indicate the presense of a substring.
- endsWith() - Determine if a string ends with another string.
- md5() - Create an MD5 hash based on a value and key.
- startsWith() - Determine if a string starts with another string.
- trim() - Performs left and right trims on the given string.
Attachment
- resize() - Resizes an image attachment and returns a new attachment object representing the resized image.