cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [1/3] Successful firing of deviceready (works with a hacked cordova.osx.js search for TODO:)
Date Wed, 06 Mar 2013 01:38:27 GMT
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/15c64637/CordovaMac/www/index.html
----------------------------------------------------------------------
diff --git a/CordovaMac/www/index.html b/CordovaMac/www/index.html
index 24047bd..c5f8f02 100644
--- a/CordovaMac/www/index.html
+++ b/CordovaMac/www/index.html
@@ -25,48 +25,22 @@ Licensed to the Apache Software Foundation (ASF) under one
 	<meta charset="utf-8">
     <style>
     </style>
-
-
-	<!-- iPad/iPhone specific css below, add after your main css >
-	<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css"
type="text/css" />		
-	<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css"
type="text/css" />		
-	-->
-	<!-- If your application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js
into your www directory and include it here -->
-	<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
+    <script>
+        window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln);};
+    </script>
+	<script type="text/javascript" charset="utf-8" src="cordova.osx.js"></script>
     <script type="text/javascript">
 
-
-	// If you want to prevent dragging, uncomment this section
-	/*
-	function preventBehavior(e) 
-	{ 
-      e.preventDefault(); 
-    };
-	document.addEventListener("touchmove", preventBehavior, false);
-	*/
-	
-	/* If you are supporting your own protocol, the var invokeString will contain any arguments
to the app launch.
-	see http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
-	for more details -jm */
-	/*
-	function handleOpenURL(url)
-	{
-		// TODO: do something with the url passed in.
-	}
-	*/
-	
 	function onBodyLoad()
 	{		
-		//document.addEventListener("deviceready", onDeviceReady, false);
+		document.addEventListener("deviceready", onDeviceReady, false);
+    }
         
+    function onDeviceReady()
+    {
         console.log("Cordova is working!");
         navigator.notification.alert("Cordova is working!", "Apache Cordova");
         cordovabridge.exec('INVALID', 'TestService', 'TestAction', [ 1, 'two', { 3 : 'three',
'four': 4 }]);
-	}
-        
-    function onDeviceReady()
-    {
-		//navigator.notification.alert("Cordova is working!");
     }
         
     </script>


Mime
View raw message