diff --git a/build/platform-yui.js b/build/platform-yui.js index 8f62ae0..cbccace 100644 --- a/build/platform-yui.js +++ b/build/platform-yui.js @@ -14,7 +14,7 @@ // //= require //= require -//= require +//= require //= require //= require // diff --git a/third-party/yui/animation.js b/third-party/yui/animation.js index 5737b68..d92a436 100644 --- a/third-party/yui/animation.js +++ b/third-party/yui/animation.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ (function() { @@ -1389,4 +1389,4 @@ YAHOO.util.Easing = { Y.Scroll = Scroll; })(); -YAHOO.register("animation", YAHOO.util.Anim, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("animation", YAHOO.util.Anim, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/assets/container-core.css b/third-party/yui/assets/container-core.css index 4903215..4bfc683 100644 --- a/third-party/yui/assets/container-core.css +++ b/third-party/yui/assets/container-core.css @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ .yui-overlay, .yui-panel-container { diff --git a/third-party/yui/assets/container.css b/third-party/yui/assets/container.css index 55e4c97..b70d7d0 100644 --- a/third-party/yui/assets/container.css +++ b/third-party/yui/assets/container.css @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ .yui-overlay, .yui-panel-container { diff --git a/third-party/yui/assets/logger.css b/third-party/yui/assets/logger.css index fef14ed..3d8931d 100644 --- a/third-party/yui/assets/logger.css +++ b/third-party/yui/assets/logger.css @@ -1,51 +1,57 @@ -/* logger default styles */ -/* default width: 31em */ -/* default font-size 77% */ -.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;} - -/* for containers built from scratch */ -.yui-log-container {position:absolute;top:1em;right:1em;} - -/* buttons */ -.yui-log input { - margin:0;padding:0; - font-family:arial; - font-size:100%; - font-weight:normal; -} -.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} - -/* header */ -.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;} -.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;} - -/* body */ - -.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/ -.yui-log p {margin:1px;padding:.1em;} -.yui-log pre {margin:0;padding:0;} - -/* for pre to respect newlines yet wrap long lines */ -/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ -.yui-log pre.yui-log-verbose { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} - -/* footer */ -.yui-log .yui-log-ft {margin-top:.5em;} -.yui-log .yui-log-ft .yui-log-categoryfilters {} -.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} -.yui-log .yui-log-filtergrp {margin-right:.5em;} -/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8} -.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/ - -/* logs */ -.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ -.yui-log .warn {background-color:#F58516;} /* F58516 orange */ -.yui-log .error {background-color:#E32F0B;} /* E32F0B red */ -.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ -.yui-log .window {background-color:#F2E886;} /* F2E886 tan */ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +/* logger default styles */ +/* default width: 31em */ +/* default font-size 77% */ +.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;} + +/* for containers built from scratch */ +.yui-log-container {position:absolute;top:1em;right:1em;} + +/* buttons */ +.yui-log input { + margin:0;padding:0; + font-family:arial; + font-size:100%; + font-weight:normal; +} +.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} + +/* header */ +.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;} +.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;} + +/* body */ + +.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/ +.yui-log p {margin:1px;padding:.1em;} +.yui-log pre {margin:0;padding:0;} + +/* for pre to respect newlines yet wrap long lines */ +/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ +.yui-log pre.yui-log-verbose { + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + +/* footer */ +.yui-log .yui-log-ft {margin-top:.5em;} +.yui-log .yui-log-ft .yui-log-categoryfilters {} +.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} +.yui-log .yui-log-filtergrp {margin-right:.5em;} +/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8} +.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/ + +/* logs */ +.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ +.yui-log .warn {background-color:#F58516;} /* F58516 orange */ +.yui-log .error {background-color:#E32F0B;} /* E32F0B red */ +.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ +.yui-log .window {background-color:#F2E886;} /* F2E886 tan */ diff --git a/third-party/yui/assets/skins/sam/container-skin.css b/third-party/yui/assets/skins/sam/container-skin.css index 6966c95..8adcdb5 100644 --- a/third-party/yui/assets/skins/sam/container-skin.css +++ b/third-party/yui/assets/skins/sam/container-skin.css @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /* Panel modality mask styles */ .yui-skin-sam .mask { diff --git a/third-party/yui/assets/skins/sam/container.css b/third-party/yui/assets/skins/sam/container.css index 45f1e0b..0e1c188 100644 --- a/third-party/yui/assets/skins/sam/container.css +++ b/third-party/yui/assets/skins/sam/container.css @@ -1,7 +1,7 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ .yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel{position:relative;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay,.yui-effect-fade .yui-tt-shadow{display:none;}.yui-tt-shadow{position:absolute;}.yui-override-padding{padding:0!important;}.yui-panel-container .container-close{overflow:hidden;text-indent:-10000em;text-decoration:none;}.yui-overlay.yui-force-redraw,.yui-panel-container.yui-force-redraw{margin-bottom:1px;}.yui-skin-sam .mask{background-color:#000;opacity:.25;filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px;}.yui-skin-sam .yui-panel{position:relative;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;*border-width:1px;*zoom:1;_zoom:normal;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;*margin:0;*border:0;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 4px 0 2px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;left:-3px;right:-3px;bottom:-3px;*top:4px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_left:0;_right:0;_bottom:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled{background-position:0 -1500px;border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled button{color:#a6a6a6;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;filter:alpha(opacity=12);} diff --git a/third-party/yui/button.js b/third-party/yui/button.js index b57c819..ee1f142 100644 --- a/third-party/yui/button.js +++ b/third-party/yui/button.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * @module button @@ -4630,4 +4630,4 @@ version: 2.8.0r4 }); })(); -YAHOO.register("button", YAHOO.widget.Button, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("button", YAHOO.widget.Button, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/calendar.js b/third-party/yui/calendar.js index d6e2016..881f3cf 100644 --- a/third-party/yui/calendar.js +++ b/third-party/yui/calendar.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ (function () { @@ -7291,4 +7291,4 @@ YAHOO.widget.CalendarNavigator.prototype = { __isMac : (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1) }; -YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/colorpicker.js b/third-party/yui/colorpicker.js index 2e031a1..cf38b8d 100644 --- a/third-party/yui/colorpicker.js +++ b/third-party/yui/colorpicker.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * Provides color conversion and validation utils @@ -1760,4 +1760,4 @@ YAHOO.util.Color = function() { YAHOO.widget.ColorPicker = ColorPicker; })(); -YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/connection.js b/third-party/yui/connection.js index a0eef84..c564a75 100644 --- a/third-party/yui/connection.js +++ b/third-party/yui/connection.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * The Connection Manager provides a simplified interface to the XMLHttpRequest @@ -1543,4 +1543,4 @@ YAHOO.util.Connect = YCM.uploadFile = _uploadFile; })(); -YAHOO.register("connection", YAHOO.util.Connect, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("connection", YAHOO.util.Connect, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/container_core.js b/third-party/yui/container.js similarity index 56% rename from third-party/yui/container_core.js rename to third-party/yui/container.js index 45131b5..5805348 100644 --- a/third-party/yui/container_core.js +++ b/third-party/yui/container.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ (function () { @@ -4738,6 +4738,3932 @@ version: 2.8.0r4 } }; }()); +(function () { + + /** + * Tooltip is an implementation of Overlay that behaves like an OS tooltip, + * displaying when the user mouses over a particular element, and + * disappearing on mouse out. + * @namespace YAHOO.widget + * @class Tooltip + * @extends YAHOO.widget.Overlay + * @constructor + * @param {String} el The element ID representing the Tooltip OR + * @param {HTMLElement} el The element representing the Tooltip + * @param {Object} userConfig The configuration object literal containing + * the configuration that should be set for this Overlay. See configuration + * documentation for more details. + */ + YAHOO.widget.Tooltip = function (el, userConfig) { + YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig); + }; + + var Lang = YAHOO.lang, + Event = YAHOO.util.Event, + CustomEvent = YAHOO.util.CustomEvent, + Dom = YAHOO.util.Dom, + Tooltip = YAHOO.widget.Tooltip, + UA = YAHOO.env.ua, + bIEQuirks = (UA.ie && (UA.ie <= 6 || document.compatMode == "BackCompat")), + + m_oShadowTemplate, + + /** + * Constant representing the Tooltip's configuration properties + * @property DEFAULT_CONFIG + * @private + * @final + * @type Object + */ + DEFAULT_CONFIG = { + + "PREVENT_OVERLAP": { + key: "preventoverlap", + value: true, + validator: Lang.isBoolean, + supercedes: ["x", "y", "xy"] + }, + + "SHOW_DELAY": { + key: "showdelay", + value: 200, + validator: Lang.isNumber + }, + + "AUTO_DISMISS_DELAY": { + key: "autodismissdelay", + value: 5000, + validator: Lang.isNumber + }, + + "HIDE_DELAY": { + key: "hidedelay", + value: 250, + validator: Lang.isNumber + }, + + "TEXT": { + key: "text", + suppressEvent: true + }, + + "CONTAINER": { + key: "container" + }, + + "DISABLED": { + key: "disabled", + value: false, + suppressEvent: true + }, + + "XY_OFFSET": { + key: "xyoffset", + value: [0, 25], + suppressEvent: true + } + }, + + /** + * Constant representing the name of the Tooltip's events + * @property EVENT_TYPES + * @private + * @final + * @type Object + */ + EVENT_TYPES = { + "CONTEXT_MOUSE_OVER": "contextMouseOver", + "CONTEXT_MOUSE_OUT": "contextMouseOut", + "CONTEXT_TRIGGER": "contextTrigger" + }; + + /** + * Constant representing the Tooltip CSS class + * @property YAHOO.widget.Tooltip.CSS_TOOLTIP + * @static + * @final + * @type String + */ + Tooltip.CSS_TOOLTIP = "yui-tt"; + + function restoreOriginalWidth(sOriginalWidth, sForcedWidth) { + + var oConfig = this.cfg, + sCurrentWidth = oConfig.getProperty("width"); + + if (sCurrentWidth == sForcedWidth) { + oConfig.setProperty("width", sOriginalWidth); + } + } + + /* + changeContent event handler that sets a Tooltip instance's "width" + configuration property to the value of its root HTML + elements's offsetWidth if a specific width has not been set. + */ + + function setWidthToOffsetWidth(p_sType, p_aArgs) { + + if ("_originalWidth" in this) { + restoreOriginalWidth.call(this, this._originalWidth, this._forcedWidth); + } + + var oBody = document.body, + oConfig = this.cfg, + sOriginalWidth = oConfig.getProperty("width"), + sNewWidth, + oClone; + + if ((!sOriginalWidth || sOriginalWidth == "auto") && + (oConfig.getProperty("container") != oBody || + oConfig.getProperty("x") >= Dom.getViewportWidth() || + oConfig.getProperty("y") >= Dom.getViewportHeight())) { + + oClone = this.element.cloneNode(true); + oClone.style.visibility = "hidden"; + oClone.style.top = "0px"; + oClone.style.left = "0px"; + + oBody.appendChild(oClone); + + sNewWidth = (oClone.offsetWidth + "px"); + + oBody.removeChild(oClone); + oClone = null; + + oConfig.setProperty("width", sNewWidth); + oConfig.refireEvent("xy"); + + this._originalWidth = sOriginalWidth || ""; + this._forcedWidth = sNewWidth; + } + } + + // "onDOMReady" that renders the ToolTip + + function onDOMReady(p_sType, p_aArgs, p_oObject) { + this.render(p_oObject); + } + + // "init" event handler that automatically renders the Tooltip + + function onInit() { + Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this); + } + + YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { + + /** + * The Tooltip initialization method. This method is automatically + * called by the constructor. A Tooltip is automatically rendered by + * the init method, and it also is set to be invisible by default, + * and constrained to viewport by default as well. + * @method init + * @param {String} el The element ID representing the Tooltip OR + * @param {HTMLElement} el The element representing the Tooltip + * @param {Object} userConfig The configuration object literal + * containing the configuration that should be set for this Tooltip. + * See configuration documentation for more details. + */ + init: function (el, userConfig) { + + + Tooltip.superclass.init.call(this, el); + + this.beforeInitEvent.fire(Tooltip); + + Dom.addClass(this.element, Tooltip.CSS_TOOLTIP); + + if (userConfig) { + this.cfg.applyConfig(userConfig, true); + } + + this.cfg.queueProperty("visible", false); + this.cfg.queueProperty("constraintoviewport", true); + + this.setBody(""); + + this.subscribe("changeContent", setWidthToOffsetWidth); + this.subscribe("init", onInit); + this.subscribe("render", this.onRender); + + this.initEvent.fire(Tooltip); + }, + + /** + * Initializes the custom events for Tooltip + * @method initEvents + */ + initEvents: function () { + + Tooltip.superclass.initEvents.call(this); + var SIGNATURE = CustomEvent.LIST; + + /** + * CustomEvent fired when user mouses over a context element. Returning false from + * a subscriber to this event will prevent the tooltip from being displayed for + * the current context element. + * + * @event contextMouseOverEvent + * @param {HTMLElement} context The context element which the user just moused over + * @param {DOMEvent} e The DOM event object, associated with the mouse over + */ + this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER); + this.contextMouseOverEvent.signature = SIGNATURE; + + /** + * CustomEvent fired when the user mouses out of a context element. + * + * @event contextMouseOutEvent + * @param {HTMLElement} context The context element which the user just moused out of + * @param {DOMEvent} e The DOM event object, associated with the mouse out + */ + this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT); + this.contextMouseOutEvent.signature = SIGNATURE; + + /** + * CustomEvent fired just before the tooltip is displayed for the current context. + *

+ * You can subscribe to this event if you need to set up the text for the + * tooltip based on the context element for which it is about to be displayed. + *

+ *

This event differs from the beforeShow event in following respects:

+ *
    + *
  1. + * When moving from one context element to another, if the tooltip is not + * hidden (the hidedelay is not reached), the beforeShow and Show events will not + * be fired when the tooltip is displayed for the new context since it is already visible. + * However the contextTrigger event is always fired before displaying the tooltip for + * a new context. + *
  2. + *
  3. + * The trigger event provides access to the context element, allowing you to + * set the text of the tooltip based on context element for which the tooltip is + * triggered. + *
  4. + *
+ *

+ * It is not possible to prevent the tooltip from being displayed + * using this event. You can use the contextMouseOverEvent if you need to prevent + * the tooltip from being displayed. + *

