-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from FrogTheFrog/v2.0.0
V2.0.0
- Loading branch information
Showing
64 changed files
with
2,800 additions
and
1,520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
dist/ | ||
src/renderer/styles/oldThemes/ | ||
release/ | ||
npm-debug.log* | ||
.debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM electronuserland/electron-builder:base | ||
WORKDIR /app | ||
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - && apt-get install -y nodejs && curl -L https://npmjs.org/install.sh | sh && npm cache clean && npm config set unsafe-perm true && npm completion >> ~/.bashrc && apt-get clean && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,43 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, OnDestroy } from '@angular/core'; | ||
import { SettingsService } from "../services"; | ||
import { Router } from "@angular/router"; | ||
import { Subscription } from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'app', | ||
template: ` | ||
<titlebar></titlebar> | ||
<section> | ||
<nav></nav> | ||
<router-outlet></router-outlet> | ||
</section> | ||
<theme></theme> | ||
<alert></alert> | ||
<ng-container *ngIf="setttingsLoaded; else stillLoading"> | ||
<titlebar></titlebar> | ||
<section> | ||
<nav></nav> | ||
<router-outlet></router-outlet> | ||
</section> | ||
<theme></theme> | ||
<alert></alert> | ||
</ng-container> | ||
<ng-template #stillLoading> | ||
<div class="appLoading loadingSettings"></div> | ||
</ng-template> | ||
`, | ||
styleUrls: ['../styles/app.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class AppComponent { } | ||
export class AppComponent implements OnDestroy { | ||
private setttingsLoaded: boolean = false; | ||
private subscriptions: Subscription = new Subscription(); | ||
|
||
constructor(private settingsService: SettingsService, private router: Router, private changeDetectionRef: ChangeDetectorRef) { | ||
this.subscriptions.add(this.settingsService.getLoadStatusObservable().subscribe((loaded) => { | ||
if (loaded) { | ||
this.setttingsLoaded = loaded; | ||
this.router.initialNavigation(); | ||
this.changeDetectionRef.detectChanges(); | ||
this.subscriptions.unsubscribe(); | ||
} | ||
})); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.subscriptions.unsubscribe(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { Component, forwardRef, ElementRef, ViewChildren, QueryList, Input, EventEmitter, Output } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'ng-toggle-button', | ||
template: ` | ||
<div *ngIf="!contentOnLeft" class="button" style="margin-right: 0.25em;"> | ||
<svg [class.active]="currentValue" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 220 100"> | ||
<path (click)="writeValue(!currentValue)" d="M60 10 c -60 0, -60 80, 0 80 h 100 c 60 0, 60 -80, 0 -80 h -100" stroke-width="3" /> | ||
<circle id="shape" (click)="writeValue(!currentValue)" [attr.cx]="(currentValue ? 165: 55)" cy="50" r="43" stroke-width="2"> | ||
<animate #animation begin="indefinite" attributeName="cx" dur="150ms" [attr.from]="(currentValue ? 55: 165)" [attr.to]="(currentValue ? 165: 55)" /> | ||
</circle> | ||
</svg> | ||
</div> | ||
<div class="content"> | ||
<ng-content></ng-content> | ||
</div> | ||
<div *ngIf="contentOnLeft" class="button" style="margin-left: 0.25em;"> | ||
<svg [class.active]="currentValue" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 220 100"> | ||
<path (click)="writeValue(!currentValue)" d="M60 10 c -60 0, -60 80, 0 80 h 100 c 60 0, 60 -80, 0 -80 h -100" stroke-width="3" /> | ||
<circle id="shape" (click)="writeValue(!currentValue)" [attr.cx]="(currentValue ? 165: 55)" cy="50" r="43" stroke-width="2"> | ||
<animate #animation begin="indefinite" attributeName="cx" dur="150ms" [attr.from]="(currentValue ? 55: 165)" [attr.to]="(currentValue ? 165: 55)" /> | ||
</circle> | ||
</svg> | ||
</div> | ||
`, | ||
styleUrls: [ | ||
'../styles/ng-toggle-button.component.scss' | ||
], | ||
providers: [{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => ToggleButtonComponent), | ||
multi: true | ||
}] | ||
}) | ||
export class ToggleButtonComponent implements ControlValueAccessor { | ||
@Input('contentOnLeft') private contentOnLeft: boolean; | ||
@ViewChildren('animation', { read: ElementRef }) private animation: QueryList<ElementRef>; | ||
@Output() private change = new EventEmitter(); | ||
@Output() private touched = new EventEmitter(); | ||
private onTouchedNgModel: () => void = () => {}; | ||
private onChangeNgModel: (_: any) => void = () => {}; | ||
private currentValue: any = false; | ||
|
||
constructor(private element: ElementRef) { } | ||
|
||
@Input() | ||
set value(value: any) { | ||
let oldValue = this.currentValue; | ||
this.currentValue = !!value; | ||
|
||
if (value !== oldValue){ | ||
this.change.emit(value); | ||
this.onChangeNgModel(value); | ||
if (this.animation && this.animation.first){ | ||
this.animation.first.nativeElement.beginElement(); | ||
} | ||
} | ||
|
||
this.touched.emit(); | ||
this.onTouchedNgModel(); | ||
} | ||
|
||
get value() { | ||
return this.currentValue; | ||
} | ||
|
||
writeValue(value: any): void { | ||
this.value = value; | ||
} | ||
|
||
registerOnChange(fn: (value: any) => any): void { | ||
this.onChangeNgModel = fn; | ||
} | ||
|
||
registerOnTouched(fn: () => any): void { | ||
this.onTouchedNgModel = fn; | ||
} | ||
} |
12 changes: 4 additions & 8 deletions
12
...enderer/components/ng-button.component.ts → src/renderer/components/ng-var.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.