Sortie/ Sortie.js

Main file for Sortie.  Contains the Sortie namespace and the Sorite.Core preprocessor

Copyright

2005-2006 Rohan (robr.nosp@m.ohan@gmai.nosp@m.l.com).  All rights reserved

Summary
Main file for Sortie.
the current version
set this to true to turn on debug mode and use this in your code if you want to branch based on debug mode
Core acts as a pre processor.
Main pre processor function.
Function to write out all the files to be included
the current version

Variables

Sortie. VERSION

Sortie.VERSION

the current version

Sortie. DEBUG

Sortie.DEBUG

set this to true to turn on debug mode and use this in your code if you want to branch based on debug mode

Core

Core acts as a pre processor.  You can use Core in include javascript libraries from with javascript code, and you can also ad “require” statements to your libraries if your library depends on some other library.  For example, to include libraries - from your applications main startup area you could do the following:

Sortie.Core.$({
include:new Array(
"Code/Util/Cookie.js",
"Code/Util/Search.js"
)
});

After you have all the js files the application needs you call Sortie.Core.Include() to load all the libraries.  See the Events.html example for a working example.  In addition to including files, your library can use Core to check to see if a required library exists.  To check, in your library code, you add something like the following at the start of the file:

Sortie.Core.$({
require:new Array(
{ c:"Sortie.Util.Collections", v:"0.2"},
{ c:"Some.Other.Class" }
)
});

c stands for class, and v stands for version.  Version is optional, but if the libaray adds metadata to the class (the “VERSION” property) the version is checked and if older than required there is an error.  After the Sortie.Core.Include() is run, the environment is checked for the existence of the class (or function) passed in c.  At present the require and include commands are the only supported pre processor commands.

| Command        | Params              |

| require | Array of variables |
| include | Array of filenames |

Namespace

Sortie

Summary
Main pre processor function.
Function to write out all the files to be included
the current version

Functions

$

this["$"] = function(e)

Main pre processor function.

Core. Include

Function to write out all the files to be included

Variables

Sortie. Core. VERSION

Sortie.Core.VERSION

the current version

Sortie.VERSION
the current version
Sortie.DEBUG
set this to true to turn on debug mode and use this in your code if you want to branch based on debug mode
this["$"] = function(e)
Main pre processor function.
Sortie.Core.VERSION
the current version