Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Various updates

  • Loading branch information...
commit 08d983fdb8f5c6767b60196345624e23f62cec51 1 parent 010f546
@divineprog authored
View
9 copyjs.sh
@@ -1,9 +1,2 @@
#!/bin/bash
-adb push ./javascript/DroidScriptApp.js /sdcard/droidscript/DroidScriptApp.js
-adb push ./javascript/DroidScriptServer.js /sdcard/droidscript/DroidScriptServer.js
-adb push ./javascript/Toast.js /sdcard/droidscript/Toast.js
-adb push ./javascript/Paint.js /sdcard/droidscript/Paint.js
-adb push ./javascript/Colors.js /sdcard/droidscript/Colors.js
-adb push ./javascript/Hello.js /sdcard/droidscript/Hello.js
-adb push ./javascript/CameraPreview.js /sdcard/droidscript/CameraPreview.js
-adb push ./javascript/WebAppSample.js /sdcard/droidscript/WebAppSample.js
+adb push ./javascript/ /sdcard/droidscript/
View
7 javascript/CameraPreview.js
@@ -34,9 +34,10 @@ function createPreviewSurface()
camera = null; },
surfaceChanged : function(holder, format, w, h) {
- var parameters = camera.getParameters();
- parameters.setPreviewSize(w, h);
- camera.setParameters(parameters);
+ // Crashes the camera on Nexus One:
+ // var parameters = camera.getParameters();
+ // parameters.setPreviewSize(w, h);
+ // camera.setParameters(parameters);
camera.startPreview(); }
};
View
2  javascript/DroidScriptApp.js
@@ -128,7 +128,7 @@ function onPrepareOptionsMenu(menu)
[[Droid.translate("OPEN_SCRIPT"), function() { openScriptDialog(); }],
["Colors app", function() { openScript("droidscript/Colors.js"); showToast("Press Run Activity"); }],
["Paint app", function() { openScript("droidscript/Paint.js"); showToast("Press Run Activity"); }],
-// ["FlipComics", function() { openScript("droidscript/FlipComics.js"); showToast("Press Run Activity"); }],
+// ["Comics", function() { openScript("droidscript/ComicsDemoActivity.js"); showToast("Press Run Activity"); }],
[Droid.translate("BE_KIND"), function() { showToast(Droid.translate("BE_KIND_MESSAGE")); }],
[Droid.translate("UPDATE_APP_SCRIPTS"), function() { updateApplicationScripts(); }],
[Droid.translate("QUIT_APP"), function() { Activity.finish(); }]];
View
7 javascript/DroidScriptServer.js
@@ -1,10 +1,7 @@
//
// This file defines the DroidScript server Activity. The activity starts
// a tiny web server and listens for requests on port 4042 (as default).
-// PUT and GET requests are accepted. There is no security what so ever
-// at this stage!
-//
-// TODO: Clean up the code. Add translations.
+// PUT and GET requests are accepted. There is no security what so ever!
//
// @author Mikael Kindborg
// Email: mikael.kindborg@gmail.com
@@ -142,7 +139,7 @@ function startServer()
// TODO: Add save and get script.
// TODO: Add support for favicon: URI=/favicon.ico
- // log("METHOD=" + method + " URI=" + uri + " DATA=" + data);
+ //log("METHOD=" + method + " URI=" + uri + " DATA=" + data);
log("METHOD=" + method + " URI=" + uri);
if (("PUT" == method) && (uri.length() > 5) && ("/eval/" == uri.substring(0, 6)))
View
14 src/comikit/droidscript/DroidScriptActivity.java
@@ -319,7 +319,7 @@ protected void createInterpreter()
// dialog.show();
// }
- public void reportError(Throwable e)
+ public void reportError(Object e)
{
// Create error message.
String message = "";
@@ -363,7 +363,10 @@ public void reportError(Throwable e)
// Log the error message.
Log.i("DroidScript", "JavaScript Error: " + message);
- e.printStackTrace();
+ if (e instanceof Throwable)
+ {
+ ((Throwable) e).printStackTrace();
+ }
}
public static String preprocess(String code) throws Exception
@@ -398,9 +401,10 @@ public static String extractCodeFromDroidScriptTags(String code) throws Exceptio
// Replace escaped characters with plain characters.
// TODO: Add more characters here
- result = result.replace("&lt;", "<").replace("&gt;", ">");
-
- return result;
+ return result
+ .replace("&lt;", "<")
+ .replace("&gt;", ">")
+ .replace("&quot;", "\"");
}
public static String preprocessMultiLineStrings(String code) throws Exception
Please sign in to comment.
Something went wrong with that request. Please try again.