mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-14 13:04:59 +00:00
Reformat code
This commit is contained in:
parent
a45232998a
commit
e9aecabab4
@ -1,11 +1,11 @@
|
|||||||
import { NgModule, ApplicationRef } from "@angular/core";
|
import { ApplicationRef, NgModule } from "@angular/core";
|
||||||
import { BrowserModule } from "@angular/platform-browser";
|
import { BrowserModule } from "@angular/platform-browser";
|
||||||
import { HttpModule } from "@angular/http";
|
import { HttpModule } from "@angular/http";
|
||||||
import { FormsModule } from "@angular/forms";
|
import { FormsModule } from "@angular/forms";
|
||||||
import { AppComponent } from "./app.component";
|
import { AppComponent } from "./app.component";
|
||||||
import { HomeComponent } from "./home/home.component";
|
import { HomeComponent } from "./home/home.component";
|
||||||
import { routing } from "./app.routing";
|
import { routing } from "./app.routing";
|
||||||
import { removeNgStyles, createNewHosts } from "@angularclass/hmr";
|
import { createNewHosts, removeNgStyles } from "@angularclass/hmr";
|
||||||
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
||||||
import { RiotComponent } from "./riot/riot.component";
|
import { RiotComponent } from "./riot/riot.component";
|
||||||
import { ApiService } from "./shared/api.service";
|
import { ApiService } from "./shared/api.service";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ModalComponent, DialogRef } from "ngx-modialog";
|
import { DialogRef, ModalComponent } from "ngx-modialog";
|
||||||
import { WidgetComponent } from "../widget.component";
|
import { WidgetComponent } from "../widget.component";
|
||||||
import { ScalarService } from "../../../shared/scalar.service";
|
import { ScalarService } from "../../../shared/scalar.service";
|
||||||
import { ConfigModalContext } from "../../../integration/integration.component";
|
import { ConfigModalContext } from "../../../integration/integration.component";
|
||||||
|
@ -52,7 +52,8 @@
|
|||||||
[(ngModel)]="widget.newUrl" name="widget-url-{{widget.id}}"
|
[(ngModel)]="widget.newUrl" name="widget-url-{{widget.id}}"
|
||||||
[disabled]="isUpdating">
|
[disabled]="isUpdating">
|
||||||
</label>
|
</label>
|
||||||
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">Save
|
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">
|
||||||
|
Save
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
||||||
Cancel
|
Cancel
|
||||||
|
@ -52,7 +52,8 @@
|
|||||||
[(ngModel)]="widget.data.newDimChannelName" name="widget-url-{{widget.id}}"
|
[(ngModel)]="widget.data.newDimChannelName" name="widget-url-{{widget.id}}"
|
||||||
[disabled]="isUpdating">
|
[disabled]="isUpdating">
|
||||||
</label>
|
</label>
|
||||||
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">Save
|
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">
|
||||||
|
Save
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
||||||
Cancel
|
Cancel
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ModalComponent, DialogRef } from "ngx-modialog";
|
import { DialogRef, ModalComponent } from "ngx-modialog";
|
||||||
import { WidgetComponent } from "../widget.component";
|
import { WidgetComponent } from "../widget.component";
|
||||||
import { ScalarService } from "../../../shared/scalar.service";
|
import { ScalarService } from "../../../shared/scalar.service";
|
||||||
import { ConfigModalContext } from "../../../integration/integration.component";
|
import { ConfigModalContext } from "../../../integration/integration.component";
|
||||||
@ -33,7 +33,7 @@ export class TwitchWidgetConfigComponent extends WidgetComponent implements Moda
|
|||||||
|
|
||||||
public validateAndAddWidget() {
|
public validateAndAddWidget() {
|
||||||
// Replace channel name with path to embedable Twitch Player
|
// Replace channel name with path to embedable Twitch Player
|
||||||
const url = "https://player.twitch.tv/?channel="+this.newWidgetUrl;
|
const url = "https://player.twitch.tv/?channel=" + this.newWidgetUrl;
|
||||||
|
|
||||||
// TODO Somehow Validate if it is a valid Username
|
// TODO Somehow Validate if it is a valid Username
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@ -47,7 +47,7 @@ export class TwitchWidgetConfigComponent extends WidgetComponent implements Moda
|
|||||||
}
|
}
|
||||||
|
|
||||||
public validateAndSaveWidget(widget: Widget) {
|
public validateAndSaveWidget(widget: Widget) {
|
||||||
const url = "https://player.twitch.tv/?channel="+widget.data.dimChannelName;
|
const url = "https://player.twitch.tv/?channel=" + widget.data.dimChannelName;
|
||||||
|
|
||||||
// TODO Somehow Validate if it is a valid Username
|
// TODO Somehow Validate if it is a valid Username
|
||||||
if (!url) {
|
if (!url) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ScalarService } from "../../shared/scalar.service";
|
import { ScalarService } from "../../shared/scalar.service";
|
||||||
import { Widget, ScalarToWidgets } from "../../shared/models/widget";
|
import { ScalarToWidgets, Widget } from "../../shared/models/widget";
|
||||||
import { ToasterService } from "angular2-toaster";
|
import { ToasterService } from "angular2-toaster";
|
||||||
|
|
||||||
const SCALAR_WIDGET_LINKS = [
|
const SCALAR_WIDGET_LINKS = [
|
||||||
|
@ -52,7 +52,8 @@
|
|||||||
[(ngModel)]="widget.newUrl" name="widget-url-{{widget.id}}"
|
[(ngModel)]="widget.newUrl" name="widget-url-{{widget.id}}"
|
||||||
[disabled]="isUpdating">
|
[disabled]="isUpdating">
|
||||||
</label>
|
</label>
|
||||||
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">Save
|
<button type="button" class="btn btn-primary btn-sm" (click)="validateAndSaveWidget(widget)">
|
||||||
|
Save
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
<button type="button" class="btn btn-outline btn-sm" (click)="toggleWidget(widget)">
|
||||||
Cancel
|
Cancel
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { ModalComponent, DialogRef } from "ngx-modialog";
|
import { DialogRef, ModalComponent } from "ngx-modialog";
|
||||||
import { WidgetComponent } from "../widget.component";
|
import { WidgetComponent } from "../widget.component";
|
||||||
import { ScalarService } from "../../../shared/scalar.service";
|
import { ScalarService } from "../../../shared/scalar.service";
|
||||||
import { ConfigModalContext } from "../../../integration/integration.component";
|
import { ConfigModalContext } from "../../../integration/integration.component";
|
||||||
import { ToasterService } from "angular2-toaster";
|
import { ToasterService } from "angular2-toaster";
|
||||||
import { Widget, WIDGET_SCALAR_YOUTUBE, WIDGET_DIM_YOUTUBE } from "../../../shared/models/widget";
|
import { Widget, WIDGET_DIM_YOUTUBE, WIDGET_SCALAR_YOUTUBE } from "../../../shared/models/widget";
|
||||||
import * as embed from "embed-video";
|
import * as embed from "embed-video";
|
||||||
import * as $ from "jquery";
|
import * as $ from "jquery";
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<button myToggleFullscreen="">
|
<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>
|
@ -16,6 +16,7 @@
|
|||||||
</pre>
|
</pre>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<p>Learn more on <a href="https://github.com/turt2live/matrix-dimension">Github</a>. Talk about it in <a href="https://matrix.to/#/#dimension:t2l.io">#dimension:t2l.io</a></p>
|
<p>Learn more on <a href="https://github.com/turt2live/matrix-dimension">Github</a>. Talk about it in <a
|
||||||
|
href="https://matrix.to/#/#dimension:t2l.io">#dimension:t2l.io</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -4,14 +4,17 @@
|
|||||||
<b>{{ integration.name }}</b>
|
<b>{{ integration.name }}</b>
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<div class="switch" *ngIf="integration.type !== 'bridge' && integration.type !== 'widget'">
|
<div class="switch" *ngIf="integration.type !== 'bridge' && integration.type !== 'widget'">
|
||||||
<ui-switch [checked]="integration.isEnabled" size="small" [disabled]="integration.isBroken" (change)="update()"></ui-switch>
|
<ui-switch [checked]="integration.isEnabled" size="small" [disabled]="integration.isBroken"
|
||||||
|
(change)="update()"></ui-switch>
|
||||||
</div>
|
</div>
|
||||||
<div class="switch" *ngIf="integration.type == 'bridge' && !integration.isEnabled">
|
<div class="switch" *ngIf="integration.type == 'bridge' && !integration.isEnabled">
|
||||||
<i class="fa fa-warning text-warning" ngbTooltip="{{ integration.bridgeError }}"></i>
|
<i class="fa fa-warning text-warning" ngbTooltip="{{ integration.bridgeError }}"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<i class="fa fa-question-circle text-info" ngbTooltip="{{integration.about}}" *ngIf="integration.about"></i>
|
<i class="fa fa-question-circle text-info" ngbTooltip="{{integration.about}}"
|
||||||
<i class="fa fa-cog text-info config-icon" (click)="configureIntegration()" *ngIf="integration.isEnabled && integration.hasConfig"></i>
|
*ngIf="integration.about"></i>
|
||||||
|
<i class="fa fa-cog text-info config-icon" (click)="configureIntegration()"
|
||||||
|
*ngIf="integration.isEnabled && integration.hasConfig"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, Input, Output, EventEmitter } from "@angular/core";
|
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
||||||
import { Integration } from "../shared/models/integration";
|
import { Integration } from "../shared/models/integration";
|
||||||
import { overlayConfigFactory } from "ngx-modialog";
|
import { overlayConfigFactory } from "ngx-modialog";
|
||||||
import { Modal, BSModalContext } from "ngx-modialog/plugins/bootstrap";
|
import { BSModalContext, Modal } from "ngx-modialog/plugins/bootstrap";
|
||||||
import { IntegrationService } from "../shared/integration.service";
|
import { IntegrationService } from "../shared/integration.service";
|
||||||
|
|
||||||
export class ConfigModalContext extends BSModalContext {
|
export class ConfigModalContext extends BSModalContext {
|
||||||
|
@ -6,7 +6,7 @@ import { ToasterService } from "angular2-toaster";
|
|||||||
import { Integration } from "../shared/models/integration";
|
import { Integration } from "../shared/models/integration";
|
||||||
import { IntegrationService } from "../shared/integration.service";
|
import { IntegrationService } from "../shared/integration.service";
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
import { WIDGET_DIM_CUSTOM, WIDGET_DIM_YOUTUBE, WIDGET_DIM_TWITCH, WIDGET_DIM_ETHERPAD } from "../shared/models/widget";
|
import { WIDGET_DIM_CUSTOM, WIDGET_DIM_ETHERPAD, WIDGET_DIM_TWITCH, WIDGET_DIM_YOUTUBE } from "../shared/models/widget";
|
||||||
import { IntegrationComponent } from "../integration/integration.component";
|
import { IntegrationComponent } from "../integration/integration.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -14,18 +14,18 @@ export interface Integration {
|
|||||||
|
|
||||||
export interface RSSIntegration extends Integration {
|
export interface RSSIntegration extends Integration {
|
||||||
feeds: string[];
|
feeds: string[];
|
||||||
immutableFeeds: {url: string, ownerId: string}[];
|
immutableFeeds: { url: string, ownerId: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TravisCiIntegration extends Integration {
|
export interface TravisCiIntegration extends Integration {
|
||||||
repoTemplates: {repoKey: string, template: string, newTemplate: string}[]; // newTemplate is local
|
repoTemplates: { repoKey: string, template: string, newTemplate: string }[]; // newTemplate is local
|
||||||
immutableRepoTemplates: {repoKey: string, template: string, ownerId: string}[];
|
immutableRepoTemplates: { repoKey: string, template: string, ownerId: string }[];
|
||||||
webhookUrl: string; // immutable
|
webhookUrl: string; // immutable
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IRCIntegration extends Integration {
|
export interface IRCIntegration extends Integration {
|
||||||
availableNetworks: {name: string, id: string}[];
|
availableNetworks: { name: string, id: string }[];
|
||||||
channels: {[networkId: string]: string[]};
|
channels: { [networkId: string]: string[] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EtherpadWidgetIntegration extends Integration {
|
export interface EtherpadWidgetIntegration extends Integration {
|
||||||
|
@ -11,11 +11,11 @@ export interface ScalarUserResponse extends ScalarRoomResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ScalarErrorResponse extends ScalarResponse {
|
export interface ScalarErrorResponse extends ScalarResponse {
|
||||||
response: {error: {message: string, _error: Error}};
|
response: { error: { message: string, _error: Error } };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ScalarSuccessResponse extends ScalarResponse {
|
export interface ScalarSuccessResponse extends ScalarResponse {
|
||||||
response: {success: boolean};
|
response: { success: boolean };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MembershipStateResponse extends ScalarUserResponse {
|
export interface MembershipStateResponse extends ScalarUserResponse {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
import * as randomString from "random-string";
|
import * as randomString from "random-string";
|
||||||
import {
|
import {
|
||||||
|
JoinRuleStateResponse,
|
||||||
MembershipStateResponse,
|
MembershipStateResponse,
|
||||||
ScalarSuccessResponse,
|
ScalarSuccessResponse,
|
||||||
JoinRuleStateResponse,
|
|
||||||
WidgetsResponse
|
WidgetsResponse
|
||||||
} from "./models/scalar_responses";
|
} from "./models/scalar_responses";
|
||||||
import { Widget } from "./models/widget";
|
import { Widget } from "./models/widget";
|
||||||
@ -11,9 +11,9 @@ import { Widget } from "./models/widget";
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ScalarService {
|
export class ScalarService {
|
||||||
|
|
||||||
private static actionMap: {[key: string]: {resolve: (obj: any) => void, reject: (obj: any) => void}} = {};
|
private static actionMap: { [key: string]: { resolve: (obj: any) => void, reject: (obj: any) => void } } = {};
|
||||||
|
|
||||||
public static getAndRemoveActionHandler(requestKey: string): {resolve: (obj: any) => void, reject: (obj: any) => void} {
|
public static getAndRemoveActionHandler(requestKey: string): { resolve: (obj: any) => void, reject: (obj: any) => void } {
|
||||||
let handler = ScalarService.actionMap[requestKey];
|
let handler = ScalarService.actionMap[requestKey];
|
||||||
ScalarService.actionMap[requestKey] = null;
|
ScalarService.actionMap[requestKey] = null;
|
||||||
return handler;
|
return handler;
|
||||||
|
@ -6,7 +6,8 @@ import * as screenfull from "screenfull";
|
|||||||
})
|
})
|
||||||
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();
|
||||||
|
Loading…
Reference in New Issue
Block a user