2017-12-22 23:08:10 -05:00
|
|
|
import { ApplicationRef, Injector, NgModule } from "@angular/core";
|
2017-05-26 23:51:48 -04:00
|
|
|
import { BrowserModule } from "@angular/platform-browser";
|
|
|
|
import { HttpModule } from "@angular/http";
|
|
|
|
import { FormsModule } from "@angular/forms";
|
|
|
|
import { AppComponent } from "./app.component";
|
|
|
|
import { HomeComponent } from "./home/home.component";
|
|
|
|
import { routing } from "./app.routing";
|
2017-12-09 18:34:59 -05:00
|
|
|
import { createNewHosts, removeNgStyles } from "@angularclass/hmr";
|
2017-05-26 23:51:48 -04:00
|
|
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
2017-05-27 03:27:36 -04:00
|
|
|
import { RiotComponent } from "./riot/riot.component";
|
|
|
|
import { UiSwitchModule } from "angular2-ui-switch";
|
2017-12-24 04:02:57 -05:00
|
|
|
import { ScalarClientApiService } from "./shared/services/scalar/scalar-client-api.service";
|
2017-05-27 19:45:07 -04:00
|
|
|
import { ToasterModule } from "angular2-toaster";
|
|
|
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
2017-05-28 02:53:12 -04:00
|
|
|
import { ScalarCloseComponent } from "./riot/scalar-close/scalar-close.component";
|
2017-08-27 01:26:00 -04:00
|
|
|
import { BootstrapModalModule } from "ngx-modialog/plugins/bootstrap";
|
|
|
|
import { ModalModule } from "ngx-modialog";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { GenericWidgetWrapperComponent } from "./widget-wrappers/generic/generic.component";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { ToggleFullscreenDirective } from "./shared/directives/toggle-fullscreen.directive";
|
2017-12-22 23:08:10 -05:00
|
|
|
import { FullscreenButtonComponent } from "./elements/fullscreen-button/fullscreen-button.component";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { VideoWidgetWrapperComponent } from "./widget-wrappers/video/video.component";
|
|
|
|
import { JitsiWidgetWrapperComponent } from "./widget-wrappers/jitsi/jitsi.component";
|
|
|
|
import { GCalWidgetWrapperComponent } from "./widget-wrappers/gcal/gcal.component";
|
2017-12-14 23:25:15 -05:00
|
|
|
import { PageHeaderComponent } from "./page-header/page-header.component";
|
2017-12-22 23:08:10 -05:00
|
|
|
import { SpinnerComponent } from "./elements/spinner/spinner.component";
|
2017-12-14 23:25:15 -05:00
|
|
|
import { BreadcrumbsModule } from "ng2-breadcrumbs";
|
2017-12-15 01:41:56 -05:00
|
|
|
import { RiotHomeComponent } from "./riot/riot-home/home.component";
|
2017-12-15 23:22:34 -05:00
|
|
|
import { IntegrationBagComponent } from "./integration-bag/integration-bag.component";
|
2017-12-24 04:02:57 -05:00
|
|
|
import { ScalarServerApiService } from "./shared/services/scalar/scalar-server-api.service";
|
|
|
|
import { AdminApiService } from "./shared/services/admin/admin-api.service";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { ServiceLocator } from "./shared/registry/locator.service";
|
2017-12-22 23:08:10 -05:00
|
|
|
import { IboxComponent } from "./elements/ibox/ibox.component";
|
2017-12-22 23:33:37 -05:00
|
|
|
import { CustomWidgetConfigComponent } from "./configs/widget/custom/custom.widget.component";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { ConfigScreenWidgetComponent } from "./configs/widget/config-screen/config-screen.widget.component";
|
2017-12-23 15:16:05 -05:00
|
|
|
import { EtherpadWidgetConfigComponent } from "./configs/widget/etherpad/etherpad.widget.component";
|
|
|
|
import { NameService } from "./shared/services/name.service";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { GoogleCalendarWidgetConfigComponent } from "./configs/widget/google-calendar/gcal.widget.component";
|
|
|
|
import { GoogleDocsWidgetConfigComponent } from "./configs/widget/google-docs/gdoc.widget.component";
|
2017-12-23 16:16:22 -05:00
|
|
|
import { JitsiWidgetConfigComponent } from "./configs/widget/jitsi/jitsi.widget.component";
|
2017-12-23 17:03:24 -05:00
|
|
|
import { TwitchWidgetConfigComponent } from "./configs/widget/twitch/twitch.widget.component";
|
2017-12-23 17:28:42 -05:00
|
|
|
import { YoutubeWidgetConfigComponent } from "./configs/widget/youtube/youtube.widget.component";
|
2017-12-23 20:47:41 -05:00
|
|
|
import { AdminComponent } from "./admin/admin.component";
|
|
|
|
import { AdminHomeComponent } from "./admin/home/home.component";
|
2017-12-23 23:40:01 -05:00
|
|
|
import { AdminWidgetsComponent } from "./admin/widgets/widgets.component";
|
|
|
|
import { AdminWidgetEtherpadConfigComponent } from "./admin/widgets/etherpad/etherpad.component";
|
|
|
|
import { AdminWidgetJitsiConfigComponent } from "./admin/widgets/jitsi/jitsi.component";
|
2017-12-24 04:02:57 -05:00
|
|
|
import { AdminIntegrationsApiService } from "./shared/services/admin/admin-integrations-api.service";
|
|
|
|
import { IntegrationsApiService } from "./shared/services/integrations/integrations-api.service";
|
|
|
|
import { WidgetApiService } from "./shared/services/integrations/widget-api.service";
|
2017-12-28 20:22:50 -05:00
|
|
|
import { AdminAppserviceApiService } from "./shared/services/admin/admin-appservice-api.service";
|
|
|
|
import { AdminNebApiService } from "./shared/services/admin/admin-neb-api.service";
|
|
|
|
import { AdminUpstreamApiService } from "./shared/services/admin/admin-upstream-api.service";
|
|
|
|
import { AdminNebComponent } from "./admin/neb/neb.component";
|
|
|
|
import { AdminEditNebComponent } from "./admin/neb/edit/edit.component";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { AdminAddSelfhostedNebComponent } from "./admin/neb/add-selfhosted/add-selfhosted.component";
|
2018-03-24 14:18:38 -04:00
|
|
|
import { AdminNebAppserviceConfigComponent } from "./admin/neb/appservice-config/appservice-config.component";
|
2018-03-24 23:17:44 -04:00
|
|
|
import { AdminNebGiphyConfigComponent } from "./admin/neb/config/giphy/giphy.component";
|
2018-03-24 23:44:05 -04:00
|
|
|
import { AdminNebGuggyConfigComponent } from "./admin/neb/config/guggy/guggy.component";
|
2018-03-24 23:50:30 -04:00
|
|
|
import { AdminNebGoogleConfigComponent } from "./admin/neb/config/google/google.component";
|
2018-03-24 23:55:35 -04:00
|
|
|
import { AdminNebImgurConfigComponent } from "./admin/neb/config/imgur/imgur.component";
|
2018-03-25 21:17:09 -04:00
|
|
|
import { ConfigSimpleBotComponent } from "./configs/simple-bot/simple-bot.component";
|
2018-03-25 23:01:05 -04:00
|
|
|
import { ConfigScreenComplexBotComponent } from "./configs/complex-bot/config-screen/config-screen.complex-bot.component";
|
|
|
|
import { RssComplexBotConfigComponent } from "./configs/complex-bot/rss/rss.complex-bot.component";
|
2018-03-29 00:18:33 -04:00
|
|
|
import { TravisCiComplexBotConfigComponent } from "./configs/complex-bot/travisci/travisci.complex-bot.component";
|
2018-03-30 21:22:15 -04:00
|
|
|
import { ConfigScreenBridgeComponent } from "./configs/bridge/config-screen/config-screen.bridge.component";
|
|
|
|
import { AdminBridgesComponent } from "./admin/bridges/bridges.component";
|
|
|
|
import { AdminIrcBridgeComponent } from "./admin/bridges/irc/irc.component";
|
2018-03-31 01:12:31 -04:00
|
|
|
import { AdminIrcApiService } from "./shared/services/admin/admin-irc-api.service";
|
2018-03-31 13:26:00 -04:00
|
|
|
import { AdminIrcBridgeNetworksComponent } from "./admin/bridges/irc/networks/networks.component";
|
2018-03-31 13:45:19 -04:00
|
|
|
import { AdminIrcBridgeAddSelfhostedComponent } from "./admin/bridges/irc/add-selfhosted/add-selfhosted.component";
|
2018-03-31 16:37:36 -04:00
|
|
|
import { IrcBridgeConfigComponent } from "./configs/bridge/irc/irc.bridge.component";
|
|
|
|
import { IrcApiService } from "./shared/services/integrations/irc-api.service";
|
2018-05-11 23:58:10 -04:00
|
|
|
import { ScreenshotCapableDirective } from "./shared/directives/screenshot-capable.directive";
|
2018-05-12 23:55:02 -04:00
|
|
|
import { AdminStickersApiService } from "./shared/services/admin/admin-stickers-api-service";
|
|
|
|
import { AdminStickerPacksComponent } from "./admin/sticker-packs/sticker-packs.component";
|
|
|
|
import { AdminStickerPackPreviewComponent } from "./admin/sticker-packs/preview/preview.component";
|
|
|
|
import { MediaService } from "./shared/services/media.service";
|
2018-05-13 01:51:31 -04:00
|
|
|
import { StickerApiService } from "./shared/services/integrations/sticker-api.service";
|
|
|
|
import { StickerpickerComponent } from "./configs/stickerpicker/stickerpicker.component";
|
2018-05-14 00:32:13 -04:00
|
|
|
import { StickerPickerWidgetWrapperComponent } from "./widget-wrappers/sticker-picker/sticker-picker.component";
|
2017-12-10 04:35:24 -05:00
|
|
|
|
2017-05-26 23:51:48 -04:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
HttpModule,
|
|
|
|
FormsModule,
|
|
|
|
routing,
|
2017-05-27 03:27:36 -04:00
|
|
|
NgbModule.forRoot(),
|
|
|
|
UiSwitchModule,
|
2017-05-27 19:45:07 -04:00
|
|
|
ToasterModule,
|
|
|
|
BrowserAnimationsModule,
|
2017-05-29 00:51:04 -04:00
|
|
|
ModalModule.forRoot(),
|
|
|
|
BootstrapModalModule,
|
2017-12-14 23:25:15 -05:00
|
|
|
BreadcrumbsModule,
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
2017-05-27 03:27:36 -04:00
|
|
|
HomeComponent,
|
|
|
|
RiotComponent,
|
2017-12-15 23:22:34 -05:00
|
|
|
IntegrationBagComponent,
|
2017-12-14 23:25:15 -05:00
|
|
|
PageHeaderComponent,
|
|
|
|
SpinnerComponent,
|
2017-05-28 02:53:12 -04:00
|
|
|
ScalarCloseComponent,
|
2017-10-09 22:49:26 -04:00
|
|
|
GenericWidgetWrapperComponent,
|
2017-10-09 23:24:12 -04:00
|
|
|
ToggleFullscreenDirective,
|
|
|
|
FullscreenButtonComponent,
|
2017-10-10 22:44:09 -04:00
|
|
|
VideoWidgetWrapperComponent,
|
2017-12-10 02:59:36 -05:00
|
|
|
JitsiWidgetWrapperComponent,
|
2017-12-11 19:29:57 -05:00
|
|
|
GCalWidgetWrapperComponent,
|
2017-12-15 01:41:56 -05:00
|
|
|
RiotHomeComponent,
|
2017-12-22 23:08:10 -05:00
|
|
|
IboxComponent,
|
2017-12-23 01:30:42 -05:00
|
|
|
ConfigScreenWidgetComponent,
|
2017-12-22 23:33:37 -05:00
|
|
|
CustomWidgetConfigComponent,
|
2017-12-23 15:16:05 -05:00
|
|
|
EtherpadWidgetConfigComponent,
|
2017-12-23 15:32:07 -05:00
|
|
|
GoogleCalendarWidgetConfigComponent,
|
2017-12-23 15:44:19 -05:00
|
|
|
GoogleDocsWidgetConfigComponent,
|
2017-12-23 16:16:22 -05:00
|
|
|
JitsiWidgetConfigComponent,
|
2017-12-23 17:03:24 -05:00
|
|
|
TwitchWidgetConfigComponent,
|
2017-12-23 17:28:42 -05:00
|
|
|
YoutubeWidgetConfigComponent,
|
2017-12-23 20:47:41 -05:00
|
|
|
AdminComponent,
|
|
|
|
AdminHomeComponent,
|
2017-12-23 23:40:01 -05:00
|
|
|
AdminWidgetsComponent,
|
|
|
|
AdminWidgetEtherpadConfigComponent,
|
|
|
|
AdminWidgetJitsiConfigComponent,
|
2017-12-28 20:22:50 -05:00
|
|
|
AdminNebComponent,
|
|
|
|
AdminEditNebComponent,
|
2018-01-31 18:30:08 -05:00
|
|
|
AdminAddSelfhostedNebComponent,
|
2018-03-24 14:18:38 -04:00
|
|
|
AdminNebAppserviceConfigComponent,
|
2018-03-24 23:17:44 -04:00
|
|
|
AdminNebGiphyConfigComponent,
|
2018-03-24 23:44:05 -04:00
|
|
|
AdminNebGuggyConfigComponent,
|
2018-03-24 23:50:30 -04:00
|
|
|
AdminNebGoogleConfigComponent,
|
2018-03-24 23:55:35 -04:00
|
|
|
AdminNebImgurConfigComponent,
|
2018-03-25 21:17:09 -04:00
|
|
|
ConfigSimpleBotComponent,
|
2018-03-25 23:01:05 -04:00
|
|
|
ConfigScreenComplexBotComponent,
|
|
|
|
RssComplexBotConfigComponent,
|
2018-03-29 00:18:33 -04:00
|
|
|
TravisCiComplexBotConfigComponent,
|
2018-03-30 21:22:15 -04:00
|
|
|
ConfigScreenBridgeComponent,
|
|
|
|
AdminBridgesComponent,
|
|
|
|
AdminIrcBridgeComponent,
|
2018-03-31 13:26:00 -04:00
|
|
|
AdminIrcBridgeNetworksComponent,
|
2018-03-31 13:45:19 -04:00
|
|
|
AdminIrcBridgeAddSelfhostedComponent,
|
2018-03-31 16:37:36 -04:00
|
|
|
IrcBridgeConfigComponent,
|
2018-05-11 23:58:10 -04:00
|
|
|
ScreenshotCapableDirective,
|
2018-05-12 23:55:02 -04:00
|
|
|
AdminStickerPacksComponent,
|
|
|
|
AdminStickerPackPreviewComponent,
|
2018-05-13 01:51:31 -04:00
|
|
|
StickerpickerComponent,
|
2018-05-14 00:32:13 -04:00
|
|
|
StickerPickerWidgetWrapperComponent,
|
2017-12-23 20:47:41 -05:00
|
|
|
|
2017-05-27 03:27:36 -04:00
|
|
|
// Vendor
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
providers: [
|
2017-12-24 04:02:57 -05:00
|
|
|
AdminApiService,
|
|
|
|
AdminIntegrationsApiService,
|
|
|
|
IntegrationsApiService,
|
|
|
|
WidgetApiService,
|
2017-12-20 23:28:43 -05:00
|
|
|
ScalarClientApiService,
|
|
|
|
ScalarServerApiService,
|
2017-12-23 15:16:05 -05:00
|
|
|
NameService,
|
2017-12-28 20:22:50 -05:00
|
|
|
AdminAppserviceApiService,
|
|
|
|
AdminNebApiService,
|
|
|
|
AdminUpstreamApiService,
|
2018-03-31 01:12:31 -04:00
|
|
|
AdminIrcApiService,
|
2018-03-31 16:37:36 -04:00
|
|
|
IrcApiService,
|
2018-05-12 23:55:02 -04:00
|
|
|
AdminStickersApiService,
|
|
|
|
MediaService,
|
2018-05-13 01:51:31 -04:00
|
|
|
StickerApiService,
|
2017-10-09 22:26:46 -04:00
|
|
|
{provide: Window, useValue: window},
|
2017-05-27 03:27:36 -04:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent],
|
2017-12-23 23:40:01 -05:00
|
|
|
entryComponents: [
|
|
|
|
AdminWidgetEtherpadConfigComponent,
|
|
|
|
AdminWidgetJitsiConfigComponent,
|
2018-03-24 14:18:38 -04:00
|
|
|
AdminNebAppserviceConfigComponent,
|
2018-03-24 23:17:44 -04:00
|
|
|
AdminNebGiphyConfigComponent,
|
2018-03-24 23:44:05 -04:00
|
|
|
AdminNebGuggyConfigComponent,
|
2018-03-24 23:50:30 -04:00
|
|
|
AdminNebGoogleConfigComponent,
|
2018-03-24 23:55:35 -04:00
|
|
|
AdminNebImgurConfigComponent,
|
2018-03-25 21:17:09 -04:00
|
|
|
ConfigSimpleBotComponent,
|
2018-03-31 13:26:00 -04:00
|
|
|
AdminIrcBridgeNetworksComponent,
|
2018-03-31 13:45:19 -04:00
|
|
|
AdminIrcBridgeAddSelfhostedComponent,
|
2018-05-12 23:55:02 -04:00
|
|
|
AdminStickerPackPreviewComponent,
|
2017-12-23 23:40:01 -05:00
|
|
|
]
|
2017-05-26 23:51:48 -04:00
|
|
|
})
|
|
|
|
export class AppModule {
|
2017-12-22 23:08:10 -05:00
|
|
|
constructor(public appRef: ApplicationRef, injector: Injector) {
|
|
|
|
ServiceLocator.injector = injector;
|
2017-05-26 23:51:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
hmrOnInit(store) {
|
2017-08-27 01:26:00 -04:00
|
|
|
console.log("HMR store", store);
|
2017-05-26 23:51:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
hmrOnDestroy(store) {
|
|
|
|
let cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
|
|
|
|
// recreate elements
|
|
|
|
store.disposeOldHosts = createNewHosts(cmpLocation);
|
|
|
|
// remove styles
|
|
|
|
removeNgStyles();
|
|
|
|
}
|
|
|
|
|
|
|
|
hmrAfterDestroy(store) {
|
|
|
|
// display new elements
|
|
|
|
store.disposeOldHosts();
|
|
|
|
delete store.disposeOldHosts;
|
|
|
|
}
|
|
|
|
}
|