Skip to content

Commit

Permalink
Merge pull request #103 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
0.9.0 PR
  • Loading branch information
NicolasConstant authored May 25, 2019
2 parents 41c7137 + 0418ee6 commit 3dffcda
Show file tree
Hide file tree
Showing 35 changed files with 875 additions and 107 deletions.
72 changes: 59 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,43 @@ <h1 class="header__download-box--title">Discover Sengi</h1>

<div class="header__download-box--description">
A FLOSS multi-account Mastodon and Pleroma desktop client<br />
Now available in Beta (v0.8.0)<br />
Now available in Beta <span id="sengi-version"></span> <br />
<br />
</div>

<div class="header__download-box--buttons">
<p>
<h4 class="header__download-box--subtitle">Try it in your browser!</h4>
<a href="#" class="download-button download-button__web" title="what are you waiting for? click!"
<a href="#" class="download-button download-button__web"
title="what are you waiting for? click!"
onClick="window.open('http://sengi.nicolas-constant.com'+'?qt='+ (new Date()).getTime(),'Sengi','toolbar=no,location=no,status=no,menubar=no,scrollbars=no, resizable=yes,width=377,height=800'); return false;"
class="button"><i class="fas fa-globe"></i><span
class="download-button__web--label">launch!</span></a><br />
class="button"><i class="fas fa-globe"></i><span class="download-button__web--label">launch!</span></a><br />
<br />
<br />

<h4 class="header__download-box--subtitle">Or download the desktop client:</h4>
<a href="https://github.com/NicolasConstant/sengi/releases/download/0.8.0/Sengi-0.8.0-win.exe" class="download-button" title="download client for windows"><i class="fab fa-windows"></i></a>
<a href="https://github.com/NicolasConstant/sengi/releases/download/0.8.0/Sengi-0.8.0-mac.dmg" class="download-button" title="download client for mac"><i class="fab fa-apple"></i></a>
<a href="https://github.com/NicolasConstant/sengi/releases/download/0.8.0/Sengi-0.8.0-linux.deb" class="download-button" title="download client for debian-based distrib"><i class="fab fa-ubuntu"></i></a>
<a href="https://snapcraft.io/sengi" title="use Snap Store for linux"><img src="images/snap-store-white.png" /></a>
<div id="download-buttons" style="display: none;">
<a id="windows" href class="download-button" title="download client for windows">
<i class="fab fa-windows"></i>
</a>
<a id="mac" href class="download-button" title="download client for mac">
<i class="fab fa-apple"></i>
</a>
<a id="linux" href class="download-button" title="download client for debian-based distrib">
<i class="fab fa-ubuntu"></i>
</a>
<a href="https://snapcraft.io/sengi" title="use Snap Store for linux">
<img src="images/snap-store-white.png" />
</a>
</div>
<div id="download-buttons-nojs">
<a href="https://github.com/NicolasConstant/sengi/releases/"
class="download-button" title="latest releases">
<i class="fab fa-github"></i></a>
<a href="https://snapcraft.io/sengi" title="use Snap Store for linux">
<img src="images/snap-store-white.png" />
</a>
</div>
</p>
</div>

Expand All @@ -71,13 +89,41 @@ <h4 class="header__download-box--subtitle">Or download the desktop client:</h4>
</section>
</main>
<footer class="footer">
<h3 class="footer__title">Let's keep in touch!</h3>
<h3 class="footer__title">Let's keep in touch!</h3>

<div class="footer__buttons">
<a href="https://mastodon.social/@sengi_app" rel="me" class="footer__buttons--button" title="open pleroma-compatible account"><i class="fab fa-mastodon"></i></a>
<a href="https://github.com/NicolasConstant/sengi" class="footer__buttons--button" title="open microsoft github repository"><i class="fab fa-github"></i></a>
<a href="https://mastodon.social/@sengi_app" rel="me" class="footer__buttons--button"
title="open pleroma-compatible account"><i class="fab fa-mastodon"></i></a>
<a href="https://github.com/NicolasConstant/sengi" class="footer__buttons--button"
title="open microsoft github repository"><i class="fab fa-github"></i></a>
</div>
</footer>
</body>

</html>

<script type="text/javascript" language="javascript">
const getLastRelease = async () => {
const response = await fetch('https://api.github.com/repos/NicolasConstant/sengi/releases/latest');
const myJson = await response.json();
return myJson;
}

document.addEventListener('DOMContentLoaded', async function () {
let lastRelease = await getLastRelease();
let version = lastRelease.tag_name;

var downloadButtons = document.getElementById('download-buttons');
downloadButtons.style.display = 'block';

var downloadButtonsNojs = document.getElementById('download-buttons-nojs');
downloadButtonsNojs.style.display = 'none';

var sengiVersion = document.getElementById('sengi-version');
sengiVersion.textContent = `(${version})`;

document.getElementById('windows').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-win.exe`;
document.getElementById('mac').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-mac.dmg`;
document.getElementById('linux').href = `https://github.com/NicolasConstant/sengi/releases/download/${version}/Sengi-${version}-linux.deb`;
}, false);
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sengi",
"version": "0.8.0",
"version": "0.9.0",
"license": "AGPL-3.0-or-later",
"main": "main-electron.js",
"description": "A multi-account desktop client for Mastodon and Pleroma",
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import { NotificationsComponent } from './components/floating-column/manage-acco
import { SettingsState } from './states/settings.state';
import { AccountEmojiPipe } from './pipes/account-emoji.pipe';
import { CardComponent } from './components/stream/status/card/card.component';
import { ListEditorComponent } from './components/floating-column/manage-account/my-account/list-editor/list-editor.component';
import { ListAccountComponent } from './components/floating-column/manage-account/my-account/list-editor/list-account/list-account.component';

const routes: Routes = [
{ path: "", redirectTo: "home", pathMatch: "full" },
Expand Down Expand Up @@ -104,7 +106,9 @@ const routes: Routes = [
MentionsComponent,
NotificationsComponent,
AccountEmojiPipe,
CardComponent
CardComponent,
ListEditorComponent,
ListAccountComponent
],
imports: [
FontAwesomeModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class DirectMessagesComponent implements OnInit {

@Input('account')
set account(acc: AccountWrapper) {
console.warn('account');
this._account = acc;
this.getDirectMessages();
}
Expand Down
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>
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;
}
}
}
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();
});
});
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;
}
}
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>
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;
}
}
}
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();
});
});
Loading

0 comments on commit 3dffcda

Please sign in to comment.