+ * @event contextTriggerEvent + * @param {HTMLElement} context The context element for which the tooltip is triggered + */ + this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER); + this.contextTriggerEvent.signature = SIGNATURE; + }, + + /** + * Initializes the class's configurable properties which can be + * changed using the Overlay's Config object (cfg). + * @method initDefaultConfig + */ + initDefaultConfig: function () { + + Tooltip.superclass.initDefaultConfig.call(this); + + /** + * Specifies whether the Tooltip should be kept from overlapping + * its context element. + * @config preventoverlap + * @type Boolean + * @default true + */ + this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key, { + value: DEFAULT_CONFIG.PREVENT_OVERLAP.value, + validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, + supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes + }); + + /** + * The number of milliseconds to wait before showing a Tooltip + * on mouseover. + * @config showdelay + * @type Number + * @default 200 + */ + this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key, { + handler: this.configShowDelay, + value: 200, + validator: DEFAULT_CONFIG.SHOW_DELAY.validator + }); + + /** + * The number of milliseconds to wait before automatically + * dismissing a Tooltip after the mouse has been resting on the + * context element. + * @config autodismissdelay + * @type Number + * @default 5000 + */ + this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key, { + handler: this.configAutoDismissDelay, + value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value, + validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator + }); + + /** + * The number of milliseconds to wait before hiding a Tooltip + * after mouseout. + * @config hidedelay + * @type Number + * @default 250 + */ + this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key, { + handler: this.configHideDelay, + value: DEFAULT_CONFIG.HIDE_DELAY.value, + validator: DEFAULT_CONFIG.HIDE_DELAY.validator + }); + + /** + * Specifies the Tooltip's text. + * @config text + * @type String + * @default null + */ + this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, { + handler: this.configText, + suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent + }); + + /** + * Specifies the container element that the Tooltip's markup + * should be rendered into. + * @config container + * @type HTMLElement/String + * @default document.body + */ + this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key, { + handler: this.configContainer, + value: document.body + }); + + /** + * Specifies whether or not the tooltip is disabled. Disabled tooltips + * will not be displayed. If the tooltip is driven by the title attribute + * of the context element, the title attribute will still be removed for + * disabled tooltips, to prevent default tooltip behavior. + * + * @config disabled + * @type Boolean + * @default false + */ + this.cfg.addProperty(DEFAULT_CONFIG.DISABLED.key, { + handler: this.configContainer, + value: DEFAULT_CONFIG.DISABLED.value, + supressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent + }); + + /** + * Specifies the XY offset from the mouse position, where the tooltip should be displayed, specified + * as a 2 element array (e.g. [10, 20]); + * + * @config xyoffset + * @type Array + * @default [0, 25] + */ + this.cfg.addProperty(DEFAULT_CONFIG.XY_OFFSET.key, { + value: DEFAULT_CONFIG.XY_OFFSET.value.concat(), + supressEvent: DEFAULT_CONFIG.XY_OFFSET.suppressEvent + }); + + /** + * Specifies the element or elements that the Tooltip should be + * anchored to on mouseover. + * @config context + * @type HTMLElement[]/String[] + * @default null + */ + + /** + * String representing the width of the Tooltip. Please note: + * As of version 2.3 if either no value or a value of "auto" + * is specified, and the Toolip's "container" configuration property + * is set to something other than document.body or + * its "context" element resides outside the immediately visible + * portion of the document, the width of the Tooltip will be + * calculated based on the offsetWidth of its root HTML and set just + * before it is made visible. The original value will be + * restored when the Tooltip is hidden. This ensures the Tooltip is + * rendered at a usable width. For more information see + * YUILibrary bug #1685496 and YUILibrary + * bug #1735423. + * @config width + * @type String + * @default null + */ + + }, + + // BEGIN BUILT-IN PROPERTY EVENT HANDLERS // + + /** + * The default event handler fired when the "text" property is changed. + * @method configText + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configText: function (type, args, obj) { + var text = args[0]; + if (text) { + this.setBody(text); + } + }, + + /** + * The default event handler fired when the "container" property + * is changed. + * @method configContainer + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For + * configuration handlers, args[0] will equal the newly applied value + * for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configContainer: function (type, args, obj) { + var container = args[0]; + + if (typeof container == 'string') { + this.cfg.setProperty("container", document.getElementById(container), true); + } + }, + + /** + * @method _removeEventListeners + * @description Removes all of the DOM event handlers from the HTML + * element(s) that trigger the display of the tooltip. + * @protected + */ + _removeEventListeners: function () { + + var aElements = this._context, + nElements, + oElement, + i; + + if (aElements) { + nElements = aElements.length; + if (nElements > 0) { + i = nElements - 1; + do { + oElement = aElements[i]; + Event.removeListener(oElement, "mouseover", this.onContextMouseOver); + Event.removeListener(oElement, "mousemove", this.onContextMouseMove); + Event.removeListener(oElement, "mouseout", this.onContextMouseOut); + } + while (i--); + } + } + }, + + /** + * The default event handler fired when the "context" property + * is changed. + * @method configContext + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configContext: function (type, args, obj) { + + var context = args[0], + aElements, + nElements, + oElement, + i; + + if (context) { + + // Normalize parameter into an array + if (! (context instanceof Array)) { + if (typeof context == "string") { + this.cfg.setProperty("context", [document.getElementById(context)], true); + } else { // Assuming this is an element + this.cfg.setProperty("context", [context], true); + } + context = this.cfg.getProperty("context"); + } + + // Remove any existing mouseover/mouseout listeners + this._removeEventListeners(); + + // Add mouseover/mouseout listeners to context elements + this._context = context; + + aElements = this._context; + + if (aElements) { + nElements = aElements.length; + if (nElements > 0) { + i = nElements - 1; + do { + oElement = aElements[i]; + Event.on(oElement, "mouseover", this.onContextMouseOver, this); + Event.on(oElement, "mousemove", this.onContextMouseMove, this); + Event.on(oElement, "mouseout", this.onContextMouseOut, this); + } + while (i--); + } + } + } + }, + + // END BUILT-IN PROPERTY EVENT HANDLERS // + + // BEGIN BUILT-IN DOM EVENT HANDLERS // + + /** + * The default event handler fired when the user moves the mouse while + * over the context element. + * @method onContextMouseMove + * @param {DOMEvent} e The current DOM event + * @param {Object} obj The object argument + */ + onContextMouseMove: function (e, obj) { + obj.pageX = Event.getPageX(e); + obj.pageY = Event.getPageY(e); + }, + + /** + * The default event handler fired when the user mouses over the + * context element. + * @method onContextMouseOver + * @param {DOMEvent} e The current DOM event + * @param {Object} obj The object argument + */ + onContextMouseOver: function (e, obj) { + var context = this; + + if (context.title) { + obj._tempTitle = context.title; + context.title = ""; + } + + // Fire first, to honor disabled set in the listner + if (obj.fireEvent("contextMouseOver", context, e) !== false + && !obj.cfg.getProperty("disabled")) { + + // Stop the tooltip from being hidden (set on last mouseout) + if (obj.hideProcId) { + clearTimeout(obj.hideProcId); + obj.hideProcId = null; + } + + Event.on(context, "mousemove", obj.onContextMouseMove, obj); + + /** + * The unique process ID associated with the thread responsible + * for showing the Tooltip. + * @type int + */ + obj.showProcId = obj.doShow(e, context); + } + }, + + /** + * The default event handler fired when the user mouses out of + * the context element. + * @method onContextMouseOut + * @param {DOMEvent} e The current DOM event + * @param {Object} obj The object argument + */ + onContextMouseOut: function (e, obj) { + var el = this; + + if (obj._tempTitle) { + el.title = obj._tempTitle; + obj._tempTitle = null; + } + + if (obj.showProcId) { + clearTimeout(obj.showProcId); + obj.showProcId = null; + } + + if (obj.hideProcId) { + clearTimeout(obj.hideProcId); + obj.hideProcId = null; + } + + obj.fireEvent("contextMouseOut", el, e); + + obj.hideProcId = setTimeout(function () { + obj.hide(); + }, obj.cfg.getProperty("hidedelay")); + }, + + // END BUILT-IN DOM EVENT HANDLERS // + + /** + * Processes the showing of the Tooltip by setting the timeout delay + * and offset of the Tooltip. + * @method doShow + * @param {DOMEvent} e The current DOM event + * @param {HTMLElement} context The current context element + * @return {Number} The process ID of the timeout function associated + * with doShow + */ + doShow: function (e, context) { + + var offset = this.cfg.getProperty("xyoffset"), + xOffset = offset[0], + yOffset = offset[1], + me = this; + + if (UA.opera && context.tagName && + context.tagName.toUpperCase() == "A") { + yOffset += 12; + } + + return setTimeout(function () { + + var txt = me.cfg.getProperty("text"); + + // title does not over-ride text + if (me._tempTitle && (txt === "" || YAHOO.lang.isUndefined(txt) || YAHOO.lang.isNull(txt))) { + me.setBody(me._tempTitle); + } else { + me.cfg.refireEvent("text"); + } + + me.moveTo(me.pageX + xOffset, me.pageY + yOffset); + + if (me.cfg.getProperty("preventoverlap")) { + me.preventOverlap(me.pageX, me.pageY); + } + + Event.removeListener(context, "mousemove", me.onContextMouseMove); + + me.contextTriggerEvent.fire(context); + + me.show(); + + me.hideProcId = me.doHide(); + + }, this.cfg.getProperty("showdelay")); + }, + + /** + * Sets the timeout for the auto-dismiss delay, which by default is 5 + * seconds, meaning that a tooltip will automatically dismiss itself + * after 5 seconds of being displayed. + * @method doHide + */ + doHide: function () { + + var me = this; + + + return setTimeout(function () { + + me.hide(); + + }, this.cfg.getProperty("autodismissdelay")); + + }, + + /** + * Fired when the Tooltip is moved, this event handler is used to + * prevent the Tooltip from overlapping with its context element. + * @method preventOverlay + * @param {Number} pageX The x coordinate position of the mouse pointer + * @param {Number} pageY The y coordinate position of the mouse pointer + */ + preventOverlap: function (pageX, pageY) { + + var height = this.element.offsetHeight, + mousePoint = new YAHOO.util.Point(pageX, pageY), + elementRegion = Dom.getRegion(this.element); + + elementRegion.top -= 5; + elementRegion.left -= 5; + elementRegion.right += 5; + elementRegion.bottom += 5; + + + if (elementRegion.contains(mousePoint)) { + this.cfg.setProperty("y", (pageY - height - 5)); + } + }, + + + /** + * @method onRender + * @description "render" event handler for the Tooltip. + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + */ + onRender: function (p_sType, p_aArgs) { + + function sizeShadow() { + + var oElement = this.element, + oShadow = this.underlay; + + if (oShadow) { + oShadow.style.width = (oElement.offsetWidth + 6) + "px"; + oShadow.style.height = (oElement.offsetHeight + 1) + "px"; + } + + } + + function addShadowVisibleClass() { + Dom.addClass(this.underlay, "yui-tt-shadow-visible"); + + if (UA.ie) { + this.forceUnderlayRedraw(); + } + } + + function removeShadowVisibleClass() { + Dom.removeClass(this.underlay, "yui-tt-shadow-visible"); + } + + function createShadow() { + + var oShadow = this.underlay, + oElement, + Module, + nIE, + me; + + if (!oShadow) { + + oElement = this.element; + Module = YAHOO.widget.Module; + nIE = UA.ie; + me = this; + + if (!m_oShadowTemplate) { + m_oShadowTemplate = document.createElement("div"); + m_oShadowTemplate.className = "yui-tt-shadow"; + } + + oShadow = m_oShadowTemplate.cloneNode(false); + + oElement.appendChild(oShadow); + + this.underlay = oShadow; + + // Backward compatibility, even though it's probably + // intended to be "private", it isn't marked as such in the api docs + this._shadow = this.underlay; + + addShadowVisibleClass.call(this); + + this.subscribe("beforeShow", addShadowVisibleClass); + this.subscribe("hide", removeShadowVisibleClass); + + if (bIEQuirks) { + window.setTimeout(function () { + sizeShadow.call(me); + }, 0); + + this.cfg.subscribeToConfigEvent("width", sizeShadow); + this.cfg.subscribeToConfigEvent("height", sizeShadow); + this.subscribe("changeContent", sizeShadow); + + Module.textResizeEvent.subscribe(sizeShadow, this, true); + this.subscribe("destroy", function () { + Module.textResizeEvent.unsubscribe(sizeShadow, this); + }); + } + } + } + + function onBeforeShow() { + createShadow.call(this); + this.unsubscribe("beforeShow", onBeforeShow); + } + + if (this.cfg.getProperty("visible")) { + createShadow.call(this); + } else { + this.subscribe("beforeShow", onBeforeShow); + } + + }, + + /** + * Forces the underlay element to be repainted, through the application/removal + * of a yui-force-redraw class to the underlay element. + * + * @method forceUnderlayRedraw + */ + forceUnderlayRedraw : function() { + var tt = this; + Dom.addClass(tt.underlay, "yui-force-redraw"); + setTimeout(function() {Dom.removeClass(tt.underlay, "yui-force-redraw");}, 0); + }, + + /** + * Removes the Tooltip element from the DOM and sets all child + * elements to null. + * @method destroy + */ + destroy: function () { + + // Remove any existing mouseover/mouseout listeners + this._removeEventListeners(); + + Tooltip.superclass.destroy.call(this); + + }, + + /** + * Returns a string representation of the object. + * @method toString + * @return {String} The string representation of the Tooltip + */ + toString: function () { + return "Tooltip " + this.id; + } + + }); + +}()); +(function () { + + /** + * Panel is an implementation of Overlay that behaves like an OS window, + * with a draggable header and an optional close icon at the top right. + * @namespace YAHOO.widget + * @class Panel + * @extends YAHOO.widget.Overlay + * @constructor + * @param {String} el The element ID representing the Panel OR + * @param {HTMLElement} el The element representing the Panel + * @param {Object} userConfig The configuration object literal containing + * the configuration that should be set for this Panel. See configuration + * documentation for more details. + */ + YAHOO.widget.Panel = function (el, userConfig) { + YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig); + }; + + var _currentModal = null; + + var Lang = YAHOO.lang, + Util = YAHOO.util, + Dom = Util.Dom, + Event = Util.Event, + CustomEvent = Util.CustomEvent, + KeyListener = YAHOO.util.KeyListener, + Config = Util.Config, + Overlay = YAHOO.widget.Overlay, + Panel = YAHOO.widget.Panel, + UA = YAHOO.env.ua, + + bIEQuirks = (UA.ie && (UA.ie <= 6 || document.compatMode == "BackCompat")), + + m_oMaskTemplate, + m_oUnderlayTemplate, + m_oCloseIconTemplate, + + /** + * Constant representing the name of the Panel's events + * @property EVENT_TYPES + * @private + * @final + * @type Object + */ + EVENT_TYPES = { + "SHOW_MASK": "showMask", + "HIDE_MASK": "hideMask", + "DRAG": "drag" + }, + + /** + * Constant representing the Panel's configuration properties + * @property DEFAULT_CONFIG + * @private + * @final + * @type Object + */ + DEFAULT_CONFIG = { + + "CLOSE": { + key: "close", + value: true, + validator: Lang.isBoolean, + supercedes: ["visible"] + }, + + "DRAGGABLE": { + key: "draggable", + value: (Util.DD ? true : false), + validator: Lang.isBoolean, + supercedes: ["visible"] + }, + + "DRAG_ONLY" : { + key: "dragonly", + value: false, + validator: Lang.isBoolean, + supercedes: ["draggable"] + }, + + "UNDERLAY": { + key: "underlay", + value: "shadow", + supercedes: ["visible"] + }, + + "MODAL": { + key: "modal", + value: false, + validator: Lang.isBoolean, + supercedes: ["visible", "zindex"] + }, + + "KEY_LISTENERS": { + key: "keylisteners", + suppressEvent: true, + supercedes: ["visible"] + }, + + "STRINGS" : { + key: "strings", + supercedes: ["close"], + validator: Lang.isObject, + value: { + close: "Close" + } + } + }; + + /** + * Constant representing the default CSS class used for a Panel + * @property YAHOO.widget.Panel.CSS_PANEL + * @static + * @final + * @type String + */ + Panel.CSS_PANEL = "yui-panel"; + + /** + * Constant representing the default CSS class used for a Panel's + * wrapping container + * @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER + * @static + * @final + * @type String + */ + Panel.CSS_PANEL_CONTAINER = "yui-panel-container"; + + /** + * Constant representing the default set of focusable elements + * on the pagewhich Modal Panels will prevent access to, when + * the modal mask is displayed + * + * @property YAHOO.widget.Panel.FOCUSABLE + * @static + * @type Array + */ + Panel.FOCUSABLE = [ + "a", + "button", + "select", + "textarea", + "input", + "iframe" + ]; + + // Private CustomEvent listeners + + /* + "beforeRender" event handler that creates an empty header for a Panel + instance if its "draggable" configuration property is set to "true" + and no header has been created. + */ + + function createHeader(p_sType, p_aArgs) { + if (!this.header && this.cfg.getProperty("draggable")) { + this.setHeader(" "); + } + } + + /* + "hide" event handler that sets a Panel instance's "width" + configuration property back to its original value before + "setWidthToOffsetWidth" was called. + */ + + function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) { + + var sOriginalWidth = p_oObject[0], + sNewWidth = p_oObject[1], + oConfig = this.cfg, + sCurrentWidth = oConfig.getProperty("width"); + + if (sCurrentWidth == sNewWidth) { + oConfig.setProperty("width", sOriginalWidth); + } + + this.unsubscribe("hide", restoreOriginalWidth, p_oObject); + } + + /* + "beforeShow" event handler that sets a Panel instance's "width" + configuration property to the value of its root HTML + elements's offsetWidth + */ + + function setWidthToOffsetWidth(p_sType, p_aArgs) { + + var oConfig, + sOriginalWidth, + sNewWidth; + + if (bIEQuirks) { + + oConfig = this.cfg; + sOriginalWidth = oConfig.getProperty("width"); + + if (!sOriginalWidth || sOriginalWidth == "auto") { + + sNewWidth = (this.element.offsetWidth + "px"); + + oConfig.setProperty("width", sNewWidth); + + this.subscribe("hide", restoreOriginalWidth, + [(sOriginalWidth || ""), sNewWidth]); + + } + } + } + + YAHOO.extend(Panel, Overlay, { + + /** + * The Overlay initialization method, which is executed for Overlay and + * all of its subclasses. This method is automatically called by the + * constructor, and sets up all DOM references for pre-existing markup, + * and creates required markup if it is not already present. + * @method init + * @param {String} el The element ID representing the Overlay OR + * @param {HTMLElement} el The element representing the Overlay + * @param {Object} userConfig The configuration object literal + * containing the configuration that should be set for this Overlay. + * See configuration documentation for more details. + */ + init: function (el, userConfig) { + /* + Note that we don't pass the user config in here yet because + we only want it executed once, at the lowest subclass level + */ + + Panel.superclass.init.call(this, el/*, userConfig*/); + + this.beforeInitEvent.fire(Panel); + + Dom.addClass(this.element, Panel.CSS_PANEL); + + this.buildWrapper(); + + if (userConfig) { + this.cfg.applyConfig(userConfig, true); + } + + this.subscribe("showMask", this._addFocusHandlers); + this.subscribe("hideMask", this._removeFocusHandlers); + this.subscribe("beforeRender", createHeader); + + this.subscribe("render", function() { + this.setFirstLastFocusable(); + this.subscribe("changeContent", this.setFirstLastFocusable); + }); + + this.subscribe("show", this.focusFirst); + + this.initEvent.fire(Panel); + }, + + /** + * @method _onElementFocus + * @private + * + * "focus" event handler for a focuable element. Used to automatically + * blur the element when it receives focus to ensure that a Panel + * instance's modality is not compromised. + * + * @param {Event} e The DOM event object + */ + _onElementFocus : function(e){ + + if(_currentModal === this) { + + var target = Event.getTarget(e), + doc = document.documentElement, + insideDoc = (target !== doc && target !== window); + + // mask and documentElement checks added for IE, which focuses on the mask when it's clicked on, and focuses on + // the documentElement, when the document scrollbars are clicked on + if (insideDoc && target !== this.element && target !== this.mask && !Dom.isAncestor(this.element, target)) { + try { + if (this.firstElement) { + this.firstElement.focus(); + } else { + if (this._modalFocus) { + this._modalFocus.focus(); + } else { + this.innerElement.focus(); + } + } + } catch(err){ + // Just in case we fail to focus + try { + if (insideDoc && target !== document.body) { + target.blur(); + } + } catch(err2) { } + } + } + } + }, + + /** + * @method _addFocusHandlers + * @protected + * + * "showMask" event handler that adds a "focus" event handler to all + * focusable elements in the document to enforce a Panel instance's + * modality from being compromised. + * + * @param p_sType {String} Custom event type + * @param p_aArgs {Array} Custom event arguments + */ + _addFocusHandlers: function(p_sType, p_aArgs) { + if (!this.firstElement) { + if (UA.webkit || UA.opera) { + if (!this._modalFocus) { + this._createHiddenFocusElement(); + } + } else { + this.innerElement.tabIndex = 0; + } + } + this.setTabLoop(this.firstElement, this.lastElement); + Event.onFocus(document.documentElement, this._onElementFocus, this, true); + _currentModal = this; + }, + + /** + * Creates a hidden focusable element, used to focus on, + * to enforce modality for browsers in which focus cannot + * be applied to the container box. + * + * @method _createHiddenFocusElement + * @private + */ + _createHiddenFocusElement : function() { + var e = document.createElement("button"); + e.style.height = "1px"; + e.style.width = "1px"; + e.style.position = "absolute"; + e.style.left = "-10000em"; + e.style.opacity = 0; + e.tabIndex = -1; + this.innerElement.appendChild(e); + this._modalFocus = e; + }, + + /** + * @method _removeFocusHandlers + * @protected + * + * "hideMask" event handler that removes all "focus" event handlers added + * by the "addFocusEventHandlers" method. + * + * @param p_sType {String} Event type + * @param p_aArgs {Array} Event Arguments + */ + _removeFocusHandlers: function(p_sType, p_aArgs) { + Event.removeFocusListener(document.documentElement, this._onElementFocus, this); + + if (_currentModal == this) { + _currentModal = null; + } + }, + + /** + * Sets focus to the first element in the Panel. + * + * @method focusFirst + */ + focusFirst: function (type, args, obj) { + var el = this.firstElement; + + if (args && args[1]) { + Event.stopEvent(args[1]); + } + + if (el) { + try { + el.focus(); + } catch(err) { + // Ignore + } + } + }, + + /** + * Sets focus to the last element in the Panel. + * + * @method focusLast + */ + focusLast: function (type, args, obj) { + var el = this.lastElement; + + if (args && args[1]) { + Event.stopEvent(args[1]); + } + + if (el) { + try { + el.focus(); + } catch(err) { + // Ignore + } + } + }, + + /** + * Sets up a tab, shift-tab loop between the first and last elements + * provided. NOTE: Sets up the preventBackTab and preventTabOut KeyListener + * instance properties, which are reset everytime this method is invoked. + * + * @method setTabLoop + * @param {HTMLElement} firstElement + * @param {HTMLElement} lastElement + * + */ + setTabLoop : function(firstElement, lastElement) { + + var backTab = this.preventBackTab, tab = this.preventTabOut, + showEvent = this.showEvent, hideEvent = this.hideEvent; + + if (backTab) { + backTab.disable(); + showEvent.unsubscribe(backTab.enable, backTab); + hideEvent.unsubscribe(backTab.disable, backTab); + backTab = this.preventBackTab = null; + } + + if (tab) { + tab.disable(); + showEvent.unsubscribe(tab.enable, tab); + hideEvent.unsubscribe(tab.disable,tab); + tab = this.preventTabOut = null; + } + + if (firstElement) { + this.preventBackTab = new KeyListener(firstElement, + {shift:true, keys:9}, + {fn:this.focusLast, scope:this, correctScope:true} + ); + backTab = this.preventBackTab; + + showEvent.subscribe(backTab.enable, backTab, true); + hideEvent.subscribe(backTab.disable,backTab, true); + } + + if (lastElement) { + this.preventTabOut = new KeyListener(lastElement, + {shift:false, keys:9}, + {fn:this.focusFirst, scope:this, correctScope:true} + ); + tab = this.preventTabOut; + + showEvent.subscribe(tab.enable, tab, true); + hideEvent.subscribe(tab.disable,tab, true); + } + }, + + /** + * Returns an array of the currently focusable items which reside within + * Panel. The set of focusable elements the method looks for are defined + * in the Panel.FOCUSABLE static property + * + * @method getFocusableElements + * @param {HTMLElement} root element to start from. + */ + getFocusableElements : function(root) { + + root = root || this.innerElement; + + var focusable = {}; + for (var i = 0; i < Panel.FOCUSABLE.length; i++) { + focusable[Panel.FOCUSABLE[i]] = true; + } + + function isFocusable(el) { + if (el.focus && el.type !== "hidden" && !el.disabled && focusable[el.tagName.toLowerCase()]) { + return true; + } + return false; + } + + // Not looking by Tag, since we want elements in DOM order + return Dom.getElementsBy(isFocusable, null, root); + }, + + /** + * Sets the firstElement and lastElement instance properties + * to the first and last focusable elements in the Panel. + * + * @method setFirstLastFocusable + */ + setFirstLastFocusable : function() { + + this.firstElement = null; + this.lastElement = null; + + var elements = this.getFocusableElements(); + this.focusableElements = elements; + + if (elements.length > 0) { + this.firstElement = elements[0]; + this.lastElement = elements[elements.length - 1]; + } + + if (this.cfg.getProperty("modal")) { + this.setTabLoop(this.firstElement, this.lastElement); + } + }, + + /** + * Initializes the custom events for Module which are fired + * automatically at appropriate times by the Module class. + */ + initEvents: function () { + Panel.superclass.initEvents.call(this); + + var SIGNATURE = CustomEvent.LIST; + + /** + * CustomEvent fired after the modality mask is shown + * @event showMaskEvent + */ + this.showMaskEvent = this.createEvent(EVENT_TYPES.SHOW_MASK); + this.showMaskEvent.signature = SIGNATURE; + + /** + * CustomEvent fired after the modality mask is hidden + * @event hideMaskEvent + */ + this.hideMaskEvent = this.createEvent(EVENT_TYPES.HIDE_MASK); + this.hideMaskEvent.signature = SIGNATURE; + + /** + * CustomEvent when the Panel is dragged + * @event dragEvent + */ + this.dragEvent = this.createEvent(EVENT_TYPES.DRAG); + this.dragEvent.signature = SIGNATURE; + }, + + /** + * Initializes the class's configurable properties which can be changed + * using the Panel's Config object (cfg). + * @method initDefaultConfig + */ + initDefaultConfig: function () { + Panel.superclass.initDefaultConfig.call(this); + + // Add panel config properties // + + /** + * True if the Panel should display a "close" button + * @config close + * @type Boolean + * @default true + */ + this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key, { + handler: this.configClose, + value: DEFAULT_CONFIG.CLOSE.value, + validator: DEFAULT_CONFIG.CLOSE.validator, + supercedes: DEFAULT_CONFIG.CLOSE.supercedes + }); + + /** + * Boolean specifying if the Panel should be draggable. The default + * value is "true" if the Drag and Drop utility is included, + * otherwise it is "false." PLEASE NOTE: There is a + * known issue in IE 6 (Strict Mode and Quirks Mode) and IE 7 + * (Quirks Mode) where Panels that either don't have a value set for + * their "width" configuration property, or their "width" + * configuration property is set to "auto" will only be draggable by + * placing the mouse on the text of the Panel's header element. + * To fix this bug, draggable Panels missing a value for their + * "width" configuration property, or whose "width" configuration + * property is set to "auto" will have it set to the value of + * their root HTML element's offsetWidth before they are made + * visible. The calculated width is then removed when the Panel is + * hidden. This fix is only applied to draggable Panels in IE 6 + * (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode). For + * more information on this issue see: + * YUILibrary bugs #1726972 and #1589210. + * @config draggable + * @type Boolean + * @default true + */ + this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key, { + handler: this.configDraggable, + value: (Util.DD) ? true : false, + validator: DEFAULT_CONFIG.DRAGGABLE.validator, + supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes + }); + + /** + * Boolean specifying if the draggable Panel should be drag only, not interacting with drop + * targets on the page. + *

