mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Referer cleanup
This commit is contained in:
parent
1e55f21fa5
commit
7bdf5b0f76
3 changed files with 15 additions and 10 deletions
|
|
@ -39,8 +39,18 @@ proc linkText*(text: string; class=""): VNode =
|
|||
buildHtml():
|
||||
a(href=url, class=class): text text
|
||||
|
||||
proc refererField*(path: string): VNode =
|
||||
buildHtml():
|
||||
verbatim "<input name=\"referer\" style=\"display: none\" value=\"$1\"/>" % path
|
||||
|
||||
proc iconReferer*(icon, action, path: string, title=""): VNode =
|
||||
buildHtml(form(`method`="get", action=action, class="icon-button")):
|
||||
verbatim "<input name=\"referer\" style=\"display: none\" value=\"$1\"/>" % path
|
||||
refererField path
|
||||
button(`type`="submit"):
|
||||
icon icon, title=title
|
||||
|
||||
proc buttonReferer*(action, text, path: string; class=""; `method`="post"): VNode =
|
||||
buildHtml(form(`method`=`method`, action=action, class=class)):
|
||||
refererField path
|
||||
button(`type`="submit"):
|
||||
text text
|
||||
|
|
|
|||
Loading…
Reference in a new issue