...
The public JavaScript events are placed on the RefinedWiki API namespace: RWA. This is divided into sub-namespaces depending based on functionality. The available namespaces
RWA.Category
ui-expand |
---|
|
/** * * * */
RWA.Category.hideUserCategory = function();
|
ui-expand |
---|
title | hideInlineUserCategoryDialogs |
---|
|
/** * * */
RWA.Category.hideInlineUserCategoryDialogs = function();
|
ui-expand |
---|
|
/** * * * * * * */
RWA.Category.hideCategory = function();
|
ui-expand |
---|
|
/** * * * * * * * * * * * * * * * */
RWA.Category.showCategory = function(key, expandAll, callback);
|
ui-expand |
---|
|
/** * * * * * * * * * */
RWA.Category.toggleSubCategory(subCategory);
|
ui-expand |
---|
title | getActiveCategoryKey |
---|
|
/** * * * * * * * * * */
RWA.Category.getActiveCategoryKey();
|
ui-expand |
---|
|
From version 5.0.2 /** * * * * */
RWA.Category.settings;
|
RWA.Page
ui-expand |
---|
|
From version 5.0.5 /** *
*/
RWA.Page.isFullscreen();
|
ui-expand |
---|
|
From version 5.0.5 /** *
*/
RWA.Page.openFullscreen();
|
ui-expand |
---|
|
From version 5.0.5 /** *
*/
RWA.Page.closeFullscreen();
|
...
Refined for Confluence provides various js events you can listen to. These , which are trigger triggered on the AJS namespace and you . You can bind on them in the following way:
...
// A collapsed category was just opened. Check if we should append our cool feature ...
});
Below you find a list of events available. You hook in on them using the same syntax as above.
Available rw-categories events
ui-expand |
---|
title | Category menu loaded |
---|
|
// Triggered when the top navigation has been populated with the top-level categories.
AJS.bind('rw-categories:menu-loaded', function(e, $el, categories){ });
$el - jQuery object representing the DOM element containing the category menu. This also includes the first 'Dashboard' item if present.e - jQuery Event categories - JSON Array containing all categories loaded in the navigation menu. See other category events for category attributes. |
ui-expand |
---|
title | Collapsed category opened |
---|
|
// Triggered when a collapsable (sub)category is opened within the category dropdown.
// Opening a subcategory will load and render it's content. If the category previously
// has loaded the content is just showed as it's already present in the DOM.
AJS.bind('rw-categories:category-opened', function(e, $el, category){ });
$el - jQuery object representing the DOM element containing the category that has been opened.e - jQuery Event category - JSON object representing the category in question. Some useful attributes include: canEdit: boolean boolean children: Array Array link: Object Object name: string nameKey: string string parentKey: string string subCategories: Array Array themeId: int type: string string
|
ui-expand |
---|
title | Collapsed category closed |
---|
|
// Triggered when a collapsable (sub)category is closed within the category dropdown.
// Closing a subcategory will just hide its content rather than delete it - in order to
// be able to re-render without having to re-fetch the content.
AJS.bind('rw-categories:category-closed', function(e, $el, category){ });
$el - jQuery object representing the DOM element containing the category that has been closed.e - jQuery Event category - JSON object representing the category in question. Some useful attributes include: canEdit: boolean boolean children: Array Array link: Object Object name: string nameKey: string string parentKey: string string subCategories: Array Array themeId: int type: string string
|
ui-expand |
---|
title | Category dropdown open |
---|
|
// Triggers when the category dropdown is opened. At this stage the $el will contain all category elements that will be populated with data.
// If the user is using collapsed subcategories, these elements will only contain the expandable header of the category. In those cases you
// could listen to rw-categories:category-opened and rw-categories:category-closed to get info on when the collapsed categories are toggled.
AJS.bind('rw-categories:category-dropdown-open', function(e, $el, category){ });
e - jQuery Event $el - jQuery object representing the DOM element containing the dropdown wrapper that has been opened. category - JSON object representing the category in question. Some useful attributes include: canEdit: boolean boolean children: Array Array link: Object Object name: string nameKey: string string parentKey: string string subCategories: Array Array themeId: int type: string string
|
ui-expand |
---|
title | Category dropdown closed |
---|
|
// Triggered when the category dropdown is hidden
// selector == rw_category_key_{categoryKey}
// Denotes the id-attribute of the element that has been hidden.
AJS.bind('rw-categories:category-dropdown-closed', function(e, $el, category){ });
e - jQuery Event $el - jQuery object representing the DOM element containing the dropdown wrapper that has been closed. category - JSON object representing the category in question. Some useful attributes include: canEdit: boolean boolean children: Array Array link: Object Object name: string nameKey: string string parentKey: string string subCategories: Array Array themeId: int type: string string
|
Available rw-page events
ui-expand |
---|
|
// Triggered when the fullscreen feature is opened or closed
AJS.bind('rw-page:fullscreen-toggle', function(e, $el, isFullscreen) { });
$el - jQuery object representing the DOM element containing the page. div#rw_main_column.e - jQuery Event isFullscreen - true if the page is currently in fullscreen |
...