-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 #103 from NicolasConstant/develop
0.9.0 PR
- Loading branch information
Showing
35 changed files
with
875 additions
and
107 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
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
21 changes: 21 additions & 0 deletions
21
...ing-column/manage-account/my-account/list-editor/list-account/list-account.component.html
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,21 @@ | ||
<div class="list-account"> | ||
<div class="list-account__action"> | ||
<a href class="list-account__action--button list-account__action--button--add" title="add account to list" | ||
*ngIf="!accountWrapper.isInList" (click)="add()"> | ||
<fa-icon [icon]="faPlus"></fa-icon> | ||
</a> | ||
|
||
<a href class="list-account__action--button list-account__action--button--remove" title="remove account from list" | ||
*ngIf="accountWrapper.isInList" (click)="remove()"> | ||
<fa-icon [icon]="faTimes"></fa-icon> | ||
</a> | ||
|
||
</div> | ||
<div class="list-account__account"> | ||
<img src="{{ accountWrapper.account.avatar }}" alt="" class="list-account__account--avatar"> | ||
|
||
<span class="list-account__account--display-name" title="{{ accountWrapper.account.display_name }}" innerHTML="{{ accountWrapper.account | accountEmoji }}"></span> | ||
<span class="list-account__account--acct" title="{{ accountWrapper.account.acct }}">{{ accountWrapper.account.acct }}</span> | ||
</div> | ||
|
||
</div> |
82 changes: 82 additions & 0 deletions
82
...ing-column/manage-account/my-account/list-editor/list-account/list-account.component.scss
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,82 @@ | ||
@import "variables"; | ||
|
||
.list-account { | ||
transition: all .2s; | ||
$actin-width: 50px; | ||
|
||
&__action { | ||
float: right; | ||
width: $actin-width; | ||
position: relative; | ||
|
||
&--button { | ||
position: absolute; | ||
top: 4px; | ||
right: 12px; | ||
color: #fff; | ||
font-size: 14px; | ||
padding: 10px; | ||
// outline: 1px solid greenyellow; | ||
|
||
&:hover{ | ||
color: darken(#fff, 20); | ||
} | ||
|
||
// $add-color: rgb(167, 220, 255); | ||
// $remove-color: rgb(255, 154, 196); | ||
// &--add { | ||
// color: $add-color; | ||
// &:hover{ | ||
// color: darken($add-color, 20); | ||
// } | ||
// } | ||
|
||
&--remove { | ||
color: $font-link-primary; | ||
&:hover{ | ||
color: lighten($font-link-primary, 40); | ||
} | ||
} | ||
} | ||
} | ||
|
||
&__account { | ||
width: calc(100% - #{ $actin-width }); | ||
position: relative; | ||
height: 50px; | ||
|
||
|
||
&--avatar { | ||
position: absolute; | ||
top: 5px; | ||
left: 5px; | ||
width: 40px; | ||
height: 40px; | ||
} | ||
|
||
$max-name-width: 190px; | ||
&--display-name { | ||
position: absolute; | ||
top: 8px; | ||
left: 60px; | ||
color: white; | ||
|
||
max-width: $max-name-width; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
|
||
&--acct { | ||
position: absolute; | ||
top: 26px; | ||
left: 60px; | ||
color: $status-secondary-color; | ||
|
||
max-width: $max-name-width; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...-column/manage-account/my-account/list-editor/list-account/list-account.component.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ListAccountComponent } from './list-account.component'; | ||
|
||
xdescribe('ListAccountComponent', () => { | ||
let component: ListAccountComponent; | ||
let fixture: ComponentFixture<ListAccountComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ListAccountComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ListAccountComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
...ating-column/manage-account/my-account/list-editor/list-account/list-account.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
import { faTimes, faPlus } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
import { Account } from "../../../../../../services/models/mastodon.interfaces"; | ||
import { AccountListWrapper } from '../list-editor.component'; | ||
import { isUndefined } from 'util'; | ||
|
||
@Component({ | ||
selector: 'app-list-account', | ||
templateUrl: './list-account.component.html', | ||
styleUrls: ['./list-account.component.scss'] | ||
}) | ||
export class ListAccountComponent implements OnInit { | ||
faTimes = faTimes; | ||
faPlus = faPlus; | ||
|
||
@Input() accountWrapper: AccountListWrapper; | ||
@Output() addEvent = new EventEmitter<AccountListWrapper>(); | ||
@Output() removeEvent = new EventEmitter<AccountListWrapper>(); | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
add(): boolean { | ||
if(this.accountWrapper && this.accountWrapper.isLoading) return; | ||
this.addEvent.emit(this.accountWrapper); | ||
return false; | ||
} | ||
|
||
remove(): boolean { | ||
if(this.accountWrapper && this.accountWrapper.isLoading) return; | ||
this.removeEvent.emit(this.accountWrapper); | ||
return false; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...mponents/floating-column/manage-account/my-account/list-editor/list-editor.component.html
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,17 @@ | ||
<div class="list-editor"> | ||
<a href class="list-editor__close-search" title="close search" *ngIf="searchOpen" (click)="closeSearch()"> | ||
<fa-icon [icon]="faTimes"></fa-icon> | ||
</a> | ||
<input class="list-editor__search" placeholder="search account" [(ngModel)]="searchPattern" | ||
(keyup.enter)="search()" /> | ||
<div class="list-editor__list flexcroll" *ngIf="!searchOpen"> | ||
<app-list-account class="list-editor__account" *ngFor="let account of accountsInList" | ||
[accountWrapper]="account" (addEvent)="addEvent($event)" (removeEvent)="removeEvent($event)"> | ||
</app-list-account> | ||
</div> | ||
<div class="list-editor__list flexcroll" *ngIf="searchOpen"> | ||
<app-list-account class="list-editor__account" *ngFor="let account of accountsSearch" | ||
[accountWrapper]="account" (addEvent)="addEvent($event)" (removeEvent)="removeEvent($event)"> | ||
</app-list-account> | ||
</div> | ||
</div> |
46 changes: 46 additions & 0 deletions
46
...mponents/floating-column/manage-account/my-account/list-editor/list-editor.component.scss
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,46 @@ | ||
@import "variables"; | ||
@import "commons"; | ||
|
||
.list-editor { | ||
background-color: $color-primary; | ||
min-height: 20px; | ||
margin-top: 1px; | ||
position: relative; | ||
|
||
&__search { | ||
color: #fff; | ||
background-color: darken($color-primary, 4); | ||
border: 2px solid $color-primary; | ||
width: calc(100%); | ||
padding: 3px 5px; | ||
|
||
&:focus { | ||
outline: none !important; | ||
box-shadow: none; | ||
} | ||
} | ||
|
||
&__close-search { | ||
position: absolute; | ||
top: 0px; | ||
right: 5px; | ||
color: white; | ||
padding: 5px; | ||
&:hover { | ||
color: rgb(160, 160, 160); | ||
} | ||
} | ||
|
||
&__list { | ||
max-height: 300px; | ||
overflow-y: auto; | ||
border-top: 1px solid #000; | ||
} | ||
|
||
&__account { | ||
display: block; | ||
&:not(:last-child){ | ||
border-bottom: 1px solid #000; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...nents/floating-column/manage-account/my-account/list-editor/list-editor.component.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ListEditorComponent } from './list-editor.component'; | ||
|
||
xdescribe('ListEditorComponent', () => { | ||
let component: ListEditorComponent; | ||
let fixture: ComponentFixture<ListEditorComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ListEditorComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ListEditorComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.