From d2169f4f91b4e7d8c19bd008395a47f15e168d0d Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 11 May 2023 18:01:07 -0700 Subject: [PATCH] Replace Prototype.js with native JavaScript --- .../hudson/tasks/_ant/AntTargetNote/script.js | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/resources/hudson/tasks/_ant/AntTargetNote/script.js b/src/main/resources/hudson/tasks/_ant/AntTargetNote/script.js index 3b6af7a..97ef553 100644 --- a/src/main/resources/hudson/tasks/_ant/AntTargetNote/script.js +++ b/src/main/resources/hudson/tasks/_ant/AntTargetNote/script.js @@ -10,14 +10,19 @@ if (!loading) { loading = true; - var u = new Ajax.Updater(document.getElementById("side-panel"), - rootURL+"/descriptor/hudson.tasks._ant.AntTargetNote/outline", - {insertion: Insertion.Bottom, onComplete: function() { - if (!u.success()) return; // we can't us onSuccess because that kicks in before onComplete - outline = document.getElementById("console-outline-body"); - loading = false; - queue.each(handle); - }}); + fetch(rootURL + "/descriptor/hudson.tasks._ant.AntTargetNote/outline", { + method: "post", + headers: crumb.wrap({}), + }).then(function(rsp) { + if (rsp.ok) { + rsp.text().then((responseText) => { + document.getElementById("side-panel").insertAdjacentHTML("beforeend", responseText); + outline = document.getElementById("console-outline-body"); + loading = false; + queue.forEach(handle); + }); + } + }); } return true; }