{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/43299565","id":43299565,"diff_hunk":"@@ -726,6 +757,100 @@\n       return this.icons.children.indexOf(child);\n     },\n \n+    removeSelectedIcon: function() {\n+      if (!this.selectedIcon) {\n+        return;\n+      }\n+\n+      if (this.selectedIcon.app) {\n+        if (!this.selectedIcon.app.removable) {\n+          return;\n+        }\n+        navigator.mozApps.mgmt.uninstall(this.selectedIcon.app);\n+      } else if (this.selectedIcon.bookmark) {\n+        new MozActivity({\n+          name: 'remove-bookmark',\n+          data: { type: 'url', url: this.selectedIcon.bookmark.id }\n+        });\n+      }\n+    },\n+\n+    renameSelectedIcon: function() {\n+      if (!this.selectedIcon || !this.selectedIcon.bookmark) {\n+        return;\n+      }\n+\n+      new MozActivity({\n+        name: 'save-bookmark',\n+        data: { type: 'url', url: this.selectedIcon.bookmark.id }\n+      });\n+    },\n+\n+    iconIsEditable: function(icon) {\n+      return (icon.bookmark || (icon.app && icon.app.removable)) ? true : false;","path":"apps/homescreen/js/app.js","position":148,"original_position":148,"commit_id":"51514eeba02af61c645a166a41730061ef45d66f","original_commit_id":"1eeb8233a179255ebecad610d5d0930ef54d235a","user":{"login":"Cwiiis","id":668518,"avatar_url":"https://avatars.githubusercontent.com/u/668518?v=3","gravatar_id":"","url":"https://api.github.com/users/Cwiiis","html_url":"https://github.com/Cwiiis","followers_url":"https://api.github.com/users/Cwiiis/followers","following_url":"https://api.github.com/users/Cwiiis/following{/other_user}","gists_url":"https://api.github.com/users/Cwiiis/gists{/gist_id}","starred_url":"https://api.github.com/users/Cwiiis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cwiiis/subscriptions","organizations_url":"https://api.github.com/users/Cwiiis/orgs","repos_url":"https://api.github.com/users/Cwiiis/repos","events_url":"https://api.github.com/users/Cwiiis/events{/privacy}","received_events_url":"https://api.github.com/users/Cwiiis/received_events","type":"User","site_admin":false},"body":"Because that ends up returning the objects (you could put a !! before it, which would be similar to what I've done). Most things are fine, but it came up in a unit test and I've had funny things happen from returning things like `undefined` instead of `false`, so decided to be explicit.","created_at":"2015-10-28T18:39:26Z","updated_at":"2015-10-28T18:39:26Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/32778#discussion_r43299565","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/43299565"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32778#discussion_r43299565"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778","id":48876780,"html_url":"https://github.com/mozilla-b2g/gaia/pull/32778","diff_url":"https://github.com/mozilla-b2g/gaia/pull/32778.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/32778.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32778","number":32778,"state":"open","locked":false,"title":"Bug 1218805 - Implement home screen 'edit mode'. r=gmarty","user":{"login":"Cwiiis","id":668518,"avatar_url":"https://avatars.githubusercontent.com/u/668518?v=3","gravatar_id":"","url":"https://api.github.com/users/Cwiiis","html_url":"https://github.com/Cwiiis","followers_url":"https://api.github.com/users/Cwiiis/followers","following_url":"https://api.github.com/users/Cwiiis/following{/other_user}","gists_url":"https://api.github.com/users/Cwiiis/gists{/gist_id}","starred_url":"https://api.github.com/users/Cwiiis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cwiiis/subscriptions","organizations_url":"https://api.github.com/users/Cwiiis/orgs","repos_url":"https://api.github.com/users/Cwiiis/repos","events_url":"https://api.github.com/users/Cwiiis/events{/privacy}","received_events_url":"https://api.github.com/users/Cwiiis/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-27T14:22:26Z","updated_at":"2015-10-28T18:39:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da0ce860a6a63e58a56ef230b066f837c39081e1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32778/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/51514eeba02af61c645a166a41730061ef45d66f","head":{"label":"Cwiiis:new-homescreen-edit-mode","ref":"new-homescreen-edit-mode","sha":"51514eeba02af61c645a166a41730061ef45d66f","user":{"login":"Cwiiis","id":668518,"avatar_url":"https://avatars.githubusercontent.com/u/668518?v=3","gravatar_id":"","url":"https://api.github.com/users/Cwiiis","html_url":"https://github.com/Cwiiis","followers_url":"https://api.github.com/users/Cwiiis/followers","following_url":"https://api.github.com/users/Cwiiis/following{/other_user}","gists_url":"https://api.github.com/users/Cwiiis/gists{/gist_id}","starred_url":"https://api.github.com/users/Cwiiis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cwiiis/subscriptions","organizations_url":"https://api.github.com/users/Cwiiis/orgs","repos_url":"https://api.github.com/users/Cwiiis/repos","events_url":"https://api.github.com/users/Cwiiis/events{/privacy}","received_events_url":"https://api.github.com/users/Cwiiis/received_events","type":"User","site_admin":false},"repo":{"id":20401491,"name":"gaia","full_name":"Cwiiis/gaia","owner":{"login":"Cwiiis","id":668518,"avatar_url":"https://avatars.githubusercontent.com/u/668518?v=3","gravatar_id":"","url":"https://api.github.com/users/Cwiiis","html_url":"https://github.com/Cwiiis","followers_url":"https://api.github.com/users/Cwiiis/followers","following_url":"https://api.github.com/users/Cwiiis/following{/other_user}","gists_url":"https://api.github.com/users/Cwiiis/gists{/gist_id}","starred_url":"https://api.github.com/users/Cwiiis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cwiiis/subscriptions","organizations_url":"https://api.github.com/users/Cwiiis/orgs","repos_url":"https://api.github.com/users/Cwiiis/repos","events_url":"https://api.github.com/users/Cwiiis/events{/privacy}","received_events_url":"https://api.github.com/users/Cwiiis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Cwiiis/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/Cwiiis/gaia","forks_url":"https://api.github.com/repos/Cwiiis/gaia/forks","keys_url":"https://api.github.com/repos/Cwiiis/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cwiiis/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cwiiis/gaia/teams","hooks_url":"https://api.github.com/repos/Cwiiis/gaia/hooks","issue_events_url":"https://api.github.com/repos/Cwiiis/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/Cwiiis/gaia/events","assignees_url":"https://api.github.com/repos/Cwiiis/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/Cwiiis/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/Cwiiis/gaia/tags","blobs_url":"https://api.github.com/repos/Cwiiis/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cwiiis/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cwiiis/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cwiiis/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cwiiis/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/Cwiiis/gaia/languages","stargazers_url":"https://api.github.com/repos/Cwiiis/gaia/stargazers","contributors_url":"https://api.github.com/repos/Cwiiis/gaia/contributors","subscribers_url":"https://api.github.com/repos/Cwiiis/gaia/subscribers","subscription_url":"https://api.github.com/repos/Cwiiis/gaia/subscription","commits_url":"https://api.github.com/repos/Cwiiis/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cwiiis/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cwiiis/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cwiiis/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cwiiis/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/Cwiiis/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cwiiis/gaia/merges","archive_url":"https://api.github.com/repos/Cwiiis/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cwiiis/gaia/downloads","issues_url":"https://api.github.com/repos/Cwiiis/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/Cwiiis/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/Cwiiis/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/Cwiiis/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cwiiis/gaia/labels{/name}","releases_url":"https://api.github.com/repos/Cwiiis/gaia/releases{/id}","created_at":"2014-06-02T11:19:38Z","updated_at":"2015-09-30T14:14:46Z","pushed_at":"2015-10-28T18:37:49Z","git_url":"git://github.com/Cwiiis/gaia.git","ssh_url":"git@github.com:Cwiiis/gaia.git","clone_url":"https://github.com/Cwiiis/gaia.git","svn_url":"https://github.com/Cwiiis/gaia","homepage":"https://wiki.mozilla.org/B2G","size":964957,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mozilla-b2g:master","ref":"master","sha":"453948536f33d93a2119231368097dc998904f32","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-10-26T01:49:34Z","pushed_at":"2015-10-28T18:37:51Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1678934,"stargazers_count":1992,"watchers_count":1992,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2496,"mirror_url":null,"open_issues_count":1260,"forks":2496,"open_issues":1260,"watchers":1992,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32778"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32778"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32778/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32778/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/51514eeba02af61c645a166a41730061ef45d66f"}}}}