+ * When set to true, draggable Panels will not check to see if they are over drop targets, + * or fire the DragDrop events required to support drop target interaction (onDragEnter, + * onDragOver, onDragOut, onDragDrop etc.). + * If the Panel is not designed to be dropped on any target elements on the page, then this + * flag can be set to true to improve performance. + *

+ *

+ * When set to false, all drop target related events will be fired. + *

+ *

+ * The property is set to false by default to maintain backwards compatibility but should be + * set to true if drop target interaction is not required for the Panel, to improve performance.

+ * + * @config dragOnly + * @type Boolean + * @default false + */ + this.cfg.addProperty(DEFAULT_CONFIG.DRAG_ONLY.key, { + value: DEFAULT_CONFIG.DRAG_ONLY.value, + validator: DEFAULT_CONFIG.DRAG_ONLY.validator, + supercedes: DEFAULT_CONFIG.DRAG_ONLY.supercedes + }); + + /** + * Sets the type of underlay to display for the Panel. Valid values + * are "shadow," "matte," and "none". PLEASE NOTE: + * The creation of the underlay element is deferred until the Panel + * is initially made visible. For Gecko-based browsers on Mac + * OS X the underlay elment is always created as it is used as a + * shim to prevent Aqua scrollbars below a Panel instance from poking + * through it (See YUILibrary bug #1723530). + * @config underlay + * @type String + * @default shadow + */ + this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key, { + handler: this.configUnderlay, + value: DEFAULT_CONFIG.UNDERLAY.value, + supercedes: DEFAULT_CONFIG.UNDERLAY.supercedes + }); + + /** + * True if the Panel should be displayed in a modal fashion, + * automatically creating a transparent mask over the document that + * will not be removed until the Panel is dismissed. + * @config modal + * @type Boolean + * @default false + */ + this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key, { + handler: this.configModal, + value: DEFAULT_CONFIG.MODAL.value, + validator: DEFAULT_CONFIG.MODAL.validator, + supercedes: DEFAULT_CONFIG.MODAL.supercedes + }); + + /** + * A KeyListener (or array of KeyListeners) that will be enabled + * when the Panel is shown, and disabled when the Panel is hidden. + * @config keylisteners + * @type YAHOO.util.KeyListener[] + * @default null + */ + this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key, { + handler: this.configKeyListeners, + suppressEvent: DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent, + supercedes: DEFAULT_CONFIG.KEY_LISTENERS.supercedes + }); + + /** + * UI Strings used by the Panel + * + * @config strings + * @type Object + * @default An object literal with the properties shown below: + *
+ *
close
String : The string to use for the close icon. Defaults to "Close".
+ *
+ */ + this.cfg.addProperty(DEFAULT_CONFIG.STRINGS.key, { + value:DEFAULT_CONFIG.STRINGS.value, + handler:this.configStrings, + validator:DEFAULT_CONFIG.STRINGS.validator, + supercedes:DEFAULT_CONFIG.STRINGS.supercedes + }); + }, + + // BEGIN BUILT-IN PROPERTY EVENT HANDLERS // + + /** + * The default event handler fired when the "close" property is changed. + * The method controls the appending or hiding of the close icon at the + * top right of the Panel. + * @method configClose + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configClose: function (type, args, obj) { + + var val = args[0], + oClose = this.close, + strings = this.cfg.getProperty("strings"); + + if (val) { + if (!oClose) { + + if (!m_oCloseIconTemplate) { + m_oCloseIconTemplate = document.createElement("a"); + m_oCloseIconTemplate.className = "container-close"; + m_oCloseIconTemplate.href = "#"; + } + + oClose = m_oCloseIconTemplate.cloneNode(true); + this.innerElement.appendChild(oClose); + + oClose.innerHTML = (strings && strings.close) ? strings.close : " "; + + Event.on(oClose, "click", this._doClose, this, true); + + this.close = oClose; + + } else { + oClose.style.display = "block"; + } + + } else { + if (oClose) { + oClose.style.display = "none"; + } + } + + }, + + /** + * Event handler for the close icon + * + * @method _doClose + * @protected + * + * @param {DOMEvent} e + */ + _doClose : function (e) { + Event.preventDefault(e); + this.hide(); + }, + + /** + * The default event handler fired when the "draggable" property + * is changed. + * @method configDraggable + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configDraggable: function (type, args, obj) { + var val = args[0]; + + if (val) { + if (!Util.DD) { + this.cfg.setProperty("draggable", false); + return; + } + + if (this.header) { + Dom.setStyle(this.header, "cursor", "move"); + this.registerDragDrop(); + } + + this.subscribe("beforeShow", setWidthToOffsetWidth); + + } else { + + if (this.dd) { + this.dd.unreg(); + } + + if (this.header) { + Dom.setStyle(this.header,"cursor","auto"); + } + + this.unsubscribe("beforeShow", setWidthToOffsetWidth); + } + }, + + /** + * The default event handler fired when the "underlay" property + * is changed. + * @method configUnderlay + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configUnderlay: function (type, args, obj) { + + var bMacGecko = (this.platform == "mac" && UA.gecko), + sUnderlay = args[0].toLowerCase(), + oUnderlay = this.underlay, + oElement = this.element; + + function createUnderlay() { + var bNew = false; + if (!oUnderlay) { // create if not already in DOM + + if (!m_oUnderlayTemplate) { + m_oUnderlayTemplate = document.createElement("div"); + m_oUnderlayTemplate.className = "underlay"; + } + + oUnderlay = m_oUnderlayTemplate.cloneNode(false); + this.element.appendChild(oUnderlay); + + this.underlay = oUnderlay; + + if (bIEQuirks) { + this.sizeUnderlay(); + this.cfg.subscribeToConfigEvent("width", this.sizeUnderlay); + this.cfg.subscribeToConfigEvent("height", this.sizeUnderlay); + + this.changeContentEvent.subscribe(this.sizeUnderlay); + YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay, this, true); + } + + if (UA.webkit && UA.webkit < 420) { + this.changeContentEvent.subscribe(this.forceUnderlayRedraw); + } + + bNew = true; + } + } + + function onBeforeShow() { + var bNew = createUnderlay.call(this); + if (!bNew && bIEQuirks) { + this.sizeUnderlay(); + } + this._underlayDeferred = false; + this.beforeShowEvent.unsubscribe(onBeforeShow); + } + + function destroyUnderlay() { + if (this._underlayDeferred) { + this.beforeShowEvent.unsubscribe(onBeforeShow); + this._underlayDeferred = false; + } + + if (oUnderlay) { + this.cfg.unsubscribeFromConfigEvent("width", this.sizeUnderlay); + this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay); + this.changeContentEvent.unsubscribe(this.sizeUnderlay); + this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw); + YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay, this, true); + + this.element.removeChild(oUnderlay); + + this.underlay = null; + } + } + + switch (sUnderlay) { + case "shadow": + Dom.removeClass(oElement, "matte"); + Dom.addClass(oElement, "shadow"); + break; + case "matte": + if (!bMacGecko) { + destroyUnderlay.call(this); + } + Dom.removeClass(oElement, "shadow"); + Dom.addClass(oElement, "matte"); + break; + default: + if (!bMacGecko) { + destroyUnderlay.call(this); + } + Dom.removeClass(oElement, "shadow"); + Dom.removeClass(oElement, "matte"); + break; + } + + if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) { + if (this.cfg.getProperty("visible")) { + var bNew = createUnderlay.call(this); + if (!bNew && bIEQuirks) { + this.sizeUnderlay(); + } + } else { + if (!this._underlayDeferred) { + this.beforeShowEvent.subscribe(onBeforeShow); + this._underlayDeferred = true; + } + } + } + }, + + /** + * The default event handler fired when the "modal" property is + * changed. This handler subscribes or unsubscribes to the show and hide + * events to handle the display or hide of the modality mask. + * @method configModal + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configModal: function (type, args, obj) { + + var modal = args[0]; + if (modal) { + if (!this._hasModalityEventListeners) { + + this.subscribe("beforeShow", this.buildMask); + this.subscribe("beforeShow", this.bringToTop); + this.subscribe("beforeShow", this.showMask); + this.subscribe("hide", this.hideMask); + + Overlay.windowResizeEvent.subscribe(this.sizeMask, + this, true); + + this._hasModalityEventListeners = true; + } + } else { + if (this._hasModalityEventListeners) { + + if (this.cfg.getProperty("visible")) { + this.hideMask(); + this.removeMask(); + } + + this.unsubscribe("beforeShow", this.buildMask); + this.unsubscribe("beforeShow", this.bringToTop); + this.unsubscribe("beforeShow", this.showMask); + this.unsubscribe("hide", this.hideMask); + + Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this); + + this._hasModalityEventListeners = false; + } + } + }, + + /** + * Removes the modality mask. + * @method removeMask + */ + removeMask: function () { + + var oMask = this.mask, + oParentNode; + + if (oMask) { + /* + Hide the mask before destroying it to ensure that DOM + event handlers on focusable elements get removed. + */ + this.hideMask(); + + oParentNode = oMask.parentNode; + if (oParentNode) { + oParentNode.removeChild(oMask); + } + + this.mask = null; + } + }, + + /** + * The default event handler fired when the "keylisteners" property + * is changed. + * @method configKeyListeners + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configKeyListeners: function (type, args, obj) { + + var listeners = args[0], + listener, + nListeners, + i; + + if (listeners) { + + if (listeners instanceof Array) { + + nListeners = listeners.length; + + for (i = 0; i < nListeners; i++) { + + listener = listeners[i]; + + if (!Config.alreadySubscribed(this.showEvent, + listener.enable, listener)) { + + this.showEvent.subscribe(listener.enable, + listener, true); + + } + + if (!Config.alreadySubscribed(this.hideEvent, + listener.disable, listener)) { + + this.hideEvent.subscribe(listener.disable, + listener, true); + + this.destroyEvent.subscribe(listener.disable, + listener, true); + } + } + + } else { + + if (!Config.alreadySubscribed(this.showEvent, + listeners.enable, listeners)) { + + this.showEvent.subscribe(listeners.enable, + listeners, true); + } + + if (!Config.alreadySubscribed(this.hideEvent, + listeners.disable, listeners)) { + + this.hideEvent.subscribe(listeners.disable, + listeners, true); + + this.destroyEvent.subscribe(listeners.disable, + listeners, true); + + } + + } + + } + + }, + + /** + * The default handler for the "strings" property + * @method configStrings + */ + configStrings : function(type, args, obj) { + var val = Lang.merge(DEFAULT_CONFIG.STRINGS.value, args[0]); + this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key, val, true); + }, + + /** + * The default event handler fired when the "height" property is changed. + * @method configHeight + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configHeight: function (type, args, obj) { + var height = args[0], + el = this.innerElement; + + Dom.setStyle(el, "height", height); + this.cfg.refireEvent("iframe"); + }, + + /** + * The default custom event handler executed when the Panel's height is changed, + * if the autofillheight property has been set. + * + * @method _autoFillOnHeightChange + * @protected + * @param {String} type The event type + * @param {Array} args The array of arguments passed to event subscribers + * @param {HTMLElement} el The header, body or footer element which is to be resized to fill + * out the containers height + */ + _autoFillOnHeightChange : function(type, args, el) { + Panel.superclass._autoFillOnHeightChange.apply(this, arguments); + if (bIEQuirks) { + var panel = this; + setTimeout(function() { + panel.sizeUnderlay(); + },0); + } + }, + + /** + * The default event handler fired when the "width" property is changed. + * @method configWidth + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configWidth: function (type, args, obj) { + + var width = args[0], + el = this.innerElement; + + Dom.setStyle(el, "width", width); + this.cfg.refireEvent("iframe"); + + }, + + /** + * The default event handler fired when the "zIndex" property is changed. + * @method configzIndex + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configzIndex: function (type, args, obj) { + Panel.superclass.configzIndex.call(this, type, args, obj); + + if (this.mask || this.cfg.getProperty("modal") === true) { + var panelZ = Dom.getStyle(this.element, "zIndex"); + if (!panelZ || isNaN(panelZ)) { + panelZ = 0; + } + + if (panelZ === 0) { + // Recursive call to configzindex (which should be stopped + // from going further because panelZ should no longer === 0) + this.cfg.setProperty("zIndex", 1); + } else { + this.stackMask(); + } + } + }, + + // END BUILT-IN PROPERTY EVENT HANDLERS // + /** + * Builds the wrapping container around the Panel that is used for + * positioning the shadow and matte underlays. The container element is + * assigned to a local instance variable called container, and the + * element is reinserted inside of it. + * @method buildWrapper + */ + buildWrapper: function () { + + var elementParent = this.element.parentNode, + originalElement = this.element, + wrapper = document.createElement("div"); + + wrapper.className = Panel.CSS_PANEL_CONTAINER; + wrapper.id = originalElement.id + "_c"; + + if (elementParent) { + elementParent.insertBefore(wrapper, originalElement); + } + + wrapper.appendChild(originalElement); + + this.element = wrapper; + this.innerElement = originalElement; + + Dom.setStyle(this.innerElement, "visibility", "inherit"); + }, + + /** + * Adjusts the size of the shadow based on the size of the element. + * @method sizeUnderlay + */ + sizeUnderlay: function () { + var oUnderlay = this.underlay, + oElement; + + if (oUnderlay) { + oElement = this.element; + oUnderlay.style.width = oElement.offsetWidth + "px"; + oUnderlay.style.height = oElement.offsetHeight + "px"; + } + }, + + /** + * Registers the Panel's header for drag & drop capability. + * @method registerDragDrop + */ + registerDragDrop: function () { + + var me = this; + + if (this.header) { + + if (!Util.DD) { + return; + } + + var bDragOnly = (this.cfg.getProperty("dragonly") === true); + + /** + * The YAHOO.util.DD instance, used to implement the draggable header for the panel if draggable is enabled + * + * @property dd + * @type YAHOO.util.DD + */ + this.dd = new Util.DD(this.element.id, this.id, {dragOnly: bDragOnly}); + + if (!this.header.id) { + this.header.id = this.id + "_h"; + } + + this.dd.startDrag = function () { + + var offsetHeight, + offsetWidth, + viewPortWidth, + viewPortHeight, + scrollX, + scrollY; + + if (YAHOO.env.ua.ie == 6) { + Dom.addClass(me.element,"drag"); + } + + if (me.cfg.getProperty("constraintoviewport")) { + + var nViewportOffset = Overlay.VIEWPORT_OFFSET; + + offsetHeight = me.element.offsetHeight; + offsetWidth = me.element.offsetWidth; + + viewPortWidth = Dom.getViewportWidth(); + viewPortHeight = Dom.getViewportHeight(); + + scrollX = Dom.getDocumentScrollLeft(); + scrollY = Dom.getDocumentScrollTop(); + + if (offsetHeight + nViewportOffset < viewPortHeight) { + this.minY = scrollY + nViewportOffset; + this.maxY = scrollY + viewPortHeight - offsetHeight - nViewportOffset; + } else { + this.minY = scrollY + nViewportOffset; + this.maxY = scrollY + nViewportOffset; + } + + if (offsetWidth + nViewportOffset < viewPortWidth) { + this.minX = scrollX + nViewportOffset; + this.maxX = scrollX + viewPortWidth - offsetWidth - nViewportOffset; + } else { + this.minX = scrollX + nViewportOffset; + this.maxX = scrollX + nViewportOffset; + } + + this.constrainX = true; + this.constrainY = true; + } else { + this.constrainX = false; + this.constrainY = false; + } + + me.dragEvent.fire("startDrag", arguments); + }; + + this.dd.onDrag = function () { + me.syncPosition(); + me.cfg.refireEvent("iframe"); + if (this.platform == "mac" && YAHOO.env.ua.gecko) { + this.showMacGeckoScrollbars(); + } + + me.dragEvent.fire("onDrag", arguments); + }; + + this.dd.endDrag = function () { + + if (YAHOO.env.ua.ie == 6) { + Dom.removeClass(me.element,"drag"); + } + + me.dragEvent.fire("endDrag", arguments); + me.moveEvent.fire(me.cfg.getProperty("xy")); + + }; + + this.dd.setHandleElId(this.header.id); + this.dd.addInvalidHandleType("INPUT"); + this.dd.addInvalidHandleType("SELECT"); + this.dd.addInvalidHandleType("TEXTAREA"); + } + }, + + /** + * Builds the mask that is laid over the document when the Panel is + * configured to be modal. + * @method buildMask + */ + buildMask: function () { + var oMask = this.mask; + if (!oMask) { + if (!m_oMaskTemplate) { + m_oMaskTemplate = document.createElement("div"); + m_oMaskTemplate.className = "mask"; + m_oMaskTemplate.innerHTML = " "; + } + oMask = m_oMaskTemplate.cloneNode(true); + oMask.id = this.id + "_mask"; + + document.body.insertBefore(oMask, document.body.firstChild); + + this.mask = oMask; + + if (YAHOO.env.ua.gecko && this.platform == "mac") { + Dom.addClass(this.mask, "block-scrollbars"); + } + + // Stack mask based on the element zindex + this.stackMask(); + } + }, + + /** + * Hides the modality mask. + * @method hideMask + */ + hideMask: function () { + if (this.cfg.getProperty("modal") && this.mask) { + this.mask.style.display = "none"; + Dom.removeClass(document.body, "masked"); + this.hideMaskEvent.fire(); + } + }, + + /** + * Shows the modality mask. + * @method showMask + */ + showMask: function () { + if (this.cfg.getProperty("modal") && this.mask) { + Dom.addClass(document.body, "masked"); + this.sizeMask(); + this.mask.style.display = "block"; + this.showMaskEvent.fire(); + } + }, + + /** + * Sets the size of the modality mask to cover the entire scrollable + * area of the document + * @method sizeMask + */ + sizeMask: function () { + if (this.mask) { + + // Shrink mask first, so it doesn't affect the document size. + var mask = this.mask, + viewWidth = Dom.getViewportWidth(), + viewHeight = Dom.getViewportHeight(); + + if (mask.offsetHeight > viewHeight) { + mask.style.height = viewHeight + "px"; + } + + if (mask.offsetWidth > viewWidth) { + mask.style.width = viewWidth + "px"; + } + + // Then size it to the document + mask.style.height = Dom.getDocumentHeight() + "px"; + mask.style.width = Dom.getDocumentWidth() + "px"; + } + }, + + /** + * Sets the zindex of the mask, if it exists, based on the zindex of + * the Panel element. The zindex of the mask is set to be one less + * than the Panel element's zindex. + * + *

