This commit is contained in:
Travis Ralston 2017-10-09 22:00:29 -06:00
parent 27abf3ec1d
commit 38ac6ec4e9
9 changed files with 20 additions and 20 deletions

View file

@ -25,7 +25,7 @@ import { TravisCiConfigComponent } from "./configs/travisci/travisci-config.comp
import { CustomWidgetConfigComponent } from "./configs/widget/custom_widget/custom_widget-config.component"; import { CustomWidgetConfigComponent } from "./configs/widget/custom_widget/custom_widget-config.component";
import { MyFilterPipe } from "./shared/my-filter.pipe"; import { MyFilterPipe } from "./shared/my-filter.pipe";
import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component"; import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component";
import { ToggleFullscreenDirective } from "./toggle-fullscreen/toggle-fullscreen.directive"; import { ToggleFullscreenDirective } from "./shared/toggle-fullscreen.directive";
import { FullscreenButtonComponent } from "./fullscreen-button/fullscreen-button.component"; import { FullscreenButtonComponent } from "./fullscreen-button/fullscreen-button.component";
@NgModule({ @NgModule({

View file

@ -58,7 +58,7 @@ export class CustomWidgetConfigComponent extends WidgetComponent implements Moda
private getWrappedUrl(url: string): string { private getWrappedUrl(url: string): string {
const urls = [this.wrapperUrl].concat(SCALAR_WIDGET_LINKS); const urls = [this.wrapperUrl].concat(SCALAR_WIDGET_LINKS);
for (var scalarUrl of urls) { for (let scalarUrl of urls) {
if (url.startsWith(scalarUrl)) { if (url.startsWith(scalarUrl)) {
return decodeURIComponent(url.substring(scalarUrl.length)); return decodeURIComponent(url.substring(scalarUrl.length));
} }

View file

@ -2,10 +2,10 @@ import { ScalarService } from "../../shared/scalar.service";
import { Widget, ScalarToWidgets } from "../../shared/models/widget"; import { Widget, ScalarToWidgets } from "../../shared/models/widget";
export const SCALAR_WIDGET_LINKS = [ export const SCALAR_WIDGET_LINKS = [
'https://scalar-staging.riot.im/scalar/api/widgets/generic.html?url=', "https://scalar-staging.riot.im/scalar/api/widgets/generic.html?url=",
'https://scalar-staging.vector.im/scalar/api/widgets/generic.html?url=', "https://scalar-staging.vector.im/scalar/api/widgets/generic.html?url=",
'https://scalar-develop.riot.im/scalar/api/widgets/generic.html?url=', "https://scalar-develop.riot.im/scalar/api/widgets/generic.html?url=",
'https://demo.riot.im/scalar/api/widgets/generic.html?url=', "https://demo.riot.im/scalar/api/widgets/generic.html?url=",
]; ];
export class WidgetComponent { export class WidgetComponent {

View file

@ -1,3 +1,3 @@
<button toggleFullscreen=""> <button myToggleFullscreen="">
<img [src]="isFullscreen ? '/img/exit-fullscreen.png' : '/img/enter-fullscreen.png'" /> <img [src]="isFullscreen ? '/img/exit-fullscreen.png' : '/img/enter-fullscreen.png'" />
</button> </button>

View file

@ -1,5 +1,5 @@
import { Component, OnDestroy, OnInit } from "@angular/core"; import { Component, OnDestroy, OnInit } from "@angular/core";
import * as screenfull from 'screenfull'; import * as screenfull from "screenfull";
@Component({ @Component({
selector: "my-fullscreen-button", selector: "my-fullscreen-button",
@ -17,7 +17,7 @@ export class FullscreenButtonComponent implements OnDestroy, OnInit {
} }
public ngOnInit(): void { public ngOnInit(): void {
this.listener = screenfull.on('change', () => { this.listener = screenfull.on("change", () => {
this.isFullscreen = screenfull.isFullscreen; this.isFullscreen = screenfull.isFullscreen;
}); });
this.isFullscreen = screenfull.isFullscreen; this.isFullscreen = screenfull.isFullscreen;

View file

@ -31,7 +31,7 @@ export class IntegrationComponent {
this.updated.emit(); this.updated.emit();
} }
public configureIntegration(integrationId:string=null): void { public configureIntegration(integrationId: string = null): void {
this.modal.open(IntegrationService.getConfigComponent(this.integration), overlayConfigFactory({ this.modal.open(IntegrationService.getConfigComponent(this.integration), overlayConfigFactory({
integration: this.integration, integration: this.integration,
roomId: this.roomId, roomId: this.roomId,

View file

@ -16,7 +16,7 @@
ngbTooltip="Widgets add small apps to Riot, like Google Docs, Jitsi conferences, and YouTube videos"></i> ngbTooltip="Widgets add small apps to Riot, like Google Docs, Jitsi conferences, and YouTube videos"></i>
</h4> </h4>
<div class="integration-container"> <div class="integration-container">
<my-integration *ngFor="let integration of integrations | myfilter:'type':'widget'" <my-integration *ngFor="let integration of integrations | myFilter:'type':'widget'"
[integration]="integration" [integration]="integration"
[roomId]="roomId" [roomId]="roomId"
[scalarToken]="scalarToken" [scalarToken]="scalarToken"
@ -31,12 +31,12 @@
ngbTooltip="Bots can provide entertainment or some utility to your room"></i> ngbTooltip="Bots can provide entertainment or some utility to your room"></i>
</h4> </h4>
<div class="integration-container"> <div class="integration-container">
<my-integration *ngFor="let integration of integrations | myfilter:'type':'bot'" <my-integration *ngFor="let integration of integrations | myFilter:'type':'bot'"
[integration]="integration" [integration]="integration"
[roomId]="roomId" [roomId]="roomId"
[scalarToken]="scalarToken" [scalarToken]="scalarToken"
(updated)="updateIntegration(integration)"></my-integration> (updated)="updateIntegration(integration)"></my-integration>
<my-integration *ngFor="let integration of integrations | myfilter:'type':'complex-bot'" <my-integration *ngFor="let integration of integrations | myFilter:'type':'complex-bot'"
[integration]="integration" [integration]="integration"
[roomId]="roomId" [roomId]="roomId"
[scalarToken]="scalarToken" [scalarToken]="scalarToken"
@ -51,7 +51,7 @@
ngbTooltip="Bridges allow people on other platforms to talk in the room"></i> ngbTooltip="Bridges allow people on other platforms to talk in the room"></i>
</h4> </h4>
<div class="integration-container"> <div class="integration-container">
<my-integration *ngFor="let integration of integrations | myfilter:'type':'bridge'" <my-integration *ngFor="let integration of integrations | myFilter:'type':'bridge'"
[integration]="integration" [integration]="integration"
[roomId]="roomId" [roomId]="roomId"
[scalarToken]="scalarToken" [scalarToken]="scalarToken"

View file

@ -1,13 +1,13 @@
import { Pipe, PipeTransform } from "@angular/core"; import { Pipe, PipeTransform } from "@angular/core";
@Pipe({ @Pipe({
name: 'myfilter', name: "myFilter",
pure: false pure: false
}) })
export class MyFilterPipe implements PipeTransform { export class MyFilterPipe implements PipeTransform {
transform(items: any[], field: string, value: string): any[] { transform(items: any[], field: string, value: string): any[] {
if (!items) return []; if (!items) return [];
if (!value || value.length == 0) return items; if (!value || value.length === 0) return items;
return items.filter(it => it[field].toLowerCase() === value.toLowerCase()); return items.filter(it => it[field].toLowerCase() === value.toLowerCase());
} }
} }

View file

@ -1,12 +1,12 @@
import { Directive, HostListener } from "@angular/core"; import { Directive, HostListener } from "@angular/core";
import * as screenfull from 'screenfull'; import * as screenfull from "screenfull";
@Directive({ @Directive({
selector: '[toggleFullscreen]', selector: "[myToggleFullscreen]",
}) })
export class ToggleFullscreenDirective { export class ToggleFullscreenDirective {
@HostListener('click') onClick() { @HostListener("click") onClick() {
// HACK: This should be behind a service in the event the library changes // HACK: This should be behind a service in the event the library changes
if (screenfull.enabled) { if (screenfull.enabled) {
screenfull.toggle(); screenfull.toggle();