2022-12-29 02:12:18 +08:00
|
|
|
import {Injectable, NgModule} from '@angular/core';
|
|
|
|
import {BrowserModule, HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerModule,} from '@angular/platform-browser';
|
|
|
|
import {FormsModule} from '@angular/forms';
|
|
|
|
import {AppComponent} from './app.component';
|
|
|
|
import {UserService} from './model/network/user.service';
|
|
|
|
import {ContentService} from './ui/gallery/content.service';
|
|
|
|
import {NetworkService} from './model/network/network.service';
|
|
|
|
import {GalleryCacheService} from './ui/gallery/cache.gallery.service';
|
|
|
|
import {FullScreenService} from './ui/gallery/fullscreen.service';
|
|
|
|
import {AuthenticationService} from './model/network/authentication.service';
|
|
|
|
import {FrameComponent} from './ui/frame/frame.component';
|
|
|
|
import {LeafletModule} from '@asymmetrik/ngx-leaflet';
|
|
|
|
import {LoadingBarModule} from '@ngx-loading-bar/core';
|
|
|
|
import {GalleryLightboxMediaComponent} from './ui/gallery/lightbox/media/media.lightbox.gallery.component';
|
|
|
|
import {GalleryPhotoLoadingComponent} from './ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component';
|
|
|
|
import {GalleryNavigatorComponent} from './ui/gallery/navigator/navigator.gallery.component';
|
|
|
|
import {GallerySearchComponent} from './ui/gallery/search/search.gallery.component';
|
|
|
|
import {GalleryLightboxComponent} from './ui/gallery/lightbox/lightbox.gallery.component';
|
|
|
|
import {GalleryDirectoryComponent} from './ui/gallery/directories/directory/directory.gallery.component';
|
|
|
|
import {GalleryGridComponent} from './ui/gallery/grid/grid.gallery.component';
|
|
|
|
import {GalleryPhotoComponent} from './ui/gallery/grid/photo/photo.grid.gallery.component';
|
|
|
|
import {LoginComponent} from './ui/login/login.component';
|
|
|
|
import {AdminComponent} from './ui/admin/admin.component';
|
|
|
|
import {GalleryComponent} from './ui/gallery/gallery.component';
|
|
|
|
import {StringifyRole} from './pipes/StringifyRolePipe';
|
|
|
|
import {GPXFilesFilterPipe} from './pipes/GPXFilesFilterPipe';
|
|
|
|
import {GalleryMapComponent} from './ui/gallery/map/map.gallery.component';
|
|
|
|
import {GalleryMapLightboxComponent} from './ui/gallery/map/lightbox/lightbox.map.gallery.component';
|
|
|
|
import {ThumbnailManagerService} from './ui/gallery/thumbnailManager.service';
|
|
|
|
import {OverlayService} from './ui/gallery/overlay.service';
|
|
|
|
import {GalleryShareComponent} from './ui/gallery/share/share.gallery.component';
|
|
|
|
import {ShareLoginComponent} from './ui/sharelogin/share-login.component';
|
|
|
|
import {ShareService} from './ui/gallery/share.service';
|
|
|
|
import {ModalModule} from 'ngx-bootstrap/modal';
|
|
|
|
import {BsDatepickerModule} from 'ngx-bootstrap/datepicker';
|
|
|
|
import {ToastrModule} from 'ngx-toastr';
|
|
|
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
|
|
import {NotificationService} from './model/notification.service';
|
|
|
|
import {JwBootstrapSwitchNg2Module} from 'jw-bootstrap-switch-ng2';
|
|
|
|
import {ClipboardModule} from 'ngx-clipboard';
|
|
|
|
import {NavigationService} from './model/navigation.service';
|
|
|
|
import {InfoPanelLightboxComponent} from './ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component';
|
|
|
|
import {TooltipModule} from 'ngx-bootstrap/tooltip';
|
|
|
|
import {BsDropdownModule} from 'ngx-bootstrap/dropdown';
|
|
|
|
import {CollapseModule} from 'ngx-bootstrap/collapse';
|
|
|
|
import {PopoverModule} from 'ngx-bootstrap/popover';
|
|
|
|
import {SettingsService} from './ui/settings/settings.service';
|
|
|
|
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule,} from '@angular/common/http';
|
|
|
|
import {DefaultUrlSerializer, UrlSerializer, UrlTree} from '@angular/router';
|
|
|
|
import {LanguageComponent} from './ui/language/language.component';
|
|
|
|
import {QueryService} from './model/query.service';
|
|
|
|
import {IconizeSortingMethod} from './pipes/IconizeSortingMethod';
|
|
|
|
import {StringifySortingMethod} from './pipes/StringifySortingMethod';
|
|
|
|
import {RandomQueryBuilderGalleryComponent} from './ui/gallery/random-query-builder/random-query-builder.gallery.component';
|
|
|
|
import {DurationPipe} from './pipes/DurationPipe';
|
|
|
|
import {MapService} from './ui/gallery/map/map.service';
|
|
|
|
import {ThumbnailLoaderService} from './ui/gallery/thumbnailLoader.service';
|
|
|
|
import {FileSizePipe} from './pipes/FileSizePipe';
|
|
|
|
import {DuplicateService} from './ui/duplicates/duplicates.service';
|
|
|
|
import {DuplicateComponent} from './ui/duplicates/duplicates.component';
|
|
|
|
import {DuplicatesPhotoComponent} from './ui/duplicates/photo/photo.duplicates.component';
|
|
|
|
import {SeededRandomService} from './model/seededRandom.service';
|
|
|
|
import {FacesComponent} from './ui/faces/faces.component';
|
|
|
|
import {FacesService} from './ui/faces/faces.service';
|
|
|
|
import {FaceComponent} from './ui/faces/face/face.component';
|
|
|
|
import {VersionService} from './model/version.service';
|
|
|
|
import {DirectoriesComponent} from './ui/gallery/directories/directories.component';
|
|
|
|
import {ControlsLightboxComponent} from './ui/gallery/lightbox/controls/controls.lightbox.gallery.component';
|
|
|
|
import {TimepickerModule} from 'ngx-bootstrap/timepicker';
|
|
|
|
import {TimeStampDatePickerComponent} from './ui/utils/timestamp-datepicker/datepicker.component';
|
|
|
|
import {TimeStampTimePickerComponent} from './ui/utils/timestamp-timepicker/timepicker.component';
|
|
|
|
import {ScheduledJobsService} from './ui/settings/scheduled-jobs.service';
|
|
|
|
import {BackendtextService} from './model/backendtext.service';
|
|
|
|
import {ErrorInterceptor} from './model/network/helper/error.interceptor';
|
|
|
|
import {CSRFInterceptor} from './model/network/helper/csrf.interceptor';
|
|
|
|
import {SettingsEntryComponent} from './ui/settings/_abstract/settings-entry/settings-entry.component';
|
|
|
|
import {GallerySearchQueryEntryComponent} from './ui/gallery/search/query-enrty/query-entry.search.gallery.component';
|
|
|
|
import {StringifySearchQuery} from './pipes/StringifySearchQuery';
|
|
|
|
import {AutoCompleteService} from './ui/gallery/search/autocomplete.service';
|
|
|
|
import {SearchQueryParserService} from './ui/gallery/search/search-query-parser.service';
|
|
|
|
import {GallerySearchFieldBaseComponent} from './ui/gallery/search/search-field-base/search-field-base.gallery.component';
|
|
|
|
import {AppRoutingModule} from './app.routing';
|
|
|
|
import {CookieService} from 'ngx-cookie-service';
|
|
|
|
import {LeafletMarkerClusterModule} from '@asymmetrik/ngx-leaflet-markercluster';
|
|
|
|
import {icon, Marker} from 'leaflet';
|
|
|
|
import {AlbumsComponent} from './ui/albums/albums.component';
|
|
|
|
import {AlbumComponent} from './ui/albums/album/album.component';
|
|
|
|
import {AlbumsService} from './ui/albums/albums.service';
|
|
|
|
import {GallerySearchQueryBuilderComponent} from './ui/gallery/search/query-builder/query-bulder.gallery.component';
|
|
|
|
import {SavedSearchPopupComponent} from './ui/albums/saved-search-popup/saved-search-popup.component';
|
|
|
|
import {MarkdownModule} from 'ngx-markdown';
|
|
|
|
import {GalleryBlogComponent} from './ui/gallery/blog/blog.gallery.component';
|
|
|
|
import {MDFilesFilterPipe} from './pipes/MDFilesFilterPipe';
|
|
|
|
import {FileDTOToPathPipe} from './pipes/FileDTOToPathPipe';
|
|
|
|
import {BlogService} from './ui/gallery/blog/blog.service';
|
|
|
|
import {PhotoFilterPipe} from './pipes/PhotoFilterPipe';
|
|
|
|
import {GallerySearchFieldComponent} from './ui/gallery/search/search-field/search-field.gallery.component';
|
|
|
|
import {GalleryFilterComponent} from './ui/gallery/filter/filter.gallery.component';
|
|
|
|
import {GallerySortingService} from './ui/gallery/navigator/sorting.service';
|
|
|
|
import {FilterService} from './ui/gallery/filter/filter.service';
|
|
|
|
import {TemplateComponent} from './ui/settings/template/template.component';
|
2022-12-29 05:12:53 +08:00
|
|
|
import {AbstractSettingsService} from './ui/settings/_abstract/abstract.settings.service';
|
2022-12-31 07:20:42 +08:00
|
|
|
import {WorkflowComponent} from './ui/settings/workflow/workflow.component';
|
2022-12-30 22:35:07 +08:00
|
|
|
import {JobProgressComponent} from './ui/settings/jobs/progress/job-progress.settings.component';
|
|
|
|
import {JobButtonComponent} from './ui/settings/jobs/button/job-button.settings.component';
|
2022-12-31 07:20:42 +08:00
|
|
|
import {GalleryStatisticComponent} from './ui/settings/gallery-statistic/gallery-statistic.component';
|
2016-12-27 06:36:38 +08:00
|
|
|
|
2018-05-08 03:42:32 +08:00
|
|
|
@Injectable()
|
2017-07-18 00:30:16 +08:00
|
|
|
export class MyHammerConfig extends HammerGestureConfig {
|
2018-12-18 07:06:25 +08:00
|
|
|
events: string[] = ['pinch'];
|
|
|
|
overrides = {
|
2022-12-29 02:12:18 +08:00
|
|
|
pan: {threshold: 1},
|
|
|
|
swipe: {direction: 31}, // enable swipe up
|
|
|
|
pinch: {enable: true},
|
2018-03-31 03:30:30 +08:00
|
|
|
};
|
2017-07-18 00:30:16 +08:00
|
|
|
}
|
2018-12-09 01:17:33 +08:00
|
|
|
|
2017-07-19 13:48:22 +08:00
|
|
|
export class CustomUrlSerializer implements UrlSerializer {
|
2022-04-05 01:37:31 +08:00
|
|
|
private defaultUrlSerializer: DefaultUrlSerializer =
|
|
|
|
new DefaultUrlSerializer();
|
2017-07-19 00:26:24 +08:00
|
|
|
|
|
|
|
parse(url: string): UrlTree {
|
|
|
|
// Encode parentheses
|
|
|
|
url = url.replace(/\(/g, '%28').replace(/\)/g, '%29');
|
|
|
|
// Use the default serializer.
|
2021-04-11 21:59:30 +08:00
|
|
|
return this.defaultUrlSerializer.parse(url);
|
2017-07-19 00:26:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
serialize(tree: UrlTree): string {
|
2022-04-05 01:37:31 +08:00
|
|
|
return this.defaultUrlSerializer
|
|
|
|
.serialize(tree)
|
|
|
|
.replace(/%28/g, '(')
|
|
|
|
.replace(/%29/g, ')');
|
2017-07-19 00:26:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-02 01:35:18 +08:00
|
|
|
// Fixes Leaflet icon path issue:
|
|
|
|
// https://stackoverflow.com/questions/41144319/leaflet-marker-not-found-production-env
|
|
|
|
const iconRetinaUrl = 'assets/marker-icon-2x.png';
|
|
|
|
const iconUrl = 'assets/marker-icon.png';
|
|
|
|
const shadowUrl = 'assets/marker-shadow.png';
|
|
|
|
const iconDefault = icon({
|
|
|
|
iconRetinaUrl,
|
|
|
|
iconUrl,
|
|
|
|
shadowUrl,
|
|
|
|
iconSize: [25, 41],
|
|
|
|
iconAnchor: [12, 41],
|
|
|
|
popupAnchor: [1, -34],
|
|
|
|
tooltipAnchor: [16, -28],
|
2022-04-05 01:37:31 +08:00
|
|
|
shadowSize: [41, 41],
|
2021-05-02 01:35:18 +08:00
|
|
|
});
|
|
|
|
Marker.prototype.options.icon = iconDefault;
|
|
|
|
|
2016-12-27 06:36:38 +08:00
|
|
|
@NgModule({
|
2017-06-11 04:32:56 +08:00
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
2021-04-19 23:26:35 +08:00
|
|
|
HammerModule,
|
2017-06-11 04:32:56 +08:00
|
|
|
FormsModule,
|
2018-03-31 03:30:30 +08:00
|
|
|
HttpClientModule,
|
2017-07-08 18:43:42 +08:00
|
|
|
BrowserAnimationsModule,
|
2021-04-11 21:59:30 +08:00
|
|
|
AppRoutingModule,
|
2017-07-09 18:03:17 +08:00
|
|
|
ClipboardModule,
|
2018-10-22 06:24:17 +08:00
|
|
|
JwBootstrapSwitchNg2Module,
|
2017-07-15 18:47:11 +08:00
|
|
|
TooltipModule.forRoot(),
|
2018-05-23 08:27:07 +08:00
|
|
|
ToastrModule.forRoot(),
|
2017-07-08 18:43:42 +08:00
|
|
|
ModalModule.forRoot(),
|
2018-05-14 04:59:57 +08:00
|
|
|
CollapseModule.forRoot(),
|
2019-01-18 07:26:20 +08:00
|
|
|
PopoverModule.forRoot(),
|
2017-12-25 07:42:25 +08:00
|
|
|
BsDropdownModule.forRoot(),
|
2018-12-08 05:06:13 +08:00
|
|
|
BsDatepickerModule.forRoot(),
|
2021-04-11 06:05:33 +08:00
|
|
|
TimepickerModule.forRoot(),
|
2021-04-26 01:07:02 +08:00
|
|
|
LoadingBarModule,
|
2021-05-01 05:40:32 +08:00
|
|
|
LeafletModule,
|
2022-01-01 01:50:21 +08:00
|
|
|
LeafletMarkerClusterModule,
|
2022-12-29 02:12:18 +08:00
|
|
|
MarkdownModule.forRoot({loader: HttpClient}),
|
2017-06-11 04:32:56 +08:00
|
|
|
],
|
2022-04-05 01:37:31 +08:00
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
LoginComponent,
|
2017-07-04 01:17:49 +08:00
|
|
|
ShareLoginComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryComponent,
|
2019-02-15 07:25:55 +08:00
|
|
|
FacesComponent,
|
2018-03-31 03:30:30 +08:00
|
|
|
// misc
|
2017-06-11 04:32:56 +08:00
|
|
|
FrameComponent,
|
2017-12-25 07:42:25 +08:00
|
|
|
LanguageComponent,
|
2019-08-20 18:54:45 +08:00
|
|
|
TimeStampDatePickerComponent,
|
|
|
|
TimeStampTimePickerComponent,
|
2021-05-29 03:01:59 +08:00
|
|
|
// Albums
|
|
|
|
AlbumsComponent,
|
|
|
|
AlbumComponent,
|
2021-05-30 06:02:05 +08:00
|
|
|
SavedSearchPopupComponent,
|
2018-03-31 03:30:30 +08:00
|
|
|
// Gallery
|
2018-11-18 02:32:31 +08:00
|
|
|
GalleryLightboxMediaComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryPhotoLoadingComponent,
|
|
|
|
GalleryGridComponent,
|
|
|
|
GalleryDirectoryComponent,
|
|
|
|
GalleryLightboxComponent,
|
2022-01-01 01:50:21 +08:00
|
|
|
GalleryBlogComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryMapComponent,
|
|
|
|
GalleryMapLightboxComponent,
|
|
|
|
FrameComponent,
|
|
|
|
GallerySearchComponent,
|
2021-01-31 19:22:56 +08:00
|
|
|
GallerySearchQueryEntryComponent,
|
2022-01-27 05:50:49 +08:00
|
|
|
GallerySearchFieldBaseComponent,
|
2021-03-27 03:57:13 +08:00
|
|
|
GallerySearchFieldComponent,
|
2021-05-29 05:17:29 +08:00
|
|
|
GallerySearchQueryBuilderComponent,
|
2017-07-04 01:17:49 +08:00
|
|
|
GalleryShareComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryNavigatorComponent,
|
2022-02-12 02:05:51 +08:00
|
|
|
GalleryFilterComponent,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryPhotoComponent,
|
2017-07-08 18:43:42 +08:00
|
|
|
AdminComponent,
|
2017-07-10 04:00:42 +08:00
|
|
|
InfoPanelLightboxComponent,
|
2019-07-15 01:31:34 +08:00
|
|
|
ControlsLightboxComponent,
|
2018-10-22 06:24:17 +08:00
|
|
|
RandomQueryBuilderGalleryComponent,
|
2019-07-28 04:56:12 +08:00
|
|
|
DirectoriesComponent,
|
2019-02-15 07:25:55 +08:00
|
|
|
// Face
|
|
|
|
FaceComponent,
|
2019-07-28 04:56:12 +08:00
|
|
|
// Duplicates
|
|
|
|
DuplicateComponent,
|
|
|
|
DuplicatesPhotoComponent,
|
2018-03-31 03:30:30 +08:00
|
|
|
// Settings
|
2020-02-05 02:37:47 +08:00
|
|
|
SettingsEntryComponent,
|
2022-12-29 02:12:18 +08:00
|
|
|
TemplateComponent,
|
2022-12-30 22:35:07 +08:00
|
|
|
JobProgressComponent,
|
|
|
|
JobButtonComponent,
|
2022-12-31 07:20:42 +08:00
|
|
|
WorkflowComponent,
|
|
|
|
GalleryStatisticComponent,
|
2019-12-30 22:49:56 +08:00
|
|
|
|
2019-07-28 04:56:12 +08:00
|
|
|
// Pipes
|
2018-05-29 02:03:12 +08:00
|
|
|
StringifyRole,
|
|
|
|
IconizeSortingMethod,
|
2018-11-02 17:40:09 +08:00
|
|
|
StringifySortingMethod,
|
2018-12-10 06:25:39 +08:00
|
|
|
DurationPipe,
|
2020-09-06 23:07:40 +08:00
|
|
|
FileSizePipe,
|
2021-03-14 23:52:37 +08:00
|
|
|
GPXFilesFilterPipe,
|
2022-01-01 01:50:21 +08:00
|
|
|
MDFilesFilterPipe,
|
|
|
|
StringifySearchQuery,
|
2022-01-14 05:41:30 +08:00
|
|
|
FileDTOToPathPipe,
|
2022-04-05 01:37:31 +08:00
|
|
|
PhotoFilterPipe,
|
2018-11-02 17:40:09 +08:00
|
|
|
],
|
2017-06-11 04:32:56 +08:00
|
|
|
providers: [
|
2022-12-29 02:12:18 +08:00
|
|
|
{provide: HTTP_INTERCEPTORS, useClass: CSRFInterceptor, multi: true},
|
|
|
|
{provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true},
|
|
|
|
{provide: UrlSerializer, useClass: CustomUrlSerializer},
|
|
|
|
{provide: HAMMER_GESTURE_CONFIG, useClass: MyHammerConfig},
|
2020-02-05 02:37:47 +08:00
|
|
|
StringifySortingMethod,
|
2017-06-11 04:32:56 +08:00
|
|
|
NetworkService,
|
2017-07-04 01:17:49 +08:00
|
|
|
ShareService,
|
2017-06-11 04:32:56 +08:00
|
|
|
UserService,
|
2021-05-29 03:01:59 +08:00
|
|
|
AlbumsService,
|
2017-06-11 04:32:56 +08:00
|
|
|
GalleryCacheService,
|
2022-02-17 05:17:38 +08:00
|
|
|
ContentService,
|
|
|
|
FilterService,
|
2022-02-12 02:05:51 +08:00
|
|
|
GallerySortingService,
|
2018-11-26 07:26:29 +08:00
|
|
|
MapService,
|
2022-01-01 01:50:21 +08:00
|
|
|
BlogService,
|
2021-03-20 21:37:56 +08:00
|
|
|
SearchQueryParserService,
|
|
|
|
AutoCompleteService,
|
2017-06-11 04:32:56 +08:00
|
|
|
AuthenticationService,
|
|
|
|
ThumbnailLoaderService,
|
|
|
|
ThumbnailManagerService,
|
2017-07-08 18:43:42 +08:00
|
|
|
NotificationService,
|
2017-06-11 04:32:56 +08:00
|
|
|
FullScreenService,
|
2017-07-09 18:03:17 +08:00
|
|
|
NavigationService,
|
2017-07-15 20:27:12 +08:00
|
|
|
SettingsService,
|
2019-01-28 06:27:41 +08:00
|
|
|
SeededRandomService,
|
2018-03-30 08:30:23 +08:00
|
|
|
OverlayService,
|
2018-05-27 08:49:55 +08:00
|
|
|
QueryService,
|
2019-01-18 07:26:20 +08:00
|
|
|
DuplicateService,
|
2019-02-15 07:25:55 +08:00
|
|
|
FacesService,
|
2019-02-16 00:47:09 +08:00
|
|
|
VersionService,
|
2019-12-24 19:22:25 +08:00
|
|
|
ScheduledJobsService,
|
2021-04-20 02:10:44 +08:00
|
|
|
BackendtextService,
|
2022-04-05 01:37:31 +08:00
|
|
|
CookieService,
|
2022-12-29 05:12:53 +08:00
|
|
|
AbstractSettingsService
|
2018-03-30 08:30:23 +08:00
|
|
|
],
|
2022-04-05 01:37:31 +08:00
|
|
|
bootstrap: [AppComponent],
|
2016-12-27 06:36:38 +08:00
|
|
|
})
|
2022-12-29 02:12:18 +08:00
|
|
|
export class AppModule {
|
|
|
|
}
|