mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
docs: add bookmarklet for auto-filling TFE test form
- bookmark.md with draggable link + readable source + lookup table reference - all field selectors match actual form name attributes and schema IDs
This commit is contained in:
111
docs/bookmarklet.md
Normal file
111
docs/bookmarklet.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# Bookmarklet
|
||||
|
||||
## Auto-fill TFE form (testing)
|
||||
|
||||
Drag the link below to your bookmarks bar, open `/admin/add.php?mode=student`, then click it. Every field gets filled with dummy data so you can hit submit immediately.
|
||||
|
||||
### Bookmarklet
|
||||
|
||||
**[Remplir TFE](javascript:(function()%7Bvar%20f%3Ddocument.querySelector('form.admin-form')%3Bif(!f)return%3Bvar%20set%3Dfunction(n%2Cv)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'%22]')%3Bif(e)%7Be.value%3Dv%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bvar%20check%3Dfunction(n)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'%22]')%3Bif(e)%7Be.checked%3Dtrue%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bvar%20checkCB%3Dfunction(n%2Cv)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'[]%22][value%3D%22'%2Bv%2B'%22]')%3Bif(e)%7Be.checked%3Dtrue%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bset('titre'%2C'TFE%20Test%20%E2%80%94%20Impact%20des%20r%C3%A9seaux%20sociaux%20sur%20la%20pratique%20artistique%20contemporaine')%3Bset('subtitle'%2C'%C3%89tude%20de%20cas%20aupr%C3%A8s%20des%20%C3%A9tudiant%C2%B7es%20de%20l%27ERG')%3Bset('auteurice'%2C'Marie-France%20Dupont')%3Bset('mail'%2C'mfd%40testmail.be')%3Bset('synopsis'%2C'Ce%20travail%20explore%20la%20mani%C3%A8re%20dont%20les%20plateformes%20num%C3%A9riques%20ont%20transform%C3%A9%20les%20processus%20de%20cr%C3%A9ation%20artistique.')%3Bcheck('contact_public')%3Bset('jury_president'%2C'Prof.%20Jean-Luc%20Moreau')%3Bset('jury_promoteur'%2C'Dr.%20Aline%20Vandenberghe')%3Bcheck('jury_promoteur_ext')%3Bset('ann%C3%A9e'%2C'2025')%3Bset('orientation'%2C'4')%3Bset('ap'%2C'3')%3Bset('finality'%2C'1')%3BcheckCB('languages'%2C'1')%3BcheckCB('languages'%2C'2')%3BcheckCB('formats'%2C'1')%3BcheckCB('formats'%2C'3')%3Bset('tag'%2C'r%C3%A9seaux%20sociaux%2Cart%20num%C3%A9rique%2Csociologie%2Cpratique%20artistique')%3Bset('license_id'%2C'7')%3Bset('duration_info'%2C'96%20pages')%3Bset('lien'%2C'https%3A%2F%2Fexample.com%2Ftfe-test')%3Bset('access_type_id'%2C'2')%3Bcheck('cc4r')%3B%7D)())**
|
||||
|
||||
### Readable source
|
||||
|
||||
```js
|
||||
(function () {
|
||||
var f = document.querySelector('form.admin-form');
|
||||
if (!f) return;
|
||||
|
||||
var set = function (name, val) {
|
||||
var e = f.querySelector('[name="' + name + '"]');
|
||||
if (e) { e.value = val; e.dispatchEvent(new Event('change', { bubbles: true })); }
|
||||
};
|
||||
var check = function (name) {
|
||||
var e = f.querySelector('[name="' + name + '"]');
|
||||
if (e) { e.checked = true; e.dispatchEvent(new Event('change', { bubbles: true })); }
|
||||
};
|
||||
var checkCB = function (name, val) {
|
||||
var e = f.querySelector('[name="' + name + '[]"][value="' + val + '"]');
|
||||
if (e) { e.checked = true; e.dispatchEvent(new Event('change', { bubbles: true })); }
|
||||
};
|
||||
|
||||
// ── Informations du TFE ──
|
||||
set('titre', 'TFE Test — Impact des réseaux sociaux sur la pratique artistique contemporaine');
|
||||
set('subtitle', 'Étude de cas auprès des étudiant·es de l\'ERG');
|
||||
set('auteurice', 'Marie-France Dupont');
|
||||
set('mail', 'mfd@testmail.be');
|
||||
set('synopsis', 'Ce travail explore la manière dont les plateformes numériques ont transformé les processus de création artistique.');
|
||||
check('contact_public');
|
||||
|
||||
// ── Jury ──
|
||||
set('jury_president', 'Prof. Jean-Luc Moreau');
|
||||
set('jury_promoteur', 'Dr. Aline Vandenberghe');
|
||||
check('jury_promoteur_ext');
|
||||
|
||||
// ── Cadre académique ──
|
||||
set('année', '2025');
|
||||
set('orientation', '4'); // Installation-Performance
|
||||
set('ap', '3'); // Atelier Pratiques Situées
|
||||
set('finality', '1'); // Approfondi
|
||||
checkCB('languages', '1'); // Français
|
||||
checkCB('languages', '2'); // Anglais
|
||||
checkCB('formats', '1'); // Site web
|
||||
checkCB('formats', '3'); // Vidéo
|
||||
set('tag', 'réseaux sociaux, art numérique, sociologie, pratique artistique');
|
||||
|
||||
// ── Métadonnées complémentaires ──
|
||||
set('license_id', '7'); // Tous droits réservés
|
||||
set('duration_info', '96 pages');
|
||||
set('lien', 'https://example.com/tfe-test');
|
||||
set('access_type_id', '2'); // Interne
|
||||
|
||||
// ── Licences (student mode only) ──
|
||||
check('cc4r');
|
||||
})();
|
||||
```
|
||||
|
||||
### Lookup table reference (schema.sql seed IDs)
|
||||
|
||||
| Table | ID | Value |
|
||||
|---|---|---|
|
||||
| **orientations** | 1 | Arts Numériques |
|
||||
| | 2 | Dessin |
|
||||
| | 3 | Cinéma d'animation |
|
||||
| | 4 | Installation-Performance |
|
||||
| | 5 | Peinture |
|
||||
| | 6 | Photographie |
|
||||
| | 7 | Sculpture |
|
||||
| | 8 | Vidéographie |
|
||||
| | 9 | Graphisme |
|
||||
| | 10 | Typographie |
|
||||
| | 11 | Design Numérique |
|
||||
| | 12 | Illustration |
|
||||
| | 13 | Bande-Dessinée |
|
||||
| | 14 | Sérigraphie |
|
||||
| | 15 | Gravure |
|
||||
| **ap_programs** | 1 | Narration Spéculative |
|
||||
| | 2 | Design et Politique du Multiple |
|
||||
| | 3 | Atelier Pratiques Situées |
|
||||
| | 4 | LIENS |
|
||||
| **finality_types** | 1 | Approfondi |
|
||||
| | 2 | Enseignement |
|
||||
| | 3 | Spécialisé |
|
||||
| **languages** | 1 | Français |
|
||||
| | 2 | Anglais |
|
||||
| **format_types** | 1 | Site web |
|
||||
| | 2 | Audio |
|
||||
| | 3 | Vidéo |
|
||||
| | 4 | Performance |
|
||||
| | 5 | Objet éditorial |
|
||||
| | 6 | Installation |
|
||||
| | 7 | Autre |
|
||||
| **license_types** | 1 | CC BY 4.0 |
|
||||
| | 2 | CC BY-SA 4.0 |
|
||||
| | 3 | CC BY-ND 4.0 |
|
||||
| | 4 | CC BY-NC 4.0 |
|
||||
| | 5 | CC BY-NC-SA 4.0 |
|
||||
| | 6 | CC BY-NC-ND 4.0 |
|
||||
| | 7 | Tous droits réservés |
|
||||
| | 8 | Domaine public |
|
||||
| **access_types** | 1 | Libre |
|
||||
| | 2 | Interne |
|
||||
| | 3 | Interdit |
|
||||
Reference in New Issue
Block a user