/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 3.0.0 build: 1549 */ YUI.add('compat', function(Y) { var COMPAT_ARG = '~yui|2|compat~'; if (window.YAHOO != YUI) { // get any existing YAHOO obj props var o = (window.YAHOO) ? YUI.merge(window.YAHOO) : null; // Make the YUI global the YAHOO global window.YAHOO = YUI; // augment old YAHOO props if (o) { Y.mix(Y, o); } } // add old namespaces Y.namespace("util", "widget", "example"); // case/location change Y.env = (Y.env) ? Y.mix(Y.env, Y.Env) : Y.Env; Y.lang = (Y.lang) ? Y.mix(Y.lang, Y.Lang) : Y.Lang; Y.env.ua = Y.UA; // support Y.register Y.mix(Y.env, { modules: [], listeners: [], getVersion: function(name) { return this.Env.modules[name] || null; } }); var L = Y.lang; // add old lang properties Y.mix(L, { augmentObject: function(r, s) { var a = arguments, wl = (a.length > 2) ? Y.Array(a, 2, true) : null; return Y.mix(r, s, (wl), wl); }, augmentProto: function(r, s) { var a = arguments, wl = (a.length > 2) ? Y.Array(a, 2, true) : null; return Y.mix(r, s, (wl), wl, 1); }, // extend: Y.bind(Y.extend, Y), extend: Y.extend, // merge: Y.bind(Y.merge, Y) merge: Y.merge }, true); L.augment = L.augmentProto; L.hasOwnProperty = function(o, k) { return (o.hasOwnProperty(k)); }; Y.augmentProto = L.augmentProto; // add register function Y.mix(Y, { register: function(name, mainClass, data) { var mods = Y.Env.modules; if (!mods[name]) { mods[name] = { versions:[], builds:[] }; } var m=mods[name],v=data.version,b=data.build,ls=Y.Env.listeners; m.name = name; m.version = v; m.build = b; m.versions.push(v); m.builds.push(b); m.mainClass = mainClass; // fire the module load listeners for (var i=0;i= this.left && region.right <= this.right && region.top >= this.top && region.bottom <= this.bottom ); }; YAHOO.util.Region.prototype.getArea = function() { return ( (this.bottom - this.top) * (this.right - this.left) ); }; YAHOO.util.Region.prototype.intersect = function(region) { var t = Math.max( this.top, region.top ); var r = Math.min( this.right, region.right ); var b = Math.min( this.bottom, region.bottom ); var l = Math.max( this.left, region.left ); if (b >= t && r >= l) { return new YAHOO.util.Region(t, r, b, l); } else { return null; } }; YAHOO.util.Region.prototype.union = function(region) { var t = Math.min( this.top, region.top ); var r = Math.max( this.right, region.right ); var b = Math.max( this.bottom, region.bottom ); var l = Math.min( this.left, region.left ); return new YAHOO.util.Region(t, r, b, l); }; YAHOO.util.Region.prototype.toString = function() { return ( "Region {" + "top: " + this.top + ", right: " + this.right + ", bottom: " + this.bottom + ", left: " + this.left + "}" ); }; YAHOO.util.Region.getRegion = function(el) { return YUI.DOM.region(el); }; YAHOO.util.Point = function(x, y) { if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc. y = x[1]; // dont blow away x yet x = x[0]; } this.x = this.right = this.left = this[0] = x; this.y = this.top = this.bottom = this[1] = y; }; YAHOO.util.Point.prototype = new YAHOO.util.Region(); }, '3.0.0' ,{requires:['dom','event']}); YUI._setup(); YUI.use('dom', 'event', 'compat');