Skip to content

Commit

Permalink
Renamed theme service to mod service
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmalloy committed Mar 5, 2024
1 parent 66e72fe commit d2d7af4
Show file tree
Hide file tree
Showing 34 changed files with 106 additions and 107 deletions.
6 changes: 3 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ import { AdminService } from './service/admin.service';
import { AuthnService } from './service/authn.service';
import { ConfigService } from './service/config.service';
import { DebugService } from './service/debug.service';
import { ModService } from './service/mod.service';
import { OriginMapService } from './service/origin-map.service';
import { ThemeService } from './service/theme.service';

const loadFactory = (config: ConfigService, debug: DebugService, authn: AuthnService, admin: AdminService, account: AccountService, origins: OriginMapService, themes: ThemeService) => () =>
const loadFactory = (config: ConfigService, debug: DebugService, authn: AuthnService, admin: AdminService, account: AccountService, origins: OriginMapService, themes: ModService) => () =>
config.load$.pipe(
tap(() => console.log('-{1}- Loading Jasper')),
switchMap(() => debug.init$),
Expand Down Expand Up @@ -339,7 +339,7 @@ const loadFactory = (config: ConfigService, debug: DebugService, authn: AuthnSer
{
provide: APP_INITIALIZER,
useFactory: loadFactory,
deps: [ConfigService, DebugService, AuthnService, AdminService, AccountService, OriginMapService, ThemeService],
deps: [ConfigService, DebugService, AuthnService, AdminService, AccountService, OriginMapService, ModService],
multi: true,
},
],
Expand Down
10 changes: 5 additions & 5 deletions src/app/component/subscription-bar/subscription-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Location } from '@angular/common';
import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { autorun, IReactionDisposer } from 'mobx';
import { map } from 'rxjs';
import { Ext } from '../../model/ext';
import { AdminService } from '../../service/admin.service';
import { ExtService } from '../../service/api/ext.service';
import { ConfigService } from '../../service/config.service';
import { ThemeService } from '../../service/theme.service';
import { ModService } from '../../service/mod.service';
import { Store } from '../../store/store';
import { map } from 'rxjs';
import { Ext } from '../../model/ext';
import { autorun, IReactionDisposer } from 'mobx';

@Component({
selector: 'app-subscription-bar',
Expand All @@ -26,7 +26,7 @@ export class SubscriptionBarComponent implements OnInit, OnDestroy {
constructor(
public config: ConfigService,
public store: Store,
public themes: ThemeService,
public themes: ModService,
public admin: AdminService,
private exts: ExtService,
public location: Location,
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ext/ext.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Ext } from '../../model/ext';
import { tagDeleteNotice } from '../../mods/delete';
import { AdminService } from '../../service/admin.service';
import { ExtService } from '../../service/api/ext.service';
import { ThemeService } from '../../service/theme.service';
import { ModService } from '../../service/mod.service';
import { Store } from '../../store/store';
import { scrollToFirstInvalid } from '../../util/form';
import { TAG_SUFFIX_REGEX } from '../../util/format';
Expand Down Expand Up @@ -43,14 +43,14 @@ export class ExtPage implements OnInit, OnDestroy, HasChanges {
templates = this.admin.tmplSubmit;

constructor(
private theme: ThemeService,
private mod: ModService,
private admin: AdminService,
public router: Router,
public store: Store,
private exts: ExtService,
private fb: UntypedFormBuilder,
) {
theme.setTitle($localize`Edit Tag`);
mod.setTitle($localize`Edit Tag`);
this.extForm = fb.group({
tag: ['', [Validators.pattern(TAG_SUFFIX_REGEX)]],
});
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Ext } from '../../model/ext';
import { AccountService } from '../../service/account.service';
import { AdminService } from '../../service/admin.service';
import { ExtService } from '../../service/api/ext.service';
import { ThemeService } from '../../service/theme.service';
import { ModService } from '../../service/mod.service';
import { QueryStore } from '../../store/query';
import { Store } from '../../store/store';
import { getArgs } from '../../util/query';
Expand All @@ -22,14 +22,14 @@ export class HomePage implements OnInit, OnDestroy {
activeExts: Ext[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public account: AccountService,
public store: Store,
public query: QueryStore,
private exts: ExtService,
) {
theme.setTitle($localize`Home`);
mod.setTitle($localize`Home`);
store.view.clear(!!this.admin.getPlugin('plugin/vote/up') ? 'voteScoreDecay' : 'published');
query.clear();
if (admin.getTemplate('home')) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/inbox/alarms/alarms.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -18,12 +18,12 @@ export class InboxAlarmsPage implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
) {
theme.setTitle($localize`Inbox: Alarms`);
mod.setTitle($localize`Inbox: Alarms`);
store.view.clear('modified');
query.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/inbox/all/all.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -18,12 +18,12 @@ export class InboxAllPage implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
) {
theme.setTitle($localize`Inbox: All`);
mod.setTitle($localize`Inbox: All`);
store.view.clear('modified');
query.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/inbox/dms/dms.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -18,12 +18,12 @@ export class InboxDmsPage implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
) {
theme.setTitle($localize`Inbox: DMs`);
mod.setTitle($localize`Inbox: DMs`);
store.view.clear('modified');
query.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/inbox/modlist/modlist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -18,12 +18,12 @@ export class InboxModlistPage implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
) {
theme.setTitle($localize`Inbox: Modlist`);
mod.setTitle($localize`Inbox: Modlist`);
store.view.clear('modified');
query.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/inbox/sent/sent.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -18,12 +18,12 @@ export class InboxSentPage implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
) {
theme.setTitle($localize`Inbox: Sent`);
mod.setTitle($localize`Inbox: Sent`);
store.view.clear();
query.clear();
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/page/inbox/unread/unread.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { defer } from 'lodash-es';
import { autorun, IReactionDisposer } from 'mobx';
import { RefPageArgs } from '../../../model/ref';
import { newest } from '../../../mods/mailbox';
import { AccountService } from '../../../service/account.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { Router } from '@angular/router';

@Component({
selector: 'app-unread',
Expand All @@ -21,13 +21,13 @@ export class InboxUnreadPage implements OnInit, OnDestroy {
private lastNotified?: moment.Moment;

constructor(
private theme: ThemeService,
private mod: ModService,
public store: Store,
public query: QueryStore,
private account: AccountService,
private router: Router,
) {
theme.setTitle($localize`Inbox: Unread`);
mod.setTitle($localize`Inbox: Unread`);
store.view.clear('modified');
query.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ref/alts/alts.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { autorun, IReactionDisposer, runInAction } from 'mobx';
import { Page } from '../../../model/page';
import { Ref } from '../../../model/ref';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -21,7 +21,7 @@ export class RefAltsComponent implements OnInit, OnDestroy {
page: Page<Ref> = Page.of([]);

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
Expand Down Expand Up @@ -60,7 +60,7 @@ export class RefAltsComponent implements OnInit, OnDestroy {
};
}));
this.disposers.push(autorun(() => {
this.theme.setTitle($localize`Alternate URLs: ` + (this.store.view.ref?.title || this.store.view.url));
this.mod.setTitle($localize`Alternate URLs: ` + (this.store.view.ref?.title || this.store.view.url));
}));
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ref/comments/comments.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Subject } from 'rxjs';
import { Ref } from '../../../model/ref';
import { getMailbox, mailboxes } from '../../../mods/mailbox';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { Store } from '../../../store/store';
import { ThreadStore } from '../../../store/thread';
import { hasTag, removeTag, top } from '../../../util/tag';
Expand All @@ -20,7 +20,7 @@ export class RefCommentsComponent implements OnInit, OnDestroy {
newComments$ = new Subject<Ref | null>();

constructor(
private theme: ThemeService,
private mod: ModService,
public store: Store,
public thread: ThreadStore,
private admin: AdminService,
Expand All @@ -30,7 +30,7 @@ export class RefCommentsComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.disposers.push(autorun(() => this.theme.setTitle($localize`Comments: ` + (this.store.view.ref?.title || this.store.view.url))));
this.disposers.push(autorun(() => this.mod.setTitle($localize`Comments: ` + (this.store.view.ref?.title || this.store.view.url))));
this.disposers.push(autorun(() => {
const top = this.store.view.ref!;
const sort = this.store.view.sort;
Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ref/responses/responses.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { defer, uniq } from 'lodash-es';
import { autorun, IReactionDisposer, runInAction } from 'mobx';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -17,7 +17,7 @@ export class RefResponsesComponent implements OnInit, OnDestroy {
private disposers: IReactionDisposer[] = [];

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
Expand All @@ -40,7 +40,7 @@ export class RefResponsesComponent implements OnInit, OnDestroy {
defer(() => this.query.setArgs(args));
}));
this.disposers.push(autorun(() => {
this.theme.setTitle($localize`Responses: ` + (this.store.view.ref?.title || this.store.view.url));
this.mod.setTitle($localize`Responses: ` + (this.store.view.ref?.title || this.store.view.url));
}));
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ref/sources/sources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { autorun, IReactionDisposer, runInAction } from 'mobx';
import { Page } from '../../../model/page';
import { Ref } from '../../../model/ref';
import { AdminService } from '../../../service/admin.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { getArgs } from '../../../util/query';
Expand All @@ -21,7 +21,7 @@ export class RefSourcesComponent implements OnInit, OnDestroy {
page: Page<Ref> = Page.of([]);

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public store: Store,
public query: QueryStore,
Expand Down Expand Up @@ -56,7 +56,7 @@ export class RefSourcesComponent implements OnInit, OnDestroy {
}
}));
this.disposers.push(autorun(() => {
this.theme.setTitle($localize`Sources: ` + (this.store.view.ref?.title || this.store.view.url));
this.mod.setTitle($localize`Sources: ` + (this.store.view.ref?.title || this.store.view.url));
}));
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/page/ref/summary/summary.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Ref } from '../../../model/ref';
import { getMailbox, mailboxes } from '../../../mods/mailbox';
import { AdminService } from '../../../service/admin.service';
import { RefService } from '../../../service/api/ref.service';
import { ThemeService } from '../../../service/theme.service';
import { ModService } from '../../../service/mod.service';
import { QueryStore } from '../../../store/query';
import { Store } from '../../../store/store';
import { ThreadStore } from '../../../store/thread';
Expand All @@ -25,7 +25,7 @@ export class RefSummaryComponent implements OnInit, OnDestroy {
summaryItems = 5;

constructor(
private theme: ThemeService,
private mod: ModService,
public admin: AdminService,
public refs: RefService,
public store: Store,
Expand All @@ -38,7 +38,7 @@ export class RefSummaryComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.disposers.push(autorun(() => this.theme.setTitle((this.store.view.ref?.title || this.store.view.url))));
this.disposers.push(autorun(() => this.mod.setTitle((this.store.view.ref?.title || this.store.view.url))));
this.disposers.push(autorun(() => {
const top = this.store.view.ref!;
const sort = this.store.view.sort;
Expand Down
Loading

0 comments on commit d2d7af4

Please sign in to comment.