Update create.php

This commit is contained in:
Jesse James Isler 2022-03-31 13:01:07 +02:00
parent 033a5ad8b3
commit 1dbac88141

View File

@ -177,9 +177,9 @@
<i class="material-icons">code</i>Convars <i class="material-icons">code</i>Convars
</div> </div>
<div class="collapsible-body"> <div class="collapsible-body">
<pre >Normal Role Convars (also found in ULX): <pre>Normal Role Convars (also found in ULX):
<code id="cvars"></code> <code id="cvars"></code></pre>
Rolespecific Convars: <pre>Rolespecific Convars:
<code id="rcvars"></code></pre> <code id="rcvars"></code></pre>
</div> </div>
</li> </li>
@ -213,31 +213,41 @@
<!-- Updatescript --> <!-- Updatescript -->
<script> <script>
function updateCard() {
updateName();
updateColor();
updateDescription();
updateHowToPlay();
}
function updateName() { function updateName() {
document.getElementById("cardname").innerHTML = $('#name').val(); document.getElementById("cardname").innerHTML = document.getElementById("name").value;
} }
function updateHowToPlay() { function updateHowToPlay() {
document.getElementById("thowtoplay").innerHTML = $('#howtoplay').val(); document.getElementById("thowtoplay").innerHTML = document.getElementById("howtoplay").value;
}
function createMenuItem(name) {
let li = document.createElement('li');
li.textContent = name;
return li;
}
/*
function updateGoodRoles() {
goodRoles = $('#goodRoles').val();
goodRoles.forEach(element => document.getElementById("tplaysbestwith").appendChild(createMenuItem(element)); )
} }
*/ function createMenuItem(name) {
function updateDescription() { let li = document.createElement('li');
document.getElementById("carddescription").innerHTML = $('#description').val(); li.textContent = name;
return li;
} }
function updateGoodRoles() {
let goodRoles = document.getElementById('rolecolor').value;
goodRoles.forEach(element => document.getElementById("tplaysbestwith").appendChild(createMenuItem(element)));
}
function updateDescription() {
document.getElementById("carddescription").innerHTML = document.getElementById("description").value;
}
function updateColor() { function updateColor() {
let color = document.getElementById('rolecolor'); let color = document.getElementById('rolecolor');
let strength = document.getElementById("carddescription"); let strength = document.getElementById("carddescription");
let modifier = document.getElementById("modifier"); let modifier = document.getElementById("modifier");
let textcolor = document.getElementById("tcolor"); let textcolor = document.getElementById("tcolor");
@ -247,11 +257,8 @@
modifier.removeAttribute('disabled'); modifier.removeAttribute('disabled');
if (color.value === "transparent" || color.value === "black" || color.value === "white") { if (color.value === "transparent" || color.value === "black" || color.value === "white") {
modifier.value = ""; modifier.value = "";
modifier.setAttribute('disabled', '');
strength.value = ""; strength.value = "";
strength.setAttribute('disabled', '');
} else if (color.value === "brown" || color.value === "grey" || color.value === "blue-grey") { } else if (color.value === "brown" || color.value === "grey" || color.value === "blue-grey") {
@ -264,6 +271,12 @@
} }
</script> </script>
<!-- Start Tab init --> <!-- Start Tab init -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {