payload: {"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/comments/264776565","pull_request_review_id":213502438,"id":264776565,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2NDc3NjU2NQ==","diff_hunk":"@@ -158,4 +160,47 @@ function shoreditch_civicrm_pageRun(&$page) {\n   if ($pageName == 'CRM_Contact_Page_View_Summary') {\n     CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.shoreditch', 'js/contact-summary.js');\n   }\n+\n+  _add_shoreditch_page_styles($page->urlPath);\n+}\n+\n+/**\n+ * @return bool\n+ */\n+function _shoreditch_is_custom_css_enabled() {\n+  $cssUrl = (string) Civi::settings()->get('customCSSURL');\n+  return (bool) strpos($cssUrl, 'shoreditch/css/custom-civicrm.css');\n+}\n+\n+/**\n+ * Adds css files that match the current url path.\n+ *\n+ * E.g. if we are on the page civicrm/contact/view\n+ * This function will search for and load the following css files if they exist.\n+ *   css/civicrm.css\n+ *   css/civicrm/contact.css\n+ *   css/civicrm/contact/view.css\n+ *\n+ * @param array $path\n+ */\n+function _add_shoreditch_page_styles($path) {\n+  // Sometimes the dashboard path is just \"civicrm\"\n+  if (count($path) < 2) {\n+    $path = ['civicrm', 'dashboard'];\n+  }\n+  // Only add page styles if we are in full override mode and this is not an ajax callback\n+  if (!in_array($path[1], ['ajax', 'angular']) && _shoreditch_is_custom_css_enabled()) {","path":"shoreditch.php","position":51,"original_position":51,"commit_id":"c14bb0ba58ba297f42a58fba00d19d71ce3c83a3","original_commit_id":"c14bb0ba58ba297f42a58fba00d19d71ce3c83a3","user":{"login":"igorpavlov","id":3973243,"node_id":"MDQ6VXNlcjM5NzMyNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/3973243?v=4","gravatar_id":"","url":"https://api.github.com/users/igorpavlov","html_url":"https://github.com/igorpavlov","followers_url":"https://api.github.com/users/igorpavlov/followers","following_url":"https://api.github.com/users/igorpavlov/following{/other_user}","gists_url":"https://api.github.com/users/igorpavlov/gists{/gist_id}","starred_url":"https://api.github.com/users/igorpavlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorpavlov/subscriptions","organizations_url":"https://api.github.com/users/igorpavlov/orgs","repos_url":"https://api.github.com/users/igorpavlov/repos","events_url":"https://api.github.com/users/igorpavlov/events{/privacy}","received_events_url":"https://api.github.com/users/igorpavlov/received_events","type":"User","site_admin":false},"body":"Same here, if we could:\r\n\r\n```\r\n$isNotAjaxOrAngular = !in_array($path[1], ['ajax', 'angular']);\r\n```","created_at":"2019-03-12T16:47:13Z","updated_at":"2019-03-12T16:56:10Z","html_url":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366#discussion_r264776565","pull_request_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/comments/264776565"},"html":{"href":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366#discussion_r264776565"},"pull_request":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366","id":255480002,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU1NDgwMDAy","html_url":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366","diff_url":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366.diff","patch_url":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366.patch","issue_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/366","number":366,"state":"open","locked":false,"title":"extensions/shoreditch#4 Load path-specific css files","user":{"login":"colemanw","id":2874912,"node_id":"MDQ6VXNlcjI4NzQ5MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2874912?v=4","gravatar_id":"","url":"https://api.github.com/users/colemanw","html_url":"https://github.com/colemanw","followers_url":"https://api.github.com/users/colemanw/followers","following_url":"https://api.github.com/users/colemanw/following{/other_user}","gists_url":"https://api.github.com/users/colemanw/gists{/gist_id}","starred_url":"https://api.github.com/users/colemanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemanw/subscriptions","organizations_url":"https://api.github.com/users/colemanw/orgs","repos_url":"https://api.github.com/users/colemanw/repos","events_url":"https://api.github.com/users/colemanw/events{/privacy}","received_events_url":"https://api.github.com/users/colemanw/received_events","type":"User","site_admin":false},"body":"See https://lab.civicrm.org/extensions/shoreditch/issues/4\r\n\r\nThis adds an auto-loader for css files based on the current url path. It will load all files that match the full or partial path. This allows us to create general files that relate to a section of civicrm as well as specific files to target individual pages. Examples:\r\n\r\n* The file `css/civicrm/admin.css` would load on the path `civicrm/admin` and every sub-page e.g. `civicrm/admin/custom/group`, `civicrm/admin/configtask` etc.\r\n* We could create a general contact stylesheet `css/civicrm/contact.css` which would appear on `civicrm/contact/view` and `civicrm/contact/edit` etc. And also create more specific stylesheets like `css/civicrm/contact/view.css` to target those individual pages.","created_at":"2019-02-22T17:53:11Z","updated_at":"2019-03-12T16:56:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8209114bfa670aafe9338bea4e8a2961192b8758","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366/commits","review_comments_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366/comments","review_comment_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/366/comments","statuses_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/statuses/c14bb0ba58ba297f42a58fba00d19d71ce3c83a3","head":{"label":"colemanw:pageStyles","ref":"pageStyles","sha":"c14bb0ba58ba297f42a58fba00d19d71ce3c83a3","user":{"login":"colemanw","id":2874912,"node_id":"MDQ6VXNlcjI4NzQ5MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2874912?v=4","gravatar_id":"","url":"https://api.github.com/users/colemanw","html_url":"https://github.com/colemanw","followers_url":"https://api.github.com/users/colemanw/followers","following_url":"https://api.github.com/users/colemanw/following{/other_user}","gists_url":"https://api.github.com/users/colemanw/gists{/gist_id}","starred_url":"https://api.github.com/users/colemanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemanw/subscriptions","organizations_url":"https://api.github.com/users/colemanw/orgs","repos_url":"https://api.github.com/users/colemanw/repos","events_url":"https://api.github.com/users/colemanw/events{/privacy}","received_events_url":"https://api.github.com/users/colemanw/received_events","type":"User","site_admin":false},"repo":{"id":87498015,"node_id":"MDEwOlJlcG9zaXRvcnk4NzQ5ODAxNQ==","name":"org.civicrm.shoreditch","full_name":"colemanw/org.civicrm.shoreditch","private":false,"owner":{"login":"colemanw","id":2874912,"node_id":"MDQ6VXNlcjI4NzQ5MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2874912?v=4","gravatar_id":"","url":"https://api.github.com/users/colemanw","html_url":"https://github.com/colemanw","followers_url":"https://api.github.com/users/colemanw/followers","following_url":"https://api.github.com/users/colemanw/following{/other_user}","gists_url":"https://api.github.com/users/colemanw/gists{/gist_id}","starred_url":"https://api.github.com/users/colemanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colemanw/subscriptions","organizations_url":"https://api.github.com/users/colemanw/orgs","repos_url":"https://api.github.com/users/colemanw/repos","events_url":"https://api.github.com/users/colemanw/events{/privacy}","received_events_url":"https://api.github.com/users/colemanw/received_events","type":"User","site_admin":false},"html_url":"https://github.com/colemanw/org.civicrm.shoreditch","description":null,"fork":true,"url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch","forks_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/forks","keys_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/teams","hooks_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/hooks","issue_events_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/issues/events{/number}","events_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/events","assignees_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/assignees{/user}","branches_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/branches{/branch}","tags_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/tags","blobs_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/git/refs{/sha}","trees_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/statuses/{sha}","languages_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/languages","stargazers_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/stargazers","contributors_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/contributors","subscribers_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/subscribers","subscription_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/subscription","commits_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/commits{/sha}","git_commits_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/git/commits{/sha}","comments_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/comments{/number}","issue_comment_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/issues/comments{/number}","contents_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/contents/{+path}","compare_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/merges","archive_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/downloads","issues_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/issues{/number}","pulls_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/pulls{/number}","milestones_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/milestones{/number}","notifications_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/labels{/name}","releases_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/releases{/id}","deployments_url":"https://api.github.com/repos/colemanw/org.civicrm.shoreditch/deployments","created_at":"2017-04-07T02:55:13Z","updated_at":"2017-04-07T02:55:15Z","pushed_at":"2019-03-12T13:48:22Z","git_url":"git://github.com/colemanw/org.civicrm.shoreditch.git","ssh_url":"git@github.com:colemanw/org.civicrm.shoreditch.git","clone_url":"https://github.com/colemanw/org.civicrm.shoreditch.git","svn_url":"https://github.com/colemanw/org.civicrm.shoreditch","homepage":null,"size":17228,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"civicrm:master","ref":"master","sha":"42c92973b3e17eab209946373323e6ff329aa88f","user":{"login":"civicrm","id":136373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjM3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":81770202,"node_id":"MDEwOlJlcG9zaXRvcnk4MTc3MDIwMg==","name":"org.civicrm.shoreditch","full_name":"civicrm/org.civicrm.shoreditch","private":false,"owner":{"login":"civicrm","id":136373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjM3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/civicrm/org.civicrm.shoreditch","description":null,"fork":false,"url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch","forks_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/forks","keys_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/teams","hooks_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/hooks","issue_events_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/events","assignees_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/tags","blobs_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/languages","stargazers_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/stargazers","contributors_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/contributors","subscribers_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/subscribers","subscription_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/subscription","commits_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/merges","archive_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/downloads","issues_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/deployments","created_at":"2017-02-13T00:56:43Z","updated_at":"2019-03-12T10:41:09Z","pushed_at":"2019-03-12T14:54:31Z","git_url":"git://github.com/civicrm/org.civicrm.shoreditch.git","ssh_url":"git@github.com:civicrm/org.civicrm.shoreditch.git","clone_url":"https://github.com/civicrm/org.civicrm.shoreditch.git","svn_url":"https://github.com/civicrm/org.civicrm.shoreditch","homepage":null,"size":17354,"stargazers_count":32,"watchers_count":32,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":35,"open_issues":38,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366"},"html":{"href":"https://github.com/civicrm/org.civicrm.shoreditch/pull/366"},"issue":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/366"},"comments":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/issues/366/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/pulls/366/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/org.civicrm.shoreditch/statuses/c14bb0ba58ba297f42a58fba00d19d71ce3c83a3"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"igorpavlov"}}