Permalink
Browse files

initializing with content

  • Loading branch information...
1 parent 5cb2d7b commit 612e10218197718150ea7f0d7f0e4d5406f78d4f @aclement aclement committed Oct 10, 2012
Showing 2,284 changed files with 315,812 additions and 3 deletions.
View
@@ -0,0 +1,4 @@
+/npm-debug.log
+*~
+.DS_Store
+scripted.log
View
@@ -0,0 +1,94 @@
+/*
+
+ FORMATTER OPTIONS:
+
+ indent_size (default 4) ? indentation size,
+ indent_char (default space) ? character to indent with,
+ preserve_newlines (default true) ? whether existing line breaks should be preserved,
+ preserve_max_newlines (default unlimited) ? maximum number of line breaks to be preserved in one chunk,
+
+ jslint_happy (default false) ? if true, then jslint-stricter mode is enforced.
+
+ jslint_happy !jslint_happy
+ ---------------------------------
+ function () function()
+
+ brace_style (default "collapse") ? "collapse" | "expand" | "end-expand" | "expand-strict"
+ put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
+
+ expand-strict: put brace on own line even in such cases:
+
+ var a =
+ {
+ a: 5,
+ b: 6
+ }
+ This mode may break your scripts - e.g "return { a: 1 }" will be broken into two lines, so beware.
+
+ space_before_conditional (default true) ? should the space before conditional statement be added, "if(true)" vs "if (true)",
+
+ unescape_strings (default false) ? should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
+
+
+
+ CONFIGURATION OPTION EXAMPLES:
+
+ "formatter": {
+ "js": {
+ "indent_size": 1,
+ "indent_char": "\t"
+ }
+ },
+ "ui": {
+ "font":"Ubuntu Mono",
+ "font_size":18,
+ "content_assist_font_size":14,
+ "navigator": false
+ }
+
+ EXEC configuration examples:
+
+ "exec": {
+ "onKeys" : {
+ "ctrl+alt+b": {
+ "cmd": "ls -la",
+ "cwd": "${dir}",
+ "name": "ls current dir"
+ },
+ "ctrl+alt+shift+b": "ls -la",
+ "ctrl+alt+shift+x": "this command is very long and should be too long for a name",
+ "ctrl+alt+shift+y": "this command is very long and should be too long for a name like this",
+ "ctrl+alt+shift+c": "javac ${file}"
+ },
+ "afterSave" : {
+ "** / *.js": "cat ${file}", //!!!Spaces arround the / should be removed!!!
+ ".rigel": "echo Thank you for saving me!",
+ "** / .rigel": "echo ${file}" //!!!Spaces arround the / should be removed!!!
+ },
+ "onLoad" : [
+ "echo Loading ${projectDir}",
+ { "cmd": "ls -la",
+ "cwd": "${projectDir}/client"
+ }
+ ]
+ }
+
+ "exec": {
+ "onKeys" : {
+ "ctrl+alt+c": "node releng/copycheck.js"
+ }
+ },
+ "formatter": {
+ "js": {
+ "indent_size": 1,
+ "indent_char": "\t"
+ }
+ }
+{
+ "ui": {
+ "font": "Monaco"
+ }
+ }
+*/
+{
+}
View
@@ -1,4 +1,150 @@
-scripted
-========
+# Welcome to Scripted
-The Scripted code editor
+## What is Scripted?
+
+Scripted is a fast and lightweight code editor with an initial focus on JavaScript editing.
+Scripted is a browser based editor and the editor itself is served from a locally running Node.js
+server instance.
+
+<center>
+<img src="http://dist.springsource.org/release/SCRIPTED/screenshot2.png" width="736" height="451"/>
+</center>
+
+What are the key features?
+
+- Fast startup, lightweight.
+- Syntax highlighting for JavaScript, HTML and CSS.
+- Errors and warnings:
+ - JSLint is integrated to provide error/warning markers on JavaScript code.
+ - AMD and CommonJS module resolution: there is basic resolution where unresolved references will be marked as errors.
+- Content assist:
+ - Basic content assist for HTML, CSS
+ - For JavaScript, content assist is driven by a type inferencing engine which is aware of AMD/CommonJS module
+dependencies and also uses JSDoc comments to help it understand the code.
+- Hovers: hovering over a JavaScript identifier will bring up the inferred type signature.
+- Navigation:
+ - press F8 on an identifier (that the inferencer has recognized) and the editor will navigate to the declaration.
+ - this also works on module identifiers (e.g. in `define()` clauses)
+- Formatting: JSbeautify is integrated
+- Sidepanel: alongside the main editor a sidepanel can be opened - currently this can be used to host a second editor.
+- Key binding to external command: Key bindings in the editor can invoke external commands (less, mvn, etc)
+
+The editor is actually the [Eclipse Orion](http://www.eclipse.org/orion/) editor with a few additional bells and whistles.
+Anyone familiar with editing in Eclipse will immediately know many of the key bindings
+the Scripted editor supports.
+
+Many of these are covered in this introductory screencast:<br>
+<a href="http://dist.springsource.org/release/SCRIPTED/Scripted2.mov"><img align="center" src="http://dist.springsource.org/release/SCRIPTED/posterScripted2.png" width="428" height="263"/></a>
+
+# How do I try it out?
+
+The only pre-req for trying it out is that you have Node.js installed. Grab it from here: [http://nodejs.org/](http://nodejs.org).
+The team has been testing with recent versions from 0.6 to 0.8.
+
+Then you can grab the most recent packaged release from here:
+
+[Version 0.2.0](http://dist.springsource.org/release/SCRIPTED/scripted_v0.2.0.zip)
+
+OR you can live on the bleeding edge by either cloning the repository:
+
+ git clone https://github.com/scripted-editor/scripted
+
+or grabbing the latest repo contents as a zip:
+
+ https://github.com/scripted-editor/scripted/zipball/master
+
+Unpack whatever you have and then make sure the files in the bin folder are executable on mac/linux:
+
+ chmod 755 bin/*
+
+Then add the bin folder to your path:
+
+Mac/Linux:
+
+ export PATH=<pathToUnzipLocationOrClone>/bin:$PATH
+
+Win:
+
+ set PATH=<pathToUnzipLocationOrClone>\bin;%PATH%
+
+then launch it:
+
+ scr myfile.js
+
+(you can use `scripted` to launch it if you'd prefer to type more characters...)
+
+When working with Scripted, think about it like using `vi`/`emacs`. From wherever you are in your terminal window you
+can launch Scripted and start editing a file.
+
+Launching scripted will cause the Node.js server to start in the background.
+
+Here are some of the more vital key bindings to use once the editor is open:
+
+- `Cmd/Ctrl+h` - open help to show all key bindings (or press '?' in the top right)
+- `Cmd/Ctrl+s` - save!
+- `Cmd/Ctrl+Shift+E` - open/close subeditor
+- `Cmd/Ctrl+Shift+F` - open Find File dialog. Inside the dialog, you can search for files in the project by regular expression and:
+ - `Click` a result to open it in main editor
+ - `Shift+Click` a result to open it in sub-editor
+ - `Cmd/Ctrl+Click` a result to open it in a new tab
+- `Cmd/Ctrl+Shift+o` - open outline view. A dialog will present the functions and you can quickly navigate to them
+- `Cmd/Ctrl+F` - in-file search
+- `Ctrl+Space` - content assist
+- `F8` - navigate to declaration
+- `Shift+F8` - open declaration in subeditor
+- `Cmd/Ctrl+F8` - navigate to declaration in new tab
+- `Alt+Shift+F` - format
+
+On the left hand side is a traditional navigator for opening different files. Above the editor is a breadcrumb, hover over a component to see other files in that directory.
+
+The editor does support a degree of customization, see the section on the [Features](https://github.com/scripted-editor/scripted/wiki/Features) page.
+
+Scripted receives most testing in Chrome and Firefox, you may need one of those browsers in order to get the most out of it.
+
+# Anything else I need to know before using it?
+
+When you open Scripted on a file, it will attempt to infer the root of your project by locating the nearest `.git`/`.project` file
+in the hierarchy. Knowing the root is important because that is the scope in which searching and dependency analysis is done. If
+you don't have one of these markers for the root, you can create an empty `.scripted` file to indicate the root.
+
+# Current status
+
+As of Oct 2012 the project is at version 0.2. There is a long way to go but the team have been using Scripted to develop Scripted for a while now.
+
+# Further reading
+
+- [Features](https://github.com/scripted-editor/scripted/wiki/Features)
+- [FAQ](https://github.com/scripted-editor/scripted/wiki/FAQ)
+- [Troubleshooting](https://github.com/scripted-editor/scripted/wiki/FAQ#wiki-Troubleshooting)
+- [Architecture](https://github.com/scripted-editor/scripted/wiki/Architecture)
+
+# Where can I ask questions, provide feedback or raise issues?
+
+- The [scripted-dev google group](https://groups.google.com/forum/#!forum/scripted-dev) is open for questions and discussion
+- The [issuetracker](https://issuetracker.springsource.com/browse/scripted) to raise issues or take a look and vote on existing issues.
+
+# What's next for Scripted?
+
+- Even smarter inferencing, leading to better content assist and easier navigation.
+- More panes for the side panel. Currently there is just an editor pane but we intend to include search results panes,
+documentation, git information panes, perhaps code preview and simulated code execution panes. The intention will be
+for Scripted to try and automatically manage these where possible, so all the content on screen is kept relevant
+to the task at hand.
+- Simple plugin system.
+- Debugging. Exploring integration with tools like Chrome Dev Tools and node inspector.
+
+If you have more ideas for what you'd like to see, let us know via [Jira](https://issuetracker.springsource.com/browse/scripted) or
+our [scripted-dev](https://groups.google.com/forum/#!forum/scripted-dev) group.
+
+# Can I contribute?
+
+Sure! Just press *Fork* at the top of this github page and get coding. Before we accept pull requests we just need you to sign a simple contributor's
+agreement - which you can find [here](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
+Pull requests should ideally reference a JIRA ticket in the [issuetracker](https://issuetracker.springsource.com/browse/SCRIPTED) that details what the request is addressing.
+
+The codebase is entirely JavaScript/HTML/CSS.
+
+If you are keen to contribute but aren't sure what to work on, take a look at the [public issuetracker](https://issuetracker.springsource.com/browse/SCRIPTED) for inspiration.
+The codebase is very new in places and isn't that tricky to get to grips with. Some of the simpler issues that might provide an easy way to get started with the codebase are tagged with the label help-wanted, see [here](https://issuetracker.springsource.com/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+SCRIPTED+AND+labels+%3D+help-wanted+AND+status+in+%28Open%2C+%22In+Progress%22%2C+Reopened%29+ORDER+BY+key+ASC%2C+priority+DESC).
+
+If you don't feel like coding but still want to contribute, please join the discussion on the issuetracker and scripted-dev group.
View
@@ -0,0 +1,35 @@
+@echo off
+setlocal enableDelayedExpansion
+
+set thisdir=%~dp0
+pushd..
+cd %thisdir%..
+set rootdir=%cd%
+popd
+
+rem taskkill /F /IM "node.exe" > killed.log 2>&1
+
+echo =================================================== >> scripted.log
+echo launching node again: %DATE% %TIME% >> scripted.log
+
+set arg=%1
+set identifiers=%arg:~1,2%
+
+IF %identifiers% EQU :\ (
+set patharg=%1
+) ELSE (
+set patharg=%cd%\%1
+)
+
+set patharg=%patharg:\=/%
+set "patharg=!patharg: =%%20!"
+
+echo Starting scripted.js... >> scripted.log
+
+start node-inspector &
+
+start /MIN cmd /c node --debug-brk %rootdir%\server\scripted.js^>^>scripted.log
+
+start http://127.0.0.1:8080/debug?port=5858
+
+start http://localhost:7261/editor.html?%patharg%
View
@@ -0,0 +1,43 @@
+#!/bin/bash
+# Launch script for scripted, intended to be uses as an 'Open With' application for gnome.
+# It differs from the regular scripted script in that we assume gnome will always pass
+# an absolute file reference to the file that is to be opened.
+
+# Does the following:
+# 1. locate any existing running node (big assumption that 'node app.js' is the node app we want)
+# 2. Kills it
+# 3. Calls 'launchnode' to start a new node
+# 4. Opens a URL that loads the editor - the url encodes the file we want to edit
+
+pid=`ps axu | grep "node app.js" | grep -v grep | awk '{print $2}'`
+#echo $pid
+
+DIRNAME=`dirname "$0"`
+CHROME=/opt/google/chrome/chrome
+
+if [ ! -z "$pid" ]
+then
+# echo "killing node"
+ kill -9 $pid
+fi
+echo "===" >> $DIRNAME/../scripted.log
+echo "launching node again: `date`" >> $DIRNAME/../scripted.log
+$DIRNAME/launchnode >> $DIRNAME/../scripted.log 2>&1 &
+
+file="$1"
+URL=http://localhost:7261/editor.html?$file
+
+sleep 0.10
+echo "opening $file"
+if [ -f $CHROME ]; then
+ $CHROME $URL
+elif which gnome-open > /dev/null; then
+ gnome-open $URL
+elif which xdg-open > /dev/null; then
+ xdg-open $URL
+elif which open > /dev/null; then
+ open $URL
+else
+ echo "Could not detect the web browser to use."
+fi
+
View
@@ -0,0 +1,10 @@
+pid=`ps axu | grep "node scripted.js" | grep -v grep | awk '{print $2}'`
+echo $pid
+
+DIRNAME=`dirname "$0"`
+
+if [ ! -z "$pid" ]
+then
+ echo "Killing $pid"
+ kill -9 $pid
+fi
View
@@ -0,0 +1,4 @@
+# Node launch script
+DIRNAME=`dirname "$0"`
+cd $DIRNAME/../server
+node scripted.js
View
@@ -0,0 +1,8 @@
+#!/bin/bash
+killserver
+
+DIRNAME=`dirname "$0"`
+echo "===" >> $DIRNAME/../scripted.log
+echo "launching node again: `date`" >> $DIRNAME/../scripted.log
+$DIRNAME/launchnode >> $DIRNAME/../scripted.log 2>&1 &
+exit 0
Oops, something went wrong.

0 comments on commit 612e102

Please sign in to comment.