Skip to content
Commits on Source (1)
import {
AfterViewInit,
ChangeDetectorRef,
ContentChild,
Directive,
ElementRef,
ContentChild,
ChangeDetectorRef,
Input,
} from '@angular/core';
import { ReadMoreButtonComponent } from './button.component';
......@@ -10,7 +11,7 @@ import { ReadMoreButtonComponent } from './button.component';
@Directive({
selector: '[m-read-more]',
})
export class ReadMoreDirective {
export class ReadMoreDirective implements AfterViewInit {
_element: any;
realHeight: any;
expandable: boolean = false;
......@@ -27,7 +28,7 @@ export class ReadMoreDirective {
}
setTimeout(() => {
this.realHeight = this._element.clientHeight;
this.realHeight = this._element.scrollHeight;
if (this.button && !this.button.content) {
this.button.content = this;
}
......
......@@ -51,28 +51,6 @@
i18n="@@M__COMMON__EDITED"
>edited</span
>
<div
class="mdl-card__supporting-text is-boosted"
*ngIf="boosted"
[class.is-onchain]="activity.boosted_onchain"
>
<i class="material-icons">trending_up</i>
<a
i18n="@@MINDS__CARDS__ACTIVITY__BOOSTED_LABEL"
[hidden]="activity.boosted_onchain"
>Boosted</a
>
<a
i18n="@@MINDS__CARDS__ACTIVITY__BOOSTED_LABEL_ONCHAIN"
[hidden]="!activity.boosted_onchain"
[routerLink]="['/token']"
>Boosted Onchain</a
>
</div>
<div class="mdl-card__supporting-text is-boosted" *ngIf="isUnlisted()">
<i class="material-icons unlisted">visibility_off</i>
<a i18n>Unlisted</a>
</div>
</a>
<a
[routerLink]="['/newsfeed/', activity.entity_guid]"
......@@ -320,7 +298,11 @@
</a>
<!-- [innerHtml]="activity.message | tags"
-->
<!-- [modelToWatch]="activity.message"-->
<span
[fittext]="true"
[minFontSize]="16"
[maxFontSize]="20"
class="m-mature-message-content"
[ngClass]="{ 'm-mature-text': attachment.shouldBeBlurred(activity) }"
(click)="
......@@ -497,32 +479,50 @@
<ng-content select="[bottom-content]"></ng-content>
<!-- Action buttons -->
<div class="tabs" *ngIf="!hideTabs && !isPending(activity)">
<!--<div class="tabs" *ngIf="!hideTabs && !isPending(activity)">-->
<!-- <minds-button-thumbs-up [object]="activity"></minds-button-thumbs-up>-->
<!-- <minds-button-thumbs-down [object]="activity"></minds-button-thumbs-down>-->
<!-- <m-wire-button-->
<!-- *ngIf="session.getLoggedInUser().guid != activity.owner_guid"-->
<!-- [object]="activity"-->
<!-- (done)="wireSubmitted($event)"-->
<!-- ></m-wire-button>-->
<!-- <button-->
<!-- class="m-btn m-btn&#45;&#45;action m-btn&#45;&#45;slim minds-boost-button"-->
<!-- *ngIf="-->
<!-- session.getLoggedInUser().guid == activity.owner_guid &&-->
<!-- !isScheduled(activity.time_created)-->
<!-- "-->
<!-- id="boost-actions"-->
<!-- (click)="showBoost()"-->
<!-- >-->
<!-- <span i18n="verb|@@M__ACTION__BOOST">Boost</span>-->
<!-- </button>-->
<!-- <minds-button-comment-->
<!-- [object]="activity"-->
<!-- (click)="openComments()"-->
<!-- ></minds-button-comment>-->
<!-- <minds-button-remind [object]="activity"></minds-button-remind>-->
<!--</div>-->
<!-- action bar and comments -->
<div class="m-activity__actionButtons">
<minds-button-thumbs-up [object]="activity"></minds-button-thumbs-up>
<minds-button-thumbs-down [object]="activity"></minds-button-thumbs-down>
<m-wire-button
<minds-button-remind [object]="activity"></minds-button-remind>
<div
class="m-activity__pay"
*ngIf="session.getLoggedInUser().guid != activity.owner_guid"
[object]="activity"
(done)="wireSubmitted($event)"
></m-wire-button>
<button
class="m-btn m-btn--action m-btn--slim minds-boost-button"
*ngIf="
session.getLoggedInUser().guid == activity.owner_guid &&
!isScheduled(activity.time_created)
"
id="boost-actions"
(click)="showBoost()"
>
<span i18n="verb|@@M__ACTION__BOOST">Boost</span>
</button>
<minds-button-comment
[object]="activity"
(click)="openComments()"
></minds-button-comment>
<minds-button-remind [object]="activity"></minds-button-remind>
<img
[src]="minds.cdn_assets_url + 'assets/icons/pay.png'"
(click)="openWireModal()"
/>
</div>
</div>
<div class="m-activity__commentPoster"></div>
<!-- Activity metrics -->
<div
class="impressions-tag m-activity--metrics m-activity--metrics-wire"
......@@ -562,33 +562,6 @@
#toggle
*ngIf="!hideTabs"
>
<button
class="mdl-button m-pin-button mdl-button--icon mdl-color-text--blue-grey-300"
(click)="togglePin()"
[disabled]="
session.getLoggedInUser().guid != activity.owner_guid || activity.dontPin
"
*ngIf="!activity?.ephemeral"
>
<m-tooltip
icon="turned_in"
*ngIf="activity.pinned"
i18n="@@MINDS__CARDS__ACTIVITY__PINNED_POST"
>
This post is pinned
</m-tooltip>
<m-tooltip
icon="turned_in_not"
*ngIf="
session.getLoggedInUser().guid == activity.owner_guid &&
!activity.pinned &&
!activity.dontPin
"
i18n="@@MINDS__CARDS__ACTIVITY__CLICK_TO_PIN"
>
Click to pin this post to the top of your channel feed
</m-tooltip>
</button>
<m-safe-toggle
*ngIf="showRatingToggle && session.isAdmin()"
[(entity)]="activity"
......
......@@ -8,6 +8,14 @@ minds-activity-v2 {
overflow: visible;
&.minds-activity-v2__allowOverflow {
max-height: none;
.m-mature-message {
max-height: none;
//.m-mature-message-content {
// max-height: none;
//}
}
}
.mdl-card__supporting-text {
......@@ -26,7 +34,8 @@ minds-activity-v2 {
}
.mdl-card__supporting-text.message {
margin-top: 26px;
margin: 26px;
padding: 0 22px;
white-space: pre-line;
word-wrap: break-word;
padding-top: 0;
......@@ -39,6 +48,118 @@ minds-activity-v2 {
.m-owner-block {
position: relative;
//flex-shrink: 0;
//flex-grow: 0;
min-height: 72px;
height: 72px;
max-height: 72px;
.avatar {
img {
width: 37px;
height: 37px;
}
.body {
margin-left: 14px;
a {
font-size: 16px;
line-height: 21px;
color: #5d5d5d;
&.permalink {
font-size: 13px;
line-height: 18px;
color: #b6b6b6;
}
}
}
}
}
m-video {
height: 300px;
}
a.m-activity--image-link {
img {
height: 300px;
background-color: #f5f5f5;
}
}
.m-mature-message {
max-height: 146px;
margin-top: 5px;
.m-read-more--button {
text-align: center;
}
}
.m-activity__actionButtons {
height: 60px;
border-top: 1px solid #eee;
padding: 23px 0;
display: flex;
box-sizing: border-box;
> * {
display: flex;
flex-direction: column;
//flex:auto;
//flex: 1;
text-align: center;
cursor: pointer;
}
minds-button-thumbs-up,
minds-button-thumbs-down,
minds-button-remind {
padding: 0 22px;
a {
&:not(.selected) {
color: #b6b6b6 !important;
}
i,
span {
vertical-align: middle;
font-size: 19px;
line-height: 16px;
}
span {
font-size: 12px;
padding: 0 0 0 8px;
}
}
}
}
.m-activity__pay {
justify-self: flex-end;
align-self: center;
margin-left: auto;
margin-right: 22px;
img {
width: 21px;
height: 19px;
cursor: pointer;
}
}
.m-activity__commentPoster {
height: 91px;
flex-shrink: 0;
background-color: lightblue;
}
.m-owner-block--remind {
......@@ -50,8 +171,6 @@ minds-activity-v2 {
}
.avatar img {
width: 24px;
height: 24px;
object-fit: cover;
}
......@@ -158,24 +277,35 @@ minds-activity-v2 {
img {
width: 100%;
height: 300px;
object-fit: contain;
background-color: #f5f5f5;
}
.meta {
padding: $minds-padding * 2 $minds-padding * 2 0;
padding: 16px 22px 0;
display: block;
text-decoration: none;
width: calc(100% - 32px);
background-color: #fbfbfb;
h2 {
font-size: 15px;
line-height: 20px;
color: #4a4a4a;
}
p {
color: #9b9b9b;
font-size: 13px;
line-height: 18px;
text-overflow: ellipsis;
text-rendering: auto;
white-space: pre-wrap;
overflow: hidden;
max-height: 48px;
margin: 8px 0;
margin: 2px 0;
padding: 0;
line-height: 1.25;
}
p.m-url {
......
import {
Component,
ChangeDetectionStrategy,
ChangeDetectorRef,
EventEmitter,
Component,
ElementRef,
EventEmitter,
Injector,
Input,
ViewChild,
OnInit,
SkipSelf,
Injector,
ViewChild,
} from '@angular/core';
import { Client } from '../../../../../services/api';
......@@ -30,6 +30,7 @@ import { AutocompleteSuggestionsService } from '../../../../suggestions/services
import { ActivityService } from '../../../../../common/services/activity.service';
import { FeaturesService } from '../../../../../services/features.service';
import isMobile from '../../../../../helpers/is-mobile';
import { SignupModalService } from '../../../../modals/signup/service';
@Component({
moduleId: module.id,
......@@ -176,7 +177,8 @@ export class MindsActivityV2 implements OnInit {
public suggestions: AutocompleteSuggestionsService,
protected activityService: ActivityService,
@SkipSelf() injector: Injector,
protected elementRef: ElementRef
protected elementRef: ElementRef,
protected signupModal: SignupModalService
) {
this.clientMetaService.inherit(injector);
......@@ -612,4 +614,28 @@ export class MindsActivityV2 implements OnInit {
'minds-activity-v2__allowOverflow'
);
}
openWireModal() {
if (!this.session.isLoggedIn()) {
this.signupModal.open();
return;
}
const creator = this.overlayModal.create(
WireCreatorComponent,
this.activity,
{
default: this.activity && this.activity.wire_threshold,
onComplete: wire => {
if (this.activity.wire_totals) {
this.activity.wire_totals[wire.currency] = wire.amount;
}
this.wireSubmitted(wire);
},
}
);
creator.present();
}
}
......@@ -40,6 +40,7 @@ import { CommentsModule } from '../comments/comments.module';
import { TextInputAutocompleteModule } from '../../common/components/autocomplete';
import { CommentComponentV2 } from '../comments/comment/comment.component';
import { MindsActivityV2 } from './components/cards/activity-v2/activity.component';
import { Ng2FittextModule } from 'ng2-fittext';
@NgModule({
imports: [
......@@ -58,6 +59,7 @@ import { MindsActivityV2 } from './components/cards/activity-v2/activity.compone
PostMenuModule,
CommentsModule,
TextInputAutocompleteModule,
Ng2FittextModule,
],
declarations: [
Activity,
......
......@@ -3,6 +3,7 @@ import {
Component,
ElementRef,
Injector,
OnInit,
QueryList,
SkipSelf,
ViewChildren,
......@@ -37,7 +38,7 @@ import { ClientMetaService } from '../../../common/services/client-meta.service'
providers: [ClientMetaService, FeedsService],
templateUrl: 'boost-rotator.component.html',
})
export class NewsfeedBoostRotatorComponent {
export class NewsfeedBoostRotatorComponent implements OnInit {
boosts: Array<any> = [];
offset: string = '';
inProgress: boolean = false;
......@@ -176,7 +177,7 @@ export class NewsfeedBoostRotatorComponent {
return;
}
this.next();
// this.next();
//this.recordImpression(this.currentPosition);
}, this.interval * 1000);
}
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.