js
This commit is contained in:
parent
9a9e9c7b22
commit
f125df39ee
|
@ -11,6 +11,17 @@ function createElemNS(type,attributes){
|
||||||
{elem.setAttributeNS(null,i,attributes[i]);}
|
{elem.setAttributeNS(null,i,attributes[i]);}
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
function changeSelect(number,botId){
|
||||||
|
//show an other selector if bot is chosen
|
||||||
|
var next = parseInt(number) + 1;
|
||||||
|
if((botId > 0) && (botId < 12)){
|
||||||
|
if(document.getElementById('selectBot' + next){
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
show_bot_panel(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
function show_bot_panel(number){
|
function show_bot_panel(number){
|
||||||
//configurePlayers
|
//configurePlayers
|
||||||
var fieldset = createElem('fieldset',{'class':'botFormulaire'});
|
var fieldset = createElem('fieldset',{'class':'botFormulaire'});
|
||||||
|
@ -18,7 +29,7 @@ function show_bot_panel(number){
|
||||||
legend.innerHTML = 'bot ' + number;
|
legend.innerHTML = 'bot ' + number;
|
||||||
fieldset.appendChild(legend);
|
fieldset.appendChild(legend);
|
||||||
var p=createElem('p');
|
var p=createElem('p');
|
||||||
var select = createElem('select',{'id':'selectBot' + number, 'onchange':'changeSelect(this.value);'});
|
var select = createElem('select',{'id':'selectBot' + number, 'onchange':'changeSelect(number,this.value);'});
|
||||||
var option = createElem('option',{'value': '0', 'selected': 'selected'});
|
var option = createElem('option',{'value': '0', 'selected': 'selected'});
|
||||||
option.innerHTML = '';
|
option.innerHTML = '';
|
||||||
select.appendChild(option);
|
select.appendChild(option);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user