{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/37522808","id":37522808,"diff_hunk":"@@ -1,40 +1,151 @@\n-'use strict';\n-\n-var utils = window.utils || {};\n-(function() {\n-  utils.overlay = {};\n-\n-  var overlay = document.querySelector('#loading-overlay'),\n-      statusContainer = overlay.querySelector('p[role=\"status\"]'),\n-      progressActivity = document.querySelector('#progress-activity'),\n-      progressTitle = document.querySelector('#progress-title'),\n-      progressElement = document.querySelector('#progress-element'),\n-      progressMsg = document.querySelector('#progress-msg'),\n-      menu = document.querySelector('#loading-overlay menu'),\n-      cancelButton = document.querySelector('#cancel-overlay');\n-\n-  // Constructor for the progress element\n-  function ProgressBar(pMsgId, pClass) {\n-    var counter = 0;\n-    var total = 0;\n-    var progressTextId = pMsgId || 'genericProgress';\n-    var clazz = pClass;\n+/* global LazyLoader, HtmlImports */\n \n+(function(exports) {\n+  'use strict';\n+\n+  var counter = 0;\n+  var total = 0;\n+  var progressTextId;\n+  var progressType;\n+\n+  var overlay,\n+      statusContainer,\n+      progressActivity,\n+      progressTitle,\n+      progressElement,\n+      progressMsg,\n+      menu,\n+      cancelButton,\n+      _cancelCB,\n+      isAnimationPlaying = false,\n+      isShown = false;\n+\n+  var overlayReady,\n+      _reject,\n+      isLoading = false;\n+\n+  var link = document.createElement('link');\n+  link.setAttribute('rel', 'import');\n+  link.setAttribute('href', '/shared/elements/contacts/overlay.html');\n+\n+  function cacheElements() {\n+    statusContainer = overlay.querySelector('p[role=\"status\"]'),\n+    progressActivity = document.querySelector('#progress-activity'),\n+    progressTitle = document.querySelector('#progress-title'),\n+    progressElement = document.querySelector('#progress-element'),\n+    progressMsg = document.querySelector('#progress-msg'),\n+    menu = document.querySelector('#loading-overlay menu'),\n+    cancelButton = document.querySelector('#cancel-overlay');\n     progressElement.setAttribute('value', 0);\n+  }\n \n-    function showMessage() {\n+  function addListeners() {\n+    cancelButton.onclick = function on_cancel(evt) {\n+      evt.preventDefault();\n+      delete cancelButton.onclick;\n+      cancelButton.disabled = false;\n+      if (typeof _cancelCB === 'function') {\n+        _cancelCB();\n+      }\n+      _cancelCB = null;\n+    };\n+  }\n+\n+  function deleteOverlay() {\n+    document.head.removeChild(link);\n+    document.body.removeChild(overlay);\n+    overlay = null;\n+    overlayReady = null;\n+    _reject = null;\n+    isLoading = false;\n+    counter = 0;\n+    total = 0;","path":"shared/js/contacts/import/utilities/overlay.js","position":84,"original_position":84,"commit_id":"80e14b44366c2a3009ce67a03fd60c91187170fb","original_commit_id":"80e14b44366c2a3009ce67a03fd60c91187170fb","user":{"login":"borjasalguero","id":1785537,"avatar_url":"https://avatars.githubusercontent.com/u/1785537?v=3","gravatar_id":"","url":"https://api.github.com/users/borjasalguero","html_url":"https://github.com/borjasalguero","followers_url":"https://api.github.com/users/borjasalguero/followers","following_url":"https://api.github.com/users/borjasalguero/following{/other_user}","gists_url":"https://api.github.com/users/borjasalguero/gists{/gist_id}","starred_url":"https://api.github.com/users/borjasalguero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borjasalguero/subscriptions","organizations_url":"https://api.github.com/users/borjasalguero/orgs","repos_url":"https://api.github.com/users/borjasalguero/repos","events_url":"https://api.github.com/users/borjasalguero/events{/privacy}","received_events_url":"https://api.github.com/users/borjasalguero/received_events","type":"User","site_admin":false},"body":"Why dont we create a function for handling this? `reset()`?","created_at":"2015-08-20T12:25:46Z","updated_at":"2015-08-20T12:25:46Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/31298#discussion_r37522808","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/37522808"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/31298#discussion_r37522808"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298","id":42005470,"html_url":"https://github.com/mozilla-b2g/gaia/pull/31298","diff_url":"https://github.com/mozilla-b2g/gaia/pull/31298.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/31298.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31298","number":31298,"state":"open","locked":false,"title":"Bug 1180627 - [Contacts][NGA] Remove overlay dependencies with contac…","user":{"login":"mancas","id":2591048,"avatar_url":"https://avatars.githubusercontent.com/u/2591048?v=3","gravatar_id":"","url":"https://api.github.com/users/mancas","html_url":"https://github.com/mancas","followers_url":"https://api.github.com/users/mancas/followers","following_url":"https://api.github.com/users/mancas/following{/other_user}","gists_url":"https://api.github.com/users/mancas/gists{/gist_id}","starred_url":"https://api.github.com/users/mancas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mancas/subscriptions","organizations_url":"https://api.github.com/users/mancas/orgs","repos_url":"https://api.github.com/users/mancas/repos","events_url":"https://api.github.com/users/mancas/events{/privacy}","received_events_url":"https://api.github.com/users/mancas/received_events","type":"User","site_admin":false},"body":"…ts.js","created_at":"2015-08-10T10:20:32Z","updated_at":"2015-08-20T12:25:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a352fc5d4d5494beecd44a53e4d66754b9b670a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298/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/31298/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/80e14b44366c2a3009ce67a03fd60c91187170fb","head":{"label":"mancas:overlay","ref":"overlay","sha":"80e14b44366c2a3009ce67a03fd60c91187170fb","user":{"login":"mancas","id":2591048,"avatar_url":"https://avatars.githubusercontent.com/u/2591048?v=3","gravatar_id":"","url":"https://api.github.com/users/mancas","html_url":"https://github.com/mancas","followers_url":"https://api.github.com/users/mancas/followers","following_url":"https://api.github.com/users/mancas/following{/other_user}","gists_url":"https://api.github.com/users/mancas/gists{/gist_id}","starred_url":"https://api.github.com/users/mancas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mancas/subscriptions","organizations_url":"https://api.github.com/users/mancas/orgs","repos_url":"https://api.github.com/users/mancas/repos","events_url":"https://api.github.com/users/mancas/events{/privacy}","received_events_url":"https://api.github.com/users/mancas/received_events","type":"User","site_admin":false},"repo":{"id":21567415,"name":"gaia","full_name":"mancas/gaia","owner":{"login":"mancas","id":2591048,"avatar_url":"https://avatars.githubusercontent.com/u/2591048?v=3","gravatar_id":"","url":"https://api.github.com/users/mancas","html_url":"https://github.com/mancas","followers_url":"https://api.github.com/users/mancas/followers","following_url":"https://api.github.com/users/mancas/following{/other_user}","gists_url":"https://api.github.com/users/mancas/gists{/gist_id}","starred_url":"https://api.github.com/users/mancas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mancas/subscriptions","organizations_url":"https://api.github.com/users/mancas/orgs","repos_url":"https://api.github.com/users/mancas/repos","events_url":"https://api.github.com/users/mancas/events{/privacy}","received_events_url":"https://api.github.com/users/mancas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mancas/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":true,"url":"https://api.github.com/repos/mancas/gaia","forks_url":"https://api.github.com/repos/mancas/gaia/forks","keys_url":"https://api.github.com/repos/mancas/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mancas/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mancas/gaia/teams","hooks_url":"https://api.github.com/repos/mancas/gaia/hooks","issue_events_url":"https://api.github.com/repos/mancas/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mancas/gaia/events","assignees_url":"https://api.github.com/repos/mancas/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mancas/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mancas/gaia/tags","blobs_url":"https://api.github.com/repos/mancas/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mancas/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mancas/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mancas/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mancas/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mancas/gaia/languages","stargazers_url":"https://api.github.com/repos/mancas/gaia/stargazers","contributors_url":"https://api.github.com/repos/mancas/gaia/contributors","subscribers_url":"https://api.github.com/repos/mancas/gaia/subscribers","subscription_url":"https://api.github.com/repos/mancas/gaia/subscription","commits_url":"https://api.github.com/repos/mancas/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mancas/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mancas/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mancas/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mancas/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mancas/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mancas/gaia/merges","archive_url":"https://api.github.com/repos/mancas/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mancas/gaia/downloads","issues_url":"https://api.github.com/repos/mancas/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mancas/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mancas/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mancas/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mancas/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mancas/gaia/releases{/id}","created_at":"2014-07-07T10:56:55Z","updated_at":"2015-01-19T09:24:10Z","pushed_at":"2015-08-20T10:49:41Z","git_url":"git://github.com/mancas/gaia.git","ssh_url":"git@github.com:mancas/gaia.git","clone_url":"https://github.com/mancas/gaia.git","svn_url":"https://github.com/mancas/gaia","homepage":"https://wiki.mozilla.org/B2G","size":945615,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"39b121515ab8a8c3ea07f26d3ba1dd792e90217c","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-08-19T15:00:38Z","pushed_at":"2015-08-20T12:10:37Z","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":1584655,"stargazers_count":1971,"watchers_count":1971,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2399,"mirror_url":null,"open_issues_count":1141,"forks":2399,"open_issues":1141,"watchers":1971,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/31298"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31298"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31298/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31298/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/31298/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/80e14b44366c2a3009ce67a03fd60c91187170fb"}}}}