{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments/29393349","id":29393349,"diff_hunk":"@@ -3,6 +3,54 @@\n \n 'use strict';\n \n+// The download dialog generates many style recalculations while attached to\n+// the DOM, regardless of its display style, so instead of setting its display\n+// style, we add/remove it to/from the DOM.\n+var display = document.getElementById(\"display\");\n+\n+var downloadDialog = document.getElementById('download-screen');\n+display.removeChild(downloadDialog);\n+downloadDialog.style.display = 'block';\n+function showDownloadScreen() {\n+  display.appendChild(downloadDialog);\n+}\n+function hideDownloadScreen() {\n+  if (downloadDialog.parentNode) {\n+    downloadDialog.parentNode.removeChild(downloadDialog);\n+  }\n+}\n+\n+var splashScreen = document.getElementById('splash-screen');\n+display.removeChild(splashScreen);\n+splashScreen.style.display = 'block';\n+function showSplashScreen() {\n+  display.appendChild(splashScreen);\n+}\n+function hideSplashScreen() {\n+  if (splashScreen.parentNode) {\n+    splashScreen.parentNode.removeChild(splashScreen);\n+  }\n+}\n+\n+function showBackgroundScreen() {\n+  document.getElementById(\"background-screen\").style.display = \"block\";\n+}\n+function hideBackgroundScreen() {\n+  document.getElementById(\"background-screen\").style.display = \"none\";\n+}\n+\n+// The exit screen is hidden by default, and we only ever show it,\n+// so we don't need a hideExitScreen function.\n+function showExitScreen() {\n+  document.getElementById(\"exit-screen\").style.display = \"block\";\n+}\n+\n+// If the document is hidden, then we've been started by an alarm and are in","path":"main.js","position":46,"original_position":46,"commit_id":"005676aca379261e7f830e340eb8d9f63eb04667","original_commit_id":"005676aca379261e7f830e340eb8d9f63eb04667","user":{"login":"marco-c","id":1616846,"avatar_url":"https://avatars.githubusercontent.com/u/1616846?v=3","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"body":"Nit: Can you move this to background.js?","created_at":"2015-04-29T23:51:14Z","updated_at":"2015-04-29T23:51:14Z","html_url":"https://github.com/mozilla/j2me.js/pull/1482#discussion_r29393349","pull_request_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482","_links":{"self":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments/29393349"},"html":{"href":"https://github.com/mozilla/j2me.js/pull/1482#discussion_r29393349"},"pull_request":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482","id":34290759,"html_url":"https://github.com/mozilla/j2me.js/pull/1482","diff_url":"https://github.com/mozilla/j2me.js/pull/1482.diff","patch_url":"https://github.com/mozilla/j2me.js/pull/1482.patch","issue_url":"https://api.github.com/repos/mozilla/j2me.js/issues/1482","number":1482,"state":"open","locked":false,"title":"simplify startup screens","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"body":"This branch makes several changes to simplify the sequence of startup screens that the user sees while starting up the app:\r\n\r\n* Display the app splash screen as soon as possible, to minimize the transition between the OS and app splash screens.\r\n* Hide the background screen if the app is visible (f.e. because it was started by the user rather than the background alarm), so it doesn't show up between transitions (from the OS splash screen to the app splash screen, and from the app splash screen to the initial midlet screen).\r\n* Add the midlet name to the splash screen at build time, so it's always visible on the splash screen (instead of sometimes appearing after the splash screen is already displayed).\r\n\r\nAlong the way, it makes a few other changes:\r\n\r\n* Make the style of the download screen consistent with the style of the splash screen, so the transition between them is less significant.\r\n* Add an explanatory message and call to action to the download failure dialog.\r\n* Refactor the code that shows/hides the various screens.\r\n* Remove the download screen from the DOM when hiding it, to avoid the frequent style recalculations that it triggers.\r\n","created_at":"2015-04-28T17:26:47Z","updated_at":"2015-04-29T23:51:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86c094a4fc440c8ad91229d99ee8208f9761794b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482/commits","review_comments_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482/comments","review_comment_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/j2me.js/issues/1482/comments","statuses_url":"https://api.github.com/repos/mozilla/j2me.js/statuses/005676aca379261e7f830e340eb8d9f63eb04667","head":{"label":"mykmelez:simplify-startup-screens","ref":"simplify-startup-screens","sha":"005676aca379261e7f830e340eb8d9f63eb04667","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"repo":{"id":22497156,"name":"j2me.js","full_name":"mykmelez/j2me.js","owner":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mykmelez/j2me.js","description":"J2ME VM in JavaScript","fork":true,"url":"https://api.github.com/repos/mykmelez/j2me.js","forks_url":"https://api.github.com/repos/mykmelez/j2me.js/forks","keys_url":"https://api.github.com/repos/mykmelez/j2me.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mykmelez/j2me.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mykmelez/j2me.js/teams","hooks_url":"https://api.github.com/repos/mykmelez/j2me.js/hooks","issue_events_url":"https://api.github.com/repos/mykmelez/j2me.js/issues/events{/number}","events_url":"https://api.github.com/repos/mykmelez/j2me.js/events","assignees_url":"https://api.github.com/repos/mykmelez/j2me.js/assignees{/user}","branches_url":"https://api.github.com/repos/mykmelez/j2me.js/branches{/branch}","tags_url":"https://api.github.com/repos/mykmelez/j2me.js/tags","blobs_url":"https://api.github.com/repos/mykmelez/j2me.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mykmelez/j2me.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mykmelez/j2me.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mykmelez/j2me.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mykmelez/j2me.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mykmelez/j2me.js/languages","stargazers_url":"https://api.github.com/repos/mykmelez/j2me.js/stargazers","contributors_url":"https://api.github.com/repos/mykmelez/j2me.js/contributors","subscribers_url":"https://api.github.com/repos/mykmelez/j2me.js/subscribers","subscription_url":"https://api.github.com/repos/mykmelez/j2me.js/subscription","commits_url":"https://api.github.com/repos/mykmelez/j2me.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mykmelez/j2me.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mykmelez/j2me.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mykmelez/j2me.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mykmelez/j2me.js/contents/{+path}","compare_url":"https://api.github.com/repos/mykmelez/j2me.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mykmelez/j2me.js/merges","archive_url":"https://api.github.com/repos/mykmelez/j2me.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mykmelez/j2me.js/downloads","issues_url":"https://api.github.com/repos/mykmelez/j2me.js/issues{/number}","pulls_url":"https://api.github.com/repos/mykmelez/j2me.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mykmelez/j2me.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mykmelez/j2me.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mykmelez/j2me.js/labels{/name}","releases_url":"https://api.github.com/repos/mykmelez/j2me.js/releases{/id}","created_at":"2014-08-01T06:02:22Z","updated_at":"2015-04-29T16:45:15Z","pushed_at":"2015-04-29T23:18:13Z","git_url":"git://github.com/mykmelez/j2me.js.git","ssh_url":"git@github.com:mykmelez/j2me.js.git","clone_url":"https://github.com/mykmelez/j2me.js.git","svn_url":"https://github.com/mykmelez/j2me.js","homepage":null,"size":31383,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"mozilla:master","ref":"master","sha":"a6dc2322bebec00bcdba678767ef5dea7cd521f5","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":21724513,"name":"j2me.js","full_name":"mozilla/j2me.js","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/j2me.js","description":"J2ME VM in JavaScript","fork":false,"url":"https://api.github.com/repos/mozilla/j2me.js","forks_url":"https://api.github.com/repos/mozilla/j2me.js/forks","keys_url":"https://api.github.com/repos/mozilla/j2me.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/j2me.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/j2me.js/teams","hooks_url":"https://api.github.com/repos/mozilla/j2me.js/hooks","issue_events_url":"https://api.github.com/repos/mozilla/j2me.js/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/j2me.js/events","assignees_url":"https://api.github.com/repos/mozilla/j2me.js/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/j2me.js/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/j2me.js/tags","blobs_url":"https://api.github.com/repos/mozilla/j2me.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/j2me.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/j2me.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/j2me.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/j2me.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/j2me.js/languages","stargazers_url":"https://api.github.com/repos/mozilla/j2me.js/stargazers","contributors_url":"https://api.github.com/repos/mozilla/j2me.js/contributors","subscribers_url":"https://api.github.com/repos/mozilla/j2me.js/subscribers","subscription_url":"https://api.github.com/repos/mozilla/j2me.js/subscription","commits_url":"https://api.github.com/repos/mozilla/j2me.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/j2me.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/j2me.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/j2me.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/j2me.js/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/j2me.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/j2me.js/merges","archive_url":"https://api.github.com/repos/mozilla/j2me.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/j2me.js/downloads","issues_url":"https://api.github.com/repos/mozilla/j2me.js/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/j2me.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/j2me.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/j2me.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/j2me.js/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/j2me.js/releases{/id}","created_at":"2014-07-11T06:23:27Z","updated_at":"2015-04-29T19:59:38Z","pushed_at":"2015-04-29T22:12:43Z","git_url":"git://github.com/mozilla/j2me.js.git","ssh_url":"git@github.com:mozilla/j2me.js.git","clone_url":"https://github.com/mozilla/j2me.js.git","svn_url":"https://github.com/mozilla/j2me.js","homepage":null,"size":39078,"stargazers_count":80,"watchers_count":80,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":235,"forks":26,"open_issues":235,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482"},"html":{"href":"https://github.com/mozilla/j2me.js/pull/1482"},"issue":{"href":"https://api.github.com/repos/mozilla/j2me.js/issues/1482"},"comments":{"href":"https://api.github.com/repos/mozilla/j2me.js/issues/1482/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1482/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/j2me.js/statuses/005676aca379261e7f830e340eb8d9f63eb04667"}}}}