This commit is contained in:
parent
23181e4997
commit
fb2ea59afb
@ -1,6 +1,5 @@
|
|||||||
<div class="op">
|
<div class="op">
|
||||||
<h4>Тред номер {{op.Thread_Id}}</h4>
|
<a [routerLink] ="['/board']" [queryParams]="{thread: op.Thread_Id}" >Зайти в тред{{op.Thread_Id}} </a>
|
||||||
<a [routerLink] ="['/board']" [queryParams]="{thread: op.Thread_Id}" >Тред номер {{op.Thread_Id}} </a>
|
|
||||||
<p> # {{op.Id}} {{op.Timestamp}}</p>
|
<p> # {{op.Id}} {{op.Timestamp}}</p>
|
||||||
<div>
|
<div>
|
||||||
<a *ngFor="let i of op.ImgURL" [href]="i" target="_blank">
|
<a *ngFor="let i of op.ImgURL" [href]="i" target="_blank">
|
||||||
|
@ -3,6 +3,7 @@ import { ApiChatService } from '../services/api-chat.service';
|
|||||||
import { SinglePost } from '../models/post'
|
import { SinglePost } from '../models/post'
|
||||||
import * as vars from '../var/api'
|
import * as vars from '../var/api'
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import {ActivatedRoute} from "@angular/router";
|
||||||
|
import {setDisplayedThread} from "../var/api";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-SingleThread',
|
selector: 'app-SingleThread',
|
||||||
@ -34,6 +35,7 @@ export class BoardsComponent implements OnInit {
|
|||||||
if(threadId != null)
|
if(threadId != null)
|
||||||
{
|
{
|
||||||
this.displayed_thread_number = parseInt(threadId);
|
this.displayed_thread_number = parseInt(threadId);
|
||||||
|
vars.setDisplayedThread(this.displayed_thread_number);
|
||||||
}
|
}
|
||||||
this.apiChatService.getPosts('postgres', this.displayed_thread_number).subscribe(response => {
|
this.apiChatService.getPosts('postgres', this.displayed_thread_number).subscribe(response => {
|
||||||
this.postsToShow = response
|
this.postsToShow = response
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="send_post">
|
<div class="send_post">
|
||||||
<h4>Поведай миру что-нибудь хорошее.</h4>
|
<h4>Поведай миру что-нибудь хорошее.</h4>
|
||||||
<br>
|
<br>
|
||||||
<textarea type="text" rows="8" cols="45" placeholder="Печатать сюда" #textToPost> </textarea>
|
<textarea type="text" rows="8" cols="45" placeholder="Печатать сюда" #textToPost></textarea>
|
||||||
<p>
|
<p>
|
||||||
<button (click)="sendPost(textToPost.value) ; textToPost.value=''" >Отправить</button>
|
<button (click)="sendPost(textToPost.value) ; textToPost.value=''" >Отправить</button>
|
||||||
</p>
|
</p>
|
||||||
|
@ -11,7 +11,7 @@ import * as vars from "../var/api";
|
|||||||
export class SendPostComponent implements OnInit {
|
export class SendPostComponent implements OnInit {
|
||||||
|
|
||||||
progress: number;
|
progress: number;
|
||||||
message: string;
|
message: string = '';
|
||||||
filename: string[] = [];
|
filename: string[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -24,10 +24,13 @@ export class SendPostComponent implements OnInit {
|
|||||||
|
|
||||||
sendPost(text: string) {
|
sendPost(text: string) {
|
||||||
var threadId = vars.displayed_thread;
|
var threadId = vars.displayed_thread;
|
||||||
this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe();
|
this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe( response => {
|
||||||
|
response = response.toString();
|
||||||
|
vars.showAlert(response.toString(), "#ff0a36");
|
||||||
|
});
|
||||||
this.message = '0';
|
this.message = '0';
|
||||||
this.filename = [];
|
this.filename = [];
|
||||||
alert("Сообщение отправлено.");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +40,7 @@ export class SendPostComponent implements OnInit {
|
|||||||
response => {
|
response => {
|
||||||
response = response.value.toString();
|
response = response.value.toString();
|
||||||
this.filename.push(response);
|
this.filename.push(response);
|
||||||
vars.showAlert("Картинка " + response + " добавлена к посту!", "#696116")
|
vars.showAlert("Картинка " + response + " добавлена к посту!", "#ff0a36")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ const showAlert = (message:string, color:string) => {
|
|||||||
alertContainer.style.left = '50';
|
alertContainer.style.left = '50';
|
||||||
alertContainer.style.top = '0';
|
alertContainer.style.top = '0';
|
||||||
alertContainer.style.right = '0';
|
alertContainer.style.right = '0';
|
||||||
alertContainer.style.padding = '10px 3px';
|
alertContainer.style.padding = '30px 3px';
|
||||||
alertContainer.style.fontSize = '30px';
|
alertContainer.style.fontSize = '20px';
|
||||||
alertContainer.style.textAlign = 'center';
|
alertContainer.style.textAlign = 'right';
|
||||||
alertContainer.style.backgroundColor = color;
|
alertContainer.style.backgroundColor = color;
|
||||||
alertContainer.style.border = "2px dashed #6CFFDD"
|
alertContainer.style.border = "2px dashed #6CFFDD"
|
||||||
alertContainer.textContent = message;
|
alertContainer.textContent = message;
|
||||||
|
Reference in New Issue
Block a user