AlphabetCity = {
/*
 * AlphabetCity @VERSION - 
 *
 * Copyright (c) 2008 Jill Platner
 *
 * $Date: 2008-09-08 08:17:31 -0400 (Mon, 08 Sep 2008) $
 * $Rev: 269 $
 *
 */
};
(function($, $ABC){
	$.extend(true, $ABC, {
    	Models:{},
    	Views:{},
    	Controllers:{}
	});
})(jQuery, AlphabetCity);

(function($){
	
    //-------------------------------------------------------------------------------------//
    //  -   APPLICATION CONFIGURATION   -
    //______________________________________________________________________________________//
   $.extend(true, $.Configuration, {
        ioc:[
            //-------------------------------------------------------------------------------------//
            //  -   MODELS  (aka Domain Objects)    -
            //  -
            //______________________________________________________________________________________//
            {   id:"#NecklaceModel",       clazz:"AlphabetCity.Models.Necklace", 
                options:[{
                    url:"/env/jillplatner/alphabetcity",
                    resourceType:"json"
                }]
            },
            //-------------------------------------------------------------------------------------//
            //  -   VIEWS   -
            //
            //_____________________________________________________________________________________//
            {   id:"#NecklaceView",        clazz:"AlphabetCity.Views.Necklace", selector:"#dialog" },
            //-------------------------------------------------------------------------------------//
            //  -   CONTROLLERS -
            //  - Controllers contain the business logic of the application.  Event, links, and forms
            //  - are routed to the controllers in the mvc configuration section. (see section commented
            //  - with title 'ROUTERS'). Simple controller ussually implements the 'handle' method
            //  - but 'multi-action' controllers can implement any methods they choose and only need
            //  - to supply the specified endpoint in the configuration (see ROUTERS below.)
            //  -
            //_____________________________________________________________________________________//
            {  id:"#NecklaceController",	clazz:"AlphabetCity.Controllers.Necklace" ,
            	options :[{
            		steps:[{
				    	area: "#abc_choose_length",
				    	preview: "#abc_length"
					},/*{
				    	area: "#abc_choose_color",
				    	preview: "#abc_color",
				    	message: "Select Cord Color.",
				    	buttons:["#abc_start_over"]
					},*/{
				    	area: "#abc_choose_blocks",
				    	preview: "#abc_blocks",
				    	buttons:["#abc_previous", "#abc_start_over", "#abc_confirm"]
					},{
				    	area: "#abc_confirm_order",
				    	preview: "#abc_confirmation",
				    	buttons:["#abc_previous", "#abc_start_over", "#abc_add_to_cart"]
					}]
            	}],
                inject:{ 
                	abcNecklace	: "ref://#NecklaceModel" ,
                	maxBlocks	: 17,
                	cartUrl: "/cart/add/custom/abc"
            	}
            }
        ],
        //-------------------------------------------------------------------------------------//
        //  -   ROUTERS     -
        //  - Routers are low level controllers that hijax the browsers normal behaviour 
        //  - forwarding control to a high level controller that you've written.  In particular
        //  - we use links, form sumbission, and events (Claypool.Server includes support
        //  - for http request routing).
        //  -
        //  - Also it's important to note that you dont have to use these low level controllers,
        //  - but they help to reduce the memory consumption of an application because the
        //  - high level controllers are not created until needed.
        //  -
        //  - Both links and forms can be hijaxed using regular expression matches to the
        //  - href and action atrribute respectively. 
        //  - 
        //  - When no action is specified for a given controller, the default method 'handle'
        //  - will be called.
        //_____________________________________________________________________________________//
        mvc:{
            "hijax:a" : [
                {
                    id:"#AlphabetCityLinks",
                    active:true,
                    filter:"[href$='.abc']",
                    stopPropagation:false,
                    hijaxMap:
                      [{urls:"customize.abc$",  		controller:"#NecklaceController" , action:"open"},
                       {urls:"close.abc$", 				controller:"#NecklaceController" , action:"close"},
                       {urls:"start_over.abc$", 		controller:"#NecklaceController" , action:"startOver"},
                       {urls:"previous.abc$", 			controller:"#NecklaceController" , action:"previous"},
                       {urls:"confirm.abc$", 			controller:"#NecklaceController" , action:"confirm"},
                       {urls:"add_to_cart.abc$", 		controller:"#NecklaceController" , action:"addToCart"}]
	        	}
           ],
           "hijax:input" : [
                {
                    id:"#AlphabetCityInputControls",
                    active:true,
                    filter:":checkbox",
                    preventDefault:false,
                    hijaxMap:
                      [{urls:"block/(\\w+).abc$",  		controller:"#NecklaceController" , action:"modifyBlockMetal"}]
	        	}
           ],
           "hijax:button" : [
                {
                    id:"#AlphabetCityButtons",
                    hijaxMap:[
                      {urls:"cancel$",  controller:"#NecklaceController", action:"cancel"}]
               }
           ],
           "hijax:form" : [
                {
                    id:"#AlphabetCityForms",
                    hijaxMap:[
                      {urls:"login$",  controller:"#NecklaceController", action:"login"},
                      {urls:"logout$", controller:"#NecklaceController", action:"logout"}]
               }
           ],
           "hijax:event" : [
            	{
                    id:"#AlphabetCityEvents",
                    stopPropagation:false,
                    hijaxMap:
                      [{event:"ChooseLength",    controller:"#NecklaceController",   action:"chooseLength"},
                      {event:"ChooseBlocks",    controller:"#NecklaceController",   action:"chooseBlocks"},
                      {event:"ChooseCordColor",    controller:"#NecklaceController",   action:"chooseCordColor"}]
               },
               {
                    id:"#AlphabetCityKeypad",
                    selector:"#abc_choose_blocks",
                    stopPropogation:true,
                    hijaxMap:
                      [{event:"click",    controller:"#NecklaceController",   action:"modifyBlocks"}]
	        	},
	        	{
                    id:"#AlphabetCityLengthChoice",
                    selector:"#abc_select_length",
                    stopPropogation:true,
                    hijaxMap:
                      [{event:"click",    controller:"#NecklaceController",   action:"chooseLength"}]
               },
	        	{
                    id:"#AlphabetCityCordChoice",
                    selector:"#abc_select_color",
                    stopPropogation:true,
                    hijaxMap:
                      [{event:"click",    controller:"#NecklaceController",   action:"chooseCordColor"}]
               }
           ]
       },
        //-------------------------------------------------------------------------------------//
        //  -   LOGGERS     -
        //  - Loggers can be enabled or disabled, turned up or turned downed here.  There
        //  - are five levels for loggers, DEBUG, INFO, WARN, ERROR, and NONE.  Each level
        //  - will include log messages from higher levels but not lower.  So DEBUG will
        //  - print all messages while WARN will include error messages but not info and 
        //  - debug messages.
        //  -
        //  - Understanding Logging Categories is critical to using logging effectively.  Every
        //  - new logger is created with a '.' delimited name, and that name should represent
        //  - some hierarchy.  Best practice is to use Namespaces and ClassNames that represent
        //  - the given class.  For example 'MetaSeach.SessionController' would be a good name.
        //  - If you want to only get warning messages from the MetasSearch components, but want
        //  - to get all messages from MetaSearch.SessionController you can have seperate 
        //  - configurations for each.
        //  -
        //  - By default, all Categories that are not explicitly configured will use the 'root'
        //  - configuration (see below).
        //_____________________________________________________________________________________//
       logging:[
            { category:"AlphabetCity", 				level:"DEBUG" 	},
            { category:"AlphabetCity.Models", 		level:"DEBUG" 	},
            { category:"AlphabetCity.Views", 		level:"DEBUG"	},
            { category:"AlphabetCity.Controllers", 	level:"DEBUG" 	},
            { category:"root",  					level:"INFO"  	}
        ]
    });
})(jQuery);
    
