-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from evt-project/feature/Highlight2
Feature/highlight2
- Loading branch information
Showing
62 changed files
with
14,147 additions
and
5,726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { CollationComponent } from './view-modes/collation/collation.component'; | ||
import { ImageTextComponent } from './view-modes/image-text/image-text.component'; | ||
import { ReadingTextComponent } from './view-modes/reading-text/reading-text.component'; | ||
import { TextSourcesComponent } from './view-modes/text-sources/text-sources.component'; | ||
import { TextTextComponent } from './view-modes/text-text/text-text.component'; | ||
import { TextVersionsComponent } from './view-modes/text-versions/text-versions.component'; | ||
|
||
const appRoutes: Routes = [ | ||
{ path: 'imageText', component: ImageTextComponent }, | ||
{ path: 'readingText', component: ReadingTextComponent }, | ||
{ path: 'textText', component: TextTextComponent }, | ||
{ path: 'collation', component: CollationComponent }, | ||
{ path: 'textSources', component: TextSourcesComponent }, | ||
{ path: 'textVersions', component: TextVersionsComponent }, | ||
]; | ||
@NgModule({ | ||
imports: [RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' })], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Component, ElementRef, HostBinding, HostListener, OnDestroy, ViewChild } from '@angular/core'; | ||
import { Title } from '@angular/platform-browser'; | ||
import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router'; | ||
import { NgxSpinnerService } from 'ngx-spinner'; | ||
import { BehaviorSubject, Observable, Subscription } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
import { AppConfig } from './app.config'; | ||
import { ThemesService } from './services/themes.service'; | ||
import { ShortcutsService } from './shortcuts/shortcuts.service'; | ||
import { EvtIconInfo } from './ui-components/icon/icon.component'; | ||
|
||
@Component({ | ||
selector: 'evt-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
}) | ||
export class AppComponent implements OnDestroy { | ||
@ViewChild('mainSpinner') mainSpinner: ElementRef; | ||
private subscriptions: Subscription[] = []; | ||
public hasNavBar = AppConfig.evtSettings.ui.enableNavBar; | ||
public navbarOpened$ = new BehaviorSubject(this.hasNavBar && AppConfig.evtSettings.ui.initNavBarOpened); | ||
|
||
public navbarTogglerIcon$: Observable<EvtIconInfo> = this.navbarOpened$.pipe( | ||
map((opened: boolean) => opened ? { icon: 'caret-down', iconSet: 'fas' } : { icon: 'caret-up', iconSet: 'fas' }), | ||
); | ||
|
||
constructor( | ||
private router: Router, | ||
private spinner: NgxSpinnerService, | ||
private shortcutsService: ShortcutsService, | ||
private themes: ThemesService, | ||
private titleService: Title, | ||
) { | ||
this.router.events.subscribe((event) => { | ||
switch (true) { | ||
case event instanceof NavigationStart: | ||
this.spinner.show(); | ||
break; | ||
case event instanceof NavigationEnd: | ||
case event instanceof NavigationCancel: | ||
case event instanceof NavigationError: | ||
this.spinner.hide(); | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
this.titleService.setTitle(AppConfig.evtSettings.edition.editionTitle || 'EVT'); | ||
} | ||
|
||
@HostBinding('attr.data-theme') get dataTheme() { return this.themes.getCurrentTheme().value; } | ||
|
||
toggleToolbar() { | ||
this.navbarOpened$.next(!this.navbarOpened$.getValue()); | ||
window.dispatchEvent(new Event('resize')); // Needed to tell Gridster to resize | ||
} | ||
|
||
ngOnDestroy() { | ||
this.subscriptions.forEach((subscription) => subscription.unsubscribe()); | ||
} | ||
|
||
@HostListener('window:keyup', ['$event']) | ||
keyEvent(e: KeyboardEvent) { | ||
this.shortcutsService.handleKeyboardEvent(e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.