Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

aui/flag with standalone website

costamarco July 6, 2015

I tried to use the aui flags but it doesn't work. (AUI 5.7.30)

I downloaded the aui framework and I created the following html page

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE">
<title>TEST</title>
<link rel="stylesheet" href="assets/libs/aui/css/aui.css" media="all">
<link rel="stylesheet" href="assets/libs/aui/css/aui-experimental.css"
	media="all">
<!--[if IE 9]><link rel="stylesheet" href="assets/libs/aui/css/aui-ie9.css" media="all"><![endif]-->
<script src="assets/libs/aui/js/aui-dependencies.js"></script>
<script src="assets/libs/aui/js/aui.js"></script>
<script src="assets/libs/aui/js/aui-experimental.js"></script>
<script src="assets/libs/aui/js/aui-soy.js"></script>
<script type="text/javascript">

var titles = ['Backup stale', 'Success!', 'Destructive operation!', 'Backing up attachments', 'Persistent info', 'Could not watch the page'];
var types = ['info', 'success', 'error', 'warning', 'info', 'info'];
var persistence = [false, false, false, false, true, false];
var bodies = ['This JIRA instance was last backed up on Thursday, 18 September 2011.',
                'You have backed up your JIRA system to C:/backups/JIRA.90383.93483.xml.',
                '<p>Attachments will not be backed up. This needs to be done manually.</p>' +
                '<ul class="aui-nav-actions-list">' +
                    '<li><a href="#">Why?</a></li>' +
                    '<li><a href="#">Find out how</a></li>' +
                '</ul>',
                'Data import will wipe all existing JIRA content - make sure you backup first!',
                'You can not close me',
                '<p>I have actions</p>' +
                '<ul class="aui-nav-actions-list">' +
                    '<li><a href="#">Action 1</a></li>' +
                    '<li><a href="#">Action 2</a></li>' +
                    '<li><a href="#">Action 3</a></li>' +
                '</ul>'];
require(['aui/flag'], function(flag) {
    function showMessage(messageNumber) {
        flag({
           type: types[messageNumber],
           title: titles[messageNumber],
           persistent: persistence[messageNumber],
           body: bodies[messageNumber]
        });
    }
    var messageNumber = 0;
    AJS.$("#next-flag-show-button").click(function() {
        if (messageNumber < 6) {
            showMessage(messageNumber++);
        } else {
            AJS.$("#next-flag-show-button").html('No more flags to show');
        }
    });
});
    
</script>
</head>
<body>

	<button id="next-flag-show-button" class="aui-button">Show
		next flag</button>
</body>
</html>

 

When I load this page I get the following error: require is not defined

Did I forgot something to include? RequireJS? Almond?

 

Best regards

Marco

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2015

Does the solution here work for you?

https://ecosystem.atlassian.net/browse/AUI-2928

costamarco July 6, 2015

Hi Timothy. No...it doesn't work

TAGS
AUG Leaders

Atlassian Community Events