Browse Source

Code refactoring

main
Stipe Varnica 5 months ago
parent
commit
eeaf298adb
  1. 1
      TEMPEST/tempest-devel
  2. 12
      index.html
  3. 8
      javascript/filesHandling.js
  4. 10
      javascript/index.js
  5. 2
      node_modules/.package-lock.json
  6. 2
      package-lock.json

1
TEMPEST/tempest-devel

@ -1 +0,0 @@
Subproject commit 8da32343531799e827816124932063a28e9c885b

12
index.html

@ -25,6 +25,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.53.2/mode/javascript/javascript.min.js"></script>
<script src="node_modules/@viz-js/viz/lib/viz-standalone.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row gx-0">
@ -186,16 +187,6 @@
</div>
<div class="row">
<div class="col">
<!-- <label for="fname">File name</label>
<br />
<input type="text" id="fname" name="fname" />
<button id="create" type="button" class="btn btn-success">
Create File
</button>
<a download="info.txt" id="downloadlink" style="display: none"
>Download Here</a
> -->
<h4 class="mt-1">Upload a file</h4>
<div class="mb-3">
<input type="file" id="fileInput" class="form-control" />
@ -280,7 +271,6 @@
></script>
<script src="javascript/syntax.js"></script>
<script src="javascript/index.js"></script>
<script src="javascript/zoom.js"></script>
<script src="javascript/filesHandling.js"></script>
</body>

8
javascript/filesHandling.js

@ -99,14 +99,14 @@ document.addEventListener("DOMContentLoaded", function () {
return textFile;
};
var download = document.getElementById("downloadFirstEditor");
var download2 = document.getElementById("downloadSpecifications");
var downloadEditorText = document.getElementById("downloadFirstEditor");
var downloadSpecifications = document.getElementById("downloadSpecifications");
var input1 = editor;
var input2 = editor2;
// Add an event listener to the button for the click event
download.addEventListener("click", function () {
downloadEditorText.addEventListener("click", function () {
// Check if the editor is empty
if (!editor.getValue()) {
Toastify({
@ -137,7 +137,7 @@ document.addEventListener("DOMContentLoaded", function () {
}
});
download2.addEventListener("click", function () {
downloadSpecifications.addEventListener("click", function () {
if (!editor2.getValue()) {
Toastify({
text: "Specifications field empty",

10
javascript/index.js

@ -15,13 +15,7 @@ var editor2 = CodeMirror.fromTextArea(input2, {
lineNumbers: true,
});
document.addEventListener("DOMContentLoaded", function () {
// var input = document.createElement("input");
// input.type = "file";
// input.classList.add("customInput", "col-3");
// input.setAttribute("id", "fileInputEditor");
// const position = { line: 1, ch: 2 };
// editor.addWidget(position, input, false);
//Run function
document.getElementById("runBtn").addEventListener("click", function () {
@ -69,6 +63,8 @@ function graphFunction(svg) {
graph = svg;
}
function getActiveTabContent() {
var activeTabId = document.querySelector(".rightNav.active").id;
switch (activeTabId) {

2
node_modules/.package-lock.json

@ -1,5 +1,5 @@
{
"name": "Internship",
"name": "testingwasm_new",
"lockfileVersion": 3,
"requires": true,
"packages": {

2
package-lock.json

@ -1,5 +1,5 @@
{
"name": "Internship",
"name": "testingwasm_new",
"lockfileVersion": 3,
"requires": true,
"packages": {

Loading…
Cancel
Save