{"action":"created","comment":{"url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/comments/183930118","pull_request_review_id":115022572,"id":183930118,"diff_hunk":"@@ -0,0 +1,101 @@\n+'use strict';\n+\n+var dialog = require('./dialog');\n+var util = require('./util');\n+/**\n+ * @function gdprprivacy    Used to display/control of the modal containing the gdpr message\n+ **/\n+module.exports = function () {\n+    /**\n+     * If we have not accepted cookies AND we're not on the Privacy Policy page, then show the notification\n+     * NOTE: You will probably want to adjust the Privacy Page test to match your site's specific privacy / cookie page\n+     */\n+\tif (SitePreferences.GDPR_HINT && document.cookie.indexOf('dw_cookies_gdpr_accepted') < 0) {\n+        // check for privacy policy page\n+        if ($('.privacy-policy').length === 0) {\n+            dialog.open({\n+                url: Urls.gdprHint,\n+                options: {\n+                    closeOnEscape: false,\n+                    dialogClass: 'no-close',\n+                    buttons: [{\n+                        text: Resources.GDPR_CONSENT,\n+                        click: function () {\n+                            $(this).dialog('close');\n+                            enableCookies();\n+                            $.ajax({\n+                                type: 'GET',\n+                                url: util.appendParamToURL(Urls.gdprSetSession, 'gdpr', true),\n+                                success: function () {\n+                                    \tshowPrivacyDialog();\n+                        \t        },\n+                        \t        error: function () {\n+                            \t        \tshowPrivacyDialog()\n+                        \t        }\n+                            })\n+                        }\n+                    }, {\n+                        text: Resources.GDPR_NO_CONSENT,\n+                        click: function () {\n+                            $(this).dialog('close');\n+                            disableCookies();\n+                            $.ajax({\n+                                type: 'GET',\n+                                url: util.appendParamToURL(Urls.gdprSetSession, 'gdpr', false),\n+                                success: function () {\n+                                    \tshowPrivacyDialog();\n+                            \t    },\n+                            \t    error: function () {\n+                                \t    \tshowPrivacyDialog()\n+                            \t    }\n+                            })\n+                        }\n+                    }]\n+                }\n+            });\n+        }\n+    }\n+    function disableCookies() {\n+        if (document.cookie.indexOf('dw_cookies_gdpr_accepted') < 0 ) {\n+            document.cookie = 'dw_cookies_gdpr_accepted=0; path=/';\n+        }\n+    }\n+    function enableCookies() {\n+        if (document.cookie.indexOf('dw_cookies_gdpr_accepted') < 0) {\n+            document.cookie = 'dw_cookies_gdpr_accepted=1; path=/';\n+        }\n+    }\n+    function enablePrivacyCookies() {\n+        if (document.cookie.indexOf('dw=1') < 0) {\n+            document.cookie = 'dw=1; path=/';\n+        }\n+        if (document.cookie.indexOf('dw_cookies_accepted') < 0) {\n+            document.cookie = 'dw_cookies_accepted=1; path=/';\n+        }\n+    }\n+    function showPrivacyDialog(){\n+\n+    \t    if (SitePreferences.COOKIE_HINT === true && document.cookie.indexOf('dw_cookies_accepted') < 0) {\n+    \t        // check for privacy policy page\n+    \t        if ($('.privacy-policy').length === 0) {\n+    \t            dialog.open({\n+    \t                url: Urls.cookieHint,\n+    \t                options: {\n+    \t                    closeOnEscape: false,\n+    \t                    dialogClass: 'no-close',\n+    \t                    buttons: [{\n+    \t                        text: Resources.I_AGREE,\n+    \t                        click: function () {\n+    \t                            $(this).dialog('close');\n+    \t                            enablePrivacyCookies();\n+    \t                        }\n+    \t                    }]\n+    \t                }\n+    \t            });\n+    \t        }\n+    \t    } else {\n+    \t        // Otherwise, we don't need to show the asset, just enable the cookies\n+    \t        \tenablePrivacyCookies();","path":"app_storefront_core/cartridge/js/cookiegdpr.js","position":null,"original_position":98,"commit_id":"2fd7a2e3a59e10e3c7d0c403af58d0c72b406794","original_commit_id":"dbdffd2981873a1e56c461b0b62e5e5ce07510f0","user":{"login":"pganshirt","id":7996878,"avatar_url":"https://avatars0.githubusercontent.com/u/7996878?v=4","gravatar_id":"","url":"https://api.github.com/users/pganshirt","html_url":"https://github.com/pganshirt","followers_url":"https://api.github.com/users/pganshirt/followers","following_url":"https://api.github.com/users/pganshirt/following{/other_user}","gists_url":"https://api.github.com/users/pganshirt/gists{/gist_id}","starred_url":"https://api.github.com/users/pganshirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pganshirt/subscriptions","organizations_url":"https://api.github.com/users/pganshirt/orgs","repos_url":"https://api.github.com/users/pganshirt/repos","events_url":"https://api.github.com/users/pganshirt/events{/privacy}","received_events_url":"https://api.github.com/users/pganshirt/received_events","type":"User","site_admin":false},"body":"CreatedBy=@shussainsalesforce\nSpacing seems off here","created_at":"2018-04-25T02:27:21Z","updated_at":"2018-04-25T02:27:21Z","html_url":"https://github.com/Demandware/sitegenesis/pull/80#discussion_r183930118","pull_request_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/comments/183930118"},"html":{"href":"https://github.com/Demandware/sitegenesis/pull/80#discussion_r183930118"},"pull_request":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80","id":183910513,"html_url":"https://github.com/Demandware/sitegenesis/pull/80","diff_url":"https://github.com/Demandware/sitegenesis/pull/80.diff","patch_url":"https://github.com/Demandware/sitegenesis/pull/80.patch","issue_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/80","number":80,"state":"open","locked":false,"title":"gdpr - consent management","user":{"login":"pganshirt","id":7996878,"avatar_url":"https://avatars0.githubusercontent.com/u/7996878?v=4","gravatar_id":"","url":"https://api.github.com/users/pganshirt","html_url":"https://github.com/pganshirt","followers_url":"https://api.github.com/users/pganshirt/followers","following_url":"https://api.github.com/users/pganshirt/following{/other_user}","gists_url":"https://api.github.com/users/pganshirt/gists{/gist_id}","starred_url":"https://api.github.com/users/pganshirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pganshirt/subscriptions","organizations_url":"https://api.github.com/users/pganshirt/orgs","repos_url":"https://api.github.com/users/pganshirt/repos","events_url":"https://api.github.com/users/pganshirt/events{/privacy}","received_events_url":"https://api.github.com/users/pganshirt/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-25T02:27:19Z","updated_at":"2018-04-25T02:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80/commits","review_comments_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80/comments","review_comment_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/80/comments","statuses_url":"https://api.github.com/repos/Demandware/sitegenesis/statuses/2fd7a2e3a59e10e3c7d0c403af58d0c72b406794","head":{"label":"Demandware:W-4531781-gdpr-modal","ref":"W-4531781-gdpr-modal","sha":"2fd7a2e3a59e10e3c7d0c403af58d0c72b406794","user":{"login":"Demandware","id":1315434,"avatar_url":"https://avatars2.githubusercontent.com/u/1315434?v=4","gravatar_id":"","url":"https://api.github.com/users/Demandware","html_url":"https://github.com/Demandware","followers_url":"https://api.github.com/users/Demandware/followers","following_url":"https://api.github.com/users/Demandware/following{/other_user}","gists_url":"https://api.github.com/users/Demandware/gists{/gist_id}","starred_url":"https://api.github.com/users/Demandware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Demandware/subscriptions","organizations_url":"https://api.github.com/users/Demandware/orgs","repos_url":"https://api.github.com/users/Demandware/repos","events_url":"https://api.github.com/users/Demandware/events{/privacy}","received_events_url":"https://api.github.com/users/Demandware/received_events","type":"Organization","site_admin":false},"repo":{"id":130930538,"name":"sitegenesis","full_name":"Demandware/sitegenesis","owner":{"login":"Demandware","id":1315434,"avatar_url":"https://avatars2.githubusercontent.com/u/1315434?v=4","gravatar_id":"","url":"https://api.github.com/users/Demandware","html_url":"https://github.com/Demandware","followers_url":"https://api.github.com/users/Demandware/followers","following_url":"https://api.github.com/users/Demandware/following{/other_user}","gists_url":"https://api.github.com/users/Demandware/gists{/gist_id}","starred_url":"https://api.github.com/users/Demandware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Demandware/subscriptions","organizations_url":"https://api.github.com/users/Demandware/orgs","repos_url":"https://api.github.com/users/Demandware/repos","events_url":"https://api.github.com/users/Demandware/events{/privacy}","received_events_url":"https://api.github.com/users/Demandware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Demandware/sitegenesis","description":null,"fork":false,"url":"https://api.github.com/repos/Demandware/sitegenesis","forks_url":"https://api.github.com/repos/Demandware/sitegenesis/forks","keys_url":"https://api.github.com/repos/Demandware/sitegenesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Demandware/sitegenesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Demandware/sitegenesis/teams","hooks_url":"https://api.github.com/repos/Demandware/sitegenesis/hooks","issue_events_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/events{/number}","events_url":"https://api.github.com/repos/Demandware/sitegenesis/events","assignees_url":"https://api.github.com/repos/Demandware/sitegenesis/assignees{/user}","branches_url":"https://api.github.com/repos/Demandware/sitegenesis/branches{/branch}","tags_url":"https://api.github.com/repos/Demandware/sitegenesis/tags","blobs_url":"https://api.github.com/repos/Demandware/sitegenesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Demandware/sitegenesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Demandware/sitegenesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/Demandware/sitegenesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Demandware/sitegenesis/statuses/{sha}","languages_url":"https://api.github.com/repos/Demandware/sitegenesis/languages","stargazers_url":"https://api.github.com/repos/Demandware/sitegenesis/stargazers","contributors_url":"https://api.github.com/repos/Demandware/sitegenesis/contributors","subscribers_url":"https://api.github.com/repos/Demandware/sitegenesis/subscribers","subscription_url":"https://api.github.com/repos/Demandware/sitegenesis/subscription","commits_url":"https://api.github.com/repos/Demandware/sitegenesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/Demandware/sitegenesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/Demandware/sitegenesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/Demandware/sitegenesis/contents/{+path}","compare_url":"https://api.github.com/repos/Demandware/sitegenesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Demandware/sitegenesis/merges","archive_url":"https://api.github.com/repos/Demandware/sitegenesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Demandware/sitegenesis/downloads","issues_url":"https://api.github.com/repos/Demandware/sitegenesis/issues{/number}","pulls_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls{/number}","milestones_url":"https://api.github.com/repos/Demandware/sitegenesis/milestones{/number}","notifications_url":"https://api.github.com/repos/Demandware/sitegenesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Demandware/sitegenesis/labels{/name}","releases_url":"https://api.github.com/repos/Demandware/sitegenesis/releases{/id}","deployments_url":"https://api.github.com/repos/Demandware/sitegenesis/deployments","created_at":"2018-04-25T00:53:28Z","updated_at":"2018-04-25T00:56:52Z","pushed_at":"2018-04-25T02:27:20Z","git_url":"git://github.com/Demandware/sitegenesis.git","ssh_url":"git@github.com:Demandware/sitegenesis.git","clone_url":"https://github.com/Demandware/sitegenesis.git","svn_url":"https://github.com/Demandware/sitegenesis","homepage":null,"size":122897,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":74,"license":null,"forks":0,"open_issues":74,"watchers":0,"default_branch":"master"}},"base":{"label":"Demandware:master","ref":"master","sha":"f74e591bbc466b3adb88887fb1782fc614de96a7","user":{"login":"Demandware","id":1315434,"avatar_url":"https://avatars2.githubusercontent.com/u/1315434?v=4","gravatar_id":"","url":"https://api.github.com/users/Demandware","html_url":"https://github.com/Demandware","followers_url":"https://api.github.com/users/Demandware/followers","following_url":"https://api.github.com/users/Demandware/following{/other_user}","gists_url":"https://api.github.com/users/Demandware/gists{/gist_id}","starred_url":"https://api.github.com/users/Demandware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Demandware/subscriptions","organizations_url":"https://api.github.com/users/Demandware/orgs","repos_url":"https://api.github.com/users/Demandware/repos","events_url":"https://api.github.com/users/Demandware/events{/privacy}","received_events_url":"https://api.github.com/users/Demandware/received_events","type":"Organization","site_admin":false},"repo":{"id":130930538,"name":"sitegenesis","full_name":"Demandware/sitegenesis","owner":{"login":"Demandware","id":1315434,"avatar_url":"https://avatars2.githubusercontent.com/u/1315434?v=4","gravatar_id":"","url":"https://api.github.com/users/Demandware","html_url":"https://github.com/Demandware","followers_url":"https://api.github.com/users/Demandware/followers","following_url":"https://api.github.com/users/Demandware/following{/other_user}","gists_url":"https://api.github.com/users/Demandware/gists{/gist_id}","starred_url":"https://api.github.com/users/Demandware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Demandware/subscriptions","organizations_url":"https://api.github.com/users/Demandware/orgs","repos_url":"https://api.github.com/users/Demandware/repos","events_url":"https://api.github.com/users/Demandware/events{/privacy}","received_events_url":"https://api.github.com/users/Demandware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Demandware/sitegenesis","description":null,"fork":false,"url":"https://api.github.com/repos/Demandware/sitegenesis","forks_url":"https://api.github.com/repos/Demandware/sitegenesis/forks","keys_url":"https://api.github.com/repos/Demandware/sitegenesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Demandware/sitegenesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Demandware/sitegenesis/teams","hooks_url":"https://api.github.com/repos/Demandware/sitegenesis/hooks","issue_events_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/events{/number}","events_url":"https://api.github.com/repos/Demandware/sitegenesis/events","assignees_url":"https://api.github.com/repos/Demandware/sitegenesis/assignees{/user}","branches_url":"https://api.github.com/repos/Demandware/sitegenesis/branches{/branch}","tags_url":"https://api.github.com/repos/Demandware/sitegenesis/tags","blobs_url":"https://api.github.com/repos/Demandware/sitegenesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Demandware/sitegenesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Demandware/sitegenesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/Demandware/sitegenesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Demandware/sitegenesis/statuses/{sha}","languages_url":"https://api.github.com/repos/Demandware/sitegenesis/languages","stargazers_url":"https://api.github.com/repos/Demandware/sitegenesis/stargazers","contributors_url":"https://api.github.com/repos/Demandware/sitegenesis/contributors","subscribers_url":"https://api.github.com/repos/Demandware/sitegenesis/subscribers","subscription_url":"https://api.github.com/repos/Demandware/sitegenesis/subscription","commits_url":"https://api.github.com/repos/Demandware/sitegenesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/Demandware/sitegenesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/Demandware/sitegenesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/Demandware/sitegenesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/Demandware/sitegenesis/contents/{+path}","compare_url":"https://api.github.com/repos/Demandware/sitegenesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Demandware/sitegenesis/merges","archive_url":"https://api.github.com/repos/Demandware/sitegenesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Demandware/sitegenesis/downloads","issues_url":"https://api.github.com/repos/Demandware/sitegenesis/issues{/number}","pulls_url":"https://api.github.com/repos/Demandware/sitegenesis/pulls{/number}","milestones_url":"https://api.github.com/repos/Demandware/sitegenesis/milestones{/number}","notifications_url":"https://api.github.com/repos/Demandware/sitegenesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Demandware/sitegenesis/labels{/name}","releases_url":"https://api.github.com/repos/Demandware/sitegenesis/releases{/id}","deployments_url":"https://api.github.com/repos/Demandware/sitegenesis/deployments","created_at":"2018-04-25T00:53:28Z","updated_at":"2018-04-25T00:56:52Z","pushed_at":"2018-04-25T02:27:20Z","git_url":"git://github.com/Demandware/sitegenesis.git","ssh_url":"git@github.com:Demandware/sitegenesis.git","clone_url":"https://github.com/Demandware/sitegenesis.git","svn_url":"https://github.com/Demandware/sitegenesis","homepage":null,"size":122897,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":74,"license":null,"forks":0,"open_issues":74,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80"},"html":{"href":"https://github.com/Demandware/sitegenesis/pull/80"},"issue":{"href":"https://api.github.com/repos/Demandware/sitegenesis/issues/80"},"comments":{"href":"https://api.github.com/repos/Demandware/sitegenesis/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Demandware/sitegenesis/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/Demandware/sitegenesis/statuses/2fd7a2e3a59e10e3c7d0c403af58d0c72b406794"}},"author_association":"NONE"}}
{"actor":{"display_login":"pganshirt"}}