From 8b092db4575cedb94b29df1dc48ead90418470f5 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Fri, 13 Apr 2018 13:00:04 +0300 Subject: [PATCH] Update Segment.io Analytics code to latest version, v4.1.0. This is a drive-by update which seemed worth landing, but turned out not to fix the solution to the problem I was trying to fix (see refs for what that turned out to be). Ref: https://github.com/meteor/meteor-theme-hexo/commit/544f1f40 Ref: https://github.com/meteor/meteor-theme-hexo/pull/65 --- CHANGELOG.md | 4 +++- layout/layout.ejs | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6075739..4e0bc21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## vNEXT * Elements with HTML IDs of `analytics` will no longer break Segment.io. - [PR #](https://github.com/meteor/meteor-theme-hexo/pull/) + [PR #65](https://github.com/meteor/meteor-theme-hexo/pull/65) +* Update Segment.io JavaScript code to latest version. + [PR #66](https://github.com/meteor/meteor-theme-hexo/pull/66) ## v1.0.5 diff --git a/layout/layout.ejs b/layout/layout.ejs index 7d5ff6f..f18b30f 100644 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -112,6 +112,7 @@ <% } %> <% if (config.apis && config.apis.segment) { %> +<<<<<<< HEAD <%# We define `analytics` in the global context to guard against HTML elements on the page potentially named "analytics". This is necessary because we have some docs pages with @@ -125,10 +126,10 @@ %> var analytics; - <%# Segment.io's analytics code. %> - !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t + !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t"); - analytics.page() + analytics.page(); }}(); <% } %>