mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 11:32:47 +00:00
Merge branch 'move-services-to-folder' into 'master'
Move services to folder. See merge request openlp/web-remote!138
This commit is contained in:
commit
9a8db9619a
@ -4,15 +4,15 @@ import { MatBottomSheet } from '@angular/material/bottom-sheet';
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { State, Display, DisplayMode } from './responses';
|
import { State, Display, DisplayMode } from './responses';
|
||||||
import { OpenLPService, WebSocketStatus } from './openlp.service';
|
import { OpenLPService, WebSocketStatus } from './services/openlp.service';
|
||||||
import { WindowRef } from './window-ref.service';
|
import { WindowRef } from './services/window-ref.service';
|
||||||
import { PageTitleService } from './page-title.service';
|
import { PageTitleService } from './services/page-title.service';
|
||||||
import { fromEvent } from 'rxjs';
|
import { fromEvent } from 'rxjs';
|
||||||
import { debounceTime } from 'rxjs/operators';
|
import { debounceTime } from 'rxjs/operators';
|
||||||
import { DisplayModeSelectorComponent } from './components/display-mode-selector/display-mode-selector.component';
|
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 { ShortcutPipe } from './components/pipes/shortcut.pipe';
|
||||||
import { SettingsService } from './settings.service';
|
import { SettingsService } from './services/settings.service';
|
||||||
import * as supportedBrowsers from '../assets/supportedBrowsers';
|
import * as supportedBrowsers from '../assets/supportedBrowsers';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -27,10 +27,11 @@ import { MatSliderModule } from '@angular/material/slider';
|
|||||||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { PageTitleService } from './page-title.service';
|
import { OpenLPService } from './services/openlp.service';
|
||||||
import { OpenLPService } from './openlp.service';
|
import { PageTitleService } from './services/page-title.service';
|
||||||
import { TranslationService } from './translation.service';
|
import { SettingsService } from './services/settings.service';
|
||||||
import { WindowRef } from './window-ref.service';
|
import { ShortcutsService } from './services/shortcuts.service';
|
||||||
|
import { TranslationService } from './services/translation.service';
|
||||||
import { AppRoutingModule } from './app.routing';
|
import { AppRoutingModule } from './app.routing';
|
||||||
import { ServiceComponent } from './components/service/service.component';
|
import { ServiceComponent } from './components/service/service.component';
|
||||||
import { AlertComponent } from './components/alert/alert.component';
|
import { AlertComponent } from './components/alert/alert.component';
|
||||||
@ -114,13 +115,14 @@ import { StageChordPreviewComponent } from './components/settings/stage-chord-pr
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
PageTitleService,
|
|
||||||
OpenLPService,
|
OpenLPService,
|
||||||
TranslationService,
|
PageTitleService,
|
||||||
SentenceCasePipe,
|
SentenceCasePipe,
|
||||||
|
SettingsService,
|
||||||
|
ShortcutsService,
|
||||||
Title,
|
Title,
|
||||||
TitleCasePipe,
|
TitleCasePipe,
|
||||||
WindowRef,
|
TranslationService,
|
||||||
provideHttpClient(withInterceptorsFromDi()),
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
|
@ -3,8 +3,8 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import { TitleCasePipe } from '@angular/common';
|
import { TitleCasePipe } from '@angular/common';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-alert',
|
selector: 'openlp-alert',
|
||||||
|
@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import { TitleCasePipe } from '@angular/common';
|
import { TitleCasePipe } from '@angular/common';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { SettingsService } from 'src/app/settings.service';
|
import { SettingsService } from '../../services/settings.service';
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { ServiceItem, Slide } from '../../responses';
|
import { ServiceItem, Slide } from '../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-main-view',
|
selector: 'app-main-view',
|
||||||
|
@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
import { TitleCasePipe } from '@angular/common';
|
import { TitleCasePipe } from '@angular/common';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../../openlp.service';
|
import { OpenLPService } from '../../../services/openlp.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-search-options',
|
selector: 'openlp-search-options',
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { PluginDescription } from '../../responses';
|
import { PluginDescription } from '../../responses';
|
||||||
import { SearchOptionsComponent } from './search-options/search-options.component';
|
import { SearchOptionsComponent } from './search-options/search-options.component';
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
|
||||||
import { DeleteConfirmationComponent } from './delete-confirmation/delete-confirmation.component';
|
import { DeleteConfirmationComponent } from './delete-confirmation/delete-confirmation.component';
|
||||||
import { OpenLPService } from '../../../openlp.service';
|
import { OpenLPService } from '../../../services/openlp.service';
|
||||||
import { ServiceItem } from '../../../responses';
|
import { ServiceItem } from '../../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { OpenLPService } from '../../../openlp.service';
|
import { OpenLPService } from '../../../services/openlp.service';
|
||||||
import { ServiceItem } from '../../../responses';
|
import { ServiceItem } from '../../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -2,8 +2,8 @@ import { Component } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { ServiceItem } from '../../responses';
|
import { ServiceItem } from '../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Component, OnDestroy } from '@angular/core';
|
import { Component, OnDestroy } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../settings.service';
|
import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../services/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-settings',
|
selector: 'openlp-settings',
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { fromEvent, Subscription } from 'rxjs';
|
import { fromEvent, Subscription } from 'rxjs';
|
||||||
import { debounceTime } from 'rxjs/operators';
|
import { debounceTime } from 'rxjs/operators';
|
||||||
import { SettingsProperties, SettingsService } from 'src/app/settings.service';
|
import { SettingsProperties, SettingsService } from '../../../services/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-stage-chord-preview',
|
selector: 'openlp-stage-chord-preview',
|
||||||
|
@ -2,7 +2,7 @@ import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/cor
|
|||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { Slide } from '../../../responses';
|
import { Slide } from '../../../responses';
|
||||||
import { OpenLPService } from '../../../openlp.service';
|
import { OpenLPService } from '../../../services/openlp.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-slide-list',
|
selector: 'openlp-slide-list',
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { SlideListItem } from './slide-list/slide-list.component';
|
import { SlideListItem } from './slide-list/slide-list.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { SettingsProperties, SettingsService } from 'src/app/settings.service';
|
import { SettingsProperties, SettingsService } from '../../services/settings.service';
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { ServiceItem, Slide } from '../../responses';
|
import { ServiceItem, Slide } from '../../responses';
|
||||||
|
|
||||||
interface Tag {
|
interface Tag {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../services/openlp.service';
|
||||||
import { PageTitleService } from '../../page-title.service';
|
import { PageTitleService } from '../../services/page-title.service';
|
||||||
import { Theme } from '../../responses';
|
import { Theme } from '../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -6,8 +6,8 @@ import { TitleCasePipe } from '@angular/common';
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { Observable, of, Subscription } from 'rxjs';
|
import { Observable, of, Subscription } from 'rxjs';
|
||||||
import { catchError, finalize, shareReplay, tap } from 'rxjs/operators';
|
import { catchError, finalize, shareReplay, tap } from 'rxjs/operators';
|
||||||
import { SentenceCasePipe } from './components/pipes/sentence-case.pipe';
|
import { SentenceCasePipe } from '../components/pipes/sentence-case.pipe';
|
||||||
import { LoginComponent } from './components/login/login.component';
|
import { LoginComponent } from '../components/login/login.component';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PluginDescription,
|
PluginDescription,
|
||||||
@ -23,10 +23,10 @@ import {
|
|||||||
AuthToken,
|
AuthToken,
|
||||||
Message,
|
Message,
|
||||||
MessageType
|
MessageType
|
||||||
} from './responses';
|
} from '../responses';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
import { createWebSocket } from './openlp-websocket';
|
import { createWebSocket } from '../openlp-websocket';
|
||||||
import { deserialize } from './utils';
|
import { deserialize } from '../utils';
|
||||||
|
|
||||||
const httpOptions = {
|
const httpOptions = {
|
||||||
headers: new HttpHeaders({
|
headers: new HttpHeaders({
|
@ -16,7 +16,7 @@ export interface SettingsPropertiesItem<SP extends keyof SettingsProperties, SV
|
|||||||
|
|
||||||
const LOCAL_STORAGE_PREFIX = 'OpenLP-';
|
const LOCAL_STORAGE_PREFIX = 'OpenLP-';
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable()
|
||||||
export class SettingsService {
|
export class SettingsService {
|
||||||
constructor() {
|
constructor() {
|
||||||
window.addEventListener('storage', this._handleStorageEvent);
|
window.addEventListener('storage', this._handleStorageEvent);
|
@ -20,7 +20,7 @@ interface Options {
|
|||||||
keys: string;
|
keys: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable()
|
||||||
export class ShortcutsService {
|
export class ShortcutsService {
|
||||||
defaults: Partial<Options> = {
|
defaults: Partial<Options> = {
|
||||||
element: this.document
|
element: this.document
|
@ -3,9 +3,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable()
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class TranslationService implements TranslateLoader {
|
export class TranslationService implements TranslateLoader {
|
||||||
constructor(private http: HttpClient) {}
|
constructor(private http: HttpClient) {}
|
||||||
|
|
@ -4,10 +4,8 @@ function _window(): any {
|
|||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({providedIn: 'root'})
|
||||||
export class WindowRef {
|
export class WindowRef {
|
||||||
|
|
||||||
get nativeWindow(): any {
|
get nativeWindow(): any {
|
||||||
return _window();
|
return _window();
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user