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

How to include a web resource in only view page context in confluence?

Neeraj Bodhe February 16, 2015

I have tried using 2 contexts namely "page" and "editor" for confluence 5.7 in  my plugin

As per my observation, the resources like js or css files are affecting the confluence editors css in v5.7.

In the previous versions of confluence, the edit page was populated with a Iframe of wysing editor and so i guess my JS and CSS files didn't have an effect on them.

But the edit page is changed in v5.7 and the plugin CSS resources in page context also now have effect in edit page section.

 

Is there a way through which i can just include my JS or CSS resources in only view page mode in confluence.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Steve Gerstner [bridgingIT]
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.
February 16, 2015

Hi Neeraj,

 

Write a little javascript which identifies your environment (view or edit) and add a class on the body element.

Then you can work with this wrapping class in your css.

In js it should be no problem to handle this limitation.

 

Regards

 

Steve

Neeraj Bodhe February 16, 2015

Does a AJS variable of identifying the editing mode exist? can be useful. Not the ideal solution but maybe i can see if it is completely applicable in case of my problem here.

Stephen Deutsch
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.
February 16, 2015

Hi Neeraj, one option is AJS.params.browsePageTreeMode

Neeraj Bodhe February 16, 2015

Thank you Stephen. In case if you come across any solution regarding the context itself in future, then do post.

TAGS
AUG Leaders

Atlassian Community Events