Browse Source

Update and lock keen-core@0.1.1, update README, fix #49

master
dustinlarimer 8 years ago
parent
commit
f3843fa10d
  1. 7
      CHANGELOG.md
  2. 6
      README.md
  3. 7
      dist/keen-tracking.js
  4. 2
      dist/keen-tracking.min.js
  5. 4
      package.json

7
CHANGELOG.md

@ -6,6 +6,13 @@
**BREAKING:** **BREAKING:**
**CHANGE:** **CHANGE:**
--> -->
<a name="1.1.1"></a>
# 1.1.1 Global Namespace Fix (Pt2)
**FIXED:**
* This patch isolates global namespace definition and installs `keen-core@0.1.1` to fix an issue where prototype methods of other SDKs were blended into this SDK's prototype.
<a name="1.1.0"></a> <a name="1.1.0"></a>
# 1.1.0 Global Namespace Fix # 1.1.0 Global Namespace Fix

6
README.md

@ -130,7 +130,7 @@ Copy/paste this snippet of JavaScript above the `</head>` tag of your page to lo
// Loads the library asynchronously from any URI // Loads the library asynchronously from any URI
!function(name,path,ctx){ !function(name,path,ctx){
var latest,prev=name!=='Keen'&&window.Keen?window.Keen:false;ctx[name]=ctx[name]||{ready:function(fn){var h=document.getElementsByTagName('head')[0],s=document.createElement('script'),w=window,loaded;s.onload=s.onerror=s.onreadystatechange=function(){if((s.readyState&&!(/^c|loade/.test(s.readyState)))||loaded){return}s.onload=s.onreadystatechange=null;loaded=1;latest=w.Keen;if(prev){w.Keen=prev}else{try{delete w.Keen}catch(e){w.Keen=void 0}}ctx[name]=latest;ctx[name].ready(fn)};s.async=1;s.src=path;h.parentNode.insertBefore(s,h)}} var latest,prev=name!=='Keen'&&window.Keen?window.Keen:false;ctx[name]=ctx[name]||{ready:function(fn){var h=document.getElementsByTagName('head')[0],s=document.createElement('script'),w=window,loaded;s.onload=s.onerror=s.onreadystatechange=function(){if((s.readyState&&!(/^c|loade/.test(s.readyState)))||loaded){return}s.onload=s.onreadystatechange=null;loaded=1;latest=w.Keen;if(prev){w.Keen=prev}else{try{delete w.Keen}catch(e){w.Keen=void 0}}ctx[name]=latest;ctx[name].ready(fn)};s.async=1;s.src=path;h.parentNode.insertBefore(s,h)}}
}('Keen','https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.1.0.min.js',this); }('Keen','https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.1.1.min.js',this);
// Executes when the library is loaded and ready // Executes when the library is loaded and ready
Keen.ready(function(){ Keen.ready(function(){
@ -678,8 +678,12 @@ These helpers are designed to generate useful properties and objects for event d
### Datetime index ### Datetime index
**Important:** This is now supported by the API as an add-on! Learn more here: https://keen.io/docs/api/#datetime-parser
`Keen.utils.getDatetimeIndex()` returns a set of properties like "hour_of_day" or "day_of_month". This helper accepts an optional Date object as an argument, otherwise it will construct and return a datetime index object based on "now". `Keen.utils.getDatetimeIndex()` returns a set of properties like "hour_of_day" or "day_of_month". This helper accepts an optional Date object as an argument, otherwise it will construct and return a datetime index object based on "now".
This helper works with a new `Date` object, and therefore the value returned is localized and not UTC. [Read more about this issue here](https://github.com/keen/keen-tracking.js/issues/49).
```javascript ```javascript
var datetimeIndex = Keen.helpers.getDatetimeIndex(); var datetimeIndex = Keen.helpers.getDatetimeIndex();
/* /*

7
dist/keen-tracking.js

@ -1274,7 +1274,7 @@ Emitter.prototype.hasListeners = function(event){
debug: false, debug: false,
enabled: true, enabled: true,
loaded: false, loaded: false,
version: '1.1.0' version: '1.1.1'
}); });
Client.helpers = Client.helpers || {}; Client.helpers = Client.helpers || {};
Client.resources = Client.resources || {}; Client.resources = Client.resources || {};
@ -1293,7 +1293,7 @@ Emitter.prototype.hasListeners = function(event){
}); });
Client.extendLibrary = function(target, source) { Client.extendLibrary = function(target, source) {
var previous = previousKeen || source; var previous = previousKeen || source;
if (typeof previous !== 'undefined') { if (isDefined(previous) && isDefined(previous.resources)) {
each(previous, function(value, key) { each(previous, function(value, key) {
if (typeof value === 'object') { if (typeof value === 'object') {
target[key] = target[key] || {}; target[key] = target[key] || {};
@ -1427,6 +1427,9 @@ Emitter.prototype.hasListeners = function(event){
fn(); fn();
} }
} }
function isDefined(target) {
return typeof target !== 'undefined';
}
function isUndefined(target) { function isUndefined(target) {
return typeof target === 'undefined'; return typeof target === 'undefined';
} }

2
dist/keen-tracking.min.js

File diff suppressed because one or more lines are too long

4
package.json

@ -1,6 +1,6 @@
{ {
"name": "keen-tracking", "name": "keen-tracking",
"version": "1.1.0", "version": "1.1.1",
"description": "Data Collection SDK for Keen IO", "description": "Data Collection SDK for Keen IO",
"main": "lib/server.js", "main": "lib/server.js",
"browser": "lib/browser.js", "browser": "lib/browser.js",
@ -24,7 +24,7 @@
"dependencies": { "dependencies": {
"component-emitter": "^1.2.0", "component-emitter": "^1.2.0",
"js-cookie": "2.1.0", "js-cookie": "2.1.0",
"keen-core": "^0.1.0" "keen-core": "0.1.1"
}, },
"devDependencies": { "devDependencies": {
"browserify": "^9.0.8", "browserify": "^9.0.8",

Loading…
Cancel
Save