Compare commits
No commits in common. "8fa40620159e31e1b5e51fb38d8d865a9d38f553" and "97b06fe9200756fe0ec72f8f910649f4222a5862" have entirely different histories.
8fa4062015
...
97b06fe920
5 changed files with 5 additions and 39 deletions
|
@ -38,7 +38,6 @@ img {
|
||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<script src="./js/element.js"></script>
|
<script src="./js/element.js"></script>
|
||||||
<div id="div_button_score">
|
<div id="div_button_score">
|
||||||
<script src="./js/technologie.js"></script>
|
<script src="./js/technologie.js"></script>
|
||||||
<div id="divButton_score">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Element{
|
||||||
this.techno = techno
|
this.techno = techno
|
||||||
}
|
}
|
||||||
|
|
||||||
chargerDepuisBdd(){
|
charger_depuis_bdd(){
|
||||||
fetch("../bdd/arbre.json").then((data)=>{
|
fetch("../bdd/arbre.json").then((data)=>{
|
||||||
data.json().then((data)=>{
|
data.json().then((data)=>{
|
||||||
this.props = data["technologies"][this.techno]["elements"][this.tag]
|
this.props = data["technologies"][this.techno]["elements"][this.tag]
|
||||||
|
@ -16,7 +16,7 @@ class Element{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
afficherDropsDansHtml(){
|
afficher_props_dans_html(){
|
||||||
const table= document.getElementById("table_technologies_body")
|
const table= document.getElementById("table_technologies_body")
|
||||||
|
|
||||||
const tr = document.createElement("tr")
|
const tr = document.createElement("tr")
|
||||||
|
|
33
js/main.js
33
js/main.js
|
@ -1,33 +0,0 @@
|
||||||
function remplirMagasin(){
|
|
||||||
|
|
||||||
|
|
||||||
const table= document.getElementById("table_magasin_body")
|
|
||||||
|
|
||||||
|
|
||||||
fetch("../bdd/arbre.json").then((data)=>{
|
|
||||||
data.json().then((data)=>{
|
|
||||||
console.log(data)
|
|
||||||
let tech = data["technologies"]
|
|
||||||
|
|
||||||
Object.keys(tech).forEach(key => {
|
|
||||||
el = tech[key]
|
|
||||||
const tr = document.createElement("tr")
|
|
||||||
const nom = document.createElement("td")
|
|
||||||
nom.innerText = el.nom
|
|
||||||
const boost = document.createElement("td")
|
|
||||||
boost.innerText = el.boost
|
|
||||||
const cout = document.createElement("td")
|
|
||||||
cout.innerText = el.cout
|
|
||||||
|
|
||||||
tr.appendChild(nom)
|
|
||||||
tr.appendChild(boost)
|
|
||||||
tr.appendChild(cout)
|
|
||||||
table.appendChild(tr)
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,7 +3,7 @@ class Technologie{
|
||||||
this.nom = nom
|
this.nom = nom
|
||||||
}
|
}
|
||||||
|
|
||||||
chargerDepuisBdd(){
|
charger_depuis_bdd(){
|
||||||
fetch("../bdd/arbre.json").then((data)=>{
|
fetch("../bdd/arbre.json").then((data)=>{
|
||||||
data.json().then((data)=>{
|
data.json().then((data)=>{
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
@ -15,7 +15,7 @@ class Technologie{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
appliquerAmeliorationStyle(){
|
appliquer_amelioration_style(){
|
||||||
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
|
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue