diff --git a/App/ApiTransform.js b/App/ApiTransform.js index 444ab56..8be498a 100644 --- a/App/ApiTransform.js +++ b/App/ApiTransform.js @@ -38,6 +38,7 @@ var ApiSchema = { }, Quoting: { Mastodon: "reblog", + Misskey: "renote", }, Time: { Mastodon: "created_at", @@ -78,7 +79,16 @@ var ApiSchema = { }, }; +var ApiEndpoints = { + FetchNotes: { + Mastodon(Profile) { + return `accounts/${Profile.Id}/statuses`; + }, + }, +}; + function ApiTransform(Data, FromSource, DestType) { + LogDebug([Data, DestType, FromSource]); return JsonTransformB(Data, ApiSchema, ApiSchema[DestType], FromSource); }; diff --git a/App/Elems.js b/App/Elems.js index d7d62d3..2775778 100644 --- a/App/Elems.js +++ b/App/Elems.js @@ -1,4 +1,4 @@ -function HtmlEl(Tag, Attrs) { +function MkHtmlEl(Tag, Attrs) { var El = document.createElement(Tag); if (Attrs) { Object.keys(Attrs).forEach(function(Attr){ @@ -8,15 +8,27 @@ function HtmlEl(Tag, Attrs) { return El; }; -function MakeWindow(Attrs) { - var Window = HtmlEl('div', Attrs); +function MkWindow(Attrs) { + var Window = MkHtmlEl('div', Attrs); Window.className += ' Window'; Root.appendChild(Window); return Window; }; -function Dropdown(Attrs) { - var Menu = HtmlEl('div', Attrs); - Window.className += ' Dropdown'; +function MkSelectMenu(Opts, Attrs) { + var Menu = MkHtmlEl('div', Attrs); + var OptsHtml = ''; + Opts.forEach(function(Opt){ + OptsHtml += '
Posting in: [Channel]
@@ -158,11 +184,11 @@ function PostNote(Text) { }; function ManageSettings() { - MakeWindow().innerHTML = ` + MkWindow().innerHTML = `- Language: ${Dropdown()} + Language: ${MkSelectMenu([{innerHTML: "en"}, {innerHTML: "it"},]).outerHTML}
Theme:
diff --git a/App/Net.js b/App/Net.js
index c67b222..b4a7ce6 100644
--- a/App/Net.js
+++ b/App/Net.js
@@ -1,4 +1,4 @@
-function ApiCall(Data, Proc) {
+function NetApiCall(Data, Proc) {
// Data = {Target: "Friendica", Method: "...", Data: {}, Call: (), CallFine: (), CallFail: ()}
var Req = new XMLHttpRequest();
Req.Proc = Proc;
diff --git a/App/Polyfill.js b/App/Polyfill.js
new file mode 100644
index 0000000..450b9fb
--- /dev/null
+++ b/App/Polyfill.js
@@ -0,0 +1,9 @@
+if (!Array.prototype.from) {
+ Array.prototype.from = function from(List) {
+ var Arr = [];
+ for (var i=0; i