速報APP / 教育 / JsOs

JsOs

價格:免費

更新日期:2018-06-12

檔案大小:2.5M

目前版本:2.0

版本需求:Android 4.0.3 以上版本

官方網站:mailto:zc2255@columbia.edu

JsOs(圖1)-速報App

A platform to write javascript with full access to android API

How to use

The app has two modes:

1 the editor mode, with - as bar character

2 the command model, with = as bar character

use Alt+x to toggle between these modes

The editor mode.

Editor the current file and run.

Ctrl+ (f/b/n/p) cursor right/left/down/up (like in emacs)

Ctrl+ space set mark

Ctrl+ (w/y) cut/paste

Ctrl+ (e/a) end/begining of line

Ctrl+ (j/r) run code (without/with) babel in js thread (different from ui thread) and clear content

JsOs(圖2)-速報App

Ctrl+ u run code with babel in main UI thread and clear content (this is necessary when user want's to create a UI program, otherwise, just run it in js thread)

Ctrl+ q, show the magic input screen (a novel design)

Ctrl + ( [ / ] ), toggle history

Ctrl + i, send to IO (use for java.read)

Ctrl+c, clear output

TAB: intelligent autocomplete

Alt+ w copy

Alt + (f/b) word forward/backward

Alt+ (j/r) run code (without/with) babel in js thread (different from ui thread) and don't clear content

Alt+ u run code with babel in main UI thread and don't clear content (this is necessary when user want's to create a UI program, otherwise, just run it in js thread)

The command mode

This mode is to create, open, list, and execute files

Current support command

JsOs(圖3)-速報App

ls: list files and directories in current working directory

cd: change working directory

mkdir: create new directory

clear: clear output

save filename: save the file

open filename: open the file and into editor mode

cat filename: print the file content to output

examples: write the example files

otherwise, the system search the file same as the command and push the arguments into a variable exposed as arg as a javascript array

Manage Js contexts

Each javascript context has its own heap, so the user can create an isolated namespace associated with a default java thread to execute code. Since the underlying javascript engine (based on duktape) is single thread essentially, i.e, each time, only one thread can access the heap at a given time, the JsOs use the hack in method to execute any heap from the main thread (in principle,from any thread) in contrast to the default js thread by using the locker.

Ctrl+c create a js thread

Ctrl+k delete the current js thread (the default heap and thread to execute code)

JsOs(圖4)-速報App

Ctrl+o, show the information for js threads

Ctrl+(-/=) set the current thread as (previous/next) thread

Alt+c create new thread

JsOs(圖5)-速報App