GitHub PullRequestReviewCommentEvent at 2014-12-30 07:41:58
Repository: vimium
Actor: philc
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/philc/vimium/pulls/comments/22341008","id":22341008,"diff_hunk":"@@ -77,20 +89,56 @@ class CheckBoxOption extends Option\n   readValueFromElement: -> @element.checked\n \n class ExclusionRulesOption extends Option\n-  constructor: (args...) ->\n-    super(args...)\n+  constructor: (field, onUpdated, @url=\"\") ->\n+    super(field, onUpdated)\n     $(\"exclusionAddButton\").addEventListener \"click\", (event) =>\n-      @appendRule { pattern: \"\", passKeys: \"\" }\n-      # Focus the pattern element in the new rule.\n-      @element.children[@element.children.length-1].children[0].children[0].focus()\n+      @addRule()\n+\n+  addRule: ->\n+      @appendRule { pattern: (if @url then generateDefaultPattern(@url) else \"\"), passKeys: \"\" }\n+      # On the options page, focus the pattern; on the page popup (where we already have a pattern), focus the\n+      # passKeys.\n+      focus = if @url then 1 else 0\n+      element = @element.children[@element.children.length-1]\n+      element.children[focus].children[0].focus()","path":"pages/options.coffee","position":58,"original_position":58,"commit_id":"93b84200db90c17f59a1ce5333a4ff8258297f2c","original_commit_id":"93b84200db90c17f59a1ce5333a4ff8258297f2c","user":{"login":"philc","id":8598,"avatar_url":"https://avatars.githubusercontent.com/u/8598?v=3","gravatar_id":"","url":"https://api.github.com/users/philc","html_url":"https://github.com/philc","followers_url":"https://api.github.com/users/philc/followers","following_url":"https://api.github.com/users/philc/following{/other_user}","gists_url":"https://api.github.com/users/philc/gists{/gist_id}","starred_url":"https://api.github.com/users/philc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philc/subscriptions","organizations_url":"https://api.github.com/users/philc/orgs","repos_url":"https://api.github.com/users/philc/repos","events_url":"https://api.github.com/users/philc/events{/privacy}","received_events_url":"https://api.github.com/users/philc/received_events","type":"User","site_admin":false},"body":"Indexing children by position is brittle. Can we instead use element.querySelector to find elements by class?","created_at":"2014-12-30T07:41:58Z","updated_at":"2014-12-30T07:41:58Z","html_url":"https://github.com/philc/vimium/pull/1366#discussion_r22341008","pull_request_url":"https://api.github.com/repos/philc/vimium/pulls/1366","_links":{"self":{"href":"https://api.github.com/repos/philc/vimium/pulls/comments/22341008"},"html":{"href":"https://github.com/philc/vimium/pull/1366#discussion_r22341008"},"pull_request":{"href":"https://api.github.com/repos/philc/vimium/pulls/1366"}}},"pull_request":{"url":"https://api.github.com/repos/philc/vimium/pulls/1366","id":26428604,"html_url":"https://github.com/philc/vimium/pull/1366","diff_url":"https://github.com/philc/vimium/pull/1366.diff","patch_url":"https://github.com/philc/vimium/pull/1366.patch","issue_url":"https://api.github.com/repos/philc/vimium/issues/1366","number":1366,"state":"open","locked":false,"title":"Match multiple exclusion rules","user":{"login":"smblott-github","id":2641335,"avatar_url":"https://avatars.githubusercontent.com/u/2641335?v=3","gravatar_id":"","url":"https://api.github.com/users/smblott-github","html_url":"https://github.com/smblott-github","followers_url":"https://api.github.com/users/smblott-github/followers","following_url":"https://api.github.com/users/smblott-github/following{/other_user}","gists_url":"https://api.github.com/users/smblott-github/gists{/gist_id}","starred_url":"https://api.github.com/users/smblott-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smblott-github/subscriptions","organizations_url":"https://api.github.com/users/smblott-github/orgs","repos_url":"https://api.github.com/users/smblott-github/repos","events_url":"https://api.github.com/users/smblott-github/events{/privacy}","received_events_url":"https://api.github.com/users/smblott-github/received_events","type":"User","site_admin":false},"body":"This does the following:\r\n- Changes the exclusion-rule logic such that, if multiple rules with pass keys match, then the keys taken is the union of the matches.  If *any* matching rule has no pass keys, then Vimium is disabled.\r\n- Substantially updates the page popup.  Basically, it now reuses the structure and styling from the options page (and we lose `popup.coffee`).\r\n- Consistent look-n-feel wrt exclusion rules.\r\n\r\nExample:\r\n\r\n![snapshot](https://cloud.githubusercontent.com/assets/2641335/5518433/c6fc33ac-891f-11e4-9a20-da71e0fdaa89.png)\r\n\r\nOther points:\r\n- The state that would apply *if the rules were to be save* is given at the top of the popup.\r\n- Patterns turn red when they don't match the current URL. (This looks better in practice than you might expect.)\r\n\r\nIssues:\r\n- ~~The *only* way to delete rules is via the little cross.  So that workflow is not great.~~\r\n- ~~@mrmr1993 wanted some user feedback as to what a red pattern means.  I can't figure out how to do that for now.~~\r\n- The popup is wider than it was before.  Is that ok?\r\n- (There must be more, I'll add them as I think of them.)\r\n\r\nFixes #1339.\r\n\r\nEdit:\r\n\r\nAdditional notes:\r\n- The CSS from the options page has been moved to its own file, and is now shared with the popup page.\r\n- The HTML for exclusion rules has been moved to its own file, and is similarly shared.\r\n\r\nAlso: ![snapshot](https://cloud.githubusercontent.com/assets/2641335/5518690/8d0f7b60-892c-11e4-88b1-9b26fffe0765.png) Fewer LOC!\r\n","created_at":"2014-12-21T14:52:12Z","updated_at":"2014-12-30T07:41:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd99b5428e7c9ec707ddedfce82770168939968e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/philc/vimium/pulls/1366/commits","review_comments_url":"https://api.github.com/repos/philc/vimium/pulls/1366/comments","review_comment_url":"https://api.github.com/repos/philc/vimium/pulls/comments/{number}","comments_url":"https://api.github.com/repos/philc/vimium/issues/1366/comments","statuses_url":"https://api.github.com/repos/philc/vimium/statuses/93b84200db90c17f59a1ce5333a4ff8258297f2c","head":{"label":"smblott-github:passkeys---union-of-rules","ref":"passkeys---union-of-rules","sha":"93b84200db90c17f59a1ce5333a4ff8258297f2c","user":{"login":"smblott-github","id":2641335,"avatar_url":"https://avatars.githubusercontent.com/u/2641335?v=3","gravatar_id":"","url":"https://api.github.com/users/smblott-github","html_url":"https://github.com/smblott-github","followers_url":"https://api.github.com/users/smblott-github/followers","following_url":"https://api.github.com/users/smblott-github/following{/other_user}","gists_url":"https://api.github.com/users/smblott-github/gists{/gist_id}","starred_url":"https://api.github.com/users/smblott-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smblott-github/subscriptions","organizations_url":"https://api.github.com/users/smblott-github/orgs","repos_url":"https://api.github.com/users/smblott-github/repos","events_url":"https://api.github.com/users/smblott-github/events{/privacy}","received_events_url":"https://api.github.com/users/smblott-github/received_events","type":"User","site_admin":false},"repo":{"id":18924701,"name":"vimium","full_name":"smblott-github/vimium","owner":{"login":"smblott-github","id":2641335,"avatar_url":"https://avatars.githubusercontent.com/u/2641335?v=3","gravatar_id":"","url":"https://api.github.com/users/smblott-github","html_url":"https://github.com/smblott-github","followers_url":"https://api.github.com/users/smblott-github/followers","following_url":"https://api.github.com/users/smblott-github/following{/other_user}","gists_url":"https://api.github.com/users/smblott-github/gists{/gist_id}","starred_url":"https://api.github.com/users/smblott-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smblott-github/subscriptions","organizations_url":"https://api.github.com/users/smblott-github/orgs","repos_url":"https://api.github.com/users/smblott-github/repos","events_url":"https://api.github.com/users/smblott-github/events{/privacy}","received_events_url":"https://api.github.com/users/smblott-github/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smblott-github/vimium","description":"The hacker's browser.","fork":true,"url":"https://api.github.com/repos/smblott-github/vimium","forks_url":"https://api.github.com/repos/smblott-github/vimium/forks","keys_url":"https://api.github.com/repos/smblott-github/vimium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smblott-github/vimium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smblott-github/vimium/teams","hooks_url":"https://api.github.com/repos/smblott-github/vimium/hooks","issue_events_url":"https://api.github.com/repos/smblott-github/vimium/issues/events{/number}","events_url":"https://api.github.com/repos/smblott-github/vimium/events","assignees_url":"https://api.github.com/repos/smblott-github/vimium/assignees{/user}","branches_url":"https://api.github.com/repos/smblott-github/vimium/branches{/branch}","tags_url":"https://api.github.com/repos/smblott-github/vimium/tags","blobs_url":"https://api.github.com/repos/smblott-github/vimium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smblott-github/vimium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smblott-github/vimium/git/refs{/sha}","trees_url":"https://api.github.com/repos/smblott-github/vimium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smblott-github/vimium/statuses/{sha}","languages_url":"https://api.github.com/repos/smblott-github/vimium/languages","stargazers_url":"https://api.github.com/repos/smblott-github/vimium/stargazers","contributors_url":"https://api.github.com/repos/smblott-github/vimium/contributors","subscribers_url":"https://api.github.com/repos/smblott-github/vimium/subscribers","subscription_url":"https://api.github.com/repos/smblott-github/vimium/subscription","commits_url":"https://api.github.com/repos/smblott-github/vimium/commits{/sha}","git_commits_url":"https://api.github.com/repos/smblott-github/vimium/git/commits{/sha}","comments_url":"https://api.github.com/repos/smblott-github/vimium/comments{/number}","issue_comment_url":"https://api.github.com/repos/smblott-github/vimium/issues/comments/{number}","contents_url":"https://api.github.com/repos/smblott-github/vimium/contents/{+path}","compare_url":"https://api.github.com/repos/smblott-github/vimium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smblott-github/vimium/merges","archive_url":"https://api.github.com/repos/smblott-github/vimium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smblott-github/vimium/downloads","issues_url":"https://api.github.com/repos/smblott-github/vimium/issues{/number}","pulls_url":"https://api.github.com/repos/smblott-github/vimium/pulls{/number}","milestones_url":"https://api.github.com/repos/smblott-github/vimium/milestones{/number}","notifications_url":"https://api.github.com/repos/smblott-github/vimium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smblott-github/vimium/labels{/name}","releases_url":"https://api.github.com/repos/smblott-github/vimium/releases{/id}","created_at":"2014-04-18T20:29:25Z","updated_at":"2014-12-29T15:18:46Z","pushed_at":"2014-12-30T07:16:58Z","git_url":"git://github.com/smblott-github/vimium.git","ssh_url":"git@github.com:smblott-github/vimium.git","clone_url":"https://github.com/smblott-github/vimium.git","svn_url":"https://github.com/smblott-github/vimium","homepage":"","size":3936,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","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":1,"default_branch":"master"}},"base":{"label":"philc:master","ref":"master","sha":"b38f0111d98c80fc3a03851a045feba447cc04ea","user":{"login":"philc","id":8598,"avatar_url":"https://avatars.githubusercontent.com/u/8598?v=3","gravatar_id":"","url":"https://api.github.com/users/philc","html_url":"https://github.com/philc","followers_url":"https://api.github.com/users/philc/followers","following_url":"https://api.github.com/users/philc/following{/other_user}","gists_url":"https://api.github.com/users/philc/gists{/gist_id}","starred_url":"https://api.github.com/users/philc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philc/subscriptions","organizations_url":"https://api.github.com/users/philc/orgs","repos_url":"https://api.github.com/users/philc/repos","events_url":"https://api.github.com/users/philc/events{/privacy}","received_events_url":"https://api.github.com/users/philc/received_events","type":"User","site_admin":false},"repo":{"id":312262,"name":"vimium","full_name":"philc/vimium","owner":{"login":"philc","id":8598,"avatar_url":"https://avatars.githubusercontent.com/u/8598?v=3","gravatar_id":"","url":"https://api.github.com/users/philc","html_url":"https://github.com/philc","followers_url":"https://api.github.com/users/philc/followers","following_url":"https://api.github.com/users/philc/following{/other_user}","gists_url":"https://api.github.com/users/philc/gists{/gist_id}","starred_url":"https://api.github.com/users/philc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philc/subscriptions","organizations_url":"https://api.github.com/users/philc/orgs","repos_url":"https://api.github.com/users/philc/repos","events_url":"https://api.github.com/users/philc/events{/privacy}","received_events_url":"https://api.github.com/users/philc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/philc/vimium","description":"The hacker's browser.","fork":false,"url":"https://api.github.com/repos/philc/vimium","forks_url":"https://api.github.com/repos/philc/vimium/forks","keys_url":"https://api.github.com/repos/philc/vimium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/philc/vimium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/philc/vimium/teams","hooks_url":"https://api.github.com/repos/philc/vimium/hooks","issue_events_url":"https://api.github.com/repos/philc/vimium/issues/events{/number}","events_url":"https://api.github.com/repos/philc/vimium/events","assignees_url":"https://api.github.com/repos/philc/vimium/assignees{/user}","branches_url":"https://api.github.com/repos/philc/vimium/branches{/branch}","tags_url":"https://api.github.com/repos/philc/vimium/tags","blobs_url":"https://api.github.com/repos/philc/vimium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/philc/vimium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/philc/vimium/git/refs{/sha}","trees_url":"https://api.github.com/repos/philc/vimium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/philc/vimium/statuses/{sha}","languages_url":"https://api.github.com/repos/philc/vimium/languages","stargazers_url":"https://api.github.com/repos/philc/vimium/stargazers","contributors_url":"https://api.github.com/repos/philc/vimium/contributors","subscribers_url":"https://api.github.com/repos/philc/vimium/subscribers","subscription_url":"https://api.github.com/repos/philc/vimium/subscription","commits_url":"https://api.github.com/repos/philc/vimium/commits{/sha}","git_commits_url":"https://api.github.com/repos/philc/vimium/git/commits{/sha}","comments_url":"https://api.github.com/repos/philc/vimium/comments{/number}","issue_comment_url":"https://api.github.com/repos/philc/vimium/issues/comments/{number}","contents_url":"https://api.github.com/repos/philc/vimium/contents/{+path}","compare_url":"https://api.github.com/repos/philc/vimium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/philc/vimium/merges","archive_url":"https://api.github.com/repos/philc/vimium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/philc/vimium/downloads","issues_url":"https://api.github.com/repos/philc/vimium/issues{/number}","pulls_url":"https://api.github.com/repos/philc/vimium/pulls{/number}","milestones_url":"https://api.github.com/repos/philc/vimium/milestones{/number}","notifications_url":"https://api.github.com/repos/philc/vimium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/philc/vimium/labels{/name}","releases_url":"https://api.github.com/repos/philc/vimium/releases{/id}","created_at":"2009-09-20T07:08:19Z","updated_at":"2014-12-30T03:52:29Z","pushed_at":"2014-12-30T06:20:46Z","git_url":"git://github.com/philc/vimium.git","ssh_url":"git@github.com:philc/vimium.git","clone_url":"https://github.com/philc/vimium.git","svn_url":"https://github.com/philc/vimium","homepage":"","size":6571,"stargazers_count":2550,"watchers_count":2550,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":409,"mirror_url":null,"open_issues_count":294,"forks":409,"open_issues":294,"watchers":2550,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/philc/vimium/pulls/1366"},"html":{"href":"https://github.com/philc/vimium/pull/1366"},"issue":{"href":"https://api.github.com/repos/philc/vimium/issues/1366"},"comments":{"href":"https://api.github.com/repos/philc/vimium/issues/1366/comments"},"review_comments":{"href":"https://api.github.com/repos/philc/vimium/pulls/1366/comments"},"review_comment":{"href":"https://api.github.com/repos/philc/vimium/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/philc/vimium/pulls/1366/commits"},"statuses":{"href":"https://api.github.com/repos/philc/vimium/statuses/93b84200db90c17f59a1ce5333a4ff8258297f2c"}}}}