How to Customise the Login Gadget?

srinivasp
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.
March 22, 2012

I need to customize the login screen and so tried with script as it is a simple text change but i am unable to get the references of the dom elements. Is there any easy way to customize the Login gadget other than the way specified in documentation (http://confluence.atlassian.com/display/JIRAKB/How+to+Customise+the+Login+Gadget?focusedCommentId=268730494#comment-268730494)?

4 answers

1 vote
AddteqS November 13, 2012

Hi Spatruni,

This is how we have managed to get reference of the DOM elements from the login gadget:

//recursive function until element is detected function checkElement(){
        setTimeout(function() {
		var iframe = document.getElementById('gadgetID');
		var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
		var element = innerDoc.getElementById('elementID');
		if(typeof(element) !== 'undefined' && element != null) {
			alert('DOM Element is detected');
                        alert(element);
		}
		else{
		        checkElement();
		}
	},250);
};

AJS.toInit(function() {
	AJS.$(window).load(function() {	
                //check for iframe loaded. This is good with browser forward and back button reload 		AJS.$(".gadget-iframe").ready(function(){
			checkElement();
		});
	});
});

0 votes
srinivasp
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.
March 30, 2012

My requirement is to remove the hyperlink "Can't access your account" from the login gadget. So instead of editing the soy file which is mentioned in the documentation, i edited the property "gadget.login.forgotpassword" from the JiraWebActionSupport.properties property file. Hence resolved.

Kate August 14, 2012

Hi! how did you edit this property?

srinivasp
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.
August 14, 2012

Make the property value to blank.

0 votes
Dennis Kromhout van der Meer
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.
March 26, 2012

Unfortunately there is no other because the login gadget is loaded via an iframe, which makes it very hard to get to the DOM with javascript. The jar customization is currently the only way to go, If your company does not have the required time/skill to make this happen, I'm more than happy to find the best 3rd party expert to help you based on your requirements.

0 votes
srinivasp
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.
March 22, 2012

Hi Atlassians,

Any comments on this please??

Thanks!

Suggest an answer

Log in or Sign up to answer