Generify some widget wrappers

This commit is contained in:
Travis Ralston 2017-12-14 23:52:36 -07:00
parent e8f1167ec2
commit d02830e170
9 changed files with 16 additions and 23 deletions

View File

@ -21,10 +21,15 @@ const routes: Routes = [
}, },
], ],
}, },
{path: "widgets/generic", component: GenericWidgetWrapperComponent}, {
{path: "widgets/video", component: VideoWidgetWrapperComponent}, path: "widgets",
{path: "widgets/jitsi", component: JitsiWidgetWrapperComponent}, children: [
{path: "widgets/gcal", component: GCalWidgetWrapperComponent}, {path: "generic", component: GenericWidgetWrapperComponent},
{path: "video", component: VideoWidgetWrapperComponent},
{path: "jitsi", component: JitsiWidgetWrapperComponent},
{path: "gcal", component: GCalWidgetWrapperComponent},
]
},
]; ];
export const routing = RouterModule.forRoot(routes); export const routing = RouterModule.forRoot(routes);

View File

@ -4,8 +4,8 @@ import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
@Component({ @Component({
selector: "my-gcal-widget-wrapper", selector: "my-gcal-widget-wrapper",
templateUrl: "gcal.component.html", templateUrl: "../fullpage-iframe/fullpage-iframe.component.html",
styleUrls: ["gcal.component.scss"], styleUrls: ["../fullpage-iframe/fullpage-iframe.component.scss"],
}) })
export class GCalWidgetWrapperComponent { export class GCalWidgetWrapperComponent {

View File

@ -1,8 +1,7 @@
<div class="wrapper"> <div class="wrapper">
<div class="control-page" *ngIf="isLoading || !canEmbed"> <div class="control-page" *ngIf="isLoading || !canEmbed">
<div class="loading-badge" *ngIf="isLoading"> <div class="loading-badge" *ngIf="isLoading">
<i class="fa fa-circle-o-notch fa-spin"></i> <my-spinner></my-spinner>
Loading...
</div> </div>
<div class="embed-failed" *ngIf="!isLoading && !canEmbed"> <div class="embed-failed" *ngIf="!isLoading && !canEmbed">
<p class="ban"><i class="fa fa-ban"></i></p> <p class="ban"><i class="fa fa-ban"></i></p>

View File

@ -7,8 +7,8 @@
right: 0; right: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: #222; background-color: #eee;
color: #eee; color: #222;
} }
.loading-badge { .loading-badge {

View File

@ -1 +0,0 @@
<iframe [src]="embedUrl" frameborder="0" allowfullscreen></iframe>

View File

@ -1,10 +0,0 @@
// component styles are encapsulated and only applied to their components
iframe {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
}

View File

@ -4,8 +4,8 @@ import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
@Component({ @Component({
selector: "my-video-widget-wrapper", selector: "my-video-widget-wrapper",
templateUrl: "video.component.html", templateUrl: "../fullpage-iframe/fullpage-iframe.component.html",
styleUrls: ["video.component.scss"], styleUrls: ["../fullpage-iframe/fullpage-iframe.component.scss"],
}) })
export class VideoWidgetWrapperComponent { export class VideoWidgetWrapperComponent {