mirror of
https://github.com/jstrieb/urlpages.git
synced 2024-12-22 13:52:15 +01:00
Add ability to hide buttons in the editor
This commit is contained in:
parent
801ed5ed85
commit
9d6b7ba2ce
3 changed files with 24 additions and 0 deletions
|
@ -82,6 +82,17 @@ function showCopyCodePrompt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Hide and show buttons based on checkbox state */
|
||||||
|
function hideButtons(box) {
|
||||||
|
let buttons = document.querySelectorAll("button");
|
||||||
|
if (box.checked) {
|
||||||
|
buttons.forEach((button) => button.style.display = "none");
|
||||||
|
} else {
|
||||||
|
buttons.forEach((button) => button.style.display = "inline");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Main procedure functions
|
* Main procedure functions
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="bottomleft-buttons">
|
<div id="bottomleft-buttons">
|
||||||
|
<label for="hide">Hide Buttons</label>
|
||||||
|
<input type="checkbox" id="hide" onclick="hideButtons(this)" /><br />
|
||||||
<!-- Seemingly random attributes necessary for TinyUrl to accept the request -->
|
<!-- Seemingly random attributes necessary for TinyUrl to accept the request -->
|
||||||
<form action="http://tinyurl.com/create.php" method="get" target="_blank">
|
<form action="http://tinyurl.com/create.php" method="get" target="_blank">
|
||||||
<input type="hidden" id="source" name="source" value="indexpage">
|
<input type="hidden" id="source" name="source" value="indexpage">
|
||||||
|
@ -25,6 +27,7 @@
|
||||||
<button><a id="getLinkLink" href="" target="_blank">Open Page</a></button>
|
<button><a id="getLinkLink" href="" target="_blank">Open Page</a></button>
|
||||||
<button onclick="showCopyCodePrompt()">Copy Code</button>
|
<button onclick="showCopyCodePrompt()">Copy Code</button>
|
||||||
<button><a id="downloadLink" href="" target="_blank" download="export.html">Download Code</a></button>
|
<button><a id="downloadLink" href="" target="_blank" download="export.html">Download Code</a></button>
|
||||||
|
<button><a href="https://jstrieb.github.io/link-lock" target="_blank">Add a Password</a></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="topright-buttons">
|
<div id="topright-buttons">
|
||||||
|
|
|
@ -52,3 +52,13 @@ a, button {
|
||||||
form {
|
form {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label, input[type="checkbox"] {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
margin: 5px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue