Skip to content
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

[JENKINS-74119] Remove inline onClick handlers in PowerShellBuildScript/config.jelly #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
<f:select />
</f:entry>

<a target="_blank" style="display:none;" href="" onclick="window.open(this.href,'window','width=900,height=640,resizable,scrollbars,toolbar,menubar') ;return false;">view selected script</a>
<st:adjunct includes="org.jenkinsci.plugins.managedscripts.PowerShellBuildStep.powershell-build-step"/>
<a target="_blank" style="display:none;" href="" class="powershell-script-window-link">view selected script</a>

<f:optionalBlock name="defineArgs" inline="true" title="${%Define arguments}" checked="${!empty(instance.buildStepArgs)}" help="/plugin/managed-scripts/help-defineArgs_powershell.html">
<f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1">
<f:entry>
<div name="argName"><st:nbsp/></div>
<input type="text" name="arg" value="${arg}" size="80"/>
<input type="button" name="delete_button" value="${%Delete}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;" />
<input type="button" name="add_button" onClick="ms_labelArgs()" value="${%Add argument}" class="repeatable-add show-if-last" />
<input type="button" name="add_button" value="${%Add argument}" class="repeatable-add show-if-last" />
</f:entry>
</f:repeatable>
</f:optionalBlock>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
document.addEventListener("DOMContentLoaded", function () {
const scriptLink = document.querySelector(".powershell-script-window-link");

scriptLink.addEventListener("click", function (e) {
e.preventDefault();
window.open(e.href, "window", "width=900,height=640,resizable,scrollbars,toolbar,menubar");
});
});