-
Notifications
You must be signed in to change notification settings - Fork 43
Enable copy to clipboard on text badges #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
For reasons I do not yet understand, the |
@janfaracik IIRC you made a great effort in modernizing the build history widget. Would you by chance have any idea what may cause my approach here to not work? |
343c260
to
69bfde0
Compare
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Outdated
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Outdated
Show resolved
Hide resolved
@@ -26,6 +26,7 @@ THE SOFTWARE. | |||
<?jelly escape-by-default='false'?> | |||
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:st="jelly:stapler"> | |||
<st:adjunct includes="com.jenkinsci.plugins.badge.assets"/> | |||
<st:adjunct includes="com.jenkinsci.plugins.badge.copy"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think scripts are not loaded when you insert html into the dom with innerHTML as it is done by the widget. |
As @daniel-beck pointed out it seems to be
I can confirm that the scripts load fine before this change.
Interessting. I would not know how to prevent that from happening tho. |
I gave it another go but for the life of me can not find out what's blocking my script. There is no error anywhere and the CSS file is loaded just fine. |
Just a theory in the old widget after loading the div with the fetched content it was running |
c12545a
to
f4ebb66
Compare
Sorry for the delay, taking a look :) |
Hmm also struggling to figure out why it's not working. I've made some changes to core but still couldn't get it working. Would it be possible/advisable to add an invisible action to the page to load in 'copy.js'? |
Also with 2.463.3 it only works when the badge is already present on initial page load. When the job has no old builds and you click build now once the build appears in the history the copy to clipboard doesn't work here as well. |
#266
Testing done
Submitter checklist