Here is the two javascripts and the CSS.
CSS
input[type="file"] {
display: none;
}
.custom-file-upload {
font-size: 10px;
border: 0px solid #ccc;
display: inline-block;
padding: 0px 0px;
cursor: pointer;
}
.button {
background-color: white;
border: none;
color: black;
padding: 0px 0px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 10px;
}
/* Dropdown Button */
.dropbtn {
background-color: white;
color: black;
padding: 0px;
font-size: 10px;
border: none;
cursor: pointer;
}
/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
background-color: white;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: absolute;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: relative;
background-color: white;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: white}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}
JS 1
function saveTextAsFile()
{
var textToSave = document.getElementById("inputTextToSave").value;
var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});
var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value;
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
downloadLink.href = textToSaveAsURL;
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
downloadLink.click();
}
function destroyClickedElement(event)
{
document.body.removeChild(event.target);
}
function loadFileAsText()
{
var fileToLoad = document.getElementById("fileToLoad").files[0];
var fileReader = new FileReader();
fileReader.onload = function(fileLoadedEvent)
{
var textFromFileLoaded = fileLoadedEvent.target.result;
document.getElementById("inputTextToSave").value = textFromFileLoaded;
};
fileReader.readAsText(fileToLoad, "UTF-8");
}
JS 2
function AG() {
document.getElementById("AUTO").classList.toggle("show");
}
function EG() {
document.getElementById("EDIT").classList.toggle("show");
}
function GD() {
document.getElementById("DATA").classList.toggle("show");
}
function DG() {
document.getElementById("DEBUG").classList.toggle("show");
}
function myFunction() {
var x = document.getElementById('menu');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
// openDropdown.classList.remove('show');
}
}
}
}