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 { MyFilterPipe } from "./shared/my-filter.pipe";
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";
@NgModule({

View file

@ -58,7 +58,7 @@ export class CustomWidgetConfigComponent extends WidgetComponent implements Moda
private getWrappedUrl(url: string): string {
const urls = [this.wrapperUrl].concat(SCALAR_WIDGET_LINKS);
for (var scalarUrl of urls) {
for (let scalarUrl of urls) {
if (url.startsWith(scalarUrl)) {
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";
export const SCALAR_WIDGET_LINKS = [
'https://scalar-staging.riot.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://demo.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-develop.riot.im/scalar/api/widgets/generic.html?url=",
"https://demo.riot.im/scalar/api/widgets/generic.html?url=",
];
export class WidgetComponent {

View file

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

View file

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

View file

@ -31,7 +31,7 @@ export class IntegrationComponent {
this.updated.emit();
}
public configureIntegration(integrationId:string=null): void {
public configureIntegration(integrationId: string = null): void {
this.modal.open(IntegrationService.getConfigComponent(this.integration), overlayConfigFactory({
integration: this.integration,
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>
</h4>
<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"
[roomId]="roomId"
[scalarToken]="scalarToken"
@ -31,12 +31,12 @@
ngbTooltip="Bots can provide entertainment or some utility to your room"></i>
</h4>
<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"
[roomId]="roomId"
[scalarToken]="scalarToken"
(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"
[roomId]="roomId"
[scalarToken]="scalarToken"
@ -51,7 +51,7 @@
ngbTooltip="Bridges allow people on other platforms to talk in the room"></i>
</h4>
<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"
[roomId]="roomId"
[scalarToken]="scalarToken"

View file

@ -1,13 +1,13 @@
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: 'myfilter',
name: "myFilter",
pure: false
})
export class MyFilterPipe implements PipeTransform {
transform(items: any[], field: string, value: string): any[] {
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());
}
}
}

View file

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