added poll-editor and scheduler components
This commit is contained in:
parent
b332955abf
commit
caaa301349
|
@ -68,6 +68,8 @@ import { TimeLeftPipe } from './pipes/time-left.pipe';
|
||||||
import { AutosuggestComponent } from './components/create-status/autosuggest/autosuggest.component';
|
import { AutosuggestComponent } from './components/create-status/autosuggest/autosuggest.component';
|
||||||
import { EmojiPickerComponent } from './components/create-status/emoji-picker/emoji-picker.component';
|
import { EmojiPickerComponent } from './components/create-status/emoji-picker/emoji-picker.component';
|
||||||
import { StatusUserContextMenuComponent } from './components/stream/status/action-bar/status-user-context-menu/status-user-context-menu.component';
|
import { StatusUserContextMenuComponent } from './components/stream/status/action-bar/status-user-context-menu/status-user-context-menu.component';
|
||||||
|
import { StatusSchedulerComponent } from './components/create-status/status-scheduler/status-scheduler.component';
|
||||||
|
import { PollEditorComponent } from './components/create-status/poll-editor/poll-editor.component';
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
@ -122,7 +124,9 @@ const routes: Routes = [
|
||||||
TimeLeftPipe,
|
TimeLeftPipe,
|
||||||
AutosuggestComponent,
|
AutosuggestComponent,
|
||||||
EmojiPickerComponent,
|
EmojiPickerComponent,
|
||||||
StatusUserContextMenuComponent
|
StatusUserContextMenuComponent,
|
||||||
|
StatusSchedulerComponent,
|
||||||
|
PollEditorComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
EmojiPickerComponent
|
EmojiPickerComponent
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
(suggestionSelectedEvent)="suggestionSelected($event)" (hasSuggestionsEvent)="suggestionsChanged($event)">
|
(suggestionSelectedEvent)="suggestionSelected($event)" (hasSuggestionsEvent)="suggestionsChanged($event)">
|
||||||
</app-autosuggest>
|
</app-autosuggest>
|
||||||
|
|
||||||
|
<app-poll-editor *ngIf="pollIsActive"></app-poll-editor>
|
||||||
|
|
||||||
|
<app-status-scheduler *ngIf="scheduleIsActive"></app-status-scheduler>
|
||||||
|
|
||||||
<div class="status-editor__footer" #footer>
|
<div class="status-editor__footer" #footer>
|
||||||
<button type="submit" title="reply" class="status-editor__footer--send-button" *ngIf="statusReplyingToWrapper">
|
<button type="submit" title="reply" class="status-editor__footer--send-button" *ngIf="statusReplyingToWrapper">
|
||||||
<span *ngIf="!isSending">REPLY!</span>
|
<span *ngIf="!isSending">REPLY!</span>
|
||||||
|
@ -47,6 +51,14 @@
|
||||||
<fa-icon [icon]="faLock" *ngIf="selectedPrivacy === 'Follows-only'"></fa-icon>
|
<fa-icon [icon]="faLock" *ngIf="selectedPrivacy === 'Follows-only'"></fa-icon>
|
||||||
<fa-icon [icon]="faEnvelope" *ngIf="selectedPrivacy === 'DM'"></fa-icon>
|
<fa-icon [icon]="faEnvelope" *ngIf="selectedPrivacy === 'DM'"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href class="status-editor__footer--link status-editor__footer--add-poll" title="add poll" (click)="addPoll()">
|
||||||
|
<fa-icon [icon]="faPollH"></fa-icon>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href class="status-editor__footer--link" title="schedule" (click)="schedule()">
|
||||||
|
<fa-icon [icon]="faClock"></fa-icon>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<context-menu #contextMenu>
|
<context-menu #contextMenu>
|
||||||
|
|
|
@ -128,6 +128,13 @@ $counter-width: 90px;
|
||||||
margin: 2px 0 0 5px;
|
margin: 2px 0 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--add-poll {
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
position: relative;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
&--send-button {
|
&--send-button {
|
||||||
@include clearButton;
|
@include clearButton;
|
||||||
transition: all .2s;
|
transition: all .2s;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { Store } from '@ngxs/store';
|
import { Store } from '@ngxs/store';
|
||||||
import { Subscription, Observable } from 'rxjs';
|
import { Subscription, Observable } from 'rxjs';
|
||||||
import { UP_ARROW, DOWN_ARROW, ENTER, ESCAPE } from '@angular/cdk/keycodes';
|
import { UP_ARROW, DOWN_ARROW, ENTER, ESCAPE } from '@angular/cdk/keycodes';
|
||||||
import { faPaperclip, faGlobe, faGlobeAmericas, faLock, faLockOpen, faEnvelope } from "@fortawesome/free-solid-svg-icons";
|
import { faPaperclip, faGlobe, faGlobeAmericas, faLock, faLockOpen, faEnvelope, faPollH } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faWindowClose as faWindowCloseRegular } from "@fortawesome/free-regular-svg-icons";
|
import { faClock, faWindowClose as faWindowCloseRegular } from "@fortawesome/free-regular-svg-icons";
|
||||||
import { ContextMenuService, ContextMenuComponent } from 'ngx-contextmenu';
|
import { ContextMenuService, ContextMenuComponent } from 'ngx-contextmenu';
|
||||||
|
|
||||||
import { MastodonService, VisibilityEnum } from '../../services/mastodon.service';
|
import { MastodonService, VisibilityEnum } from '../../services/mastodon.service';
|
||||||
|
@ -32,6 +32,8 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||||
faLock = faLock;
|
faLock = faLock;
|
||||||
faLockOpen = faLockOpen;
|
faLockOpen = faLockOpen;
|
||||||
faEnvelope = faEnvelope;
|
faEnvelope = faEnvelope;
|
||||||
|
faPollH = faPollH;
|
||||||
|
faClock = faClock;
|
||||||
|
|
||||||
autoSuggestUserActionsStream = new EventEmitter<AutosuggestUserActionEnum>();
|
autoSuggestUserActionsStream = new EventEmitter<AutosuggestUserActionEnum>();
|
||||||
|
|
||||||
|
@ -705,4 +707,16 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||||
this.overlayRef.dispose();
|
this.overlayRef.dispose();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pollIsActive: boolean;
|
||||||
|
addPoll(): boolean {
|
||||||
|
this.pollIsActive = !this.pollIsActive;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduleIsActive: boolean;
|
||||||
|
schedule(): boolean {
|
||||||
|
this.scheduleIsActive = !this.scheduleIsActive;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<p>
|
||||||
|
poll-editor works!
|
||||||
|
</p>
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PollEditorComponent } from './poll-editor.component';
|
||||||
|
|
||||||
|
describe('PollEditorComponent', () => {
|
||||||
|
let component: PollEditorComponent;
|
||||||
|
let fixture: ComponentFixture<PollEditorComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ PollEditorComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PollEditorComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-poll-editor',
|
||||||
|
templateUrl: './poll-editor.component.html',
|
||||||
|
styleUrls: ['./poll-editor.component.scss']
|
||||||
|
})
|
||||||
|
export class PollEditorComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
<p>
|
||||||
|
status-scheduler works!
|
||||||
|
</p>
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { StatusSchedulerComponent } from './status-scheduler.component';
|
||||||
|
|
||||||
|
describe('StatusSchedulerComponent', () => {
|
||||||
|
let component: StatusSchedulerComponent;
|
||||||
|
let fixture: ComponentFixture<StatusSchedulerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ StatusSchedulerComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(StatusSchedulerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-status-scheduler',
|
||||||
|
templateUrl: './status-scheduler.component.html',
|
||||||
|
styleUrls: ['./status-scheduler.component.scss']
|
||||||
|
})
|
||||||
|
export class StatusSchedulerComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue