Permalink
Browse files

Updates

  • Loading branch information...
1 parent dac04cb commit 11b6649e968e2b80a86a86d11ac7795ab9060331 @mikaelkindborg mikaelkindborg committed Feb 21, 2010
Showing with 9 additions and 9 deletions.
  1. +1 −1 javascript/DroidScriptApp.js
  2. +6 −6 javascript/DroidScriptServer.js
  3. +2 −2 src/comikit/droidscript/Droid.java
@@ -149,7 +149,7 @@ function onOptionsItemSelected(item)
else
if (menuItemHasId(item, 13)) { updateApplicationScripts(); }
else
- if (menuItemHasId(item, 14)) { Activity.finish(); }
+ if (menuItemHasId(item, 14)) { Droid.Log.clear(); Activity.finish(); }
return true;
}
@@ -82,7 +82,7 @@ function onOptionsItemSelected(item)
else
if (menuItemHasId(item, 12)) { startServer(); }
else
- if (menuItemHasId(item, 13)) { Activity.finish(); }
+ if (menuItemHasId(item, 13)) { Droid.Log.clear(); Activity.finish(); }
return true;
}
@@ -114,24 +114,24 @@ function startServer()
// TODO: Handle PUT and GET, look for action in request (eval or run).
// TODO: Add save and get script.
// URI=/favicon.ico
- log("URI=" + uri + " DATA=" + data);
- if (("PUT" == method) && ("/eval/" == uri.substring(0, 6)))
+ log("METHOD=" + method + " URI=" + uri + " DATA=" + data);
+ if (("PUT" == method) && (uri.length() > 5) && ("/eval/" == uri.substring(0, 6)))
{
return Activity.eval(data);
}
- if (("PUT" == method) && ("/run/" == uri.substring(0, 5)))
+ if (("PUT" == method) && (uri.length() > 4) && ("/run/" == uri.substring(0, 5)))
{
var intent = new Intent();
intent.setClassName(Activity, "comikit.droidscript.DroidScriptActivity");
intent.putExtra("Script", data);
Activity.startActivity(intent);
return;
}
- if (("GET" == method) && ("/eval/" == uri.substring(0, 6)))
+ if (("GET" == method) && (uri.length() > 5) && ("/eval/" == uri.substring(0, 6)))
{
return Activity.eval(uri.substring(6));
}
- if (("GET" == method) && ("/hello" == uri.substring(0, 6)))
+ if (("GET" == method) && (uri.length() > 5) && ("/hello" == uri.substring(0, 6)))
{
return "Welcome to the wonderful world of DroidScript!";
}
@@ -24,8 +24,8 @@
*/
public class Droid
{
- static MessageLog Log = new MessageLog();
- static LanguageDictionary Dictionary = new LanguageDictionary();
+ public static MessageLog Log = new MessageLog();
+ public static LanguageDictionary Dictionary = new LanguageDictionary();
public static void log(String message)
{

0 comments on commit 11b6649

Please sign in to comment.