small fixes

This commit is contained in:
teldra 2022-05-10 04:29:46 +02:00
parent c7095d9e50
commit 8e1ca129a7
1 changed files with 6 additions and 10 deletions

View File

@ -12,12 +12,11 @@ function check_checkboxes(name) {
}
function button(x) {
const textarea = document.getElementById('content');
if (x == "url") {
let url = prompt("Please enter URL", "https://wikipedia.org");
let desc = prompt("Description", "The free Encyclopedia");
var out = "[" + desc + "](" + url + ")";
} else
var out = "[" + desc + "](" + url + ") ";
}
if (x == "headline") {
let headline = prompt("Headline", "Act One");
var out = "##" + headline + "\n\n";
@ -25,27 +24,24 @@ function button(x) {
if (x == "pic") {
let desc = prompt("Description", "Wikipedia logo");
let pic = prompt("Please enter URL or Number", "https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png");
var out = "![" + desc + "](" + pic + ")";
var out = "![" + desc + "](" + pic + ") ";
}
if (x == "bold") {
let bold = prompt("Bold", "");
var out = "**" + bold + "**";
var out = "_" + bold + "_ ";
}
if (x == "paragraph") {
var out = "\n\n";
}
if (x == "newline") {
var out = " ";
var out = " \n";
}
if (x == "more") {
var out = "\n\n<!--more-->\n\n";
}
if (out != null) {
textarea.innerHTML += out;
var end = textarea.value.length;
document.getElementById('content').innerHTML += out;
}
textarea.setSelectionRange(end, end);
textarea.focus();
}
function testor(input) {