From ecbcb3c90631934b3623e521c2410ee241571428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Fri, 10 Nov 2017 19:00:25 +0100 Subject: [PATCH] =?UTF-8?q?verbesserungen=20bei=20den=20kn=C3=B6pfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quelldatein/manifestation/web/partie.ts | 169 ++++++++++++++---------- quelldatein/manifestation/web/vtm.css | 25 +++- quelldatein/manifestation/web/vtm.html | 3 +- 3 files changed, 119 insertions(+), 78 deletions(-) diff --git a/quelldatein/manifestation/web/partie.ts b/quelldatein/manifestation/web/partie.ts index 2557079..a2fe737 100644 --- a/quelldatein/manifestation/web/partie.ts +++ b/quelldatein/manifestation/web/partie.ts @@ -204,23 +204,32 @@ module mod_vtm_manifestation */ public erneuern_knoepfe() : void { - // Knöpfe anzeigen/ausblenden - { - document.querySelector("#knoepfe").setAttribute - ( - "class", - ( - (this.aufbau.modus_lesen() === mod_vtm_aufbau.modus_initial) - ? "initial" - : ( + let modus : mod_vtm_aufbau.typ_modus = this.aufbau.modus_lesen(); + let klasse : string; + switch (modus) + { + case mod_vtm_aufbau.modus_initial: + { + klasse = "initial"; + break; + } + case mod_vtm_aufbau.modus_ungewiss: + { + klasse = ( this.intervall.ist_schlicht() - ? "testen_laufend" - : "testen_stehend" - ) - ) - ) - ; - } + ? "ungewiss_laufend" + : "ungewiss_stehend" + ); + break; + } + case mod_vtm_aufbau.modus_fehlerhaft: + case mod_vtm_aufbau.modus_korrekt: + { + klasse = "fertig"; + break; + } + } + document.querySelector("#knoepfe").setAttribute("class", klasse); } @@ -238,6 +247,65 @@ module mod_vtm_manifestation } + /** + * @author kcf + */ + private anhalten() : void + { + if (this.intervall.ist_schlicht()) + { + clearInterval(this.intervall.lesen()); + this.intervall = (new klasse_nichts()); + } + else + { + let meldung : string = "kein Intervall gesetzt"; + console.warn(meldung); + } + this.erneuern_knoepfe(); + } + + + /** + * @author kcf + */ + private fortfahren() : void + { + this.aufbau.fortfahren(); + let modus : mod_vtm_aufbau.typ_modus = this.aufbau.modus_lesen(); + if (modus <= 1) + { + // nichts tun + } + else + { + this.anhalten(); + } + this.erneuern_knoepfe(); + } + + + /** + * @author kcf + */ + private testen() : void + { + let handle : any = setInterval(() => this.fortfahren(), 500); + this.intervall = (new klasse_schlicht(handle)); + } + + + /** + * @author kcf + */ + private bearbeiten() : void + { + this.anhalten(); + this.aufbau.zuruecksetzen(); + this.erneuern_knoepfe(); + } + + /** * @author kcf * @implementation @@ -318,45 +386,24 @@ module mod_vtm_manifestation } ) ; + // Schritt + document.querySelector("#knopf_schritt").addEventListener + ( + "click", + event => + { + this.anhalten(); + this.fortfahren(); + } + ) + ; // Testen document.querySelector("#knopf_testen").addEventListener ( "click", event => { - this.intervall = ( - new klasse_schlicht - ( - setInterval - ( - () => - { - this.aufbau.fortfahren(); - let modus : mod_vtm_aufbau.typ_modus = this.aufbau.modus_lesen(); - if (modus <= 1) - { - // nichts tun - } - else - { - if (this.intervall.ist_schlicht()) - { - clearInterval(this.intervall.lesen()); - this.intervall = (new klasse_nichts()); - } - else - { - let meldung : string = "kein Intervall gesetzt"; - console.warn(meldung); - } - } - this.erneuern_knoepfe(); - } - , - 500 - ) - ) - ); + this.testen(); } ) ; @@ -366,17 +413,7 @@ module mod_vtm_manifestation "click", event => { - if (this.intervall.ist_schlicht()) - { - clearInterval(this.intervall.lesen()); - this.intervall = (new klasse_nichts()); - } - else - { - let meldung : string = "kein Intervall gesetzt"; - console.warn(meldung); - } - this.erneuern_knoepfe(); + this.anhalten(); } ) ; @@ -386,17 +423,7 @@ module mod_vtm_manifestation "click", event => { - if (this.intervall.ist_schlicht()) - { - clearInterval(this.intervall.lesen()); - this.intervall = (new klasse_nichts()); - } - else - { - // nichts tun - } - this.aufbau.zuruecksetzen(); - this.erneuern_knoepfe(); + this.bearbeiten(); } ) ; diff --git a/quelldatein/manifestation/web/vtm.css b/quelldatein/manifestation/web/vtm.css index 7d4c86d..7494141 100644 --- a/quelldatein/manifestation/web/vtm.css +++ b/quelldatein/manifestation/web/vtm.css @@ -96,17 +96,30 @@ body > header font-size: 150%; } +#knoepfe > * + { + margin: 2px; + } + +#knoepfe.initial > #knopf_schritt {} #knoepfe.initial > #knopf_testen {} #knoepfe.initial > #knopf_anhalten {display: none;} #knoepfe.initial > #knopf_bearbeiten {display: none;} -#knoepfe.testen_laufend > #knopf_testen {display: none;} -#knoepfe.testen_laufend > #knopf_anhalten {} -#knoepfe.testen_laufend > #knopf_bearbeiten {} +#knoepfe.ungewiss_laufend > #knopf_schritt {display: none;} +#knoepfe.ungewiss_laufend > #knopf_testen {display: none;} +#knoepfe.ungewiss_laufend > #knopf_anhalten {} +#knoepfe.ungewiss_laufend > #knopf_bearbeiten {display: none;} -#knoepfe.testen_stehend > #knopf_testen {} -#knoepfe.testen_stehend > #knopf_anhalten {display: none;} -#knoepfe.testen_stehend > #knopf_bearbeiten {} +#knoepfe.ungewiss_stehend > #knopf_schritt {} +#knoepfe.ungewiss_stehend > #knopf_testen {} +#knoepfe.ungewiss_stehend > #knopf_anhalten {display: none;} +#knoepfe.ungewiss_stehend > #knopf_bearbeiten {} + +#knoepfe.fertig > #knopf_schritt {display: none;} +#knoepfe.fertig > #knopf_testen {display: none;} +#knoepfe.fertig > #knopf_anhalten {display: none;} +#knoepfe.fertig > #knopf_bearbeiten {} #aufgabe_status { diff --git a/quelldatein/manifestation/web/vtm.html b/quelldatein/manifestation/web/vtm.html index adee452..a1e2281 100644 --- a/quelldatein/manifestation/web/vtm.html +++ b/quelldatein/manifestation/web/vtm.html @@ -20,7 +20,8 @@
- + +