diff --git a/nietzsche-beta-app/package.json b/nietzsche-beta-app/package.json index 0454186..ff5698a 100644 --- a/nietzsche-beta-app/package.json +++ b/nietzsche-beta-app/package.json @@ -1,56 +1,56 @@ { "name": "nietzsche-app-beta", - "version": "0.5.2.0", + "version": "0.5.2.1", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "compodoc": "./node_modules/.bin/compodoc -p tsconfig.app.json", "sparqljs": "./node_modules/sparqljs/sparql.js" }, "private": true, "dependencies": { "@angular/animations": "~8.2.14", "@angular/cdk": "~8.2.3", "@angular/common": "~8.2.14", "@angular/compiler": "~8.2.14", "@angular/core": "~8.2.14", "@angular/forms": "~8.2.14", "@angular/material": "^8.2.3", "@angular/platform-browser": "~8.2.14", "@angular/platform-browser-dynamic": "~8.2.14", "@angular/router": "~8.2.14", "@types/rdf-js": "^2.0.11", "lodash": "^4.17.20", "ngx-mat-standoff-markup": "^0.7.3", "rdfjs": "^0.0.1", "rxjs": "~6.4.0", "sparqljs": "^3.0.1", "tslib": "^1.10.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "^0.803.25", "@angular/cli": "~8.3.24", "@angular/compiler-cli": "~8.2.14", "@angular/language-service": "~8.2.14", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "^5.0.0", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", "typescript": "~3.5.3" } } diff --git a/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.html b/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.html index 7fefad1..3f9d384 100644 --- a/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.html +++ b/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.html @@ -1,22 +1,23 @@
diff --git a/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.ts b/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.ts index 2310d32..7ae9fad 100644 --- a/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.ts +++ b/nietzsche-beta-app/src/app/content-view-tab-component/content-view-tab-component.component.ts @@ -1,132 +1,137 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, NavigationEnd, Params, Router} from '@angular/router'; import {Subscription} from "rxjs/index"; import {NavigationServiceService} from "../services/navigation-service.service"; import { TLN_CROSSREF_EDITOR_ROUTE, TLN_CROSSREF_ROUTE, TLN_MANUSCRIPT_ROUTE, TLN_SEARCH_ROUTE, TLN_VIEWER_ROUTE } from '../tln-edition/constants'; @Component({ selector: 'app-content-view-tab-component', templateUrl: './content-view-tab-component.component.html', styleUrls: ['./content-view-tab-component.component.scss'], providers: [ NavigationServiceService ] }) export class ContentViewTabComponentComponent implements OnInit { // navigation tabs for the content view (manuscript view, page view, rhizome view) navTabLinks: any[]; // navbar on th left for navigating navBarOpenState = false; fullscreen = false; navBarOpenMode: string; queryParams: Params = {}; queryParamSubscription: Subscription; routeSubscription: Subscription; constructor(private router: Router, private activatedRoute: ActivatedRoute, private naviService: NavigationServiceService) { // The links/tabs for routing the correct view-component this.navTabLinks = [ { label: 'Manuskriptansicht', link: TLN_MANUSCRIPT_ROUTE, index: 0, isActive: true, - context: 'manuscript' // in which context the viewers are opened + context: 'manuscript', // in which context the viewers are opened + disabled: false }, { label: 'Seitenansicht', link: TLN_VIEWER_ROUTE, index: 1, isActive: false, - context: 'page' // in which context the viewers are opened + context: 'page', // in which context the viewers are opened + disabled: false }, { label: 'Querverweise', link: TLN_CROSSREF_ROUTE, index: 2, - isActive: false + isActive: false, + disabled: false }, { label: 'Suche', link: TLN_SEARCH_ROUTE, index: 3, - isActive: false + isActive: false, + disabled: false }, { label: 'Querverweis-Editor', link: TLN_CROSSREF_EDITOR_ROUTE, index: 4, - isActive: false + isActive: false, + disabled: true }, ]; // subscribe to route event and for marking the active navTab as active this.routeSubscription = this.router.events.subscribe((event) => { if ( event instanceof NavigationEnd) { // if the navigated link is not active, we set it acive if ( !this.navTabLinks.find(nl => nl.link === this.activatedRoute.snapshot.children.pop().routeConfig.path).isActive ) { this.setActiveLink(this.activatedRoute.snapshot.children.pop().routeConfig.path); } } }); this.queryParamSubscription = this.activatedRoute.queryParams.subscribe( (queryParams: Params ) => { this.queryParams = queryParams; if (queryParams.navBarOpenState) { this.navBarOpenState = JSON.parse(queryParams.navBarOpenState.toLowerCase()); } if (queryParams.fullscreen) { this.fullscreen = JSON.parse(queryParams.fullscreen.toLowerCase()); } }); } ngOnInit() { this.navBarOpenMode = 'side'; // side || over || push this.setParamsOnInit(); // If url pasted or page refreshed --> resetting this.queryparams to the query params of the url; // needed for active routing in the nav tabs & for general use in the template } // Sets the isActive prop of a navTabLink to true and all others to false . setActiveLink(link: string) { this.navTabLinks.forEach((navTabLink, index ) => { if (navTabLink.link === link) { this.navTabLinks[index].isActive = true; if (navTabLink.context) { window.setTimeout(() => this.naviService.updateRoute({contextView : navTabLink.context}), 300); } } else { this.navTabLinks[index].isActive = false; } }); } /** * setParamsOnInit checks if the page is loaded with query params. If a certain query param is missing, it will be set to a default value * */ setParamsOnInit() { const qParams: Params = {}; // Set the NavBarOpenstate to true if it is not defined explicitely as false in the url query param onInit. if (this.activatedRoute.snapshot.queryParamMap.get('navBarOpenState') !== 'false') { qParams.navBarOpenState = 'true'; } // viewMode if (!this.activatedRoute.snapshot.queryParamMap.get('viewMode')) { qParams.viewMode = 'Transkription/Faksimile'; } // contextView if (!this.activatedRoute.snapshot.queryParamMap.get('contextView')) { qParams.contextView = 'manuscript'; } // navTabIdx: if none default is null if (!this.activatedRoute.snapshot.queryParamMap.get('navTabIdx')) { if (this.activatedRoute.snapshot.queryParamMap.get('contextView') === 'manuscript' || qParams.contextView === 'manuscript') { qParams.navTabIdx = '0'; } else { qParams.navTabIdx = '1'; } } this.naviService.updateRoute(qParams); } } diff --git a/nietzsche-beta-app/src/app/main-menu-component/main-menu-component.component.ts b/nietzsche-beta-app/src/app/main-menu-component/main-menu-component.component.ts index 2fe19ce..e21caea 100644 --- a/nietzsche-beta-app/src/app/main-menu-component/main-menu-component.component.ts +++ b/nietzsche-beta-app/src/app/main-menu-component/main-menu-component.component.ts @@ -1,31 +1,30 @@ import { Component, OnInit } from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; import {Subscription} from 'rxjs'; import {ActivatedRoute, Params} from '@angular/router'; import { CONTENT_VIEW_ROUTE, DOCUMENTATION_ROUTE, HOME_ROUTE, IMPRESSUM_ROUTE, PROJECT_ROUTE } from '../constants'; @Component({ selector: 'app-main-menu-component', templateUrl: './main-menu-component.component.html', styleUrls: ['./main-menu-component.component.scss'] }) export class MainMenuComponentComponent implements OnInit { contentViewLink: string[] = [ CONTENT_VIEW_ROUTE ]; fullScreen: string; impressumLink: string[] = [ IMPRESSUM_ROUTE ]; homeLink: string[] = [ HOME_ROUTE ]; projectLink: string[] = [ PROJECT_ROUTE]; queryParamSub: Subscription; queryParams: Params; constructor(private activatedRoute: ActivatedRoute) { } ngOnInit() { this.queryParamSub = this.activatedRoute.queryParams.subscribe( (queryParams: Params ) => { this.fullScreen = queryParams.fullscreen; this.queryParams = queryParams; }); } }