Skip to content

Commit

Permalink
Merge pull request #997 from zbynek/noyui
Browse files Browse the repository at this point in the history
Replace dropdown button to remove dependency on YUI
  • Loading branch information
res0nance authored Nov 4, 2024
2 parents 8ce0171 + e2b61e2 commit 132eba5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ THE SOFTWARE.

<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.414.3</jenkins.version>
<jenkins.version>2.452.3</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<hpi.compatibleSinceVersion>1626</hpi.compatibleSinceVersion>
</properties>
Expand Down Expand Up @@ -201,8 +201,8 @@ THE SOFTWARE.
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.414.x</artifactId>
<version>2982.vdce2153031a_0</version>
<artifactId>bom-2.452.x</artifactId>
<version>3208.vb_21177d4b_cd9</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
40 changes: 22 additions & 18 deletions src/main/resources/hudson/plugins/ec2/EC2Cloud/computerSet.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
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:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:l="/lib/layout" xmlns:dd="/lib/layout/dropdowns" xmlns:f="/lib/form">
<j:if test="${it.hasPermission(it.PROVISION)}">
<j:set var="formId" value="${h.generateId()}"/>
<tr>
<td />
<td colspan="${monitors.size()+1}">
<f:form action="${rootURL}/${it.url}/provision" method="post" name="provision">
<input type="submit" class="ec2-provision-button" value="${%Provision via} ${it.displayName}" />
<select name="template">
<j:forEach var="t" items="${it.templates}">
<option value="${t.description}">${t.displayName}</option>
</j:forEach>
</select>
<st:once>
<script>
Behaviour.register({
".ec2-provision-button" : function (e) {
new YAHOO.widget.Button(e, { type: "menu", menu: e.nextSibling });
}
});
</script>
</st:once>
<td colspan="${monitors.size()+2}">
<l:overflowButton icon="symbol-add"
text="${%Provision via} ${it.displayName}"
tooltip="${null}"
clazz="jenkins-!-margin-top-2">
<j:forEach var="t" items="${it.templates}">
<dd:custom>
<button class="jenkins-dropdown__item"
data-type="ec2-provision"
data-form="${formId}"
data-url="${t.description}">
${t.displayName}
</button>
</dd:custom>
</j:forEach>
</l:overflowButton>
<f:form action="${rootURL}/${it.url}/provision" method="post" name="provision" id="${formId}">
<input name="template" type="hidden"/>
</f:form>
<st:adjunct includes="hudson.plugins.ec2.EC2Cloud.provision"/>
</td>
</tr>
</j:if>
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/hudson/plugins/ec2/EC2Cloud/provision.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Behaviour.specify("[data-type='ec2-provision']", 'ec2-provision', -99, function(e) {
e.addEventListener("click", function (event) {
const form = document.getElementById(e.dataset.form);
form.querySelector("[name='template']").value = e.dataset.url;
buildFormTree(form);
form.submit();
});
});

0 comments on commit 132eba5

Please sign in to comment.