From 00b90176cdc1bf8f2a07b98d39dfab618e2dca5f Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 15 May 2023 20:20:04 -0700 Subject: [PATCH] Replace Prototype.js with native JavaScript --- .../src/main/webapp/scripts/featureButton.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js b/github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js index fd6baa7c..115833b1 100644 --- a/github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js +++ b/github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js @@ -1,10 +1,12 @@ function callFeature(button, answerPlaceId, parameters) { - new Ajax.Request(button.action, { + fetch(button.action, { method: "post", - parameters: parameters, - onComplete: function (rsp) { - answerPlaceId.innerHTML = rsp.responseText; - } + headers: crumb.wrap({}), + body: new URLSearchParams(parameters), + }).then(rsp => { + rsp.text().then((responseText) => { + answerPlaceId.innerHTML = responseText; + }); }); return false; }