From 5842899a01bc1332b98eeb70a69ff34cf052aab0 Mon Sep 17 00:00:00 2001 From: Dslak Date: Wed, 9 Dec 2020 11:28:18 +0100 Subject: [PATCH] clean ur --- src/app/app.component.ts | 13 +++++++++---- src/app/detail/detail.component.ts | 8 ++++---- src/app/portfolio/portfolio.component.ts | 9 +++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f16fb86..ecc3a7e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,12 +1,17 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { Title } from '@angular/platform-browser'; + @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent { - title = 'Dslak | new-media arts'; +export class AppComponent implements OnInit { + + public constructor(private titleService: Title) { } - public constructor() { } + ngOnInit(): void { + this.titleService.setTitle('Dslak | New-media arts') + } } diff --git a/src/app/detail/detail.component.ts b/src/app/detail/detail.component.ts index 8400276..cab5fe0 100644 --- a/src/app/detail/detail.component.ts +++ b/src/app/detail/detail.component.ts @@ -30,6 +30,7 @@ export class DetailComponent implements OnInit { imageOffset: '0px', showDeleteControl: false, showImageTitle: false, + showArrows: false } public galleryImages: GALLERY_IMAGE[] = [] @@ -94,7 +95,7 @@ export class DetailComponent implements OnInit { }) this.loaded = !this.loadedImages.length - this.titleService.setTitle(`Dslak - New media arts | ${this.details.title}`) + this.titleService.setTitle(`Dslak | New-media arts | ${this.details.title}`) },(error) => { console.error('getPortfolio ERROR', error) @@ -115,7 +116,7 @@ export class DetailComponent implements OnInit { } else { this.location.back() title = this.router.url.split('/')[2] - this.titleService.setTitle(`Dslak - New media arts | ${title.charAt(0).toUpperCase() + title.slice(1)}`) + this.titleService.setTitle(`Dslak | New media arts | ${title.charAt(0).toUpperCase() + title.slice(1)}`) } } @@ -125,9 +126,8 @@ export class DetailComponent implements OnInit { this.loaded = this.init && this.loadedImages.every( (val) => !val) } - parseTitle(title): string { - return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '_') + return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-').replace('--', '-').replace('--', '-') } diff --git a/src/app/portfolio/portfolio.component.ts b/src/app/portfolio/portfolio.component.ts index 37e16e7..eecb298 100644 --- a/src/app/portfolio/portfolio.component.ts +++ b/src/app/portfolio/portfolio.component.ts @@ -75,8 +75,8 @@ export class PortfolioComponent implements OnInit { showDetails(id, title = ''): void { const section = this.section == 'exhibitions' ? 'exhibitions' : 'works' - if(title) { this.titleService.setTitle(`Dslak - New media arts | ${title}`) } - this.router.navigate([`/detail/${section}/${id}/${title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '_')}`]) + if(title) { this.titleService.setTitle(`Dslak | New-media arts | ${title}`) } + this.router.navigate([`/detail/${section}/${id}/${this.parseTitle(title)}`]) } onLoad(id): void { @@ -84,4 +84,9 @@ export class PortfolioComponent implements OnInit { this.loaded = this.init && this.portfolioItems.every( (val) => !val.loading) } + parseTitle(title): string { + return title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-').replace('--', '-').replace('--', '-') + } + + }