Cleaned up code
This commit is contained in:
@@ -120,14 +120,14 @@ async function formatXML(xml) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showRequestBody(element){
|
function showRequestBody(element){
|
||||||
requestBody = "";
|
|
||||||
document.getElementById('code-highlight-content').innerText = "Loading...";
|
|
||||||
var historyRequestBody = historyJson[element.id].requestBody;
|
var historyRequestBody = historyJson[element.id].requestBody;
|
||||||
|
const popupContent = document.getElementById('code-highlight-content')
|
||||||
|
|
||||||
|
document.getElementById('code-highlight-content').innerText = "Loading...";
|
||||||
switch(historyJson[element.id].headers["content-type"]){
|
switch(historyJson[element.id].headers["content-type"]){
|
||||||
case "application/json":{
|
case "application/json":{
|
||||||
formatJSON(historyRequestBody).then(function(result) {
|
formatJSON(historyRequestBody).then(function(result) {
|
||||||
document.getElementById('code-highlight-content').innerText = result.data;
|
popupContent.innerText = result.data;
|
||||||
console.log(result.data);
|
|
||||||
highlightSyntax('code-highlight-content');
|
highlightSyntax('code-highlight-content');
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -135,11 +135,11 @@ function showRequestBody(element){
|
|||||||
case "application/xml":{
|
case "application/xml":{
|
||||||
formatXML(historyRequestBody).then(function(result) {
|
formatXML(historyRequestBody).then(function(result) {
|
||||||
if (result.status == "OK") {
|
if (result.status == "OK") {
|
||||||
document.getElementById('code-highlight-content').innerText = result.result;
|
popupContent.innerText = result.result;
|
||||||
highlightSyntax('code-highlight-content');
|
highlightSyntax('code-highlight-content');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
document.getElementById('code-highlight-content').innerText = historyRequestBody;
|
popupContent.innerText = historyRequestBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -147,7 +147,7 @@ function showRequestBody(element){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
document.getElementById('code-highlight-content').innerText = historyRequestBody;
|
popupContent.innerText = historyRequestBody;
|
||||||
highlightSyntax('code-highlight-content');
|
highlightSyntax('code-highlight-content');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user