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

MVC.Doc.Directive

Inherits: MVC.Class
The base directive class. Classes extending MVC.Doc.Pair add directives to be matched against. The available directives are:

How directives work

Directives mix in their add and add_more functions into MVC.Doc.Pair classes. These functions work with Pair::comment_setup to read directives (things that look like @something) and make sense of their data.

Prototype Methods

add

add(line) -> Object
Called when comment_setup first sees a line with the matching directive. If the function returns null or false, following lines without another directive will be added to real_comment. If the function returns data, the add_more will be called with lines following this line and the data returned. In these functions, save the data from comments like:
 this.my_data = line.match(/\d\d/)
It's important to note that this refers to the Pair instance of the class that has added this directive.
{String} - the line with the directive on it.
{Object} - if false, add future lines to real_comment, otherwise, call add_more with future lines and the data returned.

add_more

add_more(line, prior) -> Object
Adds lines following a directive.
{String} - the current comment line
{Object} - data the data returned from the previous add or add_more.
{Object} - if false, ends calling add_more with future lines, otherwise; calls add_more with the next line and the return value.