Skip to content

Conversation

@tadatuta
Copy link
Member

@tadatuta tadatuta commented Feb 7, 2017

No description provided.

' var n = d.getElementsByTagName("script")[0],',
' s = d.createElement("script"),',
' f = function () { n.parentNode.insertBefore(s, n); };',
' s.type = "text/javascript";',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text/javascript is default value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, but why Metrica provides this attribute? May be it brings value for using in old browsers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should care for such old browsers.

].join('');

noScriptContent = {
tag : 'div',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div is default value

' d.addEventListener("DOMContentLoaded", f, false);',
' } else { f(); }',
'})(document, window, "yandex_metrika_callbacks");'
].join('\n');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should safe ~35 bytes :)

@tadatuta
Copy link
Member Author

tadatuta commented Feb 7, 2017

please squash commits before merge

@remnev
Copy link
Member

remnev commented Feb 8, 2017

I propose to implement it into a modifier. Something like _minified_true

I don't like to get minified script by default. Metrica provides script such our current template does. I'd like to save this behaviour.

@tadatuta
Copy link
Member Author

tadatuta commented Feb 8, 2017

When you apply BEMHTML templates to BEMJSON you get minimized HTML.
Isn't it strange to have all the HTML of a page as one-liner and the only different piece is Metrica snippet?

@remnev
Copy link
Member

remnev commented Feb 9, 2017

Ok, you're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants