small fixes
This commit is contained in:
parent
10cbba1935
commit
a3cdc52a9f
55
add_archive.sh
Executable file
55
add_archive.sh
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
err() {
|
||||||
|
echo "${1}"
|
||||||
|
zenity --error --no-wrap --text "${1}"
|
||||||
|
}
|
||||||
|
|
||||||
|
warn() {
|
||||||
|
echo "${1}"
|
||||||
|
zenity --warning --no-wrap --text "${1}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! command -v unzip &> /dev/null
|
||||||
|
then
|
||||||
|
err "'unzip' could not be found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ ${#@} -eq 0 ]; then
|
||||||
|
# no arguments
|
||||||
|
IFS=$'\n' files=($(zenity --file-selection --multiple --separator=$'\n' --title="Choose files"))
|
||||||
|
else
|
||||||
|
# arguments
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${files[@]}"; do
|
||||||
|
if ! unzip -l "${i}"|grep -q "index.de.md"; then
|
||||||
|
err "maybe wrong archive, this is not compatible"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fname="$(basename ${i%.*})"
|
||||||
|
if ! [ -d content ]; then
|
||||||
|
err "folder 'content' not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
set -x
|
||||||
|
mkdir -p "content/posts/${fname}/"
|
||||||
|
unzip -d "content/posts/${fname}/" "${i}"
|
||||||
|
done
|
||||||
|
|
||||||
|
output="Done."
|
||||||
|
output_temp=""
|
||||||
|
|
||||||
|
for i in "${files[@]}"; do
|
||||||
|
fname="$(basename ${i%.*})"
|
||||||
|
folder="content/posts/${fname}"
|
||||||
|
if ! [ -e "${folder}/banner*" ]; then
|
||||||
|
output_temp="${output_temp}banner missing\n "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
warn "${output_temp}"
|
BIN
content/posts/2022-06-26-a/banner_2.jpeg
Normal file
BIN
content/posts/2022-06-26-a/banner_2.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 268 KiB |
11
content/posts/2022-06-26-a/index.de.md
Normal file
11
content/posts/2022-06-26-a/index.de.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
title: "a"
|
||||||
|
date: 2022-06-26T13:55:00+02:00
|
||||||
|
---
|
||||||
|
![Describe the Picture for the Blind](redarrot.png)
|
||||||
|
|
||||||
|
[Describe the File for the Blind](t60.conf)
|
||||||
|
|
||||||
|
![Describe the Picture for the Blind](Buntes.Haus.Celle.Logo.5.png)
|
||||||
|
|
||||||
|
[Describe the File for the Blind](reconfigure_pipewire.sh)
|
BIN
content/posts/2022-06-26-a/ui.jpeg
Normal file
BIN
content/posts/2022-06-26-a/ui.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 268 KiB |
43
new.sh
43
new.sh
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
echo "Titel des Artikels"
|
|
||||||
read -p ": " title
|
|
||||||
|
|
||||||
title=${title//[^[:print:]]/}
|
|
||||||
title=${title//#/}
|
|
||||||
newfoldername="${title//[^[:alnum:][:blank:]-]/}"
|
|
||||||
newfoldername=${newfoldername// /-}
|
|
||||||
newfoldername=${newfoldername/%-/}
|
|
||||||
newfoldername=${newfoldername/-/}
|
|
||||||
|
|
||||||
title="${title//\//\\\/}" # / -> \/
|
|
||||||
title="${title//\"/\\\"}" # " -> \"
|
|
||||||
|
|
||||||
date_long=$(date +%Y-%m-%dT%H:%M:00+0200)
|
|
||||||
date=$(date +%Y-%m-%d)
|
|
||||||
mkdir -p "content/posts/${date}-${newfoldername}"
|
|
||||||
touch "content/posts/${date}-${newfoldername}/index.de.md"
|
|
||||||
# echo "---" > "content/posts/${date}-${newfoldername}/index.de.md"
|
|
||||||
# echo "title: \"${title}\"" >> "content/posts/${date}-${newfoldername}/index.de.md"
|
|
||||||
# echo "date: ${date_long}" >> "content/posts/${date}-${newfoldername}/index.de.md"
|
|
||||||
# echo "---" >> "content/posts/${date}-${newfoldername}/index.de.md"
|
|
||||||
|
|
||||||
git add "content/posts/${date}-${newfoldername}/"
|
|
||||||
git commit -m "New Post: ${date}-${newfoldername}"
|
|
||||||
|
|
||||||
for i in vim nano gedit kate; do
|
|
||||||
if command -v $i > /dev/null; then
|
|
||||||
editor="$i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
echo "Schreibe nun mit einem einfachen Editor deinen Artikel."
|
|
||||||
echo ""
|
|
||||||
echo "'${editor} content/posts/${date}-${newfoldername}/index.de.md'"
|
|
||||||
echo ""
|
|
||||||
echo "'https://buha.rotce.de/de/tools/generator/' hilft dir!"
|
|
||||||
echo ""
|
|
||||||
echo "Lege vielleicht noch Bilder in den Ordner 'content/posts/${date}-${newfoldername}'"
|
|
||||||
echo ""
|
|
||||||
echo "Wenn du fertig bist, nutze './push.sh' um das hochzuladen."
|
|
|
@ -11,15 +11,10 @@ fieldset {
|
||||||
}
|
}
|
||||||
|
|
||||||
#result {
|
#result {
|
||||||
white-space: pre; display: flex; background: var(--background-alt);
|
margin: 1em;
|
||||||
padding: 1rem 0 1rem 1rem;
|
display: flex;
|
||||||
margin-top: 1rem;
|
flex-direction: column;
|
||||||
-webkit-user-select: all;
|
max-width: 80%;
|
||||||
user-select: all;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
word-wrap: break-word;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
max-width: 100vw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
|
|
|
@ -21,15 +21,16 @@ forms:
|
||||||
input_type: textarea
|
input_type: textarea
|
||||||
name: "Zusammenfassung"
|
name: "Zusammenfassung"
|
||||||
expanded: true
|
expanded: true
|
||||||
buttons: "url,URL;pic,Bild;bold,Fett;strike,Durchgestrichen;paragraph,Absatz;newline,Neue Zeile"
|
buttons: "url,URL;bold,Fett;strike,Durchgestrichen;paragraph,Absatz;newline,Neue Zeile"
|
||||||
placeholder: "Der erste Absatz des Artkels. Eine Zusammenfassung des Inhalts. Gerne einladend bis reisserisch oder zusammenfassend. Denke an die Formatierungshilfe hinter dem Link oben."
|
placeholder: "Der erste Absatz des Artkels. Eine Zusammenfassung des Inhalts. Gerne einladend bis reisserisch oder zusammenfassend. Denke an die Formatierungshilfe hinter dem Link oben."
|
||||||
help: ""
|
help: ""
|
||||||
- title: content
|
- title: content
|
||||||
input_type: textarea
|
input_type: textarea
|
||||||
name: "Inhalt"
|
name: "Inhalt"
|
||||||
buttons: "headline,Überschrift;url,URL;pic,Bild;bold,Fett;strike,Durchgestrichen;paragraph,Absatz;newline,Neue Zeile"
|
buttons: "headline,Überschrift;url,URL;picurl,Bild URL;bold,Fett;strike,Durchgestrichen;paragraph,Absatz;newline,Neue Zeile"
|
||||||
required: true
|
required: true
|
||||||
placeholder: "Der Inhalt des Artikels. Denke an die Formatierungshilfe hinter dem Link oben."
|
placeholder: "Der Inhalt des Artikels. Denke an die Formatierungshilfe hinter dem Link oben."
|
||||||
|
pictures: "Dateien Auswählen"
|
||||||
- title: news
|
- title: news
|
||||||
input_type: categories
|
input_type: categories
|
||||||
name: "Kategorie"
|
name: "Kategorie"
|
||||||
|
|
|
@ -7,38 +7,19 @@
|
||||||
<div class="dfjcc">{{ .Text }}</div>
|
<div class="dfjcc">{{ .Text }}</div>
|
||||||
</a>
|
</a>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{ $ignore := slice (.Page.Resources.GetMatch "banner*") }}
|
{{ $dest := string (printf "%s*" .Destination) }}
|
||||||
{{ $images := .Page.Resources.ByType "image" }}
|
{{ if .Page.Resources.GetMatch $dest }}
|
||||||
{{ $images = complement $ignore $images }}
|
{{- $image := .Page.Resources.GetMatch $dest -}}
|
||||||
{{ if where (.Page.Resources.ByType "image") ".File.TranslationBaseName" "!=" "banner*" }}
|
<a href="{{- $image.Permalink -}}" class="article_image no_underline">
|
||||||
{{ $img_tmp := "" }}
|
<img loading="lazy"
|
||||||
{{ $dest := string (printf "%s.*" .Destination) }}
|
src="{{ $image.Permalink }}"
|
||||||
{{ if .Page.Resources.GetMatch $dest }}
|
alt="{{ .Text }}"
|
||||||
{{- $img_tmp = .Page.Resources.GetMatch $dest -}}
|
{{ with .Title}} title="{{ . }}"{{ end }}
|
||||||
{{ else }}
|
width={{ $image.Width }}
|
||||||
{{ $nr := .Destination }}
|
height="{{ $image.Height }}" /><br>
|
||||||
{{- $img_tmp = index $images (sub (int $nr) 1) -}}
|
{{ .Text }}
|
||||||
{{ end }}
|
</a>
|
||||||
{{ if $img_tmp }}
|
{{ else }}
|
||||||
{{- $image := .Page.Resources.GetMatch (printf "%s" ($img_tmp | safeURL)) -}}
|
{{ .Destination }} missing..
|
||||||
{{- $permalink := "" -}}
|
|
||||||
|
|
||||||
{{- if ne $image nil -}}
|
|
||||||
{{- $permalink = $image.Permalink -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $image = imageConfig (printf "static/%s" (.Destination | safeURL)) -}}
|
|
||||||
{{- $permalink = (printf "/%s" (.Destination | safeURL)) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
<a href="{{- $image.Permalink -}}" class="article_image no_underline">
|
|
||||||
<img loading="lazy"
|
|
||||||
src="{{ $permalink }}"
|
|
||||||
alt="{{ .Text }}"
|
|
||||||
{{ with .Title}} title="{{ . }}"{{ end }}
|
|
||||||
width={{ $image.Width }}
|
|
||||||
height="{{ $image.Height }}" /><br>
|
|
||||||
{{ .Text }}
|
|
||||||
</a>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
{{ define "main" }}
|
|
||||||
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
|
|
||||||
{{ $days := int (mul (mul (int .Site.Params.featured_expire) 7) -1) }}
|
|
||||||
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}
|
|
||||||
{{ $featured = $all | intersect $featured }}
|
|
||||||
{{ $posts := $all | complement $featured }}
|
|
||||||
{{- $paginator := .Paginate $posts -}}
|
|
||||||
{{ if eq $paginator.PageNumber 1 }}
|
|
||||||
{{ if ne .Content "" }}
|
|
||||||
<article>
|
|
||||||
{{ .Content }}
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
|
||||||
{{ if gt (len $featured) 0 }}
|
|
||||||
<a href="/featured"><h2 style="margin-left: .5rem;">{{if "featured" | i18n }}{{ "featured" | i18n }}{{ else }}{{ "Featured" }}{{ end }}</h2></a>
|
|
||||||
{{ partial "contentlayouts/list.html" (dict "context" . "pages" $featured "amount" "3" ) }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ if gt (len $posts) 1 }}
|
|
||||||
<a href="/news"><h2 style="margin-left: .5rem;">{{ if "news" | i18n }}{{ "news" | i18n }}{{ else }}{{ "News" }}{{ end }}</h2></a>
|
|
||||||
{{ partial "contentlayouts/list.html" (dict "context" . "paginator" $paginator "amount" "5") }}
|
|
||||||
|
|
||||||
<div id="pagination_outer" style="display: flex; justify-content: center;">
|
|
||||||
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ define "sidebar" }}
|
|
||||||
{{- partial "contentlayouts/menu.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
|
@ -39,8 +39,12 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<textarea class="w100 textarea" name="{{ .title }}" id="{{ .title }}" rows="10" {{ if .placeholder }}placeholder="{{ .placeholder }}"{{ end }}></textarea>
|
<textarea class="w100 textarea" name="{{ .title }}" id="{{ .title }}" rows="10" {{ if .placeholder }}placeholder="{{ .placeholder }}"{{ end }}></textarea>
|
||||||
{{ if eq .title "content" }}
|
{{ if .pictures }}
|
||||||
<div id="added-files" style="display: flex; flex-direction: column;"></div>
|
{{ $nn := printf "%s;%s" .title "addfiles"}}
|
||||||
|
<div style="margin-top: .5em; margin-bottom: .5em;">
|
||||||
|
<button class="button" onclick="addfiles({{- $nn -}})" type="button" value="addfiles">{{ .pictures }}</button>
|
||||||
|
<div id="added-files" style="display: flex; flex-direction: column; margin-top: 1em;"></div>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ else if eq .input_type "radio" }}
|
{{ else if eq .input_type "radio" }}
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
var zip = new JSZip();
|
var zip = new JSZip();
|
||||||
|
var archive_name = "";
|
||||||
|
var fout = document.getElementById('added-files');
|
||||||
|
|
||||||
|
function isFileImage(file) {
|
||||||
|
return file && file['type'].split('/')[0] === 'image';
|
||||||
|
}
|
||||||
|
|
||||||
function check_checkboxes(name) {
|
function check_checkboxes(name) {
|
||||||
const checkboxes = document.querySelectorAll(`input[name="${name}"]:checked`);
|
const checkboxes = document.querySelectorAll(`input[name="${name}"]:checked`);
|
||||||
|
@ -58,6 +64,56 @@ function rm_file(fname) {
|
||||||
zip.remove(fname);
|
zip.remove(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insert_file(fname) {
|
||||||
|
var arr = fname.split(";");
|
||||||
|
let t = arr[2];
|
||||||
|
let x = arr[1];
|
||||||
|
let target = arr[0];
|
||||||
|
var id = document.getElementById(target);
|
||||||
|
function typeInTextarea(newText, el = id) {
|
||||||
|
const [start, end] = [el.selectionStart, el.selectionEnd];
|
||||||
|
el.setRangeText(newText, start, end);
|
||||||
|
}
|
||||||
|
if (t == "image") {
|
||||||
|
var desc = prompt("Desc for ", "Describe the Picture for the Blind");
|
||||||
|
var out = "![" + desc + "](" + x + ") \n\n";
|
||||||
|
} else if (t == "other") {
|
||||||
|
var desc = prompt("Desc for ", "Describe the File for the Blind");
|
||||||
|
var out = "[" + desc + "](" + x + ") \n\n";
|
||||||
|
}
|
||||||
|
if (out != null) {
|
||||||
|
typeInTextarea(out);
|
||||||
|
var end = id.value.length;
|
||||||
|
id.setSelectionRange(end, end);
|
||||||
|
id.focus({preventScroll: true});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addfiles(str) {
|
||||||
|
var arr = str.split(";");
|
||||||
|
let x = arr[1];
|
||||||
|
let target = arr[0];
|
||||||
|
var input = document.createElement('input');
|
||||||
|
var type = "image";
|
||||||
|
input.type = 'file';
|
||||||
|
input.multiple = 'multiple';
|
||||||
|
input.id = 'inpic';
|
||||||
|
input.click();
|
||||||
|
input.onchange = e => {
|
||||||
|
var files = e.target.files;
|
||||||
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
var name = files[i].name.trim();
|
||||||
|
if (isFileImage(files[i])) {
|
||||||
|
type = "image";
|
||||||
|
} else {
|
||||||
|
type = "other"
|
||||||
|
}
|
||||||
|
zip.file(name, files[i]);
|
||||||
|
fout.innerHTML += "<div id=\"" + name + "\" style=\"display: flex; flex-direction: row;\">" + "<button type=\"button\" onclick=\"insert_file('" + target + ";" + name + ";" + type + "')\" value=\"" + name + "\" id=\"" + name + "\" class=\"button\">Einfügen</button>" + "<button type=\"button\" onclick=\"rm_file('" + name + "')\" value=\"" + name + "\" id=\"" + name + "\" class=\"button\">Entfernen</button>" + name + "</div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function button(str) {
|
function button(str) {
|
||||||
var arr = str.split(";");
|
var arr = str.split(";");
|
||||||
let x = arr[1];
|
let x = arr[1];
|
||||||
|
@ -74,39 +130,17 @@ function button(str) {
|
||||||
if (desc != null) {var out = "[" + desc + "](" + url + ") ";}
|
if (desc != null) {var out = "[" + desc + "](" + url + ") ";}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (x == "picurl") {
|
||||||
|
let url = prompt("Please enter Link to an image", "https://de.wikipedia.org/static/images/project-logos/dewiki.png");
|
||||||
|
if (url != null) {
|
||||||
|
let desc = prompt("Description", "Wikipedia logo");
|
||||||
|
if (desc != null) {var out = "![" + desc + "](" + url + ") ";}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (x == "headline") {
|
if (x == "headline") {
|
||||||
let headline = prompt("Headline", "Act One");
|
let headline = prompt("Headline", "Act One");
|
||||||
if (headline != null) {var out = "## " + headline + "\n\n";}
|
if (headline != null) {var out = "## " + headline + "\n\n";}
|
||||||
}
|
}
|
||||||
if (x == "pic") {
|
|
||||||
|
|
||||||
|
|
||||||
var input = document.createElement('input');
|
|
||||||
var fout = document.getElementById('added-files');
|
|
||||||
input.type = 'file';
|
|
||||||
input.multiple = 'multiple';
|
|
||||||
input.id = 'inpic';
|
|
||||||
input.click();
|
|
||||||
input.onchange = e => {
|
|
||||||
var files = e.target.files;
|
|
||||||
|
|
||||||
for (var i = 0; i < files.length; i++) {
|
|
||||||
var name = files[i].name.trim();
|
|
||||||
var p = "Desc for " + name;
|
|
||||||
var desc = prompt(p, "Wikipedia logo");
|
|
||||||
if (desc) {
|
|
||||||
zip.file(name, files[i]);
|
|
||||||
var pic = name;
|
|
||||||
var out = "![" + desc + "](" + pic + ") \n\n";
|
|
||||||
typeInTextarea(out);
|
|
||||||
var end = id.value.length;
|
|
||||||
id.setSelectionRange(end, end);
|
|
||||||
id.focus({preventScroll: true});
|
|
||||||
fout.innerHTML += "<div id=\"" + name + "\" style=\"display: flex; flex-direction: row;\">" + pic + "<button type=\"button\" onclick=\"rm_file('" + name + "')\" value=\"" + name + "\" id=\"" + name + "\">remove</button></div>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (x == "bold") {
|
if (x == "bold") {
|
||||||
let bold = prompt("Bold", "");
|
let bold = prompt("Bold", "");
|
||||||
if (bold != null) {var out = "\*\*" + bold + "\*\* ";}
|
if (bold != null) {var out = "\*\*" + bold + "\*\* ";}
|
||||||
|
@ -145,12 +179,10 @@ function testor(input) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInput(e) {
|
function showInput(e) {
|
||||||
document.getElementById("result").innerHTML = '';
|
|
||||||
e.preventDefault();
|
|
||||||
document.getElementById("result").style.display = "flex";
|
|
||||||
var display = document.getElementById("result");
|
var display = document.getElementById("result");
|
||||||
|
display.innerHTML = '';
|
||||||
|
e.preventDefault();
|
||||||
|
display.style.display = "flex";
|
||||||
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var datestring = d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2) + "T" + ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2) + ":00+02:00";
|
var datestring = d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2) + "T" + ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2) + ":00+02:00";
|
||||||
|
@ -272,7 +304,6 @@ function showInput(e) {
|
||||||
var output = "---\n";
|
var output = "---\n";
|
||||||
var output = output + "title: \"" + title.trim() + "\"\n";
|
var output = output + "title: \"" + title.trim() + "\"\n";
|
||||||
|
|
||||||
|
|
||||||
if (lastmod) {
|
if (lastmod) {
|
||||||
var output = output + "lastmod: " + lastmod.trim() + "\n";
|
var output = output + "lastmod: " + lastmod.trim() + "\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -325,14 +356,11 @@ function showInput(e) {
|
||||||
}
|
}
|
||||||
var output = output + "---\n";
|
var output = output + "---\n";
|
||||||
if (summary) {
|
if (summary) {
|
||||||
var output = output + summary.trim() + "\n" + "<!--more-->" + "\n";
|
var output = output + summary.trim() + "\n" + "<!--more-->" + "\n";
|
||||||
}
|
}
|
||||||
if (content) {
|
if (content) {
|
||||||
var output = output + content.trim();
|
var output = output + content.trim();
|
||||||
}
|
}
|
||||||
if (output) {
|
|
||||||
display.innerHTML += output.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add an top-level, arbitrary text file with contents
|
// Add an top-level, arbitrary text file with contents
|
||||||
zip.file("index.de.md", output);
|
zip.file("index.de.md", output);
|
||||||
|
@ -342,15 +370,28 @@ function showInput(e) {
|
||||||
var t = t.replaceAll(/\s+/g, '-');
|
var t = t.replaceAll(/\s+/g, '-');
|
||||||
|
|
||||||
var t = t.replace(/[^\w.-]+/g, "");
|
var t = t.replace(/[^\w.-]+/g, "");
|
||||||
|
archive_name = datestring_shorter + "-" + t + ".zip";
|
||||||
|
|
||||||
var archive_name = datestring_shorter + "-" + t + ".zip";
|
var check_banner = false;
|
||||||
|
|
||||||
// Generate the zip file asynchronously
|
for(let [filename, file] of Object.entries(zip.files)) {
|
||||||
zip.generateAsync({type:"blob"})
|
console.log(filename);
|
||||||
.then(function(cont) {
|
if (filename.startsWith("banner")) { check_banner = true; }
|
||||||
// Force down of the Zip file
|
}
|
||||||
saveAs(cont, archive_name);
|
if (output) {
|
||||||
});
|
display.innerHTML += "<button style=\"background: #69c839;\" class=\"button\" onclick=\"dl_archive()\" type=\"button\" \">Save Archive</button><br>";
|
||||||
|
if (check_banner == false) {
|
||||||
|
display.innerHTML += "<br>\n<div>A Nice Banner (1920x850px) is missing</div>"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dl_archive() {
|
||||||
|
// Generate the zip file asynchronously
|
||||||
|
zip.generateAsync({type:"blob"})
|
||||||
|
.then(function(cont) {
|
||||||
|
// Force down of the Zip file
|
||||||
|
saveAs(cont, archive_name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user