Comparing version 0.0.2 to 0.0.3
@@ -21,12 +21,9 @@ var gulp = require('gulp'), | ||
return browserify({ | ||
entries: './test/index.js', | ||
entries: './lib/index.js', | ||
debug: true | ||
}) | ||
.bundle() | ||
.pipe(source('bundle.js')) | ||
.pipe(source('keen-core.js')) | ||
.pipe(buffer()) | ||
.pipe(compress()) | ||
.on('error', gutil.log) | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest('./test')); | ||
@@ -84,4 +81,11 @@ }); | ||
.pipe(tapeRunner()) | ||
.on('error', gutil.log) | ||
.on('results', gutil.log) | ||
.pipe(process.stdout); | ||
.pipe(process.stdout) | ||
.pipe(source('bundle.js')) | ||
.pipe(buffer()) | ||
// .pipe(compress()) | ||
.pipe(sourcemaps.init({ loadMaps: true })) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest('./test')); | ||
}); | ||
@@ -88,0 +92,0 @@ |
@@ -58,2 +58,11 @@ var each = require('./utils/each'), | ||
Client.ready = function(fn){ | ||
if (Client.loaded) { | ||
fn(); | ||
} | ||
else { | ||
Client.once('ready', fn); | ||
} | ||
}; | ||
Client.prototype.configure = function(obj){ | ||
@@ -145,2 +154,34 @@ var config = obj || {}; | ||
domReady(function(){ | ||
Client.loaded = true; | ||
Client.emit('ready'); | ||
}); | ||
function domReady(fn){ | ||
if (Client.loaded || typeof document === 'undefined') { | ||
fn(); | ||
return; | ||
} | ||
// Firefox 3.5 shim | ||
if(document.readyState == null && document.addEventListener){ | ||
document.addEventListener('DOMContentLoaded', function DOMContentLoaded(){ | ||
document.removeEventListener('DOMContentLoaded', DOMContentLoaded, false); | ||
document.readyState = 'complete'; | ||
}, false); | ||
document.readyState = 'loading'; | ||
} | ||
testDom(fn); | ||
} | ||
function testDom(fn){ | ||
if (/in/.test(document.readyState)) { | ||
setTimeout(function(){ | ||
testDom(fn); | ||
}, 9); | ||
} | ||
else { | ||
fn(); | ||
} | ||
} | ||
// Module Definitions | ||
@@ -159,9 +200,4 @@ // -------------------- | ||
// RequireJS | ||
if (typeof define !== 'undefined' && define.amd) { | ||
define('keen-core', [], function(){ | ||
return Client; | ||
}); | ||
} | ||
/* RequireJS defintion not necessary */ | ||
}).call(this, typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}); |
{ | ||
"name": "keen-core", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Core functionality powering Keen IO's modular JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24508
18
640