Initial commit with some working code and basic example.
This commit is contained in:
37
common/const.go
Normal file
37
common/const.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package common
|
||||
|
||||
const (
|
||||
HTMLElementA = "a"
|
||||
HTMLElementBody = "body"
|
||||
HTMLElementButton = "button"
|
||||
HTMLElementDiv = "div"
|
||||
HTMLElementDocument = "document"
|
||||
HTMLElementHead = "head"
|
||||
HTMLElementLink = "link"
|
||||
HTMLElementMeta = "meta"
|
||||
HTMLElementNav = "nav"
|
||||
HTMLElementP = "p"
|
||||
HTMLElementSection = "section"
|
||||
|
||||
HTMLElementParameterClassList = "classList"
|
||||
HTMLElementParameterHref = "href"
|
||||
HTMLElementParameterID = "id"
|
||||
HTMLElementParameterRel = "rel"
|
||||
HTMLElementParameterRole = "role"
|
||||
|
||||
HTMLMetaParameterCharset = "charset"
|
||||
HTMLMetaParameterContent = "content"
|
||||
HTMLMetaParameterName = "name"
|
||||
|
||||
HTMLHeadElementTitle = "title"
|
||||
|
||||
JSCallAdd = "add"
|
||||
JSCallAddEventListener = "addEventListener"
|
||||
JSCallAppendChild = "appendChild"
|
||||
JSCallCreateElement = "createElement"
|
||||
JSCallQuerySelector = "querySelector"
|
||||
|
||||
JSConsole = "console"
|
||||
|
||||
JSEventDOMContentLoaded = "DOMContentLoaded"
|
||||
)
|
10
common/log.go
Normal file
10
common/log.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/gopherjs/gopherjs/js"
|
||||
)
|
||||
|
||||
// Log logs everything passed to Javascript console.
|
||||
func Log(args ...interface{}) {
|
||||
js.Global.Get(JSConsole).Call("log", args...)
|
||||
}
|
Reference in New Issue
Block a user