-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
94 lines (65 loc) · 3.41 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<head>
<style>
</style>
<meta charset="UTF-8">
<link rel="stylesheet" href="app/css/bootstrap.css">
<link rel="stylesheet" href="app/css/main.css">
</head>
<body>
<nav id="sidebar">
<div id="editor-storage"></div>
</nav>
<div class="overlay"></div>
<nav class="navbar navbar-expand-lg navbar-light v.0.03">
<div class="container-fluid">
<button id="listProjects" class="btn btn-primary" >Projects</button>
<button class="btn btn-success" onclick="storeJS()" >Save</button>
<button class="btn" onclick="editor._actions.runCode.run()" >Run(CTRL+ENTER)</button>
<button class="btn btn-danger" onclick="deleteProject()" >Delete Project</button>
<form class="m-0" enctype="multipart/form-data">
<input type="file" name="file" id="file" class="inputfile" accept=".js" data-multiple-caption="{count} files selected" multiple />
<label class="btn btn-info m-0" for="file"><span>Choose a file</span></label>
</form>
<button class="btn" onclick="repl.downloadJS()"> Download Project </button>
<input class="form-control form-control-sm" id='projectName' type="text" placeholder="Name your Project">
</div>
</nav>
<!-- Dark Overlay element -->
<row>
<div class="col-6">
<div id="vseditor" class=""></div>
</div>
<!-- <div id="term_demo" class="terminal col-6"></div>-->
<div class="col-6">
<p id="myLog" class=" mb-0" ></p>
</div>
</row>
<script src="vs/loader.js"></script>
<script src="js/bootstrap.bundle.min.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="app/js/app.js"> </script>
<script src="app/js/refactoring.js"> </script>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jshint/2.9.6/jshint.js"></script>-->
<script>
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// use the 1st file from the list
f = files[0];
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
file_content= e.target.result
editor.setValue(file_content)
editorStorage[window.location.href] = file_content;
localStorage.setObject("editorStorage", editorStorage);
};
})(f);
// Read in the image file as a data URL.
reader.readAsText(f);
}
document.getElementById('file').addEventListener('change', handleFileSelect, false);
</script>
<script type="text/javascript">
</script>
</body>