{"action":"created","comment":{"url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/comments/33108947","id":33108947,"diff_hunk":"@@ -129,16 +156,75 @@ TODO: remove instrinsic ratio implementation from index.html and it to the plugi\n             $videoTitle.html(videoConfig.videoTitle || video.name);\n             $description.html(videoConfig.videoDescription || video.long_description);\n             //shows/hides disclaimer panel based on player config\n-            if (disclaimer && disclaimer.trim().length > 0){\n+            if (isValidString(disclaimer)){\n                 $disclaimerDiv.html(disclaimer);\n                 $modal.addClass(\"bcc-has-disclaimer\");\n             } else {\n                 $modal.removeClass(\"bcc-has-disclaimer\");\n             }\n+            \n+            // Adds Video CTAs\n+            addCTAs(videoConfig.ctas);\n             sizeModal();\n         },\n         \n         /**\n+        * Adds CTAs to the displayer based on player configuration.\n+        */\n+        addCTAs = function(ctaConfig) {\n+            var i,\n+                addedCTAs = 0, // number of CTAs added to the display\n+                $ctaContainer = $detailDiv.find('.bcc-cta-container'),\n+                totalCTAs = (ctaConfig) ? ctaConfig.length : 0;\n+            \n+            //Removes CTAs from the container before adding new ones,\n+            $ctaContainer.empty();\n+                       \n+            for (i = 0; i < totalCTAs; i++) {\n+             // Validates CTA configuration. \n+             // Exits loop if the number of added CTAs is greater to the max allowed.\n+             if (addedCTAs >= CTA_MAX) break;\n+             // breaks one iteration in the loop, if the condition below occurs.\n+             if (!isValidString(ctaConfig[i].text) || !(isValidLink(ctaConfig[i].link) || isValidFunction(ctaConfig[i].callback)) || ctaConfig[i].displayOnDesktop === false) {\n+                 log(\"-------- skip cta.\"); //TODO: remove when testing is done\n+                 continue;\n+             } \n+                \n+             // Adds elements and listeners.    \n+             (function(){\n+                 var $item, \n+                     cta = ctaConfig[i];\n+\n+                 //Creates the div element\n+                 $item = $('<div class=\"bcc-cta-button\"></div>').html(cta.text);\n+\n+                 $item.on(\"click touchstart\", function(){\n+                     if (isValidFunction(cta.callback)){\n+                         cta.callback(videoConfig); \n+                     } else {\n+                         window.open(cta.link ,'_blank');\n+                     }\n+                 }); \n+\n+                 //Adds element to the display\n+                 $ctaContainer.append($item);\n+\n+                 addedCTAs += 1;\n+                 log(addedCTAs + \". Added CTA: \" +  cta.text); //TODO: remove when testing is done\n+\n+             }());\n+            }\n+            \n+            //Shows/Hides CTA container.\n+            if (addedCTAs > 0) {\n+                $ctaContainer.addClass(\"bcc-has-ctas\");\n+            } else {\n+                $ctaContainer.removeClass(\"bcc-has-ctas\");\n+            }\n+                 \n+        },\n+        \n+        /**","path":"lib/bcgs_ford_modal.js","position":123,"original_position":123,"commit_id":"a9e5a511a9ced65a718b0978a1ec615b3166dda7","original_commit_id":"a9e5a511a9ced65a718b0978a1ec615b3166dda7","user":{"login":"bceacuna","id":1122841,"avatar_url":"https://avatars.githubusercontent.com/u/1122841?v=3","gravatar_id":"","url":"https://api.github.com/users/bceacuna","html_url":"https://github.com/bceacuna","followers_url":"https://api.github.com/users/bceacuna/followers","following_url":"https://api.github.com/users/bceacuna/following{/other_user}","gists_url":"https://api.github.com/users/bceacuna/gists{/gist_id}","starred_url":"https://api.github.com/users/bceacuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bceacuna/subscriptions","organizations_url":"https://api.github.com/users/bceacuna/orgs","repos_url":"https://api.github.com/users/bceacuna/repos","events_url":"https://api.github.com/users/bceacuna/events{/privacy}","received_events_url":"https://api.github.com/users/bceacuna/received_events","type":"User","site_admin":false},"body":"Agree. Next sprint I'll refactor this and create a new file for the CTA logic.","created_at":"2015-06-24T00:50:59Z","updated_at":"2015-06-24T00:50:59Z","html_url":"https://github.com/BrightcovePS/FordPlayer/pull/27#discussion_r33108947","pull_request_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/comments/33108947"},"html":{"href":"https://github.com/BrightcovePS/FordPlayer/pull/27#discussion_r33108947"},"pull_request":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27","id":38385937,"html_url":"https://github.com/BrightcovePS/FordPlayer/pull/27","diff_url":"https://github.com/BrightcovePS/FordPlayer/pull/27.diff","patch_url":"https://github.com/BrightcovePS/FordPlayer/pull/27.patch","issue_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/27","number":27,"state":"open","locked":false,"title":"Feature/ct adesktop","user":{"login":"bceacuna","id":1122841,"avatar_url":"https://avatars.githubusercontent.com/u/1122841?v=3","gravatar_id":"","url":"https://api.github.com/users/bceacuna","html_url":"https://github.com/bceacuna","followers_url":"https://api.github.com/users/bceacuna/followers","following_url":"https://api.github.com/users/bceacuna/following{/other_user}","gists_url":"https://api.github.com/users/bceacuna/gists{/gist_id}","starred_url":"https://api.github.com/users/bceacuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bceacuna/subscriptions","organizations_url":"https://api.github.com/users/bceacuna/orgs","repos_url":"https://api.github.com/users/bceacuna/repos","events_url":"https://api.github.com/users/bceacuna/events{/privacy}","received_events_url":"https://api.github.com/users/bceacuna/received_events","type":"User","site_admin":false},"body":"Show CTAs on Desktop","created_at":"2015-06-23T21:37:20Z","updated_at":"2015-06-24T00:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27/commits","review_comments_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27/comments","review_comment_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/27/comments","statuses_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/statuses/a9e5a511a9ced65a718b0978a1ec615b3166dda7","head":{"label":"BrightcovePS:feature/CTAdesktop","ref":"feature/CTAdesktop","sha":"a9e5a511a9ced65a718b0978a1ec615b3166dda7","user":{"login":"BrightcovePS","id":552419,"avatar_url":"https://avatars.githubusercontent.com/u/552419?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcovePS","html_url":"https://github.com/BrightcovePS","followers_url":"https://api.github.com/users/BrightcovePS/followers","following_url":"https://api.github.com/users/BrightcovePS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcovePS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcovePS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcovePS/subscriptions","organizations_url":"https://api.github.com/users/BrightcovePS/orgs","repos_url":"https://api.github.com/users/BrightcovePS/repos","events_url":"https://api.github.com/users/BrightcovePS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcovePS/received_events","type":"Organization","site_admin":false},"repo":{"id":36770895,"name":"FordPlayer","full_name":"BrightcovePS/FordPlayer","owner":{"login":"BrightcovePS","id":552419,"avatar_url":"https://avatars.githubusercontent.com/u/552419?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcovePS","html_url":"https://github.com/BrightcovePS","followers_url":"https://api.github.com/users/BrightcovePS/followers","following_url":"https://api.github.com/users/BrightcovePS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcovePS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcovePS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcovePS/subscriptions","organizations_url":"https://api.github.com/users/BrightcovePS/orgs","repos_url":"https://api.github.com/users/BrightcovePS/repos","events_url":"https://api.github.com/users/BrightcovePS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcovePS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrightcovePS/FordPlayer","description":"Ford / Team Detroit custom player","fork":false,"url":"https://api.github.com/repos/BrightcovePS/FordPlayer","forks_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/forks","keys_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/teams","hooks_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/hooks","issue_events_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/events{/number}","events_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/events","assignees_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/assignees{/user}","branches_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/branches{/branch}","tags_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/tags","blobs_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/statuses/{sha}","languages_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/languages","stargazers_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/stargazers","contributors_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/contributors","subscribers_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/subscribers","subscription_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/subscription","commits_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/contents/{+path}","compare_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/merges","archive_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/downloads","issues_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues{/number}","pulls_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls{/number}","milestones_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/milestones{/number}","notifications_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/labels{/name}","releases_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/releases{/id}","created_at":"2015-06-03T00:57:35Z","updated_at":"2015-06-03T00:57:35Z","pushed_at":"2015-06-24T00:35:04Z","git_url":"git://github.com/BrightcovePS/FordPlayer.git","ssh_url":"git@github.com:BrightcovePS/FordPlayer.git","clone_url":"https://github.com/BrightcovePS/FordPlayer.git","svn_url":"https://github.com/BrightcovePS/FordPlayer","homepage":null,"size":2152,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"BrightcovePS:dev","ref":"dev","sha":"bbd19dcdfe205ff29d8e3c81b4df0761b3a94ab8","user":{"login":"BrightcovePS","id":552419,"avatar_url":"https://avatars.githubusercontent.com/u/552419?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcovePS","html_url":"https://github.com/BrightcovePS","followers_url":"https://api.github.com/users/BrightcovePS/followers","following_url":"https://api.github.com/users/BrightcovePS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcovePS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcovePS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcovePS/subscriptions","organizations_url":"https://api.github.com/users/BrightcovePS/orgs","repos_url":"https://api.github.com/users/BrightcovePS/repos","events_url":"https://api.github.com/users/BrightcovePS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcovePS/received_events","type":"Organization","site_admin":false},"repo":{"id":36770895,"name":"FordPlayer","full_name":"BrightcovePS/FordPlayer","owner":{"login":"BrightcovePS","id":552419,"avatar_url":"https://avatars.githubusercontent.com/u/552419?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcovePS","html_url":"https://github.com/BrightcovePS","followers_url":"https://api.github.com/users/BrightcovePS/followers","following_url":"https://api.github.com/users/BrightcovePS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcovePS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcovePS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcovePS/subscriptions","organizations_url":"https://api.github.com/users/BrightcovePS/orgs","repos_url":"https://api.github.com/users/BrightcovePS/repos","events_url":"https://api.github.com/users/BrightcovePS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcovePS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrightcovePS/FordPlayer","description":"Ford / Team Detroit custom player","fork":false,"url":"https://api.github.com/repos/BrightcovePS/FordPlayer","forks_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/forks","keys_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/teams","hooks_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/hooks","issue_events_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/events{/number}","events_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/events","assignees_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/assignees{/user}","branches_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/branches{/branch}","tags_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/tags","blobs_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/statuses/{sha}","languages_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/languages","stargazers_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/stargazers","contributors_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/contributors","subscribers_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/subscribers","subscription_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/subscription","commits_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/contents/{+path}","compare_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/merges","archive_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/downloads","issues_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues{/number}","pulls_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls{/number}","milestones_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/milestones{/number}","notifications_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/labels{/name}","releases_url":"https://api.github.com/repos/BrightcovePS/FordPlayer/releases{/id}","created_at":"2015-06-03T00:57:35Z","updated_at":"2015-06-03T00:57:35Z","pushed_at":"2015-06-24T00:35:04Z","git_url":"git://github.com/BrightcovePS/FordPlayer.git","ssh_url":"git@github.com:BrightcovePS/FordPlayer.git","clone_url":"https://github.com/BrightcovePS/FordPlayer.git","svn_url":"https://github.com/BrightcovePS/FordPlayer","homepage":null,"size":2152,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27"},"html":{"href":"https://github.com/BrightcovePS/FordPlayer/pull/27"},"issue":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/27"},"comments":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/BrightcovePS/FordPlayer/statuses/a9e5a511a9ced65a718b0978a1ec615b3166dda7"}}}}