Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:thatcher/env-js
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcher committed Aug 26, 2009
2 parents 0aa2d08 + 8f0e64c commit b99dad8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
42 changes: 23 additions & 19 deletions README
Expand Up @@ -33,31 +33,35 @@ Testing:

Installing:
1) Include the proper env.js file for your platform.
load('env.rhino.js'); //if in a Rhino script
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";
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.onload = function() { /* do something after DOM is loaded */};
window.location = "some/file.html";
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.2.6.js');
window.location = "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
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
Expand Down
2 changes: 0 additions & 2 deletions dist/env.js
Expand Up @@ -8185,7 +8185,6 @@ $w.__defineGetter__("location", function(url){
* history.js
*/

$info("Initializing Window History.");
$currentHistoryIndex = 0;
$history = [];

Expand Down Expand Up @@ -9412,7 +9411,6 @@ var loadCookies = function(){
//We simply use the default ajax get to load the .cookies.js file
//if it doesn't exist we create it with a post. Cookies are maintained
//in memory, but serialized with each set.
$info("Loading Cookies");
try{
//TODO - load cookies
loadCookies();
Expand Down
2 changes: 0 additions & 2 deletions dist/env.rhino.js
Expand Up @@ -8815,7 +8815,6 @@ $w.__defineGetter__("location", function(url){
* history.js
*/

$info("Initializing Window History.");
$currentHistoryIndex = 0;
$history = [];

Expand Down Expand Up @@ -10042,7 +10041,6 @@ var loadCookies = function(){
//We simply use the default ajax get to load the .cookies.js file
//if it doesn't exist we create it with a post. Cookies are maintained
//in memory, but serialized with each set.
$info("Loading Cookies");
try{
//TODO - load cookies
loadCookies();
Expand Down
1 change: 0 additions & 1 deletion src/html/cookie.js
Expand Up @@ -124,7 +124,6 @@ var loadCookies = function(){
//We simply use the default ajax get to load the .cookies.js file
//if it doesn't exist we create it with a post. Cookies are maintained
//in memory, but serialized with each set.
$info("Loading Cookies");
try{
//TODO - load cookies
loadCookies();
Expand Down
1 change: 0 additions & 1 deletion src/window/history.js
Expand Up @@ -2,7 +2,6 @@
* history.js
*/

$info("Initializing Window History.");
$currentHistoryIndex = 0;
$history = [];

Expand Down

0 comments on commit b99dad8

Please sign in to comment.