-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
40 lines (30 loc) · 1.13 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function creerInterface() {
const categories = ["Auteurs", "Époques", "Mouvements", "Œuvres", "Textes"];
const fiches = ["auteur", "epoque", "mouvement", "oeuvre", "texte"];
const extensions = [".html", ".json", ".md", ".rtf", ".xml", ".docx", ".pptx"];
/**
* formulaire en cours
*/
var formulaire: Formulaire;
var xtension = ".docx", categorie = "Textes";
new Radio(document.body, 2, 80, 176, 180, categories, (rad: string) => {
categorie = rad;
afficherForm();
}, true);
afficherForm();
function afficherForm(): void {
if (formulaire != undefined) formulaire.detruire();
let index = categories.indexOf(categorie);
let idCat = categorie.substring(0, categorie.length - 1);
formulaire = Formulaire.Creer(fiches[index], idCat, xtension, 180, 80);
let r = new Radio(formulaire.navig.div, 310, 0, 380, 28, extensions, (rad: string) => {
xtension = rad;
afficherForm();
}, false);
r.selectedIndex = extensions.indexOf(xtension);
}
}
window.onload = () => {
creerInterface();
}