Members
-
<constant> DISABLE_ALL_ERROR_HANDLERS
-
Constant that allows to easily disable all error handlers
- Source:
Methods
-
addonCategory(category) → {bitbucket/util/navbuilder.Builder}
-
Parameters:
Name Type Description categorystring The category of requests to filter by.
- Source:
Returns:
-
createEmptyPage() → {Promise}
-
Return a promise resolved with an empty REST page
- Source:
Returns:
- Type
- Promise
-
fetchThemefromAPI() → {Promise}
-
fetchThemefromAPI doescall to fetch theme from user preferences: GET latest/users/admin/settings
NOTE: this will be removed once we have plugin integrated for setting / getting theme preferences.- Source:
Returns:
- a promise that resolves with the result of the API call
- Type
- Promise
-
getUserPreferredTheme() → {Promise}
-
Verifies if the module had initialize, if not it will call updateUserPreferredTheme,
to do it and once it resolves, it will resolve the current theme.We use a promise for 'get' to simulate a service call that will be implemented in
later releases.- Source:
Returns:
- a promise that resolves with the current theme
- Type
- Promise
-
init()
-
Initialize theme module and adds media listeners.
- Source:
-
mergeStrategies() → {bitbucket/util/navbuilder.Builder}
-
- Source:
Returns:
-
setBitbucketTheme(theme)
-
Sets the required attributes by Atlaskit and AUI to turn ON/OFF their Dark themes
Parameters:
Name Type Description themeObject Any of the available themes in THEME_CONST.theme
- Source:
-
setThemeToAPI() → {Promise}
-
setThemeToAPI does an API call to set theme in user preferences: POST latest/users/admin/settings.
NOTE: this will be removed once we have plugin integrated for setting / getting theme preferences.
POST latest/users/admin/settings- 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() → {Promise}
-
Reads the current theme from localStorage and update the attributes accordingly.
If the theme is not valid or undefined, it will set the default theme.We use a promise for 'update' due to the dependency to 'setUserPreferredTheme'.
- Source:
Returns:
- a promise that resolves with the current theme
- Type
- Promise