Documentation

1.1.0

Release date: XXXX

  • Manage cookies through the javascript cookie api
  • Manage browser history through the javascript history api
  • Update dialogs to allow the chrome flag
  • Dialog height is now always the height of the iframe.

Dialog chrome flag

Both webitems and dialogs opened from javascript can now be with or without the buttons and header (chrome). This solves the difficult task of styling a dialog opened from javascript to look like other dialogs and enables chromeless dialogs to be opened from webitems.

Opening a dialog with chrome using javascript

For additional options such as header and button text, please refer to the dialog options documentation

AP.require(['dialog'], function(dialog){
    dialog.create({
        key: 'my-dialog-page', // the module key defined in your atlassian-connect.json descriptor file
        chrome: true        // a new config flag specifying that the header and buttons should be added
    });
})

Opening a dialog without chrome using a webitem

Adding the following to your atlassian-connect.json descriptor will create a webitem that opens a chromeless dialog. Previously, all dialogs would open with the header and buttons displayed.

{
    "webItems": [
        {
          "key": "my-dialog-page",
            "url": "/dialog.html",
            "location": "system.top.navigation.bar",
            "context": "addon",
            "weight": 200,
            "target": {
                "type": "dialog",
                "options": {
                    "width": "200px",
                    "height": "200px",
                    "chrome": false
                }
            },
            "name": {
                "value": "Greetings"
            }
        }
    ]
}

Updating your existing dialogs to the correct height

If you specify a height for a dialog with chrome (header and buttons), you will need to subtract 107px. Specifying a height is now deemed as the height of the iframe, not the height of the dialog. The following dialogs will need to be updated:

  • Dialog page (XML Descriptor only)
  • Custom Confluence macro editors
  • Webitems with a target of "dialog"

Issues Resolved

Key Summary
Fixed AC-900 As an Add-on developer, I want to be able to set cookies for handing user preferences, without user having to allow for third-party cookies.

Testing

You can start JIRA or Confluence with Atlassian Connect as follows: