{"action":"created","comment":{"url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/comments/39023872","id":39023872,"diff_hunk":"@@ -0,0 +1,297 @@\n+var $ = require('jquery'),\n+    tmpl = require('riot-tmpl'),\n+    Plugin = require('./plugin.js')\n+\n+var Toyplay = function (element, options) {\n+  this.$element = $(element)\n+  this.options = options\n+  this.appendPlayer()\n+}\n+\n+Toyplay.DEFAULTS = {\n+  template: [\n+    '<div class = \"toyplayer-song-image\">',\n+      '<img src = {imageSrc[songNumber]}></img>',\n+    '</div>',\n+\n+    '<div class = \"toyplayer-controls\">',\n+\n+      '<button class=\"toyplayer-button-play\">{PLAY}</button>',\n+\n+      '<div class=\"toyplayer-extra-controls\">',\n+        '<span class=\"toyplayer-current-time\">00.00</span>',\n+        '<span class=\"toyplayer-duration-time\">00.00</span>',\n+        '<a class=\"toyplayer-button-slower\">-30c</a>',\n+        '<a class=\"toyplayer-button-faster\">+30c</a>',\n+      '</div>',\n+\n+      '<button class=\"toyplayer-button-volume\">{MUTE}</button>',\n+\n+      '<div class=\"toyplayer-volume-bar-block\" class=\"hidden\">',\n+        '<span class=\"toyplayer-volume-change-bar-roller\">',\n+        '<span class=\"toyplayer-volume-change-bar-value\"></span>',\n+        '</span>',\n+      '</div>',\n+\n+      '<div class=\"toyplayer-progress\">',\n+        '<span class=\"toyplayer-progress-value\"></span>',\n+      '</div>',\n+\n+      '<button class=\"toyplayer-button-previous\">{PREV}</button>',\n+\n+      '<div class=\"toyplayer-song-name\">',\n+        '<p>{song[songNumber]}</p>',\n+        '<p>{artist[songNumber]}</p>',\n+      '</div>',\n+\n+      '<button class=\"toyplayer-button-next\">{NEXT}</button>',\n+\n+    '</div>',\n+\n+    '<audio>Canvas not supported</audio>'\n+\n+  ].join(''),\n+\n+  defaultImageSrc: 'http://www.themarkeworld.com/wp-content/uploads/2012/08/Night-sky.jpg',\n+\n+  imageSrc: [\n+    'http://i.allday2.com/d3/b8/a1/thumbs/1362952007_07.jpg',\n+    'http://assets.worldwildlife.org/photos/946/images/story_full_width/forests-why-matter_63516847.jpg?1345534028',\n+    'http://orig15.deviantart.net/b78d/f/2013/127/9/7/that_festival_night_by_boxtail-d64ickr.png'\n+  ],\n+\n+  songSrc: [\n+    'http://a.tumblr.com/tumblr_lyr37pUOvg1qbgvpzo1.mp3',\n+    'http://www.sp-fan.ru/media/music/file/Men_Without_Hats_-_The_Safety_Dance.mp3',\n+    'http://www.mcdman.com/music/mp3/Fields/PartyHard.mp3'\n+  ],\n+\n+  song: [\n+    'Different Pulses',\n+    'Cyclamen',\n+    'Love it or leave it'\n+  ],\n+\n+  artist: [\n+    'Asaf Avidan',\n+    'Asaf Avidan',\n+    'Asaf Avidan'\n+  ],\n+\n+  songNumber: 0,\n+\n+  PLAY: '&#xf04b;',\n+\n+  PAUSE: '&#xf04c;',\n+\n+  MUTE: '&#xf027;',\n+\n+  PREV: '&#xf048;',\n+\n+  NEXT: '&#xf051;'\n+}\n+\n+Toyplay.prototype = {\n+  appendPlayer: function (e) {\n+    var temperaryTemplate = this.options.template\n+    temperaryTemplate = tmpl(temperaryTemplate, this.options)\n+    $(this.$element).append(temperaryTemplate)\n+    this.listenEvents()\n+  },\n+\n+  listenEvents: function () {\n+    $('.toyplayer-button-play').on('click', $.proxy(this.togglePlay, this))\n+    $('.toyplayer-button-slower').on('click', $.proxy(this.rewindAudio, this))\n+    $('.toyplayer-button-faster').on('click', $.proxy(this.forwardAudio, this))\n+    $('audio').on('durationchange', $.proxy(this.showDuration, this))\n+    $('audio').on('timeupdate', $.proxy(this.drawProgressBar, this))\n+    $('audio').on('timeupdate', $.proxy(this.showCurrentTime, this))\n+    $('.toyplayer-volume-change-bar-roller').on('click', $.proxy(this.volumeChange, this))\n+    $('.toyplayer-progress').on('click', $.proxy(this.changeCurrentTime, this))\n+    $('.toyplayer-button-volume').on('click', $.proxy(this.toggleVolumeBar, this))\n+    $('.toyplayer-button-next').on('click', $.proxy(this.changeSongToNext, this))\n+    $('.toyplayer-button-previous').on('click', $.proxy(this.changeSongToPrevious, this))\n+  },\n+\n+  togglePlay: function () {\n+    var audioElm = document.querySelector('audio')\n+\n+    if (audioElm.paused) {","path":"src/javascripts/audio_player.js","position":119,"original_position":119,"commit_id":"97bd98de834aea58b5ab97f1f79d1205b4f0d195","original_commit_id":"97bd98de834aea58b5ab97f1f79d1205b4f0d195","user":{"login":"strangeworks","id":1908752,"avatar_url":"https://avatars.githubusercontent.com/u/1908752?v=3","gravatar_id":"","url":"https://api.github.com/users/strangeworks","html_url":"https://github.com/strangeworks","followers_url":"https://api.github.com/users/strangeworks/followers","following_url":"https://api.github.com/users/strangeworks/following{/other_user}","gists_url":"https://api.github.com/users/strangeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/strangeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangeworks/subscriptions","organizations_url":"https://api.github.com/users/strangeworks/orgs","repos_url":"https://api.github.com/users/strangeworks/repos","events_url":"https://api.github.com/users/strangeworks/events{/privacy}","received_events_url":"https://api.github.com/users/strangeworks/received_events","type":"User","site_admin":false},"body":"```javascript\r\nthis[audioElm.paused ? 'playAudio' : 'pauseAudio']()\r\n```","created_at":"2015-09-09T09:39:30Z","updated_at":"2015-09-09T09:39:30Z","html_url":"https://github.com/strangeworks/toyplayer/pull/1#discussion_r39023872","pull_request_url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/comments/39023872"},"html":{"href":"https://github.com/strangeworks/toyplayer/pull/1#discussion_r39023872"},"pull_request":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1","id":44430779,"html_url":"https://github.com/strangeworks/toyplayer/pull/1","diff_url":"https://github.com/strangeworks/toyplayer/pull/1.diff","patch_url":"https://github.com/strangeworks/toyplayer/pull/1.patch","issue_url":"https://api.github.com/repos/strangeworks/toyplayer/issues/1","number":1,"state":"open","locked":false,"title":"Creating audio player","user":{"login":"NaumenkoYuliia","id":13471431,"avatar_url":"https://avatars.githubusercontent.com/u/13471431?v=3","gravatar_id":"","url":"https://api.github.com/users/NaumenkoYuliia","html_url":"https://github.com/NaumenkoYuliia","followers_url":"https://api.github.com/users/NaumenkoYuliia/followers","following_url":"https://api.github.com/users/NaumenkoYuliia/following{/other_user}","gists_url":"https://api.github.com/users/NaumenkoYuliia/gists{/gist_id}","starred_url":"https://api.github.com/users/NaumenkoYuliia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaumenkoYuliia/subscriptions","organizations_url":"https://api.github.com/users/NaumenkoYuliia/orgs","repos_url":"https://api.github.com/users/NaumenkoYuliia/repos","events_url":"https://api.github.com/users/NaumenkoYuliia/events{/privacy}","received_events_url":"https://api.github.com/users/NaumenkoYuliia/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-08T13:18:25Z","updated_at":"2015-09-09T09:39:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4096476c740481d98a9f38c70b3cc39ff2047b12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1/commits","review_comments_url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1/comments","review_comment_url":"https://api.github.com/repos/strangeworks/toyplayer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strangeworks/toyplayer/issues/1/comments","statuses_url":"https://api.github.com/repos/strangeworks/toyplayer/statuses/97bd98de834aea58b5ab97f1f79d1205b4f0d195","head":{"label":"NaumenkoYuliia:creating_audio_player","ref":"creating_audio_player","sha":"97bd98de834aea58b5ab97f1f79d1205b4f0d195","user":{"login":"NaumenkoYuliia","id":13471431,"avatar_url":"https://avatars.githubusercontent.com/u/13471431?v=3","gravatar_id":"","url":"https://api.github.com/users/NaumenkoYuliia","html_url":"https://github.com/NaumenkoYuliia","followers_url":"https://api.github.com/users/NaumenkoYuliia/followers","following_url":"https://api.github.com/users/NaumenkoYuliia/following{/other_user}","gists_url":"https://api.github.com/users/NaumenkoYuliia/gists{/gist_id}","starred_url":"https://api.github.com/users/NaumenkoYuliia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaumenkoYuliia/subscriptions","organizations_url":"https://api.github.com/users/NaumenkoYuliia/orgs","repos_url":"https://api.github.com/users/NaumenkoYuliia/repos","events_url":"https://api.github.com/users/NaumenkoYuliia/events{/privacy}","received_events_url":"https://api.github.com/users/NaumenkoYuliia/received_events","type":"User","site_admin":false},"repo":{"id":41728974,"name":"toyplayer","full_name":"NaumenkoYuliia/toyplayer","owner":{"login":"NaumenkoYuliia","id":13471431,"avatar_url":"https://avatars.githubusercontent.com/u/13471431?v=3","gravatar_id":"","url":"https://api.github.com/users/NaumenkoYuliia","html_url":"https://github.com/NaumenkoYuliia","followers_url":"https://api.github.com/users/NaumenkoYuliia/followers","following_url":"https://api.github.com/users/NaumenkoYuliia/following{/other_user}","gists_url":"https://api.github.com/users/NaumenkoYuliia/gists{/gist_id}","starred_url":"https://api.github.com/users/NaumenkoYuliia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaumenkoYuliia/subscriptions","organizations_url":"https://api.github.com/users/NaumenkoYuliia/orgs","repos_url":"https://api.github.com/users/NaumenkoYuliia/repos","events_url":"https://api.github.com/users/NaumenkoYuliia/events{/privacy}","received_events_url":"https://api.github.com/users/NaumenkoYuliia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NaumenkoYuliia/toyplayer","description":"Task for junior frontend dev","fork":true,"url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer","forks_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/forks","keys_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/teams","hooks_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/hooks","issue_events_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/issues/events{/number}","events_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/events","assignees_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/assignees{/user}","branches_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/branches{/branch}","tags_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/tags","blobs_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/statuses/{sha}","languages_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/languages","stargazers_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/stargazers","contributors_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/contributors","subscribers_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/subscribers","subscription_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/subscription","commits_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/contents/{+path}","compare_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/merges","archive_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/downloads","issues_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/issues{/number}","pulls_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/pulls{/number}","milestones_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/milestones{/number}","notifications_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/labels{/name}","releases_url":"https://api.github.com/repos/NaumenkoYuliia/toyplayer/releases{/id}","created_at":"2015-09-01T09:16:49Z","updated_at":"2015-09-01T09:16:49Z","pushed_at":"2015-09-08T12:48:50Z","git_url":"git://github.com/NaumenkoYuliia/toyplayer.git","ssh_url":"git@github.com:NaumenkoYuliia/toyplayer.git","clone_url":"https://github.com/NaumenkoYuliia/toyplayer.git","svn_url":"https://github.com/NaumenkoYuliia/toyplayer","homepage":"","size":19796,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"strangeworks:master","ref":"master","sha":"68d11384365d891fc3b54e05a6fff44aa016d652","user":{"login":"strangeworks","id":1908752,"avatar_url":"https://avatars.githubusercontent.com/u/1908752?v=3","gravatar_id":"","url":"https://api.github.com/users/strangeworks","html_url":"https://github.com/strangeworks","followers_url":"https://api.github.com/users/strangeworks/followers","following_url":"https://api.github.com/users/strangeworks/following{/other_user}","gists_url":"https://api.github.com/users/strangeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/strangeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangeworks/subscriptions","organizations_url":"https://api.github.com/users/strangeworks/orgs","repos_url":"https://api.github.com/users/strangeworks/repos","events_url":"https://api.github.com/users/strangeworks/events{/privacy}","received_events_url":"https://api.github.com/users/strangeworks/received_events","type":"User","site_admin":false},"repo":{"id":41696913,"name":"toyplayer","full_name":"strangeworks/toyplayer","owner":{"login":"strangeworks","id":1908752,"avatar_url":"https://avatars.githubusercontent.com/u/1908752?v=3","gravatar_id":"","url":"https://api.github.com/users/strangeworks","html_url":"https://github.com/strangeworks","followers_url":"https://api.github.com/users/strangeworks/followers","following_url":"https://api.github.com/users/strangeworks/following{/other_user}","gists_url":"https://api.github.com/users/strangeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/strangeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangeworks/subscriptions","organizations_url":"https://api.github.com/users/strangeworks/orgs","repos_url":"https://api.github.com/users/strangeworks/repos","events_url":"https://api.github.com/users/strangeworks/events{/privacy}","received_events_url":"https://api.github.com/users/strangeworks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/strangeworks/toyplayer","description":"Task for junior frontend dev","fork":false,"url":"https://api.github.com/repos/strangeworks/toyplayer","forks_url":"https://api.github.com/repos/strangeworks/toyplayer/forks","keys_url":"https://api.github.com/repos/strangeworks/toyplayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strangeworks/toyplayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strangeworks/toyplayer/teams","hooks_url":"https://api.github.com/repos/strangeworks/toyplayer/hooks","issue_events_url":"https://api.github.com/repos/strangeworks/toyplayer/issues/events{/number}","events_url":"https://api.github.com/repos/strangeworks/toyplayer/events","assignees_url":"https://api.github.com/repos/strangeworks/toyplayer/assignees{/user}","branches_url":"https://api.github.com/repos/strangeworks/toyplayer/branches{/branch}","tags_url":"https://api.github.com/repos/strangeworks/toyplayer/tags","blobs_url":"https://api.github.com/repos/strangeworks/toyplayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strangeworks/toyplayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strangeworks/toyplayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/strangeworks/toyplayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strangeworks/toyplayer/statuses/{sha}","languages_url":"https://api.github.com/repos/strangeworks/toyplayer/languages","stargazers_url":"https://api.github.com/repos/strangeworks/toyplayer/stargazers","contributors_url":"https://api.github.com/repos/strangeworks/toyplayer/contributors","subscribers_url":"https://api.github.com/repos/strangeworks/toyplayer/subscribers","subscription_url":"https://api.github.com/repos/strangeworks/toyplayer/subscription","commits_url":"https://api.github.com/repos/strangeworks/toyplayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/strangeworks/toyplayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/strangeworks/toyplayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/strangeworks/toyplayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/strangeworks/toyplayer/contents/{+path}","compare_url":"https://api.github.com/repos/strangeworks/toyplayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strangeworks/toyplayer/merges","archive_url":"https://api.github.com/repos/strangeworks/toyplayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strangeworks/toyplayer/downloads","issues_url":"https://api.github.com/repos/strangeworks/toyplayer/issues{/number}","pulls_url":"https://api.github.com/repos/strangeworks/toyplayer/pulls{/number}","milestones_url":"https://api.github.com/repos/strangeworks/toyplayer/milestones{/number}","notifications_url":"https://api.github.com/repos/strangeworks/toyplayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strangeworks/toyplayer/labels{/name}","releases_url":"https://api.github.com/repos/strangeworks/toyplayer/releases{/id}","created_at":"2015-08-31T19:46:34Z","updated_at":"2015-08-31T23:24:45Z","pushed_at":"2015-09-08T13:18:25Z","git_url":"git://github.com/strangeworks/toyplayer.git","ssh_url":"git@github.com:strangeworks/toyplayer.git","clone_url":"https://github.com/strangeworks/toyplayer.git","svn_url":"https://github.com/strangeworks/toyplayer","homepage":"","size":140,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1"},"html":{"href":"https://github.com/strangeworks/toyplayer/pull/1"},"issue":{"href":"https://api.github.com/repos/strangeworks/toyplayer/issues/1"},"comments":{"href":"https://api.github.com/repos/strangeworks/toyplayer/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strangeworks/toyplayer/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/strangeworks/toyplayer/statuses/97bd98de834aea58b5ab97f1f79d1205b4f0d195"}}}}