Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
39 lines
925 B
JavaScript
Executable file
39 lines
925 B
JavaScript
Executable file
'use strict';
|
|
|
|
var fb = self.fb || {};
|
|
self.fb = fb;
|
|
|
|
// Only will be executed in the case of not loading fb.utils previously
|
|
// i.e. dialer and call log FB integration
|
|
fb.utils = self.fb.utils || {};
|
|
self.fb.utils = fb.utils;
|
|
|
|
if (typeof fb.utils.Request !== 'function') {
|
|
/**
|
|
* Request auxiliary object to support asynchronous calls
|
|
*
|
|
*/
|
|
fb.utils.Request = function() {
|
|
this.done = function(result) {
|
|
this.result = result;
|
|
if (typeof this.onsuccess === 'function') {
|
|
var ev = {};
|
|
ev.target = this;
|
|
window.setTimeout(function() {
|
|
this.onsuccess(ev);
|
|
}.bind(this), 0);
|
|
}
|
|
};
|
|
|
|
this.failed = function(error) {
|
|
this.error = error;
|
|
if (typeof this.onerror === 'function') {
|
|
var ev = {};
|
|
ev.target = this;
|
|
window.setTimeout(function() {
|
|
this.onerror(ev);
|
|
}.bind(this), 0);
|
|
}
|
|
};
|
|
};
|
|
}
|