NOTE: This method will not bump up the zindex of the Panel + * to ensure that the mask has a non-negative zindex. If you require the + * mask zindex to be 0 or higher, the zindex of the Panel + * should be set to a value higher than 0, before this method is called. + *

+ * @method stackMask + */ + stackMask: function() { + if (this.mask) { + var panelZ = Dom.getStyle(this.element, "zIndex"); + if (!YAHOO.lang.isUndefined(panelZ) && !isNaN(panelZ)) { + Dom.setStyle(this.mask, "zIndex", panelZ - 1); + } + } + }, + + /** + * Renders the Panel by inserting the elements that are not already in + * the main Panel into their correct places. Optionally appends the + * Panel to the specified node prior to the render's execution. NOTE: + * For Panels without existing markup, the appendToNode argument is + * REQUIRED. If this argument is ommitted and the current element is + * not present in the document, the function will return false, + * indicating that the render was a failure. + * @method render + * @param {String} appendToNode The element id to which the Module + * should be appended to prior to rendering OR + * @param {HTMLElement} appendToNode The element to which the Module + * should be appended to prior to rendering + * @return {boolean} Success or failure of the render + */ + render: function (appendToNode) { + return Panel.superclass.render.call(this, appendToNode, this.innerElement); + }, + + /** + * Renders the currently set header into it's proper position under the + * module element. If the module element is not provided, "this.innerElement" + * is used. + * + * @method _renderHeader + * @protected + * @param {HTMLElement} moduleElement Optional. A reference to the module element + */ + _renderHeader: function(moduleElement){ + moduleElement = moduleElement || this.innerElement; + Panel.superclass._renderHeader.call(this, moduleElement); + }, + + /** + * Renders the currently set body into it's proper position under the + * module element. If the module element is not provided, "this.innerElement" + * is used. + * + * @method _renderBody + * @protected + * @param {HTMLElement} moduleElement Optional. A reference to the module element. + */ + _renderBody: function(moduleElement){ + moduleElement = moduleElement || this.innerElement; + Panel.superclass._renderBody.call(this, moduleElement); + }, + + /** + * Renders the currently set footer into it's proper position under the + * module element. If the module element is not provided, "this.innerElement" + * is used. + * + * @method _renderFooter + * @protected + * @param {HTMLElement} moduleElement Optional. A reference to the module element + */ + _renderFooter: function(moduleElement){ + moduleElement = moduleElement || this.innerElement; + Panel.superclass._renderFooter.call(this, moduleElement); + }, + + /** + * Removes the Panel element from the DOM and sets all child elements + * to null. + * @method destroy + */ + destroy: function () { + Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this); + this.removeMask(); + if (this.close) { + Event.purgeElement(this.close); + } + Panel.superclass.destroy.call(this); + }, + + /** + * Forces the underlay element to be repainted through the application/removal + * of a yui-force-redraw class to the underlay element. + * + * @method forceUnderlayRedraw + */ + forceUnderlayRedraw : function () { + var u = this.underlay; + Dom.addClass(u, "yui-force-redraw"); + setTimeout(function(){Dom.removeClass(u, "yui-force-redraw");}, 0); + }, + + /** + * Returns a String representation of the object. + * @method toString + * @return {String} The string representation of the Panel. + */ + toString: function () { + return "Panel " + this.id; + } + + }); + +}()); +(function () { + + /** + *

+ * Dialog is an implementation of Panel that can be used to submit form + * data. + *

+ *

+ * Built-in functionality for buttons with event handlers is included. + * If the optional YUI Button dependancy is included on the page, the buttons + * created will be instances of YAHOO.widget.Button, otherwise regular HTML buttons + * will be created. + *

+ *

+ * Forms can be processed in 3 ways -- via an asynchronous Connection utility call, + * a simple form POST or GET, or manually. The YUI Connection utility should be + * included if you're using the default "async" postmethod, but is not required if + * you're using any of the other postmethod values. + *

+ * @namespace YAHOO.widget + * @class Dialog + * @extends YAHOO.widget.Panel + * @constructor + * @param {String} el The element ID representing the Dialog OR + * @param {HTMLElement} el The element representing the Dialog + * @param {Object} userConfig The configuration object literal containing + * the configuration that should be set for this Dialog. See configuration + * documentation for more details. + */ + YAHOO.widget.Dialog = function (el, userConfig) { + YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig); + }; + + var Event = YAHOO.util.Event, + CustomEvent = YAHOO.util.CustomEvent, + Dom = YAHOO.util.Dom, + Dialog = YAHOO.widget.Dialog, + Lang = YAHOO.lang, + + /** + * Constant representing the name of the Dialog's events + * @property EVENT_TYPES + * @private + * @final + * @type Object + */ + EVENT_TYPES = { + "BEFORE_SUBMIT": "beforeSubmit", + "SUBMIT": "submit", + "MANUAL_SUBMIT": "manualSubmit", + "ASYNC_SUBMIT": "asyncSubmit", + "FORM_SUBMIT": "formSubmit", + "CANCEL": "cancel" + }, + + /** + * Constant representing the Dialog's configuration properties + * @property DEFAULT_CONFIG + * @private + * @final + * @type Object + */ + DEFAULT_CONFIG = { + + "POST_METHOD": { + key: "postmethod", + value: "async" + }, + + "POST_DATA" : { + key: "postdata", + value: null + }, + + "BUTTONS": { + key: "buttons", + value: "none", + supercedes: ["visible"] + }, + + "HIDEAFTERSUBMIT" : { + key: "hideaftersubmit", + value: true + } + + }; + + /** + * Constant representing the default CSS class used for a Dialog + * @property YAHOO.widget.Dialog.CSS_DIALOG + * @static + * @final + * @type String + */ + Dialog.CSS_DIALOG = "yui-dialog"; + + function removeButtonEventHandlers() { + + var aButtons = this._aButtons, + nButtons, + oButton, + i; + + if (Lang.isArray(aButtons)) { + nButtons = aButtons.length; + + if (nButtons > 0) { + i = nButtons - 1; + do { + oButton = aButtons[i]; + + if (YAHOO.widget.Button && oButton instanceof YAHOO.widget.Button) { + oButton.destroy(); + } + else if (oButton.tagName.toUpperCase() == "BUTTON") { + Event.purgeElement(oButton); + Event.purgeElement(oButton, false); + } + } + while (i--); + } + } + } + + YAHOO.extend(Dialog, YAHOO.widget.Panel, { + + /** + * @property form + * @description Object reference to the Dialog's + * <form> element. + * @default null + * @type HTMLFormElement + */ + form: null, + + /** + * Initializes the class's configurable properties which can be changed + * using the Dialog's Config object (cfg). + * @method initDefaultConfig + */ + initDefaultConfig: function () { + Dialog.superclass.initDefaultConfig.call(this); + + /** + * The internally maintained callback object for use with the + * Connection utility. The format of the callback object is + * similar to Connection Manager's callback object and is + * simply passed through to Connection Manager when the async + * request is made. + * @property callback + * @type Object + */ + this.callback = { + + /** + * The function to execute upon success of the + * Connection submission (when the form does not + * contain a file input element). + * + * @property callback.success + * @type Function + */ + success: null, + + /** + * The function to execute upon failure of the + * Connection submission + * @property callback.failure + * @type Function + */ + failure: null, + + /** + *

+ * The function to execute upon success of the + * Connection submission, when the form contains + * a file input element. + *

+ *

+ * NOTE: Connection manager will not + * invoke the success or failure handlers for the file + * upload use case. This will be the only callback + * handler invoked. + *

+ *

+ * For more information, see the + * Connection Manager documenation on file uploads. + *

+ * @property callback.upload + * @type Function + */ + + /** + * The arbitraty argument or arguments to pass to the Connection + * callback functions + * @property callback.argument + * @type Object + */ + argument: null + + }; + + // Add form dialog config properties // + /** + * The method to use for posting the Dialog's form. Possible values + * are "async", "form", and "manual". + * @config postmethod + * @type String + * @default async + */ + this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key, { + handler: this.configPostMethod, + value: DEFAULT_CONFIG.POST_METHOD.value, + validator: function (val) { + if (val != "form" && val != "async" && val != "none" && + val != "manual") { + return false; + } else { + return true; + } + } + }); + + /** + * Any additional post data which needs to be sent when using the + * async postmethod for dialog POST submissions. + * The format for the post data string is defined by Connection Manager's + * asyncRequest + * method. + * @config postdata + * @type String + * @default null + */ + this.cfg.addProperty(DEFAULT_CONFIG.POST_DATA.key, { + value: DEFAULT_CONFIG.POST_DATA.value + }); + + /** + * This property is used to configure whether or not the + * dialog should be automatically hidden after submit. + * + * @config hideaftersubmit + * @type Boolean + * @default true + */ + this.cfg.addProperty(DEFAULT_CONFIG.HIDEAFTERSUBMIT.key, { + value: DEFAULT_CONFIG.HIDEAFTERSUBMIT.value + }); + + /** + * Array of object literals, each containing a set of properties + * defining a button to be appended into the Dialog's footer. + * + *

Each button object in the buttons array can have three properties:

+ *
+ *
text:
+ *
+ * The text that will display on the face of the button. The text can + * include HTML, as long as it is compliant with HTML Button specifications. + *
+ *
handler:
+ *
Can be either: + *
    + *
  1. A reference to a function that should fire when the + * button is clicked. (In this case scope of this function is + * always its Dialog instance.)
  2. + * + *
  3. An object literal representing the code to be + * executed when the button is clicked. + * + *

    Format:

    + * + *

    + * { + *
    + * fn: Function, // + * The handler to call when the event fires. + *
    + * obj: Object, // + * An object to pass back to the handler. + *
    + * scope: Object // + * The object to use for the scope of the handler. + *
    + * }
    + *

    + *
  4. + *
+ *
+ *
isDefault:
+ *
+ * An optional boolean value that specifies that a button + * should be highlighted and focused by default. + *
+ *
+ * + * NOTE:If the YUI Button Widget is included on the page, + * the buttons created will be instances of YAHOO.widget.Button. + * Otherwise, HTML Buttons (<BUTTON>) will be + * created. + * + * @config buttons + * @type {Array|String} + * @default "none" + */ + this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key, { + handler: this.configButtons, + value: DEFAULT_CONFIG.BUTTONS.value, + supercedes : DEFAULT_CONFIG.BUTTONS.supercedes + }); + + }, + + /** + * Initializes the custom events for Dialog which are fired + * automatically at appropriate times by the Dialog class. + * @method initEvents + */ + initEvents: function () { + Dialog.superclass.initEvents.call(this); + + var SIGNATURE = CustomEvent.LIST; + + /** + * CustomEvent fired prior to submission + * @event beforeSubmitEvent + */ + this.beforeSubmitEvent = + this.createEvent(EVENT_TYPES.BEFORE_SUBMIT); + this.beforeSubmitEvent.signature = SIGNATURE; + + /** + * CustomEvent fired after submission + * @event submitEvent + */ + this.submitEvent = this.createEvent(EVENT_TYPES.SUBMIT); + this.submitEvent.signature = SIGNATURE; + + /** + * CustomEvent fired for manual submission, before the generic submit event is fired + * @event manualSubmitEvent + */ + this.manualSubmitEvent = + this.createEvent(EVENT_TYPES.MANUAL_SUBMIT); + this.manualSubmitEvent.signature = SIGNATURE; + + /** + * CustomEvent fired after asynchronous submission, before the generic submit event is fired + * + * @event asyncSubmitEvent + * @param {Object} conn The connection object, returned by YAHOO.util.Connect.asyncRequest + */ + this.asyncSubmitEvent = this.createEvent(EVENT_TYPES.ASYNC_SUBMIT); + this.asyncSubmitEvent.signature = SIGNATURE; + + /** + * CustomEvent fired after form-based submission, before the generic submit event is fired + * @event formSubmitEvent + */ + this.formSubmitEvent = this.createEvent(EVENT_TYPES.FORM_SUBMIT); + this.formSubmitEvent.signature = SIGNATURE; + + /** + * CustomEvent fired after cancel + * @event cancelEvent + */ + this.cancelEvent = this.createEvent(EVENT_TYPES.CANCEL); + this.cancelEvent.signature = SIGNATURE; + + }, + + /** + * The Dialog initialization method, which is executed for Dialog and + * all of its subclasses. This method is automatically called by the + * constructor, and sets up all DOM references for pre-existing markup, + * and creates required markup if it is not already present. + * + * @method init + * @param {String} el The element ID representing the Dialog OR + * @param {HTMLElement} el The element representing the Dialog + * @param {Object} userConfig The configuration object literal + * containing the configuration that should be set for this Dialog. + * See configuration documentation for more details. + */ + init: function (el, userConfig) { + + /* + Note that we don't pass the user config in here yet because + we only want it executed once, at the lowest subclass level + */ + + Dialog.superclass.init.call(this, el/*, userConfig*/); + + this.beforeInitEvent.fire(Dialog); + + Dom.addClass(this.element, Dialog.CSS_DIALOG); + + this.cfg.setProperty("visible", false); + + if (userConfig) { + this.cfg.applyConfig(userConfig, true); + } + + this.showEvent.subscribe(this.focusFirst, this, true); + this.beforeHideEvent.subscribe(this.blurButtons, this, true); + + this.subscribe("changeBody", this.registerForm); + + this.initEvent.fire(Dialog); + }, + + /** + * Submits the Dialog's form depending on the value of the + * "postmethod" configuration property. Please note: + * As of version 2.3 this method will automatically handle + * asyncronous file uploads should the Dialog instance's form contain + * <input type="file"> elements. If a Dialog + * instance will be handling asyncronous file uploads, its + * callback property will need to be setup with a + * upload handler rather than the standard + * success and, or failure handlers. For more + * information, see the Connection Manager documenation on file uploads. + * @method doSubmit + */ + doSubmit: function () { + + var Connect = YAHOO.util.Connect, + oForm = this.form, + bUseFileUpload = false, + bUseSecureFileUpload = false, + aElements, + nElements, + i, + formAttrs; + + switch (this.cfg.getProperty("postmethod")) { + + case "async": + aElements = oForm.elements; + nElements = aElements.length; + + if (nElements > 0) { + i = nElements - 1; + do { + if (aElements[i].type == "file") { + bUseFileUpload = true; + break; + } + } + while(i--); + } + + if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) { + bUseSecureFileUpload = true; + } + + formAttrs = this._getFormAttributes(oForm); + + Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload); + + var postData = this.cfg.getProperty("postdata"); + var c = Connect.asyncRequest(formAttrs.method, formAttrs.action, this.callback, postData); + + this.asyncSubmitEvent.fire(c); + + break; + + case "form": + oForm.submit(); + this.formSubmitEvent.fire(); + break; + + case "none": + case "manual": + this.manualSubmitEvent.fire(); + break; + } + }, + + /** + * Retrieves important attributes (currently method and action) from + * the form element, accounting for any elements which may have the same name + * as the attributes. Defaults to "POST" and "" for method and action respectively + * if the attribute cannot be retrieved. + * + * @method _getFormAttributes + * @protected + * @param {HTMLFormElement} oForm The HTML Form element from which to retrieve the attributes + * @return {Object} Object literal, with method and action String properties. + */ + _getFormAttributes : function(oForm){ + var attrs = { + method : null, + action : null + }; + + if (oForm) { + if (oForm.getAttributeNode) { + var action = oForm.getAttributeNode("action"); + var method = oForm.getAttributeNode("method"); + + if (action) { + attrs.action = action.value; + } + + if (method) { + attrs.method = method.value; + } + + } else { + attrs.action = oForm.getAttribute("action"); + attrs.method = oForm.getAttribute("method"); + } + } + + attrs.method = (Lang.isString(attrs.method) ? attrs.method : "POST").toUpperCase(); + attrs.action = Lang.isString(attrs.action) ? attrs.action : ""; + + return attrs; + }, + + /** + * Prepares the Dialog's internal FORM object, creating one if one is + * not currently present. + * @method registerForm + */ + registerForm: function() { + + var form = this.element.getElementsByTagName("form")[0]; + + if (this.form) { + if (this.form == form && Dom.isAncestor(this.element, this.form)) { + return; + } else { + Event.purgeElement(this.form); + this.form = null; + } + } + + if (!form) { + form = document.createElement("form"); + form.name = "frm_" + this.id; + this.body.appendChild(form); + } + + if (form) { + this.form = form; + Event.on(form, "submit", this._submitHandler, this, true); + } + }, + + /** + * Internal handler for the form submit event + * + * @method _submitHandler + * @protected + * @param {DOMEvent} e The DOM Event object + */ + _submitHandler : function(e) { + Event.stopEvent(e); + this.submit(); + this.form.blur(); + }, + + /** + * Sets up a tab, shift-tab loop between the first and last elements + * provided. NOTE: Sets up the preventBackTab and preventTabOut KeyListener + * instance properties, which are reset everytime this method is invoked. + * + * @method setTabLoop + * @param {HTMLElement} firstElement + * @param {HTMLElement} lastElement + * + */ + setTabLoop : function(firstElement, lastElement) { + + firstElement = firstElement || this.firstButton; + lastElement = this.lastButton || lastElement; + + Dialog.superclass.setTabLoop.call(this, firstElement, lastElement); + }, + + /** + * Configures instance properties, pointing to the + * first and last focusable elements in the Dialog's form. + * + * @method setFirstLastFocusable + */ + setFirstLastFocusable : function() { + + Dialog.superclass.setFirstLastFocusable.call(this); + + var i, l, el, elements = this.focusableElements; + + this.firstFormElement = null; + this.lastFormElement = null; + + if (this.form && elements && elements.length > 0) { + l = elements.length; + + for (i = 0; i < l; ++i) { + el = elements[i]; + if (this.form === el.form) { + this.firstFormElement = el; + break; + } + } + + for (i = l-1; i >= 0; --i) { + el = elements[i]; + if (this.form === el.form) { + this.lastFormElement = el; + break; + } + } + } + }, + + // BEGIN BUILT-IN PROPERTY EVENT HANDLERS // + /** + * The default event handler fired when the "close" property is + * changed. The method controls the appending or hiding of the close + * icon at the top right of the Dialog. + * @method configClose + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For + * configuration handlers, args[0] will equal the newly applied value + * for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configClose: function (type, args, obj) { + Dialog.superclass.configClose.apply(this, arguments); + }, + + /** + * Event handler for the close icon + * + * @method _doClose + * @protected + * + * @param {DOMEvent} e + */ + _doClose : function(e) { + Event.preventDefault(e); + this.cancel(); + }, + + /** + * The default event handler for the "buttons" configuration property + * @method configButtons + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configButtons: function (type, args, obj) { + + var Button = YAHOO.widget.Button, + aButtons = args[0], + oInnerElement = this.innerElement, + oButton, + oButtonEl, + oYUIButton, + nButtons, + oSpan, + oFooter, + i; + + removeButtonEventHandlers.call(this); + + this._aButtons = null; + + if (Lang.isArray(aButtons)) { + + oSpan = document.createElement("span"); + oSpan.className = "button-group"; + nButtons = aButtons.length; + + this._aButtons = []; + this.defaultHtmlButton = null; + + for (i = 0; i < nButtons; i++) { + oButton = aButtons[i]; + + if (Button) { + oYUIButton = new Button({ label: oButton.text}); + oYUIButton.appendTo(oSpan); + + oButtonEl = oYUIButton.get("element"); + + if (oButton.isDefault) { + oYUIButton.addClass("default"); + this.defaultHtmlButton = oButtonEl; + } + + if (Lang.isFunction(oButton.handler)) { + + oYUIButton.set("onclick", { + fn: oButton.handler, + obj: this, + scope: this + }); + + } else if (Lang.isObject(oButton.handler) && Lang.isFunction(oButton.handler.fn)) { + + oYUIButton.set("onclick", { + fn: oButton.handler.fn, + obj: ((!Lang.isUndefined(oButton.handler.obj)) ? oButton.handler.obj : this), + scope: (oButton.handler.scope || this) + }); + + } + + this._aButtons[this._aButtons.length] = oYUIButton; + + } else { + + oButtonEl = document.createElement("button"); + oButtonEl.setAttribute("type", "button"); + + if (oButton.isDefault) { + oButtonEl.className = "default"; + this.defaultHtmlButton = oButtonEl; + } + + oButtonEl.innerHTML = oButton.text; + + if (Lang.isFunction(oButton.handler)) { + Event.on(oButtonEl, "click", oButton.handler, this, true); + } else if (Lang.isObject(oButton.handler) && + Lang.isFunction(oButton.handler.fn)) { + + Event.on(oButtonEl, "click", + oButton.handler.fn, + ((!Lang.isUndefined(oButton.handler.obj)) ? oButton.handler.obj : this), + (oButton.handler.scope || this)); + } + + oSpan.appendChild(oButtonEl); + this._aButtons[this._aButtons.length] = oButtonEl; + } + + oButton.htmlButton = oButtonEl; + + if (i === 0) { + this.firstButton = oButtonEl; + } + + if (i == (nButtons - 1)) { + this.lastButton = oButtonEl; + } + } + + this.setFooter(oSpan); + + oFooter = this.footer; + + if (Dom.inDocument(this.element) && !Dom.isAncestor(oInnerElement, oFooter)) { + oInnerElement.appendChild(oFooter); + } + + this.buttonSpan = oSpan; + + } else { // Do cleanup + oSpan = this.buttonSpan; + oFooter = this.footer; + if (oSpan && oFooter) { + oFooter.removeChild(oSpan); + this.buttonSpan = null; + this.firstButton = null; + this.lastButton = null; + this.defaultHtmlButton = null; + } + } + + this.changeContentEvent.fire(); + }, + + /** + * @method getButtons + * @description Returns an array containing each of the Dialog's + * buttons, by default an array of HTML <BUTTON> + * elements. If the Dialog's buttons were created using the + * YAHOO.widget.Button class (via the inclusion of the optional Button + * dependancy on the page), an array of YAHOO.widget.Button instances + * is returned. + * @return {Array} + */ + getButtons: function () { + return this._aButtons || null; + }, + + /** + *

