{"action":"created","comment":{"url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/comments/62614174","id":62614174,"diff_hunk":"@@ -1,106 +1,82 @@\n-$(function() {\n-    Timer.init();\n+var app = angular.module('app', []);\n+\n+app.filter('secondsToTime', function() {\n+    return function(seconds) {\n+        var d = new Date(0,0,0,0,0,0,0);\n+        d.setSeconds(seconds);\n+        return d;\n+    };\n });\n \n-var Timer = {\n-    paused: true,\n-    timeTillNext: {},\n-    timeStarted: {},\n-    timeRemaining: {},\n-    minute: 60 * 1000,\n-    bell: document.createElement('audio'),\n-    init: function () {\n-        this._bindBtns();\n-        // Sound = \"glass ping\"\n-        Timer.bell.setAttribute('src', 'http://soundbible.com/grab.php?id=2084&type=wav');\n-        Timer.bell.setAttribute('src', 'http://soundbible.com/grab.php?id=2084&type=mp3');\n-    },\n-    _bindBtns: function () {\n-        $('#btn-break-down').on('click', function() {\n-          Timer._incremLength('break-len', 'down');\n-          Timer._reset();\n-        });\n-        $('#btn-break-up').on('click', function() {\n-          Timer._incremLength('break-len');\n-          Timer._reset();\n-        });\n-        $('#btn-session-down').on('click', function() {\n-          Timer._incremLength('session-len', 'down');\n-          Timer._reset();\n-        });\n-        $('#btn-session-up').on('click', function() {\n-          Timer._incremLength('session-len');\n-          Timer._reset();\n-        });\n-        $('.circle').on('click', function() {\n-          if ($('#circleLabel').text() === 'Start')\n-              Timer._setCountdown();\n-          else {\n-              // Pause countdown if it's currently running\n-              if(Timer.paused === false) {\n-                  // 'Pause' current countdown.  Note: $(id).countdown('pause') just freezes the countdown html displayed,\n-                  // but not the actual time.  See https://github.com/hilios/jQuery.countdown/issues/144#issuecomment-146582246)\n-                  $(\"#timer\").countdown('pause');\n-                  // Clear timer set for next countdown.\n-                  clearTimeout(Timer.timeTillNext);\n-                  // Calculate the time remaining for current countdown\n-                  var timePaused = new Date().getTime();\n-                  Timer.timeRemaining = Timer.timeRemaining - (timePaused - Timer.timeStarted);\n-                  Timer.paused = true;\n-              // Unpause countdown if it's currently paused\n-              } else {\n-                  // Reset current countdown based on time remaining\n-                  Timer._countdown(Timer.timeRemaining);\n-                  // Reset timer for the next countdown\n-                  Timer.timeTillNext = setTimeout( function() {\n-                      Timer._setCountdown();\n-                  }, Timer.timeRemaining);\n-                  Timer.paused = false;\n-              }\n-          }\n-        });\n-    },\n-    _incremLength: function (locId, direction = 'up') {\n-        var currLen = Number($('#' + locId).text());\n-        var d = 1;\n-        if (direction === 'down')\n-            d = -1;\n-        currLen = Math.max(0, currLen + d);\n-        $('#' + locId).html(currLen);\n-    },\n-    // Set countdown.  Parameter 'length' is in ms\n-    _countdown: function (timeRemaining) {\n-        Timer.timeStarted = new Date().getTime();\n-        var endTime = new Date().setTime(Timer.timeStarted + timeRemaining);\n-        $(\"#timer\").countdown(endTime, function(event) {\n-            $(this).text(event.strftime('%H:%M:%S'));\n-        });\n-        // Only play bell if the Timer._countdown function was called due to a swap between\n-        // session and break, not if it was called to unpause.\n-        if(Timer.paused === false)\n-            Timer.bell.play();\n-        Timer.paused = false;\n-    },\n-    _setCountdown: function(lenLocId, breakLabel) {\n-        // Set variables\n-        var label = $('#circleLabel').text() ;\n-        var lenLocId = (label === 'Start' || label === 'Break') ? '#session-len': '#break-len';\n-        var breakLabel = (label === 'Start' || label === 'Break') ? 'Session': 'Break';\n-        // Set up countdown\n-        Timer.timeRemaining = Number($(lenLocId).text()) * Timer.minute;\n-        $('#circleLabel').html(breakLabel);\n-        Timer._countdown(Timer.timeRemaining);\n-        // Set timer for the following countdown\n-        Timer.timeTillNext = setTimeout( function() {\n-            Timer._setCountdown();\n-        }, Timer.timeRemaining);\n-    },\n-    _reset: function() {\n-        $('#circleLabel').html('Start');\n-        clearTimeout(Timer.timeTillNext);\n-        if(Timer.paused === false)\n-            $('#timer').countdown('stop');\n-        $('#timer').html('00:00:00');\n-        Timer.paused = true;","path":"public/js/app.js","position":112,"original_position":112,"commit_id":"44471b81411fcb51c2f71b4906f4085bc02fad8c","original_commit_id":"44471b81411fcb51c2f71b4906f4085bc02fad8c","user":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"body":"Added functionality of adding additional timers, each with the option of muting/removing","created_at":"2016-05-10T05:26:52Z","updated_at":"2016-05-10T05:26:52Z","html_url":"https://github.com/ytv/pomodoro-clock/pull/1#discussion_r62614174","pull_request_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/comments/62614174"},"html":{"href":"https://github.com/ytv/pomodoro-clock/pull/1#discussion_r62614174"},"pull_request":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1","id":69285619,"html_url":"https://github.com/ytv/pomodoro-clock/pull/1","diff_url":"https://github.com/ytv/pomodoro-clock/pull/1.diff","patch_url":"https://github.com/ytv/pomodoro-clock/pull/1.patch","issue_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/1","number":1,"state":"open","locked":false,"title":"added angularJS and removed jQuery","user":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"body":"Because I removed jQuery and added AngularJS, I had to rewrite the countdown which was previously a jquery plugin.  Also, the class names were slightly renamed to be more in line with CSS recommended style-guides.  The JS logic however is pretty much the same as before.","created_at":"2016-05-09T01:01:24Z","updated_at":"2016-05-10T05:26:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d3b6a630aa588197cbcb81025535e3536799cde","assignee":{"login":"pandaexpress","id":4051837,"avatar_url":"https://avatars.githubusercontent.com/u/4051837?v=3","gravatar_id":"","url":"https://api.github.com/users/pandaexpress","html_url":"https://github.com/pandaexpress","followers_url":"https://api.github.com/users/pandaexpress/followers","following_url":"https://api.github.com/users/pandaexpress/following{/other_user}","gists_url":"https://api.github.com/users/pandaexpress/gists{/gist_id}","starred_url":"https://api.github.com/users/pandaexpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandaexpress/subscriptions","organizations_url":"https://api.github.com/users/pandaexpress/orgs","repos_url":"https://api.github.com/users/pandaexpress/repos","events_url":"https://api.github.com/users/pandaexpress/events{/privacy}","received_events_url":"https://api.github.com/users/pandaexpress/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/1/comments","statuses_url":"https://api.github.com/repos/ytv/pomodoro-clock/statuses/44471b81411fcb51c2f71b4906f4085bc02fad8c","head":{"label":"ytv:addAngularJS","ref":"addAngularJS","sha":"44471b81411fcb51c2f71b4906f4085bc02fad8c","user":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"repo":{"id":58157234,"name":"pomodoro-clock","full_name":"ytv/pomodoro-clock","owner":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ytv/pomodoro-clock","description":"A pomodoro clock web app that lets you time how work and breaks","fork":false,"url":"https://api.github.com/repos/ytv/pomodoro-clock","forks_url":"https://api.github.com/repos/ytv/pomodoro-clock/forks","keys_url":"https://api.github.com/repos/ytv/pomodoro-clock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ytv/pomodoro-clock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ytv/pomodoro-clock/teams","hooks_url":"https://api.github.com/repos/ytv/pomodoro-clock/hooks","issue_events_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/events{/number}","events_url":"https://api.github.com/repos/ytv/pomodoro-clock/events","assignees_url":"https://api.github.com/repos/ytv/pomodoro-clock/assignees{/user}","branches_url":"https://api.github.com/repos/ytv/pomodoro-clock/branches{/branch}","tags_url":"https://api.github.com/repos/ytv/pomodoro-clock/tags","blobs_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/refs{/sha}","trees_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ytv/pomodoro-clock/statuses/{sha}","languages_url":"https://api.github.com/repos/ytv/pomodoro-clock/languages","stargazers_url":"https://api.github.com/repos/ytv/pomodoro-clock/stargazers","contributors_url":"https://api.github.com/repos/ytv/pomodoro-clock/contributors","subscribers_url":"https://api.github.com/repos/ytv/pomodoro-clock/subscribers","subscription_url":"https://api.github.com/repos/ytv/pomodoro-clock/subscription","commits_url":"https://api.github.com/repos/ytv/pomodoro-clock/commits{/sha}","git_commits_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/commits{/sha}","comments_url":"https://api.github.com/repos/ytv/pomodoro-clock/comments{/number}","issue_comment_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/comments{/number}","contents_url":"https://api.github.com/repos/ytv/pomodoro-clock/contents/{+path}","compare_url":"https://api.github.com/repos/ytv/pomodoro-clock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ytv/pomodoro-clock/merges","archive_url":"https://api.github.com/repos/ytv/pomodoro-clock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ytv/pomodoro-clock/downloads","issues_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues{/number}","pulls_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls{/number}","milestones_url":"https://api.github.com/repos/ytv/pomodoro-clock/milestones{/number}","notifications_url":"https://api.github.com/repos/ytv/pomodoro-clock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ytv/pomodoro-clock/labels{/name}","releases_url":"https://api.github.com/repos/ytv/pomodoro-clock/releases{/id}","deployments_url":"https://api.github.com/repos/ytv/pomodoro-clock/deployments","created_at":"2016-05-05T20:02:58Z","updated_at":"2016-05-05T20:03:55Z","pushed_at":"2016-05-09T01:01:24Z","git_url":"git://github.com/ytv/pomodoro-clock.git","ssh_url":"git@github.com:ytv/pomodoro-clock.git","clone_url":"https://github.com/ytv/pomodoro-clock.git","svn_url":"https://github.com/ytv/pomodoro-clock","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"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":"ytv:master","ref":"master","sha":"d060ce2dab72e81dee5223c1a0b2d5f1865f79ac","user":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"repo":{"id":58157234,"name":"pomodoro-clock","full_name":"ytv/pomodoro-clock","owner":{"login":"ytv","id":14367962,"avatar_url":"https://avatars.githubusercontent.com/u/14367962?v=3","gravatar_id":"","url":"https://api.github.com/users/ytv","html_url":"https://github.com/ytv","followers_url":"https://api.github.com/users/ytv/followers","following_url":"https://api.github.com/users/ytv/following{/other_user}","gists_url":"https://api.github.com/users/ytv/gists{/gist_id}","starred_url":"https://api.github.com/users/ytv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ytv/subscriptions","organizations_url":"https://api.github.com/users/ytv/orgs","repos_url":"https://api.github.com/users/ytv/repos","events_url":"https://api.github.com/users/ytv/events{/privacy}","received_events_url":"https://api.github.com/users/ytv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ytv/pomodoro-clock","description":"A pomodoro clock web app that lets you time how work and breaks","fork":false,"url":"https://api.github.com/repos/ytv/pomodoro-clock","forks_url":"https://api.github.com/repos/ytv/pomodoro-clock/forks","keys_url":"https://api.github.com/repos/ytv/pomodoro-clock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ytv/pomodoro-clock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ytv/pomodoro-clock/teams","hooks_url":"https://api.github.com/repos/ytv/pomodoro-clock/hooks","issue_events_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/events{/number}","events_url":"https://api.github.com/repos/ytv/pomodoro-clock/events","assignees_url":"https://api.github.com/repos/ytv/pomodoro-clock/assignees{/user}","branches_url":"https://api.github.com/repos/ytv/pomodoro-clock/branches{/branch}","tags_url":"https://api.github.com/repos/ytv/pomodoro-clock/tags","blobs_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/refs{/sha}","trees_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ytv/pomodoro-clock/statuses/{sha}","languages_url":"https://api.github.com/repos/ytv/pomodoro-clock/languages","stargazers_url":"https://api.github.com/repos/ytv/pomodoro-clock/stargazers","contributors_url":"https://api.github.com/repos/ytv/pomodoro-clock/contributors","subscribers_url":"https://api.github.com/repos/ytv/pomodoro-clock/subscribers","subscription_url":"https://api.github.com/repos/ytv/pomodoro-clock/subscription","commits_url":"https://api.github.com/repos/ytv/pomodoro-clock/commits{/sha}","git_commits_url":"https://api.github.com/repos/ytv/pomodoro-clock/git/commits{/sha}","comments_url":"https://api.github.com/repos/ytv/pomodoro-clock/comments{/number}","issue_comment_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues/comments{/number}","contents_url":"https://api.github.com/repos/ytv/pomodoro-clock/contents/{+path}","compare_url":"https://api.github.com/repos/ytv/pomodoro-clock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ytv/pomodoro-clock/merges","archive_url":"https://api.github.com/repos/ytv/pomodoro-clock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ytv/pomodoro-clock/downloads","issues_url":"https://api.github.com/repos/ytv/pomodoro-clock/issues{/number}","pulls_url":"https://api.github.com/repos/ytv/pomodoro-clock/pulls{/number}","milestones_url":"https://api.github.com/repos/ytv/pomodoro-clock/milestones{/number}","notifications_url":"https://api.github.com/repos/ytv/pomodoro-clock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ytv/pomodoro-clock/labels{/name}","releases_url":"https://api.github.com/repos/ytv/pomodoro-clock/releases{/id}","deployments_url":"https://api.github.com/repos/ytv/pomodoro-clock/deployments","created_at":"2016-05-05T20:02:58Z","updated_at":"2016-05-05T20:03:55Z","pushed_at":"2016-05-09T01:01:24Z","git_url":"git://github.com/ytv/pomodoro-clock.git","ssh_url":"git@github.com:ytv/pomodoro-clock.git","clone_url":"https://github.com/ytv/pomodoro-clock.git","svn_url":"https://github.com/ytv/pomodoro-clock","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1"},"html":{"href":"https://github.com/ytv/pomodoro-clock/pull/1"},"issue":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/issues/1"},"comments":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ytv/pomodoro-clock/statuses/44471b81411fcb51c2f71b4906f4085bc02fad8c"}}}}