{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/11686","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11686/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11686/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11686/events","html_url":"https://github.com/joomla/joomla-cms/pull/11686","id":172268443,"number":11686,"title":"[RFC] Polyfill js events for ie8","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-08-20T12:16:56Z","updated_at":"2016-08-20T19:57:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11686","html_url":"https://github.com/joomla/joomla-cms/pull/11686","diff_url":"https://github.com/joomla/joomla-cms/pull/11686.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11686.patch"},"body":"### Summary of Changes\r\n\r\nAs discussed in https://github.com/joomla/joomla-cms/pull/11585 this adds the ability to polyfill js events in older browsers (ex: IE8).\r\n\r\n### Testing Instructions\r\n\r\n- Apply patch\r\n- Add this vanilla js events code in isis index.php\r\n```php\r\nJHtml::_('behavior.polyfill', 'event', 'lt IE 9');\r\n\r\n$this->addScriptDeclaration(\"\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n\r\n    this.getElementById('status').addEventListener('click', function() {\r\n        alert('clicked the status bar');\r\n    });\r\n\r\n    this.querySelector('.container-logo').addEventListener('click', function() {\r\n        alert('clicked the logo');\r\n    });\r\n});\r\n\");\r\n```\r\n- as the code says click the Joomla login in the admin and the admin status bar and check if you have a js alert.\r\n- Test in all Joomla 3.x supported browsers. https://docs.joomla.org/Joomla_Browser_Support\r\n- Code review\r\n\r\n### Documentation Changes Required\r\n\r\nDon't know.\r\n\r\n### Know issues\r\n\r\nWhen we use IE conditional expressions, for now, we need to use the `JDocument::addCustomTag` method, but custom tags are only rendered AFTER the scripts, so for now, that doesn't work.\r\nSee https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/renderer/html/head.php#L310\r\n\r\nSo for the test to work in IE8 you need to:\r\n- hardcode in isis template head\r\n```html\r\n<!--[if lt IE 9]><script src=\"/media/system/js/polyfill.event.js\"></script><![endif]-->\r\n```\r\n- remove the JHtml call: `JHtml::_('behavior.polyfill', 'event', 'lt IE 9');`\r\n\r\n@Fedik @dgt41 is this it?"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/241220454","html_url":"https://github.com/joomla/joomla-cms/pull/11686#issuecomment-241220454","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11686","id":241220454,"user":{"login":"dgt41","id":3889375,"avatar_url":"https://avatars.githubusercontent.com/u/3889375?v=3","gravatar_id":"","url":"https://api.github.com/users/dgt41","html_url":"https://github.com/dgt41","followers_url":"https://api.github.com/users/dgt41/followers","following_url":"https://api.github.com/users/dgt41/following{/other_user}","gists_url":"https://api.github.com/users/dgt41/gists{/gist_id}","starred_url":"https://api.github.com/users/dgt41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgt41/subscriptions","organizations_url":"https://api.github.com/users/dgt41/orgs","repos_url":"https://api.github.com/users/dgt41/repos","events_url":"https://api.github.com/users/dgt41/events{/privacy}","received_events_url":"https://api.github.com/users/dgt41/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T19:57:10Z","updated_at":"2016-08-20T19:57:10Z","body":"@andrepereiradasilva can I propose changing the minified files to use .min.js and the uncompressed palin .js.\r\nThis -uncompressed.js really hurts my eyes 😛"}}
{"actor":{"display_login":"dgt41"}}