Skip to content

Commit 86f5ca2

Browse files
committed
first commit
0 parents  commit 86f5ca2

25 files changed

+390
-0
lines changed

assets/css/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

assets/css/style.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.code-box{
2+
position: sticky;
3+
top: 50px;
4+
}
5+
#editor{
6+
min-height: 400px;
7+
display: block;
8+
border: 1px solid var(--bs-blue);
9+
}
10+
.output-card{
11+
min-height: 400px;
12+
margin-top: 25px;
13+
}
14+
#codeOutputBody{
15+
background-color: #F0F6FC;
16+
border-radius: 7px;
17+
}
18+
19+
@media(min-width: 768px){
20+
.btn-box-container{
21+
position: sticky;
22+
top: 255px;
23+
margin-top: 200px;
24+
}
25+
}

assets/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

assets/js/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

assets/js/style.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/* bootstrap form validation */
2+
(function() {
3+
'use strict';
4+
window.addEventListener('load', function() {
5+
/* Fetch all the forms we want to apply custom Bootstrap validation styles to */
6+
var forms = document.getElementsByClassName('needs-validation');
7+
/* Loop over them and prevent submission */
8+
var validation = Array.prototype.filter.call(forms, function(form) {
9+
form.addEventListener('submit', function(event) {
10+
if (form.checkValidity() === false) {
11+
event.preventDefault();
12+
event.stopPropagation();
13+
}
14+
form.classList.add('was-validated');
15+
}, false);
16+
});
17+
}, false);
18+
})();
19+
20+
21+
$(document).ready(function(){
22+
23+
var currentPageURL = $('input#currentPageUrl').val();
24+
25+
/* Notiflix config */
26+
Notiflix.Notify.Init({position:"right-bottom",});
27+
Notiflix.Loading.Init({svgColor:"#ff2801",});
28+
Notiflix.Report.Init({plainText:false});
29+
Notiflix.Confirm.Init({titleColor:"#ff2801",okButtonBackground:"#ff2801",});
30+
31+
/* ACE EDITOR CONFIG */
32+
try {
33+
var codeText = "echo 'Hello World!';";
34+
var editor = ace.edit("editor");
35+
editor.setTheme("ace/theme/monokai");
36+
editor.setValue(codeText);
37+
editor.session.setUseWrapMode(true);
38+
editor.session.setTabSize(2);
39+
editor.session.setMode({
40+
path: "ace/mode/php",
41+
inline: true
42+
});
43+
editor.setOptions({
44+
enableBasicAutocompletion: true,
45+
enableSnippets: true,
46+
enableLiveAutocompletion: true,
47+
fontFamily: "monospace",
48+
fontSize: '0.88rem',
49+
});
50+
editor.container.style.lineHeight = 1.5;
51+
editor.focus();
52+
editor.execCommand("gotolineend");
53+
} catch (e) {
54+
alert('ACE Editor Error');
55+
}
56+
57+
58+
$(document).on('click','button#formSubmitButton',function(){
59+
var data = new FormData();
60+
data.append('data',editor.getValue());
61+
var url = currentPageURL;
62+
var error_box = $('#error-box');
63+
var code_output_box = $('#codeOutputBody');
64+
error_box.html('');
65+
code_output_box.html('');
66+
submit_form_data_ajax( url, data, function( output ){
67+
var res = JSON.parse( output );
68+
if( res.status ) {
69+
error_box.html('<div class="alert alert-success" role="alert">'+res.msg+'</div>');
70+
Notiflix.Notify.Success( res.msg );
71+
$('#codeOutputBody').html(res.data);
72+
} else if(res.status == 0) {
73+
error_box.html('<div class="alert alert-danger" role="alert">'+res.error+'</div>');
74+
Notiflix.Notify.Failure( res.error );
75+
} else {
76+
error_box.html('<div class="alert alert-danger" role="alert">SOME ERROR</div>');
77+
Notiflix.Notify.Failure( 'SOME ERROR' );
78+
}
79+
});
80+
});
81+
82+
});
83+
84+
85+
function submit_form_data_ajax( url, data, onComplete )
86+
{
87+
/* ajax function */
88+
$.ajax({
89+
type: "POST",
90+
enctype: 'multipart/form-data',
91+
url:url,
92+
data:data,
93+
processData: false,
94+
contentType: false,
95+
cache: false,
96+
beforeSend:function(){ Notiflix.Loading.Hourglass('Loading...');},
97+
success:function(data) {onComplete( data );},
98+
error:function(err) {console.log(err);},
99+
complete: function() {Notiflix.Loading.Remove();}
100+
});
101+
}

assets/plugin/ace/ace.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/plugin/ace/ext-language_tools.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/plugin/ace/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

assets/plugin/ace/mode-php.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/plugin/ace/theme-monokai.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)