Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Apr 20, 2022
1 parent c3c5121 commit c33a9dc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
12 changes: 4 additions & 8 deletions core/src/main/resources/lib/form/apply.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ THE SOFTWARE.
<s:attribute name="value">
The text of the apply button.
</s:attribute>

<s:attribute name="large">
Set to "true" to enable the large variant of the button
</s:attribute>
</s:documentation>

<st:adjunct includes="lib.form.apply.apply"/>
<input type="hidden" name="core:apply" value="" />
<input type="button"
value="${attrs.value ?: '%Apply'}"
class="apply-button applyButton ${attrs.large ? 'large-button' : ''}"
name="Apply"/><!-- applyButton is legacy -->
<button type="button" class="jenkins-button apply-button" name="Apply">
${attrs.value ?: '%Apply'}
</button>
</j:jelly>
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/form/apply/apply.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Behaviour.specify("INPUT.apply-button", 'apply', 0, function (e) {
Behaviour.specify("INPUT.apply-button,BUTTON.apply-button", 'apply', 0, function (e) {
var id;
var containerId = "container"+(iota++);

Expand All @@ -24,7 +24,7 @@ Behaviour.specify("INPUT.apply-button", 'apply', 0, function (e) {
}
}

makeButton(e,function (e) {
e.addEventListener("click", function (e) {
var f = findAncestor(e.target, "FORM");

// create a throw-away IFRAME to avoid back button from loading the POST result back
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/form/bottomButtonBar.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ THE SOFTWARE.
</st:documentation>

<div id="bottom-sticker">
<div class="bottom-sticker-inner">
<div class="bottom-sticker-inner jenkins-buttons-row jenkins-buttons-row--equal-width">
<d:invokeBody />
</div>
</div>
Expand Down
18 changes: 7 additions & 11 deletions core/src/main/resources/lib/form/submit.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,21 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:s="jelly:stapler" xmlns:d="jelly:define" xmlns:f="/lib/form">
<s:documentation>
Submit button themed by YUI. This should be always
used instead of the plain &lt;input tag.
Submit button. This should be always used instead of the plain &lt;button&gt; tag.

<s:attribute name="name">
If specified, becomes the value of the name attribute.
When you have more than one submit button on the form, this can be used to determine
which button is pressed, as the server will get a parameter by this name.
</s:attribute>
<s:attribute name="value" use="required">
The text of the submit button. Something like "submit", "OK", etc.
</s:attribute>

<s:attribute name="large">
Set to "true" to enable the large variant of the button
The text of the submit button, defaults to 'Submit'
It's recommended to be more descriptive when possible, e.g. 'Create', 'Next'
</s:attribute>
</s:documentation>

<input type="submit"
name="${attrs.name ?: 'Submit'}"
value="${attrs.value ?: '%Submit'}"
class="submit-button primary ${attrs.large ? 'large-button' : ''}" />
<button name="${attrs.name ?: 'Submit'}"
class="jenkins-button jenkins-button--primary">
${attrs.value ?: '%Submit'}
</button>
</j:jelly>
6 changes: 6 additions & 0 deletions war/src/main/less/modules/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,10 @@ a.yui-button.icon-button.large-button {
margin-right: 0!important;
}
}

&--equal-width {
.jenkins-button {
min-width: 90px;
}
}
}
4 changes: 0 additions & 4 deletions war/src/main/webapp/scripts/hudson-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,10 +1219,6 @@ function rowvgStartEachRow(recursive,f) {
applyTooltip(e,e.getAttribute("tooltip"));
});

Behaviour.specify("INPUT.submit-button", "input-submit-button", ++p, function(e) {
makeButton(e);
});

Behaviour.specify("INPUT.yui-button", "input-yui-button", ++p, function(e) {
makeButton(e);
});
Expand Down

0 comments on commit c33a9dc

Please sign in to comment.