renamed dom module to 'kdom' to avoid conflicts with Nim's stdlib dom module; it will further diverge from it anyway
This commit is contained in:
parent
d6c7be7106
commit
c895d18ccb
10 changed files with 12 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import karax, karaxdsl, vdom, dom, components
|
import karax, karaxdsl, vdom, kdom, components
|
||||||
|
|
||||||
const
|
const
|
||||||
Play = 0
|
Play = 0
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
## Example that shows how to accomplish an "infinitely scrolling" app.
|
## Example that shows how to accomplish an "infinitely scrolling" app.
|
||||||
|
|
||||||
include karaxprelude
|
include karaxprelude
|
||||||
import jstrutils, dom
|
import jstrutils, kdom, vstyles
|
||||||
|
|
||||||
var entries: seq[cstring] = @[]
|
var entries: seq[cstring] = @[]
|
||||||
for i in 1..500:
|
for i in 1..500:
|
||||||
|
|
@ -16,7 +16,8 @@ proc scrollEvent(ev: Event; n: VNode) =
|
||||||
|
|
||||||
proc createDom(): VNode =
|
proc createDom(): VNode =
|
||||||
result = buildHtml():
|
result = buildHtml():
|
||||||
tdiv(onscroll=scrollEvent, style="height: 400px; overflow: scroll"):
|
tdiv(onscroll=scrollEvent, style=style(
|
||||||
|
(StyleAttr.height, cstring"400px"), (StyleAttr.overflow, cstring"scroll"))):
|
||||||
for x in entries:
|
for x in entries:
|
||||||
tdiv:
|
tdiv:
|
||||||
text x
|
text x
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import dom, kajax
|
import kdom, kajax
|
||||||
|
|
||||||
proc cb(httpStatus: int, response: cstring) =
|
proc cb(httpStatus: int, response: cstring) =
|
||||||
echo "Worked!"
|
echo "Worked!"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import vdom, vstyles, components, karax, karaxdsl, jdict, jstrutils, dom
|
import vdom, vstyles, components, karax, karaxdsl, jdict, jstrutils, kdom
|
||||||
|
|
||||||
var
|
var
|
||||||
images: seq[cstring] = @[cstring"a", "b", "c", "d"]
|
images: seq[cstring] = @[cstring"a", "b", "c", "d"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
## Components in Karax are built by the ``.component`` macro annotation.
|
## Components in Karax are built by the ``.component`` macro annotation.
|
||||||
|
|
||||||
import macros, jdict, dom, vdom, tables, strutils
|
import macros, jdict, kdom, vdom, tables, strutils
|
||||||
|
|
||||||
type
|
type
|
||||||
StateDict*[V] = ref object
|
StateDict*[V] = ref object
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
## Karax -- Single page applications for Nim.
|
## Karax -- Single page applications for Nim.
|
||||||
|
|
||||||
import dom, vdom, jstrutils, components, jdict, vstyles
|
import kdom, vdom, jstrutils, components, jdict, vstyles
|
||||||
|
|
||||||
export dom.Event
|
export kdom.Event
|
||||||
|
|
||||||
proc kout*[T](x: T) {.importc: "console.log", varargs.}
|
proc kout*[T](x: T) {.importc: "console.log", varargs.}
|
||||||
## the preferred way of debugging karax applications.
|
## the preferred way of debugging karax applications.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
## Virtual DOM implementation for Karax.
|
## Virtual DOM implementation for Karax.
|
||||||
|
|
||||||
from dom import Event, Node
|
from kdom import Event, Node
|
||||||
import shash, macros, vstyles
|
import shash, macros, vstyles
|
||||||
from strutils import toUpperAscii
|
from strutils import toUpperAscii
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import dom, macros
|
import kdom, macros
|
||||||
|
|
||||||
type
|
type
|
||||||
StyleAttr* {.pure.} = enum ## the style attributes supported by the virtual DOM.
|
StyleAttr* {.pure.} = enum ## the style attributes supported by the virtual DOM.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import dom, vdom, times, karax, karaxdsl, jdict, jstrutils, parseutils, sequtils
|
import kdom, vdom, times, karax, karaxdsl, jdict, jstrutils, parseutils, sequtils
|
||||||
|
|
||||||
var
|
var
|
||||||
entries: seq[cstring]
|
entries: seq[cstring]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue