mastodon tags almost done. I need to sleep (also bug fix)
This commit is contained in:
parent
a5739f4457
commit
b566263e99
3 changed files with 16 additions and 6 deletions
|
@ -14,6 +14,9 @@ body {
|
|||
|
||||
section {
|
||||
height: 75vh;
|
||||
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.SmallButton {
|
||||
|
|
|
@ -27,8 +27,10 @@
|
|||
<input type="checkbox" class="PostYoutube" />
|
||||
<label>Post to Youtube</label>
|
||||
</div>
|
||||
<textarea cols="50" rows="1" class="Warning" placeholder="Content Warnings"></textarea>
|
||||
<textarea cols="50" rows="1" class="Tags" placeholder="Tags (seperate with \";\")"></textarea>
|
||||
<textarea cols="50" rows="2" class="Warning" maxlength="100" placeholder="Content Warnings"></textarea>
|
||||
<div>
|
||||
<textarea cols="50" rows="1" class="Tags" maxlength="50" placeholder="Tags (seperate with ;)"></textarea>
|
||||
</div>
|
||||
<p class="Button">POST!</p>
|
||||
</section>
|
||||
<footer>
|
||||
|
|
13
JS/post.js
13
JS/post.js
|
@ -9,6 +9,7 @@ let VisibilityDropdown = document.getElementsByClassName("PostVisibility")[0];
|
|||
let InputArea = document.getElementsByClassName("Text")[0];
|
||||
let YoutubePoser = document.getElementsByClassName("PostYoutube")[0];
|
||||
let WarningInputArea = document.getElementsByClassName("Warning")[0];
|
||||
let TagsInputArea = document.getElementsByClassName("Tags")[0];
|
||||
|
||||
// Clicking the beeg POST button.
|
||||
PostButton.onclick = (event) => {
|
||||
|
@ -32,6 +33,7 @@ async function Post() {
|
|||
// Mastodon posting.
|
||||
if (localStorage.getItem(Variables.MastodonAccessToken) != null) {
|
||||
let TempVisible;
|
||||
let TempText = Text + "<br/><br/>" + TagsInputArea.value;
|
||||
switch(Visible) {
|
||||
case "Public":
|
||||
TempVisible = "public";
|
||||
|
@ -48,18 +50,19 @@ async function Post() {
|
|||
}
|
||||
if (website == "Mastodon") {
|
||||
if (WarningInputArea.value == "") {
|
||||
await MastodonAPI.CreateReplyStatus(Text, undefined, TempVisible, JSON.parse(localStorage.getItem("post")).id);
|
||||
await MastodonAPI.CreateReplyStatus(TempText, undefined, TempVisible, JSON.parse(localStorage.getItem("post")).id);
|
||||
} else {
|
||||
await MastodonAPI.CreateReplyStatus(Text, WarningInputArea.value, TempVisible, JSON.parse(localStorage.getItem("post")).id);
|
||||
await MastodonAPI.CreateReplyStatus(TempText, WarningInputArea.value, TempVisible, JSON.parse(localStorage.getItem("post")).id);
|
||||
}
|
||||
InputArea.value = "";
|
||||
WarningInputArea.value = "";
|
||||
TagsInputArea.value = "";
|
||||
return;
|
||||
} else if (website == "All") {
|
||||
if (WarningInputArea.value == "") {
|
||||
await MastodonAPI.CreateStatus(Text, undefined, TempVisible);
|
||||
await MastodonAPI.CreateStatus(TempText, undefined, TempVisible);
|
||||
} else {
|
||||
await MastodonAPI.CreateStatus(Text, WarningInputArea.value, TempVisible);
|
||||
await MastodonAPI.CreateStatus(TempText, WarningInputArea.value, TempVisible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +102,7 @@ async function Post() {
|
|||
}
|
||||
InputArea.value = "";
|
||||
WarningInputArea.value = "";
|
||||
TagsInputArea.value = "";
|
||||
return;
|
||||
} else if (website == "All") {
|
||||
let Post;
|
||||
|
@ -118,6 +122,7 @@ async function Post() {
|
|||
// The input being cleared means that the posting happened.
|
||||
InputArea.value = "";
|
||||
WarningInputArea.value = "";
|
||||
TagsInputArea.value = "";
|
||||
}
|
||||
|
||||
// Check if you can interact with the textbox
|
||||
|
|
Loading…
Add table
Reference in a new issue