{"action":"created","comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/218107313","pull_request_review_id":155972820,"id":218107313,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODEwNzMxMw==","diff_hunk":"@@ -217,6 +217,18 @@ const copyFiles = (options) => {\n       }\n     }\n \n+    // Joomla's hack to expose the chosen base classes so we can extend it ourselves (it was better than the\n+    // many hacks we had before. But I'm still ashamed of myself.\n+    if (packageName === 'chosen-js') {\n+      const dest = Path.join(mediaVendorPath, vendorName);\n+      const chosenPath = `${dest}/${options.settings.vendors[packageName].js['chosen.jquery.js']}`;\n+      let ChosenJs = fs.readFileSync(chosenPath, { encoding: 'UTF-8' });\n+      ChosenJs = ChosenJs.replace('}).call(this);', '  document.AbstractChosen = AbstractChosen;\\n' +","path":"build/build-modules-js/update.js","position":10,"original_position":10,"commit_id":"ec8e09d91fc49acae05744573d4279286dab70f0","original_commit_id":"ec8e09d91fc49acae05744573d4279286dab70f0","user":{"login":"Fedik","id":1568198,"node_id":"MDQ6VXNlcjE1NjgxOTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1568198?v=4","gravatar_id":"","url":"https://api.github.com/users/Fedik","html_url":"https://github.com/Fedik","followers_url":"https://api.github.com/users/Fedik/followers","following_url":"https://api.github.com/users/Fedik/following{/other_user}","gists_url":"https://api.github.com/users/Fedik/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedik/subscriptions","organizations_url":"https://api.github.com/users/Fedik/orgs","repos_url":"https://api.github.com/users/Fedik/repos","events_url":"https://api.github.com/users/Fedik/events{/privacy}","received_events_url":"https://api.github.com/users/Fedik/received_events","type":"User","site_admin":false},"body":"to make a global variable, correctly would be attach it to the `window`\r\neg \r\n`window.AbstractChosen = AbstractChosen;` \r\n`window.Chosen = Chosen;`\r\n\r\nthen they will be available globally as `AbstractChosen` and `Chosen`","created_at":"2018-09-17T15:07:12Z","updated_at":"2018-09-17T15:07:12Z","html_url":"https://github.com/joomla/joomla-cms/pull/22208#discussion_r218107313","pull_request_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/218107313"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/22208#discussion_r218107313"},"pull_request":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208"}}},"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208","id":215823380,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1ODIzMzgw","html_url":"https://github.com/joomla/joomla-cms/pull/22208","diff_url":"https://github.com/joomla/joomla-cms/pull/22208.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/22208.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/22208","number":22208,"state":"open","locked":false,"title":"[4.0] Remove most chosen hacks","user":{"login":"wilsonge","id":1986000,"node_id":"MDQ6VXNlcjE5ODYwMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1986000?v=4","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"body":"This reworks the way we hack chosen to pieces. This is done by creating a Joomla instance that extends the chosen instance to place most our hacks in. it should be added that this still requires a hack (we have to expose chosen and it's base class that isn't done by default - which i'm just regex'ing in as part of the build script. However this means we can now use the npm distributed packages without having to be as careful to ensure all our hacks are propagated (note we are now more dependent on chosen internals however so care must still be taken) - as far as I could tell we could only do this if we wrote our own coffeescript to extend the chosen classes and compiled that which is not something I feel comfortable doing.\r\n\r\n## Documentation \r\nWe're now fully on the stable version of chosen 1.6.1 - the 1.0 migration involved changes in class names and js events - we should note people must refer to these docs\r\n\r\nSomething to do with the fact that to emulate the j3.x code when creating custom chosen implementations you need to use `jchosen` function in jquery rather than `chosen`\r\n\r\n## Other Notes\r\nMy apologies to the JS community for this abomination.","created_at":"2018-09-16T13:30:01Z","updated_at":"2018-09-17T15:07:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb9718009b1bcb0474d3944e541fc1ab0e9c6fe2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":444033883,"node_id":"MDU6TGFiZWw0NDQwMzM4ODM=","url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-4.0-dev","name":"PR-4.0-dev","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/22208/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/ec8e09d91fc49acae05744573d4279286dab70f0","head":{"label":"wilsonge:feature/remove-most-chosen-hacks","ref":"feature/remove-most-chosen-hacks","sha":"ec8e09d91fc49acae05744573d4279286dab70f0","user":{"login":"wilsonge","id":1986000,"node_id":"MDQ6VXNlcjE5ODYwMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1986000?v=4","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"repo":{"id":9136608,"node_id":"MDEwOlJlcG9zaXRvcnk5MTM2NjA4","name":"joomla-cms","full_name":"wilsonge/joomla-cms","private":false,"owner":{"login":"wilsonge","id":1986000,"node_id":"MDQ6VXNlcjE5ODYwMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1986000?v=4","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wilsonge/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/wilsonge/joomla-cms","forks_url":"https://api.github.com/repos/wilsonge/joomla-cms/forks","keys_url":"https://api.github.com/repos/wilsonge/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilsonge/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilsonge/joomla-cms/teams","hooks_url":"https://api.github.com/repos/wilsonge/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/wilsonge/joomla-cms/events","assignees_url":"https://api.github.com/repos/wilsonge/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/wilsonge/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/wilsonge/joomla-cms/tags","blobs_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilsonge/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/wilsonge/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/wilsonge/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/wilsonge/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/wilsonge/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/wilsonge/joomla-cms/subscription","commits_url":"https://api.github.com/repos/wilsonge/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilsonge/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilsonge/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/wilsonge/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilsonge/joomla-cms/merges","archive_url":"https://api.github.com/repos/wilsonge/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilsonge/joomla-cms/downloads","issues_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/wilsonge/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/wilsonge/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/wilsonge/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilsonge/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/wilsonge/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/wilsonge/joomla-cms/deployments","created_at":"2013-03-31T21:30:21Z","updated_at":"2018-08-18T16:52:29Z","pushed_at":"2018-09-17T11:40:09Z","git_url":"git://github.com/wilsonge/joomla-cms.git","ssh_url":"git@github.com:wilsonge/joomla-cms.git","clone_url":"https://github.com/wilsonge/joomla-cms.git","svn_url":"https://github.com/wilsonge/joomla-cms","homepage":"http://joomla.org","size":295446,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":1,"open_issues":1,"watchers":4,"default_branch":"staging"}},"base":{"label":"joomla:4.0-dev","ref":"4.0-dev","sha":"222d559388789fdd3ff27c238d1c974270a33c4c","user":{"login":"joomla","id":751633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1MTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"node_id":"MDEwOlJlcG9zaXRvcnkyNDY0OTA4","name":"joomla-cms","full_name":"joomla/joomla-cms","private":false,"owner":{"login":"joomla","id":751633,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1MTYzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2018-09-17T11:29:57Z","pushed_at":"2018-09-17T14:41:02Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":243763,"stargazers_count":2899,"watchers_count":2899,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2757,"mirror_url":null,"archived":false,"open_issues_count":769,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":2757,"open_issues":769,"watchers":2899,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/22208"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/22208"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/22208/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/22208/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/ec8e09d91fc49acae05744573d4279286dab70f0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Fedik"}}