diff --git a/README.md b/README.md index 19b173e..46ca43d 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,14 @@ More information about Go's WebAssembly support can be found on [Go's WebAssembl Pull the library and install `wasm-server` (optional): ``` -go get -u github.com/dennwc/dom -go install github.com/dennwc/dom/cmd/wasm-server +go get -u github.com/itskass/dom +go install github.com/itskass/dom/cmd/wasm-server ``` Run an example app: ``` -cd $GOPATH/src/github.com/dennwc/dom +cd $GOPATH/src/github.com/itskass/dom wasm-server ``` diff --git a/cmd/app/main.go b/cmd/app/main.go index 225b68c..526478c 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/dennwc/dom" - "github.com/dennwc/dom/storage" - "github.com/dennwc/dom/svg" + "github.com/itskass/dom" + "github.com/itskass/dom/storage" + "github.com/itskass/dom/svg" ) func init() { diff --git a/cmd/wasm-server/main.go b/cmd/wasm-server/main.go index 5a6ac3a..33d15f7 100644 --- a/cmd/wasm-server/main.go +++ b/cmd/wasm-server/main.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "github.com/dennwc/dom/internal/goenv" + "github.com/itskass/dom/internal/goenv" ) var ( diff --git a/document.go b/document.go index 1f09006..e6d1af8 100644 --- a/document.go +++ b/document.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" func GetDocument() *Document { doc := js.Get("document") diff --git a/element.go b/element.go index f5fe262..81bda35 100644 --- a/element.go +++ b/element.go @@ -3,7 +3,7 @@ package dom import ( "fmt" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) var _ Node = (*Element)(nil) diff --git a/event.go b/event.go index cd6cb79..e927496 100644 --- a/event.go +++ b/event.go @@ -1,7 +1,7 @@ package dom import ( - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) type EventTarget interface { diff --git a/examples/go.mod b/examples/go.mod index 9458a89..0818314 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,10 +1,10 @@ -module github.com/dennwc/dom/examples +module github.com/itskass/dom/examples require ( - github.com/dennwc/dom v0.2.1 + github.com/itskass/dom v0.2.1 github.com/gogo/protobuf v1.1.1 golang.org/x/net v0.0.0-20181114220301-adae6a3d119a google.golang.org/grpc v1.16.0 ) -replace github.com/dennwc/dom => ../ +replace github.com/itskass/dom => ../ diff --git a/examples/go.sum b/examples/go.sum index b6bcc9e..cec1d6b 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -12,8 +12,8 @@ github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac h1:PThQaO4yC github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dennwc/dom v0.2.1 h1:ADY36S5pLkfm+2l6mWj5XHtt/InVXZROijUG36+lMuY= -github.com/dennwc/dom v0.2.1/go.mod h1:oFVwHbm2UiC3fpTHdNYk78qvsuvdJFnPWSBonoYGdYs= +github.com/itskass/dom v0.2.1 h1:ADY36S5pLkfm+2l6mWj5XHtt/InVXZROijUG36+lMuY= +github.com/itskass/dom v0.2.1/go.mod h1:oFVwHbm2UiC3fpTHdNYk78qvsuvdJFnPWSBonoYGdYs= github.com/dennwc/testproxy v1.0.1 h1:mQhNVWHPolTYjJrDZYKcugIplWRSlFAis6k/Zf1s0c0= github.com/dennwc/testproxy v1.0.1/go.mod h1:EHGV9tzWhMPLmEoVJ2KGyC149XqwKZwBDViCjhKD5d8= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= diff --git a/examples/grpc-over-ws/client.go b/examples/grpc-over-ws/client.go index b7888fc..5cd8291 100644 --- a/examples/grpc-over-ws/client.go +++ b/examples/grpc-over-ws/client.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc" - "github.com/dennwc/dom" - "github.com/dennwc/dom/examples/grpc-over-ws/protocol" - "github.com/dennwc/dom/net/ws" + "github.com/itskass/dom" + "github.com/itskass/dom/examples/grpc-over-ws/protocol" + "github.com/itskass/dom/net/ws" ) func dialer(s string, dt time.Duration) (net.Conn, error) { diff --git a/examples/grpc-over-ws/server.go b/examples/grpc-over-ws/server.go index 6208585..9a26321 100644 --- a/examples/grpc-over-ws/server.go +++ b/examples/grpc-over-ws/server.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc" - "github.com/dennwc/dom/examples/grpc-over-ws/protocol" - "github.com/dennwc/dom/net/ws" + "github.com/itskass/dom/examples/grpc-over-ws/protocol" + "github.com/itskass/dom/net/ws" ) //go:generate GOOS=js GOARCH=wasm go build -o app.wasm ./client.go diff --git a/examples/webrtc/main.go b/examples/webrtc/main.go index 6189201..3ce6de4 100644 --- a/examples/webrtc/main.go +++ b/examples/webrtc/main.go @@ -7,7 +7,7 @@ import ( "io" "time" - "github.com/dennwc/dom/net/webrtc" + "github.com/itskass/dom/net/webrtc" ) func main() { diff --git a/extension/chrome/bookmarks.go b/extension/chrome/bookmarks.go index c97a8d3..cf147aa 100644 --- a/extension/chrome/bookmarks.go +++ b/extension/chrome/bookmarks.go @@ -1,6 +1,6 @@ package chrome -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" type AllBookmarks interface { GetTree() []BookmarkNode diff --git a/extension/chrome/chrome.go b/extension/chrome/chrome.go index 9c06c33..273f17a 100644 --- a/extension/chrome/chrome.go +++ b/extension/chrome/chrome.go @@ -1,6 +1,6 @@ package chrome -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" var ( chrome = js.Get("chrome") diff --git a/extension/chrome/native/native_js.go b/extension/chrome/native/native_js.go index 4750f18..03f7911 100644 --- a/extension/chrome/native/native_js.go +++ b/extension/chrome/native/native_js.go @@ -7,7 +7,7 @@ import ( "fmt" "io" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) // NewApp returns a application instance with a name, as specified in the extension manifest. diff --git a/extension/chrome/tabs.go b/extension/chrome/tabs.go index 7772b56..5e1820c 100644 --- a/extension/chrome/tabs.go +++ b/extension/chrome/tabs.go @@ -1,6 +1,6 @@ package chrome -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" type TabOptions struct { Active bool diff --git a/global.go b/global.go index dab32d3..e5594f0 100644 --- a/global.go +++ b/global.go @@ -3,7 +3,7 @@ package dom import ( "image" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) var ( diff --git a/go.mod b/go.mod index 2627b4f..64df6e5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/dennwc/dom +module github.com/itskass/dom go 1.12 diff --git a/htmlElement.go b/htmlElement.go index 77ec5e5..1154df1 100644 --- a/htmlElement.go +++ b/htmlElement.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement diff --git a/js/js_host_test.go b/js/js_host_test.go index 5696fe7..f5784b1 100644 --- a/js/js_host_test.go +++ b/js/js_host_test.go @@ -5,7 +5,7 @@ package js import ( "testing" - "github.com/dennwc/dom/js/jstest" + "github.com/itskass/dom/js/jstest" ) func TestJS(t *testing.T) { diff --git a/js/js_wasm.go b/js/js_wasm.go index 9709fe4..15ddd74 100644 --- a/js/js_wasm.go +++ b/js/js_wasm.go @@ -41,9 +41,13 @@ func funcOf(fnc func(this Ref, refs []Ref) interface{}) Func { } func typedArrayOf(slice interface{}) Ref { - return js.TypedArrayOf(slice).Value + // return js.TypedArrayOf(slice).Value + var ref js.Value + js.CopyBytesToJS(ref, slice.([]byte)) + return ref } func releaseTypedArray(v Ref) { - js.TypedArray{v}.Release() + // js.TypedArray{v}.Release() + v = js.Null() } diff --git a/js/jstest/build.go b/js/jstest/build.go index 0d32013..1c3f31a 100644 --- a/js/jstest/build.go +++ b/js/jstest/build.go @@ -10,7 +10,7 @@ import ( "os/exec" "testing" - "github.com/dennwc/dom/internal/goenv" + "github.com/itskass/dom/internal/goenv" ) const ( diff --git a/js/jstest/chrome.go b/js/jstest/chrome.go index de7fc88..608a6a5 100644 --- a/js/jstest/chrome.go +++ b/js/jstest/chrome.go @@ -22,7 +22,7 @@ import ( "github.com/chromedp/cdproto/runtime" "github.com/chromedp/chromedp" "github.com/chromedp/chromedp/client" - "github.com/dennwc/dom/internal/goenv" + "github.com/itskass/dom/internal/goenv" "github.com/dennwc/testproxy" "github.com/ory/dockertest" "github.com/ory/dockertest/docker" diff --git a/js/jstest/nodejs.go b/js/jstest/nodejs.go index 1497dcd..e183c47 100644 --- a/js/jstest/nodejs.go +++ b/js/jstest/nodejs.go @@ -15,7 +15,7 @@ import ( "github.com/ory/dockertest" "github.com/ory/dockertest/docker" - "github.com/dennwc/dom/internal/goenv" + "github.com/itskass/dom/internal/goenv" "github.com/stretchr/testify/require" ) diff --git a/net/webrtc/peer_chan.go b/net/webrtc/peer_chan.go index 40083c3..15fd9c2 100644 --- a/net/webrtc/peer_chan.go +++ b/net/webrtc/peer_chan.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) type peerChannel struct { diff --git a/net/webrtc/peer_conn.go b/net/webrtc/peer_conn.go index c19262e..bf6e944 100644 --- a/net/webrtc/peer_conn.go +++ b/net/webrtc/peer_conn.go @@ -8,8 +8,8 @@ import ( "sync" "sync/atomic" - "github.com/dennwc/dom" - "github.com/dennwc/dom/js" + "github.com/itskass/dom" + "github.com/itskass/dom/js" ) const debug = false diff --git a/net/webrtc/webrtc.go b/net/webrtc/webrtc.go index 043026d..d9be2dc 100644 --- a/net/webrtc/webrtc.go +++ b/net/webrtc/webrtc.go @@ -6,7 +6,7 @@ import ( "encoding/json" "net" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) // Peers represents a dynamic list of peers that were discovered via signalling. diff --git a/net/ws/wsconn_js.go b/net/ws/wsconn_js.go index 145712a..4d06c36 100644 --- a/net/ws/wsconn_js.go +++ b/net/ws/wsconn_js.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) var errClosed = errors.New("ws: connection closed") diff --git a/net/ws/wsconn_js_test.go b/net/ws/wsconn_js_test.go index 1dd4289..c7eeec3 100644 --- a/net/ws/wsconn_js_test.go +++ b/net/ws/wsconn_js_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" "github.com/stretchr/testify/require" ) diff --git a/net/ws/wsconn_test.go b/net/ws/wsconn_test.go index 5c06016..8e40b86 100644 --- a/net/ws/wsconn_test.go +++ b/net/ws/wsconn_test.go @@ -3,7 +3,7 @@ package ws import ( - "github.com/dennwc/dom/js/jstest" + "github.com/itskass/dom/js/jstest" "github.com/stretchr/testify/require" "net/http" "net/rpc" diff --git a/node.go b/node.go index 2a99a7d..aba41ac 100644 --- a/node.go +++ b/node.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" type Node interface { EventTarget diff --git a/require/require.go b/require/require.go index 02ff093..22fd8c5 100644 --- a/require/require.go +++ b/require/require.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/dennwc/dom" - "github.com/dennwc/dom/js" + "github.com/itskass/dom" + "github.com/itskass/dom/js" ) var required = make(map[string]error) diff --git a/require/require_js_test.go b/require/require_js_test.go index 801a64f..c67cbd8 100644 --- a/require/require_js_test.go +++ b/require/require_js_test.go @@ -5,7 +5,7 @@ package require import ( "testing" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" "github.com/stretchr/testify/require" ) diff --git a/require/require_test.go b/require/require_test.go index dd75fb3..4a2599e 100644 --- a/require/require_test.go +++ b/require/require_test.go @@ -3,7 +3,7 @@ package require import ( - "github.com/dennwc/dom/js/jstest" + "github.com/itskass/dom/js/jstest" "net/http" "strings" "testing" diff --git a/shadowRoot.go b/shadowRoot.go index 6a18b5e..65c0f65 100644 --- a/shadowRoot.go +++ b/shadowRoot.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" // https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot diff --git a/storage/storage.go b/storage/storage.go index d733013..8445f43 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -1,7 +1,7 @@ package storage import ( - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) func getStorage(name string) Storage { diff --git a/style.go b/style.go index c8651f2..7c8c7b3 100644 --- a/style.go +++ b/style.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" type Style struct { v js.Value diff --git a/svg/svg.go b/svg/svg.go index 526296a..8c94acb 100644 --- a/svg/svg.go +++ b/svg/svg.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/dennwc/dom" - "github.com/dennwc/dom/js" + "github.com/itskass/dom" + "github.com/itskass/dom/js" ) // NewElement creates a new SVG element. diff --git a/tokenList.go b/tokenList.go index 51a1d68..03ff5dc 100644 --- a/tokenList.go +++ b/tokenList.go @@ -1,6 +1,6 @@ package dom -import "github.com/dennwc/dom/js" +import "github.com/itskass/dom/js" func AsTokenList(v js.Value) *TokenList { if !v.Valid() { diff --git a/window.go b/window.go index 2523464..82e6748 100644 --- a/window.go +++ b/window.go @@ -3,7 +3,7 @@ package dom import ( "strings" - "github.com/dennwc/dom/js" + "github.com/itskass/dom/js" ) func GetWindow() *Window {