if (typeof Sitefinity == "undefined") { var Sitefinity = {}; } /** * Returns the namespace specified and creates it if it doesn't exist *
 * Sitefinity.namespace("property.package");
 * Sitefinity.namespace("Sitefinity.property.package");
 * 
* Either of the above would create Sitefinity.property, then * Sitefinity.property.package * * Be careful when naming packages. Reserved words may work in some browsers * and not others. For instance, the following will fail in Safari: *
 * Sitefinity.namespace("really.long.nested.namespace");
 * 
* This fails because "long" is a future reserved word in ECMAScript * * @method namespace * @static * @param {String*} arguments 1-n namespaces to create * @return {Object} A reference to the last namespace object created */ Sitefinity.namespace = function() { var a=arguments, o=null, i, j, d; for (i=0; i -1) { return true; } else { return Sitefinity.lang.isObject(obj) && obj.constructor == Array; } }, /** * Determines whether or not the provided object is a boolean * @method isBoolean * @param {any} obj The object being testing * @return Boolean */ isBoolean: function(obj) { return typeof obj == 'boolean'; }, /** * Determines whether or not the provided object is a function * @method isFunction * @param {any} obj The object being testing * @return Boolean */ isFunction: function(obj) { return typeof obj == 'function'; }, /** * Determines whether or not the provided object is null * @method isNull * @param {any} obj The object being testing * @return Boolean */ isNull: function(obj) { return obj === null; }, /** * Determines whether or not the provided object is a legal number * @method isNumber * @param {any} obj The object being testing * @return Boolean */ isNumber: function(obj) { return typeof obj == 'number' && isFinite(obj); }, /** * Determines whether or not the provided object is of type object * or function * @method isObject * @param {any} obj The object being testing * @return Boolean */ isObject: function(obj) { return typeof obj == 'object' || Sitefinity.lang.isFunction(obj); }, /** * Determines whether or not the provided object is a string * @method isString * @param {any} obj The object being testing * @return Boolean */ isString: function(obj) { return typeof obj == 'string'; }, /** * Determines whether or not the provided object is undefined * @method isUndefined * @param {any} obj The object being testing * @return Boolean */ isUndefined: function(obj) { return typeof obj == 'undefined'; }, /** * Determines whether or not the property was added * to the object instance. Returns false if the property is not present * in the object, or was inherited from the prototype. * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x. * There is a discrepancy between Sitefinity.lang.hasOwnProperty and * Object.prototype.hasOwnProperty when the property is a primitive added to * both the instance AND prototype with the same value: *
     * var A = function() {};
     * A.prototype.foo = 'foo';
     * var a = new A();
     * a.foo = 'foo';
     * alert(a.hasOwnProperty('foo')); // true
     * alert(Sitefinity.lang.hasOwnProperty(a, 'foo')); // false when using fallback
     * 
* @method hasOwnProperty * @param {any} obj The object being testing * @return Boolean */ hasOwnProperty: function(obj, prop) { if (Object.prototype.hasOwnProperty) { return obj.hasOwnProperty(prop); } return !Sitefinity.lang.isUndefined(obj[prop]) && obj.constructor.prototype[prop] !== obj[prop]; }, /** * Utility to set up the prototype, constructor and superclass properties to * support an inheritance strategy that can chain constructors and methods. * * @method extend * @static * @param {Function} subc the object to modify * @param {Function} superc the object to inherit * @param {Object} overrides additional properties/methods to add to the * subclass prototype. These will override the * matching items obtained from the superclass * if present. */ extend: function(subc, superc, overrides) { var F = function() {}; F.prototype=superc.prototype; subc.prototype=new F(); subc.prototype.constructor=subc; subc.superclass=superc.prototype; if (superc.prototype.constructor == Object.prototype.constructor) { superc.prototype.constructor=superc; } if (overrides) { for (var i in overrides) { subc.prototype[i]=overrides[i]; } } }, /** * Applies all prototype properties in the supplier to the receiver if the * receiver does not have these properties yet. Optionally, one or more * methods/properties can be specified (as additional parameters). This * option will overwrite the property if receiver has it already. * * @method augment * @static * @param {Function} r the object to receive the augmentation * @param {Function} s the object that supplies the properties to augment * @param {String*} arguments zero or more properties methods to augment the * receiver with. If none specified, everything * in the supplier will be used unless it would * overwrite an existing property in the receiver */ augment: function(r, s) { var rp=r.prototype, sp=s.prototype, a=arguments, i, p; if (a[2]) { for (i=2; iSitefinity.lang * @class Sitefinity.util.Lang */ Sitefinity.util.Lang = Sitefinity.lang; /** * An alias for Sitefinity.lang.augment * @for Sitefinity * @method augment * @static * @param {Function} r the object to receive the augmentation * @param {Function} s the object that supplies the properties to augment * @param {String*} arguments zero or more properties methods to augment the * receiver with. If none specified, everything * in the supplier will be used unless it would * overwrite an existing property in the receiver */ Sitefinity.augment = Sitefinity.lang.augment; /** * An alias for Sitefinity.lang.extend * @method extend * @static * @param {Function} subc the object to modify * @param {Function} superc the object to inherit * @param {Object} overrides additional properties/methods to add to the * subclass prototype. These will override the * matching items obtained from the superclass * if present. */ Sitefinity.extend = Sitefinity.lang.extend; Sitefinity.register("Sitefinity", Sitefinity);