forked from imod/managed-scripts-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-20271 : Added script arg labels
- Loading branch information
ganncamp
committed
Oct 25, 2013
1 parent
ced7636
commit 6f7b3ce
Showing
5 changed files
with
229 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 69 additions & 67 deletions
136
src/main/resources/org/jenkinsci/plugins/managedscripts/ScriptBuildStep/config.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,67 +1,69 @@ | |||
<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: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"> | ||
|
|
||
<st:adjunct assumes="org.kohsuke.stapler.framework.prototype.prototype" includes="org.kohsuke.stapler.bind"/> | <st:adjunct assumes="org.kohsuke.stapler.framework.prototype.prototype" includes="org.kohsuke.stapler.bind"/> | ||
|
|
||
<st:once> | <st:once> | ||
<script type="text/javascript" src="${rootURL}/plugin/managed-scripts/js/managed-scripts.js" /> | <script type="text/javascript" src="${rootURL}/plugin/managed-scripts/js/managed-scripts.js" /> | ||
</st:once> | </st:once> | ||
<j:choose> | <j:choose> | ||
<j:when test="${empty(descriptor.availableBuildTemplates)}"> | <j:when test="${empty(descriptor.availableBuildTemplates)}"> | ||
<f:entry title=""> | <f:entry title=""> | ||
<div> | <div> | ||
No build templates are defined. Please define one | No build templates are defined. Please define one | ||
<a href="/configfiles">here</a>. | <a href="/configfiles">here</a>. | ||
</div> | </div> | ||
</f:entry> | </f:entry> | ||
</j:when> | </j:when> | ||
<j:otherwise> | <j:otherwise> | ||
<f:entry title="${%Script}" field="buildStepContent"> | <f:entry title="${%Script}" field="buildStepContent"> | ||
<select name="buildStepId" onChange="ms_initDetailLink('${rootURL}', this);ms_showParams(this, this.value);"> | <select name="buildStepId" onChange="ms_initDetailLink('${rootURL}', this);ms_showParams(this, this.value);"> | ||
<option value="">(Default)</option> | <option value="">(Default)</option> | ||
<j:forEach var="inst" items="${descriptor.availableBuildTemplates}" varStatus="loop"> | <j:forEach var="inst" items="${descriptor.availableBuildTemplates}" varStatus="loop"> | ||
<j:choose> | <j:choose> | ||
<j:when test="${inst.id == instance.buildStepId}"> | <j:when test="${inst.id == instance.buildStepId}"> | ||
<option value="${inst.id}" selected="selected">${inst.name} - ${inst.comment}</option> | <option value="${inst.id}" selected="selected">${inst.name} - ${inst.comment}</option> | ||
</j:when> | </j:when> | ||
<j:otherwise> | <j:otherwise> | ||
<option value="${inst.id}">${inst.name} - ${inst.comment}</option> | <option value="${inst.id}">${inst.name} - ${inst.comment}</option> | ||
</j:otherwise> | </j:otherwise> | ||
</j:choose> | </j:choose> | ||
</j:forEach> | </j:forEach> | ||
</select> | </select> | ||
<a target="_blank" name="showDetailLink" href="" style="display:none;" onclick="window.open(this.href,'window','width=900,height=640,resizable,scrollbars,toolbar,menubar') ;return false;"> view selected script</a> | <a target="_blank" name="showDetailLink" href="" style="display:none;" onclick="window.open(this.href,'window','width=900,height=640,resizable,scrollbars,toolbar,menubar') ;return false;"> view selected script</a> | ||
<div name="argumentDescription" /> | <div name="argumentDescription" id="argumentDescription"/> | ||
<f:block> | <f:block> | ||
<table> | <table name="scriptBuildStepArgs" id="scriptBuildStepArgs"> | ||
<f:optionalBlock name="defineArgs" inline="true" title="${%Define arguments}" checked="${!empty(instance.buildStepArgs)}" help="/plugin/managed-scripts/help-defineArgs.html"> | <f:optionalBlock name="defineArgs" inline="true" title="${%Define arguments}" checked="${!empty(instance.buildStepArgs)}" help="/plugin/managed-scripts/help-defineArgs.html"> | ||
<f:entry> | <f:entry> | ||
<f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1"> | <f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1"> | ||
<table width="100%"> | <table width="100%"> | ||
<f:entry> | <f:entry> | ||
<input type="text" name="arg" value="${arg}" size="80"/> | <div name="argName"><st:nbsp/></div> | ||
<input type="button" name="delete_button" value="${%Delete}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;" /> | <input type="text" name="arg" value="${arg}" size="80"/> | ||
<input type="button" name="add_button" value="${%Add argument}" class="repeatable-add show-if-last" /> | <input type="button" name="delete_button" value="${%Delete}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;" /> | ||
</f:entry> | <input type="button" name="add_button" onClick="ms_labelArgs()" value="${%Add argument}" class="repeatable-add show-if-last" /> | ||
</table> | </f:entry> | ||
</f:repeatable> | </table> | ||
</f:entry> | </f:repeatable> | ||
</f:optionalBlock> | </f:entry> | ||
</table> | </f:optionalBlock> | ||
</f:block> | </table> | ||
</f:entry> | </f:block> | ||
</j:otherwise> | </f:entry> | ||
</j:choose> | </j:otherwise> | ||
<st:bind var="desc" value="${descriptor}"/> | </j:choose> | ||
<st:once> | <st:bind var="desc" value="${descriptor}"/> | ||
<script type="text/javascript"> | <st:once> | ||
Event.observe(window, 'load', function() { | <script type="text/javascript"> | ||
var all = new Array(); | Event.observe(window, 'load', function() { | ||
all = document.getElementsByName('buildStepId'); | var all = new Array(); | ||
for(var i = 0; i < all.length; i++) { | all = document.getElementsByName('buildStepId'); | ||
ms_initDetailLink('<j:out value="${rootURL}" />', all.item(i)); | for(var i = 0; i < all.length; i++) { | ||
ms_showParams(all.item(i), all.item(i).value); | ms_initDetailLink('<j:out value="${rootURL}" />', all.item(i)); | ||
} | ms_showParams(all.item(i), all.item(i).value); | ||
}); | ms_getArgs(all.item(i), all.item(i).value); | ||
</script> | } | ||
</st:once> | }); | ||
</j:jelly> | </script> | ||
</st:once> | |||
</j:jelly> |
Oops, something went wrong.