-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
116 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>CSE321/as-1</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="../../assets/themes/stackoverflow-dark.min.css"> | ||
<link rel="stylesheet" href="../../assets/style.css"> | ||
</head> | ||
<body> | ||
<div class="title"> | ||
<h2>Lab Assignment-02</h2> | ||
</div> | ||
|
||
<iframe src="https://docs.google.com/viewer?url=https://eniac00.github.io/bracu/CSE321/as-2/as-2.pdf&embedded=true" ></iframe> | ||
|
||
<div class="button-container"> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('1_shell_commands')">task-1</button> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('2_a')">task-2(a)</button> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('2_b')">task-2(b)</button> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('2_c')">task-2(c)</button> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('2_d')">task-2(d)</button> | ||
<button type="button" class="btn btn-primary" onclick="loadFile('2_e')">task-2(e)</button> | ||
</div> | ||
|
||
<div id="sub-title"></div> | ||
|
||
|
||
<div id="code-wrapper"></div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script> | ||
<script src="../../assets/highlight.min.js"></script> | ||
<script> | ||
function loadFile(button_name) { | ||
|
||
document.getElementById('sub-title').innerHTML = ""; | ||
document.getElementById('sub-title').innerHTML = `${button_name}`; | ||
|
||
if (button_name === "1_shell_commands") { | ||
fetch(`./code01/${button_name}.txt`) | ||
.then(function(response) { | ||
return response.text(); | ||
}) | ||
.then(function(data) { | ||
document.getElementById('code-wrapper').innerHTML = ""; | ||
document.getElementById('code-wrapper').innerHTML = `<pre><code class='language-txt'>${data}</code></pre>`; | ||
hljs.highlightAll(); | ||
}) | ||
.catch(function(error) { | ||
console.log(error); | ||
}); | ||
|
||
|
||
} else { | ||
|
||
fetch(`./code01/${button_name}.c`) | ||
.then(function(response) { | ||
return response.text(); | ||
}) | ||
.then(function(data) { | ||
document.getElementById('code-wrapper').innerHTML = ""; | ||
document.getElementById('code-wrapper').innerHTML = `<pre><code class='language-cpp'>${htmlencode(data)}</code></pre>`; | ||
hljs.highlightAll(); | ||
}) | ||
.catch(function(error) { | ||
console.log(error); | ||
}); | ||
|
||
} | ||
} | ||
|
||
function htmlencode(text) { | ||
return ( | ||
text | ||
.replace(/&/g, '&') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
); | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters