Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound and video buttons #457

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 11 additions & 12 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { UsertoolbarComponent } from './components/usertoolbar/usertoolbar.component';
import { EditionComponent } from './components/edition/edition.component';
Expand Down Expand Up @@ -41,28 +40,28 @@ import { GridFormatManagementComponent } from './components/grid-format-manageme
import { PictogramStyleComponent } from './components/pictogram-style/pictogram-style.component';
import { DwellCursorComponent } from './components/dwell-cursor/dwell-cursor.component';
import { MainComponent } from './components/main/main.component';
import { MatAutocompleteModule } from "@angular/material/autocomplete";
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { UserPageComponent } from './components/user-page/user-page.component';
import { MatCardModule } from "@angular/material/card";
import { MatGridListModule } from "@angular/material/grid-list";
import { MatCardModule } from '@angular/material/card';
import { MatGridListModule } from '@angular/material/grid-list';
import { DialogDeleteUserComponent } from './components/dialog-delete-user/dialog-delete-user.component';
import { DialogChangeUserComponent } from './components/dialog-change-user/dialog-change-user.component';
import { DialogAddUserComponent } from './components/dialog-add-user/dialog-add-user.component';
import { DialogTextComponent } from './components/dialog-text/dialog-text.component';
import { MatInputModule } from "@angular/material/input";
import { MatInputModule } from '@angular/material/input';
import { MentionComponent } from './components/mention/mention.component';
import { DeletePageComponent } from './components/delete-page/delete-page.component';
import { MatListModule } from '@angular/material/list';
import { DialogDeletePageComponent } from './components/dialog-delete-page/dialog-delete-page.component';
import { MatButtonModule } from '@angular/material/button';
import { MatDialogModule } from "@angular/material/dialog";
import { MatMenuModule } from "@angular/material/menu";
import { MatFormFieldModule } from "@angular/material/form-field";
import { MatSelectModule } from "@angular/material/select";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatDialogModule } from '@angular/material/dialog';
import { MatMenuModule } from '@angular/material/menu';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { Spb2augComponent } from './components/spb2aug/spb2aug.component';
import { DialogHelpComponent } from './components/dialog-help/dialog-help.component';
import { MatIconModule } from "@angular/material/icon";
import { MatIconModule } from '@angular/material/icon';
import { ResetConfigurationComponent } from './components/reset-configuration/reset-configuration.component';
import { ResetGridComponent } from './components/reset-grid/reset-grid.component';
import { DialogResetGridComponent } from './components/dialog-reset-grid/dialog-reset-grid.component';
Expand All @@ -76,7 +75,7 @@ import { DialogLinkAFSRComponent } from './components/dialog-link-afsr/dialog-li
import { DialogLinkInteraactionboxComponent } from './components/dialog-link-interaactionbox/dialog-link-interaactionbox.component';
import { LoadingUserComponent } from './components/loading-user/loading-user.component';
import { DialogResetSettingsComponent } from './components/dialog-reset-settings/dialog-reset-settings.component';
import { LifeCompanion2augComponent } from "./components/life-companion2aug/life-companion2aug.component";
import { LifeCompanion2augComponent } from './components/life-companion2aug/life-companion2aug.component';
import { ModelGridComponent } from './components/model-grid/model-grid.component';
import { DialogModelGridComponent } from './components/dialog-model-grid/dialog-model-grid.component';
import { DialogExportPagesComponent } from './components/dialog-export-pages/dialog-export-pages.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function createElement(component: any, id: any, numberOfElementForms: number) {
DisplayedText: id + i,
VoiceText: id + i,
LexicInfos: [],
ImageID: id + i
ImageID: id + i,
AudioID: id + i,
VideoID: id + i
});
}
component.editionService.selectedElements.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class AlternativeFormsComponent implements OnInit {
}

imageList = [];
AudioList = [];
elementFormNameImageURL: any = '';
elementFormDisplayedWordField = '';
elementFormPronouncedWordField = '';
Expand Down Expand Up @@ -289,7 +290,7 @@ export class AlternativeFormsComponent implements OnInit {
}

/**
* Shows the image corresponding to a combination of selected library (mulberry or arasaac) and searched word (any)
* Shows the image corresponding to a combination of selected library (mulberry or arasaac) and searched word (any)
* @param elt library to be used and word to be searched
*/
previewLibrary(elt: { lib, word }) {
Expand All @@ -313,7 +314,7 @@ export class AlternativeFormsComponent implements OnInit {
}

/**
*
*
* @param elt library to be used and word to be searched
* @returns an url corresponding to the searched image's name in the selected library
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class DialogAddGridComponent implements OnInit {
}

/**
* Creates a new grid corresponding to selected options (name and type).
* Creates a new grid corresponding to selected options (name and type).
* If a grid already exists with the same name, not grid will be created and an error will be shown.
* @param newGrid Grid to be checked if already exists
*/
Expand All @@ -45,7 +45,7 @@ export class DialogAddGridComponent implements OnInit {
page.ElementIDsList = [];
page.NumberOfCols = 0;
page.NumberOfRows = 0;
this.boardService.board = new Grid(this.nameGrid, 'Grid', 6, 6, [], [], [page]);
this.boardService.board = new Grid(this.nameGrid, 'Grid', 6, 6, [], [], [page], [], []);
}
this.boardService.board.software = 'Augcom';
this.boardService.board.ID = this.nameGrid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export class DialogExportPagesComponent implements OnInit {
})
let exportedGrid: Grid;
if (this.pageToExport.NumberOfRows !== undefined && this.pageToExport.NumberOfCols !== undefined) {
exportedGrid = new Grid('exportedPage', 'Grid', Number(this.pageToExport.NumberOfCols), Number(this.pageToExport.NumberOfRows), this.gridElementOfPage, this.imageListOfPage, [this.pageToExport]);
exportedGrid = new Grid('exportedPage', 'Grid', Number(this.pageToExport.NumberOfCols), Number(this.pageToExport.NumberOfRows), this.gridElementOfPage, this.imageListOfPage, [this.pageToExport], [], []);
}
else {
exportedGrid = new Grid('exportedPage', 'Grid', 10, 10, this.gridElementOfPage, this.imageListOfPage, this.pageToExportList);
exportedGrid = new Grid('exportedPage', 'Grid', 10, 10, this.gridElementOfPage, this.imageListOfPage, this.pageToExportList, [],[]);
}
this.downloadFile(JSON.stringify(exportedGrid));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export class DialogModelGridComponent implements OnInit {
if (this.boardService.gridModel === 'default') {
this.indexDbAccessService.loadDefaultGrid();
} else if (this.boardService.gridModel === 'empty') {
let page = new Page();
const page = new Page();
page.ID = '#HOME';
page.Name = 'Accueil';
page.ElementIDsList = [];
this.boardService.board = new Grid('newGrid', 'Grid', 6, 6, [], [], [page]);
this.boardService.board = new Grid('newGrid', 'Grid', 6, 6, [], [], [page], [], []);
}
this.boardService.updateElementList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DialogResetGridComponent implements OnInit {
homePage.NumberOfCols = 3;
homePage.NumberOfRows = 3;
homePage.GapSize = 6;
this.boardService.board = new Grid('nothing', 'Grid', 0, 0, [], [], [homePage]);
this.boardService.board = new Grid('nothing', 'Grid', 0, 0, [], [], [homePage],[], []);
this.boardService.updateElementList();
}

Expand Down
15 changes: 7 additions & 8 deletions src/app/components/edition/edition.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
'border-style': 'solid',
'border-color': this.editionService.curentBorderColor}">
<div class="image haveBackgroundImage"
[style.background-image]="this.sanitizer.bypassSecurityTrustStyle('url(\'' +this.editionService.imageURL+'\')')">
[style.background-image]="this.sanitizer.bypassSecurityTrustStyle('url(\'' +this.editionService.imageURL+'\')')">

</div>
<div class="label centerText">
{{this.editionService.name}}
{{ this.editionService.name }}
</div>
</div>

</div>

<div class="width-100 floatLeft">
Expand All @@ -27,9 +26,9 @@
<div>
<div>
<div class="menu-item-title-container" [class.selected]="this.editionService.currentEditPage===section"
(click)="this.selectMenu(section)">
(click)="this.selectMenu(section)">
<div>
{{this.multilinguism.translate(section)}}
{{ this.multilinguism.translate(section) }}
</div>
</div>
</div>
Expand All @@ -40,11 +39,11 @@
</div>

<div class="save centerText floatLeft" (click)="this.save()">
{{this.multilinguism.translate("save")}}
{{ this.multilinguism.translate("save") }}
</div>
<br>
<div *ngIf="nameEmpty" class="messageError floatLeft">
{{this.multilinguism.translate("nameEmpty")}}
{{ this.multilinguism.translate("nameEmpty") }}
</div>

</div>
Expand All @@ -67,4 +66,4 @@
</ng-container>
</div>
</div>
{{this.configuration.VERSION}}
{{ this.configuration.VERSION }}
48 changes: 27 additions & 21 deletions src/app/components/edition/edition.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import { EditionComponent } from './edition.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Ng2ImgMaxModule } from 'ng2-img-max';
import { HttpClientModule } from '@angular/common/http';
import { Router } from '@angular/router';
import { Grid, GridElement } from '../../types';
import {EditionComponent} from './edition.component';
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {Ng2ImgMaxModule} from 'ng2-img-max';
import {HttpClientModule} from '@angular/common/http';
import {Router} from '@angular/router';
import {Grid, GridElement} from '../../types';

function newBoard(component: any) {
component.boardService.board = new Grid(
Expand All @@ -24,11 +24,15 @@ function newBoard(component: any) {
[{
DisplayedText: 'testBeforeModif',
VoiceText: 'testBeforeModif',
LexicInfos: [{ default: true }],
ImageID: ''
LexicInfos: [{default: true}],
ImageID: '',
AudioID: '',
VideoID: ''
}],
[])],
[],
[],
[],
[]
);
}
Expand All @@ -45,8 +49,10 @@ function addElementToBoard(component: any) {
[{
DisplayedText: 'test2BeforeModif',
VoiceText: 'test2BeforeModif',
LexicInfos: [{ default: true }],
ImageID: ''
LexicInfos: [{default: true}],
ImageID: '',
AudioID: '',
VideoID: ''
}],
[]));
}
Expand Down Expand Up @@ -95,7 +101,7 @@ describe('EditionComponent', () => {
fixture = TestBed.createComponent(EditionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
component.boardService.board = new Grid('gridId', 'grid', 2, 2, [], [], []);
component.boardService.board = new Grid('gridId', 'grid', 2, 2, [], [], [],[],[]);
component.indexedDBacess.loadUsersList();
});

Expand Down Expand Up @@ -269,30 +275,30 @@ describe('EditionComponent', () => {
component.editionService.colorPicked = 'inside';
component.editionService.selectedPalette = '22 magic colors';
fixture.detectChanges();

compiled.querySelector('.color').click();
fixture.detectChanges();

compiled.querySelector('.close').click();
fixture.detectChanges();

expect(component.editionService.curentColor).toEqual('#800000')
});


it('should change the bordercolor value when a bordercolor is selected', () => {
const compiled = fixture.debugElement.nativeElement;
clickElementOf(compiled, fixture, '.menu-item-title-container', 'Apparence');
component.editionService.colorPicked = 'border';
component.editionService.selectedPalette = '22 magic colors';
fixture.detectChanges();

compiled.querySelector('.color').click();
fixture.detectChanges();

compiled.querySelector('.close').click();
fixture.detectChanges();

expect(component.editionService.curentBorderColor).toEqual('#800000')
});
*/
Expand Down
Loading
Loading