Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
65
gaia/tv_apps/fling-player/js/master_debug.js
Executable file
65
gaia/tv_apps/fling-player/js/master_debug.js
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
(function(exports) {
|
||||
'use strict';
|
||||
|
||||
var proto;
|
||||
|
||||
/**
|
||||
* This is the local debug mode controller.
|
||||
* @class
|
||||
* @constructor
|
||||
*/
|
||||
function MasterDebug(dbg) {
|
||||
|
||||
/**
|
||||
* the local debug mode flag
|
||||
* @type {boolean}
|
||||
*/
|
||||
this._flag_dbg = false;
|
||||
|
||||
this.setDBG(dbg);
|
||||
}
|
||||
|
||||
proto = MasterDebug.prototype;
|
||||
|
||||
proto.isDBG = function () {
|
||||
return this._flag_dbg;
|
||||
};
|
||||
|
||||
proto.setDBG = function (dbg) {
|
||||
this._flag_dbg = !!dbg;
|
||||
};
|
||||
|
||||
proto.log = function (var_args) {
|
||||
if (this.isDBG()) {
|
||||
return console.log.apply(console, Array.prototype.slice.call(arguments));
|
||||
}
|
||||
};
|
||||
|
||||
proto.warn = function (var_args) {
|
||||
if (this.isDBG()) {
|
||||
return console.warn.apply(console, Array.prototype.slice.call(arguments));
|
||||
}
|
||||
};
|
||||
|
||||
proto.error = function (var_args) {
|
||||
if (this.isDBG()) {
|
||||
return console.error.apply(
|
||||
console,
|
||||
Array.prototype.slice.call(arguments)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Run provided testing behavior in the debug mode
|
||||
* @param {function} behavior a callback executing testing behavior
|
||||
*/
|
||||
proto.test = function (behavior) {
|
||||
if (this.isDBG() && typeof behavior === 'function') {
|
||||
behavior();
|
||||
}
|
||||
};
|
||||
|
||||
window.mDBG = new MasterDebug(false);
|
||||
|
||||
})(window);
|
||||
Loading…
Reference in a new issue