41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script>
|
|
function escapeHtml(text) {
|
|
return text
|
|
.replace(/&/g, "&")
|
|
.replace(/</g, "<")
|
|
.replace(/>/g, ">")
|
|
.replace(/"/g, """)
|
|
.replace(/'/g, "'");
|
|
}
|
|
window.onload = function() {
|
|
|
|
var data = document.getElementById("data").value;
|
|
|
|
var command = "not";
|
|
var result = "not";
|
|
|
|
console.log(data.split("<br/>").length);
|
|
|
|
if(data.split("<br/>").length < 2) {
|
|
command = data.split('\\n')[0];
|
|
result = data.split('\\n')[1];
|
|
} else {
|
|
command = data.split("<br/>")[0];
|
|
result = data.split("<br/>")[1];
|
|
}
|
|
|
|
document.getElementById("command").innerHTML ="<pre>Command:> " + escapeHtml(command.replace(/^/,"")) +"</pre>";
|
|
document.getElementById("result").innerHTML = "<pre>" + escapeHtml(result.trim().replace(/\<>$/, '')) + "</pre>";
|
|
};
|
|
</script>
|
|
</head>
|
|
<body style="background: black;color: green; font-size: 18px; font-weight: bold;">
|
|
<input id="data" type="hidden" value="<%= data %>"/>
|
|
<div id="command" style="padding: 5px;color: rgb(9, 155, 9); font-size: 18px; font-weight: bold;"></div><br/>
|
|
<div id="result" style="padding: 10px; padding-top: 0px; background: black;color: green; font-size: 18px; font-weight: bold;"></div>
|
|
</body>
|
|
</html>
|