Skip to content

Commit

Permalink
[JENKINS-66729] Un-inlining UsageStatistics/footer.jelly (CSP issue) …
Browse files Browse the repository at this point in the history
…#Hacktoberfest (jenkinsci#5787)

* Unlined UsageStatistics/footer.jelly

* String Fix

* String Fix

* Fixing String Issue

* Batch suggestions Fix
  • Loading branch information
abhijeet007rocks8 authored Oct 20, 2021
1 parent 71b0592 commit 6adc9c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Behaviour.addLoadEvent(function() {
var targetDiv = document.querySelector('#usage-stats-div');
var statData = targetDiv.getAttribute('data-inserted-from-java');
loadScript('https://usage.jenkins.io/usage-stats.js?'+statData);
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:if test="${it.due}">
<j:set var="statData" value="${it.statData}"/>
<j:if test="${statData != null}">
<script>
Behaviour.addLoadEvent(function() {
loadScript("https://usage.jenkins.io/usage-stats.js?${statData}");
});
</script>
<j:if test="${it.due}">
<j:set var="statData" value="${it.statData}"/>
<j:if test="${statData != null}">
<div id="usage-stats-div" data-inserted-from-java="${statData}"></div>
<st:adjunct includes="hudson.model.UsageStatistics.footer-resources" />
</j:if>
</j:if>
</j:if>
</j:jelly>

0 comments on commit 6adc9c0

Please sign in to comment.