From 46adf207bb8038034fbec095260e761db21b3a1e Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Wed, 6 Mar 2024 23:13:46 -0500 Subject: [PATCH 1/5] flex migration floating column + hover timeline --- .../floating-column.component.html | 2 +- .../floating-column.component.scss | 13 ++++- .../stream-overlay.component.html | 14 ++--- .../stream-overlay.component.scss | 56 ++++++++++--------- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/src/app/components/floating-column/floating-column.component.html b/src/app/components/floating-column/floating-column.component.html index 4c697f53..507e96ff 100644 --- a/src/app/components/floating-column/floating-column.component.html +++ b/src/app/components/floating-column/floating-column.component.html @@ -10,7 +10,7 @@
diff --git a/src/app/components/floating-column/floating-column.component.scss b/src/app/components/floating-column/floating-column.component.scss index efe59b60..82a6a6a2 100644 --- a/src/app/components/floating-column/floating-column.component.scss +++ b/src/app/components/floating-column/floating-column.component.scss @@ -29,9 +29,20 @@ } .close-button { + // outline: 1px dotted orange; + display: block; float: right; font-size: 14px; color: white; - margin: 10px 16px 0 0; + margin: 5px 5px 0 0; + + width: 40px; + height: 34px; + + &__icon { + position: relative; + top: 6px; + left: 17px; + } } \ No newline at end of file diff --git a/src/app/components/stream/stream-overlay/stream-overlay.component.html b/src/app/components/stream/stream-overlay/stream-overlay.component.html index 0ced8ea6..42f9e0fb 100644 --- a/src/app/components/stream/stream-overlay/stream-overlay.component.html +++ b/src/app/components/stream/stream-overlay/stream-overlay.component.html @@ -1,9 +1,5 @@
diff --git a/src/app/components/stream/stream-overlay/stream-overlay.component.scss b/src/app/components/stream/stream-overlay/stream-overlay.component.scss index 84cb7962..a33eb851 100644 --- a/src/app/components/stream/stream-overlay/stream-overlay.component.scss +++ b/src/app/components/stream/stream-overlay/stream-overlay.component.scss @@ -11,7 +11,9 @@ $header-content-height: 40px; width: calc(100%); height: $header-content-height; background-color: $column-header-background-color; - border-bottom: 1px solid #222736; + border-bottom: 1px solid #222736; + + display: flex; } &__content-wrapper { transition: all .2s; @@ -44,11 +46,17 @@ $header-content-height: 40px; } &__button { + // outline: 1px dotted orange; + width: 25px; height: 25px; + + width: $header-content-height; + height: $header-content-height; + color: #354060; transition: all .2s; - margin: 8px 0 0 8px; + &:hover { color: #536599; color: #7a8dc7; @@ -68,19 +76,8 @@ $header-content-height: 40px; &__icon { position: relative; - left: 7px; - top: -1px - } - } - &-next { - display: block; - float: left; - font-size: 18px; - - &__icon { - position: relative; - left: 8px; - top: -1px + left: 17px; + top: 7px } } &-refresh { @@ -90,29 +87,38 @@ $header-content-height: 40px; &__icon { position: relative; - left: 5px; - top: 1px + left: 13px; + top: 9px + } + } + &-next { + display: block; + float: left; + font-size: 18px; + + &__icon { + position: relative; + left: 13px; + top: 7px } } &-gototop { - position: absolute; - top: 0; - left: 110px; - right: 40px; + // outline: 1px dotted orange; + + flex-grow: 1; + display: block; height: $header-content-height; } &-close { display: block; - float: right; font-size: 13px; color: white; - margin-right: 8px; &__icon { position: relative; - left: 7px; - top: 1px + left: 15px; + top: 9px } } } From 1830212a917045c0fa44e7d3ad2740c5524e4546 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 7 Mar 2024 00:24:27 -0500 Subject: [PATCH 2/5] flex migration of account navigation --- .../user-profile/user-profile.component.html | 24 +++++-------------- .../user-profile/user-profile.component.scss | 23 +++++++++--------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/app/components/stream/user-profile/user-profile.component.html b/src/app/components/stream/user-profile/user-profile.component.html index 50c69c55..e9061ef8 100644 --- a/src/app/components/stream/user-profile/user-profile.component.html +++ b/src/app/components/stream/user-profile/user-profile.component.html @@ -166,39 +166,27 @@
-
- Status -
- -
- Media -
-
- Status -
- -
- Media -
diff --git a/src/app/components/stream/user-profile/user-profile.component.scss b/src/app/components/stream/user-profile/user-profile.component.scss index cab3bebb..d67cf410 100644 --- a/src/app/components/stream/user-profile/user-profile.component.scss +++ b/src/app/components/stream/user-profile/user-profile.component.scss @@ -275,14 +275,15 @@ $floating-header-height: 60px; &-follows { width: calc(100%); font-size: 13px; - border-bottom: 1px solid #0f111a;; + border-bottom: 1px solid #0f111a; + + display: flex; &__link { color: white; - width: calc(50%); + flex-grow: 1; padding: 5px; text-align: center; - display: inline-block; background-color: #1a1f2e; transition: all .2s; @@ -311,15 +312,15 @@ $floating-header-height: 60px; font-size: 13px; transition: all .4s; - &__section { - text-align: center; - display: inline-block; - width: calc(33.333% - 5px); - padding: 5px 0 7px 0; + display: flex; - &:not(:last-child) { - margin-right: 5px; - } + &__section { + // outline: 1px dotted orange; + + flex-grow: 1; + + text-align: center; + padding: 5px 0 7px 0; } &__preparefloating { From c0f84ddc11fbb4b43ef6f561b98e6c64e5bbc012 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 7 Mar 2024 00:59:00 -0500 Subject: [PATCH 3/5] open status from image galery, fix #627 --- .../attachement-image.component.html | 3 +++ .../attachement-image.component.scss | 20 +++++++++++++++++++ .../attachement-image.component.ts | 16 ++++++++++++++- .../user-profile/user-profile.component.html | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html index 957bb122..72ccc2ac 100644 --- a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html +++ b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html @@ -1,5 +1,8 @@
ALT
+ + + diff --git a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.scss b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.scss index 44a95067..267d24e5 100644 --- a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.scss +++ b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.scss @@ -25,11 +25,31 @@ // } } + &__status { + z-index: 10; + position: absolute; + top: 0; + right: 25px; + padding: 5px 5px 8px 8px; + transition: all .2s; + opacity: 0; + color: white; + + &--icon { + filter: drop-shadow(0 0 3px rgb(78, 78, 78)); + } + } + &:hover &__link { opacity: 1; cursor: pointer; } + &:hover &__status { + opacity: 1; + cursor: pointer; + } + &__alt { display: inline; color: white; diff --git a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.ts b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.ts index 2568f66b..b584be61 100644 --- a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.ts +++ b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.ts @@ -1,8 +1,10 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { faLink } from "@fortawesome/free-solid-svg-icons"; +import { faLink, faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons"; import { SettingsService } from '../../../../../services/settings.service'; import { Attachment } from '../../../../../services/models/mastodon.interfaces'; +import { StatusWrapper } from '../../../../../models/common.model'; +import { OpenThreadEvent } from '../../../../../services/tools.service'; @Component({ selector: 'app-attachement-image', @@ -11,10 +13,13 @@ import { Attachment } from '../../../../../services/models/mastodon.interfaces'; }) export class AttachementImageComponent implements OnInit { faLink = faLink; + faExternalLinkAlt = faExternalLinkAlt; displayAltLabel: boolean; @Input() attachment: Attachment; + @Input() status: StatusWrapper; @Output() openEvent = new EventEmitter(); + @Output() browseThreadEvent = new EventEmitter(); constructor( private readonly settingsService: SettingsService @@ -34,4 +39,13 @@ export class AttachementImageComponent implements OnInit { window.open(this.attachment.url, '_blank'); return false; } + + openStatus(): boolean { + if(!this.status) return false; + + const openThreadEvent = new OpenThreadEvent(this.status.status, this.status.provider); + this.browseThreadEvent.next(openThreadEvent); + + return false; + } } diff --git a/src/app/components/stream/user-profile/user-profile.component.html b/src/app/components/stream/user-profile/user-profile.component.html index e9061ef8..c6111381 100644 --- a/src/app/components/stream/user-profile/user-profile.component.html +++ b/src/app/components/stream/user-profile/user-profile.component.html @@ -210,7 +210,7 @@
- +
From c4de387f86bd84f788cce24c005e79e8473c29a7 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 7 Mar 2024 01:17:04 -0500 Subject: [PATCH 4/5] sort list in alphabetical order, fix #633 --- .../manage-account/my-account/my-account.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/components/floating-column/manage-account/my-account/my-account.component.ts b/src/app/components/floating-column/manage-account/my-account/my-account.component.ts index 58710d92..0819fc95 100644 --- a/src/app/components/floating-column/manage-account/my-account/my-account.component.ts +++ b/src/app/components/floating-column/manage-account/my-account/my-account.component.ts @@ -122,6 +122,17 @@ export class MyAccountComponent implements OnInit, OnDestroy { } } }) + .then(_ => { + this.availableLists.sort((a,b) => { + if (a.name < b.name) { + return -1; + } + if (a.name > b.name) { + return 1; + } + return 0; + }); + }) .catch(err => { this.notificationService.notifyHttpError(err, this.account.info); }); From d2221d539c9d183390678af7d02c63d525a3970e Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Thu, 7 Mar 2024 18:23:26 -0500 Subject: [PATCH 5/5] fix undefined image description, fix #632 --- .../attachement-image/attachement-image.component.html | 2 +- src/app/services/mastodon.service.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html index 72ccc2ac..08481752 100644 --- a/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html +++ b/src/app/components/stream/status/attachements/attachement-image/attachement-image.component.html @@ -1,5 +1,5 @@
-
ALT
+
ALT
diff --git a/src/app/services/mastodon.service.ts b/src/app/services/mastodon.service.ts index cc69ce0f..418a316d 100644 --- a/src/app/services/mastodon.service.ts +++ b/src/app/services/mastodon.service.ts @@ -398,11 +398,13 @@ export class MastodonService { uploadMediaAttachment(account: AccountInfo, file: File, description: string): Promise { let input = new FormData(); input.append('file', file); + if (description !== null && description !== undefined) { input.append('description', description); } else { input.append('description', ''); } + const route = `https://${account.instance}${this.apiRoutes.uploadMediaAttachment}`; const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` }); return this.httpClient.post(route, input, { headers: headers }).toPromise(); @@ -411,7 +413,13 @@ export class MastodonService { //TODO: add focus support updateMediaAttachment(account: AccountInfo, mediaId: string, description: string): Promise { let input = new FormData(); - input.append('description', description); + + if (description !== null && description !== undefined) { + input.append('description', description); + } else { + input.append('description', ''); + } + const route = `https://${account.instance}${this.apiRoutes.updateMediaAttachment.replace('{0}', mediaId)}`; const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` }); return this.httpClient.put(route, input, { headers: headers }).toPromise();