travis-web/app/initializers/google-analytics.js
Curtis Ekstrom 92896aa8e1 Remove initializer deprecation warnings
The previous initializer API was deprecated in Ember 2.1 (See
http://emberjs.com/deprecations/v2.x/), so this updates the initializer
signatures to accomodate that change.
Also, remove the registered deprecation from the workflow.
2016-01-31 12:30:27 +01:00

27 lines
642 B
JavaScript

// Generated by CoffeeScript 1.10.0
import config from 'travis/config/environment';
var GAInitializer, initialize;
initialize = function(application) {
var ga, s;
if (config.gaCode) {
window._gaq = [];
_gaq.push(['_setAccount', config.gaCode]);
ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
s = document.getElementsByTagName('script')[0];
return s.parentNode.insertBefore(ga, s);
}
};
GAInitializer = {
name: 'google-analytics',
initialize: initialize
};
export {initialize};
export default GAInitializer;