Missed Team ’24? Catch up on announcements here.

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

JS file not getting loaded in "editor" context of page editing mode in confluence plugin. Is this originally a confluence issue?

Neeraj Bodhe April 7, 2014

When I include a js file in my confluence plugin and specify its context in atlassian-plugin.xml as "editor", the js file doesnt get loaded in some cases when we are in editing mode of a page. I will specify below the conditions in which this context works and in which it doesnt

Not Working

1. When we open a page in editing mode from the edit option on the page. My validation js file doesnt get included in the edit mode of the page.

Working

1. When we are creating a new page, this js file gets included in the editing mode or creating mode of the page which is the same.

2. When we open a page in editing mode from the edit option on the page and again after this we reload or refresh the url the js file gets loaded from the editor context.

I want to know if i am doing anything wrong here, and if so then how do i correct it to get the not working part, working.

or whether this is a atlassian confluence issue?

(Note :- Moreover, the scenario works well for Documentation theme in confluence, but breaks down for Default theme.)

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
udogan May 9, 2014

Did you solve this issue? I have the same problem.

0 votes
Stefan Baader May 17, 2019

I have the same problem and question. I want to fire jQuery from Page Layout template. Something like

#if ($mode == "edit")<button id="copySection">Copy layout section</button>#end

and more jQuery which is injecting content into a layout section of the page.

The button is shown only when the page in edit mode is manually reloaded. Also the jQuery runs only after a reload.

No idea how to trigger to run after "Edit" button is clicked an edit mode is started.

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2015

Hi all, I'm just solving the similar problem. I figured out that page in 'edit' mode is only rendered with JS, so it is not RELOADED and document.ready is not invoked. I guess it is the problem you and I have. When the page is reloaded manually in the browser, document.ready is invoked and everything works fine. I tried to listen for URL change, but it doesn't work, so if you will have any idea, I would appreciate any help :) Thank you

0 votes
Neeraj Bodhe May 11, 2014

nope. I havnt found a solution for this problem yet.

I am thinking that this is a confluence issue.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events