diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 91742b3..0075765 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -4,15 +4,15 @@ import { MatBottomSheet } from '@angular/material/bottom-sheet'; import { TranslateService } from '@ngx-translate/core'; import { State, Display, DisplayMode } from './responses'; -import { OpenLPService, WebSocketStatus } from './openlp.service'; -import { WindowRef } from './window-ref.service'; -import { PageTitleService } from './page-title.service'; +import { OpenLPService, WebSocketStatus } from './services/openlp.service'; +import { WindowRef } from './services/window-ref.service'; +import { PageTitleService } from './services/page-title.service'; import { fromEvent } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { DisplayModeSelectorComponent } from './components/display-mode-selector/display-mode-selector.component'; -import { Shortcuts, ShortcutsService } from './shortcuts.service'; +import { Shortcuts, ShortcutsService } from './services/shortcuts.service'; import { ShortcutPipe } from './components/pipes/shortcut.pipe'; -import { SettingsService } from './settings.service'; +import { SettingsService } from './services/settings.service'; import * as supportedBrowsers from '../assets/supportedBrowsers'; @Component({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cef9da9..bc434da 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -27,10 +27,11 @@ import { MatSliderModule } from '@angular/material/slider'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { AppComponent } from './app.component'; -import { PageTitleService } from './page-title.service'; -import { OpenLPService } from './openlp.service'; -import { TranslationService } from './translation.service'; -import { WindowRef } from './window-ref.service'; +import { OpenLPService } from './services/openlp.service'; +import { PageTitleService } from './services/page-title.service'; +import { SettingsService } from './services/settings.service'; +import { ShortcutsService } from './services/shortcuts.service'; +import { TranslationService } from './services/translation.service'; import { AppRoutingModule } from './app.routing'; import { ServiceComponent } from './components/service/service.component'; import { AlertComponent } from './components/alert/alert.component'; @@ -114,13 +115,14 @@ import { StageChordPreviewComponent } from './components/settings/stage-chord-pr }) ], providers: [ - PageTitleService, OpenLPService, - TranslationService, + PageTitleService, SentenceCasePipe, + SettingsService, + ShortcutsService, Title, TitleCasePipe, - WindowRef, + TranslationService, provideHttpClient(withInterceptorsFromDi()), ], bootstrap: [AppComponent] diff --git a/src/app/components/alert/alert.component.ts b/src/app/components/alert/alert.component.ts index 0652a95..493b856 100644 --- a/src/app/components/alert/alert.component.ts +++ b/src/app/components/alert/alert.component.ts @@ -3,8 +3,8 @@ import { MatSnackBar } from '@angular/material/snack-bar'; import { TitleCasePipe } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; -import { PageTitleService } from '../../page-title.service'; -import { OpenLPService } from '../../openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; +import { OpenLPService } from '../../services/openlp.service'; @Component({ selector: 'openlp-alert', diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index 0f7b8ae..778ab3f 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar'; import { TitleCasePipe } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../openlp.service'; +import { OpenLPService } from '../../services/openlp.service'; @Component({ selector: 'app-login', diff --git a/src/app/components/lower-third/lower-third.component.ts b/src/app/components/lower-third/lower-third.component.ts index b1ce06b..d453418 100644 --- a/src/app/components/lower-third/lower-third.component.ts +++ b/src/app/components/lower-third/lower-third.component.ts @@ -1,8 +1,8 @@ import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; -import { SettingsService } from 'src/app/settings.service'; -import { OpenLPService } from '../../openlp.service'; +import { SettingsService } from '../../services/settings.service'; +import { OpenLPService } from '../../services/openlp.service'; import { ServiceItem, Slide } from '../../responses'; @Component({ diff --git a/src/app/components/main-view/main-view.component.ts b/src/app/components/main-view/main-view.component.ts index eb8520f..2806179 100644 --- a/src/app/components/main-view/main-view.component.ts +++ b/src/app/components/main-view/main-view.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { OpenLPService } from '../../openlp.service'; +import { OpenLPService } from '../../services/openlp.service'; @Component({ selector: 'app-main-view', diff --git a/src/app/components/search/search-options/search-options.component.ts b/src/app/components/search/search-options/search-options.component.ts index c6a65f1..178f5ab 100644 --- a/src/app/components/search/search-options/search-options.component.ts +++ b/src/app/components/search/search-options/search-options.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { TitleCasePipe } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../../openlp.service'; +import { OpenLPService } from '../../../services/openlp.service'; @Component({ selector: 'openlp-search-options', diff --git a/src/app/components/search/search.component.ts b/src/app/components/search/search.component.ts index 23bd540..b6c6d05 100644 --- a/src/app/components/search/search.component.ts +++ b/src/app/components/search/search.component.ts @@ -1,8 +1,8 @@ import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../openlp.service'; -import { PageTitleService } from '../../page-title.service'; +import { OpenLPService } from '../../services/openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; import { PluginDescription } from '../../responses'; import { SearchOptionsComponent } from './search-options/search-options.component'; diff --git a/src/app/components/service/service-item/service-item.component.ts b/src/app/components/service/service-item/service-item.component.ts index 3200be5..a200c44 100644 --- a/src/app/components/service/service-item/service-item.component.ts +++ b/src/app/components/service/service-item/service-item.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from import { MatDialog } from '@angular/material/dialog'; import { DeleteConfirmationComponent } from './delete-confirmation/delete-confirmation.component'; -import { OpenLPService } from '../../../openlp.service'; +import { OpenLPService } from '../../../services/openlp.service'; import { ServiceItem } from '../../../responses'; @Component({ diff --git a/src/app/components/service/service-list/service-list.component.ts b/src/app/components/service/service-list/service-list.component.ts index 8b0c1a1..98bbd7c 100644 --- a/src/app/components/service/service-list/service-list.component.ts +++ b/src/app/components/service/service-list/service-list.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; -import { OpenLPService } from '../../../openlp.service'; +import { OpenLPService } from '../../../services/openlp.service'; import { ServiceItem } from '../../../responses'; @Component({ diff --git a/src/app/components/service/service.component.ts b/src/app/components/service/service.component.ts index b0a482e..c5a0a62 100644 --- a/src/app/components/service/service.component.ts +++ b/src/app/components/service/service.component.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../openlp.service'; -import { PageTitleService } from '../../page-title.service'; +import { OpenLPService } from '../../services/openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; import { ServiceItem } from '../../responses'; @Component({ diff --git a/src/app/components/settings/settings.component.ts b/src/app/components/settings/settings.component.ts index 3f8135a..0f4e370 100644 --- a/src/app/components/settings/settings.component.ts +++ b/src/app/components/settings/settings.component.ts @@ -1,9 +1,9 @@ import { Component, OnDestroy } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { OpenLPService } from '../../openlp.service'; -import { PageTitleService } from '../../page-title.service'; -import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../settings.service'; +import { OpenLPService } from '../../services/openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; +import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../services/settings.service'; @Component({ selector: 'openlp-settings', diff --git a/src/app/components/settings/stage-chord-preview/stage-chord-preview.component.ts b/src/app/components/settings/stage-chord-preview/stage-chord-preview.component.ts index 95dcdcf..98f8264 100644 --- a/src/app/components/settings/stage-chord-preview/stage-chord-preview.component.ts +++ b/src/app/components/settings/stage-chord-preview/stage-chord-preview.component.ts @@ -12,7 +12,7 @@ import { } from '@angular/core'; import { fromEvent, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { SettingsProperties, SettingsService } from 'src/app/settings.service'; +import { SettingsProperties, SettingsService } from '../../../services/settings.service'; @Component({ selector: 'openlp-stage-chord-preview', diff --git a/src/app/components/slides/slide-list/slide-list.component.ts b/src/app/components/slides/slide-list/slide-list.component.ts index abfbff0..a8eb3ea 100644 --- a/src/app/components/slides/slide-list/slide-list.component.ts +++ b/src/app/components/slides/slide-list/slide-list.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/cor import { Subscription } from 'rxjs'; import { Slide } from '../../../responses'; -import { OpenLPService } from '../../../openlp.service'; +import { OpenLPService } from '../../../services/openlp.service'; @Component({ selector: 'openlp-slide-list', diff --git a/src/app/components/slides/slides.component.ts b/src/app/components/slides/slides.component.ts index 5357d19..0555399 100644 --- a/src/app/components/slides/slides.component.ts +++ b/src/app/components/slides/slides.component.ts @@ -1,8 +1,8 @@ import { Component } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../openlp.service'; -import { PageTitleService } from '../../page-title.service'; +import { OpenLPService } from '../../services/openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; import { SlideListItem } from './slide-list/slide-list.component'; @Component({ diff --git a/src/app/components/stage-view/stage-view.component.ts b/src/app/components/stage-view/stage-view.component.ts index f0812f2..8904b29 100644 --- a/src/app/components/stage-view/stage-view.component.ts +++ b/src/app/components/stage-view/stage-view.component.ts @@ -1,8 +1,8 @@ import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; -import { SettingsProperties, SettingsService } from 'src/app/settings.service'; -import { OpenLPService } from '../../openlp.service'; +import { SettingsProperties, SettingsService } from '../../services/settings.service'; +import { OpenLPService } from '../../services/openlp.service'; import { ServiceItem, Slide } from '../../responses'; interface Tag { diff --git a/src/app/components/themes/themes.component.ts b/src/app/components/themes/themes.component.ts index 971e4ca..4f5f138 100644 --- a/src/app/components/themes/themes.component.ts +++ b/src/app/components/themes/themes.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { OpenLPService } from '../../openlp.service'; -import { PageTitleService } from '../../page-title.service'; +import { OpenLPService } from '../../services/openlp.service'; +import { PageTitleService } from '../../services/page-title.service'; import { Theme } from '../../responses'; @Component({ diff --git a/src/app/openlp.service.ts b/src/app/services/openlp.service.ts similarity index 97% rename from src/app/openlp.service.ts rename to src/app/services/openlp.service.ts index 424d0e6..9b3a271 100644 --- a/src/app/openlp.service.ts +++ b/src/app/services/openlp.service.ts @@ -6,8 +6,8 @@ import { TitleCasePipe } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; import { Observable, of, Subscription } from 'rxjs'; import { catchError, finalize, shareReplay, tap } from 'rxjs/operators'; -import { SentenceCasePipe } from './components/pipes/sentence-case.pipe'; -import { LoginComponent } from './components/login/login.component'; +import { SentenceCasePipe } from '../components/pipes/sentence-case.pipe'; +import { LoginComponent } from '../components/login/login.component'; import { PluginDescription, @@ -23,10 +23,10 @@ import { AuthToken, Message, MessageType -} from './responses'; -import { environment } from '../environments/environment'; -import { createWebSocket } from './openlp-websocket'; -import { deserialize } from './utils'; +} from '../responses'; +import { environment } from '../../environments/environment'; +import { createWebSocket } from '../openlp-websocket'; +import { deserialize } from '../utils'; const httpOptions = { headers: new HttpHeaders({ diff --git a/src/app/page-title.service.ts b/src/app/services/page-title.service.ts similarity index 100% rename from src/app/page-title.service.ts rename to src/app/services/page-title.service.ts diff --git a/src/app/settings.service.ts b/src/app/services/settings.service.ts similarity index 98% rename from src/app/settings.service.ts rename to src/app/services/settings.service.ts index a0605f5..64e7e3a 100644 --- a/src/app/settings.service.ts +++ b/src/app/services/settings.service.ts @@ -16,7 +16,7 @@ export interface SettingsPropertiesItem = { element: this.document diff --git a/src/app/translation.service.ts b/src/app/services/translation.service.ts similarity index 92% rename from src/app/translation.service.ts rename to src/app/services/translation.service.ts index e2036e0..040591a 100644 --- a/src/app/translation.service.ts +++ b/src/app/services/translation.service.ts @@ -3,9 +3,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class TranslationService implements TranslateLoader { constructor(private http: HttpClient) {} diff --git a/src/app/window-ref.service.spec.ts b/src/app/services/window-ref.service.spec.ts similarity index 100% rename from src/app/window-ref.service.spec.ts rename to src/app/services/window-ref.service.spec.ts diff --git a/src/app/window-ref.service.ts b/src/app/services/window-ref.service.ts similarity index 99% rename from src/app/window-ref.service.ts rename to src/app/services/window-ref.service.ts index e5cb701..2ce946d 100644 --- a/src/app/window-ref.service.ts +++ b/src/app/services/window-ref.service.ts @@ -4,10 +4,8 @@ function _window(): any { return window; } - @Injectable({providedIn: 'root'}) export class WindowRef { - get nativeWindow(): any { return _window(); }