{"action":"created","comment":{"url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/comments/29661563","id":29661563,"diff_hunk":"@@ -344,6 +360,37 @@ function css_fixreplacementurls($replacements, $location) {\n }\n \n /**\n+ * Wrapper for the files, content and mediatype for the event CSS_STYLES_INCLUDED\n+ *\n+ * @param string $mediatype type ofthe current media files/content set\n+ * @param array $files set of files that define the current mediatype\n+ * @return array\n+ */\n+function css_filewrapper($mediatype, $files=array()){\n+    return array(\n+            'files'                 => $files,\n+\t        'mediatype'             => $mediatype,\n+\t        'encapsulate'           => in_array($mediatype, array('screen', 'print')),","path":"lib/exe/css.php","position":149,"original_position":149,"commit_id":"72404cf2382951aa38bd8f5b43ceb29f4978fd00","original_commit_id":"72404cf2382951aa38bd8f5b43ceb29f4978fd00","user":{"login":"gamma","id":112151,"avatar_url":"https://avatars.githubusercontent.com/u/112151?v=3","gravatar_id":"","url":"https://api.github.com/users/gamma","html_url":"https://github.com/gamma","followers_url":"https://api.github.com/users/gamma/followers","following_url":"https://api.github.com/users/gamma/following{/other_user}","gists_url":"https://api.github.com/users/gamma/gists{/gist_id}","starred_url":"https://api.github.com/users/gamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamma/subscriptions","organizations_url":"https://api.github.com/users/gamma/orgs","repos_url":"https://api.github.com/users/gamma/repos","events_url":"https://api.github.com/users/gamma/events{/privacy}","received_events_url":"https://api.github.com/users/gamma/received_events","type":"User","site_admin":false},"body":"See #1131 - the whitelist should be a lot broader. There is indeed a bit of piggybacking. This function is a container to the Event that allows developers to inject/remove CSS depending on the context or state (e.g. admin is logged in -> admin styles) and allow removal of the currently hardcoded DW core styles. This is a new functionality - but it should ensure backwards compatibility as well. the encapsulate check was meant to ensure that only real media types will be encapsulated. Everything else should go into all or screen - while \"all\" should not be encapsulated. I had situations when a large ``@media all {}`` section had problems with CSS parsers.\r\n","created_at":"2015-05-05T11:48:26Z","updated_at":"2015-05-05T11:48:26Z","html_url":"https://github.com/splitbrain/dokuwiki/pull/1002#discussion_r29661563","pull_request_url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002","_links":{"self":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/comments/29661563"},"html":{"href":"https://github.com/splitbrain/dokuwiki/pull/1002#discussion_r29661563"},"pull_request":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002"}}},"pull_request":{"url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002","id":27191472,"html_url":"https://github.com/splitbrain/dokuwiki/pull/1002","diff_url":"https://github.com/splitbrain/dokuwiki/pull/1002.diff","patch_url":"https://github.com/splitbrain/dokuwiki/pull/1002.patch","issue_url":"https://api.github.com/repos/splitbrain/dokuwiki/issues/1002","number":1002,"state":"open","locked":false,"title":"CSS / JS modification actions","user":{"login":"gamma","id":112151,"avatar_url":"https://avatars.githubusercontent.com/u/112151?v=3","gravatar_id":"","url":"https://api.github.com/users/gamma","html_url":"https://github.com/gamma","followers_url":"https://api.github.com/users/gamma/followers","following_url":"https://api.github.com/users/gamma/following{/other_user}","gists_url":"https://api.github.com/users/gamma/gists{/gist_id}","starred_url":"https://api.github.com/users/gamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamma/subscriptions","organizations_url":"https://api.github.com/users/gamma/orgs","repos_url":"https://api.github.com/users/gamma/repos","events_url":"https://api.github.com/users/gamma/events{/privacy}","received_events_url":"https://api.github.com/users/gamma/received_events","type":"User","site_admin":false},"body":"There are 3 new events and one event modification in these commits. They all open the js.php and css.php for action plugins.\r\n\r\n#### ```js.php```\r\n\r\n *  9488fc9 introduced a new event trigger ```JS_SCRIPT_LIST```\r\n   * This event allows to modify the list of *.js files before they are handled by the cache and prepared for the client. Uses cases would be - to remove certain Javascript sources that you do not use on your website without removing the plugins. E.g. when you have a closed wiki you could remove all admin and editing scripts that a user does not need access to.\r\n\r\n#### ```css.php```\r\n\r\n * 6c650df unifies the cache usage of ```js.php``` and ```css.php```. The CSS generator can now make use of this special event to determine whether the cache may be used or not. The event is called ```CSS_CACHE_USE```\r\n * new event: CSS_STYLES_INCLUDED\r\n  * plugins can modify the list of files that will be used for this mediatype\r\n  * plugins can modify the encapsulation string (default: ```@media $mediatype```) and whether to encapsulate at all\r\n  * plugins can prevent a mediative from being printed at all\r\n  * there is a special mediatype \"DW_DEFAULT\" to indicate the default interwiki and file icon styles (which can be prevented)\r\n  * the resulting file list will influence the cache\r\n\r\n#### Why I did this\r\n\r\nI think it is good to have more options to customise the script and css output. We're using the DW for our website in a readonly mode. It is therefore not necessary to include styles and scripts that are only really used for editing or admin or user management purposes. Also, we mostly want our own custom styles with only the DW backend - so the default styles are not really needed as well.\r\n\r\nIf you think that things could be improved, please let me know ;)","created_at":"2015-01-12T12:44:55Z","updated_at":"2015-05-05T11:48:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"414ce6f79a3b335b650517540328ebf2b434c53f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002/commits","review_comments_url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002/comments","review_comment_url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/splitbrain/dokuwiki/issues/1002/comments","statuses_url":"https://api.github.com/repos/splitbrain/dokuwiki/statuses/72404cf2382951aa38bd8f5b43ceb29f4978fd00","head":{"label":"gamma:css-js-modification-action","ref":"css-js-modification-action","sha":"72404cf2382951aa38bd8f5b43ceb29f4978fd00","user":{"login":"gamma","id":112151,"avatar_url":"https://avatars.githubusercontent.com/u/112151?v=3","gravatar_id":"","url":"https://api.github.com/users/gamma","html_url":"https://github.com/gamma","followers_url":"https://api.github.com/users/gamma/followers","following_url":"https://api.github.com/users/gamma/following{/other_user}","gists_url":"https://api.github.com/users/gamma/gists{/gist_id}","starred_url":"https://api.github.com/users/gamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamma/subscriptions","organizations_url":"https://api.github.com/users/gamma/orgs","repos_url":"https://api.github.com/users/gamma/repos","events_url":"https://api.github.com/users/gamma/events{/privacy}","received_events_url":"https://api.github.com/users/gamma/received_events","type":"User","site_admin":false},"repo":{"id":16274051,"name":"dokuwiki","full_name":"gamma/dokuwiki","owner":{"login":"gamma","id":112151,"avatar_url":"https://avatars.githubusercontent.com/u/112151?v=3","gravatar_id":"","url":"https://api.github.com/users/gamma","html_url":"https://github.com/gamma","followers_url":"https://api.github.com/users/gamma/followers","following_url":"https://api.github.com/users/gamma/following{/other_user}","gists_url":"https://api.github.com/users/gamma/gists{/gist_id}","starred_url":"https://api.github.com/users/gamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamma/subscriptions","organizations_url":"https://api.github.com/users/gamma/orgs","repos_url":"https://api.github.com/users/gamma/repos","events_url":"https://api.github.com/users/gamma/events{/privacy}","received_events_url":"https://api.github.com/users/gamma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gamma/dokuwiki","description":"The DokuWiki Open Source Wiki Engine","fork":true,"url":"https://api.github.com/repos/gamma/dokuwiki","forks_url":"https://api.github.com/repos/gamma/dokuwiki/forks","keys_url":"https://api.github.com/repos/gamma/dokuwiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gamma/dokuwiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gamma/dokuwiki/teams","hooks_url":"https://api.github.com/repos/gamma/dokuwiki/hooks","issue_events_url":"https://api.github.com/repos/gamma/dokuwiki/issues/events{/number}","events_url":"https://api.github.com/repos/gamma/dokuwiki/events","assignees_url":"https://api.github.com/repos/gamma/dokuwiki/assignees{/user}","branches_url":"https://api.github.com/repos/gamma/dokuwiki/branches{/branch}","tags_url":"https://api.github.com/repos/gamma/dokuwiki/tags","blobs_url":"https://api.github.com/repos/gamma/dokuwiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gamma/dokuwiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gamma/dokuwiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/gamma/dokuwiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gamma/dokuwiki/statuses/{sha}","languages_url":"https://api.github.com/repos/gamma/dokuwiki/languages","stargazers_url":"https://api.github.com/repos/gamma/dokuwiki/stargazers","contributors_url":"https://api.github.com/repos/gamma/dokuwiki/contributors","subscribers_url":"https://api.github.com/repos/gamma/dokuwiki/subscribers","subscription_url":"https://api.github.com/repos/gamma/dokuwiki/subscription","commits_url":"https://api.github.com/repos/gamma/dokuwiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/gamma/dokuwiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/gamma/dokuwiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/gamma/dokuwiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/gamma/dokuwiki/contents/{+path}","compare_url":"https://api.github.com/repos/gamma/dokuwiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gamma/dokuwiki/merges","archive_url":"https://api.github.com/repos/gamma/dokuwiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gamma/dokuwiki/downloads","issues_url":"https://api.github.com/repos/gamma/dokuwiki/issues{/number}","pulls_url":"https://api.github.com/repos/gamma/dokuwiki/pulls{/number}","milestones_url":"https://api.github.com/repos/gamma/dokuwiki/milestones{/number}","notifications_url":"https://api.github.com/repos/gamma/dokuwiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gamma/dokuwiki/labels{/name}","releases_url":"https://api.github.com/repos/gamma/dokuwiki/releases{/id}","created_at":"2014-01-27T09:00:47Z","updated_at":"2015-04-14T08:00:56Z","pushed_at":"2015-05-04T06:03:53Z","git_url":"git://github.com/gamma/dokuwiki.git","ssh_url":"git@github.com:gamma/dokuwiki.git","clone_url":"https://github.com/gamma/dokuwiki.git","svn_url":"https://github.com/gamma/dokuwiki","homepage":"http://www.dokuwiki.org","size":25078,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"splitbrain:master","ref":"master","sha":"ea72231cade401099d5e737e18472c9de928383b","user":{"login":"splitbrain","id":86426,"avatar_url":"https://avatars.githubusercontent.com/u/86426?v=3","gravatar_id":"","url":"https://api.github.com/users/splitbrain","html_url":"https://github.com/splitbrain","followers_url":"https://api.github.com/users/splitbrain/followers","following_url":"https://api.github.com/users/splitbrain/following{/other_user}","gists_url":"https://api.github.com/users/splitbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/splitbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splitbrain/subscriptions","organizations_url":"https://api.github.com/users/splitbrain/orgs","repos_url":"https://api.github.com/users/splitbrain/repos","events_url":"https://api.github.com/users/splitbrain/events{/privacy}","received_events_url":"https://api.github.com/users/splitbrain/received_events","type":"User","site_admin":false},"repo":{"id":456930,"name":"dokuwiki","full_name":"splitbrain/dokuwiki","owner":{"login":"splitbrain","id":86426,"avatar_url":"https://avatars.githubusercontent.com/u/86426?v=3","gravatar_id":"","url":"https://api.github.com/users/splitbrain","html_url":"https://github.com/splitbrain","followers_url":"https://api.github.com/users/splitbrain/followers","following_url":"https://api.github.com/users/splitbrain/following{/other_user}","gists_url":"https://api.github.com/users/splitbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/splitbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splitbrain/subscriptions","organizations_url":"https://api.github.com/users/splitbrain/orgs","repos_url":"https://api.github.com/users/splitbrain/repos","events_url":"https://api.github.com/users/splitbrain/events{/privacy}","received_events_url":"https://api.github.com/users/splitbrain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/splitbrain/dokuwiki","description":"The DokuWiki Open Source Wiki Engine","fork":false,"url":"https://api.github.com/repos/splitbrain/dokuwiki","forks_url":"https://api.github.com/repos/splitbrain/dokuwiki/forks","keys_url":"https://api.github.com/repos/splitbrain/dokuwiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/splitbrain/dokuwiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/splitbrain/dokuwiki/teams","hooks_url":"https://api.github.com/repos/splitbrain/dokuwiki/hooks","issue_events_url":"https://api.github.com/repos/splitbrain/dokuwiki/issues/events{/number}","events_url":"https://api.github.com/repos/splitbrain/dokuwiki/events","assignees_url":"https://api.github.com/repos/splitbrain/dokuwiki/assignees{/user}","branches_url":"https://api.github.com/repos/splitbrain/dokuwiki/branches{/branch}","tags_url":"https://api.github.com/repos/splitbrain/dokuwiki/tags","blobs_url":"https://api.github.com/repos/splitbrain/dokuwiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/splitbrain/dokuwiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/splitbrain/dokuwiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/splitbrain/dokuwiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/splitbrain/dokuwiki/statuses/{sha}","languages_url":"https://api.github.com/repos/splitbrain/dokuwiki/languages","stargazers_url":"https://api.github.com/repos/splitbrain/dokuwiki/stargazers","contributors_url":"https://api.github.com/repos/splitbrain/dokuwiki/contributors","subscribers_url":"https://api.github.com/repos/splitbrain/dokuwiki/subscribers","subscription_url":"https://api.github.com/repos/splitbrain/dokuwiki/subscription","commits_url":"https://api.github.com/repos/splitbrain/dokuwiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/splitbrain/dokuwiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/splitbrain/dokuwiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/splitbrain/dokuwiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/splitbrain/dokuwiki/contents/{+path}","compare_url":"https://api.github.com/repos/splitbrain/dokuwiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/splitbrain/dokuwiki/merges","archive_url":"https://api.github.com/repos/splitbrain/dokuwiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/splitbrain/dokuwiki/downloads","issues_url":"https://api.github.com/repos/splitbrain/dokuwiki/issues{/number}","pulls_url":"https://api.github.com/repos/splitbrain/dokuwiki/pulls{/number}","milestones_url":"https://api.github.com/repos/splitbrain/dokuwiki/milestones{/number}","notifications_url":"https://api.github.com/repos/splitbrain/dokuwiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/splitbrain/dokuwiki/labels{/name}","releases_url":"https://api.github.com/repos/splitbrain/dokuwiki/releases{/id}","created_at":"2010-01-03T13:47:20Z","updated_at":"2015-05-03T09:06:56Z","pushed_at":"2015-05-05T08:48:23Z","git_url":"git://github.com/splitbrain/dokuwiki.git","ssh_url":"git@github.com:splitbrain/dokuwiki.git","clone_url":"https://github.com/splitbrain/dokuwiki.git","svn_url":"https://github.com/splitbrain/dokuwiki","homepage":"http://www.dokuwiki.org","size":57884,"stargazers_count":1126,"watchers_count":1126,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":330,"mirror_url":null,"open_issues_count":105,"forks":330,"open_issues":105,"watchers":1126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002"},"html":{"href":"https://github.com/splitbrain/dokuwiki/pull/1002"},"issue":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/issues/1002"},"comments":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/issues/1002/comments"},"review_comments":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002/comments"},"review_comment":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/pulls/1002/commits"},"statuses":{"href":"https://api.github.com/repos/splitbrain/dokuwiki/statuses/72404cf2382951aa38bd8f5b43ceb29f4978fd00"}}}}