I see that the spaceKey is stored here:
<meta id="confluence-space-key" name="confluence-space-key" content="GHDEV">
...but is that the best source?
Community moderators have prevented the ability to post new answers.
A-ha! AJS.params.spaceKey is probably best.
In fact, there's all manner of handy stuff in the AJS.params JavaScript object on both Confluence and JIRA.
And if you place your own i18n in a hidden fieldset, AJS.params will be populated with your own stuff
e.g. if your plugin has an i18n value...
hello.david=Hello David!
Add the fieldset to the page:
<fieldset class="hidden parameters">
<input type="hidden" id="helloDavid" value="$action.getText('hello.david')">
</fieldset>
...then call AJS.params.helloDavid, you'll get Hello David!
See Confluence UI Guidelines for more info.
The page Atlassian User Interface (AUI) Developer Documentation is also a good source of information for AJS functions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.