Can I change the background color of zoom lense in livesearch macro

Sridevi Dwaraganath December 3, 2019

Can I change the background color of zoom lense in livesearch macro

1 answer

0 votes
Dominic Lagger
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.
December 4, 2019

Hi @Sridevi Dwaraganath 

Out of the box, this isn't possible.

The only way I could think of, would be an user macro, which includes the live macro and some javascript and css, where you would change the background-color.

Are you familiar with User Macros, Javascript and CSS? 

Regards, Dominic

Sridevi Dwaraganath December 4, 2019

Hi @Dominic Lagger ,

   Thanks for the reply, Nope i am not familiar, sample code will be of real help.

Dominic Lagger
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.
December 5, 2019

Hi @Sridevi Dwaraganath 

This is a possible user macro:

## Macro title: Live Search Colored
## Macro has a body: N
##
## Developed by: Dominic
## Date created: 05/12/2019
## Installed by: Dominic

## This is an example macro
## @param Color:title=Color|type=string|default=red|desc=Color by name or by HEX

<div id="livesearchmacro">
<ac:structured-macro ac:name="livesearch" ac:schema-version="1" ac:macro-id="842a4a89-897c-419a-b917-b84087bd1281">
<ac:parameter ac:name="size">large</ac:parameter>
<ac:parameter ac:name="placeholder">Live search</ac:parameter>
</ac:structured-macro>
</div>
<script>
var input = document.getElementById("livesearchmacro").getElementsByClassName("text")[0]
input.style.backgroundColor = "$paramColor"
</script>

Note:

  • The user macro just includes the "Live Search" macro in "Storage Format"
  • If you want other options from the "Live Search" macro, just copy the generated storage format into this user macro

Hope this helps. Let me know, when you have further questions

Regards, Dominic

Sridevi Dwaraganath December 5, 2019

I dont know why i am not able to see user macro :-( in confluence. Version which i am using is 6.13.6. For now i hacked it a bit like this using div style

 

<div style="vertical-align: top;width: 280.0px;border-radius: 5.0px;background-color: rgb(236,237,240);">
<ac:structured-macro ac:macro-id="0b124fdb-5328-4c1c-878b-0c931f1c721f" ac:name="livesearch" ac:schema-version="1">
</ac:structured-macro>
</div>

Dominic Lagger
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.
December 5, 2019

For user macros you need to be an administrator. 

See the documentation here: https://confluence.atlassian.com/doc/writing-user-macros-4485.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events