-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinDevice.min.js
executable file
·1 lines (1 loc) · 1.17 KB
/
winDevice.min.js
1
!function(o,n){var e=void 0;o.winDevice=function(n,r){try{if(o.angular){!0,-1===document.URL.indexOf("http://")&&-1===document.URL.indexOf("https://")||o.cordova?(console.log("Cordova App"),e=!0,document.addEventListener("deviceready",function(){console.log("Bootstrapping APP On Cordova : "+n),angular.bootstrap(document,[n]),log("Device Ready")},!1)):(console.log("Running In A Browser"),e=!1,document.addEventListener("DOMContentLoaded",function(){console.log("Bootstrapping APP On Browser : "+n),angular.bootstrap(document,[n]),log("Device Ready")}));var t={};this.enable=function(o){return t.log=o,o&&(log=console.log.bind(console),error=console.error.bind(console),warn=console.warn.bind(console)),o||(log=function(){},error=function(){},warn=function(){},console.log=function(){},console.error=function(){},console.warn=function(){}),this},this.device=function(){if(o.angular)return console.log("App Init with Dependency "+n),angular.module(n,r);console.error("Angularjs Not Found")},this.info=function(){return e?log("Emulation For Cordova : true"):log("Emulation For Browser : true"),log("Logging : "+t.log),this}}else console.error("Angular Not Found")}catch(o){return o}}}(window);