Date: Thu, 28 Mar 2024 20:57:01 +0000 (UTC) Message-ID: <1810732948.9.1711659421464@3191de6f0903> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8_2009606551.1711659421464" ------=_Part_8_2009606551.1711659421464 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
lifeincodes-hoverjs is a library that can be used to add hover f= unctionality to Jira Issue Links to all applications.
Version: 1.0.0
This JS library can be used only by customers of Issue Preview for Jira = App (https://marketplace.a= tlassian.com/apps/1220952/issue-preview-for-jira)
Import lifeincodes-hover.min.js in the pages you want the hover.
Import lifeincodes-hover.min.css to give the hover Jira look and feel.
Initialize LifeInCodesHover with a list of parameters.
Parameter name: $
Mandatory: no, but if not passed, $ object must already be defined.
Default value: $
Possible values: a Javascript object representing jQuery $
Comments: Atlassian pages have a wrapper on top of $, so the best practice =
is to use AJS.$ when used in Jira/Confluence/Bamboo pages
Parameter name: source
Mandatory: no
Default value: N/A
Possible values: any string
Comments: A string used as an identifier of the application that calls the =
backend. Can be used for audit purposes
Parameter name: requestHeaders
Mandatory: no
Default value: N/A
Possible values: A map with all the request headers
Parameter name: selector
Mandatory: no
Default value: a
Possible values: any string representing a CSS selector
Comments: A string representing the CSS selector of elements where the hove=
r will be applied
Parameter name: debugMode
Mandatory: no
Default value: false
Possible values: true/false
Comments: If enabled, it will print some events to console + not close the =
hover anymore. Use for debug purposes by the developers of this plugin. Don=
't forget to disable in production
Parameter name: waitTime
Mandatory: no
Default value: 750
Possible values: A int representing after how many milliseconds the backend=
call will be made
Parameter name: getIssueKeyFunc
Mandatory: no
Default value: N/A
Possible values: A valid Javascript function that returns the issue key of =
HTML elements
Comments: The function will be applied on all elements that are returned by=
the selector parameter. The default function returns the correct issue key=
of all issue links in Jira/Confluence/Bamboo pages
Parameter name: disableBrowserTitleHover
Mandatory: no
Default value: true
Possible values: true/false
Comments: If true, the default browser functionality of showing the HTML el=
ements title in a small hover is removed.
Parameter name: backendUrl
Mandatory: yes
Default value: N/A
Possible values: Any string representing a valid rest endpoint
Comments: There are 2 options:
A valid Issue Preview for Jira REST endpoint. If you are connecting from= an application other than Jira/Confluence/Bamboo, a requestHeader must be = passed named Authorization.
An external REST endpoint that will return exactly what the Issue Previe=
w for Jira App endpoint returns. This can be used in case you want to inter=
cept requests/add custom audit functionality/etc. The plugin will append a =
new url parameter named issueKey with the key of the issue link.
We strongly advise not to change the return of the Issue Preview for Jira P=
lugin as it may cause future incompatibility!
Add hover capability to all <a> elements in the page
var opt= ions =3D { selector: "a", backendUrl: "www.my-jira.com:8080/jira", source: 'my-app' }; var lifeInCodesHover =3D new LifeInCodesHover(); lifeInCodesHover.init(options);
Jira basic authentication
// Author= ization needs a base64 encoding of username:password. Example: "admin:admin= " =3D "YWRtaW46YWRtaW4=3D", so var requestHeadersMap; requestHeadersMap['Authorization'] =3D 'Basic YWRtaW46YWRtaW4=3D'; requestHeadersMap['Access-Control-Allow-Origin'] =3D '*'; var options =3D { source: "my-app", selector: "a:not(#header a)", waitTime: 1000, backendUrl: 'www.my-jira.com:8080/jira?customUrlParameter=3DXXX', requestHeaders: requestHeadersMap }; var lifeInCodesHover =3D new LifeInCodesHover(); lifeInCodesHover.init(options);
Jira OAUTH authentication
For this, we recommend you connect to your backend server and connect to Ji=
ra through OAUTH from there.
You will need to set up a user to connect to Jira.
Remember that the user should have access to the Jira project/issue that yo=
u are trying to view or else the REST endpoint will not be rendered.
var optio= ns =3D { source: "my-app", selector: "a", backendUrl: 'www.my-jira.com:8080/jira' }; var lifeInCodesHover =3D new LifeInCodesHover(); lifeInCodesHover.init(options);
Q: What do I need to do to use the hover in a third party app?
A: You will need to include in the page lifeincodes-hover.min.js, lifeincod=
es-hover.min.css, jQuery v3.4.1 or newer and jQuery Nicescroll v3.7.6 or ne=
wer. Then just init an object of type LifeInCodesHover with some options an=
d that's it.
Q: What types of authentication do you support?
A: We have added support for basic authentication by making the request hea=
ders customizable. For Oauth you will have to connect to your own backend U=
RL that will handle authentication before calling the Issue Preview for Jir=
a REST endpoint.
Q: What browsers do you support?
A: The plugin has been tested with Chrome, Mozilla, IE 8+, Edge, Brave brow=
sers.
Vlad Petrescu (vlad@lifeincodes.com)
Alexandru Constantinescu (alex@lifeincodes.com)
Used libraries: