Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor changed #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions ide/templates/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

nav {
border-radius: 0 !important;
position: fixed;
}

#dropdown {
top: 40px;
right: 1;
}

.io {
Expand Down Expand Up @@ -63,14 +69,21 @@
</head>

<body>
<div class="nav_bar">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="btn btn-outline-info" title="User Details"><i class="fa fa-user" aria-hidden="true"></i></button>
{% for i in data%}
<h6>{{i.username}}</h6>
{% endfor %}
</nav>
</div>
<nav class="navbar container-fluid justify-between navbar-dark bg-dark">
<a href="#" class="navbar-brand">Rabbit IDE</a>
<div class="d-flex">
<a class="nav-link text-white mr-2" href="#">Questions</a>
<div class="position-relative">
<button id="dropdown-btn" class="btn btn-outline-info shadow-none rounded-circle p-2"
title="User Details"><i class="fa fa-user" aria-hidden="true"></i></button>
<div id="dropdown" class="position-absolute bg-light text-dark p-3 d-none rounded">
{% for i in data%}
<h6>{{i.username}}</h6>
{% endfor %}
</div>
</div>
</div>
</nav>
<div class="d-flex justify-content-around mt-2">
<div class="d-flex flex-column align-items-center">
<form method="POST" class="bg-dark p-3" id="code_form">
Expand Down Expand Up @@ -166,6 +179,8 @@ <h6>{{i.username}}</h6>
const modeSelector = document.getElementById("language")
const runButton = document.getElementById("run")
const clrButton = document.getElementById("clear")
const dropdownButton = document.getElementById("dropdown-btn");
const dropdown = document.getElementById("dropdown");

editor.setTheme(`ace/theme/${themeSelector.value}`)
editor.session.setMode(`ace/mode/${modeSelector.value}`)
Expand All @@ -191,6 +206,14 @@ <h6>{{i.username}}</h6>
document.getElementById("output").value = ""
})

dropdownButton.addEventListener("click", () => {
dropdown.classList.toggle("d-none")
})

clrButton.addEventListener("click", () => {
document.getElementById("output").value = ""
})

$(document).on('submit', '#code_form', function (e) {
e.preventDefault();
$("#run").toggleClass("d-none")
Expand All @@ -216,7 +239,7 @@ <h6>{{i.username}}</h6>
})
});


</script>
</body>

Expand Down
Loading