As a workaround for this bug: https://jira.atlassian.com/browse/CONF-33273
I'm trying to run the following JS via the "Custom HTML" at the end of HEAD:
<script type="text/javascript"> AJS.toInit(function(){ AJS.$("#rte-button-publish").attr('data-tooltip','(Ctrl + S)'); }); </script>
I've run the JS via console and it works but it doesn't seem to get loaded directly on the page and I cannot figure out why since I followed this https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluenceas far as I can tell.
Any suggestions?
Thanks
Your JS is probably running prior to #rte-button-publish existing on the page. Which is why it works in the console, but not during page load.
I thought that might be the reason but then doesn't "AJS.toInit" take care of that problem? I thought it should but clearly it doesn't. Why not?
Why you no like me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If #rte-button-publish is being injected into the DOM by AJS.toInit() as well, then it might be happening after yours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe the property gets set after I've tried changing it with my hack. Not sure how I could resolve that... The injected property value depends on the OS... Does anybody know the source of the values that get injected? There seems to have been a version where the Save button tooltip is too long which messes up what I'm currently fighting...btw, when I tried to edit my answer above it didn't work at all (using Chrome)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if (!AJS.$("#rte-button-publish").length) alert("all alone");
But that would mean that the code above should create the alert, right? It does on all pages except the edit screen. This is incredibly frustrating... The bug seems to be rare and my clearly not so genius workaround doesn't cut it either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.