﻿/*
    MIT License

    Copyright (c) 2009 Mats Bryntse

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
*/

Ext.ns('Globals');

Globals.apiConfig = [
    {
        id: 'extjs',
        name: 'ExtJS (all)',
        versions: [
            {
                name : '2.2.1',
                scripts: [
                    "js/frameworks/ext-base2.2.1.js",
                    "js/frameworks/ext-all2.2.1.js"
                ],
                styleSheets: [
                    "css/frameworks/ext-all2.2.1.css"
                ]
            },
            {
                name : '2.2',
                scripts: [
                    "js/frameworks/ext-base2.2.js",
                    "js/frameworks/ext-all2.2.js"
                ],
                styleSheets: [
                    "css/frameworks/ext-all2.2.css"
                ]
            }
        ]
    },
    {
        id: 'googlejsapi',
        name: 'Google JS API',
        versions: [
            {
                scripts: [
                    "js/frameworks/googlejsapi.js"
                ]
            }
        ]
    },
    {
        id: 'virtualearth',
        name: 'Microsoft Virtual Earth',
        versions: [
            {
                scripts: [
                    "js/frameworks/virtualearth.js"
                ]
            }
        ]
    }, {
        id: 'googlemaps',
        name: 'Google Maps',
        versions: [
            {
                scripts: [
                    "js/frameworks/googlemaps.js"
                ]
            }
        ]  
    }, {
        id: 'jslint',
        name: 'JsLint',
        versions: [
            {
                scripts: [
                    "js/frameworks/fulljslint.js"
                ]
            }
        ]
    },
    {
        id: 'urchin',
        name: 'Google Urchin',
        versions: [
            {
                scripts: [
                    "js/frameworks/urchin.js"
                ]
            }
        ]
    },
    {
        id: 'googleanalytics',
        name: 'Google Analytics',
        versions: [
            {
                scripts: [
                    "js/frameworks/ga.js"
                ]
            }
        ]
    },
    {
        id: 'jquery',
        name: 'JQuery',
        versions: [
            {
                name : '1.3.2',
                scripts: [
                    "js/frameworks/jquery-1.3.2.min.js"
                ]
            },
            {
                name : '1.3.1',
                scripts: [
                    "js/frameworks/jquery1.3.1.min.js"
                ]
            }
        ]
    },
    {
        id: 'jqueryui',
        name: 'JQuery UI',
        versions: [
            {
                name: '1.5.3',
                scripts: [
                    "js/frameworks/jquery.min.js",
                    "js/frameworks/jquery-ui.min.js"
                ],
                styleSheets: [
                    "css/frameworks/jqueryui.css"
                ]
            }
        ],
        dependencies: 'jquery'
    },
    {
        id: 'prototype',
        name: 'Prototype',
        versions: [
            {
                name: '1.6.0.3',
                scripts: [
                    "js/frameworks/prototype.js"
                ]
            }
        ]
    },
    {
        id: 'scriptaculous',
        name: 'Scriptaculous',
        versions: [
            {
                name: '1.8.2',
                scripts: [
                    "js/frameworks/prototype.js",
                    "js/frameworks/scriptaculous.js"
                ]
            }
        ],
        dependencies: 'prototype'
    },
    {
        id: 'mootools',
        name: 'MooTools',
        versions: [
            {
                name: '1.2.1',
                scripts: [
                    "js/frameworks/mootools-yui-compressed.js"
                ]
            }
        ]
    },
    {
        id: 'yui',
        name: 'YUI (all)',
        versions: [
            {
                name : '2.7.0',
                scripts: [
                    "js/frameworks/yui2.7.js"
                ],
                styleSheets: [
                    "css/frameworks/yui2.7.css"
                ]
            },
            {
                name : '2.6.0',
                scripts: [
                    "js/frameworks/yui2.6.js"
                ],
                styleSheets: [
                    "css/frameworks/yui2.6.css"
                ]
            }
        ]
    },
    {
        id: 'dojo',
        name: 'Dojo',
        versions: [
            {
                name: '1.2.3',
                scripts: [
                    "js/frameworks/dojo.xd.js"
                ],
                styleSheets: [
                    "css/frameworks/dojo.css"
                ]
            }
        ]
    },
    {
        id: 'swfobject',
        name: 'SWFObject',
        versions: [
            {        
                scripts: [
                    "js/frameworks/swfobject.js"
                ]
            }
        ]
    },
    {
        id: 'msajax',
        name: 'Microsoft Ajax',
        versions: [
            {
                name: '3.5',
                scripts: [
                    "js/frameworks/MicrosoftAjax.js",
                    "js/frameworks/MicrosoftAjaxTimer.js",
                    "js/frameworks/MicrosoftAjaxWebForms.js"
                ]
            },
            {
                name: '3.5 (Debug)',
                scripts: [
                    "js/frameworks/MicrosoftAjax.debug.js",
                    "js/frameworks/MicrosoftAjaxTimer.debug.js",
                    "js/frameworks/MicrosoftAjaxWebForms.debug.js"
                ]
            }
        ]
    },
    {
        id: 'mochikit',
        name: 'MochiKit',
        versions : [
            {
                name : '1.3.1',
                scripts: [
                    "js/frameworks/MochiKit.js"
                ]
            }, 
            {
                name: '1.3.1  + {__export__: false}',
                scripts: [
                    'js/frameworks/MochiKit_export_false.js',
                    'js/frameworks/MochiKit.js'
                ]
            }
        ]
    },
    {
        id: 'spry',
        name: 'Adobe Spry',
        versions: [
            {
                name : '1.6.1 pre-release',
                scripts: [
                    "js/frameworks/SpryData.js"
                ]
            }
        ]
    },
    {
        id: 'rialto',
        name: 'Rialto',
        versions: [
            {
                name : '0.85',
                scripts: [
                    "js/frameworks/rialtoconfig.js",
                    "js/frameworks/rialto.js"
                ]
            }
        ]
    },
    {
        id: 'midori',
        name: 'Midori',
        versions : [
            {
                scripts: [
                    "js/frameworks/midori.js"
                ]
            }
        ]
    },
    {
        id: 'simplejs',
        name: 'SimpleJS',
        versions: [
            {
                name : '0.1b',
                scripts: [
                    "js/frameworks/simple.js"
                ]
            }
        ]
    },
    {
        id: 'fleegix',
        name: 'Fleegix',
        versions : [
        {
                name : '0.5.0',
                scripts: [
                    "js/frameworks/fleegix.js"
                ]
            }
        ]
    },
    {
        id: 'twobirds',
        name: 'TwoBirds',
        versions : [
            {
                scripts: [
                    "js/frameworks/twobirds.pack.js"
                ]
            }
        ]
    },
    {
        id: 'log4javascript',
        name: 'log4javascript',
        versions: [
            {
                name : '1.4',
                scripts: [
                    "js/frameworks/log4javascript.js"
                ]
            }
        ]
    },
    {
        id: 'activerecordjs',
        name: 'ActiveRecord.js',
        versions : [
            {
                name : '1.0b1',
                scripts: [
                    "js/frameworks/active_record.js"
                ]
            }
        ]
    },
    {
        id: 'linb',
        name: 'Linb',
        versions : [
            {
                scripts: [
                    "js/frameworks/linb-all.js"
                ]
            }
        ]
    },
    {
        id: 'codemirror',
        name: 'CodeMirror',
        versions : [
            {
                scripts: [
                    "js/codemirror/codemirror.js"
                ]
            }
        ]
    },
    {
        id: 'rico',
        name: 'Rico (all)',
        versions : [
            {
                scripts: [
                    "js/frameworks/prototype.js",
                    "js/frameworks/ricoall.js"
                ],
                styleSheets: [
                    "css/frameworks/ricoall.css"
                ]
            }
        ],
        dependencies: 'prototype'
    },
    {
        id: 'yass',
        name: 'YASS',
        versions: [
            {
                name : '0.3.8',
                scripts: [
                    "js/frameworks/yass.js"
                ]
            }
        ]
    },
    {
        id: 'sizzle',
        name: 'Sizzle',
        versions: [
            {
                name : '0.9.3',
                scripts: [
                    "js/frameworks/sizzle.js"
                ]
            }
        ]
    },
    {
        id: 'ajile',
        name: 'Ajile',
        versions : [
            {
                scripts: [
                    "js/frameworks/ajile.js"
                ]
            }
        ]
    },
    {
        id: 'sitecatalyst',
        name: 'SiteCatalyst',
        versions : [
            {
                name : 'H.1',
                scripts: [
                    "js/frameworks/s_code.js"
                ]
            }
        ]
    }
].sort(function(a, b) {
    return a.name > b.name;
});

