Added so radiobuttons will be checked when in use

This commit is contained in:
kasperrt
2014-10-24 19:28:35 +02:00
parent 889c09c389
commit 63ec3370d7
3 changed files with 26 additions and 19 deletions

View File

@@ -14,14 +14,15 @@ function admin()
function submitAdmin(form)
{
voting = form.vote.checked,
addSongs = form.addSongs.checked,
longSongs = form.longSongs.checked,
frontpage = form.frontPage.checked,
allvideos = form.allvideos.checked,
removePlay = form.removePlay.checked,
voting = form.vote.value,
addSongs = form.addSongs.value,
longSongs = form.longSongs.value,
frontpage = form.frontPage.value,
allvideos = form.allvideos.value,
removePlay = form.removePlay.value,
adminpass = form.pass.value;
confRes = $.ajax({
type: "POST",
url: "php/change.php",

View File

@@ -80,11 +80,17 @@ function updateList()
if(!adminTogg)
{
document.getElementsByName("vote")[0].checked = (conf["vote"] === "true");
document.getElementsByName("vote")[1].checked = (conf["vote"] === "false");
document.getElementsByName("addSongs")[0].checked = (conf["addsongs"] === "true");
document.getElementsByName("addSongs")[1].checked = (conf["addsongs"] === "false");
document.getElementsByName("longSongs")[0].checked = (conf["longsongs"] === "true");
document.getElementsByName("longSongs")[1].checked = (conf["longsongs"] === "false");
document.getElementsByName("frontPage")[0].checked = (conf["frontpage"] === "true");
document.getElementsByName("frontPage")[1].checked = (conf["frontpage"] === "false");
document.getElementsByName("allvideos")[0].checked = (conf["allvideos"] === "true");
document.getElementsByName("allvideos")[1].checked = (conf["allvideos"] === "false");
document.getElementsByName("removePlay")[0].checked = (conf["removeplay"] === "true");
document.getElementsByName("removePlay")[1].checked = (conf["removeplay"] === "false");
}
}, 2500);
}

View File

@@ -3,33 +3,33 @@
<form id="adminForm" onsubmit="return false" name="ufo" action="" class="daform nomargin" id="base">
<div class="toggles">
<div class="toggler">
<label><input type="radio" class="radio"name="frontPage" value="1"><span>Display</span></label> /
<label><input type="radio" class="radio"name="frontPage" value="0"><span>Hide</span></label>
<label><input type="radio" class="radio"name="frontPage" value="true"><span>Display</span></label> /
<label><input type="radio" class="radio"name="frontPage" value="false"><span>Hide</span></label>
</div>
<div class="toggler">
<label><input type="radio" class="radio"name="vote" value="1"><span>Admin</span></label> /
<label><input type="radio" class="radio"name="vote" value="0"><span>Anyone</span></label>
<label><input type="radio" class="radio"name="vote" value="true"><span>Admin</span></label> /
<label><input type="radio" class="radio"name="vote" value="false"><span>Anyone</span></label>
</div>
<div class="toggler">
<label><input type="radio" class="radio"name="addSongs" value="1"><span>Admin</span></label> /
<label><input type="radio" class="radio"name="addSongs" value="0"><span>Anyone</span></label>
<label><input type="radio" class="radio"name="addSongs" value="true"><span>Admin</span></label> /
<label><input type="radio" class="radio"name="addSongs" value="false"><span>Anyone</span></label>
</div>
<div class="toggler">
<label><input type="radio" class="radio"name="longSongs" value="1"><span>Allow</span></label> /
<label><input type="radio" class="radio"name="longSongs" value="0"><span>Block</span></label>
<label><input type="radio" class="radio"name="longSongs" value="true"><span>Allow</span></label> /
<label><input type="radio" class="radio"name="longSongs" value="false"><span>Block</span></label>
</div>
<div class="toggler">
<label><input type="radio" class="radio"name="allvideos" value="1"><span>All</span></label> /
<label><input type="radio" class="radio"name="allvideos" value="0"><span>Song</span></label>
<label><input type="radio" class="radio"name="allvideos" value="true"><span>All</span></label> /
<label><input type="radio" class="radio"name="allvideos" value="false"><span>Song</span></label>
</div>
<div class="toggler">
<label><input type="radio" class="radio"name="removePlay" value="1"><span>Remove</span></label> /
<label><input type="radio" class="radio"name="removePlay" value="0"><span>Keep</span></label>
<label><input type="radio" class="radio"name="removePlay" value="true"><span>Remove</span></label> /
<label><input type="radio" class="radio"name="removePlay" value="false"><span>Keep</span></label>
</div>
</div>