public
Fork of jeresig/env-js
Description: A pure-JavaScript browser environment.
Homepage: http://ejohn.org/blog/bringing-the-browser-to-the-server/
Clone URL: git://github.com/thatcher/env-js.git
Click here to lend your support to: env-js and make a donation at www.pledgie.com !
thatcher (author)
Wed Sep 09 22:22:43 -0700 2009
commit  58a5df464711a03b89878e083ad442d8cbebeaf3
tree    a795eaa765e4402d01a08b077a926ecbd7ff335e
parent  e7d73b06e27e957c144c1def26caf268bfe761d0
env-js /
name age message
file .gitignore Sun Aug 16 18:02:09 -0700 2009 did some refactoring of Glen E. Iveys substanti... [thatcher]
file .project Wed May 20 06:54:39 -0700 2009 added xpath and xslt related stubs to satisfy p... [thatcher]
directory DTD/ Mon Nov 17 22:09:03 -0800 2008 theres a hole in the bucket [thatcher]
file Makefile Sun Aug 16 18:02:09 -0700 2009 did some refactoring of Glen E. Iveys substanti... [thatcher]
file README Tue Sep 08 20:29:22 -0700 2009 logging can be set via Envjs.logLevel, made som... [thatcher]
file Rakefile Sun Aug 16 18:02:09 -0700 2009 did some refactoring of Glen E. Iveys substanti... [thatcher]
directory bin/ Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
file build.properties Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
file build.xml Wed Sep 02 14:12:08 -0700 2009 Added stub functions to allow env.rhino.js to r... [gleneivey]
directory dist/ Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
directory doc/ Thu Aug 20 07:26:23 -0700 2009 found some good little bugs in node insertBefor... [thatcher]
directory jsl/ Thu Jan 15 13:28:15 -0800 2009 oops I think I just commited incorrectly [thatcher]
directory licenses/ Tue Aug 25 21:56:29 -0700 2009 merging glens envjs.main changes. used in comb... [thatcher]
directory rhino/ Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
directory src/ Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
directory test/ Wed Sep 09 22:22:43 -0700 2009 cleaning house in lighthouse for 1.0.0 tag [thatcher]
README
env.js : A pure JavaScript browser environment.
Developed by John Resig (http://ejohn.org)

Major Contributers:
Chris Thatcher (http://github.com/thatcher)

GitHub repositories:
http://github.com/jeresig/env-js/
http://github.com/thatcher/env-js/

Mailing List:
http://groups.google.com/group/envjs

Lighthouse (Bug Tracking):
http://envjs.lighthouseapp.com/projects/21590-envjs/

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/


Building:
* run "ant concat"
* Creates a platform-agnostic "dist/env.js" file and a Rhino-specific "dist/env.rhino.js" file.

Testing:
* run "ant test"

Java command line:

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
supplied with env.js (env-js.jar).  If your application uses multiple
windows, frames, or iframes, or if it depends on precise adherence to
JavaScript object scoping in event handlers, you will have to use
env-js.jar.  Simple applications may be able to run with the generic
version of Rhino.

The command line used for testing env.js can be found in build.xml,
although the general form is:
     java -jar [jar file] [javascript file]
Where "jar file" is either "dist/env-js.jar", "rhino/js.jar", or your
local path to a different version of the Rhino js.jar file.  The
"javascript file" is the path to the JavaScript you wish to execute.

Installing:
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:
     window.location = "some/file.html";
     Envjs("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) }});

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

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

   c) Other JavaScript frameworks have their own methods of setup, but the general pattern is:
     // load env.js
     // load your framework
     // tell env.js the base DOM to model
     // run any setup code for your framework
     // tell the framework that the document is loaded


    
Testing jQuery Compatibility:
* run ./bin/test-jquery.sh 1.3.2
* run ./bin/test-jquery.sh 1.3.1
* run ./bin/test-jquery.sh 1.2.6
* Checks out the given jQuery tag from Subversion into test/vendor/jQuery/[version], 
  moves dist/env.rhino.js into the correct location in their tree, and runs the test suites.