-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCode Used.html
138 lines (110 loc) · 4.16 KB
/
Code Used.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!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">
<title>Tasker.JS Console by N Paul</title>
<!-- HTML -->
<!-- This project is originally made by me(N Paul).
My github profile https://github.com/nirmalpaul383/
My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/
This is an open source program . You are welcomed to modify it...
If you want to support me please give a like to our facebook page
https://facebook.com/a.new.way.Technical/ -->
<!-- Custom Styles -->
<style>
* {
padding: 0px;
margin: 0px;
}
#outputDisplay {
width: 98vw;
display: inline-block;
margin-left: 1vw;
margin-right: 1vw;
background: rgb(0, 0, 0);
height: 88vh;
color: rgb(51, 204, 51);
resize: none;
}
#inputCode {
display: inline;
width: 80vw;
margin-left: 1vw;
margin-right: 1vw;
height: 10vh;
border: 1px solid red;
border-radius: 10px;
color: red;
}
#acceptButton {
display: inline;
width: 16vw;
height: 10vh;
background: rgb(51, 204, 204);
position: absolute;
border: 1px solid blue;
border-radius: 10px;
font-size: 2vh;
}
#acceptButton:hover {
background: rgb(51, 204, 89);
}
#acceptButton:active {
background: rgb(204, 51, 51);
}
#user_input {
display: inline-block;
height: 10vh;
}
</style>
</head>
<body>
<textarea type="text" id="outputDisplay"></textarea>
<div id="user_input">
<input type="text" id="inputCode" placeholder="type the code">
<input type="button" id="acceptButton" value="OK" onclick="acceptThisCode()">
</div>
<!-- Project -->
<script>
/** This project is originally made by me(N Paul).
My github profile https://github.com/nirmalpaul383/
My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/
This is an open source program . You are welcomed to modify it...
If you want to support me please give a like to our facebook page
https://facebook.com/a.new.way.Technical/ **/
const taskerjs = {
about: `A console written using the source codes of (https://github.com/nirmalpaul383/JavaScript_Console_Mini-inside-webpage) with support of the Tasker's JavaScript interface....
This project is originally made by me(N Paul). My github profile https://github.com/nirmalpaul383/ My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/
This is an open source program . You are welcomed to modify it... If you want to support me please give a like to our facebook page https://facebook.com/a.new.way.Technical/`
};
//Declaration of all essential global variables
let outputDisplay = document.getElementById('outputDisplay'); //Display
let inputCode = document.getElementById('inputCode'); //Input
//Set opening/welcome value to the display
outputDisplay.value = `Welcome to Tasker.JS Mini by N Paul... Current Version 1.1.0.
Type "taskerjs.about" for more info...
`;
//Declaration of main function
function acceptThisCode() {
let processTemp = '' //Process Temp
outputDisplay.value = `${outputDisplay.value} user: ${inputCode.value}
`; /* User input code will be displayed on the display log */
{
try {
processTemp = window.eval(inputCode.value);
/* Try to evaluate user's input and record its output. 'window.eval()' is used
because 'eval()' has local scope but 'window.eval()' has global scope*/
}
catch (errorMsg) {
processTemp = errorMsg; /* If an error occurred while evaluating. It will record the error message */
}
};
inputCode.value = ''; /* It will clear user input panel */
outputDisplay.value = `${outputDisplay.value} JavaScript Engine: ${processTemp}
`; /* It will show the final output to the display(by Creating a log) */
};
</script>
</body>
</html>