Skip to content

Commit

Permalink
Merge remote-tracking branch 'FarmGeek4Life/tables-to-divs'
Browse files Browse the repository at this point in the history
  • Loading branch information
whitej committed Dec 22, 2020
2 parents c2f7ca5 + 4d9313d commit fe7bfc7
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 45 deletions.
22 changes: 22 additions & 0 deletions src/main/resources/lib/managed_scripts/blockWrapper.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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">
<st:documentation>
This adds a wrapper allowing adding an ID to a field or group of fields that can be targeted by JavaScript
The wrapper will be a `table` tag before 2.264, and a `div` tag after that.

</st:documentation>

<j:choose>
<j:when test="${divBasedFormLayout}">
<div>
<d:invokeBody/>
</div>
</j:when>
<j:otherwise>
<table>
<d:invokeBody/>
</table>
</j:otherwise>
</j:choose>

</j:jelly>
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%Script}" field="buildStepContent">

Expand All @@ -14,22 +14,22 @@
</tr>

<f:block>
<table name="scriptBuildStepArgs" id="scriptBuildStepArgs">
<ms:blockWrapper name="scriptBuildStepArgs" id="scriptBuildStepArgs">
<f:optionalBlock name="defineArgs" inline="true" title="${%Define arguments}" checked="${!empty(instance.buildStepArgs)}" help="/plugin/managed-scripts/help-defineArgs_powershell.html">
<f:entry>
<f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<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" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</f:optionalBlock>
</table>
</ms:blockWrapper>
</f:block>
</f:entry>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:ms="/lib/managed_scripts">

<p>
${%description}
Expand All @@ -35,19 +35,19 @@ THE SOFTWARE.
<j:set var="descriptor" value="${config.descriptor}"/>
<st:include page="id-name-and-comment" class="${descriptor.clazz}"/>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" name="name" value="${arg.name}" size="40" />
<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" value="${%Add argument}" class="repeatable-add show-if-last" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea id="config.content" name="config.content" value="${config.content}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%ID}">
<f:textbox readonly="readonly" name="config.id" value="${config.id}" />
Expand All @@ -21,17 +21,17 @@
<f:textbox readonly="readonly" name="config.comment" value="${config.comment}" />
</f:entry>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" readonly="readonly" name="name" value="${arg.name}" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea readonly="readonly" id="config.content" name="config.content" value="${config.content}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%Script}" field="buildStepContent">
<f:entry field="buildStepId">
Expand All @@ -13,25 +13,25 @@
</tr>

<f:block>
<table name="scriptBuildStepArgs" id="scriptBuildStepArgs">
<ms:blockWrapper 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:entry field="tokenized">
<f:checkbox title="${%Tokenized}" checked="${instance.isTokenized()}" />
</f:entry>
<f:entry>
<f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<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" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</f:optionalBlock>
</table>
</ms:blockWrapper>
</f:block>
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:ms="/lib/managed_scripts">

<p>
${%description}
Expand All @@ -35,19 +35,19 @@ THE SOFTWARE.
<j:set var="descriptor" value="${config.descriptor}"/>
<st:include page="id-name-and-comment" class="${descriptor.clazz}"/>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" name="name" value="${arg.name}" size="40" />
<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" value="${%Add argument}" class="repeatable-add show-if-last" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea id="config.content" name="config.content" value="${config.content}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%ID}">
<f:textbox readonly="readonly" name="config.id" value="${config.id}" />
Expand All @@ -21,17 +21,17 @@
<f:textbox readonly="readonly" name="config.comment" value="${config.comment}" />
</f:entry>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" readonly="readonly" name="name" value="${arg.name}" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea readonly="readonly" id="config.content" name="config.content" value="${config.content}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%Script}" field="buildStepContent">
<f:entry field="buildStepId">
Expand All @@ -13,22 +13,22 @@
</tr>

<f:block>
<table name="scriptBuildStepArgs" id="scriptBuildStepArgs">
<ms:blockWrapper name="scriptBuildStepArgs" id="scriptBuildStepArgs">
<f:optionalBlock name="defineArgs" inline="true" title="${%Define arguments}" checked="${!empty(instance.buildStepArgs)}" help="/plugin/managed-scripts/help-defineArgs_win.html">
<f:entry>
<f:repeatable var="arg" items="${instance.buildStepArgs}" name="buildStepArgs" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<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" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</f:optionalBlock>
</table>
</ms:blockWrapper>
</f:block>
</f:entry>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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">
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:ms="/lib/managed_scripts">

<p>
${%description}
Expand All @@ -35,19 +35,19 @@ THE SOFTWARE.
<j:set var="descriptor" value="${config.descriptor}"/>
<st:include page="id-name-and-comment" class="${descriptor.clazz}"/>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" name="name" value="${arg.name}" size="40" />
<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" value="${%Add argument}" class="repeatable-add show-if-last" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea id="config.content" name="config.content" value="${config.content}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


<?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: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" xmlns:ms="/lib/managed_scripts">

<f:entry title="${%ID}">
<f:textbox readonly="readonly" name="config.id" value="${config.id}" />
Expand All @@ -21,17 +21,17 @@
<f:textbox readonly="readonly" name="config.comment" value="${config.comment}" />
</f:entry>
<f:block>
<table>
<ms:blockWrapper>
<f:entry title="${%Argument list}" field="config.args">
<f:repeatable var="arg" items="${config.args}" name="args" noAddButton="true" minimum="1">
<table width="100%">
<ms:blockWrapper width="100%">
<f:entry>
<input type="text" readonly="readonly" name="name" value="${arg.name}" />
</f:entry>
</table>
</ms:blockWrapper>
</f:repeatable>
</f:entry>
</table>
</ms:blockWrapper>
</f:block>
<f:entry title="${%Content}">
<f:textarea readonly="readonly" id="config.content" name="config.content" value="${config.content}" />
Expand Down

0 comments on commit fe7bfc7

Please sign in to comment.