+ * Sets focus to the first focusable element in the Dialog's form if found, + * else, the default button if found, else the first button defined via the + * "buttons" configuration property. + *

+ *

+ * This method is invoked when the Dialog is made visible. + *

+ * @method focusFirst + */ + focusFirst: function (type, args, obj) { + + var el = this.firstFormElement; + + if (args && args[1]) { + Event.stopEvent(args[1]); + } + + if (el) { + try { + el.focus(); + } catch(oException) { + // Ignore + } + } else { + if (this.defaultHtmlButton) { + this.focusDefaultButton(); + } else { + this.focusFirstButton(); + } + } + }, + + /** + * Sets focus to the last element in the Dialog's form or the last + * button defined via the "buttons" configuration property. + * @method focusLast + */ + focusLast: function (type, args, obj) { + + var aButtons = this.cfg.getProperty("buttons"), + el = this.lastFormElement; + + if (args && args[1]) { + Event.stopEvent(args[1]); + } + + if (aButtons && Lang.isArray(aButtons)) { + this.focusLastButton(); + } else { + if (el) { + try { + el.focus(); + } catch(oException) { + // Ignore + } + } + } + }, + + /** + * Helper method to normalize button references. It either returns the + * YUI Button instance for the given element if found, + * or the passes back the HTMLElement reference if a corresponding YUI Button + * reference is not found or YAHOO.widget.Button does not exist on the page. + * + * @method _getButton + * @private + * @param {HTMLElement} button + * @return {YAHOO.widget.Button|HTMLElement} + */ + _getButton : function(button) { + var Button = YAHOO.widget.Button; + + // If we have an HTML button and YUI Button is on the page, + // get the YUI Button reference if available. + if (Button && button && button.nodeName && button.id) { + button = Button.getButton(button.id) || button; + } + + return button; + }, + + /** + * Sets the focus to the button that is designated as the default via + * the "buttons" configuration property. By default, this method is + * called when the Dialog is made visible. + * @method focusDefaultButton + */ + focusDefaultButton: function () { + var button = this._getButton(this.defaultHtmlButton); + if (button) { + /* + Place the call to the "focus" method inside a try/catch + block to prevent IE from throwing JavaScript errors if + the element is disabled or hidden. + */ + try { + button.focus(); + } catch(oException) { + } + } + }, + + /** + * Blurs all the buttons defined via the "buttons" + * configuration property. + * @method blurButtons + */ + blurButtons: function () { + + var aButtons = this.cfg.getProperty("buttons"), + nButtons, + oButton, + oElement, + i; + + if (aButtons && Lang.isArray(aButtons)) { + nButtons = aButtons.length; + if (nButtons > 0) { + i = (nButtons - 1); + do { + oButton = aButtons[i]; + if (oButton) { + oElement = this._getButton(oButton.htmlButton); + if (oElement) { + /* + Place the call to the "blur" method inside + a try/catch block to prevent IE from + throwing JavaScript errors if the element + is disabled or hidden. + */ + try { + oElement.blur(); + } catch(oException) { + // ignore + } + } + } + } while(i--); + } + } + }, + + /** + * Sets the focus to the first button created via the "buttons" + * configuration property. + * @method focusFirstButton + */ + focusFirstButton: function () { + + var aButtons = this.cfg.getProperty("buttons"), + oButton, + oElement; + + if (aButtons && Lang.isArray(aButtons)) { + oButton = aButtons[0]; + if (oButton) { + oElement = this._getButton(oButton.htmlButton); + if (oElement) { + /* + Place the call to the "focus" method inside a + try/catch block to prevent IE from throwing + JavaScript errors if the element is disabled + or hidden. + */ + try { + oElement.focus(); + } catch(oException) { + // ignore + } + } + } + } + }, + + /** + * Sets the focus to the last button created via the "buttons" + * configuration property. + * @method focusLastButton + */ + focusLastButton: function () { + + var aButtons = this.cfg.getProperty("buttons"), + nButtons, + oButton, + oElement; + + if (aButtons && Lang.isArray(aButtons)) { + nButtons = aButtons.length; + if (nButtons > 0) { + oButton = aButtons[(nButtons - 1)]; + + if (oButton) { + oElement = this._getButton(oButton.htmlButton); + if (oElement) { + /* + Place the call to the "focus" method inside a + try/catch block to prevent IE from throwing + JavaScript errors if the element is disabled + or hidden. + */ + + try { + oElement.focus(); + } catch(oException) { + // Ignore + } + } + } + } + } + }, + + /** + * The default event handler for the "postmethod" configuration property + * @method configPostMethod + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For + * configuration handlers, args[0] will equal the newly applied value + * for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configPostMethod: function (type, args, obj) { + this.registerForm(); + }, + + // END BUILT-IN PROPERTY EVENT HANDLERS // + + /** + * Built-in function hook for writing a validation function that will + * be checked for a "true" value prior to a submit. This function, as + * implemented by default, always returns true, so it should be + * overridden if validation is necessary. + * @method validate + */ + validate: function () { + return true; + }, + + /** + * Executes a submit of the Dialog if validation + * is successful. By default the Dialog is hidden + * after submission, but you can set the "hideaftersubmit" + * configuration property to false, to prevent the Dialog + * from being hidden. + * + * @method submit + */ + submit: function () { + if (this.validate()) { + if (this.beforeSubmitEvent.fire()) { + this.doSubmit(); + this.submitEvent.fire(); + + if (this.cfg.getProperty("hideaftersubmit")) { + this.hide(); + } + + return true; + } else { + return false; + } + } else { + return false; + } + }, + + /** + * Executes the cancel of the Dialog followed by a hide. + * @method cancel + */ + cancel: function () { + this.cancelEvent.fire(); + this.hide(); + }, + + /** + * Returns a JSON-compatible data structure representing the data + * currently contained in the form. + * @method getData + * @return {Object} A JSON object reprsenting the data of the + * current form. + */ + getData: function () { + + var oForm = this.form, + aElements, + nTotalElements, + oData, + sName, + oElement, + nElements, + sType, + sTagName, + aOptions, + nOptions, + aValues, + oOption, + oRadio, + oCheckbox, + valueAttr, + i, + n; + + function isFormElement(p_oElement) { + var sTag = p_oElement.tagName.toUpperCase(); + return ((sTag == "INPUT" || sTag == "TEXTAREA" || + sTag == "SELECT") && p_oElement.name == sName); + } + + if (oForm) { + + aElements = oForm.elements; + nTotalElements = aElements.length; + oData = {}; + + for (i = 0; i < nTotalElements; i++) { + sName = aElements[i].name; + + /* + Using "Dom.getElementsBy" to safeguard user from JS + errors that result from giving a form field (or set of + fields) the same name as a native method of a form + (like "submit") or a DOM collection (such as the "item" + method). Originally tried accessing fields via the + "namedItem" method of the "element" collection, but + discovered that it won't return a collection of fields + in Gecko. + */ + + oElement = Dom.getElementsBy(isFormElement, "*", oForm); + nElements = oElement.length; + + if (nElements > 0) { + if (nElements == 1) { + oElement = oElement[0]; + + sType = oElement.type; + sTagName = oElement.tagName.toUpperCase(); + + switch (sTagName) { + case "INPUT": + if (sType == "checkbox") { + oData[sName] = oElement.checked; + } else if (sType != "radio") { + oData[sName] = oElement.value; + } + break; + + case "TEXTAREA": + oData[sName] = oElement.value; + break; + + case "SELECT": + aOptions = oElement.options; + nOptions = aOptions.length; + aValues = []; + + for (n = 0; n < nOptions; n++) { + oOption = aOptions[n]; + if (oOption.selected) { + valueAttr = oOption.attributes.value; + aValues[aValues.length] = (valueAttr && valueAttr.specified) ? oOption.value : oOption.text; + } + } + oData[sName] = aValues; + break; + } + + } else { + sType = oElement[0].type; + switch (sType) { + case "radio": + for (n = 0; n < nElements; n++) { + oRadio = oElement[n]; + if (oRadio.checked) { + oData[sName] = oRadio.value; + break; + } + } + break; + + case "checkbox": + aValues = []; + for (n = 0; n < nElements; n++) { + oCheckbox = oElement[n]; + if (oCheckbox.checked) { + aValues[aValues.length] = oCheckbox.value; + } + } + oData[sName] = aValues; + break; + } + } + } + } + } + + return oData; + }, + + /** + * Removes the Panel element from the DOM and sets all child elements + * to null. + * @method destroy + */ + destroy: function () { + removeButtonEventHandlers.call(this); + + this._aButtons = null; + + var aForms = this.element.getElementsByTagName("form"), + oForm; + + if (aForms.length > 0) { + oForm = aForms[0]; + + if (oForm) { + Event.purgeElement(oForm); + if (oForm.parentNode) { + oForm.parentNode.removeChild(oForm); + } + this.form = null; + } + } + Dialog.superclass.destroy.call(this); + }, + + /** + * Returns a string representation of the object. + * @method toString + * @return {String} The string representation of the Dialog + */ + toString: function () { + return "Dialog " + this.id; + } + + }); + +}()); +(function () { + + /** + * SimpleDialog is a simple implementation of Dialog that can be used to + * submit a single value. Forms can be processed in 3 ways -- via an + * asynchronous Connection utility call, a simple form POST or GET, + * or manually. + * @namespace YAHOO.widget + * @class SimpleDialog + * @extends YAHOO.widget.Dialog + * @constructor + * @param {String} el The element ID representing the SimpleDialog + * OR + * @param {HTMLElement} el The element representing the SimpleDialog + * @param {Object} userConfig The configuration object literal containing + * the configuration that should be set for this SimpleDialog. See + * configuration documentation for more details. + */ + YAHOO.widget.SimpleDialog = function (el, userConfig) { + + YAHOO.widget.SimpleDialog.superclass.constructor.call(this, + el, userConfig); + + }; + + var Dom = YAHOO.util.Dom, + SimpleDialog = YAHOO.widget.SimpleDialog, + + /** + * Constant representing the SimpleDialog's configuration properties + * @property DEFAULT_CONFIG + * @private + * @final + * @type Object + */ + DEFAULT_CONFIG = { + + "ICON": { + key: "icon", + value: "none", + suppressEvent: true + }, + + "TEXT": { + key: "text", + value: "", + suppressEvent: true, + supercedes: ["icon"] + } + + }; + + /** + * Constant for the standard network icon for a blocking action + * @property YAHOO.widget.SimpleDialog.ICON_BLOCK + * @static + * @final + * @type String + */ + SimpleDialog.ICON_BLOCK = "blckicon"; + + /** + * Constant for the standard network icon for alarm + * @property YAHOO.widget.SimpleDialog.ICON_ALARM + * @static + * @final + * @type String + */ + SimpleDialog.ICON_ALARM = "alrticon"; + + /** + * Constant for the standard network icon for help + * @property YAHOO.widget.SimpleDialog.ICON_HELP + * @static + * @final + * @type String + */ + SimpleDialog.ICON_HELP = "hlpicon"; + + /** + * Constant for the standard network icon for info + * @property YAHOO.widget.SimpleDialog.ICON_INFO + * @static + * @final + * @type String + */ + SimpleDialog.ICON_INFO = "infoicon"; + + /** + * Constant for the standard network icon for warn + * @property YAHOO.widget.SimpleDialog.ICON_WARN + * @static + * @final + * @type String + */ + SimpleDialog.ICON_WARN = "warnicon"; + + /** + * Constant for the standard network icon for a tip + * @property YAHOO.widget.SimpleDialog.ICON_TIP + * @static + * @final + * @type String + */ + SimpleDialog.ICON_TIP = "tipicon"; + + /** + * Constant representing the name of the CSS class applied to the element + * created by the "icon" configuration property. + * @property YAHOO.widget.SimpleDialog.ICON_CSS_CLASSNAME + * @static + * @final + * @type String + */ + SimpleDialog.ICON_CSS_CLASSNAME = "yui-icon"; + + /** + * Constant representing the default CSS class used for a SimpleDialog + * @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG + * @static + * @final + * @type String + */ + SimpleDialog.CSS_SIMPLEDIALOG = "yui-simple-dialog"; + + + YAHOO.extend(SimpleDialog, YAHOO.widget.Dialog, { + + /** + * Initializes the class's configurable properties which can be changed + * using the SimpleDialog's Config object (cfg). + * @method initDefaultConfig + */ + initDefaultConfig: function () { + + SimpleDialog.superclass.initDefaultConfig.call(this); + + // Add dialog config properties // + + /** + * Sets the informational icon for the SimpleDialog + * @config icon + * @type String + * @default "none" + */ + this.cfg.addProperty(DEFAULT_CONFIG.ICON.key, { + handler: this.configIcon, + value: DEFAULT_CONFIG.ICON.value, + suppressEvent: DEFAULT_CONFIG.ICON.suppressEvent + }); + + /** + * Sets the text for the SimpleDialog + * @config text + * @type String + * @default "" + */ + this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, { + handler: this.configText, + value: DEFAULT_CONFIG.TEXT.value, + suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent, + supercedes: DEFAULT_CONFIG.TEXT.supercedes + }); + + }, + + + /** + * The SimpleDialog initialization method, which is executed for + * SimpleDialog and all of its subclasses. This method is automatically + * called by the constructor, and sets up all DOM references for + * pre-existing markup, and creates required markup if it is not + * already present. + * @method init + * @param {String} el The element ID representing the SimpleDialog + * OR + * @param {HTMLElement} el The element representing the SimpleDialog + * @param {Object} userConfig The configuration object literal + * containing the configuration that should be set for this + * SimpleDialog. See configuration documentation for more details. + */ + init: function (el, userConfig) { + + /* + Note that we don't pass the user config in here yet because we + only want it executed once, at the lowest subclass level + */ + + SimpleDialog.superclass.init.call(this, el/*, userConfig*/); + + this.beforeInitEvent.fire(SimpleDialog); + + Dom.addClass(this.element, SimpleDialog.CSS_SIMPLEDIALOG); + + this.cfg.queueProperty("postmethod", "manual"); + + if (userConfig) { + this.cfg.applyConfig(userConfig, true); + } + + this.beforeRenderEvent.subscribe(function () { + if (! this.body) { + this.setBody(""); + } + }, this, true); + + this.initEvent.fire(SimpleDialog); + + }, + + /** + * Prepares the SimpleDialog's internal FORM object, creating one if one + * is not currently present, and adding the value hidden field. + * @method registerForm + */ + registerForm: function () { + + SimpleDialog.superclass.registerForm.call(this); + + this.form.innerHTML += ""; + + }, + + // BEGIN BUILT-IN PROPERTY EVENT HANDLERS // + + /** + * Fired when the "icon" property is set. + * @method configIcon + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configIcon: function (type,args,obj) { + + var sIcon = args[0], + oBody = this.body, + sCSSClass = SimpleDialog.ICON_CSS_CLASSNAME, + aElements, + oIcon, + oIconParent; + + if (sIcon && sIcon != "none") { + + aElements = Dom.getElementsByClassName(sCSSClass, "*" , oBody); + + if (aElements.length === 1) { + + oIcon = aElements[0]; + oIconParent = oIcon.parentNode; + + if (oIconParent) { + + oIconParent.removeChild(oIcon); + + oIcon = null; + + } + + } + + + if (sIcon.indexOf(".") == -1) { + + oIcon = document.createElement("span"); + oIcon.className = (sCSSClass + " " + sIcon); + oIcon.innerHTML = " "; + + } else { + + oIcon = document.createElement("img"); + oIcon.src = (this.imageRoot + sIcon); + oIcon.className = sCSSClass; + + } + + + if (oIcon) { + + oBody.insertBefore(oIcon, oBody.firstChild); + + } + + } + + }, + + /** + * Fired when the "text" property is set. + * @method configText + * @param {String} type The CustomEvent type (usually the property name) + * @param {Object[]} args The CustomEvent arguments. For configuration + * handlers, args[0] will equal the newly applied value for the property. + * @param {Object} obj The scope object. For configuration handlers, + * this will usually equal the owner. + */ + configText: function (type,args,obj) { + var text = args[0]; + if (text) { + this.setBody(text); + this.cfg.refireEvent("icon"); + } + }, + + // END BUILT-IN PROPERTY EVENT HANDLERS // + + /** + * Returns a string representation of the object. + * @method toString + * @return {String} The string representation of the SimpleDialog + */ + toString: function () { + return "SimpleDialog " + this.id; + } + + /** + *

+ * Sets the SimpleDialog's body content to the HTML specified. + * If no body is present, one will be automatically created. + * An empty string can be passed to the method to clear the contents of the body. + *

+ *

NOTE: SimpleDialog provides the text + * and icon configuration properties to set the contents + * of it's body element in accordance with the UI design for a SimpleDialog (an + * icon and message text). Calling setBody on the SimpleDialog will not enforce this + * UI design constraint and will replace the entire contents of the SimpleDialog body. + * It should only be used if you wish the replace the default icon/text body structure + * of a SimpleDialog with your own custom markup.

+ * + * @method setBody + * @param {String} bodyContent The HTML used to set the body. + * As a convenience, non HTMLElement objects can also be passed into + * the method, and will be treated as strings, with the body innerHTML + * set to their default toString implementations. + * OR + * @param {HTMLElement} bodyContent The HTMLElement to add as the first and only child of the body element. + * OR + * @param {DocumentFragment} bodyContent The document fragment + * containing elements which are to be added to the body + */ + }); + +}()); (function () { /** @@ -5123,4 +9049,4 @@ version: 2.8.0r4 YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider); })(); -YAHOO.register("containercore", YAHOO.widget.Module, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("container", YAHOO.widget.Module, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/dragdrop.js b/third-party/yui/dragdrop.js index 9004749..1eef047 100644 --- a/third-party/yui/dragdrop.js +++ b/third-party/yui/dragdrop.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * The drag and drop utility provides a framework for building drag and drop @@ -3598,4 +3598,4 @@ YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, { return ("DDTarget " + this.id); } }); -YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/element.js b/third-party/yui/element.js index 741801f..215e6de 100644 --- a/third-party/yui/element.js +++ b/third-party/yui/element.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * Provides Attribute configurations. @@ -1087,4 +1087,4 @@ YAHOO.augment(Element, AttributeProvider); YAHOO.util.Element = Element; })(); -YAHOO.register("element", YAHOO.util.Element, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("element", YAHOO.util.Element, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/logger.js b/third-party/yui/logger.js index 03addb7..2594188 100644 --- a/third-party/yui/logger.js +++ b/third-party/yui/logger.js @@ -1,3 +1,9 @@ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ /****************************************************************************/ /****************************************************************************/ /****************************************************************************/ @@ -862,7 +868,7 @@ LogReader.prototype = { * @type Number * @default 500 */ - thresholdMax : 5000, + thresholdMax : 500, /** * When a LogReader console reaches its thresholdMax, it will clear out messages @@ -2095,4 +2101,4 @@ LogReader.prototype = { YAHOO.widget.LogReader = LogReader; })(); -YAHOO.register("logger", YAHOO.widget.Logger, {version: "@VERSION@", build: "@BUILD@"}); +YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/menu.js b/third-party/yui/menu.js index ffb22c6..e0c9f1b 100644 --- a/third-party/yui/menu.js +++ b/third-party/yui/menu.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ @@ -9820,4 +9820,4 @@ toString: function() { } }); // END YAHOO.lang.extend -YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/slider.js b/third-party/yui/slider.js index 1ef24e3..35f98ea 100644 --- a/third-party/yui/slider.js +++ b/third-party/yui/slider.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ /** * The Slider component is a UI control that enables the user to adjust @@ -2065,4 +2065,4 @@ YW.Slider.getVertDualSlider = YAHOO.widget.DualSlider = DualSlider; })(); -YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.8.0r4", build: "2449"}); +YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/treeview.js b/third-party/yui/treeview.js index 18703eb..ea8e27b 100644 --- a/third-party/yui/treeview.js +++ b/third-party/yui/treeview.js @@ -1,16 +1,16 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ (function () { var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event, Lang = YAHOO.lang, Widget = YAHOO.widget; - - + + /** * The treeview widget is a generic tree building tool. @@ -27,10 +27,10 @@ version: 2.8.0r4 * @class TreeView * @uses YAHOO.util.EventProvider * @constructor - * @param {string|HTMLElement} id The id of the element, or the element itself that the tree will be inserted into. + * @param {string|HTMLElement} id The id of the element, or the element itself that the tree will be inserted into. * Existing markup in this element, if valid, will be used to build the tree * @param {Array|Object|String} oConfig (optional) If present, it will be used to build the tree via method buildTreeFromObject - * + * */ YAHOO.widget.TreeView = function(id, oConfig) { if (id) { this.init(id); } @@ -115,7 +115,7 @@ TV.prototype = { * @private */ _hasDblClickSubscriber: false, - + /** * Stores the timer used to check for double clicks * @property _dblClickTimer @@ -130,16 +130,16 @@ TV.prototype = { * @type YAHOO.widget.Node */ currentFocus: null, - + /** * If true, only one Node can be highlighted at a time * @property singleNodeHighlight * @type boolean * @default false */ - + singleNodeHighlight: false, - + /** * A reference to the Node that is currently highlighted. * It is only meaningful if singleNodeHighlight is enabled @@ -148,13 +148,13 @@ TV.prototype = { * @default null * @private */ - + _currentlyHighlighted: null, /** * Sets up the animation for expanding children * @method setExpandAnim - * @param {string} type the type of animation (acceptable values defined + * @param {string} type the type of animation (acceptable values defined * in YAHOO.widget.TVAnim) */ setExpandAnim: function(type) { @@ -164,7 +164,7 @@ TV.prototype = { /** * Sets up the animation for collapsing children * @method setCollapseAnim - * @param {string} type of animation (acceptable values defined in + * @param {string} type of animation (acceptable values defined in * YAHOO.widget.TVAnim) */ setCollapseAnim: function(type) { @@ -184,12 +184,12 @@ TV.prototype = { if (this._expandAnim && this._animCount < this.maxAnim) { // this.locked = true; var tree = this; - var a = Widget.TVAnim.getAnim(this._expandAnim, el, + var a = Widget.TVAnim.getAnim(this._expandAnim, el, function() { tree.expandComplete(node); }); - if (a) { + if (a) { ++this._animCount; this.fireEvent("animStart", { - "node": node, + "node": node, "type": "expand" }); a.animate(); @@ -214,12 +214,12 @@ TV.prototype = { if (this._collapseAnim && this._animCount < this.maxAnim) { // this.locked = true; var tree = this; - var a = Widget.TVAnim.getAnim(this._collapseAnim, el, + var a = Widget.TVAnim.getAnim(this._collapseAnim, el, function() { tree.collapseComplete(node); }); - if (a) { + if (a) { ++this._animCount; this.fireEvent("animStart", { - "node": node, + "node": node, "type": "collapse" }); a.animate(); @@ -238,7 +238,7 @@ TV.prototype = { expandComplete: function(node) { --this._animCount; this.fireEvent("animComplete", { - "node": node, + "node": node, "type": "expand" }); // this.locked = false; @@ -251,7 +251,7 @@ TV.prototype = { collapseComplete: function(node) { --this._animCount; this.fireEvent("animComplete", { - "node": node, + "node": node, "type": "collapse" }); // this.locked = false; @@ -330,7 +330,7 @@ TV.prototype = { * @param {YAHOO.widget.Node} node the node that has the focus */ this.createEvent("enterKeyPressed", this); - + /** * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click. * The listener may return false to cancel toggling and focusing on the node. @@ -340,16 +340,16 @@ TV.prototype = { * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked */ this.createEvent("clickEvent", this); - + /** - * Fires when the focus receives the focus, when it changes from a Node + * Fires when the focus receives the focus, when it changes from a Node * to another Node or when it is completely lost (blurred) * @event focusChanged * @type CustomEvent * @param oArgs.oldNode {YAHOO.widget.Node} Node that had the focus or null if none * @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none */ - + this.createEvent('focusChanged',this); /** @@ -366,9 +366,9 @@ TV.prototype = { self._hasDblClickSubscriber = true; } }); - + /** - * Custom event that is fired when the text node label is clicked. + * Custom event that is fired when the text node label is clicked. * The node clicked is provided as an argument * * @event labelClick @@ -377,11 +377,11 @@ TV.prototype = { * @deprecated use clickEvent or dblClickEvent */ this.createEvent("labelClick", this); - + /** * Custom event fired when the highlight of a node changes. * The node that triggered the change is provided as an argument: - * The status of the highlight can be checked in + * The status of the highlight can be checked in * nodeRef.highlightState. * Depending on nodeRef.propagateHighlight, other nodes might have changed * @event highlightEvent @@ -389,7 +389,7 @@ TV.prototype = { * @param node {YAHOO.widget.Node} the node that started the change in highlighting state */ this.createEvent("highlightEvent",this); - + this._nodes = []; @@ -403,21 +403,21 @@ TV.prototype = { var LW = Widget.LogWriter; - + if (this._initEditor) { this._initEditor(); } - + // YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true); // YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true); }, //handleAvailable: function() { //var Event = YAHOO.util.Event; - //Event.on(this.id, + //Event.on(this.id, //}, /** - * Builds the TreeView from an object. + * Builds the TreeView from an object. * This is the method called by the constructor to build the tree when it has a second argument. * A tree can be described by an array of objects, each object corresponding to a node. * Node descriptions may contain values for any property of a node plus the following extra properties:
    @@ -431,7 +431,7 @@ TV.prototype = { * @method buildTreeFromObject * @param oConfig {Array|Object|String} array containing a full description of the tree. * An object or a string will be turned into an array with the given object or string as its only element. - * + * */ buildTreeFromObject: function (oConfig) { var build = function (parent, oConfig) { @@ -481,11 +481,11 @@ TV.prototype = { oConfig = [oConfig]; } - + build(this.root,oConfig); }, /** - * Builds the TreeView from existing markup. Markup should consist of <UL> or <OL> elements containing <LI> elements. + * Builds the TreeView from existing markup. Markup should consist of <UL> or <OL> elements containing <LI> elements. * Each <LI> can have one element used as label and a second optional element which is to be a <UL> or <OL> * containing nested nodes. * Depending on what the first element of the <LI> element is, the following Nodes will be created:
      @@ -549,7 +549,7 @@ TV.prototype = { break; } // if there are further elements or text, it will be ignored. - + if (YAHOO.lang.JSON) { yuiConfig = el.getAttribute('yuiConfig'); if (yuiConfig) { @@ -557,7 +557,7 @@ TV.prototype = { config = YAHOO.lang.merge(config,yuiConfig); } } - + branch.push(config); break; case 'UL': @@ -574,7 +574,7 @@ TV.prototype = { return branch; }; - var markup = Dom.getChildrenBy(Dom.get(id),function (el) { + var markup = Dom.getChildrenBy(Dom.get(id),function (el) { var tag = el.tagName.toUpperCase(); return tag == 'UL' || tag == 'OL'; }); @@ -589,10 +589,10 @@ TV.prototype = { * @private */ _getEventTargetTdEl: function (ev) { - var target = Event.getTarget(ev); + var target = Event.getTarget(ev); // go up looking for a TD with a className with a ygtv prefix - while (target && !(target.tagName.toUpperCase() == 'TD' && Dom.hasClass(target.parentNode,'ygtvrow'))) { - target = Dom.getAncestorByTagName(target,'td'); + while (target && !(target.tagName.toUpperCase() == 'TD' && Dom.hasClass(target.parentNode,'ygtvrow'))) { + target = Dom.getAncestorByTagName(target,'td'); } if (Lang.isNull(target)) { return null; } // If it is a spacer cell, do nothing @@ -638,14 +638,14 @@ TV.prototype = { }; if (!td) { - return; + return; } node = this.getNodeByElement(td); - if (!node) { - return; + if (!node) { + return; } - + // exception to handle deprecated event labelClick // @TODO take another look at this deprecation. It is common for people to // only be interested in the label click, so why make them have to test @@ -654,7 +654,7 @@ TV.prototype = { if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) { this.fireEvent('labelClick',node); } - + // If it is a toggle cell, toggle if (/\bygtv[tl][mp]h?h?/.test(td.className)) { toggle(true); @@ -666,12 +666,12 @@ TV.prototype = { if (this._hasDblClickSubscriber) { this._dblClickTimer = window.setTimeout(function () { self._dblClickTimer = null; - if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { + if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { toggle(); } }, 200); } else { - if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { + if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { toggle(); } } @@ -690,7 +690,7 @@ TV.prototype = { if (!td) {return;} if (!(/\bygtv[tl][mp]h?h?/.test(td.className))) { - this.fireEvent('dblClickEvent', {event:ev, node:this.getNodeByElement(td)}); + this.fireEvent('dblClickEvent', {event:ev, node:this.getNodeByElement(td)}); if (this._dblClickTimer) { window.clearTimeout(this._dblClickTimer); this._dblClickTimer = null; @@ -790,7 +790,7 @@ TV.prototype = { } while (newNode && !newNode._canHaveFocus()); if (newNode) { newNode.focus();} }; - + moveFocusRight(newNode); Event.preventDefault(ev); break; @@ -858,7 +858,7 @@ TV.prototype = { } this._hasEvents = true; }, - + /** * Returns the tree's host element * @method getEl @@ -895,11 +895,11 @@ TV.prototype = { * @method setDynamicLoad * @param {function} fnDataLoader the function that will be called to get the data * @param iconMode {int} configures the icon that is displayed when a dynamic - * load node is expanded the first time without children. By default, the + * load node is expanded the first time without children. By default, the * "collapse" icon will be used. If set to 1, the leaf node icon will be * displayed. */ - setDynamicLoad: function(fnDataLoader, iconMode) { + setDynamicLoad: function(fnDataLoader, iconMode) { this.root.setDynamicLoad(fnDataLoader, iconMode); }, @@ -910,9 +910,9 @@ TV.prototype = { * will be expanded. * @method expandAll */ - expandAll: function() { + expandAll: function() { if (!this.locked) { - this.root.expandAll(); + this.root.expandAll(); } }, @@ -920,9 +920,9 @@ TV.prototype = { * Collapses all expanded child nodes in the entire tree. * @method collapseAll */ - collapseAll: function() { + collapseAll: function() { if (!this.locked) { - this.root.collapseAll(); + this.root.collapseAll(); } }, @@ -961,8 +961,8 @@ TV.prototype = { }, /** - * Returns a collection of nodes that have a matching property - * and value in the data object that was passed into its constructor. + * Returns a collection of nodes that have a matching property + * and value in the data object that was passed into its constructor. * @method getNodesByProperty * @param {object} property the property to search (usually a string) * @param {object} value the value we want to find (usuall an int or string) @@ -985,8 +985,8 @@ TV.prototype = { /** * Returns a collection of nodes that have passed the test function - * passed as its only argument. - * The function will receive a reference to each node to be tested. + * passed as its only argument. + * The function will receive a reference to each node to be tested. * @method getNodesBy * @param {function} a boolean function that receives a Node instance and returns true to add the node to the results list * @return {Array} the matching collection of nodes, null if no match @@ -1030,12 +1030,12 @@ TV.prototype = { break; } - } + } while (p.id !== this.id && p.tagName.toLowerCase() !== "body"); return null; }, - + /** * When in singleNodeHighlight it returns the node highlighted * or null if none. Returns null if singleNodeHighlight is false. @@ -1048,14 +1048,14 @@ TV.prototype = { /** - * Removes the node and its children, and optionally refreshes the + * Removes the node and its children, and optionally refreshes the * branch of the tree that was affected. * @method removeNode * @param {Node} node to remove * @param {boolean} autoRefresh automatically refreshes branch if true * @return {boolean} False is there was a problem, true otherwise. */ - removeNode: function(node, autoRefresh) { + removeNode: function(node, autoRefresh) { // Don't delete the root node if (node.isRoot()) { @@ -1080,7 +1080,7 @@ TV.prototype = { }, /** - * wait until the animation is complete before deleting + * wait until the animation is complete before deleting * to avoid javascript errors * @method _removeChildren_animComplete * @param o the custom event payload @@ -1099,13 +1099,13 @@ TV.prototype = { * @method removeChildren * @param {Node} node the node to purge */ - removeChildren: function(node) { + removeChildren: function(node) { if (node.expanded) { // wait until the animation is complete before deleting to // avoid javascript errors if (this._collapseAnim) { - this.subscribe("animComplete", + this.subscribe("animComplete", this._removeChildren_animComplete, this, true); Widget.Node.prototype.collapse.call(node); return; @@ -1133,7 +1133,7 @@ TV.prototype = { * @method _deleteNode * @private */ - _deleteNode: function(node) { + _deleteNode: function(node) { // Remove all the child nodes first this.removeChildren(node); @@ -1142,13 +1142,13 @@ TV.prototype = { }, /** - * Removes the node from the tree, preserving the child collection - * to make it possible to insert the branch into another part of the + * Removes the node from the tree, preserving the child collection + * to make it possible to insert the branch into another part of the * tree, or another tree. * @method popNode * @param {Node} node to remove */ - popNode: function(node) { + popNode: function(node) { var p = node.parent; // Update the parent's collection of children @@ -1186,7 +1186,7 @@ TV.prototype = { node.nextSibling = null; node.tree = null; - // Update the tree's node collection + // Update the tree's node collection delete this._nodes[node.index]; }, @@ -1215,8 +1215,8 @@ TV.prototype = { el.innerHTML = ''; this._hasEvents = false; }, - - + + /** @@ -1263,7 +1263,7 @@ TV.prototype = { * @deprecated use treeobj.subscribe("collapse") instead */ onCollapse: function(node) { }, - + /** * Sets the value of a property for all loaded nodes in the tree. * @method setNodesProperty @@ -1297,7 +1297,7 @@ TV.prototype = { node.toggleHighlight(); return false; } - + }; @@ -1316,7 +1316,7 @@ PROT.draw = PROT.render; YAHOO.augment(TV, YAHOO.util.EventProvider); /** - * Running count of all nodes created in all trees. This is + * Running count of all nodes created in all trees. This is * used to provide unique identifies for all nodes. Deleting * nodes does not change the nodeCount. * @property YAHOO.widget.TreeView.nodeCount @@ -1372,7 +1372,7 @@ TV.getNode = function(treeId, nodeIndex) { * @final * @default "ygtvfocus" - */ + */ TV.FOCUS_CLASS_NAME = 'ygtvfocus'; @@ -1415,7 +1415,7 @@ YAHOO.widget.Node.prototype = { /** * This node's child node collection. * @property children - * @type Node[] + * @type Node[] */ children: null, @@ -1464,7 +1464,7 @@ YAHOO.widget.Node.prototype = { /** * Should we render children for a collapsed node? It is possible that the - * implementer will want to render the hidden data... @todo verify that we + * implementer will want to render the hidden data... @todo verify that we * need this, and implement it if we do. * @property renderHidden * @type boolean @@ -1565,7 +1565,7 @@ YAHOO.widget.Node.prototype = { isLeaf: false, /** - * The CSS class for the html content container. Defaults to ygtvhtml, but + * The CSS class for the html content container. Defaults to ygtvhtml, but * can be overridden to provide a custom presentation for a specific node. * @property contentStyle * @type string @@ -1579,16 +1579,16 @@ YAHOO.widget.Node.prototype = { * @type string */ contentElId: null, - -/** + +/** * Enables node highlighting. If true, the node can be highlighted and/or propagate highlighting * @property enableHighlight * @type boolean * @default true */ enableHighlight: true, - -/** + +/** * Stores the highlight state. Can be any of: *
        *
      • 0 - not highlighted
      • @@ -1599,36 +1599,36 @@ YAHOO.widget.Node.prototype = { * @type integer * @default 0 */ - + highlightState: 0, - + /** * Tells whether highlighting will be propagated up to the parents of the clicked node * @property propagateHighlightUp * @type boolean * @default false */ - + propagateHighlightUp: false, - + /** * Tells whether highlighting will be propagated down to the children of the clicked node * @property propagateHighlightDown * @type boolean * @default false */ - + propagateHighlightDown: false, - + /** * User-defined className to be added to the Node * @property className * @type string * @default null */ - + className: null, - + /** * The node type * @property _type @@ -1660,7 +1660,7 @@ YAHOO.widget.Node.prototype = { this.index = YAHOO.widget.TreeView.nodeCount; ++YAHOO.widget.TreeView.nodeCount; this.contentElId = "ygtvcontentel" + this.index; - + if (Lang.isObject(oData)) { for (var property in oData) { if (oData.hasOwnProperty(property)) { @@ -1673,7 +1673,7 @@ YAHOO.widget.Node.prototype = { } } if (!Lang.isUndefined(expanded) ) { this.expanded = expanded; } - + /** * The parentChange event is fired when a parent element is applied @@ -1794,7 +1794,7 @@ YAHOO.widget.Node.prototype = { return this; }, - + /** * Inserts this node after the supplied node * @method insertAfter @@ -1833,7 +1833,7 @@ YAHOO.widget.Node.prototype = { * Returns true if the Node is a child of supplied Node * @method isChildOf * @param parentNode {Node} the Node to check - * @return {boolean} The node index if this Node is a child of + * @return {boolean} The node index if this Node is a child of * supplied Node, else -1. * @private */ @@ -1922,7 +1922,7 @@ YAHOO.widget.Node.prototype = { /* getSpacerId: function() { return "ygtvspacer" + this.index; - }, + }, */ /** @@ -1956,7 +1956,7 @@ YAHOO.widget.Node.prototype = { * @method getContentEl * @return {HTMLElement} the element */ - getContentEl: function() { + getContentEl: function() { return Dom.get(this.contentElId); }, @@ -2033,8 +2033,8 @@ YAHOO.widget.Node.prototype = { */ expand: function(lazySource) { // Only expand if currently collapsed. - if (this.isLoading || (this.expanded && !lazySource)) { - return; + if (this.isLoading || (this.expanded && !lazySource)) { + return; } var ret = true; @@ -2049,7 +2049,7 @@ YAHOO.widget.Node.prototype = { if (false === ret) { return; } - + ret = this.tree.fireEvent("expand", this); } @@ -2085,8 +2085,8 @@ YAHOO.widget.Node.prototype = { if (! this.multiExpand) { var sibs = this.getSiblings(); for (var i=0; sibs && i 0 || - (checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) + return ( this.children.length > 0 || + (checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) ); } }, @@ -2329,21 +2329,21 @@ YAHOO.widget.Node.prototype = { if (this.dataLoader) { - setTimeout( + setTimeout( function() { - node.dataLoader(node, - function() { - node.loadComplete(); + node.dataLoader(node, + function() { + node.loadComplete(); }); }, 10); - + } else if (this.tree.root.dataLoader) { - setTimeout( + setTimeout( function() { - node.tree.root.dataLoader(node, - function() { - node.loadComplete(); + node.tree.root.dataLoader(node, + function() { + node.loadComplete(); }); }, 10); @@ -2370,7 +2370,7 @@ YAHOO.widget.Node.prototype = { // this.children[i].childrenRendered = false; sb[sb.length] = this.children[i].getHtml(); } - + this.childrenRendered = true; return sb.join(""); @@ -2394,7 +2394,7 @@ YAHOO.widget.Node.prototype = { } } // if (highlighState == 2) leave child nodes with whichever highlight state they are set } - + this.dynamicLoadComplete = true; this.isLoading = false; this.expand(true); @@ -2413,7 +2413,7 @@ YAHOO.widget.Node.prototype = { } var p = this.parent; - + while (p.depth > depth) { p = p.parent; } @@ -2431,7 +2431,7 @@ YAHOO.widget.Node.prototype = { * @return {string} the css class for the spacer */ getDepthStyle: function(depth) { - return (this.getAncestor(depth).nextSibling) ? + return (this.getAncestor(depth).nextSibling) ? "ygtvdepthcell" : "ygtvblankdepthcell"; }, @@ -2441,7 +2441,7 @@ YAHOO.widget.Node.prototype = { * @method getNodeHtml * @return {string} The HTML that will render this node. */ - getNodeHtml: function() { + getNodeHtml: function() { var sb = []; sb[sb.length] = ''; - + for (var i=0;i
        '; } @@ -2464,7 +2464,7 @@ YAHOO.widget.Node.prototype = { sb[sb.length] = '"> '; } - sb[sb.length] = '
        http://developer.yahoo.com/yui/calendar/#internationalization * @property calendarConfig */ calendarConfig: null, - - - - /** + + + + /** * If YAHOO.widget.Calendar is available, it will pop up a Calendar to enter a new date. Otherwise, it falls back to a plain <input> textbox * @method fillEditorContainer * @param editorData {YAHOO.widget.TreeView.editorData} a shortcut to the static object holding editing information * @return void */ fillEditorContainer: function (editorData) { - + var cal, container = editorData.inputContainer; - + if (Lang.isUndefined(Calendar)) { Dom.replaceClass(editorData.editorPanel,'ygtv-edit-DateNode','ygtv-edit-TextNode'); YAHOO.widget.DateNode.superclass.fillEditorContainer.call(this, editorData); return; } - + if (editorData.nodeType != this._type) { editorData.nodeType = this._type; editorData.saveOnEnter = false; - + editorData.node.destroyEditorContents(editorData); editorData.inputObject = cal = new Calendar(container.appendChild(document.createElement('div'))); - if (this.calendarConfig) { - cal.cfg.applyConfig(this.calendarConfig,true); + if (this.calendarConfig) { + cal.cfg.applyConfig(this.calendarConfig,true); cal.cfg.fireQueue(); } cal.selectEvent.subscribe(function () { @@ -3350,7 +3350,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { } editorData.oldValue = this.label; - cal.cfg.setProperty("selected",this.label, false); + cal.cfg.setProperty("selected",this.label, false); var delim = cal.cfg.getProperty('DATE_FIELD_DELIMITER'); var pageDate = this.label.split(delim); @@ -3375,7 +3375,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { var cal = editorData.inputObject, date = cal.getSelectedDates()[0], dd = []; - + dd[cal.cfg.getProperty('MDY_DAY_POSITION') -1] = date.getDate(); dd[cal.cfg.getProperty('MDY_MONTH_POSITION') -1] = date.getMonth() + 1; dd[cal.cfg.getProperty('MDY_YEAR_POSITION') -1] = date.getFullYear(); @@ -3401,7 +3401,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * It will return false if the node or any descendant loads dynamically, regardless of whether it is loaded or not. * @method getNodeDefinition * @return {Object | false} definition of the node or false if this node or any descendant is defined as dynamic - */ + */ getNodeDefinition: function() { var def = YAHOO.widget.DateNode.superclass.getNodeDefinition.call(this); if (def === false) { return false; } @@ -3415,7 +3415,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { (function () { var Dom = YAHOO.util.Dom, - Lang = YAHOO.lang, + Lang = YAHOO.lang, Event = YAHOO.util.Event, TV = YAHOO.widget.TreeView, TVproto = TV.prototype; @@ -3451,11 +3451,11 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { oldValue:undefined // Each node type is free to add its own properties to this as it sees fit. }; - + /** - * Validator function for edited data, called from the TreeView instance scope, - * receives the arguments (newValue, oldValue, nodeInstance) - * and returns either the validated (or type-converted) value or undefined. + * Validator function for edited data, called from the TreeView instance scope, + * receives the arguments (newValue, oldValue, nodeInstance) + * and returns either the validated (or type-converted) value or undefined. * An undefined return will prevent the editor from closing * @property validator * @type function @@ -3463,9 +3463,9 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @for YAHOO.widget.TreeView */ TVproto.validator = null; - + /** - * Entry point for initializing the editing plug-in. + * Entry point for initializing the editing plug-in. * TreeView will call this method on initializing if it exists * @method _initEditor * @for YAHOO.widget.TreeView @@ -3473,30 +3473,30 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { */ TVproto._initEditor = function () { - /** + /** * Fires when the user clicks on the ok button of a node editor - * @event editorSaveEvent - * @type CustomEvent - * @param oArgs.newValue {mixed} the new value just entered - * @param oArgs.oldValue {mixed} the value originally in the tree - * @param oArgs.node {YAHOO.widget.Node} the node that has the focus + * @event editorSaveEvent + * @type CustomEvent + * @param oArgs.newValue {mixed} the new value just entered + * @param oArgs.oldValue {mixed} the value originally in the tree + * @param oArgs.node {YAHOO.widget.Node} the node that has the focus * @for YAHOO.widget.TreeView - */ - this.createEvent("editorSaveEvent", this); - - /** + */ + this.createEvent("editorSaveEvent", this); + + /** * Fires when the user clicks on the cancel button of a node editor - * @event editorCancelEvent - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that has the focus + * @event editorCancelEvent + * @type CustomEvent + * @param {YAHOO.widget.Node} node the node that has the focus * @for YAHOO.widget.TreeView - */ - this.createEvent("editorCancelEvent", this); + */ + this.createEvent("editorCancelEvent", this); }; /** - * Entry point of the editing plug-in. + * Entry point of the editing plug-in. * TreeView will call this method if it exists when a node label is clicked * @method _nodeEditing * @param node {YAHOO.widget.Node} the node to be edited @@ -3504,9 +3504,9 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @for YAHOO.widget.TreeView * @private */ - - - + + + TVproto._nodeEditing = function (node) { if (node.fillEditorContainer && node.editable) { var ed, topLeft, buttons, button, editorData = TV.editorData; @@ -3539,14 +3539,14 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { editorData.inputContainer = ed.appendChild(document.createElement('div')); Dom.addClass(editorData.inputContainer,'ygtv-input'); - + Event.on(ed,'keydown',function (ev) { var editorData = TV.editorData, KEY = YAHOO.util.KeyListener.KEY; switch (ev.keyCode) { case KEY.ENTER: Event.stopEvent(ev); - if (editorData.saveOnEnter) { + if (editorData.saveOnEnter) { this._closeEditor(true); } break; @@ -3558,7 +3558,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { },this,true); - + } else { ed = editorData.editorPanel; } @@ -3577,7 +3577,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { return true; // If inline editor available, don't do anything else. } }; - + /** * Method to be associated with an event (clickEvent, dblClickEvent or enterKeyPressed) to pop up the contents editor * It calls the corresponding node editNode method. @@ -3593,7 +3593,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { oArgs.node.editNode(); } }; - + /** * Method to be called when the inline editing is finished and the editor is to be closed * @method _closeEditor @@ -3601,24 +3601,24 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @private * @for YAHOO.widget.TreeView */ - + TVproto._closeEditor = function (save) { - var ed = TV.editorData, + var ed = TV.editorData, node = ed.node, close = true; - if (save) { - close = ed.node.saveEditorValue(ed) !== false; + if (save) { + close = ed.node.saveEditorValue(ed) !== false; } else { - this.fireEvent( 'editorCancelEvent', node); + this.fireEvent( 'editorCancelEvent', node); } - + if (close) { - Dom.setStyle(ed.editorPanel,'display','none'); + Dom.setStyle(ed.editorPanel,'display','none'); ed.active = false; node.focus(); } }; - + /** * Entry point for TreeView's destroy method to destroy whatever the editing plug-in has created * @method _destroyEditor @@ -3636,9 +3636,9 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { ed.active = false; } }; - + var Nproto = YAHOO.widget.Node.prototype; - + /** * Signals if the label is editable. (Ignored on TextNodes with href set.) * @property editable @@ -3646,18 +3646,18 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @for YAHOO.widget.Node */ Nproto.editable = false; - + /** * pops up the contents editor, if there is one and the node is declared editable * @method editNode * @for YAHOO.widget.Node */ - + Nproto.editNode = function () { this.tree._nodeEditing(this); }; - - + + /** Placeholder for a function that should provide the inline node label editor. @@ -3671,7 +3671,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { */ Nproto.fillEditorContainer = null; - + /** * Node-specific destroy function to empty the contents of the inline editor panel. * This function is the worst case alternative that will purge all possible events and remove the editor contents. @@ -3695,16 +3695,16 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @for YAHOO.widget.Node */ Nproto.saveEditorValue = function (editorData) { - var node = editorData.node, + var node = editorData.node, value, validator = node.tree.validator; - + value = this.getEditorValue(editorData); - + if (Lang.isFunction(validator)) { value = validator(value,editorData.oldValue,node); - if (Lang.isUndefined(value)) { - return false; + if (Lang.isUndefined(value)) { + return false; } } @@ -3716,8 +3716,8 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { this.displayEditedValue(value,editorData); } }; - - + + /** * Returns the value(s) from the input element(s) . * Should be overridden by each node type. @@ -3740,12 +3740,12 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { */ Nproto.displayEditedValue = function (value,editorData) { }; - + var TNproto = YAHOO.widget.TextNode.prototype; + - - /** + /** * Places an <input> textbox in the input container and loads the label text into it. * @method fillEditorContainer * @param editorData {YAHOO.widget.TreeView.editorData} a shortcut to the static object holding editing information @@ -3753,7 +3753,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { * @for YAHOO.widget.TextNode */ TNproto.fillEditorContainer = function (editorData) { - + var input; // If last node edited is not of the same type as this one, delete it and fill it with our editor if (editorData.nodeType != this._type) { @@ -3762,7 +3762,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { editorData.node.destroyEditorContents(editorData); editorData.inputElement = input = editorData.inputContainer.appendChild(document.createElement('input')); - + } else { // if the last node edited was of the same time, reuse the input element. input = editorData.inputElement; @@ -3772,7 +3772,7 @@ YAHOO.extend(YAHOO.widget.DateNode, YAHOO.widget.TextNode, { input.focus(); input.select(); }; - + /** * Returns the value from the input element. * Overrides Node.getEditorValue. @@ -3903,7 +3903,7 @@ YAHOO.widget.TVFadeIn.prototype = { s.filter = "alpha(opacity=10)"; s.display = ""; - var dur = 0.4; + var dur = 0.4; var a = new YAHOO.util.Anim(this.el, {opacity: {from: 0.1, to: 1, unit:""}}, dur); a.onComplete.subscribe( function() { tvanim.onComplete(); } ); a.animate(); @@ -3986,4 +3986,4 @@ YAHOO.widget.TVFadeOut.prototype = { } }; -YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.8.0r4", build: "2446"}); +YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.8.2r1", build: "7"}); diff --git a/third-party/yui/yahoo-dom-event.js b/third-party/yui/yahoo-dom-event.js index 68586b2..8ab7c86 100644 --- a/third-party/yui/yahoo-dom-event.js +++ b/third-party/yui/yahoo-dom-event.js @@ -1,14 +1,14 @@ /* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 */ -if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F; y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom._getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B; -this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; +this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.2r1",build:"7"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; }else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A); -},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;gthis.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.8.0r4",build:"2449"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"root":"2.8.0r4/build/","base":"http://yui.yahooapis.com/2.8.0r4/build/","comboBase":"http://yui.yahooapis.com/combo?","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event","datasource"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],supersedes:["datemeth"],"skinnable":true},"carousel":{"type":"js","path":"carousel/carousel-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-min.js","requires":["element","json","datasource","swf"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"],"supersedes":["connectioncore"]},"connectioncore":{"type":"js","path":"connection/connection_core-min.js","requires":["event"],"pkg":"connection"},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop","paginator"],"skinnable":true},datemath:{"type":"js","path":"datemath/datemath-min.js","requires":["yahoo"]},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-min.js","requires":["dom","event"],"optional":["event-mouseenter","event-delegate"]},"element-delegate":{"type":"js","path":"element-delegate/element-delegate-min.js","requires":["element"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"event-simulate":{"type":"js","path":"event-simulate/event-simulate-min.js","requires":["event"]},"event-delegate":{"type":"js","path":"event-delegate/event-delegate-min.js","requires":["event"],"optional":["selector"]},"event-mouseenter":{"type":"js","path":"event-mouseenter/event-mouseenter-min.js","requires":["dom","event"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-min.js","requires":["dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-min.js","requires":["element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"paginator":{"type":"js","path":"paginator/paginator-min.js","requires":["element"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"progressbar":{"type":"js","path":"progressbar/progressbar-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-min.js","requires":["dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"],"skinnable":true},"storage":{"type":"js","path":"storage/storage-min.js","requires":["yahoo","event","cookie"],"optional":["swfstore"]},"stylesheet":{"type":"js","path":"stylesheet/stylesheet-min.js","requires":["yahoo"]},"swf":{"type":"js","path":"swf/swf-min.js","requires":["element"],"supersedes":["swfdetect"]},"swfdetect":{"type":"js","path":"swfdetect/swfdetect-min.js","requires":["yahoo"]},"swfstore":{"type":"js","path":"swfstore/swfstore-min.js","requires":["element","cookie","swf"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event","dom"],"optional":["json","animation","calendar"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-min.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"optional":["event-simulate"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0; +if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;gthis.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.8.2r1",build:"7"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"root":"2.8.2r1/build/","base":"http://yui.yahooapis.com/2.8.2r1/build/","comboBase":"http://yui.yahooapis.com/combo?","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event","datasource"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],supersedes:["datemeth"],"skinnable":true},"carousel":{"type":"js","path":"carousel/carousel-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-min.js","requires":["element","json","datasource","swf"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"],"supersedes":["connectioncore"]},"connectioncore":{"type":"js","path":"connection/connection_core-min.js","requires":["event"],"pkg":"connection"},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop","paginator"],"skinnable":true},datemath:{"type":"js","path":"datemath/datemath-min.js","requires":["yahoo"]},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-min.js","requires":["dom","event"],"optional":["event-mouseenter","event-delegate"]},"element-delegate":{"type":"js","path":"element-delegate/element-delegate-min.js","requires":["element"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"event-simulate":{"type":"js","path":"event-simulate/event-simulate-min.js","requires":["event"]},"event-delegate":{"type":"js","path":"event-delegate/event-delegate-min.js","requires":["event"],"optional":["selector"]},"event-mouseenter":{"type":"js","path":"event-mouseenter/event-mouseenter-min.js","requires":["dom","event"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-min.js","requires":["dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-min.js","requires":["element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"paginator":{"type":"js","path":"paginator/paginator-min.js","requires":["element"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"progressbar":{"type":"js","path":"progressbar/progressbar-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-min.js","requires":["dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"],"skinnable":true},"storage":{"type":"js","path":"storage/storage-min.js","requires":["yahoo","event","cookie"],"optional":["swfstore"]},"stylesheet":{"type":"js","path":"stylesheet/stylesheet-min.js","requires":["yahoo"]},"swf":{"type":"js","path":"swf/swf-min.js","requires":["element"],"supersedes":["swfdetect"]},"swfdetect":{"type":"js","path":"swfdetect/swfdetect-min.js","requires":["yahoo"]},"swfstore":{"type":"js","path":"swfstore/swfstore-min.js","requires":["element","cookie","swf"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event","dom"],"optional":["json","animation","calendar"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-min.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"optional":["event-simulate"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0; i=m.rollup);if(roll){break;}}}}}else{for(j=0;j=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(lang.hasOwnProperty(r,j)){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;iistartLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self});}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self});}else{loadScript();}return;}else{this.loadNext(this._loading);}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine();}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return;}this.loadNext();},sandbox:function(o,type){this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this._onFailure.call(this.varName+" reference failure");}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return;}if(mname){if(mname!==this._loading){return;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;iistartLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self});}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self});}else{loadScript();}return;}else{this.loadNext(this._loading);}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine();}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return;}this.loadNext();},sandbox:function(o,type){this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this._onFailure.call(this.varName+" reference failure");}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return;}if(mname){if(mname!==this._loading){return;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F; y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom._getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B; -this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; +this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.2r1",build:"7"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; }else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A); -},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C&]/g, function(c){ - switch(c){ - case "<": return "<"; - case ">": return ">"; - case "\"": return """; - case "'": return "'"; - case "&": return "&"; - } - }); - } - - /** - * Returns test results formatted as an XML string. - * @param {Object} result The results object created by TestRunner. - * @return {String} An XML-formatted string of results. - * @namespace YAHOO.tool.TestFormat - * @method XML - * @static - */ - YAHOO.tool.TestFormat.XML = function(results) { - - function serializeToXML(results){ - var l = YAHOO.lang, - xml = "<" + results.type + " name=\"" + xmlEscape(results.name) + "\""; - - if (l.isNumber(results.duration)){ - xml += " duration=\"" + results.duration + "\""; - } - - if (results.type == "test"){ - xml += " result=\"" + results.result + "\" message=\"" + xmlEscape(results.message) + "\">"; - } else { - xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">"; - for (var prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - xml += serializeToXML(results[prop]); - } - } - } - - xml += ""; - - return xml; - } - - return "" + serializeToXML(results); - - }; - - - /** - * Returns test results formatted in JUnit XML format. - * @param {Object} result The results object created by TestRunner. - * @return {String} An XML-formatted string of results. - * @namespace YAHOO.tool.TestFormat - * @method JUnitXML - * @static - */ - YAHOO.tool.TestFormat.JUnitXML = function(results) { - - - function serializeToJUnitXML(results){ - var l = YAHOO.lang, - xml = "", - prop; - - switch (results.type){ - //equivalent to testcase in JUnit - case "test": - if (results.result != "ignore"){ - xml = ""; - if (results.result == "fail"){ - xml += ""; - } - xml+= ""; - } - break; - - //equivalent to testsuite in JUnit - case "testcase": - - xml = ""; - - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - xml += serializeToJUnitXML(results[prop]); - } - } - - xml += ""; - break; - - case "testsuite": - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - xml += serializeToJUnitXML(results[prop]); - } - } - - //skip output - no JUnit equivalent - break; - - case "report": - - xml = ""; - - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - xml += serializeToJUnitXML(results[prop]); - } - } - - xml += ""; - - //no default - } - - return xml; - - } - - return "" + serializeToJUnitXML(results); - }; - - /** - * Returns test results formatted in TAP format. - * For more information, see Test Anything Protocol. - * @param {Object} result The results object created by TestRunner. - * @return {String} A TAP-formatted string of results. - * @namespace YAHOO.tool.TestFormat - * @method TAP - * @static - */ - YAHOO.tool.TestFormat.TAP = function(results) { - - var currentTestNum = 1; - - function serializeToTAP(results){ - var l = YAHOO.lang, - text = ""; - - switch (results.type){ - - case "test": - if (results.result != "ignore"){ - - text = "ok " + (currentTestNum++) + " - " + results.name; - - if (results.result == "fail"){ - text = "not " + text + " - " + results.message; - } - - text += "\n"; - } else { - text = "#Ignored test " + results.name + "\n"; - } - break; - - case "testcase": - - text = "#Begin testcase " + results.name + "(" + results.failed + " failed of " + results.total + ")\n"; - - - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - text += serializeToTAP(results[prop]); - } - } - - text += "#End testcase " + results.name + "\n"; - - - break; - - case "testsuite": - - text = "#Begin testsuite " + results.name + "(" + results.failed + " failed of " + results.total + ")\n"; - - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - text += serializeToTAP(results[prop]); - } - } - - text += "#End testsuite " + results.name + "\n"; - break; - - case "report": - - for (prop in results) { - if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ - text += serializeToTAP(results[prop]); - } - } - - //no default - } - - return text; - - } - - return "1.." + results.total + "\n" + serializeToTAP(results); - }; - -})(); - -YAHOO.namespace("tool.CoverageFormat"); - /** - * Returns the coverage report in JSON format. This is the straight - * JSON representation of the native coverage report. - * @param {Object} coverage The coverage report object. - * @return {String} A JSON-formatted string of coverage data. + * Returns test results formatted as a JSON string. Requires JSON utility. + * @param {Object} result The results object created by TestRunner. + * @return {String} An XML-formatted string of results. + * @namespace YAHOO.tool.TestFormat * @method JSON - * @namespace YAHOO.tool.CoverageFormat + * @static */ -YAHOO.tool.CoverageFormat.JSON = function(coverage){ - return YAHOO.lang.JSON.stringify(coverage); +YAHOO.tool.TestFormat.JSON = function(results /*:Object*/) /*:String*/ { + return YAHOO.lang.JSON.stringify(results); }; /** - * Returns the coverage report in a JSON format compatible with - * Xdebug. See Xdebug Documentation - * for more information. Note: function coverage is not available - * in this format. - * @param {Object} coverage The coverage report object. - * @return {String} A JSON-formatted string of coverage data. - * @method XdebugJSON - * @namespace YAHOO.tool.CoverageFormat + * Returns test results formatted as an XML string. + * @param {Object} result The results object created by TestRunner. + * @return {String} An XML-formatted string of results. + * @namespace YAHOO.tool.TestFormat + * @method XML + * @static */ -YAHOO.tool.CoverageFormat.XdebugJSON = function(coverage){ - var report = {}, - prop; - for (prop in coverage){ - if (coverage.hasOwnProperty(prop)){ - report[prop] = coverage[prop].lines; - } - } +YAHOO.tool.TestFormat.XML = function(results /*:Object*/) /*:String*/ { - return YAHOO.lang.JSON.stringify(report); -}; + var l = YAHOO.lang; + var xml /*:String*/ = "<" + results.type + " name=\"" + results.name.replace(/"/g, """).replace(/'/g, "'") + "\""; + + if (l.isNumber(results.duration)){ + xml += " duration=\"" + results.duration + "\""; + } + + if (results.type == "test"){ + xml += " result=\"" + results.result + "\" message=\"" + results.message + "\">"; + } else { + xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">"; + for (var prop in results) { + if (l.hasOwnProperty(results, prop) && l.isObject(results[prop]) && !l.isArray(results[prop])){ + xml += arguments.callee(results[prop]); + } + } + } + xml += ""; + + return xml; +}; YAHOO.namespace("tool"); /** @@ -3116,12 +2738,4 @@ YAHOO.tool.TestReporter.prototype = { } }; - -/*Stub for future compatibility*/ -YUITest = { - Runner: YAHOO.tool.TestRunner, - ResultsFormat: YAHOO.tool.TestFormat, - CoverageFormat: YAHOO.tool.CoverageFormat -}; - -YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "@VERSION@", build: "@BUILD@"}); +YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.8.2r1", build: "7"});