Bugzilla – Attachment 135734 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
Katrin Fischer
on 2022-06-06 19:04:35 UTC
(
hide
)
Description:
Bug 13614: Replace usage of YUI on basket groups page
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-06-06 19:04:35 UTC
Size:
2.79 MB
patch
obsolete
>From 6ec43d0e7c020a88a75a128b69dec2f4bae8a458 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. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../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.showMaskEvent.signature=U;this.hideMaskEvent=this.createEvent(D.HIDE_MASK);this.hideMaskEvent.signature=U;this.dragEvent=this.createEvent(D.DRAG);this.dragEvent.signature=U;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(N.CLOSE.key,{handler:this.configClose,value:N.CLOSE.value,validator:N.CLOSE.validator,supercedes:N.CLOSE.supercedes});this.cfg.addProperty(N.DRAGGABLE.key,{handler:this.configDraggable,value:(F.DD)?true:false,validator:N.DRAGGABLE.validator,supercedes:N.DRAGGABLE.supercedes});this.cfg.addProperty(N.DRAG_ONLY.key,{value:N.DRAG_ONLY.value,validator:N.DRAG_ONLY.validator,supercedes:N.DRAG_ONLY.supercedes});this.cfg.addProperty(N.UNDERLAY.key,{handler:this.configUnderlay,value:N.UNDERLAY.value,supercedes:N.UNDERLAY.supercedes});this.cfg.addProperty(N.MODAL.key,{handler:this.configModal,value:N.MODAL.value,validator:N.MODAL.validator,supercedes:N.MODAL.supercedes});this.cfg.addProperty(N.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:N.KEY_LISTENERS.suppressEvent,supercedes:N.KEY_LISTENERS.supercedes});this.cfg.addProperty(N.STRINGS.key,{value:N.STRINGS.value,handler:this.configStrings,validator:N.STRINGS.validator,supercedes:N.STRINGS.supercedes});},configClose:function(X,V,Y){var Z=V[0],W=this.close,U=this.cfg.getProperty("strings");if(Z){if(!W){if(!C){C=document.createElement("a");C.className="container-close";C.href="#";}W=C.cloneNode(true);this.innerElement.appendChild(W);W.innerHTML=(U&&U.close)?U.close:" ";T.on(W,"click",this._doClose,this,true);this.close=W;}else{W.style.display="block";}}else{if(W){W.style.display="none";}}},_doClose:function(U){T.preventDefault(U);this.hide();},configDraggable:function(V,U,W){var X=U[0];if(X){if(!F.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",B);}else{if(this.dd){this.dd.unreg();}if(this.header){A.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",B);}},configUnderlay:function(d,c,Z){var b=(this.platform=="mac"&&L.gecko),e=c[0].toLowerCase(),V=this.underlay,W=this.element;function X(){var f=false;if(!V){if(!Q){Q=document.createElement("div");Q.className="underlay";}V=Q.cloneNode(false);this.element.appendChild(V);this.underlay=V;if(P){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(L.webkit&&L.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}f=true;}}function a(){var f=X.call(this);if(!f&&P){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(a);}function Y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(a);this._underlayDeferred=false;}if(V){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(V);this.underlay=null;}}switch(e){case"shadow":A.removeClass(W,"matte");A.addClass(W,"shadow");break;case"matte":if(!b){Y.call(this);}A.removeClass(W,"shadow");A.addClass(W,"matte");break;default:if(!b){Y.call(this);}A.removeClass(W,"shadow");A.removeClass(W,"matte");break;}if((e=="shadow")||(b&&!V)){if(this.cfg.getProperty("visible")){var U=X.call(this);if(!U&&P){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(a);this._underlayDeferred=true;}}}},configModal:function(V,U,X){var W=U[0];if(W){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);H.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);H.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var V=this.mask,U;if(V){this.hideMask();U=V.parentNode; >-if(U){U.removeChild(V);}this.mask=null;}},configKeyListeners:function(X,U,a){var W=U[0],Z,Y,V;if(W){if(W instanceof Array){Y=W.length;for(V=0;V<Y;V++){Z=W[V];if(!I.alreadySubscribed(this.showEvent,Z.enable,Z)){this.showEvent.subscribe(Z.enable,Z,true);}if(!I.alreadySubscribed(this.hideEvent,Z.disable,Z)){this.hideEvent.subscribe(Z.disable,Z,true);this.destroyEvent.subscribe(Z.disable,Z,true);}}}else{if(!I.alreadySubscribed(this.showEvent,W.enable,W)){this.showEvent.subscribe(W.enable,W,true);}if(!I.alreadySubscribed(this.hideEvent,W.disable,W)){this.hideEvent.subscribe(W.disable,W,true);this.destroyEvent.subscribe(W.disable,W,true);}}}},configStrings:function(V,U,W){var X=E.merge(N.STRINGS.value,U[0]);this.cfg.setProperty(N.STRINGS.key,X,true);},configHeight:function(X,V,Y){var U=V[0],W=this.innerElement;A.setStyle(W,"height",U);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(X,V,W){O.superclass._autoFillOnHeightChange.apply(this,arguments);if(P){var U=this;setTimeout(function(){U.sizeUnderlay();},0);}},configWidth:function(X,U,Y){var W=U[0],V=this.innerElement;A.setStyle(V,"width",W);this.cfg.refireEvent("iframe");},configzIndex:function(V,U,X){O.superclass.configzIndex.call(this,V,U,X);if(this.mask||this.cfg.getProperty("modal")===true){var W=A.getStyle(this.element,"zIndex");if(!W||isNaN(W)){W=0;}if(W===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var W=this.element.parentNode,U=this.element,V=document.createElement("div");V.className=O.CSS_PANEL_CONTAINER;V.id=U.id+"_c";if(W){W.insertBefore(V,U);}V.appendChild(U);this.element=V;this.innerElement=U;A.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var V=this.underlay,U;if(V){U=this.element;V.style.width=U.offsetWidth+"px";V.style.height=U.offsetHeight+"px";}},registerDragDrop:function(){var V=this;if(this.header){if(!F.DD){return;}var U=(this.cfg.getProperty("dragonly")===true);this.dd=new F.DD(this.element.id,this.id,{dragOnly:U});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var X,Z,W,c,b,a;if(YAHOO.env.ua.ie==6){A.addClass(V.element,"drag");}if(V.cfg.getProperty("constraintoviewport")){var Y=H.VIEWPORT_OFFSET;X=V.element.offsetHeight;Z=V.element.offsetWidth;W=A.getViewportWidth();c=A.getViewportHeight();b=A.getDocumentScrollLeft();a=A.getDocumentScrollTop();if(X+Y<c){this.minY=a+Y;this.maxY=a+c-X-Y;}else{this.minY=a+Y;this.maxY=a+Y;}if(Z+Y<W){this.minX=b+Y;this.maxX=b+W-Z-Y;}else{this.minX=b+Y;this.maxX=b+Y;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}V.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){V.syncPosition();V.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}V.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){A.removeClass(V.element,"drag");}V.dragEvent.fire("endDrag",arguments);V.moveEvent.fire(V.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var U=this.mask;if(!U){if(!G){G=document.createElement("div");G.className="mask";G.innerHTML=" ";}U=G.cloneNode(true);U.id=this.id+"_mask";document.body.insertBefore(U,document.body.firstChild);this.mask=U;if(YAHOO.env.ua.gecko&&this.platform=="mac"){A.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";A.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){A.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var V=this.mask,W=A.getViewportWidth(),U=A.getViewportHeight();if(V.offsetHeight>U){V.style.height=U+"px";}if(V.offsetWidth>W){V.style.width=W+"px";}V.style.height=A.getDocumentHeight()+"px";V.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var U=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(U)&&!isNaN(U)){A.setStyle(this.mask,"zIndex",U-1);}}},render:function(U){return O.superclass.render.call(this,U,this.innerElement);},_renderHeader:function(U){U=U||this.innerElement;O.superclass._renderHeader.call(this,U);},_renderBody:function(U){U=U||this.innerElement;O.superclass._renderBody.call(this,U);},_renderFooter:function(U){U=U||this.innerElement;O.superclass._renderFooter.call(this,U);},destroy:function(){H.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){T.purgeElement(this.close);}O.superclass.destroy.call(this);},forceUnderlayRedraw:function(){var U=this.underlay;A.addClass(U,"yui-force-redraw");setTimeout(function(){A.removeClass(U,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(J,I){YAHOO.widget.Dialog.superclass.constructor.call(this,J,I);};var B=YAHOO.util.Event,G=YAHOO.util.CustomEvent,E=YAHOO.util.Dom,A=YAHOO.widget.Dialog,F=YAHOO.lang,H={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},C={"POST_METHOD":{key:"postmethod",value:"async"},"POST_DATA":{key:"postdata",value:null},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};A.CSS_DIALOG="yui-dialog";function D(){var L=this._aButtons,J,K,I;if(F.isArray(L)){J=L.length;if(J>0){I=J-1;do{K=L[I];if(YAHOO.widget.Button&&K instanceof YAHOO.widget.Button){K.destroy();}else{if(K.tagName.toUpperCase()=="BUTTON"){B.purgeElement(K);B.purgeElement(K,false);}}}while(I--);}}}YAHOO.extend(A,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null}; >-this.cfg.addProperty(C.POST_METHOD.key,{handler:this.configPostMethod,value:C.POST_METHOD.value,validator:function(I){if(I!="form"&&I!="async"&&I!="none"&&I!="manual"){return false;}else{return true;}}});this.cfg.addProperty(C.POST_DATA.key,{value:C.POST_DATA.value});this.cfg.addProperty(C.HIDEAFTERSUBMIT.key,{value:C.HIDEAFTERSUBMIT.value});this.cfg.addProperty(C.BUTTONS.key,{handler:this.configButtons,value:C.BUTTONS.value,supercedes:C.BUTTONS.supercedes});},initEvents:function(){A.superclass.initEvents.call(this);var I=G.LIST;this.beforeSubmitEvent=this.createEvent(H.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=I;this.submitEvent=this.createEvent(H.SUBMIT);this.submitEvent.signature=I;this.manualSubmitEvent=this.createEvent(H.MANUAL_SUBMIT);this.manualSubmitEvent.signature=I;this.asyncSubmitEvent=this.createEvent(H.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=I;this.formSubmitEvent=this.createEvent(H.FORM_SUBMIT);this.formSubmitEvent.signature=I;this.cancelEvent=this.createEvent(H.CANCEL);this.cancelEvent.signature=I;},init:function(J,I){A.superclass.init.call(this,J);this.beforeInitEvent.fire(A);E.addClass(this.element,A.CSS_DIALOG);this.cfg.setProperty("visible",false);if(I){this.cfg.applyConfig(I,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(A);},doSubmit:function(){var P=YAHOO.util.Connect,Q=this.form,K=false,N=false,R,M,L,I;switch(this.cfg.getProperty("postmethod")){case"async":R=Q.elements;M=R.length;if(M>0){L=M-1;do{if(R[L].type=="file"){K=true;break;}}while(L--);}if(K&&YAHOO.env.ua.ie&&this.isSecure){N=true;}I=this._getFormAttributes(Q);P.setForm(Q,K,N);var J=this.cfg.getProperty("postdata");var O=P.asyncRequest(I.method,I.action,this.callback,J);this.asyncSubmitEvent.fire(O);break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(K){var I={method:null,action:null};if(K){if(K.getAttributeNode){var J=K.getAttributeNode("action");var L=K.getAttributeNode("method");if(J){I.action=J.value;}if(L){I.method=L.value;}}else{I.action=K.getAttribute("action");I.method=K.getAttribute("method");}}I.method=(F.isString(I.method)?I.method:"POST").toUpperCase();I.action=F.isString(I.action)?I.action:"";return I;},registerForm:function(){var I=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==I&&E.isAncestor(this.element,this.form)){return;}else{B.purgeElement(this.form);this.form=null;}}if(!I){I=document.createElement("form");I.name="frm_"+this.id;this.body.appendChild(I);}if(I){this.form=I;B.on(I,"submit",this._submitHandler,this,true);}},_submitHandler:function(I){B.stopEvent(I);this.submit();this.form.blur();},setTabLoop:function(I,J){I=I||this.firstButton;J=this.lastButton||J;A.superclass.setTabLoop.call(this,I,J);},setFirstLastFocusable:function(){A.superclass.setFirstLastFocusable.call(this);var J,I,K,L=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&L&&L.length>0){I=L.length;for(J=0;J<I;++J){K=L[J];if(this.form===K.form){this.firstFormElement=K;break;}}for(J=I-1;J>=0;--J){K=L[J];if(this.form===K.form){this.lastFormElement=K;break;}}}},configClose:function(J,I,K){A.superclass.configClose.apply(this,arguments);},_doClose:function(I){B.preventDefault(I);this.cancel();},configButtons:function(S,R,M){var N=YAHOO.widget.Button,U=R[0],K=this.innerElement,T,P,J,Q,O,I,L;D.call(this);this._aButtons=null;if(F.isArray(U)){O=document.createElement("span");O.className="button-group";Q=U.length;this._aButtons=[];this.defaultHtmlButton=null;for(L=0;L<Q;L++){T=U[L];if(N){J=new N({label:T.text});J.appendTo(O);P=J.get("element");if(T.isDefault){J.addClass("default");this.defaultHtmlButton=P;}if(F.isFunction(T.handler)){J.set("onclick",{fn:T.handler,obj:this,scope:this});}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){J.set("onclick",{fn:T.handler.fn,obj:((!F.isUndefined(T.handler.obj))?T.handler.obj:this),scope:(T.handler.scope||this)});}}this._aButtons[this._aButtons.length]=J;}else{P=document.createElement("button");P.setAttribute("type","button");if(T.isDefault){P.className="default";this.defaultHtmlButton=P;}P.innerHTML=T.text;if(F.isFunction(T.handler)){B.on(P,"click",T.handler,this,true);}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){B.on(P,"click",T.handler.fn,((!F.isUndefined(T.handler.obj))?T.handler.obj:this),(T.handler.scope||this));}}O.appendChild(P);this._aButtons[this._aButtons.length]=P;}T.htmlButton=P;if(L===0){this.firstButton=P;}if(L==(Q-1)){this.lastButton=P;}}this.setFooter(O);I=this.footer;if(E.inDocument(this.element)&&!E.isAncestor(K,I)){K.appendChild(I);}this.buttonSpan=O;}else{O=this.buttonSpan;I=this.footer;if(O&&I){I.removeChild(O);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(K,I,M){var J=this.firstFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(J){try{J.focus();}catch(L){}}else{if(this.defaultHtmlButton){this.focusDefaultButton();}else{this.focusFirstButton();}}},focusLast:function(K,I,M){var N=this.cfg.getProperty("buttons"),J=this.lastFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(N&&F.isArray(N)){this.focusLastButton();}else{if(J){try{J.focus();}catch(L){}}}},_getButton:function(J){var I=YAHOO.widget.Button;if(I&&J&&J.nodeName&&J.id){J=I.getButton(J.id)||J;}return J;},focusDefaultButton:function(){var I=this._getButton(this.defaultHtmlButton);if(I){try{I.focus();}catch(J){}}},blurButtons:function(){var N=this.cfg.getProperty("buttons"),K,M,J,I;if(N&&F.isArray(N)){K=N.length;if(K>0){I=(K-1);do{M=N[I];if(M){J=this._getButton(M.htmlButton);if(J){try{J.blur();}catch(L){}}}}while(I--);}}},focusFirstButton:function(){var L=this.cfg.getProperty("buttons"),K,I;if(L&&F.isArray(L)){K=L[0];if(K){I=this._getButton(K.htmlButton); >-if(I){try{I.focus();}catch(J){}}}}},focusLastButton:function(){var M=this.cfg.getProperty("buttons"),J,L,I;if(M&&F.isArray(M)){J=M.length;if(J>0){L=M[(J-1)];if(L){I=this._getButton(L.htmlButton);if(I){try{I.focus();}catch(K){}}}}}},configPostMethod:function(J,I,K){this.registerForm();},validate:function(){return true;},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;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var Y=this.form,J,R,U,L,S,P,O,I,V,K,W,Z,N,a,M,X,T;function Q(c){var b=c.tagName.toUpperCase();return((b=="INPUT"||b=="TEXTAREA"||b=="SELECT")&&c.name==L);}if(Y){J=Y.elements;R=J.length;U={};for(X=0;X<R;X++){L=J[X].name;S=E.getElementsBy(Q,"*",Y);P=S.length;if(P>0){if(P==1){S=S[0];O=S.type;I=S.tagName.toUpperCase();switch(I){case"INPUT":if(O=="checkbox"){U[L]=S.checked;}else{if(O!="radio"){U[L]=S.value;}}break;case"TEXTAREA":U[L]=S.value;break;case"SELECT":V=S.options;K=V.length;W=[];for(T=0;T<K;T++){Z=V[T];if(Z.selected){M=Z.attributes.value;W[W.length]=(M&&M.specified)?Z.value:Z.text;}}U[L]=W;break;}}else{O=S[0].type;switch(O){case"radio":for(T=0;T<P;T++){N=S[T];if(N.checked){U[L]=N.value;break;}}break;case"checkbox":W=[];for(T=0;T<P;T++){a=S[T];if(a.checked){W[W.length]=a.value;}}U[L]=W;break;}}}}}return U;},destroy:function(){D.call(this);this._aButtons=null;var I=this.element.getElementsByTagName("form"),J;if(I.length>0){J=I[0];if(J){B.purgeElement(J);if(J.parentNode){J.parentNode.removeChild(J);}this.form=null;}}A.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(K,J,H){var D=J[0],E=this.body,F=B.ICON_CSS_CLASSNAME,L,I,G;if(D&&D!="none"){L=C.getElementsByClassName(F,"*",E);if(L.length===1){I=L[0];G=I.parentNode;if(G){G.removeChild(I);I=null;}}if(D.indexOf(".")==-1){I=document.createElement("span");I.className=(F+" "+D);I.innerHTML=" ";}else{I=document.createElement("img");I.src=(this.imageRoot+D);I.className=F;}if(I){E.insertBefore(I,E.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(E,H,G,D,F){if(!F){F=YAHOO.util.Anim;}this.overlay=E;this.attrIn=H;this.attrOut=G;this.targetElement=D||E.element;this.animClass=F;};var B=YAHOO.util.Dom,C=YAHOO.util.CustomEvent,A=YAHOO.widget.ContainerEffect;A.FADE=function(D,F){var G=YAHOO.util.Easing,I={attributes:{opacity:{from:0,to:1}},duration:F,method:G.easeIn},E={attributes:{opacity:{to:0}},duration:F,method:G.easeOut},H=new A(D,I,E,D.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(D.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(D.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();L.overlay._setDomVisibility(true);B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.overlay._setDomVisibility(false);B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(F,D){var I=YAHOO.util.Easing,L=F.cfg.getProperty("x")||B.getX(F.element),K=F.cfg.getProperty("y")||B.getY(F.element),M=B.getClientWidth(),H=F.element.offsetWidth,J={attributes:{points:{to:[L,K]}},duration:D,method:I.easeIn},E={attributes:{points:{to:[(M+25),K]}},duration:D,method:I.easeOut},G=new A(F,J,E,F.element,YAHOO.util.Motion);G.handleStartAnimateIn=function(O,N,P){P.overlay.element.style.left=((-25)-H)+"px";P.overlay.element.style.top=K+"px";};G.handleTweenAnimateIn=function(Q,P,R){var S=B.getXY(R.overlay.element),O=S[0],N=S[1];if(B.getStyle(R.overlay.element,"visibility")=="hidden"&&O<L){R.overlay._setDomVisibility(true); >-}R.overlay.cfg.setProperty("xy",[O,N],true);R.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateIn=function(O,N,P){P.overlay.cfg.setProperty("xy",[L,K],true);P.startX=L;P.startY=K;P.overlay.cfg.refireEvent("iframe");P.animateInCompleteEvent.fire();};G.handleStartAnimateOut=function(O,N,R){var P=B.getViewportWidth(),S=B.getXY(R.overlay.element),Q=S[1];R.animOut.attributes.points.to=[(P+25),Q];};G.handleTweenAnimateOut=function(P,O,Q){var S=B.getXY(Q.overlay.element),N=S[0],R=S[1];Q.overlay.cfg.setProperty("xy",[N,R],true);Q.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateOut=function(O,N,P){P.overlay._setDomVisibility(false);P.overlay.cfg.setProperty("xy",[L,K]);P.animateOutCompleteEvent.fire();};G.init();return G;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=C.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=C.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=C.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=C.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);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(E,D,F){},handleTweenAnimateIn:function(E,D,F){},handleCompleteAnimateIn:function(E,D,F){},handleStartAnimateOut:function(E,D,F){},handleTweenAnimateOut:function(E,D,F){},handleCompleteAnimateOut:function(E,D,F){},toString:function(){var D="ContainerEffect";if(this.overlay){D+=" ["+this.overlay.toString()+"]";}return D;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/container.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container.js >deleted file mode 100644 >index 689054674c..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container.js >+++ /dev/null >@@ -1,9052 +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); >- } >- >- >- }; >- >- >- 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 ) { >- 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(); >- >- 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(); >- >- 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(); >- >- 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; >- >- } >- } >- } >- } >- } >- >- >- 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 { >- } >- }; >- >- 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)) { >- 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"); >- >- >- 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) { >- >- >- 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.hideProcId = null; >- } >- >- Event.on(context, "mousemove", obj.onContextMouseMove, obj); >- >- /** >- * The unique process ID associated with the thread responsible >- * for showing the Tooltip. >- * @type int >- */ >- obj.showProcId = obj.doShow(e, context); >- } >- }, >- >- /** >- * The default event handler fired when the user mouses out of >- * the context element. >- * @method onContextMouseOut >- * @param {DOMEvent} e The current DOM event >- * @param {Object} obj The object argument >- */ >- onContextMouseOut: function (e, obj) { >- var el = this; >- >- if (obj._tempTitle) { >- el.title = obj._tempTitle; >- obj._tempTitle = null; >- } >- >- if (obj.showProcId) { >- clearTimeout(obj.showProcId); >- obj.showProcId = null; >- } >- >- if (obj.hideProcId) { >- clearTimeout(obj.hideProcId); >- obj.hideProcId = null; >- } >- >- obj.fireEvent("contextMouseOut", el, e); >- >- obj.hideProcId = setTimeout(function () { >- obj.hide(); >- }, obj.cfg.getProperty("hidedelay")); >- }, >- >- // END BUILT-IN DOM EVENT HANDLERS // >- >- /** >- * Processes the showing of the Tooltip by setting the timeout delay >- * and offset of the Tooltip. >- * @method doShow >- * @param {DOMEvent} e The current DOM event >- * @param {HTMLElement} context The current context element >- * @return {Number} The process ID of the timeout function associated >- * with doShow >- */ >- doShow: function (e, context) { >- >- var offset = this.cfg.getProperty("xyoffset"), >- xOffset = offset[0], >- yOffset = offset[1], >- me = this; >- >- if (UA.opera && context.tagName && >- context.tagName.toUpperCase() == "A") { >- yOffset += 12; >- } >- >- return setTimeout(function () { >- >- var txt = me.cfg.getProperty("text"); >- >- // title does not over-ride text >- if (me._tempTitle && (txt === "" || YAHOO.lang.isUndefined(txt) || YAHOO.lang.isNull(txt))) { >- me.setBody(me._tempTitle); >- } else { >- me.cfg.refireEvent("text"); >- } >- >- me.moveTo(me.pageX + xOffset, me.pageY + yOffset); >- >- if (me.cfg.getProperty("preventoverlap")) { >- me.preventOverlap(me.pageX, me.pageY); >- } >- >- Event.removeListener(context, "mousemove", me.onContextMouseMove); >- >- me.contextTriggerEvent.fire(context); >- >- me.show(); >- >- me.hideProcId = me.doHide(); >- >- }, this.cfg.getProperty("showdelay")); >- }, >- >- /** >- * Sets the timeout for the auto-dismiss delay, which by default is 5 >- * seconds, meaning that a tooltip will automatically dismiss itself >- * after 5 seconds of being displayed. >- * @method doHide >- */ >- doHide: function () { >- >- var me = this; >- >- >- return setTimeout(function () { >- >- me.hide(); >- >- }, this.cfg.getProperty("autodismissdelay")); >- >- }, >- >- /** >- * Fired when the Tooltip is moved, this event handler is used to >- * prevent the Tooltip from overlapping with its context element. >- * @method preventOverlay >- * @param {Number} pageX The x coordinate position of the mouse pointer >- * @param {Number} pageY The y coordinate position of the mouse pointer >- */ >- preventOverlap: function (pageX, pageY) { >- >- var height = this.element.offsetHeight, >- mousePoint = new YAHOO.util.Point(pageX, pageY), >- elementRegion = Dom.getRegion(this.element); >- >- elementRegion.top -= 5; >- elementRegion.left -= 5; >- elementRegion.right += 5; >- elementRegion.bottom += 5; >- >- >- if (elementRegion.contains(mousePoint)) { >- this.cfg.setProperty("y", (pageY - height - 5)); >- } >- }, >- >- >- /** >- * @method onRender >- * @description "render" event handler for the Tooltip. >- * @param {String} p_sType String representing the name of the event >- * that was fired. >- * @param {Array} p_aArgs Array of arguments sent when the event >- * was fired. >- */ >- onRender: function (p_sType, p_aArgs) { >- >- function sizeShadow() { >- >- var oElement = this.element, >- oShadow = this.underlay; >- >- if (oShadow) { >- oShadow.style.width = (oElement.offsetWidth + 6) + "px"; >- oShadow.style.height = (oElement.offsetHeight + 1) + "px"; >- } >- >- } >- >- function addShadowVisibleClass() { >- Dom.addClass(this.underlay, "yui-tt-shadow-visible"); >- >- if (UA.ie) { >- this.forceUnderlayRedraw(); >- } >- } >- >- function removeShadowVisibleClass() { >- Dom.removeClass(this.underlay, "yui-tt-shadow-visible"); >- } >- >- function createShadow() { >- >- var oShadow = this.underlay, >- oElement, >- Module, >- nIE, >- me; >- >- if (!oShadow) { >- >- oElement = this.element; >- Module = YAHOO.widget.Module; >- nIE = UA.ie; >- me = this; >- >- if (!m_oShadowTemplate) { >- m_oShadowTemplate = document.createElement("div"); >- m_oShadowTemplate.className = "yui-tt-shadow"; >- } >- >- oShadow = m_oShadowTemplate.cloneNode(false); >- >- oElement.appendChild(oShadow); >- >- this.underlay = oShadow; >- >- // Backward compatibility, even though it's probably >- // intended to be "private", it isn't marked as such in the api docs >- this._shadow = this.underlay; >- >- addShadowVisibleClass.call(this); >- >- this.subscribe("beforeShow", addShadowVisibleClass); >- this.subscribe("hide", removeShadowVisibleClass); >- >- if (bIEQuirks) { >- window.setTimeout(function () { >- sizeShadow.call(me); >- }, 0); >- >- this.cfg.subscribeToConfigEvent("width", sizeShadow); >- this.cfg.subscribeToConfigEvent("height", sizeShadow); >- this.subscribe("changeContent", sizeShadow); >- >- Module.textResizeEvent.subscribe(sizeShadow, this, true); >- this.subscribe("destroy", function () { >- Module.textResizeEvent.unsubscribe(sizeShadow, this); >- }); >- } >- } >- } >- >- function onBeforeShow() { >- createShadow.call(this); >- this.unsubscribe("beforeShow", onBeforeShow); >- } >- >- if (this.cfg.getProperty("visible")) { >- createShadow.call(this); >- } else { >- this.subscribe("beforeShow", onBeforeShow); >- } >- >- }, >- >- /** >- * Forces the underlay element to be repainted, through the application/removal >- * of a yui-force-redraw class to the underlay element. >- * >- * @method forceUnderlayRedraw >- */ >- forceUnderlayRedraw : function() { >- var tt = this; >- Dom.addClass(tt.underlay, "yui-force-redraw"); >- setTimeout(function() {Dom.removeClass(tt.underlay, "yui-force-redraw");}, 0); >- }, >- >- /** >- * Removes the Tooltip element from the DOM and sets all child >- * elements to null. >- * @method destroy >- */ >- destroy: function () { >- >- // Remove any existing mouseover/mouseout listeners >- this._removeEventListeners(); >- >- Tooltip.superclass.destroy.call(this); >- >- }, >- >- /** >- * Returns a string representation of the object. >- * @method toString >- * @return {String} The string representation of the Tooltip >- */ >- toString: function () { >- return "Tooltip " + this.id; >- } >- >- }); >- >-}()); >-(function () { >- >- /** >- * Panel is an implementation of Overlay that behaves like an OS window, >- * with a draggable header and an optional close icon at the top right. >- * @namespace YAHOO.widget >- * @class Panel >- * @extends YAHOO.widget.Overlay >- * @constructor >- * @param {String} el The element ID representing the Panel <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) { >- this.cfg.setProperty("draggable", false); >- return; >- } >- >- if (this.header) { >- Dom.setStyle(this.header, "cursor", "move"); >- this.registerDragDrop(); >- } >- >- this.subscribe("beforeShow", setWidthToOffsetWidth); >- >- } else { >- >- if (this.dd) { >- this.dd.unreg(); >- } >- >- if (this.header) { >- Dom.setStyle(this.header,"cursor","auto"); >- } >- >- this.unsubscribe("beforeShow", setWidthToOffsetWidth); >- } >- }, >- >- /** >- * The default event handler fired when the "underlay" property >- * is changed. >- * @method configUnderlay >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configUnderlay: function (type, args, obj) { >- >- var bMacGecko = (this.platform == "mac" && UA.gecko), >- sUnderlay = args[0].toLowerCase(), >- oUnderlay = this.underlay, >- oElement = this.element; >- >- function createUnderlay() { >- var bNew = false; >- if (!oUnderlay) { // create if not already in DOM >- >- if (!m_oUnderlayTemplate) { >- m_oUnderlayTemplate = document.createElement("div"); >- m_oUnderlayTemplate.className = "underlay"; >- } >- >- oUnderlay = m_oUnderlayTemplate.cloneNode(false); >- this.element.appendChild(oUnderlay); >- >- this.underlay = oUnderlay; >- >- if (bIEQuirks) { >- this.sizeUnderlay(); >- this.cfg.subscribeToConfigEvent("width", this.sizeUnderlay); >- this.cfg.subscribeToConfigEvent("height", this.sizeUnderlay); >- >- this.changeContentEvent.subscribe(this.sizeUnderlay); >- YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay, this, true); >- } >- >- if (UA.webkit && UA.webkit < 420) { >- this.changeContentEvent.subscribe(this.forceUnderlayRedraw); >- } >- >- bNew = true; >- } >- } >- >- function onBeforeShow() { >- var bNew = createUnderlay.call(this); >- if (!bNew && bIEQuirks) { >- this.sizeUnderlay(); >- } >- this._underlayDeferred = false; >- this.beforeShowEvent.unsubscribe(onBeforeShow); >- } >- >- function destroyUnderlay() { >- if (this._underlayDeferred) { >- this.beforeShowEvent.unsubscribe(onBeforeShow); >- this._underlayDeferred = false; >- } >- >- if (oUnderlay) { >- this.cfg.unsubscribeFromConfigEvent("width", this.sizeUnderlay); >- this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay); >- this.changeContentEvent.unsubscribe(this.sizeUnderlay); >- this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw); >- YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay, this, true); >- >- this.element.removeChild(oUnderlay); >- >- this.underlay = null; >- } >- } >- >- switch (sUnderlay) { >- case "shadow": >- Dom.removeClass(oElement, "matte"); >- Dom.addClass(oElement, "shadow"); >- break; >- case "matte": >- if (!bMacGecko) { >- destroyUnderlay.call(this); >- } >- Dom.removeClass(oElement, "shadow"); >- Dom.addClass(oElement, "matte"); >- break; >- default: >- if (!bMacGecko) { >- destroyUnderlay.call(this); >- } >- Dom.removeClass(oElement, "shadow"); >- Dom.removeClass(oElement, "matte"); >- break; >- } >- >- if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) { >- if (this.cfg.getProperty("visible")) { >- var bNew = createUnderlay.call(this); >- if (!bNew && bIEQuirks) { >- this.sizeUnderlay(); >- } >- } else { >- if (!this._underlayDeferred) { >- this.beforeShowEvent.subscribe(onBeforeShow); >- this._underlayDeferred = true; >- } >- } >- } >- }, >- >- /** >- * The default event handler fired when the "modal" property is >- * changed. This handler subscribes or unsubscribes to the show and hide >- * events to handle the display or hide of the modality mask. >- * @method configModal >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configModal: function (type, args, obj) { >- >- var modal = args[0]; >- if (modal) { >- if (!this._hasModalityEventListeners) { >- >- this.subscribe("beforeShow", this.buildMask); >- this.subscribe("beforeShow", this.bringToTop); >- this.subscribe("beforeShow", this.showMask); >- this.subscribe("hide", this.hideMask); >- >- Overlay.windowResizeEvent.subscribe(this.sizeMask, >- this, true); >- >- this._hasModalityEventListeners = true; >- } >- } else { >- if (this._hasModalityEventListeners) { >- >- if (this.cfg.getProperty("visible")) { >- this.hideMask(); >- this.removeMask(); >- } >- >- this.unsubscribe("beforeShow", this.buildMask); >- this.unsubscribe("beforeShow", this.bringToTop); >- this.unsubscribe("beforeShow", this.showMask); >- this.unsubscribe("hide", this.hideMask); >- >- Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this); >- >- this._hasModalityEventListeners = false; >- } >- } >- }, >- >- /** >- * Removes the modality mask. >- * @method removeMask >- */ >- removeMask: function () { >- >- var oMask = this.mask, >- oParentNode; >- >- if (oMask) { >- /* >- Hide the mask before destroying it to ensure that DOM >- event handlers on focusable elements get removed. >- */ >- this.hideMask(); >- >- oParentNode = oMask.parentNode; >- if (oParentNode) { >- oParentNode.removeChild(oMask); >- } >- >- this.mask = null; >- } >- }, >- >- /** >- * The default event handler fired when the "keylisteners" property >- * is changed. >- * @method configKeyListeners >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configKeyListeners: function (type, args, obj) { >- >- var listeners = args[0], >- listener, >- nListeners, >- i; >- >- if (listeners) { >- >- if (listeners instanceof Array) { >- >- nListeners = listeners.length; >- >- for (i = 0; i < nListeners; i++) { >- >- listener = listeners[i]; >- >- if (!Config.alreadySubscribed(this.showEvent, >- listener.enable, listener)) { >- >- this.showEvent.subscribe(listener.enable, >- listener, true); >- >- } >- >- if (!Config.alreadySubscribed(this.hideEvent, >- listener.disable, listener)) { >- >- this.hideEvent.subscribe(listener.disable, >- listener, true); >- >- this.destroyEvent.subscribe(listener.disable, >- listener, true); >- } >- } >- >- } else { >- >- if (!Config.alreadySubscribed(this.showEvent, >- listeners.enable, listeners)) { >- >- this.showEvent.subscribe(listeners.enable, >- listeners, true); >- } >- >- if (!Config.alreadySubscribed(this.hideEvent, >- listeners.disable, listeners)) { >- >- this.hideEvent.subscribe(listeners.disable, >- listeners, true); >- >- this.destroyEvent.subscribe(listeners.disable, >- listeners, true); >- >- } >- >- } >- >- } >- >- }, >- >- /** >- * The default handler for the "strings" property >- * @method configStrings >- */ >- configStrings : function(type, args, obj) { >- var val = Lang.merge(DEFAULT_CONFIG.STRINGS.value, args[0]); >- this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key, val, true); >- }, >- >- /** >- * The default event handler fired when the "height" property is changed. >- * @method configHeight >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configHeight: function (type, args, obj) { >- var height = args[0], >- el = this.innerElement; >- >- Dom.setStyle(el, "height", height); >- this.cfg.refireEvent("iframe"); >- }, >- >- /** >- * The default custom event handler executed when the Panel's height is changed, >- * if the autofillheight property has been set. >- * >- * @method _autoFillOnHeightChange >- * @protected >- * @param {String} type The event type >- * @param {Array} args The array of arguments passed to event subscribers >- * @param {HTMLElement} el The header, body or footer element which is to be resized to fill >- * out the containers height >- */ >- _autoFillOnHeightChange : function(type, args, el) { >- Panel.superclass._autoFillOnHeightChange.apply(this, arguments); >- if (bIEQuirks) { >- var panel = this; >- setTimeout(function() { >- panel.sizeUnderlay(); >- },0); >- } >- }, >- >- /** >- * The default event handler fired when the "width" property is changed. >- * @method configWidth >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configWidth: function (type, args, obj) { >- >- var width = args[0], >- el = this.innerElement; >- >- Dom.setStyle(el, "width", width); >- this.cfg.refireEvent("iframe"); >- >- }, >- >- /** >- * The default event handler fired when the "zIndex" property is changed. >- * @method configzIndex >- * @param {String} type The CustomEvent type (usually the property name) >- * @param {Object[]} args The CustomEvent arguments. For configuration >- * handlers, args[0] will equal the newly applied value for the property. >- * @param {Object} obj The scope object. For configuration handlers, >- * this will usually equal the owner. >- */ >- configzIndex: function (type, args, obj) { >- Panel.superclass.configzIndex.call(this, type, args, obj); >- >- if (this.mask || this.cfg.getProperty("modal") === true) { >- var panelZ = Dom.getStyle(this.element, "zIndex"); >- if (!panelZ || isNaN(panelZ)) { >- panelZ = 0; >- } >- >- if (panelZ === 0) { >- // Recursive call to configzindex (which should be stopped >- // from going further because panelZ should no longer === 0) >- this.cfg.setProperty("zIndex", 1); >- } else { >- this.stackMask(); >- } >- } >- }, >- >- // END BUILT-IN PROPERTY EVENT HANDLERS // >- /** >- * Builds the wrapping container around the Panel that is used for >- * positioning the shadow and matte underlays. The container element is >- * assigned to a local instance variable called container, and the >- * element is reinserted inside of it. >- * @method buildWrapper >- */ >- buildWrapper: function () { >- >- var elementParent = this.element.parentNode, >- originalElement = this.element, >- wrapper = document.createElement("div"); >- >- wrapper.className = Panel.CSS_PANEL_CONTAINER; >- wrapper.id = originalElement.id + "_c"; >- >- if (elementParent) { >- elementParent.insertBefore(wrapper, originalElement); >- } >- >- wrapper.appendChild(originalElement); >- >- this.element = wrapper; >- this.innerElement = originalElement; >- >- Dom.setStyle(this.innerElement, "visibility", "inherit"); >- }, >- >- /** >- * Adjusts the size of the shadow based on the size of the element. >- * @method sizeUnderlay >- */ >- sizeUnderlay: function () { >- var oUnderlay = this.underlay, >- oElement; >- >- if (oUnderlay) { >- oElement = this.element; >- oUnderlay.style.width = oElement.offsetWidth + "px"; >- oUnderlay.style.height = oElement.offsetHeight + "px"; >- } >- }, >- >- /** >- * Registers the Panel's header for drag & drop capability. >- * @method registerDragDrop >- */ >- registerDragDrop: function () { >- >- var me = this; >- >- if (this.header) { >- >- if (!Util.DD) { >- return; >- } >- >- var bDragOnly = (this.cfg.getProperty("dragonly") === true); >- >- /** >- * The YAHOO.util.DD instance, used to implement the draggable header for the panel if draggable is enabled >- * >- * @property dd >- * @type YAHOO.util.DD >- */ >- this.dd = new Util.DD(this.element.id, this.id, {dragOnly: bDragOnly}); >- >- if (!this.header.id) { >- this.header.id = this.id + "_h"; >- } >- >- this.dd.startDrag = function () { >- >- var offsetHeight, >- offsetWidth, >- viewPortWidth, >- viewPortHeight, >- scrollX, >- scrollY; >- >- if (YAHOO.env.ua.ie == 6) { >- Dom.addClass(me.element,"drag"); >- } >- >- if (me.cfg.getProperty("constraintoviewport")) { >- >- var nViewportOffset = Overlay.VIEWPORT_OFFSET; >- >- offsetHeight = me.element.offsetHeight; >- offsetWidth = me.element.offsetWidth; >- >- viewPortWidth = Dom.getViewportWidth(); >- viewPortHeight = Dom.getViewportHeight(); >- >- scrollX = Dom.getDocumentScrollLeft(); >- scrollY = Dom.getDocumentScrollTop(); >- >- if (offsetHeight + nViewportOffset < viewPortHeight) { >- this.minY = scrollY + nViewportOffset; >- this.maxY = scrollY + viewPortHeight - offsetHeight - nViewportOffset; >- } else { >- this.minY = scrollY + nViewportOffset; >- this.maxY = scrollY + nViewportOffset; >- } >- >- if (offsetWidth + nViewportOffset < viewPortWidth) { >- this.minX = scrollX + nViewportOffset; >- this.maxX = scrollX + viewPortWidth - offsetWidth - nViewportOffset; >- } else { >- this.minX = scrollX + nViewportOffset; >- this.maxX = scrollX + nViewportOffset; >- } >- >- this.constrainX = true; >- this.constrainY = true; >- } else { >- this.constrainX = false; >- this.constrainY = false; >- } >- >- me.dragEvent.fire("startDrag", arguments); >- }; >- >- this.dd.onDrag = function () { >- me.syncPosition(); >- me.cfg.refireEvent("iframe"); >- if (this.platform == "mac" && YAHOO.env.ua.gecko) { >- this.showMacGeckoScrollbars(); >- } >- >- me.dragEvent.fire("onDrag", arguments); >- }; >- >- this.dd.endDrag = function () { >- >- if (YAHOO.env.ua.ie == 6) { >- Dom.removeClass(me.element,"drag"); >- } >- >- me.dragEvent.fire("endDrag", arguments); >- me.moveEvent.fire(me.cfg.getProperty("xy")); >- >- }; >- >- this.dd.setHandleElId(this.header.id); >- this.dd.addInvalidHandleType("INPUT"); >- this.dd.addInvalidHandleType("SELECT"); >- this.dd.addInvalidHandleType("TEXTAREA"); >- } >- }, >- >- /** >- * Builds the mask that is laid over the document when the Panel is >- * configured to be modal. >- * @method buildMask >- */ >- buildMask: function () { >- var oMask = this.mask; >- if (!oMask) { >- if (!m_oMaskTemplate) { >- m_oMaskTemplate = document.createElement("div"); >- m_oMaskTemplate.className = "mask"; >- m_oMaskTemplate.innerHTML = " "; >- } >- oMask = m_oMaskTemplate.cloneNode(true); >- oMask.id = this.id + "_mask"; >- >- document.body.insertBefore(oMask, document.body.firstChild); >- >- this.mask = oMask; >- >- if (YAHOO.env.ua.gecko && this.platform == "mac") { >- Dom.addClass(this.mask, "block-scrollbars"); >- } >- >- // Stack mask based on the element zindex >- this.stackMask(); >- } >- }, >- >- /** >- * Hides the modality mask. >- * @method hideMask >- */ >- hideMask: function () { >- if (this.cfg.getProperty("modal") && this.mask) { >- this.mask.style.display = "none"; >- Dom.removeClass(document.body, "masked"); >- this.hideMaskEvent.fire(); >- } >- }, >- >- /** >- * Shows the modality mask. >- * @method showMask >- */ >- showMask: function () { >- if (this.cfg.getProperty("modal") && this.mask) { >- Dom.addClass(document.body, "masked"); >- this.sizeMask(); >- this.mask.style.display = "block"; >- this.showMaskEvent.fire(); >- } >- }, >- >- /** >- * Sets the size of the modality mask to cover the entire scrollable >- * area of the document >- * @method sizeMask >- */ >- sizeMask: function () { >- if (this.mask) { >- >- // Shrink mask first, so it doesn't affect the document size. >- var mask = this.mask, >- viewWidth = Dom.getViewportWidth(), >- viewHeight = Dom.getViewportHeight(); >- >- if (mask.offsetHeight > viewHeight) { >- mask.style.height = viewHeight + "px"; >- } >- >- if (mask.offsetWidth > viewWidth) { >- mask.style.width = viewWidth + "px"; >- } >- >- // Then size it to the document >- mask.style.height = Dom.getDocumentHeight() + "px"; >- mask.style.width = Dom.getDocumentWidth() + "px"; >- } >- }, >- >- /** >- * Sets the zindex of the mask, if it exists, based on the zindex of >- * the Panel element. The zindex of the mask is set to be one less >- * than the Panel element's zindex. >- * >- * <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_core-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container_core-debug.js >deleted file mode 100644 >index 89bf8ba967..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container_core-debug.js >+++ /dev/null >@@ -1,5136 +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 () { >- >- /** >- * 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("containercore", YAHOO.widget.Module, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/container_core-min.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container_core-min.js >deleted file mode 100644 >index 7b73c40382..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container_core-min.js >+++ /dev/null >@@ -1,14 +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.ContainerEffect=function(E,H,G,D,F){if(!F){F=YAHOO.util.Anim;}this.overlay=E;this.attrIn=H;this.attrOut=G;this.targetElement=D||E.element;this.animClass=F;};var B=YAHOO.util.Dom,C=YAHOO.util.CustomEvent,A=YAHOO.widget.ContainerEffect;A.FADE=function(D,F){var G=YAHOO.util.Easing,I={attributes:{opacity:{from:0,to:1}},duration:F,method:G.easeIn},E={attributes:{opacity:{to:0}},duration:F,method:G.easeOut},H=new A(D,I,E,D.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(D.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(D.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();L.overlay._setDomVisibility(true);B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.overlay._setDomVisibility(false);B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(F,D){var I=YAHOO.util.Easing,L=F.cfg.getProperty("x")||B.getX(F.element),K=F.cfg.getProperty("y")||B.getY(F.element),M=B.getClientWidth(),H=F.element.offsetWidth,J={attributes:{points:{to:[L,K]}},duration:D,method:I.easeIn},E={attributes:{points:{to:[(M+25),K]}},duration:D,method:I.easeOut},G=new A(F,J,E,F.element,YAHOO.util.Motion);G.handleStartAnimateIn=function(O,N,P){P.overlay.element.style.left=((-25)-H)+"px";P.overlay.element.style.top=K+"px";};G.handleTweenAnimateIn=function(Q,P,R){var S=B.getXY(R.overlay.element),O=S[0],N=S[1];if(B.getStyle(R.overlay.element,"visibility")=="hidden"&&O<L){R.overlay._setDomVisibility(true);}R.overlay.cfg.setProperty("xy",[O,N],true);R.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateIn=function(O,N,P){P.overlay.cfg.setProperty("xy",[L,K],true);P.startX=L;P.startY=K;P.overlay.cfg.refireEvent("iframe");P.animateInCompleteEvent.fire();};G.handleStartAnimateOut=function(O,N,R){var P=B.getViewportWidth(),S=B.getXY(R.overlay.element),Q=S[1];R.animOut.attributes.points.to=[(P+25),Q];};G.handleTweenAnimateOut=function(P,O,Q){var S=B.getXY(Q.overlay.element),N=S[0],R=S[1];Q.overlay.cfg.setProperty("xy",[N,R],true);Q.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateOut=function(O,N,P){P.overlay._setDomVisibility(false);P.overlay.cfg.setProperty("xy",[L,K]);P.animateOutCompleteEvent.fire();};G.init();return G;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=C.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=C.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=C.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=C.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);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(E,D,F){},handleTweenAnimateIn:function(E,D,F){},handleCompleteAnimateIn:function(E,D,F){},handleStartAnimateOut:function(E,D,F){},handleTweenAnimateOut:function(E,D,F){},handleCompleteAnimateOut:function(E,D,F){},toString:function(){var D="ContainerEffect";if(this.overlay){D+=" ["+this.overlay.toString()+"]";}return D;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider); >-})();YAHOO.register("containercore",YAHOO.widget.Module,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/container/container_core.js b/koha-tmpl/intranet-tmpl/lib/yui/container/container_core.js >deleted file mode 100644 >index 45131b58f5..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/container/container_core.js >+++ /dev/null >@@ -1,5126 +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); >- } >- >- >- }; >- >- >- 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 ) { >- 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(); >- >- 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(); >- >- 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(); >- >- 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; >- >- } >- } >- } >- } >- } >- >- >- 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 { >- } >- }; >- >- 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)) { >- 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"); >- >- >- 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 () { >- >- /** >- * 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("containercore", YAHOO.widget.Module, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-debug.js >deleted file mode 100644 >index 2c3ae43acf..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-debug.js >+++ /dev/null >@@ -1,3710 +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 >-*/ >-/** >- * The drag and drop utility provides a framework for building drag and drop >- * applications. In addition to enabling drag and drop for specific elements, >- * the drag and drop elements are tracked by the manager class, and the >- * interactions between the various elements are tracked during the drag and >- * the implementing code is notified about these important moments. >- * @module dragdrop >- * @title Drag and Drop >- * @requires yahoo,dom,event >- * @namespace YAHOO.util >- */ >- >-// Only load the library once. Rewriting the manager class would orphan >-// existing drag and drop instances. >-if (!YAHOO.util.DragDropMgr) { >- >-/** >- * DragDropMgr is a singleton that tracks the element interaction for >- * all DragDrop items in the window. Generally, you will not call >- * this class directly, but it does have helper methods that could >- * be useful in your DragDrop implementations. >- * @class DragDropMgr >- * @static >- */ >-YAHOO.util.DragDropMgr = function() { >- >- var Event = YAHOO.util.Event, >- Dom = YAHOO.util.Dom; >- >- return { >- /** >- * This property is used to turn on global use of the shim element on all DragDrop instances, defaults to false for backcompat. (Use: YAHOO.util.DDM.useShim = true) >- * @property useShim >- * @type Boolean >- * @static >- */ >- useShim: false, >- /** >- * This property is used to determine if the shim is active over the screen, default false. >- * @private >- * @property _shimActive >- * @type Boolean >- * @static >- */ >- _shimActive: false, >- /** >- * This property is used when useShim is set on a DragDrop object to store the current state of DDM.useShim so it can be reset when a drag operation is done. >- * @private >- * @property _shimState >- * @type Boolean >- * @static >- */ >- _shimState: false, >- /** >- * This property is used when useShim is set to true, it will set the opacity on the shim to .5 for debugging. Use: (YAHOO.util.DDM._debugShim = true;) >- * @private >- * @property _debugShim >- * @type Boolean >- * @static >- */ >- _debugShim: false, >- /** >- * This method will create a shim element (giving it the id of yui-ddm-shim), it also attaches the mousemove and mouseup listeners to it and attaches a scroll listener on the window >- * @private >- * @method _sizeShim >- * @static >- */ >- _createShim: function() { >- YAHOO.log('Creating Shim Element', 'info', 'DragDropMgr'); >- var s = document.createElement('div'); >- s.id = 'yui-ddm-shim'; >- if (document.body.firstChild) { >- document.body.insertBefore(s, document.body.firstChild); >- } else { >- document.body.appendChild(s); >- } >- s.style.display = 'none'; >- s.style.backgroundColor = 'red'; >- s.style.position = 'absolute'; >- s.style.zIndex = '99999'; >- Dom.setStyle(s, 'opacity', '0'); >- this._shim = s; >- Event.on(s, "mouseup", this.handleMouseUp, this, true); >- Event.on(s, "mousemove", this.handleMouseMove, this, true); >- Event.on(window, 'scroll', this._sizeShim, this, true); >- }, >- /** >- * This method will size the shim, called from activate and on window scroll event >- * @private >- * @method _sizeShim >- * @static >- */ >- _sizeShim: function() { >- if (this._shimActive) { >- YAHOO.log('Sizing Shim', 'info', 'DragDropMgr'); >- var s = this._shim; >- s.style.height = Dom.getDocumentHeight() + 'px'; >- s.style.width = Dom.getDocumentWidth() + 'px'; >- s.style.top = '0'; >- s.style.left = '0'; >- } >- }, >- /** >- * This method will create the shim element if needed, then show the shim element, size the element and set the _shimActive property to true >- * @private >- * @method _activateShim >- * @static >- */ >- _activateShim: function() { >- if (this.useShim) { >- YAHOO.log('Activating Shim', 'info', 'DragDropMgr'); >- if (!this._shim) { >- this._createShim(); >- } >- this._shimActive = true; >- var s = this._shim, >- o = '0'; >- if (this._debugShim) { >- o = '.5'; >- } >- Dom.setStyle(s, 'opacity', o); >- this._sizeShim(); >- s.style.display = 'block'; >- } >- }, >- /** >- * This method will hide the shim element and set the _shimActive property to false >- * @private >- * @method _deactivateShim >- * @static >- */ >- _deactivateShim: function() { >- YAHOO.log('Deactivating Shim', 'info', 'DragDropMgr'); >- this._shim.style.display = 'none'; >- this._shimActive = false; >- }, >- /** >- * The HTML element created to use as a shim over the document to track mouse movements >- * @private >- * @property _shim >- * @type HTMLElement >- * @static >- */ >- _shim: null, >- /** >- * Two dimensional Array of registered DragDrop objects. The first >- * dimension is the DragDrop item group, the second the DragDrop >- * object. >- * @property ids >- * @type {string: string} >- * @private >- * @static >- */ >- ids: {}, >- >- /** >- * Array of element ids defined as drag handles. Used to determine >- * if the element that generated the mousedown event is actually the >- * handle and not the html element itself. >- * @property handleIds >- * @type {string: string} >- * @private >- * @static >- */ >- handleIds: {}, >- >- /** >- * the DragDrop object that is currently being dragged >- * @property dragCurrent >- * @type DragDrop >- * @private >- * @static >- **/ >- dragCurrent: null, >- >- /** >- * the DragDrop object(s) that are being hovered over >- * @property dragOvers >- * @type Array >- * @private >- * @static >- */ >- dragOvers: {}, >- >- /** >- * the X distance between the cursor and the object being dragged >- * @property deltaX >- * @type int >- * @private >- * @static >- */ >- deltaX: 0, >- >- /** >- * the Y distance between the cursor and the object being dragged >- * @property deltaY >- * @type int >- * @private >- * @static >- */ >- deltaY: 0, >- >- /** >- * Flag to determine if we should prevent the default behavior of the >- * events we define. By default this is true, but this can be set to >- * false if you need the default behavior (not recommended) >- * @property preventDefault >- * @type boolean >- * @static >- */ >- preventDefault: true, >- >- /** >- * Flag to determine if we should stop the propagation of the events >- * we generate. This is true by default but you may want to set it to >- * false if the html element contains other features that require the >- * mouse click. >- * @property stopPropagation >- * @type boolean >- * @static >- */ >- stopPropagation: true, >- >- /** >- * Internal flag that is set to true when drag and drop has been >- * initialized >- * @property initialized >- * @private >- * @static >- */ >- initialized: false, >- >- /** >- * All drag and drop can be disabled. >- * @property locked >- * @private >- * @static >- */ >- locked: false, >- >- /** >- * Provides additional information about the current set of >- * interactions. Can be accessed from the event handlers. It >- * contains the following properties: >- * >- * out: onDragOut interactions >- * enter: onDragEnter interactions >- * over: onDragOver interactions >- * drop: onDragDrop interactions >- * point: The location of the cursor >- * draggedRegion: The location of dragged element at the time >- * of the interaction >- * sourceRegion: The location of the source elemtn at the time >- * of the interaction >- * validDrop: boolean >- * @property interactionInfo >- * @type object >- * @static >- */ >- interactionInfo: null, >- >- /** >- * Called the first time an element is registered. >- * @method init >- * @private >- * @static >- */ >- init: function() { >- this.initialized = true; >- }, >- >- /** >- * In point mode, drag and drop interaction is defined by the >- * location of the cursor during the drag/drop >- * @property POINT >- * @type int >- * @static >- * @final >- */ >- POINT: 0, >- >- /** >- * In intersect mode, drag and drop interaction is defined by the >- * cursor position or the amount of overlap of two or more drag and >- * drop objects. >- * @property INTERSECT >- * @type int >- * @static >- * @final >- */ >- INTERSECT: 1, >- >- /** >- * In intersect mode, drag and drop interaction is defined only by the >- * overlap of two or more drag and drop objects. >- * @property STRICT_INTERSECT >- * @type int >- * @static >- * @final >- */ >- STRICT_INTERSECT: 2, >- >- /** >- * The current drag and drop mode. Default: POINT >- * @property mode >- * @type int >- * @static >- */ >- mode: 0, >- >- /** >- * Runs method on all drag and drop objects >- * @method _execOnAll >- * @private >- * @static >- */ >- _execOnAll: function(sMethod, args) { >- for (var i in this.ids) { >- for (var j in this.ids[i]) { >- var oDD = this.ids[i][j]; >- if (! this.isTypeOfDD(oDD)) { >- continue; >- } >- oDD[sMethod].apply(oDD, args); >- } >- } >- }, >- >- /** >- * Drag and drop initialization. Sets up the global event handlers >- * @method _onLoad >- * @private >- * @static >- */ >- _onLoad: function() { >- >- this.init(); >- >- YAHOO.log("DragDropMgr onload", "info", "DragDropMgr"); >- Event.on(document, "mouseup", this.handleMouseUp, this, true); >- Event.on(document, "mousemove", this.handleMouseMove, this, true); >- Event.on(window, "unload", this._onUnload, this, true); >- Event.on(window, "resize", this._onResize, this, true); >- // Event.on(window, "mouseout", this._test); >- >- }, >- >- /** >- * Reset constraints on all drag and drop objs >- * @method _onResize >- * @private >- * @static >- */ >- _onResize: function(e) { >- YAHOO.log("window resize", "info", "DragDropMgr"); >- this._execOnAll("resetConstraints", []); >- }, >- >- /** >- * Lock all drag and drop functionality >- * @method lock >- * @static >- */ >- lock: function() { this.locked = true; }, >- >- /** >- * Unlock all drag and drop functionality >- * @method unlock >- * @static >- */ >- unlock: function() { this.locked = false; }, >- >- /** >- * Is drag and drop locked? >- * @method isLocked >- * @return {boolean} True if drag and drop is locked, false otherwise. >- * @static >- */ >- isLocked: function() { return this.locked; }, >- >- /** >- * Location cache that is set for all drag drop objects when a drag is >- * initiated, cleared when the drag is finished. >- * @property locationCache >- * @private >- * @static >- */ >- locationCache: {}, >- >- /** >- * Set useCache to false if you want to force object the lookup of each >- * drag and drop linked element constantly during a drag. >- * @property useCache >- * @type boolean >- * @static >- */ >- useCache: true, >- >- /** >- * The number of pixels that the mouse needs to move after the >- * mousedown before the drag is initiated. Default=3; >- * @property clickPixelThresh >- * @type int >- * @static >- */ >- clickPixelThresh: 3, >- >- /** >- * The number of milliseconds after the mousedown event to initiate the >- * drag if we don't get a mouseup event. Default=1000 >- * @property clickTimeThresh >- * @type int >- * @static >- */ >- clickTimeThresh: 1000, >- >- /** >- * Flag that indicates that either the drag pixel threshold or the >- * mousdown time threshold has been met >- * @property dragThreshMet >- * @type boolean >- * @private >- * @static >- */ >- dragThreshMet: false, >- >- /** >- * Timeout used for the click time threshold >- * @property clickTimeout >- * @type Object >- * @private >- * @static >- */ >- clickTimeout: null, >- >- /** >- * The X position of the mousedown event stored for later use when a >- * drag threshold is met. >- * @property startX >- * @type int >- * @private >- * @static >- */ >- startX: 0, >- >- /** >- * The Y position of the mousedown event stored for later use when a >- * drag threshold is met. >- * @property startY >- * @type int >- * @private >- * @static >- */ >- startY: 0, >- >- /** >- * Flag to determine if the drag event was fired from the click timeout and >- * not the mouse move threshold. >- * @property fromTimeout >- * @type boolean >- * @private >- * @static >- */ >- fromTimeout: false, >- >- /** >- * Each DragDrop instance must be registered with the DragDropMgr. >- * This is executed in DragDrop.init() >- * @method regDragDrop >- * @param {DragDrop} oDD the DragDrop object to register >- * @param {String} sGroup the name of the group this element belongs to >- * @static >- */ >- regDragDrop: function(oDD, sGroup) { >- if (!this.initialized) { this.init(); } >- >- if (!this.ids[sGroup]) { >- this.ids[sGroup] = {}; >- } >- this.ids[sGroup][oDD.id] = oDD; >- }, >- >- /** >- * Removes the supplied dd instance from the supplied group. Executed >- * by DragDrop.removeFromGroup, so don't call this function directly. >- * @method removeDDFromGroup >- * @private >- * @static >- */ >- removeDDFromGroup: function(oDD, sGroup) { >- if (!this.ids[sGroup]) { >- this.ids[sGroup] = {}; >- } >- >- var obj = this.ids[sGroup]; >- if (obj && obj[oDD.id]) { >- delete obj[oDD.id]; >- } >- }, >- >- /** >- * Unregisters a drag and drop item. This is executed in >- * DragDrop.unreg, use that method instead of calling this directly. >- * @method _remove >- * @private >- * @static >- */ >- _remove: function(oDD) { >- for (var g in oDD.groups) { >- if (g) { >- var item = this.ids[g]; >- if (item && item[oDD.id]) { >- delete item[oDD.id]; >- } >- } >- >- } >- delete this.handleIds[oDD.id]; >- }, >- >- /** >- * Each DragDrop handle element must be registered. This is done >- * automatically when executing DragDrop.setHandleElId() >- * @method regHandle >- * @param {String} sDDId the DragDrop id this element is a handle for >- * @param {String} sHandleId the id of the element that is the drag >- * handle >- * @static >- */ >- regHandle: function(sDDId, sHandleId) { >- if (!this.handleIds[sDDId]) { >- this.handleIds[sDDId] = {}; >- } >- this.handleIds[sDDId][sHandleId] = sHandleId; >- }, >- >- /** >- * Utility function to determine if a given element has been >- * registered as a drag drop item. >- * @method isDragDrop >- * @param {String} id the element id to check >- * @return {boolean} true if this element is a DragDrop item, >- * false otherwise >- * @static >- */ >- isDragDrop: function(id) { >- return ( this.getDDById(id) ) ? true : false; >- }, >- >- /** >- * Returns the drag and drop instances that are in all groups the >- * passed in instance belongs to. >- * @method getRelated >- * @param {DragDrop} p_oDD the obj to get related data for >- * @param {boolean} bTargetsOnly if true, only return targetable objs >- * @return {DragDrop[]} the related instances >- * @static >- */ >- getRelated: function(p_oDD, bTargetsOnly) { >- var oDDs = []; >- for (var i in p_oDD.groups) { >- for (var j in this.ids[i]) { >- var dd = this.ids[i][j]; >- if (! this.isTypeOfDD(dd)) { >- continue; >- } >- if (!bTargetsOnly || dd.isTarget) { >- oDDs[oDDs.length] = dd; >- } >- } >- } >- >- return oDDs; >- }, >- >- /** >- * Returns true if the specified dd target is a legal target for >- * the specifice drag obj >- * @method isLegalTarget >- * @param {DragDrop} the drag obj >- * @param {DragDrop} the target >- * @return {boolean} true if the target is a legal target for the >- * dd obj >- * @static >- */ >- isLegalTarget: function (oDD, oTargetDD) { >- var targets = this.getRelated(oDD, true); >- for (var i=0, len=targets.length;i<len;++i) { >- if (targets[i].id == oTargetDD.id) { >- return true; >- } >- } >- >- return false; >- }, >- >- /** >- * My goal is to be able to transparently determine if an object is >- * typeof DragDrop, and the exact subclass of DragDrop. typeof >- * returns "object", oDD.constructor.toString() always returns >- * "DragDrop" and not the name of the subclass. So for now it just >- * evaluates a well-known variable in DragDrop. >- * @method isTypeOfDD >- * @param {Object} the object to evaluate >- * @return {boolean} true if typeof oDD = DragDrop >- * @static >- */ >- isTypeOfDD: function (oDD) { >- return (oDD && oDD.__ygDragDrop); >- }, >- >- /** >- * Utility function to determine if a given element has been >- * registered as a drag drop handle for the given Drag Drop object. >- * @method isHandle >- * @param {String} id the element id to check >- * @return {boolean} true if this element is a DragDrop handle, false >- * otherwise >- * @static >- */ >- isHandle: function(sDDId, sHandleId) { >- return ( this.handleIds[sDDId] && >- this.handleIds[sDDId][sHandleId] ); >- }, >- >- /** >- * Returns the DragDrop instance for a given id >- * @method getDDById >- * @param {String} id the id of the DragDrop object >- * @return {DragDrop} the drag drop object, null if it is not found >- * @static >- */ >- getDDById: function(id) { >- for (var i in this.ids) { >- if (this.ids[i][id]) { >- return this.ids[i][id]; >- } >- } >- return null; >- }, >- >- /** >- * Fired after a registered DragDrop object gets the mousedown event. >- * Sets up the events required to track the object being dragged >- * @method handleMouseDown >- * @param {Event} e the event >- * @param oDD the DragDrop object being dragged >- * @private >- * @static >- */ >- handleMouseDown: function(e, oDD) { >- //this._activateShim(); >- >- this.currentTarget = YAHOO.util.Event.getTarget(e); >- >- this.dragCurrent = oDD; >- >- var el = oDD.getEl(); >- >- // track start position >- this.startX = YAHOO.util.Event.getPageX(e); >- this.startY = YAHOO.util.Event.getPageY(e); >- >- this.deltaX = this.startX - el.offsetLeft; >- this.deltaY = this.startY - el.offsetTop; >- >- this.dragThreshMet = false; >- >- this.clickTimeout = setTimeout( >- function() { >- var DDM = YAHOO.util.DDM; >- DDM.startDrag(DDM.startX, DDM.startY); >- DDM.fromTimeout = true; >- }, >- this.clickTimeThresh ); >- }, >- >- /** >- * Fired when either the drag pixel threshold or the mousedown hold >- * time threshold has been met. >- * @method startDrag >- * @param x {int} the X position of the original mousedown >- * @param y {int} the Y position of the original mousedown >- * @static >- */ >- startDrag: function(x, y) { >- if (this.dragCurrent && this.dragCurrent.useShim) { >- this._shimState = this.useShim; >- this.useShim = true; >- } >- this._activateShim(); >- YAHOO.log("firing drag start events", "info", "DragDropMgr"); >- clearTimeout(this.clickTimeout); >- var dc = this.dragCurrent; >- if (dc && dc.events.b4StartDrag) { >- dc.b4StartDrag(x, y); >- dc.fireEvent('b4StartDragEvent', { x: x, y: y }); >- } >- if (dc && dc.events.startDrag) { >- dc.startDrag(x, y); >- dc.fireEvent('startDragEvent', { x: x, y: y }); >- } >- this.dragThreshMet = true; >- }, >- >- /** >- * Internal function to handle the mouseup event. Will be invoked >- * from the context of the document. >- * @method handleMouseUp >- * @param {Event} e the event >- * @private >- * @static >- */ >- handleMouseUp: function(e) { >- if (this.dragCurrent) { >- clearTimeout(this.clickTimeout); >- >- if (this.dragThreshMet) { >- YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr"); >- if (this.fromTimeout) { >- YAHOO.log('fromTimeout is true (mouse didn\'t move), call handleMouseMove so we can get the dragOver event', 'info', 'DragDropMgr'); >- this.fromTimeout = false; >- this.handleMouseMove(e); >- } >- this.fromTimeout = false; >- this.fireEvents(e, true); >- } else { >- YAHOO.log("drag threshold not met", "info", "DragDropMgr"); >- } >- >- this.stopDrag(e); >- >- this.stopEvent(e); >- } >- }, >- >- /** >- * Utility to stop event propagation and event default, if these >- * features are turned on. >- * @method stopEvent >- * @param {Event} e the event as returned by this.getEvent() >- * @static >- */ >- stopEvent: function(e) { >- if (this.stopPropagation) { >- YAHOO.util.Event.stopPropagation(e); >- } >- >- if (this.preventDefault) { >- YAHOO.util.Event.preventDefault(e); >- } >- }, >- >- /** >- * Ends the current drag, cleans up the state, and fires the endDrag >- * and mouseUp events. Called internally when a mouseup is detected >- * during the drag. Can be fired manually during the drag by passing >- * either another event (such as the mousemove event received in onDrag) >- * or a fake event with pageX and pageY defined (so that endDrag and >- * onMouseUp have usable position data.). Alternatively, pass true >- * for the silent parameter so that the endDrag and onMouseUp events >- * are skipped (so no event data is needed.) >- * >- * @method stopDrag >- * @param {Event} e the mouseup event, another event (or a fake event) >- * with pageX and pageY defined, or nothing if the >- * silent parameter is true >- * @param {boolean} silent skips the enddrag and mouseup events if true >- * @static >- */ >- stopDrag: function(e, silent) { >- // YAHOO.log("mouseup - removing event handlers"); >- var dc = this.dragCurrent; >- // Fire the drag end event for the item that was dragged >- if (dc && !silent) { >- if (this.dragThreshMet) { >- YAHOO.log("firing endDrag events", "info", "DragDropMgr"); >- if (dc.events.b4EndDrag) { >- dc.b4EndDrag(e); >- dc.fireEvent('b4EndDragEvent', { e: e }); >- } >- if (dc.events.endDrag) { >- dc.endDrag(e); >- dc.fireEvent('endDragEvent', { e: e }); >- } >- } >- if (dc.events.mouseUp) { >- YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr"); >- dc.onMouseUp(e); >- dc.fireEvent('mouseUpEvent', { e: e }); >- } >- } >- >- if (this._shimActive) { >- this._deactivateShim(); >- if (this.dragCurrent && this.dragCurrent.useShim) { >- this.useShim = this._shimState; >- this._shimState = false; >- } >- } >- >- this.dragCurrent = null; >- this.dragOvers = {}; >- }, >- >- /** >- * Internal function to handle the mousemove event. Will be invoked >- * from the context of the html element. >- * >- * @TODO figure out what we can do about mouse events lost when the >- * user drags objects beyond the window boundary. Currently we can >- * detect this in internet explorer by verifying that the mouse is >- * down during the mousemove event. Firefox doesn't give us the >- * button state on the mousemove event. >- * @method handleMouseMove >- * @param {Event} e the event >- * @private >- * @static >- */ >- handleMouseMove: function(e) { >- //YAHOO.log("handlemousemove"); >- >- var dc = this.dragCurrent; >- if (dc) { >- // YAHOO.log("no current drag obj"); >- >- // var button = e.which || e.button; >- // YAHOO.log("which: " + e.which + ", button: "+ e.button); >- >- // check for IE mouseup outside of page boundary >- if (YAHOO.util.Event.isIE && !e.button) { >- YAHOO.log("button failure", "info", "DragDropMgr"); >- this.stopEvent(e); >- return this.handleMouseUp(e); >- } else { >- if (e.clientX < 0 || e.clientY < 0) { >- //This will stop the element from leaving the viewport in FF, Opera & Safari >- //Not turned on yet >- //YAHOO.log("Either clientX or clientY is negative, stop the event.", "info", "DragDropMgr"); >- //this.stopEvent(e); >- //return false; >- } >- } >- >- if (!this.dragThreshMet) { >- var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e)); >- var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e)); >- // YAHOO.log("diffX: " + diffX + "diffY: " + diffY); >- if (diffX > this.clickPixelThresh || >- diffY > this.clickPixelThresh) { >- YAHOO.log("pixel threshold met", "info", "DragDropMgr"); >- this.startDrag(this.startX, this.startY); >- } >- } >- >- if (this.dragThreshMet) { >- if (dc && dc.events.b4Drag) { >- dc.b4Drag(e); >- dc.fireEvent('b4DragEvent', { e: e}); >- } >- if (dc && dc.events.drag) { >- dc.onDrag(e); >- dc.fireEvent('dragEvent', { e: e}); >- } >- if (dc) { >- this.fireEvents(e, false); >- } >- } >- >- this.stopEvent(e); >- } >- }, >- >- /** >- * Iterates over all of the DragDrop elements to find ones we are >- * hovering over or dropping on >- * @method fireEvents >- * @param {Event} e the event >- * @param {boolean} isDrop is this a drop op or a mouseover op? >- * @private >- * @static >- */ >- fireEvents: function(e, isDrop) { >- var dc = this.dragCurrent; >- >- // If the user did the mouse up outside of the window, we could >- // get here even though we have ended the drag. >- // If the config option dragOnly is true, bail out and don't fire the events >- if (!dc || dc.isLocked() || dc.dragOnly) { >- return; >- } >- >- var x = YAHOO.util.Event.getPageX(e), >- y = YAHOO.util.Event.getPageY(e), >- pt = new YAHOO.util.Point(x,y), >- pos = dc.getTargetCoord(pt.x, pt.y), >- el = dc.getDragEl(), >- events = ['out', 'over', 'drop', 'enter'], >- curRegion = new YAHOO.util.Region( pos.y, >- pos.x + el.offsetWidth, >- pos.y + el.offsetHeight, >- pos.x ), >- >- oldOvers = [], // cache the previous dragOver array >- inGroupsObj = {}, >- inGroups = [], >- data = { >- outEvts: [], >- overEvts: [], >- dropEvts: [], >- enterEvts: [] >- }; >- >- >- // Check to see if the object(s) we were hovering over is no longer >- // being hovered over so we can fire the onDragOut event >- for (var i in this.dragOvers) { >- >- var ddo = this.dragOvers[i]; >- >- if (! this.isTypeOfDD(ddo)) { >- continue; >- } >- if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) { >- data.outEvts.push( ddo ); >- } >- >- oldOvers[i] = true; >- delete this.dragOvers[i]; >- } >- >- for (var sGroup in dc.groups) { >- // YAHOO.log("Processing group " + sGroup); >- >- if ("string" != typeof sGroup) { >- continue; >- } >- >- for (i in this.ids[sGroup]) { >- var oDD = this.ids[sGroup][i]; >- if (! this.isTypeOfDD(oDD)) { >- continue; >- } >- >- if (oDD.isTarget && !oDD.isLocked() && oDD != dc) { >- if (this.isOverTarget(pt, oDD, this.mode, curRegion)) { >- inGroupsObj[sGroup] = true; >- // look for drop interactions >- if (isDrop) { >- data.dropEvts.push( oDD ); >- // look for drag enter and drag over interactions >- } else { >- >- // initial drag over: dragEnter fires >- if (!oldOvers[oDD.id]) { >- data.enterEvts.push( oDD ); >- // subsequent drag overs: dragOver fires >- } else { >- data.overEvts.push( oDD ); >- } >- >- this.dragOvers[oDD.id] = oDD; >- } >- } >- } >- } >- } >- >- this.interactionInfo = { >- out: data.outEvts, >- enter: data.enterEvts, >- over: data.overEvts, >- drop: data.dropEvts, >- point: pt, >- draggedRegion: curRegion, >- sourceRegion: this.locationCache[dc.id], >- validDrop: isDrop >- }; >- >- >- for (var inG in inGroupsObj) { >- inGroups.push(inG); >- } >- >- // notify about a drop that did not find a target >- if (isDrop && !data.dropEvts.length) { >- YAHOO.log(dc.id + " dropped, but not on a target", "info", "DragDropMgr"); >- this.interactionInfo.validDrop = false; >- if (dc.events.invalidDrop) { >- dc.onInvalidDrop(e); >- dc.fireEvent('invalidDropEvent', { e: e }); >- } >- } >- for (i = 0; i < events.length; i++) { >- var tmp = null; >- if (data[events[i] + 'Evts']) { >- tmp = data[events[i] + 'Evts']; >- } >- if (tmp && tmp.length) { >- var type = events[i].charAt(0).toUpperCase() + events[i].substr(1), >- ev = 'onDrag' + type, >- b4 = 'b4Drag' + type, >- cev = 'drag' + type + 'Event', >- check = 'drag' + type; >- if (this.mode) { >- YAHOO.log(dc.id + ' ' + ev + ': ' + tmp, "info", "DragDropMgr"); >- if (dc.events[b4]) { >- dc[b4](e, tmp, inGroups); >- dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups }); >- >- } >- if (dc.events[check]) { >- dc[ev](e, tmp, inGroups); >- dc.fireEvent(cev, { event: e, info: tmp, group: inGroups }); >- } >- } else { >- for (var b = 0, len = tmp.length; b < len; ++b) { >- YAHOO.log(dc.id + ' ' + ev + ': ' + tmp[b].id, "info", "DragDropMgr"); >- if (dc.events[b4]) { >- dc[b4](e, tmp[b].id, inGroups[0]); >- dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] }); >- } >- if (dc.events[check]) { >- dc[ev](e, tmp[b].id, inGroups[0]); >- dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] }); >- } >- } >- } >- } >- } >- }, >- >- /** >- * Helper function for getting the best match from the list of drag >- * and drop objects returned by the drag and drop events when we are >- * in INTERSECT mode. It returns either the first object that the >- * cursor is over, or the object that has the greatest overlap with >- * the dragged element. >- * @method getBestMatch >- * @param {DragDrop[]} dds The array of drag and drop objects >- * targeted >- * @return {DragDrop} The best single match >- * @static >- */ >- getBestMatch: function(dds) { >- var winner = null; >- >- var len = dds.length; >- >- if (len == 1) { >- winner = dds[0]; >- } else { >- // Loop through the targeted items >- for (var i=0; i<len; ++i) { >- var dd = dds[i]; >- // If the cursor is over the object, it wins. If the >- // cursor is over multiple matches, the first one we come >- // to wins. >- if (this.mode == this.INTERSECT && dd.cursorIsOver) { >- winner = dd; >- break; >- // Otherwise the object with the most overlap wins >- } else { >- if (!winner || !winner.overlap || (dd.overlap && >- winner.overlap.getArea() < dd.overlap.getArea())) { >- winner = dd; >- } >- } >- } >- } >- >- return winner; >- }, >- >- /** >- * Refreshes the cache of the top-left and bottom-right points of the >- * drag and drop objects in the specified group(s). This is in the >- * format that is stored in the drag and drop instance, so typical >- * usage is: >- * <code> >- * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups); >- * </code> >- * Alternatively: >- * <code> >- * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true}); >- * </code> >- * @TODO this really should be an indexed array. Alternatively this >- * method could accept both. >- * @method refreshCache >- * @param {Object} groups an associative array of groups to refresh >- * @static >- */ >- refreshCache: function(groups) { >- YAHOO.log("refreshing element location cache", "info", "DragDropMgr"); >- >- // refresh everything if group array is not provided >- var g = groups || this.ids; >- >- for (var sGroup in g) { >- if ("string" != typeof sGroup) { >- continue; >- } >- for (var i in this.ids[sGroup]) { >- var oDD = this.ids[sGroup][i]; >- >- if (this.isTypeOfDD(oDD)) { >- var loc = this.getLocation(oDD); >- if (loc) { >- this.locationCache[oDD.id] = loc; >- } else { >- delete this.locationCache[oDD.id]; >-YAHOO.log("Could not get the loc for " + oDD.id, "warn", "DragDropMgr"); >- } >- } >- } >- } >- }, >- >- /** >- * This checks to make sure an element exists and is in the DOM. The >- * main purpose is to handle cases where innerHTML is used to remove >- * drag and drop objects from the DOM. IE provides an 'unspecified >- * error' when trying to access the offsetParent of such an element >- * @method verifyEl >- * @param {HTMLElement} el the element to check >- * @return {boolean} true if the element looks usable >- * @static >- */ >- verifyEl: function(el) { >- try { >- if (el) { >- var parent = el.offsetParent; >- if (parent) { >- return true; >- } >- } >- } catch(e) { >- YAHOO.log("detected problem with an element", "info", "DragDropMgr"); >- } >- >- return false; >- }, >- >- /** >- * Returns a Region object containing the drag and drop element's position >- * and size, including the padding configured for it >- * @method getLocation >- * @param {DragDrop} oDD the drag and drop object to get the >- * location for >- * @return {YAHOO.util.Region} a Region object representing the total area >- * the element occupies, including any padding >- * the instance is configured for. >- * @static >- */ >- getLocation: function(oDD) { >- if (! this.isTypeOfDD(oDD)) { >- YAHOO.log(oDD + " is not a DD obj", "info", "DragDropMgr"); >- return null; >- } >- >- var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l; >- >- try { >- pos= YAHOO.util.Dom.getXY(el); >- } catch (e) { } >- >- if (!pos) { >- YAHOO.log("getXY failed", "info", "DragDropMgr"); >- return null; >- } >- >- x1 = pos[0]; >- x2 = x1 + el.offsetWidth; >- y1 = pos[1]; >- y2 = y1 + el.offsetHeight; >- >- t = y1 - oDD.padding[0]; >- r = x2 + oDD.padding[1]; >- b = y2 + oDD.padding[2]; >- l = x1 - oDD.padding[3]; >- >- return new YAHOO.util.Region( t, r, b, l ); >- }, >- >- /** >- * Checks the cursor location to see if it over the target >- * @method isOverTarget >- * @param {YAHOO.util.Point} pt The point to evaluate >- * @param {DragDrop} oTarget the DragDrop object we are inspecting >- * @param {boolean} intersect true if we are in intersect mode >- * @param {YAHOO.util.Region} pre-cached location of the dragged element >- * @return {boolean} true if the mouse is over the target >- * @private >- * @static >- */ >- isOverTarget: function(pt, oTarget, intersect, curRegion) { >- // use cache if available >- var loc = this.locationCache[oTarget.id]; >- if (!loc || !this.useCache) { >- YAHOO.log("cache not populated", "info", "DragDropMgr"); >- loc = this.getLocation(oTarget); >- this.locationCache[oTarget.id] = loc; >- >- YAHOO.log("cache: " + loc, "info", "DragDropMgr"); >- } >- >- if (!loc) { >- YAHOO.log("could not get the location of the element", "info", "DragDropMgr"); >- return false; >- } >- >- //YAHOO.log("loc: " + loc + ", pt: " + pt); >- oTarget.cursorIsOver = loc.contains( pt ); >- >- // DragDrop is using this as a sanity check for the initial mousedown >- // in this case we are done. In POINT mode, if the drag obj has no >- // contraints, we are done. Otherwise we need to evaluate the >- // region the target as occupies to determine if the dragged element >- // overlaps with it. >- >- var dc = this.dragCurrent; >- if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) { >- >- //if (oTarget.cursorIsOver) { >- //YAHOO.log("over " + oTarget + ", " + loc + ", " + pt, "warn"); >- //} >- return oTarget.cursorIsOver; >- } >- >- oTarget.overlap = null; >- >- >- // Get the current location of the drag element, this is the >- // location of the mouse event less the delta that represents >- // where the original mousedown happened on the element. We >- // need to consider constraints and ticks as well. >- >- if (!curRegion) { >- var pos = dc.getTargetCoord(pt.x, pt.y); >- var el = dc.getDragEl(); >- curRegion = new YAHOO.util.Region( pos.y, >- pos.x + el.offsetWidth, >- pos.y + el.offsetHeight, >- pos.x ); >- } >- >- var overlap = curRegion.intersect(loc); >- >- if (overlap) { >- oTarget.overlap = overlap; >- return (intersect) ? true : oTarget.cursorIsOver; >- } else { >- return false; >- } >- }, >- >- /** >- * unload event handler >- * @method _onUnload >- * @private >- * @static >- */ >- _onUnload: function(e, me) { >- this.unregAll(); >- }, >- >- /** >- * Cleans up the drag and drop events and objects. >- * @method unregAll >- * @private >- * @static >- */ >- unregAll: function() { >- YAHOO.log("unregister all", "info", "DragDropMgr"); >- >- if (this.dragCurrent) { >- this.stopDrag(); >- this.dragCurrent = null; >- } >- >- this._execOnAll("unreg", []); >- >- //for (var i in this.elementCache) { >- //delete this.elementCache[i]; >- //} >- //this.elementCache = {}; >- >- this.ids = {}; >- }, >- >- /** >- * A cache of DOM elements >- * @property elementCache >- * @private >- * @static >- * @deprecated elements are not cached now >- */ >- elementCache: {}, >- >- /** >- * Get the wrapper for the DOM element specified >- * @method getElWrapper >- * @param {String} id the id of the element to get >- * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element >- * @private >- * @deprecated This wrapper isn't that useful >- * @static >- */ >- getElWrapper: function(id) { >- var oWrapper = this.elementCache[id]; >- if (!oWrapper || !oWrapper.el) { >- oWrapper = this.elementCache[id] = >- new this.ElementWrapper(YAHOO.util.Dom.get(id)); >- } >- return oWrapper; >- }, >- >- /** >- * Returns the actual DOM element >- * @method getElement >- * @param {String} id the id of the elment to get >- * @return {Object} The element >- * @deprecated use YAHOO.util.Dom.get instead >- * @static >- */ >- getElement: function(id) { >- return YAHOO.util.Dom.get(id); >- }, >- >- /** >- * Returns the style property for the DOM element (i.e., >- * document.getElById(id).style) >- * @method getCss >- * @param {String} id the id of the elment to get >- * @return {Object} The style property of the element >- * @deprecated use YAHOO.util.Dom instead >- * @static >- */ >- getCss: function(id) { >- var el = YAHOO.util.Dom.get(id); >- return (el) ? el.style : null; >- }, >- >- /** >- * Inner class for cached elements >- * @class DragDropMgr.ElementWrapper >- * @for DragDropMgr >- * @private >- * @deprecated >- */ >- ElementWrapper: function(el) { >- /** >- * The element >- * @property el >- */ >- this.el = el || null; >- /** >- * The element id >- * @property id >- */ >- this.id = this.el && el.id; >- /** >- * A reference to the style property >- * @property css >- */ >- this.css = this.el && el.style; >- }, >- >- /** >- * Returns the X position of an html element >- * @method getPosX >- * @param el the element for which to get the position >- * @return {int} the X coordinate >- * @for DragDropMgr >- * @deprecated use YAHOO.util.Dom.getX instead >- * @static >- */ >- getPosX: function(el) { >- return YAHOO.util.Dom.getX(el); >- }, >- >- /** >- * Returns the Y position of an html element >- * @method getPosY >- * @param el the element for which to get the position >- * @return {int} the Y coordinate >- * @deprecated use YAHOO.util.Dom.getY instead >- * @static >- */ >- getPosY: function(el) { >- return YAHOO.util.Dom.getY(el); >- }, >- >- /** >- * Swap two nodes. In IE, we use the native method, for others we >- * emulate the IE behavior >- * @method swapNode >- * @param n1 the first node to swap >- * @param n2 the other node to swap >- * @static >- */ >- swapNode: function(n1, n2) { >- if (n1.swapNode) { >- n1.swapNode(n2); >- } else { >- var p = n2.parentNode; >- var s = n2.nextSibling; >- >- if (s == n1) { >- p.insertBefore(n1, n2); >- } else if (n2 == n1.nextSibling) { >- p.insertBefore(n2, n1); >- } else { >- n1.parentNode.replaceChild(n2, n1); >- p.insertBefore(n1, s); >- } >- } >- }, >- >- /** >- * Returns the current scroll position >- * @method getScroll >- * @private >- * @static >- */ >- getScroll: function () { >- var t, l, dde=document.documentElement, db=document.body; >- if (dde && (dde.scrollTop || dde.scrollLeft)) { >- t = dde.scrollTop; >- l = dde.scrollLeft; >- } else if (db) { >- t = db.scrollTop; >- l = db.scrollLeft; >- } else { >- YAHOO.log("could not get scroll property", "info", "DragDropMgr"); >- } >- return { top: t, left: l }; >- }, >- >- /** >- * Returns the specified element style property >- * @method getStyle >- * @param {HTMLElement} el the element >- * @param {string} styleProp the style property >- * @return {string} The value of the style property >- * @deprecated use YAHOO.util.Dom.getStyle >- * @static >- */ >- getStyle: function(el, styleProp) { >- return YAHOO.util.Dom.getStyle(el, styleProp); >- }, >- >- /** >- * Gets the scrollTop >- * @method getScrollTop >- * @return {int} the document's scrollTop >- * @static >- */ >- getScrollTop: function () { return this.getScroll().top; }, >- >- /** >- * Gets the scrollLeft >- * @method getScrollLeft >- * @return {int} the document's scrollTop >- * @static >- */ >- getScrollLeft: function () { return this.getScroll().left; }, >- >- /** >- * Sets the x/y position of an element to the location of the >- * target element. >- * @method moveToEl >- * @param {HTMLElement} moveEl The element to move >- * @param {HTMLElement} targetEl The position reference element >- * @static >- */ >- moveToEl: function (moveEl, targetEl) { >- var aCoord = YAHOO.util.Dom.getXY(targetEl); >- YAHOO.log("moveToEl: " + aCoord, "info", "DragDropMgr"); >- YAHOO.util.Dom.setXY(moveEl, aCoord); >- }, >- >- /** >- * Gets the client height >- * @method getClientHeight >- * @return {int} client height in px >- * @deprecated use YAHOO.util.Dom.getViewportHeight instead >- * @static >- */ >- getClientHeight: function() { >- return YAHOO.util.Dom.getViewportHeight(); >- }, >- >- /** >- * Gets the client width >- * @method getClientWidth >- * @return {int} client width in px >- * @deprecated use YAHOO.util.Dom.getViewportWidth instead >- * @static >- */ >- getClientWidth: function() { >- return YAHOO.util.Dom.getViewportWidth(); >- }, >- >- /** >- * Numeric array sort function >- * @method numericSort >- * @static >- */ >- numericSort: function(a, b) { return (a - b); }, >- >- /** >- * Internal counter >- * @property _timeoutCount >- * @private >- * @static >- */ >- _timeoutCount: 0, >- >- /** >- * Trying to make the load order less important. Without this we get >- * an error if this file is loaded before the Event Utility. >- * @method _addListeners >- * @private >- * @static >- */ >- _addListeners: function() { >- var DDM = YAHOO.util.DDM; >- if ( YAHOO.util.Event && document ) { >- DDM._onLoad(); >- } else { >- if (DDM._timeoutCount > 2000) { >- YAHOO.log("DragDrop requires the Event Utility", "error", "DragDropMgr"); >- } else { >- setTimeout(DDM._addListeners, 10); >- if (document && document.body) { >- DDM._timeoutCount += 1; >- } >- } >- } >- }, >- >- /** >- * Recursively searches the immediate parent and all child nodes for >- * the handle element in order to determine wheter or not it was >- * clicked. >- * @method handleWasClicked >- * @param node the html element to inspect >- * @static >- */ >- handleWasClicked: function(node, id) { >- if (this.isHandle(id, node.id)) { >- YAHOO.log("clicked node is a handle", "info", "DragDropMgr"); >- return true; >- } else { >- // check to see if this is a text node child of the one we want >- var p = node.parentNode; >- // YAHOO.log("p: " + p); >- >- while (p) { >- if (this.isHandle(id, p.id)) { >- return true; >- } else { >- YAHOO.log(p.id + " is not a handle", "info", "DragDropMgr"); >- p = p.parentNode; >- } >- } >- } >- >- return false; >- } >- >- }; >- >-}(); >- >-// shorter alias, save a few bytes >-YAHOO.util.DDM = YAHOO.util.DragDropMgr; >-YAHOO.util.DDM._addListeners(); >- >-} >- >-(function() { >- >-var Event=YAHOO.util.Event; >-var Dom=YAHOO.util.Dom; >- >-/** >- * Defines the interface and base operation of items that that can be >- * dragged or can be drop targets. It was designed to be extended, overriding >- * the event handlers for startDrag, onDrag, onDragOver, onDragOut. >- * Up to three html elements can be associated with a DragDrop instance: >- * <ul> >- * <li>linked element: the element that is passed into the constructor. >- * This is the element which defines the boundaries for interaction with >- * other DragDrop objects.</li> >- * <li>handle element(s): The drag operation only occurs if the element that >- * was clicked matches a handle element. By default this is the linked >- * element, but there are times that you will want only a portion of the >- * linked element to initiate the drag operation, and the setHandleElId() >- * method provides a way to define this.</li> >- * <li>drag element: this represents an the element that would be moved along >- * with the cursor during a drag operation. By default, this is the linked >- * element itself as in {@link YAHOO.util.DD}. setDragElId() lets you define >- * a separate element that would be moved, as in {@link YAHOO.util.DDProxy} >- * </li> >- * </ul> >- * This class should not be instantiated until the onload event to ensure that >- * the associated elements are available. >- * The following would define a DragDrop obj that would interact with any >- * other DragDrop obj in the "group1" group: >- * <pre> >- * dd = new YAHOO.util.DragDrop("div1", "group1"); >- * </pre> >- * Since none of the event handlers have been implemented, nothing would >- * actually happen if you were to run the code above. Normally you would >- * override this class or one of the default implementations, but you can >- * also override the methods you want on an instance of the class... >- * <pre> >- * dd.onDragDrop = function(e, id) { >- * alert("dd was dropped on " + id); >- * } >- * </pre> >- * @namespace YAHOO.util >- * @class DragDrop >- * @constructor >- * @param {String} id of the element that is linked to this instance >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DragDrop: >- * padding, isTarget, maintainOffset, primaryButtonOnly, >- */ >-YAHOO.util.DragDrop = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- } >-}; >- >-YAHOO.util.DragDrop.prototype = { >- /** >- * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop >- * By setting any of these to false, then event will not be fired. >- * @property events >- * @type object >- */ >- events: null, >- /** >- * @method on >- * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a> >- */ >- on: function() { >- this.subscribe.apply(this, arguments); >- }, >- /** >- * The id of the element associated with this object. This is what we >- * refer to as the "linked element" because the size and position of >- * this element is used to determine when the drag and drop objects have >- * interacted. >- * @property id >- * @type String >- */ >- id: null, >- >- /** >- * Configuration attributes passed into the constructor >- * @property config >- * @type object >- */ >- config: null, >- >- /** >- * The id of the element that will be dragged. By default this is same >- * as the linked element , but could be changed to another element. Ex: >- * YAHOO.util.DDProxy >- * @property dragElId >- * @type String >- * @private >- */ >- dragElId: null, >- >- /** >- * the id of the element that initiates the drag operation. By default >- * this is the linked element, but could be changed to be a child of this >- * element. This lets us do things like only starting the drag when the >- * header element within the linked html element is clicked. >- * @property handleElId >- * @type String >- * @private >- */ >- handleElId: null, >- >- /** >- * An associative array of HTML tags that will be ignored if clicked. >- * @property invalidHandleTypes >- * @type {string: string} >- */ >- invalidHandleTypes: null, >- >- /** >- * An associative array of ids for elements that will be ignored if clicked >- * @property invalidHandleIds >- * @type {string: string} >- */ >- invalidHandleIds: null, >- >- /** >- * An indexted array of css class names for elements that will be ignored >- * if clicked. >- * @property invalidHandleClasses >- * @type string[] >- */ >- invalidHandleClasses: null, >- >- /** >- * The linked element's absolute X position at the time the drag was >- * started >- * @property startPageX >- * @type int >- * @private >- */ >- startPageX: 0, >- >- /** >- * The linked element's absolute X position at the time the drag was >- * started >- * @property startPageY >- * @type int >- * @private >- */ >- startPageY: 0, >- >- /** >- * The group defines a logical collection of DragDrop objects that are >- * related. Instances only get events when interacting with other >- * DragDrop object in the same group. This lets us define multiple >- * groups using a single DragDrop subclass if we want. >- * @property groups >- * @type {string: string} >- */ >- groups: null, >- >- /** >- * Individual drag/drop instances can be locked. This will prevent >- * onmousedown start drag. >- * @property locked >- * @type boolean >- * @private >- */ >- locked: false, >- >- /** >- * Lock this instance >- * @method lock >- */ >- lock: function() { this.locked = true; }, >- >- /** >- * Unlock this instace >- * @method unlock >- */ >- unlock: function() { this.locked = false; }, >- >- /** >- * By default, all instances can be a drop target. This can be disabled by >- * setting isTarget to false. >- * @property isTarget >- * @type boolean >- */ >- isTarget: true, >- >- /** >- * The padding configured for this drag and drop object for calculating >- * the drop zone intersection with this object. >- * @property padding >- * @type int[] >- */ >- padding: null, >- /** >- * If this flag is true, do not fire drop events. The element is a drag only element (for movement not dropping) >- * @property dragOnly >- * @type Boolean >- */ >- dragOnly: false, >- >- /** >- * If this flag is true, a shim will be placed over the screen/viewable area to track mouse events. Should help with dragging elements over iframes and other controls. >- * @property useShim >- * @type Boolean >- */ >- useShim: false, >- >- /** >- * Cached reference to the linked element >- * @property _domRef >- * @private >- */ >- _domRef: null, >- >- /** >- * Internal typeof flag >- * @property __ygDragDrop >- * @private >- */ >- __ygDragDrop: true, >- >- /** >- * Set to true when horizontal contraints are applied >- * @property constrainX >- * @type boolean >- * @private >- */ >- constrainX: false, >- >- /** >- * Set to true when vertical contraints are applied >- * @property constrainY >- * @type boolean >- * @private >- */ >- constrainY: false, >- >- /** >- * The left constraint >- * @property minX >- * @type int >- * @private >- */ >- minX: 0, >- >- /** >- * The right constraint >- * @property maxX >- * @type int >- * @private >- */ >- maxX: 0, >- >- /** >- * The up constraint >- * @property minY >- * @type int >- * @type int >- * @private >- */ >- minY: 0, >- >- /** >- * The down constraint >- * @property maxY >- * @type int >- * @private >- */ >- maxY: 0, >- >- /** >- * The difference between the click position and the source element's location >- * @property deltaX >- * @type int >- * @private >- */ >- deltaX: 0, >- >- /** >- * The difference between the click position and the source element's location >- * @property deltaY >- * @type int >- * @private >- */ >- deltaY: 0, >- >- /** >- * Maintain offsets when we resetconstraints. Set to true when you want >- * the position of the element relative to its parent to stay the same >- * when the page changes >- * >- * @property maintainOffset >- * @type boolean >- */ >- maintainOffset: false, >- >- /** >- * Array of pixel locations the element will snap to if we specified a >- * horizontal graduation/interval. This array is generated automatically >- * when you define a tick interval. >- * @property xTicks >- * @type int[] >- */ >- xTicks: null, >- >- /** >- * Array of pixel locations the element will snap to if we specified a >- * vertical graduation/interval. This array is generated automatically >- * when you define a tick interval. >- * @property yTicks >- * @type int[] >- */ >- yTicks: null, >- >- /** >- * By default the drag and drop instance will only respond to the primary >- * button click (left button for a right-handed mouse). Set to true to >- * allow drag and drop to start with any mouse click that is propogated >- * by the browser >- * @property primaryButtonOnly >- * @type boolean >- */ >- primaryButtonOnly: true, >- >- /** >- * The availabe property is false until the linked dom element is accessible. >- * @property available >- * @type boolean >- */ >- available: false, >- >- /** >- * By default, drags can only be initiated if the mousedown occurs in the >- * region the linked element is. This is done in part to work around a >- * bug in some browsers that mis-report the mousedown if the previous >- * mouseup happened outside of the window. This property is set to true >- * if outer handles are defined. >- * >- * @property hasOuterHandles >- * @type boolean >- * @default false >- */ >- hasOuterHandles: false, >- >- /** >- * Property that is assigned to a drag and drop object when testing to >- * see if it is being targeted by another dd object. This property >- * can be used in intersect mode to help determine the focus of >- * the mouse interaction. DDM.getBestMatch uses this property first to >- * determine the closest match in INTERSECT mode when multiple targets >- * are part of the same interaction. >- * @property cursorIsOver >- * @type boolean >- */ >- cursorIsOver: false, >- >- /** >- * Property that is assigned to a drag and drop object when testing to >- * see if it is being targeted by another dd object. This is a region >- * that represents the area the draggable element overlaps this target. >- * DDM.getBestMatch uses this property to compare the size of the overlap >- * to that of other targets in order to determine the closest match in >- * INTERSECT mode when multiple targets are part of the same interaction. >- * @property overlap >- * @type YAHOO.util.Region >- */ >- overlap: null, >- >- /** >- * Code that executes immediately before the startDrag event >- * @method b4StartDrag >- * @private >- */ >- b4StartDrag: function(x, y) { }, >- >- /** >- * Abstract method called after a drag/drop object is clicked >- * and the drag or mousedown time thresholds have beeen met. >- * @method startDrag >- * @param {int} X click location >- * @param {int} Y click location >- */ >- startDrag: function(x, y) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDrag event >- * @method b4Drag >- * @private >- */ >- b4Drag: function(e) { }, >- >- /** >- * Abstract method called during the onMouseMove event while dragging an >- * object. >- * @method onDrag >- * @param {Event} e the mousemove event >- */ >- onDrag: function(e) { /* override this */ }, >- >- /** >- * Abstract method called when this element fist begins hovering over >- * another DragDrop obj >- * @method onDragEnter >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this is hovering over. In INTERSECT mode, an array of one or more >- * dragdrop items being hovered over. >- */ >- onDragEnter: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragOver event >- * @method b4DragOver >- * @private >- */ >- b4DragOver: function(e) { }, >- >- /** >- * Abstract method called when this element is hovering over another >- * DragDrop obj >- * @method onDragOver >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this is hovering over. In INTERSECT mode, an array of dd items >- * being hovered over. >- */ >- onDragOver: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragOut event >- * @method b4DragOut >- * @private >- */ >- b4DragOut: function(e) { }, >- >- /** >- * Abstract method called when we are no longer hovering over an element >- * @method onDragOut >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this was hovering over. In INTERSECT mode, an array of dd items >- * that the mouse is no longer over. >- */ >- onDragOut: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragDrop event >- * @method b4DragDrop >- * @private >- */ >- b4DragDrop: function(e) { }, >- >- /** >- * Abstract method called when this item is dropped on another DragDrop >- * obj >- * @method onDragDrop >- * @param {Event} e the mouseup event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this was dropped on. In INTERSECT mode, an array of dd items this >- * was dropped on. >- */ >- onDragDrop: function(e, id) { /* override this */ }, >- >- /** >- * Abstract method called when this item is dropped on an area with no >- * drop target >- * @method onInvalidDrop >- * @param {Event} e the mouseup event >- */ >- onInvalidDrop: function(e) { /* override this */ }, >- >- /** >- * Code that executes immediately before the endDrag event >- * @method b4EndDrag >- * @private >- */ >- b4EndDrag: function(e) { }, >- >- /** >- * Fired when we are done dragging the object >- * @method endDrag >- * @param {Event} e the mouseup event >- */ >- endDrag: function(e) { /* override this */ }, >- >- /** >- * Code executed immediately before the onMouseDown event >- * @method b4MouseDown >- * @param {Event} e the mousedown event >- * @private >- */ >- b4MouseDown: function(e) { }, >- >- /** >- * Event handler that fires when a drag/drop obj gets a mousedown >- * @method onMouseDown >- * @param {Event} e the mousedown event >- */ >- onMouseDown: function(e) { /* override this */ }, >- >- /** >- * Event handler that fires when a drag/drop obj gets a mouseup >- * @method onMouseUp >- * @param {Event} e the mouseup event >- */ >- onMouseUp: function(e) { /* override this */ }, >- >- /** >- * Override the onAvailable method to do what is needed after the initial >- * position was determined. >- * @method onAvailable >- */ >- onAvailable: function () { >- //this.logger.log("onAvailable (base)"); >- }, >- >- /** >- * Returns a reference to the linked element >- * @method getEl >- * @return {HTMLElement} the html element >- */ >- getEl: function() { >- if (!this._domRef) { >- this._domRef = Dom.get(this.id); >- } >- >- return this._domRef; >- }, >- >- /** >- * Returns a reference to the actual element to drag. By default this is >- * the same as the html element, but it can be assigned to another >- * element. An example of this can be found in YAHOO.util.DDProxy >- * @method getDragEl >- * @return {HTMLElement} the html element >- */ >- getDragEl: function() { >- return Dom.get(this.dragElId); >- }, >- >- /** >- * Sets up the DragDrop object. Must be called in the constructor of any >- * YAHOO.util.DragDrop subclass >- * @method init >- * @param id the id of the linked element >- * @param {String} sGroup the group of related items >- * @param {object} config configuration attributes >- */ >- init: function(id, sGroup, config) { >- this.initTarget(id, sGroup, config); >- Event.on(this._domRef || this.id, "mousedown", >- this.handleMouseDown, this, true); >- >- // Event.on(this.id, "selectstart", Event.preventDefault); >- for (var i in this.events) { >- this.createEvent(i + 'Event'); >- } >- >- }, >- >- /** >- * Initializes Targeting functionality only... the object does not >- * get a mousedown handler. >- * @method initTarget >- * @param id the id of the linked element >- * @param {String} sGroup the group of related items >- * @param {object} config configuration attributes >- */ >- initTarget: function(id, sGroup, config) { >- >- // configuration attributes >- this.config = config || {}; >- >- this.events = {}; >- >- // create a local reference to the drag and drop manager >- this.DDM = YAHOO.util.DDM; >- >- // initialize the groups object >- this.groups = {}; >- >- // assume that we have an element reference instead of an id if the >- // parameter is not a string >- if (typeof id !== "string") { >- YAHOO.log("id is not a string, assuming it is an HTMLElement"); >- this._domRef = id; >- id = Dom.generateId(id); >- } >- >- // set the id >- this.id = id; >- >- // add to an interaction group >- this.addToGroup((sGroup) ? sGroup : "default"); >- >- // We don't want to register this as the handle with the manager >- // so we just set the id rather than calling the setter. >- this.handleElId = id; >- >- Event.onAvailable(id, this.handleOnAvailable, this, true); >- >- // create a logger instance >- this.logger = (YAHOO.widget.LogWriter) ? >- new YAHOO.widget.LogWriter(this.toString()) : YAHOO; >- >- // the linked element is the element that gets dragged by default >- this.setDragElId(id); >- >- // by default, clicked anchors will not start drag operations. >- // @TODO what else should be here? Probably form fields. >- this.invalidHandleTypes = { A: "A" }; >- this.invalidHandleIds = {}; >- this.invalidHandleClasses = []; >- >- this.applyConfig(); >- }, >- >- /** >- * Applies the configuration parameters that were passed into the constructor. >- * This is supposed to happen at each level through the inheritance chain. So >- * a DDProxy implentation will execute apply config on DDProxy, DD, and >- * DragDrop in order to get all of the parameters that are available in >- * each object. >- * @method applyConfig >- */ >- applyConfig: function() { >- this.events = { >- mouseDown: true, >- b4MouseDown: true, >- mouseUp: true, >- b4StartDrag: true, >- startDrag: true, >- b4EndDrag: true, >- endDrag: true, >- drag: true, >- b4Drag: true, >- invalidDrop: true, >- b4DragOut: true, >- dragOut: true, >- dragEnter: true, >- b4DragOver: true, >- dragOver: true, >- b4DragDrop: true, >- dragDrop: true >- }; >- >- if (this.config.events) { >- for (var i in this.config.events) { >- if (this.config.events[i] === false) { >- this.events[i] = false; >- } >- } >- } >- >- >- // configurable properties: >- // padding, isTarget, maintainOffset, primaryButtonOnly >- this.padding = this.config.padding || [0, 0, 0, 0]; >- this.isTarget = (this.config.isTarget !== false); >- this.maintainOffset = (this.config.maintainOffset); >- this.primaryButtonOnly = (this.config.primaryButtonOnly !== false); >- this.dragOnly = ((this.config.dragOnly === true) ? true : false); >- this.useShim = ((this.config.useShim === true) ? true : false); >- }, >- >- /** >- * Executed when the linked element is available >- * @method handleOnAvailable >- * @private >- */ >- handleOnAvailable: function() { >- //this.logger.log("handleOnAvailable"); >- this.available = true; >- this.resetConstraints(); >- this.onAvailable(); >- }, >- >- /** >- * Configures the padding for the target zone in px. Effectively expands >- * (or reduces) the virtual object size for targeting calculations. >- * Supports css-style shorthand; if only one parameter is passed, all sides >- * will have that padding, and if only two are passed, the top and bottom >- * will have the first param, the left and right the second. >- * @method setPadding >- * @param {int} iTop Top pad >- * @param {int} iRight Right pad >- * @param {int} iBot Bot pad >- * @param {int} iLeft Left pad >- */ >- setPadding: function(iTop, iRight, iBot, iLeft) { >- // this.padding = [iLeft, iRight, iTop, iBot]; >- if (!iRight && 0 !== iRight) { >- this.padding = [iTop, iTop, iTop, iTop]; >- } else if (!iBot && 0 !== iBot) { >- this.padding = [iTop, iRight, iTop, iRight]; >- } else { >- this.padding = [iTop, iRight, iBot, iLeft]; >- } >- }, >- >- /** >- * Stores the initial placement of the linked element. >- * @method setInitialPosition >- * @param {int} diffX the X offset, default 0 >- * @param {int} diffY the Y offset, default 0 >- * @private >- */ >- setInitPosition: function(diffX, diffY) { >- var el = this.getEl(); >- >- if (!this.DDM.verifyEl(el)) { >- if (el && el.style && (el.style.display == 'none')) { >- this.logger.log(this.id + " can not get initial position, element style is display: none"); >- } else { >- this.logger.log(this.id + " element is broken"); >- } >- return; >- } >- >- var dx = diffX || 0; >- var dy = diffY || 0; >- >- var p = Dom.getXY( el ); >- >- this.initPageX = p[0] - dx; >- this.initPageY = p[1] - dy; >- >- this.lastPageX = p[0]; >- this.lastPageY = p[1]; >- >- this.logger.log(this.id + " initial position: " + this.initPageX + >- ", " + this.initPageY); >- >- >- this.setStartPosition(p); >- }, >- >- /** >- * Sets the start position of the element. This is set when the obj >- * is initialized, the reset when a drag is started. >- * @method setStartPosition >- * @param pos current position (from previous lookup) >- * @private >- */ >- setStartPosition: function(pos) { >- var p = pos || Dom.getXY(this.getEl()); >- >- this.deltaSetXY = null; >- >- this.startPageX = p[0]; >- this.startPageY = p[1]; >- }, >- >- /** >- * Add this instance to a group of related drag/drop objects. All >- * instances belong to at least one group, and can belong to as many >- * groups as needed. >- * @method addToGroup >- * @param sGroup {string} the name of the group >- */ >- addToGroup: function(sGroup) { >- this.groups[sGroup] = true; >- this.DDM.regDragDrop(this, sGroup); >- }, >- >- /** >- * Remove's this instance from the supplied interaction group >- * @method removeFromGroup >- * @param {string} sGroup The group to drop >- */ >- removeFromGroup: function(sGroup) { >- this.logger.log("Removing from group: " + sGroup); >- if (this.groups[sGroup]) { >- delete this.groups[sGroup]; >- } >- >- this.DDM.removeDDFromGroup(this, sGroup); >- }, >- >- /** >- * Allows you to specify that an element other than the linked element >- * will be moved with the cursor during a drag >- * @method setDragElId >- * @param id {string} the id of the element that will be used to initiate the drag >- */ >- setDragElId: function(id) { >- this.dragElId = id; >- }, >- >- /** >- * Allows you to specify a child of the linked element that should be >- * used to initiate the drag operation. An example of this would be if >- * you have a content div with text and links. Clicking anywhere in the >- * content area would normally start the drag operation. Use this method >- * to specify that an element inside of the content div is the element >- * that starts the drag operation. >- * @method setHandleElId >- * @param id {string} the id of the element that will be used to >- * initiate the drag. >- */ >- setHandleElId: function(id) { >- if (typeof id !== "string") { >- YAHOO.log("id is not a string, assuming it is an HTMLElement"); >- id = Dom.generateId(id); >- } >- this.handleElId = id; >- this.DDM.regHandle(this.id, id); >- }, >- >- /** >- * Allows you to set an element outside of the linked element as a drag >- * handle >- * @method setOuterHandleElId >- * @param id the id of the element that will be used to initiate the drag >- */ >- setOuterHandleElId: function(id) { >- if (typeof id !== "string") { >- YAHOO.log("id is not a string, assuming it is an HTMLElement"); >- id = Dom.generateId(id); >- } >- this.logger.log("Adding outer handle event: " + id); >- Event.on(id, "mousedown", >- this.handleMouseDown, this, true); >- this.setHandleElId(id); >- >- this.hasOuterHandles = true; >- }, >- >- /** >- * Remove all drag and drop hooks for this element >- * @method unreg >- */ >- unreg: function() { >- this.logger.log("DragDrop obj cleanup " + this.id); >- Event.removeListener(this.id, "mousedown", >- this.handleMouseDown); >- this._domRef = null; >- this.DDM._remove(this); >- }, >- >- /** >- * Returns true if this instance is locked, or the drag drop mgr is locked >- * (meaning that all drag/drop is disabled on the page.) >- * @method isLocked >- * @return {boolean} true if this obj or all drag/drop is locked, else >- * false >- */ >- isLocked: function() { >- return (this.DDM.isLocked() || this.locked); >- }, >- >- /** >- * Fired when this object is clicked >- * @method handleMouseDown >- * @param {Event} e >- * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj) >- * @private >- */ >- handleMouseDown: function(e, oDD) { >- >- var button = e.which || e.button; >- this.logger.log("button: " + button); >- >- if (this.primaryButtonOnly && button > 1) { >- this.logger.log("Mousedown was not produced by the primary button"); >- return; >- } >- >- if (this.isLocked()) { >- this.logger.log("Drag and drop is disabled, aborting"); >- return; >- } >- >- this.logger.log("mousedown " + this.id); >- >- this.logger.log("firing onMouseDown events"); >- >- // firing the mousedown events prior to calculating positions >- var b4Return = this.b4MouseDown(e), >- b4Return2 = true; >- >- if (this.events.b4MouseDown) { >- b4Return2 = this.fireEvent('b4MouseDownEvent', e); >- } >- var mDownReturn = this.onMouseDown(e), >- mDownReturn2 = true; >- if (this.events.mouseDown) { >- mDownReturn2 = this.fireEvent('mouseDownEvent', e); >- } >- >- if ((b4Return === false) || (mDownReturn === false) || (b4Return2 === false) || (mDownReturn2 === false)) { >- this.logger.log('b4MouseDown or onMouseDown returned false, exiting drag'); >- return; >- } >- >- this.DDM.refreshCache(this.groups); >- // var self = this; >- // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0); >- >- // Only process the event if we really clicked within the linked >- // element. The reason we make this check is that in the case that >- // another element was moved between the clicked element and the >- // cursor in the time between the mousedown and mouseup events. When >- // this happens, the element gets the next mousedown event >- // regardless of where on the screen it happened. >- var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e)); >- if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) { >- this.logger.log("Click was not over the element: " + this.id); >- } else { >- if (this.clickValidator(e)) { >- >- this.logger.log("click was a valid handle"); >- >- // set the initial element position >- this.setStartPosition(); >- >- // start tracking mousemove distance and mousedown time to >- // determine when to start the actual drag >- this.DDM.handleMouseDown(e, this); >- >- // this mousedown is mine >- this.DDM.stopEvent(e); >- } else { >- >-this.logger.log("clickValidator returned false, drag not initiated"); >- >- } >- } >- }, >- >- /** >- * @method clickValidator >- * @description Method validates that the clicked element >- * was indeed the handle or a valid child of the handle >- * @param {Event} e >- */ >- clickValidator: function(e) { >- var target = YAHOO.util.Event.getTarget(e); >- return ( this.isValidHandleChild(target) && >- (this.id == this.handleElId || >- this.DDM.handleWasClicked(target, this.id)) ); >- }, >- >- /** >- * Finds the location the element should be placed if we want to move >- * it to where the mouse location less the click offset would place us. >- * @method getTargetCoord >- * @param {int} iPageX the X coordinate of the click >- * @param {int} iPageY the Y coordinate of the click >- * @return an object that contains the coordinates (Object.x and Object.y) >- * @private >- */ >- getTargetCoord: function(iPageX, iPageY) { >- >- // this.logger.log("getTargetCoord: " + iPageX + ", " + iPageY); >- >- var x = iPageX - this.deltaX; >- var y = iPageY - this.deltaY; >- >- if (this.constrainX) { >- if (x < this.minX) { x = this.minX; } >- if (x > this.maxX) { x = this.maxX; } >- } >- >- if (this.constrainY) { >- if (y < this.minY) { y = this.minY; } >- if (y > this.maxY) { y = this.maxY; } >- } >- >- x = this.getTick(x, this.xTicks); >- y = this.getTick(y, this.yTicks); >- >- // this.logger.log("getTargetCoord " + >- // " iPageX: " + iPageX + >- // " iPageY: " + iPageY + >- // " x: " + x + ", y: " + y); >- >- return {x:x, y:y}; >- }, >- >- /** >- * Allows you to specify a tag name that should not start a drag operation >- * when clicked. This is designed to facilitate embedding links within a >- * drag handle that do something other than start the drag. >- * @method addInvalidHandleType >- * @param {string} tagName the type of element to exclude >- */ >- addInvalidHandleType: function(tagName) { >- var type = tagName.toUpperCase(); >- this.invalidHandleTypes[type] = type; >- }, >- >- /** >- * Lets you to specify an element id for a child of a drag handle >- * that should not initiate a drag >- * @method addInvalidHandleId >- * @param {string} id the element id of the element you wish to ignore >- */ >- addInvalidHandleId: function(id) { >- if (typeof id !== "string") { >- YAHOO.log("id is not a string, assuming it is an HTMLElement"); >- id = Dom.generateId(id); >- } >- this.invalidHandleIds[id] = id; >- }, >- >- >- /** >- * Lets you specify a css class of elements that will not initiate a drag >- * @method addInvalidHandleClass >- * @param {string} cssClass the class of the elements you wish to ignore >- */ >- addInvalidHandleClass: function(cssClass) { >- this.invalidHandleClasses.push(cssClass); >- }, >- >- /** >- * Unsets an excluded tag name set by addInvalidHandleType >- * @method removeInvalidHandleType >- * @param {string} tagName the type of element to unexclude >- */ >- removeInvalidHandleType: function(tagName) { >- var type = tagName.toUpperCase(); >- // this.invalidHandleTypes[type] = null; >- delete this.invalidHandleTypes[type]; >- }, >- >- /** >- * Unsets an invalid handle id >- * @method removeInvalidHandleId >- * @param {string} id the id of the element to re-enable >- */ >- removeInvalidHandleId: function(id) { >- if (typeof id !== "string") { >- YAHOO.log("id is not a string, assuming it is an HTMLElement"); >- id = Dom.generateId(id); >- } >- delete this.invalidHandleIds[id]; >- }, >- >- /** >- * Unsets an invalid css class >- * @method removeInvalidHandleClass >- * @param {string} cssClass the class of the element(s) you wish to >- * re-enable >- */ >- removeInvalidHandleClass: function(cssClass) { >- for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) { >- if (this.invalidHandleClasses[i] == cssClass) { >- delete this.invalidHandleClasses[i]; >- } >- } >- }, >- >- /** >- * Checks the tag exclusion list to see if this click should be ignored >- * @method isValidHandleChild >- * @param {HTMLElement} node the HTMLElement to evaluate >- * @return {boolean} true if this is a valid tag type, false if not >- */ >- isValidHandleChild: function(node) { >- >- var valid = true; >- // var n = (node.nodeName == "#text") ? node.parentNode : node; >- var nodeName; >- try { >- nodeName = node.nodeName.toUpperCase(); >- } catch(e) { >- nodeName = node.nodeName; >- } >- valid = valid && !this.invalidHandleTypes[nodeName]; >- valid = valid && !this.invalidHandleIds[node.id]; >- >- for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) { >- valid = !Dom.hasClass(node, this.invalidHandleClasses[i]); >- } >- >- this.logger.log("Valid handle? ... " + valid); >- >- return valid; >- >- }, >- >- /** >- * Create the array of horizontal tick marks if an interval was specified >- * in setXConstraint(). >- * @method setXTicks >- * @private >- */ >- setXTicks: function(iStartX, iTickSize) { >- this.xTicks = []; >- this.xTickSize = iTickSize; >- >- var tickMap = {}; >- >- for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) { >- if (!tickMap[i]) { >- this.xTicks[this.xTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) { >- if (!tickMap[i]) { >- this.xTicks[this.xTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- this.xTicks.sort(this.DDM.numericSort) ; >- this.logger.log("xTicks: " + this.xTicks.join()); >- }, >- >- /** >- * Create the array of vertical tick marks if an interval was specified in >- * setYConstraint(). >- * @method setYTicks >- * @private >- */ >- setYTicks: function(iStartY, iTickSize) { >- // this.logger.log("setYTicks: " + iStartY + ", " + iTickSize >- // + ", " + this.initPageY + ", " + this.minY + ", " + this.maxY ); >- this.yTicks = []; >- this.yTickSize = iTickSize; >- >- var tickMap = {}; >- >- for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) { >- if (!tickMap[i]) { >- this.yTicks[this.yTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) { >- if (!tickMap[i]) { >- this.yTicks[this.yTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- this.yTicks.sort(this.DDM.numericSort) ; >- this.logger.log("yTicks: " + this.yTicks.join()); >- }, >- >- /** >- * By default, the element can be dragged any place on the screen. Use >- * this method to limit the horizontal travel of the element. Pass in >- * 0,0 for the parameters if you want to lock the drag to the y axis. >- * @method setXConstraint >- * @param {int} iLeft the number of pixels the element can move to the left >- * @param {int} iRight the number of pixels the element can move to the >- * right >- * @param {int} iTickSize optional parameter for specifying that the >- * element >- * should move iTickSize pixels at a time. >- */ >- setXConstraint: function(iLeft, iRight, iTickSize) { >- this.leftConstraint = parseInt(iLeft, 10); >- this.rightConstraint = parseInt(iRight, 10); >- >- this.minX = this.initPageX - this.leftConstraint; >- this.maxX = this.initPageX + this.rightConstraint; >- if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); } >- >- this.constrainX = true; >- this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX + >- " maxX:" + this.maxX); >- }, >- >- /** >- * Clears any constraints applied to this instance. Also clears ticks >- * since they can't exist independent of a constraint at this time. >- * @method clearConstraints >- */ >- clearConstraints: function() { >- this.logger.log("Clearing constraints"); >- this.constrainX = false; >- this.constrainY = false; >- this.clearTicks(); >- }, >- >- /** >- * Clears any tick interval defined for this instance >- * @method clearTicks >- */ >- clearTicks: function() { >- this.logger.log("Clearing ticks"); >- this.xTicks = null; >- this.yTicks = null; >- this.xTickSize = 0; >- this.yTickSize = 0; >- }, >- >- /** >- * By default, the element can be dragged any place on the screen. Set >- * this to limit the vertical travel of the element. Pass in 0,0 for the >- * parameters if you want to lock the drag to the x axis. >- * @method setYConstraint >- * @param {int} iUp the number of pixels the element can move up >- * @param {int} iDown the number of pixels the element can move down >- * @param {int} iTickSize optional parameter for specifying that the >- * element should move iTickSize pixels at a time. >- */ >- setYConstraint: function(iUp, iDown, iTickSize) { >- this.logger.log("setYConstraint: " + iUp + "," + iDown + "," + iTickSize); >- this.topConstraint = parseInt(iUp, 10); >- this.bottomConstraint = parseInt(iDown, 10); >- >- this.minY = this.initPageY - this.topConstraint; >- this.maxY = this.initPageY + this.bottomConstraint; >- if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); } >- >- this.constrainY = true; >- >- this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY + >- " maxY:" + this.maxY); >- }, >- >- /** >- * resetConstraints must be called if you manually reposition a dd element. >- * @method resetConstraints >- */ >- resetConstraints: function() { >- >- //this.logger.log("resetConstraints"); >- >- // Maintain offsets if necessary >- if (this.initPageX || this.initPageX === 0) { >- //this.logger.log("init pagexy: " + this.initPageX + ", " + >- //this.initPageY); >- //this.logger.log("last pagexy: " + this.lastPageX + ", " + >- //this.lastPageY); >- // figure out how much this thing has moved >- var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0; >- var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0; >- >- this.setInitPosition(dx, dy); >- >- // This is the first time we have detected the element's position >- } else { >- this.setInitPosition(); >- } >- >- if (this.constrainX) { >- this.setXConstraint( this.leftConstraint, >- this.rightConstraint, >- this.xTickSize ); >- } >- >- if (this.constrainY) { >- this.setYConstraint( this.topConstraint, >- this.bottomConstraint, >- this.yTickSize ); >- } >- }, >- >- /** >- * Normally the drag element is moved pixel by pixel, but we can specify >- * that it move a number of pixels at a time. This method resolves the >- * location when we have it set up like this. >- * @method getTick >- * @param {int} val where we want to place the object >- * @param {int[]} tickArray sorted array of valid points >- * @return {int} the closest tick >- * @private >- */ >- getTick: function(val, tickArray) { >- >- if (!tickArray) { >- // If tick interval is not defined, it is effectively 1 pixel, >- // so we return the value passed to us. >- return val; >- } else if (tickArray[0] >= val) { >- // The value is lower than the first tick, so we return the first >- // tick. >- return tickArray[0]; >- } else { >- for (var i=0, len=tickArray.length; i<len; ++i) { >- var next = i + 1; >- if (tickArray[next] && tickArray[next] >= val) { >- var diff1 = val - tickArray[i]; >- var diff2 = tickArray[next] - val; >- return (diff2 > diff1) ? tickArray[i] : tickArray[next]; >- } >- } >- >- // The value is larger than the last tick, so we return the last >- // tick. >- return tickArray[tickArray.length - 1]; >- } >- }, >- >- /** >- * toString method >- * @method toString >- * @return {string} string representation of the dd obj >- */ >- toString: function() { >- return ("DragDrop " + this.id); >- } >- >-}; >-YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider); >- >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-})(); >-/** >- * A DragDrop implementation where the linked element follows the >- * mouse cursor during a drag. >- * @class DD >- * @extends YAHOO.util.DragDrop >- * @constructor >- * @param {String} id the id of the linked element >- * @param {String} sGroup the group of related DragDrop items >- * @param {object} config an object containing configurable attributes >- * Valid properties for DD: >- * scroll >- */ >-YAHOO.util.DD = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- } >-}; >- >-YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, { >- >- /** >- * When set to true, the utility automatically tries to scroll the browser >- * window when a drag and drop element is dragged near the viewport boundary. >- * Defaults to true. >- * @property scroll >- * @type boolean >- */ >- scroll: true, >- >- /** >- * Sets the pointer offset to the distance between the linked element's top >- * left corner and the location the element was clicked >- * @method autoOffset >- * @param {int} iPageX the X coordinate of the click >- * @param {int} iPageY the Y coordinate of the click >- */ >- autoOffset: function(iPageX, iPageY) { >- var x = iPageX - this.startPageX; >- var y = iPageY - this.startPageY; >- this.setDelta(x, y); >- // this.logger.log("autoOffset el pos: " + aCoord + ", delta: " + x + "," + y); >- }, >- >- /** >- * Sets the pointer offset. You can call this directly to force the >- * offset to be in a particular location (e.g., pass in 0,0 to set it >- * to the center of the object, as done in YAHOO.widget.Slider) >- * @method setDelta >- * @param {int} iDeltaX the distance from the left >- * @param {int} iDeltaY the distance from the top >- */ >- setDelta: function(iDeltaX, iDeltaY) { >- this.deltaX = iDeltaX; >- this.deltaY = iDeltaY; >- this.logger.log("deltaX:" + this.deltaX + ", deltaY:" + this.deltaY); >- }, >- >- /** >- * Sets the drag element to the location of the mousedown or click event, >- * maintaining the cursor location relative to the location on the element >- * that was clicked. Override this if you want to place the element in a >- * location other than where the cursor is. >- * @method setDragElPos >- * @param {int} iPageX the X coordinate of the mousedown or drag event >- * @param {int} iPageY the Y coordinate of the mousedown or drag event >- */ >- setDragElPos: function(iPageX, iPageY) { >- // the first time we do this, we are going to check to make sure >- // the element has css positioning >- >- var el = this.getDragEl(); >- this.alignElWithMouse(el, iPageX, iPageY); >- }, >- >- /** >- * Sets the element to the location of the mousedown or click event, >- * maintaining the cursor location relative to the location on the element >- * that was clicked. Override this if you want to place the element in a >- * location other than where the cursor is. >- * @method alignElWithMouse >- * @param {HTMLElement} el the element to move >- * @param {int} iPageX the X coordinate of the mousedown or drag event >- * @param {int} iPageY the Y coordinate of the mousedown or drag event >- */ >- alignElWithMouse: function(el, iPageX, iPageY) { >- var oCoord = this.getTargetCoord(iPageX, iPageY); >- // this.logger.log("****alignElWithMouse : " + el.id + ", " + aCoord + ", " + el.style.display); >- >- if (!this.deltaSetXY) { >- var aCoord = [oCoord.x, oCoord.y]; >- YAHOO.util.Dom.setXY(el, aCoord); >- >- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); >- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); >- >- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ]; >- } else { >- YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px"); >- YAHOO.util.Dom.setStyle(el, "top", (oCoord.y + this.deltaSetXY[1]) + "px"); >- } >- >- this.cachePosition(oCoord.x, oCoord.y); >- var self = this; >- setTimeout(function() { >- self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth); >- }, 0); >- }, >- >- /** >- * Saves the most recent position so that we can reset the constraints and >- * tick marks on-demand. We need to know this so that we can calculate the >- * number of pixels the element is offset from its original position. >- * @method cachePosition >- * @param iPageX the current x position (optional, this just makes it so we >- * don't have to look it up again) >- * @param iPageY the current y position (optional, this just makes it so we >- * don't have to look it up again) >- */ >- cachePosition: function(iPageX, iPageY) { >- if (iPageX) { >- this.lastPageX = iPageX; >- this.lastPageY = iPageY; >- } else { >- var aCoord = YAHOO.util.Dom.getXY(this.getEl()); >- this.lastPageX = aCoord[0]; >- this.lastPageY = aCoord[1]; >- } >- }, >- >- /** >- * Auto-scroll the window if the dragged object has been moved beyond the >- * visible window boundary. >- * @method autoScroll >- * @param {int} x the drag element's x position >- * @param {int} y the drag element's y position >- * @param {int} h the height of the drag element >- * @param {int} w the width of the drag element >- * @private >- */ >- autoScroll: function(x, y, h, w) { >- >- if (this.scroll) { >- // The client height >- var clientH = this.DDM.getClientHeight(); >- >- // The client width >- var clientW = this.DDM.getClientWidth(); >- >- // The amt scrolled down >- var st = this.DDM.getScrollTop(); >- >- // The amt scrolled right >- var sl = this.DDM.getScrollLeft(); >- >- // Location of the bottom of the element >- var bot = h + y; >- >- // Location of the right of the element >- var right = w + x; >- >- // The distance from the cursor to the bottom of the visible area, >- // adjusted so that we don't scroll if the cursor is beyond the >- // element drag constraints >- var toBot = (clientH + st - y - this.deltaY); >- >- // The distance from the cursor to the right of the visible area >- var toRight = (clientW + sl - x - this.deltaX); >- >- // this.logger.log( " x: " + x + " y: " + y + " h: " + h + >- // " clientH: " + clientH + " clientW: " + clientW + >- // " st: " + st + " sl: " + sl + " bot: " + bot + >- // " right: " + right + " toBot: " + toBot + " toRight: " + toRight); >- >- // How close to the edge the cursor must be before we scroll >- // var thresh = (document.all) ? 100 : 40; >- var thresh = 40; >- >- // How many pixels to scroll per autoscroll op. This helps to reduce >- // clunky scrolling. IE is more sensitive about this ... it needs this >- // value to be higher. >- var scrAmt = (document.all) ? 80 : 30; >- >- // Scroll down if we are near the bottom of the visible page and the >- // obj extends below the crease >- if ( bot > clientH && toBot < thresh ) { >- window.scrollTo(sl, st + scrAmt); >- } >- >- // Scroll up if the window is scrolled down and the top of the object >- // goes above the top border >- if ( y < st && st > 0 && y - st < thresh ) { >- window.scrollTo(sl, st - scrAmt); >- } >- >- // Scroll right if the obj is beyond the right border and the cursor is >- // near the border. >- if ( right > clientW && toRight < thresh ) { >- window.scrollTo(sl + scrAmt, st); >- } >- >- // Scroll left if the window has been scrolled to the right and the obj >- // extends past the left border >- if ( x < sl && sl > 0 && x - sl < thresh ) { >- window.scrollTo(sl - scrAmt, st); >- } >- } >- }, >- >- /* >- * Sets up config options specific to this class. Overrides >- * YAHOO.util.DragDrop, but all versions of this method through the >- * inheritance chain are called >- */ >- applyConfig: function() { >- YAHOO.util.DD.superclass.applyConfig.call(this); >- this.scroll = (this.config.scroll !== false); >- }, >- >- /* >- * Event that fires prior to the onMouseDown event. Overrides >- * YAHOO.util.DragDrop. >- */ >- b4MouseDown: function(e) { >- this.setStartPosition(); >- // this.resetConstraints(); >- this.autoOffset(YAHOO.util.Event.getPageX(e), >- YAHOO.util.Event.getPageY(e)); >- }, >- >- /* >- * Event that fires prior to the onDrag event. Overrides >- * YAHOO.util.DragDrop. >- */ >- b4Drag: function(e) { >- this.setDragElPos(YAHOO.util.Event.getPageX(e), >- YAHOO.util.Event.getPageY(e)); >- }, >- >- toString: function() { >- return ("DD " + this.id); >- } >- >- ////////////////////////////////////////////////////////////////////////// >- // Debugging ygDragDrop events that can be overridden >- ////////////////////////////////////////////////////////////////////////// >- /* >- startDrag: function(x, y) { >- this.logger.log(this.id.toString() + " startDrag"); >- }, >- >- onDrag: function(e) { >- this.logger.log(this.id.toString() + " onDrag"); >- }, >- >- onDragEnter: function(e, id) { >- this.logger.log(this.id.toString() + " onDragEnter: " + id); >- }, >- >- onDragOver: function(e, id) { >- this.logger.log(this.id.toString() + " onDragOver: " + id); >- }, >- >- onDragOut: function(e, id) { >- this.logger.log(this.id.toString() + " onDragOut: " + id); >- }, >- >- onDragDrop: function(e, id) { >- this.logger.log(this.id.toString() + " onDragDrop: " + id); >- }, >- >- endDrag: function(e) { >- this.logger.log(this.id.toString() + " endDrag"); >- } >- >- */ >- >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-}); >-/** >- * A DragDrop implementation that inserts an empty, bordered div into >- * the document that follows the cursor during drag operations. At the time of >- * the click, the frame div is resized to the dimensions of the linked html >- * element, and moved to the exact location of the linked element. >- * >- * References to the "frame" element refer to the single proxy element that >- * was created to be dragged in place of all DDProxy elements on the >- * page. >- * >- * @class DDProxy >- * @extends YAHOO.util.DD >- * @constructor >- * @param {String} id the id of the linked html element >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DDProxy in addition to those in DragDrop: >- * resizeFrame, centerFrame, dragElId >- */ >-YAHOO.util.DDProxy = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- this.initFrame(); >- } >-}; >- >-/** >- * The default drag frame div id >- * @property YAHOO.util.DDProxy.dragElId >- * @type String >- * @static >- */ >-YAHOO.util.DDProxy.dragElId = "ygddfdiv"; >- >-YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, { >- >- /** >- * By default we resize the drag frame to be the same size as the element >- * we want to drag (this is to get the frame effect). We can turn it off >- * if we want a different behavior. >- * @property resizeFrame >- * @type boolean >- */ >- resizeFrame: true, >- >- /** >- * By default the frame is positioned exactly where the drag element is, so >- * we use the cursor offset provided by YAHOO.util.DD. Another option that works only if >- * you do not have constraints on the obj is to have the drag frame centered >- * around the cursor. Set centerFrame to true for this effect. >- * @property centerFrame >- * @type boolean >- */ >- centerFrame: false, >- >- /** >- * Creates the proxy element if it does not yet exist >- * @method createFrame >- */ >- createFrame: function() { >- var self=this, body=document.body; >- >- if (!body || !body.firstChild) { >- setTimeout( function() { self.createFrame(); }, 50 ); >- return; >- } >- >- var div=this.getDragEl(), Dom=YAHOO.util.Dom; >- >- if (!div) { >- div = document.createElement("div"); >- div.id = this.dragElId; >- var s = div.style; >- >- s.position = "absolute"; >- s.visibility = "hidden"; >- s.cursor = "move"; >- s.border = "2px solid #aaa"; >- s.zIndex = 999; >- s.height = "25px"; >- s.width = "25px"; >- >- var _data = document.createElement('div'); >- Dom.setStyle(_data, 'height', '100%'); >- Dom.setStyle(_data, 'width', '100%'); >- /** >- * If the proxy element has no background-color, then it is considered to the "transparent" by Internet Explorer. >- * Since it is "transparent" then the events pass through it to the iframe below. >- * So creating a "fake" div inside the proxy element and giving it a background-color, then setting it to an >- * opacity of 0, it appears to not be there, however IE still thinks that it is so the events never pass through. >- */ >- Dom.setStyle(_data, 'background-color', '#ccc'); >- Dom.setStyle(_data, 'opacity', '0'); >- div.appendChild(_data); >- >- // appendChild can blow up IE if invoked prior to the window load event >- // while rendering a table. It is possible there are other scenarios >- // that would cause this to happen as well. >- body.insertBefore(div, body.firstChild); >- } >- }, >- >- /** >- * Initialization for the drag frame element. Must be called in the >- * constructor of all subclasses >- * @method initFrame >- */ >- initFrame: function() { >- this.createFrame(); >- }, >- >- applyConfig: function() { >- //this.logger.log("DDProxy applyConfig"); >- YAHOO.util.DDProxy.superclass.applyConfig.call(this); >- >- this.resizeFrame = (this.config.resizeFrame !== false); >- this.centerFrame = (this.config.centerFrame); >- this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId); >- }, >- >- /** >- * Resizes the drag frame to the dimensions of the clicked object, positions >- * it over the object, and finally displays it >- * @method showFrame >- * @param {int} iPageX X click position >- * @param {int} iPageY Y click position >- * @private >- */ >- showFrame: function(iPageX, iPageY) { >- var el = this.getEl(); >- var dragEl = this.getDragEl(); >- var s = dragEl.style; >- >- this._resizeProxy(); >- >- if (this.centerFrame) { >- this.setDelta( Math.round(parseInt(s.width, 10)/2), >- Math.round(parseInt(s.height, 10)/2) ); >- } >- >- this.setDragElPos(iPageX, iPageY); >- >- YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); >- }, >- >- /** >- * The proxy is automatically resized to the dimensions of the linked >- * element when a drag is initiated, unless resizeFrame is set to false >- * @method _resizeProxy >- * @private >- */ >- _resizeProxy: function() { >- if (this.resizeFrame) { >- var DOM = YAHOO.util.Dom; >- var el = this.getEl(); >- var dragEl = this.getDragEl(); >- >- var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth" ), 10); >- var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth" ), 10); >- var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10); >- var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth" ), 10); >- >- if (isNaN(bt)) { bt = 0; } >- if (isNaN(br)) { br = 0; } >- if (isNaN(bb)) { bb = 0; } >- if (isNaN(bl)) { bl = 0; } >- >- this.logger.log("proxy size: " + bt + " " + br + " " + bb + " " + bl); >- >- var newWidth = Math.max(0, el.offsetWidth - br - bl); >- var newHeight = Math.max(0, el.offsetHeight - bt - bb); >- >- this.logger.log("Resizing proxy element"); >- >- DOM.setStyle( dragEl, "width", newWidth + "px" ); >- DOM.setStyle( dragEl, "height", newHeight + "px" ); >- } >- }, >- >- // overrides YAHOO.util.DragDrop >- b4MouseDown: function(e) { >- this.setStartPosition(); >- var x = YAHOO.util.Event.getPageX(e); >- var y = YAHOO.util.Event.getPageY(e); >- this.autoOffset(x, y); >- >- // This causes the autoscroll code to kick off, which means autoscroll can >- // happen prior to the check for a valid drag handle. >- // this.setDragElPos(x, y); >- }, >- >- // overrides YAHOO.util.DragDrop >- b4StartDrag: function(x, y) { >- // show the drag frame >- this.logger.log("start drag show frame, x: " + x + ", y: " + y); >- this.showFrame(x, y); >- }, >- >- // overrides YAHOO.util.DragDrop >- b4EndDrag: function(e) { >- this.logger.log(this.id + " b4EndDrag"); >- YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); >- }, >- >- // overrides YAHOO.util.DragDrop >- // By default we try to move the element to the last location of the frame. >- // This is so that the default behavior mirrors that of YAHOO.util.DD. >- endDrag: function(e) { >- var DOM = YAHOO.util.Dom; >- this.logger.log(this.id + " endDrag"); >- var lel = this.getEl(); >- var del = this.getDragEl(); >- >- // Show the drag frame briefly so we can get its position >- // del.style.visibility = ""; >- DOM.setStyle(del, "visibility", ""); >- >- // Hide the linked element before the move to get around a Safari >- // rendering bug. >- //lel.style.visibility = "hidden"; >- DOM.setStyle(lel, "visibility", "hidden"); >- YAHOO.util.DDM.moveToEl(lel, del); >- //del.style.visibility = "hidden"; >- DOM.setStyle(del, "visibility", "hidden"); >- //lel.style.visibility = ""; >- DOM.setStyle(lel, "visibility", ""); >- }, >- >- toString: function() { >- return ("DDProxy " + this.id); >- } >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-}); >-/** >- * A DragDrop implementation that does not move, but can be a drop >- * target. You would get the same result by simply omitting implementation >- * for the event callbacks, but this way we reduce the processing cost of the >- * event listener and the callbacks. >- * @class DDTarget >- * @extends YAHOO.util.DragDrop >- * @constructor >- * @param {String} id the id of the element that is a drop target >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DDTarget in addition to those in >- * DragDrop: >- * none >- */ >-YAHOO.util.DDTarget = function(id, sGroup, config) { >- if (id) { >- this.initTarget(id, sGroup, config); >- } >-}; >- >-// YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop(); >-YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, { >- toString: function() { >- return ("DDTarget " + this.id); >- } >-}); >-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-min.js b/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-min.js >deleted file mode 100644 >index 1fc717c053..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop-min.js >+++ /dev/null >@@ -1,10 +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 >-*/ >-if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue; >-}if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id); >-}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D); >-}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop.js b/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop.js >deleted file mode 100644 >index af5f0cd58f..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/dragdrop/dragdrop.js >+++ /dev/null >@@ -1,3601 +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 >-*/ >-/** >- * The drag and drop utility provides a framework for building drag and drop >- * applications. In addition to enabling drag and drop for specific elements, >- * the drag and drop elements are tracked by the manager class, and the >- * interactions between the various elements are tracked during the drag and >- * the implementing code is notified about these important moments. >- * @module dragdrop >- * @title Drag and Drop >- * @requires yahoo,dom,event >- * @namespace YAHOO.util >- */ >- >-// Only load the library once. Rewriting the manager class would orphan >-// existing drag and drop instances. >-if (!YAHOO.util.DragDropMgr) { >- >-/** >- * DragDropMgr is a singleton that tracks the element interaction for >- * all DragDrop items in the window. Generally, you will not call >- * this class directly, but it does have helper methods that could >- * be useful in your DragDrop implementations. >- * @class DragDropMgr >- * @static >- */ >-YAHOO.util.DragDropMgr = function() { >- >- var Event = YAHOO.util.Event, >- Dom = YAHOO.util.Dom; >- >- return { >- /** >- * This property is used to turn on global use of the shim element on all DragDrop instances, defaults to false for backcompat. (Use: YAHOO.util.DDM.useShim = true) >- * @property useShim >- * @type Boolean >- * @static >- */ >- useShim: false, >- /** >- * This property is used to determine if the shim is active over the screen, default false. >- * @private >- * @property _shimActive >- * @type Boolean >- * @static >- */ >- _shimActive: false, >- /** >- * This property is used when useShim is set on a DragDrop object to store the current state of DDM.useShim so it can be reset when a drag operation is done. >- * @private >- * @property _shimState >- * @type Boolean >- * @static >- */ >- _shimState: false, >- /** >- * This property is used when useShim is set to true, it will set the opacity on the shim to .5 for debugging. Use: (YAHOO.util.DDM._debugShim = true;) >- * @private >- * @property _debugShim >- * @type Boolean >- * @static >- */ >- _debugShim: false, >- /** >- * This method will create a shim element (giving it the id of yui-ddm-shim), it also attaches the mousemove and mouseup listeners to it and attaches a scroll listener on the window >- * @private >- * @method _sizeShim >- * @static >- */ >- _createShim: function() { >- var s = document.createElement('div'); >- s.id = 'yui-ddm-shim'; >- if (document.body.firstChild) { >- document.body.insertBefore(s, document.body.firstChild); >- } else { >- document.body.appendChild(s); >- } >- s.style.display = 'none'; >- s.style.backgroundColor = 'red'; >- s.style.position = 'absolute'; >- s.style.zIndex = '99999'; >- Dom.setStyle(s, 'opacity', '0'); >- this._shim = s; >- Event.on(s, "mouseup", this.handleMouseUp, this, true); >- Event.on(s, "mousemove", this.handleMouseMove, this, true); >- Event.on(window, 'scroll', this._sizeShim, this, true); >- }, >- /** >- * This method will size the shim, called from activate and on window scroll event >- * @private >- * @method _sizeShim >- * @static >- */ >- _sizeShim: function() { >- if (this._shimActive) { >- var s = this._shim; >- s.style.height = Dom.getDocumentHeight() + 'px'; >- s.style.width = Dom.getDocumentWidth() + 'px'; >- s.style.top = '0'; >- s.style.left = '0'; >- } >- }, >- /** >- * This method will create the shim element if needed, then show the shim element, size the element and set the _shimActive property to true >- * @private >- * @method _activateShim >- * @static >- */ >- _activateShim: function() { >- if (this.useShim) { >- if (!this._shim) { >- this._createShim(); >- } >- this._shimActive = true; >- var s = this._shim, >- o = '0'; >- if (this._debugShim) { >- o = '.5'; >- } >- Dom.setStyle(s, 'opacity', o); >- this._sizeShim(); >- s.style.display = 'block'; >- } >- }, >- /** >- * This method will hide the shim element and set the _shimActive property to false >- * @private >- * @method _deactivateShim >- * @static >- */ >- _deactivateShim: function() { >- this._shim.style.display = 'none'; >- this._shimActive = false; >- }, >- /** >- * The HTML element created to use as a shim over the document to track mouse movements >- * @private >- * @property _shim >- * @type HTMLElement >- * @static >- */ >- _shim: null, >- /** >- * Two dimensional Array of registered DragDrop objects. The first >- * dimension is the DragDrop item group, the second the DragDrop >- * object. >- * @property ids >- * @type {string: string} >- * @private >- * @static >- */ >- ids: {}, >- >- /** >- * Array of element ids defined as drag handles. Used to determine >- * if the element that generated the mousedown event is actually the >- * handle and not the html element itself. >- * @property handleIds >- * @type {string: string} >- * @private >- * @static >- */ >- handleIds: {}, >- >- /** >- * the DragDrop object that is currently being dragged >- * @property dragCurrent >- * @type DragDrop >- * @private >- * @static >- **/ >- dragCurrent: null, >- >- /** >- * the DragDrop object(s) that are being hovered over >- * @property dragOvers >- * @type Array >- * @private >- * @static >- */ >- dragOvers: {}, >- >- /** >- * the X distance between the cursor and the object being dragged >- * @property deltaX >- * @type int >- * @private >- * @static >- */ >- deltaX: 0, >- >- /** >- * the Y distance between the cursor and the object being dragged >- * @property deltaY >- * @type int >- * @private >- * @static >- */ >- deltaY: 0, >- >- /** >- * Flag to determine if we should prevent the default behavior of the >- * events we define. By default this is true, but this can be set to >- * false if you need the default behavior (not recommended) >- * @property preventDefault >- * @type boolean >- * @static >- */ >- preventDefault: true, >- >- /** >- * Flag to determine if we should stop the propagation of the events >- * we generate. This is true by default but you may want to set it to >- * false if the html element contains other features that require the >- * mouse click. >- * @property stopPropagation >- * @type boolean >- * @static >- */ >- stopPropagation: true, >- >- /** >- * Internal flag that is set to true when drag and drop has been >- * initialized >- * @property initialized >- * @private >- * @static >- */ >- initialized: false, >- >- /** >- * All drag and drop can be disabled. >- * @property locked >- * @private >- * @static >- */ >- locked: false, >- >- /** >- * Provides additional information about the current set of >- * interactions. Can be accessed from the event handlers. It >- * contains the following properties: >- * >- * out: onDragOut interactions >- * enter: onDragEnter interactions >- * over: onDragOver interactions >- * drop: onDragDrop interactions >- * point: The location of the cursor >- * draggedRegion: The location of dragged element at the time >- * of the interaction >- * sourceRegion: The location of the source elemtn at the time >- * of the interaction >- * validDrop: boolean >- * @property interactionInfo >- * @type object >- * @static >- */ >- interactionInfo: null, >- >- /** >- * Called the first time an element is registered. >- * @method init >- * @private >- * @static >- */ >- init: function() { >- this.initialized = true; >- }, >- >- /** >- * In point mode, drag and drop interaction is defined by the >- * location of the cursor during the drag/drop >- * @property POINT >- * @type int >- * @static >- * @final >- */ >- POINT: 0, >- >- /** >- * In intersect mode, drag and drop interaction is defined by the >- * cursor position or the amount of overlap of two or more drag and >- * drop objects. >- * @property INTERSECT >- * @type int >- * @static >- * @final >- */ >- INTERSECT: 1, >- >- /** >- * In intersect mode, drag and drop interaction is defined only by the >- * overlap of two or more drag and drop objects. >- * @property STRICT_INTERSECT >- * @type int >- * @static >- * @final >- */ >- STRICT_INTERSECT: 2, >- >- /** >- * The current drag and drop mode. Default: POINT >- * @property mode >- * @type int >- * @static >- */ >- mode: 0, >- >- /** >- * Runs method on all drag and drop objects >- * @method _execOnAll >- * @private >- * @static >- */ >- _execOnAll: function(sMethod, args) { >- for (var i in this.ids) { >- for (var j in this.ids[i]) { >- var oDD = this.ids[i][j]; >- if (! this.isTypeOfDD(oDD)) { >- continue; >- } >- oDD[sMethod].apply(oDD, args); >- } >- } >- }, >- >- /** >- * Drag and drop initialization. Sets up the global event handlers >- * @method _onLoad >- * @private >- * @static >- */ >- _onLoad: function() { >- >- this.init(); >- >- Event.on(document, "mouseup", this.handleMouseUp, this, true); >- Event.on(document, "mousemove", this.handleMouseMove, this, true); >- Event.on(window, "unload", this._onUnload, this, true); >- Event.on(window, "resize", this._onResize, this, true); >- // Event.on(window, "mouseout", this._test); >- >- }, >- >- /** >- * Reset constraints on all drag and drop objs >- * @method _onResize >- * @private >- * @static >- */ >- _onResize: function(e) { >- this._execOnAll("resetConstraints", []); >- }, >- >- /** >- * Lock all drag and drop functionality >- * @method lock >- * @static >- */ >- lock: function() { this.locked = true; }, >- >- /** >- * Unlock all drag and drop functionality >- * @method unlock >- * @static >- */ >- unlock: function() { this.locked = false; }, >- >- /** >- * Is drag and drop locked? >- * @method isLocked >- * @return {boolean} True if drag and drop is locked, false otherwise. >- * @static >- */ >- isLocked: function() { return this.locked; }, >- >- /** >- * Location cache that is set for all drag drop objects when a drag is >- * initiated, cleared when the drag is finished. >- * @property locationCache >- * @private >- * @static >- */ >- locationCache: {}, >- >- /** >- * Set useCache to false if you want to force object the lookup of each >- * drag and drop linked element constantly during a drag. >- * @property useCache >- * @type boolean >- * @static >- */ >- useCache: true, >- >- /** >- * The number of pixels that the mouse needs to move after the >- * mousedown before the drag is initiated. Default=3; >- * @property clickPixelThresh >- * @type int >- * @static >- */ >- clickPixelThresh: 3, >- >- /** >- * The number of milliseconds after the mousedown event to initiate the >- * drag if we don't get a mouseup event. Default=1000 >- * @property clickTimeThresh >- * @type int >- * @static >- */ >- clickTimeThresh: 1000, >- >- /** >- * Flag that indicates that either the drag pixel threshold or the >- * mousdown time threshold has been met >- * @property dragThreshMet >- * @type boolean >- * @private >- * @static >- */ >- dragThreshMet: false, >- >- /** >- * Timeout used for the click time threshold >- * @property clickTimeout >- * @type Object >- * @private >- * @static >- */ >- clickTimeout: null, >- >- /** >- * The X position of the mousedown event stored for later use when a >- * drag threshold is met. >- * @property startX >- * @type int >- * @private >- * @static >- */ >- startX: 0, >- >- /** >- * The Y position of the mousedown event stored for later use when a >- * drag threshold is met. >- * @property startY >- * @type int >- * @private >- * @static >- */ >- startY: 0, >- >- /** >- * Flag to determine if the drag event was fired from the click timeout and >- * not the mouse move threshold. >- * @property fromTimeout >- * @type boolean >- * @private >- * @static >- */ >- fromTimeout: false, >- >- /** >- * Each DragDrop instance must be registered with the DragDropMgr. >- * This is executed in DragDrop.init() >- * @method regDragDrop >- * @param {DragDrop} oDD the DragDrop object to register >- * @param {String} sGroup the name of the group this element belongs to >- * @static >- */ >- regDragDrop: function(oDD, sGroup) { >- if (!this.initialized) { this.init(); } >- >- if (!this.ids[sGroup]) { >- this.ids[sGroup] = {}; >- } >- this.ids[sGroup][oDD.id] = oDD; >- }, >- >- /** >- * Removes the supplied dd instance from the supplied group. Executed >- * by DragDrop.removeFromGroup, so don't call this function directly. >- * @method removeDDFromGroup >- * @private >- * @static >- */ >- removeDDFromGroup: function(oDD, sGroup) { >- if (!this.ids[sGroup]) { >- this.ids[sGroup] = {}; >- } >- >- var obj = this.ids[sGroup]; >- if (obj && obj[oDD.id]) { >- delete obj[oDD.id]; >- } >- }, >- >- /** >- * Unregisters a drag and drop item. This is executed in >- * DragDrop.unreg, use that method instead of calling this directly. >- * @method _remove >- * @private >- * @static >- */ >- _remove: function(oDD) { >- for (var g in oDD.groups) { >- if (g) { >- var item = this.ids[g]; >- if (item && item[oDD.id]) { >- delete item[oDD.id]; >- } >- } >- >- } >- delete this.handleIds[oDD.id]; >- }, >- >- /** >- * Each DragDrop handle element must be registered. This is done >- * automatically when executing DragDrop.setHandleElId() >- * @method regHandle >- * @param {String} sDDId the DragDrop id this element is a handle for >- * @param {String} sHandleId the id of the element that is the drag >- * handle >- * @static >- */ >- regHandle: function(sDDId, sHandleId) { >- if (!this.handleIds[sDDId]) { >- this.handleIds[sDDId] = {}; >- } >- this.handleIds[sDDId][sHandleId] = sHandleId; >- }, >- >- /** >- * Utility function to determine if a given element has been >- * registered as a drag drop item. >- * @method isDragDrop >- * @param {String} id the element id to check >- * @return {boolean} true if this element is a DragDrop item, >- * false otherwise >- * @static >- */ >- isDragDrop: function(id) { >- return ( this.getDDById(id) ) ? true : false; >- }, >- >- /** >- * Returns the drag and drop instances that are in all groups the >- * passed in instance belongs to. >- * @method getRelated >- * @param {DragDrop} p_oDD the obj to get related data for >- * @param {boolean} bTargetsOnly if true, only return targetable objs >- * @return {DragDrop[]} the related instances >- * @static >- */ >- getRelated: function(p_oDD, bTargetsOnly) { >- var oDDs = []; >- for (var i in p_oDD.groups) { >- for (var j in this.ids[i]) { >- var dd = this.ids[i][j]; >- if (! this.isTypeOfDD(dd)) { >- continue; >- } >- if (!bTargetsOnly || dd.isTarget) { >- oDDs[oDDs.length] = dd; >- } >- } >- } >- >- return oDDs; >- }, >- >- /** >- * Returns true if the specified dd target is a legal target for >- * the specifice drag obj >- * @method isLegalTarget >- * @param {DragDrop} the drag obj >- * @param {DragDrop} the target >- * @return {boolean} true if the target is a legal target for the >- * dd obj >- * @static >- */ >- isLegalTarget: function (oDD, oTargetDD) { >- var targets = this.getRelated(oDD, true); >- for (var i=0, len=targets.length;i<len;++i) { >- if (targets[i].id == oTargetDD.id) { >- return true; >- } >- } >- >- return false; >- }, >- >- /** >- * My goal is to be able to transparently determine if an object is >- * typeof DragDrop, and the exact subclass of DragDrop. typeof >- * returns "object", oDD.constructor.toString() always returns >- * "DragDrop" and not the name of the subclass. So for now it just >- * evaluates a well-known variable in DragDrop. >- * @method isTypeOfDD >- * @param {Object} the object to evaluate >- * @return {boolean} true if typeof oDD = DragDrop >- * @static >- */ >- isTypeOfDD: function (oDD) { >- return (oDD && oDD.__ygDragDrop); >- }, >- >- /** >- * Utility function to determine if a given element has been >- * registered as a drag drop handle for the given Drag Drop object. >- * @method isHandle >- * @param {String} id the element id to check >- * @return {boolean} true if this element is a DragDrop handle, false >- * otherwise >- * @static >- */ >- isHandle: function(sDDId, sHandleId) { >- return ( this.handleIds[sDDId] && >- this.handleIds[sDDId][sHandleId] ); >- }, >- >- /** >- * Returns the DragDrop instance for a given id >- * @method getDDById >- * @param {String} id the id of the DragDrop object >- * @return {DragDrop} the drag drop object, null if it is not found >- * @static >- */ >- getDDById: function(id) { >- for (var i in this.ids) { >- if (this.ids[i][id]) { >- return this.ids[i][id]; >- } >- } >- return null; >- }, >- >- /** >- * Fired after a registered DragDrop object gets the mousedown event. >- * Sets up the events required to track the object being dragged >- * @method handleMouseDown >- * @param {Event} e the event >- * @param oDD the DragDrop object being dragged >- * @private >- * @static >- */ >- handleMouseDown: function(e, oDD) { >- //this._activateShim(); >- >- this.currentTarget = YAHOO.util.Event.getTarget(e); >- >- this.dragCurrent = oDD; >- >- var el = oDD.getEl(); >- >- // track start position >- this.startX = YAHOO.util.Event.getPageX(e); >- this.startY = YAHOO.util.Event.getPageY(e); >- >- this.deltaX = this.startX - el.offsetLeft; >- this.deltaY = this.startY - el.offsetTop; >- >- this.dragThreshMet = false; >- >- this.clickTimeout = setTimeout( >- function() { >- var DDM = YAHOO.util.DDM; >- DDM.startDrag(DDM.startX, DDM.startY); >- DDM.fromTimeout = true; >- }, >- this.clickTimeThresh ); >- }, >- >- /** >- * Fired when either the drag pixel threshold or the mousedown hold >- * time threshold has been met. >- * @method startDrag >- * @param x {int} the X position of the original mousedown >- * @param y {int} the Y position of the original mousedown >- * @static >- */ >- startDrag: function(x, y) { >- if (this.dragCurrent && this.dragCurrent.useShim) { >- this._shimState = this.useShim; >- this.useShim = true; >- } >- this._activateShim(); >- clearTimeout(this.clickTimeout); >- var dc = this.dragCurrent; >- if (dc && dc.events.b4StartDrag) { >- dc.b4StartDrag(x, y); >- dc.fireEvent('b4StartDragEvent', { x: x, y: y }); >- } >- if (dc && dc.events.startDrag) { >- dc.startDrag(x, y); >- dc.fireEvent('startDragEvent', { x: x, y: y }); >- } >- this.dragThreshMet = true; >- }, >- >- /** >- * Internal function to handle the mouseup event. Will be invoked >- * from the context of the document. >- * @method handleMouseUp >- * @param {Event} e the event >- * @private >- * @static >- */ >- handleMouseUp: function(e) { >- if (this.dragCurrent) { >- clearTimeout(this.clickTimeout); >- >- if (this.dragThreshMet) { >- if (this.fromTimeout) { >- this.fromTimeout = false; >- this.handleMouseMove(e); >- } >- this.fromTimeout = false; >- this.fireEvents(e, true); >- } else { >- } >- >- this.stopDrag(e); >- >- this.stopEvent(e); >- } >- }, >- >- /** >- * Utility to stop event propagation and event default, if these >- * features are turned on. >- * @method stopEvent >- * @param {Event} e the event as returned by this.getEvent() >- * @static >- */ >- stopEvent: function(e) { >- if (this.stopPropagation) { >- YAHOO.util.Event.stopPropagation(e); >- } >- >- if (this.preventDefault) { >- YAHOO.util.Event.preventDefault(e); >- } >- }, >- >- /** >- * Ends the current drag, cleans up the state, and fires the endDrag >- * and mouseUp events. Called internally when a mouseup is detected >- * during the drag. Can be fired manually during the drag by passing >- * either another event (such as the mousemove event received in onDrag) >- * or a fake event with pageX and pageY defined (so that endDrag and >- * onMouseUp have usable position data.). Alternatively, pass true >- * for the silent parameter so that the endDrag and onMouseUp events >- * are skipped (so no event data is needed.) >- * >- * @method stopDrag >- * @param {Event} e the mouseup event, another event (or a fake event) >- * with pageX and pageY defined, or nothing if the >- * silent parameter is true >- * @param {boolean} silent skips the enddrag and mouseup events if true >- * @static >- */ >- stopDrag: function(e, silent) { >- var dc = this.dragCurrent; >- // Fire the drag end event for the item that was dragged >- if (dc && !silent) { >- if (this.dragThreshMet) { >- if (dc.events.b4EndDrag) { >- dc.b4EndDrag(e); >- dc.fireEvent('b4EndDragEvent', { e: e }); >- } >- if (dc.events.endDrag) { >- dc.endDrag(e); >- dc.fireEvent('endDragEvent', { e: e }); >- } >- } >- if (dc.events.mouseUp) { >- dc.onMouseUp(e); >- dc.fireEvent('mouseUpEvent', { e: e }); >- } >- } >- >- if (this._shimActive) { >- this._deactivateShim(); >- if (this.dragCurrent && this.dragCurrent.useShim) { >- this.useShim = this._shimState; >- this._shimState = false; >- } >- } >- >- this.dragCurrent = null; >- this.dragOvers = {}; >- }, >- >- /** >- * Internal function to handle the mousemove event. Will be invoked >- * from the context of the html element. >- * >- * @TODO figure out what we can do about mouse events lost when the >- * user drags objects beyond the window boundary. Currently we can >- * detect this in internet explorer by verifying that the mouse is >- * down during the mousemove event. Firefox doesn't give us the >- * button state on the mousemove event. >- * @method handleMouseMove >- * @param {Event} e the event >- * @private >- * @static >- */ >- handleMouseMove: function(e) { >- >- var dc = this.dragCurrent; >- if (dc) { >- >- // var button = e.which || e.button; >- >- // check for IE mouseup outside of page boundary >- if (YAHOO.util.Event.isIE && !e.button) { >- this.stopEvent(e); >- return this.handleMouseUp(e); >- } else { >- if (e.clientX < 0 || e.clientY < 0) { >- //This will stop the element from leaving the viewport in FF, Opera & Safari >- //Not turned on yet >- //this.stopEvent(e); >- //return false; >- } >- } >- >- if (!this.dragThreshMet) { >- var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e)); >- var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e)); >- if (diffX > this.clickPixelThresh || >- diffY > this.clickPixelThresh) { >- this.startDrag(this.startX, this.startY); >- } >- } >- >- if (this.dragThreshMet) { >- if (dc && dc.events.b4Drag) { >- dc.b4Drag(e); >- dc.fireEvent('b4DragEvent', { e: e}); >- } >- if (dc && dc.events.drag) { >- dc.onDrag(e); >- dc.fireEvent('dragEvent', { e: e}); >- } >- if (dc) { >- this.fireEvents(e, false); >- } >- } >- >- this.stopEvent(e); >- } >- }, >- >- /** >- * Iterates over all of the DragDrop elements to find ones we are >- * hovering over or dropping on >- * @method fireEvents >- * @param {Event} e the event >- * @param {boolean} isDrop is this a drop op or a mouseover op? >- * @private >- * @static >- */ >- fireEvents: function(e, isDrop) { >- var dc = this.dragCurrent; >- >- // If the user did the mouse up outside of the window, we could >- // get here even though we have ended the drag. >- // If the config option dragOnly is true, bail out and don't fire the events >- if (!dc || dc.isLocked() || dc.dragOnly) { >- return; >- } >- >- var x = YAHOO.util.Event.getPageX(e), >- y = YAHOO.util.Event.getPageY(e), >- pt = new YAHOO.util.Point(x,y), >- pos = dc.getTargetCoord(pt.x, pt.y), >- el = dc.getDragEl(), >- events = ['out', 'over', 'drop', 'enter'], >- curRegion = new YAHOO.util.Region( pos.y, >- pos.x + el.offsetWidth, >- pos.y + el.offsetHeight, >- pos.x ), >- >- oldOvers = [], // cache the previous dragOver array >- inGroupsObj = {}, >- inGroups = [], >- data = { >- outEvts: [], >- overEvts: [], >- dropEvts: [], >- enterEvts: [] >- }; >- >- >- // Check to see if the object(s) we were hovering over is no longer >- // being hovered over so we can fire the onDragOut event >- for (var i in this.dragOvers) { >- >- var ddo = this.dragOvers[i]; >- >- if (! this.isTypeOfDD(ddo)) { >- continue; >- } >- if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) { >- data.outEvts.push( ddo ); >- } >- >- oldOvers[i] = true; >- delete this.dragOvers[i]; >- } >- >- for (var sGroup in dc.groups) { >- >- if ("string" != typeof sGroup) { >- continue; >- } >- >- for (i in this.ids[sGroup]) { >- var oDD = this.ids[sGroup][i]; >- if (! this.isTypeOfDD(oDD)) { >- continue; >- } >- >- if (oDD.isTarget && !oDD.isLocked() && oDD != dc) { >- if (this.isOverTarget(pt, oDD, this.mode, curRegion)) { >- inGroupsObj[sGroup] = true; >- // look for drop interactions >- if (isDrop) { >- data.dropEvts.push( oDD ); >- // look for drag enter and drag over interactions >- } else { >- >- // initial drag over: dragEnter fires >- if (!oldOvers[oDD.id]) { >- data.enterEvts.push( oDD ); >- // subsequent drag overs: dragOver fires >- } else { >- data.overEvts.push( oDD ); >- } >- >- this.dragOvers[oDD.id] = oDD; >- } >- } >- } >- } >- } >- >- this.interactionInfo = { >- out: data.outEvts, >- enter: data.enterEvts, >- over: data.overEvts, >- drop: data.dropEvts, >- point: pt, >- draggedRegion: curRegion, >- sourceRegion: this.locationCache[dc.id], >- validDrop: isDrop >- }; >- >- >- for (var inG in inGroupsObj) { >- inGroups.push(inG); >- } >- >- // notify about a drop that did not find a target >- if (isDrop && !data.dropEvts.length) { >- this.interactionInfo.validDrop = false; >- if (dc.events.invalidDrop) { >- dc.onInvalidDrop(e); >- dc.fireEvent('invalidDropEvent', { e: e }); >- } >- } >- for (i = 0; i < events.length; i++) { >- var tmp = null; >- if (data[events[i] + 'Evts']) { >- tmp = data[events[i] + 'Evts']; >- } >- if (tmp && tmp.length) { >- var type = events[i].charAt(0).toUpperCase() + events[i].substr(1), >- ev = 'onDrag' + type, >- b4 = 'b4Drag' + type, >- cev = 'drag' + type + 'Event', >- check = 'drag' + type; >- if (this.mode) { >- if (dc.events[b4]) { >- dc[b4](e, tmp, inGroups); >- dc.fireEvent(b4 + 'Event', { event: e, info: tmp, group: inGroups }); >- >- } >- if (dc.events[check]) { >- dc[ev](e, tmp, inGroups); >- dc.fireEvent(cev, { event: e, info: tmp, group: inGroups }); >- } >- } else { >- for (var b = 0, len = tmp.length; b < len; ++b) { >- if (dc.events[b4]) { >- dc[b4](e, tmp[b].id, inGroups[0]); >- dc.fireEvent(b4 + 'Event', { event: e, info: tmp[b].id, group: inGroups[0] }); >- } >- if (dc.events[check]) { >- dc[ev](e, tmp[b].id, inGroups[0]); >- dc.fireEvent(cev, { event: e, info: tmp[b].id, group: inGroups[0] }); >- } >- } >- } >- } >- } >- }, >- >- /** >- * Helper function for getting the best match from the list of drag >- * and drop objects returned by the drag and drop events when we are >- * in INTERSECT mode. It returns either the first object that the >- * cursor is over, or the object that has the greatest overlap with >- * the dragged element. >- * @method getBestMatch >- * @param {DragDrop[]} dds The array of drag and drop objects >- * targeted >- * @return {DragDrop} The best single match >- * @static >- */ >- getBestMatch: function(dds) { >- var winner = null; >- >- var len = dds.length; >- >- if (len == 1) { >- winner = dds[0]; >- } else { >- // Loop through the targeted items >- for (var i=0; i<len; ++i) { >- var dd = dds[i]; >- // If the cursor is over the object, it wins. If the >- // cursor is over multiple matches, the first one we come >- // to wins. >- if (this.mode == this.INTERSECT && dd.cursorIsOver) { >- winner = dd; >- break; >- // Otherwise the object with the most overlap wins >- } else { >- if (!winner || !winner.overlap || (dd.overlap && >- winner.overlap.getArea() < dd.overlap.getArea())) { >- winner = dd; >- } >- } >- } >- } >- >- return winner; >- }, >- >- /** >- * Refreshes the cache of the top-left and bottom-right points of the >- * drag and drop objects in the specified group(s). This is in the >- * format that is stored in the drag and drop instance, so typical >- * usage is: >- * <code> >- * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups); >- * </code> >- * Alternatively: >- * <code> >- * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true}); >- * </code> >- * @TODO this really should be an indexed array. Alternatively this >- * method could accept both. >- * @method refreshCache >- * @param {Object} groups an associative array of groups to refresh >- * @static >- */ >- refreshCache: function(groups) { >- >- // refresh everything if group array is not provided >- var g = groups || this.ids; >- >- for (var sGroup in g) { >- if ("string" != typeof sGroup) { >- continue; >- } >- for (var i in this.ids[sGroup]) { >- var oDD = this.ids[sGroup][i]; >- >- if (this.isTypeOfDD(oDD)) { >- var loc = this.getLocation(oDD); >- if (loc) { >- this.locationCache[oDD.id] = loc; >- } else { >- delete this.locationCache[oDD.id]; >- } >- } >- } >- } >- }, >- >- /** >- * This checks to make sure an element exists and is in the DOM. The >- * main purpose is to handle cases where innerHTML is used to remove >- * drag and drop objects from the DOM. IE provides an 'unspecified >- * error' when trying to access the offsetParent of such an element >- * @method verifyEl >- * @param {HTMLElement} el the element to check >- * @return {boolean} true if the element looks usable >- * @static >- */ >- verifyEl: function(el) { >- try { >- if (el) { >- var parent = el.offsetParent; >- if (parent) { >- return true; >- } >- } >- } catch(e) { >- } >- >- return false; >- }, >- >- /** >- * Returns a Region object containing the drag and drop element's position >- * and size, including the padding configured for it >- * @method getLocation >- * @param {DragDrop} oDD the drag and drop object to get the >- * location for >- * @return {YAHOO.util.Region} a Region object representing the total area >- * the element occupies, including any padding >- * the instance is configured for. >- * @static >- */ >- getLocation: function(oDD) { >- if (! this.isTypeOfDD(oDD)) { >- return null; >- } >- >- var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l; >- >- try { >- pos= YAHOO.util.Dom.getXY(el); >- } catch (e) { } >- >- if (!pos) { >- return null; >- } >- >- x1 = pos[0]; >- x2 = x1 + el.offsetWidth; >- y1 = pos[1]; >- y2 = y1 + el.offsetHeight; >- >- t = y1 - oDD.padding[0]; >- r = x2 + oDD.padding[1]; >- b = y2 + oDD.padding[2]; >- l = x1 - oDD.padding[3]; >- >- return new YAHOO.util.Region( t, r, b, l ); >- }, >- >- /** >- * Checks the cursor location to see if it over the target >- * @method isOverTarget >- * @param {YAHOO.util.Point} pt The point to evaluate >- * @param {DragDrop} oTarget the DragDrop object we are inspecting >- * @param {boolean} intersect true if we are in intersect mode >- * @param {YAHOO.util.Region} pre-cached location of the dragged element >- * @return {boolean} true if the mouse is over the target >- * @private >- * @static >- */ >- isOverTarget: function(pt, oTarget, intersect, curRegion) { >- // use cache if available >- var loc = this.locationCache[oTarget.id]; >- if (!loc || !this.useCache) { >- loc = this.getLocation(oTarget); >- this.locationCache[oTarget.id] = loc; >- >- } >- >- if (!loc) { >- return false; >- } >- >- oTarget.cursorIsOver = loc.contains( pt ); >- >- // DragDrop is using this as a sanity check for the initial mousedown >- // in this case we are done. In POINT mode, if the drag obj has no >- // contraints, we are done. Otherwise we need to evaluate the >- // region the target as occupies to determine if the dragged element >- // overlaps with it. >- >- var dc = this.dragCurrent; >- if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) { >- >- //if (oTarget.cursorIsOver) { >- //} >- return oTarget.cursorIsOver; >- } >- >- oTarget.overlap = null; >- >- >- // Get the current location of the drag element, this is the >- // location of the mouse event less the delta that represents >- // where the original mousedown happened on the element. We >- // need to consider constraints and ticks as well. >- >- if (!curRegion) { >- var pos = dc.getTargetCoord(pt.x, pt.y); >- var el = dc.getDragEl(); >- curRegion = new YAHOO.util.Region( pos.y, >- pos.x + el.offsetWidth, >- pos.y + el.offsetHeight, >- pos.x ); >- } >- >- var overlap = curRegion.intersect(loc); >- >- if (overlap) { >- oTarget.overlap = overlap; >- return (intersect) ? true : oTarget.cursorIsOver; >- } else { >- return false; >- } >- }, >- >- /** >- * unload event handler >- * @method _onUnload >- * @private >- * @static >- */ >- _onUnload: function(e, me) { >- this.unregAll(); >- }, >- >- /** >- * Cleans up the drag and drop events and objects. >- * @method unregAll >- * @private >- * @static >- */ >- unregAll: function() { >- >- if (this.dragCurrent) { >- this.stopDrag(); >- this.dragCurrent = null; >- } >- >- this._execOnAll("unreg", []); >- >- //for (var i in this.elementCache) { >- //delete this.elementCache[i]; >- //} >- //this.elementCache = {}; >- >- this.ids = {}; >- }, >- >- /** >- * A cache of DOM elements >- * @property elementCache >- * @private >- * @static >- * @deprecated elements are not cached now >- */ >- elementCache: {}, >- >- /** >- * Get the wrapper for the DOM element specified >- * @method getElWrapper >- * @param {String} id the id of the element to get >- * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element >- * @private >- * @deprecated This wrapper isn't that useful >- * @static >- */ >- getElWrapper: function(id) { >- var oWrapper = this.elementCache[id]; >- if (!oWrapper || !oWrapper.el) { >- oWrapper = this.elementCache[id] = >- new this.ElementWrapper(YAHOO.util.Dom.get(id)); >- } >- return oWrapper; >- }, >- >- /** >- * Returns the actual DOM element >- * @method getElement >- * @param {String} id the id of the elment to get >- * @return {Object} The element >- * @deprecated use YAHOO.util.Dom.get instead >- * @static >- */ >- getElement: function(id) { >- return YAHOO.util.Dom.get(id); >- }, >- >- /** >- * Returns the style property for the DOM element (i.e., >- * document.getElById(id).style) >- * @method getCss >- * @param {String} id the id of the elment to get >- * @return {Object} The style property of the element >- * @deprecated use YAHOO.util.Dom instead >- * @static >- */ >- getCss: function(id) { >- var el = YAHOO.util.Dom.get(id); >- return (el) ? el.style : null; >- }, >- >- /** >- * Inner class for cached elements >- * @class DragDropMgr.ElementWrapper >- * @for DragDropMgr >- * @private >- * @deprecated >- */ >- ElementWrapper: function(el) { >- /** >- * The element >- * @property el >- */ >- this.el = el || null; >- /** >- * The element id >- * @property id >- */ >- this.id = this.el && el.id; >- /** >- * A reference to the style property >- * @property css >- */ >- this.css = this.el && el.style; >- }, >- >- /** >- * Returns the X position of an html element >- * @method getPosX >- * @param el the element for which to get the position >- * @return {int} the X coordinate >- * @for DragDropMgr >- * @deprecated use YAHOO.util.Dom.getX instead >- * @static >- */ >- getPosX: function(el) { >- return YAHOO.util.Dom.getX(el); >- }, >- >- /** >- * Returns the Y position of an html element >- * @method getPosY >- * @param el the element for which to get the position >- * @return {int} the Y coordinate >- * @deprecated use YAHOO.util.Dom.getY instead >- * @static >- */ >- getPosY: function(el) { >- return YAHOO.util.Dom.getY(el); >- }, >- >- /** >- * Swap two nodes. In IE, we use the native method, for others we >- * emulate the IE behavior >- * @method swapNode >- * @param n1 the first node to swap >- * @param n2 the other node to swap >- * @static >- */ >- swapNode: function(n1, n2) { >- if (n1.swapNode) { >- n1.swapNode(n2); >- } else { >- var p = n2.parentNode; >- var s = n2.nextSibling; >- >- if (s == n1) { >- p.insertBefore(n1, n2); >- } else if (n2 == n1.nextSibling) { >- p.insertBefore(n2, n1); >- } else { >- n1.parentNode.replaceChild(n2, n1); >- p.insertBefore(n1, s); >- } >- } >- }, >- >- /** >- * Returns the current scroll position >- * @method getScroll >- * @private >- * @static >- */ >- getScroll: function () { >- var t, l, dde=document.documentElement, db=document.body; >- if (dde && (dde.scrollTop || dde.scrollLeft)) { >- t = dde.scrollTop; >- l = dde.scrollLeft; >- } else if (db) { >- t = db.scrollTop; >- l = db.scrollLeft; >- } else { >- } >- return { top: t, left: l }; >- }, >- >- /** >- * Returns the specified element style property >- * @method getStyle >- * @param {HTMLElement} el the element >- * @param {string} styleProp the style property >- * @return {string} The value of the style property >- * @deprecated use YAHOO.util.Dom.getStyle >- * @static >- */ >- getStyle: function(el, styleProp) { >- return YAHOO.util.Dom.getStyle(el, styleProp); >- }, >- >- /** >- * Gets the scrollTop >- * @method getScrollTop >- * @return {int} the document's scrollTop >- * @static >- */ >- getScrollTop: function () { return this.getScroll().top; }, >- >- /** >- * Gets the scrollLeft >- * @method getScrollLeft >- * @return {int} the document's scrollTop >- * @static >- */ >- getScrollLeft: function () { return this.getScroll().left; }, >- >- /** >- * Sets the x/y position of an element to the location of the >- * target element. >- * @method moveToEl >- * @param {HTMLElement} moveEl The element to move >- * @param {HTMLElement} targetEl The position reference element >- * @static >- */ >- moveToEl: function (moveEl, targetEl) { >- var aCoord = YAHOO.util.Dom.getXY(targetEl); >- YAHOO.util.Dom.setXY(moveEl, aCoord); >- }, >- >- /** >- * Gets the client height >- * @method getClientHeight >- * @return {int} client height in px >- * @deprecated use YAHOO.util.Dom.getViewportHeight instead >- * @static >- */ >- getClientHeight: function() { >- return YAHOO.util.Dom.getViewportHeight(); >- }, >- >- /** >- * Gets the client width >- * @method getClientWidth >- * @return {int} client width in px >- * @deprecated use YAHOO.util.Dom.getViewportWidth instead >- * @static >- */ >- getClientWidth: function() { >- return YAHOO.util.Dom.getViewportWidth(); >- }, >- >- /** >- * Numeric array sort function >- * @method numericSort >- * @static >- */ >- numericSort: function(a, b) { return (a - b); }, >- >- /** >- * Internal counter >- * @property _timeoutCount >- * @private >- * @static >- */ >- _timeoutCount: 0, >- >- /** >- * Trying to make the load order less important. Without this we get >- * an error if this file is loaded before the Event Utility. >- * @method _addListeners >- * @private >- * @static >- */ >- _addListeners: function() { >- var DDM = YAHOO.util.DDM; >- if ( YAHOO.util.Event && document ) { >- DDM._onLoad(); >- } else { >- if (DDM._timeoutCount > 2000) { >- } else { >- setTimeout(DDM._addListeners, 10); >- if (document && document.body) { >- DDM._timeoutCount += 1; >- } >- } >- } >- }, >- >- /** >- * Recursively searches the immediate parent and all child nodes for >- * the handle element in order to determine wheter or not it was >- * clicked. >- * @method handleWasClicked >- * @param node the html element to inspect >- * @static >- */ >- handleWasClicked: function(node, id) { >- if (this.isHandle(id, node.id)) { >- return true; >- } else { >- // check to see if this is a text node child of the one we want >- var p = node.parentNode; >- >- while (p) { >- if (this.isHandle(id, p.id)) { >- return true; >- } else { >- p = p.parentNode; >- } >- } >- } >- >- return false; >- } >- >- }; >- >-}(); >- >-// shorter alias, save a few bytes >-YAHOO.util.DDM = YAHOO.util.DragDropMgr; >-YAHOO.util.DDM._addListeners(); >- >-} >- >-(function() { >- >-var Event=YAHOO.util.Event; >-var Dom=YAHOO.util.Dom; >- >-/** >- * Defines the interface and base operation of items that that can be >- * dragged or can be drop targets. It was designed to be extended, overriding >- * the event handlers for startDrag, onDrag, onDragOver, onDragOut. >- * Up to three html elements can be associated with a DragDrop instance: >- * <ul> >- * <li>linked element: the element that is passed into the constructor. >- * This is the element which defines the boundaries for interaction with >- * other DragDrop objects.</li> >- * <li>handle element(s): The drag operation only occurs if the element that >- * was clicked matches a handle element. By default this is the linked >- * element, but there are times that you will want only a portion of the >- * linked element to initiate the drag operation, and the setHandleElId() >- * method provides a way to define this.</li> >- * <li>drag element: this represents an the element that would be moved along >- * with the cursor during a drag operation. By default, this is the linked >- * element itself as in {@link YAHOO.util.DD}. setDragElId() lets you define >- * a separate element that would be moved, as in {@link YAHOO.util.DDProxy} >- * </li> >- * </ul> >- * This class should not be instantiated until the onload event to ensure that >- * the associated elements are available. >- * The following would define a DragDrop obj that would interact with any >- * other DragDrop obj in the "group1" group: >- * <pre> >- * dd = new YAHOO.util.DragDrop("div1", "group1"); >- * </pre> >- * Since none of the event handlers have been implemented, nothing would >- * actually happen if you were to run the code above. Normally you would >- * override this class or one of the default implementations, but you can >- * also override the methods you want on an instance of the class... >- * <pre> >- * dd.onDragDrop = function(e, id) { >- * alert("dd was dropped on " + id); >- * } >- * </pre> >- * @namespace YAHOO.util >- * @class DragDrop >- * @constructor >- * @param {String} id of the element that is linked to this instance >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DragDrop: >- * padding, isTarget, maintainOffset, primaryButtonOnly, >- */ >-YAHOO.util.DragDrop = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- } >-}; >- >-YAHOO.util.DragDrop.prototype = { >- /** >- * An Object Literal containing the events that we will be using: mouseDown, b4MouseDown, mouseUp, b4StartDrag, startDrag, b4EndDrag, endDrag, mouseUp, drag, b4Drag, invalidDrop, b4DragOut, dragOut, dragEnter, b4DragOver, dragOver, b4DragDrop, dragDrop >- * By setting any of these to false, then event will not be fired. >- * @property events >- * @type object >- */ >- events: null, >- /** >- * @method on >- * @description Shortcut for EventProvider.subscribe, see <a href="YAHOO.util.EventProvider.html#subscribe">YAHOO.util.EventProvider.subscribe</a> >- */ >- on: function() { >- this.subscribe.apply(this, arguments); >- }, >- /** >- * The id of the element associated with this object. This is what we >- * refer to as the "linked element" because the size and position of >- * this element is used to determine when the drag and drop objects have >- * interacted. >- * @property id >- * @type String >- */ >- id: null, >- >- /** >- * Configuration attributes passed into the constructor >- * @property config >- * @type object >- */ >- config: null, >- >- /** >- * The id of the element that will be dragged. By default this is same >- * as the linked element , but could be changed to another element. Ex: >- * YAHOO.util.DDProxy >- * @property dragElId >- * @type String >- * @private >- */ >- dragElId: null, >- >- /** >- * the id of the element that initiates the drag operation. By default >- * this is the linked element, but could be changed to be a child of this >- * element. This lets us do things like only starting the drag when the >- * header element within the linked html element is clicked. >- * @property handleElId >- * @type String >- * @private >- */ >- handleElId: null, >- >- /** >- * An associative array of HTML tags that will be ignored if clicked. >- * @property invalidHandleTypes >- * @type {string: string} >- */ >- invalidHandleTypes: null, >- >- /** >- * An associative array of ids for elements that will be ignored if clicked >- * @property invalidHandleIds >- * @type {string: string} >- */ >- invalidHandleIds: null, >- >- /** >- * An indexted array of css class names for elements that will be ignored >- * if clicked. >- * @property invalidHandleClasses >- * @type string[] >- */ >- invalidHandleClasses: null, >- >- /** >- * The linked element's absolute X position at the time the drag was >- * started >- * @property startPageX >- * @type int >- * @private >- */ >- startPageX: 0, >- >- /** >- * The linked element's absolute X position at the time the drag was >- * started >- * @property startPageY >- * @type int >- * @private >- */ >- startPageY: 0, >- >- /** >- * The group defines a logical collection of DragDrop objects that are >- * related. Instances only get events when interacting with other >- * DragDrop object in the same group. This lets us define multiple >- * groups using a single DragDrop subclass if we want. >- * @property groups >- * @type {string: string} >- */ >- groups: null, >- >- /** >- * Individual drag/drop instances can be locked. This will prevent >- * onmousedown start drag. >- * @property locked >- * @type boolean >- * @private >- */ >- locked: false, >- >- /** >- * Lock this instance >- * @method lock >- */ >- lock: function() { this.locked = true; }, >- >- /** >- * Unlock this instace >- * @method unlock >- */ >- unlock: function() { this.locked = false; }, >- >- /** >- * By default, all instances can be a drop target. This can be disabled by >- * setting isTarget to false. >- * @property isTarget >- * @type boolean >- */ >- isTarget: true, >- >- /** >- * The padding configured for this drag and drop object for calculating >- * the drop zone intersection with this object. >- * @property padding >- * @type int[] >- */ >- padding: null, >- /** >- * If this flag is true, do not fire drop events. The element is a drag only element (for movement not dropping) >- * @property dragOnly >- * @type Boolean >- */ >- dragOnly: false, >- >- /** >- * If this flag is true, a shim will be placed over the screen/viewable area to track mouse events. Should help with dragging elements over iframes and other controls. >- * @property useShim >- * @type Boolean >- */ >- useShim: false, >- >- /** >- * Cached reference to the linked element >- * @property _domRef >- * @private >- */ >- _domRef: null, >- >- /** >- * Internal typeof flag >- * @property __ygDragDrop >- * @private >- */ >- __ygDragDrop: true, >- >- /** >- * Set to true when horizontal contraints are applied >- * @property constrainX >- * @type boolean >- * @private >- */ >- constrainX: false, >- >- /** >- * Set to true when vertical contraints are applied >- * @property constrainY >- * @type boolean >- * @private >- */ >- constrainY: false, >- >- /** >- * The left constraint >- * @property minX >- * @type int >- * @private >- */ >- minX: 0, >- >- /** >- * The right constraint >- * @property maxX >- * @type int >- * @private >- */ >- maxX: 0, >- >- /** >- * The up constraint >- * @property minY >- * @type int >- * @type int >- * @private >- */ >- minY: 0, >- >- /** >- * The down constraint >- * @property maxY >- * @type int >- * @private >- */ >- maxY: 0, >- >- /** >- * The difference between the click position and the source element's location >- * @property deltaX >- * @type int >- * @private >- */ >- deltaX: 0, >- >- /** >- * The difference between the click position and the source element's location >- * @property deltaY >- * @type int >- * @private >- */ >- deltaY: 0, >- >- /** >- * Maintain offsets when we resetconstraints. Set to true when you want >- * the position of the element relative to its parent to stay the same >- * when the page changes >- * >- * @property maintainOffset >- * @type boolean >- */ >- maintainOffset: false, >- >- /** >- * Array of pixel locations the element will snap to if we specified a >- * horizontal graduation/interval. This array is generated automatically >- * when you define a tick interval. >- * @property xTicks >- * @type int[] >- */ >- xTicks: null, >- >- /** >- * Array of pixel locations the element will snap to if we specified a >- * vertical graduation/interval. This array is generated automatically >- * when you define a tick interval. >- * @property yTicks >- * @type int[] >- */ >- yTicks: null, >- >- /** >- * By default the drag and drop instance will only respond to the primary >- * button click (left button for a right-handed mouse). Set to true to >- * allow drag and drop to start with any mouse click that is propogated >- * by the browser >- * @property primaryButtonOnly >- * @type boolean >- */ >- primaryButtonOnly: true, >- >- /** >- * The availabe property is false until the linked dom element is accessible. >- * @property available >- * @type boolean >- */ >- available: false, >- >- /** >- * By default, drags can only be initiated if the mousedown occurs in the >- * region the linked element is. This is done in part to work around a >- * bug in some browsers that mis-report the mousedown if the previous >- * mouseup happened outside of the window. This property is set to true >- * if outer handles are defined. >- * >- * @property hasOuterHandles >- * @type boolean >- * @default false >- */ >- hasOuterHandles: false, >- >- /** >- * Property that is assigned to a drag and drop object when testing to >- * see if it is being targeted by another dd object. This property >- * can be used in intersect mode to help determine the focus of >- * the mouse interaction. DDM.getBestMatch uses this property first to >- * determine the closest match in INTERSECT mode when multiple targets >- * are part of the same interaction. >- * @property cursorIsOver >- * @type boolean >- */ >- cursorIsOver: false, >- >- /** >- * Property that is assigned to a drag and drop object when testing to >- * see if it is being targeted by another dd object. This is a region >- * that represents the area the draggable element overlaps this target. >- * DDM.getBestMatch uses this property to compare the size of the overlap >- * to that of other targets in order to determine the closest match in >- * INTERSECT mode when multiple targets are part of the same interaction. >- * @property overlap >- * @type YAHOO.util.Region >- */ >- overlap: null, >- >- /** >- * Code that executes immediately before the startDrag event >- * @method b4StartDrag >- * @private >- */ >- b4StartDrag: function(x, y) { }, >- >- /** >- * Abstract method called after a drag/drop object is clicked >- * and the drag or mousedown time thresholds have beeen met. >- * @method startDrag >- * @param {int} X click location >- * @param {int} Y click location >- */ >- startDrag: function(x, y) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDrag event >- * @method b4Drag >- * @private >- */ >- b4Drag: function(e) { }, >- >- /** >- * Abstract method called during the onMouseMove event while dragging an >- * object. >- * @method onDrag >- * @param {Event} e the mousemove event >- */ >- onDrag: function(e) { /* override this */ }, >- >- /** >- * Abstract method called when this element fist begins hovering over >- * another DragDrop obj >- * @method onDragEnter >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this is hovering over. In INTERSECT mode, an array of one or more >- * dragdrop items being hovered over. >- */ >- onDragEnter: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragOver event >- * @method b4DragOver >- * @private >- */ >- b4DragOver: function(e) { }, >- >- /** >- * Abstract method called when this element is hovering over another >- * DragDrop obj >- * @method onDragOver >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this is hovering over. In INTERSECT mode, an array of dd items >- * being hovered over. >- */ >- onDragOver: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragOut event >- * @method b4DragOut >- * @private >- */ >- b4DragOut: function(e) { }, >- >- /** >- * Abstract method called when we are no longer hovering over an element >- * @method onDragOut >- * @param {Event} e the mousemove event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this was hovering over. In INTERSECT mode, an array of dd items >- * that the mouse is no longer over. >- */ >- onDragOut: function(e, id) { /* override this */ }, >- >- /** >- * Code that executes immediately before the onDragDrop event >- * @method b4DragDrop >- * @private >- */ >- b4DragDrop: function(e) { }, >- >- /** >- * Abstract method called when this item is dropped on another DragDrop >- * obj >- * @method onDragDrop >- * @param {Event} e the mouseup event >- * @param {String|DragDrop[]} id In POINT mode, the element >- * id this was dropped on. In INTERSECT mode, an array of dd items this >- * was dropped on. >- */ >- onDragDrop: function(e, id) { /* override this */ }, >- >- /** >- * Abstract method called when this item is dropped on an area with no >- * drop target >- * @method onInvalidDrop >- * @param {Event} e the mouseup event >- */ >- onInvalidDrop: function(e) { /* override this */ }, >- >- /** >- * Code that executes immediately before the endDrag event >- * @method b4EndDrag >- * @private >- */ >- b4EndDrag: function(e) { }, >- >- /** >- * Fired when we are done dragging the object >- * @method endDrag >- * @param {Event} e the mouseup event >- */ >- endDrag: function(e) { /* override this */ }, >- >- /** >- * Code executed immediately before the onMouseDown event >- * @method b4MouseDown >- * @param {Event} e the mousedown event >- * @private >- */ >- b4MouseDown: function(e) { }, >- >- /** >- * Event handler that fires when a drag/drop obj gets a mousedown >- * @method onMouseDown >- * @param {Event} e the mousedown event >- */ >- onMouseDown: function(e) { /* override this */ }, >- >- /** >- * Event handler that fires when a drag/drop obj gets a mouseup >- * @method onMouseUp >- * @param {Event} e the mouseup event >- */ >- onMouseUp: function(e) { /* override this */ }, >- >- /** >- * Override the onAvailable method to do what is needed after the initial >- * position was determined. >- * @method onAvailable >- */ >- onAvailable: function () { >- }, >- >- /** >- * Returns a reference to the linked element >- * @method getEl >- * @return {HTMLElement} the html element >- */ >- getEl: function() { >- if (!this._domRef) { >- this._domRef = Dom.get(this.id); >- } >- >- return this._domRef; >- }, >- >- /** >- * Returns a reference to the actual element to drag. By default this is >- * the same as the html element, but it can be assigned to another >- * element. An example of this can be found in YAHOO.util.DDProxy >- * @method getDragEl >- * @return {HTMLElement} the html element >- */ >- getDragEl: function() { >- return Dom.get(this.dragElId); >- }, >- >- /** >- * Sets up the DragDrop object. Must be called in the constructor of any >- * YAHOO.util.DragDrop subclass >- * @method init >- * @param id the id of the linked element >- * @param {String} sGroup the group of related items >- * @param {object} config configuration attributes >- */ >- init: function(id, sGroup, config) { >- this.initTarget(id, sGroup, config); >- Event.on(this._domRef || this.id, "mousedown", >- this.handleMouseDown, this, true); >- >- // Event.on(this.id, "selectstart", Event.preventDefault); >- for (var i in this.events) { >- this.createEvent(i + 'Event'); >- } >- >- }, >- >- /** >- * Initializes Targeting functionality only... the object does not >- * get a mousedown handler. >- * @method initTarget >- * @param id the id of the linked element >- * @param {String} sGroup the group of related items >- * @param {object} config configuration attributes >- */ >- initTarget: function(id, sGroup, config) { >- >- // configuration attributes >- this.config = config || {}; >- >- this.events = {}; >- >- // create a local reference to the drag and drop manager >- this.DDM = YAHOO.util.DDM; >- >- // initialize the groups object >- this.groups = {}; >- >- // assume that we have an element reference instead of an id if the >- // parameter is not a string >- if (typeof id !== "string") { >- this._domRef = id; >- id = Dom.generateId(id); >- } >- >- // set the id >- this.id = id; >- >- // add to an interaction group >- this.addToGroup((sGroup) ? sGroup : "default"); >- >- // We don't want to register this as the handle with the manager >- // so we just set the id rather than calling the setter. >- this.handleElId = id; >- >- Event.onAvailable(id, this.handleOnAvailable, this, true); >- >- >- // the linked element is the element that gets dragged by default >- this.setDragElId(id); >- >- // by default, clicked anchors will not start drag operations. >- // @TODO what else should be here? Probably form fields. >- this.invalidHandleTypes = { A: "A" }; >- this.invalidHandleIds = {}; >- this.invalidHandleClasses = []; >- >- this.applyConfig(); >- }, >- >- /** >- * Applies the configuration parameters that were passed into the constructor. >- * This is supposed to happen at each level through the inheritance chain. So >- * a DDProxy implentation will execute apply config on DDProxy, DD, and >- * DragDrop in order to get all of the parameters that are available in >- * each object. >- * @method applyConfig >- */ >- applyConfig: function() { >- this.events = { >- mouseDown: true, >- b4MouseDown: true, >- mouseUp: true, >- b4StartDrag: true, >- startDrag: true, >- b4EndDrag: true, >- endDrag: true, >- drag: true, >- b4Drag: true, >- invalidDrop: true, >- b4DragOut: true, >- dragOut: true, >- dragEnter: true, >- b4DragOver: true, >- dragOver: true, >- b4DragDrop: true, >- dragDrop: true >- }; >- >- if (this.config.events) { >- for (var i in this.config.events) { >- if (this.config.events[i] === false) { >- this.events[i] = false; >- } >- } >- } >- >- >- // configurable properties: >- // padding, isTarget, maintainOffset, primaryButtonOnly >- this.padding = this.config.padding || [0, 0, 0, 0]; >- this.isTarget = (this.config.isTarget !== false); >- this.maintainOffset = (this.config.maintainOffset); >- this.primaryButtonOnly = (this.config.primaryButtonOnly !== false); >- this.dragOnly = ((this.config.dragOnly === true) ? true : false); >- this.useShim = ((this.config.useShim === true) ? true : false); >- }, >- >- /** >- * Executed when the linked element is available >- * @method handleOnAvailable >- * @private >- */ >- handleOnAvailable: function() { >- this.available = true; >- this.resetConstraints(); >- this.onAvailable(); >- }, >- >- /** >- * Configures the padding for the target zone in px. Effectively expands >- * (or reduces) the virtual object size for targeting calculations. >- * Supports css-style shorthand; if only one parameter is passed, all sides >- * will have that padding, and if only two are passed, the top and bottom >- * will have the first param, the left and right the second. >- * @method setPadding >- * @param {int} iTop Top pad >- * @param {int} iRight Right pad >- * @param {int} iBot Bot pad >- * @param {int} iLeft Left pad >- */ >- setPadding: function(iTop, iRight, iBot, iLeft) { >- // this.padding = [iLeft, iRight, iTop, iBot]; >- if (!iRight && 0 !== iRight) { >- this.padding = [iTop, iTop, iTop, iTop]; >- } else if (!iBot && 0 !== iBot) { >- this.padding = [iTop, iRight, iTop, iRight]; >- } else { >- this.padding = [iTop, iRight, iBot, iLeft]; >- } >- }, >- >- /** >- * Stores the initial placement of the linked element. >- * @method setInitialPosition >- * @param {int} diffX the X offset, default 0 >- * @param {int} diffY the Y offset, default 0 >- * @private >- */ >- setInitPosition: function(diffX, diffY) { >- var el = this.getEl(); >- >- if (!this.DDM.verifyEl(el)) { >- if (el && el.style && (el.style.display == 'none')) { >- } else { >- } >- return; >- } >- >- var dx = diffX || 0; >- var dy = diffY || 0; >- >- var p = Dom.getXY( el ); >- >- this.initPageX = p[0] - dx; >- this.initPageY = p[1] - dy; >- >- this.lastPageX = p[0]; >- this.lastPageY = p[1]; >- >- >- >- this.setStartPosition(p); >- }, >- >- /** >- * Sets the start position of the element. This is set when the obj >- * is initialized, the reset when a drag is started. >- * @method setStartPosition >- * @param pos current position (from previous lookup) >- * @private >- */ >- setStartPosition: function(pos) { >- var p = pos || Dom.getXY(this.getEl()); >- >- this.deltaSetXY = null; >- >- this.startPageX = p[0]; >- this.startPageY = p[1]; >- }, >- >- /** >- * Add this instance to a group of related drag/drop objects. All >- * instances belong to at least one group, and can belong to as many >- * groups as needed. >- * @method addToGroup >- * @param sGroup {string} the name of the group >- */ >- addToGroup: function(sGroup) { >- this.groups[sGroup] = true; >- this.DDM.regDragDrop(this, sGroup); >- }, >- >- /** >- * Remove's this instance from the supplied interaction group >- * @method removeFromGroup >- * @param {string} sGroup The group to drop >- */ >- removeFromGroup: function(sGroup) { >- if (this.groups[sGroup]) { >- delete this.groups[sGroup]; >- } >- >- this.DDM.removeDDFromGroup(this, sGroup); >- }, >- >- /** >- * Allows you to specify that an element other than the linked element >- * will be moved with the cursor during a drag >- * @method setDragElId >- * @param id {string} the id of the element that will be used to initiate the drag >- */ >- setDragElId: function(id) { >- this.dragElId = id; >- }, >- >- /** >- * Allows you to specify a child of the linked element that should be >- * used to initiate the drag operation. An example of this would be if >- * you have a content div with text and links. Clicking anywhere in the >- * content area would normally start the drag operation. Use this method >- * to specify that an element inside of the content div is the element >- * that starts the drag operation. >- * @method setHandleElId >- * @param id {string} the id of the element that will be used to >- * initiate the drag. >- */ >- setHandleElId: function(id) { >- if (typeof id !== "string") { >- id = Dom.generateId(id); >- } >- this.handleElId = id; >- this.DDM.regHandle(this.id, id); >- }, >- >- /** >- * Allows you to set an element outside of the linked element as a drag >- * handle >- * @method setOuterHandleElId >- * @param id the id of the element that will be used to initiate the drag >- */ >- setOuterHandleElId: function(id) { >- if (typeof id !== "string") { >- id = Dom.generateId(id); >- } >- Event.on(id, "mousedown", >- this.handleMouseDown, this, true); >- this.setHandleElId(id); >- >- this.hasOuterHandles = true; >- }, >- >- /** >- * Remove all drag and drop hooks for this element >- * @method unreg >- */ >- unreg: function() { >- Event.removeListener(this.id, "mousedown", >- this.handleMouseDown); >- this._domRef = null; >- this.DDM._remove(this); >- }, >- >- /** >- * Returns true if this instance is locked, or the drag drop mgr is locked >- * (meaning that all drag/drop is disabled on the page.) >- * @method isLocked >- * @return {boolean} true if this obj or all drag/drop is locked, else >- * false >- */ >- isLocked: function() { >- return (this.DDM.isLocked() || this.locked); >- }, >- >- /** >- * Fired when this object is clicked >- * @method handleMouseDown >- * @param {Event} e >- * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj) >- * @private >- */ >- handleMouseDown: function(e, oDD) { >- >- var button = e.which || e.button; >- >- if (this.primaryButtonOnly && button > 1) { >- return; >- } >- >- if (this.isLocked()) { >- return; >- } >- >- >- >- // firing the mousedown events prior to calculating positions >- var b4Return = this.b4MouseDown(e), >- b4Return2 = true; >- >- if (this.events.b4MouseDown) { >- b4Return2 = this.fireEvent('b4MouseDownEvent', e); >- } >- var mDownReturn = this.onMouseDown(e), >- mDownReturn2 = true; >- if (this.events.mouseDown) { >- mDownReturn2 = this.fireEvent('mouseDownEvent', e); >- } >- >- if ((b4Return === false) || (mDownReturn === false) || (b4Return2 === false) || (mDownReturn2 === false)) { >- return; >- } >- >- this.DDM.refreshCache(this.groups); >- // var self = this; >- // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0); >- >- // Only process the event if we really clicked within the linked >- // element. The reason we make this check is that in the case that >- // another element was moved between the clicked element and the >- // cursor in the time between the mousedown and mouseup events. When >- // this happens, the element gets the next mousedown event >- // regardless of where on the screen it happened. >- var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e)); >- if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) { >- } else { >- if (this.clickValidator(e)) { >- >- >- // set the initial element position >- this.setStartPosition(); >- >- // start tracking mousemove distance and mousedown time to >- // determine when to start the actual drag >- this.DDM.handleMouseDown(e, this); >- >- // this mousedown is mine >- this.DDM.stopEvent(e); >- } else { >- >- >- } >- } >- }, >- >- /** >- * @method clickValidator >- * @description Method validates that the clicked element >- * was indeed the handle or a valid child of the handle >- * @param {Event} e >- */ >- clickValidator: function(e) { >- var target = YAHOO.util.Event.getTarget(e); >- return ( this.isValidHandleChild(target) && >- (this.id == this.handleElId || >- this.DDM.handleWasClicked(target, this.id)) ); >- }, >- >- /** >- * Finds the location the element should be placed if we want to move >- * it to where the mouse location less the click offset would place us. >- * @method getTargetCoord >- * @param {int} iPageX the X coordinate of the click >- * @param {int} iPageY the Y coordinate of the click >- * @return an object that contains the coordinates (Object.x and Object.y) >- * @private >- */ >- getTargetCoord: function(iPageX, iPageY) { >- >- >- var x = iPageX - this.deltaX; >- var y = iPageY - this.deltaY; >- >- if (this.constrainX) { >- if (x < this.minX) { x = this.minX; } >- if (x > this.maxX) { x = this.maxX; } >- } >- >- if (this.constrainY) { >- if (y < this.minY) { y = this.minY; } >- if (y > this.maxY) { y = this.maxY; } >- } >- >- x = this.getTick(x, this.xTicks); >- y = this.getTick(y, this.yTicks); >- >- >- return {x:x, y:y}; >- }, >- >- /** >- * Allows you to specify a tag name that should not start a drag operation >- * when clicked. This is designed to facilitate embedding links within a >- * drag handle that do something other than start the drag. >- * @method addInvalidHandleType >- * @param {string} tagName the type of element to exclude >- */ >- addInvalidHandleType: function(tagName) { >- var type = tagName.toUpperCase(); >- this.invalidHandleTypes[type] = type; >- }, >- >- /** >- * Lets you to specify an element id for a child of a drag handle >- * that should not initiate a drag >- * @method addInvalidHandleId >- * @param {string} id the element id of the element you wish to ignore >- */ >- addInvalidHandleId: function(id) { >- if (typeof id !== "string") { >- id = Dom.generateId(id); >- } >- this.invalidHandleIds[id] = id; >- }, >- >- >- /** >- * Lets you specify a css class of elements that will not initiate a drag >- * @method addInvalidHandleClass >- * @param {string} cssClass the class of the elements you wish to ignore >- */ >- addInvalidHandleClass: function(cssClass) { >- this.invalidHandleClasses.push(cssClass); >- }, >- >- /** >- * Unsets an excluded tag name set by addInvalidHandleType >- * @method removeInvalidHandleType >- * @param {string} tagName the type of element to unexclude >- */ >- removeInvalidHandleType: function(tagName) { >- var type = tagName.toUpperCase(); >- // this.invalidHandleTypes[type] = null; >- delete this.invalidHandleTypes[type]; >- }, >- >- /** >- * Unsets an invalid handle id >- * @method removeInvalidHandleId >- * @param {string} id the id of the element to re-enable >- */ >- removeInvalidHandleId: function(id) { >- if (typeof id !== "string") { >- id = Dom.generateId(id); >- } >- delete this.invalidHandleIds[id]; >- }, >- >- /** >- * Unsets an invalid css class >- * @method removeInvalidHandleClass >- * @param {string} cssClass the class of the element(s) you wish to >- * re-enable >- */ >- removeInvalidHandleClass: function(cssClass) { >- for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) { >- if (this.invalidHandleClasses[i] == cssClass) { >- delete this.invalidHandleClasses[i]; >- } >- } >- }, >- >- /** >- * Checks the tag exclusion list to see if this click should be ignored >- * @method isValidHandleChild >- * @param {HTMLElement} node the HTMLElement to evaluate >- * @return {boolean} true if this is a valid tag type, false if not >- */ >- isValidHandleChild: function(node) { >- >- var valid = true; >- // var n = (node.nodeName == "#text") ? node.parentNode : node; >- var nodeName; >- try { >- nodeName = node.nodeName.toUpperCase(); >- } catch(e) { >- nodeName = node.nodeName; >- } >- valid = valid && !this.invalidHandleTypes[nodeName]; >- valid = valid && !this.invalidHandleIds[node.id]; >- >- for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) { >- valid = !Dom.hasClass(node, this.invalidHandleClasses[i]); >- } >- >- >- return valid; >- >- }, >- >- /** >- * Create the array of horizontal tick marks if an interval was specified >- * in setXConstraint(). >- * @method setXTicks >- * @private >- */ >- setXTicks: function(iStartX, iTickSize) { >- this.xTicks = []; >- this.xTickSize = iTickSize; >- >- var tickMap = {}; >- >- for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) { >- if (!tickMap[i]) { >- this.xTicks[this.xTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) { >- if (!tickMap[i]) { >- this.xTicks[this.xTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- this.xTicks.sort(this.DDM.numericSort) ; >- }, >- >- /** >- * Create the array of vertical tick marks if an interval was specified in >- * setYConstraint(). >- * @method setYTicks >- * @private >- */ >- setYTicks: function(iStartY, iTickSize) { >- this.yTicks = []; >- this.yTickSize = iTickSize; >- >- var tickMap = {}; >- >- for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) { >- if (!tickMap[i]) { >- this.yTicks[this.yTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) { >- if (!tickMap[i]) { >- this.yTicks[this.yTicks.length] = i; >- tickMap[i] = true; >- } >- } >- >- this.yTicks.sort(this.DDM.numericSort) ; >- }, >- >- /** >- * By default, the element can be dragged any place on the screen. Use >- * this method to limit the horizontal travel of the element. Pass in >- * 0,0 for the parameters if you want to lock the drag to the y axis. >- * @method setXConstraint >- * @param {int} iLeft the number of pixels the element can move to the left >- * @param {int} iRight the number of pixels the element can move to the >- * right >- * @param {int} iTickSize optional parameter for specifying that the >- * element >- * should move iTickSize pixels at a time. >- */ >- setXConstraint: function(iLeft, iRight, iTickSize) { >- this.leftConstraint = parseInt(iLeft, 10); >- this.rightConstraint = parseInt(iRight, 10); >- >- this.minX = this.initPageX - this.leftConstraint; >- this.maxX = this.initPageX + this.rightConstraint; >- if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); } >- >- this.constrainX = true; >- }, >- >- /** >- * Clears any constraints applied to this instance. Also clears ticks >- * since they can't exist independent of a constraint at this time. >- * @method clearConstraints >- */ >- clearConstraints: function() { >- this.constrainX = false; >- this.constrainY = false; >- this.clearTicks(); >- }, >- >- /** >- * Clears any tick interval defined for this instance >- * @method clearTicks >- */ >- clearTicks: function() { >- this.xTicks = null; >- this.yTicks = null; >- this.xTickSize = 0; >- this.yTickSize = 0; >- }, >- >- /** >- * By default, the element can be dragged any place on the screen. Set >- * this to limit the vertical travel of the element. Pass in 0,0 for the >- * parameters if you want to lock the drag to the x axis. >- * @method setYConstraint >- * @param {int} iUp the number of pixels the element can move up >- * @param {int} iDown the number of pixels the element can move down >- * @param {int} iTickSize optional parameter for specifying that the >- * element should move iTickSize pixels at a time. >- */ >- setYConstraint: function(iUp, iDown, iTickSize) { >- this.topConstraint = parseInt(iUp, 10); >- this.bottomConstraint = parseInt(iDown, 10); >- >- this.minY = this.initPageY - this.topConstraint; >- this.maxY = this.initPageY + this.bottomConstraint; >- if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); } >- >- this.constrainY = true; >- >- }, >- >- /** >- * resetConstraints must be called if you manually reposition a dd element. >- * @method resetConstraints >- */ >- resetConstraints: function() { >- >- >- // Maintain offsets if necessary >- if (this.initPageX || this.initPageX === 0) { >- // figure out how much this thing has moved >- var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0; >- var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0; >- >- this.setInitPosition(dx, dy); >- >- // This is the first time we have detected the element's position >- } else { >- this.setInitPosition(); >- } >- >- if (this.constrainX) { >- this.setXConstraint( this.leftConstraint, >- this.rightConstraint, >- this.xTickSize ); >- } >- >- if (this.constrainY) { >- this.setYConstraint( this.topConstraint, >- this.bottomConstraint, >- this.yTickSize ); >- } >- }, >- >- /** >- * Normally the drag element is moved pixel by pixel, but we can specify >- * that it move a number of pixels at a time. This method resolves the >- * location when we have it set up like this. >- * @method getTick >- * @param {int} val where we want to place the object >- * @param {int[]} tickArray sorted array of valid points >- * @return {int} the closest tick >- * @private >- */ >- getTick: function(val, tickArray) { >- >- if (!tickArray) { >- // If tick interval is not defined, it is effectively 1 pixel, >- // so we return the value passed to us. >- return val; >- } else if (tickArray[0] >= val) { >- // The value is lower than the first tick, so we return the first >- // tick. >- return tickArray[0]; >- } else { >- for (var i=0, len=tickArray.length; i<len; ++i) { >- var next = i + 1; >- if (tickArray[next] && tickArray[next] >= val) { >- var diff1 = val - tickArray[i]; >- var diff2 = tickArray[next] - val; >- return (diff2 > diff1) ? tickArray[i] : tickArray[next]; >- } >- } >- >- // The value is larger than the last tick, so we return the last >- // tick. >- return tickArray[tickArray.length - 1]; >- } >- }, >- >- /** >- * toString method >- * @method toString >- * @return {string} string representation of the dd obj >- */ >- toString: function() { >- return ("DragDrop " + this.id); >- } >- >-}; >-YAHOO.augment(YAHOO.util.DragDrop, YAHOO.util.EventProvider); >- >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-})(); >-/** >- * A DragDrop implementation where the linked element follows the >- * mouse cursor during a drag. >- * @class DD >- * @extends YAHOO.util.DragDrop >- * @constructor >- * @param {String} id the id of the linked element >- * @param {String} sGroup the group of related DragDrop items >- * @param {object} config an object containing configurable attributes >- * Valid properties for DD: >- * scroll >- */ >-YAHOO.util.DD = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- } >-}; >- >-YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, { >- >- /** >- * When set to true, the utility automatically tries to scroll the browser >- * window when a drag and drop element is dragged near the viewport boundary. >- * Defaults to true. >- * @property scroll >- * @type boolean >- */ >- scroll: true, >- >- /** >- * Sets the pointer offset to the distance between the linked element's top >- * left corner and the location the element was clicked >- * @method autoOffset >- * @param {int} iPageX the X coordinate of the click >- * @param {int} iPageY the Y coordinate of the click >- */ >- autoOffset: function(iPageX, iPageY) { >- var x = iPageX - this.startPageX; >- var y = iPageY - this.startPageY; >- this.setDelta(x, y); >- }, >- >- /** >- * Sets the pointer offset. You can call this directly to force the >- * offset to be in a particular location (e.g., pass in 0,0 to set it >- * to the center of the object, as done in YAHOO.widget.Slider) >- * @method setDelta >- * @param {int} iDeltaX the distance from the left >- * @param {int} iDeltaY the distance from the top >- */ >- setDelta: function(iDeltaX, iDeltaY) { >- this.deltaX = iDeltaX; >- this.deltaY = iDeltaY; >- }, >- >- /** >- * Sets the drag element to the location of the mousedown or click event, >- * maintaining the cursor location relative to the location on the element >- * that was clicked. Override this if you want to place the element in a >- * location other than where the cursor is. >- * @method setDragElPos >- * @param {int} iPageX the X coordinate of the mousedown or drag event >- * @param {int} iPageY the Y coordinate of the mousedown or drag event >- */ >- setDragElPos: function(iPageX, iPageY) { >- // the first time we do this, we are going to check to make sure >- // the element has css positioning >- >- var el = this.getDragEl(); >- this.alignElWithMouse(el, iPageX, iPageY); >- }, >- >- /** >- * Sets the element to the location of the mousedown or click event, >- * maintaining the cursor location relative to the location on the element >- * that was clicked. Override this if you want to place the element in a >- * location other than where the cursor is. >- * @method alignElWithMouse >- * @param {HTMLElement} el the element to move >- * @param {int} iPageX the X coordinate of the mousedown or drag event >- * @param {int} iPageY the Y coordinate of the mousedown or drag event >- */ >- alignElWithMouse: function(el, iPageX, iPageY) { >- var oCoord = this.getTargetCoord(iPageX, iPageY); >- >- if (!this.deltaSetXY) { >- var aCoord = [oCoord.x, oCoord.y]; >- YAHOO.util.Dom.setXY(el, aCoord); >- >- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); >- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); >- >- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ]; >- } else { >- YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px"); >- YAHOO.util.Dom.setStyle(el, "top", (oCoord.y + this.deltaSetXY[1]) + "px"); >- } >- >- this.cachePosition(oCoord.x, oCoord.y); >- var self = this; >- setTimeout(function() { >- self.autoScroll.call(self, oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth); >- }, 0); >- }, >- >- /** >- * Saves the most recent position so that we can reset the constraints and >- * tick marks on-demand. We need to know this so that we can calculate the >- * number of pixels the element is offset from its original position. >- * @method cachePosition >- * @param iPageX the current x position (optional, this just makes it so we >- * don't have to look it up again) >- * @param iPageY the current y position (optional, this just makes it so we >- * don't have to look it up again) >- */ >- cachePosition: function(iPageX, iPageY) { >- if (iPageX) { >- this.lastPageX = iPageX; >- this.lastPageY = iPageY; >- } else { >- var aCoord = YAHOO.util.Dom.getXY(this.getEl()); >- this.lastPageX = aCoord[0]; >- this.lastPageY = aCoord[1]; >- } >- }, >- >- /** >- * Auto-scroll the window if the dragged object has been moved beyond the >- * visible window boundary. >- * @method autoScroll >- * @param {int} x the drag element's x position >- * @param {int} y the drag element's y position >- * @param {int} h the height of the drag element >- * @param {int} w the width of the drag element >- * @private >- */ >- autoScroll: function(x, y, h, w) { >- >- if (this.scroll) { >- // The client height >- var clientH = this.DDM.getClientHeight(); >- >- // The client width >- var clientW = this.DDM.getClientWidth(); >- >- // The amt scrolled down >- var st = this.DDM.getScrollTop(); >- >- // The amt scrolled right >- var sl = this.DDM.getScrollLeft(); >- >- // Location of the bottom of the element >- var bot = h + y; >- >- // Location of the right of the element >- var right = w + x; >- >- // The distance from the cursor to the bottom of the visible area, >- // adjusted so that we don't scroll if the cursor is beyond the >- // element drag constraints >- var toBot = (clientH + st - y - this.deltaY); >- >- // The distance from the cursor to the right of the visible area >- var toRight = (clientW + sl - x - this.deltaX); >- >- >- // How close to the edge the cursor must be before we scroll >- // var thresh = (document.all) ? 100 : 40; >- var thresh = 40; >- >- // How many pixels to scroll per autoscroll op. This helps to reduce >- // clunky scrolling. IE is more sensitive about this ... it needs this >- // value to be higher. >- var scrAmt = (document.all) ? 80 : 30; >- >- // Scroll down if we are near the bottom of the visible page and the >- // obj extends below the crease >- if ( bot > clientH && toBot < thresh ) { >- window.scrollTo(sl, st + scrAmt); >- } >- >- // Scroll up if the window is scrolled down and the top of the object >- // goes above the top border >- if ( y < st && st > 0 && y - st < thresh ) { >- window.scrollTo(sl, st - scrAmt); >- } >- >- // Scroll right if the obj is beyond the right border and the cursor is >- // near the border. >- if ( right > clientW && toRight < thresh ) { >- window.scrollTo(sl + scrAmt, st); >- } >- >- // Scroll left if the window has been scrolled to the right and the obj >- // extends past the left border >- if ( x < sl && sl > 0 && x - sl < thresh ) { >- window.scrollTo(sl - scrAmt, st); >- } >- } >- }, >- >- /* >- * Sets up config options specific to this class. Overrides >- * YAHOO.util.DragDrop, but all versions of this method through the >- * inheritance chain are called >- */ >- applyConfig: function() { >- YAHOO.util.DD.superclass.applyConfig.call(this); >- this.scroll = (this.config.scroll !== false); >- }, >- >- /* >- * Event that fires prior to the onMouseDown event. Overrides >- * YAHOO.util.DragDrop. >- */ >- b4MouseDown: function(e) { >- this.setStartPosition(); >- // this.resetConstraints(); >- this.autoOffset(YAHOO.util.Event.getPageX(e), >- YAHOO.util.Event.getPageY(e)); >- }, >- >- /* >- * Event that fires prior to the onDrag event. Overrides >- * YAHOO.util.DragDrop. >- */ >- b4Drag: function(e) { >- this.setDragElPos(YAHOO.util.Event.getPageX(e), >- YAHOO.util.Event.getPageY(e)); >- }, >- >- toString: function() { >- return ("DD " + this.id); >- } >- >- ////////////////////////////////////////////////////////////////////////// >- // Debugging ygDragDrop events that can be overridden >- ////////////////////////////////////////////////////////////////////////// >- /* >- startDrag: function(x, y) { >- }, >- >- onDrag: function(e) { >- }, >- >- onDragEnter: function(e, id) { >- }, >- >- onDragOver: function(e, id) { >- }, >- >- onDragOut: function(e, id) { >- }, >- >- onDragDrop: function(e, id) { >- }, >- >- endDrag: function(e) { >- } >- >- */ >- >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-}); >-/** >- * A DragDrop implementation that inserts an empty, bordered div into >- * the document that follows the cursor during drag operations. At the time of >- * the click, the frame div is resized to the dimensions of the linked html >- * element, and moved to the exact location of the linked element. >- * >- * References to the "frame" element refer to the single proxy element that >- * was created to be dragged in place of all DDProxy elements on the >- * page. >- * >- * @class DDProxy >- * @extends YAHOO.util.DD >- * @constructor >- * @param {String} id the id of the linked html element >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DDProxy in addition to those in DragDrop: >- * resizeFrame, centerFrame, dragElId >- */ >-YAHOO.util.DDProxy = function(id, sGroup, config) { >- if (id) { >- this.init(id, sGroup, config); >- this.initFrame(); >- } >-}; >- >-/** >- * The default drag frame div id >- * @property YAHOO.util.DDProxy.dragElId >- * @type String >- * @static >- */ >-YAHOO.util.DDProxy.dragElId = "ygddfdiv"; >- >-YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, { >- >- /** >- * By default we resize the drag frame to be the same size as the element >- * we want to drag (this is to get the frame effect). We can turn it off >- * if we want a different behavior. >- * @property resizeFrame >- * @type boolean >- */ >- resizeFrame: true, >- >- /** >- * By default the frame is positioned exactly where the drag element is, so >- * we use the cursor offset provided by YAHOO.util.DD. Another option that works only if >- * you do not have constraints on the obj is to have the drag frame centered >- * around the cursor. Set centerFrame to true for this effect. >- * @property centerFrame >- * @type boolean >- */ >- centerFrame: false, >- >- /** >- * Creates the proxy element if it does not yet exist >- * @method createFrame >- */ >- createFrame: function() { >- var self=this, body=document.body; >- >- if (!body || !body.firstChild) { >- setTimeout( function() { self.createFrame(); }, 50 ); >- return; >- } >- >- var div=this.getDragEl(), Dom=YAHOO.util.Dom; >- >- if (!div) { >- div = document.createElement("div"); >- div.id = this.dragElId; >- var s = div.style; >- >- s.position = "absolute"; >- s.visibility = "hidden"; >- s.cursor = "move"; >- s.border = "2px solid #aaa"; >- s.zIndex = 999; >- s.height = "25px"; >- s.width = "25px"; >- >- var _data = document.createElement('div'); >- Dom.setStyle(_data, 'height', '100%'); >- Dom.setStyle(_data, 'width', '100%'); >- /** >- * If the proxy element has no background-color, then it is considered to the "transparent" by Internet Explorer. >- * Since it is "transparent" then the events pass through it to the iframe below. >- * So creating a "fake" div inside the proxy element and giving it a background-color, then setting it to an >- * opacity of 0, it appears to not be there, however IE still thinks that it is so the events never pass through. >- */ >- Dom.setStyle(_data, 'background-color', '#ccc'); >- Dom.setStyle(_data, 'opacity', '0'); >- div.appendChild(_data); >- >- // appendChild can blow up IE if invoked prior to the window load event >- // while rendering a table. It is possible there are other scenarios >- // that would cause this to happen as well. >- body.insertBefore(div, body.firstChild); >- } >- }, >- >- /** >- * Initialization for the drag frame element. Must be called in the >- * constructor of all subclasses >- * @method initFrame >- */ >- initFrame: function() { >- this.createFrame(); >- }, >- >- applyConfig: function() { >- YAHOO.util.DDProxy.superclass.applyConfig.call(this); >- >- this.resizeFrame = (this.config.resizeFrame !== false); >- this.centerFrame = (this.config.centerFrame); >- this.setDragElId(this.config.dragElId || YAHOO.util.DDProxy.dragElId); >- }, >- >- /** >- * Resizes the drag frame to the dimensions of the clicked object, positions >- * it over the object, and finally displays it >- * @method showFrame >- * @param {int} iPageX X click position >- * @param {int} iPageY Y click position >- * @private >- */ >- showFrame: function(iPageX, iPageY) { >- var el = this.getEl(); >- var dragEl = this.getDragEl(); >- var s = dragEl.style; >- >- this._resizeProxy(); >- >- if (this.centerFrame) { >- this.setDelta( Math.round(parseInt(s.width, 10)/2), >- Math.round(parseInt(s.height, 10)/2) ); >- } >- >- this.setDragElPos(iPageX, iPageY); >- >- YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); >- }, >- >- /** >- * The proxy is automatically resized to the dimensions of the linked >- * element when a drag is initiated, unless resizeFrame is set to false >- * @method _resizeProxy >- * @private >- */ >- _resizeProxy: function() { >- if (this.resizeFrame) { >- var DOM = YAHOO.util.Dom; >- var el = this.getEl(); >- var dragEl = this.getDragEl(); >- >- var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth" ), 10); >- var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth" ), 10); >- var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10); >- var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth" ), 10); >- >- if (isNaN(bt)) { bt = 0; } >- if (isNaN(br)) { br = 0; } >- if (isNaN(bb)) { bb = 0; } >- if (isNaN(bl)) { bl = 0; } >- >- >- var newWidth = Math.max(0, el.offsetWidth - br - bl); >- var newHeight = Math.max(0, el.offsetHeight - bt - bb); >- >- >- DOM.setStyle( dragEl, "width", newWidth + "px" ); >- DOM.setStyle( dragEl, "height", newHeight + "px" ); >- } >- }, >- >- // overrides YAHOO.util.DragDrop >- b4MouseDown: function(e) { >- this.setStartPosition(); >- var x = YAHOO.util.Event.getPageX(e); >- var y = YAHOO.util.Event.getPageY(e); >- this.autoOffset(x, y); >- >- // This causes the autoscroll code to kick off, which means autoscroll can >- // happen prior to the check for a valid drag handle. >- // this.setDragElPos(x, y); >- }, >- >- // overrides YAHOO.util.DragDrop >- b4StartDrag: function(x, y) { >- // show the drag frame >- this.showFrame(x, y); >- }, >- >- // overrides YAHOO.util.DragDrop >- b4EndDrag: function(e) { >- YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); >- }, >- >- // overrides YAHOO.util.DragDrop >- // By default we try to move the element to the last location of the frame. >- // This is so that the default behavior mirrors that of YAHOO.util.DD. >- endDrag: function(e) { >- var DOM = YAHOO.util.Dom; >- var lel = this.getEl(); >- var del = this.getDragEl(); >- >- // Show the drag frame briefly so we can get its position >- // del.style.visibility = ""; >- DOM.setStyle(del, "visibility", ""); >- >- // Hide the linked element before the move to get around a Safari >- // rendering bug. >- //lel.style.visibility = "hidden"; >- DOM.setStyle(lel, "visibility", "hidden"); >- YAHOO.util.DDM.moveToEl(lel, del); >- //del.style.visibility = "hidden"; >- DOM.setStyle(del, "visibility", "hidden"); >- //lel.style.visibility = ""; >- DOM.setStyle(lel, "visibility", ""); >- }, >- >- toString: function() { >- return ("DDProxy " + this.id); >- } >-/** >-* @event mouseDownEvent >-* @description Provides access to the mousedown event. The mousedown does not always result in a drag operation. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4MouseDownEvent >-* @description Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event mouseUpEvent >-* @description Fired from inside DragDropMgr when the drag operation is finished. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4StartDragEvent >-* @description Fires before the startDragEvent, returning false will cancel the startDrag Event. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event startDragEvent >-* @description Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event b4EndDragEvent >-* @description Fires before the endDragEvent. Returning false will cancel. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event endDragEvent >-* @description Fires on the mouseup event after a drag has been initiated (startDrag fired). >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-/** >-* @event dragEvent >-* @description Occurs every mousemove event while dragging. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragEvent >-* @description Fires before the dragEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event invalidDropEvent >-* @description Fires when the dragged objects is dropped in a location that contains no drop targets. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOutEvent >-* @description Fires before the dragOutEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOutEvent >-* @description Fires when a dragged object is no longer over an object that had the onDragEnter fire. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragEnterEvent >-* @description Occurs when the dragged object first interacts with another targettable drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragOverEvent >-* @description Fires before the dragOverEvent. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragOverEvent >-* @description Fires every mousemove event while over a drag and drop object. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event b4DragDropEvent >-* @description Fires before the dragDropEvent >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >-/** >-* @event dragDropEvent >-* @description Fires when the dragged objects is dropped on another. >-* @type YAHOO.util.CustomEvent See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event. >-*/ >- >-}); >-/** >- * A DragDrop implementation that does not move, but can be a drop >- * target. You would get the same result by simply omitting implementation >- * for the event callbacks, but this way we reduce the processing cost of the >- * event listener and the callbacks. >- * @class DDTarget >- * @extends YAHOO.util.DragDrop >- * @constructor >- * @param {String} id the id of the element that is a drop target >- * @param {String} sGroup the group of related DragDrop objects >- * @param {object} config an object containing configurable attributes >- * Valid properties for DDTarget in addition to those in >- * DragDrop: >- * none >- */ >-YAHOO.util.DDTarget = function(id, sGroup, config) { >- if (id) { >- this.initTarget(id, sGroup, config); >- } >-}; >- >-// YAHOO.util.DDTarget.prototype = new YAHOO.util.DragDrop(); >-YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, { >- toString: function() { >- return ("DDTarget " + this.id); >- } >-}); >-YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/element/element-beta-min.js b/koha-tmpl/intranet-tmpl/lib/yui/element/element-beta-min.js >deleted file mode 100644 >index 443bca78ea..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/element/element-beta-min.js >+++ /dev/null >@@ -1,8 +0,0 @@ >-/* >-Copyright (c) 2008, Yahoo! Inc. All rights reserved. >-Code licensed under the BSD License: >-http://developer.yahoo.net/yui/license.txt >-version: 2.5.1 >-*/ >-YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(this._configs[E[D]]&&!A.isUndefined(this._configs[E[D]].value)&&!A.isNull(this._configs[E[D]].value)){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var D=YAHOO.util.Dom,F=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(G,H){if(arguments.length){this.init(G,H);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(G){G=G.get?G.get("element"):G;this.get("element").appendChild(G);},getElementsByTagName:function(G){return this.get("element").getElementsByTagName(G);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(G,H){G=G.get?G.get("element"):G;H=(H&&H.get)?H.get("element"):H;this.get("element").insertBefore(G,H);},removeChild:function(G){G=G.get?G.get("element"):G;this.get("element").removeChild(G);return true;},replaceChild:function(G,H){G=G.get?G.get("element"):G;H=H.get?H.get("element"):H;return this.get("element").replaceChild(G,H);},initAttributes:function(G){},addListener:function(K,J,L,I){var H=this.get("element");I=I||this;H=this.get("id")||H;var G=this;if(!this._events[K]){if(this.DOM_EVENTS[K]){YAHOO.util.Event.addListener(H,K,function(M){if(M.srcElement&&!M.target){M.target=M.srcElement;}G.fireEvent(K,M);},L,I);}this.createEvent(K,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(H,G){this.unsubscribe.apply(this,arguments);},addClass:function(G){D.addClass(this.get("element"),G);},getElementsByClassName:function(H,G){return D.getElementsByClassName(H,G,this.get("element"));},hasClass:function(G){return D.hasClass(this.get("element"),G);},removeClass:function(G){return D.removeClass(this.get("element"),G);},replaceClass:function(H,G){return D.replaceClass(this.get("element"),H,G);},setStyle:function(I,H){var G=this.get("element");if(!G){return this._queue[this._queue.length]=["setStyle",arguments];}return D.setStyle(G,I,H);},getStyle:function(G){return D.getStyle(this.get("element"),G);},fireQueue:function(){var H=this._queue;for(var I=0,G=H.length;I<G;++I){this[H[I][0]].apply(this,H[I][1]);}},appendTo:function(H,I){H=(H.get)?H.get("element"):D.get(H);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:H});I=(I&&I.get)?I.get("element"):D.get(I);var G=this.get("element");if(!G){return false;}if(!H){return false;}if(G.parent!=H){if(I){H.insertBefore(G,I);}else{H.appendChild(G);}}this.fireEvent("appendTo",{type:"appendTo",target:H});},get:function(G){var I=this._configs||{};var H=I.element;if(H&&!I[G]&&!YAHOO.lang.isUndefined(H.value[G])){return H.value[G];}return F.prototype.get.call(this,G);},setAttributes:function(L,H){var K=this.get("element"); >-for(var J in L){if(!this._configs[J]&&!YAHOO.lang.isUndefined(K[J])){this.setAttributeConfig(J);}}for(var I=0,G=this._configOrder.length;I<G;++I){if(L[this._configOrder[I]]!==undefined){this.set(this._configOrder[I],L[this._configOrder[I]],H);}}},set:function(H,J,G){var I=this.get("element");if(!I){this._queue[this._queue.length]=["set",arguments];if(this._configs[H]){this._configs[H].value=J;}return ;}if(!this._configs[H]&&!YAHOO.lang.isUndefined(I[H])){C.call(this,H);}return F.prototype.set.apply(this,arguments);},setAttributeConfig:function(G,I,J){var H=this.get("element");if(H&&!this._configs[G]&&!YAHOO.lang.isUndefined(H[G])){C.call(this,G,I);}else{F.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(G);},getAttributeKeys:function(){var H=this.get("element");var I=F.prototype.getAttributeKeys.call(this);for(var G in H){if(!this._configs[G]){I[G]=I[G]||H[G];}}return I;},createEvent:function(H,G){this._events[H]=true;F.prototype.createEvent.apply(this,arguments);},init:function(H,G){A.apply(this,arguments);}};var A=function(H,G){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];G=G||{};G.element=G.element||H||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var I=false;if(YAHOO.lang.isString(H)){C.call(this,"id",{value:G.element});}if(D.get(H)){I=true;E.call(this,G);B.call(this,G);}YAHOO.util.Event.onAvailable(G.element,function(){if(!I){E.call(this,G);}this.fireEvent("available",{type:"available",target:G.element});},this,true);YAHOO.util.Event.onContentReady(G.element,function(){if(!I){B.call(this,G);}this.fireEvent("contentReady",{type:"contentReady",target:G.element});},this,true);};var E=function(G){this.setAttributeConfig("element",{value:D.get(G.element),readOnly:true});};var B=function(G){this.initAttributes(G);this.setAttributes(G,true);this.fireQueue();};var C=function(G,I){var H=this.get("element");I=I||{};I.name=G;I.method=I.method||function(J){H[G]=J;};I.value=I.value||H[G];this._configs[G]=new YAHOO.util.Attribute(I,this);};YAHOO.augment(YAHOO.util.Element,F);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.1",build:"984"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/element/element-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/element/element-debug.js >deleted file mode 100644 >index 4691beebe8..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/element/element-debug.js >+++ /dev/null >@@ -1,1106 +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 >-*/ >-/** >- * Provides Attribute configurations. >- * @namespace YAHOO.util >- * @class Attribute >- * @constructor >- * @param hash {Object} The intial Attribute. >- * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance. >- */ >- >-YAHOO.util.Attribute = function(hash, owner) { >- if (owner) { >- this.owner = owner; >- this.configure(hash, true); >- } >-}; >- >-YAHOO.util.Attribute.prototype = { >- /** >- * The name of the attribute. >- * @property name >- * @type String >- */ >- name: undefined, >- >- /** >- * The value of the attribute. >- * @property value >- * @type String >- */ >- value: null, >- >- /** >- * The owner of the attribute. >- * @property owner >- * @type YAHOO.util.AttributeProvider >- */ >- owner: null, >- >- /** >- * Whether or not the attribute is read only. >- * @property readOnly >- * @type Boolean >- */ >- readOnly: false, >- >- /** >- * Whether or not the attribute can only be written once. >- * @property writeOnce >- * @type Boolean >- */ >- writeOnce: false, >- >- /** >- * The attribute's initial configuration. >- * @private >- * @property _initialConfig >- * @type Object >- */ >- _initialConfig: null, >- >- /** >- * Whether or not the attribute's value has been set. >- * @private >- * @property _written >- * @type Boolean >- */ >- _written: false, >- >- /** >- * A function to call when setting the attribute's value. >- * The method receives the new value as the first arg and the attribute name as the 2nd >- * @property method >- * @type Function >- */ >- method: null, >- >- /** >- * The function to use when setting the attribute's value. >- * The setter receives the new value as the first arg and the attribute name as the 2nd >- * The return value of the setter replaces the value passed to set(). >- * @property setter >- * @type Function >- */ >- setter: null, >- >- /** >- * The function to use when getting the attribute's value. >- * The getter receives the new value as the first arg and the attribute name as the 2nd >- * The return value of the getter will be used as the return from get(). >- * @property getter >- * @type Function >- */ >- getter: null, >- >- /** >- * The validator to use when setting the attribute's value. >- * @property validator >- * @type Function >- * @return Boolean >- */ >- validator: null, >- >- /** >- * Retrieves the current value of the attribute. >- * @method getValue >- * @return {any} The current value of the attribute. >- */ >- getValue: function() { >- var val = this.value; >- >- if (this.getter) { >- val = this.getter.call(this.owner, this.name, val); >- } >- >- return val; >- }, >- >- /** >- * Sets the value of the attribute and fires beforeChange and change events. >- * @method setValue >- * @param {Any} value The value to apply to the attribute. >- * @param {Boolean} silent If true the change events will not be fired. >- * @return {Boolean} Whether or not the value was set. >- */ >- setValue: function(value, silent) { >- var beforeRetVal, >- owner = this.owner, >- name = this.name; >- >- var event = { >- type: name, >- prevValue: this.getValue(), >- newValue: value >- }; >- >- if (this.readOnly || ( this.writeOnce && this._written) ) { >- YAHOO.log( 'setValue ' + name + ', ' + value + >- ' failed: read only', 'error', 'Attribute'); >- return false; // write not allowed >- } >- >- if (this.validator && !this.validator.call(owner, value) ) { >- YAHOO.log( 'setValue ' + name + ', ' + value + >- ' validation failed', 'error', 'Attribute'); >- return false; // invalid value >- } >- >- if (!silent) { >- beforeRetVal = owner.fireBeforeChangeEvent(event); >- if (beforeRetVal === false) { >- YAHOO.log('setValue ' + name + >- ' cancelled by beforeChange event', 'info', 'Attribute'); >- return false; >- } >- } >- >- if (this.setter) { >- value = this.setter.call(owner, value, this.name); >- if (value === undefined) { >- YAHOO.log('setter for ' + this.name + ' returned undefined', 'warn', 'Attribute'); >- } >- } >- >- if (this.method) { >- this.method.call(owner, value, this.name); >- } >- >- this.value = value; // TODO: set before calling setter/method? >- this._written = true; >- >- event.type = name; >- >- if (!silent) { >- this.owner.fireChangeEvent(event); >- } >- >- return true; >- }, >- >- /** >- * Allows for configuring the Attribute's properties. >- * @method configure >- * @param {Object} map A key-value map of Attribute properties. >- * @param {Boolean} init Whether or not this should become the initial config. >- */ >- configure: function(map, init) { >- map = map || {}; >- >- if (init) { >- this._written = false; // reset writeOnce >- } >- >- this._initialConfig = this._initialConfig || {}; >- >- for (var key in map) { >- if ( map.hasOwnProperty(key) ) { >- this[key] = map[key]; >- if (init) { >- this._initialConfig[key] = map[key]; >- } >- } >- } >- }, >- >- /** >- * Resets the value to the initial config value. >- * @method resetValue >- * @return {Boolean} Whether or not the value was set. >- */ >- resetValue: function() { >- return this.setValue(this._initialConfig.value); >- }, >- >- /** >- * Resets the attribute config to the initial config state. >- * @method resetConfig >- */ >- resetConfig: function() { >- this.configure(this._initialConfig, true); >- }, >- >- /** >- * Resets the value to the current value. >- * Useful when values may have gotten out of sync with actual properties. >- * @method refresh >- * @return {Boolean} Whether or not the value was set. >- */ >- refresh: function(silent) { >- this.setValue(this.value, silent); >- } >-}; >- >-(function() { >- var Lang = YAHOO.util.Lang; >- >- /* >- Copyright (c) 2006, Yahoo! Inc. All rights reserved. >- Code licensed under the BSD License: >- http://developer.yahoo.net/yui/license.txt >- */ >- >- /** >- * Provides and manages YAHOO.util.Attribute instances >- * @namespace YAHOO.util >- * @class AttributeProvider >- * @uses YAHOO.util.EventProvider >- */ >- YAHOO.util.AttributeProvider = function() {}; >- >- YAHOO.util.AttributeProvider.prototype = { >- >- /** >- * A key-value map of Attribute configurations >- * @property _configs >- * @protected (may be used by subclasses and augmentors) >- * @private >- * @type {Object} >- */ >- _configs: null, >- /** >- * Returns the current value of the attribute. >- * @method get >- * @param {String} key The attribute whose value will be returned. >- * @return {Any} The current value of the attribute. >- */ >- get: function(key){ >- this._configs = this._configs || {}; >- var config = this._configs[key]; >- >- if (!config || !this._configs.hasOwnProperty(key)) { >- YAHOO.log(key + ' not found', 'error', 'AttributeProvider'); >- return null; >- } >- >- return config.getValue(); >- }, >- >- /** >- * Sets the value of a config. >- * @method set >- * @param {String} key The name of the attribute >- * @param {Any} value The value to apply to the attribute >- * @param {Boolean} silent Whether or not to suppress change events >- * @return {Boolean} Whether or not the value was set. >- */ >- set: function(key, value, silent){ >- this._configs = this._configs || {}; >- var config = this._configs[key]; >- >- if (!config) { >- YAHOO.log('set failed: ' + key + ' not found', >- 'error', 'AttributeProvider'); >- return false; >- } >- >- return config.setValue(value, silent); >- }, >- >- /** >- * Returns an array of attribute names. >- * @method getAttributeKeys >- * @return {Array} An array of attribute names. >- */ >- getAttributeKeys: function(){ >- this._configs = this._configs; >- var keys = [], key; >- >- for (key in this._configs) { >- if ( Lang.hasOwnProperty(this._configs, key) && >- !Lang.isUndefined(this._configs[key]) ) { >- keys[keys.length] = key; >- } >- } >- >- return keys; >- }, >- >- /** >- * Sets multiple attribute values. >- * @method setAttributes >- * @param {Object} map A key-value map of attributes >- * @param {Boolean} silent Whether or not to suppress change events >- */ >- setAttributes: function(map, silent){ >- for (var key in map) { >- if ( Lang.hasOwnProperty(map, key) ) { >- this.set(key, map[key], silent); >- } >- } >- }, >- >- /** >- * Resets the specified attribute's value to its initial value. >- * @method resetValue >- * @param {String} key The name of the attribute >- * @param {Boolean} silent Whether or not to suppress change events >- * @return {Boolean} Whether or not the value was set >- */ >- resetValue: function(key, silent){ >- this._configs = this._configs || {}; >- if (this._configs[key]) { >- this.set(key, this._configs[key]._initialConfig.value, silent); >- return true; >- } >- return false; >- }, >- >- /** >- * Sets the attribute's value to its current value. >- * @method refresh >- * @param {String | Array} key The attribute(s) to refresh >- * @param {Boolean} silent Whether or not to suppress change events >- */ >- refresh: function(key, silent) { >- this._configs = this._configs || {}; >- var configs = this._configs; >- >- key = ( ( Lang.isString(key) ) ? [key] : key ) || >- this.getAttributeKeys(); >- >- for (var i = 0, len = key.length; i < len; ++i) { >- if (configs.hasOwnProperty(key[i])) { >- this._configs[key[i]].refresh(silent); >- } >- } >- }, >- >- /** >- * Adds an Attribute to the AttributeProvider instance. >- * @method register >- * @param {String} key The attribute's name >- * @param {Object} map A key-value map containing the >- * attribute's properties. >- * @deprecated Use setAttributeConfig >- */ >- register: function(key, map) { >- this.setAttributeConfig(key, map); >- }, >- >- >- /** >- * Returns the attribute's properties. >- * @method getAttributeConfig >- * @param {String} key The attribute's name >- * @private >- * @return {object} A key-value map containing all of the >- * attribute's properties. >- */ >- getAttributeConfig: function(key) { >- this._configs = this._configs || {}; >- var config = this._configs[key] || {}; >- var map = {}; // returning a copy to prevent overrides >- >- for (key in config) { >- if ( Lang.hasOwnProperty(config, key) ) { >- map[key] = config[key]; >- } >- } >- >- return map; >- }, >- >- /** >- * Sets or updates an Attribute instance's properties. >- * @method setAttributeConfig >- * @param {String} key The attribute's name. >- * @param {Object} map A key-value map of attribute properties >- * @param {Boolean} init Whether or not this should become the intial config. >- */ >- setAttributeConfig: function(key, map, init) { >- this._configs = this._configs || {}; >- map = map || {}; >- if (!this._configs[key]) { >- map.name = key; >- this._configs[key] = this.createAttribute(map); >- } else { >- this._configs[key].configure(map, init); >- } >- }, >- >- /** >- * Sets or updates an Attribute instance's properties. >- * @method configureAttribute >- * @param {String} key The attribute's name. >- * @param {Object} map A key-value map of attribute properties >- * @param {Boolean} init Whether or not this should become the intial config. >- * @deprecated Use setAttributeConfig >- */ >- configureAttribute: function(key, map, init) { >- this.setAttributeConfig(key, map, init); >- }, >- >- /** >- * Resets an attribute to its intial configuration. >- * @method resetAttributeConfig >- * @param {String} key The attribute's name. >- * @private >- */ >- resetAttributeConfig: function(key){ >- this._configs = this._configs || {}; >- this._configs[key].resetConfig(); >- }, >- >- // wrapper for EventProvider.subscribe >- // to create events on the fly >- subscribe: function(type, callback) { >- this._events = this._events || {}; >- >- if ( !(type in this._events) ) { >- this._events[type] = this.createEvent(type); >- } >- >- YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); >- }, >- >- on: function() { >- this.subscribe.apply(this, arguments); >- }, >- >- addListener: function() { >- this.subscribe.apply(this, arguments); >- }, >- >- /** >- * Fires the attribute's beforeChange event. >- * @method fireBeforeChangeEvent >- * @param {String} key The attribute's name. >- * @param {Obj} e The event object to pass to handlers. >- */ >- fireBeforeChangeEvent: function(e) { >- var type = 'before'; >- type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change'; >- e.type = type; >- return this.fireEvent(e.type, e); >- }, >- >- /** >- * Fires the attribute's change event. >- * @method fireChangeEvent >- * @param {String} key The attribute's name. >- * @param {Obj} e The event object to pass to the handlers. >- */ >- fireChangeEvent: function(e) { >- e.type += 'Change'; >- return this.fireEvent(e.type, e); >- }, >- >- createAttribute: function(map) { >- return new YAHOO.util.Attribute(map, this); >- } >- }; >- >- YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider); >-})(); >- >-(function() { >-// internal shorthand >-var Dom = YAHOO.util.Dom, >- AttributeProvider = YAHOO.util.AttributeProvider, >- specialTypes = { >- mouseenter: true, >- mouseleave: true >- }; >- >-/** >- * Element provides an wrapper object to simplify adding >- * event listeners, using dom methods, and managing attributes. >- * @module element >- * @namespace YAHOO.util >- * @requires yahoo, dom, event >- */ >- >-/** >- * Element provides an wrapper object to simplify adding >- * event listeners, using dom methods, and managing attributes. >- * @class Element >- * @uses YAHOO.util.AttributeProvider >- * @constructor >- * @param el {HTMLElement | String} The html element that >- * represents the Element. >- * @param {Object} map A key-value map of initial config names and values >- */ >-var Element = function(el, map) { >- this.init.apply(this, arguments); >-}; >- >-Element.DOM_EVENTS = { >- 'click': true, >- 'dblclick': true, >- 'keydown': true, >- 'keypress': true, >- 'keyup': true, >- 'mousedown': true, >- 'mousemove': true, >- 'mouseout': true, >- 'mouseover': true, >- 'mouseup': true, >- 'mouseenter': true, >- 'mouseleave': true, >- 'focus': true, >- 'blur': true, >- 'submit': true, >- 'change': true >-}; >- >-Element.prototype = { >- /** >- * Dom events supported by the Element instance. >- * @property DOM_EVENTS >- * @type Object >- */ >- DOM_EVENTS: null, >- >- DEFAULT_HTML_SETTER: function(value, key) { >- var el = this.get('element'); >- >- if (el) { >- el[key] = value; >- } >- >- return value; >- >- }, >- >- DEFAULT_HTML_GETTER: function(key) { >- var el = this.get('element'), >- val; >- >- if (el) { >- val = el[key]; >- } >- >- return val; >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method appendChild >- * @param {YAHOO.util.Element || HTMLElement} child The element to append. >- * @return {HTMLElement} The appended DOM element. >- */ >- appendChild: function(child) { >- child = child.get ? child.get('element') : child; >- return this.get('element').appendChild(child); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method getElementsByTagName >- * @param {String} tag The tagName to collect >- * @return {HTMLCollection} A collection of DOM elements. >- */ >- getElementsByTagName: function(tag) { >- return this.get('element').getElementsByTagName(tag); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method hasChildNodes >- * @return {Boolean} Whether or not the element has childNodes >- */ >- hasChildNodes: function() { >- return this.get('element').hasChildNodes(); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method insertBefore >- * @param {HTMLElement} element The HTMLElement to insert >- * @param {HTMLElement} before The HTMLElement to insert >- * the element before. >- * @return {HTMLElement} The inserted DOM element. >- */ >- insertBefore: function(element, before) { >- element = element.get ? element.get('element') : element; >- before = (before && before.get) ? before.get('element') : before; >- >- return this.get('element').insertBefore(element, before); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method removeChild >- * @param {HTMLElement} child The HTMLElement to remove >- * @return {HTMLElement} The removed DOM element. >- */ >- removeChild: function(child) { >- child = child.get ? child.get('element') : child; >- return this.get('element').removeChild(child); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method replaceChild >- * @param {HTMLElement} newNode The HTMLElement to insert >- * @param {HTMLElement} oldNode The HTMLElement to replace >- * @return {HTMLElement} The replaced DOM element. >- */ >- replaceChild: function(newNode, oldNode) { >- newNode = newNode.get ? newNode.get('element') : newNode; >- oldNode = oldNode.get ? oldNode.get('element') : oldNode; >- return this.get('element').replaceChild(newNode, oldNode); >- }, >- >- >- /** >- * Registers Element specific attributes. >- * @method initAttributes >- * @param {Object} map A key-value map of initial attribute configs >- */ >- initAttributes: function(map) { >- }, >- >- /** >- * Adds a listener for the given event. These may be DOM or >- * customEvent listeners. Any event that is fired via fireEvent >- * can be listened for. All handlers receive an event object. >- * @method addListener >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The handler to call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- addListener: function(type, fn, obj, scope) { >- >- scope = scope || this; >- >- var Event = YAHOO.util.Event, >- el = this.get('element') || this.get('id'), >- self = this; >- >- >- if (specialTypes[type] && !Event._createMouseDelegate) { >- YAHOO.log("Using a " + type + " event requires the event-mouseenter module", "error", "Event"); >- return false; >- } >- >- >- if (!this._events[type]) { // create on the fly >- >- if (el && this.DOM_EVENTS[type]) { >- Event.on(el, type, function(e, matchedEl) { >- >- // Supplement IE with target, currentTarget relatedTarget >- >- if (e.srcElement && !e.target) { >- e.target = e.srcElement; >- } >- >- if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) { >- e.relatedTarget = Event.getRelatedTarget(e); >- } >- >- if (!e.currentTarget) { >- e.currentTarget = el; >- } >- >- // Note: matchedEl el is passed back for delegated listeners >- self.fireEvent(type, e, matchedEl); >- >- }, obj, scope); >- } >- this.createEvent(type, {scope: this}); >- } >- >- return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent >- }, >- >- >- /** >- * Alias for addListener >- * @method on >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- on: function() { >- return this.addListener.apply(this, arguments); >- }, >- >- /** >- * Alias for addListener >- * @method subscribe >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- subscribe: function() { >- return this.addListener.apply(this, arguments); >- }, >- >- /** >- * Remove an event listener >- * @method removeListener >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- */ >- removeListener: function(type, fn) { >- return this.unsubscribe.apply(this, arguments); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method addClass >- * @param {String} className The className to add >- */ >- addClass: function(className) { >- Dom.addClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method getElementsByClassName >- * @param {String} className The className to collect >- * @param {String} tag (optional) The tag to use in >- * conjunction with class name >- * @return {Array} Array of HTMLElements >- */ >- getElementsByClassName: function(className, tag) { >- return Dom.getElementsByClassName(className, tag, >- this.get('element') ); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method hasClass >- * @param {String} className The className to add >- * @return {Boolean} Whether or not the element has the class name >- */ >- hasClass: function(className) { >- return Dom.hasClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method removeClass >- * @param {String} className The className to remove >- */ >- removeClass: function(className) { >- return Dom.removeClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method replaceClass >- * @param {String} oldClassName The className to replace >- * @param {String} newClassName The className to add >- */ >- replaceClass: function(oldClassName, newClassName) { >- return Dom.replaceClass(this.get('element'), >- oldClassName, newClassName); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method setStyle >- * @param {String} property The style property to set >- * @param {String} value The value to apply to the style property >- */ >- setStyle: function(property, value) { >- return Dom.setStyle(this.get('element'), property, value); // TODO: always queuing? >- }, >- >- /** >- * Wrapper for Dom method. >- * @method getStyle >- * @param {String} property The style property to retrieve >- * @return {String} The current value of the property >- */ >- getStyle: function(property) { >- return Dom.getStyle(this.get('element'), property); >- }, >- >- /** >- * Apply any queued set calls. >- * @method fireQueue >- */ >- fireQueue: function() { >- var queue = this._queue; >- for (var i = 0, len = queue.length; i < len; ++i) { >- this[queue[i][0]].apply(this, queue[i][1]); >- } >- }, >- >- /** >- * Appends the HTMLElement into either the supplied parentNode. >- * @method appendTo >- * @param {HTMLElement | Element} parentNode The node to append to >- * @param {HTMLElement | Element} before An optional node to insert before >- * @return {HTMLElement} The appended DOM element. >- */ >- appendTo: function(parent, before) { >- parent = (parent.get) ? parent.get('element') : Dom.get(parent); >- >- this.fireEvent('beforeAppendTo', { >- type: 'beforeAppendTo', >- target: parent >- }); >- >- >- before = (before && before.get) ? >- before.get('element') : Dom.get(before); >- var element = this.get('element'); >- >- if (!element) { >- YAHOO.log('appendTo failed: element not available', >- 'error', 'Element'); >- return false; >- } >- >- if (!parent) { >- YAHOO.log('appendTo failed: parent not available', >- 'error', 'Element'); >- return false; >- } >- >- if (element.parent != parent) { >- if (before) { >- parent.insertBefore(element, before); >- } else { >- parent.appendChild(element); >- } >- } >- >- YAHOO.log(element + 'appended to ' + parent); >- >- this.fireEvent('appendTo', { >- type: 'appendTo', >- target: parent >- }); >- >- return element; >- }, >- >- get: function(key) { >- var configs = this._configs || {}, >- el = configs.element; // avoid loop due to 'element' >- >- if (el && !configs[key] && !YAHOO.lang.isUndefined(el.value[key]) ) { >- this._setHTMLAttrConfig(key); >- } >- >- return AttributeProvider.prototype.get.call(this, key); >- }, >- >- setAttributes: function(map, silent) { >- // set based on configOrder >- var done = {}, >- configOrder = this._configOrder; >- >- // set based on configOrder >- for (var i = 0, len = configOrder.length; i < len; ++i) { >- if (map[configOrder[i]] !== undefined) { >- done[configOrder[i]] = true; >- this.set(configOrder[i], map[configOrder[i]], silent); >- } >- } >- >- // unconfigured (e.g. Dom attributes) >- for (var att in map) { >- if (map.hasOwnProperty(att) && !done[att]) { >- this.set(att, map[att], silent); >- } >- } >- }, >- >- set: function(key, value, silent) { >- var el = this.get('element'); >- if (!el) { >- this._queue[this._queue.length] = ['set', arguments]; >- if (this._configs[key]) { >- this._configs[key].value = value; // so "get" works while queueing >- >- } >- return; >- } >- >- // set it on the element if not configured and is an HTML attribute >- if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) { >- this._setHTMLAttrConfig(key); >- } >- >- return AttributeProvider.prototype.set.apply(this, arguments); >- }, >- >- setAttributeConfig: function(key, map, init) { >- this._configOrder.push(key); >- AttributeProvider.prototype.setAttributeConfig.apply(this, arguments); >- }, >- >- createEvent: function(type, config) { >- this._events[type] = true; >- return AttributeProvider.prototype.createEvent.apply(this, arguments); >- }, >- >- init: function(el, attr) { >- this._initElement(el, attr); >- }, >- >- destroy: function() { >- var el = this.get('element'); >- YAHOO.util.Event.purgeElement(el, true); // purge DOM listeners recursively >- this.unsubscribeAll(); // unsubscribe all custom events >- >- if (el && el.parentNode) { >- el.parentNode.removeChild(el); // pull from the DOM >- } >- >- // revert initial configs >- this._queue = []; >- this._events = {}; >- this._configs = {}; >- this._configOrder = []; >- }, >- >- _initElement: function(el, attr) { >- this._queue = this._queue || []; >- this._events = this._events || {}; >- this._configs = this._configs || {}; >- this._configOrder = []; >- attr = attr || {}; >- attr.element = attr.element || el || null; >- >- var isReady = false; // to determine when to init HTMLElement and content >- >- var DOM_EVENTS = Element.DOM_EVENTS; >- this.DOM_EVENTS = this.DOM_EVENTS || {}; >- >- for (var event in DOM_EVENTS) { >- if (DOM_EVENTS.hasOwnProperty(event)) { >- this.DOM_EVENTS[event] = DOM_EVENTS[event]; >- } >- } >- >- if (typeof attr.element === 'string') { // register ID for get() access >- this._setHTMLAttrConfig('id', { value: attr.element }); >- } >- >- if (Dom.get(attr.element)) { >- isReady = true; >- this._initHTMLElement(attr); >- this._initContent(attr); >- } >- >- YAHOO.util.Event.onAvailable(attr.element, function() { >- if (!isReady) { // otherwise already done >- this._initHTMLElement(attr); >- } >- >- this.fireEvent('available', { type: 'available', target: Dom.get(attr.element) }); >- }, this, true); >- >- YAHOO.util.Event.onContentReady(attr.element, function() { >- if (!isReady) { // otherwise already done >- this._initContent(attr); >- } >- this.fireEvent('contentReady', { type: 'contentReady', target: Dom.get(attr.element) }); >- }, this, true); >- }, >- >- _initHTMLElement: function(attr) { >- /** >- * The HTMLElement the Element instance refers to. >- * @attribute element >- * @type HTMLElement >- */ >- this.setAttributeConfig('element', { >- value: Dom.get(attr.element), >- readOnly: true >- }); >- }, >- >- _initContent: function(attr) { >- this.initAttributes(attr); >- this.setAttributes(attr, true); >- this.fireQueue(); >- >- }, >- >- /** >- * Sets the value of the property and fires beforeChange and change events. >- * @private >- * @method _setHTMLAttrConfig >- * @param {YAHOO.util.Element} element The Element instance to >- * register the config to. >- * @param {String} key The name of the config to register >- * @param {Object} map A key-value map of the config's params >- */ >- _setHTMLAttrConfig: function(key, map) { >- var el = this.get('element'); >- map = map || {}; >- map.name = key; >- >- map.setter = map.setter || this.DEFAULT_HTML_SETTER; >- map.getter = map.getter || this.DEFAULT_HTML_GETTER; >- >- map.value = map.value || el[key]; >- this._configs[key] = new YAHOO.util.Attribute(map, this); >- } >-}; >- >-/** >- * Fires when the Element's HTMLElement can be retrieved by Id. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> available<br> >- * <code><HTMLElement> >- * target</code> the HTMLElement bound to this Element instance<br> >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('available', handler);</code></p> >- * @event available >- */ >- >-/** >- * Fires when the Element's HTMLElement subtree is rendered. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> contentReady<br> >- * <code><HTMLElement> >- * target</code> the HTMLElement bound to this Element instance<br> >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('contentReady', handler);</code></p> >- * @event contentReady >- */ >- >-/** >- * Fires before the Element is appended to another Element. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> beforeAppendTo<br> >- * <code><HTMLElement/Element> >- * target</code> the HTMLElement/Element being appended to >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('beforeAppendTo', handler);</code></p> >- * @event beforeAppendTo >- */ >- >-/** >- * Fires after the Element is appended to another Element. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> appendTo<br> >- * <code><HTMLElement/Element> >- * target</code> the HTMLElement/Element being appended to >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('appendTo', handler);</code></p> >- * @event appendTo >- */ >- >-YAHOO.augment(Element, AttributeProvider); >-YAHOO.util.Element = Element; >-})(); >- >-YAHOO.register("element", YAHOO.util.Element, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/element/element-min.js b/koha-tmpl/intranet-tmpl/lib/yui/element/element-min.js >deleted file mode 100644 >index 85ac6b5361..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/element/element-min.js >+++ /dev/null >@@ -1,8 +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 >-*/ >-YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name,A);}return A;},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};if(C){this._written=false;}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null;}return B.getValue();},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B;}}return C;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,D=YAHOO.util.AttributeProvider,C={mouseenter:true,mouseleave:true};var A=function(E,F){this.init.apply(this,arguments);};A.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"mouseenter":true,"mouseleave":true,"focus":true,"blur":true,"submit":true,"change":true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(G,E){var F=this.get("element");if(F){F[E]=G;}return G;},DEFAULT_HTML_GETTER:function(E){var F=this.get("element"),G;if(F){G=F[E];}return G;},appendChild:function(E){E=E.get?E.get("element"):E;return this.get("element").appendChild(E);},getElementsByTagName:function(E){return this.get("element").getElementsByTagName(E);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(E,F){E=E.get?E.get("element"):E;F=(F&&F.get)?F.get("element"):F;return this.get("element").insertBefore(E,F);},removeChild:function(E){E=E.get?E.get("element"):E;return this.get("element").removeChild(E);},replaceChild:function(E,F){E=E.get?E.get("element"):E;F=F.get?F.get("element"):F;return this.get("element").replaceChild(E,F);},initAttributes:function(E){},addListener:function(J,I,K,H){H=H||this;var E=YAHOO.util.Event,G=this.get("element")||this.get("id"),F=this;if(C[J]&&!E._createMouseDelegate){return false;}if(!this._events[J]){if(G&&this.DOM_EVENTS[J]){E.on(G,J,function(M,L){if(M.srcElement&&!M.target){M.target=M.srcElement;}if((M.toElement&&!M.relatedTarget)||(M.fromElement&&!M.relatedTarget)){M.relatedTarget=E.getRelatedTarget(M);}if(!M.currentTarget){M.currentTarget=G;}F.fireEvent(J,M,L);},K,H);}this.createEvent(J,{scope:this});}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){return this.addListener.apply(this,arguments);},subscribe:function(){return this.addListener.apply(this,arguments);},removeListener:function(F,E){return this.unsubscribe.apply(this,arguments);},addClass:function(E){B.addClass(this.get("element"),E);},getElementsByClassName:function(F,E){return B.getElementsByClassName(F,E,this.get("element"));},hasClass:function(E){return B.hasClass(this.get("element"),E);},removeClass:function(E){return B.removeClass(this.get("element"),E);},replaceClass:function(F,E){return B.replaceClass(this.get("element"),F,E);},setStyle:function(F,E){return B.setStyle(this.get("element"),F,E); >-},getStyle:function(E){return B.getStyle(this.get("element"),E);},fireQueue:function(){var F=this._queue;for(var G=0,E=F.length;G<E;++G){this[F[G][0]].apply(this,F[G][1]);}},appendTo:function(F,G){F=(F.get)?F.get("element"):B.get(F);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:F});G=(G&&G.get)?G.get("element"):B.get(G);var E=this.get("element");if(!E){return false;}if(!F){return false;}if(E.parent!=F){if(G){F.insertBefore(E,G);}else{F.appendChild(E);}}this.fireEvent("appendTo",{type:"appendTo",target:F});return E;},get:function(E){var G=this._configs||{},F=G.element;if(F&&!G[E]&&!YAHOO.lang.isUndefined(F.value[E])){this._setHTMLAttrConfig(E);}return D.prototype.get.call(this,E);},setAttributes:function(K,H){var F={},I=this._configOrder;for(var J=0,E=I.length;J<E;++J){if(K[I[J]]!==undefined){F[I[J]]=true;this.set(I[J],K[I[J]],H);}}for(var G in K){if(K.hasOwnProperty(G)&&!F[G]){this.set(G,K[G],H);}}},set:function(F,H,E){var G=this.get("element");if(!G){this._queue[this._queue.length]=["set",arguments];if(this._configs[F]){this._configs[F].value=H;}return;}if(!this._configs[F]&&!YAHOO.lang.isUndefined(G[F])){this._setHTMLAttrConfig(F);}return D.prototype.set.apply(this,arguments);},setAttributeConfig:function(E,F,G){this._configOrder.push(E);D.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(F,E){this._events[F]=true;return D.prototype.createEvent.apply(this,arguments);},init:function(F,E){this._initElement(F,E);},destroy:function(){var E=this.get("element");YAHOO.util.Event.purgeElement(E,true);this.unsubscribeAll();if(E&&E.parentNode){E.parentNode.removeChild(E);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(G,F){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];F=F||{};F.element=F.element||G||null;var I=false;var E=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var H in E){if(E.hasOwnProperty(H)){this.DOM_EVENTS[H]=E[H];}}if(typeof F.element==="string"){this._setHTMLAttrConfig("id",{value:F.element});}if(B.get(F.element)){I=true;this._initHTMLElement(F);this._initContent(F);}YAHOO.util.Event.onAvailable(F.element,function(){if(!I){this._initHTMLElement(F);}this.fireEvent("available",{type:"available",target:B.get(F.element)});},this,true);YAHOO.util.Event.onContentReady(F.element,function(){if(!I){this._initContent(F);}this.fireEvent("contentReady",{type:"contentReady",target:B.get(F.element)});},this,true);},_initHTMLElement:function(E){this.setAttributeConfig("element",{value:B.get(E.element),readOnly:true});},_initContent:function(E){this.initAttributes(E);this.setAttributes(E,true);this.fireQueue();},_setHTMLAttrConfig:function(E,G){var F=this.get("element");G=G||{};G.name=E;G.setter=G.setter||this.DEFAULT_HTML_SETTER;G.getter=G.getter||this.DEFAULT_HTML_GETTER;G.value=G.value||F[E];this._configs[E]=new YAHOO.util.Attribute(G,this);}};YAHOO.augment(A,D);YAHOO.util.Element=A;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/element/element.js b/koha-tmpl/intranet-tmpl/lib/yui/element/element.js >deleted file mode 100644 >index 741801f734..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/element/element.js >+++ /dev/null >@@ -1,1090 +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 >-*/ >-/** >- * Provides Attribute configurations. >- * @namespace YAHOO.util >- * @class Attribute >- * @constructor >- * @param hash {Object} The intial Attribute. >- * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance. >- */ >- >-YAHOO.util.Attribute = function(hash, owner) { >- if (owner) { >- this.owner = owner; >- this.configure(hash, true); >- } >-}; >- >-YAHOO.util.Attribute.prototype = { >- /** >- * The name of the attribute. >- * @property name >- * @type String >- */ >- name: undefined, >- >- /** >- * The value of the attribute. >- * @property value >- * @type String >- */ >- value: null, >- >- /** >- * The owner of the attribute. >- * @property owner >- * @type YAHOO.util.AttributeProvider >- */ >- owner: null, >- >- /** >- * Whether or not the attribute is read only. >- * @property readOnly >- * @type Boolean >- */ >- readOnly: false, >- >- /** >- * Whether or not the attribute can only be written once. >- * @property writeOnce >- * @type Boolean >- */ >- writeOnce: false, >- >- /** >- * The attribute's initial configuration. >- * @private >- * @property _initialConfig >- * @type Object >- */ >- _initialConfig: null, >- >- /** >- * Whether or not the attribute's value has been set. >- * @private >- * @property _written >- * @type Boolean >- */ >- _written: false, >- >- /** >- * A function to call when setting the attribute's value. >- * The method receives the new value as the first arg and the attribute name as the 2nd >- * @property method >- * @type Function >- */ >- method: null, >- >- /** >- * The function to use when setting the attribute's value. >- * The setter receives the new value as the first arg and the attribute name as the 2nd >- * The return value of the setter replaces the value passed to set(). >- * @property setter >- * @type Function >- */ >- setter: null, >- >- /** >- * The function to use when getting the attribute's value. >- * The getter receives the new value as the first arg and the attribute name as the 2nd >- * The return value of the getter will be used as the return from get(). >- * @property getter >- * @type Function >- */ >- getter: null, >- >- /** >- * The validator to use when setting the attribute's value. >- * @property validator >- * @type Function >- * @return Boolean >- */ >- validator: null, >- >- /** >- * Retrieves the current value of the attribute. >- * @method getValue >- * @return {any} The current value of the attribute. >- */ >- getValue: function() { >- var val = this.value; >- >- if (this.getter) { >- val = this.getter.call(this.owner, this.name, val); >- } >- >- return val; >- }, >- >- /** >- * Sets the value of the attribute and fires beforeChange and change events. >- * @method setValue >- * @param {Any} value The value to apply to the attribute. >- * @param {Boolean} silent If true the change events will not be fired. >- * @return {Boolean} Whether or not the value was set. >- */ >- setValue: function(value, silent) { >- var beforeRetVal, >- owner = this.owner, >- name = this.name; >- >- var event = { >- type: name, >- prevValue: this.getValue(), >- newValue: value >- }; >- >- if (this.readOnly || ( this.writeOnce && this._written) ) { >- return false; // write not allowed >- } >- >- if (this.validator && !this.validator.call(owner, value) ) { >- return false; // invalid value >- } >- >- if (!silent) { >- beforeRetVal = owner.fireBeforeChangeEvent(event); >- if (beforeRetVal === false) { >- return false; >- } >- } >- >- if (this.setter) { >- value = this.setter.call(owner, value, this.name); >- if (value === undefined) { >- } >- } >- >- if (this.method) { >- this.method.call(owner, value, this.name); >- } >- >- this.value = value; // TODO: set before calling setter/method? >- this._written = true; >- >- event.type = name; >- >- if (!silent) { >- this.owner.fireChangeEvent(event); >- } >- >- return true; >- }, >- >- /** >- * Allows for configuring the Attribute's properties. >- * @method configure >- * @param {Object} map A key-value map of Attribute properties. >- * @param {Boolean} init Whether or not this should become the initial config. >- */ >- configure: function(map, init) { >- map = map || {}; >- >- if (init) { >- this._written = false; // reset writeOnce >- } >- >- this._initialConfig = this._initialConfig || {}; >- >- for (var key in map) { >- if ( map.hasOwnProperty(key) ) { >- this[key] = map[key]; >- if (init) { >- this._initialConfig[key] = map[key]; >- } >- } >- } >- }, >- >- /** >- * Resets the value to the initial config value. >- * @method resetValue >- * @return {Boolean} Whether or not the value was set. >- */ >- resetValue: function() { >- return this.setValue(this._initialConfig.value); >- }, >- >- /** >- * Resets the attribute config to the initial config state. >- * @method resetConfig >- */ >- resetConfig: function() { >- this.configure(this._initialConfig, true); >- }, >- >- /** >- * Resets the value to the current value. >- * Useful when values may have gotten out of sync with actual properties. >- * @method refresh >- * @return {Boolean} Whether or not the value was set. >- */ >- refresh: function(silent) { >- this.setValue(this.value, silent); >- } >-}; >- >-(function() { >- var Lang = YAHOO.util.Lang; >- >- /* >- Copyright (c) 2006, Yahoo! Inc. All rights reserved. >- Code licensed under the BSD License: >- http://developer.yahoo.net/yui/license.txt >- */ >- >- /** >- * Provides and manages YAHOO.util.Attribute instances >- * @namespace YAHOO.util >- * @class AttributeProvider >- * @uses YAHOO.util.EventProvider >- */ >- YAHOO.util.AttributeProvider = function() {}; >- >- YAHOO.util.AttributeProvider.prototype = { >- >- /** >- * A key-value map of Attribute configurations >- * @property _configs >- * @protected (may be used by subclasses and augmentors) >- * @private >- * @type {Object} >- */ >- _configs: null, >- /** >- * Returns the current value of the attribute. >- * @method get >- * @param {String} key The attribute whose value will be returned. >- * @return {Any} The current value of the attribute. >- */ >- get: function(key){ >- this._configs = this._configs || {}; >- var config = this._configs[key]; >- >- if (!config || !this._configs.hasOwnProperty(key)) { >- return null; >- } >- >- return config.getValue(); >- }, >- >- /** >- * Sets the value of a config. >- * @method set >- * @param {String} key The name of the attribute >- * @param {Any} value The value to apply to the attribute >- * @param {Boolean} silent Whether or not to suppress change events >- * @return {Boolean} Whether or not the value was set. >- */ >- set: function(key, value, silent){ >- this._configs = this._configs || {}; >- var config = this._configs[key]; >- >- if (!config) { >- return false; >- } >- >- return config.setValue(value, silent); >- }, >- >- /** >- * Returns an array of attribute names. >- * @method getAttributeKeys >- * @return {Array} An array of attribute names. >- */ >- getAttributeKeys: function(){ >- this._configs = this._configs; >- var keys = [], key; >- >- for (key in this._configs) { >- if ( Lang.hasOwnProperty(this._configs, key) && >- !Lang.isUndefined(this._configs[key]) ) { >- keys[keys.length] = key; >- } >- } >- >- return keys; >- }, >- >- /** >- * Sets multiple attribute values. >- * @method setAttributes >- * @param {Object} map A key-value map of attributes >- * @param {Boolean} silent Whether or not to suppress change events >- */ >- setAttributes: function(map, silent){ >- for (var key in map) { >- if ( Lang.hasOwnProperty(map, key) ) { >- this.set(key, map[key], silent); >- } >- } >- }, >- >- /** >- * Resets the specified attribute's value to its initial value. >- * @method resetValue >- * @param {String} key The name of the attribute >- * @param {Boolean} silent Whether or not to suppress change events >- * @return {Boolean} Whether or not the value was set >- */ >- resetValue: function(key, silent){ >- this._configs = this._configs || {}; >- if (this._configs[key]) { >- this.set(key, this._configs[key]._initialConfig.value, silent); >- return true; >- } >- return false; >- }, >- >- /** >- * Sets the attribute's value to its current value. >- * @method refresh >- * @param {String | Array} key The attribute(s) to refresh >- * @param {Boolean} silent Whether or not to suppress change events >- */ >- refresh: function(key, silent) { >- this._configs = this._configs || {}; >- var configs = this._configs; >- >- key = ( ( Lang.isString(key) ) ? [key] : key ) || >- this.getAttributeKeys(); >- >- for (var i = 0, len = key.length; i < len; ++i) { >- if (configs.hasOwnProperty(key[i])) { >- this._configs[key[i]].refresh(silent); >- } >- } >- }, >- >- /** >- * Adds an Attribute to the AttributeProvider instance. >- * @method register >- * @param {String} key The attribute's name >- * @param {Object} map A key-value map containing the >- * attribute's properties. >- * @deprecated Use setAttributeConfig >- */ >- register: function(key, map) { >- this.setAttributeConfig(key, map); >- }, >- >- >- /** >- * Returns the attribute's properties. >- * @method getAttributeConfig >- * @param {String} key The attribute's name >- * @private >- * @return {object} A key-value map containing all of the >- * attribute's properties. >- */ >- getAttributeConfig: function(key) { >- this._configs = this._configs || {}; >- var config = this._configs[key] || {}; >- var map = {}; // returning a copy to prevent overrides >- >- for (key in config) { >- if ( Lang.hasOwnProperty(config, key) ) { >- map[key] = config[key]; >- } >- } >- >- return map; >- }, >- >- /** >- * Sets or updates an Attribute instance's properties. >- * @method setAttributeConfig >- * @param {String} key The attribute's name. >- * @param {Object} map A key-value map of attribute properties >- * @param {Boolean} init Whether or not this should become the intial config. >- */ >- setAttributeConfig: function(key, map, init) { >- this._configs = this._configs || {}; >- map = map || {}; >- if (!this._configs[key]) { >- map.name = key; >- this._configs[key] = this.createAttribute(map); >- } else { >- this._configs[key].configure(map, init); >- } >- }, >- >- /** >- * Sets or updates an Attribute instance's properties. >- * @method configureAttribute >- * @param {String} key The attribute's name. >- * @param {Object} map A key-value map of attribute properties >- * @param {Boolean} init Whether or not this should become the intial config. >- * @deprecated Use setAttributeConfig >- */ >- configureAttribute: function(key, map, init) { >- this.setAttributeConfig(key, map, init); >- }, >- >- /** >- * Resets an attribute to its intial configuration. >- * @method resetAttributeConfig >- * @param {String} key The attribute's name. >- * @private >- */ >- resetAttributeConfig: function(key){ >- this._configs = this._configs || {}; >- this._configs[key].resetConfig(); >- }, >- >- // wrapper for EventProvider.subscribe >- // to create events on the fly >- subscribe: function(type, callback) { >- this._events = this._events || {}; >- >- if ( !(type in this._events) ) { >- this._events[type] = this.createEvent(type); >- } >- >- YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); >- }, >- >- on: function() { >- this.subscribe.apply(this, arguments); >- }, >- >- addListener: function() { >- this.subscribe.apply(this, arguments); >- }, >- >- /** >- * Fires the attribute's beforeChange event. >- * @method fireBeforeChangeEvent >- * @param {String} key The attribute's name. >- * @param {Obj} e The event object to pass to handlers. >- */ >- fireBeforeChangeEvent: function(e) { >- var type = 'before'; >- type += e.type.charAt(0).toUpperCase() + e.type.substr(1) + 'Change'; >- e.type = type; >- return this.fireEvent(e.type, e); >- }, >- >- /** >- * Fires the attribute's change event. >- * @method fireChangeEvent >- * @param {String} key The attribute's name. >- * @param {Obj} e The event object to pass to the handlers. >- */ >- fireChangeEvent: function(e) { >- e.type += 'Change'; >- return this.fireEvent(e.type, e); >- }, >- >- createAttribute: function(map) { >- return new YAHOO.util.Attribute(map, this); >- } >- }; >- >- YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider); >-})(); >- >-(function() { >-// internal shorthand >-var Dom = YAHOO.util.Dom, >- AttributeProvider = YAHOO.util.AttributeProvider, >- specialTypes = { >- mouseenter: true, >- mouseleave: true >- }; >- >-/** >- * Element provides an wrapper object to simplify adding >- * event listeners, using dom methods, and managing attributes. >- * @module element >- * @namespace YAHOO.util >- * @requires yahoo, dom, event >- */ >- >-/** >- * Element provides an wrapper object to simplify adding >- * event listeners, using dom methods, and managing attributes. >- * @class Element >- * @uses YAHOO.util.AttributeProvider >- * @constructor >- * @param el {HTMLElement | String} The html element that >- * represents the Element. >- * @param {Object} map A key-value map of initial config names and values >- */ >-var Element = function(el, map) { >- this.init.apply(this, arguments); >-}; >- >-Element.DOM_EVENTS = { >- 'click': true, >- 'dblclick': true, >- 'keydown': true, >- 'keypress': true, >- 'keyup': true, >- 'mousedown': true, >- 'mousemove': true, >- 'mouseout': true, >- 'mouseover': true, >- 'mouseup': true, >- 'mouseenter': true, >- 'mouseleave': true, >- 'focus': true, >- 'blur': true, >- 'submit': true, >- 'change': true >-}; >- >-Element.prototype = { >- /** >- * Dom events supported by the Element instance. >- * @property DOM_EVENTS >- * @type Object >- */ >- DOM_EVENTS: null, >- >- DEFAULT_HTML_SETTER: function(value, key) { >- var el = this.get('element'); >- >- if (el) { >- el[key] = value; >- } >- >- return value; >- >- }, >- >- DEFAULT_HTML_GETTER: function(key) { >- var el = this.get('element'), >- val; >- >- if (el) { >- val = el[key]; >- } >- >- return val; >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method appendChild >- * @param {YAHOO.util.Element || HTMLElement} child The element to append. >- * @return {HTMLElement} The appended DOM element. >- */ >- appendChild: function(child) { >- child = child.get ? child.get('element') : child; >- return this.get('element').appendChild(child); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method getElementsByTagName >- * @param {String} tag The tagName to collect >- * @return {HTMLCollection} A collection of DOM elements. >- */ >- getElementsByTagName: function(tag) { >- return this.get('element').getElementsByTagName(tag); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method hasChildNodes >- * @return {Boolean} Whether or not the element has childNodes >- */ >- hasChildNodes: function() { >- return this.get('element').hasChildNodes(); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method insertBefore >- * @param {HTMLElement} element The HTMLElement to insert >- * @param {HTMLElement} before The HTMLElement to insert >- * the element before. >- * @return {HTMLElement} The inserted DOM element. >- */ >- insertBefore: function(element, before) { >- element = element.get ? element.get('element') : element; >- before = (before && before.get) ? before.get('element') : before; >- >- return this.get('element').insertBefore(element, before); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method removeChild >- * @param {HTMLElement} child The HTMLElement to remove >- * @return {HTMLElement} The removed DOM element. >- */ >- removeChild: function(child) { >- child = child.get ? child.get('element') : child; >- return this.get('element').removeChild(child); >- }, >- >- /** >- * Wrapper for HTMLElement method. >- * @method replaceChild >- * @param {HTMLElement} newNode The HTMLElement to insert >- * @param {HTMLElement} oldNode The HTMLElement to replace >- * @return {HTMLElement} The replaced DOM element. >- */ >- replaceChild: function(newNode, oldNode) { >- newNode = newNode.get ? newNode.get('element') : newNode; >- oldNode = oldNode.get ? oldNode.get('element') : oldNode; >- return this.get('element').replaceChild(newNode, oldNode); >- }, >- >- >- /** >- * Registers Element specific attributes. >- * @method initAttributes >- * @param {Object} map A key-value map of initial attribute configs >- */ >- initAttributes: function(map) { >- }, >- >- /** >- * Adds a listener for the given event. These may be DOM or >- * customEvent listeners. Any event that is fired via fireEvent >- * can be listened for. All handlers receive an event object. >- * @method addListener >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The handler to call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- addListener: function(type, fn, obj, scope) { >- >- scope = scope || this; >- >- var Event = YAHOO.util.Event, >- el = this.get('element') || this.get('id'), >- self = this; >- >- >- if (specialTypes[type] && !Event._createMouseDelegate) { >- return false; >- } >- >- >- if (!this._events[type]) { // create on the fly >- >- if (el && this.DOM_EVENTS[type]) { >- Event.on(el, type, function(e, matchedEl) { >- >- // Supplement IE with target, currentTarget relatedTarget >- >- if (e.srcElement && !e.target) { >- e.target = e.srcElement; >- } >- >- if ((e.toElement && !e.relatedTarget) || (e.fromElement && !e.relatedTarget)) { >- e.relatedTarget = Event.getRelatedTarget(e); >- } >- >- if (!e.currentTarget) { >- e.currentTarget = el; >- } >- >- // Note: matchedEl el is passed back for delegated listeners >- self.fireEvent(type, e, matchedEl); >- >- }, obj, scope); >- } >- this.createEvent(type, {scope: this}); >- } >- >- return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent >- }, >- >- >- /** >- * Alias for addListener >- * @method on >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- on: function() { >- return this.addListener.apply(this, arguments); >- }, >- >- /** >- * Alias for addListener >- * @method subscribe >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- * @param {Any} obj A variable to pass to the handler >- * @param {Object} scope The object to use for the scope of the handler >- */ >- subscribe: function() { >- return this.addListener.apply(this, arguments); >- }, >- >- /** >- * Remove an event listener >- * @method removeListener >- * @param {String} type The name of the event to listen for >- * @param {Function} fn The function call when the event fires >- */ >- removeListener: function(type, fn) { >- return this.unsubscribe.apply(this, arguments); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method addClass >- * @param {String} className The className to add >- */ >- addClass: function(className) { >- Dom.addClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method getElementsByClassName >- * @param {String} className The className to collect >- * @param {String} tag (optional) The tag to use in >- * conjunction with class name >- * @return {Array} Array of HTMLElements >- */ >- getElementsByClassName: function(className, tag) { >- return Dom.getElementsByClassName(className, tag, >- this.get('element') ); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method hasClass >- * @param {String} className The className to add >- * @return {Boolean} Whether or not the element has the class name >- */ >- hasClass: function(className) { >- return Dom.hasClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method removeClass >- * @param {String} className The className to remove >- */ >- removeClass: function(className) { >- return Dom.removeClass(this.get('element'), className); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method replaceClass >- * @param {String} oldClassName The className to replace >- * @param {String} newClassName The className to add >- */ >- replaceClass: function(oldClassName, newClassName) { >- return Dom.replaceClass(this.get('element'), >- oldClassName, newClassName); >- }, >- >- /** >- * Wrapper for Dom method. >- * @method setStyle >- * @param {String} property The style property to set >- * @param {String} value The value to apply to the style property >- */ >- setStyle: function(property, value) { >- return Dom.setStyle(this.get('element'), property, value); // TODO: always queuing? >- }, >- >- /** >- * Wrapper for Dom method. >- * @method getStyle >- * @param {String} property The style property to retrieve >- * @return {String} The current value of the property >- */ >- getStyle: function(property) { >- return Dom.getStyle(this.get('element'), property); >- }, >- >- /** >- * Apply any queued set calls. >- * @method fireQueue >- */ >- fireQueue: function() { >- var queue = this._queue; >- for (var i = 0, len = queue.length; i < len; ++i) { >- this[queue[i][0]].apply(this, queue[i][1]); >- } >- }, >- >- /** >- * Appends the HTMLElement into either the supplied parentNode. >- * @method appendTo >- * @param {HTMLElement | Element} parentNode The node to append to >- * @param {HTMLElement | Element} before An optional node to insert before >- * @return {HTMLElement} The appended DOM element. >- */ >- appendTo: function(parent, before) { >- parent = (parent.get) ? parent.get('element') : Dom.get(parent); >- >- this.fireEvent('beforeAppendTo', { >- type: 'beforeAppendTo', >- target: parent >- }); >- >- >- before = (before && before.get) ? >- before.get('element') : Dom.get(before); >- var element = this.get('element'); >- >- if (!element) { >- return false; >- } >- >- if (!parent) { >- return false; >- } >- >- if (element.parent != parent) { >- if (before) { >- parent.insertBefore(element, before); >- } else { >- parent.appendChild(element); >- } >- } >- >- >- this.fireEvent('appendTo', { >- type: 'appendTo', >- target: parent >- }); >- >- return element; >- }, >- >- get: function(key) { >- var configs = this._configs || {}, >- el = configs.element; // avoid loop due to 'element' >- >- if (el && !configs[key] && !YAHOO.lang.isUndefined(el.value[key]) ) { >- this._setHTMLAttrConfig(key); >- } >- >- return AttributeProvider.prototype.get.call(this, key); >- }, >- >- setAttributes: function(map, silent) { >- // set based on configOrder >- var done = {}, >- configOrder = this._configOrder; >- >- // set based on configOrder >- for (var i = 0, len = configOrder.length; i < len; ++i) { >- if (map[configOrder[i]] !== undefined) { >- done[configOrder[i]] = true; >- this.set(configOrder[i], map[configOrder[i]], silent); >- } >- } >- >- // unconfigured (e.g. Dom attributes) >- for (var att in map) { >- if (map.hasOwnProperty(att) && !done[att]) { >- this.set(att, map[att], silent); >- } >- } >- }, >- >- set: function(key, value, silent) { >- var el = this.get('element'); >- if (!el) { >- this._queue[this._queue.length] = ['set', arguments]; >- if (this._configs[key]) { >- this._configs[key].value = value; // so "get" works while queueing >- >- } >- return; >- } >- >- // set it on the element if not configured and is an HTML attribute >- if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) { >- this._setHTMLAttrConfig(key); >- } >- >- return AttributeProvider.prototype.set.apply(this, arguments); >- }, >- >- setAttributeConfig: function(key, map, init) { >- this._configOrder.push(key); >- AttributeProvider.prototype.setAttributeConfig.apply(this, arguments); >- }, >- >- createEvent: function(type, config) { >- this._events[type] = true; >- return AttributeProvider.prototype.createEvent.apply(this, arguments); >- }, >- >- init: function(el, attr) { >- this._initElement(el, attr); >- }, >- >- destroy: function() { >- var el = this.get('element'); >- YAHOO.util.Event.purgeElement(el, true); // purge DOM listeners recursively >- this.unsubscribeAll(); // unsubscribe all custom events >- >- if (el && el.parentNode) { >- el.parentNode.removeChild(el); // pull from the DOM >- } >- >- // revert initial configs >- this._queue = []; >- this._events = {}; >- this._configs = {}; >- this._configOrder = []; >- }, >- >- _initElement: function(el, attr) { >- this._queue = this._queue || []; >- this._events = this._events || {}; >- this._configs = this._configs || {}; >- this._configOrder = []; >- attr = attr || {}; >- attr.element = attr.element || el || null; >- >- var isReady = false; // to determine when to init HTMLElement and content >- >- var DOM_EVENTS = Element.DOM_EVENTS; >- this.DOM_EVENTS = this.DOM_EVENTS || {}; >- >- for (var event in DOM_EVENTS) { >- if (DOM_EVENTS.hasOwnProperty(event)) { >- this.DOM_EVENTS[event] = DOM_EVENTS[event]; >- } >- } >- >- if (typeof attr.element === 'string') { // register ID for get() access >- this._setHTMLAttrConfig('id', { value: attr.element }); >- } >- >- if (Dom.get(attr.element)) { >- isReady = true; >- this._initHTMLElement(attr); >- this._initContent(attr); >- } >- >- YAHOO.util.Event.onAvailable(attr.element, function() { >- if (!isReady) { // otherwise already done >- this._initHTMLElement(attr); >- } >- >- this.fireEvent('available', { type: 'available', target: Dom.get(attr.element) }); >- }, this, true); >- >- YAHOO.util.Event.onContentReady(attr.element, function() { >- if (!isReady) { // otherwise already done >- this._initContent(attr); >- } >- this.fireEvent('contentReady', { type: 'contentReady', target: Dom.get(attr.element) }); >- }, this, true); >- }, >- >- _initHTMLElement: function(attr) { >- /** >- * The HTMLElement the Element instance refers to. >- * @attribute element >- * @type HTMLElement >- */ >- this.setAttributeConfig('element', { >- value: Dom.get(attr.element), >- readOnly: true >- }); >- }, >- >- _initContent: function(attr) { >- this.initAttributes(attr); >- this.setAttributes(attr, true); >- this.fireQueue(); >- >- }, >- >- /** >- * Sets the value of the property and fires beforeChange and change events. >- * @private >- * @method _setHTMLAttrConfig >- * @param {YAHOO.util.Element} element The Element instance to >- * register the config to. >- * @param {String} key The name of the config to register >- * @param {Object} map A key-value map of the config's params >- */ >- _setHTMLAttrConfig: function(key, map) { >- var el = this.get('element'); >- map = map || {}; >- map.name = key; >- >- map.setter = map.setter || this.DEFAULT_HTML_SETTER; >- map.getter = map.getter || this.DEFAULT_HTML_GETTER; >- >- map.value = map.value || el[key]; >- this._configs[key] = new YAHOO.util.Attribute(map, this); >- } >-}; >- >-/** >- * Fires when the Element's HTMLElement can be retrieved by Id. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> available<br> >- * <code><HTMLElement> >- * target</code> the HTMLElement bound to this Element instance<br> >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('available', handler);</code></p> >- * @event available >- */ >- >-/** >- * Fires when the Element's HTMLElement subtree is rendered. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> contentReady<br> >- * <code><HTMLElement> >- * target</code> the HTMLElement bound to this Element instance<br> >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('contentReady', handler);</code></p> >- * @event contentReady >- */ >- >-/** >- * Fires before the Element is appended to another Element. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> beforeAppendTo<br> >- * <code><HTMLElement/Element> >- * target</code> the HTMLElement/Element being appended to >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('beforeAppendTo', handler);</code></p> >- * @event beforeAppendTo >- */ >- >-/** >- * Fires after the Element is appended to another Element. >- * <p>See: <a href="#addListener">Element.addListener</a></p> >- * <p><strong>Event fields:</strong><br> >- * <code><String> type</code> appendTo<br> >- * <code><HTMLElement/Element> >- * target</code> the HTMLElement/Element being appended to >- * <p><strong>Usage:</strong><br> >- * <code>var handler = function(e) {var target = e.target};<br> >- * myTabs.addListener('appendTo', handler);</code></p> >- * @event appendTo >- */ >- >-YAHOO.augment(Element, AttributeProvider); >-YAHOO.util.Element = Element; >-})(); >- >-YAHOO.register("element", YAHOO.util.Element, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/json/json-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/json/json-debug.js >deleted file mode 100644 >index 8d1a02b230..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/json/json-debug.js >+++ /dev/null >@@ -1,538 +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 >-*/ >-/** >- * Provides methods to parse JSON strings and convert objects to JSON strings. >- * >- * @module json >- * @class JSON >- * @namespace YAHOO.lang >- * @static >- */ >-(function () { >- >-var l = YAHOO.lang, >- isFunction = l.isFunction, >- isObject = l.isObject, >- isArray = l.isArray, >- _toStr = Object.prototype.toString, >- // 'this' is the global object. window in browser env. Keep >- // the code env agnostic. Caja requies window, unfortunately. >- Native = (YAHOO.env.ua.caja ? window : this).JSON, >- >-/* Variables used by parse */ >- >- /** >- * Replace certain Unicode characters that JavaScript may handle incorrectly >- * during eval--either by deleting them or treating them as line >- * endings--with escape sequences. >- * IMPORTANT NOTE: This regex will be used to modify the input if a match is >- * found. >- * >- * @property _UNICODE_EXCEPTIONS >- * @type {RegExp} >- * @private >- */ >- _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, >- >- /** >- * First step in the safety evaluation. Regex used to replace all escape >- * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). >- * >- * @property _ESCAPES >- * @type {RegExp} >- * @static >- * @private >- */ >- _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, >- >- /** >- * Second step in the safety evaluation. Regex used to replace all simple >- * values with ']' characters. >- * >- * @property _VALUES >- * @type {RegExp} >- * @static >- * @private >- */ >- _VALUES = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, >- >- /** >- * Third step in the safety evaluation. Regex used to remove all open >- * square brackets following a colon, comma, or at the beginning of the >- * string. >- * >- * @property _BRACKETS >- * @type {RegExp} >- * @static >- * @private >- */ >- _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g, >- >- /** >- * Final step in the safety evaluation. Regex used to test the string left >- * after all previous replacements for invalid characters. >- * >- * @property _UNSAFE >- * @type {RegExp} >- * @static >- * @private >- */ >- _UNSAFE = /^[\],:{}\s]*$/, >- >- >-/* Variables used by stringify */ >- >- /** >- * Regex used to replace special characters in strings for JSON >- * stringification. >- * >- * @property _SPECIAL_CHARS >- * @type {RegExp} >- * @static >- * @private >- */ >- _SPECIAL_CHARS = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, >- >- /** >- * Character substitution map for common escapes and special characters. >- * >- * @property _CHARS >- * @type {Object} >- * @static >- * @private >- */ >- _CHARS = { >- '\b': '\\b', >- '\t': '\\t', >- '\n': '\\n', >- '\f': '\\f', >- '\r': '\\r', >- '"' : '\\"', >- '\\': '\\\\' >- }, >- >- UNDEFINED = 'undefined', >- OBJECT = 'object', >- NULL = 'null', >- STRING = 'string', >- NUMBER = 'number', >- BOOLEAN = 'boolean', >- DATE = 'date', >- _allowable = { >- 'undefined' : UNDEFINED, >- 'string' : STRING, >- '[object String]' : STRING, >- 'number' : NUMBER, >- '[object Number]' : NUMBER, >- 'boolean' : BOOLEAN, >- '[object Boolean]' : BOOLEAN, >- '[object Date]' : DATE, >- '[object RegExp]' : OBJECT >- }, >- EMPTY = '', >- OPEN_O = '{', >- CLOSE_O = '}', >- OPEN_A = '[', >- CLOSE_A = ']', >- COMMA = ',', >- COMMA_CR = ",\n", >- CR = "\n", >- COLON = ':', >- COLON_SP = ': ', >- QUOTE = '"'; >- >-// Only accept JSON objects that report a [[Class]] of JSON >-Native = _toStr.call(Native) === '[object JSON]' && Native; >- >-// Escapes a special character to a safe Unicode representation >-function _char(c) { >- if (!_CHARS[c]) { >- _CHARS[c] = '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); >- } >- return _CHARS[c]; >-} >- >- >-/* functions used by parse */ >- >-/** >- * Traverses nested objects, applying a filter or reviver function to >- * each value. The value returned from the function will replace the >- * original value in the key:value pair. If the value returned is >- * undefined, the key will be omitted from the returned object. >- * >- * @method _revive >- * @param data {MIXED} Any JavaScript data >- * @param reviver {Function} filter or mutation function >- * @return {MIXED} The results of the filtered/mutated data structure >- * @private >- */ >-function _revive(data, reviver) { >- var walk = function (o,key) { >- var k,v,value = o[key]; >- if (value && typeof value === 'object') { >- for (k in value) { >- if (l.hasOwnProperty(value,k)) { >- v = walk(value, k); >- if (v === undefined) { >- delete value[k]; >- } else { >- value[k] = v; >- } >- } >- } >- } >- return reviver.call(o,key,value); >- }; >- >- return typeof reviver === 'function' ? walk({'':data},'') : data; >-} >- >-/** >- * Replace certain Unicode characters that may be handled incorrectly by >- * some browser implementations. >- * >- * @method _prepare >- * @param s {String} parse input >- * @return {String} sanitized JSON string ready to be validated/parsed >- * @private >- */ >-function _prepare(s) { >- return s.replace(_UNICODE_EXCEPTIONS, _char); >-} >- >-function _isSafe(str) { >- return l.isString(str) && >- _UNSAFE.test(str.replace(_ESCAPES,'@'). >- replace(_VALUES,']'). >- replace(_BRACKETS,'')); >-} >- >-function _parse(s,reviver) { >- // sanitize >- s = _prepare(s); >- >- // Ensure valid JSON >- if (_isSafe(s)) { >- // Eval the text into a JavaScript data structure, apply the >- // reviver function if provided, and return >- return _revive( eval('(' + s + ')'), reviver ); >- } >- >- // The text is not valid JSON >- throw new SyntaxError('JSON.parse'); >-} >- >- >- >-/* functions used by stringify */ >- >-// Utility function used to determine how to serialize a variable. >-function _type(o) { >- var t = typeof o; >- return _allowable[t] || // number, string, boolean, undefined >- _allowable[_toStr.call(o)] || // Number, String, Boolean, Date >- (t === OBJECT ? >- (o ? OBJECT : NULL) : // object, array, null, misc natives >- UNDEFINED); // function, unknown >-} >- >-// Enclose escaped strings in quotes >-function _string(s) { >- return QUOTE + s.replace(_SPECIAL_CHARS, _char) + QUOTE; >-} >- >-// Adds the provided space to the beginning of every line in the input string >-function _indent(s,space) { >- return s.replace(/^/gm, space); >-} >- >-// JavaScript implementation of stringify (see API declaration of stringify) >-function _stringify(o,w,space) { >- if (o === undefined) { >- return undefined; >- } >- >- var replacer = isFunction(w) ? w : null, >- format = _toStr.call(space).match(/String|Number/) || [], >- _date = YAHOO.lang.JSON.dateToString, >- stack = [], >- tmp,i,len; >- >- if (replacer || !isArray(w)) { >- w = undefined; >- } >- >- // Ensure whitelist keys are unique (bug 2110391) >- if (w) { >- tmp = {}; >- for (i = 0, len = w.length; i < len; ++i) { >- tmp[w[i]] = true; >- } >- w = tmp; >- } >- >- // Per the spec, strings are truncated to 10 characters and numbers >- // are converted to that number of spaces (max 10) >- space = format[0] === 'Number' ? >- new Array(Math.min(Math.max(0,space),10)+1).join(" ") : >- (space || EMPTY).slice(0,10); >- >- function _serialize(h,key) { >- var value = h[key], >- t = _type(value), >- a = [], >- colon = space ? COLON_SP : COLON, >- arr, i, keys, k, v; >- >- // Per the ECMA 5 spec, toJSON is applied before the replacer is >- // called. Also per the spec, Date.prototype.toJSON has been added, so >- // Date instances should be serialized prior to exposure to the >- // replacer. I disagree with this decision, but the spec is the spec. >- if (isObject(value) && isFunction(value.toJSON)) { >- value = value.toJSON(key); >- } else if (t === DATE) { >- value = _date(value); >- } >- >- if (isFunction(replacer)) { >- value = replacer.call(h,key,value); >- } >- >- if (value !== h[key]) { >- t = _type(value); >- } >- >- switch (t) { >- case DATE : // intentional fallthrough. Pre-replacer Dates are >- // serialized in the toJSON stage. Dates here would >- // have been produced by the replacer. >- case OBJECT : break; >- case STRING : return _string(value); >- case NUMBER : return isFinite(value) ? value+EMPTY : NULL; >- case BOOLEAN : return value+EMPTY; >- case NULL : return NULL; >- default : return undefined; >- } >- >- // Check for cyclical references in nested objects >- for (i = stack.length - 1; i >= 0; --i) { >- if (stack[i] === value) { >- throw new Error("JSON.stringify. Cyclical reference"); >- } >- } >- >- arr = isArray(value); >- >- // Add the object to the processing stack >- stack.push(value); >- >- if (arr) { // Array >- for (i = value.length - 1; i >= 0; --i) { >- a[i] = _serialize(value, i) || NULL; >- } >- } else { // Object >- // If whitelist provided, take only those keys >- keys = w || value; >- i = 0; >- >- for (k in keys) { >- if (keys.hasOwnProperty(k)) { >- v = _serialize(value, k); >- if (v) { >- a[i++] = _string(k) + colon + v; >- } >- } >- } >- } >- >- // remove the array from the stack >- stack.pop(); >- >- if (space && a.length) { >- return arr ? >- OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A : >- OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O; >- } else { >- return arr ? >- OPEN_A + a.join(COMMA) + CLOSE_A : >- OPEN_O + a.join(COMMA) + CLOSE_O; >- } >- } >- >- // process the input >- return _serialize({'':o},''); >-} >- >- >-/* Public API */ >-YAHOO.lang.JSON = { >- /** >- * Leverage native JSON parse if the browser has a native implementation. >- * In general, this is a good idea. See the Known Issues section in the >- * JSON user guide for caveats. The default value is true for browsers with >- * native JSON support. >- * >- * @property useNativeParse >- * @type Boolean >- * @default true >- * @static >- */ >- useNativeParse : !!Native, >- >- /** >- * Leverage native JSON stringify if the browser has a native >- * implementation. In general, this is a good idea. See the Known Issues >- * section in the JSON user guide for caveats. The default value is true >- * for browsers with native JSON support. >- * >- * @property useNativeStringify >- * @type Boolean >- * @default true >- * @static >- */ >- useNativeStringify : !!Native, >- >- /** >- * Four step determination whether a string is safe to eval. In three steps, >- * escape sequences, safe values, and properly placed open square brackets >- * are replaced with placeholders or removed. Then in the final step, the >- * result of all these replacements is checked for invalid characters. >- * >- * @method isSafe >- * @param str {String} JSON string to be tested >- * @return {boolean} is the string safe for eval? >- * @static >- */ >- isSafe : function (s) { >- return _isSafe(_prepare(s)); >- }, >- >- /** >- * <p>Parse a JSON string, returning the native JavaScript >- * representation.</p> >- * >- * <p>When lang.JSON.useNativeParse is true, this will defer to the native >- * JSON.parse if the browser has a native implementation. Otherwise, a >- * JavaScript implementation based on http://www.json.org/json2.js >- * is used.</p> >- * >- * @method parse >- * @param s {string} JSON string data >- * @param reviver {function} (optional) function(k,v) passed each key:value >- * pair of object literals, allowing pruning or altering values >- * @return {MIXED} the native JavaScript representation of the JSON string >- * @throws SyntaxError >- * @static >- */ >- parse : function (s,reviver) { >- return Native && YAHOO.lang.JSON.useNativeParse ? >- Native.parse(s,reviver) : _parse(s,reviver); >- }, >- >- /** >- * <p>Converts an arbitrary value to a JSON string representation.</p> >- * >- * <p>Objects with cyclical references will trigger an exception.</p> >- * >- * <p>If a whitelist is provided, only matching object keys will be >- * included. Alternately, a replacer function may be passed as the >- * second parameter. This function is executed on every value in the >- * input, and its return value will be used in place of the original value. >- * This is useful to serialize specialized objects or class instances.</p> >- * >- * <p>If a positive integer or non-empty string is passed as the third >- * parameter, the output will be formatted with carriage returns and >- * indentation for readability. If a String is passed (such as "\t") it >- * will be used once for each indentation level. If a number is passed, >- * that number of spaces will be used.</p> >- * >- * <p>When lang.JSON.useNativeStringify is true, this will defer to the >- * native JSON.stringify if the browser has a native implementation. >- * Otherwise, a JavaScript implementation is used.</p> >- * >- * @method stringify >- * @param o {MIXED} any arbitrary object to convert to JSON string >- * @param w {Array|Function} (optional) whitelist of acceptable object keys >- * to include OR a function(value,key) to alter values >- * before serialization >- * @param space {Number|String} (optional) indentation character(s) or >- * depthy of spaces to format the output >- * @return {string} JSON string representation of the input >- * @throws Error >- * @static >- */ >- stringify : function (o,w,space) { >- return Native && YAHOO.lang.JSON.useNativeStringify ? >- Native.stringify(o,w,space) : _stringify(o,w,space); >- }, >- >- /** >- * Serializes a Date instance as a UTC date string. Used internally by >- * the JavaScript implementation of stringify. If you need a different >- * Date serialization format, override this method. If you change this, >- * you should also set useNativeStringify to false, since native JSON >- * implementations serialize Dates per the ECMAScript 5 spec. You've been >- * warned. >- * >- * @method dateToString >- * @param d {Date} The Date to serialize >- * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ >- * @static >- */ >- dateToString : function (d) { >- function _zeroPad(v) { >- return v < 10 ? '0' + v : v; >- } >- >- return d.getUTCFullYear() + '-' + >- _zeroPad(d.getUTCMonth() + 1) + '-' + >- _zeroPad(d.getUTCDate()) + 'T' + >- _zeroPad(d.getUTCHours()) + COLON + >- _zeroPad(d.getUTCMinutes()) + COLON + >- _zeroPad(d.getUTCSeconds()) + 'Z'; >- }, >- >- /** >- * Reconstitute Date instances from the default JSON UTC serialization. >- * Reference this from a reviver function to rebuild Dates during the >- * parse operation. >- * >- * @method stringToDate >- * @param str {String} String serialization of a Date >- * @return {Date} >- */ >- stringToDate : function (str) { >- var m = str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/); >- if (m) { >- var d = new Date(); >- d.setUTCFullYear(m[1], m[2]-1, m[3]); >- d.setUTCHours(m[4], m[5], m[6], (m[7] || 0)); >- return d; >- } >- return str; >- } >-}; >- >-/** >- * <p>Four step determination whether a string is safe to eval. In three steps, >- * escape sequences, safe values, and properly placed open square brackets >- * are replaced with placeholders or removed. Then in the final step, the >- * result of all these replacements is checked for invalid characters.</p> >- * >- * <p>This is an alias for isSafe.</p> >- * >- * @method isValid >- * @param str {String} JSON string to be tested >- * @return {boolean} is the string safe for eval? >- * @static >- * @deprecated use isSafe >- */ >-YAHOO.lang.JSON.isValid = YAHOO.lang.JSON.isSafe; >- >-})(); >-YAHOO.register("json", YAHOO.lang.JSON, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/json/json-min.js b/koha-tmpl/intranet-tmpl/lib/yui/json/json-min.js >deleted file mode 100644 >index 1640b4ce63..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/json/json-min.js >+++ /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 >-*/ >-(function(){var l=YAHOO.lang,isFunction=l.isFunction,isObject=l.isObject,isArray=l.isArray,_toStr=Object.prototype.toString,Native=(YAHOO.env.ua.caja?window:this).JSON,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/^[\],:{}\s]*$/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},UNDEFINED="undefined",OBJECT="object",NULL="null",STRING="string",NUMBER="number",BOOLEAN="boolean",DATE="date",_allowable={"undefined":UNDEFINED,"string":STRING,"[object String]":STRING,"number":NUMBER,"[object Number]":NUMBER,"boolean":BOOLEAN,"[object Boolean]":BOOLEAN,"[object Date]":DATE,"[object RegExp]":OBJECT},EMPTY="",OPEN_O="{",CLOSE_O="}",OPEN_A="[",CLOSE_A="]",COMMA=",",COMMA_CR=",\n",CR="\n",COLON=":",COLON_SP=": ",QUOTE='"';Native=_toStr.call(Native)==="[object JSON]"&&Native;function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);}return _CHARS[c];}function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char);}function _isSafe(str){return l.isString(str)&&_UNSAFE.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""));}function _parse(s,reviver){s=_prepare(s);if(_isSafe(s)){return _revive(eval("("+s+")"),reviver);}throw new SyntaxError("JSON.parse");}function _type(o){var t=typeof o;return _allowable[t]||_allowable[_toStr.call(o)]||(t===OBJECT?(o?OBJECT:NULL):UNDEFINED);}function _string(s){return QUOTE+s.replace(_SPECIAL_CHARS,_char)+QUOTE;}function _indent(s,space){return s.replace(/^/gm,space);}function _stringify(o,w,space){if(o===undefined){return undefined;}var replacer=isFunction(w)?w:null,format=_toStr.call(space).match(/String|Number/)||[],_date=YAHOO.lang.JSON.dateToString,stack=[],tmp,i,len;if(replacer||!isArray(w)){w=undefined;}if(w){tmp={};for(i=0,len=w.length;i<len;++i){tmp[w[i]]=true;}w=tmp;}space=format[0]==="Number"?new Array(Math.min(Math.max(0,space),10)+1).join(" "):(space||EMPTY).slice(0,10);function _serialize(h,key){var value=h[key],t=_type(value),a=[],colon=space?COLON_SP:COLON,arr,i,keys,k,v;if(isObject(value)&&isFunction(value.toJSON)){value=value.toJSON(key);}else{if(t===DATE){value=_date(value);}}if(isFunction(replacer)){value=replacer.call(h,key,value);}if(value!==h[key]){t=_type(value);}switch(t){case DATE:case OBJECT:break;case STRING:return _string(value);case NUMBER:return isFinite(value)?value+EMPTY:NULL;case BOOLEAN:return value+EMPTY;case NULL:return NULL;default:return undefined;}for(i=stack.length-1;i>=0;--i){if(stack[i]===value){throw new Error("JSON.stringify. Cyclical reference");}}arr=isArray(value);stack.push(value);if(arr){for(i=value.length-1;i>=0;--i){a[i]=_serialize(value,i)||NULL;}}else{keys=w||value;i=0;for(k in keys){if(keys.hasOwnProperty(k)){v=_serialize(value,k);if(v){a[i++]=_string(k)+colon+v;}}}}stack.pop();if(space&&a.length){return arr?OPEN_A+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_A:OPEN_O+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_O;}else{return arr?OPEN_A+a.join(COMMA)+CLOSE_A:OPEN_O+a.join(COMMA)+CLOSE_O;}}return _serialize({"":o},"");}YAHOO.lang.JSON={useNativeParse:!!Native,useNativeStringify:!!Native,isSafe:function(s){return _isSafe(_prepare(s));},parse:function(s,reviver){return Native&&YAHOO.lang.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);},stringify:function(o,w,space){return Native&&YAHOO.lang.JSON.useNativeStringify?Native.stringify(o,w,space):_stringify(o,w,space);},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+COLON+_zeroPad(d.getUTCMinutes())+COLON+_zeroPad(d.getUTCSeconds())+"Z";},stringToDate:function(str){var m=str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/);if(m){var d=new Date();d.setUTCFullYear(m[1],m[2]-1,m[3]);d.setUTCHours(m[4],m[5],m[6],(m[7]||0));return d;}return str;}};YAHOO.lang.JSON.isValid=YAHOO.lang.JSON.isSafe;})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/json/json.js b/koha-tmpl/intranet-tmpl/lib/yui/json/json.js >deleted file mode 100644 >index 8d1a02b230..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/json/json.js >+++ /dev/null >@@ -1,538 +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 >-*/ >-/** >- * Provides methods to parse JSON strings and convert objects to JSON strings. >- * >- * @module json >- * @class JSON >- * @namespace YAHOO.lang >- * @static >- */ >-(function () { >- >-var l = YAHOO.lang, >- isFunction = l.isFunction, >- isObject = l.isObject, >- isArray = l.isArray, >- _toStr = Object.prototype.toString, >- // 'this' is the global object. window in browser env. Keep >- // the code env agnostic. Caja requies window, unfortunately. >- Native = (YAHOO.env.ua.caja ? window : this).JSON, >- >-/* Variables used by parse */ >- >- /** >- * Replace certain Unicode characters that JavaScript may handle incorrectly >- * during eval--either by deleting them or treating them as line >- * endings--with escape sequences. >- * IMPORTANT NOTE: This regex will be used to modify the input if a match is >- * found. >- * >- * @property _UNICODE_EXCEPTIONS >- * @type {RegExp} >- * @private >- */ >- _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, >- >- /** >- * First step in the safety evaluation. Regex used to replace all escape >- * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). >- * >- * @property _ESCAPES >- * @type {RegExp} >- * @static >- * @private >- */ >- _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, >- >- /** >- * Second step in the safety evaluation. Regex used to replace all simple >- * values with ']' characters. >- * >- * @property _VALUES >- * @type {RegExp} >- * @static >- * @private >- */ >- _VALUES = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, >- >- /** >- * Third step in the safety evaluation. Regex used to remove all open >- * square brackets following a colon, comma, or at the beginning of the >- * string. >- * >- * @property _BRACKETS >- * @type {RegExp} >- * @static >- * @private >- */ >- _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g, >- >- /** >- * Final step in the safety evaluation. Regex used to test the string left >- * after all previous replacements for invalid characters. >- * >- * @property _UNSAFE >- * @type {RegExp} >- * @static >- * @private >- */ >- _UNSAFE = /^[\],:{}\s]*$/, >- >- >-/* Variables used by stringify */ >- >- /** >- * Regex used to replace special characters in strings for JSON >- * stringification. >- * >- * @property _SPECIAL_CHARS >- * @type {RegExp} >- * @static >- * @private >- */ >- _SPECIAL_CHARS = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, >- >- /** >- * Character substitution map for common escapes and special characters. >- * >- * @property _CHARS >- * @type {Object} >- * @static >- * @private >- */ >- _CHARS = { >- '\b': '\\b', >- '\t': '\\t', >- '\n': '\\n', >- '\f': '\\f', >- '\r': '\\r', >- '"' : '\\"', >- '\\': '\\\\' >- }, >- >- UNDEFINED = 'undefined', >- OBJECT = 'object', >- NULL = 'null', >- STRING = 'string', >- NUMBER = 'number', >- BOOLEAN = 'boolean', >- DATE = 'date', >- _allowable = { >- 'undefined' : UNDEFINED, >- 'string' : STRING, >- '[object String]' : STRING, >- 'number' : NUMBER, >- '[object Number]' : NUMBER, >- 'boolean' : BOOLEAN, >- '[object Boolean]' : BOOLEAN, >- '[object Date]' : DATE, >- '[object RegExp]' : OBJECT >- }, >- EMPTY = '', >- OPEN_O = '{', >- CLOSE_O = '}', >- OPEN_A = '[', >- CLOSE_A = ']', >- COMMA = ',', >- COMMA_CR = ",\n", >- CR = "\n", >- COLON = ':', >- COLON_SP = ': ', >- QUOTE = '"'; >- >-// Only accept JSON objects that report a [[Class]] of JSON >-Native = _toStr.call(Native) === '[object JSON]' && Native; >- >-// Escapes a special character to a safe Unicode representation >-function _char(c) { >- if (!_CHARS[c]) { >- _CHARS[c] = '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); >- } >- return _CHARS[c]; >-} >- >- >-/* functions used by parse */ >- >-/** >- * Traverses nested objects, applying a filter or reviver function to >- * each value. The value returned from the function will replace the >- * original value in the key:value pair. If the value returned is >- * undefined, the key will be omitted from the returned object. >- * >- * @method _revive >- * @param data {MIXED} Any JavaScript data >- * @param reviver {Function} filter or mutation function >- * @return {MIXED} The results of the filtered/mutated data structure >- * @private >- */ >-function _revive(data, reviver) { >- var walk = function (o,key) { >- var k,v,value = o[key]; >- if (value && typeof value === 'object') { >- for (k in value) { >- if (l.hasOwnProperty(value,k)) { >- v = walk(value, k); >- if (v === undefined) { >- delete value[k]; >- } else { >- value[k] = v; >- } >- } >- } >- } >- return reviver.call(o,key,value); >- }; >- >- return typeof reviver === 'function' ? walk({'':data},'') : data; >-} >- >-/** >- * Replace certain Unicode characters that may be handled incorrectly by >- * some browser implementations. >- * >- * @method _prepare >- * @param s {String} parse input >- * @return {String} sanitized JSON string ready to be validated/parsed >- * @private >- */ >-function _prepare(s) { >- return s.replace(_UNICODE_EXCEPTIONS, _char); >-} >- >-function _isSafe(str) { >- return l.isString(str) && >- _UNSAFE.test(str.replace(_ESCAPES,'@'). >- replace(_VALUES,']'). >- replace(_BRACKETS,'')); >-} >- >-function _parse(s,reviver) { >- // sanitize >- s = _prepare(s); >- >- // Ensure valid JSON >- if (_isSafe(s)) { >- // Eval the text into a JavaScript data structure, apply the >- // reviver function if provided, and return >- return _revive( eval('(' + s + ')'), reviver ); >- } >- >- // The text is not valid JSON >- throw new SyntaxError('JSON.parse'); >-} >- >- >- >-/* functions used by stringify */ >- >-// Utility function used to determine how to serialize a variable. >-function _type(o) { >- var t = typeof o; >- return _allowable[t] || // number, string, boolean, undefined >- _allowable[_toStr.call(o)] || // Number, String, Boolean, Date >- (t === OBJECT ? >- (o ? OBJECT : NULL) : // object, array, null, misc natives >- UNDEFINED); // function, unknown >-} >- >-// Enclose escaped strings in quotes >-function _string(s) { >- return QUOTE + s.replace(_SPECIAL_CHARS, _char) + QUOTE; >-} >- >-// Adds the provided space to the beginning of every line in the input string >-function _indent(s,space) { >- return s.replace(/^/gm, space); >-} >- >-// JavaScript implementation of stringify (see API declaration of stringify) >-function _stringify(o,w,space) { >- if (o === undefined) { >- return undefined; >- } >- >- var replacer = isFunction(w) ? w : null, >- format = _toStr.call(space).match(/String|Number/) || [], >- _date = YAHOO.lang.JSON.dateToString, >- stack = [], >- tmp,i,len; >- >- if (replacer || !isArray(w)) { >- w = undefined; >- } >- >- // Ensure whitelist keys are unique (bug 2110391) >- if (w) { >- tmp = {}; >- for (i = 0, len = w.length; i < len; ++i) { >- tmp[w[i]] = true; >- } >- w = tmp; >- } >- >- // Per the spec, strings are truncated to 10 characters and numbers >- // are converted to that number of spaces (max 10) >- space = format[0] === 'Number' ? >- new Array(Math.min(Math.max(0,space),10)+1).join(" ") : >- (space || EMPTY).slice(0,10); >- >- function _serialize(h,key) { >- var value = h[key], >- t = _type(value), >- a = [], >- colon = space ? COLON_SP : COLON, >- arr, i, keys, k, v; >- >- // Per the ECMA 5 spec, toJSON is applied before the replacer is >- // called. Also per the spec, Date.prototype.toJSON has been added, so >- // Date instances should be serialized prior to exposure to the >- // replacer. I disagree with this decision, but the spec is the spec. >- if (isObject(value) && isFunction(value.toJSON)) { >- value = value.toJSON(key); >- } else if (t === DATE) { >- value = _date(value); >- } >- >- if (isFunction(replacer)) { >- value = replacer.call(h,key,value); >- } >- >- if (value !== h[key]) { >- t = _type(value); >- } >- >- switch (t) { >- case DATE : // intentional fallthrough. Pre-replacer Dates are >- // serialized in the toJSON stage. Dates here would >- // have been produced by the replacer. >- case OBJECT : break; >- case STRING : return _string(value); >- case NUMBER : return isFinite(value) ? value+EMPTY : NULL; >- case BOOLEAN : return value+EMPTY; >- case NULL : return NULL; >- default : return undefined; >- } >- >- // Check for cyclical references in nested objects >- for (i = stack.length - 1; i >= 0; --i) { >- if (stack[i] === value) { >- throw new Error("JSON.stringify. Cyclical reference"); >- } >- } >- >- arr = isArray(value); >- >- // Add the object to the processing stack >- stack.push(value); >- >- if (arr) { // Array >- for (i = value.length - 1; i >= 0; --i) { >- a[i] = _serialize(value, i) || NULL; >- } >- } else { // Object >- // If whitelist provided, take only those keys >- keys = w || value; >- i = 0; >- >- for (k in keys) { >- if (keys.hasOwnProperty(k)) { >- v = _serialize(value, k); >- if (v) { >- a[i++] = _string(k) + colon + v; >- } >- } >- } >- } >- >- // remove the array from the stack >- stack.pop(); >- >- if (space && a.length) { >- return arr ? >- OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A : >- OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O; >- } else { >- return arr ? >- OPEN_A + a.join(COMMA) + CLOSE_A : >- OPEN_O + a.join(COMMA) + CLOSE_O; >- } >- } >- >- // process the input >- return _serialize({'':o},''); >-} >- >- >-/* Public API */ >-YAHOO.lang.JSON = { >- /** >- * Leverage native JSON parse if the browser has a native implementation. >- * In general, this is a good idea. See the Known Issues section in the >- * JSON user guide for caveats. The default value is true for browsers with >- * native JSON support. >- * >- * @property useNativeParse >- * @type Boolean >- * @default true >- * @static >- */ >- useNativeParse : !!Native, >- >- /** >- * Leverage native JSON stringify if the browser has a native >- * implementation. In general, this is a good idea. See the Known Issues >- * section in the JSON user guide for caveats. The default value is true >- * for browsers with native JSON support. >- * >- * @property useNativeStringify >- * @type Boolean >- * @default true >- * @static >- */ >- useNativeStringify : !!Native, >- >- /** >- * Four step determination whether a string is safe to eval. In three steps, >- * escape sequences, safe values, and properly placed open square brackets >- * are replaced with placeholders or removed. Then in the final step, the >- * result of all these replacements is checked for invalid characters. >- * >- * @method isSafe >- * @param str {String} JSON string to be tested >- * @return {boolean} is the string safe for eval? >- * @static >- */ >- isSafe : function (s) { >- return _isSafe(_prepare(s)); >- }, >- >- /** >- * <p>Parse a JSON string, returning the native JavaScript >- * representation.</p> >- * >- * <p>When lang.JSON.useNativeParse is true, this will defer to the native >- * JSON.parse if the browser has a native implementation. Otherwise, a >- * JavaScript implementation based on http://www.json.org/json2.js >- * is used.</p> >- * >- * @method parse >- * @param s {string} JSON string data >- * @param reviver {function} (optional) function(k,v) passed each key:value >- * pair of object literals, allowing pruning or altering values >- * @return {MIXED} the native JavaScript representation of the JSON string >- * @throws SyntaxError >- * @static >- */ >- parse : function (s,reviver) { >- return Native && YAHOO.lang.JSON.useNativeParse ? >- Native.parse(s,reviver) : _parse(s,reviver); >- }, >- >- /** >- * <p>Converts an arbitrary value to a JSON string representation.</p> >- * >- * <p>Objects with cyclical references will trigger an exception.</p> >- * >- * <p>If a whitelist is provided, only matching object keys will be >- * included. Alternately, a replacer function may be passed as the >- * second parameter. This function is executed on every value in the >- * input, and its return value will be used in place of the original value. >- * This is useful to serialize specialized objects or class instances.</p> >- * >- * <p>If a positive integer or non-empty string is passed as the third >- * parameter, the output will be formatted with carriage returns and >- * indentation for readability. If a String is passed (such as "\t") it >- * will be used once for each indentation level. If a number is passed, >- * that number of spaces will be used.</p> >- * >- * <p>When lang.JSON.useNativeStringify is true, this will defer to the >- * native JSON.stringify if the browser has a native implementation. >- * Otherwise, a JavaScript implementation is used.</p> >- * >- * @method stringify >- * @param o {MIXED} any arbitrary object to convert to JSON string >- * @param w {Array|Function} (optional) whitelist of acceptable object keys >- * to include OR a function(value,key) to alter values >- * before serialization >- * @param space {Number|String} (optional) indentation character(s) or >- * depthy of spaces to format the output >- * @return {string} JSON string representation of the input >- * @throws Error >- * @static >- */ >- stringify : function (o,w,space) { >- return Native && YAHOO.lang.JSON.useNativeStringify ? >- Native.stringify(o,w,space) : _stringify(o,w,space); >- }, >- >- /** >- * Serializes a Date instance as a UTC date string. Used internally by >- * the JavaScript implementation of stringify. If you need a different >- * Date serialization format, override this method. If you change this, >- * you should also set useNativeStringify to false, since native JSON >- * implementations serialize Dates per the ECMAScript 5 spec. You've been >- * warned. >- * >- * @method dateToString >- * @param d {Date} The Date to serialize >- * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ >- * @static >- */ >- dateToString : function (d) { >- function _zeroPad(v) { >- return v < 10 ? '0' + v : v; >- } >- >- return d.getUTCFullYear() + '-' + >- _zeroPad(d.getUTCMonth() + 1) + '-' + >- _zeroPad(d.getUTCDate()) + 'T' + >- _zeroPad(d.getUTCHours()) + COLON + >- _zeroPad(d.getUTCMinutes()) + COLON + >- _zeroPad(d.getUTCSeconds()) + 'Z'; >- }, >- >- /** >- * Reconstitute Date instances from the default JSON UTC serialization. >- * Reference this from a reviver function to rebuild Dates during the >- * parse operation. >- * >- * @method stringToDate >- * @param str {String} String serialization of a Date >- * @return {Date} >- */ >- stringToDate : function (str) { >- var m = str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/); >- if (m) { >- var d = new Date(); >- d.setUTCFullYear(m[1], m[2]-1, m[3]); >- d.setUTCHours(m[4], m[5], m[6], (m[7] || 0)); >- return d; >- } >- return str; >- } >-}; >- >-/** >- * <p>Four step determination whether a string is safe to eval. In three steps, >- * escape sequences, safe values, and properly placed open square brackets >- * are replaced with placeholders or removed. Then in the final step, the >- * result of all these replacements is checked for invalid characters.</p> >- * >- * <p>This is an alias for isSafe.</p> >- * >- * @method isValid >- * @param str {String} JSON string to be tested >- * @return {boolean} is the string safe for eval? >- * @static >- * @deprecated use isSafe >- */ >-YAHOO.lang.JSON.isValid = YAHOO.lang.JSON.isSafe; >- >-})(); >-YAHOO.register("json", YAHOO.lang.JSON, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu-button-arrow-disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/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/menu-button-arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/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/menu/assets/menu-core.css b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu-core.css >deleted file mode 100644 >index 0832ea45b6..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu-core.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 >-*/ >-/* Menu & MenuBar styles */ >- >-.yuimenu { >- >- top: -999em; >- left: -999em; >- >-} >- >-.yuimenubar { >- >- position: static; >- >-} >- >-.yuimenu .yuimenu, >-.yuimenubar .yuimenu { >- >- position: absolute; >- >-} >- >-.yuimenubar li, >-.yuimenu li { >- >- list-style-type: none; >- >-} >- >-.yuimenubar ul, >-.yuimenu ul, >-.yuimenubar li, >-.yuimenu li, >-.yuimenu h6, >-.yuimenubar h6 { >- >- margin: 0; >- padding: 0; >- >-} >- >-.yuimenuitemlabel, >-.yuimenubaritemlabel { >- >- text-align: left; >- white-space: nowrap; >- >-} >- >- >-/* >- The following style rule trigger the "hasLayout" property in >- IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a >- MenuBar instance's <ul> element, allowing both to clear their floated >- child <li> elements. >-*/ >- >-.yuimenubar ul { >- >- *zoom: 1; >- >-} >- >- >-/* >- Remove the "hasLayout" trigger for submenus of MenuBar instances as it >- is unnecessary. >-*/ >- >-.yuimenubar .yuimenu ul { >- >- *zoom: normal; >- >-} >- >-/* >- The following style rule allows a MenuBar instance's <ul> element to clear >- its floated <li> elements in Firefox, Safari and and Opera. >-*/ >- >-.yuimenubar>.bd>ul:after { >- >- content: "."; >- display: block; >- clear: both; >- visibility: hidden; >- height: 0; >- line-height: 0; >- >-} >- >-.yuimenubaritem { >- >- float: left; >- >-} >- >-.yuimenubaritemlabel, >-.yuimenuitemlabel { >- >- display: block; >- >-} >- >-.yuimenuitemlabel .helptext { >- >- font-style: normal; >- display: block; >- >- /* >- The value for the left margin controls how much the help text is >- offset from the text of the menu item. This value will need to >- be customized depending on the longest text label of a menu item. >- */ >- >- margin: -1em 0 0 10em; >- >-} >- >-/* >- PLEASE NOTE: The <div> element used for a menu's shadow is appended >- to its root element via JavaScript once it has been rendered. The >- code that creates the shadow lives in the menu's public "onRender" >- event handler that is a prototype method of YAHOO.widget.Menu. >- Implementers wishing to remove a menu's shadow or add any other markup >- required for a given skin for menu should override the "onRender" method. >-*/ >- >-.yui-menu-shadow { >- >- position: absolute; >- visibility: hidden; >- z-index: -1; >- >-} >- >-.yui-menu-shadow-visible { >- >- top: 2px; >- right: -3px; >- left: -3px; >- bottom: -3px; >- visibility: visible; >- >-} >- >- >-/* >- >-There are two known issues with YAHOO.widget.Overlay (the superclass class of >-Menu) 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 in Menu (a subclass of YAHOO.widget.Overlay): >- >- 1) The "overflow" property of a Menu instance's shadow 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 >- Menu 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 Menu 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 * { >- >- overflow: hidden; >- >-} >- >-.hide-scrollbars select { >- >- display: none; >- >-} >- >- >-/* >- >-The following style rule (".yuimenu.show-scrollbars") overrides the >-".show-scrollbars" rule defined in container-core.css which sets the >-"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to >-"auto" when it is visible. Without this override, a Menu would have scrollbars >-when one of its submenus is visible. >- >-*/ >- >-.yuimenu.show-scrollbars, >-.yuimenubar.show-scrollbars { >- >- overflow: visible; >- >-} >- >-.yuimenu.hide-scrollbars .yui-menu-shadow, >-.yuimenubar.hide-scrollbars .yui-menu-shadow { >- >- overflow: hidden; >- >-} >- >-.yuimenu.show-scrollbars .yui-menu-shadow, >-.yuimenubar.show-scrollbars .yui-menu-shadow { >- >- overflow: auto; >- >-} >- >-.yui-overlay.yui-force-redraw { >- margin-bottom: 1px; >-} >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu.css b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu.css >deleted file mode 100644 >index 9374b172e5..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu.css >+++ /dev/null >@@ -1,503 +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 >-*/ >-/* Menu & MenuBar styles */ >- >-.yuimenu { >- >- top: -999em; >- left: -999em; >- >-} >- >-.yuimenubar { >- >- position: static; >- >-} >- >-.yuimenu .yuimenu, >-.yuimenubar .yuimenu { >- >- position: absolute; >- >-} >- >-.yuimenubar li, >-.yuimenu li { >- >- list-style-type: none; >- >-} >- >-.yuimenubar ul, >-.yuimenu ul, >-.yuimenubar li, >-.yuimenu li, >-.yuimenu h6, >-.yuimenubar h6 { >- >- margin: 0; >- padding: 0; >- >-} >- >-.yuimenuitemlabel, >-.yuimenubaritemlabel { >- >- text-align: left; >- white-space: nowrap; >- >-} >- >- >-/* >- The following style rule trigger the "hasLayout" property in >- IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a >- MenuBar instance's <ul> element, allowing both to clear their floated >- child <li> elements. >-*/ >- >-.yuimenubar ul { >- >- *zoom: 1; >- >-} >- >- >-/* >- Remove the "hasLayout" trigger for submenus of MenuBar instances as it >- is unnecessary. >-*/ >- >-.yuimenubar .yuimenu ul { >- >- *zoom: normal; >- >-} >- >-/* >- The following style rule allows a MenuBar instance's <ul> element to clear >- its floated <li> elements in Firefox, Safari and and Opera. >-*/ >- >-.yuimenubar>.bd>ul:after { >- >- content: "."; >- display: block; >- clear: both; >- visibility: hidden; >- height: 0; >- line-height: 0; >- >-} >- >-.yuimenubaritem { >- >- float: left; >- >-} >- >-.yuimenubaritemlabel, >-.yuimenuitemlabel { >- >- display: block; >- >-} >- >-.yuimenuitemlabel .helptext { >- >- font-style: normal; >- display: block; >- >- /* >- The value for the left margin controls how much the help text is >- offset from the text of the menu item. This value will need to >- be customized depending on the longest text label of a menu item. >- */ >- >- margin: -1em 0 0 10em; >- >-} >- >-/* >- PLEASE NOTE: The <div> element used for a menu's shadow is appended >- to its root element via JavaScript once it has been rendered. The >- code that creates the shadow lives in the menu's public "onRender" >- event handler that is a prototype method of YAHOO.widget.Menu. >- Implementers wishing to remove a menu's shadow or add any other markup >- required for a given skin for menu should override the "onRender" method. >-*/ >- >-.yui-menu-shadow { >- >- position: absolute; >- visibility: hidden; >- z-index: -1; >- >-} >- >-.yui-menu-shadow-visible { >- >- top: 2px; >- right: -3px; >- left: -3px; >- bottom: -3px; >- visibility: visible; >- >-} >- >- >-/* >- >-There are two known issues with YAHOO.widget.Overlay (the superclass class of >-Menu) 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 in Menu (a subclass of YAHOO.widget.Overlay): >- >- 1) The "overflow" property of a Menu instance's shadow 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 >- Menu 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 Menu 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 * { >- >- overflow: hidden; >- >-} >- >-.hide-scrollbars select { >- >- display: none; >- >-} >- >- >-/* >- >-The following style rule (".yuimenu.show-scrollbars") overrides the >-".show-scrollbars" rule defined in container-core.css which sets the >-"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to >-"auto" when it is visible. Without this override, a Menu would have scrollbars >-when one of its submenus is visible. >- >-*/ >- >-.yuimenu.show-scrollbars, >-.yuimenubar.show-scrollbars { >- >- overflow: visible; >- >-} >- >-.yuimenu.hide-scrollbars .yui-menu-shadow, >-.yuimenubar.hide-scrollbars .yui-menu-shadow { >- >- overflow: hidden; >- >-} >- >-.yuimenu.show-scrollbars .yui-menu-shadow, >-.yuimenubar.show-scrollbars .yui-menu-shadow { >- >- overflow: auto; >- >-} >- >- >-/* MenuBar style rules */ >- >-.yuimenubar { >- >- background-color: #f6f7ee; >- >-} >- >- >- >-/* Menu style rules */ >- >-.yuimenu { >- >- background-color: #f6f7ee; >- border: solid 1px #c4c4be; >- padding: 1px; >- >-} >- >-.yui-menu-shadow { >- >- display: none; >- >-} >- >-.yuimenu ul { >- >- border: solid 1px #c4c4be; >- border-width: 1px 0 0 0; >- padding: 10px 0; >- >-} >- >-.yuimenu .yui-menu-body-scrolled { >- >- overflow: hidden; >- >-} >- >- >-/* Group titles */ >- >-.yuimenu h6, >-.yuimenubar h6 { >- >- font-size: 100%; >- font-weight: normal; >- border: solid 1px #c4c4be; >- color: #b9b9b9; >- >-} >- >-.yuimenubar h6 { >- >- float: left; >- padding: 4px 12px; >- border-width: 0 1px 0 0; >- >-} >- >-.yuimenubar .yuimenu h6 { >- >- float: none; >- >-} >- >-.yuimenu h6 { >- >- border-width: 1px 0 0 0; >- padding: 5px 10px 0 10px; >- >-} >- >-.yuimenu ul.first-of-type, >-.yuimenu ul.hastitle, >-.yuimenu h6.first-of-type { >- >- border-width: 0; >- >-} >- >- >- >-/* Top and bottom scroll controls */ >- >-.yuimenu .topscrollbar, >-.yuimenu .bottomscrollbar { >- >- height: 16px; >- background-position: center center; >- background-repeat: no-repeat; >- >-} >- >-.yuimenu .topscrollbar { >- >- background-image: url(menu_up_arrow.png); >- >-} >- >-.yuimenu .topscrollbar_disabled { >- >- background-image: url(menu_up_arrow_disabled.png); >- >-} >- >-.yuimenu .bottomscrollbar { >- >- background-image: url(menu_down_arrow.png); >- >-} >- >-.yuimenu .bottomscrollbar_disabled { >- >- background-image: url(menu_down_arrow_disabled.png); >- >-} >- >- >-/* MenuItem and MenuBarItem styles */ >- >-.yuimenuitem { >- >- /* >- For IE: Used to collapse superfluous white space between <li> elements >- that is triggered by the "display" property of the <a> elements being >- set to "block." >- */ >- >- *border-bottom: solid 1px #f6f7ee; >- >-} >- >-.yuimenuitemlabel, >-.yuimenuitemlabel:visited, >-.yuimenubaritemlabel, >-.yuimenubaritemlabel:visited { >- >- font-size: 85%; >- color: #000; >- text-decoration: none; >- >-} >- >-.yuimenuitemlabel { >- >- padding: 2px 24px; >- >-} >- >-.yuimenubaritemlabel { >- >- border-width: 0 0 0 1px; >- border-style: solid; >- border-color: #c4c4be; >- padding: 4px 24px; >- >-} >- >-.yuimenubar li.first-of-type .yuimenubaritemlabel { >- >- border-width: 0; >- >-} >- >-.yuimenubaritem-hassubmenu { >- >- background: url(menubaritem_submenuindicator.png) right center no-repeat; >- >-} >- >-.yuimenuitem-hassubmenu { >- >- background: url(menuitem_submenuindicator.png) right center no-repeat; >- >-} >- >-.yuimenuitem-checked { >- >- background: url(menuitem_checkbox.png) left center no-repeat; >- >-} >- >-.yuimenuitemlabel .helptext { >- >- margin-top: -1.1em; >- *margin-top: -1.2em; /* For IE*/ >- >-} >- >- >- >-/* MenuItem states */ >- >- >-/* Selected MenuItem */ >- >-.yuimenubaritem-selected, >-.yuimenuitem-selected { >- >- background-color: #8c8ad0; >- >-} >- >-.yuimenubaritemlabel-selected, >-.yuimenubaritemlabel-selected:visited, >-.yuimenuitemlabel-selected, >-.yuimenuitemlabel-selected:visited { >- >- text-decoration: underline; >- color: #fff; >- >-} >- >-.yuimenubaritem-hassubmenu-selected { >- >- background-image: url(menubaritem_submenuindicator_selected.png); >- >-} >- >-.yuimenuitem-hassubmenu-selected { >- >- background-image: url(menuitem_submenuindicator_selected.png); >- >-} >- >-.yuimenuitem-checked-selected { >- >- background-image: url(menuitem_checkbox_selected.png); >- >-} >- >- >-/* Disabled MenuItem */ >- >-.yuimenubaritemlabel-disabled, >-.yuimenubaritemlabel-disabled:visited, >-.yuimenuitemlabel-disabled, >-.yuimenuitemlabel-disabled:visited { >- >- cursor: default; >- color: #b9b9b9; >- >-} >- >-.yuimenubaritem-hassubmenu-disabled { >- >- background-image: url(menubaritem_submenuindicator_disabled.png); >- >-} >- >-.yuimenuitem-hassubmenu-disabled { >- >- background-image: url(menuitem_submenuindicator_disabled.png); >- >-} >- >-.yuimenuitem-checked-disabled { >- >- background-image: url(menuitem_checkbox_disabled.png); >- >-} >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow.png >deleted file mode 100644 >index 86d885db1753737395d3292e7f9de8773d03b607..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3624 >zcmeH})mIek7RFx$>5>lNqf0uaVTSG)oS~!{5Rp_$knRseq#Xp64hb0?LWk}_KynCa >z0f8eSD0T4fIA^c*>}Nd}`(pprzSv1-Cc0GQY~%m{Dt$dIi)$zSD^kMiemG`=xi&Ii >zJ?j7fDCqx+0OY@70f5}p6ACpm^Y97u3Gndo<<f^jxqSV7+&v$<0T4WgvP8lxx0qB< >z7LOo?iIFc2eJmJBxhx<lkqj9EBHU!O28rCovyA2)x3sm1*!znT3DeRdQyI-gDU-=( >zNY=RDq{X~VOddR24twi0)poKma@jPkwpo3MY8)lOl2T^t$(YMUQdU4XZ+(mD>+W4% >z6W53$=ko=$q>ZlJ0T;Xk;50%-<qi*)<P#tWo}eHFSmOe$<n4qjnr%p)9YJI)0X8t> >zt|4h81JDRfgOmad9fC+yu7D*dA_9&>F3zjKObj>*KHHc8k*L$WFaluvlADpBC<AcO >zyCrG?4`on2dM{ZUAS3~UyJ5E?m=Ob#`fztWP}dBwI9iGZKuQTD%@gB<0Z|xm?C0eT >z2C;d7LFWLj^7BqD?WV{zsk{ai44<NQlr5>49|;^T&MAb`XTHNA?{vc{UqiezB#%`( >zN|xr^;V=M28I0H49$p0FsB3XJ`7|`OgV^?G;wv6!=he&g(JEgJ0G0zI#x6xA8rdS1 >zi6gx)-|+7ddEBQcdVG@N-aw<#1d6ui;D^3{*=QF($IQ;IudU4(bVF>N2I1kC$W8|= >z{Nmy72$l1b<8Pl<_@bokqjZT*zjY2D8I{}~eL)uMJin2yd)`cOb<Q!t)2;7}L5MJ{ >zn$!8EY2~LLN|*2?L0$;=@Q+`)t}Kb35vnc8fw~831YsFs<@PRwzYGOw5rNp1695ic >zeLB7hkrGCF#4L{nUG1x1=oayVNO%1gegNFp;uD7rHmdhsU!qn~lt`T>`%wprD3<tk >z$IbZ;igQQ#SO{NtCxjM4?izX9-%+?a8X^=wQpX|UDDhQ;Ll$f95ufQxE#7JMky_Q4 >z=8qF;VTVv#6d93bKPkNv_go@@b25TAjg&br?v%SjkBBaXk82>2!JNl1Lrzc1A{oYI >zrN?og>VHEq!A_?oL%APFN1w;H=}NtfYA{#*O4$U(lq;~s>b#-&;u<KGpUzZN@WuZF >zn`)|j@#dE*51P4jHE5qC_B#uSO!q@c@!l>-{asPAOqZd0o@&afUbeb>)r74{$1bDw >zK}2*>+E_Aqq96#D6Q`yg!U$n9qgT##n@{%E9GL<cVXS$lAWvqw;Rk`1Tfe(moTa4_ >z5PG7#Q*`O{60~87&~61jx+JKyAm;fE{rY#Xak_Dx@kbWCTcQ;OvU+U1nFDjKUJWFQ >zFGacT^vA8C*1FbY*4Wp$4{XU%&KiF2PAyl2ECwGKu&&dt%dQi<<w|Q>z0J2+C@+TH >zl1sON)D)vF-kT?s)5|{2R~(69(l;!rd6PB4=E3Z7;`#o2V9TwAEKZZ0FYxi9E#2=q >z-wBU`D5>HZWBL-2LaYTWBrHhQAeQ&JMy0G1DXe`kNd>8$+|4|iJRd8B2wLPRW5ytP >zmO++47Q2W9tfI2Ca<P)a>d<NkmR@n+GQ3vDO2%@vg6wN{l~pCmY{!z_5?P^Ko=}M_ >z_kpRui?F^(BDU@_>N17CGcT%lSZ(X&qHtkt3>M|~qN<9293|H+P(L#J^odAo?gd9{ >zifUy=u_9E)KnC7uarn|*on$rF@AOrm3E8GlS<YcZ@*=~&@QN^dsjLx3%FWKJGCL<5 >zQKeU9UZuO!E?>J_hAM5>ZnZv(qSov)5VRB2MW*9!qBbpOEf>nj%b1K+m5yu0E4@nC >zi(9pVK0hkk%PstLKeEusr))8#ee=)laES}ph4-JbV_ixFaU&%kF`g2~qS7Ph=cB?Q >z(TD$O4z=&nfR;FAIpr+JW?;rt-cIWLt3#9O*=x7Tx9Z*N-TPL6Sb$r=(0JQ;FW<r# >zQz~4lY@}?|H!?i(W@IW)u0U04T6(i!vtYVlsoBvc*hUmxj{fMT->_y=YQ2YUdlYA* >zXkCJ^vaxT}sX^87Pqo&xmfb4Dm}Ht%6;2_$>VBdJ&=t+Bb?Y<4_*%3#I@}5A%#3XA >zsqNa!Y|jjD3IF#(m4qr`mb!|=h9e^2gFl1PJ*CBb+^aqH@SdaWEeRxIly-DRW))38 >zB;4(ZvMiX;MKU8X0WpV(DM^OWL*hAV;sxxz3;peD27$+Z_RFE;$EbqFg3jG?{QEum >zJ<q*_`Paj;uZ0V(Wdgo*^+UgzuaBuyyv~yJTB?pPg_=eon>KkRTqH8!HPdy?B|()Z >zPW#MiztsF+ud1!8C@e}ZT00CYV4M4!hfKSC3LWB>pwD=(T(3f}#z0vlKLL_3DM~ZS >z_Qu(1=u_^`Y3fRNw_gpjyPBy*7)?ga^yr%C^^O{DkNzLeYq(D~b8#6sPwF_ci0@Nh >zNSrpDQo1521>+Lp;PL8dzKIC7F{vE6ps{&qz>?M<t!%Bu0;H6w;(IXzIT5u=@dqk% >z3N5lN>b>Ib*29ws6hi-@;cZ26ky`mj4?iuP?;a+spjIeW!<cg=`t5x~igBGsab-*u >z;&h@)*&0TPCU;-{N0U~hoGF$6fIf&njXb22qZ7#^F(yBjI0Lm4;WRnW6EO~b@gt*6 >zE`+Z~rbKid6DwHpyv>NpXrVx<kSYHOm$$U4QoB^li;U-fkV<ajOf+&Ex#9j~sM;;A >z;j-sZO0xuK7Ri8D<MZm9)?(ynNa=T&jnK3RNdwXi?*4fsX;3k{s_@Rp?r`HE{<*@d >z{nuB!be(j|FVH3NhHx<s#72Ad1H}dvzYsk6D&x&N@%M<URX!%8MZ70Xt9IczwGr(C >zp~hZO_d5ooJDLc*b||dK*W<!>=BIb<O%W2-OHEFH;!*5sj7iD040z@o#%D7^^TF%v >z2|k0L^X6ZEsHp13xQ@DyyKikQiWS;YXIJKI<WN7Nnw|SVwRG>p?(r{eyhP535WY1A >z4aL0utn#tVt!w}{qO1;k2RnlOfywWUFElw#pFSGfV-IWlCHrF%Z`*cqp*HXdZ$)5b >zJn25^cBX&Uc%ojLRJnDUedcXnW8&?%+ebJ~ctOHTjh@DQo#Yr-g;}Ie-PzHl?)&G{ >zC2BuNj7px$>fcwrE4;p1A!}PFWJ@QUR7!JCQp2j3Nhbbz!hz(FcmT;i$k!>b%s;br >zwrw#TRvVkzUJO0g#s5R|N>;@>#NZG%;5oMyJ&}n#7)?cGp~54?f6qJO-=M=bU2sbe >zXngitXakqWwXae(mD`kYb_X8=4;t|6^ze`H{P#)@-rIrODwmlPrhToiTJvi$c3zmh >z(DtS<_meI5LIvEyQG3WwrmLyRLPgbu_QO!0lb(~~C8mW4f58jfQ0r`v;9gCeX`925 >z#;)cpbRl6<-S%>RW`F+K18h*y;n=+H32|J^=w-%nIt}z@dS3caJXQQo;axRF#T9k` >zi>>oA=&0+cKq2$xo6DhEW+sV<)5)D_+*s~dan3<b=4bDxB^TS+9oF~w-p*dmPXoa+ >zQumMUo$Yo6%?EMpzg?m+U3<#)Oz6tvcm1*Dm$I`=*38T+BEsCma~Byg{Pn*{gw!<F >z1fV|c>6v-vb>?!>voHoAlplb|7yy1>UHcXQk0k-vb_75v7XW6T7Y;o-01yH*Bbc_e >zHR5{g|Mh<Y|C<Dk<N_A1H@^{RVPbg&)|({_u9L97mL@ECPNiRp8gNl|VGVy@6?B=! >quJ@?@MwDtBPVwE3BaW#fnI`~5eZ;I6Kb%JY!qe9_(W-?wM*kOi`A2X7 > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_down_arrow_disabled.png >deleted file mode 100644 >index 98b39885ab1be09ca7c32bff839ea9c1b69de3e8..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3621 >zcmeH}=QkYc7RFy8dapq^IuVR6Ix~7NBSsM25D_I3EoAh1h=^_kiC!WkBcmjGjnSfx >z5<NJ$N6AQ(x$<}1yVrX5vz`z8!~U)PVJBIb>C;hjQ3C+z3=MRwuAK6ZC`qsS(YP7* >z%BcJe>>dL^!}3QYAiwYi0MzE*FqnmfmtT<IV=q5{K0_Fc&p*)5)BB+Z03q{eYb4xy >zn_Zo-bPP34M7=Whvtpy<vx26eSTjV#`KcI<68TH!*epAlbalzN2Z|F()6!6>Y?czV >z$<(tH>-?o@F>ex+ht5{Q-}p?o5jICIKh9`u)gGanMkzWdX|oOFEEQ0+RZw20?=k&7 >zeJkryT2a(O{(zCP$({f4g&+wyjZ{;+Ezm*n8IXib(olj9(}E7^n+ZgQ9cZ2d2`ZMP >zBPipJF(rx>XoaOg%Yl|22@0JnVhxJPfb+1M>l(0-1kR$*HzxrKeVP|e0_<P$vyl{M >z06rFvL>=Iz3Tj91ChG!(G+^~K?okG_l0e$f*3$qqG=mNtBTXZqqy^HJiE+08SvYVW >z5EKjnv3Y=1@6cB5-`n+!TjE!w@*35!Ldv>P_LPzV6t=cfyka;*j@zt?F4tW0wWPX2 >z^EhRr<QcvneFdO6gY9bDql*w6eLW7Rn1-QulHB=1P84u;UAx>Et?}0aU?nJW{89qa >z#D!8NNBLfs3h$G7-KQyjLP+s!WYGEuinr%&kNp3z(Jgs_otxWOU!OJVf!eza*+yI< >zyPP^~FCPAiR68e}eE+;E6ea5zrB8PHz3c0-N!iWOmsGK?3!CZs=gl<4bDl|o9z$0w >zLY#HYk~ttvCqMN_woD)i`tnw<@C4C)by?z!RAX5IG(6BC3D1zMbaW&AX)MZ!2<liR >z0C3pq*ZED1k`(0?voab?JkY$*FBS$UPs5i10NmFRl7bI4Y4%@TqE2y?c!M_gapw(* >z4)U9w*B3fz&Ycxwp+Y@fP(~=VJL+bj^R3!ws95|+1CO{f<eL_ce21l1e5OCWRF};s >zdUbz>-!7CzonmcKRAkx%lq@d%^NA#`$q2zTN{+m^Q~pi^GUgN^zQIIRO9A5y1p^tY >zWH_IV0ned&;5Fq02fdaI)d3(IeIDPYFY_v@(Ng^z?ME24Qi&^8uasuYJxC@$oxQkV >zEbs%Dda7c{)>w@f!+g31tY5n0#|;X(o`=#>ecjOacO<AX-G<)_)Y8`UaW&knC2dVQ >zaT|RfOvW6g+d-vB77XQc;ng-km>|q%4J!F=3du9gQz=oA##(lX3S?Fqe-LS5`qgv8 >zRaPbeVIUzm&795xVGK`%^(YB3C&6Szu`jL}zJCj!V4l#Mcw{BGEm2h<Z@?v(IXLg` >z(@3HGN`mk9K-@Zdy?b45oqL`C(4HFYsul3|)OuCSYUqIx=LX}3{06y4uB^7rn|!Oq >z$`Uw}Li#;uT?xkOon=BLi~N&(<&hY6L*uf#(yU1?FAgt)_q!iKEli79yk<FLwiCnK >z`ag1hkRAuq(#5mI^d}<4I16r2+(2>$-*}g6QqDP<!r2d(R+8Dx-O6Lg^Rq#SW5l1a >zWeibg8D)uNaf?IXRn_IyOVu<sM>fOo^s4*T5%qdDa@K2ARNt~|Y^u=~yVl&+$ST#! >zglc4^A6)Zoq}@dlxm~wOw>j*sW$}BbwYEM!8aK|S5D9)Cx|;YWQ3^dG??>jIJr!@w >zz2Iq0QLnBlQHIGG$=Nnp9li3@q*%)hI4uk^quLUy$T^BkUSd7CwR(%YT;2pL<Kf^_ >zot=}7s4=LqtkK_XSFGQwK$o}cw%VOV(QEe`i8_etBhzu$(OcGY){7O?73`+!Dkt?) >z)jnn1C9OKaUmjKL=N5gwk18_pt5^zc-}-$s0&)Sr@cmtJqECw;Z=w|<$J63&sP!rY >z_^I(g`tko-!W_G`U}Y{@E;%c)8Q5{PH&c3l>oKHy_c^Qyt@-x(_Pr4y7vUE%Hr+AZ >z&$lwgmftE@HBmL`ANe{`Ix?N7P@pa|BfC|wRWMVq-0XZW<emhk67$K!uyOrfx!pdd >z?NQu4WxFzj%{|8^y*hNA@N{ckYXwsU)-2Pkrf3@3-S97F5L4C6*|0H7j<3h~Vj^6S >zt{lkb-umwS%=XNPmWaPE)G6o^=ICp9?(sxE{t(Eja#v+3A6K}q8PR*3y$wMkMj1zE >z<<>AP!?$|8(bff%`bZ8W_HoQnVoH*6^srQphExG}-{L^~x>3+cfa6No#0k2fsi14G >z68~;rao>ACVd3>x`Pa9K?BpJgbq~P4TW*YN(!9=+_F1ltG>4f-AwO;jLfjx3wskWN >z&1J#W1eXI2jh`BUuh%rz)RdNFm+YLrDs?muG!L71`xQCGEyJD*65WYm#Bor85+*^C >zCPisS*<U+54SUA_B~4QW@A0#7ZcjV47^}^uogQ5mz0q06?=|qxi#mS7RxU0B=S?4H >z5&2_!jKXEpC8ax(Rx~al&Nf~%%|8*rH7=8*5InvBd%UdkTPIs*sQ@WsuKZ5YNI_hq >zTIzw?yi$vNi)Npcr`^{n1R7!Z(D<gZlz6@3qlcfD&-acJR?(|8YvCNZkO4>k&=OqN >zaa;v^l@zmtO173sqS>8S|Iua?uVhaZK4b|NPNNR(;^{&PK*klv6K7!#;=E>u2I8h+ >zFaODCQwSC6l`E6jz{ZMJy=XI`Gg&N9DPqrm%I7PquF@_O^D^T_0JNIlG!ui|L2i0J >z9j^6=YrO1zl+q00&7v6eX?jt6-A<Ak11<jnzb7^$PSJ?;u=V^hk~E~8T~l;>WbbR! >z5dMWy;lXR-9&;D-%1caHys@n$4`Q>u_JMMvT0khCdX4S+?fARowQ8S|G2*^c<~4h^ >zIrWk4B4MUJQTIECqB}p5`0UcyP;bOV>@LjgIhrFNcFP}Ke#fJ^HQ17p>sj#}Ic(2o >z#TG&~xD)(_zT_>u`cPHVgLNPEobcS<T#_uZr_Zj=+03DTL^n78fo}QkhrN@Zx_C&= >zh#0;#1_Q&s`J(oz&7)!vH=?Que+xf`|As5>Pb_|PnK^wlzRw-r_EY|!DZG6f;X-5Z >zGv0>8#&pVa%Hz!NtcjpmpH#hlntkT$SZC%Nu-8vIL3%+UNROGpew*T%P={NkPv73v >zr|<vk^CkKqSdvbW&gSpJzEwegozV4d0@X5smriB=X=-@w3dQ7KPkE3$kO$EG!+gC0 >z>-;l&SNj(8uNvdiJ4<2b`uM*X3gy-8LXD2#gWmJo(UY0T!_ic97CItQ>eqrZz7!L_ >z<%U~+z~Fb#!WgtNp-W8JQf*VkIUIfpI&8#mu-JaG&3~uj<hv8Jqjs4&Y2M#j*qUFD >zb@0LNhqZqU_atm{7b)QukK054WhYKg6)CGPwjYK05qb$H%j}Dhfua|<;nule(fztM >z^ERhrtv&5I*kZzzrv2r@?7_nG2OYu1N8=0n1oF6;(aVgJbOzY<^t|-pc)IxAqB|PO >z%Bz}z7u)9*uu=C>ks^-E(#zp`4t7Z7>D2BFZajCqB<C<E^Na7ZvWuOLUCwv-zOFvr >z&x0XyGWU<~p6zu8F9h=(yjf;2Uw_8;T#V@T>-~xKSjAZ;XJ#gmj5PP?+)YjrfAw#Y >zA+=4l0eGMG?94LrD)YG+SeXJ4CJX>727q70E8hm-i8KH^&H$+70>I(-(y3Pu08(IK >z0@uaia93mhum2PH-z2~_BwBj4`L!S`GixH)XqGm*N+O0j+VGHhlOZe<kfudRe;|&T >qWo$vquFYdBEv%^XySa$x4dg)8{TiF6M<L%Ia)!EQI`vTJ=>G!P?nQV2 > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow.png >deleted file mode 100644 >index d83a6be8c57d2cbf86392ed62257f8ae2ef0f08d..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 936 >zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxfSkfJR9T^y|-MHc(VFct$mbgZg >z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wP9djW(e>JagB_O0IDAaqaiRdL*R>P >z@m-+LnM#8Eg8wr--EQCo<SBT%IEGZ*N=j&9VoPCTo^tR2!$ZRc!Jg9%t0Z_Bn0Of2 >W_cNHTmsA%7g_)<TpUXO@geCw<e=pDg > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menu_up_arrow_disabled.png >deleted file mode 100644 >index 63b56382a9cb5dde85f9e109fec1d1bdebb2512c..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 936 >zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxfSkfJR9T^y|-MHc(VFct$mbgZg >z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wP9djW(e>JaXokL98moz7!84u83IzL >z)E5DL&QucQ7yO^$>2?DzAWy;5#WAGfR#HL>6I%)!^OS=J7#<on2=<(ASS7*3z{JDA >XzMsK#y`;JzD9k)v{an^LB{Ts5lh!a~ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator.png >deleted file mode 100644 >index 921b267c247823a1ec6139f3b0bf129783aa2517..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3623 >zcmeH}<y#c$7R6r#$swdeICPA3O2Z7D0)q@C&47rcQi60JLZlf4l@19R975@45Re=~ >zTHpZp5Q0*dbN`Kd_VcX0p7mjWSies@;enAhB{?fO0Dw|gN5k~SX>LSHN_eyT%Tr5k >zjLcid(hmR%x_?9f@(P#%AUAf0!yi0w^YZudbMx}%)P=)2y?wo0-JiGs5IB!ELm|wz >z8I@0$j$!)o;ji_*Oc_WyO<_sl^y&OiE;1Uuc&_3(29wS^nwmsx14Z$KDJkK}3?{;m >zMDkgZb*{H5QSagtht5|*-g!*7oo<d^HO;7ORUe@n$4ELzAz3<7CNklW3K++o?@|3d >zeJkstY7ykT-hhU*(V5Hdl7|4Cg()fB<L)5&3<v@zDM&$wVSb1B-MDM&9aydnL3lJl >zhkyEgebR7xpcb40D+Ov=1mWl$elt)+1nh^M9M`}D5nwOya&r=dqt9|f2!Qo#E(U_4 >zbihgH60ZT=6hZaa!$eJh6bJOK`aSYsRs@LaTDa<fx@ORUqoHU3q!1u(5+5T3h(dt< >z01r<fh|UG{T89=&f8VR6*@E7X%56}>^2%#QSd)tQkXTrVatPvdneNfcI^1%|Qxok9 >z%4Ly^kf#2AGy*_TI>Sxdqsu@XRV@xDn}VUT6WRGfe9i6XxOTNMR^_b*z>0s^_?56& >zBWt)Kak%HzTfTiFw?`C3&rXwE8>rQqK+*QR#gX?vY&470uyb=8>+7?6JuqvBA&bx} >zRF_?c#pRP<VM-ULC*MD>@<vG7MraeAeeW7MHYm9}_KGapabYu6`=XiR`htCuyGPd% >zi-gjznb7*AXyhdyNtSRYz+MUU@=aVjuPzIp6RIrBfV#&j1R?1n<+e_QKlKG@kp3O3 >zrvMzbdUbviBqa=Yi&_~AxIR$5)Gp!!;jX%`d;oZ)!7GXwYE<nf1wf-H0$QiecHGG< >z+(CS|^Y%g~#f80WG>o^W3q}JYcMiYnYcEtC2@{MRtz(DUi+xjLm+mlei_P$+674eo >zM5XLa{o8@Guv4%tf{aLgfRxUGYd)U9F%ij=LdujIbH>%FLqwaz%Q+ZNZ^EsgE~6u1 >znuy>u*I_?Y_Pr$^XQS1Ut~dZBBQIjxv?X3gG?*xVgEYah<#MdiT5l=7I{QoHr7{-f >zfA#&ys+=ray!Expje0&+1>P^-@q?K}s^^KgXkRz1{=P6-hSP98cQvG{kG1Y$HDPPQ >ziPKnp01<73W(S!pQ2>n7fkRyfX@E4E)hXw^%PW0no=lF6FxsR`fIFjH|093PonJl7 >zj*=2_NF8CGY1&jeF`AHgc#j+}Z30|U0GoD8xBfk1f_6e{;;AXmws1whv<@pz#^AiO >zM+1rcYhliN12OC9_3m}4b+&b`Lu+!hqngkAGqY7e)1k+DEE_Z%(i_AsIg;w;@A6C+ >z%Zm|rWKykQHN_ay4<>QtbkfiA<VT|zb@fYX-eyj+x-q$(x_|iL-*RU$lfx+ctHs3d >zw)T(gAB4vN5XxAFsQ!4AAWJ?o2{Vc%fcZm?K`F~*5=%cqTux#)XDgRF*UKCU#Xw&$ >zqz{p2>Sgk0vO&cV6_urxOO+JnN9Mzb)QU%Dp|x7(Qf6xvWZ$x?%q!6kcFow#P!)>h >zah0fYFNEs*Fw4sXV#{uWZe#d+lcIXNwYEM^3MZDvKw&Nq%Bt9B5i&je^`mnyo<m!6 >zF4<d?lq)NW<>69#QWlM-N3UH~N!D_F&I<gE$hHK_vX8<Nm*@|KR)yF~r46tWE;b&O >zS=m|0DxE5mD(&5N+1kA_bZNV0tL1qFm3qIPfQ^7QDiwDdy=69Mwpd19#%QRla8fH; >z=~2Q~+^P}q<!RY|PT}WA;e`fXWlKTrTfgsyid`ZuJ%5*-XhV?1jSya9JOszA)GOoT >zrNl1QkN?{QZriN}FLB6p$X<y~$Brw#o6`DIi#pl8&t{Ex&9l$5?;SreKNr8g;f~>c >zo~a?WRH#(ZK+&LobY%4H=ya}3zOuxO<W~Mx{!IRIv%OWIl`y6p^T|cGVcn|Kav#(7 >zG{#EavIJ>vW!tD#gRbG5Zmnr8yHkcW$}p-boJMum{f!yKR5Y{HZOjtmYcZafPzRJF >z6RNqlwtGLLJtMRw^v_FW63Vzasw#FX_AtMXzVr$Y6_)aF1^cR@y~kPGVkqPo&DgBe >z8isCIsK*^`mOrVDVnSj4qK@K|67(a7MYB~z^V#|q2in*5{7-yrSAr)_(D{w|U3=yD >z5BswF?)z~IZ$_lw2o+jN`F-skfPXjH7+0lulPT`8TpeZ%H;zCxZSjaXiKScA%+xiP >z1XP|n95AW;RPlYYrn06aw<Nh_X*VL*(LB&RY~1ZtXcw~#f5~(0d>wo}4$8v$2vCFx >z5$X}vx6aRkUvPa%QB}aZ{A`%pQ%^3!sxzpkM%F}bbk=aW4g8f>!*#lqgG<M`Q^h<8 >z`!W5M#9`ARsXGiJ5EB<;5v!Ww9gk!km&le07+-+<Eo=PN$kJHKM@bmVe-P1=fvQxB >zK31BSYmshI?Gtsi9GOC*k-AUx@5+lpYh|B4`Mi9wcNDjZUZq$IVagF3u=Nfq#&sRX >zlrdI_(h4hNsTsr@-GBWbbsA_nV=~_%T>xJSc~BR77m8bKTy{Ku7H$LOFgnzM8V0}m >zE4@u7h__d&M0f)mEl`oxW<Y7Mn6FUCnD?C1Q&L%>T_WmLdYTWclFKjygW5rDx;`JS >zc8O`Y>V2BjEXI*ZGU(BmR(;!2gd77a{eiF&oPm-wpj<3mzl<gf$!Ap+-W%N;X&l0* >z$rT*Dx!$AgqFs4~DT&p$5Mf7dwpTxvZ&30H!jrEt+`bq4khoguQz8cHIb~e6XOUeS >z*3KVn=n?U#b11U2iNIr*!kl~~CUkdUX3y3bDQ3Cc<nTKd&8EVTkXTEPXUb-HIV-pj >zxWN|ZHS{HS;q}LgsvfNKnCpb=_U4jEp*2-jW%gz^)l<s3`Hz?pgm{M5vYWseHt >zTca>=?7J^YpW0l?263Z`s)+Z9W5jQS?Eb`Jlf%r})A4<_khY)Fe@)@7+fFZ420!D? >z3Cs<rT&G;lb<Z15RcjL}x6iW9J#A}@Jbm{12`30INqDF*GuUra>=Vie)70sEyV_L! >ze|)||9|VX{%2JyDS<tu2<E;_2zI{rze9A$oF#kL`q<V#9@{i~2D0Z>Ou)M=Ot$ee* >zb8AQI7UL0>@#&qV;0ta1AJhfXN|r%-M~Ff9`R&Nb4AkLRGCC6-8YcQ{!5;q>6SC!m >zTYgOKb<jfNzcQhDowTLcriimS{N#VwfZw3A_+*jyLBY;*$A3rZDr3^PzqOz>uNG_L >zf!z;oZwhfe-DWG4!z~`S2mQ@>Jv~(@ue{iP6zp}{dwR0WxESUuaETjkoeL1yuW2)G >zvpZJXQ=fw`#!abOUoFfYEWCW&5m0nAzMy?d91}Hmm41>+4Zoe5n>rjz8M|9}UqxPi >zRn_-$`=Sg!<~+t<$aMAgYPgn(Q7r6iYIg=Vo-<yYeVCo`#q&kU<xa;g%Lja4S0Bgc >z!9XdAN5>D(_c{X>0@x4UEmIq>zu<f+c<uJ9{>1ES*?9&_M#eP}Vb0NolavVl=HDbj >zsT-;TP@nSR+$7^Bb2{mm8Uhf^2S9if0Kcwpd>epg;sET}1E7!t0F&1%yIw5-2*Cpb >zgr=n>^5*Q{`Io@|CxK%bzr~y8xBN|w%&x&kv$)<(64cdDM+DA0+G`L(m~TNK$;rtO >qhz^vQIqg?6L|k*gRs6dgy)6(29HZb_fqClx(CKO#Y1G2(BmWC+B|ohI > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png >deleted file mode 100644 >index 63e0c3c193b88f349c2cd3aef8b87a1c39b7cbaa..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3623 >zcmeH}=Q|wg7R6s7>L}4mIC`1rH99kT4MvO>-4GEa5-mjUM~Uc0kmw~!jEs`#-3X$N >z5<NJ$M+u2`o%?Uxv!7?}^{fy3!}@*N@eho&Dal#M0RWV`IvS=oPIDttQo@_vU!GEO >zV`Sbsmd^m7p!-JzAUB^G0CHn@IQ+o_H!nZ0XKr5JoVsv0r?;<{tNRld00QRGW+;T& >zHly<C(lJawF6@oImnj1&rztEkj6RJY%0)(_7spjJ$6(TVM^lrCZJ;oYFgZCaiNQn| >zl0ZI7vd&eU9QiITVd#7%_?^de+v(=$Rnv^hR`n6Oag3yc6q2bUWg-&>sep0Z`5xKd >z)3>rNsuoVp>kVi~8=bkHUGflsvrr|ad)yr)p8-L@Bn2txFwE-^zZ-i^y#vd!Aqa~i >z=<rLsuTL6A57dH^VWmJ#iy#c0&2I(@iGcmElj9nAAOh?KUTsc-F!WhYFafZB!^J>Q >zm<BlMT;eo<n<A(ldzhdJkm7*eRli3b%!&YUT?<zoP}dAPa5NMRfD{76P2!@308uco >zAK>8$08u%BUhB|8>F;~BG+WRcQaKGuSYCO}aBET#9})`-Q4T?zF4H}FS%+H=xoV<a >zfjKOa;nLLKk469}Ok=oddvqCqqpHQ>WRo#eb|O1ph_AUF9oMcl#;Uy409f%09lsJ5 >zYh(>mBo6buD(2fKa(hHk`1~}{wSii#2^4P6TO4`+!$z|x6+1V#vA#a5*8{V57_tbt >zLUq}7SX@5&6{>V`dh-4ADsQ-?ZMZhk+4ruIV}p{rW3S1g92YiIv@e<|t}oapxqEaS >zu}CQWnhC8>vPN#wkz@&XJnXelFW<zq^XjtjIibq345)joLJ*uLQf})+_)}ki2I<$a >zdJ4c{t5@eYK~lmnx5$+-|LX(QOYK5F5az1;+6RC~8oZ*2p+?nyQUEjx!=ZKRY{#9< >z!X3nSJ8v&^Qe4=}M!|S{x?nUga_6wSzV<@Z5ir4+(K>dhz1TN3cIgfix0rNqD$y?U >zPgKg@)W01_3pxec!pVr#2T180xaQ*s921Z{$)rp<(PvzpIz+UIyqtq^^d{W;X)-zz >zrU?j6a~<|WW#3!!u{K&QX^I0tGU6hpO<Uqkc!P=ZH%Jp4TQ0{MrBzJv)!9!XH-)h< >z@2l@eR^=qwqOGr0Zq)NBD)4^sjvve<Qaw+^Mf<v8_4kFz(w&CuxvL>neXMm4s|j1< >zPn^c;{fTJ9H9N>;iTq)l4jk$_NCTwNtWG)SU0&%s^JH>lgi$740^I54`XBjQ?)>Uu >zc9fKeMd}FiOw*>&iO~ed!F%L*Y2)FN0@&1By7li76SNar6HiTfwuLM5q;*(%(g)|A >zJsL>l-w1Qw8;D*<uXnFYt+TCj9a@v49o2l^pP8)+nhrhIW7(kDklrA6$(B?%f0t{z >zSYCv<Ba>nUt0}^melUqGr;~o3D?b{^sH<O6Q=Bo$>c-@D>i*$}U(21v3=X5LuND)- >z+uA>}eh?n}LnvbyBKzY|f-HH=B+Mulf94O_2Bj>Mi7fpHaXE?I?5!N?94~Vu6a#(9 >zkTyh~p_jp*!3GsWR8*E$E>%*PADIs$QYs#qh16=9OPQ@zkbTRnGOt8G*fnD_Lscl2 >z$5x`sy%4JJLoF}ki7mSgx{cxQO$zJn*4p|wDV$gu1BAIeD63+ghs*Tv*N@J<d;x9E >zzGQDrRIaQjl7~y_Nm(?S9=&l@C0Wb%Im`DmBHI!y%Q^~8SfW1=S`}g|l{UaixY&49 >zW@cp~t8}VNs<e08Wo!4!(53B~t(NEERO<bD0yYBLs1)37^p@G2*<u-a8Ka@H!bz=Y >zrAG-{QLBdkm#1a>*#(~;g%uchl`RFfZ~eX-B6f+m^!#0Rq76Y3H$r%c@emxdQm>4U >zmlC^JKmKnMxNWx@yu=~HA!{Wn4Lh#%Zc6J<E$SrqKASb(HP1fJzIXh@{9OF{hC7D) >zxu%BLQlU~s14V=W(UH;O(ditSJY|U)$*sJtyqUb^W_zmuD`8AI=97zV!@5<e<vynE >zX|$ERWeL*U%C=Ff23^B9-CEOHcBc$$lx|d2FpcW2`x`Tesc2@Y+n6QB*J3;|Ar2@< >zCRB58ZTEh9dwNJq$e)+WB$TmpR8{O&?4i#-`qC>rR9MQz<?pM8^d4t!i=mKXG-I<; >zYZ$s=p&oa%S>B{JiV1~%7I_qx7_T2OESjYvn#b0+IMBYX=Xc^`yAm{Ug3fEq>)I>F >zf7qAZci)d)csnBfR;a*I>e<)s0r+>5jd4|qw;AFd%hjRAaN}@P(-x1IlUSNX%}iZ$ >ziGSs(!vT}ZPZi&{Ybt9>a!Zm+mUbg@9nAyH!^YiS1$NQP@K-$7&euWL<De{zj{rp& >zAFdv5ee3)z=q1;eWK{*c%g=_nJ@uqQtU7~wN<>Y>MrRF|+rVF`HC(4#*|;>EJ5}_9 >z&>z!ZNgOsE61zho0@1P27BQ;H-f>9QafvJ$|M3O*vt^Cn8krhPc_;~E`41v`GEkLD >z(Z@>jaxKy=s(qramLpS0G*b78{#|)dXsztiC!d!u_Ksp#(W?||!A#j=1Ge6QMYyix >z=rYC%QCeYzOf`czqx*0EqfP@YXH4Qdr1R%XCJ*dl??Q2ljmwV5&BAS<97cyaP{W|t >zf2Fm_1oHMul?ZQOqXa5a+YBfT7V{Je7;|56dP*uQv`a+3PD}NHRdN}oV^BM&P1hI0 >z)h^KuSG`XYo5eUXNCrI`Q>$-VijZSqr9Ti>f-_K(29%41>zC2^A^FUzf_tNTBaK7& >zRJr_vx7T~LU9>B&F(onj79#A(&GzcY@(oHpfq3#YhTHdI9uik8eM-PUJ*SMT_AIh$ >zL)-a-3_Zdhbq+;zHW7I2Qkau(M2GAy%<S13BgHJ2n;d?}pxIOy;uC7=@l06^uVw`o >z0yfxUy@tNzEWG(xQPqQW9&?>=-QHXhDX^x>tjyZXqIya>H~*1x`QgXClb@P+v8+)+ >zd}|~Ij(zt<=~J6a*&uFIQ5EqXag6wlklmkHY;u@6dpf?)7Toqz`mZUxb=&Es%HU_b >zIf1$1l<Snsx$b%6scLO}<@Q<Txu<Q7k*CjIKj8%7B?%7|W(NChihV*EVVW|1Z&#bD >z|BugC=mUQdN?A(tKlA%mdAv0O*SAl}mQOh-73N<g1y`?-O#bnL9mOv87?yjOtCeS# >zdv5J$-C{hVGCsYt6m+4D|ARVTTFEj{?+7vIKEE9?nT|RfOG0O$LqbJ=E!g9WF~M6- >zxaG&xUI#5Sek&82*NIz-ZHhRX!%u#P4fqW@i%%B09~A67cl>sguF@xs`&;u{b8E3S >z9@zb$_NHLh(`~i_Io#rLd*I)U*V9u4^2&?tM?qevy{9M3jEkYZ0++bq);WKH{hBu8 >zHoIfBJ@q;GV(gTv_0_`c!NRM@9sY$!;|toS#L<ysS7|3H)bQIWIVr<2lrg&n_f_QO >zS5<v4w=c@zW6opz1x#1PSHrbTjAEf@Q@b;`@$B)Uti!DIFP<+;E_XV1Sw7(Vy81Xi >z4+cm{JUV`OzSrr$;Lm>WZkgJ6{Uzrs!E3i)^(SUu%g)nT($lYr2(ynaoTNnXH~%IP >zO5IQ$fcoT@=O*blnbS$f)DVCmJ^;cZ0r+)&<J$l{7YAU+9sq@G0GPa9+x2PzKnNZf >zAT)6}+|Aj)^Dlw_PXeq%0>wAYZ~2)TnO%d8W^uinB&e&QjtH1{wAUbnFyDeel9G}j >q5FIEpbLy`oh`8o}tN3?0dRrh4I7Y$qeDjq5q0`kg(x`>mNBkGO96&(; > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menubaritem_submenuindicator_selected.png >deleted file mode 100644 >index 51078d70e254d57e48b23e56d1b5c1a53fc68d98..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3623 >zcmeH}^;Z=77RA2^l0!&`aOoK7l!h5P1qK;PngJ0BQA&{RONcaspwb~BgF`6Y3<8ov >zNDEx>T|!V|9{2ql@1C{x*=w(Le%YU&PU1ZiU1~~pN&o=0zMhu(wbNaToSgW24^*U; >zUK@q4p7j#|s2Khc5y&rO1%T4j6Ar(3&%-Cc=ZS}pFSkA%&h6{(<L>#$4S=8pv;_)b >zvBRu-x_k^XOo(`8=wr@A&TS4$j$q6Xgz`|(86@zO%rlvF-O|=3;TSAVAWlt<NMSM) >zg(OkVk!|q2NsWG+kTiV08v532ru}ql?5cTIZM)_O-84?tNe;=@lQENvfK<Y`Zhea$ >z=<Q$K5Z8#L<o5-1<V~(TPcHe0z*)G8${pTLvQL00Xo`v)bQ%|QO5Tnq(C)(W?1&;_ >zh&lr@?i!LuFanK`R9G3%&>@OI=L%YYViMpu;^Mpx?uh|Mp%+_IAOd}s7fJ+dU-2*z >z6=wi$2Dbz);Gqm^#_uO-1EeHibT{l(1ao3QQs2s557f7SP8=OoBOr$WNwb7l5kL|O >z90&RMf<R0jVAMIZQu+H%9o;tcnp9q+3YK3{JJOb1%#X~<N}Nj=r_XYSQQql>Q@)0H >zcW@q?bfhfpx1&)2iZht5+a6s8;b`h`IQdizjf2?kXHo*Mv-A4Z=6JQQ1^}x8;S*P) >z5>4z8%A^tAS8oIkNIV`;6+b;qc5kHBXa>bQ3sy(I|FF?6NypC5Z*FYN8T7(zorbN# >zu29_$omQ8Reub-CoSuC9w8kGPZ6B#ia`vrz^w_BM_V`PR80W>UG~J69D#8Wl6mPG- >zGZqPDTsNclOV!FxIg&2rO@zG^=@XbFxUQ{;o)fFB$btHYYDA$KVioo-#6Jy%=#T-O >zYo`Dlw)u2@6(%Q+@Q7X=4<!6hztk-j01@u`FZ}>`pv5na7;aJ@AO}FJI1*Z~$#LAp >zD%weUyX)p+7uAKMd<=}gw;M(WqjZh9?e8d369p5F8>{DpI!b)i;FRq&^N7pzr4jG8 >z{79qfOZ(f2yr@gKJ(7Y%bC8_DiDw~!$T<ngmrBl(7kkFjrAI=a%+EcPz-Y#6m?5Vp >zWuAoKw$$T1RQ1217;mT3nxQ-hq@yn4+I6K~MK+qLeuXr{u@wsJF*<LkzPJWR<)<+h >z7ku&mz^<AiU$XtB+Jkl>O$|OE+4-H7Os4mdq<DW1tl_RGMW)M018)tax}UxNehqP3 >z;)%<6Lm&x#q;@BTJV_vo+lfn44{3xnnbWJ_zRfRtYk@+6f;h&kTZlKa!tjG&>#bkC >ztj^L>@kl*Uz8U&71_`>*1bD9kKYb!xS_qqdL%-o2Vv>GRXY#Q*-;QWyfvg@oU*^z) >zt5+kL;ww?^JA<(s=#8EYnGKE&o<mzow6liayEBV5Ve{dK25g&jo3fjvZn@H$mT&XT >zmnupSx8%}nV6`O}^Y>=)6%4XZ^A*RUne`1zYu{u|v3sz1oO-_h9?*JgDT~V_=Zn?k >z$d2y!obSZPfe`9Ars#nLlrUQXD;X<_Es*tnu2C7=R5IHDLQ+9$FLyhSHqXZr3B^F4 >zGi3}@W*KA&W^q6z5S3MBRm)XWmPeK&h_uQF7GZTdmNFLWl@wpIt1YY0_x3C}EKrro >z74cQ53Lk{}yKw8vL{jS>qaIWEJG0^jhxPV;ZYmeHrXW!sFY4;Jr;&2Kf(>Ky&!0it >zaxXdCl2xlJOBCTU1~OJn=0~sG)ydX#{mu#lOenU6%X5yxla?8Oh^&cll*t-lrQGbi >zs<Lykk=1(DX4SfT9rAVi<>;~w?KbQ4NE*!n10g#hT~r$GCVJaq-eReovYgpiRq3Qo >zyvnPTqohqM@blyHgWRG|4<d?;e9D)DJGOt{4wJY<Tzda5KhcFCNt+=2q<9F9Ri#hP >z&qsw*VgUcQ8Qi`{177Ns<&?7;lYyO3c{{E1rw(n3XTRM#|GIa-cmG>KQb8U;L*rfJ >zgM4#iY?(-zvXQdUz}V>6o3WWZxdK(GS?TS9?Sk2Yl@>>vARAFk1?Hohe&dEsne_pt >z{c)^~qID_K(#F0?rxsl+Fw<7sR(`7-Ym#YFT{MI0ss9@@gsE&{tKXa>#n)lHF=0+9 >zXBJdTUtP~ZW=CdNYuKNcs$|sh^EB0*Hk{#4KKL^#-B()9#}yu^hxHw2??|AK<8<S5 >zGV2(I5s_X`v_-*`E{X+(eG+|?kep~3H6os)CSJhNzckpfVGwZQXTKUUd4euzD(K#? >zz`s9`Kkz(=Uwl0(`&y*PTIR`@o<aCGv&{*0s@GYPUMn@>rf}0pRP#2Ugo{LmRqbqj >zOKD)$snZV@wV!JKuh-SqRTP$`m#rN}6*^l6TSiQKe2N@mSKu%B2(E+>!UQOf5FkPk >zCq`;U+TJ)n3wh4-IaOT=@Ak8CeqS@C7^}&onHE(Wwb@n6<1zSGdM(fCb}lXh=SdTL >zFZ}z=7c!?Ur{tb+h)`^NtW}(Ps&4|4eL^ZnE^uNI{$xe#w^p{+asf)pRPnu-fgDt= >zO8lY9f<miot9rk<yY=Wa5{=Y<WO!Rq99k#;_|d18i~XbcHS`+QdMHb-#Gt)za0#ya >zIJTU*Qk-5?DO<xR!Q}3%|7g-dE0|LR4jBRkQYnMGIlEE35)<+h33G5eD3{5h9@IGG >z<zE@?a>4w4GNq!M*chS8^mZd^qoo3+BIf*O+}_fvN*z+sFEi5pU{yTEnHbbAYRmoE >zNR3-;<5l0|<Q568EV3c5ru3Sd)?$<xSlM@kjqog#tP$mA<^Fjraab|Cy6Dc>{%F%M >zK3$>k$7{kqeK-B;OH65;p_LdXa;u}}p<<(oUof6>o$2PCxcj6vDj$<DQ15Be>V2!6 >zy6_Ic5M!^%2VKKaUCl&ZdsLQ`o3UYgi?jRorbr3vm1d{kacB-Tro^N=Mm$Rn(~CLb >z#h^`&c%R|Vd5f<;R95$5UB}%g-FLQ@#fofcva52oa%dh?&o6wSUb+8a|Kz7OULt2q >z7~d9+fn(o(R{7ZORz8FqQ&va3LmVT1BjgVzmztes&mK=4aD=x1l>KWOZ`*!)sW$Wp >zZ%JfnJncU1cCLTkbgEvLShaJOeeP{vYvS#<KR`T5d`ZSfgPFyCo#vcWMVP0}+}YEm >z8TjMV75Yb@7_~gL<)4N9Yka<1!5cfL6f37()JhA_QbKE1$)^5z#);yTcnHfs%-1Qf >z$UnDrwrw>XRhyXET@Ja>#s5KDD63)}Y;c4a@?6-7n#x2Sj;Elr&|%@?zZM<wZ!n?T >zF1VG4v_3yt=>k?KwF$}F%I(THyTgwGhmH762CI)&`R|n+ymte3Rjx9pOb6Nu+w$wM >zc3#+nkdEe1_tPDYA_d&iaYyjq%!HZgB1P4uj-wEt)4tP_73QUIf1yj<NZWj%&_Qjx >zX}iO*#=hn}d?|if-S%p6?#JSbhn<1NM-z*>r=+pb<5w9cX|(X0X?bZQanx~pMR(N{ >z71z}LFLy4=;p493f<-J>Z>~n_SePZk&!+cgaTB={B{_#VnV-F%mtO96?y<ec_jmVm >zeHsdqk$P}^|9rnIa50ec$J-TJ(~alcFN6smzZy;~zLcM5vSnrxNQiTfE?i{9@Ynw) >z2};vg6M%-)=jUdb*O}Wz&)gV*5CH%pq5=3txb__Yo=O6+>j;2SE&wb(FCF@H03ZhU >zj1bxc!u83&^Dlw_Qvy_cEvwhnZv>c|SP;Nwi=@GI64uw!L<B83J8BU_SZ_ceDJdxs >qh#r)cHT_o#L{fXuUGkd(qdkxWTw~yAp=H|t*y(GVXw|_Sqy7u3i9qcD > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox.png >deleted file mode 100644 >index 12e74ddf098d77e65fe8d046d2577e0f7b852be9..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 956 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL331)Eb7y2^M16fdP}e9J >z4S|ss0$-##-vIs0QWE4B{Qv)d1_!N`Ux0igPZ!6Kid!+K4fz-xIG7wK{Qv)R!Np+h >zGNFaF2VNd}*{EYKol%$_7x9u`=L*x(uPhP_QC}H@elxtv1BIZctDnm{r-UW|a(O|; > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_disabled.png >deleted file mode 100644 >index 0063391d1ddb52efd8055e06b26fea90551e6e71..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 956 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL3308iuIlaWxq0&@P}e9J >z4S|ss0uQT%)qs9xDGBlm{{R0!gM-$}FF?MLr;B4q#jT_SH&!2>j2aV0H5EoRHG}zr >ydIvZ}7(dMvjFNEtbjE|pK~O<HlHm{=hXF&}560Lty|Yt5A?WGq=d#Wzp$PyKBRY@( > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_selected.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_checkbox_selected.png >deleted file mode 100644 >index 6f26c818dbbdf97b769445ee20ed7fe9cf035441..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 956 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL330u7^JZjZ#Q*>Qfx1S) >zXb6n75J=nVp9}OeOG%JlFen!|Xs!GL<QsXqIEGZ*iaBk_$Kb%h<T&B~|DOvk25XlI >yEv!B8^3cmh9dqf7!tA(+m;5?cn3jHJkzk1W${6&U;Z+_e1U+5-T-G@yGywplrbBlC > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator.png >deleted file mode 100644 >index ee69fe4bf70a8fbbc5eb1a921ff94ea490456ff9..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 942 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL32}{#i~y=11*0J_GDF~t >zY4Kg4&zVYs{DS{8Jl$^K1>~uDx;TbZ+)7GFNl8d>VN&4h;+WB^!<4AhnIP_Py(v#) >d)m8>ZHU>EXhQcdy!Vf_q=jrO_vd$@?2>|>6G1UM7 > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_disabled.png >deleted file mode 100644 >index a0ee7936e23c5ed50250d2d6bf43c89893ecd63a..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 942 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL32{Al?i^74C>RZakr@I~ >zr_>h#ea=)8<QM#(;puh*FCb6N)5S5Q;#N{ZN=ib43zGt07srfV9i~L3&IECX>rHtY >dtF|&QvN6aBFce;q6MhH^IZszVmvv4FO#n&WGHCz+ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_selected.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/menuitem_submenuindicator_selected.png >deleted file mode 100644 >index a96c7b5ac42182618c4419caf5f55b62ba907dc7..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 942 >zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3-piujpS2q*&4&eH|GXuHCreA7KRKOP07s >zlmzFem6RtIr7}3C<R_&nc;+Uirv{}arc@T5OtoQPU}gyL332`Z|36UuC>RZakr@Kq >z%G)0Tea=)8<QM#(;puh*FCb6N)5S5Q;#N{ZN=ib43zGt07srfV9i~L3&IECX>rHtY >dtF|&QvN6aBFce;q69(yL@O1TaS?83{1OPVkGZg>; > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu-skin.css b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu-skin.css >deleted file mode 100644 >index ad36f31511..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu-skin.css >+++ /dev/null >@@ -1,339 +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 >-*/ >-/* MenuBar style rules */ >- >-.yui-skin-sam .yuimenubar { >- >- font-size: 93%; /* 12px */ >- line-height: 2; /* ~24px */ >- *line-height: 1.9; /* For IE */ >- border: solid 1px #808080; >- background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; >- >-} >- >- >-/* MenuBarItem style rules */ >- >-.yui-skin-sam .yuimenubarnav .yuimenubaritem { >- >- border-right: solid 1px #ccc; >- >-} >- >-.yui-skin-sam .yuimenubaritemlabel { >- >- padding: 0 10px; >- color: #000; >- text-decoration: none; >- cursor: default; >- border-style: solid; >- border-color: #808080; >- border-width: 1px 0; >- *position: relative; /* Necessary to get negative margins in IE. */ >- margin: -1px 0; >- >-} >- >-.yui-skin-sam .yuimenubaritemlabel:visited { >- >- color: #000; >- >-} >- >-.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel { >- >- padding-right: 20px; >- >- /* >- Prevents the label from shifting left in IE when the >- ".yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected" >- rule us applied. >- */ >- >- *display: inline-block; >- >-} >- >-.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu { >- >- background: url(menubaritem_submenuindicator.png) right center no-repeat; >- >-} >- >- >- >-/* MenuBarItem states */ >- >-/* Selected MenuBarItem */ >- >-.yui-skin-sam .yuimenubaritem-selected { >- >- background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px; >- >-} >- >-.yui-skin-sam .yuimenubaritemlabel-selected { >- >- border-color: #7D98B8; >- >-} >- >-.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected { >- >- border-left-width: 1px; >- margin-left: -1px; >- *left: -1px; /* For IE */ >- >-} >- >- >-/* Disabled MenuBarItem */ >- >-.yui-skin-sam .yuimenubaritemlabel-disabled, >-.yui-skin-sam .yuimenubaritemlabel-disabled:visited { >- >- cursor: default; >- color: #A6A6A6; >- >-} >- >-.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled { >- >- background-image: url(menubaritem_submenuindicator_disabled.png); >- >-} >- >- >- >-/* Menu style rules */ >- >-.yui-skin-sam .yuimenu { >- >- font-size: 93%; /* 12px */ >- line-height: 1.5; /* 18px */ >- *line-height: 1.45; /* For IE */ >- >-} >- >-.yui-skin-sam .yuimenubar .yuimenu, >-.yui-skin-sam .yuimenu .yuimenu { >- >- font-size: 100%; >- >-} >- >-.yui-skin-sam .yuimenu .bd { >- >- /* >- The following application of zoom:1 prevents first tier submenus of a MenuBar from hiding >- when the mouse is moving from an item in a MenuBar to a submenu in IE 7. >- */ >- >- *zoom: 1; >- _zoom: normal; /* Remove this rule for IE 6. */ >- border: solid 1px #808080; >- background-color: #fff; >- >-} >- >-.yui-skin-sam .yuimenu .yuimenu .bd { >- >- *zoom: normal; >- >-} >- >-.yui-skin-sam .yuimenu ul { >- >- padding: 3px 0; >- border-width: 1px 0 0 0; >- border-color: #ccc; >- border-style: solid; >- >-} >- >-.yui-skin-sam .yuimenu ul.first-of-type { >- >- border-width: 0; >- >-} >- >- >-/* Group titles */ >- >-.yui-skin-sam .yuimenu h6 { >- >- font-weight: bold; >- border-style: solid; >- border-color: #ccc; >- border-width: 1px 0 0 0; >- color: #a4a4a4; >- padding: 3px 10px 0 10px; >- >-} >- >-.yui-skin-sam .yuimenu ul.hastitle, >-.yui-skin-sam .yuimenu h6.first-of-type { >- >- border-width: 0; >- >-} >- >- >-/* Top and bottom scroll controls */ >- >-.yui-skin-sam .yuimenu .yui-menu-body-scrolled { >- >- border-color: #ccc #808080; >- overflow: hidden; >- >-} >- >-.yui-skin-sam .yuimenu .topscrollbar, >-.yui-skin-sam .yuimenu .bottomscrollbar { >- >- height: 16px; >- border: solid 1px #808080; >- background: #fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0; >- >-} >- >-.yui-skin-sam .yuimenu .topscrollbar { >- >- border-bottom-width: 0; >- background-position: center -950px; >- >-} >- >-.yui-skin-sam .yuimenu .topscrollbar_disabled { >- >- background-position: center -975px; >- >-} >- >-.yui-skin-sam .yuimenu .bottomscrollbar { >- >- border-top-width: 0; >- background-position: center -850px; >- >-} >- >-.yui-skin-sam .yuimenu .bottomscrollbar_disabled { >- >- background-position: center -875px; >- >-} >- >- >-/* MenuItem style rules */ >- >-.yui-skin-sam .yuimenuitem { >- >- /* >- For IE 7 Quirks and IE 6 Strict Mode and Quirks Mode: >- Used to collapse superfluous white space between <li> elements >- that is triggered by the "display" property of the <a> elements being >- set to "block." >- */ >- >- _border-bottom: solid 1px #fff; >- >-} >- >-.yui-skin-sam .yuimenuitemlabel { >- >- padding: 0 20px; >- color: #000; >- text-decoration: none; >- cursor: default; >- >-} >- >-.yui-skin-sam .yuimenuitemlabel:visited { >- >- color: #000; >- >-} >- >-.yui-skin-sam .yuimenuitemlabel .helptext { >- >- margin-top: -1.5em; >- *margin-top: -1.45em; /* For IE*/ >- >-} >- >-.yui-skin-sam .yuimenuitem-hassubmenu { >- >- background-image: url(menuitem_submenuindicator.png); >- background-position: right center; >- background-repeat: no-repeat; >- >-} >- >-.yui-skin-sam .yuimenuitem-checked { >- >- background-image: url(menuitem_checkbox.png); >- background-position: left center; >- background-repeat: no-repeat; >- >-} >- >- >-/* Menu states */ >- >- >-/* Visible Menu */ >- >-.yui-skin-sam .yui-menu-shadow-visible { >- >- background-color: #000; >- >- /* >- Opacity can be expensive, so defer the use of opacity until the >- menu is visible. >- */ >- >- opacity: .12; >- filter: alpha(opacity=12); /* For IE */ >- >-} >- >- >- >-/* MenuItem states */ >- >- >-/* Selected MenuItem */ >- >-.yui-skin-sam .yuimenuitem-selected { >- >- background-color: #B3D4FF; >- >-} >- >- >-/* Disabled MenuItem */ >- >-.yui-skin-sam .yuimenuitemlabel-disabled, >-.yui-skin-sam .yuimenuitemlabel-disabled:visited { >- >- cursor: default; >- color: #A6A6A6; >- >-} >- >-.yui-skin-sam .yuimenuitem-hassubmenu-disabled { >- >- background-image: url(menuitem_submenuindicator_disabled.png); >- >-} >- >-.yui-skin-sam .yuimenuitem-checked-disabled { >- >- background-image: url(menuitem_checkbox_disabled.png); >- >-} >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu.css b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu.css >deleted file mode 100644 >index f02f06eccb..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menu.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 >-*/ >-.yuimenu{top:-999em;left:-999em;}.yuimenubar{position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-overlay.yui-force-redraw{margin-bottom:1px;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubaritemlabel:visited{color:#000;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled,.yui-skin-sam .yuimenubaritemlabel-disabled:visited{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{*zoom:1;_zoom:normal;border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu .yuimenu .bd{*zoom:normal;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel:visited{color:#000;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled,.yui-skin-sam .yuimenuitemlabel-disabled:visited{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);} >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png >deleted file mode 100644 >index 030941c9cffc064276813d7eaab03d8c667ed700..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3618 >zcmV+-4&CvIP)<h;3K|Lk000e1NJLTq000mG000CC0{{R3uxd}<00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~`6RjA00002bW%=J{{ZE;FiHRb03%66K~#9!Vqky(Mi^jVMCCIw >oFfyX>85y7$4gdfE0RR6300puDF<v(5bN~PV07*qoM6N<$f-m^Lg8%>k > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png >deleted file mode 100644 >index 6c1612230550ef09678a38a2e3374585055a07eb..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3618 >zcmV+-4&CvIP)<h;3K|Lk000e1NJLTq000mG000CC0{{R3uxd}<00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~9(fUf00002bW%=J{{ZE;FiHRb03%66K~#9!Vqky(Mi^jVMCCIw >oFfyX>85y7$4gdfE0RR6300puDF<v(5bN~PV07*qoM6N<$f}`EPb^rhX > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox.png >deleted file mode 100644 >index 1437a4f4b9a124d2eff708b60a74144de9607385..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3625 >zcmV+^4%YFBP)<h;3K|Lk000e1NJLTq000jF000LF0{{R3;9KVv00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~`6RjA00002bW%=J{{ZE;FiHRb04hmDK~#9!T+A^Jz#tF<!P)<R >vIt7RvxEsl~uJG{KqR~Xd==a`^KULoV6I1|I8lbr700000NkvXXu0mjf(C5k{ > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png >deleted file mode 100644 >index 5d5b9985e3094b3c0635193dd26c78d8ef164f67..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3625 >zcmV+^4%YFBP)<h;3K|Lk000e1NJLTq000jF000LF0{{R3;9KVv00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~9(fUf00002bW%=J{{ZE;FiHRb04hmDK~#9!T+A^Jz#tF<!P)<R >vIt7RvxEsl~uJG{KqR~Xd==a`^KULoV6I1|I8lbr700000NkvXXu0mjfM1aZ` > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png >deleted file mode 100644 >index ea4f6602911400991ffdc6130542c12bc4cd0982..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3617 >zcmV++4&L#JP)<h;3K|Lk000e1NJLTq000aC000LF0{{R33v65#00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~`6RjA00002bW%=J{{ZE;FiHRb03u05K~#9!VqjoI00ssI6b=Il >nhXI!ivK}PU00000|NjF33?~3ZGNlzM00000NkvXXu0mjf(Ym^p > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png >deleted file mode 100644 >index 427d60a38af14ac7b530a266dc2e969555d287c7..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3617 >zcmV++4&L#JP)<h;3K|Lk000e1NJLTq000aC000LF0{{R33v65#00009a7bBm000XU >z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag >z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V >z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H >zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T >zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j >zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p >z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i >z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i >z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf >z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G >zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u >zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm >z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v >zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW >zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo >z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X >zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t >z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl >zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 >z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ >zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l >znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U >zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 >zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O >zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p >z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? >z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y >zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB >zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt >z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= >zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C >z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB >zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe >zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 >z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ >zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ >z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 >z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu >zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu >z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E >ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw >zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX >z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& >z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 >z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R >z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw >zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD >zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| >zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy >zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z >zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h >z1DNytV>2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` >z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX >z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH >z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 >zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- >zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt >zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d >zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&O >zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 >zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ >zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! >zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk >zwzs#pxVX5vxw*Q!y1To(yu7@<y}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^<P#>dCU >z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1<F >z+1c9K+S}XP+}zyV-QC{a-rwKf;Nall;o;)q;^X7v<mBY#<>lt)=I7_<=;-L_>FMg~ >z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) >z{QUg={r&#_{{R2~9(fUf00002bW%=J{{ZE;FiHRb03u05K~#9!VqjoI00ssI6b=Il >nhXI!ivK}PU00000|NjF33?~3ZGNlzM00000NkvXXu0mjfMZ3C* > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-debug.js b/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-debug.js >deleted file mode 100644 >index 3340a61ef0..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-debug.js >+++ /dev/null >@@ -1,9870 +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 menu >-* @description <p>The Menu family of components features a collection of >-* controls that make it easy to add menus to your website or web application. >-* With the Menu Controls you can create website fly-out menus, customized >-* context menus, or application-style menu bars with just a small amount of >-* scripting.</p><p>The Menu family of controls features:</p> >-* <ul> >-* <li>Keyboard and mouse navigation.</li> >-* <li>A rich event model that provides access to all of a menu's >-* interesting moments.</li> >-* <li>Support for >-* <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive >-* Enhancement</a>; Menus can be created from simple, >-* semantic markup on the page or purely through JavaScript.</li> >-* </ul> >-* @title Menu >-* @namespace YAHOO.widget >-* @requires Event, Dom, Container >-*/ >-(function () { >- >- var UA = YAHOO.env.ua, >- Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- >- _DIV = "DIV", >- _HD = "hd", >- _BD = "bd", >- _FT = "ft", >- _LI = "LI", >- _DISABLED = "disabled", >- _MOUSEOVER = "mouseover", >- _MOUSEOUT = "mouseout", >- _MOUSEDOWN = "mousedown", >- _MOUSEUP = "mouseup", >- _CLICK = "click", >- _KEYDOWN = "keydown", >- _KEYUP = "keyup", >- _KEYPRESS = "keypress", >- _CLICK_TO_HIDE = "clicktohide", >- _POSITION = "position", >- _DYNAMIC = "dynamic", >- _SHOW_DELAY = "showdelay", >- _SELECTED = "selected", >- _VISIBLE = "visible", >- _UL = "UL", >- _MENUMANAGER = "MenuManager"; >- >- >- /** >- * Singleton that manages a collection of all menus and menu items. Listens >- * for DOM events at the document level and dispatches the events to the >- * corresponding menu or menu item. >- * >- * @namespace YAHOO.widget >- * @class MenuManager >- * @static >- */ >- YAHOO.widget.MenuManager = function () { >- >- // Private member variables >- >- >- // Flag indicating if the DOM event handlers have been attached >- >- var m_bInitializedEventHandlers = false, >- >- >- // Collection of menus >- >- m_oMenus = {}, >- >- >- // Collection of visible menus >- >- m_oVisibleMenus = {}, >- >- >- // Collection of menu items >- >- m_oItems = {}, >- >- >- // Map of DOM event types to their equivalent CustomEvent types >- >- m_oEventTypes = { >- "click": "clickEvent", >- "mousedown": "mouseDownEvent", >- "mouseup": "mouseUpEvent", >- "mouseover": "mouseOverEvent", >- "mouseout": "mouseOutEvent", >- "keydown": "keyDownEvent", >- "keyup": "keyUpEvent", >- "keypress": "keyPressEvent", >- "focus": "focusEvent", >- "focusin": "focusEvent", >- "blur": "blurEvent", >- "focusout": "blurEvent" >- }, >- >- >- m_oFocusedMenuItem = null; >- >- >- >- // Private methods >- >- >- /** >- * @method getMenuRootElement >- * @description Finds the root DIV node of a menu or the root LI node of >- * a menu item. >- * @private >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object >- * specifying an HTML element. >- */ >- function getMenuRootElement(p_oElement) { >- >- var oParentNode, >- returnVal; >- >- if (p_oElement && p_oElement.tagName) { >- >- switch (p_oElement.tagName.toUpperCase()) { >- >- case _DIV: >- >- oParentNode = p_oElement.parentNode; >- >- // Check if the DIV is the inner "body" node of a menu >- >- if (( >- Dom.hasClass(p_oElement, _HD) || >- Dom.hasClass(p_oElement, _BD) || >- Dom.hasClass(p_oElement, _FT) >- ) && >- oParentNode && >- oParentNode.tagName && >- oParentNode.tagName.toUpperCase() == _DIV) { >- >- returnVal = oParentNode; >- >- } >- else { >- >- returnVal = p_oElement; >- >- } >- >- break; >- >- case _LI: >- >- returnVal = p_oElement; >- >- break; >- >- default: >- >- oParentNode = p_oElement.parentNode; >- >- if (oParentNode) { >- >- returnVal = getMenuRootElement(oParentNode); >- >- } >- >- break; >- >- } >- >- } >- >- return returnVal; >- >- } >- >- >- >- // Private event handlers >- >- >- /** >- * @method onDOMEvent >- * @description Generic, global event handler for all of a menu's >- * DOM-based events. This listens for events against the document >- * object. If the target of a given event is a member of a menu or >- * menu item's DOM, the instance's corresponding Custom Event is fired. >- * @private >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- function onDOMEvent(p_oEvent) { >- >- // Get the target node of the DOM event >- >- var oTarget = Event.getTarget(p_oEvent), >- >- // See if the target of the event was a menu, or a menu item >- >- oElement = getMenuRootElement(oTarget), >- bFireEvent = true, >- sEventType = p_oEvent.type, >- sCustomEventType, >- sTagName, >- sId, >- oMenuItem, >- oMenu; >- >- >- if (oElement) { >- >- sTagName = oElement.tagName.toUpperCase(); >- >- if (sTagName == _LI) { >- >- sId = oElement.id; >- >- if (sId && m_oItems[sId]) { >- >- oMenuItem = m_oItems[sId]; >- oMenu = oMenuItem.parent; >- >- } >- >- } >- else if (sTagName == _DIV) { >- >- if (oElement.id) { >- >- oMenu = m_oMenus[oElement.id]; >- >- } >- >- } >- >- } >- >- >- if (oMenu) { >- >- sCustomEventType = m_oEventTypes[sEventType]; >- >- /* >- There is an inconsistency between Firefox for Mac OS X and >- Firefox Windows & Linux regarding the triggering of the >- display of the browser's context menu and the subsequent >- firing of the "click" event. In Firefox for Windows & Linux, >- when the user triggers the display of the browser's context >- menu the "click" event also fires for the document object, >- even though the "click" event did not fire for the element >- that was the original target of the "contextmenu" event. >- This is unique to Firefox on Windows & Linux. For all >- other A-Grade browsers, including Firefox for Mac OS X, the >- "click" event doesn't fire for the document object. >- >- This bug in Firefox for Windows affects Menu, as Menu >- instances listen for events at the document level and >- dispatches Custom Events of the same name. Therefore users >- of Menu will get an unwanted firing of the "click" >- custom event. The following line fixes this bug. >- */ >- >- >- >- if (sEventType == "click" && >- (UA.gecko && oMenu.platform != "mac") && >- p_oEvent.button > 0) { >- >- bFireEvent = false; >- >- } >- >- // Fire the Custom Event that corresponds the current DOM event >- >- if (bFireEvent && oMenuItem && !oMenuItem.cfg.getProperty(_DISABLED)) { >- oMenuItem[sCustomEventType].fire(p_oEvent); >- } >- >- if (bFireEvent) { >- oMenu[sCustomEventType].fire(p_oEvent, oMenuItem); >- } >- >- } >- else if (sEventType == _MOUSEDOWN) { >- >- /* >- If the target of the event wasn't a menu, hide all >- dynamically positioned menus >- */ >- >- for (var i in m_oVisibleMenus) { >- >- if (Lang.hasOwnProperty(m_oVisibleMenus, i)) { >- >- oMenu = m_oVisibleMenus[i]; >- >- if (oMenu.cfg.getProperty(_CLICK_TO_HIDE) && >- !(oMenu instanceof YAHOO.widget.MenuBar) && >- oMenu.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- oMenu.hide(); >- >- // 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(); >- } >- >- } >- else { >- >- if (oMenu.cfg.getProperty(_SHOW_DELAY) > 0) { >- >- oMenu._cancelShowDelay(); >- >- } >- >- >- if (oMenu.activeItem) { >- >- oMenu.activeItem.blur(); >- oMenu.activeItem.cfg.setProperty(_SELECTED, false); >- >- oMenu.activeItem = null; >- >- } >- >- } >- >- } >- >- } >- >- } >- >- } >- >- >- /** >- * @method onMenuDestroy >- * @description "destroy" event handler for a 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. >- * @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event. >- */ >- function onMenuDestroy(p_sType, p_aArgs, p_oMenu) { >- >- if (m_oMenus[p_oMenu.id]) { >- >- this.removeMenu(p_oMenu); >- >- } >- >- } >- >- >- /** >- * @method onMenuFocus >- * @description "focus" event handler for a MenuItem instance. >- * @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. >- */ >- function onMenuFocus(p_sType, p_aArgs) { >- >- var oItem = p_aArgs[1]; >- >- if (oItem) { >- >- m_oFocusedMenuItem = oItem; >- >- } >- >- } >- >- >- /** >- * @method onMenuBlur >- * @description "blur" event handler for a MenuItem instance. >- * @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. >- */ >- function onMenuBlur(p_sType, p_aArgs) { >- >- m_oFocusedMenuItem = null; >- >- } >- >- >- /** >- * @method onMenuVisibleConfigChange >- * @description Event handler for when the "visible" configuration >- * property of a Menu instance changes. >- * @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. >- */ >- function onMenuVisibleConfigChange(p_sType, p_aArgs) { >- >- var bVisible = p_aArgs[0], >- sId = this.id; >- >- if (bVisible) { >- >- m_oVisibleMenus[sId] = this; >- >- YAHOO.log(this + " added to the collection of visible menus.", >- "info", _MENUMANAGER); >- >- } >- else if (m_oVisibleMenus[sId]) { >- >- delete m_oVisibleMenus[sId]; >- >- YAHOO.log(this + " removed from the collection of visible menus.", >- "info", _MENUMANAGER); >- >- } >- >- } >- >- >- /** >- * @method onItemDestroy >- * @description "destroy" event handler for a MenuItem instance. >- * @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. >- */ >- function onItemDestroy(p_sType, p_aArgs) { >- >- removeItem(this); >- >- } >- >- >- /** >- * @method removeItem >- * @description Removes a MenuItem instance from the MenuManager's collection of MenuItems. >- * @private >- * @param {MenuItem} p_oMenuItem The MenuItem instance to be removed. >- */ >- function removeItem(p_oMenuItem) { >- >- var sId = p_oMenuItem.id; >- >- if (sId && m_oItems[sId]) { >- >- if (m_oFocusedMenuItem == p_oMenuItem) { >- >- m_oFocusedMenuItem = null; >- >- } >- >- delete m_oItems[sId]; >- >- p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy); >- >- YAHOO.log(p_oMenuItem + " successfully unregistered.", "info", _MENUMANAGER); >- >- } >- >- } >- >- >- /** >- * @method onItemAdded >- * @description "itemadded" event handler for a Menu instance. >- * @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. >- */ >- function onItemAdded(p_sType, p_aArgs) { >- >- var oItem = p_aArgs[0], >- sId; >- >- if (oItem instanceof YAHOO.widget.MenuItem) { >- >- sId = oItem.id; >- >- if (!m_oItems[sId]) { >- >- m_oItems[sId] = oItem; >- >- oItem.destroyEvent.subscribe(onItemDestroy); >- >- YAHOO.log(oItem + " successfully registered.", "info", _MENUMANAGER); >- >- } >- >- } >- >- } >- >- >- return { >- >- // Privileged methods >- >- >- /** >- * @method addMenu >- * @description Adds a menu to the collection of known menus. >- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu >- * instance to be added. >- */ >- addMenu: function (p_oMenu) { >- >- var oDoc; >- >- if (p_oMenu instanceof YAHOO.widget.Menu && p_oMenu.id && >- !m_oMenus[p_oMenu.id]) { >- >- m_oMenus[p_oMenu.id] = p_oMenu; >- >- >- if (!m_bInitializedEventHandlers) { >- >- oDoc = document; >- >- Event.on(oDoc, _MOUSEOVER, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEOUT, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEDOWN, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEUP, onDOMEvent, this, true); >- Event.on(oDoc, _CLICK, onDOMEvent, this, true); >- Event.on(oDoc, _KEYDOWN, onDOMEvent, this, true); >- Event.on(oDoc, _KEYUP, onDOMEvent, this, true); >- Event.on(oDoc, _KEYPRESS, onDOMEvent, this, true); >- >- Event.onFocus(oDoc, onDOMEvent, this, true); >- Event.onBlur(oDoc, onDOMEvent, this, true); >- >- m_bInitializedEventHandlers = true; >- >- YAHOO.log("DOM event handlers initialized.", "info", _MENUMANAGER); >- >- } >- >- p_oMenu.cfg.subscribeToConfigEvent(_VISIBLE, onMenuVisibleConfigChange); >- p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this); >- p_oMenu.itemAddedEvent.subscribe(onItemAdded); >- p_oMenu.focusEvent.subscribe(onMenuFocus); >- p_oMenu.blurEvent.subscribe(onMenuBlur); >- >- YAHOO.log(p_oMenu + " successfully registered.", "info", _MENUMANAGER); >- >- } >- >- }, >- >- >- /** >- * @method removeMenu >- * @description Removes a menu from the collection of known menus. >- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu >- * instance to be removed. >- */ >- removeMenu: function (p_oMenu) { >- >- var sId, >- aItems, >- i; >- >- if (p_oMenu) { >- >- sId = p_oMenu.id; >- >- if ((sId in m_oMenus) && (m_oMenus[sId] == p_oMenu)) { >- >- // Unregister each menu item >- >- aItems = p_oMenu.getItems(); >- >- if (aItems && aItems.length > 0) { >- >- i = aItems.length - 1; >- >- do { >- >- removeItem(aItems[i]); >- >- } >- while (i--); >- >- } >- >- >- // Unregister the menu >- >- delete m_oMenus[sId]; >- >- YAHOO.log(p_oMenu + " successfully unregistered.", "info", _MENUMANAGER); >- >- >- /* >- Unregister the menu from the collection of >- visible menus >- */ >- >- if ((sId in m_oVisibleMenus) && (m_oVisibleMenus[sId] == p_oMenu)) { >- >- delete m_oVisibleMenus[sId]; >- >- YAHOO.log(p_oMenu + " unregistered from the" + >- " collection of visible menus.", "info", _MENUMANAGER); >- >- } >- >- >- // Unsubscribe event listeners >- >- if (p_oMenu.cfg) { >- >- p_oMenu.cfg.unsubscribeFromConfigEvent(_VISIBLE, >- onMenuVisibleConfigChange); >- >- } >- >- p_oMenu.destroyEvent.unsubscribe(onMenuDestroy, >- p_oMenu); >- >- p_oMenu.itemAddedEvent.unsubscribe(onItemAdded); >- p_oMenu.focusEvent.unsubscribe(onMenuFocus); >- p_oMenu.blurEvent.unsubscribe(onMenuBlur); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method hideVisible >- * @description Hides all visible, dynamically positioned menus >- * (excluding instances of YAHOO.widget.MenuBar). >- */ >- hideVisible: function () { >- >- var oMenu; >- >- for (var i in m_oVisibleMenus) { >- >- if (Lang.hasOwnProperty(m_oVisibleMenus, i)) { >- >- oMenu = m_oVisibleMenus[i]; >- >- if (!(oMenu instanceof YAHOO.widget.MenuBar) && >- oMenu.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- oMenu.hide(); >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method getVisible >- * @description Returns a collection of all visible menus registered >- * with the menu manger. >- * @return {Object} >- */ >- getVisible: function () { >- >- return m_oVisibleMenus; >- >- }, >- >- >- /** >- * @method getMenus >- * @description Returns a collection of all menus registered with the >- * menu manger. >- * @return {Object} >- */ >- getMenus: function () { >- >- return m_oMenus; >- >- }, >- >- >- /** >- * @method getMenu >- * @description Returns a menu with the specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><div></code> element representing the menu to >- * be retrieved. >- * @return {YAHOO.widget.Menu} >- */ >- getMenu: function (p_sId) { >- >- var returnVal; >- >- if (p_sId in m_oMenus) { >- >- returnVal = m_oMenus[p_sId]; >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getMenuItem >- * @description Returns a menu item with the specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><li></code> element representing the menu item to >- * be retrieved. >- * @return {YAHOO.widget.MenuItem} >- */ >- getMenuItem: function (p_sId) { >- >- var returnVal; >- >- if (p_sId in m_oItems) { >- >- returnVal = m_oItems[p_sId]; >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getMenuItemGroup >- * @description Returns an array of menu item instances whose >- * corresponding <code><li></code> elements are child >- * nodes of the <code><ul></code> element with the >- * specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><ul></code> element representing the group of >- * menu items to be retrieved. >- * @return {Array} >- */ >- getMenuItemGroup: function (p_sId) { >- >- var oUL = Dom.get(p_sId), >- aItems, >- oNode, >- oItem, >- sId, >- returnVal; >- >- >- if (oUL && oUL.tagName && oUL.tagName.toUpperCase() == _UL) { >- >- oNode = oUL.firstChild; >- >- if (oNode) { >- >- aItems = []; >- >- do { >- >- sId = oNode.id; >- >- if (sId) { >- >- oItem = this.getMenuItem(sId); >- >- if (oItem) { >- >- aItems[aItems.length] = oItem; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- >- if (aItems.length > 0) { >- >- returnVal = aItems; >- >- } >- >- } >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getFocusedMenuItem >- * @description Returns a reference to the menu item that currently >- * has focus. >- * @return {YAHOO.widget.MenuItem} >- */ >- getFocusedMenuItem: function () { >- >- return m_oFocusedMenuItem; >- >- }, >- >- >- /** >- * @method getFocusedMenu >- * @description Returns a reference to the menu that currently >- * has focus. >- * @return {YAHOO.widget.Menu} >- */ >- getFocusedMenu: function () { >- >- var returnVal; >- >- if (m_oFocusedMenuItem) { >- >- returnVal = m_oFocusedMenuItem.parent.getRoot(); >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the menu manager. >- * @return {String} >- */ >- toString: function () { >- >- return _MENUMANAGER; >- >- } >- >- }; >- >- }(); >- >-})(); >- >- >- >-(function () { >- >- var Lang = YAHOO.lang, >- >- // String constants >- >- _MENU = "Menu", >- _DIV_UPPERCASE = "DIV", >- _DIV_LOWERCASE = "div", >- _ID = "id", >- _SELECT = "SELECT", >- _XY = "xy", >- _Y = "y", >- _UL_UPPERCASE = "UL", >- _UL_LOWERCASE = "ul", >- _FIRST_OF_TYPE = "first-of-type", >- _LI = "LI", >- _OPTGROUP = "OPTGROUP", >- _OPTION = "OPTION", >- _DISABLED = "disabled", >- _NONE = "none", >- _SELECTED = "selected", >- _GROUP_INDEX = "groupindex", >- _INDEX = "index", >- _SUBMENU = "submenu", >- _VISIBLE = "visible", >- _HIDE_DELAY = "hidedelay", >- _POSITION = "position", >- _DYNAMIC = "dynamic", >- _STATIC = "static", >- _DYNAMIC_STATIC = _DYNAMIC + "," + _STATIC, >- _URL = "url", >- _HASH = "#", >- _TARGET = "target", >- _MAX_HEIGHT = "maxheight", >- _TOP_SCROLLBAR = "topscrollbar", >- _BOTTOM_SCROLLBAR = "bottomscrollbar", >- _UNDERSCORE = "_", >- _TOP_SCROLLBAR_DISABLED = _TOP_SCROLLBAR + _UNDERSCORE + _DISABLED, >- _BOTTOM_SCROLLBAR_DISABLED = _BOTTOM_SCROLLBAR + _UNDERSCORE + _DISABLED, >- _MOUSEMOVE = "mousemove", >- _SHOW_DELAY = "showdelay", >- _SUBMENU_HIDE_DELAY = "submenuhidedelay", >- _IFRAME = "iframe", >- _CONSTRAIN_TO_VIEWPORT = "constraintoviewport", >- _PREVENT_CONTEXT_OVERLAP = "preventcontextoverlap", >- _SUBMENU_ALIGNMENT = "submenualignment", >- _AUTO_SUBMENU_DISPLAY = "autosubmenudisplay", >- _CLICK_TO_HIDE = "clicktohide", >- _CONTAINER = "container", >- _SCROLL_INCREMENT = "scrollincrement", >- _MIN_SCROLL_HEIGHT = "minscrollheight", >- _CLASSNAME = "classname", >- _SHADOW = "shadow", >- _KEEP_OPEN = "keepopen", >- _HD = "hd", >- _HAS_TITLE = "hastitle", >- _CONTEXT = "context", >- _EMPTY_STRING = "", >- _MOUSEDOWN = "mousedown", >- _KEYDOWN = "keydown", >- _HEIGHT = "height", >- _WIDTH = "width", >- _PX = "px", >- _EFFECT = "effect", >- _MONITOR_RESIZE = "monitorresize", >- _DISPLAY = "display", >- _BLOCK = "block", >- _VISIBILITY = "visibility", >- _ABSOLUTE = "absolute", >- _ZINDEX = "zindex", >- _YUI_MENU_BODY_SCROLLED = "yui-menu-body-scrolled", >- _NON_BREAKING_SPACE = " ", >- _SPACE = " ", >- _MOUSEOVER = "mouseover", >- _MOUSEOUT = "mouseout", >- _ITEM_ADDED = "itemAdded", >- _ITEM_REMOVED = "itemRemoved", >- _HIDDEN = "hidden", >- _YUI_MENU_SHADOW = "yui-menu-shadow", >- _YUI_MENU_SHADOW_VISIBLE = _YUI_MENU_SHADOW + "-visible", >- _YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE = _YUI_MENU_SHADOW + _SPACE + _YUI_MENU_SHADOW_VISIBLE; >- >- >-/** >-* The Menu class creates a container that holds a vertical list representing >-* a set of options or commands. Menu is the base class for all >-* menu containers. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source >-* for the menu. >-* @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 menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement >-* Object specifying the <code><select></code> element to be used as >-* the data source for the menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu. See configuration class documentation for >-* more details. >-* @namespace YAHOO.widget >-* @class Menu >-* @constructor >-* @extends YAHOO.widget.Overlay >-*/ >-YAHOO.widget.Menu = function (p_oElement, p_oConfig) { >- >- if (p_oConfig) { >- >- this.parent = p_oConfig.parent; >- this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload; >- this.itemData = p_oConfig.itemData || p_oConfig.itemdata; >- >- } >- >- >- YAHOO.widget.Menu.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >- >-/** >-* @method checkPosition >-* @description Checks to make sure that the value of the "position" property >-* is one of the supported strings. Returns true if the position is supported. >-* @private >-* @param {Object} p_sPosition String specifying the position of the menu. >-* @return {Boolean} >-*/ >-function checkPosition(p_sPosition) { >- >- var returnVal = false; >- >- if (Lang.isString(p_sPosition)) { >- >- returnVal = (_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase())) != -1); >- >- } >- >- return returnVal; >- >-} >- >- >-var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Module = YAHOO.widget.Module, >- Overlay = YAHOO.widget.Overlay, >- Menu = YAHOO.widget.Menu, >- MenuManager = YAHOO.widget.MenuManager, >- CustomEvent = YAHOO.util.CustomEvent, >- UA = YAHOO.env.ua, >- >- m_oShadowTemplate, >- >- bFocusListenerInitialized = false, >- >- oFocusedElement, >- >- EVENT_TYPES = [ >- >- ["mouseOverEvent", _MOUSEOVER], >- ["mouseOutEvent", _MOUSEOUT], >- ["mouseDownEvent", _MOUSEDOWN], >- ["mouseUpEvent", "mouseup"], >- ["clickEvent", "click"], >- ["keyPressEvent", "keypress"], >- ["keyDownEvent", _KEYDOWN], >- ["keyUpEvent", "keyup"], >- ["focusEvent", "focus"], >- ["blurEvent", "blur"], >- ["itemAddedEvent", _ITEM_ADDED], >- ["itemRemovedEvent", _ITEM_REMOVED] >- >- ], >- >- VISIBLE_CONFIG = { >- key: _VISIBLE, >- value: false, >- validator: Lang.isBoolean >- }, >- >- CONSTRAIN_TO_VIEWPORT_CONFIG = { >- key: _CONSTRAIN_TO_VIEWPORT, >- value: true, >- validator: Lang.isBoolean, >- supercedes: [_IFRAME,"x",_Y,_XY] >- }, >- >- PREVENT_CONTEXT_OVERLAP_CONFIG = { >- key: _PREVENT_CONTEXT_OVERLAP, >- value: true, >- validator: Lang.isBoolean, >- supercedes: [_CONSTRAIN_TO_VIEWPORT] >- }, >- >- POSITION_CONFIG = { >- key: _POSITION, >- value: _DYNAMIC, >- validator: checkPosition, >- supercedes: [_VISIBLE, _IFRAME] >- }, >- >- SUBMENU_ALIGNMENT_CONFIG = { >- key: _SUBMENU_ALIGNMENT, >- value: ["tl","tr"] >- }, >- >- AUTO_SUBMENU_DISPLAY_CONFIG = { >- key: _AUTO_SUBMENU_DISPLAY, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SHOW_DELAY_CONFIG = { >- key: _SHOW_DELAY, >- value: 250, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- HIDE_DELAY_CONFIG = { >- key: _HIDE_DELAY, >- value: 0, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- SUBMENU_HIDE_DELAY_CONFIG = { >- key: _SUBMENU_HIDE_DELAY, >- value: 250, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- CLICK_TO_HIDE_CONFIG = { >- key: _CLICK_TO_HIDE, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- CONTAINER_CONFIG = { >- key: _CONTAINER, >- suppressEvent: true >- }, >- >- SCROLL_INCREMENT_CONFIG = { >- key: _SCROLL_INCREMENT, >- value: 1, >- validator: Lang.isNumber, >- supercedes: [_MAX_HEIGHT], >- suppressEvent: true >- }, >- >- MIN_SCROLL_HEIGHT_CONFIG = { >- key: _MIN_SCROLL_HEIGHT, >- value: 90, >- validator: Lang.isNumber, >- supercedes: [_MAX_HEIGHT], >- suppressEvent: true >- }, >- >- MAX_HEIGHT_CONFIG = { >- key: _MAX_HEIGHT, >- value: 0, >- validator: Lang.isNumber, >- supercedes: [_IFRAME], >- suppressEvent: true >- }, >- >- CLASS_NAME_CONFIG = { >- key: _CLASSNAME, >- value: null, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- DISABLED_CONFIG = { >- key: _DISABLED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SHADOW_CONFIG = { >- key: _SHADOW, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_VISIBLE] >- }, >- >- KEEP_OPEN_CONFIG = { >- key: _KEEP_OPEN, >- value: false, >- validator: Lang.isBoolean >- }; >- >- >-function onDocFocus(event) { >- >- oFocusedElement = Event.getTarget(event); >- >-} >- >- >- >-YAHOO.lang.extend(Menu, Overlay, { >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* menu's <code><div></code> element. >-* @default "yuimenu" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenu", >- >- >-/** >-* @property ITEM_TYPE >-* @description Object representing the type of menu item to instantiate and >-* add when parsing the child nodes (either <code><li></code> element, >-* <code><optgroup></code> element or <code><option></code>) >-* of the menu's source HTML element. >-* @default YAHOO.widget.MenuItem >-* @final >-* @type YAHOO.widget.MenuItem >-*/ >-ITEM_TYPE: null, >- >- >-/** >-* @property GROUP_TITLE_TAG_NAME >-* @description String representing the tagname of the HTML element used to >-* title the menu's item groups. >-* @default H6 >-* @final >-* @type String >-*/ >-GROUP_TITLE_TAG_NAME: "h6", >- >- >-/** >-* @property OFF_SCREEN_POSITION >-* @description Array representing the default x and y position that a menu >-* should have when it is positioned outside the viewport by the >-* "poistionOffScreen" method. >-* @default "-999em" >-* @final >-* @type String >-*/ >-OFF_SCREEN_POSITION: "-999em", >- >- >-// Private properties >- >- >-/** >-* @property _useHideDelay >-* @description Boolean indicating if the "mouseover" and "mouseout" event >-* handlers used for hiding the menu via a call to "YAHOO.lang.later" have >-* already been assigned. >-* @default false >-* @private >-* @type Boolean >-*/ >-_useHideDelay: false, >- >- >-/** >-* @property _bHandledMouseOverEvent >-* @description Boolean indicating the current state of the menu's >-* "mouseover" event. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bHandledMouseOverEvent: false, >- >- >-/** >-* @property _bHandledMouseOutEvent >-* @description Boolean indicating the current state of the menu's >-* "mouseout" event. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bHandledMouseOutEvent: false, >- >- >-/** >-* @property _aGroupTitleElements >-* @description Array of HTML element used to title groups of menu items. >-* @default [] >-* @private >-* @type Array >-*/ >-_aGroupTitleElements: null, >- >- >-/** >-* @property _aItemGroups >-* @description Multi-dimensional Array representing the menu items as they >-* are grouped in the menu. >-* @default [] >-* @private >-* @type Array >-*/ >-_aItemGroups: null, >- >- >-/** >-* @property _aListElements >-* @description Array of <code><ul></code> elements, each of which is >-* the parent node for each item's <code><li></code> element. >-* @default [] >-* @private >-* @type Array >-*/ >-_aListElements: null, >- >- >-/** >-* @property _nCurrentMouseX >-* @description The current x coordinate of the mouse inside the area of >-* the menu. >-* @default 0 >-* @private >-* @type Number >-*/ >-_nCurrentMouseX: 0, >- >- >-/** >-* @property _bStopMouseEventHandlers >-* @description Stops "mouseover," "mouseout," and "mousemove" event handlers >-* from executing. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bStopMouseEventHandlers: false, >- >- >-/** >-* @property _sClassName >-* @description The current value of the "classname" configuration attribute. >-* @default null >-* @private >-* @type String >-*/ >-_sClassName: null, >- >- >- >-// Public properties >- >- >-/** >-* @property lazyLoad >-* @description Boolean indicating if the menu's "lazy load" feature is >-* enabled. If set to "true," initialization and rendering of the menu's >-* items will be deferred until the first time it is made visible. This >-* property should be set via the constructor using the configuration >-* object literal. >-* @default false >-* @type Boolean >-*/ >-lazyLoad: false, >- >- >-/** >-* @property itemData >-* @description Array of items to be added to the menu. The array can contain >-* strings representing the text for each item to be created, object literals >-* representing the menu item configuration properties, or MenuItem instances. >-* This property should be set via the constructor using the configuration >-* object literal. >-* @default null >-* @type Array >-*/ >-itemData: null, >- >- >-/** >-* @property activeItem >-* @description Object reference to the item in the menu that has is selected. >-* @default null >-* @type YAHOO.widget.MenuItem >-*/ >-activeItem: null, >- >- >-/** >-* @property parent >-* @description Object reference to the menu's parent menu or menu item. >-* This property can be set via the constructor using the configuration >-* object literal. >-* @default null >-* @type YAHOO.widget.MenuItem >-*/ >-parent: null, >- >- >-/** >-* @property srcElement >-* @description Object reference to the HTML element (either >-* <code><select></code> or <code><div></code>) used to >-* create the menu. >-* @default null >-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a >-* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html. >-* html#ID-22445964">HTMLDivElement</a> >-*/ >-srcElement: null, >- >- >- >-// Events >- >- >-/** >-* @event mouseOverEvent >-* @description Fires when the mouse has entered the menu. Passes back >-* the DOM Event object as an argument. >-*/ >- >- >-/** >-* @event mouseOutEvent >-* @description Fires when the mouse has left the menu. Passes back the DOM >-* Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event mouseDownEvent >-* @description Fires when the user mouses down on the menu. Passes back the >-* DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event mouseUpEvent >-* @description Fires when the user releases a mouse button while the mouse is >-* over the menu. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event clickEvent >-* @description Fires when the user clicks the on the menu. Passes back the >-* DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyPressEvent >-* @description Fires when the user presses an alphanumeric key when one of the >-* menu's items has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyDownEvent >-* @description Fires when the user presses a key when one of the menu's items >-* has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyUpEvent >-* @description Fires when the user releases a key when one of the menu's items >-* has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event itemAddedEvent >-* @description Fires when an item is added to the menu. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event itemRemovedEvent >-* @description Fires when an item is removed to the menu. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @method init >-* @description The Menu class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source >-* for the menu. >-* @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 menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement >-* Object specifying the <code><select></code> element to be used as >-* the data source for the menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu. See configuration class documentation for >-* more details. >-*/ >-init: function (p_oElement, p_oConfig) { >- >- this._aItemGroups = []; >- this._aListElements = []; >- this._aGroupTitleElements = []; >- >- if (!this.ITEM_TYPE) { >- >- this.ITEM_TYPE = YAHOO.widget.MenuItem; >- >- } >- >- >- var oElement; >- >- if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- } >- else if (p_oElement.tagName) { >- >- oElement = p_oElement; >- >- } >- >- >- if (oElement && oElement.tagName) { >- >- switch(oElement.tagName.toUpperCase()) { >- >- case _DIV_UPPERCASE: >- >- this.srcElement = oElement; >- >- if (!oElement.id) { >- >- oElement.setAttribute(_ID, Dom.generateId()); >- >- } >- >- >- /* >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, oElement); >- >- this.beforeInitEvent.fire(Menu); >- >- YAHOO.log("Source element: " + this.srcElement.tagName, "info", this.toString()); >- >- break; >- >- case _SELECT: >- >- this.srcElement = oElement; >- >- >- /* >- The source element is not something that we can use >- outright, so we need to create a new Overlay >- >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, Dom.generateId()); >- >- this.beforeInitEvent.fire(Menu); >- >- YAHOO.log("Source element: " + this.srcElement.tagName, "info", this.toString()); >- >- break; >- >- } >- >- } >- else { >- >- /* >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, p_oElement); >- >- this.beforeInitEvent.fire(Menu); >- >- YAHOO.log("No source element found. Created element with id: " + this.id, "info", this.toString()); >- >- } >- >- >- if (this.element) { >- >- Dom.addClass(this.element, this.CSS_CLASS_NAME); >- >- >- // Subscribe to Custom Events >- >- this.initEvent.subscribe(this._onInit); >- this.beforeRenderEvent.subscribe(this._onBeforeRender); >- this.renderEvent.subscribe(this._onRender); >- this.beforeShowEvent.subscribe(this._onBeforeShow); >- this.hideEvent.subscribe(this._onHide); >- this.showEvent.subscribe(this._onShow); >- this.beforeHideEvent.subscribe(this._onBeforeHide); >- this.mouseOverEvent.subscribe(this._onMouseOver); >- this.mouseOutEvent.subscribe(this._onMouseOut); >- this.clickEvent.subscribe(this._onClick); >- this.keyDownEvent.subscribe(this._onKeyDown); >- this.keyPressEvent.subscribe(this._onKeyPress); >- this.blurEvent.subscribe(this._onBlur); >- >- >- if (!bFocusListenerInitialized) { >- Event.onFocus(document, onDocFocus); >- bFocusListenerInitialized = true; >- } >- >- >- // Fixes an issue in Firefox 2 and Webkit where Dom's "getX" and "getY" >- // methods return values that don't take scrollTop into consideration >- >- if ((UA.gecko && UA.gecko < 1.9) || UA.webkit) { >- >- this.cfg.subscribeToConfigEvent(_Y, this._onYChange); >- >- } >- >- >- if (p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- >- // Register the Menu instance with the MenuManager >- >- MenuManager.addMenu(this); >- >- >- this.initEvent.fire(Menu); >- >- } >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _initSubTree >-* @description Iterates the childNodes of the source element to find nodes >-* used to instantiate menu and menu items. >-* @private >-*/ >-_initSubTree: function () { >- >- var oSrcElement = this.srcElement, >- sSrcElementTagName, >- nGroup, >- sGroupTitleTagName, >- oNode, >- aListElements, >- nListElements, >- i; >- >- >- if (oSrcElement) { >- >- sSrcElementTagName = >- (oSrcElement.tagName && oSrcElement.tagName.toUpperCase()); >- >- >- if (sSrcElementTagName == _DIV_UPPERCASE) { >- >- // Populate the collection of item groups and item group titles >- >- oNode = this.body.firstChild; >- >- >- if (oNode) { >- >- nGroup = 0; >- sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase(); >- >- do { >- >- >- if (oNode && oNode.tagName) { >- >- switch (oNode.tagName.toUpperCase()) { >- >- case sGroupTitleTagName: >- >- this._aGroupTitleElements[nGroup] = oNode; >- >- break; >- >- case _UL_UPPERCASE: >- >- this._aListElements[nGroup] = oNode; >- this._aItemGroups[nGroup] = []; >- nGroup++; >- >- break; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- >- /* >- Apply the "first-of-type" class to the first UL to mimic >- the ":first-of-type" CSS3 psuedo class. >- */ >- >- if (this._aListElements[0]) { >- >- Dom.addClass(this._aListElements[0], _FIRST_OF_TYPE); >- >- } >- >- } >- >- } >- >- >- oNode = null; >- >- YAHOO.log("Searching DOM for items to initialize.", "info", this.toString()); >- >- >- if (sSrcElementTagName) { >- >- switch (sSrcElementTagName) { >- >- case _DIV_UPPERCASE: >- >- aListElements = this._aListElements; >- nListElements = aListElements.length; >- >- if (nListElements > 0) { >- >- YAHOO.log("Found " + nListElements + " item groups to initialize.", >- "info", this.toString()); >- >- i = nListElements - 1; >- >- do { >- >- oNode = aListElements[i].firstChild; >- >- if (oNode) { >- >- YAHOO.log("Scanning " + >- aListElements[i].childNodes.length + >- " child nodes for items to initialize.", "info", this.toString()); >- >- do { >- >- if (oNode && oNode.tagName && >- oNode.tagName.toUpperCase() == _LI) { >- >- YAHOO.log("Initializing " + >- oNode.tagName + " node.", "info", this.toString()); >- >- this.addItem(new this.ITEM_TYPE(oNode, >- { parent: this }), i); >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- } >- >- } >- while (i--); >- >- } >- >- break; >- >- case _SELECT: >- >- YAHOO.log("Scanning " + >- oSrcElement.childNodes.length + >- " child nodes for items to initialize.", "info", this.toString()); >- >- oNode = oSrcElement.firstChild; >- >- do { >- >- if (oNode && oNode.tagName) { >- >- switch (oNode.tagName.toUpperCase()) { >- >- case _OPTGROUP: >- case _OPTION: >- >- YAHOO.log("Initializing " + >- oNode.tagName + " node.", "info", this.toString()); >- >- this.addItem( >- new this.ITEM_TYPE( >- oNode, >- { parent: this } >- ) >- ); >- >- break; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- break; >- >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _getFirstEnabledItem >-* @description Returns the first enabled item in the menu. >-* @return {YAHOO.widget.MenuItem} >-* @private >-*/ >-_getFirstEnabledItem: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- oItem, >- returnVal; >- >- >- for(var i=0; i<nItems; i++) { >- >- oItem = aItems[i]; >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED) && oItem.element.style.display != _NONE) { >- >- returnVal = oItem; >- break; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _addItemToGroup >-* @description Adds a menu item to a group. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the >-* item belongs. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nItemIndex Optional. Number indicating the index at >-* which the menu item should be added. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) { >- >- var oItem, >- nGroupIndex, >- aGroup, >- oGroupItem, >- bAppend, >- oNextItemSibling, >- nItemIndex, >- returnVal; >- >- >- function getNextItemSibling(p_aArray, p_nStartIndex) { >- >- return (p_aArray[p_nStartIndex] || getNextItemSibling(p_aArray, (p_nStartIndex+1))); >- >- } >- >- >- if (p_oItem instanceof this.ITEM_TYPE) { >- >- oItem = p_oItem; >- oItem.parent = this; >- >- } >- else if (Lang.isString(p_oItem)) { >- >- oItem = new this.ITEM_TYPE(p_oItem, { parent: this }); >- >- } >- else if (Lang.isObject(p_oItem)) { >- >- p_oItem.parent = this; >- >- oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem); >- >- } >- >- >- if (oItem) { >- >- if (oItem.cfg.getProperty(_SELECTED)) { >- >- this.activeItem = oItem; >- >- } >- >- >- nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0; >- aGroup = this._getItemGroup(nGroupIndex); >- >- >- >- if (!aGroup) { >- >- aGroup = this._createItemGroup(nGroupIndex); >- >- } >- >- >- if (Lang.isNumber(p_nItemIndex)) { >- >- bAppend = (p_nItemIndex >= aGroup.length); >- >- >- if (aGroup[p_nItemIndex]) { >- >- aGroup.splice(p_nItemIndex, 0, oItem); >- >- } >- else { >- >- aGroup[p_nItemIndex] = oItem; >- >- } >- >- >- oGroupItem = aGroup[p_nItemIndex]; >- >- if (oGroupItem) { >- >- if (bAppend && (!oGroupItem.element.parentNode || >- oGroupItem.element.parentNode.nodeType == 11)) { >- >- this._aListElements[nGroupIndex].appendChild(oGroupItem.element); >- >- } >- else { >- >- oNextItemSibling = getNextItemSibling(aGroup, (p_nItemIndex+1)); >- >- if (oNextItemSibling && (!oGroupItem.element.parentNode || >- oGroupItem.element.parentNode.nodeType == 11)) { >- >- this._aListElements[nGroupIndex].insertBefore( >- oGroupItem.element, oNextItemSibling.element); >- >- } >- >- } >- >- >- oGroupItem.parent = this; >- >- this._subscribeToItemEvents(oGroupItem); >- >- this._configureSubmenu(oGroupItem); >- >- this._updateItemProperties(nGroupIndex); >- >- YAHOO.log("Item inserted." + >- " Text: " + oGroupItem.cfg.getProperty("text") + ", " + >- " Index: " + oGroupItem.index + ", " + >- " Group Index: " + oGroupItem.groupIndex, "info", this.toString()); >- >- this.itemAddedEvent.fire(oGroupItem); >- this.changeContentEvent.fire(); >- >- returnVal = oGroupItem; >- >- } >- >- } >- else { >- >- nItemIndex = aGroup.length; >- >- aGroup[nItemIndex] = oItem; >- >- oGroupItem = aGroup[nItemIndex]; >- >- >- if (oGroupItem) { >- >- if (!Dom.isAncestor(this._aListElements[nGroupIndex], oGroupItem.element)) { >- >- this._aListElements[nGroupIndex].appendChild(oGroupItem.element); >- >- } >- >- oGroupItem.element.setAttribute(_GROUP_INDEX, nGroupIndex); >- oGroupItem.element.setAttribute(_INDEX, nItemIndex); >- >- oGroupItem.parent = this; >- >- oGroupItem.index = nItemIndex; >- oGroupItem.groupIndex = nGroupIndex; >- >- this._subscribeToItemEvents(oGroupItem); >- >- this._configureSubmenu(oGroupItem); >- >- if (nItemIndex === 0) { >- >- Dom.addClass(oGroupItem.element, _FIRST_OF_TYPE); >- >- } >- >- YAHOO.log("Item added." + >- " Text: " + oGroupItem.cfg.getProperty("text") + ", " + >- " Index: " + oGroupItem.index + ", " + >- " Group Index: " + oGroupItem.groupIndex, "info", this.toString()); >- >- >- this.itemAddedEvent.fire(oGroupItem); >- this.changeContentEvent.fire(); >- >- returnVal = oGroupItem; >- >- } >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _removeItemFromGroupByIndex >-* @description Removes a menu item from a group by index. Returns the menu >-* item that was removed. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the menu >-* item belongs. >-* @param {Number} p_nItemIndex Number indicating the index of the menu item >-* to be removed. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_removeItemFromGroupByIndex: function (p_nGroupIndex, p_nItemIndex) { >- >- var nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0, >- aGroup = this._getItemGroup(nGroupIndex), >- aArray, >- oItem, >- oUL; >- >- if (aGroup) { >- >- aArray = aGroup.splice(p_nItemIndex, 1); >- oItem = aArray[0]; >- >- if (oItem) { >- >- // Update the index and className properties of each member >- >- this._updateItemProperties(nGroupIndex); >- >- if (aGroup.length === 0) { >- >- // Remove the UL >- >- oUL = this._aListElements[nGroupIndex]; >- >- if (this.body && oUL) { >- >- this.body.removeChild(oUL); >- >- } >- >- // Remove the group from the array of items >- >- this._aItemGroups.splice(nGroupIndex, 1); >- >- >- // Remove the UL from the array of ULs >- >- this._aListElements.splice(nGroupIndex, 1); >- >- >- /* >- Assign the "first-of-type" class to the new first UL >- in the collection >- */ >- >- oUL = this._aListElements[0]; >- >- if (oUL) { >- >- Dom.addClass(oUL, _FIRST_OF_TYPE); >- >- } >- >- } >- >- >- this.itemRemovedEvent.fire(oItem); >- this.changeContentEvent.fire(); >- >- } >- >- } >- >- // Return a reference to the item that was removed >- >- return oItem; >- >-}, >- >- >-/** >-* @method _removeItemFromGroupByValue >-* @description Removes a menu item from a group by reference. Returns the >-* menu item that was removed. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the >-* menu item belongs. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be removed. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_removeItemFromGroupByValue: function (p_nGroupIndex, p_oItem) { >- >- var aGroup = this._getItemGroup(p_nGroupIndex), >- nItems, >- nItemIndex, >- returnVal, >- i; >- >- if (aGroup) { >- >- nItems = aGroup.length; >- nItemIndex = -1; >- >- if (nItems > 0) { >- >- i = nItems-1; >- >- do { >- >- if (aGroup[i] == p_oItem) { >- >- nItemIndex = i; >- break; >- >- } >- >- } >- while (i--); >- >- if (nItemIndex > -1) { >- >- returnVal = this._removeItemFromGroupByIndex(p_nGroupIndex, nItemIndex); >- >- } >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _updateItemProperties >-* @description Updates the "index," "groupindex," and "className" properties >-* of the menu items in the specified group. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group of items to update. >-*/ >-_updateItemProperties: function (p_nGroupIndex) { >- >- var aGroup = this._getItemGroup(p_nGroupIndex), >- nItems = aGroup.length, >- oItem, >- oLI, >- i; >- >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- // Update the index and className properties of each member >- >- do { >- >- oItem = aGroup[i]; >- >- if (oItem) { >- >- oLI = oItem.element; >- >- oItem.index = i; >- oItem.groupIndex = p_nGroupIndex; >- >- oLI.setAttribute(_GROUP_INDEX, p_nGroupIndex); >- oLI.setAttribute(_INDEX, i); >- >- Dom.removeClass(oLI, _FIRST_OF_TYPE); >- >- } >- >- } >- while (i--); >- >- >- if (oLI) { >- >- Dom.addClass(oLI, _FIRST_OF_TYPE); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _createItemGroup >-* @description Creates a new menu item group (array) and its associated >-* <code><ul></code> element. Returns an aray of menu item groups. >-* @private >-* @param {Number} p_nIndex Number indicating the group to create. >-* @return {Array} >-*/ >-_createItemGroup: function (p_nIndex) { >- >- var oUL, >- returnVal; >- >- if (!this._aItemGroups[p_nIndex]) { >- >- this._aItemGroups[p_nIndex] = []; >- >- oUL = document.createElement(_UL_LOWERCASE); >- >- this._aListElements[p_nIndex] = oUL; >- >- returnVal = this._aItemGroups[p_nIndex]; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _getItemGroup >-* @description Returns the menu item group at the specified index. >-* @private >-* @param {Number} p_nIndex Number indicating the index of the menu item group >-* to be retrieved. >-* @return {Array} >-*/ >-_getItemGroup: function (p_nIndex) { >- >- var nIndex = Lang.isNumber(p_nIndex) ? p_nIndex : 0, >- aGroups = this._aItemGroups, >- returnVal; >- >- if (nIndex in aGroups) { >- >- returnVal = aGroups[nIndex]; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _configureSubmenu >-* @description Subscribes the menu item's submenu to its parent menu's events. >-* @private >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance with the submenu to be configured. >-*/ >-_configureSubmenu: function (p_oItem) { >- >- var oSubmenu = p_oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- /* >- Listen for configuration changes to the parent menu >- so they they can be applied to the submenu. >- */ >- >- this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange, oSubmenu, true); >- >- this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true); >- >- } >- >-}, >- >- >- >- >-/** >-* @method _subscribeToItemEvents >-* @description Subscribes a menu to a menu item's event. >-* @private >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance whose events should be subscribed to. >-*/ >-_subscribeToItemEvents: function (p_oItem) { >- >- p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy, p_oItem, this); >- p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange, p_oItem, this); >- >-}, >- >- >-/** >-* @method _onVisibleChange >-* @description Change event handler for the menu's "visible" configuration >-* property. >-* @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. >-*/ >-_onVisibleChange: function (p_sType, p_aArgs) { >- >- var bVisible = p_aArgs[0]; >- >- if (bVisible) { >- >- Dom.addClass(this.element, _VISIBLE); >- >- } >- else { >- >- Dom.removeClass(this.element, _VISIBLE); >- >- } >- >-}, >- >- >-/** >-* @method _cancelHideDelay >-* @description Cancels the call to "hideMenu." >-* @private >-*/ >-_cancelHideDelay: function () { >- >- var oTimer = this.getRoot()._hideDelayTimer; >- >- if (oTimer) { >- >- oTimer.cancel(); >- >- } >- >-}, >- >- >-/** >-* @method _execHideDelay >-* @description Hides the menu after the number of milliseconds specified by >-* the "hidedelay" configuration property. >-* @private >-*/ >-_execHideDelay: function () { >- >- this._cancelHideDelay(); >- >- var oRoot = this.getRoot(); >- >- oRoot._hideDelayTimer = Lang.later(oRoot.cfg.getProperty(_HIDE_DELAY), this, function () { >- >- if (oRoot.activeItem) { >- >- if (oRoot.hasFocus()) { >- >- oRoot.activeItem.focus(); >- >- } >- >- oRoot.clearActiveItem(); >- >- } >- >- if (oRoot == this && !(this instanceof YAHOO.widget.MenuBar) && >- this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.hide(); >- >- } >- >- }); >- >-}, >- >- >-/** >-* @method _cancelShowDelay >-* @description Cancels the call to the "showMenu." >-* @private >-*/ >-_cancelShowDelay: function () { >- >- var oTimer = this.getRoot()._showDelayTimer; >- >- if (oTimer) { >- >- oTimer.cancel(); >- >- } >- >-}, >- >- >-/** >-* @method _execSubmenuHideDelay >-* @description Hides a submenu after the number of milliseconds specified by >-* the "submenuhidedelay" configuration property have ellapsed. >-* @private >-* @param {YAHOO.widget.Menu} p_oSubmenu Object specifying the submenu that >-* should be hidden. >-* @param {Number} p_nMouseX The x coordinate of the mouse when it left >-* the specified submenu's parent menu item. >-* @param {Number} p_nHideDelay The number of milliseconds that should ellapse >-* before the submenu is hidden. >-*/ >-_execSubmenuHideDelay: function (p_oSubmenu, p_nMouseX, p_nHideDelay) { >- >- p_oSubmenu._submenuHideDelayTimer = Lang.later(50, this, function () { >- >- if (this._nCurrentMouseX > (p_nMouseX + 10)) { >- >- p_oSubmenu._submenuHideDelayTimer = Lang.later(p_nHideDelay, p_oSubmenu, function () { >- >- this.hide(); >- >- }); >- >- } >- else { >- >- p_oSubmenu.hide(); >- >- } >- >- }); >- >-}, >- >- >- >-// Protected methods >- >- >-/** >-* @method _disableScrollHeader >-* @description Disables the header used for scrolling the body of the menu. >-* @protected >-*/ >-_disableScrollHeader: function () { >- >- if (!this._bHeaderDisabled) { >- >- Dom.addClass(this.header, _TOP_SCROLLBAR_DISABLED); >- this._bHeaderDisabled = true; >- >- } >- >-}, >- >- >-/** >-* @method _disableScrollFooter >-* @description Disables the footer used for scrolling the body of the menu. >-* @protected >-*/ >-_disableScrollFooter: function () { >- >- if (!this._bFooterDisabled) { >- >- Dom.addClass(this.footer, _BOTTOM_SCROLLBAR_DISABLED); >- this._bFooterDisabled = true; >- >- } >- >-}, >- >- >-/** >-* @method _enableScrollHeader >-* @description Enables the header used for scrolling the body of the menu. >-* @protected >-*/ >-_enableScrollHeader: function () { >- >- if (this._bHeaderDisabled) { >- >- Dom.removeClass(this.header, _TOP_SCROLLBAR_DISABLED); >- this._bHeaderDisabled = false; >- >- } >- >-}, >- >- >-/** >-* @method _enableScrollFooter >-* @description Enables the footer used for scrolling the body of the menu. >-* @protected >-*/ >-_enableScrollFooter: function () { >- >- if (this._bFooterDisabled) { >- >- Dom.removeClass(this.footer, _BOTTOM_SCROLLBAR_DISABLED); >- this._bFooterDisabled = false; >- >- } >- >-}, >- >- >-/** >-* @method _onMouseOver >-* @description "mouseover" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onMouseOver: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oTarget = Event.getTarget(oEvent), >- oRoot = this.getRoot(), >- oSubmenuHideDelayTimer = this._submenuHideDelayTimer, >- oParentMenu, >- nShowDelay, >- bShowDelay, >- oActiveItem, >- oItemCfg, >- oSubmenu; >- >- >- var showSubmenu = function () { >- >- if (this.parent.cfg.getProperty(_SELECTED)) { >- >- this.show(); >- >- } >- >- }; >- >- >- if (!this._bStopMouseEventHandlers) { >- >- if (!this._bHandledMouseOverEvent && (oTarget == this.element || >- Dom.isAncestor(this.element, oTarget))) { >- >- // Menu mouseover logic >- >- if (this._useHideDelay) { >- this._cancelHideDelay(); >- } >- >- this._nCurrentMouseX = 0; >- >- Event.on(this.element, _MOUSEMOVE, this._onMouseMove, this, true); >- >- >- /* >- If the mouse is moving from the submenu back to its corresponding menu item, >- don't hide the submenu or clear the active MenuItem. >- */ >- >- if (!(oItem && Dom.isAncestor(oItem.element, Event.getRelatedTarget(oEvent)))) { >- >- this.clearActiveItem(); >- >- } >- >- >- if (this.parent && oSubmenuHideDelayTimer) { >- >- oSubmenuHideDelayTimer.cancel(); >- >- this.parent.cfg.setProperty(_SELECTED, true); >- >- oParentMenu = this.parent.parent; >- >- oParentMenu._bHandledMouseOutEvent = true; >- oParentMenu._bHandledMouseOverEvent = false; >- >- } >- >- >- this._bHandledMouseOverEvent = true; >- this._bHandledMouseOutEvent = false; >- >- } >- >- >- if (oItem && !oItem.handledMouseOverEvent && !oItem.cfg.getProperty(_DISABLED) && >- (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))) { >- >- // Menu Item mouseover logic >- >- nShowDelay = this.cfg.getProperty(_SHOW_DELAY); >- bShowDelay = (nShowDelay > 0); >- >- >- if (bShowDelay) { >- >- this._cancelShowDelay(); >- >- } >- >- >- oActiveItem = this.activeItem; >- >- if (oActiveItem) { >- >- oActiveItem.cfg.setProperty(_SELECTED, false); >- >- } >- >- >- oItemCfg = oItem.cfg; >- >- // Select and focus the current menu item >- >- oItemCfg.setProperty(_SELECTED, true); >- >- >- if (this.hasFocus() || oRoot._hasFocus) { >- >- oItem.focus(); >- >- oRoot._hasFocus = false; >- >- } >- >- >- if (this.cfg.getProperty(_AUTO_SUBMENU_DISPLAY)) { >- >- // Show the submenu this menu item >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- if (bShowDelay) { >- >- oRoot._showDelayTimer = >- Lang.later(oRoot.cfg.getProperty(_SHOW_DELAY), oSubmenu, showSubmenu); >- >- } >- else { >- >- oSubmenu.show(); >- >- } >- >- } >- >- } >- >- oItem.handledMouseOverEvent = true; >- oItem.handledMouseOutEvent = false; >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMouseOut >-* @description "mouseout" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onMouseOut: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oRelatedTarget = Event.getRelatedTarget(oEvent), >- bMovingToSubmenu = false, >- oItemCfg, >- oSubmenu, >- nSubmenuHideDelay, >- nShowDelay; >- >- >- if (!this._bStopMouseEventHandlers) { >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- >- if (oSubmenu && (oRelatedTarget == oSubmenu.element || >- Dom.isAncestor(oSubmenu.element, oRelatedTarget))) { >- >- bMovingToSubmenu = true; >- >- } >- >- >- if (!oItem.handledMouseOutEvent && ((oRelatedTarget != oItem.element && >- !Dom.isAncestor(oItem.element, oRelatedTarget)) || bMovingToSubmenu)) { >- >- // Menu Item mouseout logic >- >- if (!bMovingToSubmenu) { >- >- oItem.cfg.setProperty(_SELECTED, false); >- >- >- if (oSubmenu) { >- >- nSubmenuHideDelay = this.cfg.getProperty(_SUBMENU_HIDE_DELAY); >- >- nShowDelay = this.cfg.getProperty(_SHOW_DELAY); >- >- if (!(this instanceof YAHOO.widget.MenuBar) && nSubmenuHideDelay > 0 && >- nShowDelay >= nSubmenuHideDelay) { >- >- this._execSubmenuHideDelay(oSubmenu, Event.getPageX(oEvent), >- nSubmenuHideDelay); >- >- } >- else { >- >- oSubmenu.hide(); >- >- } >- >- } >- >- } >- >- >- oItem.handledMouseOutEvent = true; >- oItem.handledMouseOverEvent = false; >- >- } >- >- } >- >- >- if (!this._bHandledMouseOutEvent && ((oRelatedTarget != this.element && >- !Dom.isAncestor(this.element, oRelatedTarget)) || bMovingToSubmenu)) { >- >- // Menu mouseout logic >- >- if (this._useHideDelay) { >- this._execHideDelay(); >- } >- >- Event.removeListener(this.element, _MOUSEMOVE, this._onMouseMove); >- >- this._nCurrentMouseX = Event.getPageX(oEvent); >- >- this._bHandledMouseOutEvent = true; >- this._bHandledMouseOverEvent = false; >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMouseMove >-* @description "click" event handler for the menu. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onMouseMove: function (p_oEvent, p_oMenu) { >- >- if (!this._bStopMouseEventHandlers) { >- >- this._nCurrentMouseX = Event.getPageX(p_oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onClick >-* @description "click" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onClick: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- bInMenuAnchor = false, >- oSubmenu, >- oMenu, >- oRoot, >- sId, >- sURL, >- nHashPos, >- nLen; >- >- >- var hide = function () { >- >- oRoot = this.getRoot(); >- >- if (oRoot instanceof YAHOO.widget.MenuBar || >- oRoot.cfg.getProperty(_POSITION) == _STATIC) { >- >- oRoot.clearActiveItem(); >- >- } >- else { >- >- oRoot.hide(); >- >- } >- >- }; >- >- >- if (oItem) { >- >- if (oItem.cfg.getProperty(_DISABLED)) { >- >- Event.preventDefault(oEvent); >- >- hide.call(this); >- >- } >- else { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- >- /* >- Check if the URL of the anchor is pointing to an element that is >- a child of the menu. >- */ >- >- sURL = oItem.cfg.getProperty(_URL); >- >- >- if (sURL) { >- >- nHashPos = sURL.indexOf(_HASH); >- >- nLen = sURL.length; >- >- >- if (nHashPos != -1) { >- >- sURL = sURL.substr(nHashPos, nLen); >- >- nLen = sURL.length; >- >- >- if (nLen > 1) { >- >- sId = sURL.substr(1, nLen); >- >- oMenu = YAHOO.widget.MenuManager.getMenu(sId); >- >- if (oMenu) { >- >- bInMenuAnchor = >- (this.getRoot() === oMenu.getRoot()); >- >- } >- >- } >- else if (nLen === 1) { >- >- bInMenuAnchor = true; >- >- } >- >- } >- >- } >- >- >- if (bInMenuAnchor && !oItem.cfg.getProperty(_TARGET)) { >- >- Event.preventDefault(oEvent); >- >- >- if (UA.webkit) { >- >- oItem.focus(); >- >- } >- else { >- >- oItem.focusEvent.fire(); >- >- } >- >- } >- >- >- if (!oSubmenu && !this.cfg.getProperty(_KEEP_OPEN)) { >- >- hide.call(this); >- >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onKeyDown >-* @description "keydown" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onKeyDown: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oSubmenu, >- oItemCfg, >- oParentItem, >- oRoot, >- oNextItem, >- oBody, >- nBodyScrollTop, >- nBodyOffsetHeight, >- aItems, >- nItems, >- nNextItemOffsetTop, >- nScrollTarget, >- oParentMenu, >- oFocusedEl; >- >- >- if (this._useHideDelay) { >- this._cancelHideDelay(); >- } >- >- >- /* >- This function is called to prevent a bug in Firefox. In Firefox, >- moving a DOM element into a stationary mouse pointer will cause the >- browser to fire mouse events. This can result in the menu mouse >- event handlers being called uncessarily, especially when menus are >- moved into a stationary mouse pointer as a result of a >- key event handler. >- */ >- function stopMouseEventHandlers() { >- >- this._bStopMouseEventHandlers = true; >- >- Lang.later(10, this, function () { >- >- this._bStopMouseEventHandlers = false; >- >- }); >- >- } >- >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- oParentItem = this.parent; >- >- switch(oEvent.keyCode) { >- >- case 38: // Up arrow >- case 40: // Down arrow >- >- oNextItem = (oEvent.keyCode == 38) ? >- oItem.getPreviousEnabledSibling() : >- oItem.getNextEnabledSibling(); >- >- if (oNextItem) { >- >- this.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- oNextItem.focus(); >- >- >- if (this.cfg.getProperty(_MAX_HEIGHT) > 0) { >- >- oBody = this.body; >- nBodyScrollTop = oBody.scrollTop; >- nBodyOffsetHeight = oBody.offsetHeight; >- aItems = this.getItems(); >- nItems = aItems.length - 1; >- nNextItemOffsetTop = oNextItem.element.offsetTop; >- >- >- if (oEvent.keyCode == 40 ) { // Down >- >- if (nNextItemOffsetTop >= (nBodyOffsetHeight + nBodyScrollTop)) { >- >- oBody.scrollTop = nNextItemOffsetTop - nBodyOffsetHeight; >- >- } >- else if (nNextItemOffsetTop <= nBodyScrollTop) { >- >- oBody.scrollTop = 0; >- >- } >- >- >- if (oNextItem == aItems[nItems]) { >- >- oBody.scrollTop = oNextItem.element.offsetTop; >- >- } >- >- } >- else { // Up >- >- if (nNextItemOffsetTop <= nBodyScrollTop) { >- >- oBody.scrollTop = nNextItemOffsetTop - oNextItem.element.offsetHeight; >- >- } >- else if (nNextItemOffsetTop >= (nBodyScrollTop + nBodyOffsetHeight)) { >- >- oBody.scrollTop = nNextItemOffsetTop; >- >- } >- >- >- if (oNextItem == aItems[0]) { >- >- oBody.scrollTop = 0; >- >- } >- >- } >- >- >- nBodyScrollTop = oBody.scrollTop; >- nScrollTarget = oBody.scrollHeight - oBody.offsetHeight; >- >- if (nBodyScrollTop === 0) { >- >- this._disableScrollHeader(); >- this._enableScrollFooter(); >- >- } >- else if (nBodyScrollTop == nScrollTarget) { >- >- this._enableScrollHeader(); >- this._disableScrollFooter(); >- >- } >- else { >- >- this._enableScrollHeader(); >- this._enableScrollFooter(); >- >- } >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- >- case 39: // Right arrow >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- if (!oItemCfg.getProperty(_SELECTED)) { >- >- oItemCfg.setProperty(_SELECTED, true); >- >- } >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- oSubmenu.setInitialSelection(); >- >- } >- else { >- >- oRoot = this.getRoot(); >- >- if (oRoot instanceof YAHOO.widget.MenuBar) { >- >- oNextItem = oRoot.activeItem.getNextEnabledSibling(); >- >- if (oNextItem) { >- >- oRoot.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oNextItem.focus(); >- >- } >- >- } >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- >- case 37: // Left arrow >- >- if (oParentItem) { >- >- oParentMenu = oParentItem.parent; >- >- if (oParentMenu instanceof YAHOO.widget.MenuBar) { >- >- oNextItem = >- oParentMenu.activeItem.getPreviousEnabledSibling(); >- >- if (oNextItem) { >- >- oParentMenu.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oNextItem.focus(); >- >- } >- >- } >- >- } >- else { >- >- this.hide(); >- >- oParentItem.focus(); >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- } >- >- >- } >- >- >- if (oEvent.keyCode == 27) { // Esc key >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.hide(); >- >- if (this.parent) { >- >- this.parent.focus(); >- >- } >- else { >- // Focus the element that previously had focus >- >- oFocusedEl = this._focusedElement; >- >- if (oFocusedEl && oFocusedEl.focus) { >- >- try { >- oFocusedEl.focus(); >- } >- catch(ex) { >- } >- >- } >- >- } >- >- } >- else if (this.activeItem) { >- >- oSubmenu = this.activeItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu && oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- this.activeItem.focus(); >- >- } >- else { >- >- this.activeItem.blur(); >- this.activeItem.cfg.setProperty(_SELECTED, false); >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onKeyPress >-* @description "keypress" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onKeyPress: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0]; >- >- >- if (oEvent.keyCode == 40 || oEvent.keyCode == 38) { >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onBlur >-* @description "blur" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onBlur: function (p_sType, p_aArgs) { >- >- if (this._hasFocus) { >- this._hasFocus = false; >- } >- >-}, >- >-/** >-* @method _onYChange >-* @description "y" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onYChange: function (p_sType, p_aArgs) { >- >- var oParent = this.parent, >- nScrollTop, >- oIFrame, >- nY; >- >- >- if (oParent) { >- >- nScrollTop = oParent.parent.body.scrollTop; >- >- >- if (nScrollTop > 0) { >- >- nY = (this.cfg.getProperty(_Y) - nScrollTop); >- >- Dom.setY(this.element, nY); >- >- oIFrame = this.iframe; >- >- >- if (oIFrame) { >- >- Dom.setY(oIFrame, nY); >- >- } >- >- this.cfg.setProperty(_Y, nY, true); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onScrollTargetMouseOver >-* @description "mouseover" event handler for the menu's "header" and "footer" >-* elements. Used to scroll the body of the menu up and down when the >-* menu's "maxheight" configuration property is set to a value greater than 0. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onScrollTargetMouseOver: function (p_oEvent, p_oMenu) { >- >- var oBodyScrollTimer = this._bodyScrollTimer; >- >- >- if (oBodyScrollTimer) { >- >- oBodyScrollTimer.cancel(); >- >- } >- >- >- this._cancelHideDelay(); >- >- >- var oTarget = Event.getTarget(p_oEvent), >- oBody = this.body, >- nScrollIncrement = this.cfg.getProperty(_SCROLL_INCREMENT), >- nScrollTarget, >- fnScrollFunction; >- >- >- function scrollBodyDown() { >- >- var nScrollTop = oBody.scrollTop; >- >- >- if (nScrollTop < nScrollTarget) { >- >- oBody.scrollTop = (nScrollTop + nScrollIncrement); >- >- this._enableScrollHeader(); >- >- } >- else { >- >- oBody.scrollTop = nScrollTarget; >- >- this._bodyScrollTimer.cancel(); >- >- this._disableScrollFooter(); >- >- } >- >- } >- >- >- function scrollBodyUp() { >- >- var nScrollTop = oBody.scrollTop; >- >- >- if (nScrollTop > 0) { >- >- oBody.scrollTop = (nScrollTop - nScrollIncrement); >- >- this._enableScrollFooter(); >- >- } >- else { >- >- oBody.scrollTop = 0; >- >- this._bodyScrollTimer.cancel(); >- >- this._disableScrollHeader(); >- >- } >- >- } >- >- >- if (Dom.hasClass(oTarget, _HD)) { >- >- fnScrollFunction = scrollBodyUp; >- >- } >- else { >- >- nScrollTarget = oBody.scrollHeight - oBody.offsetHeight; >- >- fnScrollFunction = scrollBodyDown; >- >- } >- >- >- this._bodyScrollTimer = Lang.later(10, this, fnScrollFunction, null, true); >- >-}, >- >- >-/** >-* @method _onScrollTargetMouseOut >-* @description "mouseout" event handler for the menu's "header" and "footer" >-* elements. Used to stop scrolling the body of the menu up and down when the >-* menu's "maxheight" configuration property is set to a value greater than 0. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onScrollTargetMouseOut: function (p_oEvent, p_oMenu) { >- >- var oBodyScrollTimer = this._bodyScrollTimer; >- >- if (oBodyScrollTimer) { >- >- oBodyScrollTimer.cancel(); >- >- } >- >- this._cancelHideDelay(); >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _onInit >-* @description "init" event handler for the 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. >-*/ >-_onInit: function (p_sType, p_aArgs) { >- >- this.cfg.subscribeToConfigEvent(_VISIBLE, this._onVisibleChange); >- >- var bRootMenu = !this.parent, >- bLazyLoad = this.lazyLoad; >- >- >- /* >- Automatically initialize a menu's subtree if: >- >- 1) This is the root menu and lazyload is off >- >- 2) This is the root menu, lazyload is on, but the menu is >- already visible >- >- 3) This menu is a submenu and lazyload is off >- */ >- >- >- >- if (((bRootMenu && !bLazyLoad) || >- (bRootMenu && (this.cfg.getProperty(_VISIBLE) || >- this.cfg.getProperty(_POSITION) == _STATIC)) || >- (!bRootMenu && !bLazyLoad)) && this.getItemGroups().length === 0) { >- >- if (this.srcElement) { >- >- this._initSubTree(); >- >- } >- >- >- if (this.itemData) { >- >- this.addItems(this.itemData); >- >- } >- >- } >- else if (bLazyLoad) { >- >- this.cfg.fireQueue(); >- >- } >- >-}, >- >- >-/** >-* @method _onBeforeRender >-* @description "beforerender" event handler for the menu. Appends all of the >-* <code><ul></code>, <code><li></code> and their accompanying >-* title elements to the body element of the 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. >-*/ >-_onBeforeRender: function (p_sType, p_aArgs) { >- >- var oEl = this.element, >- nListElements = this._aListElements.length, >- bFirstList = true, >- i = 0, >- oUL, >- oGroupTitle; >- >- if (nListElements > 0) { >- >- do { >- >- oUL = this._aListElements[i]; >- >- if (oUL) { >- >- if (bFirstList) { >- >- Dom.addClass(oUL, _FIRST_OF_TYPE); >- bFirstList = false; >- >- } >- >- >- if (!Dom.isAncestor(oEl, oUL)) { >- >- this.appendToBody(oUL); >- >- } >- >- >- oGroupTitle = this._aGroupTitleElements[i]; >- >- if (oGroupTitle) { >- >- if (!Dom.isAncestor(oEl, oGroupTitle)) { >- >- oUL.parentNode.insertBefore(oGroupTitle, oUL); >- >- } >- >- >- Dom.addClass(oUL, _HAS_TITLE); >- >- } >- >- } >- >- i++; >- >- } >- while (i < nListElements); >- >- } >- >-}, >- >- >-/** >-* @method _onRender >-* @description "render" event handler for the 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. >-*/ >-_onRender: function (p_sType, p_aArgs) { >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- if (!this.cfg.getProperty(_VISIBLE)) { >- >- this.positionOffScreen(); >- >- } >- >- } >- >-}, >- >- >- >- >- >-/** >-* @method _onBeforeShow >-* @description "beforeshow" event handler for the 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. >-*/ >-_onBeforeShow: function (p_sType, p_aArgs) { >- >- var nOptions, >- n, >- oSrcElement, >- oContainer = this.cfg.getProperty(_CONTAINER); >- >- >- if (this.lazyLoad && this.getItemGroups().length === 0) { >- >- if (this.srcElement) { >- >- this._initSubTree(); >- >- } >- >- >- if (this.itemData) { >- >- if (this.parent && this.parent.parent && >- this.parent.parent.srcElement && >- this.parent.parent.srcElement.tagName.toUpperCase() == >- _SELECT) { >- >- nOptions = this.itemData.length; >- >- for(n=0; n<nOptions; n++) { >- >- if (this.itemData[n].tagName) { >- >- this.addItem((new this.ITEM_TYPE(this.itemData[n]))); >- >- } >- >- } >- >- } >- else { >- >- this.addItems(this.itemData); >- >- } >- >- } >- >- >- oSrcElement = this.srcElement; >- >- if (oSrcElement) { >- >- if (oSrcElement.tagName.toUpperCase() == _SELECT) { >- >- if (Dom.inDocument(oSrcElement)) { >- >- this.render(oSrcElement.parentNode); >- >- } >- else { >- >- this.render(oContainer); >- >- } >- >- } >- else { >- >- this.render(); >- >- } >- >- } >- else { >- >- if (this.parent) { >- >- this.render(this.parent.element); >- >- } >- else { >- >- this.render(oContainer); >- >- } >- >- } >- >- } >- >- >- >- var oParent = this.parent, >- aAlignment; >- >- >- if (!oParent && this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.cfg.refireEvent(_XY); >- >- } >- >- >- if (oParent) { >- >- aAlignment = oParent.parent.cfg.getProperty(_SUBMENU_ALIGNMENT); >- >- this.cfg.setProperty(_CONTEXT, [oParent.element, aAlignment[0], aAlignment[1]]); >- this.align(); >- >- } >- >-}, >- >- >-getConstrainedY: function (y) { >- >- var oMenu = this, >- >- aContext = oMenu.cfg.getProperty(_CONTEXT), >- nInitialMaxHeight = oMenu.cfg.getProperty(_MAX_HEIGHT), >- >- nMaxHeight, >- >- oOverlapPositions = { >- >- "trbr": true, >- "tlbl": true, >- "bltl": true, >- "brtr": true >- >- }, >- >- bPotentialContextOverlap = (aContext && oOverlapPositions[aContext[1] + aContext[2]]), >- >- oMenuEl = oMenu.element, >- nMenuOffsetHeight = oMenuEl.offsetHeight, >- >- nViewportOffset = Overlay.VIEWPORT_OFFSET, >- viewPortHeight = Dom.getViewportHeight(), >- scrollY = Dom.getDocumentScrollTop(), >- >- bCanConstrain = >- (oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT) + nViewportOffset < viewPortHeight), >- >- nAvailableHeight, >- >- oContextEl, >- nContextElY, >- nContextElHeight, >- >- bFlipped = false, >- >- nTopRegionHeight, >- nBottomRegionHeight, >- >- topConstraint = scrollY + nViewportOffset, >- bottomConstraint = scrollY + viewPortHeight - nMenuOffsetHeight - nViewportOffset, >- >- yNew = y; >- >- >- var flipVertical = function () { >- >- var nNewY; >- >- // The Menu is below the context element, flip it above >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- nNewY = (nContextElY - nMenuOffsetHeight); >- } >- else { // The Menu is above the context element, flip it below >- nNewY = (nContextElY + nContextElHeight); >- } >- >- oMenu.cfg.setProperty(_Y, (nNewY + scrollY), true); >- >- return nNewY; >- >- }; >- >- >- /* >- Uses the context element's position to calculate the availble height >- above and below it to display its corresponding Menu. >- */ >- >- var getDisplayRegionHeight = function () { >- >- // The Menu is below the context element >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- return (nBottomRegionHeight - nViewportOffset); >- } >- else { // The Menu is above the context element >- return (nTopRegionHeight - nViewportOffset); >- } >- >- }; >- >- >- /* >- Sets the Menu's "y" configuration property to the correct value based on its >- current orientation. >- */ >- >- var alignY = function () { >- >- var nNewY; >- >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- nNewY = (nContextElY + nContextElHeight); >- } >- else { >- nNewY = (nContextElY - oMenuEl.offsetHeight); >- } >- >- oMenu.cfg.setProperty(_Y, (nNewY + scrollY), true); >- >- }; >- >- >- // Resets the maxheight of the Menu to the value set by the user >- >- var resetMaxHeight = function () { >- >- oMenu._setScrollHeight(this.cfg.getProperty(_MAX_HEIGHT)); >- >- oMenu.hideEvent.unsubscribe(resetMaxHeight); >- >- }; >- >- >- /* >- Trys to place the Menu in the best possible position (either above or >- below its corresponding context element). >- */ >- >- var setVerticalPosition = function () { >- >- var nDisplayRegionHeight = getDisplayRegionHeight(), >- bMenuHasItems = (oMenu.getItems().length > 0), >- nMenuMinScrollHeight, >- fnReturnVal; >- >- >- if (nMenuOffsetHeight > nDisplayRegionHeight) { >- >- nMenuMinScrollHeight = >- bMenuHasItems ? oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT) : nMenuOffsetHeight; >- >- >- if ((nDisplayRegionHeight > nMenuMinScrollHeight) && bMenuHasItems) { >- nMaxHeight = nDisplayRegionHeight; >- } >- else { >- nMaxHeight = nInitialMaxHeight; >- } >- >- >- oMenu._setScrollHeight(nMaxHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- >- // Re-align the Menu since its height has just changed >- // as a result of the setting of the maxheight property. >- >- alignY(); >- >- >- if (nDisplayRegionHeight < nMenuMinScrollHeight) { >- >- if (bFlipped) { >- >- /* >- All possible positions and values for the "maxheight" >- configuration property have been tried, but none were >- successful, so fall back to the original size and position. >- */ >- >- flipVertical(); >- >- } >- else { >- >- flipVertical(); >- >- bFlipped = true; >- >- fnReturnVal = setVerticalPosition(); >- >- } >- >- } >- >- } >- else if (nMaxHeight && (nMaxHeight !== nInitialMaxHeight)) { >- >- oMenu._setScrollHeight(nInitialMaxHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- // Re-align the Menu since its height has just changed >- // as a result of the setting of the maxheight property. >- >- alignY(); >- >- } >- >- return fnReturnVal; >- >- }; >- >- >- // Determine if the current value for the Menu's "y" configuration property will >- // result in the Menu being positioned outside the boundaries of the viewport >- >- if (y < topConstraint || y > bottomConstraint) { >- >- // The current value for the Menu's "y" configuration property WILL >- // result in the Menu being positioned outside the boundaries of the viewport >- >- if (bCanConstrain) { >- >- if (oMenu.cfg.getProperty(_PREVENT_CONTEXT_OVERLAP) && bPotentialContextOverlap) { >- >- // SOLUTION #1: >- // If the "preventcontextoverlap" configuration property is set to "true", >- // try to flip and/or scroll the Menu to both keep it inside the boundaries of the >- // viewport AND from overlaping its context element (MenuItem or MenuBarItem). >- >- oContextEl = aContext[0]; >- nContextElHeight = oContextEl.offsetHeight; >- nContextElY = (Dom.getY(oContextEl) - scrollY); >- >- nTopRegionHeight = nContextElY; >- nBottomRegionHeight = (viewPortHeight - (nContextElY + nContextElHeight)); >- >- setVerticalPosition(); >- >- yNew = oMenu.cfg.getProperty(_Y); >- >- } >- else if (!(oMenu instanceof YAHOO.widget.MenuBar) && >- nMenuOffsetHeight >= viewPortHeight) { >- >- // SOLUTION #2: >- // If the Menu exceeds the height of the viewport, introduce scroll bars >- // to keep the Menu inside the boundaries of the viewport >- >- nAvailableHeight = (viewPortHeight - (nViewportOffset * 2)); >- >- if (nAvailableHeight > oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT)) { >- >- oMenu._setScrollHeight(nAvailableHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- alignY(); >- >- yNew = oMenu.cfg.getProperty(_Y); >- >- } >- >- } >- else { >- >- // SOLUTION #3: >- >- if (y < topConstraint) { >- yNew = topConstraint; >- } else if (y > bottomConstraint) { >- yNew = bottomConstraint; >- } >- >- } >- >- } >- else { >- // The "y" configuration property cannot be set to a value that will keep >- // entire Menu inside the boundary of the viewport. Therefore, set >- // the "y" configuration property to scrollY to keep as much of the >- // Menu inside the viewport as possible. >- yNew = nViewportOffset + scrollY; >- } >- >- } >- >- return yNew; >- >-}, >- >- >-/** >-* @method _onHide >-* @description "hide" event handler for the 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. >-*/ >-_onHide: function (p_sType, p_aArgs) { >- >- if (this.cfg.getProperty(_POSITION) === _DYNAMIC) { >- >- this.positionOffScreen(); >- >- } >- >-}, >- >- >-/** >-* @method _onShow >-* @description "show" event handler for the 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. >-*/ >-_onShow: function (p_sType, p_aArgs) { >- >- var oParent = this.parent, >- oParentMenu, >- oElement, >- nOffsetWidth, >- sWidth; >- >- >- function disableAutoSubmenuDisplay(p_oEvent) { >- >- var oTarget; >- >- if (p_oEvent.type == _MOUSEDOWN || (p_oEvent.type == _KEYDOWN && p_oEvent.keyCode == 27)) { >- >- /* >- Set the "autosubmenudisplay" to "false" if the user >- clicks outside the menu bar. >- */ >- >- oTarget = Event.getTarget(p_oEvent); >- >- if (oTarget != oParentMenu.element || !Dom.isAncestor(oParentMenu.element, oTarget)) { >- >- oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, false); >- >- Event.removeListener(document, _MOUSEDOWN, disableAutoSubmenuDisplay); >- Event.removeListener(document, _KEYDOWN, disableAutoSubmenuDisplay); >- >- } >- >- } >- >- } >- >- >- function onSubmenuHide(p_sType, p_aArgs, p_sWidth) { >- >- this.cfg.setProperty(_WIDTH, _EMPTY_STRING); >- this.hideEvent.unsubscribe(onSubmenuHide, p_sWidth); >- >- } >- >- >- if (oParent) { >- >- oParentMenu = oParent.parent; >- >- >- if (!oParentMenu.cfg.getProperty(_AUTO_SUBMENU_DISPLAY) && >- (oParentMenu instanceof YAHOO.widget.MenuBar || >- oParentMenu.cfg.getProperty(_POSITION) == _STATIC)) { >- >- oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, true); >- >- Event.on(document, _MOUSEDOWN, disableAutoSubmenuDisplay); >- Event.on(document, _KEYDOWN, disableAutoSubmenuDisplay); >- >- } >- >- >- // The following fixes an issue with the selected state of a MenuItem >- // not rendering correctly when a submenu is aligned to the left of >- // its parent Menu instance. >- >- if ((this.cfg.getProperty("x") < oParentMenu.cfg.getProperty("x")) && >- (UA.gecko && UA.gecko < 1.9) && !this.cfg.getProperty(_WIDTH)) { >- >- oElement = this.element; >- nOffsetWidth = oElement.offsetWidth; >- >- /* >- Measuring the difference of the offsetWidth before and after >- setting the "width" style attribute allows us to compute the >- about of padding and borders applied to the element, which in >- turn allows us to set the "width" property correctly. >- */ >- >- oElement.style.width = nOffsetWidth + _PX; >- >- sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + _PX; >- >- this.cfg.setProperty(_WIDTH, sWidth); >- >- this.hideEvent.subscribe(onSubmenuHide, sWidth); >- >- } >- >- } >- >- >- /* >- Dynamically positioned, root Menus focus themselves when visible, and >- will then, when hidden, restore focus to the UI control that had focus >- before the Menu was made visible. >- */ >- >- if (this === this.getRoot() && this.cfg.getProperty(_POSITION) === _DYNAMIC) { >- >- this._focusedElement = oFocusedElement; >- >- this.focus(); >- >- } >- >- >-}, >- >- >-/** >-* @method _onBeforeHide >-* @description "beforehide" event handler for the 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. >-*/ >-_onBeforeHide: function (p_sType, p_aArgs) { >- >- var oActiveItem = this.activeItem, >- oRoot = this.getRoot(), >- oConfig, >- oSubmenu; >- >- >- if (oActiveItem) { >- >- oConfig = oActiveItem.cfg; >- >- oConfig.setProperty(_SELECTED, false); >- >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.hide(); >- >- } >- >- } >- >- >- /* >- Focus can get lost in IE when the mouse is moving from a submenu back to its parent Menu. >- For this reason, it is necessary to maintain the focused state in a private property >- so that the _onMouseOver event handler is able to determined whether or not to set focus >- to MenuItems as the user is moving the mouse. >- */ >- >- if (UA.ie && this.cfg.getProperty(_POSITION) === _DYNAMIC && this.parent) { >- >- oRoot._hasFocus = this.hasFocus(); >- >- } >- >- >- if (oRoot == this) { >- >- oRoot.blur(); >- >- } >- >-}, >- >- >-/** >-* @method _onParentMenuConfigChange >-* @description "configchange" event handler for a submenu. >-* @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 {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that >-* subscribed to the event. >-*/ >-_onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) { >- >- var sPropertyName = p_aArgs[0][0], >- oPropertyValue = p_aArgs[0][1]; >- >- switch(sPropertyName) { >- >- case _IFRAME: >- case _CONSTRAIN_TO_VIEWPORT: >- case _HIDE_DELAY: >- case _SHOW_DELAY: >- case _SUBMENU_HIDE_DELAY: >- case _CLICK_TO_HIDE: >- case _EFFECT: >- case _CLASSNAME: >- case _SCROLL_INCREMENT: >- case _MAX_HEIGHT: >- case _MIN_SCROLL_HEIGHT: >- case _MONITOR_RESIZE: >- case _SHADOW: >- case _PREVENT_CONTEXT_OVERLAP: >- case _KEEP_OPEN: >- >- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue); >- >- break; >- >- case _SUBMENU_ALIGNMENT: >- >- if (!(this.parent.parent instanceof YAHOO.widget.MenuBar)) { >- >- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue); >- >- } >- >- break; >- >- } >- >-}, >- >- >-/** >-* @method _onParentMenuRender >-* @description "render" event handler for a submenu. Renders a >-* submenu in response to the firing of its parent's "render" event. >-* @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 {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that >-* subscribed to the event. >-*/ >-_onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) { >- >- var oParentMenu = p_oSubmenu.parent.parent, >- oParentCfg = oParentMenu.cfg, >- >- oConfig = { >- >- constraintoviewport: oParentCfg.getProperty(_CONSTRAIN_TO_VIEWPORT), >- >- xy: [0,0], >- >- clicktohide: oParentCfg.getProperty(_CLICK_TO_HIDE), >- >- effect: oParentCfg.getProperty(_EFFECT), >- >- showdelay: oParentCfg.getProperty(_SHOW_DELAY), >- >- hidedelay: oParentCfg.getProperty(_HIDE_DELAY), >- >- submenuhidedelay: oParentCfg.getProperty(_SUBMENU_HIDE_DELAY), >- >- classname: oParentCfg.getProperty(_CLASSNAME), >- >- scrollincrement: oParentCfg.getProperty(_SCROLL_INCREMENT), >- >- maxheight: oParentCfg.getProperty(_MAX_HEIGHT), >- >- minscrollheight: oParentCfg.getProperty(_MIN_SCROLL_HEIGHT), >- >- iframe: oParentCfg.getProperty(_IFRAME), >- >- shadow: oParentCfg.getProperty(_SHADOW), >- >- preventcontextoverlap: oParentCfg.getProperty(_PREVENT_CONTEXT_OVERLAP), >- >- monitorresize: oParentCfg.getProperty(_MONITOR_RESIZE), >- >- keepopen: oParentCfg.getProperty(_KEEP_OPEN) >- >- }, >- >- oLI; >- >- >- >- if (!(oParentMenu instanceof YAHOO.widget.MenuBar)) { >- >- oConfig[_SUBMENU_ALIGNMENT] = oParentCfg.getProperty(_SUBMENU_ALIGNMENT); >- >- } >- >- >- p_oSubmenu.cfg.applyConfig(oConfig); >- >- >- if (!this.lazyLoad) { >- >- oLI = this.parent.element; >- >- if (this.element.parentNode == oLI) { >- >- this.render(); >- >- } >- else { >- >- this.render(oLI); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMenuItemDestroy >-* @description "destroy" event handler for the menu's items. >-* @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >-* that fired the event. >-*/ >-_onMenuItemDestroy: function (p_sType, p_aArgs, p_oItem) { >- >- this._removeItemFromGroupByValue(p_oItem.groupIndex, p_oItem); >- >-}, >- >- >-/** >-* @method _onMenuItemConfigChange >-* @description "configchange" event handler for the menu's items. >-* @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >-* that fired the event. >-*/ >-_onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) { >- >- var sPropertyName = p_aArgs[0][0], >- oPropertyValue = p_aArgs[0][1], >- oSubmenu; >- >- >- switch(sPropertyName) { >- >- case _SELECTED: >- >- if (oPropertyValue === true) { >- >- this.activeItem = p_oItem; >- >- } >- >- break; >- >- case _SUBMENU: >- >- oSubmenu = p_aArgs[0][1]; >- >- if (oSubmenu) { >- >- this._configureSubmenu(p_oItem); >- >- } >- >- break; >- >- } >- >-}, >- >- >- >-// Public event handlers for configuration properties >- >- >-/** >-* @method configVisible >-* @description Event handler for when the "visible" configuration property >-* the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configVisible: function (p_sType, p_aArgs, p_oMenu) { >- >- var bVisible, >- sDisplay; >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- Menu.superclass.configVisible.call(this, p_sType, p_aArgs, p_oMenu); >- >- } >- else { >- >- bVisible = p_aArgs[0]; >- sDisplay = Dom.getStyle(this.element, _DISPLAY); >- >- Dom.setStyle(this.element, _VISIBILITY, _VISIBLE); >- >- if (bVisible) { >- >- if (sDisplay != _BLOCK) { >- this.beforeShowEvent.fire(); >- Dom.setStyle(this.element, _DISPLAY, _BLOCK); >- this.showEvent.fire(); >- } >- >- } >- else { >- >- if (sDisplay == _BLOCK) { >- this.beforeHideEvent.fire(); >- Dom.setStyle(this.element, _DISPLAY, _NONE); >- this.hideEvent.fire(); >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configPosition >-* @description Event handler for when the "position" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configPosition: function (p_sType, p_aArgs, p_oMenu) { >- >- var oElement = this.element, >- sCSSPosition = p_aArgs[0] == _STATIC ? _STATIC : _ABSOLUTE, >- oCfg = this.cfg, >- nZIndex; >- >- >- Dom.setStyle(oElement, _POSITION, sCSSPosition); >- >- >- if (sCSSPosition == _STATIC) { >- >- // Statically positioned menus are visible by default >- >- Dom.setStyle(oElement, _DISPLAY, _BLOCK); >- >- oCfg.setProperty(_VISIBLE, true); >- >- } >- else { >- >- /* >- Even though the "visible" property is queued to >- "false" by default, we need to set the "visibility" property to >- "hidden" since Overlay's "configVisible" implementation checks the >- element's "visibility" style property before deciding whether >- or not to show an Overlay instance. >- */ >- >- Dom.setStyle(oElement, _VISIBILITY, _HIDDEN); >- >- } >- >- >- if (sCSSPosition == _ABSOLUTE) { >- >- nZIndex = oCfg.getProperty(_ZINDEX); >- >- if (!nZIndex || nZIndex === 0) { >- >- oCfg.setProperty(_ZINDEX, 1); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configIframe >-* @description Event handler for when the "iframe" configuration property of >-* the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configIframe: function (p_sType, p_aArgs, p_oMenu) { >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- Menu.superclass.configIframe.call(this, p_sType, p_aArgs, p_oMenu); >- >- } >- >-}, >- >- >-/** >-* @method configHideDelay >-* @description Event handler for when the "hidedelay" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configHideDelay: function (p_sType, p_aArgs, p_oMenu) { >- >- var nHideDelay = p_aArgs[0]; >- >- this._useHideDelay = (nHideDelay > 0); >- >-}, >- >- >-/** >-* @method configContainer >-* @description Event handler for when the "container" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configContainer: function (p_sType, p_aArgs, p_oMenu) { >- >- var oElement = p_aArgs[0]; >- >- if (Lang.isString(oElement)) { >- >- this.cfg.setProperty(_CONTAINER, Dom.get(oElement), true); >- >- } >- >-}, >- >- >-/** >-* @method _clearSetWidthFlag >-* @description Change event listener for the "width" configuration property. This listener is >-* added when a Menu's "width" configuration property is set by the "_setScrollHeight" method, and >-* is used to set the "_widthSetForScroll" property to "false" if the "width" configuration property >-* is changed after it was set by the "_setScrollHeight" method. If the "_widthSetForScroll" >-* property is set to "false", and the "_setScrollHeight" method is in the process of tearing down >-* scrolling functionality, it will maintain the Menu's new width rather than reseting it. >-* @private >-*/ >-_clearSetWidthFlag: function () { >- >- this._widthSetForScroll = false; >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >-}, >- >- >-/** >-* @method _setScrollHeight >-* @description >-* @param {String} p_nScrollHeight Number representing the scrolling height of the Menu. >-* @private >-*/ >-_setScrollHeight: function (p_nScrollHeight) { >- >- var nScrollHeight = p_nScrollHeight, >- bRefireIFrameAndShadow = false, >- bSetWidth = false, >- oElement, >- oBody, >- oHeader, >- oFooter, >- fnMouseOver, >- fnMouseOut, >- nMinScrollHeight, >- nHeight, >- nOffsetWidth, >- sWidth; >- >- >- if (this.getItems().length > 0) { >- >- oElement = this.element; >- oBody = this.body; >- oHeader = this.header; >- oFooter = this.footer; >- fnMouseOver = this._onScrollTargetMouseOver; >- fnMouseOut = this._onScrollTargetMouseOut; >- nMinScrollHeight = this.cfg.getProperty(_MIN_SCROLL_HEIGHT); >- >- >- if (nScrollHeight > 0 && nScrollHeight < nMinScrollHeight) { >- >- nScrollHeight = nMinScrollHeight; >- >- } >- >- >- Dom.setStyle(oBody, _HEIGHT, _EMPTY_STRING); >- Dom.removeClass(oBody, _YUI_MENU_BODY_SCROLLED); >- oBody.scrollTop = 0; >- >- >- // Need to set a width for the Menu to fix the following problems in >- // Firefox 2 and IE: >- >- // #1) Scrolled Menus will render at 1px wide in Firefox 2 >- >- // #2) There is a bug in gecko-based browsers where an element whose >- // "position" property is set to "absolute" and "overflow" property is >- // set to "hidden" will not render at the correct width when its >- // offsetParent's "position" property is also set to "absolute." It is >- // possible to work around this bug by specifying a value for the width >- // property in addition to overflow. >- >- // #3) In IE it is necessary to give the Menu a width before the >- // scrollbars are rendered to prevent the Menu from rendering with a >- // width that is 100% of the browser viewport. >- >- bSetWidth = ((UA.gecko && UA.gecko < 1.9) || UA.ie); >- >- if (nScrollHeight > 0 && bSetWidth && !this.cfg.getProperty(_WIDTH)) { >- >- nOffsetWidth = oElement.offsetWidth; >- >- /* >- Measuring the difference of the offsetWidth before and after >- setting the "width" style attribute allows us to compute the >- about of padding and borders applied to the element, which in >- turn allows us to set the "width" property correctly. >- */ >- >- oElement.style.width = nOffsetWidth + _PX; >- >- sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + _PX; >- >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- YAHOO.log("Setting the \"width\" configuration property to " + sWidth + " for srolling.", >- "info", this.toString()); >- >- this.cfg.setProperty(_WIDTH, sWidth); >- >- >- /* >- Set a flag (_widthSetForScroll) to maintain some history regarding how the >- "width" configuration property was set. If the "width" configuration property >- is set by something other than the "_setScrollHeight" method, it will be >- necessary to maintain that new value and not clear the width if scrolling >- is turned off. >- */ >- >- this._widthSetForScroll = true; >- >- this.cfg.subscribeToConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- } >- >- >- if (nScrollHeight > 0 && (!oHeader && !oFooter)) { >- >- YAHOO.log("Creating header and footer for scrolling.", "info", this.toString()); >- >- this.setHeader(_NON_BREAKING_SPACE); >- this.setFooter(_NON_BREAKING_SPACE); >- >- oHeader = this.header; >- oFooter = this.footer; >- >- Dom.addClass(oHeader, _TOP_SCROLLBAR); >- Dom.addClass(oFooter, _BOTTOM_SCROLLBAR); >- >- oElement.insertBefore(oHeader, oBody); >- oElement.appendChild(oFooter); >- >- } >- >- >- nHeight = nScrollHeight; >- >- >- if (oHeader && oFooter) { >- nHeight = (nHeight - (oHeader.offsetHeight + oFooter.offsetHeight)); >- } >- >- >- if ((nHeight > 0) && (oBody.offsetHeight > nScrollHeight)) { >- >- YAHOO.log("Setting up styles and event handlers for scrolling.", >- "info", this.toString()); >- >- Dom.addClass(oBody, _YUI_MENU_BODY_SCROLLED); >- Dom.setStyle(oBody, _HEIGHT, (nHeight + _PX)); >- >- if (!this._hasScrollEventHandlers) { >- >- Event.on(oHeader, _MOUSEOVER, fnMouseOver, this, true); >- Event.on(oHeader, _MOUSEOUT, fnMouseOut, this, true); >- Event.on(oFooter, _MOUSEOVER, fnMouseOver, this, true); >- Event.on(oFooter, _MOUSEOUT, fnMouseOut, this, true); >- >- this._hasScrollEventHandlers = true; >- >- } >- >- this._disableScrollHeader(); >- this._enableScrollFooter(); >- >- bRefireIFrameAndShadow = true; >- >- } >- else if (oHeader && oFooter) { >- >- YAHOO.log("Removing styles and event handlers for scrolling.", "info", this.toString()); >- >- >- /* >- Only clear the "width" configuration property if it was set the >- "_setScrollHeight" method and wasn't changed by some other means after it was set. >- */ >- >- if (this._widthSetForScroll) { >- >- YAHOO.log("Clearing width used for scrolling.", "info", this.toString()); >- >- this._widthSetForScroll = false; >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- this.cfg.setProperty(_WIDTH, _EMPTY_STRING); >- >- } >- >- >- this._enableScrollHeader(); >- this._enableScrollFooter(); >- >- if (this._hasScrollEventHandlers) { >- >- Event.removeListener(oHeader, _MOUSEOVER, fnMouseOver); >- Event.removeListener(oHeader, _MOUSEOUT, fnMouseOut); >- Event.removeListener(oFooter, _MOUSEOVER, fnMouseOver); >- Event.removeListener(oFooter, _MOUSEOUT, fnMouseOut); >- >- this._hasScrollEventHandlers = false; >- >- } >- >- oElement.removeChild(oHeader); >- oElement.removeChild(oFooter); >- >- this.header = null; >- this.footer = null; >- >- bRefireIFrameAndShadow = true; >- >- } >- >- >- if (bRefireIFrameAndShadow) { >- >- this.cfg.refireEvent(_IFRAME); >- this.cfg.refireEvent(_SHADOW); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _setMaxHeight >-* @description "renderEvent" handler used to defer the setting of the >-* "maxheight" configuration property until the menu is rendered in lazy >-* load scenarios. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-* @param {Number} p_nMaxHeight Number representing the value to set for the >-* "maxheight" configuration property. >-* @private >-*/ >-_setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) { >- >- this._setScrollHeight(p_nMaxHeight); >- this.renderEvent.unsubscribe(this._setMaxHeight); >- >-}, >- >- >-/** >-* @method configMaxHeight >-* @description Event handler for when the "maxheight" configuration property of >-* a Menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired >-* the event. >-*/ >-configMaxHeight: function (p_sType, p_aArgs, p_oMenu) { >- >- var nMaxHeight = p_aArgs[0]; >- >- if (this.lazyLoad && !this.body && nMaxHeight > 0) { >- >- this.renderEvent.subscribe(this._setMaxHeight, nMaxHeight, this); >- >- } >- else { >- >- this._setScrollHeight(nMaxHeight); >- >- } >- >-}, >- >- >-/** >-* @method configClassName >-* @description Event handler for when the "classname" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configClassName: function (p_sType, p_aArgs, p_oMenu) { >- >- var sClassName = p_aArgs[0]; >- >- if (this._sClassName) { >- >- Dom.removeClass(this.element, this._sClassName); >- >- } >- >- Dom.addClass(this.element, sClassName); >- this._sClassName = sClassName; >- >-}, >- >- >-/** >-* @method _onItemAdded >-* @description "itemadded" event handler for a Menu instance. >-* @private >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onItemAdded: function (p_sType, p_aArgs) { >- >- var oItem = p_aArgs[0]; >- >- if (oItem) { >- >- oItem.cfg.setProperty(_DISABLED, true); >- >- } >- >-}, >- >- >-/** >-* @method configDisabled >-* @description Event handler for when the "disabled" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configDisabled: function (p_sType, p_aArgs, p_oMenu) { >- >- var bDisabled = p_aArgs[0], >- aItems = this.getItems(), >- nItems, >- i; >- >- if (Lang.isArray(aItems)) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- aItems[i].cfg.setProperty(_DISABLED, bDisabled); >- >- } >- while (i--); >- >- } >- >- >- if (bDisabled) { >- >- this.clearActiveItem(true); >- >- Dom.addClass(this.element, _DISABLED); >- >- this.itemAddedEvent.subscribe(this._onItemAdded); >- >- } >- else { >- >- Dom.removeClass(this.element, _DISABLED); >- >- this.itemAddedEvent.unsubscribe(this._onItemAdded); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configShadow >-* @description Event handler for when the "shadow" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configShadow: function (p_sType, p_aArgs, p_oMenu) { >- >- var sizeShadow = function () { >- >- var oElement = this.element, >- oShadow = this._shadow; >- >- if (oShadow && oElement) { >- >- // Clear the previous width >- >- if (oShadow.style.width && oShadow.style.height) { >- >- oShadow.style.width = _EMPTY_STRING; >- oShadow.style.height = _EMPTY_STRING; >- >- } >- >- oShadow.style.width = (oElement.offsetWidth + 6) + _PX; >- oShadow.style.height = (oElement.offsetHeight + 1) + _PX; >- >- } >- >- }; >- >- >- var replaceShadow = function () { >- >- this.element.appendChild(this._shadow); >- >- }; >- >- >- var addShadowVisibleClass = function () { >- >- Dom.addClass(this._shadow, _YUI_MENU_SHADOW_VISIBLE); >- >- }; >- >- >- var removeShadowVisibleClass = function () { >- >- Dom.removeClass(this._shadow, _YUI_MENU_SHADOW_VISIBLE); >- >- }; >- >- >- var createShadow = function () { >- >- var oShadow = this._shadow, >- oElement; >- >- if (!oShadow) { >- >- oElement = this.element; >- >- >- if (!m_oShadowTemplate) { >- >- m_oShadowTemplate = document.createElement(_DIV_LOWERCASE); >- m_oShadowTemplate.className = _YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE; >- >- } >- >- oShadow = m_oShadowTemplate.cloneNode(false); >- >- oElement.appendChild(oShadow); >- >- this._shadow = oShadow; >- >- this.beforeShowEvent.subscribe(addShadowVisibleClass); >- this.beforeHideEvent.subscribe(removeShadowVisibleClass); >- >- >- if (UA.ie) { >- >- /* >- Need to call sizeShadow & syncIframe via setTimeout for >- IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode >- or the shadow and iframe shim will not be sized and >- positioned properly. >- */ >- >- Lang.later(0, this, function () { >- >- sizeShadow.call(this); >- this.syncIframe(); >- >- }); >- >- >- this.cfg.subscribeToConfigEvent(_WIDTH, sizeShadow); >- this.cfg.subscribeToConfigEvent(_HEIGHT, sizeShadow); >- this.cfg.subscribeToConfigEvent(_MAX_HEIGHT, sizeShadow); >- this.changeContentEvent.subscribe(sizeShadow); >- >- Module.textResizeEvent.subscribe(sizeShadow, this, true); >- >- this.destroyEvent.subscribe(function () { >- >- Module.textResizeEvent.unsubscribe(sizeShadow, this); >- >- }); >- >- } >- >- this.cfg.subscribeToConfigEvent(_MAX_HEIGHT, replaceShadow); >- >- } >- >- }; >- >- >- var onBeforeShow = function () { >- >- if (this._shadow) { >- >- // If called because the "shadow" event was refired - just append again and resize >- >- replaceShadow.call(this); >- >- if (UA.ie) { >- sizeShadow.call(this); >- } >- >- } >- else { >- >- createShadow.call(this); >- >- } >- >- this.beforeShowEvent.unsubscribe(onBeforeShow); >- >- }; >- >- >- var bShadow = p_aArgs[0]; >- >- >- if (bShadow && this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- if (this.cfg.getProperty(_VISIBLE)) { >- >- if (this._shadow) { >- >- // If the "shadow" event was refired - just append again and resize >- >- replaceShadow.call(this); >- >- if (UA.ie) { >- sizeShadow.call(this); >- } >- >- } >- else { >- createShadow.call(this); >- } >- >- } >- else { >- >- this.beforeShowEvent.subscribe(onBeforeShow); >- >- } >- >- } >- >-}, >- >- >- >-// Public methods >- >- >-/** >-* @method initEvents >-* @description Initializes the custom events for the menu. >-*/ >-initEvents: function () { >- >- Menu.superclass.initEvents.call(this); >- >- // Create custom events >- >- var i = EVENT_TYPES.length - 1, >- aEventData, >- oCustomEvent; >- >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- oCustomEvent = this.createEvent(aEventData[1]); >- oCustomEvent.signature = CustomEvent.LIST; >- >- this[aEventData[0]] = oCustomEvent; >- >- } >- while (i--); >- >-}, >- >- >-/** >-* @method positionOffScreen >-* @description Positions the menu outside of the boundaries of the browser's >-* viewport. Called automatically when a menu is hidden to ensure that >-* it doesn't force the browser to render uncessary scrollbars. >-*/ >-positionOffScreen: function () { >- >- var oIFrame = this.iframe, >- oElement = this.element, >- sPos = this.OFF_SCREEN_POSITION; >- >- oElement.style.top = _EMPTY_STRING; >- oElement.style.left = _EMPTY_STRING; >- >- if (oIFrame) { >- >- oIFrame.style.top = sPos; >- oIFrame.style.left = sPos; >- >- } >- >-}, >- >- >-/** >-* @method getRoot >-* @description Finds the menu's root menu. >-*/ >-getRoot: function () { >- >- var oItem = this.parent, >- oParentMenu, >- returnVal; >- >- if (oItem) { >- >- oParentMenu = oItem.parent; >- >- returnVal = oParentMenu ? oParentMenu.getRoot() : this; >- >- } >- else { >- >- returnVal = this; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu. >-* @return {String} >-*/ >-toString: function () { >- >- var sReturnVal = _MENU, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @method setItemGroupTitle >-* @description Sets the title of a group of menu items. >-* @param {String} p_sGroupTitle String specifying the title of the group. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to which >-* the title belongs. >-*/ >-setItemGroupTitle: function (p_sGroupTitle, p_nGroupIndex) { >- >- var nGroupIndex, >- oTitle, >- i, >- nFirstIndex; >- >- if (Lang.isString(p_sGroupTitle) && p_sGroupTitle.length > 0) { >- >- nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0; >- oTitle = this._aGroupTitleElements[nGroupIndex]; >- >- >- if (oTitle) { >- >- oTitle.innerHTML = p_sGroupTitle; >- >- } >- else { >- >- oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME); >- >- oTitle.innerHTML = p_sGroupTitle; >- >- this._aGroupTitleElements[nGroupIndex] = oTitle; >- >- } >- >- >- i = this._aGroupTitleElements.length - 1; >- >- do { >- >- if (this._aGroupTitleElements[i]) { >- >- Dom.removeClass(this._aGroupTitleElements[i], _FIRST_OF_TYPE); >- >- nFirstIndex = i; >- >- } >- >- } >- while (i--); >- >- >- if (nFirstIndex !== null) { >- >- Dom.addClass(this._aGroupTitleElements[nFirstIndex], >- _FIRST_OF_TYPE); >- >- } >- >- this.changeContentEvent.fire(); >- >- } >- >-}, >- >- >- >-/** >-* @method addItem >-* @description Appends an item to the menu. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to >-* which the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-addItem: function (p_oItem, p_nGroupIndex) { >- >- return this._addItemToGroup(p_nGroupIndex, p_oItem); >- >-}, >- >- >-/** >-* @method addItems >-* @description Adds an array of items to the menu. >-* @param {Array} p_aItems Array of items to be added to the menu. The array >-* can contain strings specifying the text for each item to be created, object >-* literals specifying each of the menu item configuration properties, >-* or MenuItem instances. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to >-* which the items belongs. >-* @return {Array} >-*/ >-addItems: function (p_aItems, p_nGroupIndex) { >- >- var nItems, >- aItems, >- oItem, >- i, >- returnVal; >- >- >- if (Lang.isArray(p_aItems)) { >- >- nItems = p_aItems.length; >- aItems = []; >- >- for(i=0; i<nItems; i++) { >- >- oItem = p_aItems[i]; >- >- if (oItem) { >- >- if (Lang.isArray(oItem)) { >- >- aItems[aItems.length] = this.addItems(oItem, i); >- >- } >- else { >- >- aItems[aItems.length] = this._addItemToGroup(p_nGroupIndex, oItem); >- >- } >- >- } >- >- } >- >- >- if (aItems.length) { >- >- returnVal = aItems; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method insertItem >-* @description Inserts an item into the menu at the specified index. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nItemIndex Number indicating the ordinal position at which >-* the item should be added. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which >-* the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-insertItem: function (p_oItem, p_nItemIndex, p_nGroupIndex) { >- >- return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex); >- >-}, >- >- >-/** >-* @method removeItem >-* @description Removes the specified item from the menu. >-* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem >-* instance to be removed from the menu. >-* @param {Number} p_oObject Number specifying the index of the item >-* to be removed. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to >-* which the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-removeItem: function (p_oObject, p_nGroupIndex) { >- >- var oItem, >- returnVal; >- >- if (!Lang.isUndefined(p_oObject)) { >- >- if (p_oObject instanceof YAHOO.widget.MenuItem) { >- >- oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject); >- >- } >- else if (Lang.isNumber(p_oObject)) { >- >- oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject); >- >- } >- >- if (oItem) { >- >- oItem.destroy(); >- >- YAHOO.log("Item removed." + >- " Text: " + oItem.cfg.getProperty("text") + ", " + >- " Index: " + oItem.index + ", " + >- " Group Index: " + oItem.groupIndex, "info", this.toString()); >- >- returnVal = oItem; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getItems >-* @description Returns an array of all of the items in the menu. >-* @return {Array} >-*/ >-getItems: function () { >- >- var aGroups = this._aItemGroups, >- nGroups, >- returnVal, >- aItems = []; >- >- >- if (Lang.isArray(aGroups)) { >- >- nGroups = aGroups.length; >- >- returnVal = ((nGroups == 1) ? aGroups[0] : (Array.prototype.concat.apply(aItems, aGroups))); >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getItemGroups >-* @description Multi-dimensional Array representing the menu items as they >-* are grouped in the menu. >-* @return {Array} >-*/ >-getItemGroups: function () { >- >- return this._aItemGroups; >- >-}, >- >- >-/** >-* @method getItem >-* @description Returns the item at the specified index. >-* @param {Number} p_nItemIndex Number indicating the ordinal position of the >-* item to be retrieved. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which >-* the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-getItem: function (p_nItemIndex, p_nGroupIndex) { >- >- var aGroup, >- returnVal; >- >- if (Lang.isNumber(p_nItemIndex)) { >- >- aGroup = this._getItemGroup(p_nGroupIndex); >- >- if (aGroup) { >- >- returnVal = aGroup[p_nItemIndex]; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getSubmenus >-* @description Returns an array of all of the submenus that are immediate >-* children of the menu. >-* @return {Array} >-*/ >-getSubmenus: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- aSubmenus, >- oSubmenu, >- oItem, >- i; >- >- >- if (nItems > 0) { >- >- aSubmenus = []; >- >- for(i=0; i<nItems; i++) { >- >- oItem = aItems[i]; >- >- if (oItem) { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- aSubmenus[aSubmenus.length] = oSubmenu; >- >- } >- >- } >- >- } >- >- } >- >- return aSubmenus; >- >-}, >- >- >-/** >-* @method clearContent >-* @description Removes all of the content from the menu, including the menu >-* items, group titles, header and footer. >-*/ >-clearContent: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- oElement = this.element, >- oBody = this.body, >- oHeader = this.header, >- oFooter = this.footer, >- oItem, >- oSubmenu, >- i; >- >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- >- if (oItem) { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- this.cfg.configChangedEvent.unsubscribe( >- this._onParentMenuConfigChange, oSubmenu); >- >- this.renderEvent.unsubscribe(this._onParentMenuRender, >- oSubmenu); >- >- } >- >- this.removeItem(oItem, oItem.groupIndex); >- >- } >- >- } >- while (i--); >- >- } >- >- >- if (oHeader) { >- >- Event.purgeElement(oHeader); >- oElement.removeChild(oHeader); >- >- } >- >- >- if (oFooter) { >- >- Event.purgeElement(oFooter); >- oElement.removeChild(oFooter); >- } >- >- >- if (oBody) { >- >- Event.purgeElement(oBody); >- >- oBody.innerHTML = _EMPTY_STRING; >- >- } >- >- this.activeItem = null; >- >- this._aItemGroups = []; >- this._aListElements = []; >- this._aGroupTitleElements = []; >- >- this.cfg.setProperty(_WIDTH, null); >- >-}, >- >- >-/** >-* @method destroy >-* @description Removes the menu's <code><div></code> element >-* (and accompanying child nodes) from the document. >-*/ >-destroy: function () { >- >- // Remove all items >- >- this.clearContent(); >- >- this._aItemGroups = null; >- this._aListElements = null; >- this._aGroupTitleElements = null; >- >- >- // Continue with the superclass implementation of this method >- >- Menu.superclass.destroy.call(this); >- >- YAHOO.log("Destroyed.", "info", this.toString()); >- >-}, >- >- >-/** >-* @method setInitialFocus >-* @description Sets focus to the menu's first enabled item. >-*/ >-setInitialFocus: function () { >- >- var oItem = this._getFirstEnabledItem(); >- >- if (oItem) { >- >- oItem.focus(); >- >- } >- >-}, >- >- >-/** >-* @method setInitialSelection >-* @description Sets the "selected" configuration property of the menu's first >-* enabled item to "true." >-*/ >-setInitialSelection: function () { >- >- var oItem = this._getFirstEnabledItem(); >- >- if (oItem) { >- >- oItem.cfg.setProperty(_SELECTED, true); >- } >- >-}, >- >- >-/** >-* @method clearActiveItem >-* @description Sets the "selected" configuration property of the menu's active >-* item to "false" and hides the item's submenu. >-* @param {Boolean} p_bBlur Boolean indicating if the menu's active item >-* should be blurred. >-*/ >-clearActiveItem: function (p_bBlur) { >- >- if (this.cfg.getProperty(_SHOW_DELAY) > 0) { >- >- this._cancelShowDelay(); >- >- } >- >- >- var oActiveItem = this.activeItem, >- oConfig, >- oSubmenu; >- >- if (oActiveItem) { >- >- oConfig = oActiveItem.cfg; >- >- if (p_bBlur) { >- >- oActiveItem.blur(); >- >- this.getRoot()._hasFocus = true; >- >- } >- >- oConfig.setProperty(_SELECTED, false); >- >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- >- if (oSubmenu) { >- >- oSubmenu.hide(); >- >- } >- >- this.activeItem = null; >- >- } >- >-}, >- >- >-/** >-* @method focus >-* @description Causes the menu to receive focus and fires the "focus" event. >-*/ >-focus: function () { >- >- if (!this.hasFocus()) { >- >- this.setInitialFocus(); >- >- } >- >-}, >- >- >-/** >-* @method blur >-* @description Causes the menu to lose focus and fires the "blur" event. >-*/ >-blur: function () { >- >- var oItem; >- >- if (this.hasFocus()) { >- >- oItem = MenuManager.getFocusedMenuItem(); >- >- if (oItem) { >- >- oItem.blur(); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method hasFocus >-* @description Returns a boolean indicating whether or not the menu has focus. >-* @return {Boolean} >-*/ >-hasFocus: function () { >- >- return (MenuManager.getFocusedMenu() == this.getRoot()); >- >-}, >- >- >-_doItemSubmenuSubscribe: function (p_sType, p_aArgs, p_oObject) { >- >- var oItem = p_aArgs[0], >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, p_oObject); >- } >- >-}, >- >- >-_doSubmenuSubscribe: function (p_sType, p_aArgs, p_oObject) { >- >- var oSubmenu = this.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, p_oObject); >- } >- >-}, >- >- >-/** >-* Adds the specified CustomEvent subscriber to the menu and each of >-* its submenus. >-* @method subscribe >-* @param p_type {string} the type, or name of the event >-* @param p_fn {function} the function to exectute when the event fires >-* @param p_obj {Object} An object to be passed along when the event >-* fires >-* @param p_override {boolean} If true, the obj passed in becomes the >-* execution scope of the listener >-*/ >-subscribe: function () { >- >- // Subscribe to the event for this Menu instance >- Menu.superclass.subscribe.apply(this, arguments); >- >- // Subscribe to the "itemAdded" event so that all future submenus >- // also subscribe to this event >- Menu.superclass.subscribe.call(this, _ITEM_ADDED, this._doItemSubmenuSubscribe, arguments); >- >- >- var aItems = this.getItems(), >- nItems, >- oItem, >- oSubmenu, >- i; >- >- >- if (aItems) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, arguments); >- } >- else { >- oItem.cfg.subscribeToConfigEvent(_SUBMENU, this._doSubmenuSubscribe, arguments); >- } >- >- } >- while (i--); >- >- } >- >- } >- >-}, >- >- >-unsubscribe: function () { >- >- // Remove the event for this Menu instance >- Menu.superclass.unsubscribe.apply(this, arguments); >- >- // Remove the "itemAdded" event so that all future submenus don't have >- // the event handler >- Menu.superclass.unsubscribe.call(this, _ITEM_ADDED, this._doItemSubmenuSubscribe, arguments); >- >- >- var aItems = this.getItems(), >- nItems, >- oItem, >- oSubmenu, >- i; >- >- >- if (aItems) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.unsubscribe.apply(oSubmenu, arguments); >- } >- else { >- oItem.cfg.unsubscribeFromConfigEvent(_SUBMENU, this._doSubmenuSubscribe, arguments); >- } >- >- } >- while (i--); >- >- } >- >- } >- >-}, >- >- >-/** >-* @description Initializes the class's configurable properties which can be >-* changed using the menu's Config object ("cfg"). >-* @method initDefaultConfig >-*/ >-initDefaultConfig: function () { >- >- Menu.superclass.initDefaultConfig.call(this); >- >- var oConfig = this.cfg; >- >- >- // Module documentation overrides >- >- /** >- * @config effect >- * @description Object or array of objects representing the ContainerEffect >- * classes that are active for animating the container. When set this >- * property is automatically applied to all submenus. >- * @type Object >- * @default null >- */ >- >- // Overlay documentation overrides >- >- >- /** >- * @config x >- * @description Number representing the absolute x-coordinate position of >- * the Menu. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Number >- * @default null >- */ >- >- >- /** >- * @config y >- * @description Number representing the absolute y-coordinate position of >- * the Menu. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Number >- * @default null >- */ >- >- >- /** >- * @description Array of the absolute x and y positions of the Menu. This >- * property is only applied when the "position" configuration property is >- * set to dynamic. >- * @config xy >- * @type Number[] >- * @default null >- */ >- >- >- /** >- * @config context >- * @description Array of context arguments for context-sensitive positioning. >- * The format is: [id or element, element corner, context corner]. >- * For example, setting this property to ["img1", "tl", "bl"] would >- * align the Menu's top left corner to the context element's >- * bottom left corner. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Array >- * @default null >- */ >- >- >- /** >- * @config fixedcenter >- * @description Boolean indicating if the Menu should be anchored to the >- * center of the viewport. This property is only applied when the >- * "position" configuration property is set to dynamic. >- * @type Boolean >- * @default false >- */ >- >- >- /** >- * @config iframe >- * @description Boolean indicating whether or not the Menu 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 Menu instance is intially >- * made visible. This property is only applied when the "position" >- * configuration property is set to dynamic and is automatically applied >- * to all submenus. >- * @type Boolean >- * @default true for IE6 and below, false for all other browsers. >- */ >- >- >- // Add configuration attributes >- >- /* >- Change the default value for the "visible" configuration >- property to "false" by re-adding the property. >- */ >- >- /** >- * @config visible >- * @description Boolean indicating whether or not the menu is visible. If >- * the menu's "position" configuration property is set to "dynamic" (the >- * default), this property toggles the menu's <code><div></code> >- * element's "visibility" style property between "visible" (true) or >- * "hidden" (false). If the menu's "position" configuration property is >- * set to "static" this property toggles the menu's >- * <code><div></code> element's "display" style property >- * between "block" (true) or "none" (false). >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- VISIBLE_CONFIG.key, >- { >- handler: this.configVisible, >- value: VISIBLE_CONFIG.value, >- validator: VISIBLE_CONFIG.validator >- } >- ); >- >- >- /* >- Change the default value for the "constraintoviewport" configuration >- property (inherited by YAHOO.widget.Overlay) to "true" by re-adding the property. >- */ >- >- /** >- * @config constraintoviewport >- * @description Boolean indicating if the menu will try to remain inside >- * the boundaries of the size of viewport. This property is only applied >- * when the "position" configuration property is set to dynamic and is >- * automatically applied to all submenus. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- CONSTRAIN_TO_VIEWPORT_CONFIG.key, >- { >- handler: this.configConstrainToViewport, >- value: CONSTRAIN_TO_VIEWPORT_CONFIG.value, >- validator: CONSTRAIN_TO_VIEWPORT_CONFIG.validator, >- supercedes: CONSTRAIN_TO_VIEWPORT_CONFIG.supercedes >- } >- ); >- >- >- /* >- Change the default value for the "preventcontextoverlap" configuration >- property (inherited by YAHOO.widget.Overlay) to "true" by re-adding the property. >- */ >- >- /** >- * @config preventcontextoverlap >- * @description Boolean indicating whether or not a submenu should overlap its parent MenuItem >- * when the "constraintoviewport" configuration property is set to "true". >- * @type Boolean >- * @default true >- */ >- oConfig.addProperty(PREVENT_CONTEXT_OVERLAP_CONFIG.key, { >- >- value: PREVENT_CONTEXT_OVERLAP_CONFIG.value, >- validator: PREVENT_CONTEXT_OVERLAP_CONFIG.validator, >- supercedes: PREVENT_CONTEXT_OVERLAP_CONFIG.supercedes >- >- }); >- >- >- /** >- * @config position >- * @description String indicating how a menu should be positioned on the >- * screen. Possible values are "static" and "dynamic." Static menus are >- * visible by default and reside in the normal flow of the document >- * (CSS position: static). Dynamic menus are hidden by default, reside >- * out of the normal flow of the document (CSS position: absolute), and >- * can overlay other elements on the screen. >- * @default dynamic >- * @type String >- */ >- oConfig.addProperty( >- POSITION_CONFIG.key, >- { >- handler: this.configPosition, >- value: POSITION_CONFIG.value, >- validator: POSITION_CONFIG.validator, >- supercedes: POSITION_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config submenualignment >- * @description Array defining how submenus should be aligned to their >- * parent menu item. The format is: [itemCorner, submenuCorner]. By default >- * a submenu's top left corner is aligned to its parent menu item's top >- * right corner. >- * @default ["tl","tr"] >- * @type Array >- */ >- oConfig.addProperty( >- SUBMENU_ALIGNMENT_CONFIG.key, >- { >- value: SUBMENU_ALIGNMENT_CONFIG.value, >- suppressEvent: SUBMENU_ALIGNMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config autosubmenudisplay >- * @description Boolean indicating if submenus are automatically made >- * visible when the user mouses over the menu's items. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- AUTO_SUBMENU_DISPLAY_CONFIG.key, >- { >- value: AUTO_SUBMENU_DISPLAY_CONFIG.value, >- validator: AUTO_SUBMENU_DISPLAY_CONFIG.validator, >- suppressEvent: AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config showdelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before a submenu is made visible when the user mouses over >- * the menu's items. This property is only applied when the "position" >- * configuration property is set to dynamic and is automatically applied >- * to all submenus. >- * @default 250 >- * @type Number >- */ >- oConfig.addProperty( >- SHOW_DELAY_CONFIG.key, >- { >- value: SHOW_DELAY_CONFIG.value, >- validator: SHOW_DELAY_CONFIG.validator, >- suppressEvent: SHOW_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config hidedelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before the menu is hidden. This property is only applied when >- * the "position" configuration property is set to dynamic and is >- * automatically applied to all submenus. >- * @default 0 >- * @type Number >- */ >- oConfig.addProperty( >- HIDE_DELAY_CONFIG.key, >- { >- handler: this.configHideDelay, >- value: HIDE_DELAY_CONFIG.value, >- validator: HIDE_DELAY_CONFIG.validator, >- suppressEvent: HIDE_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenuhidedelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before a submenu is hidden when the user mouses out of a menu item >- * heading in the direction of a submenu. The value must be greater than or >- * equal to the value specified for the "showdelay" configuration property. >- * This property is only applied when the "position" configuration property >- * is set to dynamic and is automatically applied to all submenus. >- * @default 250 >- * @type Number >- */ >- oConfig.addProperty( >- SUBMENU_HIDE_DELAY_CONFIG.key, >- { >- value: SUBMENU_HIDE_DELAY_CONFIG.value, >- validator: SUBMENU_HIDE_DELAY_CONFIG.validator, >- suppressEvent: SUBMENU_HIDE_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config clicktohide >- * @description Boolean indicating if the menu will automatically be >- * hidden if the user clicks outside of it. This property is only >- * applied when the "position" configuration property is set to dynamic >- * and is automatically applied to all submenus. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- CLICK_TO_HIDE_CONFIG.key, >- { >- value: CLICK_TO_HIDE_CONFIG.value, >- validator: CLICK_TO_HIDE_CONFIG.validator, >- suppressEvent: CLICK_TO_HIDE_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the menu'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 document.body >- */ >- oConfig.addProperty( >- CONTAINER_CONFIG.key, >- { >- handler: this.configContainer, >- value: document.body, >- suppressEvent: CONTAINER_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config scrollincrement >- * @description Number used to control the scroll speed of a menu. Used to >- * increment the "scrollTop" property of the menu's body by when a menu's >- * content is scrolling. When set this property is automatically applied >- * to all submenus. >- * @default 1 >- * @type Number >- */ >- oConfig.addProperty( >- SCROLL_INCREMENT_CONFIG.key, >- { >- value: SCROLL_INCREMENT_CONFIG.value, >- validator: SCROLL_INCREMENT_CONFIG.validator, >- supercedes: SCROLL_INCREMENT_CONFIG.supercedes, >- suppressEvent: SCROLL_INCREMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config minscrollheight >- * @description Number defining the minimum threshold for the "maxheight" >- * configuration property. When set this property is automatically applied >- * to all submenus. >- * @default 90 >- * @type Number >- */ >- oConfig.addProperty( >- MIN_SCROLL_HEIGHT_CONFIG.key, >- { >- value: MIN_SCROLL_HEIGHT_CONFIG.value, >- validator: MIN_SCROLL_HEIGHT_CONFIG.validator, >- supercedes: MIN_SCROLL_HEIGHT_CONFIG.supercedes, >- suppressEvent: MIN_SCROLL_HEIGHT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config maxheight >- * @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. >- * @default 0 >- * @type Number >- */ >- oConfig.addProperty( >- MAX_HEIGHT_CONFIG.key, >- { >- handler: this.configMaxHeight, >- value: MAX_HEIGHT_CONFIG.value, >- validator: MAX_HEIGHT_CONFIG.validator, >- suppressEvent: MAX_HEIGHT_CONFIG.suppressEvent, >- supercedes: MAX_HEIGHT_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config classname >- * @description String representing the CSS class to be applied to the >- * menu's root <code><div></code> element. The specified class(es) >- * are appended in addition to the default class as specified by the menu's >- * CSS_CLASS_NAME constant. When set this property is automatically >- * applied to all submenus. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- CLASS_NAME_CONFIG.key, >- { >- handler: this.configClassName, >- value: CLASS_NAME_CONFIG.value, >- validator: CLASS_NAME_CONFIG.validator, >- supercedes: CLASS_NAME_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config disabled >- * @description Boolean indicating if the menu should be disabled. >- * Disabling a menu disables each of its items. (Disabled menu items are >- * dimmed and will not respond to user input or fire events.) Disabled >- * menus have a corresponding "disabled" CSS class applied to their root >- * <code><div></code> element. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- DISABLED_CONFIG.key, >- { >- handler: this.configDisabled, >- value: DISABLED_CONFIG.value, >- validator: DISABLED_CONFIG.validator, >- suppressEvent: DISABLED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config shadow >- * @description Boolean indicating if the menu should have a shadow. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- SHADOW_CONFIG.key, >- { >- handler: this.configShadow, >- value: SHADOW_CONFIG.value, >- validator: SHADOW_CONFIG.validator >- } >- ); >- >- >- /** >- * @config keepopen >- * @description Boolean indicating if the menu should remain open when clicked. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- KEEP_OPEN_CONFIG.key, >- { >- value: KEEP_OPEN_CONFIG.value, >- validator: KEEP_OPEN_CONFIG.validator >- } >- ); >- >-} >- >-}); // END YAHOO.lang.extend >- >-})(); >- >- >- >-(function () { >- >-/** >-* Creates an item for a menu. >-* >-* @param {String} p_oObject String specifying the text of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying >-* the <code><li></code> element of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object >-* specifying the <code><option></code> element of the menu item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu item. See configuration class documentation >-* for more details. >-* @class MenuItem >-* @constructor >-*/ >-YAHOO.widget.MenuItem = function (p_oObject, p_oConfig) { >- >- if (p_oObject) { >- >- if (p_oConfig) { >- >- this.parent = p_oConfig.parent; >- this.value = p_oConfig.value; >- this.id = p_oConfig.id; >- >- } >- >- this.init(p_oObject, p_oConfig); >- >- } >- >-}; >- >- >-var Dom = YAHOO.util.Dom, >- Module = YAHOO.widget.Module, >- Menu = YAHOO.widget.Menu, >- MenuItem = YAHOO.widget.MenuItem, >- CustomEvent = YAHOO.util.CustomEvent, >- UA = YAHOO.env.ua, >- Lang = YAHOO.lang, >- >- // Private string constants >- >- _TEXT = "text", >- _HASH = "#", >- _HYPHEN = "-", >- _HELP_TEXT = "helptext", >- _URL = "url", >- _TARGET = "target", >- _EMPHASIS = "emphasis", >- _STRONG_EMPHASIS = "strongemphasis", >- _CHECKED = "checked", >- _SUBMENU = "submenu", >- _DISABLED = "disabled", >- _SELECTED = "selected", >- _HAS_SUBMENU = "hassubmenu", >- _CHECKED_DISABLED = "checked-disabled", >- _HAS_SUBMENU_DISABLED = "hassubmenu-disabled", >- _HAS_SUBMENU_SELECTED = "hassubmenu-selected", >- _CHECKED_SELECTED = "checked-selected", >- _ONCLICK = "onclick", >- _CLASSNAME = "classname", >- _EMPTY_STRING = "", >- _OPTION = "OPTION", >- _OPTGROUP = "OPTGROUP", >- _LI_UPPERCASE = "LI", >- _HREF = "href", >- _SELECT = "SELECT", >- _DIV = "DIV", >- _START_HELP_TEXT = "<em class=\"helptext\">", >- _START_EM = "<em>", >- _END_EM = "</em>", >- _START_STRONG = "<strong>", >- _END_STRONG = "</strong>", >- _PREVENT_CONTEXT_OVERLAP = "preventcontextoverlap", >- _OBJ = "obj", >- _SCOPE = "scope", >- _NONE = "none", >- _VISIBLE = "visible", >- _SPACE = " ", >- _MENUITEM = "MenuItem", >- _CLICK = "click", >- _SHOW = "show", >- _HIDE = "hide", >- _LI_LOWERCASE = "li", >- _ANCHOR_TEMPLATE = "<a href=\"#\"></a>", >- >- EVENT_TYPES = [ >- >- ["mouseOverEvent", "mouseover"], >- ["mouseOutEvent", "mouseout"], >- ["mouseDownEvent", "mousedown"], >- ["mouseUpEvent", "mouseup"], >- ["clickEvent", _CLICK], >- ["keyPressEvent", "keypress"], >- ["keyDownEvent", "keydown"], >- ["keyUpEvent", "keyup"], >- ["focusEvent", "focus"], >- ["blurEvent", "blur"], >- ["destroyEvent", "destroy"] >- >- ], >- >- TEXT_CONFIG = { >- key: _TEXT, >- value: _EMPTY_STRING, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- HELP_TEXT_CONFIG = { >- key: _HELP_TEXT, >- supercedes: [_TEXT], >- suppressEvent: true >- }, >- >- URL_CONFIG = { >- key: _URL, >- value: _HASH, >- suppressEvent: true >- }, >- >- TARGET_CONFIG = { >- key: _TARGET, >- suppressEvent: true >- }, >- >- EMPHASIS_CONFIG = { >- key: _EMPHASIS, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT] >- }, >- >- STRONG_EMPHASIS_CONFIG = { >- key: _STRONG_EMPHASIS, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT] >- }, >- >- CHECKED_CONFIG = { >- key: _CHECKED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_DISABLED, _SELECTED] >- }, >- >- SUBMENU_CONFIG = { >- key: _SUBMENU, >- suppressEvent: true, >- supercedes: [_DISABLED, _SELECTED] >- }, >- >- DISABLED_CONFIG = { >- key: _DISABLED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT, _SELECTED] >- }, >- >- SELECTED_CONFIG = { >- key: _SELECTED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- ONCLICK_CONFIG = { >- key: _ONCLICK, >- suppressEvent: true >- }, >- >- CLASS_NAME_CONFIG = { >- key: _CLASSNAME, >- value: null, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- KEY_LISTENER_CONFIG = { >- key: "keylistener", >- value: null, >- suppressEvent: true >- }, >- >- m_oMenuItemTemplate = null, >- >- CLASS_NAMES = {}; >- >- >-/** >-* @method getClassNameForState >-* @description Returns a class name for the specified prefix and state. If the class name does not >-* yet exist, it is created and stored in the CLASS_NAMES object to increase performance. >-* @private >-* @param {String} prefix String representing the prefix for the class name >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var getClassNameForState = function (prefix, state) { >- >- var oClassNames = CLASS_NAMES[prefix]; >- >- if (!oClassNames) { >- CLASS_NAMES[prefix] = {}; >- oClassNames = CLASS_NAMES[prefix]; >- } >- >- >- var sClassName = oClassNames[state]; >- >- if (!sClassName) { >- sClassName = prefix + _HYPHEN + state; >- oClassNames[state] = sClassName; >- } >- >- return sClassName; >- >-}; >- >- >-/** >-* @method addClassNameForState >-* @description Applies a class name to a MenuItem instance's <LI> and <A> elements >-* that represents a MenuItem's state - "disabled," "checked," etc. >-* @private >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var addClassNameForState = function (state) { >- >- Dom.addClass(this.element, getClassNameForState(this.CSS_CLASS_NAME, state)); >- Dom.addClass(this._oAnchor, getClassNameForState(this.CSS_LABEL_CLASS_NAME, state)); >- >-}; >- >-/** >-* @method removeClassNameForState >-* @description Removes a class name from a MenuItem instance's <LI> and <A> elements >-* that represents a MenuItem's state - "disabled," "checked," etc. >-* @private >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var removeClassNameForState = function (state) { >- >- Dom.removeClass(this.element, getClassNameForState(this.CSS_CLASS_NAME, state)); >- Dom.removeClass(this._oAnchor, getClassNameForState(this.CSS_LABEL_CLASS_NAME, state)); >- >-}; >- >- >-MenuItem.prototype = { >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to the >- * <code><li></code> element of the menu item. >- * @default "yuimenuitem" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "yuimenuitem", >- >- >- /** >- * @property CSS_LABEL_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to the >- * menu item's <code><a></code> element. >- * @default "yuimenuitemlabel" >- * @final >- * @type String >- */ >- CSS_LABEL_CLASS_NAME: "yuimenuitemlabel", >- >- >- /** >- * @property SUBMENU_TYPE >- * @description Object representing the type of menu to instantiate and >- * add when parsing the child nodes of the menu item's source HTML element. >- * @final >- * @type YAHOO.widget.Menu >- */ >- SUBMENU_TYPE: null, >- >- >- >- // Private member variables >- >- >- /** >- * @property _oAnchor >- * @description Object reference to the menu item's >- * <code><a></code> element. >- * @default null >- * @private >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-48250443">HTMLAnchorElement</a> >- */ >- _oAnchor: null, >- >- >- /** >- * @property _oHelpTextEM >- * @description Object reference to the menu item's help text >- * <code><em></code> element. >- * @default null >- * @private >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-58190037">HTMLElement</a> >- */ >- _oHelpTextEM: null, >- >- >- /** >- * @property _oSubmenu >- * @description Object reference to the menu item's submenu. >- * @default null >- * @private >- * @type YAHOO.widget.Menu >- */ >- _oSubmenu: null, >- >- >- /** >- * @property _oOnclickAttributeValue >- * @description Object reference to the menu item's current value for the >- * "onclick" configuration attribute. >- * @default null >- * @private >- * @type Object >- */ >- _oOnclickAttributeValue: null, >- >- >- /** >- * @property _sClassName >- * @description The current value of the "classname" configuration attribute. >- * @default null >- * @private >- * @type String >- */ >- _sClassName: null, >- >- >- >- // Public properties >- >- >- /** >- * @property constructor >- * @description Object reference to the menu item's constructor function. >- * @default YAHOO.widget.MenuItem >- * @type YAHOO.widget.MenuItem >- */ >- constructor: MenuItem, >- >- >- /** >- * @property index >- * @description Number indicating the ordinal position of the menu item in >- * its group. >- * @default null >- * @type Number >- */ >- index: null, >- >- >- /** >- * @property groupIndex >- * @description Number indicating the index of the group to which the menu >- * item belongs. >- * @default null >- * @type Number >- */ >- groupIndex: null, >- >- >- /** >- * @property parent >- * @description Object reference to the menu item's parent menu. >- * @default null >- * @type YAHOO.widget.Menu >- */ >- parent: null, >- >- >- /** >- * @property element >- * @description Object reference to the menu item's >- * <code><li></code> element. >- * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level >- * -one-html.html#ID-74680021">HTMLLIElement</a> >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a> >- */ >- element: null, >- >- >- /** >- * @property srcElement >- * @description Object reference to the HTML element (either >- * <code><li></code>, <code><optgroup></code> or >- * <code><option></code>) used create the menu item. >- * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www. >- * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247" >- * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM- >- * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a> >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3. >- * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"> >- * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM- >- * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a> >- */ >- srcElement: null, >- >- >- /** >- * @property value >- * @description Object reference to the menu item's value. >- * @default null >- * @type Object >- */ >- value: null, >- >- >- /** >- * @property browser >- * @deprecated Use YAHOO.env.ua >- * @description String representing the browser. >- * @type String >- */ >- browser: Module.prototype.browser, >- >- >- /** >- * @property id >- * @description Id of the menu item's root <code><li></code> >- * element. This property should be set via the constructor using the >- * configuration object literal. If an id is not specified, then one will >- * be created using the "generateId" method of the Dom utility. >- * @default null >- * @type String >- */ >- id: null, >- >- >- >- // Events >- >- >- /** >- * @event destroyEvent >- * @description Fires when the menu item's <code><li></code> >- * element is removed from its parent <code><ul></code> element. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseOverEvent >- * @description Fires when the mouse has entered the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseOutEvent >- * @description Fires when the mouse has left the menu item. Passes back >- * the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseDownEvent >- * @description Fires when the user mouses down on the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseUpEvent >- * @description Fires when the user releases a mouse button while the mouse >- * is over the menu item. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event clickEvent >- * @description Fires when the user clicks the on the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyPressEvent >- * @description Fires when the user presses an alphanumeric key when the >- * menu item has focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyDownEvent >- * @description Fires when the user presses a key when the menu item has >- * focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyUpEvent >- * @description Fires when the user releases a key when the menu item has >- * focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event focusEvent >- * @description Fires when the menu item receives focus. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event blurEvent >- * @description Fires when the menu item loses the input focus. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @method init >- * @description The MenuItem class's initialization method. 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. >- * @param {String} p_oObject String specifying the text of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying >- * the <code><li></code> element of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >- * specifying the <code><optgroup></code> element of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object >- * specifying the <code><option></code> element of the menu item. >- * @param {Object} p_oConfig Optional. Object literal specifying the >- * configuration for the menu item. See configuration class documentation >- * for more details. >- */ >- init: function (p_oObject, p_oConfig) { >- >- >- if (!this.SUBMENU_TYPE) { >- >- this.SUBMENU_TYPE = Menu; >- >- } >- >- >- // Create the config object >- >- this.cfg = new YAHOO.util.Config(this); >- >- this.initDefaultConfig(); >- >- var oConfig = this.cfg, >- sURL = _HASH, >- oCustomEvent, >- aEventData, >- oAnchor, >- sTarget, >- sText, >- sId, >- i; >- >- >- if (Lang.isString(p_oObject)) { >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject); >- >- } >- else if (p_oObject && p_oObject.tagName) { >- >- switch(p_oObject.tagName.toUpperCase()) { >- >- case _OPTION: >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject.text); >- oConfig.queueProperty(_DISABLED, p_oObject.disabled); >- >- this.value = p_oObject.value; >- >- this.srcElement = p_oObject; >- >- break; >- >- case _OPTGROUP: >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject.label); >- oConfig.queueProperty(_DISABLED, p_oObject.disabled); >- >- this.srcElement = p_oObject; >- >- this._initSubTree(); >- >- break; >- >- case _LI_UPPERCASE: >- >- // Get the anchor node (if it exists) >- >- oAnchor = Dom.getFirstChild(p_oObject); >- >- >- // Capture the "text" and/or the "URL" >- >- if (oAnchor) { >- >- sURL = oAnchor.getAttribute(_HREF, 2); >- sTarget = oAnchor.getAttribute(_TARGET); >- >- sText = oAnchor.innerHTML; >- >- } >- >- this.srcElement = p_oObject; >- this.element = p_oObject; >- this._oAnchor = oAnchor; >- >- /* >- Set these properties silently to sync up the >- configuration object without making changes to the >- element's DOM >- */ >- >- oConfig.setProperty(_TEXT, sText, true); >- oConfig.setProperty(_URL, sURL, true); >- oConfig.setProperty(_TARGET, sTarget, true); >- >- this._initSubTree(); >- >- break; >- >- } >- >- } >- >- >- if (this.element) { >- >- sId = (this.srcElement || this.element).id; >- >- if (!sId) { >- >- sId = this.id || Dom.generateId(); >- >- this.element.id = sId; >- >- } >- >- this.id = sId; >- >- >- Dom.addClass(this.element, this.CSS_CLASS_NAME); >- Dom.addClass(this._oAnchor, this.CSS_LABEL_CLASS_NAME); >- >- >- i = EVENT_TYPES.length - 1; >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- oCustomEvent = this.createEvent(aEventData[1]); >- oCustomEvent.signature = CustomEvent.LIST; >- >- this[aEventData[0]] = oCustomEvent; >- >- } >- while (i--); >- >- >- if (p_oConfig) { >- >- oConfig.applyConfig(p_oConfig); >- >- } >- >- oConfig.fireQueue(); >- >- } >- >- }, >- >- >- >- // Private methods >- >- /** >- * @method _createRootNodeStructure >- * @description Creates the core DOM structure for the menu item. >- * @private >- */ >- _createRootNodeStructure: function () { >- >- var oElement, >- oAnchor; >- >- if (!m_oMenuItemTemplate) { >- >- m_oMenuItemTemplate = document.createElement(_LI_LOWERCASE); >- m_oMenuItemTemplate.innerHTML = _ANCHOR_TEMPLATE; >- >- } >- >- oElement = m_oMenuItemTemplate.cloneNode(true); >- oElement.className = this.CSS_CLASS_NAME; >- >- oAnchor = oElement.firstChild; >- oAnchor.className = this.CSS_LABEL_CLASS_NAME; >- >- this.element = oElement; >- this._oAnchor = oAnchor; >- >- }, >- >- >- /** >- * @method _initSubTree >- * @description Iterates the source element's childNodes collection and uses >- * the child nodes to instantiate other menus. >- * @private >- */ >- _initSubTree: function () { >- >- var oSrcEl = this.srcElement, >- oConfig = this.cfg, >- oNode, >- aOptions, >- nOptions, >- oMenu, >- n; >- >- >- if (oSrcEl.childNodes.length > 0) { >- >- if (this.parent.lazyLoad && this.parent.srcElement && >- this.parent.srcElement.tagName.toUpperCase() == _SELECT) { >- >- oConfig.setProperty( >- _SUBMENU, >- { id: Dom.generateId(), itemdata: oSrcEl.childNodes } >- ); >- >- } >- else { >- >- oNode = oSrcEl.firstChild; >- aOptions = []; >- >- do { >- >- if (oNode && oNode.tagName) { >- >- switch(oNode.tagName.toUpperCase()) { >- >- case _DIV: >- >- oConfig.setProperty(_SUBMENU, oNode); >- >- break; >- >- case _OPTION: >- >- aOptions[aOptions.length] = oNode; >- >- break; >- >- } >- >- } >- >- } >- while((oNode = oNode.nextSibling)); >- >- >- nOptions = aOptions.length; >- >- if (nOptions > 0) { >- >- oMenu = new this.SUBMENU_TYPE(Dom.generateId()); >- >- oConfig.setProperty(_SUBMENU, oMenu); >- >- for(n=0; n<nOptions; n++) { >- >- oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n]))); >- >- } >- >- } >- >- } >- >- } >- >- }, >- >- >- >- // Event handlers for configuration properties >- >- >- /** >- * @method configText >- * @description Event handler for when the "text" configuration property of >- * the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configText: function (p_sType, p_aArgs, p_oItem) { >- >- var sText = p_aArgs[0], >- oConfig = this.cfg, >- oAnchor = this._oAnchor, >- sHelpText = oConfig.getProperty(_HELP_TEXT), >- sHelpTextHTML = _EMPTY_STRING, >- sEmphasisStartTag = _EMPTY_STRING, >- sEmphasisEndTag = _EMPTY_STRING; >- >- >- if (sText) { >- >- >- if (sHelpText) { >- >- sHelpTextHTML = _START_HELP_TEXT + sHelpText + _END_EM; >- >- } >- >- >- if (oConfig.getProperty(_EMPHASIS)) { >- >- sEmphasisStartTag = _START_EM; >- sEmphasisEndTag = _END_EM; >- >- } >- >- >- if (oConfig.getProperty(_STRONG_EMPHASIS)) { >- >- sEmphasisStartTag = _START_STRONG; >- sEmphasisEndTag = _END_STRONG; >- >- } >- >- >- oAnchor.innerHTML = (sEmphasisStartTag + sText + sEmphasisEndTag + sHelpTextHTML); >- >- } >- >- }, >- >- >- /** >- * @method configHelpText >- * @description Event handler for when the "helptext" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configHelpText: function (p_sType, p_aArgs, p_oItem) { >- >- this.cfg.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configURL >- * @description Event handler for when the "url" configuration property of >- * the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configURL: function (p_sType, p_aArgs, p_oItem) { >- >- var sURL = p_aArgs[0]; >- >- if (!sURL) { >- >- sURL = _HASH; >- >- } >- >- var oAnchor = this._oAnchor; >- >- if (UA.opera) { >- >- oAnchor.removeAttribute(_HREF); >- >- } >- >- oAnchor.setAttribute(_HREF, sURL); >- >- }, >- >- >- /** >- * @method configTarget >- * @description Event handler for when the "target" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configTarget: function (p_sType, p_aArgs, p_oItem) { >- >- var sTarget = p_aArgs[0], >- oAnchor = this._oAnchor; >- >- if (sTarget && sTarget.length > 0) { >- >- oAnchor.setAttribute(_TARGET, sTarget); >- >- } >- else { >- >- oAnchor.removeAttribute(_TARGET); >- >- } >- >- }, >- >- >- /** >- * @method configEmphasis >- * @description Event handler for when the "emphasis" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configEmphasis: function (p_sType, p_aArgs, p_oItem) { >- >- var bEmphasis = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bEmphasis && oConfig.getProperty(_STRONG_EMPHASIS)) { >- >- oConfig.setProperty(_STRONG_EMPHASIS, false); >- >- } >- >- >- oConfig.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configStrongEmphasis >- * @description Event handler for when the "strongemphasis" configuration >- * property of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configStrongEmphasis: function (p_sType, p_aArgs, p_oItem) { >- >- var bStrongEmphasis = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bStrongEmphasis && oConfig.getProperty(_EMPHASIS)) { >- >- oConfig.setProperty(_EMPHASIS, false); >- >- } >- >- oConfig.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configChecked >- * @description Event handler for when the "checked" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configChecked: function (p_sType, p_aArgs, p_oItem) { >- >- var bChecked = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED); >- >- } >- else { >- >- removeClassNameForState.call(this, _CHECKED); >- } >- >- >- oConfig.refireEvent(_TEXT); >- >- >- if (oConfig.getProperty(_DISABLED)) { >- >- oConfig.refireEvent(_DISABLED); >- >- } >- >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.refireEvent(_SELECTED); >- >- } >- >- }, >- >- >- >- /** >- * @method configDisabled >- * @description Event handler for when the "disabled" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configDisabled: function (p_sType, p_aArgs, p_oItem) { >- >- var bDisabled = p_aArgs[0], >- oConfig = this.cfg, >- oSubmenu = oConfig.getProperty(_SUBMENU), >- bChecked = oConfig.getProperty(_CHECKED); >- >- >- if (bDisabled) { >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.setProperty(_SELECTED, false); >- >- } >- >- >- addClassNameForState.call(this, _DISABLED); >- >- >- if (oSubmenu) { >- >- addClassNameForState.call(this, _HAS_SUBMENU_DISABLED); >- >- } >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED_DISABLED); >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _DISABLED); >- >- >- if (oSubmenu) { >- >- removeClassNameForState.call(this, _HAS_SUBMENU_DISABLED); >- >- } >- >- >- if (bChecked) { >- >- removeClassNameForState.call(this, _CHECKED_DISABLED); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method configSelected >- * @description Event handler for when the "selected" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configSelected: function (p_sType, p_aArgs, p_oItem) { >- >- var oConfig = this.cfg, >- oAnchor = this._oAnchor, >- >- bSelected = p_aArgs[0], >- bChecked = oConfig.getProperty(_CHECKED), >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- >- if (UA.opera) { >- >- oAnchor.blur(); >- >- } >- >- >- if (bSelected && !oConfig.getProperty(_DISABLED)) { >- >- addClassNameForState.call(this, _SELECTED); >- >- >- if (oSubmenu) { >- >- addClassNameForState.call(this, _HAS_SUBMENU_SELECTED); >- >- } >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED_SELECTED); >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _SELECTED); >- >- >- if (oSubmenu) { >- >- removeClassNameForState.call(this, _HAS_SUBMENU_SELECTED); >- >- } >- >- >- if (bChecked) { >- >- removeClassNameForState.call(this, _CHECKED_SELECTED); >- >- } >- >- } >- >- >- if (this.hasFocus() && UA.opera) { >- >- oAnchor.focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onSubmenuBeforeHide >- * @description "beforehide" Custom Event handler for a submenu. >- * @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. >- */ >- _onSubmenuBeforeHide: function (p_sType, p_aArgs) { >- >- var oItem = this.parent, >- oMenu; >- >- function onHide() { >- >- oItem._oAnchor.blur(); >- oMenu.beforeHideEvent.unsubscribe(onHide); >- >- } >- >- >- if (oItem.hasFocus()) { >- >- oMenu = oItem.parent; >- >- oMenu.beforeHideEvent.subscribe(onHide); >- >- } >- >- }, >- >- >- /** >- * @method configSubmenu >- * @description Event handler for when the "submenu" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configSubmenu: function (p_sType, p_aArgs, p_oItem) { >- >- var oSubmenu = p_aArgs[0], >- oConfig = this.cfg, >- bLazyLoad = this.parent && this.parent.lazyLoad, >- oMenu, >- sSubmenuId, >- oSubmenuConfig; >- >- >- if (oSubmenu) { >- >- if (oSubmenu instanceof Menu) { >- >- oMenu = oSubmenu; >- oMenu.parent = this; >- oMenu.lazyLoad = bLazyLoad; >- >- } >- else if (Lang.isObject(oSubmenu) && oSubmenu.id && !oSubmenu.nodeType) { >- >- sSubmenuId = oSubmenu.id; >- oSubmenuConfig = oSubmenu; >- >- oSubmenuConfig.lazyload = bLazyLoad; >- oSubmenuConfig.parent = this; >- >- oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig); >- >- >- // Set the value of the property to the Menu instance >- >- oConfig.setProperty(_SUBMENU, oMenu, true); >- >- } >- else { >- >- oMenu = new this.SUBMENU_TYPE(oSubmenu, { lazyload: bLazyLoad, parent: this }); >- >- >- // Set the value of the property to the Menu instance >- >- oConfig.setProperty(_SUBMENU, oMenu, true); >- >- } >- >- >- if (oMenu) { >- >- oMenu.cfg.setProperty(_PREVENT_CONTEXT_OVERLAP, true); >- >- addClassNameForState.call(this, _HAS_SUBMENU); >- >- >- if (oConfig.getProperty(_URL) === _HASH) { >- >- oConfig.setProperty(_URL, (_HASH + oMenu.id)); >- >- } >- >- >- this._oSubmenu = oMenu; >- >- >- if (UA.opera) { >- >- oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide); >- >- } >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _HAS_SUBMENU); >- >- if (this._oSubmenu) { >- >- this._oSubmenu.destroy(); >- >- } >- >- } >- >- >- if (oConfig.getProperty(_DISABLED)) { >- >- oConfig.refireEvent(_DISABLED); >- >- } >- >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.refireEvent(_SELECTED); >- >- } >- >- }, >- >- >- /** >- * @method configOnClick >- * @description Event handler for when the "onclick" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configOnClick: function (p_sType, p_aArgs, p_oItem) { >- >- var oObject = p_aArgs[0]; >- >- /* >- Remove any existing listeners if a "click" event handler has >- already been specified. >- */ >- >- if (this._oOnclickAttributeValue && (this._oOnclickAttributeValue != oObject)) { >- >- this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, >- this._oOnclickAttributeValue.obj); >- >- this._oOnclickAttributeValue = null; >- >- } >- >- >- if (!this._oOnclickAttributeValue && Lang.isObject(oObject) && >- Lang.isFunction(oObject.fn)) { >- >- this.clickEvent.subscribe(oObject.fn, >- ((_OBJ in oObject) ? oObject.obj : this), >- ((_SCOPE in oObject) ? oObject.scope : null) ); >- >- this._oOnclickAttributeValue = oObject; >- >- } >- >- }, >- >- >- /** >- * @method configClassName >- * @description Event handler for when the "classname" configuration >- * property of a menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configClassName: function (p_sType, p_aArgs, p_oItem) { >- >- var sClassName = p_aArgs[0]; >- >- if (this._sClassName) { >- >- Dom.removeClass(this.element, this._sClassName); >- >- } >- >- Dom.addClass(this.element, sClassName); >- this._sClassName = sClassName; >- >- }, >- >- >- /** >- * @method _dispatchClickEvent >- * @description Dispatches a DOM "click" event to the anchor element of a >- * MenuItem instance. >- * @private >- */ >- _dispatchClickEvent: function () { >- >- var oMenuItem = this, >- oAnchor, >- oEvent; >- >- if (!oMenuItem.cfg.getProperty(_DISABLED)) { >- >- oAnchor = Dom.getFirstChild(oMenuItem.element); >- >- // Dispatch a "click" event to the MenuItem's anchor so that its >- // "click" event handlers will get called in response to the user >- // pressing the keyboard shortcut defined by the "keylistener" >- // configuration property. >- >- if (UA.ie) { >- oAnchor.fireEvent(_ONCLICK); >- } >- else { >- >- if ((UA.gecko && UA.gecko >= 1.9) || UA.opera || UA.webkit) { >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent(_CLICK, true, true); >- >- } >- else { >- >- oEvent = document.createEvent("MouseEvents"); >- oEvent.initMouseEvent(_CLICK, true, true, window, 0, 0, 0, >- 0, 0, false, false, false, false, 0, null); >- >- } >- >- oAnchor.dispatchEvent(oEvent); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _createKeyListener >- * @description "show" event handler for a Menu instance - responsible for >- * setting up the KeyListener instance for a MenuItem. >- * @private >- * @param {String} type String representing the name of the event that >- * was fired. >- * @param {Array} args Array of arguments sent when the event was fired. >- * @param {Array} keyData Array of arguments sent when the event was fired. >- */ >- _createKeyListener: function (type, args, keyData) { >- >- var oMenuItem = this, >- oMenu = oMenuItem.parent; >- >- var oKeyListener = new YAHOO.util.KeyListener( >- oMenu.element.ownerDocument, >- keyData, >- { >- fn: oMenuItem._dispatchClickEvent, >- scope: oMenuItem, >- correctScope: true }); >- >- >- if (oMenu.cfg.getProperty(_VISIBLE)) { >- oKeyListener.enable(); >- } >- >- >- oMenu.subscribe(_SHOW, oKeyListener.enable, null, oKeyListener); >- oMenu.subscribe(_HIDE, oKeyListener.disable, null, oKeyListener); >- >- oMenuItem._keyListener = oKeyListener; >- >- oMenu.unsubscribe(_SHOW, oMenuItem._createKeyListener, keyData); >- >- }, >- >- >- /** >- * @method configKeyListener >- * @description Event handler for when the "keylistener" configuration >- * property of a menu item changes. >- * @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. >- */ >- configKeyListener: function (p_sType, p_aArgs) { >- >- var oKeyData = p_aArgs[0], >- oMenuItem = this, >- oMenu = oMenuItem.parent; >- >- if (oMenuItem._keyData) { >- >- // Unsubscribe from the "show" event in case the keylistener >- // config was changed before the Menu was ever made visible. >- >- oMenu.unsubscribe(_SHOW, >- oMenuItem._createKeyListener, oMenuItem._keyData); >- >- oMenuItem._keyData = null; >- >- } >- >- >- // Tear down for the previous value of the "keylistener" property >- >- if (oMenuItem._keyListener) { >- >- oMenu.unsubscribe(_SHOW, oMenuItem._keyListener.enable); >- oMenu.unsubscribe(_HIDE, oMenuItem._keyListener.disable); >- >- oMenuItem._keyListener.disable(); >- oMenuItem._keyListener = null; >- >- } >- >- >- if (oKeyData) { >- >- oMenuItem._keyData = oKeyData; >- >- // Defer the creation of the KeyListener instance until the >- // parent Menu is visible. This is necessary since the >- // KeyListener instance needs to be bound to the document the >- // Menu has been rendered into. Deferring creation of the >- // KeyListener instance also improves performance. >- >- oMenu.subscribe(_SHOW, oMenuItem._createKeyListener, >- oKeyData, oMenuItem); >- } >- >- }, >- >- >- // Public methods >- >- >- /** >- * @method initDefaultConfig >- * @description Initializes an item's configurable properties. >- */ >- initDefaultConfig : function () { >- >- var oConfig = this.cfg; >- >- >- // Define the configuration attributes >- >- /** >- * @config text >- * @description String specifying the text label for the menu item. >- * When building a menu from existing HTML the value of this property >- * will be interpreted from the menu's markup. >- * @default "" >- * @type String >- */ >- oConfig.addProperty( >- TEXT_CONFIG.key, >- { >- handler: this.configText, >- value: TEXT_CONFIG.value, >- validator: TEXT_CONFIG.validator, >- suppressEvent: TEXT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config helptext >- * @description String specifying additional instructional text to >- * accompany the text for the menu item. >- * @deprecated Use "text" configuration property to add help text markup. >- * For example: <code>oMenuItem.cfg.setProperty("text", "Copy <em >- * class=\"helptext\">Ctrl + C</em>");</code> >- * @default null >- * @type String|<a href="http://www.w3.org/TR/ >- * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037"> >- * HTMLElement</a> >- */ >- oConfig.addProperty( >- HELP_TEXT_CONFIG.key, >- { >- handler: this.configHelpText, >- supercedes: HELP_TEXT_CONFIG.supercedes, >- suppressEvent: HELP_TEXT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config url >- * @description String specifying the URL for the menu item's anchor's >- * "href" attribute. When building a menu from existing HTML the value >- * of this property will be interpreted from the menu's markup. >- * @default "#" >- * @type String >- */ >- oConfig.addProperty( >- URL_CONFIG.key, >- { >- handler: this.configURL, >- value: URL_CONFIG.value, >- suppressEvent: URL_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config target >- * @description String specifying the value for the "target" attribute >- * of the menu item's anchor element. <strong>Specifying a target will >- * require the user to click directly on the menu item's anchor node in >- * order to cause the browser to navigate to the specified URL.</strong> >- * When building a menu from existing HTML the value of this property >- * will be interpreted from the menu's markup. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- TARGET_CONFIG.key, >- { >- handler: this.configTarget, >- suppressEvent: TARGET_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config emphasis >- * @description Boolean indicating if the text of the menu item will be >- * rendered with emphasis. >- * @deprecated Use the "text" configuration property to add emphasis. >- * For example: <code>oMenuItem.cfg.setProperty("text", "<em>Some >- * Text</em>");</code> >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- EMPHASIS_CONFIG.key, >- { >- handler: this.configEmphasis, >- value: EMPHASIS_CONFIG.value, >- validator: EMPHASIS_CONFIG.validator, >- suppressEvent: EMPHASIS_CONFIG.suppressEvent, >- supercedes: EMPHASIS_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config strongemphasis >- * @description Boolean indicating if the text of the menu item will be >- * rendered with strong emphasis. >- * @deprecated Use the "text" configuration property to add strong emphasis. >- * For example: <code>oMenuItem.cfg.setProperty("text", "<strong> >- * Some Text</strong>");</code> >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- STRONG_EMPHASIS_CONFIG.key, >- { >- handler: this.configStrongEmphasis, >- value: STRONG_EMPHASIS_CONFIG.value, >- validator: STRONG_EMPHASIS_CONFIG.validator, >- suppressEvent: STRONG_EMPHASIS_CONFIG.suppressEvent, >- supercedes: STRONG_EMPHASIS_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config checked >- * @description Boolean indicating if the menu item should be rendered >- * with a checkmark. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- CHECKED_CONFIG.key, >- { >- handler: this.configChecked, >- value: CHECKED_CONFIG.value, >- validator: CHECKED_CONFIG.validator, >- suppressEvent: CHECKED_CONFIG.suppressEvent, >- supercedes: CHECKED_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config disabled >- * @description Boolean indicating if the menu item should be disabled. >- * (Disabled menu items are dimmed and will not respond to user input >- * or fire events.) >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- DISABLED_CONFIG.key, >- { >- handler: this.configDisabled, >- value: DISABLED_CONFIG.value, >- validator: DISABLED_CONFIG.validator, >- suppressEvent: DISABLED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config selected >- * @description Boolean indicating if the menu item should >- * be highlighted. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- SELECTED_CONFIG.key, >- { >- handler: this.configSelected, >- value: SELECTED_CONFIG.value, >- validator: SELECTED_CONFIG.validator, >- suppressEvent: SELECTED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenu >- * @description Object specifying the submenu to be appended to the >- * menu item. The value can be one of the following: <ul><li>Object >- * specifying a Menu instance.</li><li>Object literal specifying the >- * menu to be created. Format: <code>{ id: [menu id], itemdata: >- * [<a href="YAHOO.widget.Menu.html#itemData">array of values for >- * items</a>] }</code>.</li><li>String specifying the id attribute >- * of the <code><div></code> element of the menu.</li><li> >- * Object specifying the <code><div></code> element of the >- * menu.</li></ul> >- * @default null >- * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/ >- * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037"> >- * HTMLElement</a> >- */ >- oConfig.addProperty( >- SUBMENU_CONFIG.key, >- { >- handler: this.configSubmenu, >- supercedes: SUBMENU_CONFIG.supercedes, >- suppressEvent: SUBMENU_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config onclick >- * @description Object literal representing the code to be executed when >- * the item 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 >- */ >- oConfig.addProperty( >- ONCLICK_CONFIG.key, >- { >- handler: this.configOnClick, >- suppressEvent: ONCLICK_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config classname >- * @description CSS class to be applied to the menu item's root >- * <code><li></code> element. The specified class(es) are >- * appended in addition to the default class as specified by the menu >- * item's CSS_CLASS_NAME constant. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- CLASS_NAME_CONFIG.key, >- { >- handler: this.configClassName, >- value: CLASS_NAME_CONFIG.value, >- validator: CLASS_NAME_CONFIG.validator, >- suppressEvent: CLASS_NAME_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config keylistener >- * @description Object literal representing the key(s) that can be used >- * to trigger the MenuItem's "click" event. Possible attributes are >- * shift (boolean), alt (boolean), ctrl (boolean) and keys (either an int >- * or an array of ints representing keycodes). >- * @default null >- * @type Object >- */ >- oConfig.addProperty( >- KEY_LISTENER_CONFIG.key, >- { >- handler: this.configKeyListener, >- value: KEY_LISTENER_CONFIG.value, >- suppressEvent: KEY_LISTENER_CONFIG.suppressEvent >- } >- ); >- >- }, >- >- /** >- * @method getNextSibling >- * @description Finds the menu item's next sibling. >- * @return YAHOO.widget.MenuItem >- */ >- getNextSibling: function () { >- >- var isUL = function (el) { >- return (el.nodeName.toLowerCase() === "ul"); >- }, >- >- menuitemEl = this.element, >- next = Dom.getNextSibling(menuitemEl), >- parent, >- sibling, >- list; >- >- if (!next) { >- >- parent = menuitemEl.parentNode; >- sibling = Dom.getNextSiblingBy(parent, isUL); >- >- if (sibling) { >- list = sibling; >- } >- else { >- list = Dom.getFirstChildBy(parent.parentNode, isUL); >- } >- >- next = Dom.getFirstChild(list); >- >- } >- >- return YAHOO.widget.MenuManager.getMenuItem(next.id); >- >- }, >- >- /** >- * @method getNextEnabledSibling >- * @description Finds the menu item's next enabled sibling. >- * @return YAHOO.widget.MenuItem >- */ >- getNextEnabledSibling: function () { >- >- var next = this.getNextSibling(); >- >- return (next.cfg.getProperty(_DISABLED) || next.element.style.display == _NONE) ? next.getNextEnabledSibling() : next; >- >- }, >- >- >- /** >- * @method getPreviousSibling >- * @description Finds the menu item's previous sibling. >- * @return {YAHOO.widget.MenuItem} >- */ >- getPreviousSibling: function () { >- >- var isUL = function (el) { >- return (el.nodeName.toLowerCase() === "ul"); >- }, >- >- menuitemEl = this.element, >- next = Dom.getPreviousSibling(menuitemEl), >- parent, >- sibling, >- list; >- >- if (!next) { >- >- parent = menuitemEl.parentNode; >- sibling = Dom.getPreviousSiblingBy(parent, isUL); >- >- if (sibling) { >- list = sibling; >- } >- else { >- list = Dom.getLastChildBy(parent.parentNode, isUL); >- } >- >- next = Dom.getLastChild(list); >- >- } >- >- return YAHOO.widget.MenuManager.getMenuItem(next.id); >- >- }, >- >- >- /** >- * @method getPreviousEnabledSibling >- * @description Finds the menu item's previous enabled sibling. >- * @return {YAHOO.widget.MenuItem} >- */ >- getPreviousEnabledSibling: function () { >- >- var next = this.getPreviousSibling(); >- >- return (next.cfg.getProperty(_DISABLED) || next.element.style.display == _NONE) ? next.getPreviousEnabledSibling() : next; >- >- }, >- >- >- /** >- * @method focus >- * @description Causes the menu item to receive the focus and fires the >- * focus event. >- */ >- focus: function () { >- >- var oParent = this.parent, >- oAnchor = this._oAnchor, >- oActiveItem = oParent.activeItem; >- >- >- function setFocus() { >- >- try { >- >- if (!(UA.ie && !document.hasFocus())) { >- >- if (oActiveItem) { >- >- oActiveItem.blurEvent.fire(); >- >- } >- >- oAnchor.focus(); >- >- this.focusEvent.fire(); >- >- } >- >- } >- catch(e) { >- >- } >- >- } >- >- >- if (!this.cfg.getProperty(_DISABLED) && oParent && oParent.cfg.getProperty(_VISIBLE) && >- this.element.style.display != _NONE) { >- >- >- /* >- Setting focus via a timer fixes a race condition in Firefox, IE >- and Opera where the browser viewport jumps as it trys to >- position and focus the menu. >- */ >- >- Lang.later(0, this, setFocus); >- >- } >- >- }, >- >- >- /** >- * @method blur >- * @description Causes the menu item to lose focus and fires the >- * blur event. >- */ >- blur: function () { >- >- var oParent = this.parent; >- >- if (!this.cfg.getProperty(_DISABLED) && oParent && oParent.cfg.getProperty(_VISIBLE)) { >- >- Lang.later(0, this, function () { >- >- try { >- >- this._oAnchor.blur(); >- this.blurEvent.fire(); >- >- } >- catch (e) { >- >- } >- >- }, 0); >- >- } >- >- }, >- >- >- /** >- * @method hasFocus >- * @description Returns a boolean indicating whether or not the menu item >- * has focus. >- * @return {Boolean} >- */ >- hasFocus: function () { >- >- return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this); >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the menu item's <code><li></code> element >- * from its parent <code><ul></code> element. >- */ >- destroy: function () { >- >- var oEl = this.element, >- oSubmenu, >- oParentNode, >- aEventData, >- i; >- >- >- if (oEl) { >- >- >- // If the item has a submenu, destroy it first >- >- oSubmenu = this.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.destroy(); >- >- } >- >- >- // Remove the element from the parent node >- >- oParentNode = oEl.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oEl); >- >- this.destroyEvent.fire(); >- >- } >- >- >- // Remove CustomEvent listeners >- >- i = EVENT_TYPES.length - 1; >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- this[aEventData[0]].unsubscribeAll(); >- >- } >- while (i--); >- >- >- this.cfg.configChangedEvent.unsubscribeAll(); >- >- } >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the menu item. >- * @return {String} >- */ >- toString: function () { >- >- var sReturnVal = _MENUITEM, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >- } >- >-}; >- >-Lang.augmentProto(MenuItem, YAHOO.util.EventProvider); >- >-})(); >-(function () { >- >- var _XY = "xy", >- _MOUSEDOWN = "mousedown", >- _CONTEXTMENU = "ContextMenu", >- _SPACE = " "; >- >-/** >-* Creates a list of options or commands which are made visible in response to >-* an HTML element's "contextmenu" event ("mousedown" for Opera). >-* >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the context menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* context menu. >-* @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 context menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying >-* the <code><select></code> element to be used as the data source for >-* the context menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu. See configuration class documentation >-* for more details. >-* @class ContextMenu >-* @constructor >-* @extends YAHOO.widget.Menu >-* @namespace YAHOO.widget >-*/ >-YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) { >- >- YAHOO.widget.ContextMenu.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >-var Event = YAHOO.util.Event, >- UA = YAHOO.env.ua, >- ContextMenu = YAHOO.widget.ContextMenu, >- >- >- >- /** >- * Constant representing the name of the ContextMenu's events >- * @property EVENT_TYPES >- * @private >- * @final >- * @type Object >- */ >- EVENT_TYPES = { >- >- "TRIGGER_CONTEXT_MENU": "triggerContextMenu", >- "CONTEXT_MENU": (UA.opera ? _MOUSEDOWN : "contextmenu"), >- "CLICK": "click" >- >- }, >- >- >- /** >- * Constant representing the ContextMenu's configuration properties >- * @property DEFAULT_CONFIG >- * @private >- * @final >- * @type Object >- */ >- TRIGGER_CONFIG = { >- key: "trigger", >- suppressEvent: true >- }; >- >- >-/** >-* @method position >-* @description "beforeShow" event handler used to position the contextmenu. >-* @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 {Array} p_aPos Array representing the xy position for the context menu. >-*/ >-function position(p_sType, p_aArgs, p_aPos) { >- >- this.cfg.setProperty(_XY, p_aPos); >- >- this.beforeShowEvent.unsubscribe(position, p_aPos); >- >-} >- >- >-YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, { >- >- >- >-// Private properties >- >- >-/** >-* @property _oTrigger >-* @description Object reference to the current value of the "trigger" >-* configuration property. >-* @default null >-* @private >-* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve >-* l-one-html.html#ID-58190037">HTMLElement</a>|Array >-*/ >-_oTrigger: null, >- >- >-/** >-* @property _bCancelled >-* @description Boolean indicating if the display of the context menu should >-* be cancelled. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bCancelled: false, >- >- >- >-// Public properties >- >- >-/** >-* @property contextEventTarget >-* @description Object reference for the HTML element that was the target of the >-* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of >-* the context menu. >-* @default null >-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-58190037">HTMLElement</a> >-*/ >-contextEventTarget: null, >- >- >- >-// Events >- >- >-/** >-* @event triggerContextMenuEvent >-* @description Custom Event wrapper for the "contextmenu" DOM event >-* ("mousedown" for Opera) fired by the element(s) that trigger the display of >-* the context menu. >-*/ >-triggerContextMenuEvent: null, >- >- >- >-/** >-* @method init >-* @description The ContextMenu class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the context menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for >-* the context menu. >-* @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 context menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying >-* the <code><select></code> element to be used as the data source for >-* the context menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu. See configuration class documentation >-* for more details. >-*/ >-init: function(p_oElement, p_oConfig) { >- >- >- // Call the init of the superclass (YAHOO.widget.Menu) >- >- ContextMenu.superclass.init.call(this, p_oElement); >- >- >- this.beforeInitEvent.fire(ContextMenu); >- >- >- if (p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- this.initEvent.fire(ContextMenu); >- >-}, >- >- >-/** >-* @method initEvents >-* @description Initializes the custom events for the context menu. >-*/ >-initEvents: function() { >- >- ContextMenu.superclass.initEvents.call(this); >- >- // Create custom events >- >- this.triggerContextMenuEvent = this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU); >- >- this.triggerContextMenuEvent.signature = YAHOO.util.CustomEvent.LIST; >- >-}, >- >- >-/** >-* @method cancel >-* @description Cancels the display of the context menu. >-*/ >-cancel: function() { >- >- this._bCancelled = true; >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _removeEventHandlers >-* @description Removes all of the DOM event handlers from the HTML element(s) >-* whose "context menu" event ("click" for Opera) trigger the display of >-* the context menu. >-* @private >-*/ >-_removeEventHandlers: function() { >- >- var oTrigger = this._oTrigger; >- >- >- // Remove the event handlers from the trigger(s) >- >- if (oTrigger) { >- >- Event.removeListener(oTrigger, EVENT_TYPES.CONTEXT_MENU, this._onTriggerContextMenu); >- >- if (UA.opera) { >- >- Event.removeListener(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick); >- >- } >- >- } >- >-}, >- >- >- >-// Private event handlers >- >- >- >-/** >-* @method _onTriggerClick >-* @description "click" event handler for the HTML element(s) identified as the >-* "trigger" for the context menu. Used to cancel default behaviors in Opera. >-* @private >-* @param {Event} p_oEvent Object representing the DOM event object passed back >-* by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that is handling the event. >-*/ >-_onTriggerClick: function(p_oEvent, p_oMenu) { >- >- if (p_oEvent.ctrlKey) { >- >- Event.stopEvent(p_oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onTriggerContextMenu >-* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML >-* element(s) that trigger the display of the context menu. >-* @private >-* @param {Event} p_oEvent Object representing the DOM event object passed back >-* by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that is handling the event. >-*/ >-_onTriggerContextMenu: function(p_oEvent, p_oMenu) { >- >- var aXY; >- >- if (!(p_oEvent.type == _MOUSEDOWN && !p_oEvent.ctrlKey)) { >- >- this.contextEventTarget = Event.getTarget(p_oEvent); >- >- this.triggerContextMenuEvent.fire(p_oEvent); >- >- >- if (!this._bCancelled) { >- >- /* >- Prevent the browser's default context menu from appearing and >- stop the propagation of the "contextmenu" event so that >- other ContextMenu instances are not displayed. >- */ >- >- Event.stopEvent(p_oEvent); >- >- >- // Hide any other Menu instances that might be visible >- >- YAHOO.widget.MenuManager.hideVisible(); >- >- >- >- // Position and display the context menu >- >- aXY = Event.getXY(p_oEvent); >- >- >- if (!YAHOO.util.Dom.inDocument(this.element)) { >- >- this.beforeShowEvent.subscribe(position, aXY); >- >- } >- else { >- >- this.cfg.setProperty(_XY, aXY); >- >- } >- >- >- this.show(); >- >- } >- >- this._bCancelled = false; >- >- } >- >-}, >- >- >- >-// Public methods >- >- >-/** >-* @method toString >-* @description Returns a string representing the context menu. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = _CONTEXTMENU, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @method initDefaultConfig >-* @description Initializes the class's configurable properties which can be >-* changed using the context menu's Config object ("cfg"). >-*/ >-initDefaultConfig: function() { >- >- ContextMenu.superclass.initDefaultConfig.call(this); >- >- /** >- * @config trigger >- * @description The HTML element(s) whose "contextmenu" event ("mousedown" >- * for Opera) trigger the display of the context menu. Can be a string >- * representing the id attribute of the HTML element, an object reference >- * for the HTML element, or an array of strings or HTML element references. >- * @default null >- * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|Array >- */ >- this.cfg.addProperty(TRIGGER_CONFIG.key, >- { >- handler: this.configTrigger, >- suppressEvent: TRIGGER_CONFIG.suppressEvent >- } >- ); >- >-}, >- >- >-/** >-* @method destroy >-* @description Removes the context menu's <code><div></code> element >-* (and accompanying child nodes) from the document. >-*/ >-destroy: function() { >- >- // Remove the DOM event handlers from the current trigger(s) >- >- this._removeEventHandlers(); >- >- >- // Continue with the superclass implementation of this method >- >- ContextMenu.superclass.destroy.call(this); >- >-}, >- >- >- >-// Public event handlers for configuration properties >- >- >-/** >-* @method configTrigger >-* @description Event handler for when the value of the "trigger" configuration >-* property changes. >-* @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 {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that fired the event. >-*/ >-configTrigger: function(p_sType, p_aArgs, p_oMenu) { >- >- var oTrigger = p_aArgs[0]; >- >- if (oTrigger) { >- >- /* >- If there is a current "trigger" - remove the event handlers >- from that element(s) before assigning new ones >- */ >- >- if (this._oTrigger) { >- >- this._removeEventHandlers(); >- >- } >- >- this._oTrigger = oTrigger; >- >- >- /* >- Listen for the "mousedown" event in Opera b/c it does not >- support the "contextmenu" event >- */ >- >- Event.on(oTrigger, EVENT_TYPES.CONTEXT_MENU, this._onTriggerContextMenu, this, true); >- >- >- /* >- Assign a "click" event handler to the trigger element(s) for >- Opera to prevent default browser behaviors. >- */ >- >- if (UA.opera) { >- >- Event.on(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick, this, true); >- >- } >- >- } >- else { >- >- this._removeEventHandlers(); >- >- } >- >-} >- >-}); // END YAHOO.lang.extend >- >-}()); >- >- >- >-/** >-* Creates an item for a context menu. >-* >-* @param {String} p_oObject String specifying the text of the context menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the context menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the context >-* menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the context menu item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu item. See configuration class >-* documentation for more details. >-* @class ContextMenuItem >-* @constructor >-* @extends YAHOO.widget.MenuItem >-* @deprecated As of version 2.4.0 items for YAHOO.widget.ContextMenu instances >-* are of type YAHOO.widget.MenuItem. >-*/ >-YAHOO.widget.ContextMenuItem = YAHOO.widget.MenuItem; >-(function () { >- >- var Lang = YAHOO.lang, >- >- // String constants >- >- _STATIC = "static", >- _DYNAMIC_STATIC = "dynamic," + _STATIC, >- _DISABLED = "disabled", >- _SELECTED = "selected", >- _AUTO_SUBMENU_DISPLAY = "autosubmenudisplay", >- _SUBMENU = "submenu", >- _VISIBLE = "visible", >- _SPACE = " ", >- _SUBMENU_TOGGLE_REGION = "submenutoggleregion", >- _MENUBAR = "MenuBar"; >- >-/** >-* Horizontal collection of items, each of which can contain a submenu. >-* >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu bar. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* menu bar. >-* @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 menu bar. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object >-* specifying the <code><select></code> element to be used as the data >-* source for the menu bar. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar. See configuration class documentation for >-* more details. >-* @class MenuBar >-* @constructor >-* @extends YAHOO.widget.Menu >-* @namespace YAHOO.widget >-*/ >-YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) { >- >- YAHOO.widget.MenuBar.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >-/** >-* @method checkPosition >-* @description Checks to make sure that the value of the "position" property >-* is one of the supported strings. Returns true if the position is supported. >-* @private >-* @param {Object} p_sPosition String specifying the position of the menu. >-* @return {Boolean} >-*/ >-function checkPosition(p_sPosition) { >- >- var returnVal = false; >- >- if (Lang.isString(p_sPosition)) { >- >- returnVal = (_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase())) != -1); >- >- } >- >- return returnVal; >- >-} >- >- >-var Event = YAHOO.util.Event, >- MenuBar = YAHOO.widget.MenuBar, >- >- POSITION_CONFIG = { >- key: "position", >- value: _STATIC, >- validator: checkPosition, >- supercedes: [_VISIBLE] >- }, >- >- SUBMENU_ALIGNMENT_CONFIG = { >- key: "submenualignment", >- value: ["tl","bl"] >- }, >- >- AUTO_SUBMENU_DISPLAY_CONFIG = { >- key: _AUTO_SUBMENU_DISPLAY, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SUBMENU_TOGGLE_REGION_CONFIG = { >- key: _SUBMENU_TOGGLE_REGION, >- value: false, >- validator: Lang.isBoolean >- }; >- >- >- >-Lang.extend(MenuBar, YAHOO.widget.Menu, { >- >-/** >-* @method init >-* @description The MenuBar class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu bar. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* menu bar. >-* @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 menu bar. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object >-* specifying the <code><select></code> element to be used as the data >-* source for the menu bar. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar. See configuration class documentation for >-* more details. >-*/ >-init: function(p_oElement, p_oConfig) { >- >- if(!this.ITEM_TYPE) { >- >- this.ITEM_TYPE = YAHOO.widget.MenuBarItem; >- >- } >- >- >- // Call the init of the superclass (YAHOO.widget.Menu) >- >- MenuBar.superclass.init.call(this, p_oElement); >- >- >- this.beforeInitEvent.fire(MenuBar); >- >- >- if(p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- this.initEvent.fire(MenuBar); >- >-}, >- >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the menu >-* bar's <code><div></code> element. >-* @default "yuimenubar" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenubar", >- >- >-/** >-* @property SUBMENU_TOGGLE_REGION_WIDTH >-* @description Width (in pixels) of the area of a MenuBarItem that, when pressed, will toggle the >-* display of the MenuBarItem's submenu. >-* @default 20 >-* @final >-* @type Number >-*/ >-SUBMENU_TOGGLE_REGION_WIDTH: 20, >- >- >-// Protected event handlers >- >- >-/** >-* @method _onKeyDown >-* @description "keydown" Custom Event handler for the menu bar. >-* @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 {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar >-* that fired the event. >-*/ >-_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oSubmenu, >- oItemCfg, >- oNextItem; >- >- >- if(oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- >- switch(oEvent.keyCode) { >- >- case 37: // Left arrow >- case 39: // Right arrow >- >- if(oItem == this.activeItem && !oItemCfg.getProperty(_SELECTED)) { >- >- oItemCfg.setProperty(_SELECTED, true); >- >- } >- else { >- >- oNextItem = (oEvent.keyCode == 37) ? >- oItem.getPreviousEnabledSibling() : >- oItem.getNextEnabledSibling(); >- >- if(oNextItem) { >- >- this.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if(oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- oNextItem.focus(); >- } >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- break; >- >- case 40: // Down arrow >- >- if(this.activeItem != oItem) { >- >- this.clearActiveItem(); >- >- oItemCfg.setProperty(_SELECTED, true); >- oItem.focus(); >- >- } >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if(oSubmenu) { >- >- if(oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.setInitialSelection(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- break; >- >- } >- >- } >- >- >- if(oEvent.keyCode == 27 && this.activeItem) { // Esc key >- >- oSubmenu = this.activeItem.cfg.getProperty(_SUBMENU); >- >- if(oSubmenu && oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- this.activeItem.focus(); >- >- } >- else { >- >- this.activeItem.cfg.setProperty(_SELECTED, false); >- this.activeItem.blur(); >- >- } >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onClick >-* @description "click" event handler for the menu bar. >-* @protected >-* @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 {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar >-* that fired the event. >-*/ >-_onClick: function(p_sType, p_aArgs, p_oMenuBar) { >- >- MenuBar.superclass._onClick.call(this, p_sType, p_aArgs, p_oMenuBar); >- >- var oItem = p_aArgs[1], >- bReturnVal = true, >- oItemEl, >- oEvent, >- oTarget, >- oActiveItem, >- oConfig, >- oSubmenu, >- nMenuItemX, >- nToggleRegion; >- >- >- var toggleSubmenuDisplay = function () { >- >- if(oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- >- } >- else { >- >- oSubmenu.show(); >- >- } >- >- }; >- >- >- if(oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oEvent = p_aArgs[0]; >- oTarget = Event.getTarget(oEvent); >- oActiveItem = this.activeItem; >- oConfig = this.cfg; >- >- >- // Hide any other submenus that might be visible >- >- if(oActiveItem && oActiveItem != oItem) { >- >- this.clearActiveItem(); >- >- } >- >- >- oItem.cfg.setProperty(_SELECTED, true); >- >- >- // Show the submenu for the item >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- >- if(oSubmenu) { >- >- oItemEl = oItem.element; >- nMenuItemX = YAHOO.util.Dom.getX(oItemEl); >- nToggleRegion = nMenuItemX + (oItemEl.offsetWidth - this.SUBMENU_TOGGLE_REGION_WIDTH); >- >- if (oConfig.getProperty(_SUBMENU_TOGGLE_REGION)) { >- >- if (Event.getPageX(oEvent) > nToggleRegion) { >- >- toggleSubmenuDisplay(); >- >- Event.preventDefault(oEvent); >- >- /* >- Return false so that other click event handlers are not called when the >- user clicks inside the toggle region. >- */ >- bReturnVal = false; >- >- } >- >- } >- else { >- >- toggleSubmenuDisplay(); >- >- } >- >- } >- >- } >- >- >- return bReturnVal; >- >-}, >- >- >- >-// Public methods >- >-/** >-* @method configSubmenuToggle >-* @description Event handler for when the "submenutoggleregion" configuration property of >-* a MenuBar changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-*/ >-configSubmenuToggle: function (p_sType, p_aArgs) { >- >- var bSubmenuToggle = p_aArgs[0]; >- >- if (bSubmenuToggle) { >- >- this.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, false); >- >- } >- >-}, >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu bar. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = _MENUBAR, >- sId = this.id; >- >- if(sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @description Initializes the class's configurable properties which can be >-* changed using the menu bar's Config object ("cfg"). >-* @method initDefaultConfig >-*/ >-initDefaultConfig: function() { >- >- MenuBar.superclass.initDefaultConfig.call(this); >- >- var oConfig = this.cfg; >- >- // Add configuration properties >- >- >- /* >- Set the default value for the "position" configuration property >- to "static" by re-adding the property. >- */ >- >- >- /** >- * @config position >- * @description String indicating how a menu bar should be positioned on the >- * screen. Possible values are "static" and "dynamic." Static menu bars >- * are visible by default and reside in the normal flow of the document >- * (CSS position: static). Dynamic menu bars are hidden by default, reside >- * out of the normal flow of the document (CSS position: absolute), and can >- * overlay other elements on the screen. >- * @default static >- * @type String >- */ >- oConfig.addProperty( >- POSITION_CONFIG.key, >- { >- handler: this.configPosition, >- value: POSITION_CONFIG.value, >- validator: POSITION_CONFIG.validator, >- supercedes: POSITION_CONFIG.supercedes >- } >- ); >- >- >- /* >- Set the default value for the "submenualignment" configuration property >- to ["tl","bl"] by re-adding the property. >- */ >- >- /** >- * @config submenualignment >- * @description Array defining how submenus should be aligned to their >- * parent menu bar item. The format is: [itemCorner, submenuCorner]. >- * @default ["tl","bl"] >- * @type Array >- */ >- oConfig.addProperty( >- SUBMENU_ALIGNMENT_CONFIG.key, >- { >- value: SUBMENU_ALIGNMENT_CONFIG.value, >- suppressEvent: SUBMENU_ALIGNMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /* >- Change the default value for the "autosubmenudisplay" configuration >- property to "false" by re-adding the property. >- */ >- >- /** >- * @config autosubmenudisplay >- * @description Boolean indicating if submenus are automatically made >- * visible when the user mouses over the menu bar's items. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- AUTO_SUBMENU_DISPLAY_CONFIG.key, >- { >- value: AUTO_SUBMENU_DISPLAY_CONFIG.value, >- validator: AUTO_SUBMENU_DISPLAY_CONFIG.validator, >- suppressEvent: AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenutoggleregion >- * @description Boolean indicating if only a specific region of a MenuBarItem should toggle the >- * display of a submenu. The default width of the region is determined by the value of the >- * SUBMENU_TOGGLE_REGION_WIDTH property. If set to true, the autosubmenudisplay >- * configuration property will be set to false, and any click event listeners will not be >- * called when the user clicks inside the submenu toggle region of a MenuBarItem. If the >- * user clicks outside of the submenu toggle region, the MenuBarItem will maintain its >- * standard behavior. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- SUBMENU_TOGGLE_REGION_CONFIG.key, >- { >- value: SUBMENU_TOGGLE_REGION_CONFIG.value, >- validator: SUBMENU_TOGGLE_REGION_CONFIG.validator, >- handler: this.configSubmenuToggle >- } >- ); >- >-} >- >-}); // END YAHOO.lang.extend >- >-}()); >- >- >- >-/** >-* Creates an item for a menu bar. >-* >-* @param {String} p_oObject String specifying the text of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the menu bar item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar item. See configuration class documentation >-* for more details. >-* @class MenuBarItem >-* @constructor >-* @extends YAHOO.widget.MenuItem >-*/ >-YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) { >- >- YAHOO.widget.MenuBarItem.superclass.constructor.call(this, p_oObject, p_oConfig); >- >-}; >- >-YAHOO.lang.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, { >- >- >- >-/** >-* @method init >-* @description The MenuBarItem class's initialization method. 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. >-* @param {String} p_oObject String specifying the text of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the menu bar item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar item. See configuration class documentation >-* for more details. >-*/ >-init: function(p_oObject, p_oConfig) { >- >- if(!this.SUBMENU_TYPE) { >- >- this.SUBMENU_TYPE = YAHOO.widget.Menu; >- >- } >- >- >- /* >- Call the init of the superclass (YAHOO.widget.MenuItem) >- Note: We don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject); >- >- >- var oConfig = this.cfg; >- >- if(p_oConfig) { >- >- oConfig.applyConfig(p_oConfig, true); >- >- } >- >- oConfig.fireQueue(); >- >-}, >- >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* <code><li></code> element of the menu bar item. >-* @default "yuimenubaritem" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenubaritem", >- >- >-/** >-* @property CSS_LABEL_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* menu bar item's <code><a></code> element. >-* @default "yuimenubaritemlabel" >-* @final >-* @type String >-*/ >-CSS_LABEL_CLASS_NAME: "yuimenubaritemlabel", >- >- >- >-// Public methods >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu bar item. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = "MenuBarItem"; >- >- if(this.cfg && this.cfg.getProperty("text")) { >- >- sReturnVal += (": " + this.cfg.getProperty("text")); >- >- } >- >- return sReturnVal; >- >-} >- >-}); // END YAHOO.lang.extend >-YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-min.js b/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-min.js >deleted file mode 100644 >index 06de5e35bf..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu-min.js >+++ /dev/null >@@ -1,16 +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 K=YAHOO.env.ua,C=YAHOO.util.Dom,Z=YAHOO.util.Event,H=YAHOO.lang,T="DIV",P="hd",M="bd",O="ft",X="LI",A="disabled",D="mouseover",F="mouseout",U="mousedown",G="mouseup",V="click",B="keydown",N="keyup",I="keypress",L="clicktohide",S="position",Q="dynamic",Y="showdelay",J="selected",E="visible",W="UL",R="MenuManager";YAHOO.widget.MenuManager=function(){var l=false,d={},o={},h={},c={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent","focus":"focusEvent","focusin":"focusEvent","blur":"blurEvent","focusout":"blurEvent"},i=null;function b(r){var p,q;if(r&&r.tagName){switch(r.tagName.toUpperCase()){case T:p=r.parentNode;if((C.hasClass(r,P)||C.hasClass(r,M)||C.hasClass(r,O))&&p&&p.tagName&&p.tagName.toUpperCase()==T){q=p;}else{q=r;}break;case X:q=r;break;default:p=r.parentNode;if(p){q=b(p);}break;}}return q;}function e(t){var p=Z.getTarget(t),q=b(p),u=true,w=t.type,x,r,s,z,y;if(q){r=q.tagName.toUpperCase();if(r==X){s=q.id;if(s&&h[s]){z=h[s];y=z.parent;}}else{if(r==T){if(q.id){y=d[q.id];}}}}if(y){x=c[w];if(w=="click"&&(K.gecko&&y.platform!="mac")&&t.button>0){u=false;}if(u&&z&&!z.cfg.getProperty(A)){z[x].fire(t);}if(u){y[x].fire(t,z);}}else{if(w==U){for(var v in o){if(H.hasOwnProperty(o,v)){y=o[v];if(y.cfg.getProperty(L)&&!(y instanceof YAHOO.widget.MenuBar)&&y.cfg.getProperty(S)==Q){y.hide();if(K.ie&&p.focus){p.setActive();}}else{if(y.cfg.getProperty(Y)>0){y._cancelShowDelay();}if(y.activeItem){y.activeItem.blur();y.activeItem.cfg.setProperty(J,false);y.activeItem=null;}}}}}}}function n(q,p,r){if(d[r.id]){this.removeMenu(r);}}function k(q,p){var r=p[1];if(r){i=r;}}function f(q,p){i=null;}function a(r,q){var p=q[0],s=this.id;if(p){o[s]=this;}else{if(o[s]){delete o[s];}}}function j(q,p){m(this);}function m(q){var p=q.id;if(p&&h[p]){if(i==q){i=null;}delete h[p];q.destroyEvent.unsubscribe(j);}}function g(q,p){var s=p[0],r;if(s instanceof YAHOO.widget.MenuItem){r=s.id;if(!h[r]){h[r]=s;s.destroyEvent.subscribe(j);}}}return{addMenu:function(q){var p;if(q instanceof YAHOO.widget.Menu&&q.id&&!d[q.id]){d[q.id]=q;if(!l){p=document;Z.on(p,D,e,this,true);Z.on(p,F,e,this,true);Z.on(p,U,e,this,true);Z.on(p,G,e,this,true);Z.on(p,V,e,this,true);Z.on(p,B,e,this,true);Z.on(p,N,e,this,true);Z.on(p,I,e,this,true);Z.onFocus(p,e,this,true);Z.onBlur(p,e,this,true);l=true;}q.cfg.subscribeToConfigEvent(E,a);q.destroyEvent.subscribe(n,q,this);q.itemAddedEvent.subscribe(g);q.focusEvent.subscribe(k);q.blurEvent.subscribe(f);}},removeMenu:function(s){var q,p,r;if(s){q=s.id;if((q in d)&&(d[q]==s)){p=s.getItems();if(p&&p.length>0){r=p.length-1;do{m(p[r]);}while(r--);}delete d[q];if((q in o)&&(o[q]==s)){delete o[q];}if(s.cfg){s.cfg.unsubscribeFromConfigEvent(E,a);}s.destroyEvent.unsubscribe(n,s);s.itemAddedEvent.unsubscribe(g);s.focusEvent.unsubscribe(k);s.blurEvent.unsubscribe(f);}}},hideVisible:function(){var p;for(var q in o){if(H.hasOwnProperty(o,q)){p=o[q];if(!(p instanceof YAHOO.widget.MenuBar)&&p.cfg.getProperty(S)==Q){p.hide();}}}},getVisible:function(){return o;},getMenus:function(){return d;},getMenu:function(q){var p;if(q in d){p=d[q];}return p;},getMenuItem:function(q){var p;if(q in h){p=h[q];}return p;},getMenuItemGroup:function(t){var q=C.get(t),p,v,u,r,s;if(q&&q.tagName&&q.tagName.toUpperCase()==W){v=q.firstChild;if(v){p=[];do{r=v.id;if(r){u=this.getMenuItem(r);if(u){p[p.length]=u;}}}while((v=v.nextSibling));if(p.length>0){s=p;}}}return s;},getFocusedMenuItem:function(){return i;},getFocusedMenu:function(){var p;if(i){p=i.parent.getRoot();}return p;},toString:function(){return R;}};}();})();(function(){var AM=YAHOO.lang,Aq="Menu",G="DIV",K="div",Am="id",AH="SELECT",e="xy",R="y",Ax="UL",L="ul",AJ="first-of-type",k="LI",h="OPTGROUP",Az="OPTION",Ah="disabled",AY="none",y="selected",At="groupindex",i="index",O="submenu",Au="visible",AX="hidedelay",Ac="position",AD="dynamic",C="static",An=AD+","+C,Q="url",M="#",V="target",AU="maxheight",T="topscrollbar",x="bottomscrollbar",d="_",P=T+d+Ah,E=x+d+Ah,b="mousemove",Av="showdelay",c="submenuhidedelay",AF="iframe",w="constraintoviewport",A4="preventcontextoverlap",AO="submenualignment",Z="autosubmenudisplay",AC="clicktohide",g="container",j="scrollincrement",Aj="minscrollheight",A2="classname",Ag="shadow",Ar="keepopen",A0="hd",D="hastitle",p="context",u="",Ak="mousedown",Ae="keydown",Ao="height",U="width",AQ="px",Ay="effect",AE="monitorresize",AW="display",AV="block",J="visibility",z="absolute",AS="zindex",l="yui-menu-body-scrolled",AK=" ",A1=" ",Ai="mouseover",H="mouseout",AR="itemAdded",n="itemRemoved",AL="hidden",s="yui-menu-shadow",AG=s+"-visible",m=s+A1+AG;YAHOO.widget.Menu=function(A6,A5){if(A5){this.parent=A5.parent;this.lazyLoad=A5.lazyLoad||A5.lazyload;this.itemData=A5.itemData||A5.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,A6,A5);};function B(A6){var A5=false;if(AM.isString(A6)){A5=(An.indexOf((A6.toLowerCase()))!=-1);}return A5;}var f=YAHOO.util.Dom,AA=YAHOO.util.Event,Aw=YAHOO.widget.Module,AB=YAHOO.widget.Overlay,r=YAHOO.widget.Menu,A3=YAHOO.widget.MenuManager,F=YAHOO.util.CustomEvent,As=YAHOO.env.ua,Ap,AT=false,Ad,Ab=[["mouseOverEvent",Ai],["mouseOutEvent",H],["mouseDownEvent",Ak],["mouseUpEvent","mouseup"],["clickEvent","click"],["keyPressEvent","keypress"],["keyDownEvent",Ae],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["itemAddedEvent",AR],["itemRemovedEvent",n]],AZ={key:Au,value:false,validator:AM.isBoolean},AP={key:w,value:true,validator:AM.isBoolean,supercedes:[AF,"x",R,e]},AI={key:A4,value:true,validator:AM.isBoolean,supercedes:[w]},S={key:Ac,value:AD,validator:B,supercedes:[Au,AF]},A={key:AO,value:["tl","tr"]},t={key:Z,value:true,validator:AM.isBoolean,suppressEvent:true},Y={key:Av,value:250,validator:AM.isNumber,suppressEvent:true},q={key:AX,value:0,validator:AM.isNumber,suppressEvent:true},v={key:c,value:250,validator:AM.isNumber,suppressEvent:true},o={key:AC,value:true,validator:AM.isBoolean,suppressEvent:true},AN={key:g,suppressEvent:true},Af={key:j,value:1,validator:AM.isNumber,supercedes:[AU],suppressEvent:true},N={key:Aj,value:90,validator:AM.isNumber,supercedes:[AU],suppressEvent:true},X={key:AU,value:0,validator:AM.isNumber,supercedes:[AF],suppressEvent:true},W={key:A2,value:null,validator:AM.isString,suppressEvent:true},a={key:Ah,value:false,validator:AM.isBoolean,suppressEvent:true},I={key:Ag,value:true,validator:AM.isBoolean,suppressEvent:true,supercedes:[Au]},Al={key:Ar,value:false,validator:AM.isBoolean}; >-function Aa(A5){Ad=AA.getTarget(A5);}YAHOO.lang.extend(r,AB,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",OFF_SCREEN_POSITION:"-999em",_useHideDelay:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,_nCurrentMouseX:0,_bStopMouseEventHandlers:false,_sClassName:null,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,init:function(A7,A6){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var A5;if(AM.isString(A7)){A5=f.get(A7);}else{if(A7.tagName){A5=A7;}}if(A5&&A5.tagName){switch(A5.tagName.toUpperCase()){case G:this.srcElement=A5;if(!A5.id){A5.setAttribute(Am,f.generateId());}r.superclass.init.call(this,A5);this.beforeInitEvent.fire(r);break;case AH:this.srcElement=A5;r.superclass.init.call(this,f.generateId());this.beforeInitEvent.fire(r);break;}}else{r.superclass.init.call(this,A7);this.beforeInitEvent.fire(r);}if(this.element){f.addClass(this.element,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit);this.beforeRenderEvent.subscribe(this._onBeforeRender);this.renderEvent.subscribe(this._onRender);this.beforeShowEvent.subscribe(this._onBeforeShow);this.hideEvent.subscribe(this._onHide);this.showEvent.subscribe(this._onShow);this.beforeHideEvent.subscribe(this._onBeforeHide);this.mouseOverEvent.subscribe(this._onMouseOver);this.mouseOutEvent.subscribe(this._onMouseOut);this.clickEvent.subscribe(this._onClick);this.keyDownEvent.subscribe(this._onKeyDown);this.keyPressEvent.subscribe(this._onKeyPress);this.blurEvent.subscribe(this._onBlur);if(!AT){AA.onFocus(document,Aa);AT=true;}if((As.gecko&&As.gecko<1.9)||As.webkit){this.cfg.subscribeToConfigEvent(R,this._onYChange);}if(A6){this.cfg.applyConfig(A6,true);}A3.addMenu(this);this.initEvent.fire(r);}},_initSubTree:function(){var A6=this.srcElement,A5,A8,BB,BC,BA,A9,A7;if(A6){A5=(A6.tagName&&A6.tagName.toUpperCase());if(A5==G){BC=this.body.firstChild;if(BC){A8=0;BB=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(BC&&BC.tagName){switch(BC.tagName.toUpperCase()){case BB:this._aGroupTitleElements[A8]=BC;break;case Ax:this._aListElements[A8]=BC;this._aItemGroups[A8]=[];A8++;break;}}}while((BC=BC.nextSibling));if(this._aListElements[0]){f.addClass(this._aListElements[0],AJ);}}}BC=null;if(A5){switch(A5){case G:BA=this._aListElements;A9=BA.length;if(A9>0){A7=A9-1;do{BC=BA[A7].firstChild;if(BC){do{if(BC&&BC.tagName&&BC.tagName.toUpperCase()==k){this.addItem(new this.ITEM_TYPE(BC,{parent:this}),A7);}}while((BC=BC.nextSibling));}}while(A7--);}break;case AH:BC=A6.firstChild;do{if(BC&&BC.tagName){switch(BC.tagName.toUpperCase()){case h:case Az:this.addItem(new this.ITEM_TYPE(BC,{parent:this}));break;}}}while((BC=BC.nextSibling));break;}}}},_getFirstEnabledItem:function(){var A5=this.getItems(),A9=A5.length,A8,A7;for(var A6=0;A6<A9;A6++){A8=A5[A6];if(A8&&!A8.cfg.getProperty(Ah)&&A8.element.style.display!=AY){A7=A8;break;}}return A7;},_addItemToGroup:function(BA,BB,BF){var BD,BG,A8,BE,A9,A6,A7,BC;function A5(BH,BI){return(BH[BI]||A5(BH,(BI+1)));}if(BB instanceof this.ITEM_TYPE){BD=BB;BD.parent=this;}else{if(AM.isString(BB)){BD=new this.ITEM_TYPE(BB,{parent:this});}else{if(AM.isObject(BB)){BB.parent=this;BD=new this.ITEM_TYPE(BB.text,BB);}}}if(BD){if(BD.cfg.getProperty(y)){this.activeItem=BD;}BG=AM.isNumber(BA)?BA:0;A8=this._getItemGroup(BG);if(!A8){A8=this._createItemGroup(BG);}if(AM.isNumber(BF)){A9=(BF>=A8.length);if(A8[BF]){A8.splice(BF,0,BD);}else{A8[BF]=BD;}BE=A8[BF];if(BE){if(A9&&(!BE.element.parentNode||BE.element.parentNode.nodeType==11)){this._aListElements[BG].appendChild(BE.element);}else{A6=A5(A8,(BF+1));if(A6&&(!BE.element.parentNode||BE.element.parentNode.nodeType==11)){this._aListElements[BG].insertBefore(BE.element,A6.element);}}BE.parent=this;this._subscribeToItemEvents(BE);this._configureSubmenu(BE);this._updateItemProperties(BG);this.itemAddedEvent.fire(BE);this.changeContentEvent.fire();BC=BE;}}else{A7=A8.length;A8[A7]=BD;BE=A8[A7];if(BE){if(!f.isAncestor(this._aListElements[BG],BE.element)){this._aListElements[BG].appendChild(BE.element);}BE.element.setAttribute(At,BG);BE.element.setAttribute(i,A7);BE.parent=this;BE.index=A7;BE.groupIndex=BG;this._subscribeToItemEvents(BE);this._configureSubmenu(BE);if(A7===0){f.addClass(BE.element,AJ);}this.itemAddedEvent.fire(BE);this.changeContentEvent.fire();BC=BE;}}}return BC;},_removeItemFromGroupByIndex:function(A8,A6){var A7=AM.isNumber(A8)?A8:0,A9=this._getItemGroup(A7),BB,BA,A5;if(A9){BB=A9.splice(A6,1);BA=BB[0];if(BA){this._updateItemProperties(A7);if(A9.length===0){A5=this._aListElements[A7];if(this.body&&A5){this.body.removeChild(A5);}this._aItemGroups.splice(A7,1);this._aListElements.splice(A7,1);A5=this._aListElements[0];if(A5){f.addClass(A5,AJ);}}this.itemRemovedEvent.fire(BA);this.changeContentEvent.fire();}}return BA;},_removeItemFromGroupByValue:function(A8,A5){var BA=this._getItemGroup(A8),BB,A9,A7,A6;if(BA){BB=BA.length;A9=-1;if(BB>0){A6=BB-1;do{if(BA[A6]==A5){A9=A6;break;}}while(A6--);if(A9>-1){A7=this._removeItemFromGroupByIndex(A8,A9);}}}return A7;},_updateItemProperties:function(A6){var A7=this._getItemGroup(A6),BA=A7.length,A9,A8,A5;if(BA>0){A5=BA-1;do{A9=A7[A5];if(A9){A8=A9.element;A9.index=A5;A9.groupIndex=A6;A8.setAttribute(At,A6);A8.setAttribute(i,A5);f.removeClass(A8,AJ);}}while(A5--);if(A8){f.addClass(A8,AJ);}}},_createItemGroup:function(A7){var A5,A6;if(!this._aItemGroups[A7]){this._aItemGroups[A7]=[];A5=document.createElement(L);this._aListElements[A7]=A5;A6=this._aItemGroups[A7];}return A6;},_getItemGroup:function(A7){var A5=AM.isNumber(A7)?A7:0,A8=this._aItemGroups,A6;if(A5 in A8){A6=A8[A5];}return A6;},_configureSubmenu:function(A5){var A6=A5.cfg.getProperty(O);if(A6){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,A6,true);this.renderEvent.subscribe(this._onParentMenuRender,A6,true);}},_subscribeToItemEvents:function(A5){A5.destroyEvent.subscribe(this._onMenuItemDestroy,A5,this); >-A5.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,A5,this);},_onVisibleChange:function(A7,A6){var A5=A6[0];if(A5){f.addClass(this.element,Au);}else{f.removeClass(this.element,Au);}},_cancelHideDelay:function(){var A5=this.getRoot()._hideDelayTimer;if(A5){A5.cancel();}},_execHideDelay:function(){this._cancelHideDelay();var A5=this.getRoot();A5._hideDelayTimer=AM.later(A5.cfg.getProperty(AX),this,function(){if(A5.activeItem){if(A5.hasFocus()){A5.activeItem.focus();}A5.clearActiveItem();}if(A5==this&&!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty(Ac)==AD){this.hide();}});},_cancelShowDelay:function(){var A5=this.getRoot()._showDelayTimer;if(A5){A5.cancel();}},_execSubmenuHideDelay:function(A7,A6,A5){A7._submenuHideDelayTimer=AM.later(50,this,function(){if(this._nCurrentMouseX>(A6+10)){A7._submenuHideDelayTimer=AM.later(A5,A7,function(){this.hide();});}else{A7.hide();}});},_disableScrollHeader:function(){if(!this._bHeaderDisabled){f.addClass(this.header,P);this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){f.addClass(this.footer,E);this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){f.removeClass(this.header,P);this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){f.removeClass(this.footer,E);this._bFooterDisabled=false;}},_onMouseOver:function(BH,BA){var BI=BA[0],BE=BA[1],A5=AA.getTarget(BI),A9=this.getRoot(),BG=this._submenuHideDelayTimer,A6,A8,BD,A7,BC,BB;var BF=function(){if(this.parent.cfg.getProperty(y)){this.show();}};if(!this._bStopMouseEventHandlers){if(!this._bHandledMouseOverEvent&&(A5==this.element||f.isAncestor(this.element,A5))){if(this._useHideDelay){this._cancelHideDelay();}this._nCurrentMouseX=0;AA.on(this.element,b,this._onMouseMove,this,true);if(!(BE&&f.isAncestor(BE.element,AA.getRelatedTarget(BI)))){this.clearActiveItem();}if(this.parent&&BG){BG.cancel();this.parent.cfg.setProperty(y,true);A6=this.parent.parent;A6._bHandledMouseOutEvent=true;A6._bHandledMouseOverEvent=false;}this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(BE&&!BE.handledMouseOverEvent&&!BE.cfg.getProperty(Ah)&&(A5==BE.element||f.isAncestor(BE.element,A5))){A8=this.cfg.getProperty(Av);BD=(A8>0);if(BD){this._cancelShowDelay();}A7=this.activeItem;if(A7){A7.cfg.setProperty(y,false);}BC=BE.cfg;BC.setProperty(y,true);if(this.hasFocus()||A9._hasFocus){BE.focus();A9._hasFocus=false;}if(this.cfg.getProperty(Z)){BB=BC.getProperty(O);if(BB){if(BD){A9._showDelayTimer=AM.later(A9.cfg.getProperty(Av),BB,BF);}else{BB.show();}}}BE.handledMouseOverEvent=true;BE.handledMouseOutEvent=false;}}},_onMouseOut:function(BD,A7){var BE=A7[0],BB=A7[1],A8=AA.getRelatedTarget(BE),BC=false,BA,A9,A5,A6;if(!this._bStopMouseEventHandlers){if(BB&&!BB.cfg.getProperty(Ah)){BA=BB.cfg;A9=BA.getProperty(O);if(A9&&(A8==A9.element||f.isAncestor(A9.element,A8))){BC=true;}if(!BB.handledMouseOutEvent&&((A8!=BB.element&&!f.isAncestor(BB.element,A8))||BC)){if(!BC){BB.cfg.setProperty(y,false);if(A9){A5=this.cfg.getProperty(c);A6=this.cfg.getProperty(Av);if(!(this instanceof YAHOO.widget.MenuBar)&&A5>0&&A6>=A5){this._execSubmenuHideDelay(A9,AA.getPageX(BE),A5);}else{A9.hide();}}}BB.handledMouseOutEvent=true;BB.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent&&((A8!=this.element&&!f.isAncestor(this.element,A8))||BC)){if(this._useHideDelay){this._execHideDelay();}AA.removeListener(this.element,b,this._onMouseMove);this._nCurrentMouseX=AA.getPageX(BE);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}}},_onMouseMove:function(A6,A5){if(!this._bStopMouseEventHandlers){this._nCurrentMouseX=AA.getPageX(A6);}},_onClick:function(BG,A7){var BH=A7[0],BB=A7[1],BD=false,A9,BE,A6,A5,BA,BC,BF;var A8=function(){A6=this.getRoot();if(A6 instanceof YAHOO.widget.MenuBar||A6.cfg.getProperty(Ac)==C){A6.clearActiveItem();}else{A6.hide();}};if(BB){if(BB.cfg.getProperty(Ah)){AA.preventDefault(BH);A8.call(this);}else{A9=BB.cfg.getProperty(O);BA=BB.cfg.getProperty(Q);if(BA){BC=BA.indexOf(M);BF=BA.length;if(BC!=-1){BA=BA.substr(BC,BF);BF=BA.length;if(BF>1){A5=BA.substr(1,BF);BE=YAHOO.widget.MenuManager.getMenu(A5);if(BE){BD=(this.getRoot()===BE.getRoot());}}else{if(BF===1){BD=true;}}}}if(BD&&!BB.cfg.getProperty(V)){AA.preventDefault(BH);if(As.webkit){BB.focus();}else{BB.focusEvent.fire();}}if(!A9&&!this.cfg.getProperty(Ar)){A8.call(this);}}}},_onKeyDown:function(BK,BE){var BH=BE[0],BG=BE[1],BD,BI,A6,BA,BL,A5,BO,A9,BJ,A8,BF,BN,BB,BC;if(this._useHideDelay){this._cancelHideDelay();}function A7(){this._bStopMouseEventHandlers=true;AM.later(10,this,function(){this._bStopMouseEventHandlers=false;});}if(BG&&!BG.cfg.getProperty(Ah)){BI=BG.cfg;A6=this.parent;switch(BH.keyCode){case 38:case 40:BL=(BH.keyCode==38)?BG.getPreviousEnabledSibling():BG.getNextEnabledSibling();if(BL){this.clearActiveItem();BL.cfg.setProperty(y,true);BL.focus();if(this.cfg.getProperty(AU)>0){A5=this.body;BO=A5.scrollTop;A9=A5.offsetHeight;BJ=this.getItems();A8=BJ.length-1;BF=BL.element.offsetTop;if(BH.keyCode==40){if(BF>=(A9+BO)){A5.scrollTop=BF-A9;}else{if(BF<=BO){A5.scrollTop=0;}}if(BL==BJ[A8]){A5.scrollTop=BL.element.offsetTop;}}else{if(BF<=BO){A5.scrollTop=BF-BL.element.offsetHeight;}else{if(BF>=(BO+A9)){A5.scrollTop=BF;}}if(BL==BJ[0]){A5.scrollTop=0;}}BO=A5.scrollTop;BN=A5.scrollHeight-A5.offsetHeight;if(BO===0){this._disableScrollHeader();this._enableScrollFooter();}else{if(BO==BN){this._enableScrollHeader();this._disableScrollFooter();}else{this._enableScrollHeader();this._enableScrollFooter();}}}}AA.preventDefault(BH);A7();break;case 39:BD=BI.getProperty(O);if(BD){if(!BI.getProperty(y)){BI.setProperty(y,true);}BD.show();BD.setInitialFocus();BD.setInitialSelection();}else{BA=this.getRoot();if(BA instanceof YAHOO.widget.MenuBar){BL=BA.activeItem.getNextEnabledSibling();if(BL){BA.clearActiveItem();BL.cfg.setProperty(y,true);BD=BL.cfg.getProperty(O);if(BD){BD.show();BD.setInitialFocus();}else{BL.focus();}}}}AA.preventDefault(BH); >-A7();break;case 37:if(A6){BB=A6.parent;if(BB instanceof YAHOO.widget.MenuBar){BL=BB.activeItem.getPreviousEnabledSibling();if(BL){BB.clearActiveItem();BL.cfg.setProperty(y,true);BD=BL.cfg.getProperty(O);if(BD){BD.show();BD.setInitialFocus();}else{BL.focus();}}}else{this.hide();A6.focus();}}AA.preventDefault(BH);A7();break;}}if(BH.keyCode==27){if(this.cfg.getProperty(Ac)==AD){this.hide();if(this.parent){this.parent.focus();}else{BC=this._focusedElement;if(BC&&BC.focus){try{BC.focus();}catch(BM){}}}}else{if(this.activeItem){BD=this.activeItem.cfg.getProperty(O);if(BD&&BD.cfg.getProperty(Au)){BD.hide();this.activeItem.focus();}else{this.activeItem.blur();this.activeItem.cfg.setProperty(y,false);}}}AA.preventDefault(BH);}},_onKeyPress:function(A7,A6){var A5=A6[0];if(A5.keyCode==40||A5.keyCode==38){AA.preventDefault(A5);}},_onBlur:function(A6,A5){if(this._hasFocus){this._hasFocus=false;}},_onYChange:function(A6,A5){var A8=this.parent,BA,A7,A9;if(A8){BA=A8.parent.body.scrollTop;if(BA>0){A9=(this.cfg.getProperty(R)-BA);f.setY(this.element,A9);A7=this.iframe;if(A7){f.setY(A7,A9);}this.cfg.setProperty(R,A9,true);}}},_onScrollTargetMouseOver:function(BB,BE){var BD=this._bodyScrollTimer;if(BD){BD.cancel();}this._cancelHideDelay();var A7=AA.getTarget(BB),A9=this.body,A8=this.cfg.getProperty(j),A5,A6;function BC(){var BF=A9.scrollTop;if(BF<A5){A9.scrollTop=(BF+A8);this._enableScrollHeader();}else{A9.scrollTop=A5;this._bodyScrollTimer.cancel();this._disableScrollFooter();}}function BA(){var BF=A9.scrollTop;if(BF>0){A9.scrollTop=(BF-A8);this._enableScrollFooter();}else{A9.scrollTop=0;this._bodyScrollTimer.cancel();this._disableScrollHeader();}}if(f.hasClass(A7,A0)){A6=BA;}else{A5=A9.scrollHeight-A9.offsetHeight;A6=BC;}this._bodyScrollTimer=AM.later(10,this,A6,null,true);},_onScrollTargetMouseOut:function(A7,A5){var A6=this._bodyScrollTimer;if(A6){A6.cancel();}this._cancelHideDelay();},_onInit:function(A6,A5){this.cfg.subscribeToConfigEvent(Au,this._onVisibleChange);var A7=!this.parent,A8=this.lazyLoad;if(((A7&&!A8)||(A7&&(this.cfg.getProperty(Au)||this.cfg.getProperty(Ac)==C))||(!A7&&!A8))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(A8){this.cfg.fireQueue();}}},_onBeforeRender:function(A8,A7){var A9=this.element,BC=this._aListElements.length,A6=true,BB=0,A5,BA;if(BC>0){do{A5=this._aListElements[BB];if(A5){if(A6){f.addClass(A5,AJ);A6=false;}if(!f.isAncestor(A9,A5)){this.appendToBody(A5);}BA=this._aGroupTitleElements[BB];if(BA){if(!f.isAncestor(A9,BA)){A5.parentNode.insertBefore(BA,A5);}f.addClass(A5,D);}}BB++;}while(BB<BC);}},_onRender:function(A6,A5){if(this.cfg.getProperty(Ac)==AD){if(!this.cfg.getProperty(Au)){this.positionOffScreen();}}},_onBeforeShow:function(A7,A6){var A9,BC,A8,BA=this.cfg.getProperty(g);if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()==AH){A9=this.itemData.length;for(BC=0;BC<A9;BC++){if(this.itemData[BC].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[BC])));}}}else{this.addItems(this.itemData);}}A8=this.srcElement;if(A8){if(A8.tagName.toUpperCase()==AH){if(f.inDocument(A8)){this.render(A8.parentNode);}else{this.render(BA);}}else{this.render();}}else{if(this.parent){this.render(this.parent.element);}else{this.render(BA);}}}var BB=this.parent,A5;if(!BB&&this.cfg.getProperty(Ac)==AD){this.cfg.refireEvent(e);}if(BB){A5=BB.parent.cfg.getProperty(AO);this.cfg.setProperty(p,[BB.element,A5[0],A5[1]]);this.align();}},getConstrainedY:function(BH){var BS=this,BO=BS.cfg.getProperty(p),BV=BS.cfg.getProperty(AU),BR,BG={"trbr":true,"tlbl":true,"bltl":true,"brtr":true},BA=(BO&&BG[BO[1]+BO[2]]),BC=BS.element,BW=BC.offsetHeight,BQ=AB.VIEWPORT_OFFSET,BL=f.getViewportHeight(),BP=f.getDocumentScrollTop(),BM=(BS.cfg.getProperty(Aj)+BQ<BL),BU,BD,BJ,BK,BF=false,BE,A7,BI=BP+BQ,A9=BP+BL-BW-BQ,A5=BH;var BB=function(){var BX;if((BS.cfg.getProperty(R)-BP)>BJ){BX=(BJ-BW);}else{BX=(BJ+BK);}BS.cfg.setProperty(R,(BX+BP),true);return BX;};var A8=function(){if((BS.cfg.getProperty(R)-BP)>BJ){return(A7-BQ);}else{return(BE-BQ);}};var BN=function(){var BX;if((BS.cfg.getProperty(R)-BP)>BJ){BX=(BJ+BK);}else{BX=(BJ-BC.offsetHeight);}BS.cfg.setProperty(R,(BX+BP),true);};var A6=function(){BS._setScrollHeight(this.cfg.getProperty(AU));BS.hideEvent.unsubscribe(A6);};var BT=function(){var Ba=A8(),BX=(BS.getItems().length>0),BZ,BY;if(BW>Ba){BZ=BX?BS.cfg.getProperty(Aj):BW;if((Ba>BZ)&&BX){BR=Ba;}else{BR=BV;}BS._setScrollHeight(BR);BS.hideEvent.subscribe(A6);BN();if(Ba<BZ){if(BF){BB();}else{BB();BF=true;BY=BT();}}}else{if(BR&&(BR!==BV)){BS._setScrollHeight(BV);BS.hideEvent.subscribe(A6);BN();}}return BY;};if(BH<BI||BH>A9){if(BM){if(BS.cfg.getProperty(A4)&&BA){BD=BO[0];BK=BD.offsetHeight;BJ=(f.getY(BD)-BP);BE=BJ;A7=(BL-(BJ+BK));BT();A5=BS.cfg.getProperty(R);}else{if(!(BS instanceof YAHOO.widget.MenuBar)&&BW>=BL){BU=(BL-(BQ*2));if(BU>BS.cfg.getProperty(Aj)){BS._setScrollHeight(BU);BS.hideEvent.subscribe(A6);BN();A5=BS.cfg.getProperty(R);}}else{if(BH<BI){A5=BI;}else{if(BH>A9){A5=A9;}}}}}else{A5=BQ+BP;}}return A5;},_onHide:function(A6,A5){if(this.cfg.getProperty(Ac)===AD){this.positionOffScreen();}},_onShow:function(BD,BB){var A5=this.parent,A7,A8,BA,A6;function A9(BF){var BE;if(BF.type==Ak||(BF.type==Ae&&BF.keyCode==27)){BE=AA.getTarget(BF);if(BE!=A7.element||!f.isAncestor(A7.element,BE)){A7.cfg.setProperty(Z,false);AA.removeListener(document,Ak,A9);AA.removeListener(document,Ae,A9);}}}function BC(BF,BE,BG){this.cfg.setProperty(U,u);this.hideEvent.unsubscribe(BC,BG);}if(A5){A7=A5.parent;if(!A7.cfg.getProperty(Z)&&(A7 instanceof YAHOO.widget.MenuBar||A7.cfg.getProperty(Ac)==C)){A7.cfg.setProperty(Z,true);AA.on(document,Ak,A9);AA.on(document,Ae,A9);}if((this.cfg.getProperty("x")<A7.cfg.getProperty("x"))&&(As.gecko&&As.gecko<1.9)&&!this.cfg.getProperty(U)){A8=this.element; >-BA=A8.offsetWidth;A8.style.width=BA+AQ;A6=(BA-(A8.offsetWidth-BA))+AQ;this.cfg.setProperty(U,A6);this.hideEvent.subscribe(BC,A6);}}if(this===this.getRoot()&&this.cfg.getProperty(Ac)===AD){this._focusedElement=Ad;this.focus();}},_onBeforeHide:function(A7,A6){var A5=this.activeItem,A9=this.getRoot(),BA,A8;if(A5){BA=A5.cfg;BA.setProperty(y,false);A8=BA.getProperty(O);if(A8){A8.hide();}}if(As.ie&&this.cfg.getProperty(Ac)===AD&&this.parent){A9._hasFocus=this.hasFocus();}if(A9==this){A9.blur();}},_onParentMenuConfigChange:function(A6,A5,A9){var A7=A5[0][0],A8=A5[0][1];switch(A7){case AF:case w:case AX:case Av:case c:case AC:case Ay:case A2:case j:case AU:case Aj:case AE:case Ag:case A4:case Ar:A9.cfg.setProperty(A7,A8);break;case AO:if(!(this.parent.parent instanceof YAHOO.widget.MenuBar)){A9.cfg.setProperty(A7,A8);}break;}},_onParentMenuRender:function(A6,A5,BB){var A8=BB.parent.parent,A7=A8.cfg,A9={constraintoviewport:A7.getProperty(w),xy:[0,0],clicktohide:A7.getProperty(AC),effect:A7.getProperty(Ay),showdelay:A7.getProperty(Av),hidedelay:A7.getProperty(AX),submenuhidedelay:A7.getProperty(c),classname:A7.getProperty(A2),scrollincrement:A7.getProperty(j),maxheight:A7.getProperty(AU),minscrollheight:A7.getProperty(Aj),iframe:A7.getProperty(AF),shadow:A7.getProperty(Ag),preventcontextoverlap:A7.getProperty(A4),monitorresize:A7.getProperty(AE),keepopen:A7.getProperty(Ar)},BA;if(!(A8 instanceof YAHOO.widget.MenuBar)){A9[AO]=A7.getProperty(AO);}BB.cfg.applyConfig(A9);if(!this.lazyLoad){BA=this.parent.element;if(this.element.parentNode==BA){this.render();}else{this.render(BA);}}},_onMenuItemDestroy:function(A7,A6,A5){this._removeItemFromGroupByValue(A5.groupIndex,A5);},_onMenuItemConfigChange:function(A7,A6,A5){var A9=A6[0][0],BA=A6[0][1],A8;switch(A9){case y:if(BA===true){this.activeItem=A5;}break;case O:A8=A6[0][1];if(A8){this._configureSubmenu(A5);}break;}},configVisible:function(A7,A6,A8){var A5,A9;if(this.cfg.getProperty(Ac)==AD){r.superclass.configVisible.call(this,A7,A6,A8);}else{A5=A6[0];A9=f.getStyle(this.element,AW);f.setStyle(this.element,J,Au);if(A5){if(A9!=AV){this.beforeShowEvent.fire();f.setStyle(this.element,AW,AV);this.showEvent.fire();}}else{if(A9==AV){this.beforeHideEvent.fire();f.setStyle(this.element,AW,AY);this.hideEvent.fire();}}}},configPosition:function(A7,A6,BA){var A9=this.element,A8=A6[0]==C?C:z,BB=this.cfg,A5;f.setStyle(A9,Ac,A8);if(A8==C){f.setStyle(A9,AW,AV);BB.setProperty(Au,true);}else{f.setStyle(A9,J,AL);}if(A8==z){A5=BB.getProperty(AS);if(!A5||A5===0){BB.setProperty(AS,1);}}},configIframe:function(A6,A5,A7){if(this.cfg.getProperty(Ac)==AD){r.superclass.configIframe.call(this,A6,A5,A7);}},configHideDelay:function(A6,A5,A7){var A8=A5[0];this._useHideDelay=(A8>0);},configContainer:function(A6,A5,A8){var A7=A5[0];if(AM.isString(A7)){this.cfg.setProperty(g,f.get(A7),true);}},_clearSetWidthFlag:function(){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);},_setScrollHeight:function(BG){var BC=BG,BB=false,BH=false,A8,A9,BF,A6,BE,BI,A5,BD,BA,A7;if(this.getItems().length>0){A8=this.element;A9=this.body;BF=this.header;A6=this.footer;BE=this._onScrollTargetMouseOver;BI=this._onScrollTargetMouseOut;A5=this.cfg.getProperty(Aj);if(BC>0&&BC<A5){BC=A5;}f.setStyle(A9,Ao,u);f.removeClass(A9,l);A9.scrollTop=0;BH=((As.gecko&&As.gecko<1.9)||As.ie);if(BC>0&&BH&&!this.cfg.getProperty(U)){BA=A8.offsetWidth;A8.style.width=BA+AQ;A7=(BA-(A8.offsetWidth-BA))+AQ;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);this.cfg.setProperty(U,A7);this._widthSetForScroll=true;this.cfg.subscribeToConfigEvent(U,this._clearSetWidthFlag);}if(BC>0&&(!BF&&!A6)){this.setHeader(AK);this.setFooter(AK);BF=this.header;A6=this.footer;f.addClass(BF,T);f.addClass(A6,x);A8.insertBefore(BF,A9);A8.appendChild(A6);}BD=BC;if(BF&&A6){BD=(BD-(BF.offsetHeight+A6.offsetHeight));}if((BD>0)&&(A9.offsetHeight>BC)){f.addClass(A9,l);f.setStyle(A9,Ao,(BD+AQ));if(!this._hasScrollEventHandlers){AA.on(BF,Ai,BE,this,true);AA.on(BF,H,BI,this,true);AA.on(A6,Ai,BE,this,true);AA.on(A6,H,BI,this,true);this._hasScrollEventHandlers=true;}this._disableScrollHeader();this._enableScrollFooter();BB=true;}else{if(BF&&A6){if(this._widthSetForScroll){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);this.cfg.setProperty(U,u);}this._enableScrollHeader();this._enableScrollFooter();if(this._hasScrollEventHandlers){AA.removeListener(BF,Ai,BE);AA.removeListener(BF,H,BI);AA.removeListener(A6,Ai,BE);AA.removeListener(A6,H,BI);this._hasScrollEventHandlers=false;}A8.removeChild(BF);A8.removeChild(A6);this.header=null;this.footer=null;BB=true;}}if(BB){this.cfg.refireEvent(AF);this.cfg.refireEvent(Ag);}}},_setMaxHeight:function(A6,A5,A7){this._setScrollHeight(A7);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(A6,A5,A7){var A8=A5[0];if(this.lazyLoad&&!this.body&&A8>0){this.renderEvent.subscribe(this._setMaxHeight,A8,this);}else{this._setScrollHeight(A8);}},configClassName:function(A7,A6,A8){var A5=A6[0];if(this._sClassName){f.removeClass(this.element,this._sClassName);}f.addClass(this.element,A5);this._sClassName=A5;},_onItemAdded:function(A6,A5){var A7=A5[0];if(A7){A7.cfg.setProperty(Ah,true);}},configDisabled:function(A7,A6,BA){var A9=A6[0],A5=this.getItems(),BB,A8;if(AM.isArray(A5)){BB=A5.length;if(BB>0){A8=BB-1;do{A5[A8].cfg.setProperty(Ah,A9);}while(A8--);}if(A9){this.clearActiveItem(true);f.addClass(this.element,Ah);this.itemAddedEvent.subscribe(this._onItemAdded);}else{f.removeClass(this.element,Ah);this.itemAddedEvent.unsubscribe(this._onItemAdded);}}},configShadow:function(BD,A7,BC){var BB=function(){var BG=this.element,BF=this._shadow;if(BF&&BG){if(BF.style.width&&BF.style.height){BF.style.width=u;BF.style.height=u;}BF.style.width=(BG.offsetWidth+6)+AQ;BF.style.height=(BG.offsetHeight+1)+AQ;}};var BE=function(){this.element.appendChild(this._shadow);};var A9=function(){f.addClass(this._shadow,AG);};var BA=function(){f.removeClass(this._shadow,AG); >-};var A6=function(){var BG=this._shadow,BF;if(!BG){BF=this.element;if(!Ap){Ap=document.createElement(K);Ap.className=m;}BG=Ap.cloneNode(false);BF.appendChild(BG);this._shadow=BG;this.beforeShowEvent.subscribe(A9);this.beforeHideEvent.subscribe(BA);if(As.ie){AM.later(0,this,function(){BB.call(this);this.syncIframe();});this.cfg.subscribeToConfigEvent(U,BB);this.cfg.subscribeToConfigEvent(Ao,BB);this.cfg.subscribeToConfigEvent(AU,BB);this.changeContentEvent.subscribe(BB);Aw.textResizeEvent.subscribe(BB,this,true);this.destroyEvent.subscribe(function(){Aw.textResizeEvent.unsubscribe(BB,this);});}this.cfg.subscribeToConfigEvent(AU,BE);}};var A8=function(){if(this._shadow){BE.call(this);if(As.ie){BB.call(this);}}else{A6.call(this);}this.beforeShowEvent.unsubscribe(A8);};var A5=A7[0];if(A5&&this.cfg.getProperty(Ac)==AD){if(this.cfg.getProperty(Au)){if(this._shadow){BE.call(this);if(As.ie){BB.call(this);}}else{A6.call(this);}}else{this.beforeShowEvent.subscribe(A8);}}},initEvents:function(){r.superclass.initEvents.call(this);var A6=Ab.length-1,A7,A5;do{A7=Ab[A6];A5=this.createEvent(A7[1]);A5.signature=F.LIST;this[A7[0]]=A5;}while(A6--);},positionOffScreen:function(){var A6=this.iframe,A7=this.element,A5=this.OFF_SCREEN_POSITION;A7.style.top=u;A7.style.left=u;if(A6){A6.style.top=A5;A6.style.left=A5;}},getRoot:function(){var A7=this.parent,A6,A5;if(A7){A6=A7.parent;A5=A6?A6.getRoot():this;}else{A5=this;}return A5;},toString:function(){var A6=Aq,A5=this.id;if(A5){A6+=(A1+A5);}return A6;},setItemGroupTitle:function(BA,A9){var A8,A7,A6,A5;if(AM.isString(BA)&&BA.length>0){A8=AM.isNumber(A9)?A9:0;A7=this._aGroupTitleElements[A8];if(A7){A7.innerHTML=BA;}else{A7=document.createElement(this.GROUP_TITLE_TAG_NAME);A7.innerHTML=BA;this._aGroupTitleElements[A8]=A7;}A6=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[A6]){f.removeClass(this._aGroupTitleElements[A6],AJ);A5=A6;}}while(A6--);if(A5!==null){f.addClass(this._aGroupTitleElements[A5],AJ);}this.changeContentEvent.fire();}},addItem:function(A5,A6){return this._addItemToGroup(A6,A5);},addItems:function(A9,A8){var BB,A5,BA,A6,A7;if(AM.isArray(A9)){BB=A9.length;A5=[];for(A6=0;A6<BB;A6++){BA=A9[A6];if(BA){if(AM.isArray(BA)){A5[A5.length]=this.addItems(BA,A6);}else{A5[A5.length]=this._addItemToGroup(A8,BA);}}}if(A5.length){A7=A5;}}return A7;},insertItem:function(A5,A6,A7){return this._addItemToGroup(A7,A5,A6);},removeItem:function(A5,A7){var A8,A6;if(!AM.isUndefined(A5)){if(A5 instanceof YAHOO.widget.MenuItem){A8=this._removeItemFromGroupByValue(A7,A5);}else{if(AM.isNumber(A5)){A8=this._removeItemFromGroupByIndex(A7,A5);}}if(A8){A8.destroy();A6=A8;}}return A6;},getItems:function(){var A8=this._aItemGroups,A6,A7,A5=[];if(AM.isArray(A8)){A6=A8.length;A7=((A6==1)?A8[0]:(Array.prototype.concat.apply(A5,A8)));}return A7;},getItemGroups:function(){return this._aItemGroups;},getItem:function(A6,A7){var A8,A5;if(AM.isNumber(A6)){A8=this._getItemGroup(A7);if(A8){A5=A8[A6];}}return A5;},getSubmenus:function(){var A6=this.getItems(),BA=A6.length,A5,A7,A9,A8;if(BA>0){A5=[];for(A8=0;A8<BA;A8++){A9=A6[A8];if(A9){A7=A9.cfg.getProperty(O);if(A7){A5[A5.length]=A7;}}}}return A5;},clearContent:function(){var A9=this.getItems(),A6=A9.length,A7=this.element,A8=this.body,BD=this.header,A5=this.footer,BC,BB,BA;if(A6>0){BA=A6-1;do{BC=A9[BA];if(BC){BB=BC.cfg.getProperty(O);if(BB){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,BB);this.renderEvent.unsubscribe(this._onParentMenuRender,BB);}this.removeItem(BC,BC.groupIndex);}}while(BA--);}if(BD){AA.purgeElement(BD);A7.removeChild(BD);}if(A5){AA.purgeElement(A5);A7.removeChild(A5);}if(A8){AA.purgeElement(A8);A8.innerHTML=u;}this.activeItem=null;this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty(U,null);},destroy:function(){this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;r.superclass.destroy.call(this);},setInitialFocus:function(){var A5=this._getFirstEnabledItem();if(A5){A5.focus();}},setInitialSelection:function(){var A5=this._getFirstEnabledItem();if(A5){A5.cfg.setProperty(y,true);}},clearActiveItem:function(A7){if(this.cfg.getProperty(Av)>0){this._cancelShowDelay();}var A5=this.activeItem,A8,A6;if(A5){A8=A5.cfg;if(A7){A5.blur();this.getRoot()._hasFocus=true;}A8.setProperty(y,false);A6=A8.getProperty(O);if(A6){A6.hide();}this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var A5;if(this.hasFocus()){A5=A3.getFocusedMenuItem();if(A5){A5.blur();}}},hasFocus:function(){return(A3.getFocusedMenu()==this.getRoot());},_doItemSubmenuSubscribe:function(A6,A5,A8){var A9=A5[0],A7=A9.cfg.getProperty(O);if(A7){A7.subscribe.apply(A7,A8);}},_doSubmenuSubscribe:function(A6,A5,A8){var A7=this.cfg.getProperty(O);if(A7){A7.subscribe.apply(A7,A8);}},subscribe:function(){r.superclass.subscribe.apply(this,arguments);r.superclass.subscribe.call(this,AR,this._doItemSubmenuSubscribe,arguments);var A5=this.getItems(),A9,A8,A6,A7;if(A5){A9=A5.length;if(A9>0){A7=A9-1;do{A8=A5[A7];A6=A8.cfg.getProperty(O);if(A6){A6.subscribe.apply(A6,arguments);}else{A8.cfg.subscribeToConfigEvent(O,this._doSubmenuSubscribe,arguments);}}while(A7--);}}},unsubscribe:function(){r.superclass.unsubscribe.apply(this,arguments);r.superclass.unsubscribe.call(this,AR,this._doItemSubmenuSubscribe,arguments);var A5=this.getItems(),A9,A8,A6,A7;if(A5){A9=A5.length;if(A9>0){A7=A9-1;do{A8=A5[A7];A6=A8.cfg.getProperty(O);if(A6){A6.unsubscribe.apply(A6,arguments);}else{A8.cfg.unsubscribeFromConfigEvent(O,this._doSubmenuSubscribe,arguments);}}while(A7--);}}},initDefaultConfig:function(){r.superclass.initDefaultConfig.call(this);var A5=this.cfg;A5.addProperty(AZ.key,{handler:this.configVisible,value:AZ.value,validator:AZ.validator});A5.addProperty(AP.key,{handler:this.configConstrainToViewport,value:AP.value,validator:AP.validator,supercedes:AP.supercedes});A5.addProperty(AI.key,{value:AI.value,validator:AI.validator,supercedes:AI.supercedes}); >-A5.addProperty(S.key,{handler:this.configPosition,value:S.value,validator:S.validator,supercedes:S.supercedes});A5.addProperty(A.key,{value:A.value,suppressEvent:A.suppressEvent});A5.addProperty(t.key,{value:t.value,validator:t.validator,suppressEvent:t.suppressEvent});A5.addProperty(Y.key,{value:Y.value,validator:Y.validator,suppressEvent:Y.suppressEvent});A5.addProperty(q.key,{handler:this.configHideDelay,value:q.value,validator:q.validator,suppressEvent:q.suppressEvent});A5.addProperty(v.key,{value:v.value,validator:v.validator,suppressEvent:v.suppressEvent});A5.addProperty(o.key,{value:o.value,validator:o.validator,suppressEvent:o.suppressEvent});A5.addProperty(AN.key,{handler:this.configContainer,value:document.body,suppressEvent:AN.suppressEvent});A5.addProperty(Af.key,{value:Af.value,validator:Af.validator,supercedes:Af.supercedes,suppressEvent:Af.suppressEvent});A5.addProperty(N.key,{value:N.value,validator:N.validator,supercedes:N.supercedes,suppressEvent:N.suppressEvent});A5.addProperty(X.key,{handler:this.configMaxHeight,value:X.value,validator:X.validator,suppressEvent:X.suppressEvent,supercedes:X.supercedes});A5.addProperty(W.key,{handler:this.configClassName,value:W.value,validator:W.validator,supercedes:W.supercedes});A5.addProperty(a.key,{handler:this.configDisabled,value:a.value,validator:a.validator,suppressEvent:a.suppressEvent});A5.addProperty(I.key,{handler:this.configShadow,value:I.value,validator:I.validator});A5.addProperty(Al.key,{value:Al.value,validator:Al.validator});}});})();(function(){YAHOO.widget.MenuItem=function(AS,AR){if(AS){if(AR){this.parent=AR.parent;this.value=AR.value;this.id=AR.id;}this.init(AS,AR);}};var x=YAHOO.util.Dom,j=YAHOO.widget.Module,AB=YAHOO.widget.Menu,c=YAHOO.widget.MenuItem,AK=YAHOO.util.CustomEvent,k=YAHOO.env.ua,AQ=YAHOO.lang,AL="text",O="#",Q="-",L="helptext",n="url",AH="target",A="emphasis",N="strongemphasis",b="checked",w="submenu",H="disabled",B="selected",P="hassubmenu",U="checked-disabled",AI="hassubmenu-disabled",AD="hassubmenu-selected",T="checked-selected",q="onclick",J="classname",AJ="",i="OPTION",v="OPTGROUP",K="LI",AE="href",r="SELECT",X="DIV",AN='<em class="helptext">',a="<em>",I="</em>",W="<strong>",y="</strong>",Y="preventcontextoverlap",h="obj",AG="scope",t="none",V="visible",E=" ",m="MenuItem",AA="click",D="show",M="hide",S="li",AF='<a href="#"></a>',p=[["mouseOverEvent","mouseover"],["mouseOutEvent","mouseout"],["mouseDownEvent","mousedown"],["mouseUpEvent","mouseup"],["clickEvent",AA],["keyPressEvent","keypress"],["keyDownEvent","keydown"],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["destroyEvent","destroy"]],o={key:AL,value:AJ,validator:AQ.isString,suppressEvent:true},s={key:L,supercedes:[AL],suppressEvent:true},G={key:n,value:O,suppressEvent:true},AO={key:AH,suppressEvent:true},AP={key:A,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL]},d={key:N,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL]},l={key:b,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[H,B]},F={key:w,suppressEvent:true,supercedes:[H,B]},AM={key:H,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL,B]},f={key:B,value:false,validator:AQ.isBoolean,suppressEvent:true},u={key:q,suppressEvent:true},AC={key:J,value:null,validator:AQ.isString,suppressEvent:true},z={key:"keylistener",value:null,suppressEvent:true},C=null,e={};var Z=function(AU,AT){var AR=e[AU];if(!AR){e[AU]={};AR=e[AU];}var AS=AR[AT];if(!AS){AS=AU+Q+AT;AR[AT]=AS;}return AS;};var g=function(AR){x.addClass(this.element,Z(this.CSS_CLASS_NAME,AR));x.addClass(this._oAnchor,Z(this.CSS_LABEL_CLASS_NAME,AR));};var R=function(AR){x.removeClass(this.element,Z(this.CSS_CLASS_NAME,AR));x.removeClass(this._oAnchor,Z(this.CSS_LABEL_CLASS_NAME,AR));};c.prototype={CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:c,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,browser:j.prototype.browser,id:null,init:function(AR,Ab){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=AB;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var AX=this.cfg,AY=O,AT,Aa,AZ,AS,AV,AU,AW;if(AQ.isString(AR)){this._createRootNodeStructure();AX.queueProperty(AL,AR);}else{if(AR&&AR.tagName){switch(AR.tagName.toUpperCase()){case i:this._createRootNodeStructure();AX.queueProperty(AL,AR.text);AX.queueProperty(H,AR.disabled);this.value=AR.value;this.srcElement=AR;break;case v:this._createRootNodeStructure();AX.queueProperty(AL,AR.label);AX.queueProperty(H,AR.disabled);this.srcElement=AR;this._initSubTree();break;case K:AZ=x.getFirstChild(AR);if(AZ){AY=AZ.getAttribute(AE,2);AS=AZ.getAttribute(AH);AV=AZ.innerHTML;}this.srcElement=AR;this.element=AR;this._oAnchor=AZ;AX.setProperty(AL,AV,true);AX.setProperty(n,AY,true);AX.setProperty(AH,AS,true);this._initSubTree();break;}}}if(this.element){AU=(this.srcElement||this.element).id;if(!AU){AU=this.id||x.generateId();this.element.id=AU;}this.id=AU;x.addClass(this.element,this.CSS_CLASS_NAME);x.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);AW=p.length-1;do{Aa=p[AW];AT=this.createEvent(Aa[1]);AT.signature=AK.LIST;this[Aa[0]]=AT;}while(AW--);if(Ab){AX.applyConfig(Ab);}AX.fireQueue();}},_createRootNodeStructure:function(){var AR,AS;if(!C){C=document.createElement(S);C.innerHTML=AF;}AR=C.cloneNode(true);AR.className=this.CSS_CLASS_NAME;AS=AR.firstChild;AS.className=this.CSS_LABEL_CLASS_NAME;this.element=AR;this._oAnchor=AS;},_initSubTree:function(){var AX=this.srcElement,AT=this.cfg,AV,AU,AS,AR,AW;if(AX.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()==r){AT.setProperty(w,{id:x.generateId(),itemdata:AX.childNodes});}else{AV=AX.firstChild;AU=[];do{if(AV&&AV.tagName){switch(AV.tagName.toUpperCase()){case X:AT.setProperty(w,AV);break;case i:AU[AU.length]=AV;break;}}}while((AV=AV.nextSibling)); >-AS=AU.length;if(AS>0){AR=new this.SUBMENU_TYPE(x.generateId());AT.setProperty(w,AR);for(AW=0;AW<AS;AW++){AR.addItem((new AR.ITEM_TYPE(AU[AW])));}}}}},configText:function(Aa,AT,AV){var AS=AT[0],AU=this.cfg,AY=this._oAnchor,AR=AU.getProperty(L),AZ=AJ,AW=AJ,AX=AJ;if(AS){if(AR){AZ=AN+AR+I;}if(AU.getProperty(A)){AW=a;AX=I;}if(AU.getProperty(N)){AW=W;AX=y;}AY.innerHTML=(AW+AS+AX+AZ);}},configHelpText:function(AT,AS,AR){this.cfg.refireEvent(AL);},configURL:function(AT,AS,AR){var AV=AS[0];if(!AV){AV=O;}var AU=this._oAnchor;if(k.opera){AU.removeAttribute(AE);}AU.setAttribute(AE,AV);},configTarget:function(AU,AT,AS){var AR=AT[0],AV=this._oAnchor;if(AR&&AR.length>0){AV.setAttribute(AH,AR);}else{AV.removeAttribute(AH);}},configEmphasis:function(AT,AS,AR){var AV=AS[0],AU=this.cfg;if(AV&&AU.getProperty(N)){AU.setProperty(N,false);}AU.refireEvent(AL);},configStrongEmphasis:function(AU,AT,AS){var AR=AT[0],AV=this.cfg;if(AR&&AV.getProperty(A)){AV.setProperty(A,false);}AV.refireEvent(AL);},configChecked:function(AT,AS,AR){var AV=AS[0],AU=this.cfg;if(AV){g.call(this,b);}else{R.call(this,b);}AU.refireEvent(AL);if(AU.getProperty(H)){AU.refireEvent(H);}if(AU.getProperty(B)){AU.refireEvent(B);}},configDisabled:function(AT,AS,AR){var AV=AS[0],AW=this.cfg,AU=AW.getProperty(w),AX=AW.getProperty(b);if(AV){if(AW.getProperty(B)){AW.setProperty(B,false);}g.call(this,H);if(AU){g.call(this,AI);}if(AX){g.call(this,U);}}else{R.call(this,H);if(AU){R.call(this,AI);}if(AX){R.call(this,U);}}},configSelected:function(AT,AS,AR){var AX=this.cfg,AW=this._oAnchor,AV=AS[0],AY=AX.getProperty(b),AU=AX.getProperty(w);if(k.opera){AW.blur();}if(AV&&!AX.getProperty(H)){g.call(this,B);if(AU){g.call(this,AD);}if(AY){g.call(this,T);}}else{R.call(this,B);if(AU){R.call(this,AD);}if(AY){R.call(this,T);}}if(this.hasFocus()&&k.opera){AW.focus();}},_onSubmenuBeforeHide:function(AU,AT){var AV=this.parent,AR;function AS(){AV._oAnchor.blur();AR.beforeHideEvent.unsubscribe(AS);}if(AV.hasFocus()){AR=AV.parent;AR.beforeHideEvent.subscribe(AS);}},configSubmenu:function(AY,AT,AW){var AV=AT[0],AU=this.cfg,AS=this.parent&&this.parent.lazyLoad,AX,AZ,AR;if(AV){if(AV instanceof AB){AX=AV;AX.parent=this;AX.lazyLoad=AS;}else{if(AQ.isObject(AV)&&AV.id&&!AV.nodeType){AZ=AV.id;AR=AV;AR.lazyload=AS;AR.parent=this;AX=new this.SUBMENU_TYPE(AZ,AR);AU.setProperty(w,AX,true);}else{AX=new this.SUBMENU_TYPE(AV,{lazyload:AS,parent:this});AU.setProperty(w,AX,true);}}if(AX){AX.cfg.setProperty(Y,true);g.call(this,P);if(AU.getProperty(n)===O){AU.setProperty(n,(O+AX.id));}this._oSubmenu=AX;if(k.opera){AX.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);}}}else{R.call(this,P);if(this._oSubmenu){this._oSubmenu.destroy();}}if(AU.getProperty(H)){AU.refireEvent(H);}if(AU.getProperty(B)){AU.refireEvent(B);}},configOnClick:function(AT,AS,AR){var AU=AS[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=AU)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}if(!this._oOnclickAttributeValue&&AQ.isObject(AU)&&AQ.isFunction(AU.fn)){this.clickEvent.subscribe(AU.fn,((h in AU)?AU.obj:this),((AG in AU)?AU.scope:null));this._oOnclickAttributeValue=AU;}},configClassName:function(AU,AT,AS){var AR=AT[0];if(this._sClassName){x.removeClass(this.element,this._sClassName);}x.addClass(this.element,AR);this._sClassName=AR;},_dispatchClickEvent:function(){var AT=this,AS,AR;if(!AT.cfg.getProperty(H)){AS=x.getFirstChild(AT.element);if(k.ie){AS.fireEvent(q);}else{if((k.gecko&&k.gecko>=1.9)||k.opera||k.webkit){AR=document.createEvent("HTMLEvents");AR.initEvent(AA,true,true);}else{AR=document.createEvent("MouseEvents");AR.initMouseEvent(AA,true,true,window,0,0,0,0,0,false,false,false,false,0,null);}AS.dispatchEvent(AR);}}},_createKeyListener:function(AU,AT,AW){var AV=this,AS=AV.parent;var AR=new YAHOO.util.KeyListener(AS.element.ownerDocument,AW,{fn:AV._dispatchClickEvent,scope:AV,correctScope:true});if(AS.cfg.getProperty(V)){AR.enable();}AS.subscribe(D,AR.enable,null,AR);AS.subscribe(M,AR.disable,null,AR);AV._keyListener=AR;AS.unsubscribe(D,AV._createKeyListener,AW);},configKeyListener:function(AT,AS){var AV=AS[0],AU=this,AR=AU.parent;if(AU._keyData){AR.unsubscribe(D,AU._createKeyListener,AU._keyData);AU._keyData=null;}if(AU._keyListener){AR.unsubscribe(D,AU._keyListener.enable);AR.unsubscribe(M,AU._keyListener.disable);AU._keyListener.disable();AU._keyListener=null;}if(AV){AU._keyData=AV;AR.subscribe(D,AU._createKeyListener,AV,AU);}},initDefaultConfig:function(){var AR=this.cfg;AR.addProperty(o.key,{handler:this.configText,value:o.value,validator:o.validator,suppressEvent:o.suppressEvent});AR.addProperty(s.key,{handler:this.configHelpText,supercedes:s.supercedes,suppressEvent:s.suppressEvent});AR.addProperty(G.key,{handler:this.configURL,value:G.value,suppressEvent:G.suppressEvent});AR.addProperty(AO.key,{handler:this.configTarget,suppressEvent:AO.suppressEvent});AR.addProperty(AP.key,{handler:this.configEmphasis,value:AP.value,validator:AP.validator,suppressEvent:AP.suppressEvent,supercedes:AP.supercedes});AR.addProperty(d.key,{handler:this.configStrongEmphasis,value:d.value,validator:d.validator,suppressEvent:d.suppressEvent,supercedes:d.supercedes});AR.addProperty(l.key,{handler:this.configChecked,value:l.value,validator:l.validator,suppressEvent:l.suppressEvent,supercedes:l.supercedes});AR.addProperty(AM.key,{handler:this.configDisabled,value:AM.value,validator:AM.validator,suppressEvent:AM.suppressEvent});AR.addProperty(f.key,{handler:this.configSelected,value:f.value,validator:f.validator,suppressEvent:f.suppressEvent});AR.addProperty(F.key,{handler:this.configSubmenu,supercedes:F.supercedes,suppressEvent:F.suppressEvent});AR.addProperty(u.key,{handler:this.configOnClick,suppressEvent:u.suppressEvent});AR.addProperty(AC.key,{handler:this.configClassName,value:AC.value,validator:AC.validator,suppressEvent:AC.suppressEvent});AR.addProperty(z.key,{handler:this.configKeyListener,value:z.value,suppressEvent:z.suppressEvent}); >-},getNextSibling:function(){var AR=function(AX){return(AX.nodeName.toLowerCase()==="ul");},AV=this.element,AU=x.getNextSibling(AV),AT,AS,AW;if(!AU){AT=AV.parentNode;AS=x.getNextSiblingBy(AT,AR);if(AS){AW=AS;}else{AW=x.getFirstChildBy(AT.parentNode,AR);}AU=x.getFirstChild(AW);}return YAHOO.widget.MenuManager.getMenuItem(AU.id);},getNextEnabledSibling:function(){var AR=this.getNextSibling();return(AR.cfg.getProperty(H)||AR.element.style.display==t)?AR.getNextEnabledSibling():AR;},getPreviousSibling:function(){var AR=function(AX){return(AX.nodeName.toLowerCase()==="ul");},AV=this.element,AU=x.getPreviousSibling(AV),AT,AS,AW;if(!AU){AT=AV.parentNode;AS=x.getPreviousSiblingBy(AT,AR);if(AS){AW=AS;}else{AW=x.getLastChildBy(AT.parentNode,AR);}AU=x.getLastChild(AW);}return YAHOO.widget.MenuManager.getMenuItem(AU.id);},getPreviousEnabledSibling:function(){var AR=this.getPreviousSibling();return(AR.cfg.getProperty(H)||AR.element.style.display==t)?AR.getPreviousEnabledSibling():AR;},focus:function(){var AU=this.parent,AT=this._oAnchor,AR=AU.activeItem;function AS(){try{if(!(k.ie&&!document.hasFocus())){if(AR){AR.blurEvent.fire();}AT.focus();this.focusEvent.fire();}}catch(AV){}}if(!this.cfg.getProperty(H)&&AU&&AU.cfg.getProperty(V)&&this.element.style.display!=t){AQ.later(0,this,AS);}},blur:function(){var AR=this.parent;if(!this.cfg.getProperty(H)&&AR&&AR.cfg.getProperty(V)){AQ.later(0,this,function(){try{this._oAnchor.blur();this.blurEvent.fire();}catch(AS){}},0);}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var AT=this.element,AS,AR,AV,AU;if(AT){AS=this.cfg.getProperty(w);if(AS){AS.destroy();}AR=AT.parentNode;if(AR){AR.removeChild(AT);this.destroyEvent.fire();}AU=p.length-1;do{AV=p[AU];this[AV[0]].unsubscribeAll();}while(AU--);this.cfg.configChangedEvent.unsubscribeAll();}},toString:function(){var AS=m,AR=this.id;if(AR){AS+=(E+AR);}return AS;}};AQ.augmentProto(c,YAHOO.util.EventProvider);})();(function(){var B="xy",C="mousedown",F="ContextMenu",J=" ";YAHOO.widget.ContextMenu=function(L,K){YAHOO.widget.ContextMenu.superclass.constructor.call(this,L,K);};var I=YAHOO.util.Event,E=YAHOO.env.ua,G=YAHOO.widget.ContextMenu,A={"TRIGGER_CONTEXT_MENU":"triggerContextMenu","CONTEXT_MENU":(E.opera?C:"contextmenu"),"CLICK":"click"},H={key:"trigger",suppressEvent:true};function D(L,K,M){this.cfg.setProperty(B,M);this.beforeShowEvent.unsubscribe(D,M);}YAHOO.lang.extend(G,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(L,K){G.superclass.init.call(this,L);this.beforeInitEvent.fire(G);if(K){this.cfg.applyConfig(K,true);}this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(A.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var K=this._oTrigger;if(K){I.removeListener(K,A.CONTEXT_MENU,this._onTriggerContextMenu);if(E.opera){I.removeListener(K,A.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(L,K){if(L.ctrlKey){I.stopEvent(L);}},_onTriggerContextMenu:function(M,K){var L;if(!(M.type==C&&!M.ctrlKey)){this.contextEventTarget=I.getTarget(M);this.triggerContextMenuEvent.fire(M);if(!this._bCancelled){I.stopEvent(M);YAHOO.widget.MenuManager.hideVisible();L=I.getXY(M);if(!YAHOO.util.Dom.inDocument(this.element)){this.beforeShowEvent.subscribe(D,L);}else{this.cfg.setProperty(B,L);}this.show();}this._bCancelled=false;}},toString:function(){var L=F,K=this.id;if(K){L+=(J+K);}return L;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.key,{handler:this.configTrigger,suppressEvent:H.suppressEvent});},destroy:function(){this._removeEventHandlers();G.superclass.destroy.call(this);},configTrigger:function(L,K,N){var M=K[0];if(M){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=M;I.on(M,A.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(E.opera){I.on(M,A.CLICK,this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=YAHOO.widget.MenuItem;(function(){var D=YAHOO.lang,N="static",M="dynamic,"+N,A="disabled",F="selected",B="autosubmenudisplay",G="submenu",C="visible",Q=" ",H="submenutoggleregion",P="MenuBar";YAHOO.widget.MenuBar=function(T,S){YAHOO.widget.MenuBar.superclass.constructor.call(this,T,S);};function O(T){var S=false;if(D.isString(T)){S=(M.indexOf((T.toLowerCase()))!=-1);}return S;}var R=YAHOO.util.Event,L=YAHOO.widget.MenuBar,K={key:"position",value:N,validator:O,supercedes:[C]},E={key:"submenualignment",value:["tl","bl"]},J={key:B,value:false,validator:D.isBoolean,suppressEvent:true},I={key:H,value:false,validator:D.isBoolean};D.extend(L,YAHOO.widget.Menu,{init:function(T,S){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}L.superclass.init.call(this,T);this.beforeInitEvent.fire(L);if(S){this.cfg.applyConfig(S,true);}this.initEvent.fire(L);},CSS_CLASS_NAME:"yuimenubar",SUBMENU_TOGGLE_REGION_WIDTH:20,_onKeyDown:function(U,T,Y){var S=T[0],Z=T[1],W,X,V;if(Z&&!Z.cfg.getProperty(A)){X=Z.cfg;switch(S.keyCode){case 37:case 39:if(Z==this.activeItem&&!X.getProperty(F)){X.setProperty(F,true);}else{V=(S.keyCode==37)?Z.getPreviousEnabledSibling():Z.getNextEnabledSibling();if(V){this.clearActiveItem();V.cfg.setProperty(F,true);W=V.cfg.getProperty(G);if(W){W.show();W.setInitialFocus();}else{V.focus();}}}R.preventDefault(S);break;case 40:if(this.activeItem!=Z){this.clearActiveItem();X.setProperty(F,true);Z.focus();}W=X.getProperty(G);if(W){if(W.cfg.getProperty(C)){W.setInitialSelection();W.setInitialFocus();}else{W.show();W.setInitialFocus();}}R.preventDefault(S);break;}}if(S.keyCode==27&&this.activeItem){W=this.activeItem.cfg.getProperty(G);if(W&&W.cfg.getProperty(C)){W.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty(F,false);this.activeItem.blur();}R.preventDefault(S);}},_onClick:function(e,Y,b){L.superclass._onClick.call(this,e,Y,b); >-var d=Y[1],T=true,S,f,U,W,Z,a,c,V;var X=function(){if(a.cfg.getProperty(C)){a.hide();}else{a.show();}};if(d&&!d.cfg.getProperty(A)){f=Y[0];U=R.getTarget(f);W=this.activeItem;Z=this.cfg;if(W&&W!=d){this.clearActiveItem();}d.cfg.setProperty(F,true);a=d.cfg.getProperty(G);if(a){S=d.element;c=YAHOO.util.Dom.getX(S);V=c+(S.offsetWidth-this.SUBMENU_TOGGLE_REGION_WIDTH);if(Z.getProperty(H)){if(R.getPageX(f)>V){X();R.preventDefault(f);T=false;}}else{X();}}}return T;},configSubmenuToggle:function(U,T){var S=T[0];if(S){this.cfg.setProperty(B,false);}},toString:function(){var T=P,S=this.id;if(S){T+=(Q+S);}return T;},initDefaultConfig:function(){L.superclass.initDefaultConfig.call(this);var S=this.cfg;S.addProperty(K.key,{handler:this.configPosition,value:K.value,validator:K.validator,supercedes:K.supercedes});S.addProperty(E.key,{value:E.value,suppressEvent:E.suppressEvent});S.addProperty(J.key,{value:J.value,validator:J.validator,suppressEvent:J.suppressEvent});S.addProperty(I.key,{value:I.value,validator:I.validator,handler:this.configSubmenuToggle});}});}());YAHOO.widget.MenuBarItem=function(B,A){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,B,A);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(B,A){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,B);var C=this.cfg;if(A){C.applyConfig(A,true);}C.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var A="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){A+=(": "+this.cfg.getProperty("text"));}return A;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.8.0r4",build:"2449"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu.js b/koha-tmpl/intranet-tmpl/lib/yui/menu/menu.js >deleted file mode 100644 >index 93dc88df83..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/menu/menu.js >+++ /dev/null >@@ -1,9823 +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 menu >-* @description <p>The Menu family of components features a collection of >-* controls that make it easy to add menus to your website or web application. >-* With the Menu Controls you can create website fly-out menus, customized >-* context menus, or application-style menu bars with just a small amount of >-* scripting.</p><p>The Menu family of controls features:</p> >-* <ul> >-* <li>Keyboard and mouse navigation.</li> >-* <li>A rich event model that provides access to all of a menu's >-* interesting moments.</li> >-* <li>Support for >-* <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive >-* Enhancement</a>; Menus can be created from simple, >-* semantic markup on the page or purely through JavaScript.</li> >-* </ul> >-* @title Menu >-* @namespace YAHOO.widget >-* @requires Event, Dom, Container >-*/ >-(function () { >- >- var UA = YAHOO.env.ua, >- Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Lang = YAHOO.lang, >- >- _DIV = "DIV", >- _HD = "hd", >- _BD = "bd", >- _FT = "ft", >- _LI = "LI", >- _DISABLED = "disabled", >- _MOUSEOVER = "mouseover", >- _MOUSEOUT = "mouseout", >- _MOUSEDOWN = "mousedown", >- _MOUSEUP = "mouseup", >- _CLICK = "click", >- _KEYDOWN = "keydown", >- _KEYUP = "keyup", >- _KEYPRESS = "keypress", >- _CLICK_TO_HIDE = "clicktohide", >- _POSITION = "position", >- _DYNAMIC = "dynamic", >- _SHOW_DELAY = "showdelay", >- _SELECTED = "selected", >- _VISIBLE = "visible", >- _UL = "UL", >- _MENUMANAGER = "MenuManager"; >- >- >- /** >- * Singleton that manages a collection of all menus and menu items. Listens >- * for DOM events at the document level and dispatches the events to the >- * corresponding menu or menu item. >- * >- * @namespace YAHOO.widget >- * @class MenuManager >- * @static >- */ >- YAHOO.widget.MenuManager = function () { >- >- // Private member variables >- >- >- // Flag indicating if the DOM event handlers have been attached >- >- var m_bInitializedEventHandlers = false, >- >- >- // Collection of menus >- >- m_oMenus = {}, >- >- >- // Collection of visible menus >- >- m_oVisibleMenus = {}, >- >- >- // Collection of menu items >- >- m_oItems = {}, >- >- >- // Map of DOM event types to their equivalent CustomEvent types >- >- m_oEventTypes = { >- "click": "clickEvent", >- "mousedown": "mouseDownEvent", >- "mouseup": "mouseUpEvent", >- "mouseover": "mouseOverEvent", >- "mouseout": "mouseOutEvent", >- "keydown": "keyDownEvent", >- "keyup": "keyUpEvent", >- "keypress": "keyPressEvent", >- "focus": "focusEvent", >- "focusin": "focusEvent", >- "blur": "blurEvent", >- "focusout": "blurEvent" >- }, >- >- >- m_oFocusedMenuItem = null; >- >- >- >- // Private methods >- >- >- /** >- * @method getMenuRootElement >- * @description Finds the root DIV node of a menu or the root LI node of >- * a menu item. >- * @private >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object >- * specifying an HTML element. >- */ >- function getMenuRootElement(p_oElement) { >- >- var oParentNode, >- returnVal; >- >- if (p_oElement && p_oElement.tagName) { >- >- switch (p_oElement.tagName.toUpperCase()) { >- >- case _DIV: >- >- oParentNode = p_oElement.parentNode; >- >- // Check if the DIV is the inner "body" node of a menu >- >- if (( >- Dom.hasClass(p_oElement, _HD) || >- Dom.hasClass(p_oElement, _BD) || >- Dom.hasClass(p_oElement, _FT) >- ) && >- oParentNode && >- oParentNode.tagName && >- oParentNode.tagName.toUpperCase() == _DIV) { >- >- returnVal = oParentNode; >- >- } >- else { >- >- returnVal = p_oElement; >- >- } >- >- break; >- >- case _LI: >- >- returnVal = p_oElement; >- >- break; >- >- default: >- >- oParentNode = p_oElement.parentNode; >- >- if (oParentNode) { >- >- returnVal = getMenuRootElement(oParentNode); >- >- } >- >- break; >- >- } >- >- } >- >- return returnVal; >- >- } >- >- >- >- // Private event handlers >- >- >- /** >- * @method onDOMEvent >- * @description Generic, global event handler for all of a menu's >- * DOM-based events. This listens for events against the document >- * object. If the target of a given event is a member of a menu or >- * menu item's DOM, the instance's corresponding Custom Event is fired. >- * @private >- * @param {Event} p_oEvent Object representing the DOM event object >- * passed back by the event utility (YAHOO.util.Event). >- */ >- function onDOMEvent(p_oEvent) { >- >- // Get the target node of the DOM event >- >- var oTarget = Event.getTarget(p_oEvent), >- >- // See if the target of the event was a menu, or a menu item >- >- oElement = getMenuRootElement(oTarget), >- bFireEvent = true, >- sEventType = p_oEvent.type, >- sCustomEventType, >- sTagName, >- sId, >- oMenuItem, >- oMenu; >- >- >- if (oElement) { >- >- sTagName = oElement.tagName.toUpperCase(); >- >- if (sTagName == _LI) { >- >- sId = oElement.id; >- >- if (sId && m_oItems[sId]) { >- >- oMenuItem = m_oItems[sId]; >- oMenu = oMenuItem.parent; >- >- } >- >- } >- else if (sTagName == _DIV) { >- >- if (oElement.id) { >- >- oMenu = m_oMenus[oElement.id]; >- >- } >- >- } >- >- } >- >- >- if (oMenu) { >- >- sCustomEventType = m_oEventTypes[sEventType]; >- >- /* >- There is an inconsistency between Firefox for Mac OS X and >- Firefox Windows & Linux regarding the triggering of the >- display of the browser's context menu and the subsequent >- firing of the "click" event. In Firefox for Windows & Linux, >- when the user triggers the display of the browser's context >- menu the "click" event also fires for the document object, >- even though the "click" event did not fire for the element >- that was the original target of the "contextmenu" event. >- This is unique to Firefox on Windows & Linux. For all >- other A-Grade browsers, including Firefox for Mac OS X, the >- "click" event doesn't fire for the document object. >- >- This bug in Firefox for Windows affects Menu, as Menu >- instances listen for events at the document level and >- dispatches Custom Events of the same name. Therefore users >- of Menu will get an unwanted firing of the "click" >- custom event. The following line fixes this bug. >- */ >- >- >- >- if (sEventType == "click" && >- (UA.gecko && oMenu.platform != "mac") && >- p_oEvent.button > 0) { >- >- bFireEvent = false; >- >- } >- >- // Fire the Custom Event that corresponds the current DOM event >- >- if (bFireEvent && oMenuItem && !oMenuItem.cfg.getProperty(_DISABLED)) { >- oMenuItem[sCustomEventType].fire(p_oEvent); >- } >- >- if (bFireEvent) { >- oMenu[sCustomEventType].fire(p_oEvent, oMenuItem); >- } >- >- } >- else if (sEventType == _MOUSEDOWN) { >- >- /* >- If the target of the event wasn't a menu, hide all >- dynamically positioned menus >- */ >- >- for (var i in m_oVisibleMenus) { >- >- if (Lang.hasOwnProperty(m_oVisibleMenus, i)) { >- >- oMenu = m_oVisibleMenus[i]; >- >- if (oMenu.cfg.getProperty(_CLICK_TO_HIDE) && >- !(oMenu instanceof YAHOO.widget.MenuBar) && >- oMenu.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- oMenu.hide(); >- >- // 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(); >- } >- >- } >- else { >- >- if (oMenu.cfg.getProperty(_SHOW_DELAY) > 0) { >- >- oMenu._cancelShowDelay(); >- >- } >- >- >- if (oMenu.activeItem) { >- >- oMenu.activeItem.blur(); >- oMenu.activeItem.cfg.setProperty(_SELECTED, false); >- >- oMenu.activeItem = null; >- >- } >- >- } >- >- } >- >- } >- >- } >- >- } >- >- >- /** >- * @method onMenuDestroy >- * @description "destroy" event handler for a 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. >- * @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event. >- */ >- function onMenuDestroy(p_sType, p_aArgs, p_oMenu) { >- >- if (m_oMenus[p_oMenu.id]) { >- >- this.removeMenu(p_oMenu); >- >- } >- >- } >- >- >- /** >- * @method onMenuFocus >- * @description "focus" event handler for a MenuItem instance. >- * @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. >- */ >- function onMenuFocus(p_sType, p_aArgs) { >- >- var oItem = p_aArgs[1]; >- >- if (oItem) { >- >- m_oFocusedMenuItem = oItem; >- >- } >- >- } >- >- >- /** >- * @method onMenuBlur >- * @description "blur" event handler for a MenuItem instance. >- * @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. >- */ >- function onMenuBlur(p_sType, p_aArgs) { >- >- m_oFocusedMenuItem = null; >- >- } >- >- >- /** >- * @method onMenuVisibleConfigChange >- * @description Event handler for when the "visible" configuration >- * property of a Menu instance changes. >- * @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. >- */ >- function onMenuVisibleConfigChange(p_sType, p_aArgs) { >- >- var bVisible = p_aArgs[0], >- sId = this.id; >- >- if (bVisible) { >- >- m_oVisibleMenus[sId] = this; >- >- >- } >- else if (m_oVisibleMenus[sId]) { >- >- delete m_oVisibleMenus[sId]; >- >- >- } >- >- } >- >- >- /** >- * @method onItemDestroy >- * @description "destroy" event handler for a MenuItem instance. >- * @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. >- */ >- function onItemDestroy(p_sType, p_aArgs) { >- >- removeItem(this); >- >- } >- >- >- /** >- * @method removeItem >- * @description Removes a MenuItem instance from the MenuManager's collection of MenuItems. >- * @private >- * @param {MenuItem} p_oMenuItem The MenuItem instance to be removed. >- */ >- function removeItem(p_oMenuItem) { >- >- var sId = p_oMenuItem.id; >- >- if (sId && m_oItems[sId]) { >- >- if (m_oFocusedMenuItem == p_oMenuItem) { >- >- m_oFocusedMenuItem = null; >- >- } >- >- delete m_oItems[sId]; >- >- p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy); >- >- >- } >- >- } >- >- >- /** >- * @method onItemAdded >- * @description "itemadded" event handler for a Menu instance. >- * @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. >- */ >- function onItemAdded(p_sType, p_aArgs) { >- >- var oItem = p_aArgs[0], >- sId; >- >- if (oItem instanceof YAHOO.widget.MenuItem) { >- >- sId = oItem.id; >- >- if (!m_oItems[sId]) { >- >- m_oItems[sId] = oItem; >- >- oItem.destroyEvent.subscribe(onItemDestroy); >- >- >- } >- >- } >- >- } >- >- >- return { >- >- // Privileged methods >- >- >- /** >- * @method addMenu >- * @description Adds a menu to the collection of known menus. >- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu >- * instance to be added. >- */ >- addMenu: function (p_oMenu) { >- >- var oDoc; >- >- if (p_oMenu instanceof YAHOO.widget.Menu && p_oMenu.id && >- !m_oMenus[p_oMenu.id]) { >- >- m_oMenus[p_oMenu.id] = p_oMenu; >- >- >- if (!m_bInitializedEventHandlers) { >- >- oDoc = document; >- >- Event.on(oDoc, _MOUSEOVER, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEOUT, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEDOWN, onDOMEvent, this, true); >- Event.on(oDoc, _MOUSEUP, onDOMEvent, this, true); >- Event.on(oDoc, _CLICK, onDOMEvent, this, true); >- Event.on(oDoc, _KEYDOWN, onDOMEvent, this, true); >- Event.on(oDoc, _KEYUP, onDOMEvent, this, true); >- Event.on(oDoc, _KEYPRESS, onDOMEvent, this, true); >- >- Event.onFocus(oDoc, onDOMEvent, this, true); >- Event.onBlur(oDoc, onDOMEvent, this, true); >- >- m_bInitializedEventHandlers = true; >- >- >- } >- >- p_oMenu.cfg.subscribeToConfigEvent(_VISIBLE, onMenuVisibleConfigChange); >- p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this); >- p_oMenu.itemAddedEvent.subscribe(onItemAdded); >- p_oMenu.focusEvent.subscribe(onMenuFocus); >- p_oMenu.blurEvent.subscribe(onMenuBlur); >- >- >- } >- >- }, >- >- >- /** >- * @method removeMenu >- * @description Removes a menu from the collection of known menus. >- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu >- * instance to be removed. >- */ >- removeMenu: function (p_oMenu) { >- >- var sId, >- aItems, >- i; >- >- if (p_oMenu) { >- >- sId = p_oMenu.id; >- >- if ((sId in m_oMenus) && (m_oMenus[sId] == p_oMenu)) { >- >- // Unregister each menu item >- >- aItems = p_oMenu.getItems(); >- >- if (aItems && aItems.length > 0) { >- >- i = aItems.length - 1; >- >- do { >- >- removeItem(aItems[i]); >- >- } >- while (i--); >- >- } >- >- >- // Unregister the menu >- >- delete m_oMenus[sId]; >- >- >- >- /* >- Unregister the menu from the collection of >- visible menus >- */ >- >- if ((sId in m_oVisibleMenus) && (m_oVisibleMenus[sId] == p_oMenu)) { >- >- delete m_oVisibleMenus[sId]; >- >- >- } >- >- >- // Unsubscribe event listeners >- >- if (p_oMenu.cfg) { >- >- p_oMenu.cfg.unsubscribeFromConfigEvent(_VISIBLE, >- onMenuVisibleConfigChange); >- >- } >- >- p_oMenu.destroyEvent.unsubscribe(onMenuDestroy, >- p_oMenu); >- >- p_oMenu.itemAddedEvent.unsubscribe(onItemAdded); >- p_oMenu.focusEvent.unsubscribe(onMenuFocus); >- p_oMenu.blurEvent.unsubscribe(onMenuBlur); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method hideVisible >- * @description Hides all visible, dynamically positioned menus >- * (excluding instances of YAHOO.widget.MenuBar). >- */ >- hideVisible: function () { >- >- var oMenu; >- >- for (var i in m_oVisibleMenus) { >- >- if (Lang.hasOwnProperty(m_oVisibleMenus, i)) { >- >- oMenu = m_oVisibleMenus[i]; >- >- if (!(oMenu instanceof YAHOO.widget.MenuBar) && >- oMenu.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- oMenu.hide(); >- >- } >- >- } >- >- } >- >- }, >- >- >- /** >- * @method getVisible >- * @description Returns a collection of all visible menus registered >- * with the menu manger. >- * @return {Object} >- */ >- getVisible: function () { >- >- return m_oVisibleMenus; >- >- }, >- >- >- /** >- * @method getMenus >- * @description Returns a collection of all menus registered with the >- * menu manger. >- * @return {Object} >- */ >- getMenus: function () { >- >- return m_oMenus; >- >- }, >- >- >- /** >- * @method getMenu >- * @description Returns a menu with the specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><div></code> element representing the menu to >- * be retrieved. >- * @return {YAHOO.widget.Menu} >- */ >- getMenu: function (p_sId) { >- >- var returnVal; >- >- if (p_sId in m_oMenus) { >- >- returnVal = m_oMenus[p_sId]; >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getMenuItem >- * @description Returns a menu item with the specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><li></code> element representing the menu item to >- * be retrieved. >- * @return {YAHOO.widget.MenuItem} >- */ >- getMenuItem: function (p_sId) { >- >- var returnVal; >- >- if (p_sId in m_oItems) { >- >- returnVal = m_oItems[p_sId]; >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getMenuItemGroup >- * @description Returns an array of menu item instances whose >- * corresponding <code><li></code> elements are child >- * nodes of the <code><ul></code> element with the >- * specified id. >- * @param {String} p_sId String specifying the id of the >- * <code><ul></code> element representing the group of >- * menu items to be retrieved. >- * @return {Array} >- */ >- getMenuItemGroup: function (p_sId) { >- >- var oUL = Dom.get(p_sId), >- aItems, >- oNode, >- oItem, >- sId, >- returnVal; >- >- >- if (oUL && oUL.tagName && oUL.tagName.toUpperCase() == _UL) { >- >- oNode = oUL.firstChild; >- >- if (oNode) { >- >- aItems = []; >- >- do { >- >- sId = oNode.id; >- >- if (sId) { >- >- oItem = this.getMenuItem(sId); >- >- if (oItem) { >- >- aItems[aItems.length] = oItem; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- >- if (aItems.length > 0) { >- >- returnVal = aItems; >- >- } >- >- } >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method getFocusedMenuItem >- * @description Returns a reference to the menu item that currently >- * has focus. >- * @return {YAHOO.widget.MenuItem} >- */ >- getFocusedMenuItem: function () { >- >- return m_oFocusedMenuItem; >- >- }, >- >- >- /** >- * @method getFocusedMenu >- * @description Returns a reference to the menu that currently >- * has focus. >- * @return {YAHOO.widget.Menu} >- */ >- getFocusedMenu: function () { >- >- var returnVal; >- >- if (m_oFocusedMenuItem) { >- >- returnVal = m_oFocusedMenuItem.parent.getRoot(); >- >- } >- >- return returnVal; >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the menu manager. >- * @return {String} >- */ >- toString: function () { >- >- return _MENUMANAGER; >- >- } >- >- }; >- >- }(); >- >-})(); >- >- >- >-(function () { >- >- var Lang = YAHOO.lang, >- >- // String constants >- >- _MENU = "Menu", >- _DIV_UPPERCASE = "DIV", >- _DIV_LOWERCASE = "div", >- _ID = "id", >- _SELECT = "SELECT", >- _XY = "xy", >- _Y = "y", >- _UL_UPPERCASE = "UL", >- _UL_LOWERCASE = "ul", >- _FIRST_OF_TYPE = "first-of-type", >- _LI = "LI", >- _OPTGROUP = "OPTGROUP", >- _OPTION = "OPTION", >- _DISABLED = "disabled", >- _NONE = "none", >- _SELECTED = "selected", >- _GROUP_INDEX = "groupindex", >- _INDEX = "index", >- _SUBMENU = "submenu", >- _VISIBLE = "visible", >- _HIDE_DELAY = "hidedelay", >- _POSITION = "position", >- _DYNAMIC = "dynamic", >- _STATIC = "static", >- _DYNAMIC_STATIC = _DYNAMIC + "," + _STATIC, >- _URL = "url", >- _HASH = "#", >- _TARGET = "target", >- _MAX_HEIGHT = "maxheight", >- _TOP_SCROLLBAR = "topscrollbar", >- _BOTTOM_SCROLLBAR = "bottomscrollbar", >- _UNDERSCORE = "_", >- _TOP_SCROLLBAR_DISABLED = _TOP_SCROLLBAR + _UNDERSCORE + _DISABLED, >- _BOTTOM_SCROLLBAR_DISABLED = _BOTTOM_SCROLLBAR + _UNDERSCORE + _DISABLED, >- _MOUSEMOVE = "mousemove", >- _SHOW_DELAY = "showdelay", >- _SUBMENU_HIDE_DELAY = "submenuhidedelay", >- _IFRAME = "iframe", >- _CONSTRAIN_TO_VIEWPORT = "constraintoviewport", >- _PREVENT_CONTEXT_OVERLAP = "preventcontextoverlap", >- _SUBMENU_ALIGNMENT = "submenualignment", >- _AUTO_SUBMENU_DISPLAY = "autosubmenudisplay", >- _CLICK_TO_HIDE = "clicktohide", >- _CONTAINER = "container", >- _SCROLL_INCREMENT = "scrollincrement", >- _MIN_SCROLL_HEIGHT = "minscrollheight", >- _CLASSNAME = "classname", >- _SHADOW = "shadow", >- _KEEP_OPEN = "keepopen", >- _HD = "hd", >- _HAS_TITLE = "hastitle", >- _CONTEXT = "context", >- _EMPTY_STRING = "", >- _MOUSEDOWN = "mousedown", >- _KEYDOWN = "keydown", >- _HEIGHT = "height", >- _WIDTH = "width", >- _PX = "px", >- _EFFECT = "effect", >- _MONITOR_RESIZE = "monitorresize", >- _DISPLAY = "display", >- _BLOCK = "block", >- _VISIBILITY = "visibility", >- _ABSOLUTE = "absolute", >- _ZINDEX = "zindex", >- _YUI_MENU_BODY_SCROLLED = "yui-menu-body-scrolled", >- _NON_BREAKING_SPACE = " ", >- _SPACE = " ", >- _MOUSEOVER = "mouseover", >- _MOUSEOUT = "mouseout", >- _ITEM_ADDED = "itemAdded", >- _ITEM_REMOVED = "itemRemoved", >- _HIDDEN = "hidden", >- _YUI_MENU_SHADOW = "yui-menu-shadow", >- _YUI_MENU_SHADOW_VISIBLE = _YUI_MENU_SHADOW + "-visible", >- _YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE = _YUI_MENU_SHADOW + _SPACE + _YUI_MENU_SHADOW_VISIBLE; >- >- >-/** >-* The Menu class creates a container that holds a vertical list representing >-* a set of options or commands. Menu is the base class for all >-* menu containers. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source >-* for the menu. >-* @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 menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement >-* Object specifying the <code><select></code> element to be used as >-* the data source for the menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu. See configuration class documentation for >-* more details. >-* @namespace YAHOO.widget >-* @class Menu >-* @constructor >-* @extends YAHOO.widget.Overlay >-*/ >-YAHOO.widget.Menu = function (p_oElement, p_oConfig) { >- >- if (p_oConfig) { >- >- this.parent = p_oConfig.parent; >- this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload; >- this.itemData = p_oConfig.itemData || p_oConfig.itemdata; >- >- } >- >- >- YAHOO.widget.Menu.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >- >-/** >-* @method checkPosition >-* @description Checks to make sure that the value of the "position" property >-* is one of the supported strings. Returns true if the position is supported. >-* @private >-* @param {Object} p_sPosition String specifying the position of the menu. >-* @return {Boolean} >-*/ >-function checkPosition(p_sPosition) { >- >- var returnVal = false; >- >- if (Lang.isString(p_sPosition)) { >- >- returnVal = (_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase())) != -1); >- >- } >- >- return returnVal; >- >-} >- >- >-var Dom = YAHOO.util.Dom, >- Event = YAHOO.util.Event, >- Module = YAHOO.widget.Module, >- Overlay = YAHOO.widget.Overlay, >- Menu = YAHOO.widget.Menu, >- MenuManager = YAHOO.widget.MenuManager, >- CustomEvent = YAHOO.util.CustomEvent, >- UA = YAHOO.env.ua, >- >- m_oShadowTemplate, >- >- bFocusListenerInitialized = false, >- >- oFocusedElement, >- >- EVENT_TYPES = [ >- >- ["mouseOverEvent", _MOUSEOVER], >- ["mouseOutEvent", _MOUSEOUT], >- ["mouseDownEvent", _MOUSEDOWN], >- ["mouseUpEvent", "mouseup"], >- ["clickEvent", "click"], >- ["keyPressEvent", "keypress"], >- ["keyDownEvent", _KEYDOWN], >- ["keyUpEvent", "keyup"], >- ["focusEvent", "focus"], >- ["blurEvent", "blur"], >- ["itemAddedEvent", _ITEM_ADDED], >- ["itemRemovedEvent", _ITEM_REMOVED] >- >- ], >- >- VISIBLE_CONFIG = { >- key: _VISIBLE, >- value: false, >- validator: Lang.isBoolean >- }, >- >- CONSTRAIN_TO_VIEWPORT_CONFIG = { >- key: _CONSTRAIN_TO_VIEWPORT, >- value: true, >- validator: Lang.isBoolean, >- supercedes: [_IFRAME,"x",_Y,_XY] >- }, >- >- PREVENT_CONTEXT_OVERLAP_CONFIG = { >- key: _PREVENT_CONTEXT_OVERLAP, >- value: true, >- validator: Lang.isBoolean, >- supercedes: [_CONSTRAIN_TO_VIEWPORT] >- }, >- >- POSITION_CONFIG = { >- key: _POSITION, >- value: _DYNAMIC, >- validator: checkPosition, >- supercedes: [_VISIBLE, _IFRAME] >- }, >- >- SUBMENU_ALIGNMENT_CONFIG = { >- key: _SUBMENU_ALIGNMENT, >- value: ["tl","tr"] >- }, >- >- AUTO_SUBMENU_DISPLAY_CONFIG = { >- key: _AUTO_SUBMENU_DISPLAY, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SHOW_DELAY_CONFIG = { >- key: _SHOW_DELAY, >- value: 250, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- HIDE_DELAY_CONFIG = { >- key: _HIDE_DELAY, >- value: 0, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- SUBMENU_HIDE_DELAY_CONFIG = { >- key: _SUBMENU_HIDE_DELAY, >- value: 250, >- validator: Lang.isNumber, >- suppressEvent: true >- }, >- >- CLICK_TO_HIDE_CONFIG = { >- key: _CLICK_TO_HIDE, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- CONTAINER_CONFIG = { >- key: _CONTAINER, >- suppressEvent: true >- }, >- >- SCROLL_INCREMENT_CONFIG = { >- key: _SCROLL_INCREMENT, >- value: 1, >- validator: Lang.isNumber, >- supercedes: [_MAX_HEIGHT], >- suppressEvent: true >- }, >- >- MIN_SCROLL_HEIGHT_CONFIG = { >- key: _MIN_SCROLL_HEIGHT, >- value: 90, >- validator: Lang.isNumber, >- supercedes: [_MAX_HEIGHT], >- suppressEvent: true >- }, >- >- MAX_HEIGHT_CONFIG = { >- key: _MAX_HEIGHT, >- value: 0, >- validator: Lang.isNumber, >- supercedes: [_IFRAME], >- suppressEvent: true >- }, >- >- CLASS_NAME_CONFIG = { >- key: _CLASSNAME, >- value: null, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- DISABLED_CONFIG = { >- key: _DISABLED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SHADOW_CONFIG = { >- key: _SHADOW, >- value: true, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_VISIBLE] >- }, >- >- KEEP_OPEN_CONFIG = { >- key: _KEEP_OPEN, >- value: false, >- validator: Lang.isBoolean >- }; >- >- >-function onDocFocus(event) { >- >- oFocusedElement = Event.getTarget(event); >- >-} >- >- >- >-YAHOO.lang.extend(Menu, Overlay, { >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* menu's <code><div></code> element. >-* @default "yuimenu" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenu", >- >- >-/** >-* @property ITEM_TYPE >-* @description Object representing the type of menu item to instantiate and >-* add when parsing the child nodes (either <code><li></code> element, >-* <code><optgroup></code> element or <code><option></code>) >-* of the menu's source HTML element. >-* @default YAHOO.widget.MenuItem >-* @final >-* @type YAHOO.widget.MenuItem >-*/ >-ITEM_TYPE: null, >- >- >-/** >-* @property GROUP_TITLE_TAG_NAME >-* @description String representing the tagname of the HTML element used to >-* title the menu's item groups. >-* @default H6 >-* @final >-* @type String >-*/ >-GROUP_TITLE_TAG_NAME: "h6", >- >- >-/** >-* @property OFF_SCREEN_POSITION >-* @description Array representing the default x and y position that a menu >-* should have when it is positioned outside the viewport by the >-* "poistionOffScreen" method. >-* @default "-999em" >-* @final >-* @type String >-*/ >-OFF_SCREEN_POSITION: "-999em", >- >- >-// Private properties >- >- >-/** >-* @property _useHideDelay >-* @description Boolean indicating if the "mouseover" and "mouseout" event >-* handlers used for hiding the menu via a call to "YAHOO.lang.later" have >-* already been assigned. >-* @default false >-* @private >-* @type Boolean >-*/ >-_useHideDelay: false, >- >- >-/** >-* @property _bHandledMouseOverEvent >-* @description Boolean indicating the current state of the menu's >-* "mouseover" event. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bHandledMouseOverEvent: false, >- >- >-/** >-* @property _bHandledMouseOutEvent >-* @description Boolean indicating the current state of the menu's >-* "mouseout" event. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bHandledMouseOutEvent: false, >- >- >-/** >-* @property _aGroupTitleElements >-* @description Array of HTML element used to title groups of menu items. >-* @default [] >-* @private >-* @type Array >-*/ >-_aGroupTitleElements: null, >- >- >-/** >-* @property _aItemGroups >-* @description Multi-dimensional Array representing the menu items as they >-* are grouped in the menu. >-* @default [] >-* @private >-* @type Array >-*/ >-_aItemGroups: null, >- >- >-/** >-* @property _aListElements >-* @description Array of <code><ul></code> elements, each of which is >-* the parent node for each item's <code><li></code> element. >-* @default [] >-* @private >-* @type Array >-*/ >-_aListElements: null, >- >- >-/** >-* @property _nCurrentMouseX >-* @description The current x coordinate of the mouse inside the area of >-* the menu. >-* @default 0 >-* @private >-* @type Number >-*/ >-_nCurrentMouseX: 0, >- >- >-/** >-* @property _bStopMouseEventHandlers >-* @description Stops "mouseover," "mouseout," and "mousemove" event handlers >-* from executing. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bStopMouseEventHandlers: false, >- >- >-/** >-* @property _sClassName >-* @description The current value of the "classname" configuration attribute. >-* @default null >-* @private >-* @type String >-*/ >-_sClassName: null, >- >- >- >-// Public properties >- >- >-/** >-* @property lazyLoad >-* @description Boolean indicating if the menu's "lazy load" feature is >-* enabled. If set to "true," initialization and rendering of the menu's >-* items will be deferred until the first time it is made visible. This >-* property should be set via the constructor using the configuration >-* object literal. >-* @default false >-* @type Boolean >-*/ >-lazyLoad: false, >- >- >-/** >-* @property itemData >-* @description Array of items to be added to the menu. The array can contain >-* strings representing the text for each item to be created, object literals >-* representing the menu item configuration properties, or MenuItem instances. >-* This property should be set via the constructor using the configuration >-* object literal. >-* @default null >-* @type Array >-*/ >-itemData: null, >- >- >-/** >-* @property activeItem >-* @description Object reference to the item in the menu that has is selected. >-* @default null >-* @type YAHOO.widget.MenuItem >-*/ >-activeItem: null, >- >- >-/** >-* @property parent >-* @description Object reference to the menu's parent menu or menu item. >-* This property can be set via the constructor using the configuration >-* object literal. >-* @default null >-* @type YAHOO.widget.MenuItem >-*/ >-parent: null, >- >- >-/** >-* @property srcElement >-* @description Object reference to the HTML element (either >-* <code><select></code> or <code><div></code>) used to >-* create the menu. >-* @default null >-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a >-* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html. >-* html#ID-22445964">HTMLDivElement</a> >-*/ >-srcElement: null, >- >- >- >-// Events >- >- >-/** >-* @event mouseOverEvent >-* @description Fires when the mouse has entered the menu. Passes back >-* the DOM Event object as an argument. >-*/ >- >- >-/** >-* @event mouseOutEvent >-* @description Fires when the mouse has left the menu. Passes back the DOM >-* Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event mouseDownEvent >-* @description Fires when the user mouses down on the menu. Passes back the >-* DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event mouseUpEvent >-* @description Fires when the user releases a mouse button while the mouse is >-* over the menu. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event clickEvent >-* @description Fires when the user clicks the on the menu. Passes back the >-* DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyPressEvent >-* @description Fires when the user presses an alphanumeric key when one of the >-* menu's items has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyDownEvent >-* @description Fires when the user presses a key when one of the menu's items >-* has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event keyUpEvent >-* @description Fires when the user releases a key when one of the menu's items >-* has focus. Passes back the DOM Event object as an argument. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event itemAddedEvent >-* @description Fires when an item is added to the menu. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @event itemRemovedEvent >-* @description Fires when an item is removed to the menu. >-* @type YAHOO.util.CustomEvent >-*/ >- >- >-/** >-* @method init >-* @description The Menu class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source >-* for the menu. >-* @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 menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement >-* Object specifying the <code><select></code> element to be used as >-* the data source for the menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu. See configuration class documentation for >-* more details. >-*/ >-init: function (p_oElement, p_oConfig) { >- >- this._aItemGroups = []; >- this._aListElements = []; >- this._aGroupTitleElements = []; >- >- if (!this.ITEM_TYPE) { >- >- this.ITEM_TYPE = YAHOO.widget.MenuItem; >- >- } >- >- >- var oElement; >- >- if (Lang.isString(p_oElement)) { >- >- oElement = Dom.get(p_oElement); >- >- } >- else if (p_oElement.tagName) { >- >- oElement = p_oElement; >- >- } >- >- >- if (oElement && oElement.tagName) { >- >- switch(oElement.tagName.toUpperCase()) { >- >- case _DIV_UPPERCASE: >- >- this.srcElement = oElement; >- >- if (!oElement.id) { >- >- oElement.setAttribute(_ID, Dom.generateId()); >- >- } >- >- >- /* >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, oElement); >- >- this.beforeInitEvent.fire(Menu); >- >- >- break; >- >- case _SELECT: >- >- this.srcElement = oElement; >- >- >- /* >- The source element is not something that we can use >- outright, so we need to create a new Overlay >- >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, Dom.generateId()); >- >- this.beforeInitEvent.fire(Menu); >- >- >- break; >- >- } >- >- } >- else { >- >- /* >- Note: we don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- Menu.superclass.init.call(this, p_oElement); >- >- this.beforeInitEvent.fire(Menu); >- >- >- } >- >- >- if (this.element) { >- >- Dom.addClass(this.element, this.CSS_CLASS_NAME); >- >- >- // Subscribe to Custom Events >- >- this.initEvent.subscribe(this._onInit); >- this.beforeRenderEvent.subscribe(this._onBeforeRender); >- this.renderEvent.subscribe(this._onRender); >- this.beforeShowEvent.subscribe(this._onBeforeShow); >- this.hideEvent.subscribe(this._onHide); >- this.showEvent.subscribe(this._onShow); >- this.beforeHideEvent.subscribe(this._onBeforeHide); >- this.mouseOverEvent.subscribe(this._onMouseOver); >- this.mouseOutEvent.subscribe(this._onMouseOut); >- this.clickEvent.subscribe(this._onClick); >- this.keyDownEvent.subscribe(this._onKeyDown); >- this.keyPressEvent.subscribe(this._onKeyPress); >- this.blurEvent.subscribe(this._onBlur); >- >- >- if (!bFocusListenerInitialized) { >- Event.onFocus(document, onDocFocus); >- bFocusListenerInitialized = true; >- } >- >- >- // Fixes an issue in Firefox 2 and Webkit where Dom's "getX" and "getY" >- // methods return values that don't take scrollTop into consideration >- >- if ((UA.gecko && UA.gecko < 1.9) || UA.webkit) { >- >- this.cfg.subscribeToConfigEvent(_Y, this._onYChange); >- >- } >- >- >- if (p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- >- // Register the Menu instance with the MenuManager >- >- MenuManager.addMenu(this); >- >- >- this.initEvent.fire(Menu); >- >- } >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _initSubTree >-* @description Iterates the childNodes of the source element to find nodes >-* used to instantiate menu and menu items. >-* @private >-*/ >-_initSubTree: function () { >- >- var oSrcElement = this.srcElement, >- sSrcElementTagName, >- nGroup, >- sGroupTitleTagName, >- oNode, >- aListElements, >- nListElements, >- i; >- >- >- if (oSrcElement) { >- >- sSrcElementTagName = >- (oSrcElement.tagName && oSrcElement.tagName.toUpperCase()); >- >- >- if (sSrcElementTagName == _DIV_UPPERCASE) { >- >- // Populate the collection of item groups and item group titles >- >- oNode = this.body.firstChild; >- >- >- if (oNode) { >- >- nGroup = 0; >- sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase(); >- >- do { >- >- >- if (oNode && oNode.tagName) { >- >- switch (oNode.tagName.toUpperCase()) { >- >- case sGroupTitleTagName: >- >- this._aGroupTitleElements[nGroup] = oNode; >- >- break; >- >- case _UL_UPPERCASE: >- >- this._aListElements[nGroup] = oNode; >- this._aItemGroups[nGroup] = []; >- nGroup++; >- >- break; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- >- /* >- Apply the "first-of-type" class to the first UL to mimic >- the ":first-of-type" CSS3 psuedo class. >- */ >- >- if (this._aListElements[0]) { >- >- Dom.addClass(this._aListElements[0], _FIRST_OF_TYPE); >- >- } >- >- } >- >- } >- >- >- oNode = null; >- >- >- >- if (sSrcElementTagName) { >- >- switch (sSrcElementTagName) { >- >- case _DIV_UPPERCASE: >- >- aListElements = this._aListElements; >- nListElements = aListElements.length; >- >- if (nListElements > 0) { >- >- >- i = nListElements - 1; >- >- do { >- >- oNode = aListElements[i].firstChild; >- >- if (oNode) { >- >- >- do { >- >- if (oNode && oNode.tagName && >- oNode.tagName.toUpperCase() == _LI) { >- >- >- this.addItem(new this.ITEM_TYPE(oNode, >- { parent: this }), i); >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- } >- >- } >- while (i--); >- >- } >- >- break; >- >- case _SELECT: >- >- >- oNode = oSrcElement.firstChild; >- >- do { >- >- if (oNode && oNode.tagName) { >- >- switch (oNode.tagName.toUpperCase()) { >- >- case _OPTGROUP: >- case _OPTION: >- >- >- this.addItem( >- new this.ITEM_TYPE( >- oNode, >- { parent: this } >- ) >- ); >- >- break; >- >- } >- >- } >- >- } >- while ((oNode = oNode.nextSibling)); >- >- break; >- >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _getFirstEnabledItem >-* @description Returns the first enabled item in the menu. >-* @return {YAHOO.widget.MenuItem} >-* @private >-*/ >-_getFirstEnabledItem: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- oItem, >- returnVal; >- >- >- for(var i=0; i<nItems; i++) { >- >- oItem = aItems[i]; >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED) && oItem.element.style.display != _NONE) { >- >- returnVal = oItem; >- break; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _addItemToGroup >-* @description Adds a menu item to a group. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the >-* item belongs. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nItemIndex Optional. Number indicating the index at >-* which the menu item should be added. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) { >- >- var oItem, >- nGroupIndex, >- aGroup, >- oGroupItem, >- bAppend, >- oNextItemSibling, >- nItemIndex, >- returnVal; >- >- >- function getNextItemSibling(p_aArray, p_nStartIndex) { >- >- return (p_aArray[p_nStartIndex] || getNextItemSibling(p_aArray, (p_nStartIndex+1))); >- >- } >- >- >- if (p_oItem instanceof this.ITEM_TYPE) { >- >- oItem = p_oItem; >- oItem.parent = this; >- >- } >- else if (Lang.isString(p_oItem)) { >- >- oItem = new this.ITEM_TYPE(p_oItem, { parent: this }); >- >- } >- else if (Lang.isObject(p_oItem)) { >- >- p_oItem.parent = this; >- >- oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem); >- >- } >- >- >- if (oItem) { >- >- if (oItem.cfg.getProperty(_SELECTED)) { >- >- this.activeItem = oItem; >- >- } >- >- >- nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0; >- aGroup = this._getItemGroup(nGroupIndex); >- >- >- >- if (!aGroup) { >- >- aGroup = this._createItemGroup(nGroupIndex); >- >- } >- >- >- if (Lang.isNumber(p_nItemIndex)) { >- >- bAppend = (p_nItemIndex >= aGroup.length); >- >- >- if (aGroup[p_nItemIndex]) { >- >- aGroup.splice(p_nItemIndex, 0, oItem); >- >- } >- else { >- >- aGroup[p_nItemIndex] = oItem; >- >- } >- >- >- oGroupItem = aGroup[p_nItemIndex]; >- >- if (oGroupItem) { >- >- if (bAppend && (!oGroupItem.element.parentNode || >- oGroupItem.element.parentNode.nodeType == 11)) { >- >- this._aListElements[nGroupIndex].appendChild(oGroupItem.element); >- >- } >- else { >- >- oNextItemSibling = getNextItemSibling(aGroup, (p_nItemIndex+1)); >- >- if (oNextItemSibling && (!oGroupItem.element.parentNode || >- oGroupItem.element.parentNode.nodeType == 11)) { >- >- this._aListElements[nGroupIndex].insertBefore( >- oGroupItem.element, oNextItemSibling.element); >- >- } >- >- } >- >- >- oGroupItem.parent = this; >- >- this._subscribeToItemEvents(oGroupItem); >- >- this._configureSubmenu(oGroupItem); >- >- this._updateItemProperties(nGroupIndex); >- >- >- this.itemAddedEvent.fire(oGroupItem); >- this.changeContentEvent.fire(); >- >- returnVal = oGroupItem; >- >- } >- >- } >- else { >- >- nItemIndex = aGroup.length; >- >- aGroup[nItemIndex] = oItem; >- >- oGroupItem = aGroup[nItemIndex]; >- >- >- if (oGroupItem) { >- >- if (!Dom.isAncestor(this._aListElements[nGroupIndex], oGroupItem.element)) { >- >- this._aListElements[nGroupIndex].appendChild(oGroupItem.element); >- >- } >- >- oGroupItem.element.setAttribute(_GROUP_INDEX, nGroupIndex); >- oGroupItem.element.setAttribute(_INDEX, nItemIndex); >- >- oGroupItem.parent = this; >- >- oGroupItem.index = nItemIndex; >- oGroupItem.groupIndex = nGroupIndex; >- >- this._subscribeToItemEvents(oGroupItem); >- >- this._configureSubmenu(oGroupItem); >- >- if (nItemIndex === 0) { >- >- Dom.addClass(oGroupItem.element, _FIRST_OF_TYPE); >- >- } >- >- >- >- this.itemAddedEvent.fire(oGroupItem); >- this.changeContentEvent.fire(); >- >- returnVal = oGroupItem; >- >- } >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _removeItemFromGroupByIndex >-* @description Removes a menu item from a group by index. Returns the menu >-* item that was removed. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the menu >-* item belongs. >-* @param {Number} p_nItemIndex Number indicating the index of the menu item >-* to be removed. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_removeItemFromGroupByIndex: function (p_nGroupIndex, p_nItemIndex) { >- >- var nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0, >- aGroup = this._getItemGroup(nGroupIndex), >- aArray, >- oItem, >- oUL; >- >- if (aGroup) { >- >- aArray = aGroup.splice(p_nItemIndex, 1); >- oItem = aArray[0]; >- >- if (oItem) { >- >- // Update the index and className properties of each member >- >- this._updateItemProperties(nGroupIndex); >- >- if (aGroup.length === 0) { >- >- // Remove the UL >- >- oUL = this._aListElements[nGroupIndex]; >- >- if (this.body && oUL) { >- >- this.body.removeChild(oUL); >- >- } >- >- // Remove the group from the array of items >- >- this._aItemGroups.splice(nGroupIndex, 1); >- >- >- // Remove the UL from the array of ULs >- >- this._aListElements.splice(nGroupIndex, 1); >- >- >- /* >- Assign the "first-of-type" class to the new first UL >- in the collection >- */ >- >- oUL = this._aListElements[0]; >- >- if (oUL) { >- >- Dom.addClass(oUL, _FIRST_OF_TYPE); >- >- } >- >- } >- >- >- this.itemRemovedEvent.fire(oItem); >- this.changeContentEvent.fire(); >- >- } >- >- } >- >- // Return a reference to the item that was removed >- >- return oItem; >- >-}, >- >- >-/** >-* @method _removeItemFromGroupByValue >-* @description Removes a menu item from a group by reference. Returns the >-* menu item that was removed. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group to which the >-* menu item belongs. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be removed. >-* @return {YAHOO.widget.MenuItem} >-*/ >-_removeItemFromGroupByValue: function (p_nGroupIndex, p_oItem) { >- >- var aGroup = this._getItemGroup(p_nGroupIndex), >- nItems, >- nItemIndex, >- returnVal, >- i; >- >- if (aGroup) { >- >- nItems = aGroup.length; >- nItemIndex = -1; >- >- if (nItems > 0) { >- >- i = nItems-1; >- >- do { >- >- if (aGroup[i] == p_oItem) { >- >- nItemIndex = i; >- break; >- >- } >- >- } >- while (i--); >- >- if (nItemIndex > -1) { >- >- returnVal = this._removeItemFromGroupByIndex(p_nGroupIndex, nItemIndex); >- >- } >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _updateItemProperties >-* @description Updates the "index," "groupindex," and "className" properties >-* of the menu items in the specified group. >-* @private >-* @param {Number} p_nGroupIndex Number indicating the group of items to update. >-*/ >-_updateItemProperties: function (p_nGroupIndex) { >- >- var aGroup = this._getItemGroup(p_nGroupIndex), >- nItems = aGroup.length, >- oItem, >- oLI, >- i; >- >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- // Update the index and className properties of each member >- >- do { >- >- oItem = aGroup[i]; >- >- if (oItem) { >- >- oLI = oItem.element; >- >- oItem.index = i; >- oItem.groupIndex = p_nGroupIndex; >- >- oLI.setAttribute(_GROUP_INDEX, p_nGroupIndex); >- oLI.setAttribute(_INDEX, i); >- >- Dom.removeClass(oLI, _FIRST_OF_TYPE); >- >- } >- >- } >- while (i--); >- >- >- if (oLI) { >- >- Dom.addClass(oLI, _FIRST_OF_TYPE); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _createItemGroup >-* @description Creates a new menu item group (array) and its associated >-* <code><ul></code> element. Returns an aray of menu item groups. >-* @private >-* @param {Number} p_nIndex Number indicating the group to create. >-* @return {Array} >-*/ >-_createItemGroup: function (p_nIndex) { >- >- var oUL, >- returnVal; >- >- if (!this._aItemGroups[p_nIndex]) { >- >- this._aItemGroups[p_nIndex] = []; >- >- oUL = document.createElement(_UL_LOWERCASE); >- >- this._aListElements[p_nIndex] = oUL; >- >- returnVal = this._aItemGroups[p_nIndex]; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _getItemGroup >-* @description Returns the menu item group at the specified index. >-* @private >-* @param {Number} p_nIndex Number indicating the index of the menu item group >-* to be retrieved. >-* @return {Array} >-*/ >-_getItemGroup: function (p_nIndex) { >- >- var nIndex = Lang.isNumber(p_nIndex) ? p_nIndex : 0, >- aGroups = this._aItemGroups, >- returnVal; >- >- if (nIndex in aGroups) { >- >- returnVal = aGroups[nIndex]; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method _configureSubmenu >-* @description Subscribes the menu item's submenu to its parent menu's events. >-* @private >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance with the submenu to be configured. >-*/ >-_configureSubmenu: function (p_oItem) { >- >- var oSubmenu = p_oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- /* >- Listen for configuration changes to the parent menu >- so they they can be applied to the submenu. >- */ >- >- this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange, oSubmenu, true); >- >- this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true); >- >- } >- >-}, >- >- >- >- >-/** >-* @method _subscribeToItemEvents >-* @description Subscribes a menu to a menu item's event. >-* @private >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance whose events should be subscribed to. >-*/ >-_subscribeToItemEvents: function (p_oItem) { >- >- p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy, p_oItem, this); >- p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange, p_oItem, this); >- >-}, >- >- >-/** >-* @method _onVisibleChange >-* @description Change event handler for the menu's "visible" configuration >-* property. >-* @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. >-*/ >-_onVisibleChange: function (p_sType, p_aArgs) { >- >- var bVisible = p_aArgs[0]; >- >- if (bVisible) { >- >- Dom.addClass(this.element, _VISIBLE); >- >- } >- else { >- >- Dom.removeClass(this.element, _VISIBLE); >- >- } >- >-}, >- >- >-/** >-* @method _cancelHideDelay >-* @description Cancels the call to "hideMenu." >-* @private >-*/ >-_cancelHideDelay: function () { >- >- var oTimer = this.getRoot()._hideDelayTimer; >- >- if (oTimer) { >- >- oTimer.cancel(); >- >- } >- >-}, >- >- >-/** >-* @method _execHideDelay >-* @description Hides the menu after the number of milliseconds specified by >-* the "hidedelay" configuration property. >-* @private >-*/ >-_execHideDelay: function () { >- >- this._cancelHideDelay(); >- >- var oRoot = this.getRoot(); >- >- oRoot._hideDelayTimer = Lang.later(oRoot.cfg.getProperty(_HIDE_DELAY), this, function () { >- >- if (oRoot.activeItem) { >- >- if (oRoot.hasFocus()) { >- >- oRoot.activeItem.focus(); >- >- } >- >- oRoot.clearActiveItem(); >- >- } >- >- if (oRoot == this && !(this instanceof YAHOO.widget.MenuBar) && >- this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.hide(); >- >- } >- >- }); >- >-}, >- >- >-/** >-* @method _cancelShowDelay >-* @description Cancels the call to the "showMenu." >-* @private >-*/ >-_cancelShowDelay: function () { >- >- var oTimer = this.getRoot()._showDelayTimer; >- >- if (oTimer) { >- >- oTimer.cancel(); >- >- } >- >-}, >- >- >-/** >-* @method _execSubmenuHideDelay >-* @description Hides a submenu after the number of milliseconds specified by >-* the "submenuhidedelay" configuration property have ellapsed. >-* @private >-* @param {YAHOO.widget.Menu} p_oSubmenu Object specifying the submenu that >-* should be hidden. >-* @param {Number} p_nMouseX The x coordinate of the mouse when it left >-* the specified submenu's parent menu item. >-* @param {Number} p_nHideDelay The number of milliseconds that should ellapse >-* before the submenu is hidden. >-*/ >-_execSubmenuHideDelay: function (p_oSubmenu, p_nMouseX, p_nHideDelay) { >- >- p_oSubmenu._submenuHideDelayTimer = Lang.later(50, this, function () { >- >- if (this._nCurrentMouseX > (p_nMouseX + 10)) { >- >- p_oSubmenu._submenuHideDelayTimer = Lang.later(p_nHideDelay, p_oSubmenu, function () { >- >- this.hide(); >- >- }); >- >- } >- else { >- >- p_oSubmenu.hide(); >- >- } >- >- }); >- >-}, >- >- >- >-// Protected methods >- >- >-/** >-* @method _disableScrollHeader >-* @description Disables the header used for scrolling the body of the menu. >-* @protected >-*/ >-_disableScrollHeader: function () { >- >- if (!this._bHeaderDisabled) { >- >- Dom.addClass(this.header, _TOP_SCROLLBAR_DISABLED); >- this._bHeaderDisabled = true; >- >- } >- >-}, >- >- >-/** >-* @method _disableScrollFooter >-* @description Disables the footer used for scrolling the body of the menu. >-* @protected >-*/ >-_disableScrollFooter: function () { >- >- if (!this._bFooterDisabled) { >- >- Dom.addClass(this.footer, _BOTTOM_SCROLLBAR_DISABLED); >- this._bFooterDisabled = true; >- >- } >- >-}, >- >- >-/** >-* @method _enableScrollHeader >-* @description Enables the header used for scrolling the body of the menu. >-* @protected >-*/ >-_enableScrollHeader: function () { >- >- if (this._bHeaderDisabled) { >- >- Dom.removeClass(this.header, _TOP_SCROLLBAR_DISABLED); >- this._bHeaderDisabled = false; >- >- } >- >-}, >- >- >-/** >-* @method _enableScrollFooter >-* @description Enables the footer used for scrolling the body of the menu. >-* @protected >-*/ >-_enableScrollFooter: function () { >- >- if (this._bFooterDisabled) { >- >- Dom.removeClass(this.footer, _BOTTOM_SCROLLBAR_DISABLED); >- this._bFooterDisabled = false; >- >- } >- >-}, >- >- >-/** >-* @method _onMouseOver >-* @description "mouseover" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onMouseOver: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oTarget = Event.getTarget(oEvent), >- oRoot = this.getRoot(), >- oSubmenuHideDelayTimer = this._submenuHideDelayTimer, >- oParentMenu, >- nShowDelay, >- bShowDelay, >- oActiveItem, >- oItemCfg, >- oSubmenu; >- >- >- var showSubmenu = function () { >- >- if (this.parent.cfg.getProperty(_SELECTED)) { >- >- this.show(); >- >- } >- >- }; >- >- >- if (!this._bStopMouseEventHandlers) { >- >- if (!this._bHandledMouseOverEvent && (oTarget == this.element || >- Dom.isAncestor(this.element, oTarget))) { >- >- // Menu mouseover logic >- >- if (this._useHideDelay) { >- this._cancelHideDelay(); >- } >- >- this._nCurrentMouseX = 0; >- >- Event.on(this.element, _MOUSEMOVE, this._onMouseMove, this, true); >- >- >- /* >- If the mouse is moving from the submenu back to its corresponding menu item, >- don't hide the submenu or clear the active MenuItem. >- */ >- >- if (!(oItem && Dom.isAncestor(oItem.element, Event.getRelatedTarget(oEvent)))) { >- >- this.clearActiveItem(); >- >- } >- >- >- if (this.parent && oSubmenuHideDelayTimer) { >- >- oSubmenuHideDelayTimer.cancel(); >- >- this.parent.cfg.setProperty(_SELECTED, true); >- >- oParentMenu = this.parent.parent; >- >- oParentMenu._bHandledMouseOutEvent = true; >- oParentMenu._bHandledMouseOverEvent = false; >- >- } >- >- >- this._bHandledMouseOverEvent = true; >- this._bHandledMouseOutEvent = false; >- >- } >- >- >- if (oItem && !oItem.handledMouseOverEvent && !oItem.cfg.getProperty(_DISABLED) && >- (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))) { >- >- // Menu Item mouseover logic >- >- nShowDelay = this.cfg.getProperty(_SHOW_DELAY); >- bShowDelay = (nShowDelay > 0); >- >- >- if (bShowDelay) { >- >- this._cancelShowDelay(); >- >- } >- >- >- oActiveItem = this.activeItem; >- >- if (oActiveItem) { >- >- oActiveItem.cfg.setProperty(_SELECTED, false); >- >- } >- >- >- oItemCfg = oItem.cfg; >- >- // Select and focus the current menu item >- >- oItemCfg.setProperty(_SELECTED, true); >- >- >- if (this.hasFocus() || oRoot._hasFocus) { >- >- oItem.focus(); >- >- oRoot._hasFocus = false; >- >- } >- >- >- if (this.cfg.getProperty(_AUTO_SUBMENU_DISPLAY)) { >- >- // Show the submenu this menu item >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- if (bShowDelay) { >- >- oRoot._showDelayTimer = >- Lang.later(oRoot.cfg.getProperty(_SHOW_DELAY), oSubmenu, showSubmenu); >- >- } >- else { >- >- oSubmenu.show(); >- >- } >- >- } >- >- } >- >- oItem.handledMouseOverEvent = true; >- oItem.handledMouseOutEvent = false; >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMouseOut >-* @description "mouseout" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onMouseOut: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oRelatedTarget = Event.getRelatedTarget(oEvent), >- bMovingToSubmenu = false, >- oItemCfg, >- oSubmenu, >- nSubmenuHideDelay, >- nShowDelay; >- >- >- if (!this._bStopMouseEventHandlers) { >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- >- if (oSubmenu && (oRelatedTarget == oSubmenu.element || >- Dom.isAncestor(oSubmenu.element, oRelatedTarget))) { >- >- bMovingToSubmenu = true; >- >- } >- >- >- if (!oItem.handledMouseOutEvent && ((oRelatedTarget != oItem.element && >- !Dom.isAncestor(oItem.element, oRelatedTarget)) || bMovingToSubmenu)) { >- >- // Menu Item mouseout logic >- >- if (!bMovingToSubmenu) { >- >- oItem.cfg.setProperty(_SELECTED, false); >- >- >- if (oSubmenu) { >- >- nSubmenuHideDelay = this.cfg.getProperty(_SUBMENU_HIDE_DELAY); >- >- nShowDelay = this.cfg.getProperty(_SHOW_DELAY); >- >- if (!(this instanceof YAHOO.widget.MenuBar) && nSubmenuHideDelay > 0 && >- nShowDelay >= nSubmenuHideDelay) { >- >- this._execSubmenuHideDelay(oSubmenu, Event.getPageX(oEvent), >- nSubmenuHideDelay); >- >- } >- else { >- >- oSubmenu.hide(); >- >- } >- >- } >- >- } >- >- >- oItem.handledMouseOutEvent = true; >- oItem.handledMouseOverEvent = false; >- >- } >- >- } >- >- >- if (!this._bHandledMouseOutEvent && ((oRelatedTarget != this.element && >- !Dom.isAncestor(this.element, oRelatedTarget)) || bMovingToSubmenu)) { >- >- // Menu mouseout logic >- >- if (this._useHideDelay) { >- this._execHideDelay(); >- } >- >- Event.removeListener(this.element, _MOUSEMOVE, this._onMouseMove); >- >- this._nCurrentMouseX = Event.getPageX(oEvent); >- >- this._bHandledMouseOutEvent = true; >- this._bHandledMouseOverEvent = false; >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMouseMove >-* @description "click" event handler for the menu. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onMouseMove: function (p_oEvent, p_oMenu) { >- >- if (!this._bStopMouseEventHandlers) { >- >- this._nCurrentMouseX = Event.getPageX(p_oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onClick >-* @description "click" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onClick: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- bInMenuAnchor = false, >- oSubmenu, >- oMenu, >- oRoot, >- sId, >- sURL, >- nHashPos, >- nLen; >- >- >- var hide = function () { >- >- oRoot = this.getRoot(); >- >- if (oRoot instanceof YAHOO.widget.MenuBar || >- oRoot.cfg.getProperty(_POSITION) == _STATIC) { >- >- oRoot.clearActiveItem(); >- >- } >- else { >- >- oRoot.hide(); >- >- } >- >- }; >- >- >- if (oItem) { >- >- if (oItem.cfg.getProperty(_DISABLED)) { >- >- Event.preventDefault(oEvent); >- >- hide.call(this); >- >- } >- else { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- >- /* >- Check if the URL of the anchor is pointing to an element that is >- a child of the menu. >- */ >- >- sURL = oItem.cfg.getProperty(_URL); >- >- >- if (sURL) { >- >- nHashPos = sURL.indexOf(_HASH); >- >- nLen = sURL.length; >- >- >- if (nHashPos != -1) { >- >- sURL = sURL.substr(nHashPos, nLen); >- >- nLen = sURL.length; >- >- >- if (nLen > 1) { >- >- sId = sURL.substr(1, nLen); >- >- oMenu = YAHOO.widget.MenuManager.getMenu(sId); >- >- if (oMenu) { >- >- bInMenuAnchor = >- (this.getRoot() === oMenu.getRoot()); >- >- } >- >- } >- else if (nLen === 1) { >- >- bInMenuAnchor = true; >- >- } >- >- } >- >- } >- >- >- if (bInMenuAnchor && !oItem.cfg.getProperty(_TARGET)) { >- >- Event.preventDefault(oEvent); >- >- >- if (UA.webkit) { >- >- oItem.focus(); >- >- } >- else { >- >- oItem.focusEvent.fire(); >- >- } >- >- } >- >- >- if (!oSubmenu && !this.cfg.getProperty(_KEEP_OPEN)) { >- >- hide.call(this); >- >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onKeyDown >-* @description "keydown" event handler for the menu. >-* @protected >-* @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. >-*/ >-_onKeyDown: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oSubmenu, >- oItemCfg, >- oParentItem, >- oRoot, >- oNextItem, >- oBody, >- nBodyScrollTop, >- nBodyOffsetHeight, >- aItems, >- nItems, >- nNextItemOffsetTop, >- nScrollTarget, >- oParentMenu, >- oFocusedEl; >- >- >- if (this._useHideDelay) { >- this._cancelHideDelay(); >- } >- >- >- /* >- This function is called to prevent a bug in Firefox. In Firefox, >- moving a DOM element into a stationary mouse pointer will cause the >- browser to fire mouse events. This can result in the menu mouse >- event handlers being called uncessarily, especially when menus are >- moved into a stationary mouse pointer as a result of a >- key event handler. >- */ >- function stopMouseEventHandlers() { >- >- this._bStopMouseEventHandlers = true; >- >- Lang.later(10, this, function () { >- >- this._bStopMouseEventHandlers = false; >- >- }); >- >- } >- >- >- if (oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- oParentItem = this.parent; >- >- switch(oEvent.keyCode) { >- >- case 38: // Up arrow >- case 40: // Down arrow >- >- oNextItem = (oEvent.keyCode == 38) ? >- oItem.getPreviousEnabledSibling() : >- oItem.getNextEnabledSibling(); >- >- if (oNextItem) { >- >- this.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- oNextItem.focus(); >- >- >- if (this.cfg.getProperty(_MAX_HEIGHT) > 0) { >- >- oBody = this.body; >- nBodyScrollTop = oBody.scrollTop; >- nBodyOffsetHeight = oBody.offsetHeight; >- aItems = this.getItems(); >- nItems = aItems.length - 1; >- nNextItemOffsetTop = oNextItem.element.offsetTop; >- >- >- if (oEvent.keyCode == 40 ) { // Down >- >- if (nNextItemOffsetTop >= (nBodyOffsetHeight + nBodyScrollTop)) { >- >- oBody.scrollTop = nNextItemOffsetTop - nBodyOffsetHeight; >- >- } >- else if (nNextItemOffsetTop <= nBodyScrollTop) { >- >- oBody.scrollTop = 0; >- >- } >- >- >- if (oNextItem == aItems[nItems]) { >- >- oBody.scrollTop = oNextItem.element.offsetTop; >- >- } >- >- } >- else { // Up >- >- if (nNextItemOffsetTop <= nBodyScrollTop) { >- >- oBody.scrollTop = nNextItemOffsetTop - oNextItem.element.offsetHeight; >- >- } >- else if (nNextItemOffsetTop >= (nBodyScrollTop + nBodyOffsetHeight)) { >- >- oBody.scrollTop = nNextItemOffsetTop; >- >- } >- >- >- if (oNextItem == aItems[0]) { >- >- oBody.scrollTop = 0; >- >- } >- >- } >- >- >- nBodyScrollTop = oBody.scrollTop; >- nScrollTarget = oBody.scrollHeight - oBody.offsetHeight; >- >- if (nBodyScrollTop === 0) { >- >- this._disableScrollHeader(); >- this._enableScrollFooter(); >- >- } >- else if (nBodyScrollTop == nScrollTarget) { >- >- this._enableScrollHeader(); >- this._disableScrollFooter(); >- >- } >- else { >- >- this._enableScrollHeader(); >- this._enableScrollFooter(); >- >- } >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- >- case 39: // Right arrow >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- if (!oItemCfg.getProperty(_SELECTED)) { >- >- oItemCfg.setProperty(_SELECTED, true); >- >- } >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- oSubmenu.setInitialSelection(); >- >- } >- else { >- >- oRoot = this.getRoot(); >- >- if (oRoot instanceof YAHOO.widget.MenuBar) { >- >- oNextItem = oRoot.activeItem.getNextEnabledSibling(); >- >- if (oNextItem) { >- >- oRoot.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oNextItem.focus(); >- >- } >- >- } >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- >- case 37: // Left arrow >- >- if (oParentItem) { >- >- oParentMenu = oParentItem.parent; >- >- if (oParentMenu instanceof YAHOO.widget.MenuBar) { >- >- oNextItem = >- oParentMenu.activeItem.getPreviousEnabledSibling(); >- >- if (oNextItem) { >- >- oParentMenu.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oNextItem.focus(); >- >- } >- >- } >- >- } >- else { >- >- this.hide(); >- >- oParentItem.focus(); >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- stopMouseEventHandlers(); >- >- break; >- >- } >- >- >- } >- >- >- if (oEvent.keyCode == 27) { // Esc key >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.hide(); >- >- if (this.parent) { >- >- this.parent.focus(); >- >- } >- else { >- // Focus the element that previously had focus >- >- oFocusedEl = this._focusedElement; >- >- if (oFocusedEl && oFocusedEl.focus) { >- >- try { >- oFocusedEl.focus(); >- } >- catch(ex) { >- } >- >- } >- >- } >- >- } >- else if (this.activeItem) { >- >- oSubmenu = this.activeItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu && oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- this.activeItem.focus(); >- >- } >- else { >- >- this.activeItem.blur(); >- this.activeItem.cfg.setProperty(_SELECTED, false); >- >- } >- >- } >- >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onKeyPress >-* @description "keypress" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onKeyPress: function (p_sType, p_aArgs) { >- >- var oEvent = p_aArgs[0]; >- >- >- if (oEvent.keyCode == 40 || oEvent.keyCode == 38) { >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onBlur >-* @description "blur" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onBlur: function (p_sType, p_aArgs) { >- >- if (this._hasFocus) { >- this._hasFocus = false; >- } >- >-}, >- >-/** >-* @method _onYChange >-* @description "y" event handler for a Menu instance. >-* @protected >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onYChange: function (p_sType, p_aArgs) { >- >- var oParent = this.parent, >- nScrollTop, >- oIFrame, >- nY; >- >- >- if (oParent) { >- >- nScrollTop = oParent.parent.body.scrollTop; >- >- >- if (nScrollTop > 0) { >- >- nY = (this.cfg.getProperty(_Y) - nScrollTop); >- >- Dom.setY(this.element, nY); >- >- oIFrame = this.iframe; >- >- >- if (oIFrame) { >- >- Dom.setY(oIFrame, nY); >- >- } >- >- this.cfg.setProperty(_Y, nY, true); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onScrollTargetMouseOver >-* @description "mouseover" event handler for the menu's "header" and "footer" >-* elements. Used to scroll the body of the menu up and down when the >-* menu's "maxheight" configuration property is set to a value greater than 0. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onScrollTargetMouseOver: function (p_oEvent, p_oMenu) { >- >- var oBodyScrollTimer = this._bodyScrollTimer; >- >- >- if (oBodyScrollTimer) { >- >- oBodyScrollTimer.cancel(); >- >- } >- >- >- this._cancelHideDelay(); >- >- >- var oTarget = Event.getTarget(p_oEvent), >- oBody = this.body, >- nScrollIncrement = this.cfg.getProperty(_SCROLL_INCREMENT), >- nScrollTarget, >- fnScrollFunction; >- >- >- function scrollBodyDown() { >- >- var nScrollTop = oBody.scrollTop; >- >- >- if (nScrollTop < nScrollTarget) { >- >- oBody.scrollTop = (nScrollTop + nScrollIncrement); >- >- this._enableScrollHeader(); >- >- } >- else { >- >- oBody.scrollTop = nScrollTarget; >- >- this._bodyScrollTimer.cancel(); >- >- this._disableScrollFooter(); >- >- } >- >- } >- >- >- function scrollBodyUp() { >- >- var nScrollTop = oBody.scrollTop; >- >- >- if (nScrollTop > 0) { >- >- oBody.scrollTop = (nScrollTop - nScrollIncrement); >- >- this._enableScrollFooter(); >- >- } >- else { >- >- oBody.scrollTop = 0; >- >- this._bodyScrollTimer.cancel(); >- >- this._disableScrollHeader(); >- >- } >- >- } >- >- >- if (Dom.hasClass(oTarget, _HD)) { >- >- fnScrollFunction = scrollBodyUp; >- >- } >- else { >- >- nScrollTarget = oBody.scrollHeight - oBody.offsetHeight; >- >- fnScrollFunction = scrollBodyDown; >- >- } >- >- >- this._bodyScrollTimer = Lang.later(10, this, fnScrollFunction, null, true); >- >-}, >- >- >-/** >-* @method _onScrollTargetMouseOut >-* @description "mouseout" event handler for the menu's "header" and "footer" >-* elements. Used to stop scrolling the body of the menu up and down when the >-* menu's "maxheight" configuration property is set to a value greater than 0. >-* @protected >-* @param {Event} p_oEvent Object representing the DOM event object passed >-* back by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-_onScrollTargetMouseOut: function (p_oEvent, p_oMenu) { >- >- var oBodyScrollTimer = this._bodyScrollTimer; >- >- if (oBodyScrollTimer) { >- >- oBodyScrollTimer.cancel(); >- >- } >- >- this._cancelHideDelay(); >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _onInit >-* @description "init" event handler for the 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. >-*/ >-_onInit: function (p_sType, p_aArgs) { >- >- this.cfg.subscribeToConfigEvent(_VISIBLE, this._onVisibleChange); >- >- var bRootMenu = !this.parent, >- bLazyLoad = this.lazyLoad; >- >- >- /* >- Automatically initialize a menu's subtree if: >- >- 1) This is the root menu and lazyload is off >- >- 2) This is the root menu, lazyload is on, but the menu is >- already visible >- >- 3) This menu is a submenu and lazyload is off >- */ >- >- >- >- if (((bRootMenu && !bLazyLoad) || >- (bRootMenu && (this.cfg.getProperty(_VISIBLE) || >- this.cfg.getProperty(_POSITION) == _STATIC)) || >- (!bRootMenu && !bLazyLoad)) && this.getItemGroups().length === 0) { >- >- if (this.srcElement) { >- >- this._initSubTree(); >- >- } >- >- >- if (this.itemData) { >- >- this.addItems(this.itemData); >- >- } >- >- } >- else if (bLazyLoad) { >- >- this.cfg.fireQueue(); >- >- } >- >-}, >- >- >-/** >-* @method _onBeforeRender >-* @description "beforerender" event handler for the menu. Appends all of the >-* <code><ul></code>, <code><li></code> and their accompanying >-* title elements to the body element of the 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. >-*/ >-_onBeforeRender: function (p_sType, p_aArgs) { >- >- var oEl = this.element, >- nListElements = this._aListElements.length, >- bFirstList = true, >- i = 0, >- oUL, >- oGroupTitle; >- >- if (nListElements > 0) { >- >- do { >- >- oUL = this._aListElements[i]; >- >- if (oUL) { >- >- if (bFirstList) { >- >- Dom.addClass(oUL, _FIRST_OF_TYPE); >- bFirstList = false; >- >- } >- >- >- if (!Dom.isAncestor(oEl, oUL)) { >- >- this.appendToBody(oUL); >- >- } >- >- >- oGroupTitle = this._aGroupTitleElements[i]; >- >- if (oGroupTitle) { >- >- if (!Dom.isAncestor(oEl, oGroupTitle)) { >- >- oUL.parentNode.insertBefore(oGroupTitle, oUL); >- >- } >- >- >- Dom.addClass(oUL, _HAS_TITLE); >- >- } >- >- } >- >- i++; >- >- } >- while (i < nListElements); >- >- } >- >-}, >- >- >-/** >-* @method _onRender >-* @description "render" event handler for the 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. >-*/ >-_onRender: function (p_sType, p_aArgs) { >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- if (!this.cfg.getProperty(_VISIBLE)) { >- >- this.positionOffScreen(); >- >- } >- >- } >- >-}, >- >- >- >- >- >-/** >-* @method _onBeforeShow >-* @description "beforeshow" event handler for the 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. >-*/ >-_onBeforeShow: function (p_sType, p_aArgs) { >- >- var nOptions, >- n, >- oSrcElement, >- oContainer = this.cfg.getProperty(_CONTAINER); >- >- >- if (this.lazyLoad && this.getItemGroups().length === 0) { >- >- if (this.srcElement) { >- >- this._initSubTree(); >- >- } >- >- >- if (this.itemData) { >- >- if (this.parent && this.parent.parent && >- this.parent.parent.srcElement && >- this.parent.parent.srcElement.tagName.toUpperCase() == >- _SELECT) { >- >- nOptions = this.itemData.length; >- >- for(n=0; n<nOptions; n++) { >- >- if (this.itemData[n].tagName) { >- >- this.addItem((new this.ITEM_TYPE(this.itemData[n]))); >- >- } >- >- } >- >- } >- else { >- >- this.addItems(this.itemData); >- >- } >- >- } >- >- >- oSrcElement = this.srcElement; >- >- if (oSrcElement) { >- >- if (oSrcElement.tagName.toUpperCase() == _SELECT) { >- >- if (Dom.inDocument(oSrcElement)) { >- >- this.render(oSrcElement.parentNode); >- >- } >- else { >- >- this.render(oContainer); >- >- } >- >- } >- else { >- >- this.render(); >- >- } >- >- } >- else { >- >- if (this.parent) { >- >- this.render(this.parent.element); >- >- } >- else { >- >- this.render(oContainer); >- >- } >- >- } >- >- } >- >- >- >- var oParent = this.parent, >- aAlignment; >- >- >- if (!oParent && this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- this.cfg.refireEvent(_XY); >- >- } >- >- >- if (oParent) { >- >- aAlignment = oParent.parent.cfg.getProperty(_SUBMENU_ALIGNMENT); >- >- this.cfg.setProperty(_CONTEXT, [oParent.element, aAlignment[0], aAlignment[1]]); >- this.align(); >- >- } >- >-}, >- >- >-getConstrainedY: function (y) { >- >- var oMenu = this, >- >- aContext = oMenu.cfg.getProperty(_CONTEXT), >- nInitialMaxHeight = oMenu.cfg.getProperty(_MAX_HEIGHT), >- >- nMaxHeight, >- >- oOverlapPositions = { >- >- "trbr": true, >- "tlbl": true, >- "bltl": true, >- "brtr": true >- >- }, >- >- bPotentialContextOverlap = (aContext && oOverlapPositions[aContext[1] + aContext[2]]), >- >- oMenuEl = oMenu.element, >- nMenuOffsetHeight = oMenuEl.offsetHeight, >- >- nViewportOffset = Overlay.VIEWPORT_OFFSET, >- viewPortHeight = Dom.getViewportHeight(), >- scrollY = Dom.getDocumentScrollTop(), >- >- bCanConstrain = >- (oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT) + nViewportOffset < viewPortHeight), >- >- nAvailableHeight, >- >- oContextEl, >- nContextElY, >- nContextElHeight, >- >- bFlipped = false, >- >- nTopRegionHeight, >- nBottomRegionHeight, >- >- topConstraint = scrollY + nViewportOffset, >- bottomConstraint = scrollY + viewPortHeight - nMenuOffsetHeight - nViewportOffset, >- >- yNew = y; >- >- >- var flipVertical = function () { >- >- var nNewY; >- >- // The Menu is below the context element, flip it above >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- nNewY = (nContextElY - nMenuOffsetHeight); >- } >- else { // The Menu is above the context element, flip it below >- nNewY = (nContextElY + nContextElHeight); >- } >- >- oMenu.cfg.setProperty(_Y, (nNewY + scrollY), true); >- >- return nNewY; >- >- }; >- >- >- /* >- Uses the context element's position to calculate the availble height >- above and below it to display its corresponding Menu. >- */ >- >- var getDisplayRegionHeight = function () { >- >- // The Menu is below the context element >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- return (nBottomRegionHeight - nViewportOffset); >- } >- else { // The Menu is above the context element >- return (nTopRegionHeight - nViewportOffset); >- } >- >- }; >- >- >- /* >- Sets the Menu's "y" configuration property to the correct value based on its >- current orientation. >- */ >- >- var alignY = function () { >- >- var nNewY; >- >- if ((oMenu.cfg.getProperty(_Y) - scrollY) > nContextElY) { >- nNewY = (nContextElY + nContextElHeight); >- } >- else { >- nNewY = (nContextElY - oMenuEl.offsetHeight); >- } >- >- oMenu.cfg.setProperty(_Y, (nNewY + scrollY), true); >- >- }; >- >- >- // Resets the maxheight of the Menu to the value set by the user >- >- var resetMaxHeight = function () { >- >- oMenu._setScrollHeight(this.cfg.getProperty(_MAX_HEIGHT)); >- >- oMenu.hideEvent.unsubscribe(resetMaxHeight); >- >- }; >- >- >- /* >- Trys to place the Menu in the best possible position (either above or >- below its corresponding context element). >- */ >- >- var setVerticalPosition = function () { >- >- var nDisplayRegionHeight = getDisplayRegionHeight(), >- bMenuHasItems = (oMenu.getItems().length > 0), >- nMenuMinScrollHeight, >- fnReturnVal; >- >- >- if (nMenuOffsetHeight > nDisplayRegionHeight) { >- >- nMenuMinScrollHeight = >- bMenuHasItems ? oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT) : nMenuOffsetHeight; >- >- >- if ((nDisplayRegionHeight > nMenuMinScrollHeight) && bMenuHasItems) { >- nMaxHeight = nDisplayRegionHeight; >- } >- else { >- nMaxHeight = nInitialMaxHeight; >- } >- >- >- oMenu._setScrollHeight(nMaxHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- >- // Re-align the Menu since its height has just changed >- // as a result of the setting of the maxheight property. >- >- alignY(); >- >- >- if (nDisplayRegionHeight < nMenuMinScrollHeight) { >- >- if (bFlipped) { >- >- /* >- All possible positions and values for the "maxheight" >- configuration property have been tried, but none were >- successful, so fall back to the original size and position. >- */ >- >- flipVertical(); >- >- } >- else { >- >- flipVertical(); >- >- bFlipped = true; >- >- fnReturnVal = setVerticalPosition(); >- >- } >- >- } >- >- } >- else if (nMaxHeight && (nMaxHeight !== nInitialMaxHeight)) { >- >- oMenu._setScrollHeight(nInitialMaxHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- // Re-align the Menu since its height has just changed >- // as a result of the setting of the maxheight property. >- >- alignY(); >- >- } >- >- return fnReturnVal; >- >- }; >- >- >- // Determine if the current value for the Menu's "y" configuration property will >- // result in the Menu being positioned outside the boundaries of the viewport >- >- if (y < topConstraint || y > bottomConstraint) { >- >- // The current value for the Menu's "y" configuration property WILL >- // result in the Menu being positioned outside the boundaries of the viewport >- >- if (bCanConstrain) { >- >- if (oMenu.cfg.getProperty(_PREVENT_CONTEXT_OVERLAP) && bPotentialContextOverlap) { >- >- // SOLUTION #1: >- // If the "preventcontextoverlap" configuration property is set to "true", >- // try to flip and/or scroll the Menu to both keep it inside the boundaries of the >- // viewport AND from overlaping its context element (MenuItem or MenuBarItem). >- >- oContextEl = aContext[0]; >- nContextElHeight = oContextEl.offsetHeight; >- nContextElY = (Dom.getY(oContextEl) - scrollY); >- >- nTopRegionHeight = nContextElY; >- nBottomRegionHeight = (viewPortHeight - (nContextElY + nContextElHeight)); >- >- setVerticalPosition(); >- >- yNew = oMenu.cfg.getProperty(_Y); >- >- } >- else if (!(oMenu instanceof YAHOO.widget.MenuBar) && >- nMenuOffsetHeight >= viewPortHeight) { >- >- // SOLUTION #2: >- // If the Menu exceeds the height of the viewport, introduce scroll bars >- // to keep the Menu inside the boundaries of the viewport >- >- nAvailableHeight = (viewPortHeight - (nViewportOffset * 2)); >- >- if (nAvailableHeight > oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT)) { >- >- oMenu._setScrollHeight(nAvailableHeight); >- oMenu.hideEvent.subscribe(resetMaxHeight); >- >- alignY(); >- >- yNew = oMenu.cfg.getProperty(_Y); >- >- } >- >- } >- else { >- >- // SOLUTION #3: >- >- if (y < topConstraint) { >- yNew = topConstraint; >- } else if (y > bottomConstraint) { >- yNew = bottomConstraint; >- } >- >- } >- >- } >- else { >- // The "y" configuration property cannot be set to a value that will keep >- // entire Menu inside the boundary of the viewport. Therefore, set >- // the "y" configuration property to scrollY to keep as much of the >- // Menu inside the viewport as possible. >- yNew = nViewportOffset + scrollY; >- } >- >- } >- >- return yNew; >- >-}, >- >- >-/** >-* @method _onHide >-* @description "hide" event handler for the 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. >-*/ >-_onHide: function (p_sType, p_aArgs) { >- >- if (this.cfg.getProperty(_POSITION) === _DYNAMIC) { >- >- this.positionOffScreen(); >- >- } >- >-}, >- >- >-/** >-* @method _onShow >-* @description "show" event handler for the 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. >-*/ >-_onShow: function (p_sType, p_aArgs) { >- >- var oParent = this.parent, >- oParentMenu, >- oElement, >- nOffsetWidth, >- sWidth; >- >- >- function disableAutoSubmenuDisplay(p_oEvent) { >- >- var oTarget; >- >- if (p_oEvent.type == _MOUSEDOWN || (p_oEvent.type == _KEYDOWN && p_oEvent.keyCode == 27)) { >- >- /* >- Set the "autosubmenudisplay" to "false" if the user >- clicks outside the menu bar. >- */ >- >- oTarget = Event.getTarget(p_oEvent); >- >- if (oTarget != oParentMenu.element || !Dom.isAncestor(oParentMenu.element, oTarget)) { >- >- oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, false); >- >- Event.removeListener(document, _MOUSEDOWN, disableAutoSubmenuDisplay); >- Event.removeListener(document, _KEYDOWN, disableAutoSubmenuDisplay); >- >- } >- >- } >- >- } >- >- >- function onSubmenuHide(p_sType, p_aArgs, p_sWidth) { >- >- this.cfg.setProperty(_WIDTH, _EMPTY_STRING); >- this.hideEvent.unsubscribe(onSubmenuHide, p_sWidth); >- >- } >- >- >- if (oParent) { >- >- oParentMenu = oParent.parent; >- >- >- if (!oParentMenu.cfg.getProperty(_AUTO_SUBMENU_DISPLAY) && >- (oParentMenu instanceof YAHOO.widget.MenuBar || >- oParentMenu.cfg.getProperty(_POSITION) == _STATIC)) { >- >- oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, true); >- >- Event.on(document, _MOUSEDOWN, disableAutoSubmenuDisplay); >- Event.on(document, _KEYDOWN, disableAutoSubmenuDisplay); >- >- } >- >- >- // The following fixes an issue with the selected state of a MenuItem >- // not rendering correctly when a submenu is aligned to the left of >- // its parent Menu instance. >- >- if ((this.cfg.getProperty("x") < oParentMenu.cfg.getProperty("x")) && >- (UA.gecko && UA.gecko < 1.9) && !this.cfg.getProperty(_WIDTH)) { >- >- oElement = this.element; >- nOffsetWidth = oElement.offsetWidth; >- >- /* >- Measuring the difference of the offsetWidth before and after >- setting the "width" style attribute allows us to compute the >- about of padding and borders applied to the element, which in >- turn allows us to set the "width" property correctly. >- */ >- >- oElement.style.width = nOffsetWidth + _PX; >- >- sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + _PX; >- >- this.cfg.setProperty(_WIDTH, sWidth); >- >- this.hideEvent.subscribe(onSubmenuHide, sWidth); >- >- } >- >- } >- >- >- /* >- Dynamically positioned, root Menus focus themselves when visible, and >- will then, when hidden, restore focus to the UI control that had focus >- before the Menu was made visible. >- */ >- >- if (this === this.getRoot() && this.cfg.getProperty(_POSITION) === _DYNAMIC) { >- >- this._focusedElement = oFocusedElement; >- >- this.focus(); >- >- } >- >- >-}, >- >- >-/** >-* @method _onBeforeHide >-* @description "beforehide" event handler for the 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. >-*/ >-_onBeforeHide: function (p_sType, p_aArgs) { >- >- var oActiveItem = this.activeItem, >- oRoot = this.getRoot(), >- oConfig, >- oSubmenu; >- >- >- if (oActiveItem) { >- >- oConfig = oActiveItem.cfg; >- >- oConfig.setProperty(_SELECTED, false); >- >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.hide(); >- >- } >- >- } >- >- >- /* >- Focus can get lost in IE when the mouse is moving from a submenu back to its parent Menu. >- For this reason, it is necessary to maintain the focused state in a private property >- so that the _onMouseOver event handler is able to determined whether or not to set focus >- to MenuItems as the user is moving the mouse. >- */ >- >- if (UA.ie && this.cfg.getProperty(_POSITION) === _DYNAMIC && this.parent) { >- >- oRoot._hasFocus = this.hasFocus(); >- >- } >- >- >- if (oRoot == this) { >- >- oRoot.blur(); >- >- } >- >-}, >- >- >-/** >-* @method _onParentMenuConfigChange >-* @description "configchange" event handler for a submenu. >-* @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 {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that >-* subscribed to the event. >-*/ >-_onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) { >- >- var sPropertyName = p_aArgs[0][0], >- oPropertyValue = p_aArgs[0][1]; >- >- switch(sPropertyName) { >- >- case _IFRAME: >- case _CONSTRAIN_TO_VIEWPORT: >- case _HIDE_DELAY: >- case _SHOW_DELAY: >- case _SUBMENU_HIDE_DELAY: >- case _CLICK_TO_HIDE: >- case _EFFECT: >- case _CLASSNAME: >- case _SCROLL_INCREMENT: >- case _MAX_HEIGHT: >- case _MIN_SCROLL_HEIGHT: >- case _MONITOR_RESIZE: >- case _SHADOW: >- case _PREVENT_CONTEXT_OVERLAP: >- case _KEEP_OPEN: >- >- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue); >- >- break; >- >- case _SUBMENU_ALIGNMENT: >- >- if (!(this.parent.parent instanceof YAHOO.widget.MenuBar)) { >- >- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue); >- >- } >- >- break; >- >- } >- >-}, >- >- >-/** >-* @method _onParentMenuRender >-* @description "render" event handler for a submenu. Renders a >-* submenu in response to the firing of its parent's "render" event. >-* @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 {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that >-* subscribed to the event. >-*/ >-_onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) { >- >- var oParentMenu = p_oSubmenu.parent.parent, >- oParentCfg = oParentMenu.cfg, >- >- oConfig = { >- >- constraintoviewport: oParentCfg.getProperty(_CONSTRAIN_TO_VIEWPORT), >- >- xy: [0,0], >- >- clicktohide: oParentCfg.getProperty(_CLICK_TO_HIDE), >- >- effect: oParentCfg.getProperty(_EFFECT), >- >- showdelay: oParentCfg.getProperty(_SHOW_DELAY), >- >- hidedelay: oParentCfg.getProperty(_HIDE_DELAY), >- >- submenuhidedelay: oParentCfg.getProperty(_SUBMENU_HIDE_DELAY), >- >- classname: oParentCfg.getProperty(_CLASSNAME), >- >- scrollincrement: oParentCfg.getProperty(_SCROLL_INCREMENT), >- >- maxheight: oParentCfg.getProperty(_MAX_HEIGHT), >- >- minscrollheight: oParentCfg.getProperty(_MIN_SCROLL_HEIGHT), >- >- iframe: oParentCfg.getProperty(_IFRAME), >- >- shadow: oParentCfg.getProperty(_SHADOW), >- >- preventcontextoverlap: oParentCfg.getProperty(_PREVENT_CONTEXT_OVERLAP), >- >- monitorresize: oParentCfg.getProperty(_MONITOR_RESIZE), >- >- keepopen: oParentCfg.getProperty(_KEEP_OPEN) >- >- }, >- >- oLI; >- >- >- >- if (!(oParentMenu instanceof YAHOO.widget.MenuBar)) { >- >- oConfig[_SUBMENU_ALIGNMENT] = oParentCfg.getProperty(_SUBMENU_ALIGNMENT); >- >- } >- >- >- p_oSubmenu.cfg.applyConfig(oConfig); >- >- >- if (!this.lazyLoad) { >- >- oLI = this.parent.element; >- >- if (this.element.parentNode == oLI) { >- >- this.render(); >- >- } >- else { >- >- this.render(oLI); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _onMenuItemDestroy >-* @description "destroy" event handler for the menu's items. >-* @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >-* that fired the event. >-*/ >-_onMenuItemDestroy: function (p_sType, p_aArgs, p_oItem) { >- >- this._removeItemFromGroupByValue(p_oItem.groupIndex, p_oItem); >- >-}, >- >- >-/** >-* @method _onMenuItemConfigChange >-* @description "configchange" event handler for the menu's items. >-* @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >-* that fired the event. >-*/ >-_onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) { >- >- var sPropertyName = p_aArgs[0][0], >- oPropertyValue = p_aArgs[0][1], >- oSubmenu; >- >- >- switch(sPropertyName) { >- >- case _SELECTED: >- >- if (oPropertyValue === true) { >- >- this.activeItem = p_oItem; >- >- } >- >- break; >- >- case _SUBMENU: >- >- oSubmenu = p_aArgs[0][1]; >- >- if (oSubmenu) { >- >- this._configureSubmenu(p_oItem); >- >- } >- >- break; >- >- } >- >-}, >- >- >- >-// Public event handlers for configuration properties >- >- >-/** >-* @method configVisible >-* @description Event handler for when the "visible" configuration property >-* the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configVisible: function (p_sType, p_aArgs, p_oMenu) { >- >- var bVisible, >- sDisplay; >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- Menu.superclass.configVisible.call(this, p_sType, p_aArgs, p_oMenu); >- >- } >- else { >- >- bVisible = p_aArgs[0]; >- sDisplay = Dom.getStyle(this.element, _DISPLAY); >- >- Dom.setStyle(this.element, _VISIBILITY, _VISIBLE); >- >- if (bVisible) { >- >- if (sDisplay != _BLOCK) { >- this.beforeShowEvent.fire(); >- Dom.setStyle(this.element, _DISPLAY, _BLOCK); >- this.showEvent.fire(); >- } >- >- } >- else { >- >- if (sDisplay == _BLOCK) { >- this.beforeHideEvent.fire(); >- Dom.setStyle(this.element, _DISPLAY, _NONE); >- this.hideEvent.fire(); >- } >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configPosition >-* @description Event handler for when the "position" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configPosition: function (p_sType, p_aArgs, p_oMenu) { >- >- var oElement = this.element, >- sCSSPosition = p_aArgs[0] == _STATIC ? _STATIC : _ABSOLUTE, >- oCfg = this.cfg, >- nZIndex; >- >- >- Dom.setStyle(oElement, _POSITION, sCSSPosition); >- >- >- if (sCSSPosition == _STATIC) { >- >- // Statically positioned menus are visible by default >- >- Dom.setStyle(oElement, _DISPLAY, _BLOCK); >- >- oCfg.setProperty(_VISIBLE, true); >- >- } >- else { >- >- /* >- Even though the "visible" property is queued to >- "false" by default, we need to set the "visibility" property to >- "hidden" since Overlay's "configVisible" implementation checks the >- element's "visibility" style property before deciding whether >- or not to show an Overlay instance. >- */ >- >- Dom.setStyle(oElement, _VISIBILITY, _HIDDEN); >- >- } >- >- >- if (sCSSPosition == _ABSOLUTE) { >- >- nZIndex = oCfg.getProperty(_ZINDEX); >- >- if (!nZIndex || nZIndex === 0) { >- >- oCfg.setProperty(_ZINDEX, 1); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configIframe >-* @description Event handler for when the "iframe" configuration property of >-* the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configIframe: function (p_sType, p_aArgs, p_oMenu) { >- >- if (this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- Menu.superclass.configIframe.call(this, p_sType, p_aArgs, p_oMenu); >- >- } >- >-}, >- >- >-/** >-* @method configHideDelay >-* @description Event handler for when the "hidedelay" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configHideDelay: function (p_sType, p_aArgs, p_oMenu) { >- >- var nHideDelay = p_aArgs[0]; >- >- this._useHideDelay = (nHideDelay > 0); >- >-}, >- >- >-/** >-* @method configContainer >-* @description Event handler for when the "container" configuration property >-* of the menu changes. >-* @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 {YAHOO.widget.Menu} p_oMenu Object representing the menu that >-* fired the event. >-*/ >-configContainer: function (p_sType, p_aArgs, p_oMenu) { >- >- var oElement = p_aArgs[0]; >- >- if (Lang.isString(oElement)) { >- >- this.cfg.setProperty(_CONTAINER, Dom.get(oElement), true); >- >- } >- >-}, >- >- >-/** >-* @method _clearSetWidthFlag >-* @description Change event listener for the "width" configuration property. This listener is >-* added when a Menu's "width" configuration property is set by the "_setScrollHeight" method, and >-* is used to set the "_widthSetForScroll" property to "false" if the "width" configuration property >-* is changed after it was set by the "_setScrollHeight" method. If the "_widthSetForScroll" >-* property is set to "false", and the "_setScrollHeight" method is in the process of tearing down >-* scrolling functionality, it will maintain the Menu's new width rather than reseting it. >-* @private >-*/ >-_clearSetWidthFlag: function () { >- >- this._widthSetForScroll = false; >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >-}, >- >- >-/** >-* @method _setScrollHeight >-* @description >-* @param {String} p_nScrollHeight Number representing the scrolling height of the Menu. >-* @private >-*/ >-_setScrollHeight: function (p_nScrollHeight) { >- >- var nScrollHeight = p_nScrollHeight, >- bRefireIFrameAndShadow = false, >- bSetWidth = false, >- oElement, >- oBody, >- oHeader, >- oFooter, >- fnMouseOver, >- fnMouseOut, >- nMinScrollHeight, >- nHeight, >- nOffsetWidth, >- sWidth; >- >- >- if (this.getItems().length > 0) { >- >- oElement = this.element; >- oBody = this.body; >- oHeader = this.header; >- oFooter = this.footer; >- fnMouseOver = this._onScrollTargetMouseOver; >- fnMouseOut = this._onScrollTargetMouseOut; >- nMinScrollHeight = this.cfg.getProperty(_MIN_SCROLL_HEIGHT); >- >- >- if (nScrollHeight > 0 && nScrollHeight < nMinScrollHeight) { >- >- nScrollHeight = nMinScrollHeight; >- >- } >- >- >- Dom.setStyle(oBody, _HEIGHT, _EMPTY_STRING); >- Dom.removeClass(oBody, _YUI_MENU_BODY_SCROLLED); >- oBody.scrollTop = 0; >- >- >- // Need to set a width for the Menu to fix the following problems in >- // Firefox 2 and IE: >- >- // #1) Scrolled Menus will render at 1px wide in Firefox 2 >- >- // #2) There is a bug in gecko-based browsers where an element whose >- // "position" property is set to "absolute" and "overflow" property is >- // set to "hidden" will not render at the correct width when its >- // offsetParent's "position" property is also set to "absolute." It is >- // possible to work around this bug by specifying a value for the width >- // property in addition to overflow. >- >- // #3) In IE it is necessary to give the Menu a width before the >- // scrollbars are rendered to prevent the Menu from rendering with a >- // width that is 100% of the browser viewport. >- >- bSetWidth = ((UA.gecko && UA.gecko < 1.9) || UA.ie); >- >- if (nScrollHeight > 0 && bSetWidth && !this.cfg.getProperty(_WIDTH)) { >- >- nOffsetWidth = oElement.offsetWidth; >- >- /* >- Measuring the difference of the offsetWidth before and after >- setting the "width" style attribute allows us to compute the >- about of padding and borders applied to the element, which in >- turn allows us to set the "width" property correctly. >- */ >- >- oElement.style.width = nOffsetWidth + _PX; >- >- sWidth = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + _PX; >- >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- >- this.cfg.setProperty(_WIDTH, sWidth); >- >- >- /* >- Set a flag (_widthSetForScroll) to maintain some history regarding how the >- "width" configuration property was set. If the "width" configuration property >- is set by something other than the "_setScrollHeight" method, it will be >- necessary to maintain that new value and not clear the width if scrolling >- is turned off. >- */ >- >- this._widthSetForScroll = true; >- >- this.cfg.subscribeToConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- } >- >- >- if (nScrollHeight > 0 && (!oHeader && !oFooter)) { >- >- >- this.setHeader(_NON_BREAKING_SPACE); >- this.setFooter(_NON_BREAKING_SPACE); >- >- oHeader = this.header; >- oFooter = this.footer; >- >- Dom.addClass(oHeader, _TOP_SCROLLBAR); >- Dom.addClass(oFooter, _BOTTOM_SCROLLBAR); >- >- oElement.insertBefore(oHeader, oBody); >- oElement.appendChild(oFooter); >- >- } >- >- >- nHeight = nScrollHeight; >- >- >- if (oHeader && oFooter) { >- nHeight = (nHeight - (oHeader.offsetHeight + oFooter.offsetHeight)); >- } >- >- >- if ((nHeight > 0) && (oBody.offsetHeight > nScrollHeight)) { >- >- >- Dom.addClass(oBody, _YUI_MENU_BODY_SCROLLED); >- Dom.setStyle(oBody, _HEIGHT, (nHeight + _PX)); >- >- if (!this._hasScrollEventHandlers) { >- >- Event.on(oHeader, _MOUSEOVER, fnMouseOver, this, true); >- Event.on(oHeader, _MOUSEOUT, fnMouseOut, this, true); >- Event.on(oFooter, _MOUSEOVER, fnMouseOver, this, true); >- Event.on(oFooter, _MOUSEOUT, fnMouseOut, this, true); >- >- this._hasScrollEventHandlers = true; >- >- } >- >- this._disableScrollHeader(); >- this._enableScrollFooter(); >- >- bRefireIFrameAndShadow = true; >- >- } >- else if (oHeader && oFooter) { >- >- >- >- /* >- Only clear the "width" configuration property if it was set the >- "_setScrollHeight" method and wasn't changed by some other means after it was set. >- */ >- >- if (this._widthSetForScroll) { >- >- >- this._widthSetForScroll = false; >- >- this.cfg.unsubscribeFromConfigEvent(_WIDTH, this._clearSetWidthFlag); >- >- this.cfg.setProperty(_WIDTH, _EMPTY_STRING); >- >- } >- >- >- this._enableScrollHeader(); >- this._enableScrollFooter(); >- >- if (this._hasScrollEventHandlers) { >- >- Event.removeListener(oHeader, _MOUSEOVER, fnMouseOver); >- Event.removeListener(oHeader, _MOUSEOUT, fnMouseOut); >- Event.removeListener(oFooter, _MOUSEOVER, fnMouseOver); >- Event.removeListener(oFooter, _MOUSEOUT, fnMouseOut); >- >- this._hasScrollEventHandlers = false; >- >- } >- >- oElement.removeChild(oHeader); >- oElement.removeChild(oFooter); >- >- this.header = null; >- this.footer = null; >- >- bRefireIFrameAndShadow = true; >- >- } >- >- >- if (bRefireIFrameAndShadow) { >- >- this.cfg.refireEvent(_IFRAME); >- this.cfg.refireEvent(_SHADOW); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method _setMaxHeight >-* @description "renderEvent" handler used to defer the setting of the >-* "maxheight" configuration property until the menu is rendered in lazy >-* load scenarios. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-* @param {Number} p_nMaxHeight Number representing the value to set for the >-* "maxheight" configuration property. >-* @private >-*/ >-_setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) { >- >- this._setScrollHeight(p_nMaxHeight); >- this.renderEvent.unsubscribe(this._setMaxHeight); >- >-}, >- >- >-/** >-* @method configMaxHeight >-* @description Event handler for when the "maxheight" configuration property of >-* a Menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired >-* the event. >-*/ >-configMaxHeight: function (p_sType, p_aArgs, p_oMenu) { >- >- var nMaxHeight = p_aArgs[0]; >- >- if (this.lazyLoad && !this.body && nMaxHeight > 0) { >- >- this.renderEvent.subscribe(this._setMaxHeight, nMaxHeight, this); >- >- } >- else { >- >- this._setScrollHeight(nMaxHeight); >- >- } >- >-}, >- >- >-/** >-* @method configClassName >-* @description Event handler for when the "classname" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configClassName: function (p_sType, p_aArgs, p_oMenu) { >- >- var sClassName = p_aArgs[0]; >- >- if (this._sClassName) { >- >- Dom.removeClass(this.element, this._sClassName); >- >- } >- >- Dom.addClass(this.element, sClassName); >- this._sClassName = sClassName; >- >-}, >- >- >-/** >-* @method _onItemAdded >-* @description "itemadded" event handler for a Menu instance. >-* @private >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event >-* was fired. >-*/ >-_onItemAdded: function (p_sType, p_aArgs) { >- >- var oItem = p_aArgs[0]; >- >- if (oItem) { >- >- oItem.cfg.setProperty(_DISABLED, true); >- >- } >- >-}, >- >- >-/** >-* @method configDisabled >-* @description Event handler for when the "disabled" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configDisabled: function (p_sType, p_aArgs, p_oMenu) { >- >- var bDisabled = p_aArgs[0], >- aItems = this.getItems(), >- nItems, >- i; >- >- if (Lang.isArray(aItems)) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- aItems[i].cfg.setProperty(_DISABLED, bDisabled); >- >- } >- while (i--); >- >- } >- >- >- if (bDisabled) { >- >- this.clearActiveItem(true); >- >- Dom.addClass(this.element, _DISABLED); >- >- this.itemAddedEvent.subscribe(this._onItemAdded); >- >- } >- else { >- >- Dom.removeClass(this.element, _DISABLED); >- >- this.itemAddedEvent.unsubscribe(this._onItemAdded); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method configShadow >-* @description Event handler for when the "shadow" configuration property of >-* a menu changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event. >-*/ >-configShadow: function (p_sType, p_aArgs, p_oMenu) { >- >- var sizeShadow = function () { >- >- var oElement = this.element, >- oShadow = this._shadow; >- >- if (oShadow && oElement) { >- >- // Clear the previous width >- >- if (oShadow.style.width && oShadow.style.height) { >- >- oShadow.style.width = _EMPTY_STRING; >- oShadow.style.height = _EMPTY_STRING; >- >- } >- >- oShadow.style.width = (oElement.offsetWidth + 6) + _PX; >- oShadow.style.height = (oElement.offsetHeight + 1) + _PX; >- >- } >- >- }; >- >- >- var replaceShadow = function () { >- >- this.element.appendChild(this._shadow); >- >- }; >- >- >- var addShadowVisibleClass = function () { >- >- Dom.addClass(this._shadow, _YUI_MENU_SHADOW_VISIBLE); >- >- }; >- >- >- var removeShadowVisibleClass = function () { >- >- Dom.removeClass(this._shadow, _YUI_MENU_SHADOW_VISIBLE); >- >- }; >- >- >- var createShadow = function () { >- >- var oShadow = this._shadow, >- oElement; >- >- if (!oShadow) { >- >- oElement = this.element; >- >- >- if (!m_oShadowTemplate) { >- >- m_oShadowTemplate = document.createElement(_DIV_LOWERCASE); >- m_oShadowTemplate.className = _YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE; >- >- } >- >- oShadow = m_oShadowTemplate.cloneNode(false); >- >- oElement.appendChild(oShadow); >- >- this._shadow = oShadow; >- >- this.beforeShowEvent.subscribe(addShadowVisibleClass); >- this.beforeHideEvent.subscribe(removeShadowVisibleClass); >- >- >- if (UA.ie) { >- >- /* >- Need to call sizeShadow & syncIframe via setTimeout for >- IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode >- or the shadow and iframe shim will not be sized and >- positioned properly. >- */ >- >- Lang.later(0, this, function () { >- >- sizeShadow.call(this); >- this.syncIframe(); >- >- }); >- >- >- this.cfg.subscribeToConfigEvent(_WIDTH, sizeShadow); >- this.cfg.subscribeToConfigEvent(_HEIGHT, sizeShadow); >- this.cfg.subscribeToConfigEvent(_MAX_HEIGHT, sizeShadow); >- this.changeContentEvent.subscribe(sizeShadow); >- >- Module.textResizeEvent.subscribe(sizeShadow, this, true); >- >- this.destroyEvent.subscribe(function () { >- >- Module.textResizeEvent.unsubscribe(sizeShadow, this); >- >- }); >- >- } >- >- this.cfg.subscribeToConfigEvent(_MAX_HEIGHT, replaceShadow); >- >- } >- >- }; >- >- >- var onBeforeShow = function () { >- >- if (this._shadow) { >- >- // If called because the "shadow" event was refired - just append again and resize >- >- replaceShadow.call(this); >- >- if (UA.ie) { >- sizeShadow.call(this); >- } >- >- } >- else { >- >- createShadow.call(this); >- >- } >- >- this.beforeShowEvent.unsubscribe(onBeforeShow); >- >- }; >- >- >- var bShadow = p_aArgs[0]; >- >- >- if (bShadow && this.cfg.getProperty(_POSITION) == _DYNAMIC) { >- >- if (this.cfg.getProperty(_VISIBLE)) { >- >- if (this._shadow) { >- >- // If the "shadow" event was refired - just append again and resize >- >- replaceShadow.call(this); >- >- if (UA.ie) { >- sizeShadow.call(this); >- } >- >- } >- else { >- createShadow.call(this); >- } >- >- } >- else { >- >- this.beforeShowEvent.subscribe(onBeforeShow); >- >- } >- >- } >- >-}, >- >- >- >-// Public methods >- >- >-/** >-* @method initEvents >-* @description Initializes the custom events for the menu. >-*/ >-initEvents: function () { >- >- Menu.superclass.initEvents.call(this); >- >- // Create custom events >- >- var i = EVENT_TYPES.length - 1, >- aEventData, >- oCustomEvent; >- >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- oCustomEvent = this.createEvent(aEventData[1]); >- oCustomEvent.signature = CustomEvent.LIST; >- >- this[aEventData[0]] = oCustomEvent; >- >- } >- while (i--); >- >-}, >- >- >-/** >-* @method positionOffScreen >-* @description Positions the menu outside of the boundaries of the browser's >-* viewport. Called automatically when a menu is hidden to ensure that >-* it doesn't force the browser to render uncessary scrollbars. >-*/ >-positionOffScreen: function () { >- >- var oIFrame = this.iframe, >- oElement = this.element, >- sPos = this.OFF_SCREEN_POSITION; >- >- oElement.style.top = _EMPTY_STRING; >- oElement.style.left = _EMPTY_STRING; >- >- if (oIFrame) { >- >- oIFrame.style.top = sPos; >- oIFrame.style.left = sPos; >- >- } >- >-}, >- >- >-/** >-* @method getRoot >-* @description Finds the menu's root menu. >-*/ >-getRoot: function () { >- >- var oItem = this.parent, >- oParentMenu, >- returnVal; >- >- if (oItem) { >- >- oParentMenu = oItem.parent; >- >- returnVal = oParentMenu ? oParentMenu.getRoot() : this; >- >- } >- else { >- >- returnVal = this; >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu. >-* @return {String} >-*/ >-toString: function () { >- >- var sReturnVal = _MENU, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @method setItemGroupTitle >-* @description Sets the title of a group of menu items. >-* @param {String} p_sGroupTitle String specifying the title of the group. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to which >-* the title belongs. >-*/ >-setItemGroupTitle: function (p_sGroupTitle, p_nGroupIndex) { >- >- var nGroupIndex, >- oTitle, >- i, >- nFirstIndex; >- >- if (Lang.isString(p_sGroupTitle) && p_sGroupTitle.length > 0) { >- >- nGroupIndex = Lang.isNumber(p_nGroupIndex) ? p_nGroupIndex : 0; >- oTitle = this._aGroupTitleElements[nGroupIndex]; >- >- >- if (oTitle) { >- >- oTitle.innerHTML = p_sGroupTitle; >- >- } >- else { >- >- oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME); >- >- oTitle.innerHTML = p_sGroupTitle; >- >- this._aGroupTitleElements[nGroupIndex] = oTitle; >- >- } >- >- >- i = this._aGroupTitleElements.length - 1; >- >- do { >- >- if (this._aGroupTitleElements[i]) { >- >- Dom.removeClass(this._aGroupTitleElements[i], _FIRST_OF_TYPE); >- >- nFirstIndex = i; >- >- } >- >- } >- while (i--); >- >- >- if (nFirstIndex !== null) { >- >- Dom.addClass(this._aGroupTitleElements[nFirstIndex], >- _FIRST_OF_TYPE); >- >- } >- >- this.changeContentEvent.fire(); >- >- } >- >-}, >- >- >- >-/** >-* @method addItem >-* @description Appends an item to the menu. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to >-* which the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-addItem: function (p_oItem, p_nGroupIndex) { >- >- return this._addItemToGroup(p_nGroupIndex, p_oItem); >- >-}, >- >- >-/** >-* @method addItems >-* @description Adds an array of items to the menu. >-* @param {Array} p_aItems Array of items to be added to the menu. The array >-* can contain strings specifying the text for each item to be created, object >-* literals specifying each of the menu item configuration properties, >-* or MenuItem instances. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to >-* which the items belongs. >-* @return {Array} >-*/ >-addItems: function (p_aItems, p_nGroupIndex) { >- >- var nItems, >- aItems, >- oItem, >- i, >- returnVal; >- >- >- if (Lang.isArray(p_aItems)) { >- >- nItems = p_aItems.length; >- aItems = []; >- >- for(i=0; i<nItems; i++) { >- >- oItem = p_aItems[i]; >- >- if (oItem) { >- >- if (Lang.isArray(oItem)) { >- >- aItems[aItems.length] = this.addItems(oItem, i); >- >- } >- else { >- >- aItems[aItems.length] = this._addItemToGroup(p_nGroupIndex, oItem); >- >- } >- >- } >- >- } >- >- >- if (aItems.length) { >- >- returnVal = aItems; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method insertItem >-* @description Inserts an item into the menu at the specified index. >-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem >-* instance to be added to the menu. >-* @param {String} p_oItem String specifying the text of the item to be added >-* to the menu. >-* @param {Object} p_oItem Object literal containing a set of menu item >-* configuration properties. >-* @param {Number} p_nItemIndex Number indicating the ordinal position at which >-* the item should be added. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which >-* the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-insertItem: function (p_oItem, p_nItemIndex, p_nGroupIndex) { >- >- return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex); >- >-}, >- >- >-/** >-* @method removeItem >-* @description Removes the specified item from the menu. >-* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem >-* instance to be removed from the menu. >-* @param {Number} p_oObject Number specifying the index of the item >-* to be removed. >-* @param {Number} p_nGroupIndex Optional. Number specifying the group to >-* which the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-removeItem: function (p_oObject, p_nGroupIndex) { >- >- var oItem, >- returnVal; >- >- if (!Lang.isUndefined(p_oObject)) { >- >- if (p_oObject instanceof YAHOO.widget.MenuItem) { >- >- oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject); >- >- } >- else if (Lang.isNumber(p_oObject)) { >- >- oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject); >- >- } >- >- if (oItem) { >- >- oItem.destroy(); >- >- >- returnVal = oItem; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getItems >-* @description Returns an array of all of the items in the menu. >-* @return {Array} >-*/ >-getItems: function () { >- >- var aGroups = this._aItemGroups, >- nGroups, >- returnVal, >- aItems = []; >- >- >- if (Lang.isArray(aGroups)) { >- >- nGroups = aGroups.length; >- >- returnVal = ((nGroups == 1) ? aGroups[0] : (Array.prototype.concat.apply(aItems, aGroups))); >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getItemGroups >-* @description Multi-dimensional Array representing the menu items as they >-* are grouped in the menu. >-* @return {Array} >-*/ >-getItemGroups: function () { >- >- return this._aItemGroups; >- >-}, >- >- >-/** >-* @method getItem >-* @description Returns the item at the specified index. >-* @param {Number} p_nItemIndex Number indicating the ordinal position of the >-* item to be retrieved. >-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which >-* the item belongs. >-* @return {YAHOO.widget.MenuItem} >-*/ >-getItem: function (p_nItemIndex, p_nGroupIndex) { >- >- var aGroup, >- returnVal; >- >- if (Lang.isNumber(p_nItemIndex)) { >- >- aGroup = this._getItemGroup(p_nGroupIndex); >- >- if (aGroup) { >- >- returnVal = aGroup[p_nItemIndex]; >- >- } >- >- } >- >- return returnVal; >- >-}, >- >- >-/** >-* @method getSubmenus >-* @description Returns an array of all of the submenus that are immediate >-* children of the menu. >-* @return {Array} >-*/ >-getSubmenus: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- aSubmenus, >- oSubmenu, >- oItem, >- i; >- >- >- if (nItems > 0) { >- >- aSubmenus = []; >- >- for(i=0; i<nItems; i++) { >- >- oItem = aItems[i]; >- >- if (oItem) { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- aSubmenus[aSubmenus.length] = oSubmenu; >- >- } >- >- } >- >- } >- >- } >- >- return aSubmenus; >- >-}, >- >- >-/** >-* @method clearContent >-* @description Removes all of the content from the menu, including the menu >-* items, group titles, header and footer. >-*/ >-clearContent: function () { >- >- var aItems = this.getItems(), >- nItems = aItems.length, >- oElement = this.element, >- oBody = this.body, >- oHeader = this.header, >- oFooter = this.footer, >- oItem, >- oSubmenu, >- i; >- >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- >- if (oItem) { >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- this.cfg.configChangedEvent.unsubscribe( >- this._onParentMenuConfigChange, oSubmenu); >- >- this.renderEvent.unsubscribe(this._onParentMenuRender, >- oSubmenu); >- >- } >- >- this.removeItem(oItem, oItem.groupIndex); >- >- } >- >- } >- while (i--); >- >- } >- >- >- if (oHeader) { >- >- Event.purgeElement(oHeader); >- oElement.removeChild(oHeader); >- >- } >- >- >- if (oFooter) { >- >- Event.purgeElement(oFooter); >- oElement.removeChild(oFooter); >- } >- >- >- if (oBody) { >- >- Event.purgeElement(oBody); >- >- oBody.innerHTML = _EMPTY_STRING; >- >- } >- >- this.activeItem = null; >- >- this._aItemGroups = []; >- this._aListElements = []; >- this._aGroupTitleElements = []; >- >- this.cfg.setProperty(_WIDTH, null); >- >-}, >- >- >-/** >-* @method destroy >-* @description Removes the menu's <code><div></code> element >-* (and accompanying child nodes) from the document. >-*/ >-destroy: function () { >- >- // Remove all items >- >- this.clearContent(); >- >- this._aItemGroups = null; >- this._aListElements = null; >- this._aGroupTitleElements = null; >- >- >- // Continue with the superclass implementation of this method >- >- Menu.superclass.destroy.call(this); >- >- >-}, >- >- >-/** >-* @method setInitialFocus >-* @description Sets focus to the menu's first enabled item. >-*/ >-setInitialFocus: function () { >- >- var oItem = this._getFirstEnabledItem(); >- >- if (oItem) { >- >- oItem.focus(); >- >- } >- >-}, >- >- >-/** >-* @method setInitialSelection >-* @description Sets the "selected" configuration property of the menu's first >-* enabled item to "true." >-*/ >-setInitialSelection: function () { >- >- var oItem = this._getFirstEnabledItem(); >- >- if (oItem) { >- >- oItem.cfg.setProperty(_SELECTED, true); >- } >- >-}, >- >- >-/** >-* @method clearActiveItem >-* @description Sets the "selected" configuration property of the menu's active >-* item to "false" and hides the item's submenu. >-* @param {Boolean} p_bBlur Boolean indicating if the menu's active item >-* should be blurred. >-*/ >-clearActiveItem: function (p_bBlur) { >- >- if (this.cfg.getProperty(_SHOW_DELAY) > 0) { >- >- this._cancelShowDelay(); >- >- } >- >- >- var oActiveItem = this.activeItem, >- oConfig, >- oSubmenu; >- >- if (oActiveItem) { >- >- oConfig = oActiveItem.cfg; >- >- if (p_bBlur) { >- >- oActiveItem.blur(); >- >- this.getRoot()._hasFocus = true; >- >- } >- >- oConfig.setProperty(_SELECTED, false); >- >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- >- if (oSubmenu) { >- >- oSubmenu.hide(); >- >- } >- >- this.activeItem = null; >- >- } >- >-}, >- >- >-/** >-* @method focus >-* @description Causes the menu to receive focus and fires the "focus" event. >-*/ >-focus: function () { >- >- if (!this.hasFocus()) { >- >- this.setInitialFocus(); >- >- } >- >-}, >- >- >-/** >-* @method blur >-* @description Causes the menu to lose focus and fires the "blur" event. >-*/ >-blur: function () { >- >- var oItem; >- >- if (this.hasFocus()) { >- >- oItem = MenuManager.getFocusedMenuItem(); >- >- if (oItem) { >- >- oItem.blur(); >- >- } >- >- } >- >-}, >- >- >-/** >-* @method hasFocus >-* @description Returns a boolean indicating whether or not the menu has focus. >-* @return {Boolean} >-*/ >-hasFocus: function () { >- >- return (MenuManager.getFocusedMenu() == this.getRoot()); >- >-}, >- >- >-_doItemSubmenuSubscribe: function (p_sType, p_aArgs, p_oObject) { >- >- var oItem = p_aArgs[0], >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, p_oObject); >- } >- >-}, >- >- >-_doSubmenuSubscribe: function (p_sType, p_aArgs, p_oObject) { >- >- var oSubmenu = this.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, p_oObject); >- } >- >-}, >- >- >-/** >-* Adds the specified CustomEvent subscriber to the menu and each of >-* its submenus. >-* @method subscribe >-* @param p_type {string} the type, or name of the event >-* @param p_fn {function} the function to exectute when the event fires >-* @param p_obj {Object} An object to be passed along when the event >-* fires >-* @param p_override {boolean} If true, the obj passed in becomes the >-* execution scope of the listener >-*/ >-subscribe: function () { >- >- // Subscribe to the event for this Menu instance >- Menu.superclass.subscribe.apply(this, arguments); >- >- // Subscribe to the "itemAdded" event so that all future submenus >- // also subscribe to this event >- Menu.superclass.subscribe.call(this, _ITEM_ADDED, this._doItemSubmenuSubscribe, arguments); >- >- >- var aItems = this.getItems(), >- nItems, >- oItem, >- oSubmenu, >- i; >- >- >- if (aItems) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.subscribe.apply(oSubmenu, arguments); >- } >- else { >- oItem.cfg.subscribeToConfigEvent(_SUBMENU, this._doSubmenuSubscribe, arguments); >- } >- >- } >- while (i--); >- >- } >- >- } >- >-}, >- >- >-unsubscribe: function () { >- >- // Remove the event for this Menu instance >- Menu.superclass.unsubscribe.apply(this, arguments); >- >- // Remove the "itemAdded" event so that all future submenus don't have >- // the event handler >- Menu.superclass.unsubscribe.call(this, _ITEM_ADDED, this._doItemSubmenuSubscribe, arguments); >- >- >- var aItems = this.getItems(), >- nItems, >- oItem, >- oSubmenu, >- i; >- >- >- if (aItems) { >- >- nItems = aItems.length; >- >- if (nItems > 0) { >- >- i = nItems - 1; >- >- do { >- >- oItem = aItems[i]; >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- oSubmenu.unsubscribe.apply(oSubmenu, arguments); >- } >- else { >- oItem.cfg.unsubscribeFromConfigEvent(_SUBMENU, this._doSubmenuSubscribe, arguments); >- } >- >- } >- while (i--); >- >- } >- >- } >- >-}, >- >- >-/** >-* @description Initializes the class's configurable properties which can be >-* changed using the menu's Config object ("cfg"). >-* @method initDefaultConfig >-*/ >-initDefaultConfig: function () { >- >- Menu.superclass.initDefaultConfig.call(this); >- >- var oConfig = this.cfg; >- >- >- // Module documentation overrides >- >- /** >- * @config effect >- * @description Object or array of objects representing the ContainerEffect >- * classes that are active for animating the container. When set this >- * property is automatically applied to all submenus. >- * @type Object >- * @default null >- */ >- >- // Overlay documentation overrides >- >- >- /** >- * @config x >- * @description Number representing the absolute x-coordinate position of >- * the Menu. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Number >- * @default null >- */ >- >- >- /** >- * @config y >- * @description Number representing the absolute y-coordinate position of >- * the Menu. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Number >- * @default null >- */ >- >- >- /** >- * @description Array of the absolute x and y positions of the Menu. This >- * property is only applied when the "position" configuration property is >- * set to dynamic. >- * @config xy >- * @type Number[] >- * @default null >- */ >- >- >- /** >- * @config context >- * @description Array of context arguments for context-sensitive positioning. >- * The format is: [id or element, element corner, context corner]. >- * For example, setting this property to ["img1", "tl", "bl"] would >- * align the Menu's top left corner to the context element's >- * bottom left corner. This property is only applied when the "position" >- * configuration property is set to dynamic. >- * @type Array >- * @default null >- */ >- >- >- /** >- * @config fixedcenter >- * @description Boolean indicating if the Menu should be anchored to the >- * center of the viewport. This property is only applied when the >- * "position" configuration property is set to dynamic. >- * @type Boolean >- * @default false >- */ >- >- >- /** >- * @config iframe >- * @description Boolean indicating whether or not the Menu 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 Menu instance is intially >- * made visible. This property is only applied when the "position" >- * configuration property is set to dynamic and is automatically applied >- * to all submenus. >- * @type Boolean >- * @default true for IE6 and below, false for all other browsers. >- */ >- >- >- // Add configuration attributes >- >- /* >- Change the default value for the "visible" configuration >- property to "false" by re-adding the property. >- */ >- >- /** >- * @config visible >- * @description Boolean indicating whether or not the menu is visible. If >- * the menu's "position" configuration property is set to "dynamic" (the >- * default), this property toggles the menu's <code><div></code> >- * element's "visibility" style property between "visible" (true) or >- * "hidden" (false). If the menu's "position" configuration property is >- * set to "static" this property toggles the menu's >- * <code><div></code> element's "display" style property >- * between "block" (true) or "none" (false). >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- VISIBLE_CONFIG.key, >- { >- handler: this.configVisible, >- value: VISIBLE_CONFIG.value, >- validator: VISIBLE_CONFIG.validator >- } >- ); >- >- >- /* >- Change the default value for the "constraintoviewport" configuration >- property (inherited by YAHOO.widget.Overlay) to "true" by re-adding the property. >- */ >- >- /** >- * @config constraintoviewport >- * @description Boolean indicating if the menu will try to remain inside >- * the boundaries of the size of viewport. This property is only applied >- * when the "position" configuration property is set to dynamic and is >- * automatically applied to all submenus. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- CONSTRAIN_TO_VIEWPORT_CONFIG.key, >- { >- handler: this.configConstrainToViewport, >- value: CONSTRAIN_TO_VIEWPORT_CONFIG.value, >- validator: CONSTRAIN_TO_VIEWPORT_CONFIG.validator, >- supercedes: CONSTRAIN_TO_VIEWPORT_CONFIG.supercedes >- } >- ); >- >- >- /* >- Change the default value for the "preventcontextoverlap" configuration >- property (inherited by YAHOO.widget.Overlay) to "true" by re-adding the property. >- */ >- >- /** >- * @config preventcontextoverlap >- * @description Boolean indicating whether or not a submenu should overlap its parent MenuItem >- * when the "constraintoviewport" configuration property is set to "true". >- * @type Boolean >- * @default true >- */ >- oConfig.addProperty(PREVENT_CONTEXT_OVERLAP_CONFIG.key, { >- >- value: PREVENT_CONTEXT_OVERLAP_CONFIG.value, >- validator: PREVENT_CONTEXT_OVERLAP_CONFIG.validator, >- supercedes: PREVENT_CONTEXT_OVERLAP_CONFIG.supercedes >- >- }); >- >- >- /** >- * @config position >- * @description String indicating how a menu should be positioned on the >- * screen. Possible values are "static" and "dynamic." Static menus are >- * visible by default and reside in the normal flow of the document >- * (CSS position: static). Dynamic menus are hidden by default, reside >- * out of the normal flow of the document (CSS position: absolute), and >- * can overlay other elements on the screen. >- * @default dynamic >- * @type String >- */ >- oConfig.addProperty( >- POSITION_CONFIG.key, >- { >- handler: this.configPosition, >- value: POSITION_CONFIG.value, >- validator: POSITION_CONFIG.validator, >- supercedes: POSITION_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config submenualignment >- * @description Array defining how submenus should be aligned to their >- * parent menu item. The format is: [itemCorner, submenuCorner]. By default >- * a submenu's top left corner is aligned to its parent menu item's top >- * right corner. >- * @default ["tl","tr"] >- * @type Array >- */ >- oConfig.addProperty( >- SUBMENU_ALIGNMENT_CONFIG.key, >- { >- value: SUBMENU_ALIGNMENT_CONFIG.value, >- suppressEvent: SUBMENU_ALIGNMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config autosubmenudisplay >- * @description Boolean indicating if submenus are automatically made >- * visible when the user mouses over the menu's items. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- AUTO_SUBMENU_DISPLAY_CONFIG.key, >- { >- value: AUTO_SUBMENU_DISPLAY_CONFIG.value, >- validator: AUTO_SUBMENU_DISPLAY_CONFIG.validator, >- suppressEvent: AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config showdelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before a submenu is made visible when the user mouses over >- * the menu's items. This property is only applied when the "position" >- * configuration property is set to dynamic and is automatically applied >- * to all submenus. >- * @default 250 >- * @type Number >- */ >- oConfig.addProperty( >- SHOW_DELAY_CONFIG.key, >- { >- value: SHOW_DELAY_CONFIG.value, >- validator: SHOW_DELAY_CONFIG.validator, >- suppressEvent: SHOW_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config hidedelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before the menu is hidden. This property is only applied when >- * the "position" configuration property is set to dynamic and is >- * automatically applied to all submenus. >- * @default 0 >- * @type Number >- */ >- oConfig.addProperty( >- HIDE_DELAY_CONFIG.key, >- { >- handler: this.configHideDelay, >- value: HIDE_DELAY_CONFIG.value, >- validator: HIDE_DELAY_CONFIG.validator, >- suppressEvent: HIDE_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenuhidedelay >- * @description Number indicating the time (in milliseconds) that should >- * expire before a submenu is hidden when the user mouses out of a menu item >- * heading in the direction of a submenu. The value must be greater than or >- * equal to the value specified for the "showdelay" configuration property. >- * This property is only applied when the "position" configuration property >- * is set to dynamic and is automatically applied to all submenus. >- * @default 250 >- * @type Number >- */ >- oConfig.addProperty( >- SUBMENU_HIDE_DELAY_CONFIG.key, >- { >- value: SUBMENU_HIDE_DELAY_CONFIG.value, >- validator: SUBMENU_HIDE_DELAY_CONFIG.validator, >- suppressEvent: SUBMENU_HIDE_DELAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config clicktohide >- * @description Boolean indicating if the menu will automatically be >- * hidden if the user clicks outside of it. This property is only >- * applied when the "position" configuration property is set to dynamic >- * and is automatically applied to all submenus. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- CLICK_TO_HIDE_CONFIG.key, >- { >- value: CLICK_TO_HIDE_CONFIG.value, >- validator: CLICK_TO_HIDE_CONFIG.validator, >- suppressEvent: CLICK_TO_HIDE_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config container >- * @description HTML element reference or string specifying the id >- * attribute of the HTML element that the menu'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 document.body >- */ >- oConfig.addProperty( >- CONTAINER_CONFIG.key, >- { >- handler: this.configContainer, >- value: document.body, >- suppressEvent: CONTAINER_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config scrollincrement >- * @description Number used to control the scroll speed of a menu. Used to >- * increment the "scrollTop" property of the menu's body by when a menu's >- * content is scrolling. When set this property is automatically applied >- * to all submenus. >- * @default 1 >- * @type Number >- */ >- oConfig.addProperty( >- SCROLL_INCREMENT_CONFIG.key, >- { >- value: SCROLL_INCREMENT_CONFIG.value, >- validator: SCROLL_INCREMENT_CONFIG.validator, >- supercedes: SCROLL_INCREMENT_CONFIG.supercedes, >- suppressEvent: SCROLL_INCREMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config minscrollheight >- * @description Number defining the minimum threshold for the "maxheight" >- * configuration property. When set this property is automatically applied >- * to all submenus. >- * @default 90 >- * @type Number >- */ >- oConfig.addProperty( >- MIN_SCROLL_HEIGHT_CONFIG.key, >- { >- value: MIN_SCROLL_HEIGHT_CONFIG.value, >- validator: MIN_SCROLL_HEIGHT_CONFIG.validator, >- supercedes: MIN_SCROLL_HEIGHT_CONFIG.supercedes, >- suppressEvent: MIN_SCROLL_HEIGHT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config maxheight >- * @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. >- * @default 0 >- * @type Number >- */ >- oConfig.addProperty( >- MAX_HEIGHT_CONFIG.key, >- { >- handler: this.configMaxHeight, >- value: MAX_HEIGHT_CONFIG.value, >- validator: MAX_HEIGHT_CONFIG.validator, >- suppressEvent: MAX_HEIGHT_CONFIG.suppressEvent, >- supercedes: MAX_HEIGHT_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config classname >- * @description String representing the CSS class to be applied to the >- * menu's root <code><div></code> element. The specified class(es) >- * are appended in addition to the default class as specified by the menu's >- * CSS_CLASS_NAME constant. When set this property is automatically >- * applied to all submenus. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- CLASS_NAME_CONFIG.key, >- { >- handler: this.configClassName, >- value: CLASS_NAME_CONFIG.value, >- validator: CLASS_NAME_CONFIG.validator, >- supercedes: CLASS_NAME_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config disabled >- * @description Boolean indicating if the menu should be disabled. >- * Disabling a menu disables each of its items. (Disabled menu items are >- * dimmed and will not respond to user input or fire events.) Disabled >- * menus have a corresponding "disabled" CSS class applied to their root >- * <code><div></code> element. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- DISABLED_CONFIG.key, >- { >- handler: this.configDisabled, >- value: DISABLED_CONFIG.value, >- validator: DISABLED_CONFIG.validator, >- suppressEvent: DISABLED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config shadow >- * @description Boolean indicating if the menu should have a shadow. >- * @default true >- * @type Boolean >- */ >- oConfig.addProperty( >- SHADOW_CONFIG.key, >- { >- handler: this.configShadow, >- value: SHADOW_CONFIG.value, >- validator: SHADOW_CONFIG.validator >- } >- ); >- >- >- /** >- * @config keepopen >- * @description Boolean indicating if the menu should remain open when clicked. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- KEEP_OPEN_CONFIG.key, >- { >- value: KEEP_OPEN_CONFIG.value, >- validator: KEEP_OPEN_CONFIG.validator >- } >- ); >- >-} >- >-}); // END YAHOO.lang.extend >- >-})(); >- >- >- >-(function () { >- >-/** >-* Creates an item for a menu. >-* >-* @param {String} p_oObject String specifying the text of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying >-* the <code><li></code> element of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object >-* specifying the <code><option></code> element of the menu item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu item. See configuration class documentation >-* for more details. >-* @class MenuItem >-* @constructor >-*/ >-YAHOO.widget.MenuItem = function (p_oObject, p_oConfig) { >- >- if (p_oObject) { >- >- if (p_oConfig) { >- >- this.parent = p_oConfig.parent; >- this.value = p_oConfig.value; >- this.id = p_oConfig.id; >- >- } >- >- this.init(p_oObject, p_oConfig); >- >- } >- >-}; >- >- >-var Dom = YAHOO.util.Dom, >- Module = YAHOO.widget.Module, >- Menu = YAHOO.widget.Menu, >- MenuItem = YAHOO.widget.MenuItem, >- CustomEvent = YAHOO.util.CustomEvent, >- UA = YAHOO.env.ua, >- Lang = YAHOO.lang, >- >- // Private string constants >- >- _TEXT = "text", >- _HASH = "#", >- _HYPHEN = "-", >- _HELP_TEXT = "helptext", >- _URL = "url", >- _TARGET = "target", >- _EMPHASIS = "emphasis", >- _STRONG_EMPHASIS = "strongemphasis", >- _CHECKED = "checked", >- _SUBMENU = "submenu", >- _DISABLED = "disabled", >- _SELECTED = "selected", >- _HAS_SUBMENU = "hassubmenu", >- _CHECKED_DISABLED = "checked-disabled", >- _HAS_SUBMENU_DISABLED = "hassubmenu-disabled", >- _HAS_SUBMENU_SELECTED = "hassubmenu-selected", >- _CHECKED_SELECTED = "checked-selected", >- _ONCLICK = "onclick", >- _CLASSNAME = "classname", >- _EMPTY_STRING = "", >- _OPTION = "OPTION", >- _OPTGROUP = "OPTGROUP", >- _LI_UPPERCASE = "LI", >- _HREF = "href", >- _SELECT = "SELECT", >- _DIV = "DIV", >- _START_HELP_TEXT = "<em class=\"helptext\">", >- _START_EM = "<em>", >- _END_EM = "</em>", >- _START_STRONG = "<strong>", >- _END_STRONG = "</strong>", >- _PREVENT_CONTEXT_OVERLAP = "preventcontextoverlap", >- _OBJ = "obj", >- _SCOPE = "scope", >- _NONE = "none", >- _VISIBLE = "visible", >- _SPACE = " ", >- _MENUITEM = "MenuItem", >- _CLICK = "click", >- _SHOW = "show", >- _HIDE = "hide", >- _LI_LOWERCASE = "li", >- _ANCHOR_TEMPLATE = "<a href=\"#\"></a>", >- >- EVENT_TYPES = [ >- >- ["mouseOverEvent", "mouseover"], >- ["mouseOutEvent", "mouseout"], >- ["mouseDownEvent", "mousedown"], >- ["mouseUpEvent", "mouseup"], >- ["clickEvent", _CLICK], >- ["keyPressEvent", "keypress"], >- ["keyDownEvent", "keydown"], >- ["keyUpEvent", "keyup"], >- ["focusEvent", "focus"], >- ["blurEvent", "blur"], >- ["destroyEvent", "destroy"] >- >- ], >- >- TEXT_CONFIG = { >- key: _TEXT, >- value: _EMPTY_STRING, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- HELP_TEXT_CONFIG = { >- key: _HELP_TEXT, >- supercedes: [_TEXT], >- suppressEvent: true >- }, >- >- URL_CONFIG = { >- key: _URL, >- value: _HASH, >- suppressEvent: true >- }, >- >- TARGET_CONFIG = { >- key: _TARGET, >- suppressEvent: true >- }, >- >- EMPHASIS_CONFIG = { >- key: _EMPHASIS, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT] >- }, >- >- STRONG_EMPHASIS_CONFIG = { >- key: _STRONG_EMPHASIS, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT] >- }, >- >- CHECKED_CONFIG = { >- key: _CHECKED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_DISABLED, _SELECTED] >- }, >- >- SUBMENU_CONFIG = { >- key: _SUBMENU, >- suppressEvent: true, >- supercedes: [_DISABLED, _SELECTED] >- }, >- >- DISABLED_CONFIG = { >- key: _DISABLED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true, >- supercedes: [_TEXT, _SELECTED] >- }, >- >- SELECTED_CONFIG = { >- key: _SELECTED, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- ONCLICK_CONFIG = { >- key: _ONCLICK, >- suppressEvent: true >- }, >- >- CLASS_NAME_CONFIG = { >- key: _CLASSNAME, >- value: null, >- validator: Lang.isString, >- suppressEvent: true >- }, >- >- KEY_LISTENER_CONFIG = { >- key: "keylistener", >- value: null, >- suppressEvent: true >- }, >- >- m_oMenuItemTemplate = null, >- >- CLASS_NAMES = {}; >- >- >-/** >-* @method getClassNameForState >-* @description Returns a class name for the specified prefix and state. If the class name does not >-* yet exist, it is created and stored in the CLASS_NAMES object to increase performance. >-* @private >-* @param {String} prefix String representing the prefix for the class name >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var getClassNameForState = function (prefix, state) { >- >- var oClassNames = CLASS_NAMES[prefix]; >- >- if (!oClassNames) { >- CLASS_NAMES[prefix] = {}; >- oClassNames = CLASS_NAMES[prefix]; >- } >- >- >- var sClassName = oClassNames[state]; >- >- if (!sClassName) { >- sClassName = prefix + _HYPHEN + state; >- oClassNames[state] = sClassName; >- } >- >- return sClassName; >- >-}; >- >- >-/** >-* @method addClassNameForState >-* @description Applies a class name to a MenuItem instance's <LI> and <A> elements >-* that represents a MenuItem's state - "disabled," "checked," etc. >-* @private >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var addClassNameForState = function (state) { >- >- Dom.addClass(this.element, getClassNameForState(this.CSS_CLASS_NAME, state)); >- Dom.addClass(this._oAnchor, getClassNameForState(this.CSS_LABEL_CLASS_NAME, state)); >- >-}; >- >-/** >-* @method removeClassNameForState >-* @description Removes a class name from a MenuItem instance's <LI> and <A> elements >-* that represents a MenuItem's state - "disabled," "checked," etc. >-* @private >-* @param {String} state String representing a state - "disabled," "checked," etc. >-*/ >-var removeClassNameForState = function (state) { >- >- Dom.removeClass(this.element, getClassNameForState(this.CSS_CLASS_NAME, state)); >- Dom.removeClass(this._oAnchor, getClassNameForState(this.CSS_LABEL_CLASS_NAME, state)); >- >-}; >- >- >-MenuItem.prototype = { >- >- /** >- * @property CSS_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to the >- * <code><li></code> element of the menu item. >- * @default "yuimenuitem" >- * @final >- * @type String >- */ >- CSS_CLASS_NAME: "yuimenuitem", >- >- >- /** >- * @property CSS_LABEL_CLASS_NAME >- * @description String representing the CSS class(es) to be applied to the >- * menu item's <code><a></code> element. >- * @default "yuimenuitemlabel" >- * @final >- * @type String >- */ >- CSS_LABEL_CLASS_NAME: "yuimenuitemlabel", >- >- >- /** >- * @property SUBMENU_TYPE >- * @description Object representing the type of menu to instantiate and >- * add when parsing the child nodes of the menu item's source HTML element. >- * @final >- * @type YAHOO.widget.Menu >- */ >- SUBMENU_TYPE: null, >- >- >- >- // Private member variables >- >- >- /** >- * @property _oAnchor >- * @description Object reference to the menu item's >- * <code><a></code> element. >- * @default null >- * @private >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-48250443">HTMLAnchorElement</a> >- */ >- _oAnchor: null, >- >- >- /** >- * @property _oHelpTextEM >- * @description Object reference to the menu item's help text >- * <code><em></code> element. >- * @default null >- * @private >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-58190037">HTMLElement</a> >- */ >- _oHelpTextEM: null, >- >- >- /** >- * @property _oSubmenu >- * @description Object reference to the menu item's submenu. >- * @default null >- * @private >- * @type YAHOO.widget.Menu >- */ >- _oSubmenu: null, >- >- >- /** >- * @property _oOnclickAttributeValue >- * @description Object reference to the menu item's current value for the >- * "onclick" configuration attribute. >- * @default null >- * @private >- * @type Object >- */ >- _oOnclickAttributeValue: null, >- >- >- /** >- * @property _sClassName >- * @description The current value of the "classname" configuration attribute. >- * @default null >- * @private >- * @type String >- */ >- _sClassName: null, >- >- >- >- // Public properties >- >- >- /** >- * @property constructor >- * @description Object reference to the menu item's constructor function. >- * @default YAHOO.widget.MenuItem >- * @type YAHOO.widget.MenuItem >- */ >- constructor: MenuItem, >- >- >- /** >- * @property index >- * @description Number indicating the ordinal position of the menu item in >- * its group. >- * @default null >- * @type Number >- */ >- index: null, >- >- >- /** >- * @property groupIndex >- * @description Number indicating the index of the group to which the menu >- * item belongs. >- * @default null >- * @type Number >- */ >- groupIndex: null, >- >- >- /** >- * @property parent >- * @description Object reference to the menu item's parent menu. >- * @default null >- * @type YAHOO.widget.Menu >- */ >- parent: null, >- >- >- /** >- * @property element >- * @description Object reference to the menu item's >- * <code><li></code> element. >- * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level >- * -one-html.html#ID-74680021">HTMLLIElement</a> >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a> >- */ >- element: null, >- >- >- /** >- * @property srcElement >- * @description Object reference to the HTML element (either >- * <code><li></code>, <code><optgroup></code> or >- * <code><option></code>) used create the menu item. >- * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www. >- * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247" >- * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM- >- * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a> >- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3. >- * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"> >- * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM- >- * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a> >- */ >- srcElement: null, >- >- >- /** >- * @property value >- * @description Object reference to the menu item's value. >- * @default null >- * @type Object >- */ >- value: null, >- >- >- /** >- * @property browser >- * @deprecated Use YAHOO.env.ua >- * @description String representing the browser. >- * @type String >- */ >- browser: Module.prototype.browser, >- >- >- /** >- * @property id >- * @description Id of the menu item's root <code><li></code> >- * element. This property should be set via the constructor using the >- * configuration object literal. If an id is not specified, then one will >- * be created using the "generateId" method of the Dom utility. >- * @default null >- * @type String >- */ >- id: null, >- >- >- >- // Events >- >- >- /** >- * @event destroyEvent >- * @description Fires when the menu item's <code><li></code> >- * element is removed from its parent <code><ul></code> element. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseOverEvent >- * @description Fires when the mouse has entered the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseOutEvent >- * @description Fires when the mouse has left the menu item. Passes back >- * the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseDownEvent >- * @description Fires when the user mouses down on the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event mouseUpEvent >- * @description Fires when the user releases a mouse button while the mouse >- * is over the menu item. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event clickEvent >- * @description Fires when the user clicks the on the menu item. Passes >- * back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyPressEvent >- * @description Fires when the user presses an alphanumeric key when the >- * menu item has focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyDownEvent >- * @description Fires when the user presses a key when the menu item has >- * focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event keyUpEvent >- * @description Fires when the user releases a key when the menu item has >- * focus. Passes back the DOM Event object as an argument. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event focusEvent >- * @description Fires when the menu item receives focus. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @event blurEvent >- * @description Fires when the menu item loses the input focus. >- * @type YAHOO.util.CustomEvent >- */ >- >- >- /** >- * @method init >- * @description The MenuItem class's initialization method. 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. >- * @param {String} p_oObject String specifying the text of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying >- * the <code><li></code> element of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >- * specifying the <code><optgroup></code> element of the menu item. >- * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >- * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object >- * specifying the <code><option></code> element of the menu item. >- * @param {Object} p_oConfig Optional. Object literal specifying the >- * configuration for the menu item. See configuration class documentation >- * for more details. >- */ >- init: function (p_oObject, p_oConfig) { >- >- >- if (!this.SUBMENU_TYPE) { >- >- this.SUBMENU_TYPE = Menu; >- >- } >- >- >- // Create the config object >- >- this.cfg = new YAHOO.util.Config(this); >- >- this.initDefaultConfig(); >- >- var oConfig = this.cfg, >- sURL = _HASH, >- oCustomEvent, >- aEventData, >- oAnchor, >- sTarget, >- sText, >- sId, >- i; >- >- >- if (Lang.isString(p_oObject)) { >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject); >- >- } >- else if (p_oObject && p_oObject.tagName) { >- >- switch(p_oObject.tagName.toUpperCase()) { >- >- case _OPTION: >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject.text); >- oConfig.queueProperty(_DISABLED, p_oObject.disabled); >- >- this.value = p_oObject.value; >- >- this.srcElement = p_oObject; >- >- break; >- >- case _OPTGROUP: >- >- this._createRootNodeStructure(); >- >- oConfig.queueProperty(_TEXT, p_oObject.label); >- oConfig.queueProperty(_DISABLED, p_oObject.disabled); >- >- this.srcElement = p_oObject; >- >- this._initSubTree(); >- >- break; >- >- case _LI_UPPERCASE: >- >- // Get the anchor node (if it exists) >- >- oAnchor = Dom.getFirstChild(p_oObject); >- >- >- // Capture the "text" and/or the "URL" >- >- if (oAnchor) { >- >- sURL = oAnchor.getAttribute(_HREF, 2); >- sTarget = oAnchor.getAttribute(_TARGET); >- >- sText = oAnchor.innerHTML; >- >- } >- >- this.srcElement = p_oObject; >- this.element = p_oObject; >- this._oAnchor = oAnchor; >- >- /* >- Set these properties silently to sync up the >- configuration object without making changes to the >- element's DOM >- */ >- >- oConfig.setProperty(_TEXT, sText, true); >- oConfig.setProperty(_URL, sURL, true); >- oConfig.setProperty(_TARGET, sTarget, true); >- >- this._initSubTree(); >- >- break; >- >- } >- >- } >- >- >- if (this.element) { >- >- sId = (this.srcElement || this.element).id; >- >- if (!sId) { >- >- sId = this.id || Dom.generateId(); >- >- this.element.id = sId; >- >- } >- >- this.id = sId; >- >- >- Dom.addClass(this.element, this.CSS_CLASS_NAME); >- Dom.addClass(this._oAnchor, this.CSS_LABEL_CLASS_NAME); >- >- >- i = EVENT_TYPES.length - 1; >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- oCustomEvent = this.createEvent(aEventData[1]); >- oCustomEvent.signature = CustomEvent.LIST; >- >- this[aEventData[0]] = oCustomEvent; >- >- } >- while (i--); >- >- >- if (p_oConfig) { >- >- oConfig.applyConfig(p_oConfig); >- >- } >- >- oConfig.fireQueue(); >- >- } >- >- }, >- >- >- >- // Private methods >- >- /** >- * @method _createRootNodeStructure >- * @description Creates the core DOM structure for the menu item. >- * @private >- */ >- _createRootNodeStructure: function () { >- >- var oElement, >- oAnchor; >- >- if (!m_oMenuItemTemplate) { >- >- m_oMenuItemTemplate = document.createElement(_LI_LOWERCASE); >- m_oMenuItemTemplate.innerHTML = _ANCHOR_TEMPLATE; >- >- } >- >- oElement = m_oMenuItemTemplate.cloneNode(true); >- oElement.className = this.CSS_CLASS_NAME; >- >- oAnchor = oElement.firstChild; >- oAnchor.className = this.CSS_LABEL_CLASS_NAME; >- >- this.element = oElement; >- this._oAnchor = oAnchor; >- >- }, >- >- >- /** >- * @method _initSubTree >- * @description Iterates the source element's childNodes collection and uses >- * the child nodes to instantiate other menus. >- * @private >- */ >- _initSubTree: function () { >- >- var oSrcEl = this.srcElement, >- oConfig = this.cfg, >- oNode, >- aOptions, >- nOptions, >- oMenu, >- n; >- >- >- if (oSrcEl.childNodes.length > 0) { >- >- if (this.parent.lazyLoad && this.parent.srcElement && >- this.parent.srcElement.tagName.toUpperCase() == _SELECT) { >- >- oConfig.setProperty( >- _SUBMENU, >- { id: Dom.generateId(), itemdata: oSrcEl.childNodes } >- ); >- >- } >- else { >- >- oNode = oSrcEl.firstChild; >- aOptions = []; >- >- do { >- >- if (oNode && oNode.tagName) { >- >- switch(oNode.tagName.toUpperCase()) { >- >- case _DIV: >- >- oConfig.setProperty(_SUBMENU, oNode); >- >- break; >- >- case _OPTION: >- >- aOptions[aOptions.length] = oNode; >- >- break; >- >- } >- >- } >- >- } >- while((oNode = oNode.nextSibling)); >- >- >- nOptions = aOptions.length; >- >- if (nOptions > 0) { >- >- oMenu = new this.SUBMENU_TYPE(Dom.generateId()); >- >- oConfig.setProperty(_SUBMENU, oMenu); >- >- for(n=0; n<nOptions; n++) { >- >- oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n]))); >- >- } >- >- } >- >- } >- >- } >- >- }, >- >- >- >- // Event handlers for configuration properties >- >- >- /** >- * @method configText >- * @description Event handler for when the "text" configuration property of >- * the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configText: function (p_sType, p_aArgs, p_oItem) { >- >- var sText = p_aArgs[0], >- oConfig = this.cfg, >- oAnchor = this._oAnchor, >- sHelpText = oConfig.getProperty(_HELP_TEXT), >- sHelpTextHTML = _EMPTY_STRING, >- sEmphasisStartTag = _EMPTY_STRING, >- sEmphasisEndTag = _EMPTY_STRING; >- >- >- if (sText) { >- >- >- if (sHelpText) { >- >- sHelpTextHTML = _START_HELP_TEXT + sHelpText + _END_EM; >- >- } >- >- >- if (oConfig.getProperty(_EMPHASIS)) { >- >- sEmphasisStartTag = _START_EM; >- sEmphasisEndTag = _END_EM; >- >- } >- >- >- if (oConfig.getProperty(_STRONG_EMPHASIS)) { >- >- sEmphasisStartTag = _START_STRONG; >- sEmphasisEndTag = _END_STRONG; >- >- } >- >- >- oAnchor.innerHTML = (sEmphasisStartTag + sText + sEmphasisEndTag + sHelpTextHTML); >- >- } >- >- }, >- >- >- /** >- * @method configHelpText >- * @description Event handler for when the "helptext" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configHelpText: function (p_sType, p_aArgs, p_oItem) { >- >- this.cfg.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configURL >- * @description Event handler for when the "url" configuration property of >- * the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configURL: function (p_sType, p_aArgs, p_oItem) { >- >- var sURL = p_aArgs[0]; >- >- if (!sURL) { >- >- sURL = _HASH; >- >- } >- >- var oAnchor = this._oAnchor; >- >- if (UA.opera) { >- >- oAnchor.removeAttribute(_HREF); >- >- } >- >- oAnchor.setAttribute(_HREF, sURL); >- >- }, >- >- >- /** >- * @method configTarget >- * @description Event handler for when the "target" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configTarget: function (p_sType, p_aArgs, p_oItem) { >- >- var sTarget = p_aArgs[0], >- oAnchor = this._oAnchor; >- >- if (sTarget && sTarget.length > 0) { >- >- oAnchor.setAttribute(_TARGET, sTarget); >- >- } >- else { >- >- oAnchor.removeAttribute(_TARGET); >- >- } >- >- }, >- >- >- /** >- * @method configEmphasis >- * @description Event handler for when the "emphasis" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configEmphasis: function (p_sType, p_aArgs, p_oItem) { >- >- var bEmphasis = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bEmphasis && oConfig.getProperty(_STRONG_EMPHASIS)) { >- >- oConfig.setProperty(_STRONG_EMPHASIS, false); >- >- } >- >- >- oConfig.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configStrongEmphasis >- * @description Event handler for when the "strongemphasis" configuration >- * property of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configStrongEmphasis: function (p_sType, p_aArgs, p_oItem) { >- >- var bStrongEmphasis = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bStrongEmphasis && oConfig.getProperty(_EMPHASIS)) { >- >- oConfig.setProperty(_EMPHASIS, false); >- >- } >- >- oConfig.refireEvent(_TEXT); >- >- }, >- >- >- /** >- * @method configChecked >- * @description Event handler for when the "checked" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configChecked: function (p_sType, p_aArgs, p_oItem) { >- >- var bChecked = p_aArgs[0], >- oConfig = this.cfg; >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED); >- >- } >- else { >- >- removeClassNameForState.call(this, _CHECKED); >- } >- >- >- oConfig.refireEvent(_TEXT); >- >- >- if (oConfig.getProperty(_DISABLED)) { >- >- oConfig.refireEvent(_DISABLED); >- >- } >- >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.refireEvent(_SELECTED); >- >- } >- >- }, >- >- >- >- /** >- * @method configDisabled >- * @description Event handler for when the "disabled" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configDisabled: function (p_sType, p_aArgs, p_oItem) { >- >- var bDisabled = p_aArgs[0], >- oConfig = this.cfg, >- oSubmenu = oConfig.getProperty(_SUBMENU), >- bChecked = oConfig.getProperty(_CHECKED); >- >- >- if (bDisabled) { >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.setProperty(_SELECTED, false); >- >- } >- >- >- addClassNameForState.call(this, _DISABLED); >- >- >- if (oSubmenu) { >- >- addClassNameForState.call(this, _HAS_SUBMENU_DISABLED); >- >- } >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED_DISABLED); >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _DISABLED); >- >- >- if (oSubmenu) { >- >- removeClassNameForState.call(this, _HAS_SUBMENU_DISABLED); >- >- } >- >- >- if (bChecked) { >- >- removeClassNameForState.call(this, _CHECKED_DISABLED); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method configSelected >- * @description Event handler for when the "selected" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configSelected: function (p_sType, p_aArgs, p_oItem) { >- >- var oConfig = this.cfg, >- oAnchor = this._oAnchor, >- >- bSelected = p_aArgs[0], >- bChecked = oConfig.getProperty(_CHECKED), >- oSubmenu = oConfig.getProperty(_SUBMENU); >- >- >- if (UA.opera) { >- >- oAnchor.blur(); >- >- } >- >- >- if (bSelected && !oConfig.getProperty(_DISABLED)) { >- >- addClassNameForState.call(this, _SELECTED); >- >- >- if (oSubmenu) { >- >- addClassNameForState.call(this, _HAS_SUBMENU_SELECTED); >- >- } >- >- >- if (bChecked) { >- >- addClassNameForState.call(this, _CHECKED_SELECTED); >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _SELECTED); >- >- >- if (oSubmenu) { >- >- removeClassNameForState.call(this, _HAS_SUBMENU_SELECTED); >- >- } >- >- >- if (bChecked) { >- >- removeClassNameForState.call(this, _CHECKED_SELECTED); >- >- } >- >- } >- >- >- if (this.hasFocus() && UA.opera) { >- >- oAnchor.focus(); >- >- } >- >- }, >- >- >- /** >- * @method _onSubmenuBeforeHide >- * @description "beforehide" Custom Event handler for a submenu. >- * @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. >- */ >- _onSubmenuBeforeHide: function (p_sType, p_aArgs) { >- >- var oItem = this.parent, >- oMenu; >- >- function onHide() { >- >- oItem._oAnchor.blur(); >- oMenu.beforeHideEvent.unsubscribe(onHide); >- >- } >- >- >- if (oItem.hasFocus()) { >- >- oMenu = oItem.parent; >- >- oMenu.beforeHideEvent.subscribe(onHide); >- >- } >- >- }, >- >- >- /** >- * @method configSubmenu >- * @description Event handler for when the "submenu" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configSubmenu: function (p_sType, p_aArgs, p_oItem) { >- >- var oSubmenu = p_aArgs[0], >- oConfig = this.cfg, >- bLazyLoad = this.parent && this.parent.lazyLoad, >- oMenu, >- sSubmenuId, >- oSubmenuConfig; >- >- >- if (oSubmenu) { >- >- if (oSubmenu instanceof Menu) { >- >- oMenu = oSubmenu; >- oMenu.parent = this; >- oMenu.lazyLoad = bLazyLoad; >- >- } >- else if (Lang.isObject(oSubmenu) && oSubmenu.id && !oSubmenu.nodeType) { >- >- sSubmenuId = oSubmenu.id; >- oSubmenuConfig = oSubmenu; >- >- oSubmenuConfig.lazyload = bLazyLoad; >- oSubmenuConfig.parent = this; >- >- oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig); >- >- >- // Set the value of the property to the Menu instance >- >- oConfig.setProperty(_SUBMENU, oMenu, true); >- >- } >- else { >- >- oMenu = new this.SUBMENU_TYPE(oSubmenu, { lazyload: bLazyLoad, parent: this }); >- >- >- // Set the value of the property to the Menu instance >- >- oConfig.setProperty(_SUBMENU, oMenu, true); >- >- } >- >- >- if (oMenu) { >- >- oMenu.cfg.setProperty(_PREVENT_CONTEXT_OVERLAP, true); >- >- addClassNameForState.call(this, _HAS_SUBMENU); >- >- >- if (oConfig.getProperty(_URL) === _HASH) { >- >- oConfig.setProperty(_URL, (_HASH + oMenu.id)); >- >- } >- >- >- this._oSubmenu = oMenu; >- >- >- if (UA.opera) { >- >- oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide); >- >- } >- >- } >- >- } >- else { >- >- removeClassNameForState.call(this, _HAS_SUBMENU); >- >- if (this._oSubmenu) { >- >- this._oSubmenu.destroy(); >- >- } >- >- } >- >- >- if (oConfig.getProperty(_DISABLED)) { >- >- oConfig.refireEvent(_DISABLED); >- >- } >- >- >- if (oConfig.getProperty(_SELECTED)) { >- >- oConfig.refireEvent(_SELECTED); >- >- } >- >- }, >- >- >- /** >- * @method configOnClick >- * @description Event handler for when the "onclick" configuration property >- * of the menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configOnClick: function (p_sType, p_aArgs, p_oItem) { >- >- var oObject = p_aArgs[0]; >- >- /* >- Remove any existing listeners if a "click" event handler has >- already been specified. >- */ >- >- if (this._oOnclickAttributeValue && (this._oOnclickAttributeValue != oObject)) { >- >- this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, >- this._oOnclickAttributeValue.obj); >- >- this._oOnclickAttributeValue = null; >- >- } >- >- >- if (!this._oOnclickAttributeValue && Lang.isObject(oObject) && >- Lang.isFunction(oObject.fn)) { >- >- this.clickEvent.subscribe(oObject.fn, >- ((_OBJ in oObject) ? oObject.obj : this), >- ((_SCOPE in oObject) ? oObject.scope : null) ); >- >- this._oOnclickAttributeValue = oObject; >- >- } >- >- }, >- >- >- /** >- * @method configClassName >- * @description Event handler for when the "classname" configuration >- * property of a menu item changes. >- * @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 {YAHOO.widget.MenuItem} p_oItem Object representing the menu item >- * that fired the event. >- */ >- configClassName: function (p_sType, p_aArgs, p_oItem) { >- >- var sClassName = p_aArgs[0]; >- >- if (this._sClassName) { >- >- Dom.removeClass(this.element, this._sClassName); >- >- } >- >- Dom.addClass(this.element, sClassName); >- this._sClassName = sClassName; >- >- }, >- >- >- /** >- * @method _dispatchClickEvent >- * @description Dispatches a DOM "click" event to the anchor element of a >- * MenuItem instance. >- * @private >- */ >- _dispatchClickEvent: function () { >- >- var oMenuItem = this, >- oAnchor, >- oEvent; >- >- if (!oMenuItem.cfg.getProperty(_DISABLED)) { >- >- oAnchor = Dom.getFirstChild(oMenuItem.element); >- >- // Dispatch a "click" event to the MenuItem's anchor so that its >- // "click" event handlers will get called in response to the user >- // pressing the keyboard shortcut defined by the "keylistener" >- // configuration property. >- >- if (UA.ie) { >- oAnchor.fireEvent(_ONCLICK); >- } >- else { >- >- if ((UA.gecko && UA.gecko >= 1.9) || UA.opera || UA.webkit) { >- >- oEvent = document.createEvent("HTMLEvents"); >- oEvent.initEvent(_CLICK, true, true); >- >- } >- else { >- >- oEvent = document.createEvent("MouseEvents"); >- oEvent.initMouseEvent(_CLICK, true, true, window, 0, 0, 0, >- 0, 0, false, false, false, false, 0, null); >- >- } >- >- oAnchor.dispatchEvent(oEvent); >- >- } >- >- } >- >- }, >- >- >- /** >- * @method _createKeyListener >- * @description "show" event handler for a Menu instance - responsible for >- * setting up the KeyListener instance for a MenuItem. >- * @private >- * @param {String} type String representing the name of the event that >- * was fired. >- * @param {Array} args Array of arguments sent when the event was fired. >- * @param {Array} keyData Array of arguments sent when the event was fired. >- */ >- _createKeyListener: function (type, args, keyData) { >- >- var oMenuItem = this, >- oMenu = oMenuItem.parent; >- >- var oKeyListener = new YAHOO.util.KeyListener( >- oMenu.element.ownerDocument, >- keyData, >- { >- fn: oMenuItem._dispatchClickEvent, >- scope: oMenuItem, >- correctScope: true }); >- >- >- if (oMenu.cfg.getProperty(_VISIBLE)) { >- oKeyListener.enable(); >- } >- >- >- oMenu.subscribe(_SHOW, oKeyListener.enable, null, oKeyListener); >- oMenu.subscribe(_HIDE, oKeyListener.disable, null, oKeyListener); >- >- oMenuItem._keyListener = oKeyListener; >- >- oMenu.unsubscribe(_SHOW, oMenuItem._createKeyListener, keyData); >- >- }, >- >- >- /** >- * @method configKeyListener >- * @description Event handler for when the "keylistener" configuration >- * property of a menu item changes. >- * @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. >- */ >- configKeyListener: function (p_sType, p_aArgs) { >- >- var oKeyData = p_aArgs[0], >- oMenuItem = this, >- oMenu = oMenuItem.parent; >- >- if (oMenuItem._keyData) { >- >- // Unsubscribe from the "show" event in case the keylistener >- // config was changed before the Menu was ever made visible. >- >- oMenu.unsubscribe(_SHOW, >- oMenuItem._createKeyListener, oMenuItem._keyData); >- >- oMenuItem._keyData = null; >- >- } >- >- >- // Tear down for the previous value of the "keylistener" property >- >- if (oMenuItem._keyListener) { >- >- oMenu.unsubscribe(_SHOW, oMenuItem._keyListener.enable); >- oMenu.unsubscribe(_HIDE, oMenuItem._keyListener.disable); >- >- oMenuItem._keyListener.disable(); >- oMenuItem._keyListener = null; >- >- } >- >- >- if (oKeyData) { >- >- oMenuItem._keyData = oKeyData; >- >- // Defer the creation of the KeyListener instance until the >- // parent Menu is visible. This is necessary since the >- // KeyListener instance needs to be bound to the document the >- // Menu has been rendered into. Deferring creation of the >- // KeyListener instance also improves performance. >- >- oMenu.subscribe(_SHOW, oMenuItem._createKeyListener, >- oKeyData, oMenuItem); >- } >- >- }, >- >- >- // Public methods >- >- >- /** >- * @method initDefaultConfig >- * @description Initializes an item's configurable properties. >- */ >- initDefaultConfig : function () { >- >- var oConfig = this.cfg; >- >- >- // Define the configuration attributes >- >- /** >- * @config text >- * @description String specifying the text label for the menu item. >- * When building a menu from existing HTML the value of this property >- * will be interpreted from the menu's markup. >- * @default "" >- * @type String >- */ >- oConfig.addProperty( >- TEXT_CONFIG.key, >- { >- handler: this.configText, >- value: TEXT_CONFIG.value, >- validator: TEXT_CONFIG.validator, >- suppressEvent: TEXT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config helptext >- * @description String specifying additional instructional text to >- * accompany the text for the menu item. >- * @deprecated Use "text" configuration property to add help text markup. >- * For example: <code>oMenuItem.cfg.setProperty("text", "Copy <em >- * class=\"helptext\">Ctrl + C</em>");</code> >- * @default null >- * @type String|<a href="http://www.w3.org/TR/ >- * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037"> >- * HTMLElement</a> >- */ >- oConfig.addProperty( >- HELP_TEXT_CONFIG.key, >- { >- handler: this.configHelpText, >- supercedes: HELP_TEXT_CONFIG.supercedes, >- suppressEvent: HELP_TEXT_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config url >- * @description String specifying the URL for the menu item's anchor's >- * "href" attribute. When building a menu from existing HTML the value >- * of this property will be interpreted from the menu's markup. >- * @default "#" >- * @type String >- */ >- oConfig.addProperty( >- URL_CONFIG.key, >- { >- handler: this.configURL, >- value: URL_CONFIG.value, >- suppressEvent: URL_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config target >- * @description String specifying the value for the "target" attribute >- * of the menu item's anchor element. <strong>Specifying a target will >- * require the user to click directly on the menu item's anchor node in >- * order to cause the browser to navigate to the specified URL.</strong> >- * When building a menu from existing HTML the value of this property >- * will be interpreted from the menu's markup. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- TARGET_CONFIG.key, >- { >- handler: this.configTarget, >- suppressEvent: TARGET_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config emphasis >- * @description Boolean indicating if the text of the menu item will be >- * rendered with emphasis. >- * @deprecated Use the "text" configuration property to add emphasis. >- * For example: <code>oMenuItem.cfg.setProperty("text", "<em>Some >- * Text</em>");</code> >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- EMPHASIS_CONFIG.key, >- { >- handler: this.configEmphasis, >- value: EMPHASIS_CONFIG.value, >- validator: EMPHASIS_CONFIG.validator, >- suppressEvent: EMPHASIS_CONFIG.suppressEvent, >- supercedes: EMPHASIS_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config strongemphasis >- * @description Boolean indicating if the text of the menu item will be >- * rendered with strong emphasis. >- * @deprecated Use the "text" configuration property to add strong emphasis. >- * For example: <code>oMenuItem.cfg.setProperty("text", "<strong> >- * Some Text</strong>");</code> >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- STRONG_EMPHASIS_CONFIG.key, >- { >- handler: this.configStrongEmphasis, >- value: STRONG_EMPHASIS_CONFIG.value, >- validator: STRONG_EMPHASIS_CONFIG.validator, >- suppressEvent: STRONG_EMPHASIS_CONFIG.suppressEvent, >- supercedes: STRONG_EMPHASIS_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config checked >- * @description Boolean indicating if the menu item should be rendered >- * with a checkmark. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- CHECKED_CONFIG.key, >- { >- handler: this.configChecked, >- value: CHECKED_CONFIG.value, >- validator: CHECKED_CONFIG.validator, >- suppressEvent: CHECKED_CONFIG.suppressEvent, >- supercedes: CHECKED_CONFIG.supercedes >- } >- ); >- >- >- /** >- * @config disabled >- * @description Boolean indicating if the menu item should be disabled. >- * (Disabled menu items are dimmed and will not respond to user input >- * or fire events.) >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- DISABLED_CONFIG.key, >- { >- handler: this.configDisabled, >- value: DISABLED_CONFIG.value, >- validator: DISABLED_CONFIG.validator, >- suppressEvent: DISABLED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config selected >- * @description Boolean indicating if the menu item should >- * be highlighted. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- SELECTED_CONFIG.key, >- { >- handler: this.configSelected, >- value: SELECTED_CONFIG.value, >- validator: SELECTED_CONFIG.validator, >- suppressEvent: SELECTED_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenu >- * @description Object specifying the submenu to be appended to the >- * menu item. The value can be one of the following: <ul><li>Object >- * specifying a Menu instance.</li><li>Object literal specifying the >- * menu to be created. Format: <code>{ id: [menu id], itemdata: >- * [<a href="YAHOO.widget.Menu.html#itemData">array of values for >- * items</a>] }</code>.</li><li>String specifying the id attribute >- * of the <code><div></code> element of the menu.</li><li> >- * Object specifying the <code><div></code> element of the >- * menu.</li></ul> >- * @default null >- * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/ >- * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037"> >- * HTMLElement</a> >- */ >- oConfig.addProperty( >- SUBMENU_CONFIG.key, >- { >- handler: this.configSubmenu, >- supercedes: SUBMENU_CONFIG.supercedes, >- suppressEvent: SUBMENU_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config onclick >- * @description Object literal representing the code to be executed when >- * the item 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 >- */ >- oConfig.addProperty( >- ONCLICK_CONFIG.key, >- { >- handler: this.configOnClick, >- suppressEvent: ONCLICK_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config classname >- * @description CSS class to be applied to the menu item's root >- * <code><li></code> element. The specified class(es) are >- * appended in addition to the default class as specified by the menu >- * item's CSS_CLASS_NAME constant. >- * @default null >- * @type String >- */ >- oConfig.addProperty( >- CLASS_NAME_CONFIG.key, >- { >- handler: this.configClassName, >- value: CLASS_NAME_CONFIG.value, >- validator: CLASS_NAME_CONFIG.validator, >- suppressEvent: CLASS_NAME_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config keylistener >- * @description Object literal representing the key(s) that can be used >- * to trigger the MenuItem's "click" event. Possible attributes are >- * shift (boolean), alt (boolean), ctrl (boolean) and keys (either an int >- * or an array of ints representing keycodes). >- * @default null >- * @type Object >- */ >- oConfig.addProperty( >- KEY_LISTENER_CONFIG.key, >- { >- handler: this.configKeyListener, >- value: KEY_LISTENER_CONFIG.value, >- suppressEvent: KEY_LISTENER_CONFIG.suppressEvent >- } >- ); >- >- }, >- >- /** >- * @method getNextSibling >- * @description Finds the menu item's next sibling. >- * @return YAHOO.widget.MenuItem >- */ >- getNextSibling: function () { >- >- var isUL = function (el) { >- return (el.nodeName.toLowerCase() === "ul"); >- }, >- >- menuitemEl = this.element, >- next = Dom.getNextSibling(menuitemEl), >- parent, >- sibling, >- list; >- >- if (!next) { >- >- parent = menuitemEl.parentNode; >- sibling = Dom.getNextSiblingBy(parent, isUL); >- >- if (sibling) { >- list = sibling; >- } >- else { >- list = Dom.getFirstChildBy(parent.parentNode, isUL); >- } >- >- next = Dom.getFirstChild(list); >- >- } >- >- return YAHOO.widget.MenuManager.getMenuItem(next.id); >- >- }, >- >- /** >- * @method getNextEnabledSibling >- * @description Finds the menu item's next enabled sibling. >- * @return YAHOO.widget.MenuItem >- */ >- getNextEnabledSibling: function () { >- >- var next = this.getNextSibling(); >- >- return (next.cfg.getProperty(_DISABLED) || next.element.style.display == _NONE) ? next.getNextEnabledSibling() : next; >- >- }, >- >- >- /** >- * @method getPreviousSibling >- * @description Finds the menu item's previous sibling. >- * @return {YAHOO.widget.MenuItem} >- */ >- getPreviousSibling: function () { >- >- var isUL = function (el) { >- return (el.nodeName.toLowerCase() === "ul"); >- }, >- >- menuitemEl = this.element, >- next = Dom.getPreviousSibling(menuitemEl), >- parent, >- sibling, >- list; >- >- if (!next) { >- >- parent = menuitemEl.parentNode; >- sibling = Dom.getPreviousSiblingBy(parent, isUL); >- >- if (sibling) { >- list = sibling; >- } >- else { >- list = Dom.getLastChildBy(parent.parentNode, isUL); >- } >- >- next = Dom.getLastChild(list); >- >- } >- >- return YAHOO.widget.MenuManager.getMenuItem(next.id); >- >- }, >- >- >- /** >- * @method getPreviousEnabledSibling >- * @description Finds the menu item's previous enabled sibling. >- * @return {YAHOO.widget.MenuItem} >- */ >- getPreviousEnabledSibling: function () { >- >- var next = this.getPreviousSibling(); >- >- return (next.cfg.getProperty(_DISABLED) || next.element.style.display == _NONE) ? next.getPreviousEnabledSibling() : next; >- >- }, >- >- >- /** >- * @method focus >- * @description Causes the menu item to receive the focus and fires the >- * focus event. >- */ >- focus: function () { >- >- var oParent = this.parent, >- oAnchor = this._oAnchor, >- oActiveItem = oParent.activeItem; >- >- >- function setFocus() { >- >- try { >- >- if (!(UA.ie && !document.hasFocus())) { >- >- if (oActiveItem) { >- >- oActiveItem.blurEvent.fire(); >- >- } >- >- oAnchor.focus(); >- >- this.focusEvent.fire(); >- >- } >- >- } >- catch(e) { >- >- } >- >- } >- >- >- if (!this.cfg.getProperty(_DISABLED) && oParent && oParent.cfg.getProperty(_VISIBLE) && >- this.element.style.display != _NONE) { >- >- >- /* >- Setting focus via a timer fixes a race condition in Firefox, IE >- and Opera where the browser viewport jumps as it trys to >- position and focus the menu. >- */ >- >- Lang.later(0, this, setFocus); >- >- } >- >- }, >- >- >- /** >- * @method blur >- * @description Causes the menu item to lose focus and fires the >- * blur event. >- */ >- blur: function () { >- >- var oParent = this.parent; >- >- if (!this.cfg.getProperty(_DISABLED) && oParent && oParent.cfg.getProperty(_VISIBLE)) { >- >- Lang.later(0, this, function () { >- >- try { >- >- this._oAnchor.blur(); >- this.blurEvent.fire(); >- >- } >- catch (e) { >- >- } >- >- }, 0); >- >- } >- >- }, >- >- >- /** >- * @method hasFocus >- * @description Returns a boolean indicating whether or not the menu item >- * has focus. >- * @return {Boolean} >- */ >- hasFocus: function () { >- >- return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this); >- >- }, >- >- >- /** >- * @method destroy >- * @description Removes the menu item's <code><li></code> element >- * from its parent <code><ul></code> element. >- */ >- destroy: function () { >- >- var oEl = this.element, >- oSubmenu, >- oParentNode, >- aEventData, >- i; >- >- >- if (oEl) { >- >- >- // If the item has a submenu, destroy it first >- >- oSubmenu = this.cfg.getProperty(_SUBMENU); >- >- if (oSubmenu) { >- >- oSubmenu.destroy(); >- >- } >- >- >- // Remove the element from the parent node >- >- oParentNode = oEl.parentNode; >- >- if (oParentNode) { >- >- oParentNode.removeChild(oEl); >- >- this.destroyEvent.fire(); >- >- } >- >- >- // Remove CustomEvent listeners >- >- i = EVENT_TYPES.length - 1; >- >- do { >- >- aEventData = EVENT_TYPES[i]; >- >- this[aEventData[0]].unsubscribeAll(); >- >- } >- while (i--); >- >- >- this.cfg.configChangedEvent.unsubscribeAll(); >- >- } >- >- }, >- >- >- /** >- * @method toString >- * @description Returns a string representing the menu item. >- * @return {String} >- */ >- toString: function () { >- >- var sReturnVal = _MENUITEM, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >- } >- >-}; >- >-Lang.augmentProto(MenuItem, YAHOO.util.EventProvider); >- >-})(); >-(function () { >- >- var _XY = "xy", >- _MOUSEDOWN = "mousedown", >- _CONTEXTMENU = "ContextMenu", >- _SPACE = " "; >- >-/** >-* Creates a list of options or commands which are made visible in response to >-* an HTML element's "contextmenu" event ("mousedown" for Opera). >-* >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the context menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* context menu. >-* @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 context menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying >-* the <code><select></code> element to be used as the data source for >-* the context menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu. See configuration class documentation >-* for more details. >-* @class ContextMenu >-* @constructor >-* @extends YAHOO.widget.Menu >-* @namespace YAHOO.widget >-*/ >-YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) { >- >- YAHOO.widget.ContextMenu.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >-var Event = YAHOO.util.Event, >- UA = YAHOO.env.ua, >- ContextMenu = YAHOO.widget.ContextMenu, >- >- >- >- /** >- * Constant representing the name of the ContextMenu's events >- * @property EVENT_TYPES >- * @private >- * @final >- * @type Object >- */ >- EVENT_TYPES = { >- >- "TRIGGER_CONTEXT_MENU": "triggerContextMenu", >- "CONTEXT_MENU": (UA.opera ? _MOUSEDOWN : "contextmenu"), >- "CLICK": "click" >- >- }, >- >- >- /** >- * Constant representing the ContextMenu's configuration properties >- * @property DEFAULT_CONFIG >- * @private >- * @final >- * @type Object >- */ >- TRIGGER_CONFIG = { >- key: "trigger", >- suppressEvent: true >- }; >- >- >-/** >-* @method position >-* @description "beforeShow" event handler used to position the contextmenu. >-* @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 {Array} p_aPos Array representing the xy position for the context menu. >-*/ >-function position(p_sType, p_aArgs, p_aPos) { >- >- this.cfg.setProperty(_XY, p_aPos); >- >- this.beforeShowEvent.unsubscribe(position, p_aPos); >- >-} >- >- >-YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, { >- >- >- >-// Private properties >- >- >-/** >-* @property _oTrigger >-* @description Object reference to the current value of the "trigger" >-* configuration property. >-* @default null >-* @private >-* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve >-* l-one-html.html#ID-58190037">HTMLElement</a>|Array >-*/ >-_oTrigger: null, >- >- >-/** >-* @property _bCancelled >-* @description Boolean indicating if the display of the context menu should >-* be cancelled. >-* @default false >-* @private >-* @type Boolean >-*/ >-_bCancelled: false, >- >- >- >-// Public properties >- >- >-/** >-* @property contextEventTarget >-* @description Object reference for the HTML element that was the target of the >-* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of >-* the context menu. >-* @default null >-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-58190037">HTMLElement</a> >-*/ >-contextEventTarget: null, >- >- >- >-// Events >- >- >-/** >-* @event triggerContextMenuEvent >-* @description Custom Event wrapper for the "contextmenu" DOM event >-* ("mousedown" for Opera) fired by the element(s) that trigger the display of >-* the context menu. >-*/ >-triggerContextMenuEvent: null, >- >- >- >-/** >-* @method init >-* @description The ContextMenu class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the context menu. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for >-* the context menu. >-* @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 context menu. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- >-* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying >-* the <code><select></code> element to be used as the data source for >-* the context menu. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu. See configuration class documentation >-* for more details. >-*/ >-init: function(p_oElement, p_oConfig) { >- >- >- // Call the init of the superclass (YAHOO.widget.Menu) >- >- ContextMenu.superclass.init.call(this, p_oElement); >- >- >- this.beforeInitEvent.fire(ContextMenu); >- >- >- if (p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- this.initEvent.fire(ContextMenu); >- >-}, >- >- >-/** >-* @method initEvents >-* @description Initializes the custom events for the context menu. >-*/ >-initEvents: function() { >- >- ContextMenu.superclass.initEvents.call(this); >- >- // Create custom events >- >- this.triggerContextMenuEvent = this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU); >- >- this.triggerContextMenuEvent.signature = YAHOO.util.CustomEvent.LIST; >- >-}, >- >- >-/** >-* @method cancel >-* @description Cancels the display of the context menu. >-*/ >-cancel: function() { >- >- this._bCancelled = true; >- >-}, >- >- >- >-// Private methods >- >- >-/** >-* @method _removeEventHandlers >-* @description Removes all of the DOM event handlers from the HTML element(s) >-* whose "context menu" event ("click" for Opera) trigger the display of >-* the context menu. >-* @private >-*/ >-_removeEventHandlers: function() { >- >- var oTrigger = this._oTrigger; >- >- >- // Remove the event handlers from the trigger(s) >- >- if (oTrigger) { >- >- Event.removeListener(oTrigger, EVENT_TYPES.CONTEXT_MENU, this._onTriggerContextMenu); >- >- if (UA.opera) { >- >- Event.removeListener(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick); >- >- } >- >- } >- >-}, >- >- >- >-// Private event handlers >- >- >- >-/** >-* @method _onTriggerClick >-* @description "click" event handler for the HTML element(s) identified as the >-* "trigger" for the context menu. Used to cancel default behaviors in Opera. >-* @private >-* @param {Event} p_oEvent Object representing the DOM event object passed back >-* by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that is handling the event. >-*/ >-_onTriggerClick: function(p_oEvent, p_oMenu) { >- >- if (p_oEvent.ctrlKey) { >- >- Event.stopEvent(p_oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onTriggerContextMenu >-* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML >-* element(s) that trigger the display of the context menu. >-* @private >-* @param {Event} p_oEvent Object representing the DOM event object passed back >-* by the event utility (YAHOO.util.Event). >-* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that is handling the event. >-*/ >-_onTriggerContextMenu: function(p_oEvent, p_oMenu) { >- >- var aXY; >- >- if (!(p_oEvent.type == _MOUSEDOWN && !p_oEvent.ctrlKey)) { >- >- this.contextEventTarget = Event.getTarget(p_oEvent); >- >- this.triggerContextMenuEvent.fire(p_oEvent); >- >- >- if (!this._bCancelled) { >- >- /* >- Prevent the browser's default context menu from appearing and >- stop the propagation of the "contextmenu" event so that >- other ContextMenu instances are not displayed. >- */ >- >- Event.stopEvent(p_oEvent); >- >- >- // Hide any other Menu instances that might be visible >- >- YAHOO.widget.MenuManager.hideVisible(); >- >- >- >- // Position and display the context menu >- >- aXY = Event.getXY(p_oEvent); >- >- >- if (!YAHOO.util.Dom.inDocument(this.element)) { >- >- this.beforeShowEvent.subscribe(position, aXY); >- >- } >- else { >- >- this.cfg.setProperty(_XY, aXY); >- >- } >- >- >- this.show(); >- >- } >- >- this._bCancelled = false; >- >- } >- >-}, >- >- >- >-// Public methods >- >- >-/** >-* @method toString >-* @description Returns a string representing the context menu. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = _CONTEXTMENU, >- sId = this.id; >- >- if (sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @method initDefaultConfig >-* @description Initializes the class's configurable properties which can be >-* changed using the context menu's Config object ("cfg"). >-*/ >-initDefaultConfig: function() { >- >- ContextMenu.superclass.initDefaultConfig.call(this); >- >- /** >- * @config trigger >- * @description The HTML element(s) whose "contextmenu" event ("mousedown" >- * for Opera) trigger the display of the context menu. Can be a string >- * representing the id attribute of the HTML element, an object reference >- * for the HTML element, or an array of strings or HTML element references. >- * @default null >- * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/ >- * level-one-html.html#ID-58190037">HTMLElement</a>|Array >- */ >- this.cfg.addProperty(TRIGGER_CONFIG.key, >- { >- handler: this.configTrigger, >- suppressEvent: TRIGGER_CONFIG.suppressEvent >- } >- ); >- >-}, >- >- >-/** >-* @method destroy >-* @description Removes the context menu's <code><div></code> element >-* (and accompanying child nodes) from the document. >-*/ >-destroy: function() { >- >- // Remove the DOM event handlers from the current trigger(s) >- >- this._removeEventHandlers(); >- >- >- // Continue with the superclass implementation of this method >- >- ContextMenu.superclass.destroy.call(this); >- >-}, >- >- >- >-// Public event handlers for configuration properties >- >- >-/** >-* @method configTrigger >-* @description Event handler for when the value of the "trigger" configuration >-* property changes. >-* @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 {YAHOO.widget.ContextMenu} p_oMenu Object representing the context >-* menu that fired the event. >-*/ >-configTrigger: function(p_sType, p_aArgs, p_oMenu) { >- >- var oTrigger = p_aArgs[0]; >- >- if (oTrigger) { >- >- /* >- If there is a current "trigger" - remove the event handlers >- from that element(s) before assigning new ones >- */ >- >- if (this._oTrigger) { >- >- this._removeEventHandlers(); >- >- } >- >- this._oTrigger = oTrigger; >- >- >- /* >- Listen for the "mousedown" event in Opera b/c it does not >- support the "contextmenu" event >- */ >- >- Event.on(oTrigger, EVENT_TYPES.CONTEXT_MENU, this._onTriggerContextMenu, this, true); >- >- >- /* >- Assign a "click" event handler to the trigger element(s) for >- Opera to prevent default browser behaviors. >- */ >- >- if (UA.opera) { >- >- Event.on(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick, this, true); >- >- } >- >- } >- else { >- >- this._removeEventHandlers(); >- >- } >- >-} >- >-}); // END YAHOO.lang.extend >- >-}()); >- >- >- >-/** >-* Creates an item for a context menu. >-* >-* @param {String} p_oObject String specifying the text of the context menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the context menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the context >-* menu item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the context menu item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the context menu item. See configuration class >-* documentation for more details. >-* @class ContextMenuItem >-* @constructor >-* @extends YAHOO.widget.MenuItem >-* @deprecated As of version 2.4.0 items for YAHOO.widget.ContextMenu instances >-* are of type YAHOO.widget.MenuItem. >-*/ >-YAHOO.widget.ContextMenuItem = YAHOO.widget.MenuItem; >-(function () { >- >- var Lang = YAHOO.lang, >- >- // String constants >- >- _STATIC = "static", >- _DYNAMIC_STATIC = "dynamic," + _STATIC, >- _DISABLED = "disabled", >- _SELECTED = "selected", >- _AUTO_SUBMENU_DISPLAY = "autosubmenudisplay", >- _SUBMENU = "submenu", >- _VISIBLE = "visible", >- _SPACE = " ", >- _SUBMENU_TOGGLE_REGION = "submenutoggleregion", >- _MENUBAR = "MenuBar"; >- >-/** >-* Horizontal collection of items, each of which can contain a submenu. >-* >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu bar. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* menu bar. >-* @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 menu bar. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object >-* specifying the <code><select></code> element to be used as the data >-* source for the menu bar. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar. See configuration class documentation for >-* more details. >-* @class MenuBar >-* @constructor >-* @extends YAHOO.widget.Menu >-* @namespace YAHOO.widget >-*/ >-YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) { >- >- YAHOO.widget.MenuBar.superclass.constructor.call(this, p_oElement, p_oConfig); >- >-}; >- >- >-/** >-* @method checkPosition >-* @description Checks to make sure that the value of the "position" property >-* is one of the supported strings. Returns true if the position is supported. >-* @private >-* @param {Object} p_sPosition String specifying the position of the menu. >-* @return {Boolean} >-*/ >-function checkPosition(p_sPosition) { >- >- var returnVal = false; >- >- if (Lang.isString(p_sPosition)) { >- >- returnVal = (_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase())) != -1); >- >- } >- >- return returnVal; >- >-} >- >- >-var Event = YAHOO.util.Event, >- MenuBar = YAHOO.widget.MenuBar, >- >- POSITION_CONFIG = { >- key: "position", >- value: _STATIC, >- validator: checkPosition, >- supercedes: [_VISIBLE] >- }, >- >- SUBMENU_ALIGNMENT_CONFIG = { >- key: "submenualignment", >- value: ["tl","bl"] >- }, >- >- AUTO_SUBMENU_DISPLAY_CONFIG = { >- key: _AUTO_SUBMENU_DISPLAY, >- value: false, >- validator: Lang.isBoolean, >- suppressEvent: true >- }, >- >- SUBMENU_TOGGLE_REGION_CONFIG = { >- key: _SUBMENU_TOGGLE_REGION, >- value: false, >- validator: Lang.isBoolean >- }; >- >- >- >-Lang.extend(MenuBar, YAHOO.widget.Menu, { >- >-/** >-* @method init >-* @description The MenuBar class's initialization method. 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. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><div></code> element of the menu bar. >-* @param {String} p_oElement String specifying the id attribute of the >-* <code><select></code> element to be used as the data source for the >-* menu bar. >-* @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 menu bar. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object >-* specifying the <code><select></code> element to be used as the data >-* source for the menu bar. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar. See configuration class documentation for >-* more details. >-*/ >-init: function(p_oElement, p_oConfig) { >- >- if(!this.ITEM_TYPE) { >- >- this.ITEM_TYPE = YAHOO.widget.MenuBarItem; >- >- } >- >- >- // Call the init of the superclass (YAHOO.widget.Menu) >- >- MenuBar.superclass.init.call(this, p_oElement); >- >- >- this.beforeInitEvent.fire(MenuBar); >- >- >- if(p_oConfig) { >- >- this.cfg.applyConfig(p_oConfig, true); >- >- } >- >- this.initEvent.fire(MenuBar); >- >-}, >- >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the menu >-* bar's <code><div></code> element. >-* @default "yuimenubar" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenubar", >- >- >-/** >-* @property SUBMENU_TOGGLE_REGION_WIDTH >-* @description Width (in pixels) of the area of a MenuBarItem that, when pressed, will toggle the >-* display of the MenuBarItem's submenu. >-* @default 20 >-* @final >-* @type Number >-*/ >-SUBMENU_TOGGLE_REGION_WIDTH: 20, >- >- >-// Protected event handlers >- >- >-/** >-* @method _onKeyDown >-* @description "keydown" Custom Event handler for the menu bar. >-* @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 {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar >-* that fired the event. >-*/ >-_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) { >- >- var oEvent = p_aArgs[0], >- oItem = p_aArgs[1], >- oSubmenu, >- oItemCfg, >- oNextItem; >- >- >- if(oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oItemCfg = oItem.cfg; >- >- switch(oEvent.keyCode) { >- >- case 37: // Left arrow >- case 39: // Right arrow >- >- if(oItem == this.activeItem && !oItemCfg.getProperty(_SELECTED)) { >- >- oItemCfg.setProperty(_SELECTED, true); >- >- } >- else { >- >- oNextItem = (oEvent.keyCode == 37) ? >- oItem.getPreviousEnabledSibling() : >- oItem.getNextEnabledSibling(); >- >- if(oNextItem) { >- >- this.clearActiveItem(); >- >- oNextItem.cfg.setProperty(_SELECTED, true); >- >- oSubmenu = oNextItem.cfg.getProperty(_SUBMENU); >- >- if(oSubmenu) { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- oNextItem.focus(); >- } >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- break; >- >- case 40: // Down arrow >- >- if(this.activeItem != oItem) { >- >- this.clearActiveItem(); >- >- oItemCfg.setProperty(_SELECTED, true); >- oItem.focus(); >- >- } >- >- oSubmenu = oItemCfg.getProperty(_SUBMENU); >- >- if(oSubmenu) { >- >- if(oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.setInitialSelection(); >- oSubmenu.setInitialFocus(); >- >- } >- else { >- >- oSubmenu.show(); >- oSubmenu.setInitialFocus(); >- >- } >- >- } >- >- Event.preventDefault(oEvent); >- >- break; >- >- } >- >- } >- >- >- if(oEvent.keyCode == 27 && this.activeItem) { // Esc key >- >- oSubmenu = this.activeItem.cfg.getProperty(_SUBMENU); >- >- if(oSubmenu && oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- this.activeItem.focus(); >- >- } >- else { >- >- this.activeItem.cfg.setProperty(_SELECTED, false); >- this.activeItem.blur(); >- >- } >- >- Event.preventDefault(oEvent); >- >- } >- >-}, >- >- >-/** >-* @method _onClick >-* @description "click" event handler for the menu bar. >-* @protected >-* @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 {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar >-* that fired the event. >-*/ >-_onClick: function(p_sType, p_aArgs, p_oMenuBar) { >- >- MenuBar.superclass._onClick.call(this, p_sType, p_aArgs, p_oMenuBar); >- >- var oItem = p_aArgs[1], >- bReturnVal = true, >- oItemEl, >- oEvent, >- oTarget, >- oActiveItem, >- oConfig, >- oSubmenu, >- nMenuItemX, >- nToggleRegion; >- >- >- var toggleSubmenuDisplay = function () { >- >- if(oSubmenu.cfg.getProperty(_VISIBLE)) { >- >- oSubmenu.hide(); >- >- } >- else { >- >- oSubmenu.show(); >- >- } >- >- }; >- >- >- if(oItem && !oItem.cfg.getProperty(_DISABLED)) { >- >- oEvent = p_aArgs[0]; >- oTarget = Event.getTarget(oEvent); >- oActiveItem = this.activeItem; >- oConfig = this.cfg; >- >- >- // Hide any other submenus that might be visible >- >- if(oActiveItem && oActiveItem != oItem) { >- >- this.clearActiveItem(); >- >- } >- >- >- oItem.cfg.setProperty(_SELECTED, true); >- >- >- // Show the submenu for the item >- >- oSubmenu = oItem.cfg.getProperty(_SUBMENU); >- >- >- if(oSubmenu) { >- >- oItemEl = oItem.element; >- nMenuItemX = YAHOO.util.Dom.getX(oItemEl); >- nToggleRegion = nMenuItemX + (oItemEl.offsetWidth - this.SUBMENU_TOGGLE_REGION_WIDTH); >- >- if (oConfig.getProperty(_SUBMENU_TOGGLE_REGION)) { >- >- if (Event.getPageX(oEvent) > nToggleRegion) { >- >- toggleSubmenuDisplay(); >- >- Event.preventDefault(oEvent); >- >- /* >- Return false so that other click event handlers are not called when the >- user clicks inside the toggle region. >- */ >- bReturnVal = false; >- >- } >- >- } >- else { >- >- toggleSubmenuDisplay(); >- >- } >- >- } >- >- } >- >- >- return bReturnVal; >- >-}, >- >- >- >-// Public methods >- >-/** >-* @method configSubmenuToggle >-* @description Event handler for when the "submenutoggleregion" configuration property of >-* a MenuBar changes. >-* @param {String} p_sType The name of the event that was fired. >-* @param {Array} p_aArgs Collection of arguments sent when the event was fired. >-*/ >-configSubmenuToggle: function (p_sType, p_aArgs) { >- >- var bSubmenuToggle = p_aArgs[0]; >- >- if (bSubmenuToggle) { >- >- this.cfg.setProperty(_AUTO_SUBMENU_DISPLAY, false); >- >- } >- >-}, >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu bar. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = _MENUBAR, >- sId = this.id; >- >- if(sId) { >- >- sReturnVal += (_SPACE + sId); >- >- } >- >- return sReturnVal; >- >-}, >- >- >-/** >-* @description Initializes the class's configurable properties which can be >-* changed using the menu bar's Config object ("cfg"). >-* @method initDefaultConfig >-*/ >-initDefaultConfig: function() { >- >- MenuBar.superclass.initDefaultConfig.call(this); >- >- var oConfig = this.cfg; >- >- // Add configuration properties >- >- >- /* >- Set the default value for the "position" configuration property >- to "static" by re-adding the property. >- */ >- >- >- /** >- * @config position >- * @description String indicating how a menu bar should be positioned on the >- * screen. Possible values are "static" and "dynamic." Static menu bars >- * are visible by default and reside in the normal flow of the document >- * (CSS position: static). Dynamic menu bars are hidden by default, reside >- * out of the normal flow of the document (CSS position: absolute), and can >- * overlay other elements on the screen. >- * @default static >- * @type String >- */ >- oConfig.addProperty( >- POSITION_CONFIG.key, >- { >- handler: this.configPosition, >- value: POSITION_CONFIG.value, >- validator: POSITION_CONFIG.validator, >- supercedes: POSITION_CONFIG.supercedes >- } >- ); >- >- >- /* >- Set the default value for the "submenualignment" configuration property >- to ["tl","bl"] by re-adding the property. >- */ >- >- /** >- * @config submenualignment >- * @description Array defining how submenus should be aligned to their >- * parent menu bar item. The format is: [itemCorner, submenuCorner]. >- * @default ["tl","bl"] >- * @type Array >- */ >- oConfig.addProperty( >- SUBMENU_ALIGNMENT_CONFIG.key, >- { >- value: SUBMENU_ALIGNMENT_CONFIG.value, >- suppressEvent: SUBMENU_ALIGNMENT_CONFIG.suppressEvent >- } >- ); >- >- >- /* >- Change the default value for the "autosubmenudisplay" configuration >- property to "false" by re-adding the property. >- */ >- >- /** >- * @config autosubmenudisplay >- * @description Boolean indicating if submenus are automatically made >- * visible when the user mouses over the menu bar's items. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- AUTO_SUBMENU_DISPLAY_CONFIG.key, >- { >- value: AUTO_SUBMENU_DISPLAY_CONFIG.value, >- validator: AUTO_SUBMENU_DISPLAY_CONFIG.validator, >- suppressEvent: AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent >- } >- ); >- >- >- /** >- * @config submenutoggleregion >- * @description Boolean indicating if only a specific region of a MenuBarItem should toggle the >- * display of a submenu. The default width of the region is determined by the value of the >- * SUBMENU_TOGGLE_REGION_WIDTH property. If set to true, the autosubmenudisplay >- * configuration property will be set to false, and any click event listeners will not be >- * called when the user clicks inside the submenu toggle region of a MenuBarItem. If the >- * user clicks outside of the submenu toggle region, the MenuBarItem will maintain its >- * standard behavior. >- * @default false >- * @type Boolean >- */ >- oConfig.addProperty( >- SUBMENU_TOGGLE_REGION_CONFIG.key, >- { >- value: SUBMENU_TOGGLE_REGION_CONFIG.value, >- validator: SUBMENU_TOGGLE_REGION_CONFIG.validator, >- handler: this.configSubmenuToggle >- } >- ); >- >-} >- >-}); // END YAHOO.lang.extend >- >-}()); >- >- >- >-/** >-* Creates an item for a menu bar. >-* >-* @param {String} p_oObject String specifying the text of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the menu bar item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar item. See configuration class documentation >-* for more details. >-* @class MenuBarItem >-* @constructor >-* @extends YAHOO.widget.MenuItem >-*/ >-YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) { >- >- YAHOO.widget.MenuBarItem.superclass.constructor.call(this, p_oObject, p_oConfig); >- >-}; >- >-YAHOO.lang.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, { >- >- >- >-/** >-* @method init >-* @description The MenuBarItem class's initialization method. 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. >-* @param {String} p_oObject String specifying the text of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the >-* <code><li></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object >-* specifying the <code><optgroup></code> element of the menu bar item. >-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level- >-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying >-* the <code><option></code> element of the menu bar item. >-* @param {Object} p_oConfig Optional. Object literal specifying the >-* configuration for the menu bar item. See configuration class documentation >-* for more details. >-*/ >-init: function(p_oObject, p_oConfig) { >- >- if(!this.SUBMENU_TYPE) { >- >- this.SUBMENU_TYPE = YAHOO.widget.Menu; >- >- } >- >- >- /* >- Call the init of the superclass (YAHOO.widget.MenuItem) >- Note: We don't pass the user config in here yet >- because we only want it executed once, at the lowest >- subclass level. >- */ >- >- YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject); >- >- >- var oConfig = this.cfg; >- >- if(p_oConfig) { >- >- oConfig.applyConfig(p_oConfig, true); >- >- } >- >- oConfig.fireQueue(); >- >-}, >- >- >- >-// Constants >- >- >-/** >-* @property CSS_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* <code><li></code> element of the menu bar item. >-* @default "yuimenubaritem" >-* @final >-* @type String >-*/ >-CSS_CLASS_NAME: "yuimenubaritem", >- >- >-/** >-* @property CSS_LABEL_CLASS_NAME >-* @description String representing the CSS class(es) to be applied to the >-* menu bar item's <code><a></code> element. >-* @default "yuimenubaritemlabel" >-* @final >-* @type String >-*/ >-CSS_LABEL_CLASS_NAME: "yuimenubaritemlabel", >- >- >- >-// Public methods >- >- >-/** >-* @method toString >-* @description Returns a string representing the menu bar item. >-* @return {String} >-*/ >-toString: function() { >- >- var sReturnVal = "MenuBarItem"; >- >- if(this.cfg && this.cfg.getProperty("text")) { >- >- sReturnVal += (": " + this.cfg.getProperty("text")); >- >- } >- >- return sReturnVal; >- >-} >- >-}); // END YAHOO.lang.extend >-YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/plugins/bubbling-min.js b/koha-tmpl/intranet-tmpl/lib/yui/plugins/bubbling-min.js >deleted file mode 100644 >index a3ed113830..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/plugins/bubbling-min.js >+++ /dev/null >@@ -1,12 +0,0 @@ >-/* >-======= >-/* >-Copyright (c) 2007, Caridy Patiño. All rights reserved. >-Portions Copyright (c) 2007, Yahoo!, Inc. All rights reserved. >-Code licensed under the BSD License: >-http://www.bubbling-library.com/eng/licence >-version: 1.4.0 >-*/ >-YAHOO.namespace("plugin","behavior");YAHOO.namespace("CMS","CMS.widget","CMS.behaviors","CMS.plugin"); >-(function(){var $Y=YAHOO.util,$E=YAHOO.util.Event,$D=YAHOO.util.Dom,$L=YAHOO.lang,$=YAHOO.util.Dom.get;YAHOO.Bubbling=function(){var obj={},ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1);var navRelExternal=function(layer,args){var el=args[1].anchor;if(!args[1].decrepitate&&el){var r=el.getAttribute("rel"),t=el.getAttribute("target");if((!t||(t===''))&&(r=='external')){el.setAttribute("target","blank");}}};var defaultActionsControl=function(layer,args){obj.processingAction(layer,args,obj.defaultActions);};var _searchYUIButton=function(t){var el=obj.getOwnerByClassName(t,'yui-button'),bt=null,id=null;if($L.isObject(el)&&YAHOO.widget.Button){bt=YAHOO.widget.Button.getButton(el.id);}return bt;};obj.ready=false;obj.bubble={};obj.onReady=new $Y.CustomEvent('bubblingOnReady',obj,true);obj.getOwnerByClassName=function(node,className){return($D.hasClass(node,className)?node:$D.getAncestorByClassName(node,className));};obj.getOwnerByTagName=function(node,tagName){node=$D.get(node);if(!node){return null;}return(node.tagName&&node.tagName.toUpperCase()==tagName.toUpperCase()?node:$D.getAncestorByTagName(node,tagName));};obj.getAncestorByClassName=obj.getOwnerByClassName;obj.getAncestorByTagName=obj.getOwnerByTagName;obj.onKeyPressedTrigger=function(args,e,m){var b='key';e=e||$E.getEvent();m=m||{};m.action=b;m.target=args.target;m.decrepitate=false;m.event=e;m.stop=false;m.type=args.type;m.keyCode=args.keyCode;m.charCode=args.charCode;m.ctrlKey=args.ctrlKey;m.shiftKey=args.shiftKey;m.altKey=args.altKey;this.bubble.key.fire(e,m);if(m.stop){$E.stopEvent(e);}return m.stop;};obj.onEventTrigger=function(b,e,m){e=e||$E.getEvent();m=m||{};m.action=b;m.target=(e?$E.getTarget(e):null);m.decrepitate=false;m.event=e;m.stop=false;this.bubble[b].fire(e,m);if(m.stop){$E.stopEvent(e);}return m.stop;};obj.onNavigate=function(e){var conf={anchor:this.getOwnerByTagName($E.getTarget(e),'A'),button:_searchYUIButton($E.getTarget(e))};if(!conf.anchor&&!conf.button){conf.input=this.getOwnerByTagName($E.getTarget(e),'INPUT');}if(conf.button){conf.value=conf.button.get('value');}else if(conf.input){conf.value=conf.input.getAttribute('value');}if(!this.onEventTrigger('navigate',e,conf)){this.onEventTrigger('god',e,conf);}};obj.onProperty=function(e){this.onEventTrigger('property',e,{anchor:this.getOwnerByTagName($E.getTarget(e),'A'),button:_searchYUIButton($E.getTarget(e))});};obj._timeoutId=0;obj.onRepaint=function(e){clearTimeout(obj._timeoutId);obj._timeoutId=setTimeout(function(){var b='repaint',e={target:document.body},m={action:b,target:null,event:e,decrepitate:false,stop:false};obj.bubble[b].fire(e,m);if(m.stop){$E.stopEvent(e);}},150);};obj.onRollOver=function(e){this.onEventTrigger('rollover',e,{anchor:this.getOwnerByTagName($E.getTarget(e),'A')});};obj.onRollOut=function(e){this.onEventTrigger('rollout',e,{anchor:this.getOwnerByTagName($E.getTarget(e),'A')});};obj.onKeyPressed=function(args){this.onKeyPressedTrigger(args);};obj.onKeyListener=function(ev,args){this.onKeyPressedTrigger(args[1]);};obj.getActionName=function(el,depot){depot=depot||{};var b=null,r=null,f=($D.inDocument(el)?function(b){return $D.hasClass(el,b)}:function(b){return el.hasClass(b);});if(el&&($L.isObject(el)||(el=$(el)))){try{r=el.getAttribute("rel");}catch(e){};for(b in depot){if((depot.hasOwnProperty(b))&&(f(b)||(b===r))){return b;}}}return null;};obj.getFirstChildByTagName=function(el,t){if(el&&($L.isObject(el)||(el=$(el)))&&t){var l=el.getElementsByTagName(t);if(l.length>0){return l[0];}}return null;};obj.virtualTarget=function(e,el){if(el&&($L.isObject(el)||(el=$(el)))&&e){var t=$E.getRelatedTarget(e);if($L.isObject(t)){while((t.parentNode)&&$L.isObject(t.parentNode)&&(t.parentNode.tagName!=="BODY")){if(t.parentNode===el){return true;}t=t.parentNode;}}}return false;};obj.addLayer=function(layers,scope){var result=false;layers=($L.isArray(layers)?layers:[layers]);scope=scope||window;for(var i=0;i<layers.length;++i){if(layers[i]&&!this.bubble.hasOwnProperty(layers[i])){this.bubble[layers[i]]=new $Y.CustomEvent(layers[i],scope,true);result=true;}}return result;};obj.subscribe=function(layer,bh,scope){var first=this.addLayer(layer);if(layer){if($L.isObject(scope)){this.bubble[layer].subscribe(bh,scope,true);}else{this.bubble[layer].subscribe(bh);}}return first;};obj.on=obj.subscribe;obj.fire=function(layer,obj){obj=obj||{};obj.action=layer;obj.decrepitate=false;obj.stop=false;if(this.bubble.hasOwnProperty(layer)){this.bubble[layer].fire(null,obj);}return obj.stop;};obj.processingAction=function(layer,args,actions,force){var behavior=null,t;if(!args[1].decrepitate||force){t=args[1].anchor||args[1].input||args[1].button;if(t){behavior=this.getActionName(t,actions);args[1].el=t;}if(behavior&&(actions[behavior].apply(args[1],[layer,args]))){$E.stopEvent(args[0]);args[1].decrepitate=true;args[1].stop=true;}}};obj.defaultActions={};obj.addDefaultAction=function(n,f){if(n&&f&&(!this.defaultActions.hasOwnProperty(n))){this.defaultActions[n]=f;}};$E.addListener(window,"resize",obj.onRepaint,obj,true);obj.on('navigate',navRelExternal);obj.on('navigate',defaultActionsControl);obj.initMonitors=function(config){var fMonitors=function(){var oMonitors=new YAHOO.widget.Module('yui-cms-font-monitor',{monitorresize:true,visible:false});oMonitors.render(document.body);YAHOO.widget.Module.textResizeEvent.subscribe(obj.onRepaint,obj,true);YAHOO.widget.Overlay.windowScrollEvent.subscribe(obj.onRepaint,obj,true);};if($L.isFunction(YAHOO.widget.Module)){$E.onDOMReady(fMonitors,obj,true);}};obj.init=function(){if(!this.ready){var el=document.body;$E.addListener(el,"click",obj.onNavigate,obj,true);$E.addListener(el,(isOpera?"mousedown":"contextmenu"),obj.onProperty,obj,true);if(isOpera){$E.addListener(el,"click",obj.onProperty,obj,true);}$E.addListener(el,"mouseover",obj.onRollOver,obj,true);$E.addListener(el,"mouseout",obj.onRollOut,obj,true);$E.addListener(document,"keydown",obj.onKeyPressed,obj,true);$E.addListener(document,"keyup",obj.onKeyPressed,obj,true);this.ready=true;obj.onReady.fire();}};$E.onDOMReady(obj.init,obj,true);obj.addLayer(['navigate','god','property','key','repaint','rollover','rollout']);return obj;}();})();YAHOO.CMS.Bubble=YAHOO.Bubbling; >-YAHOO.register("bubbling",YAHOO.Bubbling,{version:"1.4.0",build:"216"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/plugins/loading-min.js b/koha-tmpl/intranet-tmpl/lib/yui/plugins/loading-min.js >deleted file mode 100644 >index 06d36fa5e7..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/plugins/loading-min.js >+++ /dev/null >@@ -1,9 +0,0 @@ >-/* >-Copyright (c) 2007, Caridy Pati�o. All rights reserved. >-Portions Copyright (c) 2007, Yahoo!, Inc. All rights reserved. >-Code licensed under the BSD License: >-http://www.bubbling-library.com/eng/licence >-version: 1.5.0 >-*/ >-(function(){var $B=YAHOO.Bubbling,$L=YAHOO.lang,$E=YAHOO.util.Event,$D=YAHOO.util.Dom,$=YAHOO.util.Dom.get;YAHOO.widget.Loading=function(){var obj={},_handle='yui-cms-loading',_content='yui-cms-float',_visible=false,_ready=false,_timer=null,_backup={},_defStyle={zIndex:10000,left:0,top:0,margin:0,padding:0,opacity:0,overflow:'hidden',visibility:'visible',position:'absolute',display:'block'};_defConf={autodismissdelay:0,opacity:1,closeOnDOMReady:false,closeOnLoad:true,close:false,effect:false};function _onHide(){if($L.isObject(obj.element)){$D.setStyle(obj.element,'opacity',0);$D.setStyle(obj.element,'display','none');}}function _onShow(){if($L.isObject(obj.element)){$D.setStyle(obj.element,'opacity',_defConf.opacity);}}var actionControl=function(layer,args){if(_visible&&$L.isObject(obj.element)&&((obj.element===args[1].target)||$D.isAncestor(obj.element,args[1].target))){if(window.confirm('Do you want to hide the loading mask?')){obj.hide();}}};$B.on('navigate',actionControl);$B.on('property',actionControl);obj.element=null;obj.content=null;obj.anim=null;obj.backup={};obj.config=function(userConfig){c=userConfig||{};_defConf.close=($L.isBoolean(c.close)?c.close:_defConf.close);_defConf.effect=($L.isBoolean(c.effect)?c.effect:_defConf.effect);_defConf.opacity=($L.isNumber(c.opacity)?c.opacity:_defConf.opacity);_defConf.autodismissdelay=($L.isNumber(c.autodismissdelay)?c.autodismissdelay:_defConf.autodismissdelay);if(this.element&&_visible){_onShow();}};obj.backup=function(){var el=document.body;_backup.padding=$D.getStyle(el,'padding');_backup.margin=$D.getStyle(el,'margin');_backup.overflow=$D.getStyle(el,'overflow');};obj.restore=function(){var el=document.body;$D.setStyle(el,'padding',_backup.padding);$D.setStyle(el,'padding',_backup.padding);$D.setStyle(el,'overflow',_backup.overflow);};obj.init=function(){var item;this.element=$(_handle);this.content=$(_content);if(!_ready&&($L.isObject(this.element))){_ready=true;this.backup();for(item in _defStyle){if(_defStyle.hasOwnProperty(item)){$D.setStyle(this.element,item,_defStyle[item]);}}obj.show(true);}};obj.adjust=function(){var vp={top:$D.getDocumentScrollTop(),left:$D.getDocumentScrollLeft(),width:$D.getViewportWidth(),height:$D.getViewportHeight()};if(_visible){$D.setStyle(this.element,'height',vp.height+'px');$D.setStyle(this.element,'width',vp.width+'px');$D.setXY(this.element,[vp.left,vp.top]);if(this.content){var size=$D.getRegion(this.content);var oHeight=size.bottom-size.top;var oWidth=size.right-size.left;$D.setXY(this.content,[vp.left+((vp.width-oWidth)/2),vp.top+((vp.height-oHeight)/2)]);}}};obj.show=function(firstTime){if(this.element&&!_visible){_visible=true;$D.setStyle(document.body,'overflow','hidden');$D.setStyle(this.element,'display','block');if(firstTime){$B.on('repaint',obj.adjust,obj,true);}obj.adjust();if(_defConf.effect&&!firstTime){if((this.anim)&&(this.anim.isAnimated())){this.anim.stop();}this.anim=new YAHOO.util.Anim(this.element,{opacity:{to:0.9}},1.5,YAHOO.util.Easing.easeIn);this.anim.onComplete.subscribe(_onShow);this.anim.animate();}else{_onShow();}if(_defConf.closeOnDOMReady){$E.onDOMReady(obj.hide,obj,true);}if(_defConf.closeOnLoad){$E.on(window,'load',obj.hide,obj,true);}window.clearTimeout(_timer);_timer=null;if($L.isNumber(_defConf.autodismissdelay)&&(_defConf.autodismissdelay>0)){_timer=window.setTimeout(function(){obj.hide();},Math.abs(_defConf.autodismissdelay));}}};obj.hide=function(){if(this.element&&_visible){_visible=false;if(_defConf.effect){if((this.anim)&&(this.anim.isAnimated())){this.anim.stop();}this.anim=new YAHOO.util.Anim(this.element,{opacity:{to:0}},1.5,YAHOO.util.Easing.easeOut);this.anim.onComplete.subscribe(_onHide);this.anim.animate();}else{_onHide();}obj.restore();}};if($D.inDocument(_handle)){obj.init();}else{$E.onContentReady(_handle,obj.init,obj,true);}if($L.isObject(YAHOO.widget._cLoading)){obj.config(YAHOO.widget._cLoading);}return obj;}();})(); >-YAHOO.register("loading",YAHOO.widget.Loading,{version:"1.4.0",build:"214"}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/split-button-arrow-active.png b/koha-tmpl/intranet-tmpl/lib/yui/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/split-button-arrow-disabled.png b/koha-tmpl/intranet-tmpl/lib/yui/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/split-button-arrow-focus.png b/koha-tmpl/intranet-tmpl/lib/yui/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/split-button-arrow-hover.png b/koha-tmpl/intranet-tmpl/lib/yui/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/split-button-arrow.png b/koha-tmpl/intranet-tmpl/lib/yui/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/sprite.png b/koha-tmpl/intranet-tmpl/lib/yui/sprite.png >deleted file mode 100644 >index afd65e05aaabc820fc2e6bba0740818773fcd599..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 3123 >zcmYk8dpy(oAIHCQkKB(`L$fBLgHFmdwpy8rlp;APT_~3%jD%5a64_7ZI7gvht{voB >z<bF*JXCyPtWg9ay#<pfN#(q2J_c)K=@BPpF^Y}d8pVuF+*XQwgzMpt{xT>q}Rs{e+ >z-3^62FY9IipggQ1FFWB*a!LR|9`HPK;e=Ew6|)+qskFuJ!wbzOg3pDl>|;V3o3~i# >z`tXaj0DoRRu4F)J<y=XwH(Slh>L)Jb=jRW`t43mpchf5=Me6i8o#fm`-snmC%q*)6 >zJgNd(gTc%WKBv*>DY!0|;4d??v#YMIuOl^Bbq+b@J!^V;tP02V`Tid*LMGi6m@o8J >z>n?7vsmweV&J*x_@zJ^43P|62cAM>?<CSdoBJWK=Q!_a%ER1vz^tQH_*l;&BHC1%+ >zq98hYjocm?8OdZa*`50-l!@M)9cyZ8OtdAj_RQqu)bN)P6APTK#%b~58&Pl4yXPn& >z&CBul%kwvyIZur@NTfteB_myf`@)7<XXNJQW@(!z3=U>RX)HYWfgYv33mp7&V*j_k >zr;FY`!nnAYsOL0axw(G#J+K(}+dVMze>t6NSZK5pfBZ-#M00ZvkjE)oTU%XST@s08 >zV`F1|eO)9H&9hjuvvVt4?&|95vG8w9o|H<XEiEna`Fx>JNT<)x=rgOULRl#DJn7_; >zlr%4$=S#)n^-okOi_M-{mM$(X&2pu4OeU2^Utizg@%UtxY(TuYv^2++eql-nW~4*2 >z(%va4l_M32#FPaojU(j?1e}!>#9cB5gMmV!e7;~+C>$gX&$HN-)iqo$Pgdgf_4clA >zLjQo{tpWRh-sW+sP$+_jj4p9Fqogs*^EKAq?^!Ii{f*B@gNRd8)RmPLfvi?ndq4Jl >zXlb*(+P$>IVa~I-TrP*RLMD&PRO{b2&do95p(J?N7?004J5y@mQ9+LZ^F}U-TU)=M >zcU>JgQ(Ie0pI^zz$@xxn3JwltQo4AgATm~o#bRw>Fsrl-Nkq(0BW`nLX3PmfUzQdW >zeJQS(;EScpS^F78^ak0Jt*Z9D$Z<YVpZ%|ZtxdtX@IE0WVJ1Kw0!!ZDggUs_aV)Kh >zi%TXt-2(#y_qqO?$()~<oa&%ROWstBk5eY6s4Twh<4X_uwN9W+@?`FVqRxAG0dVGc >zAONV)-H?b2u@uhagV-Nd4L|Y1U*I7%$=5pZHMNYB)~BnQDO%8N_mQwmgh0@1^XnOx >z5w%kdqb$nU<;x-OV?ri42~?5WibZk?zSL~2@ZBj*)|Cm$9nAOB<`G%qghJgTE%E*s >zg@T0Xq3|H|^Pu)2;$XUBHVkX~h<nczbytq?C!|Rq_DYFBM(}m<tqL%z65$Hu!BG@5 >znc;?)fP3-A$FbXY{dDuQwcc^)NE}>OYg#G$I^Ibcb`?Z0$G=NrJcNi1P~MLj@({5d >zsvVS_mCSev5ra_93fY+CowAqzmGCIUr}cf>e9l{bb)!QU)&jq8fjS0h+5;0MF?t|k >zbCk1M_6B?e$ku#x(@Le|8to%Q(l58xQ_+H0!}**|`k&HC9Ma~xYkcjMN1DoLr;U4% >z;=~lC40=+>!JDbOH|0w`4`;T3ITXQYd8qR@d(Pl;Am;nsYeB<$^sqtj)S}aD`h(YH >ziOmAy@5j~}acOD$L<+QV`#q`!5iF6ZsUYjV)tMRM2MJLni-|<$0sG?RP~LXNy6_jR >zPI*9Dnn&X{h+7b-0Ikt!ZxE@`d2oBCIDU$oyZJlOc<}p%2<|9ftrA{zSZI*65Iv~Y >zBq4GS0NUE7N!#)OrDK=utc_iLSPsAdW!B|^0s6*?STL`RsMh5CGC~dlJ>`>_#zsSI >z)t9+vQE8Ld-yxx_&@}zN$-G!I9i#L(6z+>?-*RTk-iJj-Ujs(TQvWy2YDFEomvHAA >z_o1;p6*rcBM(LchwrAhkS+Q#;qSw;RK9(PN7Iy}Bkh<7nuCtsW(`dQzE~)`}w6Mny >za6sPu{FOcca!6U@QSU*a9>9VPXbr5Ba!z^U^*x5?pr=;2T$(M=n-9!919<zAuC#dL >zdh$CJv|<#}Y(c$XV8#Q$sJVK7+^!g5n)G{*izxst92NZ*h>0{BKCB_Ubo6m%pJlk` >zo+jnYkRu{iP1!fQ;tUP>M6$Pm!BiiDEWG^o5C2byEeCDwbNwG6E-oDgETXx~HA6F( >zf$?8|lLq%??27pXOdfQx?m<JSJ1;xL+fd)j!h9!MKX<d5^n$jCLLzPU7mK3-b@gH2 >zq<kE-whW|`r<hbFUo!;iEl^53s#XI(p(fDm@l7&LP`c(1o4jME<~ix>#N5*p4Me~` >zXe0%J($efe#bduFjmvI6<^otj7iI;2M{ehcGUl+-_NK!iRt0d~N&$7x5QsIQm7|tY >z0iJ16&JGU%iTow8d+)H$72O1MI|xY-Ol#kMQuV~ykqQ)g#r1x2m5;}E;?x^`7{v&i >zs=dz6yJ?3MoI^jfK~2>Qy=;ESm<66;-e@tqa?MPzk0J~@d765($9CHJ>yMoqc0@sZ >z)Q4=fN=6ZT{L~!q71(+3?QFuJjcpq==w{#;DgU)JWSQNpKBq$>-4c+aV=C@H`7X?i >zx^;_$&8)1bU*}XEnAjO8sHm)~BWs~!q_3~u`t@{1fG?(FDz`hME+f&=@BGxu<Y*G{ >zR`{H>p1l-WW?H>uxOYN=74bD6r<t{J99ys2w+@YSUL6UejBJ|NZwyY2l$Mt29KRD| >zV&y5#&3!(5$+;$?Xt~%e)m?+WrCe~?Dk$+;q}lzc5d%Z-o!u6kaz=CR_ooKk*_m;* >zdAU#@Z@X0XHoZ1|dp!(VMYAIGk7-V>p2ZP|wr6^JdS3;J)tAmOB<U4(g~d19|L~ei >z*FM3drdt?Un8z)pCrBKj&{OuBMi<tNY|!QFfAZ&ieG{-%XD_0I4qPlrZ-+x_K5GTu >zT1b^oR>xjhsDD*gT~ou=?|imcHPq&zs-};~KOpC*M?~AFgpC7LD!BTfmbOeJQg9%D >zYMLbDb;Eu~tDTi?4b!?y{DS$(Xwp{umiD4{)~AQvwcE%1XL*Blfe$V;_1)QEH;z4Y >zdcR1n7>=B&>kW9A@YbB@bidRvPJf?9%U1CYgM{F-_nsdAuu6IUy6ne@*z2LJXq5@_ >z)kC|L+NL=g6S2M<W7n+T9IGBd|Jt)yU)nIWXt=HMoqhWuKabcp*FeMC7PUNTPpV%- >zHLvR1bRcVq^Yi%FSOeF5YnQfmN#50YbMniU4*!IRlZe3OQ?qeCQp+1xy1M3?hHO)s >z^n)Z{H0m$A2Xr+@qjy?kmDN<s%YUku^HQg;Hs$8_^!O%we?8LQKUqnq!xv4M<e<4c >zI^EtYSznSG`O9g1%>_jFs}T5_=bdGP(2sw-eOsc5=x`}1k$`0ZoRES{4#givEdzuB >zc<kCfe5(emT9MEK=cDnhI<OT50vN$J$G7f+g)0*L;QZbAR&|(E;ov_^_$fo<$?bT5 >z)l-3MMp{N&J7F$zgdjNoXDy?|U9eXG;Ws$n4Ii%tlPc2b`f&aOyktAfMUg;7{7t04 >zxl(i-`U0}U%%mHP(A8R2pwrzUO}k(*j~IrKCOw!jK3@GVz&Jw0mMCEo<0(X}oc0gV >z@BvXMWEn3Akg1*Nu-0>)c<fU5P#)#1dWz|aUXdq=5d6FNN#*Po_}agl09edp#x{Jb >z%HK#V^FtviW$-mad#?L1H;ly1q;TI-xqmXaoCU7>3in3=*ImpF+v4ggcV0aKV46UZ >z=xxgwFL{ZHHka&C+#Pe<`X3hxERD5Gs0*9#9PY$eq0q^U&A+g?2SlHrp;gR;g9w_4 >z`(RYT|Jjy@G}b<<`!yuEbnjH%i)Y~A98iF;Bt$>F|458i@D9HY0qM*^?5Af{?+;K* >z{bvh8<Kk;o6G}JjW4v5ladE*^=Ip!!c4$KKVJPULIKF+hBbr?v>|nVnE*~rBj@x@! >zof9&_7rsV}YBXM9tX-~Pu<G`IViNNw9&Sb96tnh|at@OlIP?@cZy@^Mt>&$Heqjpz >t#6&}WQC_v4-qAr9E!idrg%(C}T>`R7sV<66EZOD*xSjAoRvo+c=s&g>bp!wa > >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/utilities/utilities.js b/koha-tmpl/intranet-tmpl/lib/yui/utilities/utilities.js >deleted file mode 100644 >index 550ff217d6..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/utilities/utilities.js >+++ /dev/null >@@ -1,39 +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 >-*/ >-if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var D=function(H){var I=0;return parseFloat(H.replace(/\./g,function(){return(I++==1)?"":".";}));},G=navigator,F={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:G.cajaVersion,secure:false,os:null},C=navigator&&navigator.userAgent,E=window&&window.location,B=E&&E.href,A;F.secure=B&&(B.toLowerCase().indexOf("https")===0);if(C){if((/windows|win32/i).test(C)){F.os="windows";}else{if((/macintosh/i).test(C)){F.os="macintosh";}}if((/KHTML/).test(C)){F.webkit=1;}A=C.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){F.webkit=D(A[1]);if(/ Mobile\//.test(C)){F.mobile="Apple";}else{A=C.match(/NokiaN[^\/]*/);if(A){F.mobile=A[0];}}A=C.match(/AdobeAIR\/([^\s]*)/);if(A){F.air=A[0];}}if(!F.webkit){A=C.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){F.opera=D(A[1]);A=C.match(/Opera Mini[^;]*/);if(A){F.mobile=A[0];}}else{A=C.match(/MSIE\s([^;]*)/);if(A&&A[1]){F.ie=D(A[1]);}else{A=C.match(/Gecko\/([^\s]*)/);if(A){F.gecko=1;A=C.match(/rv:([^\s\)]*)/);if(A&&A[1]){F.gecko=D(A[1]);}}}}}}return F;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C++){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,A=Object.prototype,H="[object Array]",C="[object Function]",G="[object Object]",E=[],F=["toString","valueOf"],D={isArray:function(I){return A.toString.apply(I)===H;},isBoolean:function(I){return typeof I==="boolean";},isFunction:function(I){return(typeof I==="function")||A.toString.apply(I)===C;},isNull:function(I){return I===null;},isNumber:function(I){return typeof I==="number"&&isFinite(I);},isObject:function(I){return(I&&(typeof I==="object"||B.isFunction(I)))||false;},isString:function(I){return typeof I==="string";},isUndefined:function(I){return typeof I==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(K,J){var I,M,L;for(I=0;I<F.length;I=I+1){M=F[I];L=J[M];if(B.isFunction(L)&&L!=A[M]){K[M]=L;}}}:function(){},extend:function(L,M,K){if(!M||!L){throw new Error("extend failed, please check that "+"all dependencies are included.");}var J=function(){},I;J.prototype=M.prototype;L.prototype=new J();L.prototype.constructor=L;L.superclass=M.prototype;if(M.prototype.constructor==A.constructor){M.prototype.constructor=M;}if(K){for(I in K){if(B.hasOwnProperty(K,I)){L.prototype[I]=K[I];}}B._IEEnumFix(L.prototype,K);}},augmentObject:function(M,L){if(!L||!M){throw new Error("Absorb failed, verify dependencies.");}var I=arguments,K,N,J=I[2];if(J&&J!==true){for(K=2;K<I.length;K=K+1){M[I[K]]=L[I[K]];}}else{for(N in L){if(J||!(N in M)){M[N]=L[N];}}B._IEEnumFix(M,L);}},augmentProto:function(L,K){if(!K||!L){throw new Error("Augment failed, verify dependencies.");}var I=[L.prototype,K.prototype],J;for(J=2;J<arguments.length;J=J+1){I.push(arguments[J]);}B.augmentObject.apply(this,I);},dump:function(I,N){var K,M,P=[],Q="{...}",J="f(){...}",O=", ",L=" => ";if(!B.isObject(I)){return I+"";}else{if(I instanceof Date||("nodeType" in I&&"tagName" in I)){return I;}else{if(B.isFunction(I)){return J;}}}N=(B.isNumber(N))?N:3;if(B.isArray(I)){P.push("[");for(K=0,M=I.length;K<M;K=K+1){if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K<I;K=K+1){B.augmentObject(L,J[K],true);}return L;},later:function(P,J,Q,L,M){P=P||0;J=J||{};var K=Q,O=L,N,I;if(B.isString(Q)){K=J[Q];}if(!K){throw new TypeError("method undefined");}if(O&&!B.isArray(O)){O=[L];}N=function(){K.apply(J,O||E);};I=(M)?setInterval(N,P):setTimeout(N,P);return{interval:M,cancel:function(){if(this.interval){clearInterval(I);}else{clearTimeout(I);}}};},isValue:function(I){return(B.isObject(I)||B.isString(I)||B.isNumber(I)||B.isBoolean(I));}};B.hasOwnProperty=(A.hasOwnProperty)?function(I,J){return I&&I.hasOwnProperty(J);}:function(I,J){return !B.isUndefined(I[J])&&I.constructor.prototype[J]!==I[J];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.8.0r4",build:"2449"}); >-YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V]);}}return Z;};var I=function(U,V,T){var W={id:"yui__dyn_"+(R++),type:"text/css",rel:"stylesheet",href:U};if(T){S.augmentObject(W,T);}return J("link",W,V);};var P=function(U,V,T){var W={id:"yui__dyn_"+(R++),type:"text/javascript",src:U};if(T){S.augmentObject(W,T);}return J("script",W,V);};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId);}};};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T);}return V;};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V));}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return;}if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T));}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.scope||T;T.onTimeout.call(U,A(T));}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel();}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return;}if(Z){U.url.shift();if(U.varName){U.varName.shift();}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName;}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.attributes);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y);}else{C(V);}return;}var T=U.url[0];if(!T){U.url.shift();return G(V);}if(U.timeout){U.timer=S.later(U.timeout,U,O,V);}if(U.type==="script"){W=P(T,c,U.attributes);}else{W=I(T,c,U.attributes);}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e);}}else{a.appendChild(W);}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T);}};var K=function(){if(E){return;}E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T];}}E=false;};var D=function(Z){if(M[Z]){var T=M[Z],U=T.nodes,X=U.length,c=T.win.document,a=c.getElementsByTagName("head")[0],V,Y,W,b;if(T.insertBefore){V=B(T.insertBefore,Z);if(V){a=V.parentNode;}}for(Y=0;Y<X;Y=Y+1){W=U[Y];if(W.clearAttributes){W.clearAttributes();}else{for(b in W){delete W[b];}}a.removeChild(W);}T.nodes=[];}};var H=function(U,T,V){var X="q"+(L++);V=V||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K();}M[X]=S.merge(V,{tId:X,type:U,url:T,finished:false,aborted:false,nodes:[]});var W=M[X];W.win=W.win||window;W.scope=W.scope||W.win;W.autopurge=("autopurge" in W)?W.autopurge:(U==="script")?true:false;if(V.charset){W.attributes=W.attributes||{};W.attributes.charset=V.charset;}S.later(0,W,G,X);return{tId:X};};var F=function(c,X,W,U,Y,Z,b){var a=b||G;if(N.ie){X.onreadystatechange=function(){var d=this.readyState;if("loaded"===d||"complete"===d){X.onreadystatechange=null;a(W,U);}};}else{if(N.webkit){if(c==="script"){if(N.webkit>=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;g<e;g=g+1){d=d[f[g]];if(!d){this.attempts++;if(this.attempts++>this.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.8.0r4",build:"2449"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"root":"2.8.0r4/build/","base":"http://yui.yahooapis.com/2.8.0r4/build/","comboBase":"http://yui.yahooapis.com/combo?","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event","datasource"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],supersedes:["datemeth"],"skinnable":true},"carousel":{"type":"js","path":"carousel/carousel-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-min.js","requires":["element","json","datasource","swf"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"],"supersedes":["connectioncore"]},"connectioncore":{"type":"js","path":"connection/connection_core-min.js","requires":["event"],"pkg":"connection"},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop","paginator"],"skinnable":true},datemath:{"type":"js","path":"datemath/datemath-min.js","requires":["yahoo"]},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-min.js","requires":["dom","event"],"optional":["event-mouseenter","event-delegate"]},"element-delegate":{"type":"js","path":"element-delegate/element-delegate-min.js","requires":["element"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"event-simulate":{"type":"js","path":"event-simulate/event-simulate-min.js","requires":["event"]},"event-delegate":{"type":"js","path":"event-delegate/event-delegate-min.js","requires":["event"],"optional":["selector"]},"event-mouseenter":{"type":"js","path":"event-mouseenter/event-mouseenter-min.js","requires":["dom","event"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-min.js","requires":["dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-min.js","requires":["element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"paginator":{"type":"js","path":"paginator/paginator-min.js","requires":["element"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"progressbar":{"type":"js","path":"progressbar/progressbar-min.js","requires":["element"],"optional":["animation"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-min.js","requires":["dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"],"skinnable":true},"storage":{"type":"js","path":"storage/storage-min.js","requires":["yahoo","event","cookie"],"optional":["swfstore"]},"stylesheet":{"type":"js","path":"stylesheet/stylesheet-min.js","requires":["yahoo"]},"swf":{"type":"js","path":"swf/swf-min.js","requires":["element"],"supersedes":["swfdetect"]},"swfdetect":{"type":"js","path":"swfdetect/swfdetect-min.js","requires":["yahoo"]},"swfstore":{"type":"js","path":"swfstore/swfstore-min.js","requires":["element","cookie","swf"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event","dom"],"optional":["json","animation","calendar"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-min.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"optional":["event-simulate"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0; >-i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.onTimeout=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.comboBase=YUI.info.comboBase;this.combine=false;this.root=YUI.info.root;this.timeout=0;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i]);}else{this[i]=o[i];}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y;};}this.filter=this.FILTERS[f];}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({"name":name,"type":"css","path":sinf.base+skin+"/"+sinf.path,"after":sinf.after,"rollup":sinf.rollup,"ext":ext});}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","after":sinf.after,"path":pkg+"/"+sinf.base+skin+"/"+mod+".css","ext":ext});}}return name;},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o;}if(m[ckey]){return m[ckey];}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm));}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i]);}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey];},calculate:function(o){if(o||this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){if(lang.hasOwnProperty(info,name)){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name);}}else{smod=this._addSkin(this.skin.defaultSkin,name);}m.requires.push(smod);}}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore);}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]];}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j));}}this.loaded=l;},_explode:function(){var r=this.required,i,mod;for(i in r){if(lang.hasOwnProperty(r,i)){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll,info=this.moduleInfo;if(this.dirty||!this.rollups){for(i in info){if(lang.hasOwnProperty(info,i)){m=info[i];if(m&&m.rollup){rollups[i]=m;}}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=info[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(lang.hasOwnProperty(r,j)){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(lang.hasOwnProperty(r,j)){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_onFailure:function(msg){YAHOO.log("Failure","info","loader");var f=this.onFailure;if(f){f.call(this.scope,{msg:"failure: "+msg,data:this.data,success:false}); >-}},_onTimeout:function(){YAHOO.log("Timeout","info","loader");var f=this.onTimeout;if(f){f.call(this.scope,{msg:"timeout",data:this.data,success:false});}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){var mm=info[aa];if(loaded[bb]||!mm){return false;}var ii,rr=mm.expanded,after=mm.after,other=info[bb],optional=mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}if(mm.ext&&mm.type=="css"&&!other.ext&&other.type=="css"){return true;}return false;};for(var i in this.required){if(lang.hasOwnProperty(this.required,i)){s.push(i);}}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1);},_combine:function(){this._combining=[];var self=this,s=this.sorted,len=s.length,js=this.comboBase,css=this.comboBase,target,startLen=js.length,i,m,type=this.loadType;YAHOO.log("type "+type);for(i=0;i<len;i=i+1){m=this.moduleInfo[s[i]];if(m&&!m.ext&&(!type||type===m.type)){target=this.root+m.path;target+="&";if(m.type=="js"){js+=target;}else{css+=target;}this._combining.push(s[i]);}}if(this._combining.length){YAHOO.log("Attempting to combine: "+this._combining,"info","loader");var callback=function(o){var c=this._combining,len=c.length,i,m;for(i=0;i<len;i=i+1){this.inserted[c[i]]=true;}this.loadNext(o.data);},loadScript=function(){if(js.length>startLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self});}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self});}else{loadScript();}return;}else{this.loadNext(this._loading);}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine();}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return;}this.loadNext();},sandbox:function(o,type){this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this._onFailure("undefined module "+m);for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort();}return;}if(m.type!=="js"){this._loadCount++;continue;}url=m.fullpath;url=(url)?this._filter(url):this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data});}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this._onFailure.call(this.varName+" reference failure");}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return;}if(mname){if(mname!==this._loading){return;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return;}if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath,self=this,c=function(o){self.loadNext(o.data);};url=(url)?this._filter(url):this._url(m.path);if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:c,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,varName:m.varName,scope:self});return;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_filter:function(str){var f=this.filter;return(f)?str.replace(new RegExp(f.searchExp,"g"),f.replaceStr):str;},_url:function(path){return this._filter((this.base||"")+path);}};})();YAHOO.register("yuiloader",YAHOO.util.YUILoader,{version:"2.8.0r4",build:"2449"}); >-(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},DOT_ATTRIBUTES:{},get:function(z){var AB,x,AA,y,Y,G;if(z){if(z[l]||z.item){return z;}if(typeof z==="string"){AB=z;z=K.getElementById(z);G=(z)?z.attributes:null;if(z&&G&&G.id&&G.id.value===AB){return z;}else{if(z&&K.all){z=null;x=K.all[AB];for(y=0,Y=x.length;y<Y;++y){if(x[y].id===AB){return x[y];}}}}return z;}if(YAHOO.util.Element&&z instanceof YAHOO.util.Element){z=z.get("element");}if("length" in z){AA=[];for(y=0,Y=z.length;y<Y;++y){AA[AA.length]=E.Dom.get(z[y]);}return AA;}return z;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC===c)){G=S(AF[v],q);x=S(AF[v],R);if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F; >-y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom._getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){E.Dom.batch(Y,E.Dom._setAttribute,{attr:G,val:x});},_setAttribute:function(x,Y){var G=E.Dom._toCamel(Y.attr),y=Y.val;if(x&&x.setAttribute){if(E.Dom.DOT_ATTRIBUTES[G]){x[G]=y;}else{G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;x.setAttribute(G,y);}}else{}},getAttribute:function(Y,G){return E.Dom.batch(Y,E.Dom._getAttribute,G);},_getAttribute:function(Y,G){var x;G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;if(Y&&Y.getAttribute){x=Y.getAttribute(G,2);}else{}return x;},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}if(m.ie&&m.ie>=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B; >-this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var H=[],A=this.subscribers.length;var D=[].slice.call(arguments,0),C=true,F,B=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=D;}}this.fired=true;if(!A&&this.silent){return true;}if(!this.silent){}var E=this.subscribers.slice();for(F=0;F<A;++F){var G=E[F];if(!G){B=true;}else{C=this.notify(G,D);if(false===C){if(!this.silent){}break;}}}return(C!==false);},notify:function(F,C){var B,H=null,E=F.getScope(this.scope),A=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(C.length>0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L<K.length;L=L+1){E.push({id:K[L],fn:M,obj:O,overrideContext:P,checkReady:N});}A=this.POLL_RETRYS;this.startInterval();},onContentReady:function(N,K,L,M){this.onAvailable(N,K,L,M,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(M,K,V,P,T,Y){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var Q=0,S=M.length;Q<S;++Q){W=this.on(M[Q],K,V,P,T)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var O=this.getEl(M);if(O){M=O;}else{this.onAvailable(M,function(){YAHOO.util.Event._addListener(M,K,V,P,T,Y);});return true;}}}if(!M){return false;}if("unload"==K&&P!==this){J[J.length]=[M,K,V,P,T];return true;}var L=M;if(T){if(T===true){L=P;}else{L=T;}}var N=function(Z){return V.call(L,YAHOO.util.Event.getEvent(Z,M),P);};var X=[M,K,V,N,L,P,T,Y];var R=H.length;H[R]=X;try{this._simpleAdd(M,K,N,Y);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}return true;},_getType:function(K){return this._specialTypes[K]||K;},addListener:function(M,P,L,N,O){var K=((P==F||P==I)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(M,this._getType(P),L,N,O,K);},addFocusListener:function(L,K,M,N){return this.on(L,F,K,M,N);},removeFocusListener:function(L,K){return this.removeListener(L,F,K);},addBlurListener:function(L,K,M,N){return this.on(L,I,K,M,N);},removeBlurListener:function(L,K){return this.removeListener(L,I,K);},removeListener:function(L,K,R){var M,P,U;K=this._getType(K);if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var S=true;for(M=L.length-1;M>-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; >-}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N<L;N=N+1){var K=M[N];if(K&&K[this.FN]==O&&K[this.EL]==P&&K[this.TYPE]==Q){return N;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+B;++B;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(L){if(!G){G=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(E.length===0){A=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var Q=!G;if(!Q){Q=(A>0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L<K;L=L+1){O=E[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(G||N.nextSibling||!Q){M.push(O);E[L]=null;}}else{R(N,O);E[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}A--;if(Q){for(L=E.length-1;L>-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[H,J];}else{if(K==="unload"){L=[J];}else{K=this._getType(K);L=[H];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var L=YAHOO.util.Event,O,N,M,Q,P,S=J.slice(),K;for(O=0,Q=J.length;O<Q;++O){M=S[O];if(M){K=window;if(M[L.ADJ_SCOPE]){if(M[L.ADJ_SCOPE]===true){K=M[L.UNLOAD_OBJ];}else{K=M[L.ADJ_SCOPE];}}M[L.FN].call(K,L.getEvent(R,M[L.EL]),M[L.UNLOAD_OBJ]);S[O]=null;}}M=null;K=null;J=null;if(H){for(N=H.length-1;N>-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; >-/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ >-if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A); >-},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C<A.length;++C){F.subscribe(A[C].fn,A[C].obj,A[C].overrideContext);}}}return D[B];},fireEvent:function(B){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[B];if(!D){return null;}var A=[];for(var C=1;C<arguments.length;++C){A.push(arguments[C]);}return D.fire.apply(D,A);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.8.0r4",build:"2449"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(F){var D,A,B;try{A=new XMLHttpRequest();D={conn:A,tId:F,xhr:true};}catch(C){for(B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:F,xhr:true};break;}catch(E){}}}finally{return D;}},getConnectionObject:function(A){var C,D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={tId:D};if(A==="xdr"){C.conn=this._transport;C.xdr=true;}else{if(A==="upload"){C.upload=true;}}}if(C){this._transaction_id++;}}catch(B){}return C;},asyncRequest:function(G,D,F,A){var E,C,B=(F&&F.argument)?F.argument:null;if(this._isFileUpload){C="upload";}else{if(F.xdr){C="xdr";}}E=this.getConnectionObject(C);if(!E){return null;}else{if(F&&F.customevents){this.initCustomEvents(E,F);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(E,F,D,A);return E;}if(G.toUpperCase()=="GET"){if(this._sFormData.length!==0){D+=((D.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(G.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(G.toUpperCase()=="GET"&&(F&&F.cache===false)){D+=((D.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((G.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(E.xdr){this.xdr(E,G,D,F,A);return E;}E.conn.open(G,D,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(E);}this.handleReadyState(E,F);E.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(E,B);if(E.startEvent){E.startEvent.fire(E,B);}return E;}},initCustomEvents:function(A,C){var B;for(B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this,A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(B,I,D){var E,A,G=(I&&I.argument)?I.argument:null,C=(B.r&&B.r.statusText==="xdr:success")?true:false,H=(B.r&&B.r.statusText==="xdr:failure")?true:false,J=D;try{if((B.conn.status!==undefined&&B.conn.status!==0)||C){E=B.conn.status;}else{if(H&&!J){E=0;}else{E=13030;}}}catch(F){E=13030;}if((E>=200&&E<300)||E===1223||C){A=B.xdr?B.r:this.createResponseObject(B,G);if(I&&I.success){if(!I.scope){I.success(A);}else{I.success.apply(I.scope,[A]);}}this.successEvent.fire(A);if(B.successEvent){B.successEvent.fire(A);}}else{switch(E){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:A=this.createExceptionObject(B.tId,G,(D?D:false));if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}break;default:A=(B.xdr)?B.response:this.createResponseObject(B,G);if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}}this.failureEvent.fire(A);if(B.failureEvent){B.failureEvent.fire(A);}}this.releaseObject(B);A=null;},createResponseObject:function(A,G){var D={},I={},E,C,F,B;try{C=A.conn.getAllResponseHeaders();F=C.split("\n");for(E=0;E<F.length;E++){B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=YAHOO.lang.trim(F[E].substring(B+2));}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0,G="communication failure",C=-1,B="transaction aborted",E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]); >-}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(E,G,A){var D,B=(G&&G.argument)?G.argument:null;E=E||{};if(E.conn){if(E.xhr){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E.xdr){E.conn.abort(E.tId);D=true;}}}else{if(E.upload){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(A){A=A||{};if(A.xhr&&A.conn){return A.conn.readyState!==4&&A.conn.readyState!==0;}else{if(A.xdr&&A.conn){return A.conn.isCallInProgress(A.tId);}else{if(A.upload===true){return document.getElementById("yuiIO"+A.tId)?true:false;}else{return false;}}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};(function(){var G=YAHOO.util.Connect,H={};function D(I){var J='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+I+'" width="0" height="0">'+'<param name="movie" value="'+I+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",K=document.createElement("div");document.body.appendChild(K);K.innerHTML=J;}function B(L,I,J,M,K){H[parseInt(L.tId)]={"o":L,"c":M};if(K){M.method=I;M.data=K;}L.conn.send(J,M,L.tId);}function E(I){D(I);G._transport=document.getElementById("YUIConnectionSwf");}function C(){G.xdrReadyEvent.fire();}function A(J,I){if(J){G.startEvent.fire(J,I.argument);if(J.startEvent){J.startEvent.fire(J,I.argument);}}}function F(J){var K=H[J.tId].o,I=H[J.tId].c;if(J.statusText==="xdr:start"){A(K,I);return;}J.responseText=decodeURI(J.responseText);K.r=J;if(I.argument){K.r.argument=I.argument;}this.handleTransactionResponse(K,I,J.statusText==="xdr:abort"?true:false);delete H[J.tId];}G.xdr=B;G.swf=D;G.transport=E;G.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");G.xdrReady=C;G.handleXdrResponse=F;})();(function(){var D=YAHOO.util.Connect,F=YAHOO.util.Event;D._isFormSubmit=false;D._isFileUpload=false;D._formNode=null;D._sFormData=null;D._submitElementValue=null;D.uploadEvent=new YAHOO.util.CustomEvent("upload"),D._hasSubmitListener=function(){if(F){F.addListener(document,"click",function(J){var I=F.getTarget(J),H=I.nodeName.toLowerCase();if((H==="input"||H==="button")&&(I.type&&I.type.toLowerCase()=="submit")){D._submitElementValue=encodeURIComponent(I.name)+"="+encodeURIComponent(I.value);}});return true;}return false;}();function G(T,O,J){var S,I,R,P,W,Q=false,M=[],V=0,L,N,K,U,H;this.resetFormState();if(typeof T=="string"){S=(document.getElementById(T)||document.forms[T]);}else{if(typeof T=="object"){S=T;}else{return;}}if(O){this.createFrame(J?J:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=S;return;}for(L=0,N=S.elements.length;L<N;++L){I=S.elements[L];W=I.disabled;R=I.name;if(!W&&R){R=encodeURIComponent(R)+"=";P=encodeURIComponent(I.value);switch(I.type){case"select-one":if(I.selectedIndex>-1){H=I.options[I.selectedIndex];M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}break;case"select-multiple":if(I.selectedIndex>-1){for(K=I.selectedIndex,U=I.options.length;K<U;++K){H=I.options[K];if(H.selected){M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}}}break;case"radio":case"checkbox":if(I.checked){M[V++]=R+P;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(Q===false){if(this._hasSubmitListener&&this._submitElementValue){M[V++]=this._submitElementValue;}Q=true;}break;default:M[V++]=R+P;}}}this._isFormSubmit=true;this._sFormData=M.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function C(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function B(H){var I="yuiIO"+this._transaction_id,J;if(YAHOO.env.ua.ie){J=document.createElement('<iframe id="'+I+'" name="'+I+'" />');if(typeof H=="boolean"){J.src="javascript:false";}}else{J=document.createElement("iframe");J.id=I;J.name=I;}J.style.position="absolute";J.style.top="-1000px";J.style.left="-1000px";document.body.appendChild(J);}function E(H){var K=[],I=H.split("&"),J,L;for(J=0;J<I.length;J++){L=I[J].indexOf("=");if(L!=-1){K[J]=document.createElement("input");K[J].type="hidden";K[J].name=decodeURIComponent(I[J].substring(0,L));K[J].value=decodeURIComponent(I[J].substring(L+1));this._formNode.appendChild(K[J]);}}return K;}function A(K,V,L,J){var Q="yuiIO"+K.tId,R="multipart/form-data",T=document.getElementById(Q),M=(document.documentMode&&document.documentMode===8)?true:false,W=this,S=(V&&V.argument)?V.argument:null,U,P,I,O,H,N;H={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",L);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",Q);if(YAHOO.env.ua.ie&&!M){this._formNode.setAttribute("encoding",R);}else{this._formNode.setAttribute("enctype",R);}if(J){U=this.appendPostData(J);}this._formNode.submit();this.startEvent.fire(K,S);if(K.startEvent){K.startEvent.fire(K,S);}if(V&&V.timeout){this._timeOut[K.tId]=window.setTimeout(function(){W.abort(K,V,true);},V.timeout);}if(U&&U.length>0){for(P=0;P<U.length;P++){this._formNode.removeChild(U[P]);}}for(I in H){if(YAHOO.lang.hasOwnProperty(H,I)){if(H[I]){this._formNode.setAttribute(I,H[I]);}else{this._formNode.removeAttribute(I);}}}this.resetFormState();N=function(){if(V&&V.timeout){window.clearTimeout(W._timeOut[K.tId]);delete W._timeOut[K.tId];}W.completeEvent.fire(K,S);if(K.completeEvent){K.completeEvent.fire(K,S); >-}O={tId:K.tId,argument:V.argument};try{O.responseText=T.contentWindow.document.body?T.contentWindow.document.body.innerHTML:T.contentWindow.document.documentElement.textContent;O.responseXML=T.contentWindow.document.XMLDocument?T.contentWindow.document.XMLDocument:T.contentWindow.document;}catch(X){}if(V&&V.upload){if(!V.scope){V.upload(O);}else{V.upload.apply(V.scope,[O]);}}W.uploadEvent.fire(O);if(K.uploadEvent){K.uploadEvent.fire(O);}F.removeListener(T,"load",N);setTimeout(function(){document.body.removeChild(T);W.releaseObject(K);},100);};F.addListener(T,"load",N);}D.setForm=G;D.resetFormState=C;D.createFrame=B;D.appendPostData=E;D.uploadFile=A;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.8.0r4",build:"2449"});(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"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue; >-}if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id); >-}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D); >-}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.8.0r4",build:"2449"});YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name,A);}return A;},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};if(C){this._written=false;}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null;}return B.getValue();},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B;}}return C;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,D=YAHOO.util.AttributeProvider,C={mouseenter:true,mouseleave:true};var A=function(E,F){this.init.apply(this,arguments);};A.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"mouseenter":true,"mouseleave":true,"focus":true,"blur":true,"submit":true,"change":true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(G,E){var F=this.get("element");if(F){F[E]=G;}return G;},DEFAULT_HTML_GETTER:function(E){var F=this.get("element"),G;if(F){G=F[E];}return G;},appendChild:function(E){E=E.get?E.get("element"):E;return this.get("element").appendChild(E);},getElementsByTagName:function(E){return this.get("element").getElementsByTagName(E);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(E,F){E=E.get?E.get("element"):E;F=(F&&F.get)?F.get("element"):F;return this.get("element").insertBefore(E,F);},removeChild:function(E){E=E.get?E.get("element"):E;return this.get("element").removeChild(E);},replaceChild:function(E,F){E=E.get?E.get("element"):E;F=F.get?F.get("element"):F;return this.get("element").replaceChild(E,F);},initAttributes:function(E){},addListener:function(J,I,K,H){H=H||this;var E=YAHOO.util.Event,G=this.get("element")||this.get("id"),F=this;if(C[J]&&!E._createMouseDelegate){return false;}if(!this._events[J]){if(G&&this.DOM_EVENTS[J]){E.on(G,J,function(M,L){if(M.srcElement&&!M.target){M.target=M.srcElement;}if((M.toElement&&!M.relatedTarget)||(M.fromElement&&!M.relatedTarget)){M.relatedTarget=E.getRelatedTarget(M);}if(!M.currentTarget){M.currentTarget=G;}F.fireEvent(J,M,L);},K,H);}this.createEvent(J,{scope:this});}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){return this.addListener.apply(this,arguments);},subscribe:function(){return this.addListener.apply(this,arguments);},removeListener:function(F,E){return this.unsubscribe.apply(this,arguments);},addClass:function(E){B.addClass(this.get("element"),E);},getElementsByClassName:function(F,E){return B.getElementsByClassName(F,E,this.get("element"));},hasClass:function(E){return B.hasClass(this.get("element"),E);},removeClass:function(E){return B.removeClass(this.get("element"),E);},replaceClass:function(F,E){return B.replaceClass(this.get("element"),F,E);},setStyle:function(F,E){return B.setStyle(this.get("element"),F,E); >-},getStyle:function(E){return B.getStyle(this.get("element"),E);},fireQueue:function(){var F=this._queue;for(var G=0,E=F.length;G<E;++G){this[F[G][0]].apply(this,F[G][1]);}},appendTo:function(F,G){F=(F.get)?F.get("element"):B.get(F);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:F});G=(G&&G.get)?G.get("element"):B.get(G);var E=this.get("element");if(!E){return false;}if(!F){return false;}if(E.parent!=F){if(G){F.insertBefore(E,G);}else{F.appendChild(E);}}this.fireEvent("appendTo",{type:"appendTo",target:F});return E;},get:function(E){var G=this._configs||{},F=G.element;if(F&&!G[E]&&!YAHOO.lang.isUndefined(F.value[E])){this._setHTMLAttrConfig(E);}return D.prototype.get.call(this,E);},setAttributes:function(K,H){var F={},I=this._configOrder;for(var J=0,E=I.length;J<E;++J){if(K[I[J]]!==undefined){F[I[J]]=true;this.set(I[J],K[I[J]],H);}}for(var G in K){if(K.hasOwnProperty(G)&&!F[G]){this.set(G,K[G],H);}}},set:function(F,H,E){var G=this.get("element");if(!G){this._queue[this._queue.length]=["set",arguments];if(this._configs[F]){this._configs[F].value=H;}return;}if(!this._configs[F]&&!YAHOO.lang.isUndefined(G[F])){this._setHTMLAttrConfig(F);}return D.prototype.set.apply(this,arguments);},setAttributeConfig:function(E,F,G){this._configOrder.push(E);D.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(F,E){this._events[F]=true;return D.prototype.createEvent.apply(this,arguments);},init:function(F,E){this._initElement(F,E);},destroy:function(){var E=this.get("element");YAHOO.util.Event.purgeElement(E,true);this.unsubscribeAll();if(E&&E.parentNode){E.parentNode.removeChild(E);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(G,F){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];F=F||{};F.element=F.element||G||null;var I=false;var E=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var H in E){if(E.hasOwnProperty(H)){this.DOM_EVENTS[H]=E[H];}}if(typeof F.element==="string"){this._setHTMLAttrConfig("id",{value:F.element});}if(B.get(F.element)){I=true;this._initHTMLElement(F);this._initContent(F);}YAHOO.util.Event.onAvailable(F.element,function(){if(!I){this._initHTMLElement(F);}this.fireEvent("available",{type:"available",target:B.get(F.element)});},this,true);YAHOO.util.Event.onContentReady(F.element,function(){if(!I){this._initContent(F);}this.fireEvent("contentReady",{type:"contentReady",target:B.get(F.element)});},this,true);},_initHTMLElement:function(E){this.setAttributeConfig("element",{value:B.get(E.element),readOnly:true});},_initContent:function(E){this.initAttributes(E);this.setAttributes(E,true);this.fireQueue();},_setHTMLAttrConfig:function(E,G){var F=this.get("element");G=G||{};G.name=E;G.setter=G.setter||this.DEFAULT_HTML_SETTER;G.getter=G.getter||this.DEFAULT_HTML_GETTER;G.value=G.value||F[E];this._configs[E]=new YAHOO.util.Attribute(G,this);}};YAHOO.augment(A,D);YAHOO.util.Element=A;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.8.0r4",build:"2449"});YAHOO.register("utilities", YAHOO, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/lib/yui/yahoo-dom-event/yahoo-dom-event.js b/koha-tmpl/intranet-tmpl/lib/yui/yahoo-dom-event/yahoo-dom-event.js >deleted file mode 100644 >index 68586b2a2d..0000000000 >--- a/koha-tmpl/intranet-tmpl/lib/yui/yahoo-dom-event/yahoo-dom-event.js >+++ /dev/null >@@ -1,14 +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 >-*/ >-if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var D=function(H){var I=0;return parseFloat(H.replace(/\./g,function(){return(I++==1)?"":".";}));},G=navigator,F={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:G.cajaVersion,secure:false,os:null},C=navigator&&navigator.userAgent,E=window&&window.location,B=E&&E.href,A;F.secure=B&&(B.toLowerCase().indexOf("https")===0);if(C){if((/windows|win32/i).test(C)){F.os="windows";}else{if((/macintosh/i).test(C)){F.os="macintosh";}}if((/KHTML/).test(C)){F.webkit=1;}A=C.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){F.webkit=D(A[1]);if(/ Mobile\//.test(C)){F.mobile="Apple";}else{A=C.match(/NokiaN[^\/]*/);if(A){F.mobile=A[0];}}A=C.match(/AdobeAIR\/([^\s]*)/);if(A){F.air=A[0];}}if(!F.webkit){A=C.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){F.opera=D(A[1]);A=C.match(/Opera Mini[^;]*/);if(A){F.mobile=A[0];}}else{A=C.match(/MSIE\s([^;]*)/);if(A&&A[1]){F.ie=D(A[1]);}else{A=C.match(/Gecko\/([^\s]*)/);if(A){F.gecko=1;A=C.match(/rv:([^\s\)]*)/);if(A&&A[1]){F.gecko=D(A[1]);}}}}}}return F;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C++){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,A=Object.prototype,H="[object Array]",C="[object Function]",G="[object Object]",E=[],F=["toString","valueOf"],D={isArray:function(I){return A.toString.apply(I)===H;},isBoolean:function(I){return typeof I==="boolean";},isFunction:function(I){return(typeof I==="function")||A.toString.apply(I)===C;},isNull:function(I){return I===null;},isNumber:function(I){return typeof I==="number"&&isFinite(I);},isObject:function(I){return(I&&(typeof I==="object"||B.isFunction(I)))||false;},isString:function(I){return typeof I==="string";},isUndefined:function(I){return typeof I==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(K,J){var I,M,L;for(I=0;I<F.length;I=I+1){M=F[I];L=J[M];if(B.isFunction(L)&&L!=A[M]){K[M]=L;}}}:function(){},extend:function(L,M,K){if(!M||!L){throw new Error("extend failed, please check that "+"all dependencies are included.");}var J=function(){},I;J.prototype=M.prototype;L.prototype=new J();L.prototype.constructor=L;L.superclass=M.prototype;if(M.prototype.constructor==A.constructor){M.prototype.constructor=M;}if(K){for(I in K){if(B.hasOwnProperty(K,I)){L.prototype[I]=K[I];}}B._IEEnumFix(L.prototype,K);}},augmentObject:function(M,L){if(!L||!M){throw new Error("Absorb failed, verify dependencies.");}var I=arguments,K,N,J=I[2];if(J&&J!==true){for(K=2;K<I.length;K=K+1){M[I[K]]=L[I[K]];}}else{for(N in L){if(J||!(N in M)){M[N]=L[N];}}B._IEEnumFix(M,L);}},augmentProto:function(L,K){if(!K||!L){throw new Error("Augment failed, verify dependencies.");}var I=[L.prototype,K.prototype],J;for(J=2;J<arguments.length;J=J+1){I.push(arguments[J]);}B.augmentObject.apply(this,I);},dump:function(I,N){var K,M,P=[],Q="{...}",J="f(){...}",O=", ",L=" => ";if(!B.isObject(I)){return I+"";}else{if(I instanceof Date||("nodeType" in I&&"tagName" in I)){return I;}else{if(B.isFunction(I)){return J;}}}N=(B.isNumber(N))?N:3;if(B.isArray(I)){P.push("[");for(K=0,M=I.length;K<M;K=K+1){if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K<I;K=K+1){B.augmentObject(L,J[K],true);}return L;},later:function(P,J,Q,L,M){P=P||0;J=J||{};var K=Q,O=L,N,I;if(B.isString(Q)){K=J[Q];}if(!K){throw new TypeError("method undefined");}if(O&&!B.isArray(O)){O=[L];}N=function(){K.apply(J,O||E);};I=(M)?setInterval(N,P):setTimeout(N,P);return{interval:M,cancel:function(){if(this.interval){clearInterval(I);}else{clearTimeout(I);}}};},isValue:function(I){return(B.isObject(I)||B.isString(I)||B.isNumber(I)||B.isBoolean(I));}};B.hasOwnProperty=(A.hasOwnProperty)?function(I,J){return I&&I.hasOwnProperty(J);}:function(I,J){return !B.isUndefined(I[J])&&I.constructor.prototype[J]!==I[J];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.8.0r4",build:"2449"}); >-(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},DOT_ATTRIBUTES:{},get:function(z){var AB,x,AA,y,Y,G;if(z){if(z[l]||z.item){return z;}if(typeof z==="string"){AB=z;z=K.getElementById(z);G=(z)?z.attributes:null;if(z&&G&&G.id&&G.id.value===AB){return z;}else{if(z&&K.all){z=null;x=K.all[AB];for(y=0,Y=x.length;y<Y;++y){if(x[y].id===AB){return x[y];}}}}return z;}if(YAHOO.util.Element&&z instanceof YAHOO.util.Element){z=z.get("element");}if("length" in z){AA=[];for(y=0,Y=z.length;y<Y;++y){AA[AA.length]=E.Dom.get(z[y]);}return AA;}return z;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC===c)){G=S(AF[v],q);x=S(AF[v],R);if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F; >-y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom._getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){E.Dom.batch(Y,E.Dom._setAttribute,{attr:G,val:x});},_setAttribute:function(x,Y){var G=E.Dom._toCamel(Y.attr),y=Y.val;if(x&&x.setAttribute){if(E.Dom.DOT_ATTRIBUTES[G]){x[G]=y;}else{G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;x.setAttribute(G,y);}}else{}},getAttribute:function(Y,G){return E.Dom.batch(Y,E.Dom._getAttribute,G);},_getAttribute:function(Y,G){var x;G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;if(Y&&Y.getAttribute){x=Y.getAttribute(G,2);}else{}return x;},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}if(m.ie&&m.ie>=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B; >-this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var H=[],A=this.subscribers.length;var D=[].slice.call(arguments,0),C=true,F,B=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=D;}}this.fired=true;if(!A&&this.silent){return true;}if(!this.silent){}var E=this.subscribers.slice();for(F=0;F<A;++F){var G=E[F];if(!G){B=true;}else{C=this.notify(G,D);if(false===C){if(!this.silent){}break;}}}return(C!==false);},notify:function(F,C){var B,H=null,E=F.getScope(this.scope),A=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(C.length>0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L<K.length;L=L+1){E.push({id:K[L],fn:M,obj:O,overrideContext:P,checkReady:N});}A=this.POLL_RETRYS;this.startInterval();},onContentReady:function(N,K,L,M){this.onAvailable(N,K,L,M,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(M,K,V,P,T,Y){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var Q=0,S=M.length;Q<S;++Q){W=this.on(M[Q],K,V,P,T)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var O=this.getEl(M);if(O){M=O;}else{this.onAvailable(M,function(){YAHOO.util.Event._addListener(M,K,V,P,T,Y);});return true;}}}if(!M){return false;}if("unload"==K&&P!==this){J[J.length]=[M,K,V,P,T];return true;}var L=M;if(T){if(T===true){L=P;}else{L=T;}}var N=function(Z){return V.call(L,YAHOO.util.Event.getEvent(Z,M),P);};var X=[M,K,V,N,L,P,T,Y];var R=H.length;H[R]=X;try{this._simpleAdd(M,K,N,Y);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}return true;},_getType:function(K){return this._specialTypes[K]||K;},addListener:function(M,P,L,N,O){var K=((P==F||P==I)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(M,this._getType(P),L,N,O,K);},addFocusListener:function(L,K,M,N){return this.on(L,F,K,M,N);},removeFocusListener:function(L,K){return this.removeListener(L,F,K);},addBlurListener:function(L,K,M,N){return this.on(L,I,K,M,N);},removeBlurListener:function(L,K){return this.removeListener(L,I,K);},removeListener:function(L,K,R){var M,P,U;K=this._getType(K);if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var S=true;for(M=L.length-1;M>-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; >-}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N<L;N=N+1){var K=M[N];if(K&&K[this.FN]==O&&K[this.EL]==P&&K[this.TYPE]==Q){return N;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+B;++B;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(L){if(!G){G=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(E.length===0){A=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var Q=!G;if(!Q){Q=(A>0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L<K;L=L+1){O=E[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(G||N.nextSibling||!Q){M.push(O);E[L]=null;}}else{R(N,O);E[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}A--;if(Q){for(L=E.length-1;L>-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[H,J];}else{if(K==="unload"){L=[J];}else{K=this._getType(K);L=[H];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var L=YAHOO.util.Event,O,N,M,Q,P,S=J.slice(),K;for(O=0,Q=J.length;O<Q;++O){M=S[O];if(M){K=window;if(M[L.ADJ_SCOPE]){if(M[L.ADJ_SCOPE]===true){K=M[L.UNLOAD_OBJ];}else{K=M[L.ADJ_SCOPE];}}M[L.FN].call(K,L.getEvent(R,M[L.EL]),M[L.UNLOAD_OBJ]);S[O]=null;}}M=null;K=null;J=null;if(H){for(N=H.length-1;N>-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; >-/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ >-if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A); >-},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C<A.length;++C){F.subscribe(A[C].fn,A[C].obj,A[C].overrideContext);}}}return D[B];},fireEvent:function(B){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[B];if(!D){return null;}var A=[];for(var C=1;C<arguments.length;++C){A.push(arguments[C]);}return D.fire.apply(D,A);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.8.0r4",build:"2449"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.8.0r4", build: "2449"}); >diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css >index 60114036c9..68a834d7cb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css >@@ -96,9 +96,6 @@ h3.collapsed i.fa.fa-caret-down::before { > font-weight: normal; > } > >-#yui-main { >- margin-bottom:2em; >-} > #toolbar.floating { > box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.5); > border-radius: 0; >diff --git a/koha-tmpl/intranet-tmpl/prog/css/print.css b/koha-tmpl/intranet-tmpl/prog/css/print.css >index 71915fc930..b1cbc010b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/print.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/print.css >@@ -299,7 +299,6 @@ td.debit { > #batchModify, > #navmenu, > .gradient, >-div.yui-b, > .noprint, > form#sortbyform, > #cartDetails, >@@ -313,17 +312,11 @@ button.dt-button { > display: none; > } > >-div#yui-main div.yui-b, > .ui-tabs .ui-tabs-panel, > .ui-tabs .ui-tabs-hide { > display : block !important; > } > >-.yui-t1 #yui-main div.yui-b, >-.yui-t2 #yui-main div.yui-b, >-.yui-t7 #yui-main div.yui-b { >- margin-left : 0; >-} > fieldset { > border : 0; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css b/koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css >index a2ada2e1ad..ab9d2549e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/printreceiptinvoice.css >@@ -326,7 +326,6 @@ div#header_search, > div#toolbar, > div#changelanguage, > div#menu, >-div.yui-b, > .noprint, > form#sortbyform, > #cartDetails, >@@ -336,15 +335,6 @@ fieldset.action, > display: none; > } > >-div#yui-main div.yui-b { >- display : block; >-} >- >-.yui-t1 #yui-main div.yui-b, >-.yui-t2 #yui-main div.yui-b, >-.yui-t7 #yui-main div.yui-b { >- margin-left : 0; >-} > fieldset { > border : 0; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css b/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css >index 3a70812f4e..844211c478 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/right-to-left.css >@@ -1,6 +1,5 @@ > fieldset.rows ol.radio label, fieldset.rows li.radio label { float: right; margin: 0 1em 0 0.3em; } > >- > /* Adjust text directions */ > > body, >@@ -18,30 +17,15 @@ h5, > h6, > legend, > th, >-odoc, > p, > ul li, > ul.toolbar, >-#doc2, >-#doc3, >-#doc4, > .autocomplete .sample-result, > .ui-tabs-panel, >-.yui-t1, >-.yui-t2, >-.yui-t3, >-.yui-t4 >-.yui-t5, >-.yui-t6, >-.yui-t7 > { > text-align: right; > } > >-#doc, #doc2, #doc3, #doc4, .yui-t1, .yui-t2, .yui-t3, .yui-t4, .yui-t5, .yui-t6, .yui-t7 { >- text-align: right; >-} >- > #issuest th, > .column-tool > { >@@ -72,16 +56,6 @@ span.important, > #marcDocsSelect, > #toplevelnav, > .ui-tabs-nav li, >-.yui-g div.first, >-.yui-gb div.first, >-.yui-gc div.first, >-.yui-gc div.first div.first, >-.yui-gd div.first, >-.yui-ge div.first, >-.yui-gf div.first, >-.yui-t1 .yui-b, >-.yui-t2 .yui-b, >-.yui-t3 .yui-b > { > float: right; > } >@@ -98,35 +72,12 @@ input, > float: none; > } > >-div.sysprefs div.hint, >-.yui-g .yui-u, >-.yui-t1 #yui-main, >-.yui-t2 #yui-main, >-.yui-t3 #yui-main, >- >-{ >+div.sysprefs div.hint { > float: right ; > } >-.yui-t1 { >-float:right >-} > > /* Adjust margins, padding, alignment and table-element widths */ > >-.yui-t1 #yui-main, >-.yui-t2 #yui-main, >-.yui-t3 #yui-main >-{ >- margin-left: 0; >-} >- >-.yui-t1 #yui-main .yui-b, >-.yui-t2 #yui-main .yui-b >-{ >- margin-left: 0; >- /* karam margin-right: 13em; */ >-} >- > div#menu li a > { > margin-left: -1px; >@@ -135,9 +86,7 @@ div#menu li a > div#menu, > div.patroninfo ul, > div.patroninfo h5, >-#guarantorsearch, >-.yui-g input >-{ >+#guarantorsearch { > margin-left: 0.5em; > } > fieldset.rows img, >@@ -158,27 +107,12 @@ div#header_search > margin-right:200px; > } > >-.yui-g .yui-u >-{ >- padding-right: 0; >-} >- >-.yui-u >-{ >- padding-right: 0.5em; >-} >- > ul > { > padding-left: 0; > padding-right: 1.1em; > } > >-.yui-b >-{ >- padding-bottom: 5em; >-} >- > #login > { > left: 0.5em; >@@ -195,22 +129,10 @@ ul > right:auto; > } > >-div.listgroup, >-.yui-g p >-{ >+div.listgroup { > clear:right; > } > >-.yui-t2 #yui-main >-{ >- width: 75%; >-} >- >-.yui-t3 #yui-main >-{ >- width: 70%; >-} >- > .holdcount > { > line-height: 150%; >@@ -237,9 +159,7 @@ div.patroninfo h5 > > h1#logo, > #koha_url, >-#login, >-.yui-t1 .yui-b >-{ >+#login { > position: absolute; > } > >@@ -283,20 +203,6 @@ div.subfield_line label { > text-align: right; > clear: right; > } >-.yui-t3 #yui-main .yui-b { >- margin-left: -0.0759em; >-} >- >-#doc3 { >- background-position: right top; >-} >- >-.yui-gb{ >- /* use this will break the tools page "" width: 30%;""*/ >- float: right; >-} >- >- > > ul#toplevelmenu { > padding: 0px; >@@ -314,23 +220,10 @@ ul#toplevelmenu { > padding-right: 25px; > } > >- >- >-.yui-g .yui-u, .yui-g .yui-g, .yui-g .yui-gb, .yui-g .yui-gc, .yui-g .yui-gd, .yui-g .yui-ge, .yui-g .yui-gf, .yui-gc .yui-u, .yui-gd .yui-g, .yui-g .yui-gc .yui-u, .yui-ge .yui-u, .yui-ge .yui-g, .yui-gf .yui-g, .yui-gf .yui-u { >- display: inline; >- >-} >- >- >- > fieldset.action { > float: right; > > } >-#yui-main .yui-b { >- >- width: auto; >-} > > /***********************************************************/ > >@@ -339,21 +232,6 @@ fieldset.action { > float: right; > } > >-/*for the tools main page */ >-.yui-gb .yui-u { >- float: left; >- margin-right: 2%; >- margin-left: 0%; >- width: 25%; >-} >- >-/*NEWS*/ >-div.yui-b { >- position: absolute; >-} >-div#yui-main{ >-float:left; >-} > /*floating taps for marceditor and other taps plases */ > .ui-tabs .ui-tabs-nav li { > float: right; >@@ -395,21 +273,6 @@ p label, { > background-clip: padding-box; > } > >- >-/* */ >- >-div#yui-main { >- >- margin-right: 22em; >-} >- >-/* */ >- >-div#yui-main.sysprefs { >- margin-right: 0em; >- float: right; >-} >- > #user-menu { > left: 5px; > right: unset; >@@ -465,4 +328,4 @@ div.dt-buttons { > float: none; > } > >-} >\ No newline at end of file >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >index 42c3452c5e..6f483a9e30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >@@ -124,10 +124,6 @@ table { > tbody { > td { > padding: .5em; >- >- &.dataTables_empty { >- display: none; >- } > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index b05ef269f8..928ac2c476 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -700,10 +700,6 @@ > <h2>Bootstrap Icons</h2> > <p><a href="https://icons.getbootstrap.com/">Bootstrap Icons</a> licensed under the <a href="https://github.com/twbs/icons/blob/main/LICENSE.md">MIT license</a>.</p> > >- <h2>YUI</h2> >- <p> >- <a href="http://yuilibrary.com/license/">BSD License</a> >- </p> > <h2>Famfamfam iconset</h2> > <ul> > <li><a href="http://www.famfamfam.com/lab/icons/silk/">FamFamFam Site</a></li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >index 4cd224ac2e..8ca0b82a5d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >@@ -6,88 +6,7 @@ > <title>Basket grouping for [% booksellername | html %] › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'datatables.inc' %] >-[% Asset.js("lib/yui/utilities/utilities.js") | $raw %] >-[% Asset.js("lib/yui/button/button-min.js") | $raw %] >-[% Asset.js("lib/yui/container/container_core-min.js") | $raw %] >-[% Asset.js("lib/yui/menu/menu-min.js") | $raw %] >-[% Asset.js("js/basketgroup.js") | $raw %] >-[% IF ( grouping ) %] >-[% Asset.js("lib/yui/yahoo-dom-event/yahoo-dom-event.js") | $raw %] >-[% Asset.js("lib/yui/animation/animation-min.js") | $raw %] >-[% Asset.js("lib/yui/dragdrop/dragdrop-min.js") | $raw %] >-[% Asset.js("lib/yui/element/element-min.js") | $raw %] >-<style> >-/*margin and padding on body element >- can introduce errors in determining >- element position and are not recommended; >- we turn them off as a foundation for YUI >- CSS treatments. */ >- >-#ungrouped { >- overflow: auto; >- height: 400px; >-} >- >-.draglist{ >- width: 200px; >- height: 300px; >- overflow: auto; >-} >- >-div.workarea_alt { padding: 5px; float:left; width: 95%;} >-div.closed { background-color: pink; padding:10px; float:left; width: 45%;} >- >-ul.draglist { >- position: relative; >- background: #EEE; >- padding-bottom:10; >- border: 1px inset gray; >- list-style: none; >- margin:0; >- padding: 5px; >-} >- >-ul.draglist li { >- margin: 1px; >- cursor: move; >- list-style: none; >-} >- >-ul.draglist_alt { >- position: relative; >- border: 1px solid gray; >- list-style: none; >- margin: 0; >- background: #f7f7f7; >- padding: 5px; >- cursor: move; >-} >- >-ul.draglist_alt li { >- margin: 1px; >- list-style: none; >-} >- >-li.grouped { >- background-color: #D1E6EC; >- border:1px solid #7EA6B2; >- list-style: none; >-} >- >-li.ungrouped { >- background-color: #D8D4E2; >- border:1px solid #6B4C86; >-} >- >-fieldset.various li { >- list-style: none; >- clear: none; >-} >- >-</style> >- [% END %] > <script> >- YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true); > > var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?"); > var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?"); >@@ -111,13 +30,57 @@ fieldset.various li { > [% ELSE %] > $("#basket_groups a[href='#opened']").tab("show"); > [% END %] >- $("table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "bAutoWidth": false, >- "sPaginationType": "full" >- } )); >+ [% UNLESS ( grouping ) %] >+ $("table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "bAutoWidth": false, >+ "sPaginationType": "full" >+ } )); >+ [% ELSE %] >+ grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, { >+ "dom": 't', >+ "columnDefs": [ >+ { 'sortable': false, 'targets': [ 'NoSort' ] } >+ ], >+ 'autoWidth': false, >+ "language": { >+ "emptyTable": _("There are no baskets in this group") >+ } >+ } )); >+ ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, { >+ "dom": 't', >+ "columnDefs": [ >+ { 'sortable': false, 'targets': [ 'NoSort' ] } >+ ], >+ 'autoWidth': false, >+ "language": { >+ "emptyTable": _("There are no ungrouped baskets") >+ } >+ } )); >+ [% END %] >+ >+ $("#basketgroupcolumns").on("click", ".addtogroup", function(){ >+ const row = $("#" + $(this).data("basketid") ); >+ if( row ){ >+ $(this).removeClass("addtogroup").addClass("removefromgroup").html("<i class=\"fa fa-trash\" aria-hidden=\"true\"></i> " + _("Remove") ); >+ row.removeClass("ungrouped").addClass("grouped"); >+ ungrouped.row( row ).remove().draw(); >+ grouped.row.add( row ).draw(); >+ } >+ }); >+ >+ $("#basketgroupcolumns").on("click", ".removefromgroup", function(){ >+ const row = $("#" + $(this).data("basketid") ); >+ if( row ){ >+ $(this).removeClass("removefromgroup").addClass("addtogroup").html("<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> " + _("Add to group") ); >+ $(this).removeClass("").addClass(""); >+ row.removeClass("grouped").addClass("ungrouped"); >+ grouped.row( row ).remove().draw(); >+ ungrouped.row.add( row ).draw(); >+ } >+ }); > }); > </script> > >@@ -190,32 +153,48 @@ fieldset.various li { > <div id="basketgroupcolumns" class="row"> > [% UNLESS (closedbg) %] > <div class="col-xs-6 col-xs-push-6"> >- <form action="[% scriptname | html %]" method="post" name="basketgroups" id="basketgroups"> >+ > <div id="groups"> >- <fieldset class="brief"> >- <div class="workarea_alt" > >- <h3>Ungrouped baskets</h3> >- <ul id="ungrouped" class="draglist_alt"> >- [% IF ( baskets ) %] >- [% FOREACH basket IN baskets %] >- <li class="ungrouped" id="b-[% basket.basketno | html %]" > >- <a href="basket.pl?basketno=[% basket.basketno | uri %]"> >- [% IF ( basket.basketname ) %] >- [% basket.basketname | html %] >- [% ELSE %] >- <span>No name, basketnumber: [% basket.basketno | html %]</span> >- [% END %] >- </a>, <br /> >- Total: [% basket.total | $Price %] >- <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" /> >- </li> >+ <div class="workarea_alt" > >+ <h3>Ungrouped baskets</h3> >+ <table id="ungrouped" class="basketgroup_baskets"> >+ <thead> >+ <tr> >+ <th>Basket</th> >+ <th>Total</th> >+ <th class="NoSort"></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% IF ( baskets ) %] >+ [% FOREACH basket IN baskets %] >+ <tr class="ungrouped" id="b-[% basket.basketno | html %]"> >+ <td> >+ <a href="basket.pl?basketno=[% basket.basketno | uri %]"> >+ [% IF ( basket.basketname ) %] >+ [% basket.basketname | html %] >+ [% ELSE %] >+ <span>No name, basketnumber: [% basket.basketno | html %]</span> >+ [% END %] >+ </a> >+ </td> >+ <td data-sort="[% basket.total | html %]"> >+ [% basket.total | $Price %] >+ <input type="hidden" class="basket" name="basket" value="[% basket.basketno | html %]" /> >+ </td> >+ <td> >+ <a class="addtogroup btn btn-default btn-xs" data-basketid="b-[% basket.basketno | html %]"> >+ <i class="fa fa-plus" aria-hidden="true"></i> Add to group >+ </a> >+ </td> >+ </tr> >+ [% END %] > [% END %] >- [% END %] >- </ul> >- </div> >- </fieldset> >+ </tbody> >+ </table> >+ </div> > </div> >- </form> >+ > </div> > [% END %] > [% IF ( closedbg ) %] >@@ -223,7 +202,7 @@ fieldset.various li { > [% ELSE %] > <div class="col-xs-6 col-xs-pull-6"> > [% END %] >- <form action="" method="post" id="groupingform" onsubmit="return submitForm(this)"> >+ <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post" id="groupingform" onsubmit="return submitForm(this)"> > <fieldset id="various" class="brief"> > <ol> > [% UNLESS (closedbg) %] >@@ -281,34 +260,52 @@ fieldset.various li { > [% END %] > </li> > <li> >- <span class="label">Baskets in this group:</span> >- [% UNLESS (closedbg) %] >- <ul class="draglist" id="bg"> >- [% ELSE %] >- <ul> >- [% END %] >- [% FOREACH selectedbasket IN selectedbaskets %] >- <li class="grouped" id="b-[% selectedbasket.basketno | html %]" > >- <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]"> >- [% IF ( selectedbasket.basketname ) %] >- [% selectedbasket.basketname | html %] >- [% ELSE %] >- No name, basketnumber: [% selectedbasket.basketno | html %] >- [% END %] >- </a>, <br /> >- Total: [% selectedbasket.total | $Price %] >- <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" /> >- </li> >- [% END %] >- </ul> >- </li> >+ <h3>Baskets in this group:</h3> >+ <table id="grouped" class="basketgroup_baskets"> >+ <thead> >+ <tr> >+ <th>Basket</th> >+ <th>Total</th> >+ <th class="NoSort"></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH selectedbasket IN selectedbaskets %] >+ <tr id="b-[% selectedbasket.basketno | html %]"> >+ <td> >+ <a href="basket.pl?basketno=[% selectedbasket.basketno | uri %]"> >+ [% IF ( selectedbasket.basketname ) %] >+ [% selectedbasket.basketname | html %] >+ [% ELSE %] >+ No name, basketnumber: [% selectedbasket.basketno | html %] >+ [% END %] >+ </a> >+ </td> >+ <td data-sort="[% selectedbasket.total | html %]"> >+ [% selectedbasket.total | $Price %] >+ <input type="hidden" class="basket" name="basket" value="[% selectedbasket.basketno | html %]" /> >+ </td> >+ <td> >+ [% IF ( closedbg ) %] >+ [% ELSE %] >+ <a class="removefromgroup btn btn-default btn-xs" data-basketid="b-[% selectedbasket.basketno | html %]" id="addtogroup[% selectedbasket.basketno | html %]"> >+ <i class="fa fa-trash" aria-hidden="true"></i> Remove >+ </a> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </li> > [% UNLESS (closedbg) %] >- <li><label><input type="checkbox" id="closedbg" name="closedbg" />Close basket group</label></li> >+ <li><label><input type="checkbox" id="closedbg" name="closedbg" /> Close basket group</label></li> > [% ELSE %] > <input type="hidden" id="closedbg" name="closedbg" value ="1"/> > [% END %] > </ol> > </fieldset> >+ > [% UNLESS (closedbg) %] > <fieldset class="action"><input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /> > [% IF ( basketgroupid ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt >index 12dfa5f39c..b937207c3c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt >@@ -20,7 +20,6 @@ CACHE: > [% interface | html %]/[% theme | html %]/js/basket.js > [% interface | html %]/[% theme | html %]/js/offlinecirc.js > [% interface | html %]/[% theme | html %]/js/staff-global.js >-[% themelang | html %]/lib/yui/reset-fonts-grids.css > [% interface | html %]/prog/img/koha-logo-medium.png > [% interface | html %]/prog/img/loading.gif > [% interface | html %]/prog/sound/beep.ogg >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt >index ba77fb046e..fecba041ea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt >@@ -14,7 +14,7 @@ > </head> > > <body id="common_patron_search" class="common"> >-<div id="patron_search" class="yui-t7"> >+<div id="patron_search"> > <div class="container-fluid"> > > [% PROCESS patron_search_filters categories => categories, libraries => libraries, filters => ['branch', 'category'], search_filter => searchmember %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >index 1446b72b27..3b99f97f60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >@@ -11,7 +11,6 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > <style> >- .yui-u fieldset.rows .widelabel { width: 12em; } > label.description { width: 20em; } > .line_error { width: 100%; } > code { background-color: yellow; } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13614
:
135394
|
135675
|
135679
| 135734