summaryrefslogtreecommitdiffstats
path: root/_includes
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-12-01 23:50:20 +0100
committersijanec <sijanecantonluka@gmail.com>2020-12-01 23:50:20 +0100
commit5fdb8d8f43e15b9581e8320153eb2e8c24cedac8 (patch)
tree05f9192f178fd698c0a62c9582b0c5d5592f6d67 /_includes
parentdodal https predlog - hostname fix (diff)
downloadsijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar.gz
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar.bz2
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar.lz
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar.xz
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.tar.zst
sijanec.eu-5fdb8d8f43e15b9581e8320153eb2e8c24cedac8.zip
Diffstat (limited to '_includes')
-rw-r--r--_includes/commentreplyform.html18
-rw-r--r--_includes/commentsthread.html47
l---------_includes/main.js1
l---------_includes/main.scss1
4 files changed, 37 insertions, 30 deletions
diff --git a/_includes/commentreplyform.html b/_includes/commentreplyform.html
new file mode 100644
index 0000000..99ffaf3
--- /dev/null
+++ b/_includes/commentreplyform.html
@@ -0,0 +1,18 @@
+{% comment %}
+ argv: thisid,uid
+ return: html form
+ langstrings used: comment.taplaceholder, basic.nepodpiraiframe
+{% endcomment %}
+{% capture return %}
+ <form target=comstatus{{ argv[1] }} action=/api?m=commentreply method=POST class=commentform >
+ <input type=text name=vzdevek placeholder="Vzdevek pošiljatelja" />
+ <input type=submit name=submit value=Objavi! />
+ <textarea placeholder="{{ site.data.lang.comment.taplaceholder }}" name=message ></textarea>
+ {% comment %}
+ assign thisid = "comment|" | append: comment.author | append: "|" | append: comment.date <!-- rajši imamo xss-safe nonce !!! thisid se generira prej -->
+ {% endcomment %}
+ <input type=hidden name=parent value="{{ argv[0] | replace: '"', "&quot;" }}" />
+ <input type=hidden name=is-submitter-human value=true />
+ <iframe id=comstatus{{ argv[1] }}>{{ site.data.lang.basic.nepodpiraiframe }}</iframe>
+ </form>
+{% endcapture %}
diff --git a/_includes/commentsthread.html b/_includes/commentsthread.html
index 84647f7..2e1119a 100644
--- a/_includes/commentsthread.html
+++ b/_includes/commentsthread.html
@@ -1,10 +1,7 @@
{% comment %}
argv: id_of_object_whose_posts_you_want,__isinathread
- return: nothing. outputs html directly.
+ return: next UID. outputs html directly.
{% endcomment %}
-{% capture taplaceholder %}Vpišite besedilo komentarja (markdown omogočen).
-POMEMBNO: Zaradi tehničnih razlogov (veriga blokov) dokončen izbris komentarja (niti vzdevka avtorja) iz Interneta ni mogoč!{% endcapture %}
-{% capture nepodpiraiframe %}Vaš brskalnik ne podpira <pre>iframe</pre> elementa, ki je potreben za vpogled v status oddaje komentarja.{% endcapture %}
{% capture editnotice %}
Komentar lahko uredi samo tisti, ki ga je napisal. Komentar uredite v brskalniku, v katerem ste ga napisali. Bodisi piškotek bodisi IP naslov mora biti enak prejšnji oddaji komentarja. Če se objavo uredi še naslednjič, se to lahko stori iz katerega koli IP naslova in piškotka, ki se je uporabil pri predhodnih urejanjih.{% endcapture %}
{% assign comments = site.data.comments | where: "parent", argv[0] %}
@@ -27,7 +24,8 @@ Komentar lahko uredi samo tisti, ki ga je napisal. Komentar uredite v brskalniku
V {{ return }} je {{ comment.author || replace: "<", "&lt;" }} komentiral:
</small>
<p>
- {{ comment.message | replace: "<", "&lt;" | replace: "!", "&#33;" | markdownify }}
+ {% assign safemsg = comment.message | replace: "<", "&lt;" | replace: "!", "&#33;" %}
+ {{ safemsg | markdownify }}
</p>
<small class=dimmedtext>
<a href="mailto:anton@sijanec.eu?subject=Prijava%20neprimernega%20komentarja%20na%20blogu.">
@@ -38,36 +36,25 @@ Komentar lahko uredi samo tisti, ki ga je napisal. Komentar uredite v brskalniku
<a>
odgovori</a>
</label>
- <input type=checkbox id=checkbox{{ uid }} class=commentreplycheckbox >
- <div hidden=hidden class=commentform>
- <!--
- <form target=comstatus{{ uid }} action=/api?m=commentreply type=POST>
- <input type=text name=vzdevek placeholder="Vzdevek pošiljatelja" />
- <input type=submit value=Objavi! />
- <textarea placeholder="{{ taplaceholder }}" name=message ></textarea>
- {% assign thisid = "comment|" | append: comment.author | append: "|" | append: comment.date %}
- <input type=hidden name=parent value="{{ thisid | replace: '"', "&quot;" }}" />
- <iframe id=comstatus{{ uid }}>{{ nepodpiraiframe }}</iframe>
- </form>
- -->
- Objavljanje komentarjev še ni izdelano.
+ <input type=checkbox id=checkbox{{ uid }} class=showhide-checkbox >
+ <div class=showhide-hiddenelement>
+ {% assign thisid = "comment|" | append: comment.nonce %}
+ {% assign argv = thisid | append: "," | append: uid | split: "," %}
+ {% include commentreplyform.html %} {{ return }}
</div>
|
<label for=edit{{ uid }}>
<a>uredi</a>
</label>
- <input type=checkbox id=edit{{ uid }} class=commentreplycheckbox >
- <div class=commentform >
- <!--
- <form action=POST action=/api?m=commentedit target=editstatus{{ uid }} >
- <input type=text name=vzdevek value="{{ comment.author | replace: '"', "&quot;" }}" />
- <input type=submit value=Uredi! />
- <textarea placeholder="{{ taplaceholder }}{{editnotice}}" name=message ></textarea>
- <input type=hidden name=commentid value="{{ thisid | replace: '"', '&quot;' }}"/>
- <iframe id=editstatus{{ uid }} >{{ nepodpiraiframe }}</iframe>
- </form>
- -->
- Urejanje komentarjev še ni izdelano.
+ <input type=checkbox id=edit{{ uid }} class=showhide-checkbox >
+ <div class=showhide-hiddenelement >
+ <form class=commentform method=POST action=/api?m=commentedit target=editstatus{{ uid }} >
+ <input type=text name=vzdevek value="{{ comment.author | replace: '&', "&amp;" | replace: '"', "&quot;" }}" />
+ <input type=submit value=Uredi! />
+ <textarea placeholder="{{ taplaceholder }}{{ editnotice }}" name=message >{{ safemsg | replace: "&#33;", "!" }}</textarea>
+ <input type=hidden name=commentid value="{{ thisid | replace: '"', '&quot;' }}"/>
+ <iframe id=editstatus{{ uid }} >{{ nepodpiraiframe }}</iframe>
+ </form>
</div>
</small>
{% assign argv = "true" | split: "," %}
diff --git a/_includes/main.js b/_includes/main.js
new file mode 120000
index 0000000..9f673d3
--- /dev/null
+++ b/_includes/main.js
@@ -0,0 +1 @@
+../assets/js/main.js \ No newline at end of file
diff --git a/_includes/main.scss b/_includes/main.scss
new file mode 120000
index 0000000..a47427a
--- /dev/null
+++ b/_includes/main.scss
@@ -0,0 +1 @@
+../_sass/main.scss \ No newline at end of file