diff --git a/src/app/components/edition/edition.component.ts b/src/app/components/edition/edition.component.ts index ab1e19f4c..06e63c5a2 100644 --- a/src/app/components/edition/edition.component.ts +++ b/src/app/components/edition/edition.component.ts @@ -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 */ diff --git a/src/app/components/spb2aug/spb2aug.component.ts b/src/app/components/spb2aug/spb2aug.component.ts index 9547ff279..ea6a4cd77 100644 --- a/src/app/components/spb2aug/spb2aug.component.ts +++ b/src/app/components/spb2aug/spb2aug.component.ts @@ -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]); @@ -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 diff --git a/src/app/components/tile/tile.component.ts b/src/app/components/tile/tile.component.ts index 974f67143..6b39c7a6c 100644 --- a/src/app/components/tile/tile.component.ts +++ b/src/app/components/tile/tile.component.ts @@ -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; } }); } diff --git a/src/app/services/functions.service.ts b/src/app/services/functions.service.ts index 815101f3d..f71d33128 100644 --- a/src/app/services/functions.service.ts +++ b/src/app/services/functions.service.ts @@ -39,6 +39,9 @@ export class FunctionsService { 'otherforms', 'back', 'backHome', + 'turndownvolume', + 'turnupvolume', + 'mute', ) } diff --git a/src/assets/multilinguism.json b/src/assets/multilinguism.json index 02a6c1cee..44c653268 100644 --- a/src/assets/multilinguism.json +++ b/src/assets/multilinguism.json @@ -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"}