Skip to content

Commit

Permalink
Merge pull request #12 from webability-go/late-night
Browse files Browse the repository at this point in the history
v0.0.11
  • Loading branch information
metalwolf committed Apr 13, 2020
2 parents d0f6067 + fda2944 commit 1b75472
Show file tree
Hide file tree
Showing 31 changed files with 424 additions and 185 deletions.
18 changes: 11 additions & 7 deletions README.md
Expand Up @@ -20,35 +20,39 @@ TO DO:
Version Changes Control
=======================

v0.0.10 - 2020-03-08
v0.0.11 - 2020-04-13
------------------------
- Added parameters to creation of containers, zones, dataset and elements

v0.0.10 - 2020-04-08
------------------------
- Added know child "code" to event

v0.0.9 - 2020-03-08
v0.0.9 - 2020-04-08
------------------------
- Correction of event node so code is into code node.

v0.0.8 - 2020-03-08
v0.0.8 - 2020-04-08
------------------------
- Correction of all the Types of containers and elements to put correct js library name (nameContainer and nameElement syntax)

v0.0.7 - 2020-03-08
v0.0.7 - 2020-04-08
------------------------
- Added MarshalXML on Node to build XML code from nodes

v0.0.6 - 2020-03-08
v0.0.6 - 2020-04-08
------------------------
- Correction on assigning the node data (concatened, only if some info into it: will ignore spaces and line formatting characters)

v0.0.5 - 2020-03-07
v0.0.5 - 2020-04-07
-----------------------
- Added UnmarshalXML
- Added MarshalJSON
- Added basic functions AddMessage, AddHelp, AddEvent to a Node, with auto creation of children nodes
- Removed messages, events, help attributes of Node
- Added AddZone() to SeparatorContainer as a new struct extended from DomDef interface to build upon specific functions for specific nodes (it works)

v0.0.4 - 2020-03-06
v0.0.4 - 2020-04-06
-----------------------
- All structures and Application tree implemented in GO
- Full wajaf JS available in js directory
24 changes: 17 additions & 7 deletions accordioncontainer.go
@@ -1,27 +1,37 @@
package wajaf

type AccordionContainer NodeDef
type AccordionContainer struct {
NodeDef
}

