It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

Announcement banner depending on page visited Edited

Hi! I have developed a custom announcement banner depending on page visited using an easy frontend coding (html+js+jquery). In my case, I wanted to advise users about login issues on login page. And once logged, advise them about programmed Jira reboot but only on dashboard pages.

This is how I coded announcement banner:

<script type="text/javascript">
(function($) {
.....
    AJS.toInit(function(){
        // init on load
        .....
        if (($('#login-form').length === 1) || ($('#loginform').length === 1)) {
            $('#alert-ACME-ldap').fadeIn(2500);
        } else if ($(location).attr('pathname').indexOf("Dashboard.jspa") !== -1) {
            $('#alert-ACME-reboot').show();
        }
    });
    .....
})(AJS.$);
</script>
<div id="alert-ACME-ldap" style="display: none;">
  <div id="aui-flag-container"><div class="aui-flag" aria-hidden="false" id="upgrade-notification" application="JIRA" severity="warning"><div class="aui-message aui-message-warning warning closeable shadowed"><div class="body">We are working to solve intermittent problems with the Active Directory. That is why JIRA may not let you authenticate. If so, try again in a few minutes and apologize for any inconvenience!</div></div></div></div>
</div>
<div id="alert-ACME-reboot" style="display: none;">
  <div id="aui-flag-container"><div class="aui-flag" aria-hidden="false" id="upgrade-notification" application="JIRA" severity="warning"><div class="aui-message aui-message-warning warning closeable shadowed"><div class="body">Today <b>OCT-9th</b> at <b>16:15h</b> JIRA will be restarted due to maintenance tasks. The downtime will last about 15 minutes. Sorry for any inconvenience caused.</div></div></div></div>
</div>

I would like to share it with this community because maybe could be useful to someone. I also would like to know the opinion of you experts and any advices to correct or improve this code will be welcome.

imagen.pngimagen.png

0 comments

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you