This commit is contained in:
xdrm-brackets 2016-07-18 17:00:41 +02:00
parent cd0611118e
commit c5da74971b
3 changed files with 10 additions and 18 deletions

View File

@ -24,8 +24,6 @@
<span class='title' style='color: ".$_SESSION['WAREHOUSE']['theme']."'>@name <span>#@name</span></span>
<span class='link_remove' data-cluster='@id_machine_cluster'>@icon_remove</span>
<span class='link_edit' data-cluster='@id_machine_cluster'>@icon_edit</span>
<span class='code'>
@icon_type
<span>utilisateurs (@count)</span>

View File

@ -24,8 +24,6 @@
<span class='title' style='color: ".$_SESSION['WAREHOUSE']['theme']."'>@name <span>#@name</span></span>
<span class='link_remove' data-cluster='@id_user_cluster'>@icon_remove</span>
<span class='link_edit' data-cluster='@id_user_cluster'>@icon_edit</span>
<span class='code'>
@icon_type
<span>@count utilisateurs</span>

View File

@ -218,11 +218,7 @@
/* [0] Initialisation et éléments
=========================================================*/
/* (1) Etats du système */
var STATE = {
started: false,
signaled: false,
locked: false
};
var STATE = [ false, false, false ];
/* (2) Elements du DOM */
var mBox = document.getElementById('machine-box');
@ -260,17 +256,17 @@
---------------------------------------------------------*/
function updateChips(){
/* (1) Si machine bloquée */
if( STATE.locked ){
STATE.started = false;
STATE.signaled = false;
if( STATE[2] ){
STATE[0] = false;
STATE[1] = false;
led.style.background = '#f00';
}
/* (2) Si machine allumée */
else if( STATE.started ){
else if( STATE[0] ){
// {1} Allumée + signalée //
if( STATE.signaled )
if( STATE[1] )
led.style.background = '#00f';
// {2} Allumée (non signalée) //
@ -280,7 +276,7 @@
}else
led.style.background = '#000';
if( STATE.started == true )
if( STATE[0] == true )
r1.addClass('active');
else
r1.remClass('active');
@ -323,9 +319,9 @@
function countRoutine(){
COUNT++;
if( COUNT == 1 ) STATE.started = !STATE.started;
if( COUNT == 2 ) STATE.signaled = true;
if( COUNT == 3 ) STATE.locked = true;
if( COUNT == 1 ) STATE[0] = !STATE[0];
if( COUNT == 2 ) STATE[1] = true;
if( COUNT == 3 ) STATE[2] = true;
updateChips();
}