Skip to content

Commit

Permalink
[JENKINS-70921] Remove Prototype Ajax.Request usages from link.js (
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored May 8, 2023
1 parent d33dd26 commit ffd412a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
8 changes: 2 additions & 6 deletions core/src/main/resources/lib/form/link.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<st:documentation>
Generates an anchor element with the ability to send POST requests and/or
asynchronous requests. It depends the combination of post and async attributes.
Generates an anchor element with the ability to send POST requests.

@since 1.584
<st:attribute name="clazz">
Expand All @@ -38,12 +37,9 @@ THE SOFTWARE.
<st:attribute name="post">
If this must send a POST request.
</st:attribute>
<st:attribute name="async">
If this must send an asynchronous request.
</st:attribute>
</st:documentation>

<st:adjunct includes="lib.form.link.link"/>

<a href="${attrs.href}" class="${attrs.post ? 'post' + (attrs.async ? '-async' : '') : (attrs.async ? 'async' : '')} ${attrs.clazz}"><d:invokeBody/></a>
<a href="${attrs.href}" class="${attrs.post ? 'post' : ''} ${attrs.clazz}"><d:invokeBody/></a>
</j:jelly>
16 changes: 0 additions & 16 deletions core/src/main/resources/lib/form/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,3 @@ Behaviour.specify("A.post", "link.post", 0, function (element) {
return false;
};
});

Behaviour.specify("A.post-async", "link.post-async", 0, function (element) {
element.onclick = function () {
new Ajax.Request(element.getAttribute("href"));
return false;
};
});

Behaviour.specify("A.async", "link.async", 0, function (element) {
element.onclick = function () {
new Ajax.Request(element.getAttribute("href"), {
method: "get",
});
return false;
};
});

0 comments on commit ffd412a

Please # to comment.