diff --git a/Makefile b/Makefile index b3f0ebd..2c3ee4d 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,63 @@ all: build +# make dep runs without sudo +dep: + sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged + sudo apt-get -y install tcpdump + sudo apt-get -y install python-pip python-dev + + # before installing dnsmasq, the nameserver from /etc/resolv.conf should be saved + # to restore after install (gets overwritten by dnsmasq package) + cp /etc/resolv.conf /tmp/backup_resolv.conf + sudo apt-get -y install dnsmasq + sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf' + + # python dependencies for HIDbackdoor + sudo pip install pycrypto # already present on stretch + sudo pip install pydispatcher + + # install go + wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz + sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz + export PATH=$PATH:/usr/local/go/bin # put into ~/.profile + echo export PATH=$PATH:/usr/local/go/bin >> ~/.profile + sudo bash -c 'echo export PATH=\$PATH:/usr/local/go/bin >> ~/.profile' + + # install gopherjs + go get -u github.com/gopherjs/gopherjs + + # we don't need protoc + protoc-grpc-web, because the proto file is shipped pre-compiled + + # go dependencies for webapp (without my own) + #go get google.golang.org/grpc + #go get -u github.com/improbable-eng/grpc-web/go/grpcweb + #go get -u github.com/gorilla/websocket + build: - go build P4wnP1_service.go - go build P4wnP1_cli.go + go get -u github.com/mame82/P4wnP1_go # partially downloads again, but we need the library packages in go path to build + env GOBIN=$(pwd)/build go install ./... # compile all main packages to the build folder + + # compile the web app + # ToDo: (check if dependencies have been fetched by 'go get', even with the build js tags) + gopherjs build -m -o build/webapp.js web_client/*.go install: - cp P4wnP1_service /usr/local/bin/ - cp P4wnP1_cli /usr/local/bin/ - cp P4wnP1.service /etc/systemd/system/P4wnP1.service - mkdir /usr/local/P4wnP1 - cp -R keymaps /usr/local/P4wnP1/ - cp -R scripts /usr/local/P4wnP1/ + cp build/P4wnP1_service /usr/local/bin/ + cp build/P4wnP1_cli /usr/local/bin/ + cp dist/P4wnP1.service /etc/systemd/system/P4wnP1.service + # copy over keymaps, scripts and www data + mkdir -p /usr/local/P4wnP1 + cp -R dist/keymaps /usr/local/P4wnP1/ + cp -R dist/scripts /usr/local/P4wnP1/ + cp -R dist/HIDScripts /usr/local/P4wnP1/ + cp -R dist/www /usr/local/P4wnP1/ + cp build/webapp.js /usr/local/P4wnP1/www + cp build/webapp.js.map /usr/local/P4wnP1/www + + # careful testing + #sudo update-rc.d dhcpcd disable + #sudo update-rc.d dnsmasq disable + # reinit service daemon systemctl daemon-reload # enable service @@ -26,6 +73,9 @@ remove: rm -f /usr/local/bin/P4wnP1_service rm -f /usr/local/bin/P4wnP1_cli rm -f /etc/systemd/system/P4wnP1.service - rm -R /usr/local/P4wnP1/ + rm -R /usr/local/P4wnP1/ # this folder should be kept, if only an update should be applied # reinit service daemon systemctl daemon-reload + + #sudo update-rc.d dhcpcd enable + diff --git a/Makefile.old b/Makefile.old new file mode 100644 index 0000000..b3f0ebd --- /dev/null +++ b/Makefile.old @@ -0,0 +1,31 @@ +all: build + +build: + go build P4wnP1_service.go + go build P4wnP1_cli.go + +install: + cp P4wnP1_service /usr/local/bin/ + cp P4wnP1_cli /usr/local/bin/ + cp P4wnP1.service /etc/systemd/system/P4wnP1.service + mkdir /usr/local/P4wnP1 + cp -R keymaps /usr/local/P4wnP1/ + cp -R scripts /usr/local/P4wnP1/ + # reinit service daemon + systemctl daemon-reload + # enable service + systemctl enable P4wnP1.service + # start service + service P4wnP1 start + +remove: + # stop service + service P4wnP1 stop + # disable service + systemctl disable P4wnP1.service + rm -f /usr/local/bin/P4wnP1_service + rm -f /usr/local/bin/P4wnP1_cli + rm -f /etc/systemd/system/P4wnP1.service + rm -R /usr/local/P4wnP1/ + # reinit service daemon + systemctl daemon-reload diff --git a/P4wnP1_cli.go b/P4wnP1_cli.go deleted file mode 100644 index 5ad071e..0000000 --- a/P4wnP1_cli.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import ( - "github.com/mame82/P4wnP1_go/cli_client" -) - -func main() { - cli_client.Execute() -} diff --git a/P4wnP1_service.go b/P4wnP1_service.go deleted file mode 100644 index ded07fc..0000000 --- a/P4wnP1_service.go +++ /dev/null @@ -1,79 +0,0 @@ -package main - -import ( - "log" - - "./service" - "os" - "os/signal" - "syscall" - "fmt" - pb "github.com/mame82/P4wnP1_go/proto" - "github.com/mame82/P4wnP1_go/common" - "time" - "strconv" -) - - - -func main() { - - err := service.InitGlobalServiceState() - if err != nil { panic(err) } - - state := service.ServiceState - state.StartService() - - - //ToDo: Check for root privs - err = service.CheckLibComposite() - if err != nil { - log.Fatalf("Couldn't load libcomposite: %v", err) - } - - //service.NewLed(false) //Set LED to manual trigger - //service.InitDefaultLEDSettings() - - /* - log.Printf("Keyboard devFile: %s\n", service.HidDevPath[service.USB_FUNCTION_HID_KEYBOARD_name]) - log.Printf("Mouse devFile: %s\n", service.HidDevPath[service.USB_FUNCTION_HID_MOUSE_name]) - log.Printf("HID RAW devFile: %s\n", service.HidDevPath[service.USB_FUNCTION_HID_RAW_name]) - */ - - service.StartRpcServerAndWeb("0.0.0.0", "50051", "80", "/home/pi/P4wnP1_go/www") //start gRPC service - - //Indicate servers up with LED blink count 1 - state.Led.SetLed(&pb.LEDSettings{1}) - - //service.StartEventManager(20) - log.SetOutput(state.EvMgr) - log.Println("TESTMESSAGE") - go func() { - err := common.RunBashScript("/usr/local/P4wnP1/scripts/servicestart.sh") - if err != nil { log.Printf("Error executing service startup script: %v\n", err) } - }() - - - //Send some log messages for testing - textfill := "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea" - i := 0 - go func() { - for { - //println("Sending log event") - state.EvMgr.Emit(service.ConstructEventLog("test source", i%5, "message " +strconv.Itoa(i) + ": " + textfill)) - time.Sleep(time.Millisecond *2000) - i++ - } - }() - - - - //use a channel to wait for SIGTERM or SIGINT - fmt.Println("P4wnP1 service initialized, stop with SIGTERM or SIGINT") - sig := make(chan os.Signal) - signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM) - s := <-sig - log.Printf("Signal (%v) received, ending P4wnP1_service ...\n", s) - state.StopService() - return -} diff --git a/USB_RPC.md b/USB_RPC.md deleted file mode 100644 index 84b9a0e..0000000 --- a/USB_RPC.md +++ /dev/null @@ -1,27 +0,0 @@ -# USB gadget RPC mechanincs - -- RPC server is in `service.go` -- RPC client with CLI is in `cli_client.go` - -## RPC server -- holds state of desired USB setting with name `settingsState` and type `proto.GadgetSettings` -- `settingsState` is initialized to the hard-coded default settings when the RPC server is started (init) and deployed to the kernel via config FS -- the active USB gadget has not the same setting as the state stored in `settingsState`, this is only the case on init, when the default settings are deployed -- `settingsState` is meant to store the desired settings, which are customized by the user via RPC calls, in order to deploy the settings, an additional RPC call is needed (`deploySettings`) - - the user can change a single or multiple USB gadget settings with a single RPC call from the cli_client - - for this purpose, the RPC call `SetGadgetSettings` is used, which has to provide a full `proto.GadgetSettings` struct - - the settings provided with `SetGadgetSettings` overwrite the settings stored in `settingsState` (RPC doesn't keep track of changed and unchanged settings) - - thus, in order to change only a part of the settings, the client has to retrieve current `settingsState` via the RPC call `GetGadgetSettings` modify the result to its needs and send it back with `SetGadgetSettings` - - once the client is done with changing settings (could be done with a single or multiple calls to `SetGadgetSettings`) he issues the RPC call `deploySettings` to deploy the settings (real active seetings and `settingsState` are the same again, if no error occures) -- `GetDeployedGadgetSetting` RPC call could be used to retrieve the real settings in use from the running gadget - -## Error handling -- the RPC server checks the settings to be valid after every call of `SetGadgetSettings`, if an error occures it is reported back and the `settingsState`isn't updated -- if `deploySettings` is called, the server stores the old settings of the gadgets, in case of an error it is reported back and the active gadget configuration, as well as the `settingsState`, are reverted to the stored configuration -- before Deploying new gadget settings, they are compared to the active ones, to avoid re-building of the composite gadget if it isn't needed -- the most likely reason to end up with invalid gadget settings is that too many USB gadgets functions are enabled simultaneously, as each function consumes one or more USB endpoints (there're only 7 EPs available) - -## Additional notes -- the reason for not directly applying changed gadget settings, is that the whole composite gadget is destroyed and brought up again for every change -- there're likely parameters which could be changed without destroying the gadget (like the image backing an USB Mass Storage), these parameters are handled differently -- Re-deployment of the USB gagdget with changed settings interrupts the workflow, for example USB-based network interfaces are shut down during re-deployment (even if they aren't affected by the changed settings) - this would interrupt running connections or listening server sockets diff --git a/cli_client/cmd_net.go b/cli_client/cmd_net.go index 6e5bd91..fef2ab6 100644 --- a/cli_client/cmd_net.go +++ b/cli_client/cmd_net.go @@ -7,9 +7,10 @@ import ( "errors" "fmt" "google.golang.org/grpc/status" - "github.com/mame82/P4wnP1_go/service" + //"github.com/mame82/P4wnP1_go/service" "strings" "strconv" + "github.com/mame82/P4wnP1_go/common" ) //Empty settings used to store cobra flags @@ -233,7 +234,7 @@ func createDHCPServerSettings(iface string, ip4 string, mask4 string, disabled b Enabled: !disabled, DhcpServerSettings: &pb.DHCPServerSettings{ ListenInterface:iface, - LeaseFile: service.NameLeaseFileDHCPSrv(iface), + LeaseFile: common.NameLeaseFileDHCPSrv(iface), CallbackScript: "", ListenPort: 0, //Disable DNS DoNotBindInterface: false, //only listen on given interface diff --git a/common/README.md b/common/README.md index e69de29..c0d0b3f 100644 --- a/common/README.md +++ b/common/README.md @@ -0,0 +1,6 @@ +# Common functionality used by "service" and "cli_client" + +The folder hold consts, data and functions, which are used by both, the cli_client and the service. +It should not hold functionality used by the webclient, in order to avoid using huge packages like "fmt". +Functionality shared with the web_client has to be stored in the folder "common_web". + \ No newline at end of file diff --git a/common/client_server.go b/common/client_server.go index 805d0c7..6c19c83 100644 --- a/common/client_server.go +++ b/common/client_server.go @@ -1 +1,11 @@ package common + +import "fmt" + +// File holds functions used by CLI client and P4wnP1 systemd service. Not to cross import the whole CLI/service +// package, is preferred over placing these functions in a contextual logic place. + +func NameLeaseFileDHCPSrv(nameIface string) (lf string) { + return fmt.Sprintf("/tmp/dnsmasq_%s.leases", nameIface) +} + diff --git a/common_web/EventConst.go b/common_web/EventConst.go index ac63be9..ad14719 100644 --- a/common_web/EventConst.go +++ b/common_web/EventConst.go @@ -1,4 +1,4 @@ -package common +package common_web const ( EVT_ANY = int64(0) diff --git a/common_web/README.md b/common_web/README.md index c0d0b3f..5788a81 100644 --- a/common_web/README.md +++ b/common_web/README.md @@ -1,6 +1,5 @@ # Common functionality used by "service" and "cli_client" -The folder hold consts, data and functions, which are used by both, the cli_client and the service. -It should not hold functionality used by the webclient, in order to avoid using huge packages like "fmt". -Functionality shared with the web_client has to be stored in the folder "common_web". +The folder hold consts, data and functions, which are used by the cli_client, the service AND/OR the web_service. +Using huge packages like "fmt" should not be used by functionality in this folder, in order to avoid importing it into the webclient. \ No newline at end of file diff --git a/HIDScripts/cosmouse.js b/dist/HIDScripts/cosmouse.js similarity index 100% rename from HIDScripts/cosmouse.js rename to dist/HIDScripts/cosmouse.js diff --git a/HIDScripts/hidtest1.js b/dist/HIDScripts/hidtest1.js similarity index 100% rename from HIDScripts/hidtest1.js rename to dist/HIDScripts/hidtest1.js diff --git a/HIDScripts/mousejiggle.js b/dist/HIDScripts/mousejiggle.js similarity index 100% rename from HIDScripts/mousejiggle.js rename to dist/HIDScripts/mousejiggle.js diff --git a/HIDScripts/ms_snake.js b/dist/HIDScripts/ms_snake.js similarity index 100% rename from HIDScripts/ms_snake.js rename to dist/HIDScripts/ms_snake.js diff --git a/HIDScripts/onattach.js b/dist/HIDScripts/onattach.js similarity index 100% rename from HIDScripts/onattach.js rename to dist/HIDScripts/onattach.js diff --git a/HIDScripts/sinmouse.js b/dist/HIDScripts/sinmouse.js similarity index 100% rename from HIDScripts/sinmouse.js rename to dist/HIDScripts/sinmouse.js diff --git a/HIDScripts/test1.js b/dist/HIDScripts/test1.js similarity index 100% rename from HIDScripts/test1.js rename to dist/HIDScripts/test1.js diff --git a/P4wnP1.service b/dist/P4wnP1.service similarity index 100% rename from P4wnP1.service rename to dist/P4wnP1.service diff --git a/keymaps/DE_ASCII.json b/dist/keymaps/DE_ASCII.json similarity index 100% rename from keymaps/DE_ASCII.json rename to dist/keymaps/DE_ASCII.json diff --git a/keymaps/US.json b/dist/keymaps/US.json similarity index 100% rename from keymaps/US.json rename to dist/keymaps/US.json diff --git a/keymaps/common.json b/dist/keymaps/common.json similarity index 100% rename from keymaps/common.json rename to dist/keymaps/common.json diff --git a/scripts/servicestart.sh b/dist/scripts/servicestart.sh similarity index 100% rename from scripts/servicestart.sh rename to dist/scripts/servicestart.sh diff --git a/www/README.md b/dist/www/README.md similarity index 100% rename from www/README.md rename to dist/www/README.md diff --git a/www/codemirror/.editorconfig b/dist/www/codemirror/.editorconfig similarity index 100% rename from www/codemirror/.editorconfig rename to dist/www/codemirror/.editorconfig diff --git a/www/codemirror/.gitattributes b/dist/www/codemirror/.gitattributes similarity index 100% rename from www/codemirror/.gitattributes rename to dist/www/codemirror/.gitattributes diff --git a/www/codemirror/.npmignore b/dist/www/codemirror/.npmignore similarity index 100% rename from www/codemirror/.npmignore rename to dist/www/codemirror/.npmignore diff --git a/www/codemirror/.travis.yml b/dist/www/codemirror/.travis.yml similarity index 100% rename from www/codemirror/.travis.yml rename to dist/www/codemirror/.travis.yml diff --git a/www/codemirror/AUTHORS b/dist/www/codemirror/AUTHORS similarity index 100% rename from www/codemirror/AUTHORS rename to dist/www/codemirror/AUTHORS diff --git a/www/codemirror/CHANGELOG.md b/dist/www/codemirror/CHANGELOG.md similarity index 100% rename from www/codemirror/CHANGELOG.md rename to dist/www/codemirror/CHANGELOG.md diff --git a/www/codemirror/CONTRIBUTING.md b/dist/www/codemirror/CONTRIBUTING.md similarity index 100% rename from www/codemirror/CONTRIBUTING.md rename to dist/www/codemirror/CONTRIBUTING.md diff --git a/www/codemirror/LICENSE b/dist/www/codemirror/LICENSE similarity index 100% rename from www/codemirror/LICENSE rename to dist/www/codemirror/LICENSE diff --git a/www/codemirror/README.md b/dist/www/codemirror/README.md similarity index 100% rename from www/codemirror/README.md rename to dist/www/codemirror/README.md diff --git a/www/codemirror/addon/comment/comment.js b/dist/www/codemirror/addon/comment/comment.js similarity index 100% rename from www/codemirror/addon/comment/comment.js rename to dist/www/codemirror/addon/comment/comment.js diff --git a/www/codemirror/addon/comment/continuecomment.js b/dist/www/codemirror/addon/comment/continuecomment.js similarity index 100% rename from www/codemirror/addon/comment/continuecomment.js rename to dist/www/codemirror/addon/comment/continuecomment.js diff --git a/www/codemirror/addon/dialog/dialog.css b/dist/www/codemirror/addon/dialog/dialog.css similarity index 100% rename from www/codemirror/addon/dialog/dialog.css rename to dist/www/codemirror/addon/dialog/dialog.css diff --git a/www/codemirror/addon/dialog/dialog.js b/dist/www/codemirror/addon/dialog/dialog.js similarity index 100% rename from www/codemirror/addon/dialog/dialog.js rename to dist/www/codemirror/addon/dialog/dialog.js diff --git a/www/codemirror/addon/display/autorefresh.js b/dist/www/codemirror/addon/display/autorefresh.js similarity index 100% rename from www/codemirror/addon/display/autorefresh.js rename to dist/www/codemirror/addon/display/autorefresh.js diff --git a/www/codemirror/addon/display/fullscreen.css b/dist/www/codemirror/addon/display/fullscreen.css similarity index 100% rename from www/codemirror/addon/display/fullscreen.css rename to dist/www/codemirror/addon/display/fullscreen.css diff --git a/www/codemirror/addon/display/fullscreen.js b/dist/www/codemirror/addon/display/fullscreen.js similarity index 100% rename from www/codemirror/addon/display/fullscreen.js rename to dist/www/codemirror/addon/display/fullscreen.js diff --git a/www/codemirror/addon/display/panel.js b/dist/www/codemirror/addon/display/panel.js similarity index 100% rename from www/codemirror/addon/display/panel.js rename to dist/www/codemirror/addon/display/panel.js diff --git a/www/codemirror/addon/display/placeholder.js b/dist/www/codemirror/addon/display/placeholder.js similarity index 100% rename from www/codemirror/addon/display/placeholder.js rename to dist/www/codemirror/addon/display/placeholder.js diff --git a/www/codemirror/addon/display/rulers.js b/dist/www/codemirror/addon/display/rulers.js similarity index 100% rename from www/codemirror/addon/display/rulers.js rename to dist/www/codemirror/addon/display/rulers.js diff --git a/www/codemirror/addon/edit/closebrackets.js b/dist/www/codemirror/addon/edit/closebrackets.js similarity index 100% rename from www/codemirror/addon/edit/closebrackets.js rename to dist/www/codemirror/addon/edit/closebrackets.js diff --git a/www/codemirror/addon/edit/closetag.js b/dist/www/codemirror/addon/edit/closetag.js similarity index 100% rename from www/codemirror/addon/edit/closetag.js rename to dist/www/codemirror/addon/edit/closetag.js diff --git a/www/codemirror/addon/edit/continuelist.js b/dist/www/codemirror/addon/edit/continuelist.js similarity index 100% rename from www/codemirror/addon/edit/continuelist.js rename to dist/www/codemirror/addon/edit/continuelist.js diff --git a/www/codemirror/addon/edit/matchbrackets.js b/dist/www/codemirror/addon/edit/matchbrackets.js similarity index 100% rename from www/codemirror/addon/edit/matchbrackets.js rename to dist/www/codemirror/addon/edit/matchbrackets.js diff --git a/www/codemirror/addon/edit/matchtags.js b/dist/www/codemirror/addon/edit/matchtags.js similarity index 100% rename from www/codemirror/addon/edit/matchtags.js rename to dist/www/codemirror/addon/edit/matchtags.js diff --git a/www/codemirror/addon/edit/trailingspace.js b/dist/www/codemirror/addon/edit/trailingspace.js similarity index 100% rename from www/codemirror/addon/edit/trailingspace.js rename to dist/www/codemirror/addon/edit/trailingspace.js diff --git a/www/codemirror/addon/fold/brace-fold.js b/dist/www/codemirror/addon/fold/brace-fold.js similarity index 100% rename from www/codemirror/addon/fold/brace-fold.js rename to dist/www/codemirror/addon/fold/brace-fold.js diff --git a/www/codemirror/addon/fold/comment-fold.js b/dist/www/codemirror/addon/fold/comment-fold.js similarity index 100% rename from www/codemirror/addon/fold/comment-fold.js rename to dist/www/codemirror/addon/fold/comment-fold.js diff --git a/www/codemirror/addon/fold/foldcode.js b/dist/www/codemirror/addon/fold/foldcode.js similarity index 100% rename from www/codemirror/addon/fold/foldcode.js rename to dist/www/codemirror/addon/fold/foldcode.js diff --git a/www/codemirror/addon/fold/foldgutter.css b/dist/www/codemirror/addon/fold/foldgutter.css similarity index 100% rename from www/codemirror/addon/fold/foldgutter.css rename to dist/www/codemirror/addon/fold/foldgutter.css diff --git a/www/codemirror/addon/fold/foldgutter.js b/dist/www/codemirror/addon/fold/foldgutter.js similarity index 100% rename from www/codemirror/addon/fold/foldgutter.js rename to dist/www/codemirror/addon/fold/foldgutter.js diff --git a/www/codemirror/addon/fold/indent-fold.js b/dist/www/codemirror/addon/fold/indent-fold.js similarity index 100% rename from www/codemirror/addon/fold/indent-fold.js rename to dist/www/codemirror/addon/fold/indent-fold.js diff --git a/www/codemirror/addon/fold/markdown-fold.js b/dist/www/codemirror/addon/fold/markdown-fold.js similarity index 100% rename from www/codemirror/addon/fold/markdown-fold.js rename to dist/www/codemirror/addon/fold/markdown-fold.js diff --git a/www/codemirror/addon/fold/xml-fold.js b/dist/www/codemirror/addon/fold/xml-fold.js similarity index 100% rename from www/codemirror/addon/fold/xml-fold.js rename to dist/www/codemirror/addon/fold/xml-fold.js diff --git a/www/codemirror/addon/hint/anyword-hint.js b/dist/www/codemirror/addon/hint/anyword-hint.js similarity index 100% rename from www/codemirror/addon/hint/anyword-hint.js rename to dist/www/codemirror/addon/hint/anyword-hint.js diff --git a/www/codemirror/addon/hint/css-hint.js b/dist/www/codemirror/addon/hint/css-hint.js similarity index 100% rename from www/codemirror/addon/hint/css-hint.js rename to dist/www/codemirror/addon/hint/css-hint.js diff --git a/www/codemirror/addon/hint/html-hint.js b/dist/www/codemirror/addon/hint/html-hint.js similarity index 100% rename from www/codemirror/addon/hint/html-hint.js rename to dist/www/codemirror/addon/hint/html-hint.js diff --git a/www/codemirror/addon/hint/javascript-hint.js b/dist/www/codemirror/addon/hint/javascript-hint.js similarity index 100% rename from www/codemirror/addon/hint/javascript-hint.js rename to dist/www/codemirror/addon/hint/javascript-hint.js diff --git a/www/codemirror/addon/hint/show-hint.css b/dist/www/codemirror/addon/hint/show-hint.css similarity index 100% rename from www/codemirror/addon/hint/show-hint.css rename to dist/www/codemirror/addon/hint/show-hint.css diff --git a/www/codemirror/addon/hint/show-hint.js b/dist/www/codemirror/addon/hint/show-hint.js similarity index 100% rename from www/codemirror/addon/hint/show-hint.js rename to dist/www/codemirror/addon/hint/show-hint.js diff --git a/www/codemirror/addon/hint/sql-hint.js b/dist/www/codemirror/addon/hint/sql-hint.js similarity index 100% rename from www/codemirror/addon/hint/sql-hint.js rename to dist/www/codemirror/addon/hint/sql-hint.js diff --git a/www/codemirror/addon/hint/xml-hint.js b/dist/www/codemirror/addon/hint/xml-hint.js similarity index 100% rename from www/codemirror/addon/hint/xml-hint.js rename to dist/www/codemirror/addon/hint/xml-hint.js diff --git a/www/codemirror/addon/lint/coffeescript-lint.js b/dist/www/codemirror/addon/lint/coffeescript-lint.js similarity index 100% rename from www/codemirror/addon/lint/coffeescript-lint.js rename to dist/www/codemirror/addon/lint/coffeescript-lint.js diff --git a/www/codemirror/addon/lint/css-lint.js b/dist/www/codemirror/addon/lint/css-lint.js similarity index 100% rename from www/codemirror/addon/lint/css-lint.js rename to dist/www/codemirror/addon/lint/css-lint.js diff --git a/www/codemirror/addon/lint/html-lint.js b/dist/www/codemirror/addon/lint/html-lint.js similarity index 100% rename from www/codemirror/addon/lint/html-lint.js rename to dist/www/codemirror/addon/lint/html-lint.js diff --git a/www/codemirror/addon/lint/javascript-lint.js b/dist/www/codemirror/addon/lint/javascript-lint.js similarity index 100% rename from www/codemirror/addon/lint/javascript-lint.js rename to dist/www/codemirror/addon/lint/javascript-lint.js diff --git a/www/codemirror/addon/lint/json-lint.js b/dist/www/codemirror/addon/lint/json-lint.js similarity index 100% rename from www/codemirror/addon/lint/json-lint.js rename to dist/www/codemirror/addon/lint/json-lint.js diff --git a/www/codemirror/addon/lint/lint.css b/dist/www/codemirror/addon/lint/lint.css similarity index 100% rename from www/codemirror/addon/lint/lint.css rename to dist/www/codemirror/addon/lint/lint.css diff --git a/www/codemirror/addon/lint/lint.js b/dist/www/codemirror/addon/lint/lint.js similarity index 100% rename from www/codemirror/addon/lint/lint.js rename to dist/www/codemirror/addon/lint/lint.js diff --git a/www/codemirror/addon/lint/yaml-lint.js b/dist/www/codemirror/addon/lint/yaml-lint.js similarity index 100% rename from www/codemirror/addon/lint/yaml-lint.js rename to dist/www/codemirror/addon/lint/yaml-lint.js diff --git a/www/codemirror/addon/merge/merge.css b/dist/www/codemirror/addon/merge/merge.css similarity index 100% rename from www/codemirror/addon/merge/merge.css rename to dist/www/codemirror/addon/merge/merge.css diff --git a/www/codemirror/addon/merge/merge.js b/dist/www/codemirror/addon/merge/merge.js similarity index 100% rename from www/codemirror/addon/merge/merge.js rename to dist/www/codemirror/addon/merge/merge.js diff --git a/www/codemirror/addon/mode/loadmode.js b/dist/www/codemirror/addon/mode/loadmode.js similarity index 100% rename from www/codemirror/addon/mode/loadmode.js rename to dist/www/codemirror/addon/mode/loadmode.js diff --git a/www/codemirror/addon/mode/multiplex.js b/dist/www/codemirror/addon/mode/multiplex.js similarity index 100% rename from www/codemirror/addon/mode/multiplex.js rename to dist/www/codemirror/addon/mode/multiplex.js diff --git a/www/codemirror/addon/mode/multiplex_test.js b/dist/www/codemirror/addon/mode/multiplex_test.js similarity index 100% rename from www/codemirror/addon/mode/multiplex_test.js rename to dist/www/codemirror/addon/mode/multiplex_test.js diff --git a/www/codemirror/addon/mode/overlay.js b/dist/www/codemirror/addon/mode/overlay.js similarity index 100% rename from www/codemirror/addon/mode/overlay.js rename to dist/www/codemirror/addon/mode/overlay.js diff --git a/www/codemirror/addon/mode/simple.js b/dist/www/codemirror/addon/mode/simple.js similarity index 100% rename from www/codemirror/addon/mode/simple.js rename to dist/www/codemirror/addon/mode/simple.js diff --git a/www/codemirror/addon/runmode/colorize.js b/dist/www/codemirror/addon/runmode/colorize.js similarity index 100% rename from www/codemirror/addon/runmode/colorize.js rename to dist/www/codemirror/addon/runmode/colorize.js diff --git a/www/codemirror/addon/runmode/runmode-standalone.js b/dist/www/codemirror/addon/runmode/runmode-standalone.js similarity index 100% rename from www/codemirror/addon/runmode/runmode-standalone.js rename to dist/www/codemirror/addon/runmode/runmode-standalone.js diff --git a/www/codemirror/addon/runmode/runmode.js b/dist/www/codemirror/addon/runmode/runmode.js similarity index 100% rename from www/codemirror/addon/runmode/runmode.js rename to dist/www/codemirror/addon/runmode/runmode.js diff --git a/www/codemirror/addon/runmode/runmode.node.js b/dist/www/codemirror/addon/runmode/runmode.node.js similarity index 100% rename from www/codemirror/addon/runmode/runmode.node.js rename to dist/www/codemirror/addon/runmode/runmode.node.js diff --git a/www/codemirror/addon/scroll/annotatescrollbar.js b/dist/www/codemirror/addon/scroll/annotatescrollbar.js similarity index 100% rename from www/codemirror/addon/scroll/annotatescrollbar.js rename to dist/www/codemirror/addon/scroll/annotatescrollbar.js diff --git a/www/codemirror/addon/scroll/scrollpastend.js b/dist/www/codemirror/addon/scroll/scrollpastend.js similarity index 100% rename from www/codemirror/addon/scroll/scrollpastend.js rename to dist/www/codemirror/addon/scroll/scrollpastend.js diff --git a/www/codemirror/addon/scroll/simplescrollbars.css b/dist/www/codemirror/addon/scroll/simplescrollbars.css similarity index 100% rename from www/codemirror/addon/scroll/simplescrollbars.css rename to dist/www/codemirror/addon/scroll/simplescrollbars.css diff --git a/www/codemirror/addon/scroll/simplescrollbars.js b/dist/www/codemirror/addon/scroll/simplescrollbars.js similarity index 100% rename from www/codemirror/addon/scroll/simplescrollbars.js rename to dist/www/codemirror/addon/scroll/simplescrollbars.js diff --git a/www/codemirror/addon/search/jump-to-line.js b/dist/www/codemirror/addon/search/jump-to-line.js similarity index 100% rename from www/codemirror/addon/search/jump-to-line.js rename to dist/www/codemirror/addon/search/jump-to-line.js diff --git a/www/codemirror/addon/search/match-highlighter.js b/dist/www/codemirror/addon/search/match-highlighter.js similarity index 100% rename from www/codemirror/addon/search/match-highlighter.js rename to dist/www/codemirror/addon/search/match-highlighter.js diff --git a/www/codemirror/addon/search/matchesonscrollbar.css b/dist/www/codemirror/addon/search/matchesonscrollbar.css similarity index 100% rename from www/codemirror/addon/search/matchesonscrollbar.css rename to dist/www/codemirror/addon/search/matchesonscrollbar.css diff --git a/www/codemirror/addon/search/matchesonscrollbar.js b/dist/www/codemirror/addon/search/matchesonscrollbar.js similarity index 100% rename from www/codemirror/addon/search/matchesonscrollbar.js rename to dist/www/codemirror/addon/search/matchesonscrollbar.js diff --git a/www/codemirror/addon/search/search.js b/dist/www/codemirror/addon/search/search.js similarity index 100% rename from www/codemirror/addon/search/search.js rename to dist/www/codemirror/addon/search/search.js diff --git a/www/codemirror/addon/search/searchcursor.js b/dist/www/codemirror/addon/search/searchcursor.js similarity index 100% rename from www/codemirror/addon/search/searchcursor.js rename to dist/www/codemirror/addon/search/searchcursor.js diff --git a/www/codemirror/addon/selection/active-line.js b/dist/www/codemirror/addon/selection/active-line.js similarity index 100% rename from www/codemirror/addon/selection/active-line.js rename to dist/www/codemirror/addon/selection/active-line.js diff --git a/www/codemirror/addon/selection/mark-selection.js b/dist/www/codemirror/addon/selection/mark-selection.js similarity index 100% rename from www/codemirror/addon/selection/mark-selection.js rename to dist/www/codemirror/addon/selection/mark-selection.js diff --git a/www/codemirror/addon/selection/selection-pointer.js b/dist/www/codemirror/addon/selection/selection-pointer.js similarity index 100% rename from www/codemirror/addon/selection/selection-pointer.js rename to dist/www/codemirror/addon/selection/selection-pointer.js diff --git a/www/codemirror/addon/tern/tern.css b/dist/www/codemirror/addon/tern/tern.css similarity index 100% rename from www/codemirror/addon/tern/tern.css rename to dist/www/codemirror/addon/tern/tern.css diff --git a/www/codemirror/addon/tern/tern.js b/dist/www/codemirror/addon/tern/tern.js similarity index 100% rename from www/codemirror/addon/tern/tern.js rename to dist/www/codemirror/addon/tern/tern.js diff --git a/www/codemirror/addon/tern/worker.js b/dist/www/codemirror/addon/tern/worker.js similarity index 100% rename from www/codemirror/addon/tern/worker.js rename to dist/www/codemirror/addon/tern/worker.js diff --git a/www/codemirror/addon/wrap/hardwrap.js b/dist/www/codemirror/addon/wrap/hardwrap.js similarity index 100% rename from www/codemirror/addon/wrap/hardwrap.js rename to dist/www/codemirror/addon/wrap/hardwrap.js diff --git a/www/codemirror/bin/authors.sh b/dist/www/codemirror/bin/authors.sh similarity index 100% rename from www/codemirror/bin/authors.sh rename to dist/www/codemirror/bin/authors.sh diff --git a/www/codemirror/bin/lint b/dist/www/codemirror/bin/lint similarity index 100% rename from www/codemirror/bin/lint rename to dist/www/codemirror/bin/lint diff --git a/www/codemirror/bin/release b/dist/www/codemirror/bin/release similarity index 100% rename from www/codemirror/bin/release rename to dist/www/codemirror/bin/release diff --git a/www/codemirror/bin/source-highlight b/dist/www/codemirror/bin/source-highlight similarity index 100% rename from www/codemirror/bin/source-highlight rename to dist/www/codemirror/bin/source-highlight diff --git a/www/codemirror/bin/upload-release.js b/dist/www/codemirror/bin/upload-release.js similarity index 100% rename from www/codemirror/bin/upload-release.js rename to dist/www/codemirror/bin/upload-release.js diff --git a/www/codemirror/demo/activeline.html b/dist/www/codemirror/demo/activeline.html similarity index 100% rename from www/codemirror/demo/activeline.html rename to dist/www/codemirror/demo/activeline.html diff --git a/www/codemirror/demo/anywordhint.html b/dist/www/codemirror/demo/anywordhint.html similarity index 100% rename from www/codemirror/demo/anywordhint.html rename to dist/www/codemirror/demo/anywordhint.html diff --git a/www/codemirror/demo/bidi.html b/dist/www/codemirror/demo/bidi.html similarity index 98% rename from www/codemirror/demo/bidi.html rename to dist/www/codemirror/demo/bidi.html index 645e648..e3d5684 100644 --- a/www/codemirror/demo/bidi.html +++ b/dist/www/codemirror/demo/bidi.html @@ -47,7 +47,7 @@
theme (string)
.cm-s-[name]
يتم تحميل أنماط (انظر
- theme
الدليل في التوزيع).
+ theme
الدليل في التوزيع).
الافتراضي هو "default"
، والتي تم تضمينها في
الألوان codemirror.css
. فمن الممكن استخدام فئات متعددة
في تطبيق السمات مرة واحدة على سبيل المثال "foo bar"
diff --git a/www/codemirror/demo/btree.html b/dist/www/codemirror/demo/btree.html
similarity index 100%
rename from www/codemirror/demo/btree.html
rename to dist/www/codemirror/demo/btree.html
diff --git a/www/codemirror/demo/buffers.html b/dist/www/codemirror/demo/buffers.html
similarity index 100%
rename from www/codemirror/demo/buffers.html
rename to dist/www/codemirror/demo/buffers.html
diff --git a/www/codemirror/demo/changemode.html b/dist/www/codemirror/demo/changemode.html
similarity index 100%
rename from www/codemirror/demo/changemode.html
rename to dist/www/codemirror/demo/changemode.html
diff --git a/www/codemirror/demo/closebrackets.html b/dist/www/codemirror/demo/closebrackets.html
similarity index 100%
rename from www/codemirror/demo/closebrackets.html
rename to dist/www/codemirror/demo/closebrackets.html
diff --git a/www/codemirror/demo/closetag.html b/dist/www/codemirror/demo/closetag.html
similarity index 100%
rename from www/codemirror/demo/closetag.html
rename to dist/www/codemirror/demo/closetag.html
diff --git a/www/codemirror/demo/complete.html b/dist/www/codemirror/demo/complete.html
similarity index 100%
rename from www/codemirror/demo/complete.html
rename to dist/www/codemirror/demo/complete.html
diff --git a/www/codemirror/demo/emacs.html b/dist/www/codemirror/demo/emacs.html
similarity index 100%
rename from www/codemirror/demo/emacs.html
rename to dist/www/codemirror/demo/emacs.html
diff --git a/www/codemirror/demo/folding.html b/dist/www/codemirror/demo/folding.html
similarity index 100%
rename from www/codemirror/demo/folding.html
rename to dist/www/codemirror/demo/folding.html
diff --git a/www/codemirror/demo/fullscreen.html b/dist/www/codemirror/demo/fullscreen.html
similarity index 100%
rename from www/codemirror/demo/fullscreen.html
rename to dist/www/codemirror/demo/fullscreen.html
diff --git a/www/codemirror/demo/hardwrap.html b/dist/www/codemirror/demo/hardwrap.html
similarity index 100%
rename from www/codemirror/demo/hardwrap.html
rename to dist/www/codemirror/demo/hardwrap.html
diff --git a/www/codemirror/demo/html5complete.html b/dist/www/codemirror/demo/html5complete.html
similarity index 100%
rename from www/codemirror/demo/html5complete.html
rename to dist/www/codemirror/demo/html5complete.html
diff --git a/www/codemirror/demo/indentwrap.html b/dist/www/codemirror/demo/indentwrap.html
similarity index 93%
rename from www/codemirror/demo/indentwrap.html
rename to dist/www/codemirror/demo/indentwrap.html
index 3d3d0af..fd3ee43 100644
--- a/www/codemirror/demo/indentwrap.html
+++ b/dist/www/codemirror/demo/indentwrap.html
@@ -33,7 +33,7 @@
CodeMirror is a code-editor component that can be embedded in Web pages. The core library provides only the editor component, no accompanying buttons, auto-completion, or other IDE functionality. It does provide a rich API on top of which such functionality can be straightforwardly implemented. See the add-ons included in the distribution, and the CodeMirror UI project, for reusable implementations of extra features.
-CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the mode/
directory), and it isn't hard to write new ones for other languages.
CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the mode/
directory), and it isn't hard to write new ones for other languages.