Bugzilla – Attachment 135675 Details for
Bug 13614
Replace usage of YUI on basket groups page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13614: Replace usage of YUI on basket groups page
Bug-13614-Replace-usage-of-YUI-on-basket-groups-pa.patch (text/plain), 2.79 MB, created by
Owen Leonard
on 2022-06-03 10:53:10 UTC
(
hide
)
Description:
Bug 13614: Replace usage of YUI on basket groups page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-06-03 10:53:10 UTC
Size:
2.79 MB
patch
obsolete
>From f1f175aedac2619c299e17213f3a4479b1ce0734 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 26 May 2022 16:44:35 +0000 >Subject: [PATCH] Bug 13614: Replace usage of YUI on basket groups page > >This patch updates the basket groups interface so that it doesn't rely >on YUI to move baskets in and out of groups. The patch also removes >all YUI assets and many long-obsolete references to YUI-related classes >and IDs. > >To test, apply the patch and rebuild the staff interface CSS >(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client) > >- Go to Acquisitions. >- Locate a vendor with multiple closed baskets. >- Click "Basket groups" in the sidebar menu. >- Create or edit a basket group. >- On the basket group page you should see the basket group form in one > column and ungrouped baskets in another. >- Both grouped and ungrouped baskets should be in a sortable > DataTable. >- Test that when you click the "Add to group" button on an ungrouped > basket the row is removed from the table of ungrouped baskets and > added to the table of grouped baskets. > - The button text on the row should now read "Remove." >- Test the reverse operation: Clicking "Remove" on a grouped basket > should move it to the table of ungrouped baskets. >- Test that when all baskets are moved out of either of the tables a row > is displayed with a message specific to that table, e.g. "There are no > ungrouped baskets." >- Test that the basket group saves correctly when zero or more baskets > are added to the group. >--- > .../lib/yui/animation/animation-debug.js | 1396 --- > .../lib/yui/animation/animation-min.js | 23 - > .../lib/yui/animation/animation.js | 1392 --- > .../lib/yui/button/assets/button-core.css | 44 - > .../button/assets/skins/sam/button-skin.css | 219 - > .../yui/button/assets/skins/sam/button.css | 7 - > .../skins/sam/menu-button-arrow-disabled.png | Bin 173 -> 0 bytes > .../assets/skins/sam/menu-button-arrow.png | Bin 173 -> 0 bytes > .../skins/sam/split-button-arrow-active.png | Bin 280 -> 0 bytes > .../skins/sam/split-button-arrow-disabled.png | Bin 185 -> 0 bytes > .../skins/sam/split-button-arrow-focus.png | Bin 185 -> 0 bytes > .../skins/sam/split-button-arrow-hover.png | Bin 185 -> 0 bytes > .../assets/skins/sam/split-button-arrow.png | Bin 185 -> 0 bytes > .../lib/yui/button/button-beta-min.js | 11 - > .../lib/yui/button/button-debug.js | 4694 -------- > .../lib/yui/button/button-min.js | 11 - > .../intranet-tmpl/lib/yui/button/button.js | 4633 -------- > .../lib/yui/container/assets/alrt16_1.gif | Bin 971 -> 0 bytes > .../lib/yui/container/assets/blck16_1.gif | Bin 591 -> 0 bytes > .../lib/yui/container/assets/close12_1.gif | Bin 85 -> 0 bytes > .../yui/container/assets/container-core.css | 176 - > .../lib/yui/container/assets/container.css | 324 - > .../lib/yui/container/assets/hlp16_1.gif | Bin 928 -> 0 bytes > .../lib/yui/container/assets/info16_1.gif | Bin 601 -> 0 bytes > .../assets/skins/sam/container-skin.css | 242 - > .../container/assets/skins/sam/container.css | 7 - > .../lib/yui/container/assets/tip16_1.gif | Bin 552 -> 0 bytes > .../lib/yui/container/assets/warn16_1.gif | Bin 580 -> 0 bytes > .../lib/yui/container/container-debug.js | 9076 --------------- > .../lib/yui/container/container-min.js | 19 - > .../lib/yui/container/container.js | 9052 --------------- > .../lib/yui/container/container_core-debug.js | 5136 --------- > .../lib/yui/container/container_core-min.js | 14 - > .../lib/yui/container/container_core.js | 5126 --------- > .../lib/yui/dragdrop/dragdrop-debug.js | 3710 ------- > .../lib/yui/dragdrop/dragdrop-min.js | 10 - > .../lib/yui/dragdrop/dragdrop.js | 3601 ------ > .../lib/yui/element/element-beta-min.js | 8 - > .../lib/yui/element/element-debug.js | 1106 -- > .../lib/yui/element/element-min.js | 8 - > .../intranet-tmpl/lib/yui/element/element.js | 1090 -- > .../intranet-tmpl/lib/yui/json/json-debug.js | 538 - > .../intranet-tmpl/lib/yui/json/json-min.js | 7 - > koha-tmpl/intranet-tmpl/lib/yui/json/json.js | 538 - > .../lib/yui/menu-button-arrow-disabled.png | Bin 173 -> 0 bytes > .../lib/yui/menu-button-arrow.png | Bin 173 -> 0 bytes > .../lib/yui/menu/assets/menu-core.css | 242 - > .../lib/yui/menu/assets/menu.css | 503 - > .../lib/yui/menu/assets/menu_down_arrow.png | Bin 3624 -> 0 bytes > .../menu/assets/menu_down_arrow_disabled.png | Bin 3621 -> 0 bytes > .../lib/yui/menu/assets/menu_up_arrow.png | Bin 936 -> 0 bytes > .../menu/assets/menu_up_arrow_disabled.png | Bin 936 -> 0 bytes > .../assets/menubaritem_submenuindicator.png | Bin 3623 -> 0 bytes > .../menubaritem_submenuindicator_disabled.png | Bin 3623 -> 0 bytes > .../menubaritem_submenuindicator_selected.png | Bin 3623 -> 0 bytes > .../lib/yui/menu/assets/menuitem_checkbox.png | Bin 956 -> 0 bytes > .../assets/menuitem_checkbox_disabled.png | Bin 956 -> 0 bytes > .../assets/menuitem_checkbox_selected.png | Bin 956 -> 0 bytes > .../menu/assets/menuitem_submenuindicator.png | Bin 942 -> 0 bytes > .../menuitem_submenuindicator_disabled.png | Bin 942 -> 0 bytes > .../menuitem_submenuindicator_selected.png | Bin 942 -> 0 bytes > .../yui/menu/assets/skins/sam/menu-skin.css | 339 - > .../lib/yui/menu/assets/skins/sam/menu.css | 7 - > .../sam/menubaritem_submenuindicator.png | Bin 3618 -> 0 bytes > .../menubaritem_submenuindicator_disabled.png | Bin 3618 -> 0 bytes > .../assets/skins/sam/menuitem_checkbox.png | Bin 3625 -> 0 bytes > .../skins/sam/menuitem_checkbox_disabled.png | Bin 3625 -> 0 bytes > .../skins/sam/menuitem_submenuindicator.png | Bin 3617 -> 0 bytes > .../menuitem_submenuindicator_disabled.png | Bin 3617 -> 0 bytes > .../intranet-tmpl/lib/yui/menu/menu-debug.js | 9870 ----------------- > .../intranet-tmpl/lib/yui/menu/menu-min.js | 16 - > koha-tmpl/intranet-tmpl/lib/yui/menu/menu.js | 9823 ---------------- > .../lib/yui/plugins/bubbling-min.js | 12 - > .../lib/yui/plugins/loading-min.js | 9 - > .../lib/yui/split-button-arrow-active.png | Bin 280 -> 0 bytes > .../lib/yui/split-button-arrow-disabled.png | Bin 185 -> 0 bytes > .../lib/yui/split-button-arrow-focus.png | Bin 185 -> 0 bytes > .../lib/yui/split-button-arrow-hover.png | Bin 185 -> 0 bytes > .../lib/yui/split-button-arrow.png | Bin 185 -> 0 bytes > koha-tmpl/intranet-tmpl/lib/yui/sprite.png | Bin 3123 -> 0 bytes > .../lib/yui/utilities/utilities.js | 39 - > .../yui/yahoo-dom-event/yahoo-dom-event.js | 14 - > .../intranet-tmpl/prog/css/preferences.css | 3 - > koha-tmpl/intranet-tmpl/prog/css/print.css | 7 - > .../prog/css/printreceiptinvoice.css | 10 - > .../intranet-tmpl/prog/css/right-to-left.css | 147 +- > .../intranet-tmpl/prog/css/src/_tables.scss | 4 - > .../intranet-tmpl/prog/en/modules/about.tt | 4 - > .../prog/en/modules/acqui/basketgroup.tt | 265 +- > .../prog/en/modules/circ/offline-mf.tt | 1 - > .../prog/en/modules/members/search.tt | 2 +- > .../prog/en/modules/tools/import_borrowers.tt | 1 - > 92 files changed, 137 insertions(+), 73399 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/animation/animation-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/animation/animation-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/animation/animation.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/button-core.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button-skin.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-active.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/button-beta-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/button-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/button-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/button/button.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/alrt16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/blck16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/close12_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/container-core.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/container.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/hlp16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/info16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container-skin.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/tip16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/assets/warn16_1.gif > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container_core-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container_core-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/container/container_core.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/element/element-beta-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/element/element-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/element/element-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/element/element.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/json/json-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/json/json-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/json/json.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu-button-arrow-disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu-button-arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu-core.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_selected.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_selected.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu-skin.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu.css > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/menu-debug.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/menu-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/menu/menu.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/plugins/bubbling-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/plugins/loading-min.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow-active.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow-disabled.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow-focus.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow-hover.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/sprite.png > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/utilities/utilities.js > delete mode 100644 koha-tmpl/intranet-tmpl/lib/yui/yahoo-dom-event/yahoo-dom-event.js > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-debug.js >deleted file mode 100644 >index 58451e7802..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-debug.js >+++ /dev/null >@@ -1,1396 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function() { >- >-var Y = YAHOO.util; >- >-/* >-Copyright (c) 2006, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-*/ >- >-/** >- * The animation module provides allows effects to be added to HTMLElements. >- * @module animation >- * @requires yahoo, event, dom >- */ >- >-/** >- * >- * Base animation class that provides the interface for building animated effects. >- * <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p> >- * @class Anim >- * @namespace YAHOO.util >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @constructor >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- >-var Anim = function(el, attributes, duration, method) { >- if (!el) { >- YAHOO.log('element required to create Anim instance', 'error', 'Anim'); >- } >- this.init(el, attributes, duration, method); >-}; >- >-Anim.NAME = 'Anim'; >- >-Anim.prototype = { >- /** >- * Provides a readable name for the Anim instance. >- * @method toString >- * @return {String} >- */ >- toString: function() { >- var el = this.getEl() || {}; >- var id = el.id || el.tagName; >- return (this.constructor.NAME + ': ' + id); >- }, >- >- patterns: { // cached for performance >- noNegatives: /width|height|opacity|padding/i, // keep at zero or above >- offsetAttribute: /^((width|height)|(top|left))$/, // use offsetValue as default >- defaultUnit: /width|height|top$|bottom$|left$|right$/i, // use 'px' by default >- offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i // IE may return these, so convert these to offset >- }, >- >- /** >- * Returns the value computed by the animation's "method". >- * @method doMethod >- * @param {String} attr The name of the attribute. >- * @param {Number} start The value this attribute should start from for this animation. >- * @param {Number} end The value this attribute should end at for this animation. >- * @return {Number} The Value to be applied to the attribute. >- */ >- doMethod: function(attr, start, end) { >- return this.method(this.currentFrame, start, end - start, this.totalFrames); >- }, >- >- /** >- * Applies a value to an attribute. >- * @method setAttribute >- * @param {String} attr The name of the attribute. >- * @param {Number} val The value to be applied to the attribute. >- * @param {String} unit The unit ('px', '%', etc.) of the value. >- */ >- setAttribute: function(attr, val, unit) { >- var el = this.getEl(); >- if ( this.patterns.noNegatives.test(attr) ) { >- val = (val > 0) ? val : 0; >- } >- >- if (attr in el && !('style' in el && attr in el.style)) { >- el[attr] = val; >- } else { >- Y.Dom.setStyle(el, attr, val + unit); >- } >- }, >- >- /** >- * Returns current value of the attribute. >- * @method getAttribute >- * @param {String} attr The name of the attribute. >- * @return {Number} val The current value of the attribute. >- */ >- getAttribute: function(attr) { >- var el = this.getEl(); >- var val = Y.Dom.getStyle(el, attr); >- >- if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) { >- return parseFloat(val); >- } >- >- var a = this.patterns.offsetAttribute.exec(attr) || []; >- var pos = !!( a[3] ); // top or left >- var box = !!( a[2] ); // width or height >- >- if ('style' in el) { >- // use offsets for width/height and abs pos top/left >- if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) { >- val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)]; >- } else { // default to zero for other 'auto' >- val = 0; >- } >- } else if (attr in el) { >- val = el[attr]; >- } >- >- return val; >- }, >- >- /** >- * Returns the unit to use when none is supplied. >- * @method getDefaultUnit >- * @param {attr} attr The name of the attribute. >- * @return {String} The default unit to be used. >- */ >- getDefaultUnit: function(attr) { >- if ( this.patterns.defaultUnit.test(attr) ) { >- return 'px'; >- } >- >- return ''; >- }, >- >- /** >- * Sets the actual values to be used during the animation. Should only be needed for subclass use. >- * @method setRuntimeAttribute >- * @param {Object} attr The attribute object >- * @private >- */ >- setRuntimeAttribute: function(attr) { >- var start; >- var end; >- var attributes = this.attributes; >- >- this.runtimeAttributes[attr] = {}; >- >- var isset = function(prop) { >- return (typeof prop !== 'undefined'); >- }; >- >- if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) { >- return false; // note return; nothing to animate to >- } >- >- start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr); >- >- // To beats by, per SMIL 2.1 spec >- if ( isset(attributes[attr]['to']) ) { >- end = attributes[attr]['to']; >- } else if ( isset(attributes[attr]['by']) ) { >- if (start.constructor == Array) { >- end = []; >- for (var i = 0, len = start.length; i < len; ++i) { >- end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" >- } >- } else { >- end = start + attributes[attr]['by'] * 1; >- } >- } >- >- this.runtimeAttributes[attr].start = start; >- this.runtimeAttributes[attr].end = end; >- >- // set units if needed >- this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? >- attributes[attr]['unit'] : this.getDefaultUnit(attr); >- return true; >- }, >- >- /** >- * Constructor for Anim instance. >- * @method init >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- init: function(el, attributes, duration, method) { >- /** >- * Whether or not the animation is running. >- * @property isAnimated >- * @private >- * @type Boolean >- */ >- var isAnimated = false; >- >- /** >- * A Date object that is created when the animation begins. >- * @property startTime >- * @private >- * @type Date >- */ >- var startTime = null; >- >- /** >- * The number of frames this animation was able to execute. >- * @property actualFrames >- * @private >- * @type Int >- */ >- var actualFrames = 0; >- >- /** >- * The element to be animated. >- * @property el >- * @private >- * @type HTMLElement >- */ >- el = Y.Dom.get(el); >- >- /** >- * The collection of attributes to be animated. >- * Each attribute must have at least a "to" or "by" defined in order to animate. >- * If "to" is supplied, the animation will end with the attribute at that value. >- * If "by" is supplied, the animation will end at that value plus its starting value. >- * If both are supplied, "to" is used, and "by" is ignored. >- * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values). >- * @property attributes >- * @type Object >- */ >- this.attributes = attributes || {}; >- >- /** >- * The length of the animation. Defaults to "1" (second). >- * @property duration >- * @type Number >- */ >- this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1; >- >- /** >- * The method that will provide values to the attribute(s) during the animation. >- * Defaults to "YAHOO.util.Easing.easeNone". >- * @property method >- * @type Function >- */ >- this.method = method || Y.Easing.easeNone; >- >- /** >- * Whether or not the duration should be treated as seconds. >- * Defaults to true. >- * @property useSeconds >- * @type Boolean >- */ >- this.useSeconds = true; // default to seconds >- >- /** >- * The location of the current animation on the timeline. >- * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. >- * @property currentFrame >- * @type Int >- */ >- this.currentFrame = 0; >- >- /** >- * The total number of frames to be executed. >- * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. >- * @property totalFrames >- * @type Int >- */ >- this.totalFrames = Y.AnimMgr.fps; >- >- /** >- * Changes the animated element >- * @method setEl >- */ >- this.setEl = function(element) { >- el = Y.Dom.get(element); >- }; >- >- /** >- * Returns a reference to the animated element. >- * @method getEl >- * @return {HTMLElement} >- */ >- this.getEl = function() { return el; }; >- >- /** >- * Checks whether the element is currently animated. >- * @method isAnimated >- * @return {Boolean} current value of isAnimated. >- */ >- this.isAnimated = function() { >- return isAnimated; >- }; >- >- /** >- * Returns the animation start time. >- * @method getStartTime >- * @return {Date} current value of startTime. >- */ >- this.getStartTime = function() { >- return startTime; >- }; >- >- this.runtimeAttributes = {}; >- >- var logger = {}; >- logger.log = function() {YAHOO.log.apply(window, arguments)}; >- >- logger.log('creating new instance of ' + this); >- >- /** >- * Starts the animation by registering it with the animation manager. >- * @method animate >- */ >- this.animate = function() { >- if ( this.isAnimated() ) { >- return false; >- } >- >- this.currentFrame = 0; >- >- this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration; >- >- if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration >- this.totalFrames = 1; >- } >- Y.AnimMgr.registerElement(this); >- return true; >- }; >- >- /** >- * Stops the animation. Normally called by AnimMgr when animation completes. >- * @method stop >- * @param {Boolean} finish (optional) If true, animation will jump to final frame. >- */ >- this.stop = function(finish) { >- if (!this.isAnimated()) { // nothing to stop >- return false; >- } >- >- if (finish) { >- this.currentFrame = this.totalFrames; >- this._onTween.fire(); >- } >- Y.AnimMgr.stop(this); >- }; >- >- var onStart = function() { >- this.onStart.fire(); >- >- this.runtimeAttributes = {}; >- for (var attr in this.attributes) { >- this.setRuntimeAttribute(attr); >- } >- >- isAnimated = true; >- actualFrames = 0; >- startTime = new Date(); >- }; >- >- /** >- * Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s). >- * @private >- */ >- >- var onTween = function() { >- var data = { >- duration: new Date() - this.getStartTime(), >- currentFrame: this.currentFrame >- }; >- >- data.toString = function() { >- return ( >- 'duration: ' + data.duration + >- ', currentFrame: ' + data.currentFrame >- ); >- }; >- >- this.onTween.fire(data); >- >- var runtimeAttributes = this.runtimeAttributes; >- >- for (var attr in runtimeAttributes) { >- this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit); >- } >- >- actualFrames += 1; >- }; >- >- var onComplete = function() { >- var actual_duration = (new Date() - startTime) / 1000 ; >- >- var data = { >- duration: actual_duration, >- frames: actualFrames, >- fps: actualFrames / actual_duration >- }; >- >- data.toString = function() { >- return ( >- 'duration: ' + data.duration + >- ', frames: ' + data.frames + >- ', fps: ' + data.fps >- ); >- }; >- >- isAnimated = false; >- actualFrames = 0; >- this.onComplete.fire(data); >- }; >- >- /** >- * Custom event that fires after onStart, useful in subclassing >- * @private >- */ >- this._onStart = new Y.CustomEvent('_start', this, true); >- >- /** >- * Custom event that fires when animation begins >- * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) >- * @event onStart >- */ >- this.onStart = new Y.CustomEvent('start', this); >- >- /** >- * Custom event that fires between each frame >- * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction) >- * @event onTween >- */ >- this.onTween = new Y.CustomEvent('tween', this); >- >- /** >- * Custom event that fires after onTween >- * @private >- */ >- this._onTween = new Y.CustomEvent('_tween', this, true); >- >- /** >- * Custom event that fires when animation ends >- * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) >- * @event onComplete >- */ >- this.onComplete = new Y.CustomEvent('complete', this); >- /** >- * Custom event that fires after onComplete >- * @private >- */ >- this._onComplete = new Y.CustomEvent('_complete', this, true); >- >- this._onStart.subscribe(onStart); >- this._onTween.subscribe(onTween); >- this._onComplete.subscribe(onComplete); >- } >-}; >- >- Y.Anim = Anim; >-})(); >-/** >- * Handles animation queueing and threading. >- * Used by Anim and subclasses. >- * @class AnimMgr >- * @namespace YAHOO.util >- */ >-YAHOO.util.AnimMgr = new function() { >- /** >- * Reference to the animation Interval. >- * @property thread >- * @private >- * @type Int >- */ >- var thread = null; >- >- /** >- * The current queue of registered animation objects. >- * @property queue >- * @private >- * @type Array >- */ >- var queue = []; >- >- /** >- * The number of active animations. >- * @property tweenCount >- * @private >- * @type Int >- */ >- var tweenCount = 0; >- >- /** >- * Base frame rate (frames per second). >- * Arbitrarily high for better x-browser calibration (slower browsers drop more frames). >- * @property fps >- * @type Int >- * >- */ >- this.fps = 1000; >- >- /** >- * Interval delay in milliseconds, defaults to fastest possible. >- * @property delay >- * @type Int >- * >- */ >- this.delay = 1; >- >- /** >- * Adds an animation instance to the animation queue. >- * All animation instances must be registered in order to animate. >- * @method registerElement >- * @param {object} tween The Anim instance to be be registered >- */ >- this.registerElement = function(tween) { >- queue[queue.length] = tween; >- tweenCount += 1; >- tween._onStart.fire(); >- this.start(); >- }; >- >- /** >- * removes an animation instance from the animation queue. >- * All animation instances must be registered in order to animate. >- * @method unRegister >- * @param {object} tween The Anim instance to be be registered >- * @param {Int} index The index of the Anim instance >- * @private >- */ >- this.unRegister = function(tween, index) { >- index = index || getIndex(tween); >- if (!tween.isAnimated() || index === -1) { >- return false; >- } >- >- tween._onComplete.fire(); >- queue.splice(index, 1); >- >- tweenCount -= 1; >- if (tweenCount <= 0) { >- this.stop(); >- } >- >- return true; >- }; >- >- /** >- * Starts the animation thread. >- * Only one thread can run at a time. >- * @method start >- */ >- this.start = function() { >- if (thread === null) { >- thread = setInterval(this.run, this.delay); >- } >- }; >- >- /** >- * Stops the animation thread or a specific animation instance. >- * @method stop >- * @param {object} tween A specific Anim instance to stop (optional) >- * If no instance given, Manager stops thread and all animations. >- */ >- this.stop = function(tween) { >- if (!tween) { >- clearInterval(thread); >- >- for (var i = 0, len = queue.length; i < len; ++i) { >- this.unRegister(queue[0], 0); >- } >- >- queue = []; >- thread = null; >- tweenCount = 0; >- } >- else { >- this.unRegister(tween); >- } >- }; >- >- /** >- * Called per Interval to handle each animation frame. >- * @method run >- */ >- this.run = function() { >- for (var i = 0, len = queue.length; i < len; ++i) { >- var tween = queue[i]; >- if ( !tween || !tween.isAnimated() ) { continue; } >- >- if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null) >- { >- tween.currentFrame += 1; >- >- if (tween.useSeconds) { >- correctFrame(tween); >- } >- tween._onTween.fire(); >- } >- else { YAHOO.util.AnimMgr.stop(tween, i); } >- } >- }; >- >- var getIndex = function(anim) { >- for (var i = 0, len = queue.length; i < len; ++i) { >- if (queue[i] === anim) { >- return i; // note return; >- } >- } >- return -1; >- }; >- >- /** >- * On the fly frame correction to keep animation on time. >- * @method correctFrame >- * @private >- * @param {Object} tween The Anim instance being corrected. >- */ >- var correctFrame = function(tween) { >- var frames = tween.totalFrames; >- var frame = tween.currentFrame; >- var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames); >- var elapsed = (new Date() - tween.getStartTime()); >- var tweak = 0; >- >- if (elapsed < tween.duration * 1000) { // check if falling behind >- tweak = Math.round((elapsed / expected - 1) * tween.currentFrame); >- } else { // went over duration, so jump to end >- tweak = frames - (frame + 1); >- } >- if (tweak > 0 && isFinite(tweak)) { // adjust if needed >- if (tween.currentFrame + tweak >= frames) {// dont go past last frame >- tweak = frames - (frame + 1); >- } >- >- tween.currentFrame += tweak; >- } >- }; >- this._queue = queue; >- this._getIndex = getIndex; >-}; >-/** >- * Used to calculate Bezier splines for any number of control points. >- * @class Bezier >- * @namespace YAHOO.util >- * >- */ >-YAHOO.util.Bezier = new function() { >- /** >- * Get the current position of the animated element based on t. >- * Each point is an array of "x" and "y" values (0 = x, 1 = y) >- * At least 2 points are required (start and end). >- * First point is start. Last point is end. >- * Additional control points are optional. >- * @method getPosition >- * @param {Array} points An array containing Bezier points >- * @param {Number} t A number between 0 and 1 which is the basis for determining current position >- * @return {Array} An array containing int x and y member data >- */ >- this.getPosition = function(points, t) { >- var n = points.length; >- var tmp = []; >- >- for (var i = 0; i < n; ++i){ >- tmp[i] = [points[i][0], points[i][1]]; // save input >- } >- >- for (var j = 1; j < n; ++j) { >- for (i = 0; i < n - j; ++i) { >- tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; >- tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; >- } >- } >- >- return [ tmp[0][0], tmp[0][1] ]; >- >- }; >-}; >-(function() { >-/** >- * Anim subclass for color transitions. >- * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233, >- * [255,255,255], or rgb(255,255,255)</p> >- * @class ColorAnim >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @constructor >- * @extends YAHOO.util.Anim >- * @param {HTMLElement | String} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var ColorAnim = function(el, attributes, duration, method) { >- ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); >- }; >- >- ColorAnim.NAME = 'ColorAnim'; >- >- ColorAnim.DEFAULT_BGCOLOR = '#fff'; >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(ColorAnim, Y.Anim); >- >- var superclass = ColorAnim.superclass; >- var proto = ColorAnim.prototype; >- >- proto.patterns.color = /color$/i; >- proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i; >- proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i; >- proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i; >- proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari >- >- /** >- * Attempts to parse the given string and return a 3-tuple. >- * @method parseColor >- * @param {String} s The string to parse. >- * @return {Array} The 3-tuple of rgb values. >- */ >- proto.parseColor = function(s) { >- if (s.length == 3) { return s; } >- >- var c = this.patterns.hex.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ]; >- } >- >- c = this.patterns.rgb.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ]; >- } >- >- c = this.patterns.hex3.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ]; >- } >- >- return null; >- }; >- >- proto.getAttribute = function(attr) { >- var el = this.getEl(); >- if (this.patterns.color.test(attr) ) { >- var val = YAHOO.util.Dom.getStyle(el, attr); >- >- var that = this; >- if (this.patterns.transparent.test(val)) { // bgcolor default >- var parent = YAHOO.util.Dom.getAncestorBy(el, function(node) { >- return !that.patterns.transparent.test(val); >- }); >- >- if (parent) { >- val = Y.Dom.getStyle(parent, attr); >- } else { >- val = ColorAnim.DEFAULT_BGCOLOR; >- } >- } >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.doMethod = function(attr, start, end) { >- var val; >- >- if ( this.patterns.color.test(attr) ) { >- val = []; >- for (var i = 0, len = start.length; i < len; ++i) { >- val[i] = superclass.doMethod.call(this, attr, start[i], end[i]); >- } >- >- val = 'rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')'; >- } >- else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- >- return val; >- }; >- >- proto.setRuntimeAttribute = function(attr) { >- superclass.setRuntimeAttribute.call(this, attr); >- >- if ( this.patterns.color.test(attr) ) { >- var attributes = this.attributes; >- var start = this.parseColor(this.runtimeAttributes[attr].start); >- var end = this.parseColor(this.runtimeAttributes[attr].end); >- // fix colors if going "by" >- if ( typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined' ) { >- end = this.parseColor(attributes[attr].by); >- >- for (var i = 0, len = start.length; i < len; ++i) { >- end[i] = start[i] + end[i]; >- } >- } >- >- this.runtimeAttributes[attr].start = start; >- this.runtimeAttributes[attr].end = end; >- } >- }; >- >- Y.ColorAnim = ColorAnim; >-})(); >-/*! >-TERMS OF USE - EASING EQUATIONS >-Open source under the BSD License. >-Copyright 2001 Robert Penner All rights reserved. >- >-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: >- >- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. >- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. >- * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. >- >-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >-*/ >- >-/** >- * Singleton that determines how an animation proceeds from start to end. >- * @class Easing >- * @namespace YAHOO.util >-*/ >- >-YAHOO.util.Easing = { >- >- /** >- * Uniform speed between points. >- * @method easeNone >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeNone: function (t, b, c, d) { >- return c*t/d + b; >- }, >- >- /** >- * Begins slowly and accelerates towards end. >- * @method easeIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeIn: function (t, b, c, d) { >- return c*(t/=d)*t + b; >- }, >- >- /** >- * Begins quickly and decelerates towards end. >- * @method easeOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeOut: function (t, b, c, d) { >- return -c *(t/=d)*(t-2) + b; >- }, >- >- /** >- * Begins slowly and decelerates towards end. >- * @method easeBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeBoth: function (t, b, c, d) { >- if ((t/=d/2) < 1) { >- return c/2*t*t + b; >- } >- >- return -c/2 * ((--t)*(t-2) - 1) + b; >- }, >- >- /** >- * Begins slowly and accelerates towards end. >- * @method easeInStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeInStrong: function (t, b, c, d) { >- return c*(t/=d)*t*t*t + b; >- }, >- >- /** >- * Begins quickly and decelerates towards end. >- * @method easeOutStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeOutStrong: function (t, b, c, d) { >- return -c * ((t=t/d-1)*t*t*t - 1) + b; >- }, >- >- /** >- * Begins slowly and decelerates towards end. >- * @method easeBothStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeBothStrong: function (t, b, c, d) { >- if ((t/=d/2) < 1) { >- return c/2*t*t*t*t + b; >- } >- >- return -c/2 * ((t-=2)*t*t*t - 2) + b; >- }, >- >- /** >- * Snap in elastic effect. >- * @method elasticIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- >- elasticIn: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- if ( (t /= d) == 1 ) { >- return b+c; >- } >- if (!p) { >- p=d*.3; >- } >- >- if (!a || a < Math.abs(c)) { >- a = c; >- var s = p/4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; >- }, >- >- /** >- * Snap out elastic effect. >- * @method elasticOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- elasticOut: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- if ( (t /= d) == 1 ) { >- return b+c; >- } >- if (!p) { >- p=d*.3; >- } >- >- if (!a || a < Math.abs(c)) { >- a = c; >- var s = p / 4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; >- }, >- >- /** >- * Snap both elastic effect. >- * @method elasticBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- elasticBoth: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- >- if ( (t /= d/2) == 2 ) { >- return b+c; >- } >- >- if (!p) { >- p = d*(.3*1.5); >- } >- >- if ( !a || a < Math.abs(c) ) { >- a = c; >- var s = p/4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- if (t < 1) { >- return -.5*(a*Math.pow(2,10*(t-=1)) * >- Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; >- } >- return a*Math.pow(2,-10*(t-=1)) * >- Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; >- }, >- >- >- /** >- * Backtracks slightly, then reverses direction and moves to end. >- * @method backIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backIn: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- return c*(t/=d)*t*((s+1)*t - s) + b; >- }, >- >- /** >- * Overshoots end, then reverses and comes back to end. >- * @method backOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backOut: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; >- }, >- >- /** >- * Backtracks slightly, then reverses direction, overshoots end, >- * then reverses and comes back to end. >- * @method backBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backBoth: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- >- if ((t /= d/2 ) < 1) { >- return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; >- } >- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; >- }, >- >- /** >- * Bounce off of start. >- * @method bounceIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceIn: function (t, b, c, d) { >- return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b; >- }, >- >- /** >- * Bounces off end. >- * @method bounceOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceOut: function (t, b, c, d) { >- if ((t/=d) < (1/2.75)) { >- return c*(7.5625*t*t) + b; >- } else if (t < (2/2.75)) { >- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; >- } else if (t < (2.5/2.75)) { >- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; >- } >- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; >- }, >- >- /** >- * Bounces off start and end. >- * @method bounceBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceBoth: function (t, b, c, d) { >- if (t < d/2) { >- return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b; >- } >- return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; >- } >-}; >- >-(function() { >-/** >- * Anim subclass for moving elements along a path defined by the "points" >- * member of "attributes". All "points" are arrays with x, y coordinates. >- * <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p> >- * @class Motion >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @constructor >- * @extends YAHOO.util.ColorAnim >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var Motion = function(el, attributes, duration, method) { >- if (el) { // dont break existing subclasses not using YAHOO.extend >- Motion.superclass.constructor.call(this, el, attributes, duration, method); >- } >- }; >- >- >- Motion.NAME = 'Motion'; >- >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(Motion, Y.ColorAnim); >- >- var superclass = Motion.superclass; >- var proto = Motion.prototype; >- >- proto.patterns.points = /^points$/i; >- >- proto.setAttribute = function(attr, val, unit) { >- if ( this.patterns.points.test(attr) ) { >- unit = unit || 'px'; >- superclass.setAttribute.call(this, 'left', val[0], unit); >- superclass.setAttribute.call(this, 'top', val[1], unit); >- } else { >- superclass.setAttribute.call(this, attr, val, unit); >- } >- }; >- >- proto.getAttribute = function(attr) { >- if ( this.patterns.points.test(attr) ) { >- var val = [ >- superclass.getAttribute.call(this, 'left'), >- superclass.getAttribute.call(this, 'top') >- ]; >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.doMethod = function(attr, start, end) { >- var val = null; >- >- if ( this.patterns.points.test(attr) ) { >- var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100; >- val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t); >- } else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- return val; >- }; >- >- proto.setRuntimeAttribute = function(attr) { >- if ( this.patterns.points.test(attr) ) { >- var el = this.getEl(); >- var attributes = this.attributes; >- var start; >- var control = attributes['points']['control'] || []; >- var end; >- var i, len; >- >- if (control.length > 0 && !(control[0] instanceof Array) ) { // could be single point or array of points >- control = [control]; >- } else { // break reference to attributes.points.control >- var tmp = []; >- for (i = 0, len = control.length; i< len; ++i) { >- tmp[i] = control[i]; >- } >- control = tmp; >- } >- >- if (Y.Dom.getStyle(el, 'position') == 'static') { // default to relative >- Y.Dom.setStyle(el, 'position', 'relative'); >- } >- >- if ( isset(attributes['points']['from']) ) { >- Y.Dom.setXY(el, attributes['points']['from']); // set position to from point >- } >- else { Y.Dom.setXY( el, Y.Dom.getXY(el) ); } // set it to current position >- >- start = this.getAttribute('points'); // get actual top & left >- >- // TO beats BY, per SMIL 2.1 spec >- if ( isset(attributes['points']['to']) ) { >- end = translateValues.call(this, attributes['points']['to'], start); >- >- var pageXY = Y.Dom.getXY(this.getEl()); >- for (i = 0, len = control.length; i < len; ++i) { >- control[i] = translateValues.call(this, control[i], start); >- } >- >- >- } else if ( isset(attributes['points']['by']) ) { >- end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ]; >- >- for (i = 0, len = control.length; i < len; ++i) { >- control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; >- } >- } >- >- this.runtimeAttributes[attr] = [start]; >- >- if (control.length > 0) { >- this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control); >- } >- >- this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end; >- } >- else { >- superclass.setRuntimeAttribute.call(this, attr); >- } >- }; >- >- var translateValues = function(val, start) { >- var pageXY = Y.Dom.getXY(this.getEl()); >- val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ]; >- >- return val; >- }; >- >- var isset = function(prop) { >- return (typeof prop !== 'undefined'); >- }; >- >- Y.Motion = Motion; >-})(); >-(function() { >-/** >- * Anim subclass for scrolling elements to a position defined by the "scroll" >- * member of "attributes". All "scroll" members are arrays with x, y scroll positions. >- * <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p> >- * @class Scroll >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @extends YAHOO.util.ColorAnim >- * @constructor >- * @param {String or HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var Scroll = function(el, attributes, duration, method) { >- if (el) { // dont break existing subclasses not using YAHOO.extend >- Scroll.superclass.constructor.call(this, el, attributes, duration, method); >- } >- }; >- >- Scroll.NAME = 'Scroll'; >- >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(Scroll, Y.ColorAnim); >- >- var superclass = Scroll.superclass; >- var proto = Scroll.prototype; >- >- proto.doMethod = function(attr, start, end) { >- var val = null; >- >- if (attr == 'scroll') { >- val = [ >- this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames), >- this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames) >- ]; >- >- } else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- return val; >- }; >- >- proto.getAttribute = function(attr) { >- var val = null; >- var el = this.getEl(); >- >- if (attr == 'scroll') { >- val = [ el.scrollLeft, el.scrollTop ]; >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.setAttribute = function(attr, val, unit) { >- var el = this.getEl(); >- >- if (attr == 'scroll') { >- el.scrollLeft = val[0]; >- el.scrollTop = val[1]; >- } else { >- superclass.setAttribute.call(this, attr, val, unit); >- } >- }; >- >- Y.Scroll = Scroll; >-})(); >-YAHOO.register("animation", YAHOO.util.Anim, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-min.js b/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-min.js >deleted file mode 100644 >index 9fe8c62d1f..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation-min.js >+++ /dev/null >@@ -1,23 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,F,E){var D=this.getEl();if(this.patterns.noNegatives.test(C)){F=(F>0)?F:0;}if(C in D&&!("style" in D&&C in D.style)){D[C]=F;}else{B.Dom.setStyle(D,C,F+E);}},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if("style" in E){if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}}else{if(C in E){G=E[C];}}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F===-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]===H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};this._queue=B;this._getIndex=E;};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]; >-}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I);});if(F){I=C.Dom.getStyle(F,E);}else{I=A.DEFAULT_BGCOLOR;}}}else{I=D.getAttribute.call(this,E);}return I;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})(); >-/* >-TERMS OF USE - EASING EQUATIONS >-Open source under the BSD License. >-Copyright 2001 Robert Penner All rights reserved. >- >-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: >- >- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. >- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. >- * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. >- >-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >-*/ >-YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]); >-}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation.js b/koha-tmpl/intranet-tmpl/lib/yui/animation/animation.js >deleted file mode 100644 >index 5737b68bb2..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/animation/animation.js >+++ /dev/null >@@ -1,1392 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function() { >- >-var Y = YAHOO.util; >- >-/* >-Copyright (c) 2006, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-*/ >- >-/** >- * The animation module provides allows effects to be added to HTMLElements. >- * @module animation >- * @requires yahoo, event, dom >- */ >- >-/** >- * >- * Base animation class that provides the interface for building animated effects. >- * <p>Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p> >- * @class Anim >- * @namespace YAHOO.util >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @constructor >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- >-var Anim = function(el, attributes, duration, method) { >- if (!el) { >- } >- this.init(el, attributes, duration, method); >-}; >- >-Anim.NAME = 'Anim'; >- >-Anim.prototype = { >- /** >- * Provides a readable name for the Anim instance. >- * @method toString >- * @return {String} >- */ >- toString: function() { >- var el = this.getEl() || {}; >- var id = el.id || el.tagName; >- return (this.constructor.NAME + ': ' + id); >- }, >- >- patterns: { // cached for performance >- noNegatives: /width|height|opacity|padding/i, // keep at zero or above >- offsetAttribute: /^((width|height)|(top|left))$/, // use offsetValue as default >- defaultUnit: /width|height|top$|bottom$|left$|right$/i, // use 'px' by default >- offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i // IE may return these, so convert these to offset >- }, >- >- /** >- * Returns the value computed by the animation's "method". >- * @method doMethod >- * @param {String} attr The name of the attribute. >- * @param {Number} start The value this attribute should start from for this animation. >- * @param {Number} end The value this attribute should end at for this animation. >- * @return {Number} The Value to be applied to the attribute. >- */ >- doMethod: function(attr, start, end) { >- return this.method(this.currentFrame, start, end - start, this.totalFrames); >- }, >- >- /** >- * Applies a value to an attribute. >- * @method setAttribute >- * @param {String} attr The name of the attribute. >- * @param {Number} val The value to be applied to the attribute. >- * @param {String} unit The unit ('px', '%', etc.) of the value. >- */ >- setAttribute: function(attr, val, unit) { >- var el = this.getEl(); >- if ( this.patterns.noNegatives.test(attr) ) { >- val = (val > 0) ? val : 0; >- } >- >- if (attr in el && !('style' in el && attr in el.style)) { >- el[attr] = val; >- } else { >- Y.Dom.setStyle(el, attr, val + unit); >- } >- }, >- >- /** >- * Returns current value of the attribute. >- * @method getAttribute >- * @param {String} attr The name of the attribute. >- * @return {Number} val The current value of the attribute. >- */ >- getAttribute: function(attr) { >- var el = this.getEl(); >- var val = Y.Dom.getStyle(el, attr); >- >- if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) { >- return parseFloat(val); >- } >- >- var a = this.patterns.offsetAttribute.exec(attr) || []; >- var pos = !!( a[3] ); // top or left >- var box = !!( a[2] ); // width or height >- >- if ('style' in el) { >- // use offsets for width/height and abs pos top/left >- if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) { >- val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)]; >- } else { // default to zero for other 'auto' >- val = 0; >- } >- } else if (attr in el) { >- val = el[attr]; >- } >- >- return val; >- }, >- >- /** >- * Returns the unit to use when none is supplied. >- * @method getDefaultUnit >- * @param {attr} attr The name of the attribute. >- * @return {String} The default unit to be used. >- */ >- getDefaultUnit: function(attr) { >- if ( this.patterns.defaultUnit.test(attr) ) { >- return 'px'; >- } >- >- return ''; >- }, >- >- /** >- * Sets the actual values to be used during the animation. Should only be needed for subclass use. >- * @method setRuntimeAttribute >- * @param {Object} attr The attribute object >- * @private >- */ >- setRuntimeAttribute: function(attr) { >- var start; >- var end; >- var attributes = this.attributes; >- >- this.runtimeAttributes[attr] = {}; >- >- var isset = function(prop) { >- return (typeof prop !== 'undefined'); >- }; >- >- if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) { >- return false; // note return; nothing to animate to >- } >- >- start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr); >- >- // To beats by, per SMIL 2.1 spec >- if ( isset(attributes[attr]['to']) ) { >- end = attributes[attr]['to']; >- } else if ( isset(attributes[attr]['by']) ) { >- if (start.constructor == Array) { >- end = []; >- for (var i = 0, len = start.length; i < len; ++i) { >- end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" >- } >- } else { >- end = start + attributes[attr]['by'] * 1; >- } >- } >- >- this.runtimeAttributes[attr].start = start; >- this.runtimeAttributes[attr].end = end; >- >- // set units if needed >- this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? >- attributes[attr]['unit'] : this.getDefaultUnit(attr); >- return true; >- }, >- >- /** >- * Constructor for Anim instance. >- * @method init >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- init: function(el, attributes, duration, method) { >- /** >- * Whether or not the animation is running. >- * @property isAnimated >- * @private >- * @type Boolean >- */ >- var isAnimated = false; >- >- /** >- * A Date object that is created when the animation begins. >- * @property startTime >- * @private >- * @type Date >- */ >- var startTime = null; >- >- /** >- * The number of frames this animation was able to execute. >- * @property actualFrames >- * @private >- * @type Int >- */ >- var actualFrames = 0; >- >- /** >- * The element to be animated. >- * @property el >- * @private >- * @type HTMLElement >- */ >- el = Y.Dom.get(el); >- >- /** >- * The collection of attributes to be animated. >- * Each attribute must have at least a "to" or "by" defined in order to animate. >- * If "to" is supplied, the animation will end with the attribute at that value. >- * If "by" is supplied, the animation will end at that value plus its starting value. >- * If both are supplied, "to" is used, and "by" is ignored. >- * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values). >- * @property attributes >- * @type Object >- */ >- this.attributes = attributes || {}; >- >- /** >- * The length of the animation. Defaults to "1" (second). >- * @property duration >- * @type Number >- */ >- this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1; >- >- /** >- * The method that will provide values to the attribute(s) during the animation. >- * Defaults to "YAHOO.util.Easing.easeNone". >- * @property method >- * @type Function >- */ >- this.method = method || Y.Easing.easeNone; >- >- /** >- * Whether or not the duration should be treated as seconds. >- * Defaults to true. >- * @property useSeconds >- * @type Boolean >- */ >- this.useSeconds = true; // default to seconds >- >- /** >- * The location of the current animation on the timeline. >- * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. >- * @property currentFrame >- * @type Int >- */ >- this.currentFrame = 0; >- >- /** >- * The total number of frames to be executed. >- * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. >- * @property totalFrames >- * @type Int >- */ >- this.totalFrames = Y.AnimMgr.fps; >- >- /** >- * Changes the animated element >- * @method setEl >- */ >- this.setEl = function(element) { >- el = Y.Dom.get(element); >- }; >- >- /** >- * Returns a reference to the animated element. >- * @method getEl >- * @return {HTMLElement} >- */ >- this.getEl = function() { return el; }; >- >- /** >- * Checks whether the element is currently animated. >- * @method isAnimated >- * @return {Boolean} current value of isAnimated. >- */ >- this.isAnimated = function() { >- return isAnimated; >- }; >- >- /** >- * Returns the animation start time. >- * @method getStartTime >- * @return {Date} current value of startTime. >- */ >- this.getStartTime = function() { >- return startTime; >- }; >- >- this.runtimeAttributes = {}; >- >- >- >- /** >- * Starts the animation by registering it with the animation manager. >- * @method animate >- */ >- this.animate = function() { >- if ( this.isAnimated() ) { >- return false; >- } >- >- this.currentFrame = 0; >- >- this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration; >- >- if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration >- this.totalFrames = 1; >- } >- Y.AnimMgr.registerElement(this); >- return true; >- }; >- >- /** >- * Stops the animation. Normally called by AnimMgr when animation completes. >- * @method stop >- * @param {Boolean} finish (optional) If true, animation will jump to final frame. >- */ >- this.stop = function(finish) { >- if (!this.isAnimated()) { // nothing to stop >- return false; >- } >- >- if (finish) { >- this.currentFrame = this.totalFrames; >- this._onTween.fire(); >- } >- Y.AnimMgr.stop(this); >- }; >- >- var onStart = function() { >- this.onStart.fire(); >- >- this.runtimeAttributes = {}; >- for (var attr in this.attributes) { >- this.setRuntimeAttribute(attr); >- } >- >- isAnimated = true; >- actualFrames = 0; >- startTime = new Date(); >- }; >- >- /** >- * Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s). >- * @private >- */ >- >- var onTween = function() { >- var data = { >- duration: new Date() - this.getStartTime(), >- currentFrame: this.currentFrame >- }; >- >- data.toString = function() { >- return ( >- 'duration: ' + data.duration + >- ', currentFrame: ' + data.currentFrame >- ); >- }; >- >- this.onTween.fire(data); >- >- var runtimeAttributes = this.runtimeAttributes; >- >- for (var attr in runtimeAttributes) { >- this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit); >- } >- >- actualFrames += 1; >- }; >- >- var onComplete = function() { >- var actual_duration = (new Date() - startTime) / 1000 ; >- >- var data = { >- duration: actual_duration, >- frames: actualFrames, >- fps: actualFrames / actual_duration >- }; >- >- data.toString = function() { >- return ( >- 'duration: ' + data.duration + >- ', frames: ' + data.frames + >- ', fps: ' + data.fps >- ); >- }; >- >- isAnimated = false; >- actualFrames = 0; >- this.onComplete.fire(data); >- }; >- >- /** >- * Custom event that fires after onStart, useful in subclassing >- * @private >- */ >- this._onStart = new Y.CustomEvent('_start', this, true); >- >- /** >- * Custom event that fires when animation begins >- * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) >- * @event onStart >- */ >- this.onStart = new Y.CustomEvent('start', this); >- >- /** >- * Custom event that fires between each frame >- * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction) >- * @event onTween >- */ >- this.onTween = new Y.CustomEvent('tween', this); >- >- /** >- * Custom event that fires after onTween >- * @private >- */ >- this._onTween = new Y.CustomEvent('_tween', this, true); >- >- /** >- * Custom event that fires when animation ends >- * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) >- * @event onComplete >- */ >- this.onComplete = new Y.CustomEvent('complete', this); >- /** >- * Custom event that fires after onComplete >- * @private >- */ >- this._onComplete = new Y.CustomEvent('_complete', this, true); >- >- this._onStart.subscribe(onStart); >- this._onTween.subscribe(onTween); >- this._onComplete.subscribe(onComplete); >- } >-}; >- >- Y.Anim = Anim; >-})(); >-/** >- * Handles animation queueing and threading. >- * Used by Anim and subclasses. >- * @class AnimMgr >- * @namespace YAHOO.util >- */ >-YAHOO.util.AnimMgr = new function() { >- /** >- * Reference to the animation Interval. >- * @property thread >- * @private >- * @type Int >- */ >- var thread = null; >- >- /** >- * The current queue of registered animation objects. >- * @property queue >- * @private >- * @type Array >- */ >- var queue = []; >- >- /** >- * The number of active animations. >- * @property tweenCount >- * @private >- * @type Int >- */ >- var tweenCount = 0; >- >- /** >- * Base frame rate (frames per second). >- * Arbitrarily high for better x-browser calibration (slower browsers drop more frames). >- * @property fps >- * @type Int >- * >- */ >- this.fps = 1000; >- >- /** >- * Interval delay in milliseconds, defaults to fastest possible. >- * @property delay >- * @type Int >- * >- */ >- this.delay = 1; >- >- /** >- * Adds an animation instance to the animation queue. >- * All animation instances must be registered in order to animate. >- * @method registerElement >- * @param {object} tween The Anim instance to be be registered >- */ >- this.registerElement = function(tween) { >- queue[queue.length] = tween; >- tweenCount += 1; >- tween._onStart.fire(); >- this.start(); >- }; >- >- /** >- * removes an animation instance from the animation queue. >- * All animation instances must be registered in order to animate. >- * @method unRegister >- * @param {object} tween The Anim instance to be be registered >- * @param {Int} index The index of the Anim instance >- * @private >- */ >- this.unRegister = function(tween, index) { >- index = index || getIndex(tween); >- if (!tween.isAnimated() || index === -1) { >- return false; >- } >- >- tween._onComplete.fire(); >- queue.splice(index, 1); >- >- tweenCount -= 1; >- if (tweenCount <= 0) { >- this.stop(); >- } >- >- return true; >- }; >- >- /** >- * Starts the animation thread. >- * Only one thread can run at a time. >- * @method start >- */ >- this.start = function() { >- if (thread === null) { >- thread = setInterval(this.run, this.delay); >- } >- }; >- >- /** >- * Stops the animation thread or a specific animation instance. >- * @method stop >- * @param {object} tween A specific Anim instance to stop (optional) >- * If no instance given, Manager stops thread and all animations. >- */ >- this.stop = function(tween) { >- if (!tween) { >- clearInterval(thread); >- >- for (var i = 0, len = queue.length; i < len; ++i) { >- this.unRegister(queue[0], 0); >- } >- >- queue = []; >- thread = null; >- tweenCount = 0; >- } >- else { >- this.unRegister(tween); >- } >- }; >- >- /** >- * Called per Interval to handle each animation frame. >- * @method run >- */ >- this.run = function() { >- for (var i = 0, len = queue.length; i < len; ++i) { >- var tween = queue[i]; >- if ( !tween || !tween.isAnimated() ) { continue; } >- >- if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null) >- { >- tween.currentFrame += 1; >- >- if (tween.useSeconds) { >- correctFrame(tween); >- } >- tween._onTween.fire(); >- } >- else { YAHOO.util.AnimMgr.stop(tween, i); } >- } >- }; >- >- var getIndex = function(anim) { >- for (var i = 0, len = queue.length; i < len; ++i) { >- if (queue[i] === anim) { >- return i; // note return; >- } >- } >- return -1; >- }; >- >- /** >- * On the fly frame correction to keep animation on time. >- * @method correctFrame >- * @private >- * @param {Object} tween The Anim instance being corrected. >- */ >- var correctFrame = function(tween) { >- var frames = tween.totalFrames; >- var frame = tween.currentFrame; >- var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames); >- var elapsed = (new Date() - tween.getStartTime()); >- var tweak = 0; >- >- if (elapsed < tween.duration * 1000) { // check if falling behind >- tweak = Math.round((elapsed / expected - 1) * tween.currentFrame); >- } else { // went over duration, so jump to end >- tweak = frames - (frame + 1); >- } >- if (tweak > 0 && isFinite(tweak)) { // adjust if needed >- if (tween.currentFrame + tweak >= frames) {// dont go past last frame >- tweak = frames - (frame + 1); >- } >- >- tween.currentFrame += tweak; >- } >- }; >- this._queue = queue; >- this._getIndex = getIndex; >-}; >-/** >- * Used to calculate Bezier splines for any number of control points. >- * @class Bezier >- * @namespace YAHOO.util >- * >- */ >-YAHOO.util.Bezier = new function() { >- /** >- * Get the current position of the animated element based on t. >- * Each point is an array of "x" and "y" values (0 = x, 1 = y) >- * At least 2 points are required (start and end). >- * First point is start. Last point is end. >- * Additional control points are optional. >- * @method getPosition >- * @param {Array} points An array containing Bezier points >- * @param {Number} t A number between 0 and 1 which is the basis for determining current position >- * @return {Array} An array containing int x and y member data >- */ >- this.getPosition = function(points, t) { >- var n = points.length; >- var tmp = []; >- >- for (var i = 0; i < n; ++i){ >- tmp[i] = [points[i][0], points[i][1]]; // save input >- } >- >- for (var j = 1; j < n; ++j) { >- for (i = 0; i < n - j; ++i) { >- tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; >- tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; >- } >- } >- >- return [ tmp[0][0], tmp[0][1] ]; >- >- }; >-}; >-(function() { >-/** >- * Anim subclass for color transitions. >- * <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233, >- * [255,255,255], or rgb(255,255,255)</p> >- * @class ColorAnim >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @constructor >- * @extends YAHOO.util.Anim >- * @param {HTMLElement | String} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var ColorAnim = function(el, attributes, duration, method) { >- ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); >- }; >- >- ColorAnim.NAME = 'ColorAnim'; >- >- ColorAnim.DEFAULT_BGCOLOR = '#fff'; >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(ColorAnim, Y.Anim); >- >- var superclass = ColorAnim.superclass; >- var proto = ColorAnim.prototype; >- >- proto.patterns.color = /color$/i; >- proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i; >- proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i; >- proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i; >- proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari >- >- /** >- * Attempts to parse the given string and return a 3-tuple. >- * @method parseColor >- * @param {String} s The string to parse. >- * @return {Array} The 3-tuple of rgb values. >- */ >- proto.parseColor = function(s) { >- if (s.length == 3) { return s; } >- >- var c = this.patterns.hex.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ]; >- } >- >- c = this.patterns.rgb.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ]; >- } >- >- c = this.patterns.hex3.exec(s); >- if (c && c.length == 4) { >- return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ]; >- } >- >- return null; >- }; >- >- proto.getAttribute = function(attr) { >- var el = this.getEl(); >- if (this.patterns.color.test(attr) ) { >- var val = YAHOO.util.Dom.getStyle(el, attr); >- >- var that = this; >- if (this.patterns.transparent.test(val)) { // bgcolor default >- var parent = YAHOO.util.Dom.getAncestorBy(el, function(node) { >- return !that.patterns.transparent.test(val); >- }); >- >- if (parent) { >- val = Y.Dom.getStyle(parent, attr); >- } else { >- val = ColorAnim.DEFAULT_BGCOLOR; >- } >- } >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.doMethod = function(attr, start, end) { >- var val; >- >- if ( this.patterns.color.test(attr) ) { >- val = []; >- for (var i = 0, len = start.length; i < len; ++i) { >- val[i] = superclass.doMethod.call(this, attr, start[i], end[i]); >- } >- >- val = 'rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')'; >- } >- else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- >- return val; >- }; >- >- proto.setRuntimeAttribute = function(attr) { >- superclass.setRuntimeAttribute.call(this, attr); >- >- if ( this.patterns.color.test(attr) ) { >- var attributes = this.attributes; >- var start = this.parseColor(this.runtimeAttributes[attr].start); >- var end = this.parseColor(this.runtimeAttributes[attr].end); >- // fix colors if going "by" >- if ( typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined' ) { >- end = this.parseColor(attributes[attr].by); >- >- for (var i = 0, len = start.length; i < len; ++i) { >- end[i] = start[i] + end[i]; >- } >- } >- >- this.runtimeAttributes[attr].start = start; >- this.runtimeAttributes[attr].end = end; >- } >- }; >- >- Y.ColorAnim = ColorAnim; >-})(); >-/*! >-TERMS OF USE - EASING EQUATIONS >-Open source under the BSD License. >-Copyright 2001 Robert Penner All rights reserved. >- >-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: >- >- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. >- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. >- * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. >- >-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >-*/ >- >-/** >- * Singleton that determines how an animation proceeds from start to end. >- * @class Easing >- * @namespace YAHOO.util >-*/ >- >-YAHOO.util.Easing = { >- >- /** >- * Uniform speed between points. >- * @method easeNone >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeNone: function (t, b, c, d) { >- return c*t/d + b; >- }, >- >- /** >- * Begins slowly and accelerates towards end. >- * @method easeIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeIn: function (t, b, c, d) { >- return c*(t/=d)*t + b; >- }, >- >- /** >- * Begins quickly and decelerates towards end. >- * @method easeOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeOut: function (t, b, c, d) { >- return -c *(t/=d)*(t-2) + b; >- }, >- >- /** >- * Begins slowly and decelerates towards end. >- * @method easeBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeBoth: function (t, b, c, d) { >- if ((t/=d/2) < 1) { >- return c/2*t*t + b; >- } >- >- return -c/2 * ((--t)*(t-2) - 1) + b; >- }, >- >- /** >- * Begins slowly and accelerates towards end. >- * @method easeInStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeInStrong: function (t, b, c, d) { >- return c*(t/=d)*t*t*t + b; >- }, >- >- /** >- * Begins quickly and decelerates towards end. >- * @method easeOutStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeOutStrong: function (t, b, c, d) { >- return -c * ((t=t/d-1)*t*t*t - 1) + b; >- }, >- >- /** >- * Begins slowly and decelerates towards end. >- * @method easeBothStrong >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- easeBothStrong: function (t, b, c, d) { >- if ((t/=d/2) < 1) { >- return c/2*t*t*t*t + b; >- } >- >- return -c/2 * ((t-=2)*t*t*t - 2) + b; >- }, >- >- /** >- * Snap in elastic effect. >- * @method elasticIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- >- elasticIn: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- if ( (t /= d) == 1 ) { >- return b+c; >- } >- if (!p) { >- p=d*.3; >- } >- >- if (!a || a < Math.abs(c)) { >- a = c; >- var s = p/4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; >- }, >- >- /** >- * Snap out elastic effect. >- * @method elasticOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- elasticOut: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- if ( (t /= d) == 1 ) { >- return b+c; >- } >- if (!p) { >- p=d*.3; >- } >- >- if (!a || a < Math.abs(c)) { >- a = c; >- var s = p / 4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; >- }, >- >- /** >- * Snap both elastic effect. >- * @method elasticBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} a Amplitude (optional) >- * @param {Number} p Period (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- elasticBoth: function (t, b, c, d, a, p) { >- if (t == 0) { >- return b; >- } >- >- if ( (t /= d/2) == 2 ) { >- return b+c; >- } >- >- if (!p) { >- p = d*(.3*1.5); >- } >- >- if ( !a || a < Math.abs(c) ) { >- a = c; >- var s = p/4; >- } >- else { >- var s = p/(2*Math.PI) * Math.asin (c/a); >- } >- >- if (t < 1) { >- return -.5*(a*Math.pow(2,10*(t-=1)) * >- Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; >- } >- return a*Math.pow(2,-10*(t-=1)) * >- Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; >- }, >- >- >- /** >- * Backtracks slightly, then reverses direction and moves to end. >- * @method backIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backIn: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- return c*(t/=d)*t*((s+1)*t - s) + b; >- }, >- >- /** >- * Overshoots end, then reverses and comes back to end. >- * @method backOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backOut: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; >- }, >- >- /** >- * Backtracks slightly, then reverses direction, overshoots end, >- * then reverses and comes back to end. >- * @method backBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @param {Number} s Overshoot (optional) >- * @return {Number} The computed value for the current animation frame >- */ >- backBoth: function (t, b, c, d, s) { >- if (typeof s == 'undefined') { >- s = 1.70158; >- } >- >- if ((t /= d/2 ) < 1) { >- return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; >- } >- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; >- }, >- >- /** >- * Bounce off of start. >- * @method bounceIn >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceIn: function (t, b, c, d) { >- return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b; >- }, >- >- /** >- * Bounces off end. >- * @method bounceOut >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceOut: function (t, b, c, d) { >- if ((t/=d) < (1/2.75)) { >- return c*(7.5625*t*t) + b; >- } else if (t < (2/2.75)) { >- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; >- } else if (t < (2.5/2.75)) { >- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; >- } >- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; >- }, >- >- /** >- * Bounces off start and end. >- * @method bounceBoth >- * @param {Number} t Time value used to compute current value >- * @param {Number} b Starting value >- * @param {Number} c Delta between start and end values >- * @param {Number} d Total length of animation >- * @return {Number} The computed value for the current animation frame >- */ >- bounceBoth: function (t, b, c, d) { >- if (t < d/2) { >- return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b; >- } >- return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; >- } >-}; >- >-(function() { >-/** >- * Anim subclass for moving elements along a path defined by the "points" >- * member of "attributes". All "points" are arrays with x, y coordinates. >- * <p>Usage: <code>var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p> >- * @class Motion >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @constructor >- * @extends YAHOO.util.ColorAnim >- * @param {String | HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var Motion = function(el, attributes, duration, method) { >- if (el) { // dont break existing subclasses not using YAHOO.extend >- Motion.superclass.constructor.call(this, el, attributes, duration, method); >- } >- }; >- >- >- Motion.NAME = 'Motion'; >- >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(Motion, Y.ColorAnim); >- >- var superclass = Motion.superclass; >- var proto = Motion.prototype; >- >- proto.patterns.points = /^points$/i; >- >- proto.setAttribute = function(attr, val, unit) { >- if ( this.patterns.points.test(attr) ) { >- unit = unit || 'px'; >- superclass.setAttribute.call(this, 'left', val[0], unit); >- superclass.setAttribute.call(this, 'top', val[1], unit); >- } else { >- superclass.setAttribute.call(this, attr, val, unit); >- } >- }; >- >- proto.getAttribute = function(attr) { >- if ( this.patterns.points.test(attr) ) { >- var val = [ >- superclass.getAttribute.call(this, 'left'), >- superclass.getAttribute.call(this, 'top') >- ]; >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.doMethod = function(attr, start, end) { >- var val = null; >- >- if ( this.patterns.points.test(attr) ) { >- var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100; >- val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t); >- } else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- return val; >- }; >- >- proto.setRuntimeAttribute = function(attr) { >- if ( this.patterns.points.test(attr) ) { >- var el = this.getEl(); >- var attributes = this.attributes; >- var start; >- var control = attributes['points']['control'] || []; >- var end; >- var i, len; >- >- if (control.length > 0 && !(control[0] instanceof Array) ) { // could be single point or array of points >- control = [control]; >- } else { // break reference to attributes.points.control >- var tmp = []; >- for (i = 0, len = control.length; i< len; ++i) { >- tmp[i] = control[i]; >- } >- control = tmp; >- } >- >- if (Y.Dom.getStyle(el, 'position') == 'static') { // default to relative >- Y.Dom.setStyle(el, 'position', 'relative'); >- } >- >- if ( isset(attributes['points']['from']) ) { >- Y.Dom.setXY(el, attributes['points']['from']); // set position to from point >- } >- else { Y.Dom.setXY( el, Y.Dom.getXY(el) ); } // set it to current position >- >- start = this.getAttribute('points'); // get actual top & left >- >- // TO beats BY, per SMIL 2.1 spec >- if ( isset(attributes['points']['to']) ) { >- end = translateValues.call(this, attributes['points']['to'], start); >- >- var pageXY = Y.Dom.getXY(this.getEl()); >- for (i = 0, len = control.length; i < len; ++i) { >- control[i] = translateValues.call(this, control[i], start); >- } >- >- >- } else if ( isset(attributes['points']['by']) ) { >- end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ]; >- >- for (i = 0, len = control.length; i < len; ++i) { >- control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; >- } >- } >- >- this.runtimeAttributes[attr] = [start]; >- >- if (control.length > 0) { >- this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control); >- } >- >- this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end; >- } >- else { >- superclass.setRuntimeAttribute.call(this, attr); >- } >- }; >- >- var translateValues = function(val, start) { >- var pageXY = Y.Dom.getXY(this.getEl()); >- val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ]; >- >- return val; >- }; >- >- var isset = function(prop) { >- return (typeof prop !== 'undefined'); >- }; >- >- Y.Motion = Motion; >-})(); >-(function() { >-/** >- * Anim subclass for scrolling elements to a position defined by the "scroll" >- * member of "attributes". All "scroll" members are arrays with x, y scroll positions. >- * <p>Usage: <code>var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);</code></p> >- * @class Scroll >- * @namespace YAHOO.util >- * @requires YAHOO.util.Anim >- * @requires YAHOO.util.AnimMgr >- * @requires YAHOO.util.Easing >- * @requires YAHOO.util.Bezier >- * @requires YAHOO.util.Dom >- * @requires YAHOO.util.Event >- * @requires YAHOO.util.CustomEvent >- * @extends YAHOO.util.ColorAnim >- * @constructor >- * @param {String or HTMLElement} el Reference to the element that will be animated >- * @param {Object} attributes The attribute(s) to be animated. >- * Each attribute is an object with at minimum a "to" or "by" member defined. >- * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). >- * All attribute names use camelCase. >- * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based >- * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) >- */ >- var Scroll = function(el, attributes, duration, method) { >- if (el) { // dont break existing subclasses not using YAHOO.extend >- Scroll.superclass.constructor.call(this, el, attributes, duration, method); >- } >- }; >- >- Scroll.NAME = 'Scroll'; >- >- // shorthand >- var Y = YAHOO.util; >- YAHOO.extend(Scroll, Y.ColorAnim); >- >- var superclass = Scroll.superclass; >- var proto = Scroll.prototype; >- >- proto.doMethod = function(attr, start, end) { >- var val = null; >- >- if (attr == 'scroll') { >- val = [ >- this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames), >- this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames) >- ]; >- >- } else { >- val = superclass.doMethod.call(this, attr, start, end); >- } >- return val; >- }; >- >- proto.getAttribute = function(attr) { >- var val = null; >- var el = this.getEl(); >- >- if (attr == 'scroll') { >- val = [ el.scrollLeft, el.scrollTop ]; >- } else { >- val = superclass.getAttribute.call(this, attr); >- } >- >- return val; >- }; >- >- proto.setAttribute = function(attr, val, unit) { >- var el = this.getEl(); >- >- if (attr == 'scroll') { >- el.scrollLeft = val[0]; >- el.scrollTop = val[1]; >- } else { >- superclass.setAttribute.call(this, attr, val, unit); >- } >- }; >- >- Y.Scroll = Scroll; >-})(); >-YAHOO.register("animation", YAHOO.util.Anim, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/button-core.css b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/button-core.css >deleted file mode 100644 >index 0aeeb9de68..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/button-core.css >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.yui-button { >- >- display: -moz-inline-box; /* Gecko */ >- display: inline-block; /* IE, Opera and Safari */ >- vertical-align: text-bottom; >- >-} >- >-.yui-button .first-child { >- >- display: block; >- *display: inline-block; /* IE */ >- >-} >- >-.yui-button button, >-.yui-button a { >- >- display: block; >- *display: inline-block; /* IE */ >- border: none; >- margin: 0; >- >-} >- >-.yui-button button { >- >- background-color: transparent; >- *overflow: visible; /* Remove superfluous padding for IE */ >- cursor: pointer; >- >-} >- >-.yui-button a { >- >- text-decoration: none; >- >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button-skin.css b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button-skin.css >deleted file mode 100644 >index 9aeaba813e..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button-skin.css >+++ /dev/null >@@ -1,219 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.yui-skin-sam .yui-button { >- >- border-width: 1px 0; >- border-style: solid; >- border-color: #808080; >- background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; >- margin: auto .25em; >- >-} >- >-.yui-skin-sam .yui-button .first-child { >- >- border-width: 0 1px; >- border-style: solid; >- border-color: #808080; >- margin: 0 -1px; >- >- /* >- Using negative margins for rounded corners won't work in IE 6 and IE 7 >- (Quirks Mode Only), so set the "margin" property to "0" for those >- browsers. >- */ >- _margin: 0; >- >-} >- >-.yui-skin-sam .yui-button button, >-.yui-skin-sam .yui-button a, >-.yui-skin-sam .yui-button a:visited { >- >- padding: 0 10px; >- font-size: 93%; /* 12px */ >- line-height: 2; /* ~24px */ >- *line-height: 1.7; /* For IE */ >- min-height: 2em; /* For Gecko */ >- *min-height: auto; /* For IE */ >- color: #000; >- >-} >- >-.yui-skin-sam .yui-button a { >- >- /* >- Necessary to get Buttons of type "link" to be the correct >- height in IE. >- */ >- *line-height: 1.875; >- *padding-bottom: 1px; >- >-} >- >-.yui-skin-sam .yui-split-button button, >-.yui-skin-sam .yui-menu-button button { >- >- padding-right: 20px; >- background-position: right center; >- background-repeat: no-repeat; >- >-} >- >-.yui-skin-sam .yui-menu-button button { >- >- background-image: url(menu-button-arrow.png); >- >-} >- >-.yui-skin-sam .yui-split-button button { >- >- background-image: url(split-button-arrow.png); >- >-} >- >- >-/* Focus state */ >- >- >-.yui-skin-sam .yui-button-focus { >- >- border-color: #7D98B8; >- background-position: 0 -1300px; >- >-} >- >-.yui-skin-sam .yui-button-focus .first-child { >- >- border-color: #7D98B8; >- >-} >- >-.yui-skin-sam .yui-split-button-focus button { >- >- background-image: url(split-button-arrow-focus.png); >- >-} >- >- >-/* Hover state */ >- >-.yui-skin-sam .yui-button-hover { >- >- border-color: #7D98B8; >- background-position: 0 -1300px; >- >-} >- >-.yui-skin-sam .yui-button-hover .first-child { >- >- border-color: #7D98B8; >- >-} >- >-.yui-skin-sam .yui-split-button-hover button { >- >- background-image: url(split-button-arrow-hover.png); >- >-} >- >- >-/* Active state */ >- >-.yui-skin-sam .yui-button-active { >- >- border-color: #7D98B8; >- background-position: 0 -1700px; >- >-} >- >-.yui-skin-sam .yui-button-active .first-child { >- >- border-color: #7D98B8; >- >-} >- >-.yui-skin-sam .yui-split-button-activeoption { >- >- border-color: #808080; >- background-position: 0 0; >- >-} >- >-.yui-skin-sam .yui-split-button-activeoption .first-child { >- >- border-color: #808080; >- >-} >- >-.yui-skin-sam .yui-split-button-activeoption button { >- >- background-image: url(split-button-arrow-active.png); >- >-} >- >- >-/* Checked state */ >- >-.yui-skin-sam .yui-radio-button-checked, >-.yui-skin-sam .yui-checkbox-button-checked { >- >- border-color: #304369; >- background-position: 0 -1400px; >- >-} >- >-.yui-skin-sam .yui-radio-button-checked .first-child, >-.yui-skin-sam .yui-checkbox-button-checked .first-child { >- >- border-color: #304369; >- >-} >- >-.yui-skin-sam .yui-radio-button-checked button, >-.yui-skin-sam .yui-checkbox-button-checked button { >- >- color: #fff; >- >-} >- >- >-/* Disabled state */ >- >-.yui-skin-sam .yui-button-disabled { >- >- border-color: #ccc; >- background-position: 0 -1500px; >- >-} >- >-.yui-skin-sam .yui-button-disabled .first-child { >- >- border-color: #ccc; >- >-} >- >-.yui-skin-sam .yui-button-disabled button, >-.yui-skin-sam .yui-button-disabled a, >-.yui-skin-sam .yui-button-disabled a:visited { >- >- color: #A6A6A6; >- cursor: default; >- >-} >- >-.yui-skin-sam .yui-menu-button-disabled button { >- >- background-image: url(menu-button-arrow-disabled.png); >- >-} >- >-.yui-skin-sam .yui-split-button-disabled button { >- >- background-image: url(split-button-arrow-disabled.png); >- >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button.css b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button.css >deleted file mode 100644 >index b3b6c64d42..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/button.css >+++ /dev/null >@@ -1,7 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;_margin:0;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a,.yui-skin-sam .yui-button a:visited{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:1.875;*padding-bottom:1px;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a,.yui-skin-sam .yui-button-disabled a:visited{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);} >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png >deleted file mode 100644 >index 8cef2abb31170a370c7062c839ea9d5e9de18948..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 173 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~d!3-ofWcl9%anc=q9T^y|-MHc(VFct$mbgZg >z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$(3-AeXt*@{D|Np;u@pD<A2vbRr >zU+{m1r`rv@fIN9m7srr_TS*BG3~mw$2`*2WStSC0C@{LE*eN?SFfy=iVle#vvS2q* >ODTAl0pUXO@geCxqL^6l~ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/menu-button-arrow.png >deleted file mode 100644 >index f03dfee4e4055e98d278ce80bf400ed8d39424dd..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 173 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~d!3-ofWcl9%anc=q9T^y|-MHc(VFct$mbgZg >z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$(3-AeX1=9cj|6h7@{#_u8sU*lR >z_&>wb?FL>zp1h}vV@SoVq=W_rH;IG<m#56E5`jMy7~N9rlpPuv8CW+l7=C|Qup6k9 >N!PC{xWt~$(699VTGIsy~ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-active.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-active.png >deleted file mode 100644 >index fa58c5030e76082c84e38342cf6722c723ad2fd2..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 280 >zcmV+z0q6dSP)<h;3K|Lk000e1NJLTq000mG001%w0{{R3Vo9rR00004XF*Lt007q5 >z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUyLQqUpMd<SX >zy4e4Hn7HQg{{R30$KU_a=Kss$|Jv#QzuN!j^8du$|L5`l)#v}$=>N~-|K;%i-0c73 >z@c-iO|KRQa-|hd~QeFE1003M`L_t(|+U&?l5`sVg1i`WZK}Epr|6dhmytLs92=mel >z9uoULP6;mwyM%qhIpHzkHQ|(SNO(*5TD8?y@wq9xG<+26t_AN^`$=39HtEMPCOjwP >e%l`;(0R{kdKn;SADLBOd0000<MNUMnLSTZ{QG&k! > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png >deleted file mode 100644 >index 0a6a82c6402848193044fcb9791e915161c890d3..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 185 >zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY >zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_T+f_2Q(s^I|Nnnag9j&p >zg3KjBe!>6$Gh9E#3p9{H-P6S}q~camLV^=3&tj%#_Xa_x2_Xl57U&w-9pX85Q9;Im >dv4Me^VIeE)+1pK9I)PdkJYD@<);T3K0RYcxInw|D > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png >deleted file mode 100644 >index 167d71eb721ba9b85c6601f9077d5c39faa4ebd2..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 185 >zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY >zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf >zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 >b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png >deleted file mode 100644 >index 167d71eb721ba9b85c6601f9077d5c39faa4ebd2..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 185 >zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY >zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf >zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 >b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/button/assets/skins/sam/split-button-arrow.png >deleted file mode 100644 >index b33a93ff2dc2039bd24e4ea3b75ecf4bb3295f84..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 185 >zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY >zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_TpJo1fXx5@|JyBHuocK+ >zE(!7r{{Nrh`YB$Zfeh-NE{-7;w~`VPoLG4lGc~(62r^9wIq<VU*TC)&&#{XNG7gLl >b49pA*Sy|8CZraib)WYED>gTe~DWM4f1sXSq > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/button-beta-min.js b/koha-tmpl/intranet-tmpl/lib/yui/button/button-beta-min.js >deleted file mode 100644 >index c5aee13826..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/button-beta-min.js >+++ /dev/null >@@ -1,11 +0,0 @@ >-/* >-Copyright (c) 2007, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.3.1 >-*/ >-(function(){var G=YAHOO.util.Dom,L=YAHOO.util.Event,I=YAHOO.lang,B=YAHOO.widget.Overlay,J=YAHOO.widget.Menu,D={},K=null,E=null,C=null;function F(N,M,Q,O){var R,P;if(I.isString(N)&&I.isString(M)){if(YAHOO.env.ua.ie){P="<input type=\""+N+"\" name=\""+M+"\"";if(O){P+=" checked";}P+=">";R=document.createElement(P);}else{R=document.createElement("input");R.name=M;R.type=N;if(O){R.checked=true;}}R.value=Q;return R;}}function H(N,T){var M=N.nodeName.toUpperCase(),R=this,S,O,P;function U(V){if(!(V in T)){S=N.getAttributeNode(V);if(S&&("value" in S)){T[V]=S.value;}}}function Q(){U("type");if(T.type=="button"){T.type="push";}if(!("disabled" in T)){T.disabled=N.disabled;}U("name");U("value");U("title");}switch(M){case"A":T.type="link";U("href");U("target");break;case"INPUT":Q();if(!("checked" in T)){T.checked=N.checked;}break;case"BUTTON":Q();O=N.parentNode.parentNode;if(G.hasClass(O,this.CSS_CLASS_NAME+"-checked")){T.checked=true;}if(G.hasClass(O,this.CSS_CLASS_NAME+"-disabled")){T.disabled=true;}N.removeAttribute("value");N.setAttribute("type","button");break;}N.removeAttribute("id");N.removeAttribute("name");if(!("tabindex" in T)){T.tabindex=N.tabIndex;}if(!("label" in T)){P=M=="INPUT"?N.value:N.innerHTML;if(P&&P.length>0){T.label=P;}}}function A(O){var N=O.attributes,M=N.srcelement,Q=M.nodeName.toUpperCase(),P=this;if(Q==this.NODE_NAME){O.element=M;O.id=M.id;G.getElementsBy(function(R){switch(R.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":H.call(P,R,N);break;}},"*",M);}else{switch(Q){case"BUTTON":case"A":case"INPUT":H.call(this,M,N);break;}}}YAHOO.widget.Button=function(Q,N){var P=YAHOO.widget.Button.superclass.constructor,O,M;if(arguments.length==1&&!I.isString(Q)&&!Q.nodeName){if(!Q.id){Q.id=G.generateId();}P.call(this,(this.createButtonElement(Q.type)),Q);}else{O={element:null,attributes:(N||{})};if(I.isString(Q)){M=G.get(Q);if(M){if(!O.attributes.id){O.attributes.id=Q;}O.attributes.srcelement=M;A.call(this,O);if(!O.element){O.element=this.createButtonElement(O.attributes.type);}P.call(this,O.element,O.attributes);}}else{if(Q.nodeName){if(!O.attributes.id){if(Q.id){O.attributes.id=Q.id;}else{O.attributes.id=G.generateId();}}O.attributes.srcelement=Q;A.call(this,O);if(!O.element){O.element=this.createButtonElement(O.attributes.type);}P.call(this,O.element,O.attributes);}}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"yui-button",RADIO_DEFAULT_TITLE:"Unchecked. Click to check.",RADIO_CHECKED_TITLE:"Checked. Click to uncheck.",CHECKBOX_DEFAULT_TITLE:"Unchecked. Click to check.",CHECKBOX_CHECKED_TITLE:"Checked. Click to uncheck.",MENUBUTTON_DEFAULT_TITLE:"Menu collapsed. Click to expand.",MENUBUTTON_MENU_VISIBLE_TITLE:"Menu expanded. Click or press Esc to collapse.",SPLITBUTTON_DEFAULT_TITLE:("Menu collapsed. Click inside option region or press Ctrl + Shift + M to show the menu."),SPLITBUTTON_OPTION_VISIBLE_TITLE:"Menu expanded. Press Esc or Ctrl + Shift + M to hide the menu.",SUBMIT_TITLE:"Click to submit form.",_setType:function(M){if(M=="split"){this.on("option",this._onOption);}},_setLabel:function(M){this._button.innerHTML=M;var O,N;if(YAHOO.env.ua.gecko&&G.inDocument(this.get("element"))){N=this;O=this.CSS_CLASS_NAME;this.removeClass(O);window.setTimeout(function(){N.addClass(O);},0);}},_setTabIndex:function(M){this._button.tabIndex=M;},_setTitle:function(N){var M=N;if(this.get("type")!="link"){if(!M){switch(this.get("type")){case"radio":M=this.RADIO_DEFAULT_TITLE;break;case"checkbox":M=this.CHECKBOX_DEFAULT_TITLE;break;case"menu":M=this.MENUBUTTON_DEFAULT_TITLE;break;case"split":M=this.SPLITBUTTON_DEFAULT_TITLE;break;case"submit":M=this.SUBMIT_TITLE;break;}}this._button.title=M;}},_setDisabled:function(M){if(this.get("type")!="link"){if(M){if(this._menu){this._menu.hide();}if(this.hasFocus()){this.blur();}this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");this.removeStateCSSClasses("hover");this.removeStateCSSClasses("active");this.removeStateCSSClasses("focus");}else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(M){if(this.get("type")=="link"){this._button.href=M;}},_setTarget:function(M){if(this.get("type")=="link"){this._button.setAttribute("target",M);}},_setChecked:function(N){var O=this.get("type"),M;if(O=="checkbox"||O=="radio"){if(N){this.addStateCSSClasses("checked");M=(O=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{this.removeStateCSSClasses("checked");M=(O=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",M);}},_setMenu:function(W){var Q=this.get("lazyloadmenu"),T=this.get("element"),M=J.prototype.CSS_CLASS_NAME,Y=false,Z,P,S,O,N,V,R;if(!B){return false;}if(!J){return false;}function X(){Z.render(T.parentNode);this.removeListener("appendTo",X);}function U(){if(Z){G.addClass(Z.element,this.get("menuclassname"));G.addClass(Z.element,"yui-"+this.get("type")+"-button-menu");Z.showEvent.subscribe(this._onMenuShow,null,this);Z.hideEvent.subscribe(this._onMenuHide,null,this);Z.renderEvent.subscribe(this._onMenuRender,null,this);if(Z instanceof J){Z.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);Z.subscribe("click",this._onMenuClick,this,true);Z.itemAddedEvent.subscribe(this._onMenuItemAdded,this,true);S=Z.srcElement;if(S&&S.nodeName.toUpperCase()=="SELECT"){S.style.display="none";S.parentNode.removeChild(S);}}else{if(Z instanceof B){if(!K){K=new YAHOO.widget.OverlayManager();}K.register(Z);}}this._menu=Z;if(!Y){if(Q&&!(Z instanceof J)){Z.beforeShowEvent.subscribe(this._onOverlayBeforeShow,null,this);}else{if(!Q){if(G.inDocument(T)){Z.render(T.parentNode);}else{this.on("appendTo",X);}}}}}}if(W&&(W instanceof J)){Z=W;O=Z.getItems(); >-N=O.length;Y=true;if(N>0){R=N-1;do{V=O[R];if(V){V.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,V,this);}}while(R--);}U.call(this);}else{if(W&&(W instanceof B)){Z=W;Y=true;Z.cfg.setProperty("visible",false);Z.cfg.setProperty("context",[T,"tl","bl"]);U.call(this);}else{if(I.isArray(W)){this.on("appendTo",function(){Z=new J(G.generateId(),{lazyload:Q,itemdata:W});U.call(this);});}else{if(I.isString(W)){P=G.get(W);if(P){if(G.hasClass(P,M)||P.nodeName.toUpperCase()=="SELECT"){Z=new J(W,{lazyload:Q});U.call(this);}else{Z=new B(W,{visible:false,context:[T,"tl","bl"]});U.call(this);}}}else{if(W&&W.nodeName){if(G.hasClass(W,M)||W.nodeName.toUpperCase()=="SELECT"){Z=new J(W,{lazyload:Q});U.call(this);}else{if(!W.id){G.generateId(W);}Z=new B(W,{visible:false,context:[T,"tl","bl"]});U.call(this);}}}}}}},_setOnClick:function(M){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=M)){this.removeListener("click",this._onclickAttributeValue.fn);this._onclickAttributeValue=null;}if(!this._onclickAttributeValue&&I.isObject(M)&&I.isFunction(M.fn)){this.on("click",M.fn,M.obj,M.scope);this._onclickAttributeValue=M;}},_setSelectedMenuItem:function(N){var M=this._menu,O;if(M&&M instanceof J){O=M.getItem(N);if(O&&!O.cfg.getProperty("selected")){O.cfg.setProperty("selected",true);}}},_isActivationKey:function(M){var Q=this.get("type"),N=(Q=="checkbox"||Q=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,P=N.length,O;if(P>0){O=P-1;do{if(M==N[O]){return true;}}while(O--);}},_isSplitButtonOptionKey:function(M){return(M.ctrlKey&&M.shiftKey&&L.getCharCode(M)==77);},_addListenersToForm:function(){var S=this.getForm(),R=YAHOO.widget.Button.onFormKeyPress,Q,M,P,O,N;if(S){L.on(S,"reset",this._onFormReset,null,this);L.on(S,"submit",this.createHiddenFields,null,this);M=this.get("srcelement");if(this.get("type")=="submit"||(M&&M.type=="submit")){P=L.getListeners(S,"keypress");Q=false;if(P){O=P.length;if(O>0){N=O-1;do{if(P[N].fn==R){Q=true;break;}}while(N--);}}if(!Q){L.on(S,"keypress",R);}}}},_originalMaxHeight:-1,_showMenu:function(O){YAHOO.widget.MenuManager.hideVisible();if(K){K.hideAll();}var M=this._menu,N=G.getViewportHeight(),Q,R,P;if(M&&(M instanceof J)){M.cfg.applyConfig({context:[this.get("id"),"tl","bl"],constraintoviewport:false,clicktohide:false,visible:true});M.cfg.fireQueue();M.align("tl","bl");if(O.type=="mousedown"){L.stopPropagation(O);}if(this.get("focusmenu")){this._menu.focus();}Q=M.element.offsetHeight;if((M.cfg.getProperty("y")+Q)>N){M.align("bl","tl");P=M.cfg.getProperty("y");R=G.getDocumentScrollTop();if(R>=P){if(this._originalMaxHeight==-1){this._originalMaxHeight=M.cfg.getProperty("maxheight");}M.cfg.setProperty("maxheight",(Q-((R-P)+20)));M.align("bl","tl");}}}else{if(M&&(M instanceof B)){M.show();M.align("tl","bl");Q=M.element.offsetHeight;if((M.cfg.getProperty("y")+Q)>N){M.align("bl","tl");}}}},_hideMenu:function(){var M=this._menu;if(M){M.hide();}},_onMouseOver:function(M){if(!this._hasMouseEventHandlers){this.on("mouseout",this._onMouseOut);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this._hasMouseEventHandlers=true;}this.addStateCSSClasses("hover");if(this._activationButtonPressed){this.addStateCSSClasses("active");}if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}},_onMouseOut:function(M){this.removeStateCSSClasses("hover");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationButtonPressed||this._bOptionPressed){L.on(document,"mouseup",this._onDocumentMouseUp,null,this);}},_onDocumentMouseUp:function(M){this._activationButtonPressed=false;this._bOptionPressed=false;var N=this.get("type");if(N=="menu"||N=="split"){this.removeStateCSSClasses((N=="menu"?"active":"activeoption"));this._hideMenu();}L.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(P){var R,N,Q,O;function M(){this._hideMenu();this.removeListener("mouseup",M);}if((P.which||P.button)==1){if(!this.hasFocus()){this.focus();}R=this.get("type");if(R=="split"){N=this.get("element");Q=L.getPageX(P)-G.getX(N);if((N.offsetWidth-this.OPTION_AREA_WIDTH)<Q){this.fireEvent("option",P);}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}else{if(R=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}else{this._showMenu(P);this._activationButtonPressed=true;}}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}if(R=="split"||R=="menu"){O=this;this._hideMenuTimerId=window.setTimeout(function(){O.on("mouseup",M);},250);}}},_onMouseUp:function(M){var N=this.get("type");if(this._hideMenuTimerId){window.clearTimeout(this._hideMenuTimerId);}if(N=="checkbox"||N=="radio"){this.set("checked",!(this.get("checked")));}this._activationButtonPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}},_onFocus:function(N){var M;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}C=this;if(!this._hasKeyEventHandlers){M=this._button;L.on(M,"blur",this._onBlur,null,this);L.on(M,"keydown",this._onKeyDown,null,this);L.on(M,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}this.fireEvent("focus",N);},_onBlur:function(M){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationKeyPressed){L.on(document,"keyup",this._onDocumentKeyUp,null,this);}C=null;this.fireEvent("blur",M);},_onDocumentKeyUp:function(M){if(this._isActivationKey(L.getCharCode(M))){this._activationKeyPressed=false;L.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(N){var M=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(N)){this.fireEvent("option",N);}else{if(this._isActivationKey(L.getCharCode(N))){if(this.get("type")=="menu"){this._showMenu(N);}else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}}if(M&&M.cfg.getProperty("visible")&&L.getCharCode(N)==27){M.hide(); >-this.focus();}},_onKeyUp:function(M){var N;if(this._isActivationKey(L.getCharCode(M))){N=this.get("type");if(N=="checkbox"||N=="radio"){this.set("checked",!(this.get("checked")));}this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(P){var S=this.get("type"),M,Q,N,O,R;switch(S){case"radio":case"checkbox":if(this.get("checked")){M=(S=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{M=(S=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",M);break;case"submit":this.submitForm();break;case"reset":Q=this.getForm();if(Q){Q.reset();}break;case"menu":M=this._menu.cfg.getProperty("visible")?this.MENUBUTTON_MENU_VISIBLE_TITLE:this.MENUBUTTON_DEFAULT_TITLE;this.set("title",M);break;case"split":O=this.get("element");R=L.getPageX(P)-G.getX(O);if((O.offsetWidth-this.OPTION_AREA_WIDTH)<R){return false;}else{this._hideMenu();N=this.get("srcelement");if(N&&N.type=="submit"){this.submitForm();}}M=this._menu.cfg.getProperty("visible")?this.SPLITBUTTON_OPTION_VISIBLE_TITLE:this.SPLITBUTTON_DEFAULT_TITLE;this.set("title",M);break;}},_onAppendTo:function(N){var M=this;window.setTimeout(function(){M._addListenersToForm();},0);},_onFormReset:function(N){var O=this.get("type"),M=this._menu;if(O=="checkbox"||O=="radio"){this.resetValue("checked");}if(M&&(M instanceof J)){this.resetValue("selectedMenuItem");}},_onDocumentMouseDown:function(P){var M=L.getTarget(P),O=this.get("element"),N=this._menu.element;if(M!=O&&!G.isAncestor(O,M)&&M!=N&&!G.isAncestor(N,M)){this._hideMenu();L.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(M){if(this.hasClass("yui-split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}else{this._showMenu(M);this._bOptionPressed=true;}},_onOverlayBeforeShow:function(N){var M=this._menu;M.render(this.get("element").parentNode);M.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);},_onMenuShow:function(N){L.on(document,"mousedown",this._onDocumentMouseDown,null,this);var M,O;if(this.get("type")=="split"){M=this.SPLITBUTTON_OPTION_VISIBLE_TITLE;O="activeoption";}else{M=this.MENUBUTTON_MENU_VISIBLE_TITLE;O="active";}this.addStateCSSClasses(O);this.set("title",M);},_onMenuHide:function(O){var N=this._menu,M,P;if(N&&(N instanceof J)&&this._originalMaxHeight!=-1){this._menu.cfg.setProperty("maxheight",this._originalMaxHeight);}if(this.get("type")=="split"){M=this.SPLITBUTTON_DEFAULT_TITLE;P="activeoption";}else{M=this.MENUBUTTON_DEFAULT_TITLE;P="active";}this.removeStateCSSClasses(P);this.set("title",M);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(O,N){var M=N[0];if(L.getCharCode(M)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(N){var P=this.get("element"),M=P.parentNode,O=this._menu.element;if(M!=O.parentNode){M.appendChild(O);}this.set("selectedMenuItem",this.get("selectedMenuItem"));},_onMenuItemSelected:function(N,M,P){var O=M[0];if(O){this.set("selectedMenuItem",P);}},_onMenuItemAdded:function(O,N,M){var P=N[0];P.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,P.index,this);},_onMenuClick:function(N,M){var P=M[1],O;if(P){O=this.get("srcelement");if(O&&O.type=="submit"){this.submitForm();}this._hideMenu();}},createButtonElement:function(M){var O=this.NODE_NAME,N=document.createElement(O);N.innerHTML="<"+O+" class=\"first-child\">"+(M=="link"?"<a></a>":"<button type=\"button\"></button>")+"</"+O+">";return N;},addStateCSSClasses:function(M){var N=this.get("type");if(I.isString(M)){if(M!="activeoption"){this.addClass(this.CSS_CLASS_NAME+("-"+M));}this.addClass("yui-"+N+("-button-"+M));}},removeStateCSSClasses:function(M){var N=this.get("type");if(I.isString(M)){this.removeClass(this.CSS_CLASS_NAME+("-"+M));this.removeClass("yui-"+N+("-button-"+M));}},createHiddenFields:function(){this.removeHiddenFields();var R=this.getForm(),U,N,P,S,T,O,Q,M;if(R&&!this.get("disabled")){N=this.get("type");P=(N=="checkbox"||N=="radio");if(P||(E==this)){U=F((P?N:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(U){if(P){U.style.display="none";}R.appendChild(U);}}S=this._menu;if(S&&(S instanceof J)){M=S.srcElement;T=S.getItem(this.get("selectedMenuItem"));if(T){if(M&&M.nodeName.toUpperCase()=="SELECT"){R.appendChild(M);M.selectedIndex=T.index;}else{Q=(T.value===null||T.value==="")?T.cfg.getProperty("text"):T.value;O=this.get("name");if(Q&&O){M=F("hidden",(O+"_options"),Q);R.appendChild(M);}}}}if(U&&M){this._hiddenFields=[U,M];}else{if(!U&&M){this._hiddenFields=M;}else{if(U&&!M){this._hiddenFields=U;}}}return this._hiddenFields;}},removeHiddenFields:function(){var P=this._hiddenFields,N,O;function M(Q){if(G.inDocument(Q)){Q.parentNode.removeChild(Q);}}if(P){if(I.isArray(P)){N=P.length;if(N>0){O=N-1;do{M(P[O]);}while(O--);}}else{M(P);}this._hiddenFields=null;}},submitForm:function(){var P=this.getForm(),O=this.get("srcelement"),N=false,M;if(P){if(this.get("type")=="submit"||(O&&O.type=="submit")){E=this;}if(YAHOO.env.ua.ie){N=P.fireEvent("onsubmit");}else{M=document.createEvent("HTMLEvents");M.initEvent("submit",true,true);N=P.dispatchEvent(M);}if((YAHOO.env.ua.ie||YAHOO.env.ua.webkit)&&N){P.submit();}}return N;},init:function(M,T){var O=T.type=="link"?"a":"button",Q=T.srcelement,S=M.getElementsByTagName(O)[0],R;if(!S){R=M.getElementsByTagName("input")[0];if(R){S=document.createElement("button");S.setAttribute("type","button");R.parentNode.replaceChild(S,R);}}this._button=S;YAHOO.widget.Button.superclass.init.call(this,M,T);D[this.get("id")]=this;this.addClass(this.CSS_CLASS_NAME);this.addClass("yui-"+this.get("type")+"-button");L.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("click",this._onClick);this.on("appendTo",this._onAppendTo);var V=this.get("container"),N=this.get("element"),U=G.inDocument(N),P;if(V){if(Q&&Q!=N){P=Q.parentNode;if(P){P.removeChild(Q);}}if(I.isString(V)){L.onContentReady(V,function(){this.appendTo(V); >-},null,this);}else{this.appendTo(V);}}else{if(!U&&Q&&Q!=N){P=Q.parentNode;if(P){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:P});P.replaceChild(N,Q);this.fireEvent("appendTo",{type:"appendTo",target:P});}}else{if(this.get("type")!="link"&&U&&Q&&Q==N){this._addListenersToForm();}}}},initAttributes:function(N){var M=N||{};YAHOO.widget.Button.superclass.initAttributes.call(this,M);this.setAttributeConfig("type",{value:(M.type||"push"),validator:I.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:M.label,validator:I.isString,method:this._setLabel});this.setAttributeConfig("value",{value:M.value});this.setAttributeConfig("name",{value:M.name,validator:I.isString});this.setAttributeConfig("tabindex",{value:M.tabindex,validator:I.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:M.title,validator:I.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(M.disabled||false),validator:I.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:M.href,validator:I.isString,method:this._setHref});this.setAttributeConfig("target",{value:M.target,validator:I.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(M.checked||false),validator:I.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:M.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:M.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(M.lazyloadmenu===false?false:true),validator:I.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(M.menuclassname||"yui-button-menu"),validator:I.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("selectedMenuItem",{value:0,validator:I.isNumber,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:M.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(M.focusmenu===false?false:true),validator:I.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(C==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){return this._button.form;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var O=this.get("element"),N=O.parentNode,M=this._menu,Q;if(M){if(K.find(M)){K.remove(M);}M.destroy();}L.purgeElement(O);L.purgeElement(this._button);L.removeListener(document,"mouseup",this._onDocumentMouseUp);L.removeListener(document,"keyup",this._onDocumentKeyUp);L.removeListener(document,"mousedown",this._onDocumentMouseDown);var P=this.getForm();if(P){L.removeListener(P,"reset",this._onFormReset);L.removeListener(P,"submit",this.createHiddenFields);}this.unsubscribeAll();if(N){N.removeChild(O);}delete D[this.get("id")];Q=G.getElementsByClassName(this.CSS_CLASS_NAME,this.NODE_NAME,P);if(I.isArray(Q)&&Q.length===0){L.removeListener(P,"keypress",YAHOO.widget.Button.onFormKeyPress);}},fireEvent:function(N,M){if(this.DOM_EVENTS[N]&&this.get("disabled")){return ;}YAHOO.widget.Button.superclass.fireEvent.call(this,N,M);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(Q){var O=L.getTarget(Q),R=L.getCharCode(Q),P=O.nodeName&&O.nodeName.toUpperCase(),M=O.type,S=false,U,V,N,W;function T(Z){var Y,X;switch(Z.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(Z.type=="submit"&&!Z.disabled){if(!S&&!N){N=Z;}if(V&&!W){W=Z;}}break;default:Y=Z.id;if(Y){U=D[Y];if(U){S=true;if(!U.get("disabled")){X=U.get("srcelement");if(!V&&(U.get("type")=="submit"||(X&&X.type=="submit"))){V=U;}}}}break;}}if(R==13&&((P=="INPUT"&&(M=="text"||M=="password"||M=="checkbox"||M=="radio"||M=="file"))||P=="SELECT")){G.getElementsBy(T,"*",this);if(N){N.focus();}else{if(!N&&V){if(W){L.preventDefault(Q);}V.submitForm();}}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(M){var R=G.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",M),P=R.length,Q,N,O;if(P>0){for(O=0;O<P;O++){N=R[O].id;if(N){Q=D[N];if(Q){Q.createHiddenFields();}}}}};})();(function(){var C=YAHOO.util.Dom,B=YAHOO.util.Event,D=YAHOO.lang,A=YAHOO.widget.Button,E={};YAHOO.widget.ButtonGroup=function(J,H){var I=YAHOO.widget.ButtonGroup.superclass.constructor,K,G,F;if(arguments.length==1&&!D.isString(J)&&!J.nodeName){if(!J.id){F=C.generateId();J.id=F;}I.call(this,(this._createGroupElement()),J);}else{if(D.isString(J)){G=C.get(J);if(G){if(G.nodeName.toUpperCase()==this.NODE_NAME){I.call(this,G,H);}}}else{K=J.nodeName.toUpperCase();if(K&&K==this.NODE_NAME){if(!J.id){J.id=C.generateId();}I.call(this,J,H);}}}};YAHOO.extend(YAHOO.widget.ButtonGroup,YAHOO.util.Element,{_buttons:null,NODE_NAME:"DIV",CSS_CLASS_NAME:"yui-buttongroup",_createGroupElement:function(){var F=document.createElement(this.NODE_NAME);return F;},_setDisabled:function(G){var H=this.getCount(),F;if(H>0){F=H-1;do{this._buttons[F].set("disabled",G);}while(F--);}},_onKeyDown:function(K){var G=B.getTarget(K),I=B.getCharCode(K),H=G.parentNode.parentNode.id,J=E[H],F=-1;if(I==37||I==38){F=(J.index===0)?(this._buttons.length-1):(J.index-1);}else{if(I==39||I==40){F=(J.index===(this._buttons.length-1))?0:(J.index+1);}}if(F>-1){this.check(F);this.getButton(F).focus();}},_onAppendTo:function(H){var I=this._buttons,G=I.length,F;for(F=0;F<G;F++){I[F].appendTo(this.get("element"));}},_onButtonCheckedChange:function(G,F){var I=G.newValue,H=this.get("checkedButton");if(I&&H!=F){if(H){H.set("checked",false,true);}this.set("checkedButton",F);this.set("value",F.get("value"));}else{if(H&&!H.set("checked")){H.set("checked",true,true);}}},init:function(I,H){this._buttons=[];YAHOO.widget.ButtonGroup.superclass.init.call(this,I,H);this.addClass(this.CSS_CLASS_NAME);var J=this.getElementsByClassName("yui-radio-button"); >-if(J.length>0){this.addButtons(J);}function F(K){return(K.type=="radio");}J=C.getElementsBy(F,"input",this.get("element"));if(J.length>0){this.addButtons(J);}this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var G=this.get("container");if(G){if(D.isString(G)){B.onContentReady(G,function(){this.appendTo(G);},null,this);}else{this.appendTo(G);}}},initAttributes:function(G){var F=G||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,F);this.setAttributeConfig("name",{value:F.name,validator:D.isString});this.setAttributeConfig("disabled",{value:(F.disabled||false),validator:D.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:F.value});this.setAttributeConfig("container",{value:F.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(J){var L,K,G,F,H,I;if(J instanceof A&&J.get("type")=="radio"){L=J;}else{if(!D.isString(J)&&!J.nodeName){J.type="radio";L=new A(J);}else{L=new A(J,{type:"radio"});}}if(L){F=this._buttons.length;H=L.get("name");I=this.get("name");L.index=F;this._buttons[F]=L;E[L.get("id")]=L;if(H!=I){L.set("name",I);}if(this.get("disabled")){L.set("disabled",true);}if(L.get("checked")){this.set("checkedButton",L);}K=L.get("element");G=this.get("element");if(K.parentNode!=G){G.appendChild(K);}L.on("checkedChange",this._onButtonCheckedChange,L,this);return L;}},addButtons:function(G){var H,I,J,F;if(D.isArray(G)){H=G.length;J=[];if(H>0){for(F=0;F<H;F++){I=this.addButton(G[F]);if(I){J[J.length]=I;}}if(J.length>0){return J;}}}},removeButton:function(H){var I=this.getButton(H),G,F;if(I){this._buttons.splice(H,1);delete E[I.get("id")];I.removeListener("checkedChange",this._onButtonCheckedChange);I.destroy();G=this._buttons.length;if(G>0){F=this._buttons.length-1;do{this._buttons[F].index=F;}while(F--);}}},getButton:function(F){if(D.isNumber(F)){return this._buttons[F];}},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(H){var I,G,F;if(D.isNumber(H)){I=this._buttons[H];if(I){I.focus();}}else{G=this.getCount();for(F=0;F<G;F++){I=this._buttons[F];if(!I.get("disabled")){I.focus();break;}}}},check:function(F){var G=this.getButton(F);if(G){G.set("checked",true);}},destroy:function(){var I=this._buttons.length,H=this.get("element"),F=H.parentNode,G;if(I>0){G=this._buttons.length-1;do{this._buttons[G].destroy();}while(G--);}B.purgeElement(H);F.removeChild(H);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.3.1",build:"541"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/button-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/button/button-debug.js >deleted file mode 100644 >index a79ce3bd18..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/button-debug.js >+++ /dev/null >@@ -1,4694 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-/** >-* @module button >-* @description <p>The Button Control enables the creation of rich, graphical >-* buttons that function like traditional HTML form buttons. <em>Unlike</em> >-* traditional HTML form buttons, buttons created with the Button Control can have >-* a label that is different from its value. With the inclusion of the optional >-* <a href="module_menu.html">Menu Control</a>, the Button Control can also be >-* used to create menu buttons and split buttons, controls that are not >-* available natively in HTML. The Button Control can also be thought of as a >-* way to create more visually engaging implementations of the browser's >-* default radio-button and check-box controls.</p> >-* <p>The Button Control supports the following types:</p> >-* <dl> >-* <dt>push</dt> >-* <dd>Basic push button that can execute a user-specified command when >-* pressed.</dd> >-* <dt>link</dt> >-* <dd>Navigates to a specified url when pressed.</dd> >-* <dt>submit</dt> >-* <dd>Submits the parent form when pressed.</dd> >-* <dt>reset</dt> >-* <dd>Resets the parent form when pressed.</dd> >-* <dt>checkbox</dt> >-* <dd>Maintains a "checked" state that can be toggled on and off.</dd> >-* <dt>radio</dt> >-* <dd>Maintains a "checked" state that can be toggled on and off. Use with >-* the ButtonGroup class to create a set of controls that are mutually >-* exclusive; checking one button in the set will uncheck all others in >-* the group.</dd> >-* <dt>menu</dt> >-* <dd>When pressed will show/hide a menu.</dd> >-* <dt>split</dt> >-* <dd>Can execute a user-specified command or display a menu when pressed.</dd> >-* </dl> >-* @title Button >-* @namespace YAHOO.widget >-* @requires yahoo, dom, element, event >-* @optional container, menu >-*/ >- >- >-(function () { >- >- >- /** >- * The Button class creates a rich, graphical button. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to >- * be used to create the button. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org >- * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697"> >- * HTMLButtonElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html# >- * ID-33759296">HTMLElement</a>} p_oElement Object reference for the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to be >- * used to create the button. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button. >- * @param {Object} p_oAttributes Optional. Object literal specifying a set >- * of configuration attributes used to create the button. >- * @namespace YAHOO.widget >- * @class Button >- * @constructor >- * @extends YAHOO.util.Element >- */ >- >- >- >- // Shorthard for utilities >- >- var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- UA = YAHOO.env.ua, >- Overlay = YAHOO.widget.Overlay, >- Menu = YAHOO.widget.Menu, >- >- >- // Private member variables >- >- m_oButtons = {}, // Collection of all Button instances >- m_oOverlayManager = null, // YAHOO.widget.OverlayManager instance >- m_oSubmitTrigger = null, // The button that submitted the form >- m_oFocusedButton = null; // The button that has focus >- >- >- >- // Private methods >- >- >- >- /** >- * @method createInputElement >- * @description Creates an <code><input></code> element of the >- * specified type. >- * @private >- * @param {String} p_sType String specifying the type of >- * <code><input></code> element to create. >- * @param {String} p_sName String specifying the name of >- * <code><input></code> element to create. >- * @param {String} p_sValue String specifying the value of >- * <code><input></code> element to create. >- * @param {String} p_bChecked Boolean specifying if the >- * <code><input></code> element is to be checked. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>} >- */ >- function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) { >- >- var oInput, >- sInput; >- >- if (Lang.isString(p_sType) && Lang.isString(p_sName)) { >- >- if (UA.ie) { >- >- /* >- For IE it is necessary to create the element with the >- "type," "name," "value," and "checked" properties set all >- at once. >- */ >- >- sInput = "<input type=\"" + p_sType + "\" name=\"" + >- p_sName + "\""; >- >- if (p_bChecked) { >- >- sInput += " checked"; >- >- } >- >- sInput += ">"; >- >- oInput = document.createElement(sInput); >- >- } >- else { >- >- oInput = document.createElement("input"); >- oInput.name = p_sName; >- oInput.type = p_sType; >- >- if (p_bChecked) { >- >- oInput.checked = true; >- >- } >- >- } >- >- oInput.value = p_sValue; >- >- } >- >- return oInput; >- >- } >- >- >- /** >- * @method setAttributesFromSrcElement >- * @description Gets the values for all the attributes of the source element >- * (either <code><input></code> or <code><a></code>) that >- * map to Button configuration attributes and sets them into a collection >- * that is passed to the Button constructor. >- * @private >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/ >- * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID- >- * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML >- * element (either <code><input></code> or <code><span> >- * </code>) used to create the button. >- * @param {Object} p_oAttributes Object reference for the collection of >- * configuration attributes used to create the button. >- */ >- function setAttributesFromSrcElement(p_oElement, p_oAttributes) { >- >- var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(), >- sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME), >- me = this, >- oAttribute, >- oRootNode, >- sText; >- >- >- /** >- * @method setAttributeFromDOMAttribute >- * @description Gets the value of the specified DOM attribute and sets it >- * into the collection of configuration attributes used to configure >- * the button. >- * @private >- * @param {String} p_sAttribute String representing the name of the >- * attribute to retrieve from the DOM element. >- */ >- function setAttributeFromDOMAttribute(p_sAttribute) { >- >- if (!(p_sAttribute in p_oAttributes)) { >- >- /* >- Need to use "getAttributeNode" instead of "getAttribute" >- because using "getAttribute," IE will return the innerText >- of a <code><button></code> for the value attribute >- rather than the value of the "value" attribute. >- */ >- >- oAttribute = p_oElement.getAttributeNode(p_sAttribute); >- >- >- if (oAttribute && ("value" in oAttribute)) { >- >- YAHOO.log("Setting attribute \"" + p_sAttribute + >- "\" using source element's attribute value of \"" + >- oAttribute.value + "\"", "info", me.toString()); >- >- p_oAttributes[p_sAttribute] = oAttribute.value; >- >- } >- >- } >- >- } >- >- >- /** >- * @method setFormElementProperties >- * @description Gets the value of the attributes from the form element >- * and sets them into the collection of configuration attributes used to >- * configure the button. >- * @private >- */ >- function setFormElementProperties() { >- >- setAttributeFromDOMAttribute("type"); >- >- if (p_oAttributes.type == "button") { >- >- p_oAttributes.type = "push"; >- >- } >- >- if (!("disabled" in p_oAttributes)) { >- >- p_oAttributes.disabled = p_oElement.disabled; >- >- } >- >- setAttributeFromDOMAttribute("name"); >- setAttributeFromDOMAttribute("value"); >- setAttributeFromDOMAttribute("title"); >- >- } >- >- >- switch (sSrcElementNodeName) { >- >- case "A": >- >- p_oAttributes.type = "link"; >- >- setAttributeFromDOMAttribute("href"); >- setAttributeFromDOMAttribute("target"); >- >- break; >- >- case "INPUT": >- >- setFormElementProperties(); >- >- if (!("checked" in p_oAttributes)) { >- >- p_oAttributes.checked = p_oElement.checked; >- >- } >- >- break; >- >- case "BUTTON": >- >- setFormElementProperties(); >- >- oRootNode = p_oElement.parentNode.parentNode; >- >- if (Dom.hasClass(oRootNode, sClass + "-checked")) { >- >- p_oAttributes.checked = true; >- >- } >- >- if (Dom.hasClass(oRootNode, sClass + "-disabled")) { >- >- p_oAttributes.disabled = true; >- >- } >- >- p_oElement.removeAttribute("value"); >- >- p_oElement.setAttribute("type", "button"); >- >- break; >- >- } >- >- p_oElement.removeAttribute("id"); >- p_oElement.removeAttribute("name"); >- >- if (!("tabindex" in p_oAttributes)) { >- >- p_oAttributes.tabindex = p_oElement.tabIndex; >- >- } >- >- if (!("label" in p_oAttributes)) { >- >- // Set the "label" property >- >- sText = sSrcElementNodeName == "INPUT" ? >- p_oElement.value : p_oElement.innerHTML; >- >- >- if (sText && sText.length > 0) { >- >- p_oAttributes.label = sText; >- >- } >- >- } >- >- } >- >- >- /** >- * @method initConfig >- * @description Initializes the set of configuration attributes that are >- * used to instantiate the button. >- * @private >- * @param {Object} Object representing the button's set of >- * configuration attributes. >- */ >- function initConfig(p_oConfig) { >- >- var oAttributes = p_oConfig.attributes, >- oSrcElement = oAttributes.srcelement, >- sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(), >- me = this; >- >- >- if (sSrcElementNodeName == this.NODE_NAME) { >- >- p_oConfig.element = oSrcElement; >- p_oConfig.id = oSrcElement.id; >- >- Dom.getElementsBy(function (p_oElement) { >- >- switch (p_oElement.nodeName.toUpperCase()) { >- >- case "BUTTON": >- case "A": >- case "INPUT": >- >- setAttributesFromSrcElement.call(me, p_oElement, >- oAttributes); >- >- break; >- >- } >- >- }, "*", oSrcElement); >- >- } >- else { >- >- switch (sSrcElementNodeName) { >- >- case "BUTTON": >- case "A": >- case "INPUT": >- >- setAttributesFromSrcElement.call(this, oSrcElement, >- oAttributes); >- >- break; >- >- } >- >- } >- >- } >- >- >- >- // Constructor >- >- YAHOO.widget.Button = function (p_oElement, p_oAttributes) { >- >- if (!Overlay && YAHOO.widget.Overlay) { >- >- Overlay = YAHOO.widget.Overlay; >- >- } >- >- >- if (!Menu && YAHOO.widget.Menu) { >- >- Menu = YAHOO.widget.Menu; >- >- } >- >- >- var fnSuperClass = YAHOO.widget.Button.superclass.constructor, >- oConfig, >- oElement; >- >- >- if (arguments.length == 1 && !Lang.isString(p_oElement) && !p_oElement.nodeName) { >- >- if (!p_oElement.id) { >- >- p_oElement.id = Dom.generateId(); >- >- YAHOO.log("No value specified for the button's \"id\" " + >- "attribute. Setting button id to \"" + p_oElement.id + >- "\".", "info", this.toString()); >- >- } >- >- YAHOO.log("No source HTML element. Building the button " + >- "using the set of configuration attributes.", "info", this.toString()); >- >- fnSuperClass.call(this, (this.createButtonElement(p_oElement.type)), p_oElement); >- >- } >- else { >- >- oConfig = { element: null, attributes: (p_oAttributes || {}) }; >- >- >- if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- if (oElement) { >- >- if (!oConfig.attributes.id) { >- >- oConfig.attributes.id = p_oElement; >- >- } >- >- YAHOO.log("Building the button using an existing " + >- "HTML element as a source element.", "info", this.toString()); >- >- >- oConfig.attributes.srcelement = oElement; >- >- initConfig.call(this, oConfig); >- >- >- if (!oConfig.element) { >- >- YAHOO.log("Source element could not be used " + >- "as is. Creating a new HTML element for " + >- "the button.", "info", this.toString()); >- >- oConfig.element = this.createButtonElement(oConfig.attributes.type); >- >- } >- >- fnSuperClass.call(this, oConfig.element, oConfig.attributes); >- >- } >- >- } >- else if (p_oElement.nodeName) { >- >- if (!oConfig.attributes.id) { >- >- if (p_oElement.id) { >- >- oConfig.attributes.id = p_oElement.id; >- >- } >- else { >- >- oConfig.attributes.id = Dom.generateId(); >- >- YAHOO.log("No value specified for the button's " + >- "\"id\" attribute. Setting button id to \"" + >- oConfig.attributes.id + "\".", "info", this.toString()); >- >- } >- >- } >- >- YAHOO.log("Building the button using an existing HTML " + >- "element as a source element.", "info", this.toString()); >- >- >- oConfig.attributes.srcelement = p_oElement; >- >- initConfig.call(this, oConfig); >- >- >- if (!oConfig.element) { >- >- YAHOO.log("Source element could not be used as is." + >- " Creating a new HTML element for the button.", >- "info", this.toString()); >- >- oConfig.element = this.createButtonElement(oConfig.attributes.type); >- >- } >- >- fnSuperClass.call(this, oConfig.element, oConfig.attributes); >- >- } >- >- } >- >- }; >- >- >- >- YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, { >- >- >- // Protected properties >- >- >- /** >- * @property _button >- * @description Object reference to the button's internal >- * <code><a></code> or <code><button></code> element. >- * @default null >- * @protected >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html >- * #ID-34812697">HTMLButtonElement</a> >- */ >- _button: null, >- >- >- /** >- * @property _menu >- * @description Object reference to the button's menu. >- * @default null >- * @protected >- * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>| >- * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>} >- */ >- _menu: null, >- >- >- /** >- * @property _hiddenFields >- * @description Object reference to the <code><input></code> >- * element, or array of HTML form elements used to represent the button >- * when its parent form is submitted. >- * @default null >- * @protected >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array >- */ >- _hiddenFields: null, >- >- >- /** >- * @property _onclickAttributeValue >- * @description Object reference to the button's current value for the >- * "onclick" configuration attribute. >- * @default null >- * @protected >- * @type Object >- */ >- _onclickAttributeValue: null, >- >- >- /** >- * @property _activationKeyPressed >- * @description Boolean indicating if the key(s) that toggle the button's >- * "active" state have been pressed. >- * @default false >- * @protected >- * @type Boolean >- */ >- _activationKeyPressed: false, >- >- >- /** >- * @property _activationButtonPressed >- * @description Boolean indicating if the mouse button that toggles >- * the button's "active" state has been pressed. >- * @default false >- * @protected >- * @type Boolean >- */ >- _activationButtonPressed: false, >- >- >- /** >- * @property _hasKeyEventHandlers >- * @description Boolean indicating if the button's "blur", "keydown" and >- * "keyup" event handlers are assigned >- * @default false >- * @protected >- * @type Boolean >- */ >- _hasKeyEventHandlers: false, >- >- >- /** >- * @property _hasMouseEventHandlers >- * @description Boolean indicating if the button's "mouseout," >- * "mousedown," and "mouseup" event handlers are assigned >- * @default false >- * @protected >- * @type Boolean >- */ >- _hasMouseEventHandlers: false, >- >- >- /** >- * @property _nOptionRegionX >- * @description Number representing the X coordinate of the leftmost edge of the Button's >- * option region. Applies only to Buttons of type "split". >- * @default 0 >- * @protected >- * @type Number >- */ >- _nOptionRegionX: 0, >- >- >- >- // Constants >- >- /** >- * @property CLASS_NAME_PREFIX >- * @description Prefix used for all class names applied to a Button. >- * @default "yui-" >- * @final >- * @type String >- */ >- CLASS_NAME_PREFIX: "yui-", >- >- >- /** >- * @property NODE_NAME >- * @description The name of the node to be used for the button's >- * root element. >- * @default "SPAN" >- * @final >- * @type String >- */ >- NODE_NAME: "SPAN", >- >- >- /** >- * @property CHECK_ACTIVATION_KEYS >- * @description Array of numbers representing keys that (when pressed) >- * toggle the button's "checked" attribute. >- * @default [32] >- * @final >- * @type Array >- */ >- CHECK_ACTIVATION_KEYS: [32], >- >- >- /** >- * @property ACTIVATION_KEYS >- * @description Array of numbers representing keys that (when presed) >- * toggle the button's "active" state. >- * @default [13, 32] >- * @final >- * @type Array >- */ >- ACTIVATION_KEYS: [13, 32], >- >- >- /** >- * @property OPTION_AREA_WIDTH >- * @description Width (in pixels) of the area of a split button that >- * when pressed will display a menu. >- * @default 20 >- * @final >- * @type Number >- */ >- OPTION_AREA_WIDTH: 20, >- >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to >- * the button's root element. >- * @default "button" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "button", >- >- >- >- // Protected attribute setter methods >- >- >- /** >- * @method _setType >- * @description Sets the value of the button's "type" attribute. >- * @protected >- * @param {String} p_sType String indicating the value for the button's >- * "type" attribute. >- */ >- _setType: function (p_sType) { >- >- if (p_sType == "split") { >- >- this.on("option", this._onOption); >- >- } >- >- }, >- >- >- /** >- * @method _setLabel >- * @description Sets the value of the button's "label" attribute. >- * @protected >- * @param {String} p_sLabel String indicating the value for the button's >- * "label" attribute. >- */ >- _setLabel: function (p_sLabel) { >- >- this._button.innerHTML = p_sLabel; >- >- >- /* >- Remove and add the default class name from the root element >- for Gecko to ensure that the button shrinkwraps to the label. >- Without this the button will not be rendered at the correct >- width when the label changes. The most likely cause for this >- bug is button's use of the Gecko-specific CSS display type of >- "-moz-inline-box" to simulate "inline-block" supported by IE, >- Safari and Opera. >- */ >- >- var sClass, >- nGeckoVersion = UA.gecko; >- >- >- if (nGeckoVersion && nGeckoVersion < 1.9 && Dom.inDocument(this.get("element"))) { >- >- sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- this.removeClass(sClass); >- >- Lang.later(0, this, this.addClass, sClass); >- >- } >- >- }, >- >- >- /** >- * @method _setTabIndex >- * @description Sets the value of the button's "tabindex" attribute. >- * @protected >- * @param {Number} p_nTabIndex Number indicating the value for the >- * button's "tabindex" attribute. >- */ >- _setTabIndex: function (p_nTabIndex) { >- >- this._button.tabIndex = p_nTabIndex; >- >- }, >- >- >- /** >- * @method _setTitle >- * @description Sets the value of the button's "title" attribute. >- * @protected >- * @param {String} p_nTabIndex Number indicating the value for >- * the button's "title" attribute. >- */ >- _setTitle: function (p_sTitle) { >- >- if (this.get("type") != "link") { >- >- this._button.title = p_sTitle; >- >- } >- >- }, >- >- >- /** >- * @method _setDisabled >- * @description Sets the value of the button's "disabled" attribute. >- * @protected >- * @param {Boolean} p_bDisabled Boolean indicating the value for >- * the button's "disabled" attribute. >- */ >- _setDisabled: function (p_bDisabled) { >- >- if (this.get("type") != "link") { >- >- if (p_bDisabled) { >- >- if (this._menu) { >- >- this._menu.hide(); >- >- } >- >- if (this.hasFocus()) { >- >- this.blur(); >- >- } >- >- this._button.setAttribute("disabled", "disabled"); >- >- this.addStateCSSClasses("disabled"); >- >- this.removeStateCSSClasses("hover"); >- this.removeStateCSSClasses("active"); >- this.removeStateCSSClasses("focus"); >- >- } >- else { >- >- this._button.removeAttribute("disabled"); >- >- this.removeStateCSSClasses("disabled"); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _setHref >- * @description Sets the value of the button's "href" attribute. >- * @protected >- * @param {String} p_sHref String indicating the value for the button's >- * "href" attribute. >- */ >- _setHref: function (p_sHref) { >- >- if (this.get("type") == "link") { >- >- this._button.href = p_sHref; >- >- } >- >- }, >- >- >- /** >- * @method _setTarget >- * @description Sets the value of the button's "target" attribute. >- * @protected >- * @param {String} p_sTarget String indicating the value for the button's >- * "target" attribute. >- */ >- _setTarget: function (p_sTarget) { >- >- if (this.get("type") == "link") { >- >- this._button.setAttribute("target", p_sTarget); >- >- } >- >- }, >- >- >- /** >- * @method _setChecked >- * @description Sets the value of the button's "target" attribute. >- * @protected >- * @param {Boolean} p_bChecked Boolean indicating the value for >- * the button's "checked" attribute. >- */ >- _setChecked: function (p_bChecked) { >- >- var sType = this.get("type"); >- >- if (sType == "checkbox" || sType == "radio") { >- >- if (p_bChecked) { >- this.addStateCSSClasses("checked"); >- } >- else { >- this.removeStateCSSClasses("checked"); >- } >- >- } >- >- }, >- >- >- /** >- * @method _setMenu >- * @description Sets the value of the button's "menu" attribute. >- * @protected >- * @param {Object} p_oMenu Object indicating the value for the button's >- * "menu" attribute. >- */ >- _setMenu: function (p_oMenu) { >- >- var bLazyLoad = this.get("lazyloadmenu"), >- oButtonElement = this.get("element"), >- sMenuCSSClassName, >- >- /* >- Boolean indicating if the value of p_oMenu is an instance >- of YAHOO.widget.Menu or YAHOO.widget.Overlay. >- */ >- >- bInstance = false, >- oMenu, >- oMenuElement, >- oSrcElement; >- >- >- function onAppendTo() { >- >- oMenu.render(oButtonElement.parentNode); >- >- this.removeListener("appendTo", onAppendTo); >- >- } >- >- >- function setMenuContainer() { >- >- oMenu.cfg.queueProperty("container", oButtonElement.parentNode); >- >- this.removeListener("appendTo", setMenuContainer); >- >- } >- >- >- function initMenu() { >- >- var oContainer; >- >- if (oMenu) { >- >- Dom.addClass(oMenu.element, this.get("menuclassname")); >- Dom.addClass(oMenu.element, this.CLASS_NAME_PREFIX + this.get("type") + "-button-menu"); >- >- oMenu.showEvent.subscribe(this._onMenuShow, null, this); >- oMenu.hideEvent.subscribe(this._onMenuHide, null, this); >- oMenu.renderEvent.subscribe(this._onMenuRender, null, this); >- >- >- if (Menu && oMenu instanceof Menu) { >- >- if (bLazyLoad) { >- >- oContainer = this.get("container"); >- >- if (oContainer) { >- >- oMenu.cfg.queueProperty("container", oContainer); >- >- } >- else { >- >- this.on("appendTo", setMenuContainer); >- >- } >- >- } >- >- oMenu.cfg.queueProperty("clicktohide", false); >- >- oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, this, true); >- oMenu.subscribe("click", this._onMenuClick, this, true); >- >- this.on("selectedMenuItemChange", this._onSelectedMenuItemChange); >- >- oSrcElement = oMenu.srcElement; >- >- if (oSrcElement && oSrcElement.nodeName.toUpperCase() == "SELECT") { >- >- oSrcElement.style.display = "none"; >- oSrcElement.parentNode.removeChild(oSrcElement); >- >- } >- >- } >- else if (Overlay && oMenu instanceof Overlay) { >- >- if (!m_oOverlayManager) { >- >- m_oOverlayManager = new YAHOO.widget.OverlayManager(); >- >- } >- >- m_oOverlayManager.register(oMenu); >- >- } >- >- >- this._menu = oMenu; >- >- >- if (!bInstance && !bLazyLoad) { >- >- if (Dom.inDocument(oButtonElement)) { >- >- oMenu.render(oButtonElement.parentNode); >- >- } >- else { >- >- this.on("appendTo", onAppendTo); >- >- } >- >- } >- >- } >- >- } >- >- >- if (Overlay) { >- >- if (Menu) { >- >- sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME; >- >- } >- >- if (p_oMenu && Menu && (p_oMenu instanceof Menu)) { >- >- oMenu = p_oMenu; >- bInstance = true; >- >- initMenu.call(this); >- >- } >- else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) { >- >- oMenu = p_oMenu; >- bInstance = true; >- >- oMenu.cfg.queueProperty("visible", false); >- >- initMenu.call(this); >- >- } >- else if (Menu && Lang.isArray(p_oMenu)) { >- >- oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, itemdata: p_oMenu }); >- >- this._menu = oMenu; >- >- this.on("appendTo", initMenu); >- >- } >- else if (Lang.isString(p_oMenu)) { >- >- oMenuElement = Dom.get(p_oMenu); >- >- if (oMenuElement) { >- >- if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || >- oMenuElement.nodeName.toUpperCase() == "SELECT") { >- >- oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); >- >- initMenu.call(this); >- >- } >- else if (Overlay) { >- >- oMenu = new Overlay(p_oMenu, { visible: false }); >- >- initMenu.call(this); >- >- } >- >- } >- >- } >- else if (p_oMenu && p_oMenu.nodeName) { >- >- if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || >- p_oMenu.nodeName.toUpperCase() == "SELECT") { >- >- oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); >- >- initMenu.call(this); >- >- } >- else if (Overlay) { >- >- if (!p_oMenu.id) { >- >- Dom.generateId(p_oMenu); >- >- } >- >- oMenu = new Overlay(p_oMenu, { visible: false }); >- >- initMenu.call(this); >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _setOnClick >- * @description Sets the value of the button's "onclick" attribute. >- * @protected >- * @param {Object} p_oObject Object indicating the value for the button's >- * "onclick" attribute. >- */ >- _setOnClick: function (p_oObject) { >- >- /* >- Remove any existing listeners if a "click" event handler >- has already been specified. >- */ >- >- if (this._onclickAttributeValue && >- (this._onclickAttributeValue != p_oObject)) { >- >- this.removeListener("click", this._onclickAttributeValue.fn); >- >- this._onclickAttributeValue = null; >- >- } >- >- >- if (!this._onclickAttributeValue && >- Lang.isObject(p_oObject) && >- Lang.isFunction(p_oObject.fn)) { >- >- this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope); >- >- this._onclickAttributeValue = p_oObject; >- >- } >- >- }, >- >- >- >- // Protected methods >- >- >- >- /** >- * @method _isActivationKey >- * @description Determines if the specified keycode is one that toggles >- * the button's "active" state. >- * @protected >- * @param {Number} p_nKeyCode Number representing the keycode to >- * be evaluated. >- * @return {Boolean} >- */ >- _isActivationKey: function (p_nKeyCode) { >- >- var sType = this.get("type"), >- aKeyCodes = (sType == "checkbox" || sType == "radio") ? >- this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS, >- >- nKeyCodes = aKeyCodes.length, >- bReturnVal = false, >- i; >- >- >- if (nKeyCodes > 0) { >- >- i = nKeyCodes - 1; >- >- do { >- >- if (p_nKeyCode == aKeyCodes[i]) { >- >- bReturnVal = true; >- break; >- >- } >- >- } >- while (i--); >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _isSplitButtonOptionKey >- * @description Determines if the specified keycode is one that toggles >- * the display of the split button's menu. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- * @return {Boolean} >- */ >- _isSplitButtonOptionKey: function (p_oEvent) { >- >- var bShowMenu = (Event.getCharCode(p_oEvent) == 40); >- >- >- var onKeyPress = function (p_oEvent) { >- >- Event.preventDefault(p_oEvent); >- >- this.removeListener("keypress", onKeyPress); >- >- }; >- >- >- // Prevent the browser from scrolling the window >- if (bShowMenu) { >- >- if (UA.opera) { >- >- this.on("keypress", onKeyPress); >- >- } >- >- Event.preventDefault(p_oEvent); >- } >- >- return bShowMenu; >- >- }, >- >- >- /** >- * @method _addListenersToForm >- * @description Adds event handlers to the button's form. >- * @protected >- */ >- _addListenersToForm: function () { >- >- var oForm = this.getForm(), >- onFormKeyPress = YAHOO.widget.Button.onFormKeyPress, >- bHasKeyPressListener, >- oSrcElement, >- aListeners, >- nListeners, >- i; >- >- >- if (oForm) { >- >- Event.on(oForm, "reset", this._onFormReset, null, this); >- Event.on(oForm, "submit", this._onFormSubmit, null, this); >- >- oSrcElement = this.get("srcelement"); >- >- >- if (this.get("type") == "submit" || >- (oSrcElement && oSrcElement.type == "submit")) >- { >- >- aListeners = Event.getListeners(oForm, "keypress"); >- bHasKeyPressListener = false; >- >- if (aListeners) { >- >- nListeners = aListeners.length; >- >- if (nListeners > 0) { >- >- i = nListeners - 1; >- >- do { >- >- if (aListeners[i].fn == onFormKeyPress) { >- >- bHasKeyPressListener = true; >- break; >- >- } >- >- } >- while (i--); >- >- } >- >- } >- >- >- if (!bHasKeyPressListener) { >- >- Event.on(oForm, "keypress", onFormKeyPress); >- >- } >- >- } >- >- } >- >- }, >- >- >- >- /** >- * @method _showMenu >- * @description Shows the button's menu. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event) that triggered >- * the display of the menu. >- */ >- _showMenu: function (p_oEvent) { >- >- if (YAHOO.widget.MenuManager) { >- YAHOO.widget.MenuManager.hideVisible(); >- } >- >- >- if (m_oOverlayManager) { >- m_oOverlayManager.hideAll(); >- } >- >- >- var oMenu = this._menu, >- aMenuAlignment = this.get("menualignment"), >- bFocusMenu = this.get("focusmenu"), >- fnFocusMethod; >- >- >- if (this._renderedMenu) { >- >- oMenu.cfg.setProperty("context", >- [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); >- >- oMenu.cfg.setProperty("preventcontextoverlap", true); >- oMenu.cfg.setProperty("constraintoviewport", true); >- >- } >- else { >- >- oMenu.cfg.queueProperty("context", >- [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); >- >- oMenu.cfg.queueProperty("preventcontextoverlap", true); >- oMenu.cfg.queueProperty("constraintoviewport", true); >- >- } >- >- >- /* >- Refocus the Button before showing its Menu in case the call to >- YAHOO.widget.MenuManager.hideVisible() resulted in another element in the >- DOM being focused after another Menu was hidden. >- */ >- >- this.focus(); >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- // Since Menus automatically focus themselves when made visible, temporarily >- // replace the Menu focus method so that the value of the Button's "focusmenu" >- // attribute determines if the Menu should be focus when made visible. >- >- fnFocusMethod = oMenu.focus; >- >- oMenu.focus = function () {}; >- >- if (this._renderedMenu) { >- >- oMenu.cfg.setProperty("minscrollheight", this.get("menuminscrollheight")); >- oMenu.cfg.setProperty("maxheight", this.get("menumaxheight")); >- >- } >- else { >- >- oMenu.cfg.queueProperty("minscrollheight", this.get("menuminscrollheight")); >- oMenu.cfg.queueProperty("maxheight", this.get("menumaxheight")); >- >- } >- >- >- oMenu.show(); >- >- oMenu.focus = fnFocusMethod; >- >- oMenu.align(); >- >- >- /* >- Stop the propagation of the event so that the MenuManager >- doesn't blur the menu after it gets focus. >- */ >- >- if (p_oEvent.type == "mousedown") { >- Event.stopPropagation(p_oEvent); >- } >- >- >- if (bFocusMenu) { >- oMenu.focus(); >- } >- >- } >- else if (Overlay && oMenu && (oMenu instanceof Overlay)) { >- >- if (!this._renderedMenu) { >- oMenu.render(this.get("element").parentNode); >- } >- >- oMenu.show(); >- oMenu.align(); >- >- } >- >- }, >- >- >- /** >- * @method _hideMenu >- * @description Hides the button's menu. >- * @protected >- */ >- _hideMenu: function () { >- >- var oMenu = this._menu; >- >- if (oMenu) { >- >- oMenu.hide(); >- >- } >- >- }, >- >- >- >- >- // Protected event handlers >- >- >- /** >- * @method _onMouseOver >- * @description "mouseover" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseOver: function (p_oEvent) { >- >- var sType = this.get("type"), >- oElement, >- nOptionRegionX; >- >- >- if (sType === "split") { >- >- oElement = this.get("element"); >- nOptionRegionX = >- (Dom.getX(oElement) + (oElement.offsetWidth - this.OPTION_AREA_WIDTH)); >- >- this._nOptionRegionX = nOptionRegionX; >- >- } >- >- >- if (!this._hasMouseEventHandlers) { >- >- if (sType === "split") { >- >- this.on("mousemove", this._onMouseMove); >- >- } >- >- this.on("mouseout", this._onMouseOut); >- >- this._hasMouseEventHandlers = true; >- >- } >- >- >- this.addStateCSSClasses("hover"); >- >- >- if (sType === "split" && (Event.getPageX(p_oEvent) > nOptionRegionX)) { >- >- this.addStateCSSClasses("hoveroption"); >- >- } >- >- >- if (this._activationButtonPressed) { >- >- this.addStateCSSClasses("active"); >- >- } >- >- >- if (this._bOptionPressed) { >- >- this.addStateCSSClasses("activeoption"); >- >- } >- >- >- if (this._activationButtonPressed || this._bOptionPressed) { >- >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- >- } >- >- }, >- >- >- /** >- * @method _onMouseMove >- * @description "mousemove" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseMove: function (p_oEvent) { >- >- var nOptionRegionX = this._nOptionRegionX; >- >- if (nOptionRegionX) { >- >- if (Event.getPageX(p_oEvent) > nOptionRegionX) { >- >- this.addStateCSSClasses("hoveroption"); >- >- } >- else { >- >- this.removeStateCSSClasses("hoveroption"); >- >- } >- >- } >- >- }, >- >- /** >- * @method _onMouseOut >- * @description "mouseout" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseOut: function (p_oEvent) { >- >- var sType = this.get("type"); >- >- this.removeStateCSSClasses("hover"); >- >- >- if (sType != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- >- if (this._activationButtonPressed || this._bOptionPressed) { >- >- Event.on(document, "mouseup", this._onDocumentMouseUp, null, this); >- >- } >- >- >- if (sType === "split" && (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { >- >- this.removeStateCSSClasses("hoveroption"); >- >- } >- >- }, >- >- >- /** >- * @method _onDocumentMouseUp >- * @description "mouseup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentMouseUp: function (p_oEvent) { >- >- this._activationButtonPressed = false; >- this._bOptionPressed = false; >- >- var sType = this.get("type"), >- oTarget, >- oMenuElement; >- >- if (sType == "menu" || sType == "split") { >- >- oTarget = Event.getTarget(p_oEvent); >- oMenuElement = this._menu.element; >- >- if (oTarget != oMenuElement && >- !Dom.isAncestor(oMenuElement, oTarget)) { >- >- this.removeStateCSSClasses((sType == "menu" ? >- "active" : "activeoption")); >- >- this._hideMenu(); >- >- } >- >- } >- >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- >- }, >- >- >- /** >- * @method _onMouseDown >- * @description "mousedown" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseDown: function (p_oEvent) { >- >- var sType, >- bReturnVal = true; >- >- >- function onMouseUp() { >- >- this._hideMenu(); >- this.removeListener("mouseup", onMouseUp); >- >- } >- >- >- if ((p_oEvent.which || p_oEvent.button) == 1) { >- >- >- if (!this.hasFocus()) { >- >- this.focus(); >- >- } >- >- >- sType = this.get("type"); >- >- >- if (sType == "split") { >- >- if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- this.fireEvent("option", p_oEvent); >- bReturnVal = false; >- >- } >- else { >- >- this.addStateCSSClasses("active"); >- >- this._activationButtonPressed = true; >- >- } >- >- } >- else if (sType == "menu") { >- >- if (this.isActive()) { >- >- this._hideMenu(); >- >- this._activationButtonPressed = false; >- >- } >- else { >- >- this._showMenu(p_oEvent); >- >- this._activationButtonPressed = true; >- >- } >- >- } >- else { >- >- this.addStateCSSClasses("active"); >- >- this._activationButtonPressed = true; >- >- } >- >- >- >- if (sType == "split" || sType == "menu") { >- >- this._hideMenuTimer = Lang.later(250, this, this.on, ["mouseup", onMouseUp]); >- >- } >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onMouseUp >- * @description "mouseup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseUp: function (p_oEvent) { >- >- var sType = this.get("type"), >- oHideMenuTimer = this._hideMenuTimer, >- bReturnVal = true; >- >- >- if (oHideMenuTimer) { >- >- oHideMenuTimer.cancel(); >- >- } >- >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.set("checked", !(this.get("checked"))); >- >- } >- >- >- this._activationButtonPressed = false; >- >- >- if (sType != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- >- if (sType == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- bReturnVal = false; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onFocus >- * @description "focus" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onFocus: function (p_oEvent) { >- >- var oElement; >- >- this.addStateCSSClasses("focus"); >- >- if (this._activationKeyPressed) { >- >- this.addStateCSSClasses("active"); >- >- } >- >- m_oFocusedButton = this; >- >- >- if (!this._hasKeyEventHandlers) { >- >- oElement = this._button; >- >- Event.on(oElement, "blur", this._onBlur, null, this); >- Event.on(oElement, "keydown", this._onKeyDown, null, this); >- Event.on(oElement, "keyup", this._onKeyUp, null, this); >- >- this._hasKeyEventHandlers = true; >- >- } >- >- >- this.fireEvent("focus", p_oEvent); >- >- }, >- >- >- /** >- * @method _onBlur >- * @description "blur" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onBlur: function (p_oEvent) { >- >- this.removeStateCSSClasses("focus"); >- >- if (this.get("type") != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- if (this._activationKeyPressed) { >- >- Event.on(document, "keyup", this._onDocumentKeyUp, null, this); >- >- } >- >- >- m_oFocusedButton = null; >- >- this.fireEvent("blur", p_oEvent); >- >- }, >- >- >- /** >- * @method _onDocumentKeyUp >- * @description "keyup" event handler for the document. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentKeyUp: function (p_oEvent) { >- >- if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- this._activationKeyPressed = false; >- >- Event.removeListener(document, "keyup", this._onDocumentKeyUp); >- >- } >- >- }, >- >- >- /** >- * @method _onKeyDown >- * @description "keydown" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyDown: function (p_oEvent) { >- >- var oMenu = this._menu; >- >- >- if (this.get("type") == "split" && >- this._isSplitButtonOptionKey(p_oEvent)) { >- >- this.fireEvent("option", p_oEvent); >- >- } >- else if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- if (this.get("type") == "menu") { >- >- this._showMenu(p_oEvent); >- >- } >- else { >- >- this._activationKeyPressed = true; >- >- this.addStateCSSClasses("active"); >- >- } >- >- } >- >- >- if (oMenu && oMenu.cfg.getProperty("visible") && >- Event.getCharCode(p_oEvent) == 27) { >- >- oMenu.hide(); >- this.focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onKeyUp >- * @description "keyup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyUp: function (p_oEvent) { >- >- var sType; >- >- if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- sType = this.get("type"); >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.set("checked", !(this.get("checked"))); >- >- } >- >- this._activationKeyPressed = false; >- >- if (this.get("type") != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _onClick >- * @description "click" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onClick: function (p_oEvent) { >- >- var sType = this.get("type"), >- oForm, >- oSrcElement, >- bReturnVal; >- >- >- switch (sType) { >- >- case "submit": >- >- if (p_oEvent.returnValue !== false) { >- >- this.submitForm(); >- >- } >- >- break; >- >- case "reset": >- >- oForm = this.getForm(); >- >- if (oForm) { >- >- oForm.reset(); >- >- } >- >- break; >- >- >- case "split": >- >- if (this._nOptionRegionX > 0 && >- (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { >- >- bReturnVal = false; >- >- } >- else { >- >- this._hideMenu(); >- >- oSrcElement = this.get("srcelement"); >- >- if (oSrcElement && oSrcElement.type == "submit" && >- p_oEvent.returnValue !== false) { >- >- this.submitForm(); >- >- } >- >- } >- >- break; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onDblClick >- * @description "dblclick" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDblClick: function (p_oEvent) { >- >- var bReturnVal = true; >- >- if (this.get("type") == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- bReturnVal = false; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onAppendTo >- * @description "appendTo" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onAppendTo: function (p_oEvent) { >- >- /* >- It is necessary to call "_addListenersToForm" using >- "setTimeout" to make sure that the button's "form" property >- returns a node reference. Sometimes, if you try to get the >- reference immediately after appending the field, it is null. >- */ >- >- Lang.later(0, this, this._addListenersToForm); >- >- }, >- >- >- /** >- * @method _onFormReset >- * @description "reset" event handler for the button's form. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event >- * object passed back by the event utility (YAHOO.util.Event). >- */ >- _onFormReset: function (p_oEvent) { >- >- var sType = this.get("type"), >- oMenu = this._menu; >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.resetValue("checked"); >- >- } >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- this.resetValue("selectedMenuItem"); >- >- } >- >- }, >- >- >- /** >- * @method _onFormSubmit >- * @description "submit" event handler for the button's form. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event >- * object passed back by the event utility (YAHOO.util.Event). >- */ >- _onFormSubmit: function (p_oEvent) { >- >- this.createHiddenFields(); >- >- }, >- >- >- /** >- * @method _onDocumentMouseDown >- * @description "mousedown" event handler for the document. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentMouseDown: function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- oButtonElement = this.get("element"), >- oMenuElement = this._menu.element; >- >- >- if (oTarget != oButtonElement && >- !Dom.isAncestor(oButtonElement, oTarget) && >- oTarget != oMenuElement && >- !Dom.isAncestor(oMenuElement, oTarget)) { >- >- this._hideMenu(); >- >- // In IE when the user mouses down on a focusable element >- // that element will be focused and become the "activeElement". >- // (http://msdn.microsoft.com/en-us/library/ms533065(VS.85).aspx) >- // However, there is a bug in IE where if there is a >- // positioned element with a focused descendant that is >- // hidden in response to the mousedown event, the target of >- // the mousedown event will appear to have focus, but will >- // not be set as the activeElement. This will result >- // in the element not firing key events, even though it >- // appears to have focus. The following call to "setActive" >- // fixes this bug. >- >- if (UA.ie && oTarget.focus) { >- oTarget.setActive(); >- } >- >- Event.removeListener(document, "mousedown", >- this._onDocumentMouseDown); >- >- } >- >- }, >- >- >- /** >- * @method _onOption >- * @description "option" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onOption: function (p_oEvent) { >- >- if (this.hasClass(this.CLASS_NAME_PREFIX + "split-button-activeoption")) { >- >- this._hideMenu(); >- >- this._bOptionPressed = false; >- >- } >- else { >- >- this._showMenu(p_oEvent); >- >- this._bOptionPressed = true; >- >- } >- >- }, >- >- >- /** >- * @method _onMenuShow >- * @description "show" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the event >- * that was fired. >- */ >- _onMenuShow: function (p_sType) { >- >- Event.on(document, "mousedown", this._onDocumentMouseDown, >- null, this); >- >- var sState = (this.get("type") == "split") ? "activeoption" : "active"; >- >- this.addStateCSSClasses(sState); >- >- }, >- >- >- /** >- * @method _onMenuHide >- * @description "hide" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the event >- * that was fired. >- */ >- _onMenuHide: function (p_sType) { >- >- var sState = (this.get("type") == "split") ? "activeoption" : "active"; >- >- this.removeStateCSSClasses(sState); >- >- >- if (this.get("type") == "split") { >- >- this._bOptionPressed = false; >- >- } >- >- }, >- >- >- /** >- * @method _onMenuKeyDown >- * @description "keydown" event handler for the button's menu. >- * @private >- * @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. >- */ >- _onMenuKeyDown: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0]; >- >- if (Event.getCharCode(oEvent) == 27) { >- >- this.focus(); >- >- if (this.get("type") == "split") { >- >- this._bOptionPressed = false; >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _onMenuRender >- * @description "render" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the >- * event thatwas fired. >- */ >- _onMenuRender: function (p_sType) { >- >- var oButtonElement = this.get("element"), >- oButtonParent = oButtonElement.parentNode, >- oMenu = this._menu, >- oMenuElement = oMenu.element, >- oSrcElement = oMenu.srcElement, >- oItem; >- >- >- if (oButtonParent != oMenuElement.parentNode) { >- >- oButtonParent.appendChild(oMenuElement); >- >- } >- >- this._renderedMenu = true; >- >- // If the user has designated an <option> of the Menu's source >- // <select> element to be selected, sync the selectedIndex with >- // the "selectedMenuItem" Attribute. >- >- if (oSrcElement && >- oSrcElement.nodeName.toLowerCase() === "select" && >- oSrcElement.value) { >- >- >- oItem = oMenu.getItem(oSrcElement.selectedIndex); >- >- // Set the value of the "selectedMenuItem" attribute >- // silently since this is the initial set--synchronizing >- // the value of the source <SELECT> element in the DOM with >- // its corresponding Menu instance. >- >- this.set("selectedMenuItem", oItem, true); >- >- // Call the "_onSelectedMenuItemChange" method since the >- // attribute was set silently. >- >- this._onSelectedMenuItemChange({ newValue: oItem }); >- >- } >- >- }, >- >- >- >- /** >- * @method _onMenuClick >- * @description "click" event handler for the button's menu. >- * @private >- * @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. >- */ >- _onMenuClick: function (p_sType, p_aArgs) { >- >- var oItem = p_aArgs[1], >- oSrcElement; >- >- if (oItem) { >- >- this.set("selectedMenuItem", oItem); >- >- oSrcElement = this.get("srcelement"); >- >- if (oSrcElement && oSrcElement.type == "submit") { >- >- this.submitForm(); >- >- } >- >- this._hideMenu(); >- >- } >- >- }, >- >- >- /** >- * @method _onSelectedMenuItemChange >- * @description "selectedMenuItemChange" event handler for the Button's >- * "selectedMenuItem" attribute. >- * @param {Event} event Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onSelectedMenuItemChange: function (event) { >- >- var oSelected = event.prevValue, >- oItem = event.newValue, >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (oSelected) { >- Dom.removeClass(oSelected.element, (sPrefix + "button-selectedmenuitem")); >- } >- >- if (oItem) { >- Dom.addClass(oItem.element, (sPrefix + "button-selectedmenuitem")); >- } >- >- }, >- >- >- /** >- * @method _onLabelClick >- * @description "click" event handler for the Button's >- * <code><label></code> element. >- * @param {Event} event Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onLabelClick: function (event) { >- >- this.focus(); >- >- var sType = this.get("type"); >- >- if (sType == "radio" || sType == "checkbox") { >- this.set("checked", (!this.get("checked"))); >- } >- >- }, >- >- >- // Public methods >- >- >- /** >- * @method createButtonElement >- * @description Creates the button's HTML elements. >- * @param {String} p_sType String indicating the type of element >- * to create. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>} >- */ >- createButtonElement: function (p_sType) { >- >- var sNodeName = this.NODE_NAME, >- oElement = document.createElement(sNodeName); >- >- oElement.innerHTML = "<" + sNodeName + " class=\"first-child\">" + >- (p_sType == "link" ? "<a></a>" : >- "<button type=\"button\"></button>") + "</" + sNodeName + ">"; >- >- return oElement; >- >- }, >- >- >- /** >- * @method addStateCSSClasses >- * @description Appends state-specific CSS classes to the button's root >- * DOM element. >- */ >- addStateCSSClasses: function (p_sState) { >- >- var sType = this.get("type"), >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (Lang.isString(p_sState)) { >- >- if (p_sState != "activeoption" && p_sState != "hoveroption") { >- >- this.addClass(sPrefix + this.CSS_CLASS_NAME + ("-" + p_sState)); >- >- } >- >- this.addClass(sPrefix + sType + ("-button-" + p_sState)); >- >- } >- >- }, >- >- >- /** >- * @method removeStateCSSClasses >- * @description Removes state-specific CSS classes to the button's root >- * DOM element. >- */ >- removeStateCSSClasses: function (p_sState) { >- >- var sType = this.get("type"), >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (Lang.isString(p_sState)) { >- >- this.removeClass(sPrefix + this.CSS_CLASS_NAME + ("-" + p_sState)); >- this.removeClass(sPrefix + sType + ("-button-" + p_sState)); >- >- } >- >- }, >- >- >- /** >- * @method createHiddenFields >- * @description Creates the button's hidden form field and appends it >- * to its parent form. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array} >- */ >- createHiddenFields: function () { >- >- this.removeHiddenFields(); >- >- var oForm = this.getForm(), >- oButtonField, >- sType, >- bCheckable, >- oMenu, >- oMenuItem, >- sButtonName, >- oValue, >- oMenuField, >- oReturnVal, >- sMenuFieldName, >- oMenuSrcElement, >- bMenuSrcElementIsSelect = false; >- >- >- if (oForm && !this.get("disabled")) { >- >- sType = this.get("type"); >- bCheckable = (sType == "checkbox" || sType == "radio"); >- >- >- if ((bCheckable && this.get("checked")) || (m_oSubmitTrigger == this)) { >- >- YAHOO.log("Creating hidden field.", "info", this.toString()); >- >- oButtonField = createInputElement((bCheckable ? sType : "hidden"), >- this.get("name"), this.get("value"), this.get("checked")); >- >- >- if (oButtonField) { >- >- if (bCheckable) { >- >- oButtonField.style.display = "none"; >- >- } >- >- oForm.appendChild(oButtonField); >- >- } >- >- } >- >- >- oMenu = this._menu; >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- YAHOO.log("Creating hidden field for menu.", "info", this.toString()); >- >- oMenuItem = this.get("selectedMenuItem"); >- oMenuSrcElement = oMenu.srcElement; >- bMenuSrcElementIsSelect = (oMenuSrcElement && >- oMenuSrcElement.nodeName.toUpperCase() == "SELECT"); >- >- if (oMenuItem) { >- >- oValue = (oMenuItem.value === null || oMenuItem.value === "") ? >- oMenuItem.cfg.getProperty("text") : oMenuItem.value; >- >- sButtonName = this.get("name"); >- >- >- if (bMenuSrcElementIsSelect) { >- >- sMenuFieldName = oMenuSrcElement.name; >- >- } >- else if (sButtonName) { >- >- sMenuFieldName = (sButtonName + "_options"); >- >- } >- >- >- if (oValue && sMenuFieldName) { >- >- oMenuField = createInputElement("hidden", sMenuFieldName, oValue); >- oForm.appendChild(oMenuField); >- >- } >- >- } >- else if (bMenuSrcElementIsSelect) { >- >- oMenuField = oForm.appendChild(oMenuSrcElement); >- >- } >- >- } >- >- >- if (oButtonField && oMenuField) { >- >- this._hiddenFields = [oButtonField, oMenuField]; >- >- } >- else if (!oButtonField && oMenuField) { >- >- this._hiddenFields = oMenuField; >- >- } >- else if (oButtonField && !oMenuField) { >- >- this._hiddenFields = oButtonField; >- >- } >- >- oReturnVal = this._hiddenFields; >- >- } >- >- return oReturnVal; >- >- }, >- >- >- /** >- * @method removeHiddenFields >- * @description Removes the button's hidden form field(s) from its >- * parent form. >- */ >- removeHiddenFields: function () { >- >- var oField = this._hiddenFields, >- nFields, >- i; >- >- function removeChild(p_oElement) { >- >- if (Dom.inDocument(p_oElement)) { >- >- p_oElement.parentNode.removeChild(p_oElement); >- >- } >- >- } >- >- >- if (oField) { >- >- if (Lang.isArray(oField)) { >- >- nFields = oField.length; >- >- if (nFields > 0) { >- >- i = nFields - 1; >- >- do { >- >- removeChild(oField[i]); >- >- } >- while (i--); >- >- } >- >- } >- else { >- >- removeChild(oField); >- >- } >- >- this._hiddenFields = null; >- >- } >- >- }, >- >- >- /** >- * @method submitForm >- * @description Submits the form to which the button belongs. Returns >- * true if the form was submitted successfully, false if the submission >- * was cancelled. >- * @protected >- * @return {Boolean} >- */ >- submitForm: function () { >- >- var oForm = this.getForm(), >- >- oSrcElement = this.get("srcelement"), >- >- /* >- Boolean indicating if the event fired successfully >- (was not cancelled by any handlers) >- */ >- >- bSubmitForm = false, >- >- oEvent; >- >- >- if (oForm) { >- >- if (this.get("type") == "submit" || (oSrcElement && oSrcElement.type == "submit")) { >- >- m_oSubmitTrigger = this; >- >- } >- >- >- if (UA.ie) { >- >- bSubmitForm = oForm.fireEvent("onsubmit"); >- >- } >- else { // Gecko, Opera, and Safari >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent("submit", true, true); >- >- bSubmitForm = oForm.dispatchEvent(oEvent); >- >- } >- >- >- /* >- In IE and Safari, dispatching a "submit" event to a form >- WILL cause the form's "submit" event to fire, but WILL NOT >- submit the form. Therefore, we need to call the "submit" >- method as well. >- */ >- >- if ((UA.ie || UA.webkit) && bSubmitForm) { >- >- oForm.submit(); >- >- } >- >- } >- >- return bSubmitForm; >- >- }, >- >- >- /** >- * @method init >- * @description The Button class's initialization method. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to >- * be used to create the button. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http:// >- * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html >- * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR >- * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296"> >- * HTMLElement</a>} p_oElement Object reference for the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to be >- * used to create the button. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button. >- * @param {Object} p_oAttributes Optional. Object literal specifying a >- * set of configuration attributes used to create the button. >- */ >- init: function (p_oElement, p_oAttributes) { >- >- var sNodeName = p_oAttributes.type == "link" ? "a" : "button", >- oSrcElement = p_oAttributes.srcelement, >- oButton = p_oElement.getElementsByTagName(sNodeName)[0], >- oInput; >- >- >- if (!oButton) { >- >- oInput = p_oElement.getElementsByTagName("input")[0]; >- >- >- if (oInput) { >- >- oButton = document.createElement("button"); >- oButton.setAttribute("type", "button"); >- >- oInput.parentNode.replaceChild(oButton, oInput); >- >- } >- >- } >- >- this._button = oButton; >- >- >- YAHOO.widget.Button.superclass.init.call(this, p_oElement, p_oAttributes); >- >- >- var sId = this.get("id"), >- sButtonId = sId + "-button"; >- >- >- oButton.id = sButtonId; >- >- >- var aLabels, >- oLabel; >- >- >- var hasLabel = function (element) { >- >- return (element.htmlFor === sId); >- >- }; >- >- >- var setLabel = function () { >- >- oLabel.setAttribute((UA.ie ? "htmlFor" : "for"), sButtonId); >- >- }; >- >- >- if (oSrcElement && this.get("type") != "link") { >- >- aLabels = Dom.getElementsBy(hasLabel, "label"); >- >- if (Lang.isArray(aLabels) && aLabels.length > 0) { >- >- oLabel = aLabels[0]; >- >- } >- >- } >- >- >- m_oButtons[sId] = this; >- >- var sPrefix = this.CLASS_NAME_PREFIX; >- >- this.addClass(sPrefix + this.CSS_CLASS_NAME); >- this.addClass(sPrefix + this.get("type") + "-button"); >- >- Event.on(this._button, "focus", this._onFocus, null, this); >- this.on("mouseover", this._onMouseOver); >- this.on("mousedown", this._onMouseDown); >- this.on("mouseup", this._onMouseUp); >- this.on("click", this._onClick); >- >- // Need to reset the value of the "onclick" Attribute so that any >- // handlers registered via the "onclick" Attribute are fired after >- // Button's default "_onClick" listener. >- >- var fnOnClick = this.get("onclick"); >- >- this.set("onclick", null); >- this.set("onclick", fnOnClick); >- >- this.on("dblclick", this._onDblClick); >- >- >- var oParentNode; >- >- if (oLabel) { >- >- if (this.get("replaceLabel")) { >- >- this.set("label", oLabel.innerHTML); >- >- oParentNode = oLabel.parentNode; >- >- oParentNode.removeChild(oLabel); >- >- } >- else { >- >- this.on("appendTo", setLabel); >- >- Event.on(oLabel, "click", this._onLabelClick, null, this); >- >- this._label = oLabel; >- >- } >- >- } >- >- this.on("appendTo", this._onAppendTo); >- >- >- >- var oContainer = this.get("container"), >- oElement = this.get("element"), >- bElInDoc = Dom.inDocument(oElement); >- >- >- if (oContainer) { >- >- if (oSrcElement && oSrcElement != oElement) { >- >- oParentNode = oSrcElement.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oSrcElement); >- >- } >- >- } >- >- if (Lang.isString(oContainer)) { >- >- Event.onContentReady(oContainer, this.appendTo, oContainer, this); >- >- } >- else { >- >- this.on("init", function () { >- >- Lang.later(0, this, this.appendTo, oContainer); >- >- }); >- >- } >- >- } >- else if (!bElInDoc && oSrcElement && oSrcElement != oElement) { >- >- oParentNode = oSrcElement.parentNode; >- >- if (oParentNode) { >- >- this.fireEvent("beforeAppendTo", { >- type: "beforeAppendTo", >- target: oParentNode >- }); >- >- oParentNode.replaceChild(oElement, oSrcElement); >- >- this.fireEvent("appendTo", { >- type: "appendTo", >- target: oParentNode >- }); >- >- } >- >- } >- else if (this.get("type") != "link" && bElInDoc && oSrcElement && >- oSrcElement == oElement) { >- >- this._addListenersToForm(); >- >- } >- >- YAHOO.log("Initialization completed.", "info", this.toString()); >- >- >- this.fireEvent("init", { >- type: "init", >- target: this >- }); >- >- }, >- >- >- /** >- * @method initAttributes >- * @description Initializes all of the configuration attributes used to >- * create the button. >- * @param {Object} p_oAttributes Object literal specifying a set of >- * configuration attributes used to create the button. >- */ >- initAttributes: function (p_oAttributes) { >- >- var oAttributes = p_oAttributes || {}; >- >- YAHOO.widget.Button.superclass.initAttributes.call(this, >- oAttributes); >- >- >- /** >- * @attribute type >- * @description String specifying the button's type. Possible >- * values are: "push," "link," "submit," "reset," "checkbox," >- * "radio," "menu," and "split." >- * @default "push" >- * @type String >- * @writeonce >- */ >- this.setAttributeConfig("type", { >- >- value: (oAttributes.type || "push"), >- validator: Lang.isString, >- writeOnce: true, >- method: this._setType >- >- }); >- >- >- /** >- * @attribute label >- * @description String specifying the button's text label >- * or innerHTML. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("label", { >- >- value: oAttributes.label, >- validator: Lang.isString, >- method: this._setLabel >- >- }); >- >- >- /** >- * @attribute value >- * @description Object specifying the value for the button. >- * @default null >- * @type Object >- */ >- this.setAttributeConfig("value", { >- >- value: oAttributes.value >- >- }); >- >- >- /** >- * @attribute name >- * @description String specifying the name for the button. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("name", { >- >- value: oAttributes.name, >- validator: Lang.isString >- >- }); >- >- >- /** >- * @attribute tabindex >- * @description Number specifying the tabindex for the button. >- * @default null >- * @type Number >- */ >- this.setAttributeConfig("tabindex", { >- >- value: oAttributes.tabindex, >- validator: Lang.isNumber, >- method: this._setTabIndex >- >- }); >- >- >- /** >- * @attribute title >- * @description String specifying the title for the button. >- * @default null >- * @type String >- */ >- this.configureAttribute("title", { >- >- value: oAttributes.title, >- validator: Lang.isString, >- method: this._setTitle >- >- }); >- >- >- /** >- * @attribute disabled >- * @description Boolean indicating if the button should be disabled. >- * (Disabled buttons are dimmed and will not respond to user input >- * or fire events. Does not apply to button's of type "link.") >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("disabled", { >- >- value: (oAttributes.disabled || false), >- validator: Lang.isBoolean, >- method: this._setDisabled >- >- }); >- >- >- /** >- * @attribute href >- * @description String specifying the href for the button. Applies >- * only to buttons of type "link." >- * @type String >- */ >- this.setAttributeConfig("href", { >- >- value: oAttributes.href, >- validator: Lang.isString, >- method: this._setHref >- >- }); >- >- >- /** >- * @attribute target >- * @description String specifying the target for the button. >- * Applies only to buttons of type "link." >- * @type String >- */ >- this.setAttributeConfig("target", { >- >- value: oAttributes.target, >- validator: Lang.isString, >- method: this._setTarget >- >- }); >- >- >- /** >- * @attribute checked >- * @description Boolean indicating if the button is checked. >- * Applies only to buttons of type "radio" and "checkbox." >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("checked", { >- >- value: (oAttributes.checked || false), >- validator: Lang.isBoolean, >- method: this._setChecked >- >- }); >- >- >- /** >- * @attribute container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the button's markup should be >- * rendered into. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("container", { >- >- value: oAttributes.container, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute srcelement >- * @description Object reference to the HTML element (either >- * <code><input></code> or <code><span></code>) >- * used to create the button. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("srcelement", { >- >- value: oAttributes.srcelement, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menu >- * @description Object specifying the menu for the button. >- * The value can be one of the following: >- * <ul> >- * <li>Object specifying a rendered <a href="YAHOO.widget.Menu.html"> >- * YAHOO.widget.Menu</a> instance.</li> >- * <li>Object specifying a rendered <a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a> instance.</li> >- * <li>String specifying the id attribute of the <code><div> >- * </code> element used to create the menu. By default the menu >- * will be created as an instance of >- * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>. >- * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME"> >- * default CSS class name for YAHOO.widget.Menu</a> is applied to >- * the <code><div></code> element, it will be created as an >- * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu >- * </a>.</li><li>String specifying the id attribute of the >- * <code><select></code> element used to create the menu. >- * </li><li>Object specifying the <code><div></code> element >- * used to create the menu.</li> >- * <li>Object specifying the <code><select></code> element >- * used to create the menu.</li> >- * <li>Array of object literals, each representing a set of >- * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> >- * configuration attributes.</li> >- * <li>Array of strings representing the text labels for each menu >- * item in the menu.</li> >- * </ul> >- * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a >- * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a >- * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-58190037">HTMLElement</a>|String|Array >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("menu", { >- >- value: null, >- method: this._setMenu, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute lazyloadmenu >- * @description Boolean indicating the value to set for the >- * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a> >- * configuration property of the button's menu. Setting >- * "lazyloadmenu" to <code>true </code> will defer rendering of >- * the button's menu until the first time it is made visible. >- * If "lazyloadmenu" is set to <code>false</code>, the button's >- * menu will be rendered immediately if the button is in the >- * document, or in response to the button's "appendTo" event if >- * the button is not yet in the document. In either case, the >- * menu is rendered into the button's parent HTML element. >- * <em>This attribute does not apply if a >- * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or >- * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> >- * instance is passed as the value of the button's "menu" >- * configuration attribute. <a href="YAHOO.widget.Menu.html"> >- * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a> instances should be rendered before >- * being set as the value for the "menu" configuration >- * attribute.</em> >- * @default true >- * @type Boolean >- * @writeonce >- */ >- this.setAttributeConfig("lazyloadmenu", { >- >- value: (oAttributes.lazyloadmenu === false ? false : true), >- validator: Lang.isBoolean, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menuclassname >- * @description String representing the CSS class name to be >- * applied to the root element of the button's menu. >- * @type String >- * @default "yui-button-menu" >- * @writeonce >- */ >- this.setAttributeConfig("menuclassname", { >- >- value: (oAttributes.menuclassname || (this.CLASS_NAME_PREFIX + "button-menu")), >- validator: Lang.isString, >- method: this._setMenuClassName, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menuminscrollheight >- * @description Number defining the minimum threshold for the "menumaxheight" >- * configuration attribute. When set this attribute is automatically applied >- * to all submenus. >- * @default 90 >- * @type Number >- */ >- this.setAttributeConfig("menuminscrollheight", { >- >- value: (oAttributes.menuminscrollheight || 90), >- validator: Lang.isNumber >- >- }); >- >- >- /** >- * @attribute menumaxheight >- * @description Number defining the maximum height (in pixels) for a menu's >- * body element (<code><div class="bd"<</code>). Once a menu's body >- * exceeds this height, the contents of the body are scrolled to maintain >- * this value. This value cannot be set lower than the value of the >- * "minscrollheight" configuration property. >- * @type Number >- * @default 0 >- */ >- this.setAttributeConfig("menumaxheight", { >- >- value: (oAttributes.menumaxheight || 0), >- validator: Lang.isNumber >- >- }); >- >- >- /** >- * @attribute menualignment >- * @description Array defining how the Button's Menu is aligned to the Button. >- * The default value of ["tl", "bl"] aligns the Menu's top left corner to the Button's >- * bottom left corner. >- * @type Array >- * @default ["tl", "bl"] >- */ >- this.setAttributeConfig("menualignment", { >- >- value: (oAttributes.menualignment || ["tl", "bl"]), >- validator: Lang.isArray >- >- }); >- >- >- /** >- * @attribute selectedMenuItem >- * @description Object representing the item in the button's menu >- * that is currently selected. >- * @type YAHOO.widget.MenuItem >- * @default null >- */ >- this.setAttributeConfig("selectedMenuItem", { >- >- value: null >- >- }); >- >- >- /** >- * @attribute onclick >- * @description Object literal representing the code to be executed >- * when the button is clicked. Format:<br> <code> {<br> >- * <strong>fn:</strong> Function, // The handler to call >- * when the event fires.<br> <strong>obj:</strong> Object, >- * // An object to pass back to the handler.<br> >- * <strong>scope:</strong> Object // The object to use >- * for the scope of the handler.<br> } </code> >- * @type Object >- * @default null >- */ >- this.setAttributeConfig("onclick", { >- >- value: oAttributes.onclick, >- method: this._setOnClick >- >- }); >- >- >- /** >- * @attribute focusmenu >- * @description Boolean indicating whether or not the button's menu >- * should be focused when it is made visible. >- * @type Boolean >- * @default true >- */ >- this.setAttributeConfig("focusmenu", { >- >- value: (oAttributes.focusmenu === false ? false : true), >- validator: Lang.isBoolean >- >- }); >- >- >- /** >- * @attribute replaceLabel >- * @description Boolean indicating whether or not the text of the >- * button's <code><label></code> element should be used as >- * the source for the button's label configuration attribute and >- * removed from the DOM. >- * @type Boolean >- * @default false >- */ >- this.setAttributeConfig("replaceLabel", { >- >- value: false, >- validator: Lang.isBoolean, >- writeOnce: true >- >- }); >- >- }, >- >- >- /** >- * @method focus >- * @description Causes the button to receive the focus and fires the >- * button's "focus" event. >- */ >- focus: function () { >- >- if (!this.get("disabled")) { >- >- this._button.focus(); >- >- } >- >- }, >- >- >- /** >- * @method blur >- * @description Causes the button to lose focus and fires the button's >- * "blur" event. >- */ >- blur: function () { >- >- if (!this.get("disabled")) { >- >- this._button.blur(); >- >- } >- >- }, >- >- >- /** >- * @method hasFocus >- * @description Returns a boolean indicating whether or not the button >- * has focus. >- * @return {Boolean} >- */ >- hasFocus: function () { >- >- return (m_oFocusedButton == this); >- >- }, >- >- >- /** >- * @method isActive >- * @description Returns a boolean indicating whether or not the button >- * is active. >- * @return {Boolean} >- */ >- isActive: function () { >- >- return this.hasClass(this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME + "-active"); >- >- }, >- >- >- /** >- * @method getMenu >- * @description Returns a reference to the button's menu. >- * @return {<a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a>|<a >- * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>} >- */ >- getMenu: function () { >- >- return this._menu; >- >- }, >- >- >- /** >- * @method getForm >- * @description Returns a reference to the button's parent form. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1- >- * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>} >- */ >- getForm: function () { >- >- var oButton = this._button, >- oForm; >- >- if (oButton) { >- >- oForm = oButton.form; >- >- } >- >- return oForm; >- >- }, >- >- >- /** >- * @method getHiddenFields >- * @description Returns an <code><input></code> element or >- * array of form elements used to represent the button when its parent >- * form is submitted. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array} >- */ >- getHiddenFields: function () { >- >- return this._hiddenFields; >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the button's element from its parent element and >- * removes all event handlers. >- */ >- destroy: function () { >- >- YAHOO.log("Destroying ...", "info", this.toString()); >- >- var oElement = this.get("element"), >- oMenu = this._menu, >- oLabel = this._label, >- oParentNode, >- aButtons; >- >- if (oMenu) { >- >- YAHOO.log("Destroying menu.", "info", this.toString()); >- >- if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) { >- >- m_oOverlayManager.remove(oMenu); >- >- } >- >- oMenu.destroy(); >- >- } >- >- YAHOO.log("Removing DOM event listeners.", "info", this.toString()); >- >- Event.purgeElement(oElement); >- Event.purgeElement(this._button); >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- Event.removeListener(document, "keyup", this._onDocumentKeyUp); >- Event.removeListener(document, "mousedown", this._onDocumentMouseDown); >- >- >- if (oLabel) { >- >- Event.removeListener(oLabel, "click", this._onLabelClick); >- >- oParentNode = oLabel.parentNode; >- oParentNode.removeChild(oLabel); >- >- } >- >- >- var oForm = this.getForm(); >- >- if (oForm) { >- >- Event.removeListener(oForm, "reset", this._onFormReset); >- Event.removeListener(oForm, "submit", this._onFormSubmit); >- >- } >- >- YAHOO.log("Removing CustomEvent listeners.", "info", this.toString()); >- >- this.unsubscribeAll(); >- >- oParentNode = oElement.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oElement); >- >- } >- >- YAHOO.log("Removing from document.", "info", this.toString()); >- >- delete m_oButtons[this.get("id")]; >- >- var sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- aButtons = Dom.getElementsByClassName(sClass, >- this.NODE_NAME, oForm); >- >- if (Lang.isArray(aButtons) && aButtons.length === 0) { >- >- Event.removeListener(oForm, "keypress", >- YAHOO.widget.Button.onFormKeyPress); >- >- } >- >- YAHOO.log("Destroyed.", "info", this.toString()); >- >- }, >- >- >- fireEvent: function (p_sType , p_aArgs) { >- >- var sType = arguments[0]; >- >- // Disabled buttons should not respond to DOM events >- >- if (this.DOM_EVENTS[sType] && this.get("disabled")) { >- >- return false; >- >- } >- >- return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments); >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the button. >- * @return {String} >- */ >- toString: function () { >- >- return ("Button " + this.get("id")); >- >- } >- >- }); >- >- >- /** >- * @method YAHOO.widget.Button.onFormKeyPress >- * @description "keypress" event handler for the button's form. >- * @param {Event} p_oEvent Object representing the DOM event object passed >- * back by the event utility (YAHOO.util.Event). >- */ >- YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- nCharCode = Event.getCharCode(p_oEvent), >- sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(), >- sType = oTarget.type, >- >- /* >- Boolean indicating if the form contains any enabled or >- disabled YUI submit buttons >- */ >- >- bFormContainsYUIButtons = false, >- >- oButton, >- >- oYUISubmitButton, // The form's first, enabled YUI submit button >- >- /* >- The form's first, enabled HTML submit button that precedes any >- YUI submit button >- */ >- >- oPrecedingSubmitButton, >- >- oEvent; >- >- >- function isSubmitButton(p_oElement) { >- >- var sId, >- oSrcElement; >- >- switch (p_oElement.nodeName.toUpperCase()) { >- >- case "INPUT": >- case "BUTTON": >- >- if (p_oElement.type == "submit" && !p_oElement.disabled) { >- >- if (!bFormContainsYUIButtons && !oPrecedingSubmitButton) { >- >- oPrecedingSubmitButton = p_oElement; >- >- } >- >- } >- >- break; >- >- >- default: >- >- sId = p_oElement.id; >- >- if (sId) { >- >- oButton = m_oButtons[sId]; >- >- if (oButton) { >- >- bFormContainsYUIButtons = true; >- >- if (!oButton.get("disabled")) { >- >- oSrcElement = oButton.get("srcelement"); >- >- if (!oYUISubmitButton && (oButton.get("type") == "submit" || >- (oSrcElement && oSrcElement.type == "submit"))) { >- >- oYUISubmitButton = oButton; >- >- } >- >- } >- >- } >- >- } >- >- break; >- >- } >- >- } >- >- >- if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || >- sType == "password" || sType == "checkbox" || sType == "radio" || >- sType == "file")) || sNodeName == "SELECT")) { >- >- Dom.getElementsBy(isSubmitButton, "*", this); >- >- >- if (oPrecedingSubmitButton) { >- >- /* >- Need to set focus to the first enabled submit button >- to make sure that IE includes its name and value >- in the form's data set. >- */ >- >- oPrecedingSubmitButton.focus(); >- >- } >- else if (!oPrecedingSubmitButton && oYUISubmitButton) { >- >- /* >- Need to call "preventDefault" to ensure that the form doesn't end up getting >- submitted twice. >- */ >- >- Event.preventDefault(p_oEvent); >- >- >- if (UA.ie) { >- >- oYUISubmitButton.get("element").fireEvent("onclick"); >- >- } >- else { >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent("click", true, true); >- >- >- if (UA.gecko < 1.9) { >- >- oYUISubmitButton.fireEvent("click", oEvent); >- >- } >- else { >- >- oYUISubmitButton.get("element").dispatchEvent(oEvent); >- >- } >- >- } >- >- } >- >- } >- >- }; >- >- >- /** >- * @method YAHOO.widget.Button.addHiddenFieldsToForm >- * @description Searches the specified form and adds hidden fields for >- * instances of YAHOO.widget.Button that are of type "radio," "checkbox," >- * "menu," and "split." >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference >- * for the form to search. >- */ >- YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) { >- >- var proto = YAHOO.widget.Button.prototype, >- aButtons = Dom.getElementsByClassName( >- (proto.CLASS_NAME_PREFIX + proto.CSS_CLASS_NAME), >- "*", >- p_oForm), >- >- nButtons = aButtons.length, >- oButton, >- sId, >- i; >- >- if (nButtons > 0) { >- >- YAHOO.log("Form contains " + nButtons + " YUI buttons.", "info", this.toString()); >- >- for (i = 0; i < nButtons; i++) { >- >- sId = aButtons[i].id; >- >- if (sId) { >- >- oButton = m_oButtons[sId]; >- >- if (oButton) { >- >- oButton.createHiddenFields(); >- >- } >- >- } >- >- } >- >- } >- >- }; >- >- >- /** >- * @method YAHOO.widget.Button.getButton >- * @description Returns a button with the specified id. >- * @param {String} p_sId String specifying the id of the root node of the >- * HTML element representing the button to be retrieved. >- * @return {YAHOO.widget.Button} >- */ >- YAHOO.widget.Button.getButton = function (p_sId) { >- >- return m_oButtons[p_sId]; >- >- }; >- >- >- // Events >- >- >- /** >- * @event focus >- * @description Fires when the menu item receives focus. Passes back a >- * single object representing the original DOM event object passed back by >- * the event utility (YAHOO.util.Event) when the event was fired. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> >- * for more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event blur >- * @description Fires when the menu item loses the input focus. Passes back >- * a single object representing the original DOM event object passed back by >- * the event utility (YAHOO.util.Event) when the event was fired. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for >- * more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event option >- * @description Fires when the user invokes the button's option. Passes >- * back a single object representing the original DOM event (either >- * "mousedown" or "keydown") that caused the "option" event to fire. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> >- * for more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >-})(); >-(function () { >- >- // Shorthard for utilities >- >- var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- Button = YAHOO.widget.Button, >- >- // Private collection of radio buttons >- >- m_oButtons = {}; >- >- >- >- /** >- * The ButtonGroup class creates a set of buttons that are mutually >- * exclusive; checking one button in the set will uncheck all others in the >- * button group. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><div></code> element of the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object >- * specifying the <code><div></code> element of the button group. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button group. >- * @param {Object} p_oAttributes Optional. Object literal specifying a set >- * of configuration attributes used to create the button group. >- * @namespace YAHOO.widget >- * @class ButtonGroup >- * @constructor >- * @extends YAHOO.util.Element >- */ >- YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) { >- >- var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor, >- sNodeName, >- oElement, >- sId; >- >- if (arguments.length == 1 && !Lang.isString(p_oElement) && >- !p_oElement.nodeName) { >- >- if (!p_oElement.id) { >- >- sId = Dom.generateId(); >- >- p_oElement.id = sId; >- >- YAHOO.log("No value specified for the button group's \"id\"" + >- " attribute. Setting button group id to \"" + sId + "\".", >- "info"); >- >- } >- >- this.logger = new YAHOO.widget.LogWriter("ButtonGroup " + sId); >- >- this.logger.log("No source HTML element. Building the button " + >- "group using the set of configuration attributes."); >- >- fnSuperClass.call(this, (this._createGroupElement()), p_oElement); >- >- } >- else if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- if (oElement) { >- >- if (oElement.nodeName.toUpperCase() == this.NODE_NAME) { >- >- this.logger = >- new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement); >- >- fnSuperClass.call(this, oElement, p_oAttributes); >- >- } >- >- } >- >- } >- else { >- >- sNodeName = p_oElement.nodeName.toUpperCase(); >- >- if (sNodeName && sNodeName == this.NODE_NAME) { >- >- if (!p_oElement.id) { >- >- p_oElement.id = Dom.generateId(); >- >- YAHOO.log("No value specified for the button group's" + >- " \"id\" attribute. Setting button group id " + >- "to \"" + p_oElement.id + "\".", "warn"); >- >- } >- >- this.logger = >- new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement.id); >- >- fnSuperClass.call(this, p_oElement, p_oAttributes); >- >- } >- >- } >- >- }; >- >- >- YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, { >- >- >- // Protected properties >- >- >- /** >- * @property _buttons >- * @description Array of buttons in the button group. >- * @default null >- * @protected >- * @type Array >- */ >- _buttons: null, >- >- >- >- // Constants >- >- >- /** >- * @property NODE_NAME >- * @description The name of the tag to be used for the button >- * group's element. >- * @default "DIV" >- * @final >- * @type String >- */ >- NODE_NAME: "DIV", >- >- >- /** >- * @property CLASS_NAME_PREFIX >- * @description Prefix used for all class names applied to a ButtonGroup. >- * @default "yui-" >- * @final >- * @type String >- */ >- CLASS_NAME_PREFIX: "yui-", >- >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied >- * to the button group's element. >- * @default "buttongroup" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "buttongroup", >- >- >- >- // Protected methods >- >- >- /** >- * @method _createGroupElement >- * @description Creates the button group's element. >- * @protected >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} >- */ >- _createGroupElement: function () { >- >- var oElement = document.createElement(this.NODE_NAME); >- >- return oElement; >- >- }, >- >- >- >- // Protected attribute setter methods >- >- >- /** >- * @method _setDisabled >- * @description Sets the value of the button groups's >- * "disabled" attribute. >- * @protected >- * @param {Boolean} p_bDisabled Boolean indicating the value for >- * the button group's "disabled" attribute. >- */ >- _setDisabled: function (p_bDisabled) { >- >- var nButtons = this.getCount(), >- i; >- >- if (nButtons > 0) { >- >- i = nButtons - 1; >- >- do { >- >- this._buttons[i].set("disabled", p_bDisabled); >- >- } >- while (i--); >- >- } >- >- }, >- >- >- >- // Protected event handlers >- >- >- /** >- * @method _onKeyDown >- * @description "keydown" event handler for the button group. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyDown: function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- nCharCode = Event.getCharCode(p_oEvent), >- sId = oTarget.parentNode.parentNode.id, >- oButton = m_oButtons[sId], >- nIndex = -1; >- >- >- if (nCharCode == 37 || nCharCode == 38) { >- >- nIndex = (oButton.index === 0) ? >- (this._buttons.length - 1) : (oButton.index - 1); >- >- } >- else if (nCharCode == 39 || nCharCode == 40) { >- >- nIndex = (oButton.index === (this._buttons.length - 1)) ? >- 0 : (oButton.index + 1); >- >- } >- >- >- if (nIndex > -1) { >- >- this.check(nIndex); >- this.getButton(nIndex).focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onAppendTo >- * @description "appendTo" event handler for the button group. >- * @protected >- * @param {Event} p_oEvent Object representing the event that was fired. >- */ >- _onAppendTo: function (p_oEvent) { >- >- var aButtons = this._buttons, >- nButtons = aButtons.length, >- i; >- >- for (i = 0; i < nButtons; i++) { >- >- aButtons[i].appendTo(this.get("element")); >- >- } >- >- }, >- >- >- /** >- * @method _onButtonCheckedChange >- * @description "checkedChange" event handler for each button in the >- * button group. >- * @protected >- * @param {Event} p_oEvent Object representing the event that was fired. >- * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * p_oButton Object representing the button that fired the event. >- */ >- _onButtonCheckedChange: function (p_oEvent, p_oButton) { >- >- var bChecked = p_oEvent.newValue, >- oCheckedButton = this.get("checkedButton"); >- >- if (bChecked && oCheckedButton != p_oButton) { >- >- if (oCheckedButton) { >- >- oCheckedButton.set("checked", false, true); >- >- } >- >- this.set("checkedButton", p_oButton); >- this.set("value", p_oButton.get("value")); >- >- } >- else if (oCheckedButton && !oCheckedButton.set("checked")) { >- >- oCheckedButton.set("checked", true, true); >- >- } >- >- }, >- >- >- >- // Public methods >- >- >- /** >- * @method init >- * @description The ButtonGroup class's initialization method. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><div></code> element of the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object >- * specifying the <code><div></code> element of the button group. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button group. >- * @param {Object} p_oAttributes Optional. Object literal specifying a >- * set of configuration attributes used to create the button group. >- */ >- init: function (p_oElement, p_oAttributes) { >- >- this._buttons = []; >- >- YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, >- p_oAttributes); >- >- this.addClass(this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- >- var sClass = (YAHOO.widget.Button.prototype.CLASS_NAME_PREFIX + "radio-button"), >- aButtons = this.getElementsByClassName(sClass); >- >- this.logger.log("Searching for child nodes with the class name " + >- sClass + " to add to the button group."); >- >- >- if (aButtons.length > 0) { >- >- this.logger.log("Found " + aButtons.length + >- " child nodes with the class name " + sClass + >- " Attempting to add to button group."); >- >- this.addButtons(aButtons); >- >- } >- >- >- this.logger.log("Searching for child nodes with the type of " + >- " \"radio\" to add to the button group."); >- >- function isRadioButton(p_oElement) { >- >- return (p_oElement.type == "radio"); >- >- } >- >- aButtons = >- Dom.getElementsBy(isRadioButton, "input", this.get("element")); >- >- >- if (aButtons.length > 0) { >- >- this.logger.log("Found " + aButtons.length + " child nodes" + >- " with the type of \"radio.\" Attempting to add to" + >- " button group."); >- >- this.addButtons(aButtons); >- >- } >- >- this.on("keydown", this._onKeyDown); >- this.on("appendTo", this._onAppendTo); >- >- >- var oContainer = this.get("container"); >- >- if (oContainer) { >- >- if (Lang.isString(oContainer)) { >- >- Event.onContentReady(oContainer, function () { >- >- this.appendTo(oContainer); >- >- }, null, this); >- >- } >- else { >- >- this.appendTo(oContainer); >- >- } >- >- } >- >- >- this.logger.log("Initialization completed."); >- >- }, >- >- >- /** >- * @method initAttributes >- * @description Initializes all of the configuration attributes used to >- * create the button group. >- * @param {Object} p_oAttributes Object literal specifying a set of >- * configuration attributes used to create the button group. >- */ >- initAttributes: function (p_oAttributes) { >- >- var oAttributes = p_oAttributes || {}; >- >- YAHOO.widget.ButtonGroup.superclass.initAttributes.call( >- this, oAttributes); >- >- >- /** >- * @attribute name >- * @description String specifying the name for the button group. >- * This name will be applied to each button in the button group. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("name", { >- >- value: oAttributes.name, >- validator: Lang.isString >- >- }); >- >- >- /** >- * @attribute disabled >- * @description Boolean indicating if the button group should be >- * disabled. Disabling the button group will disable each button >- * in the button group. Disabled buttons are dimmed and will not >- * respond to user input or fire events. >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("disabled", { >- >- value: (oAttributes.disabled || false), >- validator: Lang.isBoolean, >- method: this._setDisabled >- >- }); >- >- >- /** >- * @attribute value >- * @description Object specifying the value for the button group. >- * @default null >- * @type Object >- */ >- this.setAttributeConfig("value", { >- >- value: oAttributes.value >- >- }); >- >- >- /** >- * @attribute container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the button group's markup >- * should be rendered into. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("container", { >- >- value: oAttributes.container, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute checkedButton >- * @description Reference for the button in the button group that >- * is checked. >- * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * @default null >- */ >- this.setAttributeConfig("checkedButton", { >- >- value: null >- >- }); >- >- }, >- >- >- /** >- * @method addButton >- * @description Adds the button to the button group. >- * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * p_oButton Object reference for the <a href="YAHOO.widget.Button.html"> >- * YAHOO.widget.Button</a> instance to be added to the button group. >- * @param {String} p_oButton String specifying the id attribute of the >- * <code><input></code> or <code><span></code> element >- * to be used to create the button to be added to the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html# >- * ID-33759296">HTMLElement</a>} p_oButton Object reference for the >- * <code><input></code> or <code><span></code> element >- * to be used to create the button to be added to the button group. >- * @param {Object} p_oButton Object literal specifying a set of >- * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> >- * configuration attributes used to configure the button to be added to >- * the button group. >- * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- */ >- addButton: function (p_oButton) { >- >- var oButton, >- oButtonElement, >- oGroupElement, >- nIndex, >- sButtonName, >- sGroupName; >- >- >- if (p_oButton instanceof Button && >- p_oButton.get("type") == "radio") { >- >- oButton = p_oButton; >- >- } >- else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) { >- >- p_oButton.type = "radio"; >- >- oButton = new Button(p_oButton); >- >- } >- else { >- >- oButton = new Button(p_oButton, { type: "radio" }); >- >- } >- >- >- if (oButton) { >- >- nIndex = this._buttons.length; >- sButtonName = oButton.get("name"); >- sGroupName = this.get("name"); >- >- oButton.index = nIndex; >- >- this._buttons[nIndex] = oButton; >- m_oButtons[oButton.get("id")] = oButton; >- >- >- if (sButtonName != sGroupName) { >- >- oButton.set("name", sGroupName); >- >- } >- >- >- if (this.get("disabled")) { >- >- oButton.set("disabled", true); >- >- } >- >- >- if (oButton.get("checked")) { >- >- this.set("checkedButton", oButton); >- >- } >- >- >- oButtonElement = oButton.get("element"); >- oGroupElement = this.get("element"); >- >- if (oButtonElement.parentNode != oGroupElement) { >- >- oGroupElement.appendChild(oButtonElement); >- >- } >- >- >- oButton.on("checkedChange", >- this._onButtonCheckedChange, oButton, this); >- >- this.logger.log("Button " + oButton.get("id") + " added."); >- >- } >- >- return oButton; >- >- }, >- >- >- /** >- * @method addButtons >- * @description Adds the array of buttons to the button group. >- * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html"> >- * YAHOO.widget.Button</a> instances to be added >- * to the button group. >- * @param {Array} p_aButtons Array of strings specifying the id >- * attribute of the <code><input></code> or <code><span> >- * </code> elements to be used to create the buttons to be added to the >- * button group. >- * @param {Array} p_aButtons Array of object references for the >- * <code><input></code> or <code><span></code> elements >- * to be used to create the buttons to be added to the button group. >- * @param {Array} p_aButtons Array of object literals, each containing >- * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> >- * configuration attributes used to configure each button to be added >- * to the button group. >- * @return {Array} >- */ >- addButtons: function (p_aButtons) { >- >- var nButtons, >- oButton, >- aButtons, >- i; >- >- if (Lang.isArray(p_aButtons)) { >- >- nButtons = p_aButtons.length; >- aButtons = []; >- >- if (nButtons > 0) { >- >- for (i = 0; i < nButtons; i++) { >- >- oButton = this.addButton(p_aButtons[i]); >- >- if (oButton) { >- >- aButtons[aButtons.length] = oButton; >- >- } >- >- } >- >- } >- >- } >- >- return aButtons; >- >- }, >- >- >- /** >- * @method removeButton >- * @description Removes the button at the specified index from the >- * button group. >- * @param {Number} p_nIndex Number specifying the index of the button >- * to be removed from the button group. >- */ >- removeButton: function (p_nIndex) { >- >- var oButton = this.getButton(p_nIndex), >- nButtons, >- i; >- >- if (oButton) { >- >- this.logger.log("Removing button " + oButton.get("id") + "."); >- >- this._buttons.splice(p_nIndex, 1); >- delete m_oButtons[oButton.get("id")]; >- >- oButton.removeListener("checkedChange", >- this._onButtonCheckedChange); >- >- oButton.destroy(); >- >- >- nButtons = this._buttons.length; >- >- if (nButtons > 0) { >- >- i = this._buttons.length - 1; >- >- do { >- >- this._buttons[i].index = i; >- >- } >- while (i--); >- >- } >- >- this.logger.log("Button " + oButton.get("id") + " removed."); >- >- } >- >- }, >- >- >- /** >- * @method getButton >- * @description Returns the button at the specified index. >- * @param {Number} p_nIndex The index of the button to retrieve from the >- * button group. >- * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- */ >- getButton: function (p_nIndex) { >- >- return this._buttons[p_nIndex]; >- >- }, >- >- >- /** >- * @method getButtons >- * @description Returns an array of the buttons in the button group. >- * @return {Array} >- */ >- getButtons: function () { >- >- return this._buttons; >- >- }, >- >- >- /** >- * @method getCount >- * @description Returns the number of buttons in the button group. >- * @return {Number} >- */ >- getCount: function () { >- >- return this._buttons.length; >- >- }, >- >- >- /** >- * @method focus >- * @description Sets focus to the button at the specified index. >- * @param {Number} p_nIndex Number indicating the index of the button >- * to focus. >- */ >- focus: function (p_nIndex) { >- >- var oButton, >- nButtons, >- i; >- >- if (Lang.isNumber(p_nIndex)) { >- >- oButton = this._buttons[p_nIndex]; >- >- if (oButton) { >- >- oButton.focus(); >- >- } >- >- } >- else { >- >- nButtons = this.getCount(); >- >- for (i = 0; i < nButtons; i++) { >- >- oButton = this._buttons[i]; >- >- if (!oButton.get("disabled")) { >- >- oButton.focus(); >- break; >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method check >- * @description Checks the button at the specified index. >- * @param {Number} p_nIndex Number indicating the index of the button >- * to check. >- */ >- check: function (p_nIndex) { >- >- var oButton = this.getButton(p_nIndex); >- >- if (oButton) { >- >- oButton.set("checked", true); >- >- } >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the button group's element from its parent >- * element and removes all event handlers. >- */ >- destroy: function () { >- >- this.logger.log("Destroying..."); >- >- var nButtons = this._buttons.length, >- oElement = this.get("element"), >- oParentNode = oElement.parentNode, >- i; >- >- if (nButtons > 0) { >- >- i = this._buttons.length - 1; >- >- do { >- >- this._buttons[i].destroy(); >- >- } >- while (i--); >- >- } >- >- this.logger.log("Removing DOM event handlers."); >- >- Event.purgeElement(oElement); >- >- this.logger.log("Removing from document."); >- >- oParentNode.removeChild(oElement); >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the button group. >- * @return {String} >- */ >- toString: function () { >- >- return ("ButtonGroup " + this.get("id")); >- >- } >- >- }); >- >-})(); >-YAHOO.register("button", YAHOO.widget.Button, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/button-min.js b/koha-tmpl/intranet-tmpl/lib/yui/button/button-min.js >deleted file mode 100644 >index 6a81b63e6e..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/button-min.js >+++ /dev/null >@@ -1,11 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function(){var G=YAHOO.util.Dom,M=YAHOO.util.Event,I=YAHOO.lang,L=YAHOO.env.ua,B=YAHOO.widget.Overlay,J=YAHOO.widget.Menu,D={},K=null,E=null,C=null;function F(O,N,R,P){var S,Q;if(I.isString(O)&&I.isString(N)){if(L.ie){Q='<input type="'+O+'" name="'+N+'"';if(P){Q+=" checked";}Q+=">";S=document.createElement(Q);}else{S=document.createElement("input");S.name=N;S.type=O;if(P){S.checked=true;}}S.value=R;}return S;}function H(O,V){var N=O.nodeName.toUpperCase(),S=(this.CLASS_NAME_PREFIX+this.CSS_CLASS_NAME),T=this,U,P,Q;function W(X){if(!(X in V)){U=O.getAttributeNode(X);if(U&&("value" in U)){V[X]=U.value;}}}function R(){W("type");if(V.type=="button"){V.type="push";}if(!("disabled" in V)){V.disabled=O.disabled;}W("name");W("value");W("title");}switch(N){case"A":V.type="link";W("href");W("target");break;case"INPUT":R();if(!("checked" in V)){V.checked=O.checked;}break;case"BUTTON":R();P=O.parentNode.parentNode;if(G.hasClass(P,S+"-checked")){V.checked=true;}if(G.hasClass(P,S+"-disabled")){V.disabled=true;}O.removeAttribute("value");O.setAttribute("type","button");break;}O.removeAttribute("id");O.removeAttribute("name");if(!("tabindex" in V)){V.tabindex=O.tabIndex;}if(!("label" in V)){Q=N=="INPUT"?O.value:O.innerHTML;if(Q&&Q.length>0){V.label=Q;}}}function A(P){var O=P.attributes,N=O.srcelement,R=N.nodeName.toUpperCase(),Q=this;if(R==this.NODE_NAME){P.element=N;P.id=N.id;G.getElementsBy(function(S){switch(S.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":H.call(Q,S,O);break;}},"*",N);}else{switch(R){case"BUTTON":case"A":case"INPUT":H.call(this,N,O);break;}}}YAHOO.widget.Button=function(R,O){if(!B&&YAHOO.widget.Overlay){B=YAHOO.widget.Overlay;}if(!J&&YAHOO.widget.Menu){J=YAHOO.widget.Menu;}var Q=YAHOO.widget.Button.superclass.constructor,P,N;if(arguments.length==1&&!I.isString(R)&&!R.nodeName){if(!R.id){R.id=G.generateId();}Q.call(this,(this.createButtonElement(R.type)),R);}else{P={element:null,attributes:(O||{})};if(I.isString(R)){N=G.get(R);if(N){if(!P.attributes.id){P.attributes.id=R;}P.attributes.srcelement=N;A.call(this,P);if(!P.element){P.element=this.createButtonElement(P.attributes.type);}Q.call(this,P.element,P.attributes);}}else{if(R.nodeName){if(!P.attributes.id){if(R.id){P.attributes.id=R.id;}else{P.attributes.id=G.generateId();}}P.attributes.srcelement=R;A.call(this,P);if(!P.element){P.element=this.createButtonElement(P.attributes.type);}Q.call(this,P.element,P.attributes);}}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,_nOptionRegionX:0,CLASS_NAME_PREFIX:"yui-",NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"button",_setType:function(N){if(N=="split"){this.on("option",this._onOption);}},_setLabel:function(O){this._button.innerHTML=O;var P,N=L.gecko;if(N&&N<1.9&&G.inDocument(this.get("element"))){P=(this.CLASS_NAME_PREFIX+this.CSS_CLASS_NAME);this.removeClass(P);I.later(0,this,this.addClass,P);}},_setTabIndex:function(N){this._button.tabIndex=N;},_setTitle:function(N){if(this.get("type")!="link"){this._button.title=N;}},_setDisabled:function(N){if(this.get("type")!="link"){if(N){if(this._menu){this._menu.hide();}if(this.hasFocus()){this.blur();}this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");this.removeStateCSSClasses("hover");this.removeStateCSSClasses("active");this.removeStateCSSClasses("focus");}else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(N){if(this.get("type")=="link"){this._button.href=N;}},_setTarget:function(N){if(this.get("type")=="link"){this._button.setAttribute("target",N);}},_setChecked:function(N){var O=this.get("type");if(O=="checkbox"||O=="radio"){if(N){this.addStateCSSClasses("checked");}else{this.removeStateCSSClasses("checked");}}},_setMenu:function(U){var P=this.get("lazyloadmenu"),R=this.get("element"),N,W=false,X,O,Q;function V(){X.render(R.parentNode);this.removeListener("appendTo",V);}function T(){X.cfg.queueProperty("container",R.parentNode);this.removeListener("appendTo",T);}function S(){var Y;if(X){G.addClass(X.element,this.get("menuclassname"));G.addClass(X.element,this.CLASS_NAME_PREFIX+this.get("type")+"-button-menu");X.showEvent.subscribe(this._onMenuShow,null,this);X.hideEvent.subscribe(this._onMenuHide,null,this);X.renderEvent.subscribe(this._onMenuRender,null,this);if(J&&X instanceof J){if(P){Y=this.get("container");if(Y){X.cfg.queueProperty("container",Y);}else{this.on("appendTo",T);}}X.cfg.queueProperty("clicktohide",false);X.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);X.subscribe("click",this._onMenuClick,this,true);this.on("selectedMenuItemChange",this._onSelectedMenuItemChange);Q=X.srcElement;if(Q&&Q.nodeName.toUpperCase()=="SELECT"){Q.style.display="none";Q.parentNode.removeChild(Q);}}else{if(B&&X instanceof B){if(!K){K=new YAHOO.widget.OverlayManager();}K.register(X);}}this._menu=X;if(!W&&!P){if(G.inDocument(R)){X.render(R.parentNode);}else{this.on("appendTo",V);}}}}if(B){if(J){N=J.prototype.CSS_CLASS_NAME;}if(U&&J&&(U instanceof J)){X=U;W=true;S.call(this);}else{if(B&&U&&(U instanceof B)){X=U;W=true;X.cfg.queueProperty("visible",false);S.call(this);}else{if(J&&I.isArray(U)){X=new J(G.generateId(),{lazyload:P,itemdata:U});this._menu=X;this.on("appendTo",S);}else{if(I.isString(U)){O=G.get(U);if(O){if(J&&G.hasClass(O,N)||O.nodeName.toUpperCase()=="SELECT"){X=new J(U,{lazyload:P});S.call(this);}else{if(B){X=new B(U,{visible:false});S.call(this);}}}}else{if(U&&U.nodeName){if(J&&G.hasClass(U,N)||U.nodeName.toUpperCase()=="SELECT"){X=new J(U,{lazyload:P});S.call(this);}else{if(B){if(!U.id){G.generateId(U);}X=new B(U,{visible:false});S.call(this);}}}}}}}}},_setOnClick:function(N){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=N)){this.removeListener("click",this._onclickAttributeValue.fn); >-this._onclickAttributeValue=null;}if(!this._onclickAttributeValue&&I.isObject(N)&&I.isFunction(N.fn)){this.on("click",N.fn,N.obj,N.scope);this._onclickAttributeValue=N;}},_isActivationKey:function(N){var S=this.get("type"),O=(S=="checkbox"||S=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,Q=O.length,R=false,P;if(Q>0){P=Q-1;do{if(N==O[P]){R=true;break;}}while(P--);}return R;},_isSplitButtonOptionKey:function(P){var O=(M.getCharCode(P)==40);var N=function(Q){M.preventDefault(Q);this.removeListener("keypress",N);};if(O){if(L.opera){this.on("keypress",N);}M.preventDefault(P);}return O;},_addListenersToForm:function(){var T=this.getForm(),S=YAHOO.widget.Button.onFormKeyPress,R,N,Q,P,O;if(T){M.on(T,"reset",this._onFormReset,null,this);M.on(T,"submit",this._onFormSubmit,null,this);N=this.get("srcelement");if(this.get("type")=="submit"||(N&&N.type=="submit")){Q=M.getListeners(T,"keypress");R=false;if(Q){P=Q.length;if(P>0){O=P-1;do{if(Q[O].fn==S){R=true;break;}}while(O--);}}if(!R){M.on(T,"keypress",S);}}}},_showMenu:function(R){if(YAHOO.widget.MenuManager){YAHOO.widget.MenuManager.hideVisible();}if(K){K.hideAll();}var N=this._menu,Q=this.get("menualignment"),P=this.get("focusmenu"),O;if(this._renderedMenu){N.cfg.setProperty("context",[this.get("element"),Q[0],Q[1]]);N.cfg.setProperty("preventcontextoverlap",true);N.cfg.setProperty("constraintoviewport",true);}else{N.cfg.queueProperty("context",[this.get("element"),Q[0],Q[1]]);N.cfg.queueProperty("preventcontextoverlap",true);N.cfg.queueProperty("constraintoviewport",true);}this.focus();if(J&&N&&(N instanceof J)){O=N.focus;N.focus=function(){};if(this._renderedMenu){N.cfg.setProperty("minscrollheight",this.get("menuminscrollheight"));N.cfg.setProperty("maxheight",this.get("menumaxheight"));}else{N.cfg.queueProperty("minscrollheight",this.get("menuminscrollheight"));N.cfg.queueProperty("maxheight",this.get("menumaxheight"));}N.show();N.focus=O;N.align();if(R.type=="mousedown"){M.stopPropagation(R);}if(P){N.focus();}}else{if(B&&N&&(N instanceof B)){if(!this._renderedMenu){N.render(this.get("element").parentNode);}N.show();N.align();}}},_hideMenu:function(){var N=this._menu;if(N){N.hide();}},_onMouseOver:function(O){var Q=this.get("type"),N,P;if(Q==="split"){N=this.get("element");P=(G.getX(N)+(N.offsetWidth-this.OPTION_AREA_WIDTH));this._nOptionRegionX=P;}if(!this._hasMouseEventHandlers){if(Q==="split"){this.on("mousemove",this._onMouseMove);}this.on("mouseout",this._onMouseOut);this._hasMouseEventHandlers=true;}this.addStateCSSClasses("hover");if(Q==="split"&&(M.getPageX(O)>P)){this.addStateCSSClasses("hoveroption");}if(this._activationButtonPressed){this.addStateCSSClasses("active");}if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}if(this._activationButtonPressed||this._bOptionPressed){M.removeListener(document,"mouseup",this._onDocumentMouseUp);}},_onMouseMove:function(N){var O=this._nOptionRegionX;if(O){if(M.getPageX(N)>O){this.addStateCSSClasses("hoveroption");}else{this.removeStateCSSClasses("hoveroption");}}},_onMouseOut:function(N){var O=this.get("type");this.removeStateCSSClasses("hover");if(O!="menu"){this.removeStateCSSClasses("active");}if(this._activationButtonPressed||this._bOptionPressed){M.on(document,"mouseup",this._onDocumentMouseUp,null,this);}if(O==="split"&&(M.getPageX(N)>this._nOptionRegionX)){this.removeStateCSSClasses("hoveroption");}},_onDocumentMouseUp:function(P){this._activationButtonPressed=false;this._bOptionPressed=false;var Q=this.get("type"),N,O;if(Q=="menu"||Q=="split"){N=M.getTarget(P);O=this._menu.element;if(N!=O&&!G.isAncestor(O,N)){this.removeStateCSSClasses((Q=="menu"?"active":"activeoption"));this._hideMenu();}}M.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(P){var Q,O=true;function N(){this._hideMenu();this.removeListener("mouseup",N);}if((P.which||P.button)==1){if(!this.hasFocus()){this.focus();}Q=this.get("type");if(Q=="split"){if(M.getPageX(P)>this._nOptionRegionX){this.fireEvent("option",P);O=false;}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}else{if(Q=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}else{this._showMenu(P);this._activationButtonPressed=true;}}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}if(Q=="split"||Q=="menu"){this._hideMenuTimer=I.later(250,this,this.on,["mouseup",N]);}}return O;},_onMouseUp:function(P){var Q=this.get("type"),N=this._hideMenuTimer,O=true;if(N){N.cancel();}if(Q=="checkbox"||Q=="radio"){this.set("checked",!(this.get("checked")));}this._activationButtonPressed=false;if(Q!="menu"){this.removeStateCSSClasses("active");}if(Q=="split"&&M.getPageX(P)>this._nOptionRegionX){O=false;}return O;},_onFocus:function(O){var N;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}C=this;if(!this._hasKeyEventHandlers){N=this._button;M.on(N,"blur",this._onBlur,null,this);M.on(N,"keydown",this._onKeyDown,null,this);M.on(N,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}this.fireEvent("focus",O);},_onBlur:function(N){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationKeyPressed){M.on(document,"keyup",this._onDocumentKeyUp,null,this);}C=null;this.fireEvent("blur",N);},_onDocumentKeyUp:function(N){if(this._isActivationKey(M.getCharCode(N))){this._activationKeyPressed=false;M.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(O){var N=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(O)){this.fireEvent("option",O);}else{if(this._isActivationKey(M.getCharCode(O))){if(this.get("type")=="menu"){this._showMenu(O);}else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}}if(N&&N.cfg.getProperty("visible")&&M.getCharCode(O)==27){N.hide();this.focus();}},_onKeyUp:function(N){var O;if(this._isActivationKey(M.getCharCode(N))){O=this.get("type");if(O=="checkbox"||O=="radio"){this.set("checked",!(this.get("checked"))); >-}this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(P){var R=this.get("type"),Q,N,O;switch(R){case"submit":if(P.returnValue!==false){this.submitForm();}break;case"reset":Q=this.getForm();if(Q){Q.reset();}break;case"split":if(this._nOptionRegionX>0&&(M.getPageX(P)>this._nOptionRegionX)){O=false;}else{this._hideMenu();N=this.get("srcelement");if(N&&N.type=="submit"&&P.returnValue!==false){this.submitForm();}}break;}return O;},_onDblClick:function(O){var N=true;if(this.get("type")=="split"&&M.getPageX(O)>this._nOptionRegionX){N=false;}return N;},_onAppendTo:function(N){I.later(0,this,this._addListenersToForm);},_onFormReset:function(O){var P=this.get("type"),N=this._menu;if(P=="checkbox"||P=="radio"){this.resetValue("checked");}if(J&&N&&(N instanceof J)){this.resetValue("selectedMenuItem");}},_onFormSubmit:function(N){this.createHiddenFields();},_onDocumentMouseDown:function(Q){var N=M.getTarget(Q),P=this.get("element"),O=this._menu.element;if(N!=P&&!G.isAncestor(P,N)&&N!=O&&!G.isAncestor(O,N)){this._hideMenu();if(L.ie&&N.focus){N.setActive();}M.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(N){if(this.hasClass(this.CLASS_NAME_PREFIX+"split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}else{this._showMenu(N);this._bOptionPressed=true;}},_onMenuShow:function(N){M.on(document,"mousedown",this._onDocumentMouseDown,null,this);var O=(this.get("type")=="split")?"activeoption":"active";this.addStateCSSClasses(O);},_onMenuHide:function(N){var O=(this.get("type")=="split")?"activeoption":"active";this.removeStateCSSClasses(O);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(P,O){var N=O[0];if(M.getCharCode(N)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(P){var S=this.get("element"),O=S.parentNode,N=this._menu,R=N.element,Q=N.srcElement,T;if(O!=R.parentNode){O.appendChild(R);}this._renderedMenu=true;if(Q&&Q.nodeName.toLowerCase()==="select"&&Q.value){T=N.getItem(Q.selectedIndex);this.set("selectedMenuItem",T,true);this._onSelectedMenuItemChange({newValue:T});}},_onMenuClick:function(O,N){var Q=N[1],P;if(Q){this.set("selectedMenuItem",Q);P=this.get("srcelement");if(P&&P.type=="submit"){this.submitForm();}this._hideMenu();}},_onSelectedMenuItemChange:function(O){var P=O.prevValue,Q=O.newValue,N=this.CLASS_NAME_PREFIX;if(P){G.removeClass(P.element,(N+"button-selectedmenuitem"));}if(Q){G.addClass(Q.element,(N+"button-selectedmenuitem"));}},_onLabelClick:function(N){this.focus();var O=this.get("type");if(O=="radio"||O=="checkbox"){this.set("checked",(!this.get("checked")));}},createButtonElement:function(N){var P=this.NODE_NAME,O=document.createElement(P);O.innerHTML="<"+P+' class="first-child">'+(N=="link"?"<a></a>":'<button type="button"></button>')+"</"+P+">";return O;},addStateCSSClasses:function(O){var P=this.get("type"),N=this.CLASS_NAME_PREFIX;if(I.isString(O)){if(O!="activeoption"&&O!="hoveroption"){this.addClass(N+this.CSS_CLASS_NAME+("-"+O));}this.addClass(N+P+("-button-"+O));}},removeStateCSSClasses:function(O){var P=this.get("type"),N=this.CLASS_NAME_PREFIX;if(I.isString(O)){this.removeClass(N+this.CSS_CLASS_NAME+("-"+O));this.removeClass(N+P+("-button-"+O));}},createHiddenFields:function(){this.removeHiddenFields();var V=this.getForm(),Z,O,S,X,Y,T,U,N,R,W,P,Q=false;if(V&&!this.get("disabled")){O=this.get("type");S=(O=="checkbox"||O=="radio");if((S&&this.get("checked"))||(E==this)){Z=F((S?O:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(Z){if(S){Z.style.display="none";}V.appendChild(Z);}}X=this._menu;if(J&&X&&(X instanceof J)){Y=this.get("selectedMenuItem");P=X.srcElement;Q=(P&&P.nodeName.toUpperCase()=="SELECT");if(Y){U=(Y.value===null||Y.value==="")?Y.cfg.getProperty("text"):Y.value;T=this.get("name");if(Q){W=P.name;}else{if(T){W=(T+"_options");}}if(U&&W){N=F("hidden",W,U);V.appendChild(N);}}else{if(Q){N=V.appendChild(P);}}}if(Z&&N){this._hiddenFields=[Z,N];}else{if(!Z&&N){this._hiddenFields=N;}else{if(Z&&!N){this._hiddenFields=Z;}}}R=this._hiddenFields;}return R;},removeHiddenFields:function(){var Q=this._hiddenFields,O,P;function N(R){if(G.inDocument(R)){R.parentNode.removeChild(R);}}if(Q){if(I.isArray(Q)){O=Q.length;if(O>0){P=O-1;do{N(Q[P]);}while(P--);}}else{N(Q);}this._hiddenFields=null;}},submitForm:function(){var Q=this.getForm(),P=this.get("srcelement"),O=false,N;if(Q){if(this.get("type")=="submit"||(P&&P.type=="submit")){E=this;}if(L.ie){O=Q.fireEvent("onsubmit");}else{N=document.createEvent("HTMLEvents");N.initEvent("submit",true,true);O=Q.dispatchEvent(N);}if((L.ie||L.webkit)&&O){Q.submit();}}return O;},init:function(P,d){var V=d.type=="link"?"a":"button",a=d.srcelement,S=P.getElementsByTagName(V)[0],U;if(!S){U=P.getElementsByTagName("input")[0];if(U){S=document.createElement("button");S.setAttribute("type","button");U.parentNode.replaceChild(S,U);}}this._button=S;YAHOO.widget.Button.superclass.init.call(this,P,d);var T=this.get("id"),Z=T+"-button";S.id=Z;var X,Q;var e=function(f){return(f.htmlFor===T);};var c=function(){Q.setAttribute((L.ie?"htmlFor":"for"),Z);};if(a&&this.get("type")!="link"){X=G.getElementsBy(e,"label");if(I.isArray(X)&&X.length>0){Q=X[0];}}D[T]=this;var b=this.CLASS_NAME_PREFIX;this.addClass(b+this.CSS_CLASS_NAME);this.addClass(b+this.get("type")+"-button");M.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this.on("click",this._onClick);var R=this.get("onclick");this.set("onclick",null);this.set("onclick",R);this.on("dblclick",this._onDblClick);var O;if(Q){if(this.get("replaceLabel")){this.set("label",Q.innerHTML);O=Q.parentNode;O.removeChild(Q);}else{this.on("appendTo",c);M.on(Q,"click",this._onLabelClick,null,this);this._label=Q;}}this.on("appendTo",this._onAppendTo);var N=this.get("container"),Y=this.get("element"),W=G.inDocument(Y); >-if(N){if(a&&a!=Y){O=a.parentNode;if(O){O.removeChild(a);}}if(I.isString(N)){M.onContentReady(N,this.appendTo,N,this);}else{this.on("init",function(){I.later(0,this,this.appendTo,N);});}}else{if(!W&&a&&a!=Y){O=a.parentNode;if(O){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:O});O.replaceChild(Y,a);this.fireEvent("appendTo",{type:"appendTo",target:O});}}else{if(this.get("type")!="link"&&W&&a&&a==Y){this._addListenersToForm();}}}this.fireEvent("init",{type:"init",target:this});},initAttributes:function(O){var N=O||{};YAHOO.widget.Button.superclass.initAttributes.call(this,N);this.setAttributeConfig("type",{value:(N.type||"push"),validator:I.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:N.label,validator:I.isString,method:this._setLabel});this.setAttributeConfig("value",{value:N.value});this.setAttributeConfig("name",{value:N.name,validator:I.isString});this.setAttributeConfig("tabindex",{value:N.tabindex,validator:I.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:N.title,validator:I.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(N.disabled||false),validator:I.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:N.href,validator:I.isString,method:this._setHref});this.setAttributeConfig("target",{value:N.target,validator:I.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(N.checked||false),validator:I.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:N.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:N.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(N.lazyloadmenu===false?false:true),validator:I.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(N.menuclassname||(this.CLASS_NAME_PREFIX+"button-menu")),validator:I.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("menuminscrollheight",{value:(N.menuminscrollheight||90),validator:I.isNumber});this.setAttributeConfig("menumaxheight",{value:(N.menumaxheight||0),validator:I.isNumber});this.setAttributeConfig("menualignment",{value:(N.menualignment||["tl","bl"]),validator:I.isArray});this.setAttributeConfig("selectedMenuItem",{value:null});this.setAttributeConfig("onclick",{value:N.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(N.focusmenu===false?false:true),validator:I.isBoolean});this.setAttributeConfig("replaceLabel",{value:false,validator:I.isBoolean,writeOnce:true});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(C==this);},isActive:function(){return this.hasClass(this.CLASS_NAME_PREFIX+this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){var N=this._button,O;if(N){O=N.form;}return O;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var P=this.get("element"),N=this._menu,T=this._label,O,S;if(N){if(K&&K.find(N)){K.remove(N);}N.destroy();}M.purgeElement(P);M.purgeElement(this._button);M.removeListener(document,"mouseup",this._onDocumentMouseUp);M.removeListener(document,"keyup",this._onDocumentKeyUp);M.removeListener(document,"mousedown",this._onDocumentMouseDown);if(T){M.removeListener(T,"click",this._onLabelClick);O=T.parentNode;O.removeChild(T);}var Q=this.getForm();if(Q){M.removeListener(Q,"reset",this._onFormReset);M.removeListener(Q,"submit",this._onFormSubmit);}this.unsubscribeAll();O=P.parentNode;if(O){O.removeChild(P);}delete D[this.get("id")];var R=(this.CLASS_NAME_PREFIX+this.CSS_CLASS_NAME);S=G.getElementsByClassName(R,this.NODE_NAME,Q);if(I.isArray(S)&&S.length===0){M.removeListener(Q,"keypress",YAHOO.widget.Button.onFormKeyPress);}},fireEvent:function(O,N){var P=arguments[0];if(this.DOM_EVENTS[P]&&this.get("disabled")){return false;}return YAHOO.widget.Button.superclass.fireEvent.apply(this,arguments);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(R){var P=M.getTarget(R),S=M.getCharCode(R),Q=P.nodeName&&P.nodeName.toUpperCase(),N=P.type,T=false,V,X,O,W;function U(a){var Z,Y;switch(a.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(a.type=="submit"&&!a.disabled){if(!T&&!O){O=a;}}break;default:Z=a.id;if(Z){V=D[Z];if(V){T=true;if(!V.get("disabled")){Y=V.get("srcelement");if(!X&&(V.get("type")=="submit"||(Y&&Y.type=="submit"))){X=V;}}}}break;}}if(S==13&&((Q=="INPUT"&&(N=="text"||N=="password"||N=="checkbox"||N=="radio"||N=="file"))||Q=="SELECT")){G.getElementsBy(U,"*",this);if(O){O.focus();}else{if(!O&&X){M.preventDefault(R);if(L.ie){X.get("element").fireEvent("onclick");}else{W=document.createEvent("HTMLEvents");W.initEvent("click",true,true);if(L.gecko<1.9){X.fireEvent("click",W);}else{X.get("element").dispatchEvent(W);}}}}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(N){var R=YAHOO.widget.Button.prototype,T=G.getElementsByClassName((R.CLASS_NAME_PREFIX+R.CSS_CLASS_NAME),"*",N),Q=T.length,S,O,P;if(Q>0){for(P=0;P<Q;P++){O=T[P].id;if(O){S=D[O];if(S){S.createHiddenFields();}}}}};YAHOO.widget.Button.getButton=function(N){return D[N];};})();(function(){var C=YAHOO.util.Dom,B=YAHOO.util.Event,D=YAHOO.lang,A=YAHOO.widget.Button,E={};YAHOO.widget.ButtonGroup=function(J,H){var I=YAHOO.widget.ButtonGroup.superclass.constructor,K,G,F;if(arguments.length==1&&!D.isString(J)&&!J.nodeName){if(!J.id){F=C.generateId();J.id=F;}I.call(this,(this._createGroupElement()),J);}else{if(D.isString(J)){G=C.get(J);if(G){if(G.nodeName.toUpperCase()==this.NODE_NAME){I.call(this,G,H);}}}else{K=J.nodeName.toUpperCase();if(K&&K==this.NODE_NAME){if(!J.id){J.id=C.generateId();}I.call(this,J,H);}}}};YAHOO.extend(YAHOO.widget.ButtonGroup,YAHOO.util.Element,{_buttons:null,NODE_NAME:"DIV",CLASS_NAME_PREFIX:"yui-",CSS_CLASS_NAME:"buttongroup",_createGroupElement:function(){var F=document.createElement(this.NODE_NAME); >-return F;},_setDisabled:function(G){var H=this.getCount(),F;if(H>0){F=H-1;do{this._buttons[F].set("disabled",G);}while(F--);}},_onKeyDown:function(K){var G=B.getTarget(K),I=B.getCharCode(K),H=G.parentNode.parentNode.id,J=E[H],F=-1;if(I==37||I==38){F=(J.index===0)?(this._buttons.length-1):(J.index-1);}else{if(I==39||I==40){F=(J.index===(this._buttons.length-1))?0:(J.index+1);}}if(F>-1){this.check(F);this.getButton(F).focus();}},_onAppendTo:function(H){var I=this._buttons,G=I.length,F;for(F=0;F<G;F++){I[F].appendTo(this.get("element"));}},_onButtonCheckedChange:function(G,F){var I=G.newValue,H=this.get("checkedButton");if(I&&H!=F){if(H){H.set("checked",false,true);}this.set("checkedButton",F);this.set("value",F.get("value"));}else{if(H&&!H.set("checked")){H.set("checked",true,true);}}},init:function(I,H){this._buttons=[];YAHOO.widget.ButtonGroup.superclass.init.call(this,I,H);this.addClass(this.CLASS_NAME_PREFIX+this.CSS_CLASS_NAME);var K=(YAHOO.widget.Button.prototype.CLASS_NAME_PREFIX+"radio-button"),J=this.getElementsByClassName(K);if(J.length>0){this.addButtons(J);}function F(L){return(L.type=="radio");}J=C.getElementsBy(F,"input",this.get("element"));if(J.length>0){this.addButtons(J);}this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var G=this.get("container");if(G){if(D.isString(G)){B.onContentReady(G,function(){this.appendTo(G);},null,this);}else{this.appendTo(G);}}},initAttributes:function(G){var F=G||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,F);this.setAttributeConfig("name",{value:F.name,validator:D.isString});this.setAttributeConfig("disabled",{value:(F.disabled||false),validator:D.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:F.value});this.setAttributeConfig("container",{value:F.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(J){var L,K,G,F,H,I;if(J instanceof A&&J.get("type")=="radio"){L=J;}else{if(!D.isString(J)&&!J.nodeName){J.type="radio";L=new A(J);}else{L=new A(J,{type:"radio"});}}if(L){F=this._buttons.length;H=L.get("name");I=this.get("name");L.index=F;this._buttons[F]=L;E[L.get("id")]=L;if(H!=I){L.set("name",I);}if(this.get("disabled")){L.set("disabled",true);}if(L.get("checked")){this.set("checkedButton",L);}K=L.get("element");G=this.get("element");if(K.parentNode!=G){G.appendChild(K);}L.on("checkedChange",this._onButtonCheckedChange,L,this);}return L;},addButtons:function(G){var H,I,J,F;if(D.isArray(G)){H=G.length;J=[];if(H>0){for(F=0;F<H;F++){I=this.addButton(G[F]);if(I){J[J.length]=I;}}}}return J;},removeButton:function(H){var I=this.getButton(H),G,F;if(I){this._buttons.splice(H,1);delete E[I.get("id")];I.removeListener("checkedChange",this._onButtonCheckedChange);I.destroy();G=this._buttons.length;if(G>0){F=this._buttons.length-1;do{this._buttons[F].index=F;}while(F--);}}},getButton:function(F){return this._buttons[F];},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(H){var I,G,F;if(D.isNumber(H)){I=this._buttons[H];if(I){I.focus();}}else{G=this.getCount();for(F=0;F<G;F++){I=this._buttons[F];if(!I.get("disabled")){I.focus();break;}}}},check:function(F){var G=this.getButton(F);if(G){G.set("checked",true);}},destroy:function(){var I=this._buttons.length,H=this.get("element"),F=H.parentNode,G;if(I>0){G=this._buttons.length-1;do{this._buttons[G].destroy();}while(G--);}B.purgeElement(H);F.removeChild(H);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/button/button.js b/koha-tmpl/intranet-tmpl/lib/yui/button/button.js >deleted file mode 100644 >index b57c819e43..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/button/button.js >+++ /dev/null >@@ -1,4633 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-/** >-* @module button >-* @description <p>The Button Control enables the creation of rich, graphical >-* buttons that function like traditional HTML form buttons. <em>Unlike</em> >-* traditional HTML form buttons, buttons created with the Button Control can have >-* a label that is different from its value. With the inclusion of the optional >-* <a href="module_menu.html">Menu Control</a>, the Button Control can also be >-* used to create menu buttons and split buttons, controls that are not >-* available natively in HTML. The Button Control can also be thought of as a >-* way to create more visually engaging implementations of the browser's >-* default radio-button and check-box controls.</p> >-* <p>The Button Control supports the following types:</p> >-* <dl> >-* <dt>push</dt> >-* <dd>Basic push button that can execute a user-specified command when >-* pressed.</dd> >-* <dt>link</dt> >-* <dd>Navigates to a specified url when pressed.</dd> >-* <dt>submit</dt> >-* <dd>Submits the parent form when pressed.</dd> >-* <dt>reset</dt> >-* <dd>Resets the parent form when pressed.</dd> >-* <dt>checkbox</dt> >-* <dd>Maintains a "checked" state that can be toggled on and off.</dd> >-* <dt>radio</dt> >-* <dd>Maintains a "checked" state that can be toggled on and off. Use with >-* the ButtonGroup class to create a set of controls that are mutually >-* exclusive; checking one button in the set will uncheck all others in >-* the group.</dd> >-* <dt>menu</dt> >-* <dd>When pressed will show/hide a menu.</dd> >-* <dt>split</dt> >-* <dd>Can execute a user-specified command or display a menu when pressed.</dd> >-* </dl> >-* @title Button >-* @namespace YAHOO.widget >-* @requires yahoo, dom, element, event >-* @optional container, menu >-*/ >- >- >-(function () { >- >- >- /** >- * The Button class creates a rich, graphical button. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to >- * be used to create the button. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org >- * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697"> >- * HTMLButtonElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html# >- * ID-33759296">HTMLElement</a>} p_oElement Object reference for the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to be >- * used to create the button. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button. >- * @param {Object} p_oAttributes Optional. Object literal specifying a set >- * of configuration attributes used to create the button. >- * @namespace YAHOO.widget >- * @class Button >- * @constructor >- * @extends YAHOO.util.Element >- */ >- >- >- >- // Shorthard for utilities >- >- var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- UA = YAHOO.env.ua, >- Overlay = YAHOO.widget.Overlay, >- Menu = YAHOO.widget.Menu, >- >- >- // Private member variables >- >- m_oButtons = {}, // Collection of all Button instances >- m_oOverlayManager = null, // YAHOO.widget.OverlayManager instance >- m_oSubmitTrigger = null, // The button that submitted the form >- m_oFocusedButton = null; // The button that has focus >- >- >- >- // Private methods >- >- >- >- /** >- * @method createInputElement >- * @description Creates an <code><input></code> element of the >- * specified type. >- * @private >- * @param {String} p_sType String specifying the type of >- * <code><input></code> element to create. >- * @param {String} p_sName String specifying the name of >- * <code><input></code> element to create. >- * @param {String} p_sValue String specifying the value of >- * <code><input></code> element to create. >- * @param {String} p_bChecked Boolean specifying if the >- * <code><input></code> element is to be checked. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>} >- */ >- function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) { >- >- var oInput, >- sInput; >- >- if (Lang.isString(p_sType) && Lang.isString(p_sName)) { >- >- if (UA.ie) { >- >- /* >- For IE it is necessary to create the element with the >- "type," "name," "value," and "checked" properties set all >- at once. >- */ >- >- sInput = "<input type=\"" + p_sType + "\" name=\"" + >- p_sName + "\""; >- >- if (p_bChecked) { >- >- sInput += " checked"; >- >- } >- >- sInput += ">"; >- >- oInput = document.createElement(sInput); >- >- } >- else { >- >- oInput = document.createElement("input"); >- oInput.name = p_sName; >- oInput.type = p_sType; >- >- if (p_bChecked) { >- >- oInput.checked = true; >- >- } >- >- } >- >- oInput.value = p_sValue; >- >- } >- >- return oInput; >- >- } >- >- >- /** >- * @method setAttributesFromSrcElement >- * @description Gets the values for all the attributes of the source element >- * (either <code><input></code> or <code><a></code>) that >- * map to Button configuration attributes and sets them into a collection >- * that is passed to the Button constructor. >- * @private >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/ >- * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID- >- * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML >- * element (either <code><input></code> or <code><span> >- * </code>) used to create the button. >- * @param {Object} p_oAttributes Object reference for the collection of >- * configuration attributes used to create the button. >- */ >- function setAttributesFromSrcElement(p_oElement, p_oAttributes) { >- >- var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(), >- sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME), >- me = this, >- oAttribute, >- oRootNode, >- sText; >- >- >- /** >- * @method setAttributeFromDOMAttribute >- * @description Gets the value of the specified DOM attribute and sets it >- * into the collection of configuration attributes used to configure >- * the button. >- * @private >- * @param {String} p_sAttribute String representing the name of the >- * attribute to retrieve from the DOM element. >- */ >- function setAttributeFromDOMAttribute(p_sAttribute) { >- >- if (!(p_sAttribute in p_oAttributes)) { >- >- /* >- Need to use "getAttributeNode" instead of "getAttribute" >- because using "getAttribute," IE will return the innerText >- of a <code><button></code> for the value attribute >- rather than the value of the "value" attribute. >- */ >- >- oAttribute = p_oElement.getAttributeNode(p_sAttribute); >- >- >- if (oAttribute && ("value" in oAttribute)) { >- >- >- p_oAttributes[p_sAttribute] = oAttribute.value; >- >- } >- >- } >- >- } >- >- >- /** >- * @method setFormElementProperties >- * @description Gets the value of the attributes from the form element >- * and sets them into the collection of configuration attributes used to >- * configure the button. >- * @private >- */ >- function setFormElementProperties() { >- >- setAttributeFromDOMAttribute("type"); >- >- if (p_oAttributes.type == "button") { >- >- p_oAttributes.type = "push"; >- >- } >- >- if (!("disabled" in p_oAttributes)) { >- >- p_oAttributes.disabled = p_oElement.disabled; >- >- } >- >- setAttributeFromDOMAttribute("name"); >- setAttributeFromDOMAttribute("value"); >- setAttributeFromDOMAttribute("title"); >- >- } >- >- >- switch (sSrcElementNodeName) { >- >- case "A": >- >- p_oAttributes.type = "link"; >- >- setAttributeFromDOMAttribute("href"); >- setAttributeFromDOMAttribute("target"); >- >- break; >- >- case "INPUT": >- >- setFormElementProperties(); >- >- if (!("checked" in p_oAttributes)) { >- >- p_oAttributes.checked = p_oElement.checked; >- >- } >- >- break; >- >- case "BUTTON": >- >- setFormElementProperties(); >- >- oRootNode = p_oElement.parentNode.parentNode; >- >- if (Dom.hasClass(oRootNode, sClass + "-checked")) { >- >- p_oAttributes.checked = true; >- >- } >- >- if (Dom.hasClass(oRootNode, sClass + "-disabled")) { >- >- p_oAttributes.disabled = true; >- >- } >- >- p_oElement.removeAttribute("value"); >- >- p_oElement.setAttribute("type", "button"); >- >- break; >- >- } >- >- p_oElement.removeAttribute("id"); >- p_oElement.removeAttribute("name"); >- >- if (!("tabindex" in p_oAttributes)) { >- >- p_oAttributes.tabindex = p_oElement.tabIndex; >- >- } >- >- if (!("label" in p_oAttributes)) { >- >- // Set the "label" property >- >- sText = sSrcElementNodeName == "INPUT" ? >- p_oElement.value : p_oElement.innerHTML; >- >- >- if (sText && sText.length > 0) { >- >- p_oAttributes.label = sText; >- >- } >- >- } >- >- } >- >- >- /** >- * @method initConfig >- * @description Initializes the set of configuration attributes that are >- * used to instantiate the button. >- * @private >- * @param {Object} Object representing the button's set of >- * configuration attributes. >- */ >- function initConfig(p_oConfig) { >- >- var oAttributes = p_oConfig.attributes, >- oSrcElement = oAttributes.srcelement, >- sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(), >- me = this; >- >- >- if (sSrcElementNodeName == this.NODE_NAME) { >- >- p_oConfig.element = oSrcElement; >- p_oConfig.id = oSrcElement.id; >- >- Dom.getElementsBy(function (p_oElement) { >- >- switch (p_oElement.nodeName.toUpperCase()) { >- >- case "BUTTON": >- case "A": >- case "INPUT": >- >- setAttributesFromSrcElement.call(me, p_oElement, >- oAttributes); >- >- break; >- >- } >- >- }, "*", oSrcElement); >- >- } >- else { >- >- switch (sSrcElementNodeName) { >- >- case "BUTTON": >- case "A": >- case "INPUT": >- >- setAttributesFromSrcElement.call(this, oSrcElement, >- oAttributes); >- >- break; >- >- } >- >- } >- >- } >- >- >- >- // Constructor >- >- YAHOO.widget.Button = function (p_oElement, p_oAttributes) { >- >- if (!Overlay && YAHOO.widget.Overlay) { >- >- Overlay = YAHOO.widget.Overlay; >- >- } >- >- >- if (!Menu && YAHOO.widget.Menu) { >- >- Menu = YAHOO.widget.Menu; >- >- } >- >- >- var fnSuperClass = YAHOO.widget.Button.superclass.constructor, >- oConfig, >- oElement; >- >- >- if (arguments.length == 1 && !Lang.isString(p_oElement) && !p_oElement.nodeName) { >- >- if (!p_oElement.id) { >- >- p_oElement.id = Dom.generateId(); >- >- >- } >- >- >- fnSuperClass.call(this, (this.createButtonElement(p_oElement.type)), p_oElement); >- >- } >- else { >- >- oConfig = { element: null, attributes: (p_oAttributes || {}) }; >- >- >- if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- if (oElement) { >- >- if (!oConfig.attributes.id) { >- >- oConfig.attributes.id = p_oElement; >- >- } >- >- >- >- oConfig.attributes.srcelement = oElement; >- >- initConfig.call(this, oConfig); >- >- >- if (!oConfig.element) { >- >- >- oConfig.element = this.createButtonElement(oConfig.attributes.type); >- >- } >- >- fnSuperClass.call(this, oConfig.element, oConfig.attributes); >- >- } >- >- } >- else if (p_oElement.nodeName) { >- >- if (!oConfig.attributes.id) { >- >- if (p_oElement.id) { >- >- oConfig.attributes.id = p_oElement.id; >- >- } >- else { >- >- oConfig.attributes.id = Dom.generateId(); >- >- >- } >- >- } >- >- >- >- oConfig.attributes.srcelement = p_oElement; >- >- initConfig.call(this, oConfig); >- >- >- if (!oConfig.element) { >- >- >- oConfig.element = this.createButtonElement(oConfig.attributes.type); >- >- } >- >- fnSuperClass.call(this, oConfig.element, oConfig.attributes); >- >- } >- >- } >- >- }; >- >- >- >- YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, { >- >- >- // Protected properties >- >- >- /** >- * @property _button >- * @description Object reference to the button's internal >- * <code><a></code> or <code><button></code> element. >- * @default null >- * @protected >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html >- * #ID-34812697">HTMLButtonElement</a> >- */ >- _button: null, >- >- >- /** >- * @property _menu >- * @description Object reference to the button's menu. >- * @default null >- * @protected >- * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>| >- * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>} >- */ >- _menu: null, >- >- >- /** >- * @property _hiddenFields >- * @description Object reference to the <code><input></code> >- * element, or array of HTML form elements used to represent the button >- * when its parent form is submitted. >- * @default null >- * @protected >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array >- */ >- _hiddenFields: null, >- >- >- /** >- * @property _onclickAttributeValue >- * @description Object reference to the button's current value for the >- * "onclick" configuration attribute. >- * @default null >- * @protected >- * @type Object >- */ >- _onclickAttributeValue: null, >- >- >- /** >- * @property _activationKeyPressed >- * @description Boolean indicating if the key(s) that toggle the button's >- * "active" state have been pressed. >- * @default false >- * @protected >- * @type Boolean >- */ >- _activationKeyPressed: false, >- >- >- /** >- * @property _activationButtonPressed >- * @description Boolean indicating if the mouse button that toggles >- * the button's "active" state has been pressed. >- * @default false >- * @protected >- * @type Boolean >- */ >- _activationButtonPressed: false, >- >- >- /** >- * @property _hasKeyEventHandlers >- * @description Boolean indicating if the button's "blur", "keydown" and >- * "keyup" event handlers are assigned >- * @default false >- * @protected >- * @type Boolean >- */ >- _hasKeyEventHandlers: false, >- >- >- /** >- * @property _hasMouseEventHandlers >- * @description Boolean indicating if the button's "mouseout," >- * "mousedown," and "mouseup" event handlers are assigned >- * @default false >- * @protected >- * @type Boolean >- */ >- _hasMouseEventHandlers: false, >- >- >- /** >- * @property _nOptionRegionX >- * @description Number representing the X coordinate of the leftmost edge of the Button's >- * option region. Applies only to Buttons of type "split". >- * @default 0 >- * @protected >- * @type Number >- */ >- _nOptionRegionX: 0, >- >- >- >- // Constants >- >- /** >- * @property CLASS_NAME_PREFIX >- * @description Prefix used for all class names applied to a Button. >- * @default "yui-" >- * @final >- * @type String >- */ >- CLASS_NAME_PREFIX: "yui-", >- >- >- /** >- * @property NODE_NAME >- * @description The name of the node to be used for the button's >- * root element. >- * @default "SPAN" >- * @final >- * @type String >- */ >- NODE_NAME: "SPAN", >- >- >- /** >- * @property CHECK_ACTIVATION_KEYS >- * @description Array of numbers representing keys that (when pressed) >- * toggle the button's "checked" attribute. >- * @default [32] >- * @final >- * @type Array >- */ >- CHECK_ACTIVATION_KEYS: [32], >- >- >- /** >- * @property ACTIVATION_KEYS >- * @description Array of numbers representing keys that (when presed) >- * toggle the button's "active" state. >- * @default [13, 32] >- * @final >- * @type Array >- */ >- ACTIVATION_KEYS: [13, 32], >- >- >- /** >- * @property OPTION_AREA_WIDTH >- * @description Width (in pixels) of the area of a split button that >- * when pressed will display a menu. >- * @default 20 >- * @final >- * @type Number >- */ >- OPTION_AREA_WIDTH: 20, >- >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to >- * the button's root element. >- * @default "button" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "button", >- >- >- >- // Protected attribute setter methods >- >- >- /** >- * @method _setType >- * @description Sets the value of the button's "type" attribute. >- * @protected >- * @param {String} p_sType String indicating the value for the button's >- * "type" attribute. >- */ >- _setType: function (p_sType) { >- >- if (p_sType == "split") { >- >- this.on("option", this._onOption); >- >- } >- >- }, >- >- >- /** >- * @method _setLabel >- * @description Sets the value of the button's "label" attribute. >- * @protected >- * @param {String} p_sLabel String indicating the value for the button's >- * "label" attribute. >- */ >- _setLabel: function (p_sLabel) { >- >- this._button.innerHTML = p_sLabel; >- >- >- /* >- Remove and add the default class name from the root element >- for Gecko to ensure that the button shrinkwraps to the label. >- Without this the button will not be rendered at the correct >- width when the label changes. The most likely cause for this >- bug is button's use of the Gecko-specific CSS display type of >- "-moz-inline-box" to simulate "inline-block" supported by IE, >- Safari and Opera. >- */ >- >- var sClass, >- nGeckoVersion = UA.gecko; >- >- >- if (nGeckoVersion && nGeckoVersion < 1.9 && Dom.inDocument(this.get("element"))) { >- >- sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- this.removeClass(sClass); >- >- Lang.later(0, this, this.addClass, sClass); >- >- } >- >- }, >- >- >- /** >- * @method _setTabIndex >- * @description Sets the value of the button's "tabindex" attribute. >- * @protected >- * @param {Number} p_nTabIndex Number indicating the value for the >- * button's "tabindex" attribute. >- */ >- _setTabIndex: function (p_nTabIndex) { >- >- this._button.tabIndex = p_nTabIndex; >- >- }, >- >- >- /** >- * @method _setTitle >- * @description Sets the value of the button's "title" attribute. >- * @protected >- * @param {String} p_nTabIndex Number indicating the value for >- * the button's "title" attribute. >- */ >- _setTitle: function (p_sTitle) { >- >- if (this.get("type") != "link") { >- >- this._button.title = p_sTitle; >- >- } >- >- }, >- >- >- /** >- * @method _setDisabled >- * @description Sets the value of the button's "disabled" attribute. >- * @protected >- * @param {Boolean} p_bDisabled Boolean indicating the value for >- * the button's "disabled" attribute. >- */ >- _setDisabled: function (p_bDisabled) { >- >- if (this.get("type") != "link") { >- >- if (p_bDisabled) { >- >- if (this._menu) { >- >- this._menu.hide(); >- >- } >- >- if (this.hasFocus()) { >- >- this.blur(); >- >- } >- >- this._button.setAttribute("disabled", "disabled"); >- >- this.addStateCSSClasses("disabled"); >- >- this.removeStateCSSClasses("hover"); >- this.removeStateCSSClasses("active"); >- this.removeStateCSSClasses("focus"); >- >- } >- else { >- >- this._button.removeAttribute("disabled"); >- >- this.removeStateCSSClasses("disabled"); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _setHref >- * @description Sets the value of the button's "href" attribute. >- * @protected >- * @param {String} p_sHref String indicating the value for the button's >- * "href" attribute. >- */ >- _setHref: function (p_sHref) { >- >- if (this.get("type") == "link") { >- >- this._button.href = p_sHref; >- >- } >- >- }, >- >- >- /** >- * @method _setTarget >- * @description Sets the value of the button's "target" attribute. >- * @protected >- * @param {String} p_sTarget String indicating the value for the button's >- * "target" attribute. >- */ >- _setTarget: function (p_sTarget) { >- >- if (this.get("type") == "link") { >- >- this._button.setAttribute("target", p_sTarget); >- >- } >- >- }, >- >- >- /** >- * @method _setChecked >- * @description Sets the value of the button's "target" attribute. >- * @protected >- * @param {Boolean} p_bChecked Boolean indicating the value for >- * the button's "checked" attribute. >- */ >- _setChecked: function (p_bChecked) { >- >- var sType = this.get("type"); >- >- if (sType == "checkbox" || sType == "radio") { >- >- if (p_bChecked) { >- this.addStateCSSClasses("checked"); >- } >- else { >- this.removeStateCSSClasses("checked"); >- } >- >- } >- >- }, >- >- >- /** >- * @method _setMenu >- * @description Sets the value of the button's "menu" attribute. >- * @protected >- * @param {Object} p_oMenu Object indicating the value for the button's >- * "menu" attribute. >- */ >- _setMenu: function (p_oMenu) { >- >- var bLazyLoad = this.get("lazyloadmenu"), >- oButtonElement = this.get("element"), >- sMenuCSSClassName, >- >- /* >- Boolean indicating if the value of p_oMenu is an instance >- of YAHOO.widget.Menu or YAHOO.widget.Overlay. >- */ >- >- bInstance = false, >- oMenu, >- oMenuElement, >- oSrcElement; >- >- >- function onAppendTo() { >- >- oMenu.render(oButtonElement.parentNode); >- >- this.removeListener("appendTo", onAppendTo); >- >- } >- >- >- function setMenuContainer() { >- >- oMenu.cfg.queueProperty("container", oButtonElement.parentNode); >- >- this.removeListener("appendTo", setMenuContainer); >- >- } >- >- >- function initMenu() { >- >- var oContainer; >- >- if (oMenu) { >- >- Dom.addClass(oMenu.element, this.get("menuclassname")); >- Dom.addClass(oMenu.element, this.CLASS_NAME_PREFIX + this.get("type") + "-button-menu"); >- >- oMenu.showEvent.subscribe(this._onMenuShow, null, this); >- oMenu.hideEvent.subscribe(this._onMenuHide, null, this); >- oMenu.renderEvent.subscribe(this._onMenuRender, null, this); >- >- >- if (Menu && oMenu instanceof Menu) { >- >- if (bLazyLoad) { >- >- oContainer = this.get("container"); >- >- if (oContainer) { >- >- oMenu.cfg.queueProperty("container", oContainer); >- >- } >- else { >- >- this.on("appendTo", setMenuContainer); >- >- } >- >- } >- >- oMenu.cfg.queueProperty("clicktohide", false); >- >- oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, this, true); >- oMenu.subscribe("click", this._onMenuClick, this, true); >- >- this.on("selectedMenuItemChange", this._onSelectedMenuItemChange); >- >- oSrcElement = oMenu.srcElement; >- >- if (oSrcElement && oSrcElement.nodeName.toUpperCase() == "SELECT") { >- >- oSrcElement.style.display = "none"; >- oSrcElement.parentNode.removeChild(oSrcElement); >- >- } >- >- } >- else if (Overlay && oMenu instanceof Overlay) { >- >- if (!m_oOverlayManager) { >- >- m_oOverlayManager = new YAHOO.widget.OverlayManager(); >- >- } >- >- m_oOverlayManager.register(oMenu); >- >- } >- >- >- this._menu = oMenu; >- >- >- if (!bInstance && !bLazyLoad) { >- >- if (Dom.inDocument(oButtonElement)) { >- >- oMenu.render(oButtonElement.parentNode); >- >- } >- else { >- >- this.on("appendTo", onAppendTo); >- >- } >- >- } >- >- } >- >- } >- >- >- if (Overlay) { >- >- if (Menu) { >- >- sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME; >- >- } >- >- if (p_oMenu && Menu && (p_oMenu instanceof Menu)) { >- >- oMenu = p_oMenu; >- bInstance = true; >- >- initMenu.call(this); >- >- } >- else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) { >- >- oMenu = p_oMenu; >- bInstance = true; >- >- oMenu.cfg.queueProperty("visible", false); >- >- initMenu.call(this); >- >- } >- else if (Menu && Lang.isArray(p_oMenu)) { >- >- oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, itemdata: p_oMenu }); >- >- this._menu = oMenu; >- >- this.on("appendTo", initMenu); >- >- } >- else if (Lang.isString(p_oMenu)) { >- >- oMenuElement = Dom.get(p_oMenu); >- >- if (oMenuElement) { >- >- if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || >- oMenuElement.nodeName.toUpperCase() == "SELECT") { >- >- oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); >- >- initMenu.call(this); >- >- } >- else if (Overlay) { >- >- oMenu = new Overlay(p_oMenu, { visible: false }); >- >- initMenu.call(this); >- >- } >- >- } >- >- } >- else if (p_oMenu && p_oMenu.nodeName) { >- >- if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || >- p_oMenu.nodeName.toUpperCase() == "SELECT") { >- >- oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); >- >- initMenu.call(this); >- >- } >- else if (Overlay) { >- >- if (!p_oMenu.id) { >- >- Dom.generateId(p_oMenu); >- >- } >- >- oMenu = new Overlay(p_oMenu, { visible: false }); >- >- initMenu.call(this); >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _setOnClick >- * @description Sets the value of the button's "onclick" attribute. >- * @protected >- * @param {Object} p_oObject Object indicating the value for the button's >- * "onclick" attribute. >- */ >- _setOnClick: function (p_oObject) { >- >- /* >- Remove any existing listeners if a "click" event handler >- has already been specified. >- */ >- >- if (this._onclickAttributeValue && >- (this._onclickAttributeValue != p_oObject)) { >- >- this.removeListener("click", this._onclickAttributeValue.fn); >- >- this._onclickAttributeValue = null; >- >- } >- >- >- if (!this._onclickAttributeValue && >- Lang.isObject(p_oObject) && >- Lang.isFunction(p_oObject.fn)) { >- >- this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope); >- >- this._onclickAttributeValue = p_oObject; >- >- } >- >- }, >- >- >- >- // Protected methods >- >- >- >- /** >- * @method _isActivationKey >- * @description Determines if the specified keycode is one that toggles >- * the button's "active" state. >- * @protected >- * @param {Number} p_nKeyCode Number representing the keycode to >- * be evaluated. >- * @return {Boolean} >- */ >- _isActivationKey: function (p_nKeyCode) { >- >- var sType = this.get("type"), >- aKeyCodes = (sType == "checkbox" || sType == "radio") ? >- this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS, >- >- nKeyCodes = aKeyCodes.length, >- bReturnVal = false, >- i; >- >- >- if (nKeyCodes > 0) { >- >- i = nKeyCodes - 1; >- >- do { >- >- if (p_nKeyCode == aKeyCodes[i]) { >- >- bReturnVal = true; >- break; >- >- } >- >- } >- while (i--); >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _isSplitButtonOptionKey >- * @description Determines if the specified keycode is one that toggles >- * the display of the split button's menu. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- * @return {Boolean} >- */ >- _isSplitButtonOptionKey: function (p_oEvent) { >- >- var bShowMenu = (Event.getCharCode(p_oEvent) == 40); >- >- >- var onKeyPress = function (p_oEvent) { >- >- Event.preventDefault(p_oEvent); >- >- this.removeListener("keypress", onKeyPress); >- >- }; >- >- >- // Prevent the browser from scrolling the window >- if (bShowMenu) { >- >- if (UA.opera) { >- >- this.on("keypress", onKeyPress); >- >- } >- >- Event.preventDefault(p_oEvent); >- } >- >- return bShowMenu; >- >- }, >- >- >- /** >- * @method _addListenersToForm >- * @description Adds event handlers to the button's form. >- * @protected >- */ >- _addListenersToForm: function () { >- >- var oForm = this.getForm(), >- onFormKeyPress = YAHOO.widget.Button.onFormKeyPress, >- bHasKeyPressListener, >- oSrcElement, >- aListeners, >- nListeners, >- i; >- >- >- if (oForm) { >- >- Event.on(oForm, "reset", this._onFormReset, null, this); >- Event.on(oForm, "submit", this._onFormSubmit, null, this); >- >- oSrcElement = this.get("srcelement"); >- >- >- if (this.get("type") == "submit" || >- (oSrcElement && oSrcElement.type == "submit")) >- { >- >- aListeners = Event.getListeners(oForm, "keypress"); >- bHasKeyPressListener = false; >- >- if (aListeners) { >- >- nListeners = aListeners.length; >- >- if (nListeners > 0) { >- >- i = nListeners - 1; >- >- do { >- >- if (aListeners[i].fn == onFormKeyPress) { >- >- bHasKeyPressListener = true; >- break; >- >- } >- >- } >- while (i--); >- >- } >- >- } >- >- >- if (!bHasKeyPressListener) { >- >- Event.on(oForm, "keypress", onFormKeyPress); >- >- } >- >- } >- >- } >- >- }, >- >- >- >- /** >- * @method _showMenu >- * @description Shows the button's menu. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event) that triggered >- * the display of the menu. >- */ >- _showMenu: function (p_oEvent) { >- >- if (YAHOO.widget.MenuManager) { >- YAHOO.widget.MenuManager.hideVisible(); >- } >- >- >- if (m_oOverlayManager) { >- m_oOverlayManager.hideAll(); >- } >- >- >- var oMenu = this._menu, >- aMenuAlignment = this.get("menualignment"), >- bFocusMenu = this.get("focusmenu"), >- fnFocusMethod; >- >- >- if (this._renderedMenu) { >- >- oMenu.cfg.setProperty("context", >- [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); >- >- oMenu.cfg.setProperty("preventcontextoverlap", true); >- oMenu.cfg.setProperty("constraintoviewport", true); >- >- } >- else { >- >- oMenu.cfg.queueProperty("context", >- [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); >- >- oMenu.cfg.queueProperty("preventcontextoverlap", true); >- oMenu.cfg.queueProperty("constraintoviewport", true); >- >- } >- >- >- /* >- Refocus the Button before showing its Menu in case the call to >- YAHOO.widget.MenuManager.hideVisible() resulted in another element in the >- DOM being focused after another Menu was hidden. >- */ >- >- this.focus(); >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- // Since Menus automatically focus themselves when made visible, temporarily >- // replace the Menu focus method so that the value of the Button's "focusmenu" >- // attribute determines if the Menu should be focus when made visible. >- >- fnFocusMethod = oMenu.focus; >- >- oMenu.focus = function () {}; >- >- if (this._renderedMenu) { >- >- oMenu.cfg.setProperty("minscrollheight", this.get("menuminscrollheight")); >- oMenu.cfg.setProperty("maxheight", this.get("menumaxheight")); >- >- } >- else { >- >- oMenu.cfg.queueProperty("minscrollheight", this.get("menuminscrollheight")); >- oMenu.cfg.queueProperty("maxheight", this.get("menumaxheight")); >- >- } >- >- >- oMenu.show(); >- >- oMenu.focus = fnFocusMethod; >- >- oMenu.align(); >- >- >- /* >- Stop the propagation of the event so that the MenuManager >- doesn't blur the menu after it gets focus. >- */ >- >- if (p_oEvent.type == "mousedown") { >- Event.stopPropagation(p_oEvent); >- } >- >- >- if (bFocusMenu) { >- oMenu.focus(); >- } >- >- } >- else if (Overlay && oMenu && (oMenu instanceof Overlay)) { >- >- if (!this._renderedMenu) { >- oMenu.render(this.get("element").parentNode); >- } >- >- oMenu.show(); >- oMenu.align(); >- >- } >- >- }, >- >- >- /** >- * @method _hideMenu >- * @description Hides the button's menu. >- * @protected >- */ >- _hideMenu: function () { >- >- var oMenu = this._menu; >- >- if (oMenu) { >- >- oMenu.hide(); >- >- } >- >- }, >- >- >- >- >- // Protected event handlers >- >- >- /** >- * @method _onMouseOver >- * @description "mouseover" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseOver: function (p_oEvent) { >- >- var sType = this.get("type"), >- oElement, >- nOptionRegionX; >- >- >- if (sType === "split") { >- >- oElement = this.get("element"); >- nOptionRegionX = >- (Dom.getX(oElement) + (oElement.offsetWidth - this.OPTION_AREA_WIDTH)); >- >- this._nOptionRegionX = nOptionRegionX; >- >- } >- >- >- if (!this._hasMouseEventHandlers) { >- >- if (sType === "split") { >- >- this.on("mousemove", this._onMouseMove); >- >- } >- >- this.on("mouseout", this._onMouseOut); >- >- this._hasMouseEventHandlers = true; >- >- } >- >- >- this.addStateCSSClasses("hover"); >- >- >- if (sType === "split" && (Event.getPageX(p_oEvent) > nOptionRegionX)) { >- >- this.addStateCSSClasses("hoveroption"); >- >- } >- >- >- if (this._activationButtonPressed) { >- >- this.addStateCSSClasses("active"); >- >- } >- >- >- if (this._bOptionPressed) { >- >- this.addStateCSSClasses("activeoption"); >- >- } >- >- >- if (this._activationButtonPressed || this._bOptionPressed) { >- >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- >- } >- >- }, >- >- >- /** >- * @method _onMouseMove >- * @description "mousemove" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseMove: function (p_oEvent) { >- >- var nOptionRegionX = this._nOptionRegionX; >- >- if (nOptionRegionX) { >- >- if (Event.getPageX(p_oEvent) > nOptionRegionX) { >- >- this.addStateCSSClasses("hoveroption"); >- >- } >- else { >- >- this.removeStateCSSClasses("hoveroption"); >- >- } >- >- } >- >- }, >- >- /** >- * @method _onMouseOut >- * @description "mouseout" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseOut: function (p_oEvent) { >- >- var sType = this.get("type"); >- >- this.removeStateCSSClasses("hover"); >- >- >- if (sType != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- >- if (this._activationButtonPressed || this._bOptionPressed) { >- >- Event.on(document, "mouseup", this._onDocumentMouseUp, null, this); >- >- } >- >- >- if (sType === "split" && (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { >- >- this.removeStateCSSClasses("hoveroption"); >- >- } >- >- }, >- >- >- /** >- * @method _onDocumentMouseUp >- * @description "mouseup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentMouseUp: function (p_oEvent) { >- >- this._activationButtonPressed = false; >- this._bOptionPressed = false; >- >- var sType = this.get("type"), >- oTarget, >- oMenuElement; >- >- if (sType == "menu" || sType == "split") { >- >- oTarget = Event.getTarget(p_oEvent); >- oMenuElement = this._menu.element; >- >- if (oTarget != oMenuElement && >- !Dom.isAncestor(oMenuElement, oTarget)) { >- >- this.removeStateCSSClasses((sType == "menu" ? >- "active" : "activeoption")); >- >- this._hideMenu(); >- >- } >- >- } >- >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- >- }, >- >- >- /** >- * @method _onMouseDown >- * @description "mousedown" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseDown: function (p_oEvent) { >- >- var sType, >- bReturnVal = true; >- >- >- function onMouseUp() { >- >- this._hideMenu(); >- this.removeListener("mouseup", onMouseUp); >- >- } >- >- >- if ((p_oEvent.which || p_oEvent.button) == 1) { >- >- >- if (!this.hasFocus()) { >- >- this.focus(); >- >- } >- >- >- sType = this.get("type"); >- >- >- if (sType == "split") { >- >- if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- this.fireEvent("option", p_oEvent); >- bReturnVal = false; >- >- } >- else { >- >- this.addStateCSSClasses("active"); >- >- this._activationButtonPressed = true; >- >- } >- >- } >- else if (sType == "menu") { >- >- if (this.isActive()) { >- >- this._hideMenu(); >- >- this._activationButtonPressed = false; >- >- } >- else { >- >- this._showMenu(p_oEvent); >- >- this._activationButtonPressed = true; >- >- } >- >- } >- else { >- >- this.addStateCSSClasses("active"); >- >- this._activationButtonPressed = true; >- >- } >- >- >- >- if (sType == "split" || sType == "menu") { >- >- this._hideMenuTimer = Lang.later(250, this, this.on, ["mouseup", onMouseUp]); >- >- } >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onMouseUp >- * @description "mouseup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onMouseUp: function (p_oEvent) { >- >- var sType = this.get("type"), >- oHideMenuTimer = this._hideMenuTimer, >- bReturnVal = true; >- >- >- if (oHideMenuTimer) { >- >- oHideMenuTimer.cancel(); >- >- } >- >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.set("checked", !(this.get("checked"))); >- >- } >- >- >- this._activationButtonPressed = false; >- >- >- if (sType != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- >- if (sType == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- bReturnVal = false; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onFocus >- * @description "focus" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onFocus: function (p_oEvent) { >- >- var oElement; >- >- this.addStateCSSClasses("focus"); >- >- if (this._activationKeyPressed) { >- >- this.addStateCSSClasses("active"); >- >- } >- >- m_oFocusedButton = this; >- >- >- if (!this._hasKeyEventHandlers) { >- >- oElement = this._button; >- >- Event.on(oElement, "blur", this._onBlur, null, this); >- Event.on(oElement, "keydown", this._onKeyDown, null, this); >- Event.on(oElement, "keyup", this._onKeyUp, null, this); >- >- this._hasKeyEventHandlers = true; >- >- } >- >- >- this.fireEvent("focus", p_oEvent); >- >- }, >- >- >- /** >- * @method _onBlur >- * @description "blur" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onBlur: function (p_oEvent) { >- >- this.removeStateCSSClasses("focus"); >- >- if (this.get("type") != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- if (this._activationKeyPressed) { >- >- Event.on(document, "keyup", this._onDocumentKeyUp, null, this); >- >- } >- >- >- m_oFocusedButton = null; >- >- this.fireEvent("blur", p_oEvent); >- >- }, >- >- >- /** >- * @method _onDocumentKeyUp >- * @description "keyup" event handler for the document. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentKeyUp: function (p_oEvent) { >- >- if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- this._activationKeyPressed = false; >- >- Event.removeListener(document, "keyup", this._onDocumentKeyUp); >- >- } >- >- }, >- >- >- /** >- * @method _onKeyDown >- * @description "keydown" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyDown: function (p_oEvent) { >- >- var oMenu = this._menu; >- >- >- if (this.get("type") == "split" && >- this._isSplitButtonOptionKey(p_oEvent)) { >- >- this.fireEvent("option", p_oEvent); >- >- } >- else if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- if (this.get("type") == "menu") { >- >- this._showMenu(p_oEvent); >- >- } >- else { >- >- this._activationKeyPressed = true; >- >- this.addStateCSSClasses("active"); >- >- } >- >- } >- >- >- if (oMenu && oMenu.cfg.getProperty("visible") && >- Event.getCharCode(p_oEvent) == 27) { >- >- oMenu.hide(); >- this.focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onKeyUp >- * @description "keyup" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyUp: function (p_oEvent) { >- >- var sType; >- >- if (this._isActivationKey(Event.getCharCode(p_oEvent))) { >- >- sType = this.get("type"); >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.set("checked", !(this.get("checked"))); >- >- } >- >- this._activationKeyPressed = false; >- >- if (this.get("type") != "menu") { >- >- this.removeStateCSSClasses("active"); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _onClick >- * @description "click" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onClick: function (p_oEvent) { >- >- var sType = this.get("type"), >- oForm, >- oSrcElement, >- bReturnVal; >- >- >- switch (sType) { >- >- case "submit": >- >- if (p_oEvent.returnValue !== false) { >- >- this.submitForm(); >- >- } >- >- break; >- >- case "reset": >- >- oForm = this.getForm(); >- >- if (oForm) { >- >- oForm.reset(); >- >- } >- >- break; >- >- >- case "split": >- >- if (this._nOptionRegionX > 0 && >- (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { >- >- bReturnVal = false; >- >- } >- else { >- >- this._hideMenu(); >- >- oSrcElement = this.get("srcelement"); >- >- if (oSrcElement && oSrcElement.type == "submit" && >- p_oEvent.returnValue !== false) { >- >- this.submitForm(); >- >- } >- >- } >- >- break; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onDblClick >- * @description "dblclick" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDblClick: function (p_oEvent) { >- >- var bReturnVal = true; >- >- if (this.get("type") == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { >- >- bReturnVal = false; >- >- } >- >- return bReturnVal; >- >- }, >- >- >- /** >- * @method _onAppendTo >- * @description "appendTo" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onAppendTo: function (p_oEvent) { >- >- /* >- It is necessary to call "_addListenersToForm" using >- "setTimeout" to make sure that the button's "form" property >- returns a node reference. Sometimes, if you try to get the >- reference immediately after appending the field, it is null. >- */ >- >- Lang.later(0, this, this._addListenersToForm); >- >- }, >- >- >- /** >- * @method _onFormReset >- * @description "reset" event handler for the button's form. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event >- * object passed back by the event utility (YAHOO.util.Event). >- */ >- _onFormReset: function (p_oEvent) { >- >- var sType = this.get("type"), >- oMenu = this._menu; >- >- if (sType == "checkbox" || sType == "radio") { >- >- this.resetValue("checked"); >- >- } >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- this.resetValue("selectedMenuItem"); >- >- } >- >- }, >- >- >- /** >- * @method _onFormSubmit >- * @description "submit" event handler for the button's form. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event >- * object passed back by the event utility (YAHOO.util.Event). >- */ >- _onFormSubmit: function (p_oEvent) { >- >- this.createHiddenFields(); >- >- }, >- >- >- /** >- * @method _onDocumentMouseDown >- * @description "mousedown" event handler for the document. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onDocumentMouseDown: function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- oButtonElement = this.get("element"), >- oMenuElement = this._menu.element; >- >- >- if (oTarget != oButtonElement && >- !Dom.isAncestor(oButtonElement, oTarget) && >- oTarget != oMenuElement && >- !Dom.isAncestor(oMenuElement, oTarget)) { >- >- this._hideMenu(); >- >- // In IE when the user mouses down on a focusable element >- // that element will be focused and become the "activeElement". >- // (http://msdn.microsoft.com/en-us/library/ms533065(VS.85).aspx) >- // However, there is a bug in IE where if there is a >- // positioned element with a focused descendant that is >- // hidden in response to the mousedown event, the target of >- // the mousedown event will appear to have focus, but will >- // not be set as the activeElement. This will result >- // in the element not firing key events, even though it >- // appears to have focus. The following call to "setActive" >- // fixes this bug. >- >- if (UA.ie && oTarget.focus) { >- oTarget.setActive(); >- } >- >- Event.removeListener(document, "mousedown", >- this._onDocumentMouseDown); >- >- } >- >- }, >- >- >- /** >- * @method _onOption >- * @description "option" event handler for the button. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onOption: function (p_oEvent) { >- >- if (this.hasClass(this.CLASS_NAME_PREFIX + "split-button-activeoption")) { >- >- this._hideMenu(); >- >- this._bOptionPressed = false; >- >- } >- else { >- >- this._showMenu(p_oEvent); >- >- this._bOptionPressed = true; >- >- } >- >- }, >- >- >- /** >- * @method _onMenuShow >- * @description "show" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the event >- * that was fired. >- */ >- _onMenuShow: function (p_sType) { >- >- Event.on(document, "mousedown", this._onDocumentMouseDown, >- null, this); >- >- var sState = (this.get("type") == "split") ? "activeoption" : "active"; >- >- this.addStateCSSClasses(sState); >- >- }, >- >- >- /** >- * @method _onMenuHide >- * @description "hide" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the event >- * that was fired. >- */ >- _onMenuHide: function (p_sType) { >- >- var sState = (this.get("type") == "split") ? "activeoption" : "active"; >- >- this.removeStateCSSClasses(sState); >- >- >- if (this.get("type") == "split") { >- >- this._bOptionPressed = false; >- >- } >- >- }, >- >- >- /** >- * @method _onMenuKeyDown >- * @description "keydown" event handler for the button's menu. >- * @private >- * @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. >- */ >- _onMenuKeyDown: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0]; >- >- if (Event.getCharCode(oEvent) == 27) { >- >- this.focus(); >- >- if (this.get("type") == "split") { >- >- this._bOptionPressed = false; >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _onMenuRender >- * @description "render" event handler for the button's menu. >- * @private >- * @param {String} p_sType String representing the name of the >- * event thatwas fired. >- */ >- _onMenuRender: function (p_sType) { >- >- var oButtonElement = this.get("element"), >- oButtonParent = oButtonElement.parentNode, >- oMenu = this._menu, >- oMenuElement = oMenu.element, >- oSrcElement = oMenu.srcElement, >- oItem; >- >- >- if (oButtonParent != oMenuElement.parentNode) { >- >- oButtonParent.appendChild(oMenuElement); >- >- } >- >- this._renderedMenu = true; >- >- // If the user has designated an <option> of the Menu's source >- // <select> element to be selected, sync the selectedIndex with >- // the "selectedMenuItem" Attribute. >- >- if (oSrcElement && >- oSrcElement.nodeName.toLowerCase() === "select" && >- oSrcElement.value) { >- >- >- oItem = oMenu.getItem(oSrcElement.selectedIndex); >- >- // Set the value of the "selectedMenuItem" attribute >- // silently since this is the initial set--synchronizing >- // the value of the source <SELECT> element in the DOM with >- // its corresponding Menu instance. >- >- this.set("selectedMenuItem", oItem, true); >- >- // Call the "_onSelectedMenuItemChange" method since the >- // attribute was set silently. >- >- this._onSelectedMenuItemChange({ newValue: oItem }); >- >- } >- >- }, >- >- >- >- /** >- * @method _onMenuClick >- * @description "click" event handler for the button's menu. >- * @private >- * @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. >- */ >- _onMenuClick: function (p_sType, p_aArgs) { >- >- var oItem = p_aArgs[1], >- oSrcElement; >- >- if (oItem) { >- >- this.set("selectedMenuItem", oItem); >- >- oSrcElement = this.get("srcelement"); >- >- if (oSrcElement && oSrcElement.type == "submit") { >- >- this.submitForm(); >- >- } >- >- this._hideMenu(); >- >- } >- >- }, >- >- >- /** >- * @method _onSelectedMenuItemChange >- * @description "selectedMenuItemChange" event handler for the Button's >- * "selectedMenuItem" attribute. >- * @param {Event} event Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onSelectedMenuItemChange: function (event) { >- >- var oSelected = event.prevValue, >- oItem = event.newValue, >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (oSelected) { >- Dom.removeClass(oSelected.element, (sPrefix + "button-selectedmenuitem")); >- } >- >- if (oItem) { >- Dom.addClass(oItem.element, (sPrefix + "button-selectedmenuitem")); >- } >- >- }, >- >- >- /** >- * @method _onLabelClick >- * @description "click" event handler for the Button's >- * <code><label></code> element. >- * @param {Event} event Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onLabelClick: function (event) { >- >- this.focus(); >- >- var sType = this.get("type"); >- >- if (sType == "radio" || sType == "checkbox") { >- this.set("checked", (!this.get("checked"))); >- } >- >- }, >- >- >- // Public methods >- >- >- /** >- * @method createButtonElement >- * @description Creates the button's HTML elements. >- * @param {String} p_sType String indicating the type of element >- * to create. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>} >- */ >- createButtonElement: function (p_sType) { >- >- var sNodeName = this.NODE_NAME, >- oElement = document.createElement(sNodeName); >- >- oElement.innerHTML = "<" + sNodeName + " class=\"first-child\">" + >- (p_sType == "link" ? "<a></a>" : >- "<button type=\"button\"></button>") + "</" + sNodeName + ">"; >- >- return oElement; >- >- }, >- >- >- /** >- * @method addStateCSSClasses >- * @description Appends state-specific CSS classes to the button's root >- * DOM element. >- */ >- addStateCSSClasses: function (p_sState) { >- >- var sType = this.get("type"), >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (Lang.isString(p_sState)) { >- >- if (p_sState != "activeoption" && p_sState != "hoveroption") { >- >- this.addClass(sPrefix + this.CSS_CLASS_NAME + ("-" + p_sState)); >- >- } >- >- this.addClass(sPrefix + sType + ("-button-" + p_sState)); >- >- } >- >- }, >- >- >- /** >- * @method removeStateCSSClasses >- * @description Removes state-specific CSS classes to the button's root >- * DOM element. >- */ >- removeStateCSSClasses: function (p_sState) { >- >- var sType = this.get("type"), >- sPrefix = this.CLASS_NAME_PREFIX; >- >- if (Lang.isString(p_sState)) { >- >- this.removeClass(sPrefix + this.CSS_CLASS_NAME + ("-" + p_sState)); >- this.removeClass(sPrefix + sType + ("-button-" + p_sState)); >- >- } >- >- }, >- >- >- /** >- * @method createHiddenFields >- * @description Creates the button's hidden form field and appends it >- * to its parent form. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array} >- */ >- createHiddenFields: function () { >- >- this.removeHiddenFields(); >- >- var oForm = this.getForm(), >- oButtonField, >- sType, >- bCheckable, >- oMenu, >- oMenuItem, >- sButtonName, >- oValue, >- oMenuField, >- oReturnVal, >- sMenuFieldName, >- oMenuSrcElement, >- bMenuSrcElementIsSelect = false; >- >- >- if (oForm && !this.get("disabled")) { >- >- sType = this.get("type"); >- bCheckable = (sType == "checkbox" || sType == "radio"); >- >- >- if ((bCheckable && this.get("checked")) || (m_oSubmitTrigger == this)) { >- >- >- oButtonField = createInputElement((bCheckable ? sType : "hidden"), >- this.get("name"), this.get("value"), this.get("checked")); >- >- >- if (oButtonField) { >- >- if (bCheckable) { >- >- oButtonField.style.display = "none"; >- >- } >- >- oForm.appendChild(oButtonField); >- >- } >- >- } >- >- >- oMenu = this._menu; >- >- >- if (Menu && oMenu && (oMenu instanceof Menu)) { >- >- >- oMenuItem = this.get("selectedMenuItem"); >- oMenuSrcElement = oMenu.srcElement; >- bMenuSrcElementIsSelect = (oMenuSrcElement && >- oMenuSrcElement.nodeName.toUpperCase() == "SELECT"); >- >- if (oMenuItem) { >- >- oValue = (oMenuItem.value === null || oMenuItem.value === "") ? >- oMenuItem.cfg.getProperty("text") : oMenuItem.value; >- >- sButtonName = this.get("name"); >- >- >- if (bMenuSrcElementIsSelect) { >- >- sMenuFieldName = oMenuSrcElement.name; >- >- } >- else if (sButtonName) { >- >- sMenuFieldName = (sButtonName + "_options"); >- >- } >- >- >- if (oValue && sMenuFieldName) { >- >- oMenuField = createInputElement("hidden", sMenuFieldName, oValue); >- oForm.appendChild(oMenuField); >- >- } >- >- } >- else if (bMenuSrcElementIsSelect) { >- >- oMenuField = oForm.appendChild(oMenuSrcElement); >- >- } >- >- } >- >- >- if (oButtonField && oMenuField) { >- >- this._hiddenFields = [oButtonField, oMenuField]; >- >- } >- else if (!oButtonField && oMenuField) { >- >- this._hiddenFields = oMenuField; >- >- } >- else if (oButtonField && !oMenuField) { >- >- this._hiddenFields = oButtonField; >- >- } >- >- oReturnVal = this._hiddenFields; >- >- } >- >- return oReturnVal; >- >- }, >- >- >- /** >- * @method removeHiddenFields >- * @description Removes the button's hidden form field(s) from its >- * parent form. >- */ >- removeHiddenFields: function () { >- >- var oField = this._hiddenFields, >- nFields, >- i; >- >- function removeChild(p_oElement) { >- >- if (Dom.inDocument(p_oElement)) { >- >- p_oElement.parentNode.removeChild(p_oElement); >- >- } >- >- } >- >- >- if (oField) { >- >- if (Lang.isArray(oField)) { >- >- nFields = oField.length; >- >- if (nFields > 0) { >- >- i = nFields - 1; >- >- do { >- >- removeChild(oField[i]); >- >- } >- while (i--); >- >- } >- >- } >- else { >- >- removeChild(oField); >- >- } >- >- this._hiddenFields = null; >- >- } >- >- }, >- >- >- /** >- * @method submitForm >- * @description Submits the form to which the button belongs. Returns >- * true if the form was submitted successfully, false if the submission >- * was cancelled. >- * @protected >- * @return {Boolean} >- */ >- submitForm: function () { >- >- var oForm = this.getForm(), >- >- oSrcElement = this.get("srcelement"), >- >- /* >- Boolean indicating if the event fired successfully >- (was not cancelled by any handlers) >- */ >- >- bSubmitForm = false, >- >- oEvent; >- >- >- if (oForm) { >- >- if (this.get("type") == "submit" || (oSrcElement && oSrcElement.type == "submit")) { >- >- m_oSubmitTrigger = this; >- >- } >- >- >- if (UA.ie) { >- >- bSubmitForm = oForm.fireEvent("onsubmit"); >- >- } >- else { // Gecko, Opera, and Safari >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent("submit", true, true); >- >- bSubmitForm = oForm.dispatchEvent(oEvent); >- >- } >- >- >- /* >- In IE and Safari, dispatching a "submit" event to a form >- WILL cause the form's "submit" event to fire, but WILL NOT >- submit the form. Therefore, we need to call the "submit" >- method as well. >- */ >- >- if ((UA.ie || UA.webkit) && bSubmitForm) { >- >- oForm.submit(); >- >- } >- >- } >- >- return bSubmitForm; >- >- }, >- >- >- /** >- * @method init >- * @description The Button class's initialization method. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to >- * be used to create the button. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http:// >- * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html >- * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR >- * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296"> >- * HTMLElement</a>} p_oElement Object reference for the >- * <code><input></code>, <code><button></code>, >- * <code><a></code>, or <code><span></code> element to be >- * used to create the button. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button. >- * @param {Object} p_oAttributes Optional. Object literal specifying a >- * set of configuration attributes used to create the button. >- */ >- init: function (p_oElement, p_oAttributes) { >- >- var sNodeName = p_oAttributes.type == "link" ? "a" : "button", >- oSrcElement = p_oAttributes.srcelement, >- oButton = p_oElement.getElementsByTagName(sNodeName)[0], >- oInput; >- >- >- if (!oButton) { >- >- oInput = p_oElement.getElementsByTagName("input")[0]; >- >- >- if (oInput) { >- >- oButton = document.createElement("button"); >- oButton.setAttribute("type", "button"); >- >- oInput.parentNode.replaceChild(oButton, oInput); >- >- } >- >- } >- >- this._button = oButton; >- >- >- YAHOO.widget.Button.superclass.init.call(this, p_oElement, p_oAttributes); >- >- >- var sId = this.get("id"), >- sButtonId = sId + "-button"; >- >- >- oButton.id = sButtonId; >- >- >- var aLabels, >- oLabel; >- >- >- var hasLabel = function (element) { >- >- return (element.htmlFor === sId); >- >- }; >- >- >- var setLabel = function () { >- >- oLabel.setAttribute((UA.ie ? "htmlFor" : "for"), sButtonId); >- >- }; >- >- >- if (oSrcElement && this.get("type") != "link") { >- >- aLabels = Dom.getElementsBy(hasLabel, "label"); >- >- if (Lang.isArray(aLabels) && aLabels.length > 0) { >- >- oLabel = aLabels[0]; >- >- } >- >- } >- >- >- m_oButtons[sId] = this; >- >- var sPrefix = this.CLASS_NAME_PREFIX; >- >- this.addClass(sPrefix + this.CSS_CLASS_NAME); >- this.addClass(sPrefix + this.get("type") + "-button"); >- >- Event.on(this._button, "focus", this._onFocus, null, this); >- this.on("mouseover", this._onMouseOver); >- this.on("mousedown", this._onMouseDown); >- this.on("mouseup", this._onMouseUp); >- this.on("click", this._onClick); >- >- // Need to reset the value of the "onclick" Attribute so that any >- // handlers registered via the "onclick" Attribute are fired after >- // Button's default "_onClick" listener. >- >- var fnOnClick = this.get("onclick"); >- >- this.set("onclick", null); >- this.set("onclick", fnOnClick); >- >- this.on("dblclick", this._onDblClick); >- >- >- var oParentNode; >- >- if (oLabel) { >- >- if (this.get("replaceLabel")) { >- >- this.set("label", oLabel.innerHTML); >- >- oParentNode = oLabel.parentNode; >- >- oParentNode.removeChild(oLabel); >- >- } >- else { >- >- this.on("appendTo", setLabel); >- >- Event.on(oLabel, "click", this._onLabelClick, null, this); >- >- this._label = oLabel; >- >- } >- >- } >- >- this.on("appendTo", this._onAppendTo); >- >- >- >- var oContainer = this.get("container"), >- oElement = this.get("element"), >- bElInDoc = Dom.inDocument(oElement); >- >- >- if (oContainer) { >- >- if (oSrcElement && oSrcElement != oElement) { >- >- oParentNode = oSrcElement.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oSrcElement); >- >- } >- >- } >- >- if (Lang.isString(oContainer)) { >- >- Event.onContentReady(oContainer, this.appendTo, oContainer, this); >- >- } >- else { >- >- this.on("init", function () { >- >- Lang.later(0, this, this.appendTo, oContainer); >- >- }); >- >- } >- >- } >- else if (!bElInDoc && oSrcElement && oSrcElement != oElement) { >- >- oParentNode = oSrcElement.parentNode; >- >- if (oParentNode) { >- >- this.fireEvent("beforeAppendTo", { >- type: "beforeAppendTo", >- target: oParentNode >- }); >- >- oParentNode.replaceChild(oElement, oSrcElement); >- >- this.fireEvent("appendTo", { >- type: "appendTo", >- target: oParentNode >- }); >- >- } >- >- } >- else if (this.get("type") != "link" && bElInDoc && oSrcElement && >- oSrcElement == oElement) { >- >- this._addListenersToForm(); >- >- } >- >- >- >- this.fireEvent("init", { >- type: "init", >- target: this >- }); >- >- }, >- >- >- /** >- * @method initAttributes >- * @description Initializes all of the configuration attributes used to >- * create the button. >- * @param {Object} p_oAttributes Object literal specifying a set of >- * configuration attributes used to create the button. >- */ >- initAttributes: function (p_oAttributes) { >- >- var oAttributes = p_oAttributes || {}; >- >- YAHOO.widget.Button.superclass.initAttributes.call(this, >- oAttributes); >- >- >- /** >- * @attribute type >- * @description String specifying the button's type. Possible >- * values are: "push," "link," "submit," "reset," "checkbox," >- * "radio," "menu," and "split." >- * @default "push" >- * @type String >- * @writeonce >- */ >- this.setAttributeConfig("type", { >- >- value: (oAttributes.type || "push"), >- validator: Lang.isString, >- writeOnce: true, >- method: this._setType >- >- }); >- >- >- /** >- * @attribute label >- * @description String specifying the button's text label >- * or innerHTML. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("label", { >- >- value: oAttributes.label, >- validator: Lang.isString, >- method: this._setLabel >- >- }); >- >- >- /** >- * @attribute value >- * @description Object specifying the value for the button. >- * @default null >- * @type Object >- */ >- this.setAttributeConfig("value", { >- >- value: oAttributes.value >- >- }); >- >- >- /** >- * @attribute name >- * @description String specifying the name for the button. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("name", { >- >- value: oAttributes.name, >- validator: Lang.isString >- >- }); >- >- >- /** >- * @attribute tabindex >- * @description Number specifying the tabindex for the button. >- * @default null >- * @type Number >- */ >- this.setAttributeConfig("tabindex", { >- >- value: oAttributes.tabindex, >- validator: Lang.isNumber, >- method: this._setTabIndex >- >- }); >- >- >- /** >- * @attribute title >- * @description String specifying the title for the button. >- * @default null >- * @type String >- */ >- this.configureAttribute("title", { >- >- value: oAttributes.title, >- validator: Lang.isString, >- method: this._setTitle >- >- }); >- >- >- /** >- * @attribute disabled >- * @description Boolean indicating if the button should be disabled. >- * (Disabled buttons are dimmed and will not respond to user input >- * or fire events. Does not apply to button's of type "link.") >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("disabled", { >- >- value: (oAttributes.disabled || false), >- validator: Lang.isBoolean, >- method: this._setDisabled >- >- }); >- >- >- /** >- * @attribute href >- * @description String specifying the href for the button. Applies >- * only to buttons of type "link." >- * @type String >- */ >- this.setAttributeConfig("href", { >- >- value: oAttributes.href, >- validator: Lang.isString, >- method: this._setHref >- >- }); >- >- >- /** >- * @attribute target >- * @description String specifying the target for the button. >- * Applies only to buttons of type "link." >- * @type String >- */ >- this.setAttributeConfig("target", { >- >- value: oAttributes.target, >- validator: Lang.isString, >- method: this._setTarget >- >- }); >- >- >- /** >- * @attribute checked >- * @description Boolean indicating if the button is checked. >- * Applies only to buttons of type "radio" and "checkbox." >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("checked", { >- >- value: (oAttributes.checked || false), >- validator: Lang.isBoolean, >- method: this._setChecked >- >- }); >- >- >- /** >- * @attribute container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the button's markup should be >- * rendered into. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("container", { >- >- value: oAttributes.container, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute srcelement >- * @description Object reference to the HTML element (either >- * <code><input></code> or <code><span></code>) >- * used to create the button. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("srcelement", { >- >- value: oAttributes.srcelement, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menu >- * @description Object specifying the menu for the button. >- * The value can be one of the following: >- * <ul> >- * <li>Object specifying a rendered <a href="YAHOO.widget.Menu.html"> >- * YAHOO.widget.Menu</a> instance.</li> >- * <li>Object specifying a rendered <a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a> instance.</li> >- * <li>String specifying the id attribute of the <code><div> >- * </code> element used to create the menu. By default the menu >- * will be created as an instance of >- * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>. >- * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME"> >- * default CSS class name for YAHOO.widget.Menu</a> is applied to >- * the <code><div></code> element, it will be created as an >- * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu >- * </a>.</li><li>String specifying the id attribute of the >- * <code><select></code> element used to create the menu. >- * </li><li>Object specifying the <code><div></code> element >- * used to create the menu.</li> >- * <li>Object specifying the <code><select></code> element >- * used to create the menu.</li> >- * <li>Array of object literals, each representing a set of >- * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> >- * configuration attributes.</li> >- * <li>Array of strings representing the text labels for each menu >- * item in the menu.</li> >- * </ul> >- * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a >- * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a >- * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-58190037">HTMLElement</a>|String|Array >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("menu", { >- >- value: null, >- method: this._setMenu, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute lazyloadmenu >- * @description Boolean indicating the value to set for the >- * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a> >- * configuration property of the button's menu. Setting >- * "lazyloadmenu" to <code>true </code> will defer rendering of >- * the button's menu until the first time it is made visible. >- * If "lazyloadmenu" is set to <code>false</code>, the button's >- * menu will be rendered immediately if the button is in the >- * document, or in response to the button's "appendTo" event if >- * the button is not yet in the document. In either case, the >- * menu is rendered into the button's parent HTML element. >- * <em>This attribute does not apply if a >- * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or >- * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> >- * instance is passed as the value of the button's "menu" >- * configuration attribute. <a href="YAHOO.widget.Menu.html"> >- * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a> instances should be rendered before >- * being set as the value for the "menu" configuration >- * attribute.</em> >- * @default true >- * @type Boolean >- * @writeonce >- */ >- this.setAttributeConfig("lazyloadmenu", { >- >- value: (oAttributes.lazyloadmenu === false ? false : true), >- validator: Lang.isBoolean, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menuclassname >- * @description String representing the CSS class name to be >- * applied to the root element of the button's menu. >- * @type String >- * @default "yui-button-menu" >- * @writeonce >- */ >- this.setAttributeConfig("menuclassname", { >- >- value: (oAttributes.menuclassname || (this.CLASS_NAME_PREFIX + "button-menu")), >- validator: Lang.isString, >- method: this._setMenuClassName, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute menuminscrollheight >- * @description Number defining the minimum threshold for the "menumaxheight" >- * configuration attribute. When set this attribute is automatically applied >- * to all submenus. >- * @default 90 >- * @type Number >- */ >- this.setAttributeConfig("menuminscrollheight", { >- >- value: (oAttributes.menuminscrollheight || 90), >- validator: Lang.isNumber >- >- }); >- >- >- /** >- * @attribute menumaxheight >- * @description Number defining the maximum height (in pixels) for a menu's >- * body element (<code><div class="bd"<</code>). Once a menu's body >- * exceeds this height, the contents of the body are scrolled to maintain >- * this value. This value cannot be set lower than the value of the >- * "minscrollheight" configuration property. >- * @type Number >- * @default 0 >- */ >- this.setAttributeConfig("menumaxheight", { >- >- value: (oAttributes.menumaxheight || 0), >- validator: Lang.isNumber >- >- }); >- >- >- /** >- * @attribute menualignment >- * @description Array defining how the Button's Menu is aligned to the Button. >- * The default value of ["tl", "bl"] aligns the Menu's top left corner to the Button's >- * bottom left corner. >- * @type Array >- * @default ["tl", "bl"] >- */ >- this.setAttributeConfig("menualignment", { >- >- value: (oAttributes.menualignment || ["tl", "bl"]), >- validator: Lang.isArray >- >- }); >- >- >- /** >- * @attribute selectedMenuItem >- * @description Object representing the item in the button's menu >- * that is currently selected. >- * @type YAHOO.widget.MenuItem >- * @default null >- */ >- this.setAttributeConfig("selectedMenuItem", { >- >- value: null >- >- }); >- >- >- /** >- * @attribute onclick >- * @description Object literal representing the code to be executed >- * when the button is clicked. Format:<br> <code> {<br> >- * <strong>fn:</strong> Function, // The handler to call >- * when the event fires.<br> <strong>obj:</strong> Object, >- * // An object to pass back to the handler.<br> >- * <strong>scope:</strong> Object // The object to use >- * for the scope of the handler.<br> } </code> >- * @type Object >- * @default null >- */ >- this.setAttributeConfig("onclick", { >- >- value: oAttributes.onclick, >- method: this._setOnClick >- >- }); >- >- >- /** >- * @attribute focusmenu >- * @description Boolean indicating whether or not the button's menu >- * should be focused when it is made visible. >- * @type Boolean >- * @default true >- */ >- this.setAttributeConfig("focusmenu", { >- >- value: (oAttributes.focusmenu === false ? false : true), >- validator: Lang.isBoolean >- >- }); >- >- >- /** >- * @attribute replaceLabel >- * @description Boolean indicating whether or not the text of the >- * button's <code><label></code> element should be used as >- * the source for the button's label configuration attribute and >- * removed from the DOM. >- * @type Boolean >- * @default false >- */ >- this.setAttributeConfig("replaceLabel", { >- >- value: false, >- validator: Lang.isBoolean, >- writeOnce: true >- >- }); >- >- }, >- >- >- /** >- * @method focus >- * @description Causes the button to receive the focus and fires the >- * button's "focus" event. >- */ >- focus: function () { >- >- if (!this.get("disabled")) { >- >- this._button.focus(); >- >- } >- >- }, >- >- >- /** >- * @method blur >- * @description Causes the button to lose focus and fires the button's >- * "blur" event. >- */ >- blur: function () { >- >- if (!this.get("disabled")) { >- >- this._button.blur(); >- >- } >- >- }, >- >- >- /** >- * @method hasFocus >- * @description Returns a boolean indicating whether or not the button >- * has focus. >- * @return {Boolean} >- */ >- hasFocus: function () { >- >- return (m_oFocusedButton == this); >- >- }, >- >- >- /** >- * @method isActive >- * @description Returns a boolean indicating whether or not the button >- * is active. >- * @return {Boolean} >- */ >- isActive: function () { >- >- return this.hasClass(this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME + "-active"); >- >- }, >- >- >- /** >- * @method getMenu >- * @description Returns a reference to the button's menu. >- * @return {<a href="YAHOO.widget.Overlay.html"> >- * YAHOO.widget.Overlay</a>|<a >- * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>} >- */ >- getMenu: function () { >- >- return this._menu; >- >- }, >- >- >- /** >- * @method getForm >- * @description Returns a reference to the button's parent form. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1- >- * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>} >- */ >- getForm: function () { >- >- var oButton = this._button, >- oForm; >- >- if (oButton) { >- >- oForm = oButton.form; >- >- } >- >- return oForm; >- >- }, >- >- >- /** >- * @method getHiddenFields >- * @description Returns an <code><input></code> element or >- * array of form elements used to represent the button when its parent >- * form is submitted. >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array} >- */ >- getHiddenFields: function () { >- >- return this._hiddenFields; >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the button's element from its parent element and >- * removes all event handlers. >- */ >- destroy: function () { >- >- >- var oElement = this.get("element"), >- oMenu = this._menu, >- oLabel = this._label, >- oParentNode, >- aButtons; >- >- if (oMenu) { >- >- >- if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) { >- >- m_oOverlayManager.remove(oMenu); >- >- } >- >- oMenu.destroy(); >- >- } >- >- >- Event.purgeElement(oElement); >- Event.purgeElement(this._button); >- Event.removeListener(document, "mouseup", this._onDocumentMouseUp); >- Event.removeListener(document, "keyup", this._onDocumentKeyUp); >- Event.removeListener(document, "mousedown", this._onDocumentMouseDown); >- >- >- if (oLabel) { >- >- Event.removeListener(oLabel, "click", this._onLabelClick); >- >- oParentNode = oLabel.parentNode; >- oParentNode.removeChild(oLabel); >- >- } >- >- >- var oForm = this.getForm(); >- >- if (oForm) { >- >- Event.removeListener(oForm, "reset", this._onFormReset); >- Event.removeListener(oForm, "submit", this._onFormSubmit); >- >- } >- >- >- this.unsubscribeAll(); >- >- oParentNode = oElement.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oElement); >- >- } >- >- >- delete m_oButtons[this.get("id")]; >- >- var sClass = (this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- aButtons = Dom.getElementsByClassName(sClass, >- this.NODE_NAME, oForm); >- >- if (Lang.isArray(aButtons) && aButtons.length === 0) { >- >- Event.removeListener(oForm, "keypress", >- YAHOO.widget.Button.onFormKeyPress); >- >- } >- >- >- }, >- >- >- fireEvent: function (p_sType , p_aArgs) { >- >- var sType = arguments[0]; >- >- // Disabled buttons should not respond to DOM events >- >- if (this.DOM_EVENTS[sType] && this.get("disabled")) { >- >- return false; >- >- } >- >- return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments); >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the button. >- * @return {String} >- */ >- toString: function () { >- >- return ("Button " + this.get("id")); >- >- } >- >- }); >- >- >- /** >- * @method YAHOO.widget.Button.onFormKeyPress >- * @description "keypress" event handler for the button's form. >- * @param {Event} p_oEvent Object representing the DOM event object passed >- * back by the event utility (YAHOO.util.Event). >- */ >- YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- nCharCode = Event.getCharCode(p_oEvent), >- sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(), >- sType = oTarget.type, >- >- /* >- Boolean indicating if the form contains any enabled or >- disabled YUI submit buttons >- */ >- >- bFormContainsYUIButtons = false, >- >- oButton, >- >- oYUISubmitButton, // The form's first, enabled YUI submit button >- >- /* >- The form's first, enabled HTML submit button that precedes any >- YUI submit button >- */ >- >- oPrecedingSubmitButton, >- >- oEvent; >- >- >- function isSubmitButton(p_oElement) { >- >- var sId, >- oSrcElement; >- >- switch (p_oElement.nodeName.toUpperCase()) { >- >- case "INPUT": >- case "BUTTON": >- >- if (p_oElement.type == "submit" && !p_oElement.disabled) { >- >- if (!bFormContainsYUIButtons && !oPrecedingSubmitButton) { >- >- oPrecedingSubmitButton = p_oElement; >- >- } >- >- } >- >- break; >- >- >- default: >- >- sId = p_oElement.id; >- >- if (sId) { >- >- oButton = m_oButtons[sId]; >- >- if (oButton) { >- >- bFormContainsYUIButtons = true; >- >- if (!oButton.get("disabled")) { >- >- oSrcElement = oButton.get("srcelement"); >- >- if (!oYUISubmitButton && (oButton.get("type") == "submit" || >- (oSrcElement && oSrcElement.type == "submit"))) { >- >- oYUISubmitButton = oButton; >- >- } >- >- } >- >- } >- >- } >- >- break; >- >- } >- >- } >- >- >- if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || >- sType == "password" || sType == "checkbox" || sType == "radio" || >- sType == "file")) || sNodeName == "SELECT")) { >- >- Dom.getElementsBy(isSubmitButton, "*", this); >- >- >- if (oPrecedingSubmitButton) { >- >- /* >- Need to set focus to the first enabled submit button >- to make sure that IE includes its name and value >- in the form's data set. >- */ >- >- oPrecedingSubmitButton.focus(); >- >- } >- else if (!oPrecedingSubmitButton && oYUISubmitButton) { >- >- /* >- Need to call "preventDefault" to ensure that the form doesn't end up getting >- submitted twice. >- */ >- >- Event.preventDefault(p_oEvent); >- >- >- if (UA.ie) { >- >- oYUISubmitButton.get("element").fireEvent("onclick"); >- >- } >- else { >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent("click", true, true); >- >- >- if (UA.gecko < 1.9) { >- >- oYUISubmitButton.fireEvent("click", oEvent); >- >- } >- else { >- >- oYUISubmitButton.get("element").dispatchEvent(oEvent); >- >- } >- >- } >- >- } >- >- } >- >- }; >- >- >- /** >- * @method YAHOO.widget.Button.addHiddenFieldsToForm >- * @description Searches the specified form and adds hidden fields for >- * instances of YAHOO.widget.Button that are of type "radio," "checkbox," >- * "menu," and "split." >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference >- * for the form to search. >- */ >- YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) { >- >- var proto = YAHOO.widget.Button.prototype, >- aButtons = Dom.getElementsByClassName( >- (proto.CLASS_NAME_PREFIX + proto.CSS_CLASS_NAME), >- "*", >- p_oForm), >- >- nButtons = aButtons.length, >- oButton, >- sId, >- i; >- >- if (nButtons > 0) { >- >- >- for (i = 0; i < nButtons; i++) { >- >- sId = aButtons[i].id; >- >- if (sId) { >- >- oButton = m_oButtons[sId]; >- >- if (oButton) { >- >- oButton.createHiddenFields(); >- >- } >- >- } >- >- } >- >- } >- >- }; >- >- >- /** >- * @method YAHOO.widget.Button.getButton >- * @description Returns a button with the specified id. >- * @param {String} p_sId String specifying the id of the root node of the >- * HTML element representing the button to be retrieved. >- * @return {YAHOO.widget.Button} >- */ >- YAHOO.widget.Button.getButton = function (p_sId) { >- >- return m_oButtons[p_sId]; >- >- }; >- >- >- // Events >- >- >- /** >- * @event focus >- * @description Fires when the menu item receives focus. Passes back a >- * single object representing the original DOM event object passed back by >- * the event utility (YAHOO.util.Event) when the event was fired. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> >- * for more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event blur >- * @description Fires when the menu item loses the input focus. Passes back >- * a single object representing the original DOM event object passed back by >- * the event utility (YAHOO.util.Event) when the event was fired. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for >- * more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event option >- * @description Fires when the user invokes the button's option. Passes >- * back a single object representing the original DOM event (either >- * "mousedown" or "keydown") that caused the "option" event to fire. See >- * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> >- * for more information on listening for this event. >- * @type YAHOO.util.CustomEvent >- */ >- >-})(); >-(function () { >- >- // Shorthard for utilities >- >- var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- Button = YAHOO.widget.Button, >- >- // Private collection of radio buttons >- >- m_oButtons = {}; >- >- >- >- /** >- * The ButtonGroup class creates a set of buttons that are mutually >- * exclusive; checking one button in the set will uncheck all others in the >- * button group. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><div></code> element of the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object >- * specifying the <code><div></code> element of the button group. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button group. >- * @param {Object} p_oAttributes Optional. Object literal specifying a set >- * of configuration attributes used to create the button group. >- * @namespace YAHOO.widget >- * @class ButtonGroup >- * @constructor >- * @extends YAHOO.util.Element >- */ >- YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) { >- >- var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor, >- sNodeName, >- oElement, >- sId; >- >- if (arguments.length == 1 && !Lang.isString(p_oElement) && >- !p_oElement.nodeName) { >- >- if (!p_oElement.id) { >- >- sId = Dom.generateId(); >- >- p_oElement.id = sId; >- >- >- } >- >- >- >- fnSuperClass.call(this, (this._createGroupElement()), p_oElement); >- >- } >- else if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- if (oElement) { >- >- if (oElement.nodeName.toUpperCase() == this.NODE_NAME) { >- >- >- fnSuperClass.call(this, oElement, p_oAttributes); >- >- } >- >- } >- >- } >- else { >- >- sNodeName = p_oElement.nodeName.toUpperCase(); >- >- if (sNodeName && sNodeName == this.NODE_NAME) { >- >- if (!p_oElement.id) { >- >- p_oElement.id = Dom.generateId(); >- >- >- } >- >- >- fnSuperClass.call(this, p_oElement, p_oAttributes); >- >- } >- >- } >- >- }; >- >- >- YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, { >- >- >- // Protected properties >- >- >- /** >- * @property _buttons >- * @description Array of buttons in the button group. >- * @default null >- * @protected >- * @type Array >- */ >- _buttons: null, >- >- >- >- // Constants >- >- >- /** >- * @property NODE_NAME >- * @description The name of the tag to be used for the button >- * group's element. >- * @default "DIV" >- * @final >- * @type String >- */ >- NODE_NAME: "DIV", >- >- >- /** >- * @property CLASS_NAME_PREFIX >- * @description Prefix used for all class names applied to a ButtonGroup. >- * @default "yui-" >- * @final >- * @type String >- */ >- CLASS_NAME_PREFIX: "yui-", >- >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied >- * to the button group's element. >- * @default "buttongroup" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "buttongroup", >- >- >- >- // Protected methods >- >- >- /** >- * @method _createGroupElement >- * @description Creates the button group's element. >- * @protected >- * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} >- */ >- _createGroupElement: function () { >- >- var oElement = document.createElement(this.NODE_NAME); >- >- return oElement; >- >- }, >- >- >- >- // Protected attribute setter methods >- >- >- /** >- * @method _setDisabled >- * @description Sets the value of the button groups's >- * "disabled" attribute. >- * @protected >- * @param {Boolean} p_bDisabled Boolean indicating the value for >- * the button group's "disabled" attribute. >- */ >- _setDisabled: function (p_bDisabled) { >- >- var nButtons = this.getCount(), >- i; >- >- if (nButtons > 0) { >- >- i = nButtons - 1; >- >- do { >- >- this._buttons[i].set("disabled", p_bDisabled); >- >- } >- while (i--); >- >- } >- >- }, >- >- >- >- // Protected event handlers >- >- >- /** >- * @method _onKeyDown >- * @description "keydown" event handler for the button group. >- * @protected >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- _onKeyDown: function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- nCharCode = Event.getCharCode(p_oEvent), >- sId = oTarget.parentNode.parentNode.id, >- oButton = m_oButtons[sId], >- nIndex = -1; >- >- >- if (nCharCode == 37 || nCharCode == 38) { >- >- nIndex = (oButton.index === 0) ? >- (this._buttons.length - 1) : (oButton.index - 1); >- >- } >- else if (nCharCode == 39 || nCharCode == 40) { >- >- nIndex = (oButton.index === (this._buttons.length - 1)) ? >- 0 : (oButton.index + 1); >- >- } >- >- >- if (nIndex > -1) { >- >- this.check(nIndex); >- this.getButton(nIndex).focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onAppendTo >- * @description "appendTo" event handler for the button group. >- * @protected >- * @param {Event} p_oEvent Object representing the event that was fired. >- */ >- _onAppendTo: function (p_oEvent) { >- >- var aButtons = this._buttons, >- nButtons = aButtons.length, >- i; >- >- for (i = 0; i < nButtons; i++) { >- >- aButtons[i].appendTo(this.get("element")); >- >- } >- >- }, >- >- >- /** >- * @method _onButtonCheckedChange >- * @description "checkedChange" event handler for each button in the >- * button group. >- * @protected >- * @param {Event} p_oEvent Object representing the event that was fired. >- * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * p_oButton Object representing the button that fired the event. >- */ >- _onButtonCheckedChange: function (p_oEvent, p_oButton) { >- >- var bChecked = p_oEvent.newValue, >- oCheckedButton = this.get("checkedButton"); >- >- if (bChecked && oCheckedButton != p_oButton) { >- >- if (oCheckedButton) { >- >- oCheckedButton.set("checked", false, true); >- >- } >- >- this.set("checkedButton", p_oButton); >- this.set("value", p_oButton.get("value")); >- >- } >- else if (oCheckedButton && !oCheckedButton.set("checked")) { >- >- oCheckedButton.set("checked", true, true); >- >- } >- >- }, >- >- >- >- // Public methods >- >- >- /** >- * @method init >- * @description The ButtonGroup class's initialization method. >- * @param {String} p_oElement String specifying the id attribute of the >- * <code><div></code> element of the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object >- * specifying the <code><div></code> element of the button group. >- * @param {Object} p_oElement Object literal specifying a set of >- * configuration attributes used to create the button group. >- * @param {Object} p_oAttributes Optional. Object literal specifying a >- * set of configuration attributes used to create the button group. >- */ >- init: function (p_oElement, p_oAttributes) { >- >- this._buttons = []; >- >- YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, >- p_oAttributes); >- >- this.addClass(this.CLASS_NAME_PREFIX + this.CSS_CLASS_NAME); >- >- >- var sClass = (YAHOO.widget.Button.prototype.CLASS_NAME_PREFIX + "radio-button"), >- aButtons = this.getElementsByClassName(sClass); >- >- >- >- if (aButtons.length > 0) { >- >- >- this.addButtons(aButtons); >- >- } >- >- >- >- function isRadioButton(p_oElement) { >- >- return (p_oElement.type == "radio"); >- >- } >- >- aButtons = >- Dom.getElementsBy(isRadioButton, "input", this.get("element")); >- >- >- if (aButtons.length > 0) { >- >- >- this.addButtons(aButtons); >- >- } >- >- this.on("keydown", this._onKeyDown); >- this.on("appendTo", this._onAppendTo); >- >- >- var oContainer = this.get("container"); >- >- if (oContainer) { >- >- if (Lang.isString(oContainer)) { >- >- Event.onContentReady(oContainer, function () { >- >- this.appendTo(oContainer); >- >- }, null, this); >- >- } >- else { >- >- this.appendTo(oContainer); >- >- } >- >- } >- >- >- >- }, >- >- >- /** >- * @method initAttributes >- * @description Initializes all of the configuration attributes used to >- * create the button group. >- * @param {Object} p_oAttributes Object literal specifying a set of >- * configuration attributes used to create the button group. >- */ >- initAttributes: function (p_oAttributes) { >- >- var oAttributes = p_oAttributes || {}; >- >- YAHOO.widget.ButtonGroup.superclass.initAttributes.call( >- this, oAttributes); >- >- >- /** >- * @attribute name >- * @description String specifying the name for the button group. >- * This name will be applied to each button in the button group. >- * @default null >- * @type String >- */ >- this.setAttributeConfig("name", { >- >- value: oAttributes.name, >- validator: Lang.isString >- >- }); >- >- >- /** >- * @attribute disabled >- * @description Boolean indicating if the button group should be >- * disabled. Disabling the button group will disable each button >- * in the button group. Disabled buttons are dimmed and will not >- * respond to user input or fire events. >- * @default false >- * @type Boolean >- */ >- this.setAttributeConfig("disabled", { >- >- value: (oAttributes.disabled || false), >- validator: Lang.isBoolean, >- method: this._setDisabled >- >- }); >- >- >- /** >- * @attribute value >- * @description Object specifying the value for the button group. >- * @default null >- * @type Object >- */ >- this.setAttributeConfig("value", { >- >- value: oAttributes.value >- >- }); >- >- >- /** >- * @attribute container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the button group's markup >- * should be rendered into. >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|String >- * @default null >- * @writeonce >- */ >- this.setAttributeConfig("container", { >- >- value: oAttributes.container, >- writeOnce: true >- >- }); >- >- >- /** >- * @attribute checkedButton >- * @description Reference for the button in the button group that >- * is checked. >- * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * @default null >- */ >- this.setAttributeConfig("checkedButton", { >- >- value: null >- >- }); >- >- }, >- >- >- /** >- * @method addButton >- * @description Adds the button to the button group. >- * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- * p_oButton Object reference for the <a href="YAHOO.widget.Button.html"> >- * YAHOO.widget.Button</a> instance to be added to the button group. >- * @param {String} p_oButton String specifying the id attribute of the >- * <code><input></code> or <code><span></code> element >- * to be used to create the button to be added to the button group. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href=" >- * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html# >- * ID-33759296">HTMLElement</a>} p_oButton Object reference for the >- * <code><input></code> or <code><span></code> element >- * to be used to create the button to be added to the button group. >- * @param {Object} p_oButton Object literal specifying a set of >- * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> >- * configuration attributes used to configure the button to be added to >- * the button group. >- * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- */ >- addButton: function (p_oButton) { >- >- var oButton, >- oButtonElement, >- oGroupElement, >- nIndex, >- sButtonName, >- sGroupName; >- >- >- if (p_oButton instanceof Button && >- p_oButton.get("type") == "radio") { >- >- oButton = p_oButton; >- >- } >- else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) { >- >- p_oButton.type = "radio"; >- >- oButton = new Button(p_oButton); >- >- } >- else { >- >- oButton = new Button(p_oButton, { type: "radio" }); >- >- } >- >- >- if (oButton) { >- >- nIndex = this._buttons.length; >- sButtonName = oButton.get("name"); >- sGroupName = this.get("name"); >- >- oButton.index = nIndex; >- >- this._buttons[nIndex] = oButton; >- m_oButtons[oButton.get("id")] = oButton; >- >- >- if (sButtonName != sGroupName) { >- >- oButton.set("name", sGroupName); >- >- } >- >- >- if (this.get("disabled")) { >- >- oButton.set("disabled", true); >- >- } >- >- >- if (oButton.get("checked")) { >- >- this.set("checkedButton", oButton); >- >- } >- >- >- oButtonElement = oButton.get("element"); >- oGroupElement = this.get("element"); >- >- if (oButtonElement.parentNode != oGroupElement) { >- >- oGroupElement.appendChild(oButtonElement); >- >- } >- >- >- oButton.on("checkedChange", >- this._onButtonCheckedChange, oButton, this); >- >- >- } >- >- return oButton; >- >- }, >- >- >- /** >- * @method addButtons >- * @description Adds the array of buttons to the button group. >- * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html"> >- * YAHOO.widget.Button</a> instances to be added >- * to the button group. >- * @param {Array} p_aButtons Array of strings specifying the id >- * attribute of the <code><input></code> or <code><span> >- * </code> elements to be used to create the buttons to be added to the >- * button group. >- * @param {Array} p_aButtons Array of object references for the >- * <code><input></code> or <code><span></code> elements >- * to be used to create the buttons to be added to the button group. >- * @param {Array} p_aButtons Array of object literals, each containing >- * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> >- * configuration attributes used to configure each button to be added >- * to the button group. >- * @return {Array} >- */ >- addButtons: function (p_aButtons) { >- >- var nButtons, >- oButton, >- aButtons, >- i; >- >- if (Lang.isArray(p_aButtons)) { >- >- nButtons = p_aButtons.length; >- aButtons = []; >- >- if (nButtons > 0) { >- >- for (i = 0; i < nButtons; i++) { >- >- oButton = this.addButton(p_aButtons[i]); >- >- if (oButton) { >- >- aButtons[aButtons.length] = oButton; >- >- } >- >- } >- >- } >- >- } >- >- return aButtons; >- >- }, >- >- >- /** >- * @method removeButton >- * @description Removes the button at the specified index from the >- * button group. >- * @param {Number} p_nIndex Number specifying the index of the button >- * to be removed from the button group. >- */ >- removeButton: function (p_nIndex) { >- >- var oButton = this.getButton(p_nIndex), >- nButtons, >- i; >- >- if (oButton) { >- >- >- this._buttons.splice(p_nIndex, 1); >- delete m_oButtons[oButton.get("id")]; >- >- oButton.removeListener("checkedChange", >- this._onButtonCheckedChange); >- >- oButton.destroy(); >- >- >- nButtons = this._buttons.length; >- >- if (nButtons > 0) { >- >- i = this._buttons.length - 1; >- >- do { >- >- this._buttons[i].index = i; >- >- } >- while (i--); >- >- } >- >- >- } >- >- }, >- >- >- /** >- * @method getButton >- * @description Returns the button at the specified index. >- * @param {Number} p_nIndex The index of the button to retrieve from the >- * button group. >- * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} >- */ >- getButton: function (p_nIndex) { >- >- return this._buttons[p_nIndex]; >- >- }, >- >- >- /** >- * @method getButtons >- * @description Returns an array of the buttons in the button group. >- * @return {Array} >- */ >- getButtons: function () { >- >- return this._buttons; >- >- }, >- >- >- /** >- * @method getCount >- * @description Returns the number of buttons in the button group. >- * @return {Number} >- */ >- getCount: function () { >- >- return this._buttons.length; >- >- }, >- >- >- /** >- * @method focus >- * @description Sets focus to the button at the specified index. >- * @param {Number} p_nIndex Number indicating the index of the button >- * to focus. >- */ >- focus: function (p_nIndex) { >- >- var oButton, >- nButtons, >- i; >- >- if (Lang.isNumber(p_nIndex)) { >- >- oButton = this._buttons[p_nIndex]; >- >- if (oButton) { >- >- oButton.focus(); >- >- } >- >- } >- else { >- >- nButtons = this.getCount(); >- >- for (i = 0; i < nButtons; i++) { >- >- oButton = this._buttons[i]; >- >- if (!oButton.get("disabled")) { >- >- oButton.focus(); >- break; >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method check >- * @description Checks the button at the specified index. >- * @param {Number} p_nIndex Number indicating the index of the button >- * to check. >- */ >- check: function (p_nIndex) { >- >- var oButton = this.getButton(p_nIndex); >- >- if (oButton) { >- >- oButton.set("checked", true); >- >- } >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the button group's element from its parent >- * element and removes all event handlers. >- */ >- destroy: function () { >- >- >- var nButtons = this._buttons.length, >- oElement = this.get("element"), >- oParentNode = oElement.parentNode, >- i; >- >- if (nButtons > 0) { >- >- i = this._buttons.length - 1; >- >- do { >- >- this._buttons[i].destroy(); >- >- } >- while (i--); >- >- } >- >- >- Event.purgeElement(oElement); >- >- >- oParentNode.removeChild(oElement); >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the button group. >- * @return {String} >- */ >- toString: function () { >- >- return ("ButtonGroup " + this.get("id")); >- >- } >- >- }); >- >-})(); >-YAHOO.register("button", YAHOO.widget.Button, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/alrt16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/alrt16_1.gif >deleted file mode 100644 >index 443d39bbfcdb29d508f2f0d632ee15d72579005c..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 971 >zcmZ?wbhEHb6krfw`0mT_Vuj7`SDU^+*!lD9j92^3o-eU|xzpn17Rwi_te?$sc(LB< >z`69b#bM2qaw|lwG^2HjPmpd$8tg(Kv(dxwptLMvXpD(q2xykCqTI>I}<~*C}@N9;| >z|NsA=EwFpJ-~8Duhv%zpo=tOjvC8JfTC11aEne+4d$G;p=@iFjvmIXTGJmnj^5t&x >zr&AqYZnu2C(C+0{%NHwcUM#bHwa@(3Zu94hZJ#f+eLBtY*<_~|n=N1MF@Ler`q^B& >z=Zo#W-Ku@Q+~(ON$ETAWU+pt{x!3&pJiF%$?4B>Pd9lIz<sS2wK*NDvSZDRHT>8}k >zv#+Op7)HTp2w)2V#h)yU3=F;uIv`0<o?zfu!7!Uc#$&?*$42jIG9oKn9yGMDaPTBp >zY)G8k?%goKpeQ9txZ8GCLWGk7gRm%@g2jOgDo+lm%KDsY2zb=MD!`V^a`Qk-YqzwJ >z$OD}Y=2lM?F|`hk#EA<U1#M>dcnCdYow$ryRwm)l6DB4Gk+g(dC56_L><QdD84Fwv >zI4}zN)UDl+&@q8U?v~M>4~z^wOeRtW784ndaCP%f(TF<}v9Z6kOWey$LV&><04x5_ >Al>h($ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/blck16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/blck16_1.gif >deleted file mode 100644 >index 56689611db271fcafe42e652c6496b703f38d9e3..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 591 >zcmZ?wbhEHb6krfwcox9$rM&!ief{ri*M2G}{3$H|$;0!--TkMg=1&okpCKVXxwt;N >zxcth@c*Vv2Q&{-tkt5$~YJLa`{ycj0>&%&7XV3nrrS+MI=d+K`XHn5_?d?BJO@AsW >z{Zv)`YG(E_BlD|}&_^rl?}CEgy1RcG8h!;T5EXr^r~ge|{U;yaPbsON?(SbLEx!~N >zewCB^p{Ms#Qu3>h&(GwzuioCjFJJy*Wc1VC{%e2#Pd2unyu9D6tbX$I|8#Tv8W#4` >z*!ZWP-%n1?Zxt0Ei;A9yhW*sn|0yl~B{cM_i_2#lo8P&)@4~{r#K!(ijJwXn^eM>g >z=bk;^jExxv8BqMm!pOi7z@P(i7bs2`*w-`!G&Q%hw)(O7cKNdSwFUV3dV3pk+G$z# >zwM?AM$uQsA)PL55N#5K{&1U{<W-;>ctY~3a<L}ty%gDB}No1=tyTXoLO+v0~r1acn >z_ztrLIBc~Q=T~C(X>#+}>aQ#-+$7*~BS71qnO#&}r^Q57t%-%1S=z?9MTNskuE|eA >zUvtWbrb&uSd}>SPv=lTvVCIq34bX6?IN{XT%~f}2LB<KsNo+ndOaz>`yc8I$0kO%o >As{jB1 > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/close12_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/close12_1.gif >deleted file mode 100644 >index e2f67d72efc158da4e069822cbe338915761e396..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 85 >zcmZ?wbhEHb<YC}pn8?5ooUrHA&F?kc7v6mRqxh4B0R(hF1W2BNNo`8M`DtDwmkh>z >lf$Gy9znh?Y?^x%Bps9Cfw!UsJn!aoAS>7kV)`>G%0|4uCA&me4 > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container-core.css b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container-core.css >deleted file mode 100644 >index 49032155cc..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container-core.css >+++ /dev/null >@@ -1,176 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.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 { >- /* >- Application of "overflow:auto" prevents Mac scrollbars from bleeding >- through the modality mask in Gecko. The block-scollbars class is only >- added for Gecko on MacOS >- */ >- overflow: auto; >-} >- >-/* >- PLEASE NOTE: >- >- 1) ".masked select" is used to prevent <SELECT> elements bleeding through >- the modality mask in IE 6. >- >- 2) ".drag select" is used to hide <SELECT> elements when dragging a >- Panel in IE 6. This is necessary to prevent some redraw problems with >- the <SELECT> elements when a Panel instance is dragged. >- >- 3) ".hide-select select" is appended to an Overlay instance's root HTML >- element when it is being annimated by YAHOO.widget.ContainerEffect. >- This is necessary because <SELECT> elements don't inherit their parent >- element's opacity in IE 6. >- >-*/ >- >-.masked select, >-.drag select, >-.hide-select select { >- _visibility: hidden; >-} >- >-.yui-panel-container select { >- _visibility: inherit; >-} >- >-/* >- >-There are two known issues with YAHOO.widget.Overlay (and its subclasses) that >-manifest in Gecko-based browsers on Mac OS X: >- >- 1) Elements with scrollbars will poke through Overlay instances floating >- above them. >- >- 2) An Overlay's scrollbars and the scrollbars of its child nodes remain >- visible when the Overlay is hidden. >- >-To fix these bugs: >- >- 1) The "overflow" property of an Overlay instance's root element and child >- nodes is toggled between "hidden" and "auto" (through the application >- and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes) >- as its "visibility" configuration property is toggled between >- "false" and "true." >- >- 2) The "display" property of <SELECT> elements that are child nodes of the >- Overlay instance's root element is set to "none" when it is hidden. >- >-PLEASE NOTE: >- >- 1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are >- applied only for Gecko on Mac OS X and are added/removed to/from the >- Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and >- "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay. >- >- 2) There may be instances where the CSS for a web page or application >- contains style rules whose specificity override the rules implemented by >- the Container CSS files to fix this bug. In such cases, is necessary to >- leverage the provided "hide-scrollbars" and "show-scrollbars" classes to >- write custom style rules to guard against this bug. >- >-** For more information on this issue, see: >- >- + https://bugzilla.mozilla.org/show_bug.cgi?id=187435 >- + YUILibrary bug #1723530 >- >-*/ >- >-.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; >- >-} >- >-/* >- Workaround for Safari 2.x - the yui-force-redraw class is applied, and then removed when >- the Panel's content changes, to force Safari 2.x to redraw the underlay. >- We attempt to choose a CSS property which has no visual impact when added, >- removed. >-*/ >-.yui-panel-container.shadow .underlay.yui-force-redraw { >- padding-bottom: 1px; >-} >- >-.yui-effect-fade .underlay, .yui-effect-fade .yui-tt-shadow { >- display:none; >-} >- >-/* >- PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended >- to its root element via JavaScript once it has been rendered. The >- code that creates the shadow lives in the Tooltip's public "onRender" >- event handler that is a prototype method of YAHOO.widget.Tooltip. >- Implementers wishing to remove a Tooltip's shadow or add any other markup >- required for a given skin for Tooltip should override the "onRender" method. >-*/ >- >-.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; >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container.css b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container.css >deleted file mode 100644 >index 55e4c97e8b..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/container.css >+++ /dev/null >@@ -1,324 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.yui-overlay, >-.yui-panel-container { >- visibility:hidden; >- position:absolute; >- z-index: 2; >-} >- >-.yui-tt { >- visibility:hidden; >- position:absolute; >- color:#333; >- background-color:#FDFFB4; >- font-family:arial,helvetica,verdana,sans-serif; >- padding:2px; >- border:1px solid #FCC90D; >- font:100% sans-serif; >- width:auto; >-} >- >-/* >- PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended >- to its root element via JavaScript once it has been rendered. The >- code that creates the shadow lives in the Tooltip's public "onRender" >- event handler that is a prototype method of YAHOO.widget.Tooltip. >- Implementers wishing to remove a Tooltip's shadow or add any other markup >- required for a given skin for Tooltip should override the "onRender" method. >-*/ >- >-.yui-tt-shadow { >- display: none; >-} >- >-* html body.masked select { >- visibility:hidden; >-} >- >-* html div.yui-panel-container select { >- visibility:inherit; >-} >- >-* html div.drag select { >- visibility:hidden; >-} >- >-* html div.hide-select select { >- visibility:hidden; >-} >- >-.mask { >- z-index: 1; >- display:none; >- position:absolute; >- top:0; >- left:0; >- -moz-opacity: 0.5; >- opacity:.50; >- filter: alpha(opacity=50); >- background-color:#CCC; >-} >- >-/* >- >-There are two known issues with YAHOO.widget.Overlay (and its subclasses) that >-manifest in Gecko-based browsers on Mac OS X: >- >- 1) Elements with scrollbars will poke through Overlay instances floating >- above them. >- >- 2) An Overlay's scrollbars and the scrollbars of its child nodes remain >- visible when the Overlay is hidden. >- >-To fix these bugs: >- >- 1) The "overflow" property of an Overlay instance's root element and child >- nodes is toggled between "hidden" and "auto" (through the application >- and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes) >- as its "visibility" configuration property is toggled between >- "false" and "true." >- >- 2) The "display" property of <SELECT> elements that are child nodes of the >- Overlay instance's root element is set to "none" when it is hidden. >- >-PLEASE NOTE: >- >- 1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are >- applied only for Gecko on Mac OS X and are added/removed to/from the >- Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and >- "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay. >- >- 2) There may be instances where the CSS for a web page or application >- contains style rules whose specificity override the rules implemented by >- the Container CSS files to fix this bug. In such cases, is necessary to >- leverage the provided "hide-scrollbars" and "show-scrollbars" classes to >- write custom style rules to guard against this bug. >- >-** For more information on this issue, see: >- + https://bugzilla.mozilla.org/show_bug.cgi?id=187435 >- + YUILibrary bug #1723530 >- >-*/ >- >-.hide-scrollbars, >-.hide-scrollbars * { >- >- overflow: hidden; >- >-} >- >-.hide-scrollbars select { >- >- display: none; >- >-} >- >-.show-scrollbars { >- >- overflow: auto; >- >-} >- >-.yui-panel-container.show-scrollbars { >- >- overflow: visible; >- >-} >- >-.yui-panel-container.show-scrollbars .underlay { >- >- overflow: auto; >- >-} >- >-.yui-panel-container.focused { >- >-} >- >- >-/* Panel underlay styles */ >- >-.yui-panel-container .underlay { >- >- position: absolute; >- top: 0; >- right: 0; >- bottom: 0; >- left: 0; >- >-} >- >-.yui-panel-container.matte { >- >- padding: 3px; >- background-color: #fff; >- >-} >- >-.yui-panel-container.shadow .underlay { >- >- top: 3px; >- bottom: -3px; >- right: -3px; >- left: 3px; >- background-color: #000; >- opacity: .12; >- filter: alpha(opacity=12); /* For IE */ >- >-} >- >-/* >- Workaround for Safari 2.x - the yui-force-redraw class is applied, and then removed when >- the Panel's content changes, to force Safari 2.x to redraw the underlay. >- We attempt to choose a CSS property which has no visual impact when added, >- removed, but still causes Safari to redraw >-*/ >-.yui-panel-container.shadow .underlay.yui-force-redraw { >- padding-bottom: 1px; >-} >- >-.yui-effect-fade .underlay { >- display:none; >-} >- >-.yui-panel { >- visibility:hidden; >- border-collapse:separate; >- position:relative; >- left:0; >- top:0; >- font:1em Arial; >- background-color:#FFF; >- border:1px solid #000; >- z-index:1; >- overflow:hidden; >-} >- >-.yui-panel .hd { >- background-color:#3d77cb; >- color:#FFF; >- font-size:100%; >- line-height:100%; >- border:1px solid #FFF; >- border-bottom:1px solid #000; >- font-weight:bold; >- padding:4px; >- white-space:nowrap; >-} >- >-.yui-panel .bd { >- overflow:hidden; >- padding:4px; >-} >- >-.yui-panel .bd p { >- margin:0 0 1em; >-} >- >-.yui-panel .container-close { >- position:absolute; >- top:5px; >- right:4px; >- z-index:6; >- height:12px; >- width:12px; >- margin:0px; >- padding:0px; >- background:url(close12_1.gif) no-repeat; >- cursor:pointer; >- visibility:inherit; >- text-indent:-10000em; >- overflow:hidden; >- text-decoration:none; >-} >- >-.yui-panel .ft { >- padding:4px; >- overflow:hidden; >-} >- >-.yui-simple-dialog .bd .yui-icon { >- background-repeat:no-repeat; >- width:16px; >- height:16px; >- margin-right:10px; >- float:left; >-} >- >-.yui-simple-dialog .bd span.blckicon { >- background: url("blck16_1.gif") no-repeat; >-} >- >-.yui-simple-dialog .bd span.alrticon { >- background: url("alrt16_1.gif") no-repeat; >-} >- >-.yui-simple-dialog .bd span.hlpicon { >- background: url("hlp16_1.gif") no-repeat; >-} >- >-.yui-simple-dialog .bd span.infoicon { >- background: url("info16_1.gif") no-repeat; >-} >- >-.yui-simple-dialog .bd span.warnicon { >- background: url("warn16_1.gif") no-repeat; >-} >- >-.yui-simple-dialog .bd span.tipicon { >- background: url("tip16_1.gif") no-repeat; >-} >- >-.yui-dialog .ft, >-.yui-simple-dialog .ft { >- padding-bottom:5px; >- padding-right:5px; >- text-align:right; >-} >- >-.yui-dialog form, >-.yui-simple-dialog form { >- margin:0; >-} >- >-.button-group button { >- font:100 76% verdana; >- text-decoration:none; >- background-color: #E4E4E4; >- color: #333; >- cursor: hand; >- vertical-align: middle; >- border: 2px solid #797979; >- border-top-color:#FFF; >- border-left-color:#FFF; >- margin:2px; >- padding:2px; >-} >- >-.button-group button.default { >- font-weight:bold; >-} >- >-.button-group button:hover, >-.button-group button.hover { >- border:2px solid #90A029; >- background-color:#EBF09E; >- border-top-color:#FFF; >- border-left-color:#FFF; >-} >- >-.button-group button:active { >- border:2px solid #E4E4E4; >- background-color:#BBB; >- border-top-color:#333; >- border-left-color:#333; >-} >- >-.yui-override-padding { >- padding:0 !important; >-} >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/hlp16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/hlp16_1.gif >deleted file mode 100644 >index 4645c8fdfa693126bd5fe969737dc1ccac1e62e1..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 928 >zcmZ?wbhEHb6krfw_-?>(y^ZbFe)X>pdVXIIcs^hJNiYA4HF8fnd0uW*csg0|*(}jl >z`_x|_)OfyJ`t<?L*9SD7bn(5~s{Cq?`tv2yulA@uZs&QmQ}y{m$(P%dU+q<UwOj4Q >zO4+AVg<l`ke7#@&`Er@(OC+Do5qq&j>cvW#7eMYJ$(NgzUhYtNHbdmqF11(tG+wNe >ze>Pv@+j-kFHC!JrMKFwl(GZ|x2q^w!VPs%1V9){C3Ca@;9JLII94(3qS`Uipv+%@l >zJbu8yCTA2-aZun`HzT7AOT>bMhd6me#LFrcC_U-sP!kYHkZ^G7YSj;u&^QoqpnHNC >zZ;t}w0;My&@@fnRB0st^3#zvLlHqv7#J$v;RfvPpREvjIBSs+hlwxDp>V#Uch7Y1| >R8o5%}?uytg>gK>;4FF6EfMoyx > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/info16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/info16_1.gif >deleted file mode 100644 >index 22f697a9917f3bae423726ef6c541e618e7a0221..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 601 >zcmZ?wbhEHb6krfwc*ekR^2`$>r}fqW+ji}_yJYokZHxH}m!7X}I}?_)$H;t^iq<51 >z=Q+}%ZYnzMy4K6|tXJyWt`_1CmRGK`4ch7!yH!cOTSh)#$8w3X<^)ZX8Jjj7)YD4R >zv0UsNwN+Im+c|Qxyi$XTZl|efbxhsqsOlp&_LH02_MbZYysT(KOUEHeshsMn1>ULK >zcJ8{NpjI!y<89(Jm7mMa#AU9wZo~BX*R*u%c{v<Zv?d!nEYvWby=mh?5y4Oyac_H< >zd5Ws-B0|yIcU+QJso-I=QP${_RVuD1otDsg(Is-Rnts1y<nGwU^9DL;T4oDd+7Aix >z`EK8KUPeAwLAAQRew}C7_QvMz<{qm9^N;P=dCf2Dh@Q<NE8k7tX$OtWXR7K<R?(a& >zCYmH6nWk<yT}w4Y$9#^yalg93RD0Kjr_aAuH=L+%xAy=4{|uA?#h)yU3=G)}Iv`^} >zal*j9ts%RqxuvyLGmR@wf?KUEo0&6NR+y3BCpJa5h1py_jFBaaB{S1fA-p+8Bw}fL >zR{GM+MB^r33opi{!5kc$GKGS&Z9_dbv74~(PgTlxj@q?u!+!DjY*9C+P3t%Ax6igy >zzIEwtCZC63wyI9_?F|Alk{OQD*&zlhk*uuhSqvEr7vE?otvDtq$-wx7JEQTqf`V2I >pg9*a{1_uqN5`n5mj6PEYGNc3w4>=rOEb1M1WP>7`>p}+xYXGoF!2kdN > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container-skin.css b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container-skin.css >deleted file mode 100644 >index 6966c95dde..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container-skin.css >+++ /dev/null >@@ -1,242 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-/* Panel modality mask styles */ >-.yui-skin-sam .mask { >- background-color: #000; >- opacity: .25; >- filter: alpha(opacity=25); /* Set opacity in IE */ >-} >- >-/* Panel styles */ >-.yui-skin-sam .yui-panel-container { >- padding:0 1px; >- /* Padding added for IE to allow 0,0 alignment with shadow */ >- *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; >- >- /* Rollback rounded corner support for IE6/7 */ >- *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; >- >- /* Rollback rounded corner support for IE6/7 */ >- *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%; /* 12px */ >- line-height: 2; /* ~24px */ >- *line-height: 1.9; /* For IE */ >- 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 .yui-panel-container.focused .yui-panel .hd { >- >-} >- >-.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; >-} >- >-/* Panel underlay styles */ >-.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 { >- /* IE 7 Quirks Mode and IE 6 Standards Mode and Quirks mode */ >- _padding: 2px 4px 0 2px; >-} >- >-.yui-skin-sam .yui-panel-container.shadow .underlay { >- position: absolute; >- top: 2px; >- left: -3px; >- right: -3px; >- bottom: -3px; >- >- /* IE7 Strict (provides 3px shadow (when combined with 2px padding applied to container) */ >- *top: 4px; >- *left: -1px; >- *right: -1px; >- *bottom: -1px; >- >- /* IE 7 Quirks Mode and IE 6 Standards Mode and Quirks mode */ >- _top: 0; >- _left: 0; >- _right: 0; >- _bottom: 0; >- _margin-top: 3px; >- _margin-left: -1px; >- >- background-color: #000; >- opacity: .12; >- filter: alpha(opacity=12); /* Set opacity in IE */ >-} >- >- >-/* Dialog styles */ >-.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; >-} >- >-/* Dialog default button style */ >-.yui-skin-sam .yui-dialog .ft button.default { >- font-weight:bold; >-} >- >-/* Dialog default YUI Button style */ >-.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; >-} >- >-/* Dialog YUI Button disabled state */ >-.yui-skin-sam .yui-dialog .ft span.yui-button-disabled { >- background-position:0pt -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; >-} >- >-/* SimpleDialog icon styles */ >-.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; >-} >- >-/* Tooltip styles */ >-.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); /* For IE */ >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container.css b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container.css >deleted file mode 100644 >index 45f1e0b0af..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/skins/sam/container.css >+++ /dev/null >@@ -1,7 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-.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/koha-tmpl/intranet-tmpl/lib/yui/container/assets/tip16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/tip16_1.gif >deleted file mode 100644 >index 8f0be2b8d1fc2151459ddf48c8676f296489a32e..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 552 >zcmZ?wbhEHb6krfwcoxdAqKt250pG88J6`NoJHNgC#7vPV=gNM)KlSdk<?bnx=Qesg >z-75d_vh&vm!N=BSUt6d2>6-h;E3R*j89zJi_ws<w^&?$(7qGlPXR~Fh*V&CBw-5MU >z+GzOsruU28s!ujay*^_2>8jg}jVf1H%U_x=y1GH>{3efE$9ulq^}jNY_s7%7Yg^Q> >zZ&AOxukg+`jfa=Ee7NLzbDQSVEiw;Q@LgK3a&HmayE9fFE_$AvDtPZi>Gka<>-s%k >z9n`(GMepbgxjmD_e!N<=V~Wp)c9DO7zkGWX`t@GmmMQi>->ki{LVRtP{*x0vzu)HE >z*rxgVklvf)rq8x3zBy*}WTVvm#T@rfmVUgN{`~e~hJgl(KUo+V7(y9zKn?-L2?Kj; >zLugZTOKTgOrGd7zMO(9!ryG-*zam#3o3IlTuYjqwl1`hJJ(HKFjJS^<XPY;Vy0eP{ >zhX}V_n=yyJAUnG}bAV%8kgkw#a4@qWD_@@~zwAjlR@c5JN%xaR9@m@HGy+Y;B<_WZ >kGQMQAdKU8T{WBH@8)XKEXL>5O<_s*)niv=?xL6ph0rg?UhX4Qo > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/assets/warn16_1.gif b/koha-tmpl/intranet-tmpl/lib/yui/container/assets/warn16_1.gif >deleted file mode 100644 >index d679df5aae924ed5a4b16a921c3c4578cd6ea970..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 580 >zcmZ?wbhEHb6krfwc*el+xK`w8Ci9Cj{%bZ0KW-lQw59R=42!=X9>1HQ`TNnaZ`+e^ >zxiCGg7yWvC!5vSgkFyM)RZCt{XMB>%`sdC4t0s)k%aq@3nExPx>EmqU4>OHk)k?l; >zmwHep@UB<k+o{<X<QZO82|uY9|FEa?NgDHYE5>KJ>`yaTpH~^(FBLo^!f?M>@KLq! >zyFQK2XP13hAOB*u@2iQ4XT=z<nK6CZ-1y^Q$%kp$A7>l<xN+d;tsVCQnO?R?yy<uP >z{p$YLO%bo^#NKo$JxbvCu(t75DEF&Qr*{jIem%Ny)1K*yF5}lVuCIHXUiUhkm0-9Z >z%Jg}$^_@_TNAb)rDnz~=>AmgF^t_P!+l2!krs_OSVY}-K<O)AZ68bpT^y|?DFKU#3 >z9IJnn<M^Ob=xwL;|Ns9PXa*F2vM@3*Br)iKYyiax1N*{;q^9PU*0v;8Mn=~578XW{ >zP)3&CCTsgxE+((3ysEZ|?9yt{y)il_iHQkJqV2}P9(t=162cr?g(D=**cNV8h_q>O >z3Gm&T$hkGa!JyeyIZAdbXW(hOppYg{Dbv$z99yjz{Nj?#h4@c%Sjh2c$H!|Ji8%`> >xGW^tE_3^J0v%kfc?(0rR4(Mwo&Dn84<+vz2ch7_c1uBQyRW;c{tVB2%tO4c8+`#|< > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/container-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container-debug.js >deleted file mode 100644 >index ed1e9a7bb2..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container-debug.js >+++ /dev/null >@@ -1,9076 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function () { >- >- /** >- * Config is a utility used within an Object to allow the implementer to >- * maintain a list of local configuration properties and listen for changes >- * to those properties dynamically using CustomEvent. The initial values are >- * also maintained so that the configuration can be reset at any given point >- * to its initial state. >- * @namespace YAHOO.util >- * @class Config >- * @constructor >- * @param {Object} owner The owner Object to which this Config Object belongs >- */ >- YAHOO.util.Config = function (owner) { >- >- if (owner) { >- this.init(owner); >- } >- >- if (!owner) { YAHOO.log("No owner specified for Config object", "error", "Config"); } >- >- }; >- >- >- var Lang = YAHOO.lang, >- CustomEvent = YAHOO.util.CustomEvent, >- Config = YAHOO.util.Config; >- >- >- /** >- * Constant representing the CustomEvent type for the config changed event. >- * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT >- * @private >- * @static >- * @final >- */ >- Config.CONFIG_CHANGED_EVENT = "configChanged"; >- >- /** >- * Constant representing the boolean type string >- * @property YAHOO.util.Config.BOOLEAN_TYPE >- * @private >- * @static >- * @final >- */ >- Config.BOOLEAN_TYPE = "boolean"; >- >- Config.prototype = { >- >- /** >- * Object reference to the owner of this Config Object >- * @property owner >- * @type Object >- */ >- owner: null, >- >- /** >- * Boolean flag that specifies whether a queue is currently >- * being executed >- * @property queueInProgress >- * @type Boolean >- */ >- queueInProgress: false, >- >- /** >- * Maintains the local collection of configuration property objects and >- * their specified values >- * @property config >- * @private >- * @type Object >- */ >- config: null, >- >- /** >- * Maintains the local collection of configuration property objects as >- * they were initially applied. >- * This object is used when resetting a property. >- * @property initialConfig >- * @private >- * @type Object >- */ >- initialConfig: null, >- >- /** >- * Maintains the local, normalized CustomEvent queue >- * @property eventQueue >- * @private >- * @type Object >- */ >- eventQueue: null, >- >- /** >- * Custom Event, notifying subscribers when Config properties are set >- * (setProperty is called without the silent flag >- * @event configChangedEvent >- */ >- configChangedEvent: null, >- >- /** >- * Initializes the configuration Object and all of its local members. >- * @method init >- * @param {Object} owner The owner Object to which this Config >- * Object belongs >- */ >- init: function (owner) { >- >- this.owner = owner; >- >- this.configChangedEvent = >- this.createEvent(Config.CONFIG_CHANGED_EVENT); >- >- this.configChangedEvent.signature = CustomEvent.LIST; >- this.queueInProgress = false; >- this.config = {}; >- this.initialConfig = {}; >- this.eventQueue = []; >- >- }, >- >- /** >- * Validates that the value passed in is a Boolean. >- * @method checkBoolean >- * @param {Object} val The value to validate >- * @return {Boolean} true, if the value is valid >- */ >- checkBoolean: function (val) { >- return (typeof val == Config.BOOLEAN_TYPE); >- }, >- >- /** >- * Validates that the value passed in is a number. >- * @method checkNumber >- * @param {Object} val The value to validate >- * @return {Boolean} true, if the value is valid >- */ >- checkNumber: function (val) { >- return (!isNaN(val)); >- }, >- >- /** >- * Fires a configuration property event using the specified value. >- * @method fireEvent >- * @private >- * @param {String} key The configuration property's name >- * @param {value} Object The value of the correct type for the property >- */ >- fireEvent: function ( key, value ) { >- YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config"); >- var property = this.config[key]; >- >- if (property && property.event) { >- property.event.fire(value); >- } >- }, >- >- /** >- * Adds a property to the Config Object's private config hash. >- * @method addProperty >- * @param {String} key The configuration property's name >- * @param {Object} propertyObject The Object containing all of this >- * property's arguments >- */ >- addProperty: function ( key, propertyObject ) { >- key = key.toLowerCase(); >- YAHOO.log("Added property: " + key, "info", "Config"); >- >- this.config[key] = propertyObject; >- >- propertyObject.event = this.createEvent(key, { scope: this.owner }); >- propertyObject.event.signature = CustomEvent.LIST; >- >- >- propertyObject.key = key; >- >- if (propertyObject.handler) { >- propertyObject.event.subscribe(propertyObject.handler, >- this.owner); >- } >- >- this.setProperty(key, propertyObject.value, true); >- >- if (! propertyObject.suppressEvent) { >- this.queueProperty(key, propertyObject.value); >- } >- >- }, >- >- /** >- * Returns a key-value configuration map of the values currently set in >- * the Config Object. >- * @method getConfig >- * @return {Object} The current config, represented in a key-value map >- */ >- getConfig: function () { >- >- var cfg = {}, >- currCfg = this.config, >- prop, >- property; >- >- for (prop in currCfg) { >- if (Lang.hasOwnProperty(currCfg, prop)) { >- property = currCfg[prop]; >- if (property && property.event) { >- cfg[prop] = property.value; >- } >- } >- } >- >- return cfg; >- }, >- >- /** >- * Returns the value of specified property. >- * @method getProperty >- * @param {String} key The name of the property >- * @return {Object} The value of the specified property >- */ >- getProperty: function (key) { >- var property = this.config[key.toLowerCase()]; >- if (property && property.event) { >- return property.value; >- } else { >- return undefined; >- } >- }, >- >- /** >- * Resets the specified property's value to its initial value. >- * @method resetProperty >- * @param {String} key The name of the property >- * @return {Boolean} True is the property was reset, false if not >- */ >- resetProperty: function (key) { >- >- key = key.toLowerCase(); >- >- var property = this.config[key]; >- >- if (property && property.event) { >- >- if (this.initialConfig[key] && >- !Lang.isUndefined(this.initialConfig[key])) { >- >- this.setProperty(key, this.initialConfig[key]); >- >- return true; >- >- } >- >- } else { >- >- return false; >- } >- >- }, >- >- /** >- * Sets the value of a property. If the silent property is passed as >- * true, the property's event will not be fired. >- * @method setProperty >- * @param {String} key The name of the property >- * @param {String} value The value to set the property to >- * @param {Boolean} silent Whether the value should be set silently, >- * without firing the property event. >- * @return {Boolean} True, if the set was successful, false if it failed. >- */ >- setProperty: function (key, value, silent) { >- >- var property; >- >- key = key.toLowerCase(); >- YAHOO.log("setProperty: " + key + "=" + value, "info", "Config"); >- >- if (this.queueInProgress && ! silent) { >- // Currently running through a queue... >- this.queueProperty(key,value); >- return true; >- >- } else { >- property = this.config[key]; >- if (property && property.event) { >- if (property.validator && !property.validator(value)) { >- return false; >- } else { >- property.value = value; >- if (! silent) { >- this.fireEvent(key, value); >- this.configChangedEvent.fire([key, value]); >- } >- return true; >- } >- } else { >- return false; >- } >- } >- }, >- >- /** >- * Sets the value of a property and queues its event to execute. If the >- * event is already scheduled to execute, it is >- * moved from its current position to the end of the queue. >- * @method queueProperty >- * @param {String} key The name of the property >- * @param {String} value The value to set the property to >- * @return {Boolean} true, if the set was successful, false if >- * it failed. >- */ >- queueProperty: function (key, value) { >- >- key = key.toLowerCase(); >- YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config"); >- >- var property = this.config[key], >- foundDuplicate = false, >- iLen, >- queueItem, >- queueItemKey, >- queueItemValue, >- sLen, >- supercedesCheck, >- qLen, >- queueItemCheck, >- queueItemCheckKey, >- queueItemCheckValue, >- i, >- s, >- q; >- >- if (property && property.event) { >- >- if (!Lang.isUndefined(value) && property.validator && >- !property.validator(value)) { // validator >- return false; >- } else { >- >- if (!Lang.isUndefined(value)) { >- property.value = value; >- } else { >- value = property.value; >- } >- >- foundDuplicate = false; >- iLen = this.eventQueue.length; >- >- for (i = 0; i < iLen; i++) { >- queueItem = this.eventQueue[i]; >- >- if (queueItem) { >- queueItemKey = queueItem[0]; >- queueItemValue = queueItem[1]; >- >- if (queueItemKey == key) { >- >- /* >- found a dupe... push to end of queue, null >- current item, and break >- */ >- >- this.eventQueue[i] = null; >- >- this.eventQueue.push( >- [key, (!Lang.isUndefined(value) ? >- value : queueItemValue)]); >- >- foundDuplicate = true; >- break; >- } >- } >- } >- >- // this is a refire, or a new property in the queue >- >- if (! foundDuplicate && !Lang.isUndefined(value)) { >- this.eventQueue.push([key, value]); >- } >- } >- >- if (property.supercedes) { >- >- sLen = property.supercedes.length; >- >- for (s = 0; s < sLen; s++) { >- >- supercedesCheck = property.supercedes[s]; >- qLen = this.eventQueue.length; >- >- for (q = 0; q < qLen; q++) { >- queueItemCheck = this.eventQueue[q]; >- >- if (queueItemCheck) { >- queueItemCheckKey = queueItemCheck[0]; >- queueItemCheckValue = queueItemCheck[1]; >- >- if (queueItemCheckKey == >- supercedesCheck.toLowerCase() ) { >- >- this.eventQueue.push([queueItemCheckKey, >- queueItemCheckValue]); >- >- this.eventQueue[q] = null; >- break; >- >- } >- } >- } >- } >- } >- >- YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config"); >- >- return true; >- } else { >- return false; >- } >- }, >- >- /** >- * Fires the event for a property using the property's current value. >- * @method refireEvent >- * @param {String} key The name of the property >- */ >- refireEvent: function (key) { >- >- key = key.toLowerCase(); >- >- var property = this.config[key]; >- >- if (property && property.event && >- >- !Lang.isUndefined(property.value)) { >- >- if (this.queueInProgress) { >- >- this.queueProperty(key); >- >- } else { >- >- this.fireEvent(key, property.value); >- >- } >- >- } >- }, >- >- /** >- * Applies a key-value Object literal to the configuration, replacing >- * any existing values, and queueing the property events. >- * Although the values will be set, fireQueue() must be called for their >- * associated events to execute. >- * @method applyConfig >- * @param {Object} userConfig The configuration Object literal >- * @param {Boolean} init When set to true, the initialConfig will >- * be set to the userConfig passed in, so that calling a reset will >- * reset the properties to the passed values. >- */ >- applyConfig: function (userConfig, init) { >- >- var sKey, >- oConfig; >- >- if (init) { >- oConfig = {}; >- for (sKey in userConfig) { >- if (Lang.hasOwnProperty(userConfig, sKey)) { >- oConfig[sKey.toLowerCase()] = userConfig[sKey]; >- } >- } >- this.initialConfig = oConfig; >- } >- >- for (sKey in userConfig) { >- if (Lang.hasOwnProperty(userConfig, sKey)) { >- this.queueProperty(sKey, userConfig[sKey]); >- } >- } >- }, >- >- /** >- * Refires the events for all configuration properties using their >- * current values. >- * @method refresh >- */ >- refresh: function () { >- >- var prop; >- >- for (prop in this.config) { >- if (Lang.hasOwnProperty(this.config, prop)) { >- this.refireEvent(prop); >- } >- } >- }, >- >- /** >- * Fires the normalized list of queued property change events >- * @method fireQueue >- */ >- fireQueue: function () { >- >- var i, >- queueItem, >- key, >- value, >- property; >- >- this.queueInProgress = true; >- for (i = 0;i < this.eventQueue.length; i++) { >- queueItem = this.eventQueue[i]; >- if (queueItem) { >- >- key = queueItem[0]; >- value = queueItem[1]; >- property = this.config[key]; >- >- property.value = value; >- >- // Clear out queue entry, to avoid it being >- // re-added to the queue by any queueProperty/supercedes >- // calls which are invoked during fireEvent >- this.eventQueue[i] = null; >- >- this.fireEvent(key,value); >- } >- } >- >- this.queueInProgress = false; >- this.eventQueue = []; >- }, >- >- /** >- * Subscribes an external handler to the change event for any >- * given property. >- * @method subscribeToConfigEvent >- * @param {String} key The property name >- * @param {Function} handler The handler function to use subscribe to >- * the property's event >- * @param {Object} obj The Object to use for scoping the event handler >- * (see CustomEvent documentation) >- * @param {Boolean} overrideContext Optional. If true, will override >- * "this" within the handler to map to the scope Object passed into the >- * method. >- * @return {Boolean} True, if the subscription was successful, >- * otherwise false. >- */ >- subscribeToConfigEvent: function (key, handler, obj, overrideContext) { >- >- var property = this.config[key.toLowerCase()]; >- >- if (property && property.event) { >- if (!Config.alreadySubscribed(property.event, handler, obj)) { >- property.event.subscribe(handler, obj, overrideContext); >- } >- return true; >- } else { >- return false; >- } >- >- }, >- >- /** >- * Unsubscribes an external handler from the change event for any >- * given property. >- * @method unsubscribeFromConfigEvent >- * @param {String} key The property name >- * @param {Function} handler The handler function to use subscribe to >- * the property's event >- * @param {Object} obj The Object to use for scoping the event >- * handler (see CustomEvent documentation) >- * @return {Boolean} True, if the unsubscription was successful, >- * otherwise false. >- */ >- unsubscribeFromConfigEvent: function (key, handler, obj) { >- var property = this.config[key.toLowerCase()]; >- if (property && property.event) { >- return property.event.unsubscribe(handler, obj); >- } else { >- return false; >- } >- }, >- >- /** >- * Returns a string representation of the Config object >- * @method toString >- * @return {String} The Config object in string format. >- */ >- toString: function () { >- var output = "Config"; >- if (this.owner) { >- output += " [" + this.owner.toString() + "]"; >- } >- return output; >- }, >- >- /** >- * Returns a string representation of the Config object's current >- * CustomEvent queue >- * @method outputEventQueue >- * @return {String} The string list of CustomEvents currently queued >- * for execution >- */ >- outputEventQueue: function () { >- >- var output = "", >- queueItem, >- q, >- nQueue = this.eventQueue.length; >- >- for (q = 0; q < nQueue; q++) { >- queueItem = this.eventQueue[q]; >- if (queueItem) { >- output += queueItem[0] + "=" + queueItem[1] + ", "; >- } >- } >- return output; >- }, >- >- /** >- * Sets all properties to null, unsubscribes all listeners from each >- * property's change event and all listeners from the configChangedEvent. >- * @method destroy >- */ >- destroy: function () { >- >- var oConfig = this.config, >- sProperty, >- oProperty; >- >- >- for (sProperty in oConfig) { >- >- if (Lang.hasOwnProperty(oConfig, sProperty)) { >- >- oProperty = oConfig[sProperty]; >- >- oProperty.event.unsubscribeAll(); >- oProperty.event = null; >- >- } >- >- } >- >- this.configChangedEvent.unsubscribeAll(); >- >- this.configChangedEvent = null; >- this.owner = null; >- this.config = null; >- this.initialConfig = null; >- this.eventQueue = null; >- >- } >- >- }; >- >- >- >- /** >- * Checks to determine if a particular function/Object pair are already >- * subscribed to the specified CustomEvent >- * @method YAHOO.util.Config.alreadySubscribed >- * @static >- * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check >- * the subscriptions >- * @param {Function} fn The function to look for in the subscribers list >- * @param {Object} obj The execution scope Object for the subscription >- * @return {Boolean} true, if the function/Object pair is already subscribed >- * to the CustomEvent passed in >- */ >- Config.alreadySubscribed = function (evt, fn, obj) { >- >- var nSubscribers = evt.subscribers.length, >- subsc, >- i; >- >- if (nSubscribers > 0) { >- i = nSubscribers - 1; >- do { >- subsc = evt.subscribers[i]; >- if (subsc && subsc.obj == obj && subsc.fn == fn) { >- return true; >- } >- } >- while (i--); >- } >- >- return false; >- >- }; >- >- YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider); >- >-}()); >-(function () { >- >- /** >- * The Container family of components is designed to enable developers to >- * create different kinds of content-containing modules on the web. Module >- * and Overlay are the most basic containers, and they can be used directly >- * or extended to build custom containers. Also part of the Container family >- * are four UI controls that extend Module and Overlay: Tooltip, Panel, >- * Dialog, and SimpleDialog. >- * @module container >- * @title Container >- * @requires yahoo, dom, event >- * @optional dragdrop, animation, button >- */ >- >- /** >- * Module is a JavaScript representation of the Standard Module Format. >- * Standard Module Format is a simple standard for markup containers where >- * child nodes representing the header, body, and footer of the content are >- * denoted using the CSS classes "hd", "bd", and "ft" respectively. >- * Module is the base class for all other classes in the YUI >- * Container package. >- * @namespace YAHOO.widget >- * @class Module >- * @constructor >- * @param {String} el The element ID representing the Module <em>OR</em> >- * @param {HTMLElement} el The element representing the Module >- * @param {Object} userConfig The configuration Object literal containing >- * the configuration that should be set for this module. See configuration >- * documentation for more details. >- */ >- YAHOO.widget.Module = function (el, userConfig) { >- if (el) { >- this.init(el, userConfig); >- } else { >- YAHOO.log("No element or element ID specified" + >- " for Module instantiation", "error"); >- } >- }; >- >- var Dom = YAHOO.util.Dom, >- Config = YAHOO.util.Config, >- Event = YAHOO.util.Event, >- CustomEvent = YAHOO.util.CustomEvent, >- Module = YAHOO.widget.Module, >- UA = YAHOO.env.ua, >- >- m_oModuleTemplate, >- m_oHeaderTemplate, >- m_oBodyTemplate, >- m_oFooterTemplate, >- >- /** >- * Constant representing the name of the Module's events >- * @property EVENT_TYPES >- * @private >- * @final >- * @type Object >- */ >- EVENT_TYPES = { >- "BEFORE_INIT": "beforeInit", >- "INIT": "init", >- "APPEND": "append", >- "BEFORE_RENDER": "beforeRender", >- "RENDER": "render", >- "CHANGE_HEADER": "changeHeader", >- "CHANGE_BODY": "changeBody", >- "CHANGE_FOOTER": "changeFooter", >- "CHANGE_CONTENT": "changeContent", >- "DESTROY": "destroy", >- "BEFORE_SHOW": "beforeShow", >- "SHOW": "show", >- "BEFORE_HIDE": "beforeHide", >- "HIDE": "hide" >- }, >- >- /** >- * Constant representing the Module's configuration properties >- * @property DEFAULT_CONFIG >- * @private >- * @final >- * @type Object >- */ >- DEFAULT_CONFIG = { >- >- "VISIBLE": { >- key: "visible", >- value: true, >- validator: YAHOO.lang.isBoolean >- }, >- >- "EFFECT": { >- key: "effect", >- suppressEvent: true, >- supercedes: ["visible"] >- }, >- >- "MONITOR_RESIZE": { >- key: "monitorresize", >- value: true >- }, >- >- "APPEND_TO_DOCUMENT_BODY": { >- key: "appendtodocumentbody", >- value: false >- } >- }; >- >- /** >- * Constant representing the prefix path to use for non-secure images >- * @property YAHOO.widget.Module.IMG_ROOT >- * @static >- * @final >- * @type String >- */ >- Module.IMG_ROOT = null; >- >- /** >- * Constant representing the prefix path to use for securely served images >- * @property YAHOO.widget.Module.IMG_ROOT_SSL >- * @static >- * @final >- * @type String >- */ >- Module.IMG_ROOT_SSL = null; >- >- /** >- * Constant for the default CSS class name that represents a Module >- * @property YAHOO.widget.Module.CSS_MODULE >- * @static >- * @final >- * @type String >- */ >- Module.CSS_MODULE = "yui-module"; >- >- /** >- * Constant representing the module header >- * @property YAHOO.widget.Module.CSS_HEADER >- * @static >- * @final >- * @type String >- */ >- Module.CSS_HEADER = "hd"; >- >- /** >- * Constant representing the module body >- * @property YAHOO.widget.Module.CSS_BODY >- * @static >- * @final >- * @type String >- */ >- Module.CSS_BODY = "bd"; >- >- /** >- * Constant representing the module footer >- * @property YAHOO.widget.Module.CSS_FOOTER >- * @static >- * @final >- * @type String >- */ >- Module.CSS_FOOTER = "ft"; >- >- /** >- * Constant representing the url for the "src" attribute of the iframe >- * used to monitor changes to the browser's base font size >- * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL >- * @static >- * @final >- * @type String >- */ >- Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;"; >- >- /** >- * Constant representing the buffer amount (in pixels) to use when positioning >- * the text resize monitor offscreen. The resize monitor is positioned >- * offscreen by an amount eqaul to its offsetHeight + the buffer value. >- * >- * @property YAHOO.widget.Module.RESIZE_MONITOR_BUFFER >- * @static >- * @type Number >- */ >- // Set to 1, to work around pixel offset in IE8, which increases when zoom is used >- Module.RESIZE_MONITOR_BUFFER = 1; >- >- /** >- * Singleton CustomEvent fired when the font size is changed in the browser. >- * Opera's "zoom" functionality currently does not support text >- * size detection. >- * @event YAHOO.widget.Module.textResizeEvent >- */ >- Module.textResizeEvent = new CustomEvent("textResize"); >- >- /** >- * Helper utility method, which forces a document level >- * redraw for Opera, which can help remove repaint >- * irregularities after applying DOM changes. >- * >- * @method YAHOO.widget.Module.forceDocumentRedraw >- * @static >- */ >- Module.forceDocumentRedraw = function() { >- var docEl = document.documentElement; >- if (docEl) { >- docEl.className += " "; >- docEl.className = YAHOO.lang.trim(docEl.className); >- } >- }; >- >- function createModuleTemplate() { >- >- if (!m_oModuleTemplate) { >- m_oModuleTemplate = document.createElement("div"); >- >- m_oModuleTemplate.innerHTML = ("<div class=\"" + >- Module.CSS_HEADER + "\"></div>" + "<div class=\"" + >- Module.CSS_BODY + "\"></div><div class=\"" + >- Module.CSS_FOOTER + "\"></div>"); >- >- m_oHeaderTemplate = m_oModuleTemplate.firstChild; >- m_oBodyTemplate = m_oHeaderTemplate.nextSibling; >- m_oFooterTemplate = m_oBodyTemplate.nextSibling; >- } >- >- return m_oModuleTemplate; >- } >- >- function createHeader() { >- if (!m_oHeaderTemplate) { >- createModuleTemplate(); >- } >- return (m_oHeaderTemplate.cloneNode(false)); >- } >- >- function createBody() { >- if (!m_oBodyTemplate) { >- createModuleTemplate(); >- } >- return (m_oBodyTemplate.cloneNode(false)); >- } >- >- function createFooter() { >- if (!m_oFooterTemplate) { >- createModuleTemplate(); >- } >- return (m_oFooterTemplate.cloneNode(false)); >- } >- >- Module.prototype = { >- >- /** >- * The class's constructor function >- * @property contructor >- * @type Function >- */ >- constructor: Module, >- >- /** >- * The main module element that contains the header, body, and footer >- * @property element >- * @type HTMLElement >- */ >- element: null, >- >- /** >- * The header element, denoted with CSS class "hd" >- * @property header >- * @type HTMLElement >- */ >- header: null, >- >- /** >- * The body element, denoted with CSS class "bd" >- * @property body >- * @type HTMLElement >- */ >- body: null, >- >- /** >- * The footer element, denoted with CSS class "ft" >- * @property footer >- * @type HTMLElement >- */ >- footer: null, >- >- /** >- * The id of the element >- * @property id >- * @type String >- */ >- id: null, >- >- /** >- * A string representing the root path for all images created by >- * a Module instance. >- * @deprecated It is recommend that any images for a Module be applied >- * via CSS using the "background-image" property. >- * @property imageRoot >- * @type String >- */ >- imageRoot: Module.IMG_ROOT, >- >- /** >- * Initializes the custom events for Module which are fired >- * automatically at appropriate times by the Module class. >- * @method initEvents >- */ >- initEvents: function () { >- >- var SIGNATURE = CustomEvent.LIST; >- >- /** >- * CustomEvent fired prior to class initalization. >- * @event beforeInitEvent >- * @param {class} classRef class reference of the initializing >- * class, such as this.beforeInitEvent.fire(Module) >- */ >- this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT); >- this.beforeInitEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired after class initalization. >- * @event initEvent >- * @param {class} classRef class reference of the initializing >- * class, such as this.beforeInitEvent.fire(Module) >- */ >- this.initEvent = this.createEvent(EVENT_TYPES.INIT); >- this.initEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the Module is appended to the DOM >- * @event appendEvent >- */ >- this.appendEvent = this.createEvent(EVENT_TYPES.APPEND); >- this.appendEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired before the Module is rendered >- * @event beforeRenderEvent >- */ >- this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER); >- this.beforeRenderEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired after the Module is rendered >- * @event renderEvent >- */ >- this.renderEvent = this.createEvent(EVENT_TYPES.RENDER); >- this.renderEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the header content of the Module >- * is modified >- * @event changeHeaderEvent >- * @param {String/HTMLElement} content String/element representing >- * the new header content >- */ >- this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER); >- this.changeHeaderEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the body content of the Module is modified >- * @event changeBodyEvent >- * @param {String/HTMLElement} content String/element representing >- * the new body content >- */ >- this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY); >- this.changeBodyEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the footer content of the Module >- * is modified >- * @event changeFooterEvent >- * @param {String/HTMLElement} content String/element representing >- * the new footer content >- */ >- this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER); >- this.changeFooterEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the content of the Module is modified >- * @event changeContentEvent >- */ >- this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT); >- this.changeContentEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired when the Module is destroyed >- * @event destroyEvent >- */ >- this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY); >- this.destroyEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired before the Module is shown >- * @event beforeShowEvent >- */ >- this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW); >- this.beforeShowEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired after the Module is shown >- * @event showEvent >- */ >- this.showEvent = this.createEvent(EVENT_TYPES.SHOW); >- this.showEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired before the Module is hidden >- * @event beforeHideEvent >- */ >- this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE); >- this.beforeHideEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired after the Module is hidden >- * @event hideEvent >- */ >- this.hideEvent = this.createEvent(EVENT_TYPES.HIDE); >- this.hideEvent.signature = SIGNATURE; >- }, >- >- /** >- * String representing the current user-agent platform >- * @property platform >- * @type String >- */ >- platform: function () { >- var ua = navigator.userAgent.toLowerCase(); >- >- if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) { >- return "windows"; >- } else if (ua.indexOf("macintosh") != -1) { >- return "mac"; >- } else { >- return false; >- } >- }(), >- >- /** >- * String representing the user-agent of the browser >- * @deprecated Use YAHOO.env.ua >- * @property browser >- * @type String >- */ >- browser: function () { >- var ua = navigator.userAgent.toLowerCase(); >- /* >- Check Opera first in case of spoof and check Safari before >- Gecko since Safari's user agent string includes "like Gecko" >- */ >- if (ua.indexOf('opera') != -1) { >- return 'opera'; >- } else if (ua.indexOf('msie 7') != -1) { >- return 'ie7'; >- } else if (ua.indexOf('msie') != -1) { >- return 'ie'; >- } else if (ua.indexOf('safari') != -1) { >- return 'safari'; >- } else if (ua.indexOf('gecko') != -1) { >- return 'gecko'; >- } else { >- return false; >- } >- }(), >- >- /** >- * Boolean representing whether or not the current browsing context is >- * secure (https) >- * @property isSecure >- * @type Boolean >- */ >- isSecure: function () { >- if (window.location.href.toLowerCase().indexOf("https") === 0) { >- return true; >- } else { >- return false; >- } >- }(), >- >- /** >- * Initializes the custom events for Module which are fired >- * automatically at appropriate times by the Module class. >- */ >- initDefaultConfig: function () { >- // Add properties // >- /** >- * Specifies whether the Module is visible on the page. >- * @config visible >- * @type Boolean >- * @default true >- */ >- this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, { >- handler: this.configVisible, >- value: DEFAULT_CONFIG.VISIBLE.value, >- validator: DEFAULT_CONFIG.VISIBLE.validator >- }); >- >- /** >- * <p> >- * Object or array of objects representing the ContainerEffect >- * classes that are active for animating the container. >- * </p> >- * <p> >- * <strong>NOTE:</strong> Although this configuration >- * property is introduced at the Module level, an out of the box >- * implementation is not shipped for the Module class so setting >- * the proroperty on the Module class has no effect. The Overlay >- * class is the first class to provide out of the box ContainerEffect >- * support. >- * </p> >- * @config effect >- * @type Object >- * @default null >- */ >- this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, { >- suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, >- supercedes: DEFAULT_CONFIG.EFFECT.supercedes >- }); >- >- /** >- * Specifies whether to create a special proxy iframe to monitor >- * for user font resizing in the document >- * @config monitorresize >- * @type Boolean >- * @default true >- */ >- this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, { >- handler: this.configMonitorResize, >- value: DEFAULT_CONFIG.MONITOR_RESIZE.value >- }); >- >- /** >- * Specifies if the module should be rendered as the first child >- * of document.body or appended as the last child when render is called >- * with document.body as the "appendToNode". >- * <p> >- * Appending to the body while the DOM is still being constructed can >- * lead to Operation Aborted errors in IE hence this flag is set to >- * false by default. >- * </p> >- * >- * @config appendtodocumentbody >- * @type Boolean >- * @default false >- */ >- this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, { >- value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value >- }); >- }, >- >- /** >- * The Module class's initialization method, which is executed for >- * Module 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. >- * <p> >- * If the element passed in does not have an id, one will be generated >- * for it. >- * </p> >- * @method init >- * @param {String} el The element ID representing the Module <em>OR</em> >- * @param {HTMLElement} el The element representing the Module >- * @param {Object} userConfig The configuration Object literal >- * containing the configuration that should be set for this module. >- * See configuration documentation for more details. >- */ >- init: function (el, userConfig) { >- >- var elId, child; >- >- this.initEvents(); >- this.beforeInitEvent.fire(Module); >- >- /** >- * The Module's Config object used for monitoring >- * configuration properties. >- * @property cfg >- * @type YAHOO.util.Config >- */ >- this.cfg = new Config(this); >- >- if (this.isSecure) { >- this.imageRoot = Module.IMG_ROOT_SSL; >- } >- >- if (typeof el == "string") { >- elId = el; >- el = document.getElementById(el); >- if (! el) { >- el = (createModuleTemplate()).cloneNode(false); >- el.id = elId; >- } >- } >- >- this.id = Dom.generateId(el); >- this.element = el; >- >- child = this.element.firstChild; >- >- if (child) { >- var fndHd = false, fndBd = false, fndFt = false; >- do { >- // We're looking for elements >- if (1 == child.nodeType) { >- if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) { >- this.header = child; >- fndHd = true; >- } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) { >- this.body = child; >- fndBd = true; >- } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){ >- this.footer = child; >- fndFt = true; >- } >- } >- } while ((child = child.nextSibling)); >- } >- >- this.initDefaultConfig(); >- >- Dom.addClass(this.element, Module.CSS_MODULE); >- >- if (userConfig) { >- this.cfg.applyConfig(userConfig, true); >- } >- >- /* >- Subscribe to the fireQueue() method of Config so that any >- queued configuration changes are excecuted upon render of >- the Module >- */ >- >- if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) { >- this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true); >- } >- >- this.initEvent.fire(Module); >- }, >- >- /** >- * Initialize an empty IFRAME that is placed out of the visible area >- * that can be used to detect text resize. >- * @method initResizeMonitor >- */ >- initResizeMonitor: function () { >- >- var isGeckoWin = (UA.gecko && this.platform == "windows"); >- if (isGeckoWin) { >- // Help prevent spinning loading icon which >- // started with FireFox 2.0.0.8/Win >- var self = this; >- setTimeout(function(){self._initResizeMonitor();}, 0); >- } else { >- this._initResizeMonitor(); >- } >- }, >- >- /** >- * Create and initialize the text resize monitoring iframe. >- * >- * @protected >- * @method _initResizeMonitor >- */ >- _initResizeMonitor : function() { >- >- var oDoc, >- oIFrame, >- sHTML; >- >- function fireTextResize() { >- Module.textResizeEvent.fire(); >- } >- >- if (!UA.opera) { >- oIFrame = Dom.get("_yuiResizeMonitor"); >- >- var supportsCWResize = this._supportsCWResize(); >- >- if (!oIFrame) { >- oIFrame = document.createElement("iframe"); >- >- if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && UA.ie) { >- oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL; >- } >- >- if (!supportsCWResize) { >- // Can't monitor on contentWindow, so fire from inside iframe >- sHTML = ["<html><head><script ", >- "type=\"text/javascript\">", >- "window.onresize=function(){window.parent.", >- "YAHOO.widget.Module.textResizeEvent.", >- "fire();};<", >- "\/script></head>", >- "<body></body></html>"].join(''); >- >- oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML); >- } >- >- oIFrame.id = "_yuiResizeMonitor"; >- oIFrame.title = "Text Resize Monitor"; >- /* >- Need to set "position" property before inserting the >- iframe into the document or Safari's status bar will >- forever indicate the iframe is loading >- (See YUILibrary bug #1723064) >- */ >- oIFrame.style.position = "absolute"; >- oIFrame.style.visibility = "hidden"; >- >- var db = document.body, >- fc = db.firstChild; >- if (fc) { >- db.insertBefore(oIFrame, fc); >- } else { >- db.appendChild(oIFrame); >- } >- >- // Setting the background color fixes an issue with IE6/IE7, where >- // elements in the DOM, with -ve margin-top which positioned them >- // offscreen (so they would be overlapped by the iframe and its -ve top >- // setting), would have their -ve margin-top ignored, when the iframe >- // was added. >- oIFrame.style.backgroundColor = "transparent"; >- >- oIFrame.style.borderWidth = "0"; >- oIFrame.style.width = "2em"; >- oIFrame.style.height = "2em"; >- oIFrame.style.left = "0"; >- oIFrame.style.top = (-1 * (oIFrame.offsetHeight + Module.RESIZE_MONITOR_BUFFER)) + "px"; >- oIFrame.style.visibility = "visible"; >- >- /* >- Don't open/close the document for Gecko like we used to, since it >- leads to duplicate cookies. (See YUILibrary bug #1721755) >- */ >- if (UA.webkit) { >- oDoc = oIFrame.contentWindow.document; >- oDoc.open(); >- oDoc.close(); >- } >- } >- >- if (oIFrame && oIFrame.contentWindow) { >- Module.textResizeEvent.subscribe(this.onDomResize, this, true); >- >- if (!Module.textResizeInitialized) { >- if (supportsCWResize) { >- if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) { >- /* >- This will fail in IE if document.domain has >- changed, so we must change the listener to >- use the oIFrame element instead >- */ >- Event.on(oIFrame, "resize", fireTextResize); >- } >- } >- Module.textResizeInitialized = true; >- } >- this.resizeMonitor = oIFrame; >- } >- } >- }, >- >- /** >- * Text resize monitor helper method. >- * Determines if the browser supports resize events on iframe content windows. >- * >- * @private >- * @method _supportsCWResize >- */ >- _supportsCWResize : function() { >- /* >- Gecko 1.8.0 (FF1.5), 1.8.1.0-5 (FF2) won't fire resize on contentWindow. >- Gecko 1.8.1.6+ (FF2.0.0.6+) and all other browsers will fire resize on contentWindow. >- >- We don't want to start sniffing for patch versions, so fire textResize the same >- way on all FF2 flavors >- */ >- var bSupported = true; >- if (UA.gecko && UA.gecko <= 1.8) { >- bSupported = false; >- } >- return bSupported; >- }, >- >- /** >- * Event handler fired when the resize monitor element is resized. >- * @method onDomResize >- * @param {DOMEvent} e The DOM resize event >- * @param {Object} obj The scope object passed to the handler >- */ >- onDomResize: function (e, obj) { >- >- var nTop = -1 * (this.resizeMonitor.offsetHeight + Module.RESIZE_MONITOR_BUFFER); >- >- this.resizeMonitor.style.top = nTop + "px"; >- this.resizeMonitor.style.left = "0"; >- }, >- >- /** >- * Sets the Module's header content to the string specified, or appends >- * the passed element to the header. If no header is present, one will >- * be automatically created. An empty string can be passed to the method >- * to clear the contents of the header. >- * >- * @method setHeader >- * @param {String} headerContent The string used to set the header. >- * As a convenience, non HTMLElement objects can also be passed into >- * the method, and will be treated as strings, with the header innerHTML >- * set to their default toString implementations. >- * <em>OR</em> >- * @param {HTMLElement} headerContent The HTMLElement to append to >- * <em>OR</em> >- * @param {DocumentFragment} headerContent The document fragment >- * containing elements which are to be added to the header >- */ >- setHeader: function (headerContent) { >- var oHeader = this.header || (this.header = createHeader()); >- >- if (headerContent.nodeName) { >- oHeader.innerHTML = ""; >- oHeader.appendChild(headerContent); >- } else { >- oHeader.innerHTML = headerContent; >- } >- >- if (this._rendered) { >- this._renderHeader(); >- } >- >- this.changeHeaderEvent.fire(headerContent); >- this.changeContentEvent.fire(); >- >- }, >- >- /** >- * Appends the passed element to the header. If no header is present, >- * one will be automatically created. >- * @method appendToHeader >- * @param {HTMLElement | DocumentFragment} element The element to >- * append to the header. In the case of a document fragment, the >- * children of the fragment will be appended to the header. >- */ >- appendToHeader: function (element) { >- var oHeader = this.header || (this.header = createHeader()); >- >- oHeader.appendChild(element); >- >- this.changeHeaderEvent.fire(element); >- this.changeContentEvent.fire(); >- >- }, >- >- /** >- * Sets the Module'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. >- * @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. >- * <em>OR</em> >- * @param {HTMLElement} bodyContent The HTMLElement to add as the first and only >- * child of the body element. >- * <em>OR</em> >- * @param {DocumentFragment} bodyContent The document fragment >- * containing elements which are to be added to the body >- */ >- setBody: function (bodyContent) { >- var oBody = this.body || (this.body = createBody()); >- >- if (bodyContent.nodeName) { >- oBody.innerHTML = ""; >- oBody.appendChild(bodyContent); >- } else { >- oBody.innerHTML = bodyContent; >- } >- >- if (this._rendered) { >- this._renderBody(); >- } >- >- this.changeBodyEvent.fire(bodyContent); >- this.changeContentEvent.fire(); >- }, >- >- /** >- * Appends the passed element to the body. If no body is present, one >- * will be automatically created. >- * @method appendToBody >- * @param {HTMLElement | DocumentFragment} element The element to >- * append to the body. In the case of a document fragment, the >- * children of the fragment will be appended to the body. >- * >- */ >- appendToBody: function (element) { >- var oBody = this.body || (this.body = createBody()); >- >- oBody.appendChild(element); >- >- this.changeBodyEvent.fire(element); >- this.changeContentEvent.fire(); >- >- }, >- >- /** >- * Sets the Module's footer content to the HTML specified, or appends >- * the passed element to the footer. If no footer is present, one will >- * be automatically created. An empty string can be passed to the method >- * to clear the contents of the footer. >- * @method setFooter >- * @param {String} footerContent The HTML used to set the footer >- * As a convenience, non HTMLElement objects can also be passed into >- * the method, and will be treated as strings, with the footer innerHTML >- * set to their default toString implementations. >- * <em>OR</em> >- * @param {HTMLElement} footerContent The HTMLElement to append to >- * the footer >- * <em>OR</em> >- * @param {DocumentFragment} footerContent The document fragment containing >- * elements which are to be added to the footer >- */ >- setFooter: function (footerContent) { >- >- var oFooter = this.footer || (this.footer = createFooter()); >- >- if (footerContent.nodeName) { >- oFooter.innerHTML = ""; >- oFooter.appendChild(footerContent); >- } else { >- oFooter.innerHTML = footerContent; >- } >- >- if (this._rendered) { >- this._renderFooter(); >- } >- >- this.changeFooterEvent.fire(footerContent); >- this.changeContentEvent.fire(); >- }, >- >- /** >- * Appends the passed element to the footer. If no footer is present, >- * one will be automatically created. >- * @method appendToFooter >- * @param {HTMLElement | DocumentFragment} element The element to >- * append to the footer. In the case of a document fragment, the >- * children of the fragment will be appended to the footer >- */ >- appendToFooter: function (element) { >- >- var oFooter = this.footer || (this.footer = createFooter()); >- >- oFooter.appendChild(element); >- >- this.changeFooterEvent.fire(element); >- this.changeContentEvent.fire(); >- >- }, >- >- /** >- * Renders the Module by inserting the elements that are not already >- * in the main Module into their correct places. Optionally appends >- * the Module to the specified node prior to the render's execution. >- * <p> >- * For Modules 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. >- * </p> >- * <p> >- * NOTE: As of 2.3.1, if the appendToNode is the document's body element >- * then the module is rendered as the first child of the body element, >- * and not appended to it, to avoid Operation Aborted errors in IE when >- * rendering the module before window's load event is fired. You can >- * use the appendtodocumentbody configuration property to change this >- * to append to document.body if required. >- * </p> >- * @method render >- * @param {String} appendToNode The element id to which the Module >- * should be appended to prior to rendering <em>OR</em> >- * @param {HTMLElement} appendToNode The element to which the Module >- * should be appended to prior to rendering >- * @param {HTMLElement} moduleElement OPTIONAL. The element that >- * represents the actual Standard Module container. >- * @return {Boolean} Success or failure of the render >- */ >- render: function (appendToNode, moduleElement) { >- >- var me = this; >- >- function appendTo(parentNode) { >- if (typeof parentNode == "string") { >- parentNode = document.getElementById(parentNode); >- } >- >- if (parentNode) { >- me._addToParent(parentNode, me.element); >- me.appendEvent.fire(); >- } >- } >- >- this.beforeRenderEvent.fire(); >- >- if (! moduleElement) { >- moduleElement = this.element; >- } >- >- if (appendToNode) { >- appendTo(appendToNode); >- } else { >- // No node was passed in. If the element is not already in the Dom, this fails >- if (! Dom.inDocument(this.element)) { >- YAHOO.log("Render failed. Must specify appendTo node if " + " Module isn't already in the DOM.", "error"); >- return false; >- } >- } >- >- this._renderHeader(moduleElement); >- this._renderBody(moduleElement); >- this._renderFooter(moduleElement); >- >- this._rendered = true; >- >- this.renderEvent.fire(); >- return true; >- }, >- >- /** >- * Renders the currently set header into it's proper position under the >- * module element. If the module element is not provided, "this.element" >- * is used. >- * >- * @method _renderHeader >- * @protected >- * @param {HTMLElement} moduleElement Optional. A reference to the module element >- */ >- _renderHeader: function(moduleElement){ >- moduleElement = moduleElement || this.element; >- >- // Need to get everything into the DOM if it isn't already >- if (this.header && !Dom.inDocument(this.header)) { >- // There is a header, but it's not in the DOM yet. Need to add it. >- var firstChild = moduleElement.firstChild; >- if (firstChild) { >- moduleElement.insertBefore(this.header, firstChild); >- } else { >- moduleElement.appendChild(this.header); >- } >- } >- }, >- >- /** >- * Renders the currently set body into it's proper position under the >- * module element. If the module element is not provided, "this.element" >- * is used. >- * >- * @method _renderBody >- * @protected >- * @param {HTMLElement} moduleElement Optional. A reference to the module element. >- */ >- _renderBody: function(moduleElement){ >- moduleElement = moduleElement || this.element; >- >- if (this.body && !Dom.inDocument(this.body)) { >- // There is a body, but it's not in the DOM yet. Need to add it. >- if (this.footer && Dom.isAncestor(moduleElement, this.footer)) { >- moduleElement.insertBefore(this.body, this.footer); >- } else { >- moduleElement.appendChild(this.body); >- } >- } >- }, >- >- /** >- * Renders the currently set footer into it's proper position under the >- * module element. If the module element is not provided, "this.element" >- * is used. >- * >- * @method _renderFooter >- * @protected >- * @param {HTMLElement} moduleElement Optional. A reference to the module element >- */ >- _renderFooter: function(moduleElement){ >- moduleElement = moduleElement || this.element; >- >- if (this.footer && !Dom.inDocument(this.footer)) { >- // There is a footer, but it's not in the DOM yet. Need to add it. >- moduleElement.appendChild(this.footer); >- } >- }, >- >- /** >- * Removes the Module element from the DOM and sets all child elements >- * to null. >- * @method destroy >- */ >- destroy: function () { >- >- var parent; >- >- if (this.element) { >- Event.purgeElement(this.element, true); >- parent = this.element.parentNode; >- } >- >- if (parent) { >- parent.removeChild(this.element); >- } >- >- this.element = null; >- this.header = null; >- this.body = null; >- this.footer = null; >- >- Module.textResizeEvent.unsubscribe(this.onDomResize, this); >- >- this.cfg.destroy(); >- this.cfg = null; >- >- this.destroyEvent.fire(); >- }, >- >- /** >- * Shows the Module element by setting the visible configuration >- * property to true. Also fires two events: beforeShowEvent prior to >- * the visibility change, and showEvent after. >- * @method show >- */ >- show: function () { >- this.cfg.setProperty("visible", true); >- }, >- >- /** >- * Hides the Module element by setting the visible configuration >- * property to false. Also fires two events: beforeHideEvent prior to >- * the visibility change, and hideEvent after. >- * @method hide >- */ >- hide: function () { >- this.cfg.setProperty("visible", false); >- }, >- >- // BUILT-IN EVENT HANDLERS FOR MODULE // >- /** >- * Default event handler for changing the visibility property of a >- * Module. By default, this is achieved by switching the "display" style >- * between "block" and "none". >- * This method is responsible for firing showEvent and hideEvent. >- * @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. >- * @method configVisible >- */ >- configVisible: function (type, args, obj) { >- var visible = args[0]; >- if (visible) { >- this.beforeShowEvent.fire(); >- Dom.setStyle(this.element, "display", "block"); >- this.showEvent.fire(); >- } else { >- this.beforeHideEvent.fire(); >- Dom.setStyle(this.element, "display", "none"); >- this.hideEvent.fire(); >- } >- }, >- >- /** >- * Default event handler for the "monitorresize" configuration property >- * @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. >- * @method configMonitorResize >- */ >- configMonitorResize: function (type, args, obj) { >- var monitor = args[0]; >- if (monitor) { >- this.initResizeMonitor(); >- } else { >- Module.textResizeEvent.unsubscribe(this.onDomResize, this, true); >- this.resizeMonitor = null; >- } >- }, >- >- /** >- * This method is a protected helper, used when constructing the DOM structure for the module >- * to account for situations which may cause Operation Aborted errors in IE. It should not >- * be used for general DOM construction. >- * <p> >- * If the parentNode is not document.body, the element is appended as the last element. >- * </p> >- * <p> >- * If the parentNode is document.body the element is added as the first child to help >- * prevent Operation Aborted errors in IE. >- * </p> >- * >- * @param {parentNode} The HTML element to which the element will be added >- * @param {element} The HTML element to be added to parentNode's children >- * @method _addToParent >- * @protected >- */ >- _addToParent: function(parentNode, element) { >- if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) { >- parentNode.insertBefore(element, parentNode.firstChild); >- } else { >- parentNode.appendChild(element); >- } >- }, >- >- /** >- * Returns a String representation of the Object. >- * @method toString >- * @return {String} The string representation of the Module >- */ >- toString: function () { >- return "Module " + this.id; >- } >- }; >- >- YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider); >- >-}()); >-(function () { >- >- /** >- * Overlay is a Module that is absolutely positioned above the page flow. It >- * has convenience methods for positioning and sizing, as well as options for >- * controlling zIndex and constraining the Overlay's position to the current >- * visible viewport. Overlay also contains a dynamicly generated IFRAME which >- * is placed beneath it for Internet Explorer 6 and 5.x so that it will be >- * properly rendered above SELECT elements. >- * @namespace YAHOO.widget >- * @class Overlay >- * @extends YAHOO.widget.Module >- * @param {String} el The element ID representing the Overlay <em>OR</em> >- * @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. >- * @constructor >- */ >- YAHOO.widget.Overlay = function (el, userConfig) { >- YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig); >- }; >- >- var Lang = YAHOO.lang, >- CustomEvent = YAHOO.util.CustomEvent, >- Module = YAHOO.widget.Module, >- Event = YAHOO.util.Event, >- Dom = YAHOO.util.Dom, >- Config = YAHOO.util.Config, >- UA = YAHOO.env.ua, >- Overlay = YAHOO.widget.Overlay, >- >- _SUBSCRIBE = "subscribe", >- _UNSUBSCRIBE = "unsubscribe", >- _CONTAINED = "contained", >- >- m_oIFrameTemplate, >- >- /** >- * Constant representing the name of the Overlay's events >- * @property EVENT_TYPES >- * @private >- * @final >- * @type Object >- */ >- EVENT_TYPES = { >- "BEFORE_MOVE": "beforeMove", >- "MOVE": "move" >- }, >- >- /** >- * Constant representing the Overlay's configuration properties >- * @property DEFAULT_CONFIG >- * @private >- * @final >- * @type Object >- */ >- DEFAULT_CONFIG = { >- >- "X": { >- key: "x", >- validator: Lang.isNumber, >- suppressEvent: true, >- supercedes: ["iframe"] >- }, >- >- "Y": { >- key: "y", >- validator: Lang.isNumber, >- suppressEvent: true, >- supercedes: ["iframe"] >- }, >- >- "XY": { >- key: "xy", >- suppressEvent: true, >- supercedes: ["iframe"] >- }, >- >- "CONTEXT": { >- key: "context", >- suppressEvent: true, >- supercedes: ["iframe"] >- }, >- >- "FIXED_CENTER": { >- key: "fixedcenter", >- value: false, >- supercedes: ["iframe", "visible"] >- }, >- >- "WIDTH": { >- key: "width", >- suppressEvent: true, >- supercedes: ["context", "fixedcenter", "iframe"] >- }, >- >- "HEIGHT": { >- key: "height", >- suppressEvent: true, >- supercedes: ["context", "fixedcenter", "iframe"] >- }, >- >- "AUTO_FILL_HEIGHT" : { >- key: "autofillheight", >- supercedes: ["height"], >- value:"body" >- }, >- >- "ZINDEX": { >- key: "zindex", >- value: null >- }, >- >- "CONSTRAIN_TO_VIEWPORT": { >- key: "constraintoviewport", >- value: false, >- validator: Lang.isBoolean, >- supercedes: ["iframe", "x", "y", "xy"] >- }, >- >- "IFRAME": { >- key: "iframe", >- value: (UA.ie == 6 ? true : false), >- validator: Lang.isBoolean, >- supercedes: ["zindex"] >- }, >- >- "PREVENT_CONTEXT_OVERLAP": { >- key: "preventcontextoverlap", >- value: false, >- validator: Lang.isBoolean, >- supercedes: ["constraintoviewport"] >- } >- >- }; >- >- /** >- * The URL that will be placed in the iframe >- * @property YAHOO.widget.Overlay.IFRAME_SRC >- * @static >- * @final >- * @type String >- */ >- Overlay.IFRAME_SRC = "javascript:false;"; >- >- /** >- * Number representing how much the iframe shim should be offset from each >- * side of an Overlay instance, in pixels. >- * @property YAHOO.widget.Overlay.IFRAME_SRC >- * @default 3 >- * @static >- * @final >- * @type Number >- */ >- Overlay.IFRAME_OFFSET = 3; >- >- /** >- * Number representing the minimum distance an Overlay instance should be >- * positioned relative to the boundaries of the browser's viewport, in pixels. >- * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET >- * @default 10 >- * @static >- * @final >- * @type Number >- */ >- Overlay.VIEWPORT_OFFSET = 10; >- >- /** >- * Constant representing the top left corner of an element, used for >- * configuring the context element alignment >- * @property YAHOO.widget.Overlay.TOP_LEFT >- * @static >- * @final >- * @type String >- */ >- Overlay.TOP_LEFT = "tl"; >- >- /** >- * Constant representing the top right corner of an element, used for >- * configuring the context element alignment >- * @property YAHOO.widget.Overlay.TOP_RIGHT >- * @static >- * @final >- * @type String >- */ >- Overlay.TOP_RIGHT = "tr"; >- >- /** >- * Constant representing the top bottom left corner of an element, used for >- * configuring the context element alignment >- * @property YAHOO.widget.Overlay.BOTTOM_LEFT >- * @static >- * @final >- * @type String >- */ >- Overlay.BOTTOM_LEFT = "bl"; >- >- /** >- * Constant representing the bottom right corner of an element, used for >- * configuring the context element alignment >- * @property YAHOO.widget.Overlay.BOTTOM_RIGHT >- * @static >- * @final >- * @type String >- */ >- Overlay.BOTTOM_RIGHT = "br"; >- >- Overlay.PREVENT_OVERLAP_X = { >- "tltr": true, >- "blbr": true, >- "brbl": true, >- "trtl": true >- }; >- >- Overlay.PREVENT_OVERLAP_Y = { >- "trbr": true, >- "tlbl": true, >- "bltl": true, >- "brtr": true >- }; >- >- /** >- * Constant representing the default CSS class used for an Overlay >- * @property YAHOO.widget.Overlay.CSS_OVERLAY >- * @static >- * @final >- * @type String >- */ >- Overlay.CSS_OVERLAY = "yui-overlay"; >- >- /** >- * Constant representing the default hidden CSS class used for an Overlay. This class is >- * applied to the overlay's outer DIV whenever it's hidden. >- * >- * @property YAHOO.widget.Overlay.CSS_HIDDEN >- * @static >- * @final >- * @type String >- */ >- Overlay.CSS_HIDDEN = "yui-overlay-hidden"; >- >- /** >- * Constant representing the default CSS class used for an Overlay iframe shim. >- * >- * @property YAHOO.widget.Overlay.CSS_IFRAME >- * @static >- * @final >- * @type String >- */ >- Overlay.CSS_IFRAME = "yui-overlay-iframe"; >- >- /** >- * Constant representing the names of the standard module elements >- * used in the overlay. >- * @property YAHOO.widget.Overlay.STD_MOD_RE >- * @static >- * @final >- * @type RegExp >- */ >- Overlay.STD_MOD_RE = /^\s*?(body|footer|header)\s*?$/i; >- >- /** >- * A singleton CustomEvent used for reacting to the DOM event for >- * window scroll >- * @event YAHOO.widget.Overlay.windowScrollEvent >- */ >- Overlay.windowScrollEvent = new CustomEvent("windowScroll"); >- >- /** >- * A singleton CustomEvent used for reacting to the DOM event for >- * window resize >- * @event YAHOO.widget.Overlay.windowResizeEvent >- */ >- Overlay.windowResizeEvent = new CustomEvent("windowResize"); >- >- /** >- * The DOM event handler used to fire the CustomEvent for window scroll >- * @method YAHOO.widget.Overlay.windowScrollHandler >- * @static >- * @param {DOMEvent} e The DOM scroll event >- */ >- Overlay.windowScrollHandler = function (e) { >- var t = Event.getTarget(e); >- >- // - Webkit (Safari 2/3) and Opera 9.2x bubble scroll events from elements to window >- // - FF2/3 and IE6/7, Opera 9.5x don't bubble scroll events from elements to window >- // - IE doesn't recognize scroll registered on the document. >- // >- // Also, when document view is scrolled, IE doesn't provide a target, >- // rest of the browsers set target to window.document, apart from opera >- // which sets target to window. >- if (!t || t === window || t === window.document) { >- if (UA.ie) { >- >- if (! window.scrollEnd) { >- window.scrollEnd = -1; >- } >- >- clearTimeout(window.scrollEnd); >- >- window.scrollEnd = setTimeout(function () { >- Overlay.windowScrollEvent.fire(); >- }, 1); >- >- } else { >- Overlay.windowScrollEvent.fire(); >- } >- } >- }; >- >- /** >- * The DOM event handler used to fire the CustomEvent for window resize >- * @method YAHOO.widget.Overlay.windowResizeHandler >- * @static >- * @param {DOMEvent} e The DOM resize event >- */ >- Overlay.windowResizeHandler = function (e) { >- >- if (UA.ie) { >- if (! window.resizeEnd) { >- window.resizeEnd = -1; >- } >- >- clearTimeout(window.resizeEnd); >- >- window.resizeEnd = setTimeout(function () { >- Overlay.windowResizeEvent.fire(); >- }, 100); >- } else { >- Overlay.windowResizeEvent.fire(); >- } >- }; >- >- /** >- * A boolean that indicated whether the window resize and scroll events have >- * already been subscribed to. >- * @property YAHOO.widget.Overlay._initialized >- * @private >- * @type Boolean >- */ >- Overlay._initialized = null; >- >- if (Overlay._initialized === null) { >- Event.on(window, "scroll", Overlay.windowScrollHandler); >- Event.on(window, "resize", Overlay.windowResizeHandler); >- Overlay._initialized = true; >- } >- >- /** >- * Internal map of special event types, which are provided >- * by the instance. It maps the event type to the custom event >- * instance. Contains entries for the "windowScroll", "windowResize" and >- * "textResize" static container events. >- * >- * @property YAHOO.widget.Overlay._TRIGGER_MAP >- * @type Object >- * @static >- * @private >- */ >- Overlay._TRIGGER_MAP = { >- "windowScroll" : Overlay.windowScrollEvent, >- "windowResize" : Overlay.windowResizeEvent, >- "textResize" : Module.textResizeEvent >- }; >- >- YAHOO.extend(Overlay, Module, { >- >- /** >- * <p> >- * Array of default event types which will trigger >- * context alignment for the Overlay class. >- * </p> >- * <p>The array is empty by default for Overlay, >- * but maybe populated in future releases, so classes extending >- * Overlay which need to define their own set of CONTEXT_TRIGGERS >- * should concatenate their super class's prototype.CONTEXT_TRIGGERS >- * value with their own array of values. >- * </p> >- * <p> >- * E.g.: >- * <code>CustomOverlay.prototype.CONTEXT_TRIGGERS = YAHOO.widget.Overlay.prototype.CONTEXT_TRIGGERS.concat(["windowScroll"]);</code> >- * </p> >- * >- * @property CONTEXT_TRIGGERS >- * @type Array >- * @final >- */ >- CONTEXT_TRIGGERS : [], >- >- /** >- * 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 <em>OR</em> >- * @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 >- */ >- >- Overlay.superclass.init.call(this, el/*, userConfig*/); >- >- this.beforeInitEvent.fire(Overlay); >- >- Dom.addClass(this.element, Overlay.CSS_OVERLAY); >- >- if (userConfig) { >- this.cfg.applyConfig(userConfig, true); >- } >- >- if (this.platform == "mac" && UA.gecko) { >- >- if (! Config.alreadySubscribed(this.showEvent, >- this.showMacGeckoScrollbars, this)) { >- >- this.showEvent.subscribe(this.showMacGeckoScrollbars, >- this, true); >- >- } >- >- if (! Config.alreadySubscribed(this.hideEvent, >- this.hideMacGeckoScrollbars, this)) { >- >- this.hideEvent.subscribe(this.hideMacGeckoScrollbars, >- this, true); >- >- } >- } >- >- this.initEvent.fire(Overlay); >- }, >- >- /** >- * Initializes the custom events for Overlay which are fired >- * automatically at appropriate times by the Overlay class. >- * @method initEvents >- */ >- initEvents: function () { >- >- Overlay.superclass.initEvents.call(this); >- >- var SIGNATURE = CustomEvent.LIST; >- >- /** >- * CustomEvent fired before the Overlay is moved. >- * @event beforeMoveEvent >- * @param {Number} x x coordinate >- * @param {Number} y y coordinate >- */ >- this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE); >- this.beforeMoveEvent.signature = SIGNATURE; >- >- /** >- * CustomEvent fired after the Overlay is moved. >- * @event moveEvent >- * @param {Number} x x coordinate >- * @param {Number} y y coordinate >- */ >- this.moveEvent = this.createEvent(EVENT_TYPES.MOVE); >- this.moveEvent.signature = SIGNATURE; >- >- }, >- >- /** >- * Initializes the class's configurable properties which can be changed >- * using the Overlay's Config object (cfg). >- * @method initDefaultConfig >- */ >- initDefaultConfig: function () { >- >- Overlay.superclass.initDefaultConfig.call(this); >- >- var cfg = this.cfg; >- >- // Add overlay config properties // >- >- /** >- * The absolute x-coordinate position of the Overlay >- * @config x >- * @type Number >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.X.key, { >- >- handler: this.configX, >- validator: DEFAULT_CONFIG.X.validator, >- suppressEvent: DEFAULT_CONFIG.X.suppressEvent, >- supercedes: DEFAULT_CONFIG.X.supercedes >- >- }); >- >- /** >- * The absolute y-coordinate position of the Overlay >- * @config y >- * @type Number >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.Y.key, { >- >- handler: this.configY, >- validator: DEFAULT_CONFIG.Y.validator, >- suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, >- supercedes: DEFAULT_CONFIG.Y.supercedes >- >- }); >- >- /** >- * An array with the absolute x and y positions of the Overlay >- * @config xy >- * @type Number[] >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.XY.key, { >- handler: this.configXY, >- suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, >- supercedes: DEFAULT_CONFIG.XY.supercedes >- }); >- >- /** >- * <p> >- * The array of context arguments for context-sensitive positioning. >- * </p> >- * >- * <p> >- * The format of the array is: <code>[contextElementOrId, overlayCorner, contextCorner, arrayOfTriggerEvents (optional), xyOffset (optional)]</code>, the >- * the 5 array elements described in detail below: >- * </p> >- * >- * <dl> >- * <dt>contextElementOrId <String|HTMLElement></dt> >- * <dd>A reference to the context element to which the overlay should be aligned (or it's id).</dd> >- * <dt>overlayCorner <String></dt> >- * <dd>The corner of the overlay which is to be used for alignment. This corner will be aligned to the >- * corner of the context element defined by the "contextCorner" entry which follows. Supported string values are: >- * "tr" (top right), "tl" (top left), "br" (bottom right), or "bl" (bottom left).</dd> >- * <dt>contextCorner <String></dt> >- * <dd>The corner of the context element which is to be used for alignment. Supported string values are the same ones listed for the "overlayCorner" entry above.</dd> >- * <dt>arrayOfTriggerEvents (optional) <Array[String|CustomEvent]></dt> >- * <dd> >- * <p> >- * By default, context alignment is a one time operation, aligning the Overlay to the context element when context configuration property is set, or when the <a href="#method_align">align</a> >- * method is invoked. However, you can use the optional "arrayOfTriggerEvents" entry to define the list of events which should force the overlay to re-align itself with the context element. >- * This is useful in situations where the layout of the document may change, resulting in the context element's position being modified. >- * </p> >- * <p> >- * The array can contain either event type strings for events the instance publishes (e.g. "beforeShow") or CustomEvent instances. Additionally the following >- * 3 static container event types are also currently supported : <code>"windowResize", "windowScroll", "textResize"</code> (defined in <a href="#property__TRIGGER_MAP">_TRIGGER_MAP</a> private property). >- * </p> >- * </dd> >- * <dt>xyOffset <Number[]></dt> >- * <dd> >- * A 2 element Array specifying the X and Y pixel amounts by which the Overlay should be offset from the aligned corner. e.g. [5,0] offsets the Overlay 5 pixels to the left, <em>after</em> aligning the given context corners. >- * NOTE: If using this property and no triggers need to be defined, the arrayOfTriggerEvents property should be set to null to maintain correct array positions for the arguments. >- * </dd> >- * </dl> >- * >- * <p> >- * For example, setting this property to <code>["img1", "tl", "bl"]</code> will >- * align the Overlay's top left corner to the bottom left corner of the >- * context element with id "img1". >- * </p> >- * <p> >- * Setting this property to <code>["img1", "tl", "bl", null, [0,5]</code> will >- * align the Overlay's top left corner to the bottom left corner of the >- * context element with id "img1", and then offset it by 5 pixels on the Y axis (providing a 5 pixel gap between the bottom of the context element and top of the overlay). >- * </p> >- * <p> >- * Adding the optional trigger values: <code>["img1", "tl", "bl", ["beforeShow", "windowResize"], [0,5]]</code>, >- * will re-align the overlay position, whenever the "beforeShow" or "windowResize" events are fired. >- * </p> >- * >- * @config context >- * @type Array >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, { >- handler: this.configContext, >- suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, >- supercedes: DEFAULT_CONFIG.CONTEXT.supercedes >- }); >- >- /** >- * Determines whether or not the Overlay should be anchored >- * to the center of the viewport. >- * >- * <p>This property can be set to:</p> >- * >- * <dl> >- * <dt>true</dt> >- * <dd> >- * To enable fixed center positioning >- * <p> >- * When enabled, the overlay will >- * be positioned in the center of viewport when initially displayed, and >- * will remain in the center of the viewport whenever the window is >- * scrolled or resized. >- * </p> >- * <p> >- * If the overlay is too big for the viewport, >- * it's top left corner will be aligned with the top left corner of the viewport. >- * </p> >- * </dd> >- * <dt>false</dt> >- * <dd> >- * To disable fixed center positioning. >- * <p>In this case the overlay can still be >- * centered as a one-off operation, by invoking the <code>center()</code> method, >- * however it will not remain centered when the window is scrolled/resized. >- * </dd> >- * <dt>"contained"<dt> >- * <dd>To enable fixed center positioning, as with the <code>true</code> option. >- * <p>However, unlike setting the property to <code>true</code>, >- * when the property is set to <code>"contained"</code>, if the overlay is >- * too big for the viewport, it will not get automatically centered when the >- * user scrolls or resizes the window (until the window is large enough to contain the >- * overlay). This is useful in cases where the Overlay has both header and footer >- * UI controls which the user may need to access. >- * </p> >- * </dd> >- * </dl> >- * >- * @config fixedcenter >- * @type Boolean | String >- * @default false >- */ >- cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, { >- handler: this.configFixedCenter, >- value: DEFAULT_CONFIG.FIXED_CENTER.value, >- validator: DEFAULT_CONFIG.FIXED_CENTER.validator, >- supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes >- }); >- >- /** >- * CSS width of the Overlay. >- * @config width >- * @type String >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, { >- handler: this.configWidth, >- suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, >- supercedes: DEFAULT_CONFIG.WIDTH.supercedes >- }); >- >- /** >- * CSS height of the Overlay. >- * @config height >- * @type String >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, { >- handler: this.configHeight, >- suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, >- supercedes: DEFAULT_CONFIG.HEIGHT.supercedes >- }); >- >- /** >- * Standard module element which should auto fill out the height of the Overlay if the height config property is set. >- * Supported values are "header", "body", "footer". >- * >- * @config autofillheight >- * @type String >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.AUTO_FILL_HEIGHT.key, { >- handler: this.configAutoFillHeight, >- value : DEFAULT_CONFIG.AUTO_FILL_HEIGHT.value, >- validator : this._validateAutoFill, >- supercedes: DEFAULT_CONFIG.AUTO_FILL_HEIGHT.supercedes >- }); >- >- /** >- * CSS z-index of the Overlay. >- * @config zIndex >- * @type Number >- * @default null >- */ >- cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, { >- handler: this.configzIndex, >- value: DEFAULT_CONFIG.ZINDEX.value >- }); >- >- /** >- * True if the Overlay should be prevented from being positioned >- * out of the viewport. >- * @config constraintoviewport >- * @type Boolean >- * @default false >- */ >- cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, { >- >- handler: this.configConstrainToViewport, >- value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, >- validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, >- supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes >- >- }); >- >- /** >- * @config iframe >- * @description Boolean indicating whether or not the Overlay should >- * have an IFRAME shim; used to prevent SELECT elements from >- * poking through an Overlay instance in IE6. When set to "true", >- * the iframe shim is created when the Overlay instance is intially >- * made visible. >- * @type Boolean >- * @default true for IE6 and below, false for all other browsers. >- */ >- cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, { >- >- handler: this.configIframe, >- value: DEFAULT_CONFIG.IFRAME.value, >- validator: DEFAULT_CONFIG.IFRAME.validator, >- supercedes: DEFAULT_CONFIG.IFRAME.supercedes >- >- }); >- >- /** >- * @config preventcontextoverlap >- * @description Boolean indicating whether or not the Overlay should overlap its >- * context element (defined using the "context" configuration property) when the >- * "constraintoviewport" configuration property is set to "true". >- * @type Boolean >- * @default false >- */ >- cfg.addProperty(DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.key, { >- value: DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.value, >- validator: DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.validator, >- supercedes: DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.supercedes >- }); >- }, >- >- /** >- * Moves the Overlay to the specified position. This function is >- * identical to calling this.cfg.setProperty("xy", [x,y]); >- * @method moveTo >- * @param {Number} x The Overlay's new x position >- * @param {Number} y The Overlay's new y position >- */ >- moveTo: function (x, y) { >- this.cfg.setProperty("xy", [x, y]); >- }, >- >- /** >- * Adds a CSS class ("hide-scrollbars") and removes a CSS class >- * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X >- * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435) >- * @method hideMacGeckoScrollbars >- */ >- hideMacGeckoScrollbars: function () { >- Dom.replaceClass(this.element, "show-scrollbars", "hide-scrollbars"); >- }, >- >- /** >- * Adds a CSS class ("show-scrollbars") and removes a CSS class >- * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X >- * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435) >- * @method showMacGeckoScrollbars >- */ >- showMacGeckoScrollbars: function () { >- Dom.replaceClass(this.element, "hide-scrollbars", "show-scrollbars"); >- }, >- >- /** >- * Internal implementation to set the visibility of the overlay in the DOM. >- * >- * @method _setDomVisibility >- * @param {boolean} visible Whether to show or hide the Overlay's outer element >- * @protected >- */ >- _setDomVisibility : function(show) { >- Dom.setStyle(this.element, "visibility", (show) ? "visible" : "hidden"); >- var hiddenClass = Overlay.CSS_HIDDEN; >- >- if (show) { >- Dom.removeClass(this.element, hiddenClass); >- } else { >- Dom.addClass(this.element, hiddenClass); >- } >- }, >- >- // BEGIN BUILT-IN PROPERTY EVENT HANDLERS // >- /** >- * The default event handler fired when the "visible" property is >- * changed. This method is responsible for firing showEvent >- * and hideEvent. >- * @method configVisible >- * @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. >- */ >- configVisible: function (type, args, obj) { >- >- var visible = args[0], >- currentVis = Dom.getStyle(this.element, "visibility"), >- effect = this.cfg.getProperty("effect"), >- effectInstances = [], >- isMacGecko = (this.platform == "mac" && UA.gecko), >- alreadySubscribed = Config.alreadySubscribed, >- eff, ei, e, i, j, k, h, >- nEffects, >- nEffectInstances; >- >- if (currentVis == "inherit") { >- e = this.element.parentNode; >- >- while (e.nodeType != 9 && e.nodeType != 11) { >- currentVis = Dom.getStyle(e, "visibility"); >- >- if (currentVis != "inherit") { >- break; >- } >- >- e = e.parentNode; >- } >- >- if (currentVis == "inherit") { >- currentVis = "visible"; >- } >- } >- >- if (effect) { >- if (effect instanceof Array) { >- nEffects = effect.length; >- >- for (i = 0; i < nEffects; i++) { >- eff = effect[i]; >- effectInstances[effectInstances.length] = >- eff.effect(this, eff.duration); >- >- } >- } else { >- effectInstances[effectInstances.length] = >- effect.effect(this, effect.duration); >- } >- } >- >- if (visible) { // Show >- if (isMacGecko) { >- this.showMacGeckoScrollbars(); >- } >- >- if (effect) { // Animate in >- if (visible) { // Animate in if not showing >- if (currentVis != "visible" || currentVis === "") { >- this.beforeShowEvent.fire(); >- nEffectInstances = effectInstances.length; >- >- for (j = 0; j < nEffectInstances; j++) { >- ei = effectInstances[j]; >- if (j === 0 && !alreadySubscribed( >- ei.animateInCompleteEvent, >- this.showEvent.fire, this.showEvent)) { >- >- /* >- Delegate showEvent until end >- of animateInComplete >- */ >- >- ei.animateInCompleteEvent.subscribe( >- this.showEvent.fire, this.showEvent, true); >- } >- ei.animateIn(); >- } >- } >- } >- } else { // Show >- if (currentVis != "visible" || currentVis === "") { >- this.beforeShowEvent.fire(); >- >- this._setDomVisibility(true); >- >- this.cfg.refireEvent("iframe"); >- this.showEvent.fire(); >- } else { >- this._setDomVisibility(true); >- } >- } >- } else { // Hide >- >- if (isMacGecko) { >- this.hideMacGeckoScrollbars(); >- } >- >- if (effect) { // Animate out if showing >- if (currentVis == "visible") { >- this.beforeHideEvent.fire(); >- >- nEffectInstances = effectInstances.length; >- for (k = 0; k < nEffectInstances; k++) { >- h = effectInstances[k]; >- >- if (k === 0 && !alreadySubscribed( >- h.animateOutCompleteEvent, this.hideEvent.fire, >- this.hideEvent)) { >- >- /* >- Delegate hideEvent until end >- of animateOutComplete >- */ >- >- h.animateOutCompleteEvent.subscribe( >- this.hideEvent.fire, this.hideEvent, true); >- >- } >- h.animateOut(); >- } >- >- } else if (currentVis === "") { >- this._setDomVisibility(false); >- } >- >- } else { // Simple hide >- >- if (currentVis == "visible" || currentVis === "") { >- this.beforeHideEvent.fire(); >- this._setDomVisibility(false); >- this.hideEvent.fire(); >- } else { >- this._setDomVisibility(false); >- } >- } >- } >- }, >- >- /** >- * Fixed center event handler used for centering on scroll/resize, but only if >- * the overlay is visible and, if "fixedcenter" is set to "contained", only if >- * the overlay fits within the viewport. >- * >- * @method doCenterOnDOMEvent >- */ >- doCenterOnDOMEvent: function () { >- var cfg = this.cfg, >- fc = cfg.getProperty("fixedcenter"); >- >- if (cfg.getProperty("visible")) { >- if (fc && (fc !== _CONTAINED || this.fitsInViewport())) { >- this.center(); >- } >- } >- }, >- >- /** >- * Determines if the Overlay (including the offset value defined by Overlay.VIEWPORT_OFFSET) >- * will fit entirely inside the viewport, in both dimensions - width and height. >- * >- * @method fitsInViewport >- * @return boolean true if the Overlay will fit, false if not >- */ >- fitsInViewport : function() { >- var nViewportOffset = Overlay.VIEWPORT_OFFSET, >- element = this.element, >- elementWidth = element.offsetWidth, >- elementHeight = element.offsetHeight, >- viewportWidth = Dom.getViewportWidth(), >- viewportHeight = Dom.getViewportHeight(); >- >- return ((elementWidth + nViewportOffset < viewportWidth) && (elementHeight + nViewportOffset < viewportHeight)); >- }, >- >- /** >- * The default event handler fired when the "fixedcenter" property >- * is changed. >- * @method configFixedCenter >- * @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. >- */ >- configFixedCenter: function (type, args, obj) { >- >- var val = args[0], >- alreadySubscribed = Config.alreadySubscribed, >- windowResizeEvent = Overlay.windowResizeEvent, >- windowScrollEvent = Overlay.windowScrollEvent; >- >- if (val) { >- this.center(); >- >- if (!alreadySubscribed(this.beforeShowEvent, this.center)) { >- this.beforeShowEvent.subscribe(this.center); >- } >- >- if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) { >- windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true); >- } >- >- if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) { >- windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true); >- } >- >- } else { >- this.beforeShowEvent.unsubscribe(this.center); >- >- windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this); >- windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this); >- } >- }, >- >- /** >- * 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.element; >- >- Dom.setStyle(el, "height", height); >- this.cfg.refireEvent("iframe"); >- }, >- >- /** >- * The default event handler fired when the "autofillheight" property is changed. >- * @method configAutoFillHeight >- * >- * @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. >- */ >- configAutoFillHeight: function (type, args, obj) { >- var fillEl = args[0], >- cfg = this.cfg, >- autoFillHeight = "autofillheight", >- height = "height", >- currEl = cfg.getProperty(autoFillHeight), >- autoFill = this._autoFillOnHeightChange; >- >- cfg.unsubscribeFromConfigEvent(height, autoFill); >- Module.textResizeEvent.unsubscribe(autoFill); >- this.changeContentEvent.unsubscribe(autoFill); >- >- if (currEl && fillEl !== currEl && this[currEl]) { >- Dom.setStyle(this[currEl], height, ""); >- } >- >- if (fillEl) { >- fillEl = Lang.trim(fillEl.toLowerCase()); >- >- cfg.subscribeToConfigEvent(height, autoFill, this[fillEl], this); >- Module.textResizeEvent.subscribe(autoFill, this[fillEl], this); >- this.changeContentEvent.subscribe(autoFill, this[fillEl], this); >- >- cfg.setProperty(autoFillHeight, fillEl, true); >- } >- }, >- >- /** >- * 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.element; >- >- 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) { >- >- var zIndex = args[0], >- el = this.element; >- >- if (! zIndex) { >- zIndex = Dom.getStyle(el, "zIndex"); >- if (! zIndex || isNaN(zIndex)) { >- zIndex = 0; >- } >- } >- >- if (this.iframe || this.cfg.getProperty("iframe") === true) { >- if (zIndex <= 0) { >- zIndex = 1; >- } >- } >- >- Dom.setStyle(el, "zIndex", zIndex); >- this.cfg.setProperty("zIndex", zIndex, true); >- >- if (this.iframe) { >- this.stackIframe(); >- } >- }, >- >- /** >- * The default event handler fired when the "xy" property is changed. >- * @method configXY >- * @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. >- */ >- configXY: function (type, args, obj) { >- >- var pos = args[0], >- x = pos[0], >- y = pos[1]; >- >- this.cfg.setProperty("x", x); >- this.cfg.setProperty("y", y); >- >- this.beforeMoveEvent.fire([x, y]); >- >- x = this.cfg.getProperty("x"); >- y = this.cfg.getProperty("y"); >- >- YAHOO.log(("xy: " + [x, y]), "iframe"); >- >- this.cfg.refireEvent("iframe"); >- this.moveEvent.fire([x, y]); >- }, >- >- /** >- * The default event handler fired when the "x" property is changed. >- * @method configX >- * @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. >- */ >- configX: function (type, args, obj) { >- >- var x = args[0], >- y = this.cfg.getProperty("y"); >- >- this.cfg.setProperty("x", x, true); >- this.cfg.setProperty("y", y, true); >- >- this.beforeMoveEvent.fire([x, y]); >- >- x = this.cfg.getProperty("x"); >- y = this.cfg.getProperty("y"); >- >- Dom.setX(this.element, x, true); >- >- this.cfg.setProperty("xy", [x, y], true); >- >- this.cfg.refireEvent("iframe"); >- this.moveEvent.fire([x, y]); >- }, >- >- /** >- * The default event handler fired when the "y" property is changed. >- * @method configY >- * @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. >- */ >- configY: function (type, args, obj) { >- >- var x = this.cfg.getProperty("x"), >- y = args[0]; >- >- this.cfg.setProperty("x", x, true); >- this.cfg.setProperty("y", y, true); >- >- this.beforeMoveEvent.fire([x, y]); >- >- x = this.cfg.getProperty("x"); >- y = this.cfg.getProperty("y"); >- >- Dom.setY(this.element, y, true); >- >- this.cfg.setProperty("xy", [x, y], true); >- >- this.cfg.refireEvent("iframe"); >- this.moveEvent.fire([x, y]); >- }, >- >- /** >- * Shows the iframe shim, if it has been enabled. >- * @method showIframe >- */ >- showIframe: function () { >- >- var oIFrame = this.iframe, >- oParentNode; >- >- if (oIFrame) { >- oParentNode = this.element.parentNode; >- >- if (oParentNode != oIFrame.parentNode) { >- this._addToParent(oParentNode, oIFrame); >- } >- oIFrame.style.display = "block"; >- } >- }, >- >- /** >- * Hides the iframe shim, if it has been enabled. >- * @method hideIframe >- */ >- hideIframe: function () { >- if (this.iframe) { >- this.iframe.style.display = "none"; >- } >- }, >- >- /** >- * Syncronizes the size and position of iframe shim to that of its >- * corresponding Overlay instance. >- * @method syncIframe >- */ >- syncIframe: function () { >- >- var oIFrame = this.iframe, >- oElement = this.element, >- nOffset = Overlay.IFRAME_OFFSET, >- nDimensionOffset = (nOffset * 2), >- aXY; >- >- if (oIFrame) { >- // Size <iframe> >- oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px"); >- oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px"); >- >- // Position <iframe> >- aXY = this.cfg.getProperty("xy"); >- >- if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) { >- this.syncPosition(); >- aXY = this.cfg.getProperty("xy"); >- } >- Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]); >- } >- }, >- >- /** >- * Sets the zindex of the iframe shim, if it exists, based on the zindex of >- * the Overlay element. The zindex of the iframe is set to be one less >- * than the Overlay element's zindex. >- * >- * <p>NOTE: This method will not bump up the zindex of the Overlay element >- * to ensure that the iframe shim has a non-negative zindex. >- * If you require the iframe zindex to be 0 or higher, the zindex of >- * the Overlay element should be set to a value greater than 0, before >- * this method is called. >- * </p> >- * @method stackIframe >- */ >- stackIframe: function () { >- if (this.iframe) { >- var overlayZ = Dom.getStyle(this.element, "zIndex"); >- if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) { >- Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1)); >- } >- } >- }, >- >- /** >- * The default event handler fired when the "iframe" property is changed. >- * @method configIframe >- * @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. >- */ >- configIframe: function (type, args, obj) { >- >- var bIFrame = args[0]; >- >- function createIFrame() { >- >- var oIFrame = this.iframe, >- oElement = this.element, >- oParent; >- >- if (!oIFrame) { >- if (!m_oIFrameTemplate) { >- m_oIFrameTemplate = document.createElement("iframe"); >- >- if (this.isSecure) { >- m_oIFrameTemplate.src = Overlay.IFRAME_SRC; >- } >- >- /* >- Set the opacity of the <iframe> to 0 so that it >- doesn't modify the opacity of any transparent >- elements that may be on top of it (like a shadow). >- */ >- if (UA.ie) { >- m_oIFrameTemplate.style.filter = "alpha(opacity=0)"; >- /* >- Need to set the "frameBorder" property to 0 >- supress the default <iframe> border in IE. >- Setting the CSS "border" property alone >- doesn't supress it. >- */ >- m_oIFrameTemplate.frameBorder = 0; >- } >- else { >- m_oIFrameTemplate.style.opacity = "0"; >- } >- >- m_oIFrameTemplate.style.position = "absolute"; >- m_oIFrameTemplate.style.border = "none"; >- m_oIFrameTemplate.style.margin = "0"; >- m_oIFrameTemplate.style.padding = "0"; >- m_oIFrameTemplate.style.display = "none"; >- m_oIFrameTemplate.tabIndex = -1; >- m_oIFrameTemplate.className = Overlay.CSS_IFRAME; >- } >- >- oIFrame = m_oIFrameTemplate.cloneNode(false); >- oIFrame.id = this.id + "_f"; >- oParent = oElement.parentNode; >- >- var parentNode = oParent || document.body; >- >- this._addToParent(parentNode, oIFrame); >- this.iframe = oIFrame; >- } >- >- /* >- Show the <iframe> before positioning it since the "setXY" >- method of DOM requires the element be in the document >- and visible. >- */ >- this.showIframe(); >- >- /* >- Syncronize the size and position of the <iframe> to that >- of the Overlay. >- */ >- this.syncIframe(); >- this.stackIframe(); >- >- // Add event listeners to update the <iframe> when necessary >- if (!this._hasIframeEventListeners) { >- this.showEvent.subscribe(this.showIframe); >- this.hideEvent.subscribe(this.hideIframe); >- this.changeContentEvent.subscribe(this.syncIframe); >- >- this._hasIframeEventListeners = true; >- } >- } >- >- function onBeforeShow() { >- createIFrame.call(this); >- this.beforeShowEvent.unsubscribe(onBeforeShow); >- this._iframeDeferred = false; >- } >- >- if (bIFrame) { // <iframe> shim is enabled >- >- if (this.cfg.getProperty("visible")) { >- createIFrame.call(this); >- } else { >- if (!this._iframeDeferred) { >- this.beforeShowEvent.subscribe(onBeforeShow); >- this._iframeDeferred = true; >- } >- } >- >- } else { // <iframe> shim is disabled >- this.hideIframe(); >- >- if (this._hasIframeEventListeners) { >- this.showEvent.unsubscribe(this.showIframe); >- this.hideEvent.unsubscribe(this.hideIframe); >- this.changeContentEvent.unsubscribe(this.syncIframe); >- >- this._hasIframeEventListeners = false; >- } >- } >- }, >- >- /** >- * Set's the container's XY value from DOM if not already set. >- * >- * Differs from syncPosition, in that the XY value is only sync'd with DOM if >- * not already set. The method also refire's the XY config property event, so any >- * beforeMove, Move event listeners are invoked. >- * >- * @method _primeXYFromDOM >- * @protected >- */ >- _primeXYFromDOM : function() { >- if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) { >- // Set CFG XY based on DOM XY >- this.syncPosition(); >- // Account for XY being set silently in syncPosition (no moveTo fired/called) >- this.cfg.refireEvent("xy"); >- this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); >- } >- }, >- >- /** >- * The default event handler fired when the "constraintoviewport" >- * property is changed. >- * @method configConstrainToViewport >- * @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. >- */ >- configConstrainToViewport: function (type, args, obj) { >- var val = args[0]; >- >- if (val) { >- if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) { >- this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true); >- } >- if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) { >- this.beforeShowEvent.subscribe(this._primeXYFromDOM); >- } >- } else { >- this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); >- this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this); >- } >- }, >- >- /** >- * 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 contextArgs = args[0], >- contextEl, >- elementMagnetCorner, >- contextMagnetCorner, >- triggers, >- offset, >- defTriggers = this.CONTEXT_TRIGGERS; >- >- if (contextArgs) { >- >- contextEl = contextArgs[0]; >- elementMagnetCorner = contextArgs[1]; >- contextMagnetCorner = contextArgs[2]; >- triggers = contextArgs[3]; >- offset = contextArgs[4]; >- >- if (defTriggers && defTriggers.length > 0) { >- triggers = (triggers || []).concat(defTriggers); >- } >- >- if (contextEl) { >- if (typeof contextEl == "string") { >- this.cfg.setProperty("context", [ >- document.getElementById(contextEl), >- elementMagnetCorner, >- contextMagnetCorner, >- triggers, >- offset], >- true); >- } >- >- if (elementMagnetCorner && contextMagnetCorner) { >- this.align(elementMagnetCorner, contextMagnetCorner, offset); >- } >- >- if (this._contextTriggers) { >- // Unsubscribe Old Set >- this._processTriggers(this._contextTriggers, _UNSUBSCRIBE, this._alignOnTrigger); >- } >- >- if (triggers) { >- // Subscribe New Set >- this._processTriggers(triggers, _SUBSCRIBE, this._alignOnTrigger); >- this._contextTriggers = triggers; >- } >- } >- } >- }, >- >- /** >- * Custom Event handler for context alignment triggers. Invokes the align method >- * >- * @method _alignOnTrigger >- * @protected >- * >- * @param {String} type The event type (not used by the default implementation) >- * @param {Any[]} args The array of arguments for the trigger event (not used by the default implementation) >- */ >- _alignOnTrigger: function(type, args) { >- this.align(); >- }, >- >- /** >- * Helper method to locate the custom event instance for the event name string >- * passed in. As a convenience measure, any custom events passed in are returned. >- * >- * @method _findTriggerCE >- * @private >- * >- * @param {String|CustomEvent} t Either a CustomEvent, or event type (e.g. "windowScroll") for which a >- * custom event instance needs to be looked up from the Overlay._TRIGGER_MAP. >- */ >- _findTriggerCE : function(t) { >- var tce = null; >- if (t instanceof CustomEvent) { >- tce = t; >- } else if (Overlay._TRIGGER_MAP[t]) { >- tce = Overlay._TRIGGER_MAP[t]; >- } >- return tce; >- }, >- >- /** >- * Utility method that subscribes or unsubscribes the given >- * function from the list of trigger events provided. >- * >- * @method _processTriggers >- * @protected >- * >- * @param {Array[String|CustomEvent]} triggers An array of either CustomEvents, event type strings >- * (e.g. "beforeShow", "windowScroll") to/from which the provided function should be >- * subscribed/unsubscribed respectively. >- * >- * @param {String} mode Either "subscribe" or "unsubscribe", specifying whether or not >- * we are subscribing or unsubscribing trigger listeners >- * >- * @param {Function} fn The function to be subscribed/unsubscribed to/from the trigger event. >- * Context is always set to the overlay instance, and no additional object argument >- * get passed to the subscribed function. >- */ >- _processTriggers : function(triggers, mode, fn) { >- var t, tce; >- >- for (var i = 0, l = triggers.length; i < l; ++i) { >- t = triggers[i]; >- tce = this._findTriggerCE(t); >- if (tce) { >- tce[mode](fn, this, true); >- } else { >- this[mode](t, fn); >- } >- } >- }, >- >- // END BUILT-IN PROPERTY EVENT HANDLERS // >- /** >- * Aligns the Overlay to its context element using the specified corner >- * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, >- * and BOTTOM_RIGHT. >- * @method align >- * @param {String} elementAlign The String representing the corner of >- * the Overlay that should be aligned to the context element >- * @param {String} contextAlign The corner of the context element >- * that the elementAlign corner should stick to. >- * @param {Number[]} xyOffset Optional. A 2 element array specifying the x and y pixel offsets which should be applied >- * after aligning the element and context corners. For example, passing in [5, -10] for this value, would offset the >- * Overlay by 5 pixels along the X axis (horizontally) and -10 pixels along the Y axis (vertically) after aligning the specified corners. >- */ >- align: function (elementAlign, contextAlign, xyOffset) { >- >- var contextArgs = this.cfg.getProperty("context"), >- me = this, >- context, >- element, >- contextRegion; >- >- function doAlign(v, h) { >- >- var alignX = null, alignY = null; >- >- switch (elementAlign) { >- >- case Overlay.TOP_LEFT: >- alignX = h; >- alignY = v; >- break; >- >- case Overlay.TOP_RIGHT: >- alignX = h - element.offsetWidth; >- alignY = v; >- break; >- >- case Overlay.BOTTOM_LEFT: >- alignX = h; >- alignY = v - element.offsetHeight; >- break; >- >- case Overlay.BOTTOM_RIGHT: >- alignX = h - element.offsetWidth; >- alignY = v - element.offsetHeight; >- break; >- } >- >- if (alignX !== null && alignY !== null) { >- if (xyOffset) { >- alignX += xyOffset[0]; >- alignY += xyOffset[1]; >- } >- me.moveTo(alignX, alignY); >- } >- } >- >- if (contextArgs) { >- context = contextArgs[0]; >- element = this.element; >- me = this; >- >- if (! elementAlign) { >- elementAlign = contextArgs[1]; >- } >- >- if (! contextAlign) { >- contextAlign = contextArgs[2]; >- } >- >- if (!xyOffset && contextArgs[4]) { >- xyOffset = contextArgs[4]; >- } >- >- if (element && context) { >- contextRegion = Dom.getRegion(context); >- >- switch (contextAlign) { >- >- case Overlay.TOP_LEFT: >- doAlign(contextRegion.top, contextRegion.left); >- break; >- >- case Overlay.TOP_RIGHT: >- doAlign(contextRegion.top, contextRegion.right); >- break; >- >- case Overlay.BOTTOM_LEFT: >- doAlign(contextRegion.bottom, contextRegion.left); >- break; >- >- case Overlay.BOTTOM_RIGHT: >- doAlign(contextRegion.bottom, contextRegion.right); >- break; >- } >- } >- } >- }, >- >- /** >- * The default event handler executed when the moveEvent is fired, if the >- * "constraintoviewport" is set to true. >- * @method enforceConstraints >- * @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. >- */ >- enforceConstraints: function (type, args, obj) { >- var pos = args[0]; >- >- var cXY = this.getConstrainedXY(pos[0], pos[1]); >- this.cfg.setProperty("x", cXY[0], true); >- this.cfg.setProperty("y", cXY[1], true); >- this.cfg.setProperty("xy", cXY, true); >- }, >- >- /** >- * Shared implementation method for getConstrainedX and getConstrainedY. >- * >- * <p> >- * Given a coordinate value, returns the calculated coordinate required to >- * position the Overlay if it is to be constrained to the viewport, based on the >- * current element size, viewport dimensions, scroll values and preventoverlap >- * settings >- * </p> >- * >- * @method _getConstrainedPos >- * @protected >- * @param {String} pos The coordinate which needs to be constrained, either "x" or "y" >- * @param {Number} The coordinate value which needs to be constrained >- * @return {Number} The constrained coordinate value >- */ >- _getConstrainedPos: function(pos, val) { >- >- var overlayEl = this.element, >- >- buffer = Overlay.VIEWPORT_OFFSET, >- >- x = (pos == "x"), >- >- overlaySize = (x) ? overlayEl.offsetWidth : overlayEl.offsetHeight, >- viewportSize = (x) ? Dom.getViewportWidth() : Dom.getViewportHeight(), >- docScroll = (x) ? Dom.getDocumentScrollLeft() : Dom.getDocumentScrollTop(), >- overlapPositions = (x) ? Overlay.PREVENT_OVERLAP_X : Overlay.PREVENT_OVERLAP_Y, >- >- context = this.cfg.getProperty("context"), >- >- bOverlayFitsInViewport = (overlaySize + buffer < viewportSize), >- bPreventContextOverlap = this.cfg.getProperty("preventcontextoverlap") && context && overlapPositions[(context[1] + context[2])], >- >- minConstraint = docScroll + buffer, >- maxConstraint = docScroll + viewportSize - overlaySize - buffer, >- >- constrainedVal = val; >- >- if (val < minConstraint || val > maxConstraint) { >- if (bPreventContextOverlap) { >- constrainedVal = this._preventOverlap(pos, context[0], overlaySize, viewportSize, docScroll); >- } else { >- if (bOverlayFitsInViewport) { >- if (val < minConstraint) { >- constrainedVal = minConstraint; >- } else if (val > maxConstraint) { >- constrainedVal = maxConstraint; >- } >- } else { >- constrainedVal = minConstraint; >- } >- } >- } >- >- return constrainedVal; >- }, >- >- /** >- * Helper method, used to position the Overlap to prevent overlap with the >- * context element (used when preventcontextoverlap is enabled) >- * >- * @method _preventOverlap >- * @protected >- * @param {String} pos The coordinate to prevent overlap for, either "x" or "y". >- * @param {HTMLElement} contextEl The context element >- * @param {Number} overlaySize The related overlay dimension value (for "x", the width, for "y", the height) >- * @param {Number} viewportSize The related viewport dimension value (for "x", the width, for "y", the height) >- * @param {Object} docScroll The related document scroll value (for "x", the scrollLeft, for "y", the scrollTop) >- * >- * @return {Number} The new coordinate value which was set to prevent overlap >- */ >- _preventOverlap : function(pos, contextEl, overlaySize, viewportSize, docScroll) { >- >- var x = (pos == "x"), >- >- buffer = Overlay.VIEWPORT_OFFSET, >- >- overlay = this, >- >- contextElPos = ((x) ? Dom.getX(contextEl) : Dom.getY(contextEl)) - docScroll, >- contextElSize = (x) ? contextEl.offsetWidth : contextEl.offsetHeight, >- >- minRegionSize = contextElPos - buffer, >- maxRegionSize = (viewportSize - (contextElPos + contextElSize)) - buffer, >- >- bFlipped = false, >- >- flip = function () { >- var flippedVal; >- >- if ((overlay.cfg.getProperty(pos) - docScroll) > contextElPos) { >- flippedVal = (contextElPos - overlaySize); >- } else { >- flippedVal = (contextElPos + contextElSize); >- } >- >- overlay.cfg.setProperty(pos, (flippedVal + docScroll), true); >- >- return flippedVal; >- }, >- >- setPosition = function () { >- >- var displayRegionSize = ((overlay.cfg.getProperty(pos) - docScroll) > contextElPos) ? maxRegionSize : minRegionSize, >- position; >- >- if (overlaySize > displayRegionSize) { >- if (bFlipped) { >- /* >- All possible positions and values have been >- tried, but none were successful, so fall back >- to the original size and position. >- */ >- flip(); >- } else { >- flip(); >- bFlipped = true; >- position = setPosition(); >- } >- } >- >- return position; >- }; >- >- setPosition(); >- >- return this.cfg.getProperty(pos); >- }, >- >- /** >- * Given x coordinate value, returns the calculated x coordinate required to >- * position the Overlay if it is to be constrained to the viewport, based on the >- * current element size, viewport dimensions and scroll values. >- * >- * @param {Number} x The X coordinate value to be constrained >- * @return {Number} The constrained x coordinate >- */ >- getConstrainedX: function (x) { >- return this._getConstrainedPos("x", x); >- }, >- >- /** >- * Given y coordinate value, returns the calculated y coordinate required to >- * position the Overlay if it is to be constrained to the viewport, based on the >- * current element size, viewport dimensions and scroll values. >- * >- * @param {Number} y The Y coordinate value to be constrained >- * @return {Number} The constrained y coordinate >- */ >- getConstrainedY : function (y) { >- return this._getConstrainedPos("y", y); >- }, >- >- /** >- * Given x, y coordinate values, returns the calculated coordinates required to >- * position the Overlay if it is to be constrained to the viewport, based on the >- * current element size, viewport dimensions and scroll values. >- * >- * @param {Number} x The X coordinate value to be constrained >- * @param {Number} y The Y coordinate value to be constrained >- * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively; >- */ >- getConstrainedXY: function(x, y) { >- return [this.getConstrainedX(x), this.getConstrainedY(y)]; >- }, >- >- /** >- * Centers the container in the viewport. >- * @method center >- */ >- center: function () { >- >- var nViewportOffset = Overlay.VIEWPORT_OFFSET, >- elementWidth = this.element.offsetWidth, >- elementHeight = this.element.offsetHeight, >- viewPortWidth = Dom.getViewportWidth(), >- viewPortHeight = Dom.getViewportHeight(), >- x, >- y; >- >- if (elementWidth < viewPortWidth) { >- x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft(); >- } else { >- x = nViewportOffset + Dom.getDocumentScrollLeft(); >- } >- >- if (elementHeight < viewPortHeight) { >- y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop(); >- } else { >- y = nViewportOffset + Dom.getDocumentScrollTop(); >- } >- >- this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]); >- this.cfg.refireEvent("iframe"); >- >- if (UA.webkit) { >- this.forceContainerRedraw(); >- } >- }, >- >- /** >- * Synchronizes the Panel's "xy", "x", and "y" properties with the >- * Panel's position in the DOM. This is primarily used to update >- * position information during drag & drop. >- * @method syncPosition >- */ >- syncPosition: function () { >- >- var pos = Dom.getXY(this.element); >- >- this.cfg.setProperty("x", pos[0], true); >- this.cfg.setProperty("y", pos[1], true); >- this.cfg.setProperty("xy", pos, true); >- >- }, >- >- /** >- * Event handler fired when the resize monitor element is resized. >- * @method onDomResize >- * @param {DOMEvent} e The resize DOM event >- * @param {Object} obj The scope object >- */ >- onDomResize: function (e, obj) { >- >- var me = this; >- >- Overlay.superclass.onDomResize.call(this, e, obj); >- >- setTimeout(function () { >- me.syncPosition(); >- me.cfg.refireEvent("iframe"); >- me.cfg.refireEvent("context"); >- }, 0); >- }, >- >- /** >- * Determines the content box height of the given element (height of the element, without padding or borders) in pixels. >- * >- * @method _getComputedHeight >- * @private >- * @param {HTMLElement} el The element for which the content height needs to be determined >- * @return {Number} The content box height of the given element, or null if it could not be determined. >- */ >- _getComputedHeight : (function() { >- >- if (document.defaultView && document.defaultView.getComputedStyle) { >- return function(el) { >- var height = null; >- if (el.ownerDocument && el.ownerDocument.defaultView) { >- var computed = el.ownerDocument.defaultView.getComputedStyle(el, ''); >- if (computed) { >- height = parseInt(computed.height, 10); >- } >- } >- return (Lang.isNumber(height)) ? height : null; >- }; >- } else { >- return function(el) { >- var height = null; >- if (el.style.pixelHeight) { >- height = el.style.pixelHeight; >- } >- return (Lang.isNumber(height)) ? height : null; >- }; >- } >- })(), >- >- /** >- * autofillheight validator. Verifies that the autofill value is either null >- * or one of the strings : "body", "header" or "footer". >- * >- * @method _validateAutoFillHeight >- * @protected >- * @param {String} val >- * @return true, if valid, false otherwise >- */ >- _validateAutoFillHeight : function(val) { >- return (!val) || (Lang.isString(val) && Overlay.STD_MOD_RE.test(val)); >- }, >- >- /** >- * The default custom event handler executed when the overlay'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) { >- var height = this.cfg.getProperty("height"); >- if ((height && height !== "auto") || (height === 0)) { >- this.fillHeight(el); >- } >- }, >- >- /** >- * Returns the sub-pixel height of the el, using getBoundingClientRect, if available, >- * otherwise returns the offsetHeight >- * @method _getPreciseHeight >- * @private >- * @param {HTMLElement} el >- * @return {Float} The sub-pixel height if supported by the browser, else the rounded height. >- */ >- _getPreciseHeight : function(el) { >- var height = el.offsetHeight; >- >- if (el.getBoundingClientRect) { >- var rect = el.getBoundingClientRect(); >- height = rect.bottom - rect.top; >- } >- >- return height; >- }, >- >- /** >- * <p> >- * Sets the height on the provided header, body or footer element to >- * fill out the height of the container. It determines the height of the >- * containers content box, based on it's configured height value, and >- * sets the height of the autofillheight element to fill out any >- * space remaining after the other standard module element heights >- * have been accounted for. >- * </p> >- * <p><strong>NOTE:</strong> This method is not designed to work if an explicit >- * height has not been set on the container, since for an "auto" height container, >- * the heights of the header/body/footer will drive the height of the container.</p> >- * >- * @method fillHeight >- * @param {HTMLElement} el The element which should be resized to fill out the height >- * of the container element. >- */ >- fillHeight : function(el) { >- if (el) { >- var container = this.innerElement || this.element, >- containerEls = [this.header, this.body, this.footer], >- containerEl, >- total = 0, >- filled = 0, >- remaining = 0, >- validEl = false; >- >- for (var i = 0, l = containerEls.length; i < l; i++) { >- containerEl = containerEls[i]; >- if (containerEl) { >- if (el !== containerEl) { >- filled += this._getPreciseHeight(containerEl); >- } else { >- validEl = true; >- } >- } >- } >- >- if (validEl) { >- >- if (UA.ie || UA.opera) { >- // Need to set height to 0, to allow height to be reduced >- Dom.setStyle(el, 'height', 0 + 'px'); >- } >- >- total = this._getComputedHeight(container); >- >- // Fallback, if we can't get computed value for content height >- if (total === null) { >- Dom.addClass(container, "yui-override-padding"); >- total = container.clientHeight; // Content, No Border, 0 Padding (set by yui-override-padding) >- Dom.removeClass(container, "yui-override-padding"); >- } >- >- remaining = Math.max(total - filled, 0); >- >- Dom.setStyle(el, "height", remaining + "px"); >- >- // Re-adjust height if required, to account for el padding and border >- if (el.offsetHeight != remaining) { >- remaining = Math.max(remaining - (el.offsetHeight - remaining), 0); >- } >- Dom.setStyle(el, "height", remaining + "px"); >- } >- } >- }, >- >- /** >- * Places the Overlay on top of all other instances of >- * YAHOO.widget.Overlay. >- * @method bringToTop >- */ >- bringToTop: function () { >- >- var aOverlays = [], >- oElement = this.element; >- >- function compareZIndexDesc(p_oOverlay1, p_oOverlay2) { >- >- var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"), >- sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"), >- >- nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10), >- nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10); >- >- if (nZIndex1 > nZIndex2) { >- return -1; >- } else if (nZIndex1 < nZIndex2) { >- return 1; >- } else { >- return 0; >- } >- } >- >- function isOverlayElement(p_oElement) { >- >- var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY), >- Panel = YAHOO.widget.Panel; >- >- if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) { >- if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) { >- aOverlays[aOverlays.length] = p_oElement.parentNode; >- } else { >- aOverlays[aOverlays.length] = p_oElement; >- } >- } >- } >- >- Dom.getElementsBy(isOverlayElement, "DIV", document.body); >- >- aOverlays.sort(compareZIndexDesc); >- >- var oTopOverlay = aOverlays[0], >- nTopZIndex; >- >- if (oTopOverlay) { >- nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex"); >- >- if (!isNaN(nTopZIndex)) { >- var bRequiresBump = false; >- >- if (oTopOverlay != oElement) { >- bRequiresBump = true; >- } else if (aOverlays.length > 1) { >- var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex"); >- // Don't rely on DOM order to stack if 2 overlays are at the same zindex. >- if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { >- bRequiresBump = true; >- } >- } >- if (bRequiresBump) { >- this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); >- } >- } >- } >- }, >- >- /** >- * Removes the Overlay element from the DOM and sets all child >- * elements to null. >- * @method destroy >- */ >- destroy: function () { >- >- if (this.iframe) { >- this.iframe.parentNode.removeChild(this.iframe); >- } >- >- this.iframe = null; >- >- Overlay.windowResizeEvent.unsubscribe( >- this.doCenterOnDOMEvent, this); >- >- Overlay.windowScrollEvent.unsubscribe( >- this.doCenterOnDOMEvent, this); >- >- Module.textResizeEvent.unsubscribe(this._autoFillOnHeightChange); >- >- if (this._contextTriggers) { >- // Unsubscribe context triggers - to cover context triggers which listen for global >- // events such as windowResize and windowScroll. Easier just to unsubscribe all >- this._processTriggers(this._contextTriggers, _UNSUBSCRIBE, this._alignOnTrigger); >- } >- >- Overlay.superclass.destroy.call(this); >- }, >- >- /** >- * Can be used to force the container to repaint/redraw it's contents. >- * <p> >- * By default applies and then removes a 1px bottom margin through the >- * application/removal of a "yui-force-redraw" class. >- * </p> >- * <p> >- * It is currently used by Overlay to force a repaint for webkit >- * browsers, when centering. >- * </p> >- * @method forceContainerRedraw >- */ >- forceContainerRedraw : function() { >- var c = this; >- Dom.addClass(c.element, "yui-force-redraw"); >- setTimeout(function() { >- Dom.removeClass(c.element, "yui-force-redraw"); >- }, 0); >- }, >- >- /** >- * Returns a String representation of the object. >- * @method toString >- * @return {String} The string representation of the Overlay. >- */ >- toString: function () { >- return "Overlay " + this.id; >- } >- >- }); >-}()); >-(function () { >- >- /** >- * OverlayManager is used for maintaining the focus status of >- * multiple Overlays. >- * @namespace YAHOO.widget >- * @namespace YAHOO.widget >- * @class OverlayManager >- * @constructor >- * @param {Array} overlays Optional. A collection of Overlays to register >- * with the manager. >- * @param {Object} userConfig The object literal representing the user >- * configuration of the OverlayManager >- */ >- YAHOO.widget.OverlayManager = function (userConfig) { >- this.init(userConfig); >- }; >- >- var Overlay = YAHOO.widget.Overlay, >- Event = YAHOO.util.Event, >- Dom = YAHOO.util.Dom, >- Config = YAHOO.util.Config, >- CustomEvent = YAHOO.util.CustomEvent, >- OverlayManager = YAHOO.widget.OverlayManager; >- >- /** >- * The CSS class representing a focused Overlay >- * @property OverlayManager.CSS_FOCUSED >- * @static >- * @final >- * @type String >- */ >- OverlayManager.CSS_FOCUSED = "focused"; >- >- OverlayManager.prototype = { >- >- /** >- * The class's constructor function >- * @property contructor >- * @type Function >- */ >- constructor: OverlayManager, >- >- /** >- * The array of Overlays that are currently registered >- * @property overlays >- * @type YAHOO.widget.Overlay[] >- */ >- overlays: null, >- >- /** >- * Initializes the default configuration of the OverlayManager >- * @method initDefaultConfig >- */ >- initDefaultConfig: function () { >- /** >- * The collection of registered Overlays in use by >- * the OverlayManager >- * @config overlays >- * @type YAHOO.widget.Overlay[] >- * @default null >- */ >- this.cfg.addProperty("overlays", { suppressEvent: true } ); >- >- /** >- * The default DOM event that should be used to focus an Overlay >- * @config focusevent >- * @type String >- * @default "mousedown" >- */ >- this.cfg.addProperty("focusevent", { value: "mousedown" } ); >- }, >- >- /** >- * Initializes the OverlayManager >- * @method init >- * @param {Overlay[]} overlays Optional. A collection of Overlays to >- * register with the manager. >- * @param {Object} userConfig The object literal representing the user >- * configuration of the OverlayManager >- */ >- init: function (userConfig) { >- >- /** >- * The OverlayManager's Config object used for monitoring >- * configuration properties. >- * @property cfg >- * @type Config >- */ >- this.cfg = new Config(this); >- >- this.initDefaultConfig(); >- >- if (userConfig) { >- this.cfg.applyConfig(userConfig, true); >- } >- this.cfg.fireQueue(); >- >- /** >- * The currently activated Overlay >- * @property activeOverlay >- * @private >- * @type YAHOO.widget.Overlay >- */ >- var activeOverlay = null; >- >- /** >- * Returns the currently focused Overlay >- * @method getActive >- * @return {Overlay} The currently focused Overlay >- */ >- this.getActive = function () { >- return activeOverlay; >- }; >- >- /** >- * Focuses the specified Overlay >- * @method focus >- * @param {Overlay} overlay The Overlay to focus >- * @param {String} overlay The id of the Overlay to focus >- */ >- this.focus = function (overlay) { >- var o = this.find(overlay); >- if (o) { >- o.focus(); >- } >- }; >- >- /** >- * Removes the specified Overlay from the manager >- * @method remove >- * @param {Overlay} overlay The Overlay to remove >- * @param {String} overlay The id of the Overlay to remove >- */ >- this.remove = function (overlay) { >- >- var o = this.find(overlay), >- originalZ; >- >- if (o) { >- if (activeOverlay == o) { >- activeOverlay = null; >- } >- >- var bDestroyed = (o.element === null && o.cfg === null) ? true : false; >- >- if (!bDestroyed) { >- // Set it's zindex so that it's sorted to the end. >- originalZ = Dom.getStyle(o.element, "zIndex"); >- o.cfg.setProperty("zIndex", -1000, true); >- } >- >- this.overlays.sort(this.compareZIndexDesc); >- this.overlays = this.overlays.slice(0, (this.overlays.length - 1)); >- >- o.hideEvent.unsubscribe(o.blur); >- o.destroyEvent.unsubscribe(this._onOverlayDestroy, o); >- o.focusEvent.unsubscribe(this._onOverlayFocusHandler, o); >- o.blurEvent.unsubscribe(this._onOverlayBlurHandler, o); >- >- if (!bDestroyed) { >- Event.removeListener(o.element, this.cfg.getProperty("focusevent"), this._onOverlayElementFocus); >- o.cfg.setProperty("zIndex", originalZ, true); >- o.cfg.setProperty("manager", null); >- } >- >- /* _managed Flag for custom or existing. Don't want to remove existing */ >- if (o.focusEvent._managed) { o.focusEvent = null; } >- if (o.blurEvent._managed) { o.blurEvent = null; } >- >- if (o.focus._managed) { o.focus = null; } >- if (o.blur._managed) { o.blur = null; } >- } >- }; >- >- /** >- * Removes focus from all registered Overlays in the manager >- * @method blurAll >- */ >- this.blurAll = function () { >- >- var nOverlays = this.overlays.length, >- i; >- >- if (nOverlays > 0) { >- i = nOverlays - 1; >- do { >- this.overlays[i].blur(); >- } >- while(i--); >- } >- }; >- >- /** >- * Updates the state of the OverlayManager and overlay, as a result of the overlay >- * being blurred. >- * >- * @method _manageBlur >- * @param {Overlay} overlay The overlay instance which got blurred. >- * @protected >- */ >- this._manageBlur = function (overlay) { >- var changed = false; >- if (activeOverlay == overlay) { >- Dom.removeClass(activeOverlay.element, OverlayManager.CSS_FOCUSED); >- activeOverlay = null; >- changed = true; >- } >- return changed; >- }; >- >- /** >- * Updates the state of the OverlayManager and overlay, as a result of the overlay >- * receiving focus. >- * >- * @method _manageFocus >- * @param {Overlay} overlay The overlay instance which got focus. >- * @protected >- */ >- this._manageFocus = function(overlay) { >- var changed = false; >- if (activeOverlay != overlay) { >- if (activeOverlay) { >- activeOverlay.blur(); >- } >- activeOverlay = overlay; >- this.bringToTop(activeOverlay); >- Dom.addClass(activeOverlay.element, OverlayManager.CSS_FOCUSED); >- changed = true; >- } >- return changed; >- }; >- >- var overlays = this.cfg.getProperty("overlays"); >- >- if (! this.overlays) { >- this.overlays = []; >- } >- >- if (overlays) { >- this.register(overlays); >- this.overlays.sort(this.compareZIndexDesc); >- } >- }, >- >- /** >- * @method _onOverlayElementFocus >- * @description Event handler for the DOM event that is used to focus >- * the Overlay instance as specified by the "focusevent" >- * configuration property. >- * @private >- * @param {Event} p_oEvent Object representing the DOM event >- * object passed back by the event utility (Event). >- */ >- _onOverlayElementFocus: function (p_oEvent) { >- >- var oTarget = Event.getTarget(p_oEvent), >- oClose = this.close; >- >- if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) { >- this.blur(); >- } else { >- this.focus(); >- } >- }, >- >- /** >- * @method _onOverlayDestroy >- * @description "destroy" event handler for the Overlay. >- * @private >- * @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. >- * @param {Overlay} p_oOverlay Object representing the overlay that >- * fired the event. >- */ >- _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) { >- this.remove(p_oOverlay); >- }, >- >- /** >- * @method _onOverlayFocusHandler >- * >- * @description focusEvent Handler, used to delegate to _manageFocus with the correct arguments. >- * >- * @private >- * @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. >- * @param {Overlay} p_oOverlay Object representing the overlay that >- * fired the event. >- */ >- _onOverlayFocusHandler: function(p_sType, p_aArgs, p_oOverlay) { >- this._manageFocus(p_oOverlay); >- }, >- >- /** >- * @method _onOverlayBlurHandler >- * @description blurEvent Handler, used to delegate to _manageBlur with the correct arguments. >- * >- * @private >- * @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. >- * @param {Overlay} p_oOverlay Object representing the overlay that >- * fired the event. >- */ >- _onOverlayBlurHandler: function(p_sType, p_aArgs, p_oOverlay) { >- this._manageBlur(p_oOverlay); >- }, >- >- /** >- * Subscribes to the Overlay based instance focusEvent, to allow the OverlayManager to >- * monitor focus state. >- * >- * If the instance already has a focusEvent (e.g. Menu), OverlayManager will subscribe >- * to the existing focusEvent, however if a focusEvent or focus method does not exist >- * on the instance, the _bindFocus method will add them, and the focus method will >- * update the OverlayManager's state directly. >- * >- * @method _bindFocus >- * @param {Overlay} overlay The overlay for which focus needs to be managed >- * @protected >- */ >- _bindFocus : function(overlay) { >- var mgr = this; >- >- if (!overlay.focusEvent) { >- overlay.focusEvent = overlay.createEvent("focus"); >- overlay.focusEvent.signature = CustomEvent.LIST; >- overlay.focusEvent._managed = true; >- } else { >- overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr); >- } >- >- if (!overlay.focus) { >- Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay); >- overlay.focus = function () { >- if (mgr._manageFocus(this)) { >- // For Panel/Dialog >- if (this.cfg.getProperty("visible") && this.focusFirst) { >- this.focusFirst(); >- } >- this.focusEvent.fire(); >- } >- }; >- overlay.focus._managed = true; >- } >- }, >- >- /** >- * Subscribes to the Overlay based instance's blurEvent to allow the OverlayManager to >- * monitor blur state. >- * >- * If the instance already has a blurEvent (e.g. Menu), OverlayManager will subscribe >- * to the existing blurEvent, however if a blurEvent or blur method does not exist >- * on the instance, the _bindBlur method will add them, and the blur method >- * update the OverlayManager's state directly. >- * >- * @method _bindBlur >- * @param {Overlay} overlay The overlay for which blur needs to be managed >- * @protected >- */ >- _bindBlur : function(overlay) { >- var mgr = this; >- >- if (!overlay.blurEvent) { >- overlay.blurEvent = overlay.createEvent("blur"); >- overlay.blurEvent.signature = CustomEvent.LIST; >- overlay.focusEvent._managed = true; >- } else { >- overlay.blurEvent.subscribe(mgr._onOverlayBlurHandler, overlay, mgr); >- } >- >- if (!overlay.blur) { >- overlay.blur = function () { >- if (mgr._manageBlur(this)) { >- this.blurEvent.fire(); >- } >- }; >- overlay.blur._managed = true; >- } >- >- overlay.hideEvent.subscribe(overlay.blur); >- }, >- >- /** >- * Subscribes to the Overlay based instance's destroyEvent, to allow the Overlay >- * to be removed for the OverlayManager when destroyed. >- * >- * @method _bindDestroy >- * @param {Overlay} overlay The overlay instance being managed >- * @protected >- */ >- _bindDestroy : function(overlay) { >- var mgr = this; >- overlay.destroyEvent.subscribe(mgr._onOverlayDestroy, overlay, mgr); >- }, >- >- /** >- * Ensures the zIndex configuration property on the managed overlay based instance >- * is set to the computed zIndex value from the DOM (with "auto" translating to 0). >- * >- * @method _syncZIndex >- * @param {Overlay} overlay The overlay instance being managed >- * @protected >- */ >- _syncZIndex : function(overlay) { >- var zIndex = Dom.getStyle(overlay.element, "zIndex"); >- if (!isNaN(zIndex)) { >- overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10)); >- } else { >- overlay.cfg.setProperty("zIndex", 0); >- } >- }, >- >- /** >- * Registers an Overlay or an array of Overlays with the manager. Upon >- * registration, the Overlay receives functions for focus and blur, >- * along with CustomEvents for each. >- * >- * @method register >- * @param {Overlay} overlay An Overlay to register with the manager. >- * @param {Overlay[]} overlay An array of Overlays to register with >- * the manager. >- * @return {boolean} true if any Overlays are registered. >- */ >- register: function (overlay) { >- >- var registered = false, >- i, >- n; >- >- if (overlay instanceof Overlay) { >- >- overlay.cfg.addProperty("manager", { value: this } ); >- >- this._bindFocus(overlay); >- this._bindBlur(overlay); >- this._bindDestroy(overlay); >- this._syncZIndex(overlay); >- >- this.overlays.push(overlay); >- this.bringToTop(overlay); >- >- registered = true; >- >- } else if (overlay instanceof Array) { >- >- for (i = 0, n = overlay.length; i < n; i++) { >- registered = this.register(overlay[i]) || registered; >- } >- >- } >- >- return registered; >- }, >- >- /** >- * Places the specified Overlay instance on top of all other >- * Overlay instances. >- * @method bringToTop >- * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an >- * Overlay instance. >- * @param {String} p_oOverlay String representing the id of an >- * Overlay instance. >- */ >- bringToTop: function (p_oOverlay) { >- >- var oOverlay = this.find(p_oOverlay), >- nTopZIndex, >- oTopOverlay, >- aOverlays; >- >- if (oOverlay) { >- >- aOverlays = this.overlays; >- aOverlays.sort(this.compareZIndexDesc); >- >- oTopOverlay = aOverlays[0]; >- >- if (oTopOverlay) { >- nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex"); >- >- if (!isNaN(nTopZIndex)) { >- >- var bRequiresBump = false; >- >- if (oTopOverlay !== oOverlay) { >- bRequiresBump = true; >- } else if (aOverlays.length > 1) { >- var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex"); >- // Don't rely on DOM order to stack if 2 overlays are at the same zindex. >- if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { >- bRequiresBump = true; >- } >- } >- >- if (bRequiresBump) { >- oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); >- } >- } >- aOverlays.sort(this.compareZIndexDesc); >- } >- } >- }, >- >- /** >- * Attempts to locate an Overlay by instance or ID. >- * @method find >- * @param {Overlay} overlay An Overlay to locate within the manager >- * @param {String} overlay An Overlay id to locate within the manager >- * @return {Overlay} The requested Overlay, if found, or null if it >- * cannot be located. >- */ >- find: function (overlay) { >- >- var isInstance = overlay instanceof Overlay, >- overlays = this.overlays, >- n = overlays.length, >- found = null, >- o, >- i; >- >- if (isInstance || typeof overlay == "string") { >- for (i = n-1; i >= 0; i--) { >- o = overlays[i]; >- if ((isInstance && (o === overlay)) || (o.id == overlay)) { >- found = o; >- break; >- } >- } >- } >- >- return found; >- }, >- >- /** >- * Used for sorting the manager's Overlays by z-index. >- * @method compareZIndexDesc >- * @private >- * @return {Number} 0, 1, or -1, depending on where the Overlay should >- * fall in the stacking order. >- */ >- compareZIndexDesc: function (o1, o2) { >- >- var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed) >- zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom. >- >- if (zIndex1 === null && zIndex2 === null) { >- return 0; >- } else if (zIndex1 === null){ >- return 1; >- } else if (zIndex2 === null) { >- return -1; >- } else if (zIndex1 > zIndex2) { >- return -1; >- } else if (zIndex1 < zIndex2) { >- return 1; >- } else { >- return 0; >- } >- }, >- >- /** >- * Shows all Overlays in the manager. >- * @method showAll >- */ >- showAll: function () { >- var overlays = this.overlays, >- n = overlays.length, >- i; >- >- for (i = n - 1; i >= 0; i--) { >- overlays[i].show(); >- } >- }, >- >- /** >- * Hides all Overlays in the manager. >- * @method hideAll >- */ >- hideAll: function () { >- var overlays = this.overlays, >- n = overlays.length, >- i; >- >- for (i = n - 1; i >= 0; i--) { >- overlays[i].hide(); >- } >- }, >- >- /** >- * Returns a string representation of the object. >- * @method toString >- * @return {String} The string representation of the OverlayManager >- */ >- toString: function () { >- return "OverlayManager"; >- } >- }; >-}()); >-(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 <em>OR</em> >- * @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 <em>OR</em> >- * @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) { >- >- this.logger = new YAHOO.widget.LogWriter(this.toString()); >- >- 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. >- * <p> >- * 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. >- * </p> >- * <p>This event differs from the beforeShow event in following respects:</p> >- * <ol> >- * <li> >- * When moving from one context element to another, if the tooltip is not >- * hidden (the <code>hidedelay</code> 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. >- * </li> >- * <li> >- * 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. >- * </li> >- * </ol> >- * <p> >- * 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. >- * </p> >- * @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. <em>Please note: >- * </em> 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 <code>document.body</code> 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.logger.log("Clearing hide timer: " + obj.hideProcId, "time"); >- 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); >- obj.logger.log("Setting show tooltip timeout: " + obj.showProcId, "time"); >- } >- }, >- >- /** >- * 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.logger.log("Clearing show timer: " + obj.showProcId, "time"); >- obj.showProcId = null; >- } >- >- if (obj.hideProcId) { >- clearTimeout(obj.hideProcId); >- obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time"); >- 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.logger.log("Show tooltip", "time"); >- 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(); >- me.logger.log("Hide tooltip time active: " + me.hideProcId, "time"); >- >- }, 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; >- >- me.logger.log("Setting hide tooltip timeout", "time"); >- >- return setTimeout(function () { >- >- me.logger.log("Hide tooltip", "time"); >- 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; >- >- this.logger.log("context " + elementRegion, "ttip"); >- this.logger.log("mouse " + mousePoint, "ttip"); >- >- if (elementRegion.contains(mousePoint)) { >- this.logger.log("OVERLAP", "warn"); >- 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 <em>OR</em> >- * @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 <em>OR</em> >- * @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." <strong>PLEASE NOTE:</strong> 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. <em>This fix is only applied to draggable Panels in IE 6 >- * (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode)</em>. 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. >- * <p> >- * 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. >- * </p> >- * <p> >- * When set to false, all drop target related events will be fired. >- * </p> >- * <p> >- * 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.</p> >- * >- * @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". <strong>PLEASE NOTE:</strong> >- * 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: >- * <dl> >- * <dt>close</dt><dd><em>String</em> : The string to use for the close icon. Defaults to "Close".</dd> >- * </dl> >- */ >- 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) { >- YAHOO.log("DD dependency not met.", "error"); >- 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) { >- YAHOO.log("DD dependency not met.", "error"); >- 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. >- * >- * <p>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. >- * </p> >- * @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 <em>OR</em> >- * @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 () { >- >- /** >- * <p> >- * Dialog is an implementation of Panel that can be used to submit form >- * data. >- * </p> >- * <p> >- * 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. >- * </p> >- * <p> >- * 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. >- * </p> >- * @namespace YAHOO.widget >- * @class Dialog >- * @extends YAHOO.widget.Panel >- * @constructor >- * @param {String} el The element ID representing the Dialog <em>OR</em> >- * @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 >- * <code><form></code> element. >- * @default null >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-40002357">HTMLFormElement</a> >- */ >- 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, >- >- /** >- *<p> >- * The function to execute upon success of the >- * Connection submission, when the form contains >- * a file input element. >- * </p> >- * <p> >- * <em>NOTE:</em> Connection manager will not >- * invoke the success or failure handlers for the file >- * upload use case. This will be the only callback >- * handler invoked. >- * </p> >- * <p> >- * For more information, see the <a href="http://developer.yahoo.com/yui/connection/#file"> >- * Connection Manager documenation on file uploads</a>. >- * </p> >- * @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 >- * <a href="#config_postmethod">async</a> postmethod for dialog POST submissions. >- * The format for the post data string is defined by Connection Manager's >- * <a href="YAHOO.util.Connect.html#method_asyncRequest">asyncRequest</a> >- * 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. >- * >- * <p>Each button object in the buttons array can have three properties:</p> >- * <dl> >- * <dt>text:</dt> >- * <dd> >- * 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. >- * </dd> >- * <dt>handler:</dt> >- * <dd>Can be either: >- * <ol> >- * <li>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.)</li> >- * >- * <li>An object literal representing the code to be >- * executed when the button is clicked. >- * >- * <p>Format:</p> >- * >- * <p> >- * <code>{ >- * <br> >- * <strong>fn:</strong> Function, // >- * The handler to call when the event fires. >- * <br> >- * <strong>obj:</strong> Object, // >- * An object to pass back to the handler. >- * <br> >- * <strong>scope:</strong> Object // >- * The object to use for the scope of the handler. >- * <br> >- * }</code> >- * </p> >- * </li> >- * </ol> >- * </dd> >- * <dt>isDefault:</dt> >- * <dd> >- * An optional boolean value that specifies that a button >- * should be highlighted and focused by default. >- * </dd> >- * </dl> >- * >- * <em>NOTE:</em>If the YUI Button Widget is included on the page, >- * the buttons created will be instances of YAHOO.widget.Button. >- * Otherwise, HTML Buttons (<code><BUTTON></code>) 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 <em>OR</em> >- * @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. <strong>Please note: >- * </strong> As of version 2.3 this method will automatically handle >- * asyncronous file uploads should the Dialog instance's form contain >- * <code><input type="file"></code> elements. If a Dialog >- * instance will be handling asyncronous file uploads, its >- * <code>callback</code> property will need to be setup with a >- * <code>upload</code> handler rather than the standard >- * <code>success</code> and, or <code>failure</code> handlers. For more >- * information, see the <a href="http://developer.yahoo.com/yui/ >- * connection/#file">Connection Manager documenation on file uploads</a>. >- * @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 <code><BUTTON></code> >- * 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; >- }, >- >- /** >- * <p> >- * 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. >- * </p> >- * <p> >- * This method is invoked when the Dialog is made visible. >- * </p> >- * @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 >- * <em>OR</em> >- * @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 >- * <em>OR</em> >- * @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 += "<input type=\"hidden\" name=\"" + >- this.id + "\" value=\"\"/>"; >- >- }, >- >- // 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; >- } >- >- /** >- * <p> >- * 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. >- * </p> >- * <p><strong>NOTE:</strong> SimpleDialog provides the <a href="#config_text">text</a> >- * and <a href="#config_icon">icon</a> 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.</p> >- * >- * @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. >- * <em>OR</em> >- * @param {HTMLElement} bodyContent The HTMLElement to add as the first and only child of the body element. >- * <em>OR</em> >- * @param {DocumentFragment} bodyContent The document fragment >- * containing elements which are to be added to the body >- */ >- }); >- >-}()); >-(function () { >- >- /** >- * ContainerEffect encapsulates animation transitions that are executed when >- * an Overlay is shown or hidden. >- * @namespace YAHOO.widget >- * @class ContainerEffect >- * @constructor >- * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation >- * should be associated with >- * @param {Object} attrIn The object literal representing the animation >- * arguments to be used for the animate-in transition. The arguments for >- * this literal are: attributes(object, see YAHOO.util.Anim for description), >- * duration(Number), and method(i.e. Easing.easeIn). >- * @param {Object} attrOut The object literal representing the animation >- * arguments to be used for the animate-out transition. The arguments for >- * this literal are: attributes(object, see YAHOO.util.Anim for description), >- * duration(Number), and method(i.e. Easing.easeIn). >- * @param {HTMLElement} targetElement Optional. The target element that >- * should be animated during the transition. Defaults to overlay.element. >- * @param {class} Optional. The animation class to instantiate. Defaults to >- * YAHOO.util.Anim. Other options include YAHOO.util.Motion. >- */ >- YAHOO.widget.ContainerEffect = function (overlay, attrIn, attrOut, targetElement, animClass) { >- >- if (!animClass) { >- animClass = YAHOO.util.Anim; >- } >- >- /** >- * The overlay to animate >- * @property overlay >- * @type YAHOO.widget.Overlay >- */ >- this.overlay = overlay; >- >- /** >- * The animation attributes to use when transitioning into view >- * @property attrIn >- * @type Object >- */ >- this.attrIn = attrIn; >- >- /** >- * The animation attributes to use when transitioning out of view >- * @property attrOut >- * @type Object >- */ >- this.attrOut = attrOut; >- >- /** >- * The target element to be animated >- * @property targetElement >- * @type HTMLElement >- */ >- this.targetElement = targetElement || overlay.element; >- >- /** >- * The animation class to use for animating the overlay >- * @property animClass >- * @type class >- */ >- this.animClass = animClass; >- >- }; >- >- >- var Dom = YAHOO.util.Dom, >- CustomEvent = YAHOO.util.CustomEvent, >- ContainerEffect = YAHOO.widget.ContainerEffect; >- >- >- /** >- * A pre-configured ContainerEffect instance that can be used for fading >- * an overlay in and out. >- * @method FADE >- * @static >- * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate >- * @param {Number} dur The duration of the animation >- * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object >- */ >- ContainerEffect.FADE = function (overlay, dur) { >- >- var Easing = YAHOO.util.Easing, >- fin = { >- attributes: {opacity:{from:0, to:1}}, >- duration: dur, >- method: Easing.easeIn >- }, >- fout = { >- attributes: {opacity:{to:0}}, >- duration: dur, >- method: Easing.easeOut >- }, >- fade = new ContainerEffect(overlay, fin, fout, overlay.element); >- >- fade.handleUnderlayStart = function() { >- var underlay = this.overlay.underlay; >- if (underlay && YAHOO.env.ua.ie) { >- var hasFilters = (underlay.filters && underlay.filters.length > 0); >- if(hasFilters) { >- Dom.addClass(overlay.element, "yui-effect-fade"); >- } >- } >- }; >- >- fade.handleUnderlayComplete = function() { >- var underlay = this.overlay.underlay; >- if (underlay && YAHOO.env.ua.ie) { >- Dom.removeClass(overlay.element, "yui-effect-fade"); >- } >- }; >- >- fade.handleStartAnimateIn = function (type, args, obj) { >- Dom.addClass(obj.overlay.element, "hide-select"); >- >- if (!obj.overlay.underlay) { >- obj.overlay.cfg.refireEvent("underlay"); >- } >- >- obj.handleUnderlayStart(); >- >- obj.overlay._setDomVisibility(true); >- Dom.setStyle(obj.overlay.element, "opacity", 0); >- }; >- >- fade.handleCompleteAnimateIn = function (type,args,obj) { >- Dom.removeClass(obj.overlay.element, "hide-select"); >- >- if (obj.overlay.element.style.filter) { >- obj.overlay.element.style.filter = null; >- } >- >- obj.handleUnderlayComplete(); >- >- obj.overlay.cfg.refireEvent("iframe"); >- obj.animateInCompleteEvent.fire(); >- }; >- >- fade.handleStartAnimateOut = function (type, args, obj) { >- Dom.addClass(obj.overlay.element, "hide-select"); >- obj.handleUnderlayStart(); >- }; >- >- fade.handleCompleteAnimateOut = function (type, args, obj) { >- Dom.removeClass(obj.overlay.element, "hide-select"); >- if (obj.overlay.element.style.filter) { >- obj.overlay.element.style.filter = null; >- } >- obj.overlay._setDomVisibility(false); >- Dom.setStyle(obj.overlay.element, "opacity", 1); >- >- obj.handleUnderlayComplete(); >- >- obj.overlay.cfg.refireEvent("iframe"); >- obj.animateOutCompleteEvent.fire(); >- }; >- >- fade.init(); >- return fade; >- }; >- >- >- /** >- * A pre-configured ContainerEffect instance that can be used for sliding an >- * overlay in and out. >- * @method SLIDE >- * @static >- * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate >- * @param {Number} dur The duration of the animation >- * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object >- */ >- ContainerEffect.SLIDE = function (overlay, dur) { >- var Easing = YAHOO.util.Easing, >- >- x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element), >- y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element), >- clientWidth = Dom.getClientWidth(), >- offsetWidth = overlay.element.offsetWidth, >- >- sin = { >- attributes: { points: { to: [x, y] } }, >- duration: dur, >- method: Easing.easeIn >- }, >- >- sout = { >- attributes: { points: { to: [(clientWidth + 25), y] } }, >- duration: dur, >- method: Easing.easeOut >- }, >- >- slide = new ContainerEffect(overlay, sin, sout, overlay.element, YAHOO.util.Motion); >- >- slide.handleStartAnimateIn = function (type,args,obj) { >- obj.overlay.element.style.left = ((-25) - offsetWidth) + "px"; >- obj.overlay.element.style.top = y + "px"; >- }; >- >- slide.handleTweenAnimateIn = function (type, args, obj) { >- >- var pos = Dom.getXY(obj.overlay.element), >- currentX = pos[0], >- currentY = pos[1]; >- >- if (Dom.getStyle(obj.overlay.element, "visibility") == >- "hidden" && currentX < x) { >- >- obj.overlay._setDomVisibility(true); >- >- } >- >- obj.overlay.cfg.setProperty("xy", [currentX, currentY], true); >- obj.overlay.cfg.refireEvent("iframe"); >- }; >- >- slide.handleCompleteAnimateIn = function (type, args, obj) { >- obj.overlay.cfg.setProperty("xy", [x, y], true); >- obj.startX = x; >- obj.startY = y; >- obj.overlay.cfg.refireEvent("iframe"); >- obj.animateInCompleteEvent.fire(); >- }; >- >- slide.handleStartAnimateOut = function (type, args, obj) { >- >- var vw = Dom.getViewportWidth(), >- pos = Dom.getXY(obj.overlay.element), >- yso = pos[1]; >- >- obj.animOut.attributes.points.to = [(vw + 25), yso]; >- }; >- >- slide.handleTweenAnimateOut = function (type, args, obj) { >- >- var pos = Dom.getXY(obj.overlay.element), >- xto = pos[0], >- yto = pos[1]; >- >- obj.overlay.cfg.setProperty("xy", [xto, yto], true); >- obj.overlay.cfg.refireEvent("iframe"); >- }; >- >- slide.handleCompleteAnimateOut = function (type, args, obj) { >- obj.overlay._setDomVisibility(false); >- >- obj.overlay.cfg.setProperty("xy", [x, y]); >- obj.animateOutCompleteEvent.fire(); >- }; >- >- slide.init(); >- return slide; >- }; >- >- ContainerEffect.prototype = { >- >- /** >- * Initializes the animation classes and events. >- * @method init >- */ >- init: function () { >- >- this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn"); >- this.beforeAnimateInEvent.signature = CustomEvent.LIST; >- >- this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut"); >- this.beforeAnimateOutEvent.signature = CustomEvent.LIST; >- >- this.animateInCompleteEvent = this.createEvent("animateInComplete"); >- this.animateInCompleteEvent.signature = CustomEvent.LIST; >- >- this.animateOutCompleteEvent = >- this.createEvent("animateOutComplete"); >- this.animateOutCompleteEvent.signature = CustomEvent.LIST; >- >- this.animIn = new this.animClass(this.targetElement, >- this.attrIn.attributes, this.attrIn.duration, >- this.attrIn.method); >- >- this.animIn.onStart.subscribe(this.handleStartAnimateIn, this); >- this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this); >- >- this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, >- this); >- >- this.animOut = new this.animClass(this.targetElement, >- this.attrOut.attributes, this.attrOut.duration, >- this.attrOut.method); >- >- this.animOut.onStart.subscribe(this.handleStartAnimateOut, this); >- this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this); >- this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, >- this); >- >- }, >- >- /** >- * Triggers the in-animation. >- * @method animateIn >- */ >- animateIn: function () { >- this.beforeAnimateInEvent.fire(); >- this.animIn.animate(); >- }, >- >- /** >- * Triggers the out-animation. >- * @method animateOut >- */ >- animateOut: function () { >- this.beforeAnimateOutEvent.fire(); >- this.animOut.animate(); >- }, >- >- /** >- * The default onStart handler for the in-animation. >- * @method handleStartAnimateIn >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleStartAnimateIn: function (type, args, obj) { }, >- >- /** >- * The default onTween handler for the in-animation. >- * @method handleTweenAnimateIn >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleTweenAnimateIn: function (type, args, obj) { }, >- >- /** >- * The default onComplete handler for the in-animation. >- * @method handleCompleteAnimateIn >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleCompleteAnimateIn: function (type, args, obj) { }, >- >- /** >- * The default onStart handler for the out-animation. >- * @method handleStartAnimateOut >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleStartAnimateOut: function (type, args, obj) { }, >- >- /** >- * The default onTween handler for the out-animation. >- * @method handleTweenAnimateOut >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleTweenAnimateOut: function (type, args, obj) { }, >- >- /** >- * The default onComplete handler for the out-animation. >- * @method handleCompleteAnimateOut >- * @param {String} type The CustomEvent type >- * @param {Object[]} args The CustomEvent arguments >- * @param {Object} obj The scope object >- */ >- handleCompleteAnimateOut: function (type, args, obj) { }, >- >- /** >- * Returns a string representation of the object. >- * @method toString >- * @return {String} The string representation of the ContainerEffect >- */ >- toString: function () { >- var output = "ContainerEffect"; >- if (this.overlay) { >- output += " [" + this.overlay.toString() + "]"; >- } >- return output; >- } >- }; >- >- YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider); >- >-})(); >-YAHOO.register("container", YAHOO.widget.Module, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/container-min.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container-min.js >deleted file mode 100644 >index d36255e2eb..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container-min.js >+++ /dev/null >@@ -1,19 +0,0 @@ >-/* >-Copyright (c) 2009, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.8.0r4 >-*/ >-(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F=this.config,G,E;for(G in F){if(B.hasOwnProperty(F,G)){E=F[G];if(E&&E.event){D[G]=E.value;}}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){if(B.hasOwnProperty(this.config,D)){this.refireEvent(D);}}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.eventQueue[E]=null;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(D,E,G,H){var F=this.config[D.toLowerCase()];if(F&&F.event){if(!A.alreadySubscribed(F.event,E,G)){F.event.subscribe(E,G,H);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(R,Q){if(R){this.init(R,Q);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,N=YAHOO.util.Event,M=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,I=YAHOO.env.ua,H,P,O,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTROY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},J={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.RESIZE_MONITOR_BUFFER=1;G.textResizeEvent=new M("textResize");G.forceDocumentRedraw=function(){var Q=document.documentElement;if(Q){Q.className+=" ";Q.className=YAHOO.lang.trim(Q.className);}};function L(){if(!H){H=document.createElement("div");H.innerHTML=('<div class="'+G.CSS_HEADER+'"></div>'+'<div class="'+G.CSS_BODY+'"></div><div class="'+G.CSS_FOOTER+'"></div>');P=H.firstChild;O=P.nextSibling;E=O.nextSibling;}return H;}function K(){if(!P){L();}return(P.cloneNode(false));}function B(){if(!O){L();}return(O.cloneNode(false));}function C(){if(!E){L();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var Q=M.LIST; >-this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=Q;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=Q;this.appendEvent=this.createEvent(A.APPEND);this.appendEvent.signature=Q;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=Q;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=Q;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=Q;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=Q;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=Q;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=Q;this.destroyEvent=this.createEvent(A.DESTROY);this.destroyEvent.signature=Q;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=Q;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=Q;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=Q;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=Q;},platform:function(){var Q=navigator.userAgent.toLowerCase();if(Q.indexOf("windows")!=-1||Q.indexOf("win32")!=-1){return"windows";}else{if(Q.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var Q=navigator.userAgent.toLowerCase();if(Q.indexOf("opera")!=-1){return"opera";}else{if(Q.indexOf("msie 7")!=-1){return"ie7";}else{if(Q.indexOf("msie")!=-1){return"ie";}else{if(Q.indexOf("safari")!=-1){return"safari";}else{if(Q.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(J.VISIBLE.key,{handler:this.configVisible,value:J.VISIBLE.value,validator:J.VISIBLE.validator});this.cfg.addProperty(J.EFFECT.key,{suppressEvent:J.EFFECT.suppressEvent,supercedes:J.EFFECT.supercedes});this.cfg.addProperty(J.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:J.MONITOR_RESIZE.value});this.cfg.addProperty(J.APPEND_TO_DOCUMENT_BODY.key,{value:J.APPEND_TO_DOCUMENT_BODY.value});},init:function(V,U){var S,W;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof V=="string"){S=V;V=document.getElementById(V);if(!V){V=(L()).cloneNode(false);V.id=S;}}this.id=F.generateId(V);this.element=V;W=this.element.firstChild;if(W){var R=false,Q=false,T=false;do{if(1==W.nodeType){if(!R&&F.hasClass(W,G.CSS_HEADER)){this.header=W;R=true;}else{if(!Q&&F.hasClass(W,G.CSS_BODY)){this.body=W;Q=true;}else{if(!T&&F.hasClass(W,G.CSS_FOOTER)){this.footer=W;T=true;}}}}}while((W=W.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(U){this.cfg.applyConfig(U,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var R=(I.gecko&&this.platform=="windows");if(R){var Q=this;setTimeout(function(){Q._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var Q,S,U;function W(){G.textResizeEvent.fire();}if(!I.opera){S=F.get("_yuiResizeMonitor");var V=this._supportsCWResize();if(!S){S=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&I.ie){S.src=G.RESIZE_MONITOR_SECURE_URL;}if(!V){U=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");S.src="data:text/html;charset=utf-8,"+encodeURIComponent(U);}S.id="_yuiResizeMonitor";S.title="Text Resize Monitor";S.style.position="absolute";S.style.visibility="hidden";var R=document.body,T=R.firstChild;if(T){R.insertBefore(S,T);}else{R.appendChild(S);}S.style.backgroundColor="transparent";S.style.borderWidth="0";S.style.width="2em";S.style.height="2em";S.style.left="0";S.style.top=(-1*(S.offsetHeight+G.RESIZE_MONITOR_BUFFER))+"px";S.style.visibility="visible";if(I.webkit){Q=S.contentWindow.document;Q.open();Q.close();}}if(S&&S.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(V){if(!N.on(S.contentWindow,"resize",W)){N.on(S,"resize",W);}}G.textResizeInitialized=true;}this.resizeMonitor=S;}}},_supportsCWResize:function(){var Q=true;if(I.gecko&&I.gecko<=1.8){Q=false;}return Q;},onDomResize:function(S,R){var Q=-1*(this.resizeMonitor.offsetHeight+G.RESIZE_MONITOR_BUFFER);this.resizeMonitor.style.top=Q+"px";this.resizeMonitor.style.left="0";},setHeader:function(R){var Q=this.header||(this.header=K());if(R.nodeName){Q.innerHTML="";Q.appendChild(R);}else{Q.innerHTML=R;}if(this._rendered){this._renderHeader();}this.changeHeaderEvent.fire(R);this.changeContentEvent.fire();},appendToHeader:function(R){var Q=this.header||(this.header=K());Q.appendChild(R);this.changeHeaderEvent.fire(R);this.changeContentEvent.fire();},setBody:function(R){var Q=this.body||(this.body=B());if(R.nodeName){Q.innerHTML="";Q.appendChild(R);}else{Q.innerHTML=R;}if(this._rendered){this._renderBody();}this.changeBodyEvent.fire(R);this.changeContentEvent.fire();},appendToBody:function(R){var Q=this.body||(this.body=B());Q.appendChild(R);this.changeBodyEvent.fire(R);this.changeContentEvent.fire();},setFooter:function(R){var Q=this.footer||(this.footer=C());if(R.nodeName){Q.innerHTML="";Q.appendChild(R);}else{Q.innerHTML=R;}if(this._rendered){this._renderFooter();}this.changeFooterEvent.fire(R);this.changeContentEvent.fire();},appendToFooter:function(R){var Q=this.footer||(this.footer=C());Q.appendChild(R);this.changeFooterEvent.fire(R);this.changeContentEvent.fire();},render:function(S,Q){var T=this;function R(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){T._addToParent(U,T.element);T.appendEvent.fire();}}this.beforeRenderEvent.fire(); >-if(!Q){Q=this.element;}if(S){R(S);}else{if(!F.inDocument(this.element)){return false;}}this._renderHeader(Q);this._renderBody(Q);this._renderFooter(Q);this._rendered=true;this.renderEvent.fire();return true;},_renderHeader:function(Q){Q=Q||this.element;if(this.header&&!F.inDocument(this.header)){var R=Q.firstChild;if(R){Q.insertBefore(this.header,R);}else{Q.appendChild(this.header);}}},_renderBody:function(Q){Q=Q||this.element;if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(Q,this.footer)){Q.insertBefore(this.body,this.footer);}else{Q.appendChild(this.body);}}},_renderFooter:function(Q){Q=Q||this.element;if(this.footer&&!F.inDocument(this.footer)){Q.appendChild(this.footer);}},destroy:function(){var Q;if(this.element){N.purgeElement(this.element,true);Q=this.element.parentNode;}if(Q){Q.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(R,Q,S){var T=Q[0];if(T){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(S,R,T){var Q=R[0];if(Q){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(Q,R){if(!this.cfg.getProperty("appendtodocumentbody")&&Q===document.body&&Q.firstChild){Q.insertBefore(R,Q.firstChild);}else{Q.appendChild(R);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(P,O){YAHOO.widget.Overlay.superclass.constructor.call(this,P,O);};var I=YAHOO.lang,M=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,N=YAHOO.util.Event,F=YAHOO.util.Dom,D=YAHOO.util.Config,K=YAHOO.env.ua,B=YAHOO.widget.Overlay,H="subscribe",E="unsubscribe",C="contained",J,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},L={"X":{key:"x",validator:I.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:I.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"AUTO_FILL_HEIGHT":{key:"autofillheight",supercedes:["height"],value:"body"},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:I.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(K.ie==6?true:false),validator:I.isBoolean,supercedes:["zindex"]},"PREVENT_CONTEXT_OVERLAP":{key:"preventcontextoverlap",value:false,validator:I.isBoolean,supercedes:["constraintoviewport"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.PREVENT_OVERLAP_X={"tltr":true,"blbr":true,"brbl":true,"trtl":true};B.PREVENT_OVERLAP_Y={"trbr":true,"tlbl":true,"bltl":true,"brtr":true};B.CSS_OVERLAY="yui-overlay";B.CSS_HIDDEN="yui-overlay-hidden";B.CSS_IFRAME="yui-overlay-iframe";B.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;B.windowScrollEvent=new M("windowScroll");B.windowResizeEvent=new M("windowResize");B.windowScrollHandler=function(P){var O=N.getTarget(P);if(!O||O===window||O===window.document){if(K.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}}};B.windowResizeHandler=function(O){if(K.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){N.on(window,"scroll",B.windowScrollHandler);N.on(window,"resize",B.windowResizeHandler);B._initialized=true;}B._TRIGGER_MAP={"windowScroll":B.windowScrollEvent,"windowResize":B.windowResizeEvent,"textResize":G.textResizeEvent};YAHOO.extend(B,G,{CONTEXT_TRIGGERS:[],init:function(P,O){B.superclass.init.call(this,P);this.beforeInitEvent.fire(B);F.addClass(this.element,B.CSS_OVERLAY);if(O){this.cfg.applyConfig(O,true);}if(this.platform=="mac"&&K.gecko){if(!D.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!D.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var O=M.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=O;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=O;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);var O=this.cfg;O.addProperty(L.X.key,{handler:this.configX,validator:L.X.validator,suppressEvent:L.X.suppressEvent,supercedes:L.X.supercedes});O.addProperty(L.Y.key,{handler:this.configY,validator:L.Y.validator,suppressEvent:L.Y.suppressEvent,supercedes:L.Y.supercedes});O.addProperty(L.XY.key,{handler:this.configXY,suppressEvent:L.XY.suppressEvent,supercedes:L.XY.supercedes});O.addProperty(L.CONTEXT.key,{handler:this.configContext,suppressEvent:L.CONTEXT.suppressEvent,supercedes:L.CONTEXT.supercedes});O.addProperty(L.FIXED_CENTER.key,{handler:this.configFixedCenter,value:L.FIXED_CENTER.value,validator:L.FIXED_CENTER.validator,supercedes:L.FIXED_CENTER.supercedes});O.addProperty(L.WIDTH.key,{handler:this.configWidth,suppressEvent:L.WIDTH.suppressEvent,supercedes:L.WIDTH.supercedes}); >-O.addProperty(L.HEIGHT.key,{handler:this.configHeight,suppressEvent:L.HEIGHT.suppressEvent,supercedes:L.HEIGHT.supercedes});O.addProperty(L.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:L.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:L.AUTO_FILL_HEIGHT.supercedes});O.addProperty(L.ZINDEX.key,{handler:this.configzIndex,value:L.ZINDEX.value});O.addProperty(L.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:L.CONSTRAIN_TO_VIEWPORT.value,validator:L.CONSTRAIN_TO_VIEWPORT.validator,supercedes:L.CONSTRAIN_TO_VIEWPORT.supercedes});O.addProperty(L.IFRAME.key,{handler:this.configIframe,value:L.IFRAME.value,validator:L.IFRAME.validator,supercedes:L.IFRAME.supercedes});O.addProperty(L.PREVENT_CONTEXT_OVERLAP.key,{value:L.PREVENT_CONTEXT_OVERLAP.value,validator:L.PREVENT_CONTEXT_OVERLAP.validator,supercedes:L.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(O,P){this.cfg.setProperty("xy",[O,P]);},hideMacGeckoScrollbars:function(){F.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){F.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(O){F.setStyle(this.element,"visibility",(O)?"visible":"hidden");var P=B.CSS_HIDDEN;if(O){F.removeClass(this.element,P);}else{F.addClass(this.element,P);}},configVisible:function(R,O,X){var Q=O[0],S=F.getStyle(this.element,"visibility"),Y=this.cfg.getProperty("effect"),V=[],U=(this.platform=="mac"&&K.gecko),g=D.alreadySubscribed,W,P,f,c,b,a,d,Z,T;if(S=="inherit"){f=this.element.parentNode;while(f.nodeType!=9&&f.nodeType!=11){S=F.getStyle(f,"visibility");if(S!="inherit"){break;}f=f.parentNode;}if(S=="inherit"){S="visible";}}if(Y){if(Y instanceof Array){Z=Y.length;for(c=0;c<Z;c++){W=Y[c];V[V.length]=W.effect(this,W.duration);}}else{V[V.length]=Y.effect(this,Y.duration);}}if(Q){if(U){this.showMacGeckoScrollbars();}if(Y){if(Q){if(S!="visible"||S===""){this.beforeShowEvent.fire();T=V.length;for(b=0;b<T;b++){P=V[b];if(b===0&&!g(P.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){P.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}P.animateIn();}}}}else{if(S!="visible"||S===""){this.beforeShowEvent.fire();this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}else{this._setDomVisibility(true);}}}else{if(U){this.hideMacGeckoScrollbars();}if(Y){if(S=="visible"){this.beforeHideEvent.fire();T=V.length;for(a=0;a<T;a++){d=V[a];if(a===0&&!g(d.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){d.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}d.animateOut();}}else{if(S===""){this._setDomVisibility(false);}}}else{if(S=="visible"||S===""){this.beforeHideEvent.fire();this._setDomVisibility(false);this.hideEvent.fire();}else{this._setDomVisibility(false);}}}},doCenterOnDOMEvent:function(){var O=this.cfg,P=O.getProperty("fixedcenter");if(O.getProperty("visible")){if(P&&(P!==C||this.fitsInViewport())){this.center();}}},fitsInViewport:function(){var S=B.VIEWPORT_OFFSET,Q=this.element,T=Q.offsetWidth,R=Q.offsetHeight,O=F.getViewportWidth(),P=F.getViewportHeight();return((T+S<O)&&(R+S<P));},configFixedCenter:function(S,Q,T){var U=Q[0],P=D.alreadySubscribed,R=B.windowResizeEvent,O=B.windowScrollEvent;if(U){this.center();if(!P(this.beforeShowEvent,this.center)){this.beforeShowEvent.subscribe(this.center);}if(!P(R,this.doCenterOnDOMEvent,this)){R.subscribe(this.doCenterOnDOMEvent,this,true);}if(!P(O,this.doCenterOnDOMEvent,this)){O.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);R.unsubscribe(this.doCenterOnDOMEvent,this);O.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(R,P,S){var O=P[0],Q=this.element;F.setStyle(Q,"height",O);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(T,S,P){var V=S[0],Q=this.cfg,U="autofillheight",W="height",R=Q.getProperty(U),O=this._autoFillOnHeightChange;Q.unsubscribeFromConfigEvent(W,O);G.textResizeEvent.unsubscribe(O);this.changeContentEvent.unsubscribe(O);if(R&&V!==R&&this[R]){F.setStyle(this[R],W,"");}if(V){V=I.trim(V.toLowerCase());Q.subscribeToConfigEvent(W,O,this[V],this);G.textResizeEvent.subscribe(O,this[V],this);this.changeContentEvent.subscribe(O,this[V],this);Q.setProperty(U,V,true);}},configWidth:function(R,O,S){var Q=O[0],P=this.element;F.setStyle(P,"width",Q);this.cfg.refireEvent("iframe");},configzIndex:function(Q,O,R){var S=O[0],P=this.element;if(!S){S=F.getStyle(P,"zIndex");if(!S||isNaN(S)){S=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(S<=0){S=1;}}F.setStyle(P,"zIndex",S);this.cfg.setProperty("zIndex",S,true);if(this.iframe){this.stackIframe();}},configXY:function(Q,P,R){var T=P[0],O=T[0],S=T[1];this.cfg.setProperty("x",O);this.cfg.setProperty("y",S);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},configX:function(Q,P,R){var O=P[0],S=this.cfg.getProperty("y");this.cfg.setProperty("x",O,true);this.cfg.setProperty("y",S,true);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");F.setX(this.element,O,true);this.cfg.setProperty("xy",[O,S],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},configY:function(Q,P,R){var O=this.cfg.getProperty("x"),S=P[0];this.cfg.setProperty("x",O,true);this.cfg.setProperty("y",S,true);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");F.setY(this.element,S,true);this.cfg.setProperty("xy",[O,S],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},showIframe:function(){var P=this.iframe,O;if(P){O=this.element.parentNode;if(O!=P.parentNode){this._addToParent(O,P);}P.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var O=this.iframe,Q=this.element,S=B.IFRAME_OFFSET,P=(S*2),R;if(O){O.style.width=(Q.offsetWidth+P+"px"); >-O.style.height=(Q.offsetHeight+P+"px");R=this.cfg.getProperty("xy");if(!I.isArray(R)||(isNaN(R[0])||isNaN(R[1]))){this.syncPosition();R=this.cfg.getProperty("xy");}F.setXY(O,[(R[0]-S),(R[1]-S)]);}},stackIframe:function(){if(this.iframe){var O=F.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(O)&&!isNaN(O)){F.setStyle(this.iframe,"zIndex",(O-1));}}},configIframe:function(R,Q,S){var O=Q[0];function T(){var V=this.iframe,W=this.element,X;if(!V){if(!J){J=document.createElement("iframe");if(this.isSecure){J.src=B.IFRAME_SRC;}if(K.ie){J.style.filter="alpha(opacity=0)";J.frameBorder=0;}else{J.style.opacity="0";}J.style.position="absolute";J.style.border="none";J.style.margin="0";J.style.padding="0";J.style.display="none";J.tabIndex=-1;J.className=B.CSS_IFRAME;}V=J.cloneNode(false);V.id=this.id+"_f";X=W.parentNode;var U=X||document.body;this._addToParent(U,V);this.iframe=V;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function P(){T.call(this);this.beforeShowEvent.unsubscribe(P);this._iframeDeferred=false;}if(O){if(this.cfg.getProperty("visible")){T.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(P);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(P,O,Q){var R=O[0];if(R){if(!D.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!D.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(U,T,Q){var X=T[0],R,O,V,S,P,W=this.CONTEXT_TRIGGERS;if(X){R=X[0];O=X[1];V=X[2];S=X[3];P=X[4];if(W&&W.length>0){S=(S||[]).concat(W);}if(R){if(typeof R=="string"){this.cfg.setProperty("context",[document.getElementById(R),O,V,S,P],true);}if(O&&V){this.align(O,V,P);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,E,this._alignOnTrigger);}if(S){this._processTriggers(S,H,this._alignOnTrigger);this._contextTriggers=S;}}}},_alignOnTrigger:function(P,O){this.align();},_findTriggerCE:function(O){var P=null;if(O instanceof M){P=O;}else{if(B._TRIGGER_MAP[O]){P=B._TRIGGER_MAP[O];}}return P;},_processTriggers:function(S,U,R){var Q,T;for(var P=0,O=S.length;P<O;++P){Q=S[P];T=this._findTriggerCE(Q);if(T){T[U](R,this,true);}else{this[U](Q,R);}}},align:function(P,W,S){var V=this.cfg.getProperty("context"),T=this,O,Q,U;function R(Z,a){var Y=null,X=null;switch(P){case B.TOP_LEFT:Y=a;X=Z;break;case B.TOP_RIGHT:Y=a-Q.offsetWidth;X=Z;break;case B.BOTTOM_LEFT:Y=a;X=Z-Q.offsetHeight;break;case B.BOTTOM_RIGHT:Y=a-Q.offsetWidth;X=Z-Q.offsetHeight;break;}if(Y!==null&&X!==null){if(S){Y+=S[0];X+=S[1];}T.moveTo(Y,X);}}if(V){O=V[0];Q=this.element;T=this;if(!P){P=V[1];}if(!W){W=V[2];}if(!S&&V[4]){S=V[4];}if(Q&&O){U=F.getRegion(O);switch(W){case B.TOP_LEFT:R(U.top,U.left);break;case B.TOP_RIGHT:R(U.top,U.right);break;case B.BOTTOM_LEFT:R(U.bottom,U.left);break;case B.BOTTOM_RIGHT:R(U.bottom,U.right);break;}}}},enforceConstraints:function(P,O,Q){var S=O[0];var R=this.getConstrainedXY(S[0],S[1]);this.cfg.setProperty("x",R[0],true);this.cfg.setProperty("y",R[1],true);this.cfg.setProperty("xy",R,true);},_getConstrainedPos:function(X,P){var T=this.element,R=B.VIEWPORT_OFFSET,Z=(X=="x"),Y=(Z)?T.offsetWidth:T.offsetHeight,S=(Z)?F.getViewportWidth():F.getViewportHeight(),c=(Z)?F.getDocumentScrollLeft():F.getDocumentScrollTop(),b=(Z)?B.PREVENT_OVERLAP_X:B.PREVENT_OVERLAP_Y,O=this.cfg.getProperty("context"),U=(Y+R<S),W=this.cfg.getProperty("preventcontextoverlap")&&O&&b[(O[1]+O[2])],V=c+R,a=c+S-Y-R,Q=P;if(P<V||P>a){if(W){Q=this._preventOverlap(X,O[0],Y,S,c);}else{if(U){if(P<V){Q=V;}else{if(P>a){Q=a;}}}else{Q=V;}}}return Q;},_preventOverlap:function(X,W,Y,U,b){var Z=(X=="x"),T=B.VIEWPORT_OFFSET,S=this,Q=((Z)?F.getX(W):F.getY(W))-b,O=(Z)?W.offsetWidth:W.offsetHeight,P=Q-T,R=(U-(Q+O))-T,c=false,V=function(){var d;if((S.cfg.getProperty(X)-b)>Q){d=(Q-Y);}else{d=(Q+O);}S.cfg.setProperty(X,(d+b),true);return d;},a=function(){var e=((S.cfg.getProperty(X)-b)>Q)?R:P,d;if(Y>e){if(c){V();}else{V();c=true;d=a();}}return d;};a();return this.cfg.getProperty(X);},getConstrainedX:function(O){return this._getConstrainedPos("x",O);},getConstrainedY:function(O){return this._getConstrainedPos("y",O);},getConstrainedXY:function(O,P){return[this.getConstrainedX(O),this.getConstrainedY(P)];},center:function(){var R=B.VIEWPORT_OFFSET,S=this.element.offsetWidth,Q=this.element.offsetHeight,P=F.getViewportWidth(),T=F.getViewportHeight(),O,U;if(S<P){O=(P/2)-(S/2)+F.getDocumentScrollLeft();}else{O=R+F.getDocumentScrollLeft();}if(Q<T){U=(T/2)-(Q/2)+F.getDocumentScrollTop();}else{U=R+F.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(O,10),parseInt(U,10)]);this.cfg.refireEvent("iframe");if(K.webkit){this.forceContainerRedraw();}},syncPosition:function(){var O=F.getXY(this.element);this.cfg.setProperty("x",O[0],true);this.cfg.setProperty("y",O[1],true);this.cfg.setProperty("xy",O,true);},onDomResize:function(Q,P){var O=this;B.superclass.onDomResize.call(this,Q,P);setTimeout(function(){O.syncPosition();O.cfg.refireEvent("iframe");O.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(P){var O=null; >-if(P.ownerDocument&&P.ownerDocument.defaultView){var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){O=parseInt(Q.height,10);}}return(I.isNumber(O))?O:null;};}else{return function(P){var O=null;if(P.style.pixelHeight){O=P.style.pixelHeight;}return(I.isNumber(O))?O:null;};}})(),_validateAutoFillHeight:function(O){return(!O)||(I.isString(O)&&B.STD_MOD_RE.test(O));},_autoFillOnHeightChange:function(R,P,Q){var O=this.cfg.getProperty("height");if((O&&O!=="auto")||(O===0)){this.fillHeight(Q);}},_getPreciseHeight:function(P){var O=P.offsetHeight;if(P.getBoundingClientRect){var Q=P.getBoundingClientRect();O=Q.bottom-Q.top;}return O;},fillHeight:function(R){if(R){var P=this.innerElement||this.element,O=[this.header,this.body,this.footer],V,W=0,X=0,T=0,Q=false;for(var U=0,S=O.length;U<S;U++){V=O[U];if(V){if(R!==V){X+=this._getPreciseHeight(V);}else{Q=true;}}}if(Q){if(K.ie||K.opera){F.setStyle(R,"height",0+"px");}W=this._getComputedHeight(P);if(W===null){F.addClass(P,"yui-override-padding");W=P.clientHeight;F.removeClass(P,"yui-override-padding");}T=Math.max(W-X,0);F.setStyle(R,"height",T+"px");if(R.offsetHeight!=T){T=Math.max(T-(R.offsetHeight-T),0);}F.setStyle(R,"height",T+"px");}}},bringToTop:function(){var S=[],R=this.element;function V(Z,Y){var b=F.getStyle(Z,"zIndex"),a=F.getStyle(Y,"zIndex"),X=(!b||isNaN(b))?0:parseInt(b,10),W=(!a||isNaN(a))?0:parseInt(a,10);if(X>W){return -1;}else{if(X<W){return 1;}else{return 0;}}}function Q(Y){var X=F.hasClass(Y,B.CSS_OVERLAY),W=YAHOO.widget.Panel;if(X&&!F.isAncestor(R,Y)){if(W&&F.hasClass(Y,W.CSS_PANEL)){S[S.length]=Y.parentNode;}else{S[S.length]=Y;}}}F.getElementsBy(Q,"DIV",document.body);S.sort(V);var O=S[0],U;if(O){U=F.getStyle(O,"zIndex");if(!isNaN(U)){var T=false;if(O!=R){T=true;}else{if(S.length>1){var P=F.getStyle(S[1],"zIndex");if(!isNaN(P)&&(U==P)){T=true;}}}if(T){this.cfg.setProperty("zindex",(parseInt(U,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);G.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);if(this._contextTriggers){this._processTriggers(this._contextTriggers,E,this._alignOnTrigger);}B.superclass.destroy.call(this);},forceContainerRedraw:function(){var O=this;F.addClass(O.element,"yui-force-redraw");setTimeout(function(){F.removeClass(O.element,"yui-force-redraw");},0);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){K.focus();}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);M.focusEvent.unsubscribe(this._onOverlayFocusHandler,M);M.blurEvent.unsubscribe(this._onOverlayBlurHandler,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}if(M.focusEvent._managed){M.focusEvent=null;}if(M.blurEvent._managed){M.blurEvent=null;}if(M.focus._managed){M.focus=null;}if(M.blur._managed){M.blur=null;}}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._manageBlur=function(J){var K=false;if(H==J){E.removeClass(H.element,A.CSS_FOCUSED);H=null;K=true;}return K;};this._manageFocus=function(J){var K=false;if(H!=J){if(H){H.blur();}H=J;this.bringToTop(H);E.addClass(H.element,A.CSS_FOCUSED);K=true;}return K;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},_onOverlayFocusHandler:function(H,G,I){this._manageFocus(I);},_onOverlayBlurHandler:function(H,G,I){this._manageBlur(I);},_bindFocus:function(G){var H=this;if(!G.focusEvent){G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.focusEvent.subscribe(H._onOverlayFocusHandler,G,H);}if(!G.focus){C.on(G.element,H.cfg.getProperty("focusevent"),H._onOverlayElementFocus,null,G);G.focus=function(){if(H._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};G.focus._managed=true;}},_bindBlur:function(G){var H=this;if(!G.blurEvent){G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.blurEvent.subscribe(H._onOverlayBlurHandler,G,H);}if(!G.blur){G.blur=function(){if(H._manageBlur(this)){this.blurEvent.fire();}};G.blur._managed=true;}G.hideEvent.subscribe(G.blur);},_bindDestroy:function(G){var H=this;G.destroyEvent.subscribe(H._onOverlayDestroy,G,H);},_syncZIndex:function(G){var H=E.getStyle(G.element,"zIndex");if(!isNaN(H)){G.cfg.setProperty("zIndex",parseInt(H,10));}else{G.cfg.setProperty("zIndex",0);}},register:function(G){var J=false,H,I;if(G instanceof D){G.cfg.addProperty("manager",{value:this});this._bindFocus(G);this._bindBlur(G);this._bindDestroy(G); >-this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H<I;H++){J=this.register(G[H])||J;}}}return J;},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(P,O){YAHOO.widget.Tooltip.superclass.constructor.call(this,P,O);};var E=YAHOO.lang,N=YAHOO.util.Event,M=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,J=YAHOO.widget.Tooltip,H=YAHOO.env.ua,G=(H.ie&&(H.ie<=6||document.compatMode=="BackCompat")),F,I={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.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}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};J.CSS_TOOLTIP="yui-tt";function K(Q,O){var P=this.cfg,R=P.getProperty("width");if(R==O){P.setProperty("width",Q);}}function D(P,O){if("_originalWidth" in this){K.call(this,this._originalWidth,this._forcedWidth);}var Q=document.body,U=this.cfg,T=U.getProperty("width"),R,S;if((!T||T=="auto")&&(U.getProperty("container")!=Q||U.getProperty("x")>=C.getViewportWidth()||U.getProperty("y")>=C.getViewportHeight())){S=this.element.cloneNode(true);S.style.visibility="hidden";S.style.top="0px";S.style.left="0px";Q.appendChild(S);R=(S.offsetWidth+"px");Q.removeChild(S);S=null;U.setProperty("width",R);U.refireEvent("xy");this._originalWidth=T||"";this._forcedWidth=R;}}function B(P,O,Q){this.render(Q);}function L(){N.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(J,YAHOO.widget.Overlay,{init:function(P,O){J.superclass.init.call(this,P);this.beforeInitEvent.fire(J);C.addClass(this.element,J.CSS_TOOLTIP);if(O){this.cfg.applyConfig(O,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",D);this.subscribe("init",L);this.subscribe("render",this.onRender);this.initEvent.fire(J);},initEvents:function(){J.superclass.initEvents.call(this);var O=M.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=O;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=O;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=O;},initDefaultConfig:function(){J.superclass.initDefaultConfig.call(this);this.cfg.addProperty(I.PREVENT_OVERLAP.key,{value:I.PREVENT_OVERLAP.value,validator:I.PREVENT_OVERLAP.validator,supercedes:I.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(I.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:I.SHOW_DELAY.validator});this.cfg.addProperty(I.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:I.AUTO_DISMISS_DELAY.value,validator:I.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(I.HIDE_DELAY.key,{handler:this.configHideDelay,value:I.HIDE_DELAY.value,validator:I.HIDE_DELAY.validator});this.cfg.addProperty(I.TEXT.key,{handler:this.configText,suppressEvent:I.TEXT.suppressEvent});this.cfg.addProperty(I.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(I.DISABLED.key,{handler:this.configContainer,value:I.DISABLED.value,supressEvent:I.DISABLED.suppressEvent});this.cfg.addProperty(I.XY_OFFSET.key,{value:I.XY_OFFSET.value.concat(),supressEvent:I.XY_OFFSET.suppressEvent});},configText:function(P,O,Q){var R=O[0];if(R){this.setBody(R);}},configContainer:function(Q,P,R){var O=P[0];if(typeof O=="string"){this.cfg.setProperty("container",document.getElementById(O),true);}},_removeEventListeners:function(){var R=this._context,O,Q,P;if(R){O=R.length;if(O>0){P=O-1;do{Q=R[P];N.removeListener(Q,"mouseover",this.onContextMouseOver);N.removeListener(Q,"mousemove",this.onContextMouseMove);N.removeListener(Q,"mouseout",this.onContextMouseOut);}while(P--);}}},configContext:function(T,P,U){var S=P[0],V,O,R,Q;if(S){if(!(S instanceof Array)){if(typeof S=="string"){this.cfg.setProperty("context",[document.getElementById(S)],true);}else{this.cfg.setProperty("context",[S],true);}S=this.cfg.getProperty("context");}this._removeEventListeners();this._context=S;V=this._context;if(V){O=V.length;if(O>0){Q=O-1;do{R=V[Q];N.on(R,"mouseover",this.onContextMouseOver,this);N.on(R,"mousemove",this.onContextMouseMove,this);N.on(R,"mouseout",this.onContextMouseOut,this);}while(Q--);}}}},onContextMouseMove:function(P,O){O.pageX=N.getPageX(P);O.pageY=N.getPageY(P);},onContextMouseOver:function(Q,P){var O=this;if(O.title){P._tempTitle=O.title;O.title="";}if(P.fireEvent("contextMouseOver",O,Q)!==false&&!P.cfg.getProperty("disabled")){if(P.hideProcId){clearTimeout(P.hideProcId); >-P.hideProcId=null;}N.on(O,"mousemove",P.onContextMouseMove,P);P.showProcId=P.doShow(Q,O);}},onContextMouseOut:function(Q,P){var O=this;if(P._tempTitle){O.title=P._tempTitle;P._tempTitle=null;}if(P.showProcId){clearTimeout(P.showProcId);P.showProcId=null;}if(P.hideProcId){clearTimeout(P.hideProcId);P.hideProcId=null;}P.fireEvent("contextMouseOut",O,Q);P.hideProcId=setTimeout(function(){P.hide();},P.cfg.getProperty("hidedelay"));},doShow:function(R,O){var T=this.cfg.getProperty("xyoffset"),P=T[0],S=T[1],Q=this;if(H.opera&&O.tagName&&O.tagName.toUpperCase()=="A"){S+=12;}return setTimeout(function(){var U=Q.cfg.getProperty("text");if(Q._tempTitle&&(U===""||YAHOO.lang.isUndefined(U)||YAHOO.lang.isNull(U))){Q.setBody(Q._tempTitle);}else{Q.cfg.refireEvent("text");}Q.moveTo(Q.pageX+P,Q.pageY+S);if(Q.cfg.getProperty("preventoverlap")){Q.preventOverlap(Q.pageX,Q.pageY);}N.removeListener(O,"mousemove",Q.onContextMouseMove);Q.contextTriggerEvent.fire(O);Q.show();Q.hideProcId=Q.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var O=this;return setTimeout(function(){O.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(S,R){var O=this.element.offsetHeight,Q=new YAHOO.util.Point(S,R),P=C.getRegion(this.element);P.top-=5;P.left-=5;P.right+=5;P.bottom+=5;if(P.contains(Q)){this.cfg.setProperty("y",(R-O-5));}},onRender:function(S,R){function T(){var W=this.element,V=this.underlay;if(V){V.style.width=(W.offsetWidth+6)+"px";V.style.height=(W.offsetHeight+1)+"px";}}function P(){C.addClass(this.underlay,"yui-tt-shadow-visible");if(H.ie){this.forceUnderlayRedraw();}}function O(){C.removeClass(this.underlay,"yui-tt-shadow-visible");}function U(){var X=this.underlay,W,V,Z,Y;if(!X){W=this.element;V=YAHOO.widget.Module;Z=H.ie;Y=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}X=F.cloneNode(false);W.appendChild(X);this.underlay=X;this._shadow=this.underlay;P.call(this);this.subscribe("beforeShow",P);this.subscribe("hide",O);if(G){window.setTimeout(function(){T.call(Y);},0);this.cfg.subscribeToConfigEvent("width",T);this.cfg.subscribeToConfigEvent("height",T);this.subscribe("changeContent",T);V.textResizeEvent.subscribe(T,this,true);this.subscribe("destroy",function(){V.textResizeEvent.unsubscribe(T,this);});}}}function Q(){U.call(this);this.unsubscribe("beforeShow",Q);}if(this.cfg.getProperty("visible")){U.call(this);}else{this.subscribe("beforeShow",Q);}},forceUnderlayRedraw:function(){var O=this;C.addClass(O.underlay,"yui-force-redraw");setTimeout(function(){C.removeClass(O.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();J.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(V,U){YAHOO.widget.Panel.superclass.constructor.call(this,V,U);};var S=null;var E=YAHOO.lang,F=YAHOO.util,A=F.Dom,T=F.Event,M=F.CustomEvent,K=YAHOO.util.KeyListener,I=F.Config,H=YAHOO.widget.Overlay,O=YAHOO.widget.Panel,L=YAHOO.env.ua,P=(L.ie&&(L.ie<=6||document.compatMode=="BackCompat")),G,Q,C,D={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},N={"CLOSE":{key:"close",value:true,validator:E.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(F.DD?true:false),validator:E.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:E.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:E.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:E.isObject,value:{close:"Close"}}};O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";O.FOCUSABLE=["a","button","select","textarea","input","iframe"];function J(V,U){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader(" ");}}function R(V,U,W){var Z=W[0],X=W[1],Y=this.cfg,a=Y.getProperty("width");if(a==X){Y.setProperty("width",Z);}this.unsubscribe("hide",R,W);}function B(V,U){var Y,X,W;if(P){Y=this.cfg;X=Y.getProperty("width");if(!X||X=="auto"){W=(this.element.offsetWidth+"px");Y.setProperty("width",W);this.subscribe("hide",R,[(X||""),W]);}}}YAHOO.extend(O,H,{init:function(V,U){O.superclass.init.call(this,V);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(U){this.cfg.applyConfig(U,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",J);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this.focusFirst);this.initEvent.fire(O);},_onElementFocus:function(Z){if(S===this){var Y=T.getTarget(Z),X=document.documentElement,V=(Y!==X&&Y!==window);if(V&&Y!==this.element&&Y!==this.mask&&!A.isAncestor(this.element,Y)){try{if(this.firstElement){this.firstElement.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}}catch(W){try{if(V&&Y!==document.body){Y.blur();}}catch(U){}}}}},_addFocusHandlers:function(V,U){if(!this.firstElement){if(L.webkit||L.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this.setTabLoop(this.firstElement,this.lastElement);T.onFocus(document.documentElement,this._onElementFocus,this,true);S=this;},_createHiddenFocusElement:function(){var U=document.createElement("button");U.style.height="1px";U.style.width="1px";U.style.position="absolute";U.style.left="-10000em";U.style.opacity=0;U.tabIndex=-1;this.innerElement.appendChild(U);this._modalFocus=U;},_removeFocusHandlers:function(V,U){T.removeFocusListener(document.documentElement,this._onElementFocus,this);if(S==this){S=null;}},focusFirst:function(W,U,Y){var V=this.firstElement;if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},focusLast:function(W,U,Y){var V=this.lastElement; >-if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},setTabLoop:function(X,Z){var V=this.preventBackTab,W=this.preventTabOut,U=this.showEvent,Y=this.hideEvent;if(V){V.disable();U.unsubscribe(V.enable,V);Y.unsubscribe(V.disable,V);V=this.preventBackTab=null;}if(W){W.disable();U.unsubscribe(W.enable,W);Y.unsubscribe(W.disable,W);W=this.preventTabOut=null;}if(X){this.preventBackTab=new K(X,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});V=this.preventBackTab;U.subscribe(V.enable,V,true);Y.subscribe(V.disable,V,true);}if(Z){this.preventTabOut=new K(Z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});W=this.preventTabOut;U.subscribe(W.enable,W,true);Y.subscribe(W.disable,W,true);}},getFocusableElements:function(U){U=U||this.innerElement;var X={};for(var W=0;W<O.FOCUSABLE.length;W++){X[O.FOCUSABLE[W]]=true;}function V(Y){if(Y.focus&&Y.type!=="hidden"&&!Y.disabled&&X[Y.tagName.toLowerCase()]){return true;}return false;}return A.getElementsBy(V,null,U);},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var U=this.getFocusableElements();this.focusableElements=U;if(U.length>0){this.firstElement=U[0];this.lastElement=U[U.length-1];}if(this.cfg.getProperty("modal")){this.setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){O.superclass.initEvents.call(this);var U=M.LIST;this.showMaskEvent=this.createEvent(D.SHOW_MASK);this.show