mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-02-05 03:14:12 +02:00
pooko
This commit is contained in:
@@ -6,6 +6,9 @@ html {
|
||||
color: white;
|
||||
|
||||
}
|
||||
.app_name {
|
||||
font-size: calc(12px + 1vmax);
|
||||
}
|
||||
.readme{
|
||||
font-family: 'Anonymous Pro';
|
||||
}
|
||||
@@ -83,7 +86,22 @@ img {
|
||||
margin-bottom: 1vh;
|
||||
|
||||
}
|
||||
|
||||
.bot-1 {
|
||||
padding-bottom: 1vmax;
|
||||
}
|
||||
body {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.margin-left-2-vm{
|
||||
margin-left: 2vmax;
|
||||
}
|
||||
.margin-right-2-vm {
|
||||
margin-right: 2vmax;
|
||||
}
|
||||
|
||||
.width-4 {
|
||||
width: 4vmax;
|
||||
}
|
||||
.blurple {
|
||||
color: #5865F2;
|
||||
}
|
||||
53
wwwroot/js/AdminPanel.js
Normal file
53
wwwroot/js/AdminPanel.js
Normal file
@@ -0,0 +1,53 @@
|
||||
function updatePreview(value) {
|
||||
var blogText = $("#previewCard").children("#code").children("#blogText");
|
||||
blogText.empty();
|
||||
blogText.append(value);
|
||||
}
|
||||
function updateAnnotation(value) {
|
||||
var blogText = $("#annotationCard").children("#code").children("#annotationText");
|
||||
blogText.empty();
|
||||
blogText.append(value);
|
||||
}
|
||||
|
||||
function sendArticleData () {
|
||||
let melon = document.cookie.split(';')[0].replace("melon=", "");
|
||||
fetch("/api/Blog", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${melon}`
|
||||
},
|
||||
body: {
|
||||
title: $("#titleInput").val(),
|
||||
annotation: $("#annotationArea").val(),
|
||||
text: $("#textArea").val(),
|
||||
image: $("#imgInput").val(),
|
||||
author: melon
|
||||
}
|
||||
}).then(k => console.log(k));
|
||||
$("#titleInput").val('');
|
||||
$("#annotationArea").val('');
|
||||
$("#textArea").val('');
|
||||
$("#imgInput").val('');
|
||||
}
|
||||
|
||||
|
||||
function sendRedirectData() {
|
||||
console.log("click!")
|
||||
let melon = document.cookie.split(';')[0].replace("melon=", "");
|
||||
let body = `{
|
||||
"url": "${$("#urlInput").val()}",
|
||||
"uri": "${$("#uriInput").val()}",
|
||||
"author": "${melon}"
|
||||
}`;
|
||||
fetch("/api/redirects", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${melon}`,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: body
|
||||
}).then(k => console.log(k));
|
||||
$("#urlInput").val('');
|
||||
$("#uriInput").val('');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,42 @@
|
||||
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
// for details on configuring this project to bundle and minify static web assets.
|
||||
let blogId = $("#blogId").text();
|
||||
function loadComments () {
|
||||
fetch(`/api/Blog/${blogId}/comments`)
|
||||
.then(response => {
|
||||
let data = response.json();
|
||||
data.then(k => {
|
||||
for (let i = 0; i < k.length; i++) {
|
||||
let date = new Date(k[i].dateTime * 1000);
|
||||
$("#commentBar").after(
|
||||
`<div class="d-flex flex flex-start bg-dark bot-1">
|
||||
<div class="container">
|
||||
<h6 class="fw-bold mb-1">${k[i].creatorMail}</h6>
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<p class="mb-0">
|
||||
${date.toLocaleString() }
|
||||
</p>
|
||||
</div>
|
||||
<p class="mb-0">
|
||||
${k[i].text}
|
||||
</p>
|
||||
</div>
|
||||
</div>`
|
||||
)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
$("#postComment").click(
|
||||
function () {
|
||||
var contentBody = {
|
||||
text: $("#commentText").val(),
|
||||
sender: $("#userEmail").val()
|
||||
}
|
||||
$.ajax(`/api/Blog/${blogId}/comments`, {
|
||||
data: JSON.stringify(contentBody),
|
||||
contentType: "application/json",
|
||||
method: "post"
|
||||
}).done(response => { $("#commentText").val(''); $("#userEmail").val(''); $("#commentBar").empty(); loadComments(); })
|
||||
|
||||
// Write your JavaScript code.
|
||||
}
|
||||
);
|
||||
$(loadComments());
|
||||
Reference in New Issue
Block a user