Update karax, cleanup input code
This commit is contained in:
parent
a63368e871
commit
a419f6c996
3 changed files with 8 additions and 11 deletions
|
@ -17,7 +17,7 @@ requires "jester >= 0.4.3"
|
|||
requires "regex >= 0.11.2"
|
||||
requires "q >= 0.0.7"
|
||||
requires "nimcrypto >= 0.3.9"
|
||||
requires "karax#b99a543"
|
||||
requires "karax#f6bda9a"
|
||||
requires "sass"
|
||||
requires "markdown"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import strutils, strformat, xmltree
|
||||
import karax/[karaxdsl, vdom]
|
||||
import strutils, xmltree
|
||||
import karax/[karaxdsl, vdom, vstyles]
|
||||
|
||||
import ../types, ../utils
|
||||
|
||||
|
@ -37,7 +37,7 @@ proc linkText*(text: string; class=""): VNode =
|
|||
|
||||
proc hiddenField*(name, value: string): VNode =
|
||||
buildHtml():
|
||||
verbatim "<input name=\"$1\" style=\"display: none\" value=\"$2\"/>" % [name, value]
|
||||
input(name=name, style={display: "none"}, value=value)
|
||||
|
||||
proc refererField*(path: string): VNode =
|
||||
hiddenField("referer", path)
|
||||
|
@ -68,7 +68,7 @@ proc genInput*(pref, label, state, placeholder: string; class=""; autofocus=fals
|
|||
buildHtml(tdiv(class=("pref-group pref-input " & class))):
|
||||
if label.len > 0:
|
||||
label(`for`=pref): text label
|
||||
verbatim &"<input name={pref} type=\"text\" placeholder=\"{p}\" value=\"{s}\" {a}/>"
|
||||
input(name=pref, `type`="text", placeholder=p, value=s): text a
|
||||
|
||||
proc genSelect*(pref, label, state: string; options: seq[string]): VNode =
|
||||
buildHtml(tdiv(class="pref-group pref-input")):
|
||||
|
@ -82,10 +82,7 @@ proc genSelect*(pref, label, state: string; options: seq[string]): VNode =
|
|||
|
||||
proc genDate*(pref, state: string): VNode =
|
||||
buildHtml(span(class="date-input")):
|
||||
if state.len > 0:
|
||||
verbatim &"<input name={pref} type=\"date\" value=\"{state}\"/>"
|
||||
else:
|
||||
verbatim &"<input name={pref} type=\"date\"/>"
|
||||
input(name=pref, `type`="date", value=state)
|
||||
icon "calendar"
|
||||
|
||||
proc genImg*(url: string; class=""): VNode =
|
||||
|
|
|
@ -100,8 +100,8 @@ proc renderVideo(video: Video; prefs: Prefs; path: string): VNode =
|
|||
of m3u8, vmap:
|
||||
video(poster=thumb, data-url=source, data-autoload="false")
|
||||
verbatim "<div class=\"video-overlay\" onclick=\"playVideo(this)\">"
|
||||
verbatim "<div class=\"overlay-circle\">"
|
||||
verbatim "<span class=\"overlay-triangle\"</span></div></div>"
|
||||
tdiv(class="overlay-circle"): span(class="overlay-triangle")
|
||||
verbatim "</div>"
|
||||
if container.len > 0:
|
||||
tdiv(class="card-content"):
|
||||
h2(class="card-title"): text video.title
|
||||
|
|
Loading…
Reference in a new issue