diff --git a/Source/ApiTransform.js b/Source/ApiTransform.js index 40c249c..6d6e88d 100644 --- a/Source/ApiTransform.js +++ b/Source/ApiTransform.js @@ -66,10 +66,11 @@ ApiSchema.Channel = CopyObj(ApiSchema.__Account__); var TransParsers = { Mastodon: { - /* 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) { return JsonTransformA(Data, TransSchemas.Mastodon.Instance, TransSchemas.Mastodon); }, diff --git a/Source/FakeApi.js b/Source/FakeApi.js index 531ae13..80dece3 100644 --- a/Source/FakeApi.js +++ b/Source/FakeApi.js @@ -14,11 +14,13 @@ FakeApi.Friendiiverse.Featured.Featured.push({ Banner: "https://picsum.photos/seed/Testing.Banner/320/180", Icon: "https://picsum.photos/seed/Testing.Icon/64", Name: "Testing Channel", + Url: "https://lemmy.example.com/c/Testing", }); FakeApi.Friendiiverse.Featured.Categories.push({ Banner: "https://picsum.photos/seed/fediverse.Banner/320/180", Icon: "https://picsum.photos/seed/fediverse.Icon/64", Name: "#fediverse", + Url: "https://mastodon.example.com/hashtag/fediverse", }); FakeApi.Mastodon.Account = { @@ -27,6 +29,8 @@ FakeApi.Mastodon.Account = { header: "https://picsum.photos/seed/Tester.Banner/320/180", url: "https://mastodon.example.com/@Tester", }; +FakeApi.Friendiiverse.Featured.Featured.push( + TransParsers.Mastodon.Account(FakeApi.Mastodon.Account)); FakeApi.Mastodon.Status = { account: FakeApi.Mastodon.Account, diff --git a/Source/Main.js b/Source/Main.js index c2a8255..ad7328a 100644 --- a/Source/Main.js +++ b/Source/Main.js @@ -108,20 +108,18 @@ function MakeWindow(Attrs) { }; function DisplayChannel(Channel) { - //DoAsync(FetchMastodon, FillTimeline); - ChannelView.innerHTML = ` -
- `; + var Window = MakeWindow({className: "Channel"}); + Window.innerHTML += ``; }; function FetchMastodon(Proc) { @@ -163,7 +161,7 @@ function FillFeatured(Categories) { Object.values(Categories).forEach(function(Channels){ Channels.forEach(function(Channel){ Window.innerHTML += `