Skip to content

Commit 5e97736

Browse files
Add files via upload
1 parent 601d996 commit 5e97736

File tree

13 files changed

+2503
-0
lines changed

13 files changed

+2503
-0
lines changed

Code Used.html

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Console.JS by N Paul</title>
9+
<!-- This project is originally made by me(N Paul). My github profile https://github.com/nirmalpaul383/
10+
My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/ .This is an open source program .
11+
You are welcomed to modify it...If you want to support me please give a like to our facebook page
12+
https://facebook.com/a.new.way.Technical/ -->
13+
14+
<style>
15+
* {
16+
padding: 0px;
17+
margin: 0px;
18+
background: rgb(0, 0, 0);
19+
}
20+
21+
/* This project is originally made by me(N Paul). My github profile https://github.com/nirmalpaul383/
22+
My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/ .This is an open source program .
23+
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/ */
24+
25+
#divForHoldingLayout {
26+
display: block;
27+
width: 96vw;
28+
height: 97vh;
29+
margin-left: 2vw;
30+
margin-top: 1vh;
31+
}
32+
33+
#consoleOutputDisplay {
34+
display: block;
35+
resize: none;
36+
width: 100%;
37+
height: 20%;
38+
background: rgb(0, 0, 0);
39+
border: 1px solid rgb(0, 0, 0);
40+
color: red;
41+
}
42+
43+
#consoleOutputDisplay:focus {
44+
outline: none;
45+
}
46+
47+
#consoleInputDisplay {
48+
display: block;
49+
resize: none;
50+
width: 100%;
51+
height: 80%;
52+
background: rgb(0, 0, 0);
53+
border: 1px solid rgb(0, 0, 0);
54+
color: rgb(9, 255, 0);
55+
}
56+
57+
#consoleInputDisplay:focus {
58+
outline: none;
59+
}
60+
61+
#acceptButton {
62+
display: block;
63+
position: fixed;
64+
top: 80vh;
65+
right: 1vw;
66+
border-radius: 35%;
67+
background: rgb(19, 221, 70);
68+
width: 10vw;
69+
height: 10vw;
70+
}
71+
72+
#acceptButton:hover {
73+
background: rgb(8, 195, 228);
74+
}
75+
76+
#acceptButton:active {
77+
background: rgb(10, 88, 233);
78+
width: 9vw;
79+
height: 9vw;
80+
}
81+
</style>
82+
83+
</head>
84+
85+
<body>
86+
87+
<div id="divForHoldingLayout">
88+
<textarea id="consoleInputDisplay" placeholder=""></textarea>
89+
<hr>
90+
<textarea id="consoleOutputDisplay" placeholder="" readonly></textarea>
91+
<input id="acceptButton" type="button" onclick="acceptThisCode()" value="Run">
92+
</div>
93+
<script>
94+
/* This project is originally made by me(N Paul). My github profile https://github.com/nirmalpaul383/
95+
My youtube page https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/ .This is an open source program .
96+
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/ */
97+
98+
99+
//Declaring necessary variables
100+
let consoleInputDisplay = document.getElementById('consoleInputDisplay');
101+
let consoleOutputDisplay = document.getElementById('consoleOutputDisplay');
102+
103+
104+
//Write some basic information to the consoleInputDisplay
105+
consoleInputDisplay.placeholder = `Welcome to Console.JS(Android) by N Paul.This is a small project to run/evaluate javascript code and to show the output on a custom console using a custom 'console.log()' method. You can enter JavaScript code here. You can use the "console.log()" method to output a JS code. It also supports Tasker's JavaScript interface. You can find more information about Tasker's JavaScript interface at https://tasker.joaoapps.com/userguide/en/javascript.html
106+
107+
108+
Console.js(Android)(https://github.com/nirmalpaul383/Console_dot_JS_Android) is based on "Console.js"(https://github.com/nirmalpaul383/Console_dot_JS) project by me. This project is very similar to my another project 'Tasker.js'(https://github.com/nirmalpaul383/Project_Tasker_dot_JS) which is based on "JavaScript_Console_Mini-inside-webpage"(https://github.com/nirmalpaul383/JavaScript_Console_Mini-inside-webpage) project by me.
109+
110+
But the main difference between these(Console.js(Android) & 'Console.js') and those('Tasker.js' & 'JavaScript_Console_Mini-inside-webpage') project are that, these never instantly return the output of a code untill "console.log()" method is used but those always return an output(regardless of defined/undefinded value). Another difference is that when a code is thrown into those('JavaScript_Console_Mini-inside-webpage' & 'Tasker.js'), they first read it, then evaluate it, then print its output and are ready to take the another code again (not forgetting the old codes). But comparatively in these project, if codes are thrown into these, these first read the entire codes, then evaluate it, and if there is "console.log()" method only then output it, and if we throw a new code, these forgets the previously executed code.
111+
112+
If you like these project please give a star to these projects. https://github.com/nirmalpaul383/Console_dot_JS_Android ,
113+
Main project: https://github.com/nirmalpaul383/Console_dot_JS
114+
115+
if you like to check out my previous similar projects you can visit
116+
https://github.com/nirmalpaul383/Project_Tasker_dot_JS ,
117+
Main project: https://github.com/nirmalpaul383/JavaScript_Console_Mini-inside-webpage
118+
119+
This project is originally made by me(N Paul).
120+
My github profile: https://github.com/nirmalpaul383/
121+
My youtube page: https://www.youtube.com/channel/UCY6JY8bTlR7hZEvhy6Pldxg/
122+
123+
This is an open source program. You are welcomed to modify it...
124+
If you want to support me please give a like to our facebook page: https://facebook.com/a.new.way.Technical/
125+
126+
`;
127+
128+
129+
consoleOutputDisplay.placeholder = `Console Output`;
130+
131+
//Changing default/stock JavaScript's console.log() function with our custom function...
132+
console.log = function (input) {
133+
134+
//When the user tries to view a JavaScript object through the console.log() method, the object will be shown as a string instead of "[object Object]".
135+
if (typeof (input) === 'object') {
136+
input = JSON.stringify(input);
137+
};
138+
139+
consoleOutputDisplay.value = `${consoleOutputDisplay.value}
140+
${input}`;
141+
};
142+
143+
//Main function, when user click Run button this function will be executed
144+
function acceptThisCode() {
145+
146+
consoleOutputDisplay.value = '';//Clearing Console
147+
148+
149+
let rawCodes = consoleInputDisplay.value;//for getting user inputed code.
150+
151+
let startTimeForTestPerformance = window.performance.now();//for performence testing
152+
153+
//When error occured for evaluating JS Codes, then program flow should not be stopped instead error message should be shown.
154+
try {
155+
eval(rawCodes);
156+
}
157+
catch (error) {
158+
console.log((error.message)); //Show error message/code to the console ,incase of an error
159+
};
160+
161+
162+
let endTimeForTestPerformance = window.performance.now(); //for performence testing
163+
164+
console.log(`Code Execution finished in Console.js(WebView). Time consumed(for User inputed JS code evaluating only): ${endTimeForTestPerformance - startTimeForTestPerformance} ms`); //Show code execution time on Console
165+
166+
}
167+
168+
169+
</script>
170+
</body>
171+
172+
</html>
93.4 KB
Loading
380 KB
Binary file not shown.

Icon/Thumbs.db

72 KB
Binary file not shown.

Screenshots/1.png

62.9 KB
Loading

Screenshots/2.png

46.6 KB
Loading

Screenshots/3.png

237 KB
Loading

Screenshots/4.png

95 KB
Loading

Screenshots/5.png

75.4 KB
Loading

Screenshots/6.png

263 KB
Loading

0 commit comments

Comments
 (0)