This commit is contained in:
Alan K 2014-07-15 19:22:25 +02:00
parent 1392bf35aa
commit 2c005d0390
4 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "filer", "name": "filer",
"version": "0.0.16", "version": "0.0.17",
"main": "dist/filer.js", "main": "dist/filer.js",
"devDependencies": { "devDependencies": {
"mocha": "1.17.1", "mocha": "1.17.1",

10
dist/filer.js vendored
View File

@ -1040,6 +1040,7 @@ EventEmitter.prototype.removeAllListeners = pub.removeAllListeners;
module.exports = EventEmitter; module.exports = EventEmitter;
},{}],3:[function(_dereq_,module,exports){ },{}],3:[function(_dereq_,module,exports){
(function (global){
// Based on https://github.com/diy/intercom.js/blob/master/lib/intercom.js // Based on https://github.com/diy/intercom.js/blob/master/lib/intercom.js
// Copyright 2012 DIY Co Apache License, Version 2.0 // Copyright 2012 DIY Co Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
@ -1080,7 +1081,7 @@ var localStorage = (function(window) {
}; };
} }
return window.localStorage; return window.localStorage;
}(this)); }(global));
function Intercom() { function Intercom() {
var self = this; var self = this;
@ -1096,14 +1097,14 @@ function Intercom() {
}; };
// If we're in node.js, skip event registration // If we're in node.js, skip event registration
if (typeof window === 'undefined' || typeof document === 'undefined') { if (typeof document === 'undefined') {
return; return;
} }
if (document.attachEvent) { if (document.attachEvent) {
document.attachEvent('onstorage', storageHandler); document.attachEvent('onstorage', storageHandler);
} else { } else {
window.addEventListener('storage', storageHandler, false); global.addEventListener('storage', storageHandler, false);
} }
} }
@ -1234,7 +1235,7 @@ Intercom.prototype._localStorageChanged = function(event, field) {
}; };
Intercom.prototype._onStorageEvent = function(event) { Intercom.prototype._onStorageEvent = function(event) {
event = event || window.event; event = event || global.event;
var self = this; var self = this;
if (this._localStorageChanged(event, INDEX_EMIT)) { if (this._localStorageChanged(event, INDEX_EMIT)) {
@ -1359,6 +1360,7 @@ Intercom.getInstance = (function() {
module.exports = Intercom; module.exports = Intercom;
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../src/shared.js":59,"./eventemitter.js":2}],4:[function(_dereq_,module,exports){ },{"../src/shared.js":59,"./eventemitter.js":2}],4:[function(_dereq_,module,exports){
// Cherry-picked bits of underscore.js, lodash.js // Cherry-picked bits of underscore.js, lodash.js

4
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
"idb", "idb",
"websql" "websql"
], ],
"version": "0.0.16", "version": "0.0.17",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)", "author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "http://js-platform.github.io/filer", "homepage": "http://js-platform.github.io/filer",
"bugs": "https://github.com/js-platform/filer/issues", "bugs": "https://github.com/js-platform/filer/issues",