{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/11289","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11289/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11289/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11289/events","html_url":"https://github.com/joomla/joomla-cms/pull/11289","id":167259331,"number":11289,"title":"Add attribs to the script tag, add version to JHtml script methods and deprecate MD5SUM (alternative to 8540)","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":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-07-24T22:58:09Z","updated_at":"2016-08-31T15:05:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11289","html_url":"https://github.com/joomla/joomla-cms/pull/11289","diff_url":"https://github.com/joomla/joomla-cms/pull/11289.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11289.patch"},"body":"### Summary of Changes\r\n\r\nThis PR (alternative to https://github.com/joomla/joomla-cms/pull/8540) adds the ability to add more attributes to the script tag using `JDocument::addScript()`, `JDocument::addScriptVersion()` and `JHtml::script()` methods.  Also adds the ability to add IE conditional statements.\r\n\r\nAlso adds the ability to add the same attribs, script version and IE conditional statements when using `JHtml::script()` method.\r\n\r\nAlso deprecates MD5SUM and JDocument::addScriptVersion method.\r\n\r\n### How to test\r\n\r\nPlease test this in all possible scenarios.\r\nAny problem will get scripts not loading.\r\n\r\n- Use latest staging\r\n- Apply patch\r\n- Check backend and frontend are working fine\r\n- Add external js scripts like to isis/protostar index.php, some examples:\r\n```php\r\n// JDocument B/C tests\r\n$this->addScript('/path/to/external/bcaddScript1.js');\r\n$this->addScript('/path/to/external/bcaddScript2.js', '', true, false);\r\n$this->addScript('/path/to/external/bcaddScript3.js', 'text/javascript', true, true);\r\n$this->addScriptVersion('/path/to/external/bcaddScriptVersion1.js');\r\n$this->addScriptVersion('/path/to/external/bcaddScriptVersion2.js', null, '', true, false);\r\n$this->addScriptVersion('/path/to/external/bcaddScriptVersion3.js', 'version-string', 'text/javascript', true, true);\r\n\r\n// JDocument new method tests\r\n$this->addScript('/path/to/external/addScript1.js', array(), array('id' => 'scriptid'));\r\n$this->addScript('/path/to/external/addScript2.js', array(), array('id' => 'scriptid', 'data-test' => 1));\r\n$this->addScript('/path/to/external/addScript3.js', array(), array('data-attrib' => 'original-value'));\r\n$this->addScript('/path/to/external/addScript4.js', array(), array('data-attrib' => 'final-value'));\r\n$this->addScript('/path/to/external/addScript5.js', array(), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));\r\n$this->addScript('/path/to/external/addScript6.js', array('version' => 'auto'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));\r\n$this->addScript('/path/to/external/addScript7.js', array('version' => 'version-string'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));\r\n$this->addScript('/path/to/external/addScript8.js', array('version' => 'auto', 'conditional' => 'lf IE 9'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));\r\n\r\n// JHTML B/C Tests\r\nJHtml::_('script', 'media/system/js/multiselect.js');\r\nJHtml::_('script', 'system/repeatable.js', false, true, false, false, true);\r\n\r\n// JHtml new method tests\r\nJHtml::_('script', 'media/com_finder/js/indexer.js', array(), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));\r\nJHtml::_('script', 'system/progressbar.js', array('relative' => true), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));\r\nJHtml::_('script', 'system/permissions.js', array('relative' => true, 'version' => 'auto'), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));\r\nJHtml::_('script', 'system/sendtestmail.js', array('relative' => true, 'version' => 'version-string'), array('async' => 'async', 'defer' => 'defer', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));\r\nJHtml::_('script', 'system/helpsite.js', array('relative' => true, 'version' => 'version-string', 'conditional' => 'lf IE 9'), array('async' => 'async', 'defer' => 'defer', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));\r\n```\r\n- Check the HTML output and confirm all is fine\r\n- Do a code review.\r\n\r\n### Observations\r\n\r\nFrom a B/C perspective i think there are no issues, but mantainers please check.\r\n\r\n### PRs depending on this one getting tested & merged\r\n\r\n- https://github.com/joomla/joomla-cms/pull/11686\r\n- https://github.com/joomla/joomla-cms/pull/8545"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/243793997","html_url":"https://github.com/joomla/joomla-cms/pull/11289#issuecomment-243793997","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11289","id":243793997,"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-31T15:05:00Z","updated_at":"2016-08-31T15:05:00Z","body":"Can someone test this one?<hr /><sub>This comment was created with the <a href=\"https://github.com/joomla/jissues\">J!Tracker Application</a> at <a href=\"https://issues.joomla.org/tracker/joomla-cms/11289\">issues.joomla.org/joomla-cms/11289</a>.</sub>"}}
{"actor":{"display_login":"dgt41"}}