Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated BlackBerry PhoneGap project file (phonegap.jdp), added a test…

… CSS file, fixed stylesheet retrieval and injection (css works now).
  • Loading branch information...
commit 96c1e41a1fae90a2f1c8dcad691b360ce67420f4 1 parent f8c13fb
@filmaj filmaj authored
View
74 blackberry/phonegap.jdp
@@ -21,80 +21,35 @@ AutoRestart=0
]
ExcludeFromBuildAll=0
[Files
-..\..\..\..\workspace_blackberry\phonegap\src\0.png
-..\..\..\..\workspace_blackberry\phonegap\src\1.png
-..\..\..\..\workspace_blackberry\phonegap\src\2.png
-..\..\..\..\workspace_blackberry\phonegap\src\3.png
-..\..\..\..\workspace_blackberry\phonegap\src\4.png
-..\..\..\..\workspace_blackberry\phonegap\src\5.png
-..\..\..\..\workspace_blackberry\phonegap\src\camera.html
-..\..\..\..\workspace_blackberry\phonegap\src\camera.js
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\Command.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\CommandManager.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\CameraCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\ContactsCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\GeoLocationCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\InitializationCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\TelephonyCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\api\impl\VibrationCommand.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\io\AsynchronousResourceFetcher.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\io\Callback.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\io\ConnectionManager.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\io\QueueResourceFetcher.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\model\Position.java
-..\..\..\..\workspace_blackberry\phonegap\src\com\nitobi\phonegap\PhoneGap.java
-..\..\..\..\workspace_blackberry\phonegap\src\contacts.html
-..\..\..\..\workspace_blackberry\phonegap\src\contacts.js
-..\..\..\..\workspace_blackberry\phonegap\src\device.html
-..\..\..\..\workspace_blackberry\phonegap\src\device.js
-..\..\..\..\workspace_blackberry\phonegap\src\geolocation.js
-..\..\..\..\workspace_blackberry\phonegap\src\index.html
-..\..\..\..\workspace_blackberry\phonegap\src\io.html
-..\..\..\..\workspace_blackberry\phonegap\src\location.html
-..\..\..\..\workspace_blackberry\phonegap\src\position.js
-..\..\..\..\workspace_blackberry\phonegap\src\telephony.html
-..\..\..\..\workspace_blackberry\phonegap\src\telephony.js
-..\..\..\..\workspace_blackberry\phonegap\src\vibration.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\camera.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\contacts.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\device.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\geolocation.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\position.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\js\telephony.js
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\camera.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\contacts.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\device.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\0.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\1.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\2.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\3.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\4.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\images\5.png
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\index.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\io.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\location.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\telephony.html
-..\..\..\..\workspace_blackberry\phonegap\src\www\test\vibration.html
src\com\nitobi\phonegap\api\Command.java
src\com\nitobi\phonegap\api\CommandManager.java
src\com\nitobi\phonegap\api\impl\CameraCommand.java
src\com\nitobi\phonegap\api\impl\ContactsCommand.java
+src\com\nitobi\phonegap\api\impl\DeviceCommand.java
src\com\nitobi\phonegap\api\impl\GeoLocationCommand.java
-src\com\nitobi\phonegap\api\impl\InitializationCommand.java
+src\com\nitobi\phonegap\api\impl\MediaCommand.java
+src\com\nitobi\phonegap\api\impl\NotificationCommand.java
src\com\nitobi\phonegap\api\impl\TelephonyCommand.java
-src\com\nitobi\phonegap\api\impl\VibrationCommand.java
src\com\nitobi\phonegap\io\AsynchronousResourceFetcher.java
src\com\nitobi\phonegap\io\Callback.java
src\com\nitobi\phonegap\io\ConnectionManager.java
+src\com\nitobi\phonegap\io\HttpConnection.java
+src\com\nitobi\phonegap\io\PrimaryResourceFetchThread.java
src\com\nitobi\phonegap\io\QueueResourceFetcher.java
+src\com\nitobi\phonegap\io\SecondaryResourceFetchThread.java
src\com\nitobi\phonegap\model\Position.java
src\com\nitobi\phonegap\PhoneGap.java
+src\www\css\test.css
src\www\js\camera.js
src\www\js\contacts.js
src\www\js\device.js
src\www\js\geolocation.js
+src\www\js\media.js
+src\www\js\notification.js
src\www\js\position.js
src\www\js\telephony.js
+src\www\media\bird.mp3
+src\www\media\percBass2.wav
src\www\test\camera.html
src\www\test\contacts.html
src\www\test\device.html
@@ -107,8 +62,9 @@ src\www\test\images\5.png
src\www\test\index.html
src\www\test\io.html
src\www\test\location.html
+src\www\test\media.html
+src\www\test\notification.html
src\www\test\telephony.html
-src\www\test\vibration.html
]
HaveAlxImports=0
HaveDefs=0
@@ -120,9 +76,8 @@ HaveImports=0
[Imports
]
Listing=0
-MidletClass=data:///www/test/index.html
Options=-quiet
-OutputFileName=phonegap
+OutputFileName=PhoneGapBB
[PackageProtection
]
RibbonPosition=0
@@ -131,6 +86,5 @@ RibbonPosition=0
RunOnStartup=0
StartupTier=7
SystemModule=0
-Title=PhoneGap
Type=0
UserData=|src
View
12 blackberry/src/com/nitobi/phonegap/io/ConnectionManager.java
@@ -51,10 +51,12 @@
public static final String DATA = "data";
public static final String DATA_PROTOCOL = DATA + ":///";
- private static final byte[] DATA_URL_HTML = (ConnectionManager.DATA + ":text/html;charset=utf-8;base64,").getBytes();
- private static final byte[] DATA_URL_JS = (ConnectionManager.DATA + ":text/javascript;charset=utf-8;base64,").getBytes();
- private static final byte[] DATA_URL_IMG_JPG = (ConnectionManager.DATA + ":image/jpeg;charset=utf-8;base64,").getBytes();
- private static final byte[] DATA_URL_PLAIN = (ConnectionManager.DATA + ":text/plain;charset=utf-8;base64,").getBytes();
+ private static final String URI_SUFFIX = ";charset=utf-8;base64,";
+ private static final byte[] DATA_URL_HTML = (ConnectionManager.DATA + ":text/html" + URI_SUFFIX).getBytes();
+ private static final byte[] DATA_URL_JS = (ConnectionManager.DATA + ":text/javascript" + URI_SUFFIX).getBytes();
+ private static final byte[] DATA_URL_IMG_JPG = (ConnectionManager.DATA + ":image/jpeg" + URI_SUFFIX).getBytes();
+ private static final byte[] DATA_URL_CSS = (ConnectionManager.DATA + ":text/css" + URI_SUFFIX).getBytes();
+ private static final byte[] DATA_URL_PLAIN = (ConnectionManager.DATA + ":text/plain" + URI_SUFFIX).getBytes();
/**
* Creates a connection and returns it. Calling this method without care may saturate BB capacity.
@@ -206,6 +208,8 @@ private static HttpConnection getDataProtocolConnection(String url) {
output.write(ConnectionManager.DATA_URL_JS);
} else if (dataUrl.endsWith(".jpg") || dataUrl.endsWith(".jpeg")) {
output.write(ConnectionManager.DATA_URL_IMG_JPG);
+ } else if (dataUrl.endsWith(".css")) {
+ output.write(ConnectionManager.DATA_URL_CSS);
} else {
output.write(ConnectionManager.DATA_URL_PLAIN);
}
View
1  blackberry/src/www/css/test.css
@@ -0,0 +1 @@
+a { color:red; }
View
1  blackberry/src/www/test/index.html
@@ -1,6 +1,7 @@
<html>
<head>
<meta http-equiv="HandheldFriendly" content="true" />
+ <LINK href="data:///www/css/test.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="http://www.google.com">Navigate to Internet</a> (needs MDS)<br/>
Please sign in to comment.
Something went wrong with that request. Please try again.