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:
Andreas Rumpf 2017-05-29 10:59:59 +02:00
commit c895d18ccb
10 changed files with 12 additions and 11 deletions

View file

@ -1,5 +1,5 @@
import karax, karaxdsl, vdom, dom, components
import karax, karaxdsl, vdom, kdom, components
const
Play = 0

View file

@ -1,7 +1,7 @@
## Example that shows how to accomplish an "infinitely scrolling" app.
include karaxprelude
import jstrutils, dom
import jstrutils, kdom, vstyles
var entries: seq[cstring] = @[]
for i in 1..500:
@ -16,7 +16,8 @@ proc scrollEvent(ev: Event; n: VNode) =
proc createDom(): VNode =
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:
tdiv:
text x

View file

@ -1,4 +1,4 @@
import dom, kajax
import kdom, kajax
proc cb(httpStatus: int, response: cstring) =
echo "Worked!"

View file

@ -1,5 +1,5 @@
import vdom, vstyles, components, karax, karaxdsl, jdict, jstrutils, dom
import vdom, vstyles, components, karax, karaxdsl, jdict, jstrutils, kdom
var
images: seq[cstring] = @[cstring"a", "b", "c", "d"]

View file

@ -1,6 +1,6 @@
## 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
StateDict*[V] = ref object

View file

@ -1,8 +1,8 @@
## 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.}
## the preferred way of debugging karax applications.

View file

@ -1,6 +1,6 @@
## Virtual DOM implementation for Karax.
from dom import Event, Node
from kdom import Event, Node
import shash, macros, vstyles
from strutils import toUpperAscii

View file

@ -1,5 +1,5 @@
import dom, macros
import kdom, macros
type
StyleAttr* {.pure.} = enum ## the style attributes supported by the virtual DOM.

View file

@ -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
entries: seq[cstring]