{"action":"created","comment":{"url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/comments/41736054","id":41736054,"diff_hunk":"@@ -141,10 +232,40 @@\n \n \n \n-\t// ----------------- file selector-------------\n+\t// ------------------ gist publish --------------\n+\n+\t$('#gist').click(function(){\n+\t\tif (confirm(\"Are you sure you want to publish all your files anonymously as a public gist on github.com\")) {\n+\t\t\t\t\t\t\t\t\t\t   \n+\t\t\tvar files = {};\n+\t\t\tvar filesArr = getFiles();\n+\t\t\tvar description = \"Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity#gist=\";\n+\t\t\t\n+\t\t\tfor(var f in filesArr) {\n+\t\t\t\tfiles[fileNameFromKey(filesArr[f])] = {\n+\t\t\t\t\tcontent: localStorage[filesArr[f]]\n+\t\t\t\t};\n+\t\t\t}\n+\n+\t\t\t$.ajax({ \n+\t\t\t\turl: 'https://api.github.com/gists',\n+\t\t\t\ttype: 'POST',\n+\t\t\t\tdata: JSON.stringify({\n+\t\t\t\t\tdescription: description,\n+\t\t\t\t\tpublic: true,\n+\t\t\t\t\tfiles: files\n+\t\t\t\t})\n+\t\t\t}).done(function(response) {\n+\t\t\t\tif (response.html_url && confirm(\"Created a gist at \" + response.html_url + \" Would you like to open it in a new window?\")) {\n+\t\t\t\t\twindow.open( response.html_url, '_blank' );","path":"index.html","position":null,"original_position":232,"commit_id":"de191e0bb328c63bdf8a392e5893cbc3f8e60b55","original_commit_id":"6768972acb0632b9c97b57f144d63936b8fc1ec6","user":{"login":"d11e9","id":8437822,"avatar_url":"https://avatars.githubusercontent.com/u/8437822?v=3","gravatar_id":"","url":"https://api.github.com/users/d11e9","html_url":"https://github.com/d11e9","followers_url":"https://api.github.com/users/d11e9/followers","following_url":"https://api.github.com/users/d11e9/following{/other_user}","gists_url":"https://api.github.com/users/d11e9/gists{/gist_id}","starred_url":"https://api.github.com/users/d11e9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d11e9/subscriptions","organizations_url":"https://api.github.com/users/d11e9/orgs","repos_url":"https://api.github.com/users/d11e9/repos","events_url":"https://api.github.com/users/d11e9/events{/privacy}","received_events_url":"https://api.github.com/users/d11e9/received_events","type":"User","site_admin":false},"body":"@chriseth unfortunately the only way to prevent pop-blocker notification is to do the navigation on user click (confirm prompt doesn't count) I will look into a solution in a followup PR","created_at":"2015-10-12T09:01:16Z","updated_at":"2015-10-12T09:01:16Z","html_url":"https://github.com/chriseth/browser-solidity/pull/40#discussion_r41736054","pull_request_url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/comments/41736054"},"html":{"href":"https://github.com/chriseth/browser-solidity/pull/40#discussion_r41736054"},"pull_request":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40","id":47164050,"html_url":"https://github.com/chriseth/browser-solidity/pull/40","diff_url":"https://github.com/chriseth/browser-solidity/pull/40.diff","patch_url":"https://github.com/chriseth/browser-solidity/pull/40.patch","issue_url":"https://api.github.com/repos/chriseth/browser-solidity/issues/40","number":40,"state":"open","locked":false,"title":"Gist","user":{"login":"soleditor","id":15032620,"avatar_url":"https://avatars.githubusercontent.com/u/15032620?v=3","gravatar_id":"","url":"https://api.github.com/users/soleditor","html_url":"https://github.com/soleditor","followers_url":"https://api.github.com/users/soleditor/followers","following_url":"https://api.github.com/users/soleditor/following{/other_user}","gists_url":"https://api.github.com/users/soleditor/gists{/gist_id}","starred_url":"https://api.github.com/users/soleditor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soleditor/subscriptions","organizations_url":"https://api.github.com/users/soleditor/orgs","repos_url":"https://api.github.com/users/soleditor/repos","events_url":"https://api.github.com/users/soleditor/events{/privacy}","received_events_url":"https://api.github.com/users/soleditor/received_events","type":"User","site_admin":false},"body":"Allows publishing files to a github gist (public)\r\nallows toggling of the right hand panel","created_at":"2015-10-08T14:59:56Z","updated_at":"2015-10-12T09:01:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6e4cd97709d26b21dc9bd1a7c477cec045aa720","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40/commits","review_comments_url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40/comments","review_comment_url":"https://api.github.com/repos/chriseth/browser-solidity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chriseth/browser-solidity/issues/40/comments","statuses_url":"https://api.github.com/repos/chriseth/browser-solidity/statuses/de191e0bb328c63bdf8a392e5893cbc3f8e60b55","head":{"label":"d11e9:gist","ref":"gist","sha":"de191e0bb328c63bdf8a392e5893cbc3f8e60b55","user":{"login":"d11e9","id":8437822,"avatar_url":"https://avatars.githubusercontent.com/u/8437822?v=3","gravatar_id":"","url":"https://api.github.com/users/d11e9","html_url":"https://github.com/d11e9","followers_url":"https://api.github.com/users/d11e9/followers","following_url":"https://api.github.com/users/d11e9/following{/other_user}","gists_url":"https://api.github.com/users/d11e9/gists{/gist_id}","starred_url":"https://api.github.com/users/d11e9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d11e9/subscriptions","organizations_url":"https://api.github.com/users/d11e9/orgs","repos_url":"https://api.github.com/users/d11e9/repos","events_url":"https://api.github.com/users/d11e9/events{/privacy}","received_events_url":"https://api.github.com/users/d11e9/received_events","type":"User","site_admin":false},"repo":{"id":41426756,"name":"browser-solidity","full_name":"d11e9/browser-solidity","owner":{"login":"d11e9","id":8437822,"avatar_url":"https://avatars.githubusercontent.com/u/8437822?v=3","gravatar_id":"","url":"https://api.github.com/users/d11e9","html_url":"https://github.com/d11e9","followers_url":"https://api.github.com/users/d11e9/followers","following_url":"https://api.github.com/users/d11e9/following{/other_user}","gists_url":"https://api.github.com/users/d11e9/gists{/gist_id}","starred_url":"https://api.github.com/users/d11e9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d11e9/subscriptions","organizations_url":"https://api.github.com/users/d11e9/orgs","repos_url":"https://api.github.com/users/d11e9/repos","events_url":"https://api.github.com/users/d11e9/events{/privacy}","received_events_url":"https://api.github.com/users/d11e9/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/d11e9/browser-solidity","description":"Solidity compiler to be run inside a browser","fork":true,"url":"https://api.github.com/repos/d11e9/browser-solidity","forks_url":"https://api.github.com/repos/d11e9/browser-solidity/forks","keys_url":"https://api.github.com/repos/d11e9/browser-solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d11e9/browser-solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d11e9/browser-solidity/teams","hooks_url":"https://api.github.com/repos/d11e9/browser-solidity/hooks","issue_events_url":"https://api.github.com/repos/d11e9/browser-solidity/issues/events{/number}","events_url":"https://api.github.com/repos/d11e9/browser-solidity/events","assignees_url":"https://api.github.com/repos/d11e9/browser-solidity/assignees{/user}","branches_url":"https://api.github.com/repos/d11e9/browser-solidity/branches{/branch}","tags_url":"https://api.github.com/repos/d11e9/browser-solidity/tags","blobs_url":"https://api.github.com/repos/d11e9/browser-solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d11e9/browser-solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d11e9/browser-solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/d11e9/browser-solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d11e9/browser-solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/d11e9/browser-solidity/languages","stargazers_url":"https://api.github.com/repos/d11e9/browser-solidity/stargazers","contributors_url":"https://api.github.com/repos/d11e9/browser-solidity/contributors","subscribers_url":"https://api.github.com/repos/d11e9/browser-solidity/subscribers","subscription_url":"https://api.github.com/repos/d11e9/browser-solidity/subscription","commits_url":"https://api.github.com/repos/d11e9/browser-solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/d11e9/browser-solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/d11e9/browser-solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/d11e9/browser-solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/d11e9/browser-solidity/contents/{+path}","compare_url":"https://api.github.com/repos/d11e9/browser-solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d11e9/browser-solidity/merges","archive_url":"https://api.github.com/repos/d11e9/browser-solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d11e9/browser-solidity/downloads","issues_url":"https://api.github.com/repos/d11e9/browser-solidity/issues{/number}","pulls_url":"https://api.github.com/repos/d11e9/browser-solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/d11e9/browser-solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/d11e9/browser-solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d11e9/browser-solidity/labels{/name}","releases_url":"https://api.github.com/repos/d11e9/browser-solidity/releases{/id}","created_at":"2015-08-26T13:20:30Z","updated_at":"2015-08-30T22:12:15Z","pushed_at":"2015-10-12T08:59:49Z","git_url":"git://github.com/d11e9/browser-solidity.git","ssh_url":"git@github.com:d11e9/browser-solidity.git","clone_url":"https://github.com/d11e9/browser-solidity.git","svn_url":"https://github.com/d11e9/browser-solidity","homepage":"http://d11e9.github.io/browser-solidity","size":39323,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"chriseth:gh-pages","ref":"gh-pages","sha":"548998207d46d7bd356d8a4711656624fa30d0b1","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"repo":{"id":39510585,"name":"browser-solidity","full_name":"chriseth/browser-solidity","owner":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chriseth/browser-solidity","description":"Solidity compiler to be run inside a browser","fork":false,"url":"https://api.github.com/repos/chriseth/browser-solidity","forks_url":"https://api.github.com/repos/chriseth/browser-solidity/forks","keys_url":"https://api.github.com/repos/chriseth/browser-solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chriseth/browser-solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chriseth/browser-solidity/teams","hooks_url":"https://api.github.com/repos/chriseth/browser-solidity/hooks","issue_events_url":"https://api.github.com/repos/chriseth/browser-solidity/issues/events{/number}","events_url":"https://api.github.com/repos/chriseth/browser-solidity/events","assignees_url":"https://api.github.com/repos/chriseth/browser-solidity/assignees{/user}","branches_url":"https://api.github.com/repos/chriseth/browser-solidity/branches{/branch}","tags_url":"https://api.github.com/repos/chriseth/browser-solidity/tags","blobs_url":"https://api.github.com/repos/chriseth/browser-solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chriseth/browser-solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chriseth/browser-solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/chriseth/browser-solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chriseth/browser-solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/chriseth/browser-solidity/languages","stargazers_url":"https://api.github.com/repos/chriseth/browser-solidity/stargazers","contributors_url":"https://api.github.com/repos/chriseth/browser-solidity/contributors","subscribers_url":"https://api.github.com/repos/chriseth/browser-solidity/subscribers","subscription_url":"https://api.github.com/repos/chriseth/browser-solidity/subscription","commits_url":"https://api.github.com/repos/chriseth/browser-solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/chriseth/browser-solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/chriseth/browser-solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/chriseth/browser-solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/chriseth/browser-solidity/contents/{+path}","compare_url":"https://api.github.com/repos/chriseth/browser-solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chriseth/browser-solidity/merges","archive_url":"https://api.github.com/repos/chriseth/browser-solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chriseth/browser-solidity/downloads","issues_url":"https://api.github.com/repos/chriseth/browser-solidity/issues{/number}","pulls_url":"https://api.github.com/repos/chriseth/browser-solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/chriseth/browser-solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/chriseth/browser-solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chriseth/browser-solidity/labels{/name}","releases_url":"https://api.github.com/repos/chriseth/browser-solidity/releases{/id}","created_at":"2015-07-22T14:23:40Z","updated_at":"2015-10-02T09:43:12Z","pushed_at":"2015-10-12T08:59:49Z","git_url":"git://github.com/chriseth/browser-solidity.git","ssh_url":"git@github.com:chriseth/browser-solidity.git","clone_url":"https://github.com/chriseth/browser-solidity.git","svn_url":"https://github.com/chriseth/browser-solidity","homepage":null,"size":39724,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":8,"forks":8,"open_issues":8,"watchers":7,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40"},"html":{"href":"https://github.com/chriseth/browser-solidity/pull/40"},"issue":{"href":"https://api.github.com/repos/chriseth/browser-solidity/issues/40"},"comments":{"href":"https://api.github.com/repos/chriseth/browser-solidity/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chriseth/browser-solidity/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/chriseth/browser-solidity/statuses/de191e0bb328c63bdf8a392e5893cbc3f8e60b55"}}}}