{"action":"created","comment":{"url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/comments/32380333","id":32380333,"diff_hunk":"@@ -1,145 +1,239 @@\n // Package ko implements bindings to KnockoutJS.\n // It also has bindings for the Knockout Validation library found on https://github.com/Knockout-Contrib/Knockout-Validation\n+// Using EnableSecureBinding make KnockoutJS works under CSP environments.\n package ko\n \n-import \"github.com/gopherjs/gopherjs/js\"\n+import (\n+\t\"github.com/Archs/js/dom\"\n \n-type Disposable interface {\n-\tDispose()\n-}\n+\t\"github.com/gopherjs/gopherjs/js\"\n+)\n \n-type Observable interface {\n-\tDisposable\n+type Disposer func()\n \n-\tSet(interface{})\n-\tGet() *js.Object\n-\tSubscribe(func(*js.Object)) Disposable\n-\tExtend(js.M) Observable\n+type Observable struct {\n+\to *js.Object\n }\n \n-type ObservableArray interface {\n-\tObservable\n+type ObservableArray struct {\n+\t*Observable\n+}\n \n-\tIndex(int) *js.Object\n-\tLength() int\n-\tPush(interface{})\n-\tRemove(interface{}) *js.Object\n-\tRemoveFunc(func(*js.Object) bool) *js.Object\n+type Computed struct {\n+\t*Observable\n }\n \n-type Computed interface {\n-\tObservable\n+type WritableComputed struct {\n+\t*Computed\n }\n \n-type Object struct {\n-\t*js.Object\n+func (ob *Observable) Set(data interface{}) {\n+\tob.o.Invoke(data)\n }\n \n-func (ob *Object) Dispose() {\n-\tob.Call(\"dispose\")\n+func (ob *Observable) Get() *js.Object {\n+\treturn ob.o.Invoke()\n }\n \n-func (ob *Object) Set(data interface{}) {\n-\tob.Invoke(data)\n+func (ob *Observable) Subscribe(fn func(*js.Object)) Disposer {","path":"ko.go","position":63,"original_position":63,"commit_id":"3abc76cdd88a2d78f209e5bb67b5bff1873d38ae","original_commit_id":"3abc76cdd88a2d78f209e5bb67b5bff1873d38ae","user":{"login":"Archs","id":4538154,"avatar_url":"https://avatars.githubusercontent.com/u/4538154?v=3","gravatar_id":"","url":"https://api.github.com/users/Archs","html_url":"https://github.com/Archs","followers_url":"https://api.github.com/users/Archs/followers","following_url":"https://api.github.com/users/Archs/following{/other_user}","gists_url":"https://api.github.com/users/Archs/gists{/gist_id}","starred_url":"https://api.github.com/users/Archs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Archs/subscriptions","organizations_url":"https://api.github.com/users/Archs/orgs","repos_url":"https://api.github.com/users/Archs/repos","events_url":"https://api.github.com/users/Archs/events{/privacy}","received_events_url":"https://api.github.com/users/Archs/received_events","type":"User","site_admin":false},"body":"Yes, that's good :+1: ","created_at":"2015-06-14T14:42:27Z","updated_at":"2015-06-14T14:42:27Z","html_url":"https://github.com/mibitzi/gopherjs-ko/pull/2#discussion_r32380333","pull_request_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/comments/32380333"},"html":{"href":"https://github.com/mibitzi/gopherjs-ko/pull/2#discussion_r32380333"},"pull_request":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2","id":37639145,"html_url":"https://github.com/mibitzi/gopherjs-ko/pull/2","diff_url":"https://github.com/mibitzi/gopherjs-ko/pull/2.diff","patch_url":"https://github.com/mibitzi/gopherjs-ko/pull/2.patch","issue_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/2","number":2,"state":"open","locked":false,"title":"CSP and ko mapping support, using struct instead of interface to avoid some issues","user":{"login":"Archs","id":4538154,"avatar_url":"https://avatars.githubusercontent.com/u/4538154?v=3","gravatar_id":"","url":"https://api.github.com/users/Archs","html_url":"https://github.com/Archs","followers_url":"https://api.github.com/users/Archs/followers","following_url":"https://api.github.com/users/Archs/following{/other_user}","gists_url":"https://api.github.com/users/Archs/gists{/gist_id}","starred_url":"https://api.github.com/users/Archs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Archs/subscriptions","organizations_url":"https://api.github.com/users/Archs/orgs","repos_url":"https://api.github.com/users/Archs/repos","events_url":"https://api.github.com/users/Archs/events{/privacy}","received_events_url":"https://api.github.com/users/Archs/received_events","type":"User","site_admin":false},"body":"changes made here:\r\n\r\n1. KnockoutJS Secure Bindings API\r\n2. Knockout Mapping API\r\n3. No Interface used (thus not quite compitable with origin implementation, thus no pull request) to avoid some problems with `GopherJS`, see: https://github.com/mibitzi/gopherjs-ko/issues/1\r\n\r\n","created_at":"2015-06-14T10:03:05Z","updated_at":"2015-06-14T14:42:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3e9afeac37360716b8d179685477cc9a08d7744","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2/commits","review_comments_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2/comments","review_comment_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/2/comments","statuses_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/statuses/3abc76cdd88a2d78f209e5bb67b5bff1873d38ae","head":{"label":"Archs:master","ref":"master","sha":"3abc76cdd88a2d78f209e5bb67b5bff1873d38ae","user":{"login":"Archs","id":4538154,"avatar_url":"https://avatars.githubusercontent.com/u/4538154?v=3","gravatar_id":"","url":"https://api.github.com/users/Archs","html_url":"https://github.com/Archs","followers_url":"https://api.github.com/users/Archs/followers","following_url":"https://api.github.com/users/Archs/following{/other_user}","gists_url":"https://api.github.com/users/Archs/gists{/gist_id}","starred_url":"https://api.github.com/users/Archs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Archs/subscriptions","organizations_url":"https://api.github.com/users/Archs/orgs","repos_url":"https://api.github.com/users/Archs/repos","events_url":"https://api.github.com/users/Archs/events{/privacy}","received_events_url":"https://api.github.com/users/Archs/received_events","type":"User","site_admin":false},"repo":{"id":35955374,"name":"gopherjs-ko","full_name":"Archs/gopherjs-ko","owner":{"login":"Archs","id":4538154,"avatar_url":"https://avatars.githubusercontent.com/u/4538154?v=3","gravatar_id":"","url":"https://api.github.com/users/Archs","html_url":"https://github.com/Archs","followers_url":"https://api.github.com/users/Archs/followers","following_url":"https://api.github.com/users/Archs/following{/other_user}","gists_url":"https://api.github.com/users/Archs/gists{/gist_id}","starred_url":"https://api.github.com/users/Archs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Archs/subscriptions","organizations_url":"https://api.github.com/users/Archs/orgs","repos_url":"https://api.github.com/users/Archs/repos","events_url":"https://api.github.com/users/Archs/events{/privacy}","received_events_url":"https://api.github.com/users/Archs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Archs/gopherjs-ko","description":"GopherJS bindings to KnockoutJS","fork":true,"url":"https://api.github.com/repos/Archs/gopherjs-ko","forks_url":"https://api.github.com/repos/Archs/gopherjs-ko/forks","keys_url":"https://api.github.com/repos/Archs/gopherjs-ko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Archs/gopherjs-ko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Archs/gopherjs-ko/teams","hooks_url":"https://api.github.com/repos/Archs/gopherjs-ko/hooks","issue_events_url":"https://api.github.com/repos/Archs/gopherjs-ko/issues/events{/number}","events_url":"https://api.github.com/repos/Archs/gopherjs-ko/events","assignees_url":"https://api.github.com/repos/Archs/gopherjs-ko/assignees{/user}","branches_url":"https://api.github.com/repos/Archs/gopherjs-ko/branches{/branch}","tags_url":"https://api.github.com/repos/Archs/gopherjs-ko/tags","blobs_url":"https://api.github.com/repos/Archs/gopherjs-ko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Archs/gopherjs-ko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Archs/gopherjs-ko/git/refs{/sha}","trees_url":"https://api.github.com/repos/Archs/gopherjs-ko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Archs/gopherjs-ko/statuses/{sha}","languages_url":"https://api.github.com/repos/Archs/gopherjs-ko/languages","stargazers_url":"https://api.github.com/repos/Archs/gopherjs-ko/stargazers","contributors_url":"https://api.github.com/repos/Archs/gopherjs-ko/contributors","subscribers_url":"https://api.github.com/repos/Archs/gopherjs-ko/subscribers","subscription_url":"https://api.github.com/repos/Archs/gopherjs-ko/subscription","commits_url":"https://api.github.com/repos/Archs/gopherjs-ko/commits{/sha}","git_commits_url":"https://api.github.com/repos/Archs/gopherjs-ko/git/commits{/sha}","comments_url":"https://api.github.com/repos/Archs/gopherjs-ko/comments{/number}","issue_comment_url":"https://api.github.com/repos/Archs/gopherjs-ko/issues/comments{/number}","contents_url":"https://api.github.com/repos/Archs/gopherjs-ko/contents/{+path}","compare_url":"https://api.github.com/repos/Archs/gopherjs-ko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Archs/gopherjs-ko/merges","archive_url":"https://api.github.com/repos/Archs/gopherjs-ko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Archs/gopherjs-ko/downloads","issues_url":"https://api.github.com/repos/Archs/gopherjs-ko/issues{/number}","pulls_url":"https://api.github.com/repos/Archs/gopherjs-ko/pulls{/number}","milestones_url":"https://api.github.com/repos/Archs/gopherjs-ko/milestones{/number}","notifications_url":"https://api.github.com/repos/Archs/gopherjs-ko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Archs/gopherjs-ko/labels{/name}","releases_url":"https://api.github.com/repos/Archs/gopherjs-ko/releases{/id}","created_at":"2015-05-20T15:05:51Z","updated_at":"2015-05-20T15:05:51Z","pushed_at":"2015-06-14T10:00:43Z","git_url":"git://github.com/Archs/gopherjs-ko.git","ssh_url":"git@github.com:Archs/gopherjs-ko.git","clone_url":"https://github.com/Archs/gopherjs-ko.git","svn_url":"https://github.com/Archs/gopherjs-ko","homepage":"","size":201,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mibitzi:master","ref":"master","sha":"93e421bbdaa5eb2d7838255d468487ed3e3d66e6","user":{"login":"mibitzi","id":3488011,"avatar_url":"https://avatars.githubusercontent.com/u/3488011?v=3","gravatar_id":"","url":"https://api.github.com/users/mibitzi","html_url":"https://github.com/mibitzi","followers_url":"https://api.github.com/users/mibitzi/followers","following_url":"https://api.github.com/users/mibitzi/following{/other_user}","gists_url":"https://api.github.com/users/mibitzi/gists{/gist_id}","starred_url":"https://api.github.com/users/mibitzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mibitzi/subscriptions","organizations_url":"https://api.github.com/users/mibitzi/orgs","repos_url":"https://api.github.com/users/mibitzi/repos","events_url":"https://api.github.com/users/mibitzi/events{/privacy}","received_events_url":"https://api.github.com/users/mibitzi/received_events","type":"User","site_admin":false},"repo":{"id":35209499,"name":"gopherjs-ko","full_name":"mibitzi/gopherjs-ko","owner":{"login":"mibitzi","id":3488011,"avatar_url":"https://avatars.githubusercontent.com/u/3488011?v=3","gravatar_id":"","url":"https://api.github.com/users/mibitzi","html_url":"https://github.com/mibitzi","followers_url":"https://api.github.com/users/mibitzi/followers","following_url":"https://api.github.com/users/mibitzi/following{/other_user}","gists_url":"https://api.github.com/users/mibitzi/gists{/gist_id}","starred_url":"https://api.github.com/users/mibitzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mibitzi/subscriptions","organizations_url":"https://api.github.com/users/mibitzi/orgs","repos_url":"https://api.github.com/users/mibitzi/repos","events_url":"https://api.github.com/users/mibitzi/events{/privacy}","received_events_url":"https://api.github.com/users/mibitzi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mibitzi/gopherjs-ko","description":"GopherJS bindings to KnockoutJS","fork":false,"url":"https://api.github.com/repos/mibitzi/gopherjs-ko","forks_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/forks","keys_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/teams","hooks_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/hooks","issue_events_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/events{/number}","events_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/events","assignees_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/assignees{/user}","branches_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/branches{/branch}","tags_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/tags","blobs_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/git/refs{/sha}","trees_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/statuses/{sha}","languages_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/languages","stargazers_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/stargazers","contributors_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/contributors","subscribers_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/subscribers","subscription_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/subscription","commits_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/commits{/sha}","git_commits_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/git/commits{/sha}","comments_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/comments{/number}","issue_comment_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/comments{/number}","contents_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/contents/{+path}","compare_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/merges","archive_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/downloads","issues_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues{/number}","pulls_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls{/number}","milestones_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/milestones{/number}","notifications_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/labels{/name}","releases_url":"https://api.github.com/repos/mibitzi/gopherjs-ko/releases{/id}","created_at":"2015-05-07T08:56:01Z","updated_at":"2015-05-16T16:38:18Z","pushed_at":"2015-06-14T10:03:06Z","git_url":"git://github.com/mibitzi/gopherjs-ko.git","ssh_url":"git@github.com:mibitzi/gopherjs-ko.git","clone_url":"https://github.com/mibitzi/gopherjs-ko.git","svn_url":"https://github.com/mibitzi/gopherjs-ko","homepage":"","size":319,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2"},"html":{"href":"https://github.com/mibitzi/gopherjs-ko/pull/2"},"issue":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/2"},"comments":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/mibitzi/gopherjs-ko/statuses/3abc76cdd88a2d78f209e5bb67b5bff1873d38ae"}}}}