Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/components/edition/edition.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export class EditionComponent implements OnInit, ComponentCanDeactivate {
}
}


/**
* Creates a new button and adds it to the board, given the information of this class, updated by the edition html panel
*/
Expand Down
21 changes: 21 additions & 0 deletions src/app/components/spb2aug/spb2aug.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export class Spb2augComponent implements OnInit {
} else {
gridElement.x = Number(tabResPos[0]) + 1;
}
this.assignFunctionToButton(gridElement);
gridElement.y = Number(tabResPos[1]);
gridElement.rows = Number(tabResSpan[1]);
gridElement.cols = Number(tabResSpan[0]);
Expand Down Expand Up @@ -257,6 +258,26 @@ export class Spb2augComponent implements OnInit {
}
}

/**
* assign the function to the button by mathching his text
* @param element current grid element
*/
assignFunctionToButton(element:GridElement){
if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "retour"){
element.InteractionsList[0].ActionList = [];
element.InteractionsList[0].ActionList.push({ID:'back', Options: []});
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "monter le son"){
element.InteractionsList[0].ActionList = [];
element.InteractionsList[0].ActionList.push({ID:'turnupvolume', Options: []});
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "baisser le son"){
element.InteractionsList[0].ActionList = [];
element.InteractionsList[0].ActionList.push({ID:'turndownvolume', Options: []});
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "couper le son"){
element.InteractionsList[0].ActionList = [];
element.InteractionsList[0].ActionList.push({ID:'mute', Options: []});
}
}

/**
* this function check if we need a new page, if yes I add a new page and a button to go in
* @param gridElement current gridElement I am checking if he can be filled in the page or if we need more
Expand Down
12 changes: 12 additions & 0 deletions src/app/components/tile/tile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ export class TileComponent implements OnInit, OnDestroy {
this.boardService.backToPreviousFolder();
} else if (action.ID === 'backHome') {
this.boardService.backHome();
} else if ((action.ID) === 'turndownvolume'){
this.configurationService.VOLUME -= 0.1;
if(this.configurationService.VOLUME < 0) {
this.configurationService.VOLUME = 0;
}
} else if ((action.ID) === 'turnupvolume'){
this.configurationService.VOLUME += 0.1;
if(this.configurationService.VOLUME > 1){
this.configurationService.VOLUME = 1;
}
} else if ((action.ID) === 'mute'){
this.configurationService.VOLUME = 0;
}
});
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/services/functions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export class FunctionsService {
'otherforms',
'back',
'backHome',
'turndownvolume',
'turnupvolume',
'mute',
)
}

Expand Down
6 changes: 6 additions & 0 deletions src/assets/multilinguism.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@
{ "id" : "WordNameFile", "FR": "ClavierAugCom", "EN": "GridFileAugcom"},
{ "id" : "WordTitle", "FR": "Clavier Augcom", "EN": "AugCom main grid"},
{ "id" : "WordFolder", "FR": "Sous Dossier", "EN": "Folder"},
{ "id" : "OpenTheFolder", "FR": "Ouvre le dossier", "EN": "Open the folder"},
{ "id" : "functionDescription", "FR": "L'élément créé sera un bouton qui effectue des actions", "EN": "The element created will be a button that performs the following actions"},
{ "id" : "Retour", "FR": "Retour", "EN": "Back"},
{ "id" : "turndownvolume", "FR": "Baisser le son", "EN": "Turn down the sound"},
{ "id" : "turnupvolume", "FR": "Monter le son", "EN": "Turn up the sound"},
{ "id" : "mute", "FR": "Couper le volume", "EN": "Mute"},
{ "id" : "path", "FR": "Chemin", "EN": "Path"},
{ "id" : "titlePage", "FR": "Titre de la page", "EN": "Title of the page"},
{ "id" : "visualisationPath", "FR": "Visualisation du chemin", "EN": "Path visualization"}
Expand Down