func NewAccordionContainer(id string) AccordionContainer {
func NewAccordionContainer(id string) *AccordionContainer {

c := NewNode("container", "accordionContainer")
c := &AccordionContainer{
NodeDef: NewNode("container", "accordionContainer"),
}
c.SetID(id)

c.RegisterKnownAttributes([]string{"display", "style", "classname", "classnamezone", "left", "width", "right", "top", "height", "bottom", "haslistener"})
c.RegisterKnownChildren([]string{"zone", "event", "help", "message"})
c.RegisterKnownChildren([]string{"zone", "event", "help"})

return c
}

func (c *AccordionContainer) NewZone(ztype string, id string) NodeDef {
z := NewAccordionZone(ztype, id)
c.AddChild(z)
return z
}

type AccordionZone NodeDef

func NewAccordionZone(id string) AccordionZone {
func NewAccordionZone(ztype string, id string) AccordionZone {

z := NewNode("zone", "")
z := NewNode("zone", ztype)
z.SetID(id)

z.RegisterKnownAttributes([]string{"style", "classname", "application", "params"})
z.RegisterKnownChildren([]string{"container", "element"})
z.RegisterKnownChildren([]string{"container", "element", "event", "help"})

return z
}
2 changes: 1 addition & 1 deletion application.go
Expand Up @@ -8,7 +8,7 @@ func NewApplication(id string) Application {
app.SetID(id)

app.RegisterKnownAttributes([]string{"id", "enforce", "style"})
app.RegisterKnownChildren([]string{"container", "element"})
app.RegisterKnownChildren([]string{"container", "element", "event"})

return app
}
24 changes: 17 additions & 7 deletions barcontainer.go
@@ -1,27 +1,37 @@
package wajaf

type BarContainer NodeDef
type BarContainer struct {
NodeDef
}

func NewBarContainer(id string) BarContainer {
func NewBarContainer(id string) *BarContainer {

c := NewNode("container", "barContainer")
c := &BarContainer{
NodeDef: NewNode("container", "barContainer"),
}
c.SetID(id)

c.RegisterKnownAttributes([]string{"display", "style", "classname", "classnamezone", "left", "width", "right", "top", "height", "bottom", "haslistener"})
c.RegisterKnownChildren([]string{"zone"})
c.RegisterKnownChildren([]string{"zone", "event", "help"})

return c
}

func (c *BarContainer) NewZone(ztype string, id string) NodeDef {
z := NewBarZone(ztype, id)
c.AddChild(z)
return z
}

type BarZone NodeDef

func NewBarZone(id string) BarZone {
func NewBarZone(ztype string, id string) BarZone {

z := NewNode("zone", "")
z := NewNode("zone", ztype)
z.SetID(id)

z.RegisterKnownAttributes([]string{"style", "classname", "application", "params"})
z.RegisterKnownChildren([]string{"container", "element"})
z.RegisterKnownChildren([]string{"container", "element", "event", "help"})

return z
}
4 changes: 3 additions & 1 deletion buttonelement.go
Expand Up @@ -2,7 +2,7 @@ package wajaf

type ButtonElement NodeDef

func NewButtonElement(id string) ButtonElement {
func NewButtonElement(id string, action string) ButtonElement {

e := NewNode("element", "buttonElement")
e.SetID(id)
Expand All @@ -11,5 +11,7 @@ func NewButtonElement(id string) ButtonElement {
"visible", "action", "status", "extra"})
// e.RegisterKnownMessages([]string{"titleinsert", "titleupdate", "titledelete", "titleview"})

e.SetAttribute("action", action)

return e
}
3 changes: 2 additions & 1 deletion codeelement.go
Expand Up @@ -2,10 +2,11 @@ package wajaf

type CodeElement NodeDef

func NewCodeElement(id string) CodeElement {
func NewCodeElement(id string, code string) CodeElement {

e := NewNode("element", "codeElement")
e.SetID(id)
e.SetData(code)

e.RegisterKnownAttributes([]string{"display", "style", "classname", "left", "width", "right", "top", "height", "bottom"})

Expand Down
44 changes: 33 additions & 11 deletions dblistcontainer.go
@@ -1,36 +1,52 @@
package wajaf

type DBListContainer NodeDef
type DBListContainer struct {
NodeDef
}

func NewDBListContainer(id string) DBListContainer {
func NewDBListContainer(id string) *DBListContainer {

c := NewNode("container", "dblistContainer")
c := &DBListContainer{
NodeDef: NewNode("container", "dblistContainer"),
}
c.SetID(id)

c.RegisterKnownAttributes([]string{"display", "style", "classname", "classnamezone", "left", "width", "right", "top", "height", "bottom", "haslistener"})
c.RegisterKnownChildren([]string{"zone", "template", "dataset"})
c.RegisterKnownChildren([]string{"zone", "template", "dataset", "event", "help"})

return c
}

func (c *DBListContainer) NewZone(ztype string, id string) NodeDef {
z := NewDBListZone(ztype, id)
c.AddChild(z)
return z
}

type DBListZone NodeDef

func NewDBListZone(id string) DBListZone {
func NewDBListZone(id string, ztype string) DBListZone {

z := NewNode("zone", "")
z := NewNode("zone", ztype)
z.SetID(id)

z.RegisterKnownAttributes([]string{"style", "classname", "application", "params"})
z.RegisterKnownChildren([]string{"container", "element"})
z.RegisterKnownChildren([]string{"container", "element", "event", "help"})

return z
}

func (c *DBListContainer) NewTemplate(ttype string, name string) NodeDef {
z := NewDBListTemplate(ttype, name)
c.AddChild(z)
return z
}

type DBListTemplate NodeDef

func NewDBListTemplate(name string) DBListTemplate {
func NewDBListTemplate(ttype string, name string) DBListTemplate {

t := NewNode("template", "")
t := NewNode("template", ttype)

t.RegisterKnownAttributes([]string{"name"})
t.RegisterKnownChildren([]string{"container", "element"})
Expand All @@ -40,11 +56,17 @@ func NewDBListTemplate(name string) DBListTemplate {
return t
}

func (c *DBListContainer) NewDataset(dtype string, data string) NodeDef {
z := NewDBListDataset(dtype, data)
c.AddChild(z)
return z
}

type DBListDataset NodeDef

func NewDBListDataset(data string) DBListDataset {
func NewDBListDataset(dtype string, data string) DBListDataset {

d := NewNode("dataset", "")
d := NewNode("dataset", dtype)
d.SetData(data)

return d
Expand Down
14 changes: 0 additions & 14 deletions decoder.go

This file was deleted.

24 changes: 17 additions & 7 deletions dockcontainer.go
@@ -1,27 +1,37 @@
package wajaf

type DockContainer NodeDef
type DockContainer struct {
NodeDef
}

func NewDockContainer(id string) DockContainer {
func NewDockContainer(id string) *DockContainer {

c := NewNode("container", "dockContainer")
c := &DockContainer{
NodeDef: NewNode("container", "dockContainer"),
}
c.SetID(id)

c.RegisterKnownAttributes([]string{"display", "style", "classname", "classnamezone", "left", "width", "right", "top", "height", "bottom", "haslistener"})
c.RegisterKnownChildren([]string{"zone"})
c.RegisterKnownChildren([]string{"zone", "event", "help"})

return c
}

func (c *DockContainer) NewZone(ztype string, id string) NodeDef {
z := NewDockZone(ztype, id)
c.AddChild(z)
return z
}

type DockZone NodeDef

func NewDockZone(id string) DockZone {
func NewDockZone(ztype string, id string) DockZone {

z := NewNode("zone", "")
z := NewNode("zone", ztype)
z.SetID(id)

z.RegisterKnownAttributes([]string{"style", "classname", "application", "params"})
z.RegisterKnownChildren([]string{"container", "element"})
z.RegisterKnownChildren([]string{"container", "element", "event", "help"})

return z
}
24 changes: 17 additions & 7 deletions expandablecontainer.go
@@ -1,28 +1,38 @@
package wajaf

type ExpandableContainer NodeDef
type ExpandableContainer struct {
NodeDef
}

func NewExpandableContainer(id string) ExpandableContainer {
func NewExpandableContainer(id string) *ExpandableContainer {

c := NewNode("container", "expandableContainer")
c := &ExpandableContainer{
NodeDef: NewNode("container", "expandableContainer"),
}
c.SetID(id)

c.RegisterKnownAttributes([]string{"display", "style", "classname", "classnamezone", "left", "width", "right", "top", "height", "bottom", "haslistener"})
c.RegisterKnownChildren([]string{"zone"})
c.RegisterKnownChildren([]string{"zone", "event", "help"})

return c
}

func (c *ExpandableContainer) NewZone(ztype string, id string) NodeDef {
z := NewExpandableZone(ztype, id)
c.AddChild(z)
return z
}

type ExpandableZone NodeDef

func NewExpandableZone(id string) ExpandableZone {
func NewExpandableZone(ztype string, id string) ExpandableZone {

z := NewNode("zone", "")
z := NewNode("zone", ztype)
z.SetID(id)

z.RegisterKnownAttributes([]string{"style", "classname", "application", "params",
"title", "closed", "classnameselectoropen", "classnameselectorclose", "display"})
z.RegisterKnownChildren([]string{"container", "element"})
z.RegisterKnownChildren([]string{"container", "element", "event", "help"})

return z
}

0 comments on commit 1b75472

Please sign in to comment.