Skip to content
Closed
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
17,591 changes: 10,714 additions & 6,877 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions src/app/components/edition/edition.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ export class EditionComponent implements OnInit, ComponentCanDeactivate {
} else {
return new FolderGoTo(this.editionService.pageLink);
}
} else {
} else if(this.editionService.radioTypeFormat === 'button') {
return 'button';
} else {
return 'function';
}
}

Expand Down Expand Up @@ -357,7 +359,17 @@ export class EditionComponent implements OnInit, ComponentCanDeactivate {
this.editionService.name = this.editionService.getDefaultForm(elementToModif.ElementFormsList).DisplayedText;
this.editionService.curentColor = this.gridElementService.getStyle(elementToModif).BackgroundColor;
this.editionService.curentBorderColor = this.gridElementService.getStyle(elementToModif).BorderColor;
this.editionService.radioTypeFormat = elementToModif.Type === 'button' ? 'button' : 'folder';
switch(elementToModif.Type){
case 'button':
this.editionService.radioTypeFormat = 'button';
break;
case 'folder':
this.editionService.radioTypeFormat = 'folder';
break;
case 'function':
this.editionService.radioTypeFormat = 'function';
break;
}
this.editionService.pageLink = elementToModif.Type === 'button' ? '@' : (elementToModif.Type as FolderGoTo).GoTo;
const imageToModif = this.boardService.board.ImageList.find(x => x.ID === elementToModif.ElementFormsList[0].ImageID);
if (imageToModif != null && imageToModif !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="page-content">
<div class="tableTitle"> {{multilinguism.translate("modifInfo")}}</div>
<div class="element">
<label class="label" for="namefield">{{multilinguism.translate("elementName")}} : </label>
<input id="namefield" (keyup)="getName($event)" class="input width-100" [placeholder]="nameInput" type="text">
<label class="label" for="namefield" *ngIf="this.editionService.radioTypeFormat!='function'">{{multilinguism.translate("elementName")}} : </label>
<input id="namefield" (keyup)="getName($event)" class="input width-100" [placeholder]="nameInput" type="text" *ngIf="this.editionService.radioTypeFormat!='function'">

<label class="label" for="typefield">{{multilinguism.translate("elementType")}} : </label>
<form id="typefield" class="input width-100">
Expand All @@ -20,14 +20,28 @@
<label class="radio" for="radioFolder">{{multilinguism.translate("folder")}}</label>
<p class="subtitle">{{ multilinguism.translate("folderDescription") }}</p>

<input [(ngModel)]="this.editionService.radioTypeFormat" id="radioFunction" name="typeFormat" type="radio"
value="function">
<label class="radio" for="radioFunction">{{multilinguism.translate("function")}}</label>
<p class="subtitle">{{ multilinguism.translate("functionDescription") }}</p>

<select class="selectBox" [(ngModel)]="this.editionService.pageLink"
*ngIf="this.editionService.radioTypeFormat=='folder'" [ngModelOptions]="{standalone: true}">
<option value="@NEW@">-{{multilinguism.translate("createNewPage")}}-</option>
<ng-container *ngFor="let p of this.board.board.PageList">
<option value="{{p.ID}}"> {{p.ID}} </option>
</ng-container>
<label class="radio">{{multilinguism.translate("OpenTheFolder")}}</label>
</select>


<select class="selectBox" [(ngModel)]="this.name" (click)="setName()"
*ngIf="this.editionService.radioTypeFormat=='function'" [ngModelOptions]="{standalone: true}">
<ng-container *ngFor="let p of this.editionService.function">
<option value="{{p}}"> {{multilinguism.translate(p)}} </option>
</ng-container>
<label class="radio" >{{multilinguism.translate("OpenTheFolder")}}</label>
</select>

<input type="text" [(ngModel)]="this.editionService.newPage"
placeholder="{{multilinguism.translate('newPageID')}}"
*ngIf="this.editionService.radioTypeFormat=='folder' && this.editionService.pageLink === '@NEW@'"
Expand All @@ -36,4 +50,4 @@
</div>
</div>
</div>
</ng-container>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ export class InformationEditionPageComponent implements OnInit {
this.editionService.name = this.name;
this.editionService.newPage = this.name;
}

setName(){
console.log("ça click");
this.nameInput = this.name;
this.editionService.name = this.name;
this.editionService.newPage = this.name;
}
}
3 changes: 3 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,9 @@ export class Spb2augComponent implements OnInit {
} else {
gridElement.x = Number(tabResPos[0]) + 1;
}
if(gridElement.ElementFormsList[0].DisplayedText == "Retour" || gridElement.ElementFormsList[0].DisplayedText == "retour" || gridElement.ElementFormsList[0].DisplayedText == "Monter le son" || gridElement.ElementFormsList[0].DisplayedText == "Baisser le son" || gridElement.ElementFormsList[0].DisplayedText == "Couper le son"){
gridElement.Type = 'function';
}
gridElement.y = Number(tabResPos[1]);
gridElement.rows = Number(tabResSpan[1]);
gridElement.cols = Number(tabResSpan[0]);
Expand Down
33 changes: 30 additions & 3 deletions src/app/components/tile/tile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ export class TileComponent implements OnInit, OnDestroy {
(element.Type as FolderGoTo).GoTo;
}
this.layoutService.refresh();

// for errors
} else {
} else if (element.Type == "function") {
this.assignFunctionToButton(element);
}
// for errors
else {
console.error(element.Type);
console.error(
'ElementType : ' +
Expand All @@ -242,6 +244,31 @@ export class TileComponent implements OnInit, OnDestroy {
this.boardService.updateElementList();
}

/**
* 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.ElementFormsList[0].DisplayedText.toLowerCase() == "back"){
this.boardService.backToPreviousFolder();
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "monter le son" || element.ElementFormsList[0].DisplayedText.toLowerCase() == "turn up the sound"){
this.configurationService.VOLUME += 0.1;
if(this.configurationService.VOLUME > 1){
this.configurationService.VOLUME = 1;
}
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "baisser le son" || element.ElementFormsList[0].DisplayedText.toLowerCase() == "turn down the sound"){
this.configurationService.VOLUME -= 0.1;
if(this.configurationService.VOLUME < 0) {
this.configurationService.VOLUME = 0;
}
}else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "couper le volume" || element.ElementFormsList[0].DisplayedText.toLowerCase() == "mute"){
this.configurationService.VOLUME = 0;
}
else if(element.ElementFormsList[0].DisplayedText.toLowerCase() == "accueil" || element.ElementFormsList[0].DisplayedText.toLowerCase() == "home"){
this.boardService.backHome();
}
}

/**
* Return true if the element is part of the search result
*
Expand Down
2 changes: 2 additions & 0 deletions src/app/services/edition.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export class EditionService {
pageLink = '@';
newPage = '';

function:string[] = ["Retour", "Monter le son", "Baisser le son", "Couper le volume"];

selectedPalette = this.paletteService.defaultPalette;
insideCheck: boolean = false;
borderCheck: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class FolderGoTo {
*/
export class GridElement {
ID: string;
Type: 'empty' | 'button' | FolderGoTo;
Type: 'empty' | 'button' | FolderGoTo | 'function';
PartOfSpeech: '-nom-' | '-nom-pr-' | 'nom de famille' | '-adv-' | 'prénom' | '-adj-' | 'variante typographique' | '-verb' | 'pronom' | 'locution-phrase' | 'interjection' | 'onomatopée' | 'pronom démonstratif' | 'adjectif indéfini' | 'pronom indéfini' | 'pronom personnel' | 'conjonction' | 'adjectif numéral' | 'préposition' | 'article partitif' | 'adverbe interrogatif' | 'conjonction de coordination' | 'pronom interrogatif' | 'pronom relatif' | 'pronom possessif' | 'erreur' | 'locution phrase' | 'proverbe' | 'adverbe relatif' | 'nom scientifique' | 'adjectif exclamatif' | 'adjectif interrogatif' | 'adjectif possessif' | 'adjectif démonstratif' | 'patronyme' | 'article défini' | 'interj' | 'locution' | 'article indéfini' | string;
VisibilityLevel: number;
x: number;
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" : "Baisser le son", "FR": "Baisser le son", "EN": "Turn down the sound"},
{ "id" : "Monter le son", "FR": "Monter le son", "EN": "Turn up the sound"},
{ "id" : "Couper le volume", "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
Loading