diff --git a/CHANGELOG b/CHANGELOG index 65a7034bc..f70dbb9d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Version 1.0.2 (2014-06-24) +-------------------------- +Added guard to prevent document size field from being set as "NaNxNaN" (#220) +Fixed Grunt publish tasks to build sp.js as well as upload it to S3 (#224) +Added cache control to Grunt upload for full semantic version (#225) + Version 1.0.1 (2014-04-09) -------------------------- Fixed lodash.js to work in the presence of AMD modules (#165) diff --git a/Gruntfile.js b/Gruntfile.js index 8ac37acc8..4c339d062 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -155,6 +155,11 @@ module.exports = function(grunt) { gzip: true }, not_pinned: { + options: { + headers: { + 'Cache-Control': 'max-age=315360000' + } + }, upload: [ { src: 'dist/sp.js', @@ -163,6 +168,11 @@ module.exports = function(grunt) { ] }, pinned: { + options: { + headers: { + 'Cache-Control': 'max-age=3600' + } + }, upload: [ { src: 'dist/sp.js', @@ -198,8 +208,8 @@ module.exports = function(grunt) { }); grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify', 'concat', 'min']); - grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'concat', 'min', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']); - grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'concat', 'min', 's3', 'invalidate_cloudfront']); + grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify', 'concat', 'min', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']); + grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify', 'concat', 'min', 's3', 'invalidate_cloudfront']); grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','intern']); } diff --git a/package.json b/package.json index fabecef4b..6f8e3915c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snowplow-tracker", - "version": "1.0.1", + "version": "1.0.2", "devDependencies": { "grunt": "~0.4.2", "intern": "~1.4.0", diff --git a/src/js/lib/detectors.js b/src/js/lib/detectors.js index 25c0fb2bd..df2c1c0fb 100644 --- a/src/js/lib/detectors.js +++ b/src/js/lib/detectors.js @@ -155,7 +155,7 @@ var de = documentAlias.documentElement; // Alias var w = Math.max(de.clientWidth, de.offsetWidth, de.scrollWidth); var h = Math.max(de.clientHeight, de.offsetHeight, de.scrollHeight); - return w + 'x' + h; + return isNaN(w) || isNaN(h) ? '' : w + 'x' + h; } /* diff --git a/src/js/snowplow.js b/src/js/snowplow.js index 3c975fd72..45e5c0ed1 100644 --- a/src/js/snowplow.js +++ b/src/js/snowplow.js @@ -88,7 +88,7 @@ windowAlias = window, /* Tracker identifier with version */ - version = 'js-1.0.0', // Update banner.js too + version = 'js-1.0.2', // Update banner.js too /* Contains three variables that are shared with tracker.js and must be passed by reference */ mutSnowplowState = {