Global

Members

<constant> DISABLE_ALL_ERROR_HANDLERS

Constant that allows to easily disable all error handlers

Source:

<constant> converters

JQMIGRATE : jQuery.parseJSON requires a valid JSON string
http://github.com/jquery/jquery/issues/3973
Prior to 1.9, an ajax call that expected a return data type of JSON or JSONP would consider a return value of an empty string to be a success case,
but return a null to the success handler or promise.
As of 1.9, an empty string returned for JSON data is considered to be malformed JSON (because it is);
this will now throw an error.

Source:

Methods

addonCategory(category) → {bitbucket/util/navbuilder.Builder}

Parameters:
Name Type Description
category string

The category of requests to filter by.

Source:
Returns:
Type
bitbucket/util/navbuilder.Builder

createEmptyPage() → {Promise}

Return a promise resolved with an empty REST page

Source:
Returns:
Type
Promise

getUserPreferredTheme() → {string}

Verifies if the module had initialize, if not it will call updateUserPreferredTheme,
it will return the current theme.

Source:
Returns:
  • current theme
Type
string

init()

Initialize theme module and adds media listeners.

Source:

mergeStrategies() → {bitbucket/util/navbuilder.Builder}

Source:
Returns:
Type
bitbucket/util/navbuilder.Builder

setBitbucketTheme(theme) → {string}

Sets the required attributes by Atlaskit and AUI to turn ON/OFF their Dark themes

Parameters:
Name Type Description
theme Object

Any of the available themes in THEME_CONST.theme

Source:
Returns:

theme - current theme

Type
string

setThemeToAPI() → {Promise}

setThemeToAPI does an API call to set theme in user preferences:

POST rest/atlassian-theme/1/user-preferences

Source:
Returns:
  • a promise that resolves with the current theme
Type
Promise

setUserPreferredTheme() → {Promise}

Sets a new theme if the theme passed inside data is valid, data is used to simulate
a REST call in case this functionality is moved to an API.

We use a promise for 'set' to simulate a service call that will be implemented in
later releases.

Currently it will store the selected theme in client storage.

Source:
Returns:
  • a promise that resolves with the current theme
Type
Promise

updateUserPreferredTheme()

Reads the current theme from attributes and sets the corresponding theme.

Source: