This commit is contained in:
octospacc 2023-04-22 10:06:31 +02:00
parent 841fe95450
commit dee3883537
4 changed files with 34 additions and 19 deletions

View File

@ -66,10 +66,11 @@ ApiSchema.Channel = CopyObj(ApiSchema.__Account__);
var TransParsers = { var TransParsers = {
Mastodon: { Mastodon: {
/*
Account(Data) { Account(Data) {
return JsonTransformA(Data, TransSchemas.Mastodon.Author, TransSchemas.Mastodon); //return JsonTransformA(Data, TransSchemas.Mastodon.Author, TransSchemas.Mastodon);
return JsonTransformB(Data, ApiSchema, ApiSchema.Author, 'Mastodon');
}, },
/*
Instance(Data) { Instance(Data) {
return JsonTransformA(Data, TransSchemas.Mastodon.Instance, TransSchemas.Mastodon); return JsonTransformA(Data, TransSchemas.Mastodon.Instance, TransSchemas.Mastodon);
}, },

View File

@ -14,11 +14,13 @@ FakeApi.Friendiiverse.Featured.Featured.push({
Banner: "https://picsum.photos/seed/Testing.Banner/320/180", Banner: "https://picsum.photos/seed/Testing.Banner/320/180",
Icon: "https://picsum.photos/seed/Testing.Icon/64", Icon: "https://picsum.photos/seed/Testing.Icon/64",
Name: "Testing Channel", Name: "Testing Channel",
Url: "https://lemmy.example.com/c/Testing",
}); });
FakeApi.Friendiiverse.Featured.Categories.push({ FakeApi.Friendiiverse.Featured.Categories.push({
Banner: "https://picsum.photos/seed/fediverse.Banner/320/180", Banner: "https://picsum.photos/seed/fediverse.Banner/320/180",
Icon: "https://picsum.photos/seed/fediverse.Icon/64", Icon: "https://picsum.photos/seed/fediverse.Icon/64",
Name: "#fediverse", Name: "#fediverse",
Url: "https://mastodon.example.com/hashtag/fediverse",
}); });
FakeApi.Mastodon.Account = { FakeApi.Mastodon.Account = {
@ -27,6 +29,8 @@ FakeApi.Mastodon.Account = {
header: "https://picsum.photos/seed/Tester.Banner/320/180", header: "https://picsum.photos/seed/Tester.Banner/320/180",
url: "https://mastodon.example.com/@Tester", url: "https://mastodon.example.com/@Tester",
}; };
FakeApi.Friendiiverse.Featured.Featured.push(
TransParsers.Mastodon.Account(FakeApi.Mastodon.Account));
FakeApi.Mastodon.Status = { FakeApi.Mastodon.Status = {
account: FakeApi.Mastodon.Account, account: FakeApi.Mastodon.Account,

View File

@ -108,9 +108,8 @@ function MakeWindow(Attrs) {
}; };
function DisplayChannel(Channel) { function DisplayChannel(Channel) {
//DoAsync(FetchMastodon, FillTimeline); var Window = MakeWindow({className: "Channel"});
ChannelView.innerHTML = ` Window.innerHTML += `<div class="" style="display: inline-block;">
<div class="" style="display: inline-block;">
<a href="${Channel.Url}"> <a href="${Channel.Url}">
<div> <div>
<img class="" src="${Channel.Banner}"/> <img class="" src="${Channel.Banner}"/>
@ -120,8 +119,7 @@ function DisplayChannel(Channel) {
${Channel.Name} ${Channel.Name}
</div> </div>
</a> </a>
</div> </div>`;
`;
}; };
function FetchMastodon(Proc) { function FetchMastodon(Proc) {
@ -163,7 +161,7 @@ function FillFeatured(Categories) {
Object.values(Categories).forEach(function(Channels){ Object.values(Categories).forEach(function(Channels){
Channels.forEach(function(Channel){ Channels.forEach(function(Channel){
Window.innerHTML += `<div data-data="${B64Obj(Channel)}"> Window.innerHTML += `<div data-data="${B64Obj(Channel)}">
<a href="${Channel.Url}" onclick="DisplayChannel(UnB64Obj(this.parentNode.dataset.data).Author); return false;"> <a href="${Channel.Url}" onclick="DisplayChannel(UnB64Obj(this.parentNode.dataset.data)); return false;">
<div> <div>
<img src="${Channel.Banner}"/> <img src="${Channel.Banner}"/>
</div> </div>
@ -201,4 +199,4 @@ PlazasView.innerHTML = `
*/ */
DoAsync(FetchFeatured, FillFeatured); DoAsync(FetchFeatured, FillFeatured);
CoverView.remove();

View File

@ -3,7 +3,7 @@ img, video {
} }
#Root { #Root {
margin-bottom: 2em; /*margin-bottom: 2em;*/
} }
#Bottom { #Bottom {
@ -20,6 +20,18 @@ img, video {
white-space: break-spaces; white-space: break-spaces;
} }
.Window {
background: white;
position: absolute;
width: 100%;
max-width: 100%;
min-width: 100%;
min-height: calc(100% - 4em);
padding-bottom: 2em;
}
.View.Note { .View.Note {
border: 4px solid purple; border: 4px solid purple;
margin: 12px; margin: 12px;