Skip to content

Commit

Permalink
merging from envjs trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
moschel committed Sep 23, 2010
2 parents 43e9b1a + 419d08a commit ec17667
Show file tree
Hide file tree
Showing 358 changed files with 37,167 additions and 10,542 deletions.
20 changes: 15 additions & 5 deletions .gitignore
@@ -1,12 +1,22 @@
dist/env.*.*.*.js
dist/env.rhino.*.*.*.js
dist/env-js.*.jar
dist/*
*~
rhino/build
jshost
htmlparser/gwt*
htmlparser/gwt-*
htmlparser/html5
htmlparser/build

htmlparser/gwt2/htmlparser-*
htmlparser/gwt2/gwt-*
htmlparser/gwt2/war
htmlparser/gwt2/*/*/*/*/*/*.class

local_settings.js
java_pid*
dist

# gpsee compiled js files
*.jsc

# emacs turds
\#*

6 changes: 6 additions & 0 deletions .project
Expand Up @@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.rubypeople.rdt.core.rubybuilder</name>
<arguments>
Expand All @@ -13,5 +18,6 @@
</buildSpec>
<natures>
<nature>org.rubypeople.rdt.core.rubynature</nature>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
51 changes: 27 additions & 24 deletions README
Expand Up @@ -16,15 +16,16 @@ http://groups.google.com/group/envjs
Lighthouse (Bug Tracking):
http://envjs.lighthouseapp.com/

Build Status:
http://runcoderun.com/thatcher/env-js

Original blog post:
http://ejohn.org/projects/bringing-the-browser-to-the-server/

Rhino (Java-based JavaScript engine)
http://www.mozilla.org/rhino/

= Guides and Apis =
http://www.envjs.com/doc/guides
http://www.envjs.com/doc/apis

Getting the code:

* Check the code out from git: git clone git://github.com/thatcher/env-js.git
Expand Down Expand Up @@ -83,12 +84,12 @@ Getting the code:

== contributing tests with patches ==

Each module has a spec in env-js/test/spec. Most tests will run whether you
Each module has a spec in env-js/specs. Most tests will run whether you
load them in the file:, http:, or https:, though once you get to xhr.js
the tests will fail for the 'file:' protocol in firefox because of
permissions. To run xhr.js and window.js specs, copy settings.js to
local_settings.js and run a local server to satisfy those urls included in
the spec.js;
local_settings.js, update it, and run a local server to satisfy
those urls included in the spec.js;


== platforms ==
Expand All @@ -98,51 +99,53 @@ Getting the code:
or as a github plugin.

Installing:
0) common usage - all you need is env.rhino.js and rhino js.jar
java -jar js.jar -opt -1 myscript.js

1) Include the proper env.js file for your platform.
load('env.rhino.js'); //if in a Rhino script

2) Tell env.js to load an HTML file from your file system that it should model:
Envjs("some/file.html");
or

var someWindow = window.open("some/file.html");
or
window.location = "some/file.html";

Optionally you can turn on/off settings by passing an options object:
Envjs("some/file.html", {log: function(msg){ console.debug(msg) }});
Envjs({
scriptTypes: {
"": true,
"text/javascript": true
}
});

3) Optionally trigger "document ready" events in one of these ways:

4) Start processing of window(s)' event queue:
Envjs.wait();

All together, the steps could be:

a) simplest method:
load('env.rhino.js');
Envjs("some/file.html");
Envjs.wait();
window.location = "some/file.html";

b) jQuery ready method:
load('env.rhino.js');
load('jquery-1.3.2.js');
Envjs("some/file.html");
load('jquery.js');
window.location = "some/file.html";
load('some-code-that-sets-up-jquery-onready-behaviors.js')
jQuery.ready();
Envjs.wait();

c) Other JavaScript frameworks have their own methods of setup, but the general pattern is:
// step 1: load env.js
// optionally: load your framework(s)
// step 2: tell env.js the base DOM to model
// optionally: run any setup code for your framework(s0
// optionally: run any setup code for your framework
// step 3: tell the framework that the document is loaded
// step 4: Envjs.wait();

Note that env.js is currently limited to loading a single HTML page
from the original window. If you are going to load multiple pages in
succession into the same window, load the first into a new window
object using window.open().
Note:
The window object can be re-used, for example when crawling

window.location = "http://www.envjs.com/";
window.location = "http://www.envjs.com/news";

Testing jQuery Compatibility:
* run ./bin/test-jquery.sh #runs 1.4.1 by default
Expand All @@ -159,7 +162,7 @@ Testing jQuery Compatibility:
organize the code into more independent areas, provide behavior driven testing
with tests that run on firefox for each module and it's dependencies.

Java command line:
Java command line in 1.1:

env.rhino.js can be run either with a "generic" version of the Rhino
library (js.jar), or with the repackaged/extended version of Rhino
Expand Down
4 changes: 4 additions & 0 deletions WEB-INF/appengine-web.xml
@@ -0,0 +1,4 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>envjs</application>
<version>3</version>
</appengine-web-app>
12 changes: 12 additions & 0 deletions WEB-INF/web.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


<welcome-file-list>
<welcome-file>README</welcome-file>
</welcome-file-list>

</web-app>
2 changes: 1 addition & 1 deletion bin/test-jquery.js
@@ -1,6 +1,6 @@
//debugger;
load("dist/env.rhino.js");
load("plugins/qunit.env.js");
load("plugins/env.qunit.js");

//yup its that easy
window.location = 'test/vendor/jQuery/'+arguments[0]+'/test/index.html';
9 changes: 0 additions & 9 deletions build.bat

This file was deleted.

5 changes: 3 additions & 2 deletions build.js
@@ -1,8 +1,9 @@
load('steal/file/file.js');
load('steal/rhino/steal.js')

if (java.lang.System.getProperty("os.name").indexOf("Windows") != -1)
runCommand("cmd", "/C", "cd envjs && ant")
else
runCommand("sh", "-c", "cd envjs && ant")
var env = readFile("envjs/dist/env.rhino.js");
new steal.File("steal/rhino/env.js").save(env);
new steal.File("envjs/dist/env.rhino.js").copyTo("steal/rhino/env.js", [])
new steal.File("envjs/dist/env.rhino.js").copyTo("funcunit/dist/selenium/env.js", [])
3 changes: 1 addition & 2 deletions build.properties
Expand Up @@ -2,9 +2,8 @@
PROJECT: env-js
BUILD_MAJOR: 1
BUILD_MINOR: 2
BUILD_ID: 0.10
BUILD_ID: 35
BUILD_VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
BUILD: ${PROJECT}.${BUILD_VERSION}
VERSION: ${BUILD} ${DSTAMP}


0 comments on commit ec17667

Please sign in to comment.