Documentation

include MVC MVC.Animate MVC.Class MVC.Controller MVC.Controller.Action MVC.Controller.Action.Drag MVC.Controller.Action.Drop MVC.Controller.Action.EnterLeave MVC.Controller.Action.Event MVC.Controller.Action.Hover MVC.Controller.Action.Lasso MVC.Controller.Action.Selectable MVC.Controller.Action.Subscribe MVC.Controller.Comet MVC.Controller.Params MVC.Controller.Params.Drag MVC.Controller.Params.Drop MVC.Controller.Stateful MVC.Delegator MVC.Doc MVC.Element MVC.Event MVC.File MVC.History MVC.IO MVC.IO.Ajax MVC.IO.Comet MVC.IO.JsonP MVC.IO.WindowName MVC.IO.XDoc MVC.Model MVC.Model.Ajax MVC.Model.Cookie MVC.Model.JsonP MVC.Model.JsonRest MVC.Model.WindowName MVC.Model.XmlRest MVC.Native MVC.Native.Array MVC.Native.Date MVC.Native.Function MVC.Native.Number MVC.Native.Object MVC.Native.String MVC.Options MVC.Store MVC.SyntheticEvent MVC.Test MVC.Test.Assertions MVC.Test.Controller MVC.Test.Functional MVC.Test.Runner MVC.Test.Unit MVC.Timer MVC.Timer.Easings MVC.Vector MVC.View MVC.View.Helpers OpenAjax

include

Include is used to load and compress JavaScript files. You can load files relative to your current file and compress all your application files into one with no extra coding.

How to Use

Create an application

Create an application by running:
 js jmvc\generate\app APP_NAME

Add to your page

In your HTML, right before the closing </body> tag add a script tag like:
 <script src="include.js?APP_NAME,development" type="text/javascript">
 </script>
The parameters after the include are the application name and the development mode. You can also create a page that loads your app by running:
 js jmvc\generate\page APP_NAME location\to\page.html

Include JavaScript files

In your application file at 'apps\APP_NAME.js', include the files you need in your project.
 include('../resources/', 'javascripts/myapplication');
Includes are performed relative to the including file. Files are included last-in-first-out after the current file has been loaded and run.

Compress your application

Run
 js apps\APP_NAME\compress.js

Run in proudction

Switch to the production mode by changing development to production:
 <script src="include.js?APP_NAME,production" type="text/javascript">
 </script>

Script Load Order

The load order for your scripts follows a consistent last-in first-out order across all browsers. This is the same way the following document.write would work in IE, Firefox, or Safari:
 document.write('')
An example helps illustrate this.
Load Order File
1 1.js
2 3.js
3 4.js
4 2.js
5 5.js
6 6.js


Static Methods

check_exists

check_exists(path) -> Boolean
Returns true or false if a file exists. This isn't 'locking' in FF3.
{Object} -
{Boolean} -

close_time

close_time() -> undefined
Used to close a document that has been openned. This is useful for writing to popup windows.

controllers

controllers() -> undefined
create_link(location) -> undefined
Creates a css link and appends it to head.
{Object} -

css

css() -> undefined
Includes CSS

engines

engines() -> undefined
Includes a list of engines

force

force() -> undefined
Includes something if it has been included or not.

get_env

get_env() -> undefined
Returns what the environment is

get_path

get_path() -> undefined
Gets the current working directory

get_production_name

get_production_name() -> undefined
Gets the location of the production file

insert_head

insert_head(src, encode) -> undefined
Inserts a script tag in head with the encoding.
{Object} -
{Object} -

models

models() -> undefined

plugins

plugins() -> undefined
Includes a list of plugins

request

request(path, content_type) -> undefined
Synchronously requests a file.
{Object} -
{} -

resources

resources() -> undefined

set_path

set_path(p) -> undefined
Sets the current directory.
{Object} -

setup

setup(o) -> undefined
Sets up the current environment, and where the production file is.
{Object} -
view

views

views() -> undefined
Includes views into the production file. This is highly encouraged as the files are preprocessed and don't rely on eval.