From 3f10c670f57298d631262fd4d270e90da3b5774d Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Thu, 3 May 2018 18:23:48 -0400 Subject: [PATCH] package update and improving lightbox --- backend/model/sql/IndexingManager.ts | 37 +-- frontend/app/frame/frame.component.ts | 4 +- frontend/app/gallery/gallery.component.html | 3 +- frontend/app/gallery/gallery.component.ts | 18 +- .../lightbox/lightbox.gallery.component.css | 3 - .../lightbox/lightbox.gallery.component.html | 3 +- .../lightbox/lightbox.gallery.component.ts | 280 +++++++++--------- .../photo.lightbox.gallery.component.css | 7 +- .../photo/photo.lightbox.gallery.component.ts | 18 +- .../model/network/authentication.service.ts | 8 +- frontend/app/model/notification.service.ts | 2 +- .../_abstract/abstract.settings.component.ts | 8 +- .../indexing/indexing.settings.component.ts | 18 +- .../indexing/indexing.settings.service.ts | 2 +- gulpfile.js | 13 +- package.json | 66 ++--- 16 files changed, 256 insertions(+), 234 deletions(-) diff --git a/backend/model/sql/IndexingManager.ts b/backend/model/sql/IndexingManager.ts index 098573c0..218c3bb0 100644 --- a/backend/model/sql/IndexingManager.ts +++ b/backend/model/sql/IndexingManager.ts @@ -1,13 +1,13 @@ -import {IIndexingManager} from "../interfaces/IIndexingManager"; -import {IndexingProgressDTO} from "../../../common/entities/settings/IndexingProgressDTO"; -import {ObjectManagerRepository} from "../ObjectManagerRepository"; -import {ISQLGalleryManager} from "./IGalleryManager"; -import * as path from "path"; -import {SQLConnection} from "./SQLConnection"; -import {DirectoryEntity} from "./enitites/DirectoryEntity"; -import {Logger} from "../../Logger"; +import {IIndexingManager} from '../interfaces/IIndexingManager'; +import {IndexingProgressDTO} from '../../../common/entities/settings/IndexingProgressDTO'; +import {ObjectManagerRepository} from '../ObjectManagerRepository'; +import {ISQLGalleryManager} from './IGalleryManager'; +import * as path from 'path'; +import {SQLConnection} from './SQLConnection'; +import {DirectoryEntity} from './enitites/DirectoryEntity'; +import {Logger} from '../../Logger'; -const LOG_TAG = "[IndexingManager]"; +const LOG_TAG = '[IndexingManager]'; export class IndexingManager implements IIndexingManager { directoriesToIndex: string[] = []; @@ -30,24 +30,24 @@ export class IndexingManager implements IIndexingManager { } this.indexingProgress.indexed++; for (let i = 0; i < scanned.directories.length; i++) { - this.directoriesToIndex.push(path.join(scanned.directories[i].path, scanned.directories[i].name)) + this.directoriesToIndex.push(path.join(scanned.directories[i].path, scanned.directories[i].name)); } process.nextTick(this.indexNewDirectory); }; startIndexing(): void { if (this.directoriesToIndex.length == 0 && this.enabled == false) { - Logger.info(LOG_TAG, "Starting indexing"); + Logger.info(LOG_TAG, 'Starting indexing'); this.indexingProgress = { indexed: 0, left: 0, - current: "" + current: '' }; - this.directoriesToIndex.push("/"); + this.directoriesToIndex.push('/'); this.enabled = true; this.indexNewDirectory(); } else { - Logger.info(LOG_TAG, "Already indexing.."); + Logger.info(LOG_TAG, 'Already indexing..'); } } @@ -56,7 +56,7 @@ export class IndexingManager implements IIndexingManager { } cancelIndexing(): void { - Logger.info(LOG_TAG, "Canceling indexing"); + Logger.info(LOG_TAG, 'Canceling indexing'); this.directoriesToIndex = []; this.indexingProgress = null; this.enabled = false; @@ -66,15 +66,16 @@ export class IndexingManager implements IIndexingManager { } async reset(): Promise { - Logger.info(LOG_TAG, "Resetting DB"); + Logger.info(LOG_TAG, 'Resetting DB'); this.directoriesToIndex = []; this.indexingProgress = null; this.enabled = false; const connection = await SQLConnection.getConnection(); return connection .getRepository(DirectoryEntity) - .createQueryBuilder("directory") + .createQueryBuilder('directory') .delete() - .execute(); + .execute().then(() => { + }); } } diff --git a/frontend/app/frame/frame.component.ts b/frontend/app/frame/frame.component.ts index d18f7973..acf4f246 100644 --- a/frontend/app/frame/frame.component.ts +++ b/frontend/app/frame/frame.component.ts @@ -16,9 +16,9 @@ import {NotificationService} from '../model/notification.service'; export class FrameComponent { user: BehaviorSubject; - authenticationRequired: boolean = false; + authenticationRequired = false; public title: string; - isIn: boolean = false; + isIn = false; constructor(private _authService: AuthenticationService, public notificationService: NotificationService) { diff --git a/frontend/app/gallery/gallery.component.html b/frontend/app/gallery/gallery.component.html index 3aba757e..404f25cc 100644 --- a/frontend/app/gallery/gallery.component.html +++ b/frontend/app/gallery/gallery.component.html @@ -1,4 +1,4 @@ - + @@ -18,7 +18,6 @@
  • - -
    diff --git a/frontend/app/gallery/gallery.component.ts b/frontend/app/gallery/gallery.component.ts index 9dc8a45e..7aa5c1fc 100644 --- a/frontend/app/gallery/gallery.component.ts +++ b/frontend/app/gallery/gallery.component.ts @@ -11,7 +11,7 @@ import {SearchResultDTO} from '../../../common/entities/SearchResultDTO'; import {ShareService} from './share.service'; import {NavigationService} from '../model/navigation.service'; import {UserRoles} from '../../../common/entities/UserDTO'; -import {Observable} from 'rxjs/Rx'; +import {interval} from 'rxjs/observable/interval'; import {ContentWrapper} from '../../../common/entities/ConentWrapper'; @Component({ @@ -24,8 +24,8 @@ export class GalleryComponent implements OnInit, OnDestroy { @ViewChild(GallerySearchComponent) search: GallerySearchComponent; @ViewChild(GalleryGridComponent) grid: GalleryGridComponent; - public showSearchBar: boolean = false; - public showShare: boolean = false; + public showSearchBar = false; + public showShare = false; public directories: DirectoryDTO[] = []; public isPhotoWithLocation = false; private $counter; @@ -64,11 +64,11 @@ export class GalleryComponent implements OnInit, OnDestroy { private onRoute = async (params: Params) => { const searchText = params['searchText']; - if (searchText && searchText != '') { - let typeString = params['type']; + if (searchText && searchText !== '') { + const typeString = params['type']; - if (typeString && typeString != '') { - let type: SearchTypes = SearchTypes[typeString]; + if (typeString && typeString !== '') { + const type: SearchTypes = SearchTypes[typeString]; this._galleryService.search(searchText, type); return; } @@ -77,7 +77,7 @@ export class GalleryComponent implements OnInit, OnDestroy { return; } - if (params['sharingKey'] && params['sharingKey'] != '') { + if (params['sharingKey'] && params['sharingKey'] !== '') { const sharing = await this.shareService.getSharing(); this._router.navigate(['/gallery', sharing.path], {queryParams: {sk: this.shareService.getSharingKey()}}); return; @@ -140,7 +140,7 @@ export class GalleryComponent implements OnInit, OnDestroy { this.subscription.route = this._route.params.subscribe(this.onRoute); if (this.shareService.isSharing()) { - this.$counter = Observable.interval(1000); + this.$counter = interval(1000); this.subscription.timer = this.$counter.subscribe((x) => this.updateTimer(x)); } diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.css b/frontend/app/gallery/lightbox/lightbox.gallery.component.css index 84842e5b..00387c33 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.css +++ b/frontend/app/gallery/lightbox/lightbox.gallery.component.css @@ -6,9 +6,6 @@ width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: hidden; - display: flex; /* add */ - justify-content: center; /* add to align horizontal */ - align-items: center; /* add to align vertical */ cursor: pointer; } diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.html b/frontend/app/gallery/lightbox/lightbox.gallery.component.html index bc5d0c9d..4cc6e6d0 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.html +++ b/frontend/app/gallery/lightbox/lightbox.gallery.component.html @@ -33,7 +33,8 @@ *ngIf="!fullScreenService.isFullScreenEnabled()" (click)="fullScreenService.showFullScreen(root)" title="toggle fullscreen" i18n-title> - +