You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/04/06 03:20:42 UTC

[11/40] git commit: Adding console and device objects to proper global namespaces

Adding console and device objects to proper global namespaces


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/6e56c3ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/6e56c3ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/6e56c3ae

Branch: refs/heads/master
Commit: 6e56c3ae6d973ca764948e25f2857584401ac25a
Parents: 8ae56c6
Author: filmaj <ma...@gmail.com>
Authored: Fri Mar 30 17:22:11 2012 -0700
Committer: filmaj <ma...@gmail.com>
Committed: Fri Mar 30 17:22:11 2012 -0700

----------------------------------------------------------------------
 lib/wp7/platform.js           |   13 +++++++------
 lib/wp7/plugin/wp7/console.js |   33 +++++----------------------------
 2 files changed, 12 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/6e56c3ae/lib/wp7/platform.js
----------------------------------------------------------------------
diff --git a/lib/wp7/platform.js b/lib/wp7/platform.js
index 13ba1e5..4b5b1a9 100644
--- a/lib/wp7/platform.js
+++ b/lib/wp7/platform.js
@@ -1,11 +1,6 @@
 module.exports = {
     id: "wp7",
-    initialize:function() {
-		
-		console.log("wp7 initialize");
-		console.log("window.CordovaCommandResult = " + window.CordovaCommandResult);
-		//cordova.require("cordova/channel").onNativeReady.fire();
-	},
+    initialize:function() {},
     objects: {
 		CordovaCommandResult: {
 			path:"cordova/plugin/wp7/CordovaCommandResult"
@@ -16,6 +11,12 @@ module.exports = {
                     path: "cordova/plugin/wp7/device"
                 }
             }
+        },
+        device:{
+          path:"cordova/plugin/wp7/device"
+        },
+        console:{
+          path: "cordova/plugin/wp7/console"
         }
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/6e56c3ae/lib/wp7/plugin/wp7/console.js
----------------------------------------------------------------------
diff --git a/lib/wp7/plugin/wp7/console.js b/lib/wp7/plugin/wp7/console.js
index af058cd..2a8faf0 100644
--- a/lib/wp7/plugin/wp7/console.js
+++ b/lib/wp7/plugin/wp7/console.js
@@ -1,40 +1,17 @@
-
-console.log("console is being added");
-
 var exec = require('cordova/exec'),
     channel = require('cordova/channel');
 var cordova = require("cordova");
 
-
-var debugConsole = 
-{
+var debugConsole = {
 	log:function(msg){
-		cordova.exec(null,null,"DebugConsole","log",msg);
+		exec(null,null,"DebugConsole","log",msg);
 	},
 	warn:function(msg){
-		cordova.exec(null,null,"DebugConsole","warn",msg);
+		exec(null,null,"DebugConsole","warn",msg);
 	},
 	error:function(msg){
-		cordova.exec(null,null,"DebugConsole","error",msg);
+		exec(null,null,"DebugConsole","error",msg);
 	}	
 };
 
-
-if(typeof window.console == "undefined")
-{
-	window.console = debugConsole;
-}
-else
-{
-	console.log("window.console is already defined");
-}
-
-// output any errors to console log, created above.
-window.onerror=function(e)
-{
-	debugConsole.error(JSON.stringify(e));
-};
-
-module.exports = debugConsole;
-
-console.log("console is added");
+module.exports = debugConsole;
\ No newline at end of file