Globals.nativeSymbols = [
    "window",
    "document",
    
    "Array",       
    "Date",            
    "Error",          
    "Event",
    "Function",        
    "NodeList",
    "Object",
    "RangeError",      
    "RegExp",          
    "ReferenceError",  
    "StyleSheet",
    "SyntaxError",     
    "TypeError",       
    "URIError",        
    
    "Node",
    "CharacterData",
        "Text",
    
    "Document",
        "HTMLDocument",
  
    "Element",
        "HTMLElement",
            "HTMLAnchorElement",
            "HTMLAppletElement",
            "HTMLAreaElement",
            "HTMLBaseElement",
            "HTMLBaseFontElement",
            "HTMLBlockquoteElement",
            "HTMLBodyElement",
            "HTMLBRElement",
            "HTMLButtonElement",
            "HTMLDirectoryElement",
            "HTMLDivElement",
            "HTMLDListElement",
            "HTMLFieldSetElement",
            "HTMLFontElement",
            "HTMLFormElement",
            "HTMLFrameElement",
            "HTMLFrameSetElement",
            "HTMLHeadElement",
            "HTMLHeadingElement",
            "HTMLHRElement",
            "HTMLHtmlElement",
            "HTMLIFrameElement",
            "HTMLImageElement",
            "HTMLInputElement",
            "HTMLIsIndexElement",
            "HTMLLabelElement",
            "HTMLLayerElement",
            "HTMLLegendElement",
            "HTMLLIElement",
            "HTMLLinkElement",
            "HTMLMapElement",
            "HTMLMenuElement",
            "HTMLMetaElement",
            "HTMLModElement",
            "HTMLObjectElement",
            "HTMLOListElement",
            "HTMLOptGroupElement",
            "HTMLOptionElement",
            "HTMLParagraphElement",
            "HTMLParamElement",
            "HTMLPreElement",
            "HTMLQuoteElement",
            "HTMLScriptElement",
            "HTMLSelectElement",
            "HTMLStyleElement",
            "HTMLTableCaptionElement",
            "HTMLTableCellElement",
            "HTMLTableColElement",
            "HTMLTableElement",
            "HTMLTableRowElement",
            "HTMLTableSectionElement",
            "HTMLTextAreaElement",
            "HTMLTitleElement",
            "HTMLUListElement",

    // Primitive types:
    "String",
    "Number",
    "Boolean",
    
    // Misc
    "Math"
];

Globals.excludeProperties = [
    
    // Firebug properties
    'getInterface',
    '_firebug',
    '_FirebugCommandLine',
    '_getFirebugConsole',
    '_getFirebugConsoleElement',
    'loadFirebugConsole',
    'console',
    
    // Event.Text shows up on all items in FF
    'Event.TEXT'
];

if (Ext.isSafari) {
Globals.excludeProperties.push.apply(Globals.excludeProperties, 
    // These show up in Chrome
   ['event', 
    'crypto',
    'document.all',
    'Regexp.$1',
    'Regexp.input',
    'Regexp.lastMatch',
    'Regexp.firstMatch',
    'Regexp.lastParen',
    'Regexp.leftContext',
    'Regexp.rightContext']);
}
