1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>API: container Module.js (YUI Library)
</title>
5 <link rel=
"stylesheet" type=
"text/css" href=
"assets/api.css">
9 <div id=
"doc3" class=
"yui-t2">
12 <h1>Yahoo! UI Library
</h1>
13 <h3>Container
<span class=
"subtitle">2.2.0</span></h3>
15 <a href=
"./index.html">Yahoo! UI Library
</a>
16 > <a href=
"./module_container.html">container
</a>
18 > Module.js (source view)
27 <div class=
"highlight" ><pre><span class=
"c">/*
</span>
28 <span class=
"c">Copyright (c)
2006, Yahoo! Inc. All rights reserved.
</span>
29 <span class=
"c">Code licensed under the BSD License:
</span>
30 <span class=
"c">http://developer.yahoo.net/yui/license.txt
</span>
31 <span class=
"c">Version
0.12.2</span>
32 <span class=
"c">*/
</span>
34 <span class=
"c">/**
</span>
35 <span class=
"c">* 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.
</span>
36 <span class=
"c">* @module container
</span>
37 <span class=
"c">* @title Container
</span>
38 <span class=
"c">* @requires yahoo,dom,event,dragdrop,animation
</span>
39 <span class=
"c">*/
</span>
41 <span class=
"c">/**
</span>
42 <span class=
"c">* 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.
</span>
43 <span class=
"c">* @namespace YAHOO.widget
</span>
44 <span class=
"c">* @class Module
</span>
45 <span class=
"c">* @constructor
</span>
46 <span class=
"c">* @param {String} el The element ID representing the Module
<em
>OR
</em
></span>
47 <span class=
"c">* @param {HTMLElement} el The element representing the Module
</span>
48 <span class=
"c">* @param {Object} userConfig The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
</span>
49 <span class=
"c">*/
</span>
50 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span> <span class=
"o">=
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">,
</span> <span class=
"nx">userConfig
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
51 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
52 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">init
</span><span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">,
</span> <span class=
"nx">userConfig
</span><span class=
"o">);
</span>
53 <span class=
"o">}
</span>
54 <span class=
"o">};
</span>
56 <span class=
"c">/**
</span>
57 <span class=
"c">* Constant representing the prefix path to use for non-secure images
</span>
58 <span class=
"c">* @property YAHOO.widget.Module.IMG_ROOT
</span>
59 <span class=
"c">* @static
</span>
60 <span class=
"c">* @final
</span>
61 <span class=
"c">* @type String
</span>
62 <span class=
"c">*/
</span>
63 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">IMG_ROOT
</span> <span class=
"o">=
</span> <span class=
"s2">"http://us.i1.yimg.com/us.yimg.com/i/
"</span><span class=
"o">;
</span>
65 <span class=
"c">/**
</span>
66 <span class=
"c">* Constant representing the prefix path to use for securely served images
</span>
67 <span class=
"c">* @property YAHOO.widget.Module.IMG_ROOT_SSL
</span>
68 <span class=
"c">* @static
</span>
69 <span class=
"c">* @final
</span>
70 <span class=
"c">* @type String
</span>
71 <span class=
"c">*/
</span>
72 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">IMG_ROOT_SSL
</span> <span class=
"o">=
</span> <span class=
"s2">"https://a248.e.akamai.net/sec.yimg.com/i/
"</span><span class=
"o">;
</span>
74 <span class=
"c">/**
</span>
75 <span class=
"c">* Constant for the default CSS class name that represents a Module
</span>
76 <span class=
"c">* @property YAHOO.widget.Module.CSS_MODULE
</span>
77 <span class=
"c">* @static
</span>
78 <span class=
"c">* @final
</span>
79 <span class=
"c">* @type String
</span>
80 <span class=
"c">*/
</span>
81 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_MODULE
</span> <span class=
"o">=
</span> <span class=
"s2">"module
"</span><span class=
"o">;
</span>
83 <span class=
"c">/**
</span>
84 <span class=
"c">* Constant representing the module header
</span>
85 <span class=
"c">* @property YAHOO.widget.Module.CSS_HEADER
</span>
86 <span class=
"c">* @static
</span>
87 <span class=
"c">* @final
</span>
88 <span class=
"c">* @type String
</span>
89 <span class=
"c">*/
</span>
90 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_HEADER
</span> <span class=
"o">=
</span> <span class=
"s2">"hd
"</span><span class=
"o">;
</span>
92 <span class=
"c">/**
</span>
93 <span class=
"c">* Constant representing the module body
</span>
94 <span class=
"c">* @property YAHOO.widget.Module.CSS_BODY
</span>
95 <span class=
"c">* @static
</span>
96 <span class=
"c">* @final
</span>
97 <span class=
"c">* @type String
</span>
98 <span class=
"c">*/
</span>
99 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_BODY
</span> <span class=
"o">=
</span> <span class=
"s2">"bd
"</span><span class=
"o">;
</span>
101 <span class=
"c">/**
</span>
102 <span class=
"c">* Constant representing the module footer
</span>
103 <span class=
"c">* @property YAHOO.widget.Module.CSS_FOOTER
</span>
104 <span class=
"c">* @static
</span>
105 <span class=
"c">* @final
</span>
106 <span class=
"c">* @type String
</span>
107 <span class=
"c">*/
</span>
108 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_FOOTER
</span> <span class=
"o">=
</span> <span class=
"s2">"ft
"</span><span class=
"o">;
</span>
110 <span class=
"c">/**
</span>
111 <span class=
"c">* Constant representing the url for the
"src
" attribute of the iframe used to monitor changes to the browser
's base font size
</span>
112 <span class=
"c">* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
</span>
113 <span class=
"c">* @static
</span>
114 <span class=
"c">* @final
</span>
115 <span class=
"c">* @type String
</span>
116 <span class=
"c">*/
</span>
117 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">RESIZE_MONITOR_SECURE_URL
</span> <span class=
"o">=
</span> <span class=
"s2">"javascript:false;
"</span><span class=
"o">;
</span>
119 <span class=
"c">/**
</span>
120 <span class=
"c">* Singleton CustomEvent fired when the font size is changed in the browser.
</span>
121 <span class=
"c">* Opera
's
"zoom
" functionality currently does not support text size detection.
</span>
122 <span class=
"c">* @event YAHOO.widget.Module.textResizeEvent
</span>
123 <span class=
"c">*/
</span>
124 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"textResize
"</span><span class=
"o">);
</span>
126 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">prototype
</span> <span class=
"o">=
</span> <span class=
"o">{
</span>
127 <span class=
"c">/**
</span>
128 <span class=
"c"> * The class
's constructor function
</span>
129 <span class=
"c"> * @property contructor
</span>
130 <span class=
"c"> * @type Function
</span>
131 <span class=
"c"> */
</span>
132 <span class=
"nx">constructor
</span> <span class=
"o">:
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">,
</span>
134 <span class=
"c">/**
</span>
135 <span class=
"c"> * The main module element that contains the header, body, and footer
</span>
136 <span class=
"c"> * @property element
</span>
137 <span class=
"c"> * @type HTMLElement
</span>
138 <span class=
"c"> */
</span>
139 <span class=
"nx">element
</span> <span class=
"o">:
</span> <span class=
"kc">null
</span><span class=
"o">,
</span>
141 <span class=
"c">/**
</span>
142 <span class=
"c"> * The header element, denoted with CSS class
"hd
"</span>
143 <span class=
"c"> * @property header
</span>
144 <span class=
"c"> * @type HTMLElement
</span>
145 <span class=
"c"> */
</span>
146 <span class=
"nx">header
</span> <span class=
"o">:
</span> <span class=
"kc">null
</span><span class=
"o">,
</span>
148 <span class=
"c">/**
</span>
149 <span class=
"c"> * The body element, denoted with CSS class
"bd
"</span>
150 <span class=
"c"> * @property body
</span>
151 <span class=
"c"> * @type HTMLElement
</span>
152 <span class=
"c"> */
</span>
153 <span class=
"nx">body
</span> <span class=
"o">:
</span> <span class=
"kc">null
</span><span class=
"o">,
</span>
155 <span class=
"c">/**
</span>
156 <span class=
"c"> * The footer element, denoted with CSS class
"ft
"</span>
157 <span class=
"c"> * @property footer
</span>
158 <span class=
"c"> * @type HTMLElement
</span>
159 <span class=
"c"> */
</span>
160 <span class=
"nx">footer
</span> <span class=
"o">:
</span> <span class=
"kc">null
</span><span class=
"o">,
</span>
162 <span class=
"c">/**
</span>
163 <span class=
"c"> * The id of the element
</span>
164 <span class=
"c"> * @property id
</span>
165 <span class=
"c"> * @type String
</span>
166 <span class=
"c"> */
</span>
167 <span class=
"nx">id
</span> <span class=
"o">:
</span> <span class=
"kc">null
</span><span class=
"o">,
</span>
169 <span class=
"c">/**
</span>
170 <span class=
"c"> * The String representing the image root
</span>
171 <span class=
"c"> * @property imageRoot
</span>
172 <span class=
"c"> * @type String
</span>
173 <span class=
"c"> */
</span>
174 <span class=
"nx">imageRoot
</span> <span class=
"o">:
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">IMG_ROOT
</span><span class=
"o">,
</span>
176 <span class=
"c">/**
</span>
177 <span class=
"c"> * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
</span>
178 <span class=
"c"> * @method initEvents
</span>
179 <span class=
"c"> */
</span>
180 <span class=
"nx">initEvents
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
182 <span class=
"c">/**
</span>
183 <span class=
"c"> * CustomEvent fired prior to class initalization.
</span>
184 <span class=
"c"> * @event beforeInitEvent
</span>
185 <span class=
"c"> * @param {class} classRef class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
</span>
186 <span class=
"c"> */
</span>
187 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeInitEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"beforeInit
"</span><span class=
"o">);
</span>
189 <span class=
"c">/**
</span>
190 <span class=
"c"> * CustomEvent fired after class initalization.
</span>
191 <span class=
"c"> * @event initEvent
</span>
192 <span class=
"c"> * @param {class} classRef class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
</span>
193 <span class=
"c"> */
</span>
194 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">initEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"init
"</span><span class=
"o">);
</span>
196 <span class=
"c">/**
</span>
197 <span class=
"c"> * CustomEvent fired when the Module is appended to the DOM
</span>
198 <span class=
"c"> * @event appendEvent
</span>
199 <span class=
"c"> */
</span>
200 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">appendEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"append
"</span><span class=
"o">);
</span>
202 <span class=
"c">/**
</span>
203 <span class=
"c"> * CustomEvent fired before the Module is rendered
</span>
204 <span class=
"c"> * @event beforeRenderEvent
</span>
205 <span class=
"c"> */
</span>
206 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeRenderEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"beforeRender
"</span><span class=
"o">);
</span>
208 <span class=
"c">/**
</span>
209 <span class=
"c"> * CustomEvent fired after the Module is rendered
</span>
210 <span class=
"c"> * @event renderEvent
</span>
211 <span class=
"c"> */
</span>
212 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">renderEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"render
"</span><span class=
"o">);
</span>
214 <span class=
"c">/**
</span>
215 <span class=
"c"> * CustomEvent fired when the header content of the Module is modified
</span>
216 <span class=
"c"> * @event changeHeaderEvent
</span>
217 <span class=
"c"> * @param {String/HTMLElement} content String/element representing the new header content
</span>
218 <span class=
"c"> */
</span>
219 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeHeaderEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"changeHeader
"</span><span class=
"o">);
</span>
221 <span class=
"c">/**
</span>
222 <span class=
"c"> * CustomEvent fired when the body content of the Module is modified
</span>
223 <span class=
"c"> * @event changeBodyEvent
</span>
224 <span class=
"c"> * @param {String/HTMLElement} content String/element representing the new body content
</span>
225 <span class=
"c"> */
</span>
226 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeBodyEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"changeBody
"</span><span class=
"o">);
</span>
228 <span class=
"c">/**
</span>
229 <span class=
"c"> * CustomEvent fired when the footer content of the Module is modified
</span>
230 <span class=
"c"> * @event changeFooterEvent
</span>
231 <span class=
"c"> * @param {String/HTMLElement} content String/element representing the new footer content
</span>
232 <span class=
"c"> */
</span>
233 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeFooterEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"changeFooter
"</span><span class=
"o">);
</span>
235 <span class=
"c">/**
</span>
236 <span class=
"c"> * CustomEvent fired when the content of the Module is modified
</span>
237 <span class=
"c"> * @event changeContentEvent
</span>
238 <span class=
"c"> */
</span>
239 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"changeContent
"</span><span class=
"o">);
</span>
241 <span class=
"c">/**
</span>
242 <span class=
"c"> * CustomEvent fired when the Module is destroyed
</span>
243 <span class=
"c"> * @event destroyEvent
</span>
244 <span class=
"c"> */
</span>
245 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">destroyEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"destroy
"</span><span class=
"o">);
</span>
247 <span class=
"c">/**
</span>
248 <span class=
"c"> * CustomEvent fired before the Module is shown
</span>
249 <span class=
"c"> * @event beforeShowEvent
</span>
250 <span class=
"c"> */
</span>
251 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeShowEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"beforeShow
"</span><span class=
"o">);
</span>
253 <span class=
"c">/**
</span>
254 <span class=
"c"> * CustomEvent fired after the Module is shown
</span>
255 <span class=
"c"> * @event showEvent
</span>
256 <span class=
"c"> */
</span>
257 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">showEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"show
"</span><span class=
"o">);
</span>
259 <span class=
"c">/**
</span>
260 <span class=
"c"> * CustomEvent fired before the Module is hidden
</span>
261 <span class=
"c"> * @event beforeHideEvent
</span>
262 <span class=
"c"> */
</span>
263 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeHideEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"beforeHide
"</span><span class=
"o">);
</span>
265 <span class=
"c">/**
</span>
266 <span class=
"c"> * CustomEvent fired after the Module is hidden
</span>
267 <span class=
"c"> * @event hideEvent
</span>
268 <span class=
"c"> */
</span>
269 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">hideEvent
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">(
</span><span class=
"s2">"hide
"</span><span class=
"o">);
</span>
270 <span class=
"o">},
</span>
272 <span class=
"c">/**
</span>
273 <span class=
"c"> * String representing the current user-agent platform
</span>
274 <span class=
"c"> * @property platform
</span>
275 <span class=
"c"> * @type String
</span>
276 <span class=
"c"> */
</span>
277 <span class=
"nx">platform
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
278 <span class=
"k">var
</span> <span class=
"nx">ua
</span> <span class=
"o">=
</span> <span class=
"nx">navigator
</span><span class=
"o">.
</span><span class=
"nx">userAgent
</span><span class=
"o">.
</span><span class=
"nx">toLowerCase
</span><span class=
"o">();
</span>
279 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s2">"windows
"</span><span class=
"o">)
</span> <span class=
"o">!=
</span> <span class=
"o">-
</span><span class=
"m">1</span> <span class=
"o">||
</span> <span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s2">"win32
"</span><span class=
"o">)
</span> <span class=
"o">!=
</span> <span class=
"o">-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span>
280 <span class=
"k">return
</span> <span class=
"s2">"windows
"</span><span class=
"o">;
</span>
281 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s2">"macintosh
"</span><span class=
"o">)
</span> <span class=
"o">!=
</span> <span class=
"o">-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span>
282 <span class=
"k">return
</span> <span class=
"s2">"mac
"</span><span class=
"o">;
</span>
283 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
284 <span class=
"k">return
</span> <span class=
"kc">false
</span><span class=
"o">;
</span>
285 <span class=
"o">}
</span>
286 <span class=
"o">}(),
</span>
288 <span class=
"c">/**
</span>
289 <span class=
"c"> * String representing the current user-agent browser
</span>
290 <span class=
"c"> * @property browser
</span>
291 <span class=
"c"> * @type String
</span>
292 <span class=
"c"> */
</span>
293 <span class=
"nx">browser
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
294 <span class=
"k">var
</span> <span class=
"nx">ua
</span> <span class=
"o">=
</span> <span class=
"nx">navigator
</span><span class=
"o">.
</span><span class=
"nx">userAgent
</span><span class=
"o">.
</span><span class=
"nx">toLowerCase
</span><span class=
"o">();
</span>
295 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s1">'opera
'</span><span class=
"o">)!=-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// Opera (check first in case of spoof)
</span>
296 <span class=
"c"></span> <span class=
"k">return
</span> <span class=
"s1">'opera
'</span><span class=
"o">;
</span>
297 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s1">'msie
7'</span><span class=
"o">)!=-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// IE7
</span>
298 <span class=
"c"></span> <span class=
"k">return
</span> <span class=
"s1">'ie7
'</span><span class=
"o">;
</span>
299 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s1">'msie
'</span><span class=
"o">)
</span> <span class=
"o">!=-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// IE
</span>
300 <span class=
"c"></span> <span class=
"k">return
</span> <span class=
"s1">'ie
'</span><span class=
"o">;
</span>
301 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s1">'safari
'</span><span class=
"o">)!=-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// Safari (check before Gecko because it includes
"like Gecko
")
</span>
302 <span class=
"c"></span> <span class=
"k">return
</span> <span class=
"s1">'safari
'</span><span class=
"o">;
</span>
303 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">ua
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s1">'gecko
'</span><span class=
"o">)
</span> <span class=
"o">!=
</span> <span class=
"o">-
</span><span class=
"m">1</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// Gecko
</span>
304 <span class=
"c"></span> <span class=
"k">return
</span> <span class=
"s1">'gecko
'</span><span class=
"o">;
</span>
305 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
306 <span class=
"k">return
</span> <span class=
"kc">false
</span><span class=
"o">;
</span>
307 <span class=
"o">}
</span>
308 <span class=
"o">}(),
</span>
310 <span class=
"c">/**
</span>
311 <span class=
"c"> * Boolean representing whether or not the current browsing context is secure (https)
</span>
312 <span class=
"c"> * @property isSecure
</span>
313 <span class=
"c"> * @type Boolean
</span>
314 <span class=
"c"> */
</span>
315 <span class=
"nx">isSecure
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
316 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nb">window
</span><span class=
"o">.
</span><span class=
"nx">location
</span><span class=
"o">.
</span><span class=
"nx">href
</span><span class=
"o">.
</span><span class=
"nx">toLowerCase
</span><span class=
"o">().
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s2">"https
"</span><span class=
"o">)
</span> <span class=
"o">===
</span> <span class=
"m">0</span><span class=
"o">)
</span> <span class=
"o">{
</span>
317 <span class=
"k">return
</span> <span class=
"kc">true
</span><span class=
"o">;
</span>
318 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
319 <span class=
"k">return
</span> <span class=
"kc">false
</span><span class=
"o">;
</span>
320 <span class=
"o">}
</span>
321 <span class=
"o">}(),
</span>
323 <span class=
"c">/**
</span>
324 <span class=
"c"> * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
</span>
325 <span class=
"c"> */
</span>
326 <span class=
"nx">initDefaultConfig
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
327 <span class=
"c">// Add properties //
</span>
328 <span class=
"c"></span>
329 <span class=
"c">/**
</span>
330 <span class=
"c"> * Specifies whether the Module is visible on the page.
</span>
331 <span class=
"c"> * @config visible
</span>
332 <span class=
"c"> * @type Boolean
</span>
333 <span class=
"c"> * @default true
</span>
334 <span class=
"c"> */
</span>
335 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">addProperty
</span><span class=
"o">(
</span><span class=
"s2">"visible
"</span><span class=
"o">,
</span> <span class=
"o">{
</span> <span class=
"nx">value
</span><span class=
"o">:
</span><span class=
"kc">true
</span><span class=
"o">,
</span> <span class=
"nx">handler
</span><span class=
"o">:
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">configVisible
</span><span class=
"o">,
</span> <span class=
"nx">validator
</span><span class=
"o">:
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">checkBoolean
</span> <span class=
"o">}
</span> <span class=
"o">);
</span>
337 <span class=
"c">/**
</span>
338 <span class=
"c"> * Object or array of objects representing the ContainerEffect classes that are active for animating the container.
</span>
339 <span class=
"c"> * @config effect
</span>
340 <span class=
"c"> * @type Object
</span>
341 <span class=
"c"> * @default null
</span>
342 <span class=
"c"> */
</span>
343 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">addProperty
</span><span class=
"o">(
</span><span class=
"s2">"effect
"</span><span class=
"o">,
</span> <span class=
"o">{
</span> <span class=
"nx">suppressEvent
</span><span class=
"o">:
</span><span class=
"kc">true
</span><span class=
"o">,
</span> <span class=
"nx">supercedes
</span><span class=
"o">:[
</span><span class=
"s2">"visible
"</span><span class=
"o">]
</span> <span class=
"o">}
</span> <span class=
"o">);
</span>
345 <span class=
"c">/**
</span>
346 <span class=
"c"> * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
</span>
347 <span class=
"c"> * @config monitorresize
</span>
348 <span class=
"c"> * @type Boolean
</span>
349 <span class=
"c"> * @default true
</span>
350 <span class=
"c"> */
</span>
351 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">addProperty
</span><span class=
"o">(
</span><span class=
"s2">"monitorresize
"</span><span class=
"o">,
</span> <span class=
"o">{
</span> <span class=
"nx">value
</span><span class=
"o">:
</span><span class=
"kc">true
</span><span class=
"o">,
</span> <span class=
"nx">handler
</span><span class=
"o">:
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">configMonitorResize
</span> <span class=
"o">}
</span> <span class=
"o">);
</span>
352 <span class=
"o">},
</span>
354 <span class=
"c">/**
</span>
355 <span class=
"c"> * 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.
</span>
356 <span class=
"c"> * @method init
</span>
357 <span class=
"c"> * @param {String} el The element ID representing the Module
<em
>OR
</em
></span>
358 <span class=
"c"> * @param {HTMLElement} el The element representing the Module
</span>
359 <span class=
"c"> * @param {Object} userConfig The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
</span>
360 <span class=
"c"> */
</span>
361 <span class=
"nx">init
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">,
</span> <span class=
"nx">userConfig
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
363 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">initEvents
</span><span class=
"o">();
</span>
365 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeInitEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">);
</span>
367 <span class=
"c">/**
</span>
368 <span class=
"c"> * The Module
's Config object used for monitoring configuration properties.
</span>
369 <span class=
"c"> * @property cfg
</span>
370 <span class=
"c"> * @type YAHOO.util.Config
</span>
371 <span class=
"c"> */
</span>
372 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Config
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">);
</span>
374 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">isSecure
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
375 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">imageRoot
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">IMG_ROOT_SSL
</span><span class=
"o">;
</span>
376 <span class=
"o">}
</span>
378 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">typeof
</span> <span class=
"nx">el
</span> <span class=
"o">==
</span> <span class=
"s2">"string
"</span><span class=
"o">)
</span> <span class=
"o">{
</span>
379 <span class=
"k">var
</span> <span class=
"nx">elId
</span> <span class=
"o">=
</span> <span class=
"nx">el
</span><span class=
"o">;
</span>
381 <span class=
"nx">el
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">getElementById
</span><span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">);
</span>
382 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">el
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
383 <span class=
"nx">el
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
384 <span class=
"nx">el
</span><span class=
"o">.
</span><span class=
"nx">id
</span> <span class=
"o">=
</span> <span class=
"nx">elId
</span><span class=
"o">;
</span>
385 <span class=
"o">}
</span>
386 <span class=
"o">}
</span>
388 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span> <span class=
"o">=
</span> <span class=
"nx">el
</span><span class=
"o">;
</span>
390 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">el
</span><span class=
"o">.
</span><span class=
"nx">id
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
391 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">id
</span> <span class=
"o">=
</span> <span class=
"nx">el
</span><span class=
"o">.
</span><span class=
"nx">id
</span><span class=
"o">;
</span>
392 <span class=
"o">}
</span>
394 <span class=
"k">var
</span> <span class=
"nx">childNodes
</span> <span class=
"o">=
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">.
</span><span class=
"nx">childNodes
</span><span class=
"o">;
</span>
396 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">childNodes
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
397 <span class=
"k">for
</span> <span class=
"o">(
</span><span class=
"k">var
</span> <span class=
"nx">i
</span><span class=
"o">=
</span><span class=
"m">0</span><span class=
"o">;
</span><span class=
"nx">i
</span><span class=
"o"><</span><span class=
"nx">childNodes
</span><span class=
"o">.
</span><span class=
"nx">length
</span><span class=
"o">;
</span><span class=
"nx">i
</span><span class=
"o">++)
</span> <span class=
"o">{
</span>
398 <span class=
"k">var
</span> <span class=
"nx">child
</span> <span class=
"o">=
</span> <span class=
"nx">childNodes
</span><span class=
"o">[
</span><span class=
"nx">i
</span><span class=
"o">];
</span>
399 <span class=
"nx">switch
</span> <span class=
"o">(
</span><span class=
"nx">child
</span><span class=
"o">.
</span><span class=
"nx">className
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
400 <span class=
"nx">case
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_HEADER
</span><span class=
"o">:
</span>
401 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span> <span class=
"o">=
</span> <span class=
"nx">child
</span><span class=
"o">;
</span>
402 <span class=
"k">break
</span><span class=
"o">;
</span>
403 <span class=
"nx">case
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_BODY
</span><span class=
"o">:
</span>
404 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span> <span class=
"o">=
</span> <span class=
"nx">child
</span><span class=
"o">;
</span>
405 <span class=
"k">break
</span><span class=
"o">;
</span>
406 <span class=
"nx">case
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_FOOTER
</span><span class=
"o">:
</span>
407 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">=
</span> <span class=
"nx">child
</span><span class=
"o">;
</span>
408 <span class=
"k">break
</span><span class=
"o">;
</span>
409 <span class=
"o">}
</span>
410 <span class=
"o">}
</span>
411 <span class=
"o">}
</span>
413 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">initDefaultConfig
</span><span class=
"o">();
</span>
415 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">addClass
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">,
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_MODULE
</span><span class=
"o">);
</span>
417 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">userConfig
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
418 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">applyConfig
</span><span class=
"o">(
</span><span class=
"nx">userConfig
</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
419 <span class=
"o">}
</span>
421 <span class=
"c">// Subscribe to the fireQueue() method of Config so that any queued configuration changes are
</span>
422 <span class=
"c"></span> <span class=
"c">// excecuted upon render of the Module
</span>
423 <span class=
"c"></span> <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Config
</span><span class=
"o">.
</span><span class=
"nx">alreadySubscribed
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">renderEvent
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">fireQueue
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
424 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">renderEvent
</span><span class=
"o">.
</span><span class=
"nx">subscribe
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">fireQueue
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
425 <span class=
"o">}
</span>
427 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">initEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">);
</span>
428 <span class=
"o">},
</span>
430 <span class=
"c">/**
</span>
431 <span class=
"c"> * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
</span>
432 <span class=
"c"> * @method initResizeMonitor
</span>
433 <span class=
"c"> */
</span>
434 <span class=
"nx">initResizeMonitor
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
436 <span class=
"k">if
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">browser
</span> <span class=
"o">!=
</span> <span class=
"s2">"opera
"</span><span class=
"o">)
</span> <span class=
"o">{
</span>
438 <span class=
"k">var
</span> <span class=
"nx">resizeMonitor
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">getElementById
</span><span class=
"o">(
</span><span class=
"s2">"_yuiResizeMonitor
"</span><span class=
"o">);
</span>
440 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
442 <span class=
"nx">resizeMonitor
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"iframe
"</span><span class=
"o">);
</span>
444 <span class=
"k">var
</span> <span class=
"nx">bIE
</span> <span class=
"o">=
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">browser
</span><span class=
"o">.
</span><span class=
"nx">indexOf
</span><span class=
"o">(
</span><span class=
"s2">"ie
"</span><span class=
"o">)
</span> <span class=
"o">===
</span> <span class=
"m">0</span><span class=
"o">);
</span>
446 <span class=
"k">if
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">isSecure
</span> <span class=
"o">&&</span>
447 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">RESIZE_MONITOR_SECURE_URL
</span> <span class=
"o">&&</span>
448 <span class=
"nx">bIE
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
450 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">src
</span> <span class=
"o">=
</span>
451 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">RESIZE_MONITOR_SECURE_URL
</span><span class=
"o">;
</span>
453 <span class=
"o">}
</span>
455 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">id
</span> <span class=
"o">=
</span> <span class=
"s2">"_yuiResizeMonitor
"</span><span class=
"o">;
</span>
456 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">visibility
</span> <span class=
"o">=
</span> <span class=
"s2">"hidden
"</span><span class=
"o">;
</span>
458 <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">);
</span>
460 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">width
</span> <span class=
"o">=
</span> <span class=
"s2">"10em
"</span><span class=
"o">;
</span>
461 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">height
</span> <span class=
"o">=
</span> <span class=
"s2">"10em
"</span><span class=
"o">;
</span>
462 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">position
</span> <span class=
"o">=
</span> <span class=
"s2">"absolute
"</span><span class=
"o">;
</span>
464 <span class=
"k">var
</span> <span class=
"nx">nLeft
</span> <span class=
"o">=
</span> <span class=
"o">-
</span><span class=
"m">1</span> <span class=
"o">*
</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">offsetWidth
</span><span class=
"o">,
</span>
465 <span class=
"nx">nTop
</span> <span class=
"o">=
</span> <span class=
"o">-
</span><span class=
"m">1</span> <span class=
"o">*
</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">offsetHeight
</span><span class=
"o">;
</span>
467 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">top
</span> <span class=
"o">=
</span> <span class=
"nx">nTop
</span> <span class=
"o">+
</span> <span class=
"s2">"px
"</span><span class=
"o">;
</span>
468 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">left
</span> <span class=
"o">=
</span> <span class=
"nx">nLeft
</span> <span class=
"o">+
</span> <span class=
"s2">"px
"</span><span class=
"o">;
</span>
469 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">borderStyle
</span> <span class=
"o">=
</span> <span class=
"s2">"none
"</span><span class=
"o">;
</span>
470 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">borderWidth
</span> <span class=
"o">=
</span> <span class=
"s2">"0"</span><span class=
"o">;
</span>
471 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">setStyle
</span><span class=
"o">(
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">,
</span> <span class=
"s2">"opacity
"</span><span class=
"o">,
</span> <span class=
"s2">"0"</span><span class=
"o">);
</span>
473 <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">visibility
</span> <span class=
"o">=
</span> <span class=
"s2">"visible
"</span><span class=
"o">;
</span>
475 <span class=
"k">if
</span><span class=
"o">(!
</span><span class=
"nx">bIE
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
477 <span class=
"k">var
</span> <span class=
"nx">doc
</span> <span class=
"o">=
</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">contentWindow
</span><span class=
"o">.
</span><span class=
"nb">document
</span><span class=
"o">;
</span>
479 <span class=
"nx">doc
</span><span class=
"o">.
</span><span class=
"nx">open
</span><span class=
"o">();
</span>
480 <span class=
"nx">doc
</span><span class=
"o">.
</span><span class=
"nx">close
</span><span class=
"o">();
</span>
482 <span class=
"o">}
</span>
483 <span class=
"o">}
</span>
485 <span class=
"k">var
</span> <span class=
"nx">fireTextResize
</span> <span class=
"o">=
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
486 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
487 <span class=
"o">};
</span>
489 <span class=
"k">if
</span><span class=
"o">(
</span><span class=
"nx">resizeMonitor
</span> <span class=
"o">&&</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">contentWindow
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
490 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span> <span class=
"o">=
</span> <span class=
"nx">resizeMonitor
</span><span class=
"o">;
</span>
492 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeEvent
</span><span class=
"o">.
</span><span class=
"nx">subscribe
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">onDomResize
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
494 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeInitialized
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
495 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Event
</span><span class=
"o">.
</span><span class=
"nx">addListener
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">contentWindow
</span><span class=
"o">,
</span> <span class=
"s2">"resize
"</span><span class=
"o">,
</span> <span class=
"nx">fireTextResize
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
496 <span class=
"c">// This will fail in IE if document.domain has changed, so we must change the listener to
</span>
497 <span class=
"c"></span> <span class=
"c">// use the resizeMonitor element instead
</span>
498 <span class=
"c"></span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Event
</span><span class=
"o">.
</span><span class=
"nx">addListener
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">,
</span> <span class=
"s2">"resize
"</span><span class=
"o">,
</span> <span class=
"nx">fireTextResize
</span><span class=
"o">);
</span>
499 <span class=
"o">}
</span>
500 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeInitialized
</span> <span class=
"o">=
</span> <span class=
"kc">true
</span><span class=
"o">;
</span>
501 <span class=
"o">}
</span>
502 <span class=
"o">}
</span>
504 <span class=
"o">}
</span>
506 <span class=
"o">},
</span>
508 <span class=
"c">/**
</span>
509 <span class=
"c"> * Event handler fired when the resize monitor element is resized.
</span>
510 <span class=
"c"> * @method onDomResize
</span>
511 <span class=
"c"> * @param {DOMEvent} e The DOM resize event
</span>
512 <span class=
"c"> * @param {Object} obj The scope object passed to the handler
</span>
513 <span class=
"c"> */
</span>
514 <span class=
"nx">onDomResize
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">e
</span><span class=
"o">,
</span> <span class=
"nx">obj
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
515 <span class=
"k">var
</span> <span class=
"nx">nLeft
</span> <span class=
"o">=
</span> <span class=
"o">-
</span><span class=
"m">1</span> <span class=
"o">*
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">offsetWidth
</span><span class=
"o">,
</span>
516 <span class=
"nx">nTop
</span> <span class=
"o">=
</span> <span class=
"o">-
</span><span class=
"m">1</span> <span class=
"o">*
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">offsetHeight
</span><span class=
"o">;
</span>
518 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">top
</span> <span class=
"o">=
</span> <span class=
"nx">nTop
</span> <span class=
"o">+
</span> <span class=
"s2">"px
"</span><span class=
"o">;
</span>
519 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span><span class=
"o">.
</span><span class=
"nx">style
</span><span class=
"o">.
</span><span class=
"nx">left
</span> <span class=
"o">=
</span> <span class=
"nx">nLeft
</span> <span class=
"o">+
</span> <span class=
"s2">"px
"</span><span class=
"o">;
</span>
521 <span class=
"o">},
</span>
523 <span class=
"c">/**
</span>
524 <span class=
"c"> * Sets the Module
's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
</span>
525 <span class=
"c"> * @method setHeader
</span>
526 <span class=
"c"> * @param {String} headerContent The HTML used to set the header
<em
>OR
</em
></span>
527 <span class=
"c"> * @param {HTMLElement} headerContent The HTMLElement to append to the header
</span>
528 <span class=
"c"> */
</span>
529 <span class=
"nx">setHeader
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">headerContent
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
530 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
531 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
532 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_HEADER
</span><span class=
"o">;
</span>
533 <span class=
"o">}
</span>
535 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">typeof
</span> <span class=
"nx">headerContent
</span> <span class=
"o">==
</span> <span class=
"s2">"string
"</span><span class=
"o">)
</span> <span class=
"o">{
</span>
536 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"nx">headerContent
</span><span class=
"o">;
</span>
537 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
538 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"s2">""</span><span class=
"o">;
</span>
539 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">headerContent
</span><span class=
"o">);
</span>
540 <span class=
"o">}
</span>
542 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeHeaderEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">headerContent
</span><span class=
"o">);
</span>
543 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
544 <span class=
"o">},
</span>
546 <span class=
"c">/**
</span>
547 <span class=
"c"> * Appends the passed element to the header. If no header is present, one will be automatically created.
</span>
548 <span class=
"c"> * @method appendToHeader
</span>
549 <span class=
"c"> * @param {HTMLElement} element The element to append to the header
</span>
550 <span class=
"c"> */
</span>
551 <span class=
"nx">appendToHeader
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
552 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
553 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
554 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_HEADER
</span><span class=
"o">;
</span>
555 <span class=
"o">}
</span>
557 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
558 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeHeaderEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
559 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
560 <span class=
"o">},
</span>
562 <span class=
"c">/**
</span>
563 <span class=
"c"> * Sets the Module
's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
</span>
564 <span class=
"c"> * @method setBody
</span>
565 <span class=
"c"> * @param {String} bodyContent The HTML used to set the body
<em
>OR
</em
></span>
566 <span class=
"c"> * @param {HTMLElement} bodyContent The HTMLElement to append to the body
</span>
567 <span class=
"c"> */
</span>
568 <span class=
"nx">setBody
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">bodyContent
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
569 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
570 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
571 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_BODY
</span><span class=
"o">;
</span>
572 <span class=
"o">}
</span>
574 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">typeof
</span> <span class=
"nx">bodyContent
</span> <span class=
"o">==
</span> <span class=
"s2">"string
"</span><span class=
"o">)
</span>
575 <span class=
"o">{
</span>
576 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"nx">bodyContent
</span><span class=
"o">;
</span>
577 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
578 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"s2">""</span><span class=
"o">;
</span>
579 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">bodyContent
</span><span class=
"o">);
</span>
580 <span class=
"o">}
</span>
582 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeBodyEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">bodyContent
</span><span class=
"o">);
</span>
583 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
584 <span class=
"o">},
</span>
586 <span class=
"c">/**
</span>
587 <span class=
"c"> * Appends the passed element to the body. If no body is present, one will be automatically created.
</span>
588 <span class=
"c"> * @method appendToBody
</span>
589 <span class=
"c"> * @param {HTMLElement} element The element to append to the body
</span>
590 <span class=
"c"> */
</span>
591 <span class=
"nx">appendToBody
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
592 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
593 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
594 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_BODY
</span><span class=
"o">;
</span>
595 <span class=
"o">}
</span>
597 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
598 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeBodyEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
599 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
600 <span class=
"o">},
</span>
602 <span class=
"c">/**
</span>
603 <span class=
"c"> * 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.
</span>
604 <span class=
"c"> * @method setFooter
</span>
605 <span class=
"c"> * @param {String} footerContent The HTML used to set the footer
<em
>OR
</em
></span>
606 <span class=
"c"> * @param {HTMLElement} footerContent The HTMLElement to append to the footer
</span>
607 <span class=
"c"> */
</span>
608 <span class=
"nx">setFooter
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">footerContent
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
609 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
610 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
611 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_FOOTER
</span><span class=
"o">;
</span>
612 <span class=
"o">}
</span>
614 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">typeof
</span> <span class=
"nx">footerContent
</span> <span class=
"o">==
</span> <span class=
"s2">"string
"</span><span class=
"o">)
</span> <span class=
"o">{
</span>
615 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"nx">footerContent
</span><span class=
"o">;
</span>
616 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
617 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">innerHTML
</span> <span class=
"o">=
</span> <span class=
"s2">""</span><span class=
"o">;
</span>
618 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">footerContent
</span><span class=
"o">);
</span>
619 <span class=
"o">}
</span>
621 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeFooterEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">footerContent
</span><span class=
"o">);
</span>
622 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
623 <span class=
"o">},
</span>
625 <span class=
"c">/**
</span>
626 <span class=
"c"> * Appends the passed element to the footer. If no footer is present, one will be automatically created.
</span>
627 <span class=
"c"> * @method appendToFooter
</span>
628 <span class=
"c"> * @param {HTMLElement} element The element to append to the footer
</span>
629 <span class=
"c"> */
</span>
630 <span class=
"nx">appendToFooter
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
631 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
632 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">createElement
</span><span class=
"o">(
</span><span class=
"s2">"DIV
"</span><span class=
"o">);
</span>
633 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">className
</span> <span class=
"o">=
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">CSS_FOOTER
</span><span class=
"o">;
</span>
634 <span class=
"o">}
</span>
636 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
637 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeFooterEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
638 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">changeContentEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
639 <span class=
"o">},
</span>
641 <span class=
"c">/**
</span>
642 <span class=
"c"> * 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. NOTE: 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.
</span>
643 <span class=
"c"> * @method render
</span>
644 <span class=
"c"> * @param {String} appendToNode The element id to which the Module should be appended to prior to rendering
<em
>OR
</em
></span>
645 <span class=
"c"> * @param {HTMLElement} appendToNode The element to which the Module should be appended to prior to rendering
</span>
646 <span class=
"c"> * @param {HTMLElement} moduleElement OPTIONAL. The element that represents the actual Standard Module container.
</span>
647 <span class=
"c"> * @return {Boolean} Success or failure of the render
</span>
648 <span class=
"c"> */
</span>
649 <span class=
"nx">render
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">appendToNode
</span><span class=
"o">,
</span> <span class=
"nx">moduleElement
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
650 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeRenderEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
652 <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">moduleElement
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
653 <span class=
"nx">moduleElement
</span> <span class=
"o">=
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">;
</span>
654 <span class=
"o">}
</span>
656 <span class=
"k">var
</span> <span class=
"nx">me
</span> <span class=
"o">=
</span> <span class=
"k">this
</span><span class=
"o">;
</span>
657 <span class=
"k">var
</span> <span class=
"nx">appendTo
</span> <span class=
"o">=
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
658 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">typeof
</span> <span class=
"nx">element
</span> <span class=
"o">==
</span> <span class=
"s2">"string
"</span><span class=
"o">)
</span> <span class=
"o">{
</span>
659 <span class=
"nx">element
</span> <span class=
"o">=
</span> <span class=
"nb">document
</span><span class=
"o">.
</span><span class=
"nx">getElementById
</span><span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
660 <span class=
"o">}
</span>
662 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
663 <span class=
"nx">element
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"nx">me
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
664 <span class=
"nx">me
</span><span class=
"o">.
</span><span class=
"nx">appendEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
665 <span class=
"o">}
</span>
666 <span class=
"o">};
</span>
668 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">appendToNode
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
669 <span class=
"nx">appendTo
</span><span class=
"o">(
</span><span class=
"nx">appendToNode
</span><span class=
"o">);
</span>
670 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span> <span class=
"c">// No node was passed in. If the element is not pre-marked up, this fails
</span>
671 <span class=
"c"></span> <span class=
"k">if
</span> <span class=
"o">(!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">inDocument
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
672 <span class=
"k">return
</span> <span class=
"kc">false
</span><span class=
"o">;
</span>
673 <span class=
"o">}
</span>
674 <span class=
"o">}
</span>
676 <span class=
"c">// Need to get everything into the DOM if it isn
't already
</span>
677 <span class=
"c"></span>
678 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span> <span class=
"o">&&</span> <span class=
"o">!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">inDocument
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
679 <span class=
"c">// There is a header, but it
's not in the DOM yet... need to add it
</span>
680 <span class=
"c"></span> <span class=
"k">var
</span> <span class=
"nx">firstChild
</span> <span class=
"o">=
</span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">firstChild
</span><span class=
"o">;
</span>
681 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">firstChild
</span><span class=
"o">)
</span> <span class=
"o">{
</span> <span class=
"c">// Insert before first child if exists
</span>
682 <span class=
"c"></span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">insertBefore
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">,
</span> <span class=
"nx">firstChild
</span><span class=
"o">);
</span>
683 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span> <span class=
"c">// Append to empty body because there are no children
</span>
684 <span class=
"c"></span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span><span class=
"o">);
</span>
685 <span class=
"o">}
</span>
686 <span class=
"o">}
</span>
688 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span> <span class=
"o">&&</span> <span class=
"o">!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">inDocument
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
689 <span class=
"c">// There is a body, but it
's not in the DOM yet... need to add it
</span>
690 <span class=
"c"></span> <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">&&</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">isAncestor
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">moduleElement
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">))
</span> <span class=
"o">{
</span> <span class=
"c">// Insert before footer if exists in DOM
</span>
691 <span class=
"c"></span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">insertBefore
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">);
</span>
692 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span> <span class=
"c">// Append to element because there is no footer
</span>
693 <span class=
"c"></span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span><span class=
"o">);
</span>
694 <span class=
"o">}
</span>
695 <span class=
"o">}
</span>
697 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">&&</span> <span class=
"o">!
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">inDocument
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">))
</span> <span class=
"o">{
</span>
698 <span class=
"c">// There is a footer, but it
's not in the DOM yet... need to add it
</span>
699 <span class=
"c"></span> <span class=
"nx">moduleElement
</span><span class=
"o">.
</span><span class=
"nx">appendChild
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span><span class=
"o">);
</span>
700 <span class=
"o">}
</span>
702 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">renderEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
703 <span class=
"k">return
</span> <span class=
"kc">true
</span><span class=
"o">;
</span>
704 <span class=
"o">},
</span>
706 <span class=
"c">/**
</span>
707 <span class=
"c"> * Removes the Module element from the DOM and sets all child elements to null.
</span>
708 <span class=
"c"> * @method destroy
</span>
709 <span class=
"c"> */
</span>
710 <span class=
"nx">destroy
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
711 <span class=
"k">var
</span> <span class=
"nx">parent
</span><span class=
"o">;
</span>
713 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
714 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Event
</span><span class=
"o">.
</span><span class=
"nx">purgeElement
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
715 <span class=
"nx">parent
</span> <span class=
"o">=
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">.
</span><span class=
"nx">parentNode
</span><span class=
"o">;
</span>
716 <span class=
"o">}
</span>
717 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">parent
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
718 <span class=
"nx">parent
</span><span class=
"o">.
</span><span class=
"nx">removeChild
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">);
</span>
719 <span class=
"o">}
</span>
721 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span> <span class=
"o">=
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
722 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">header
</span> <span class=
"o">=
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
723 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">body
</span> <span class=
"o">=
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
724 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">footer
</span> <span class=
"o">=
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
726 <span class=
"k">for
</span> <span class=
"o">(
</span><span class=
"k">var
</span> <span class=
"nx">e
</span> <span class=
"k">in
</span> <span class=
"k">this
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
727 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">e
</span> <span class=
"k">instanceof
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">CustomEvent
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
728 <span class=
"nx">e
</span><span class=
"o">.
</span><span class=
"nx">unsubscribeAll
</span><span class=
"o">();
</span>
729 <span class=
"o">}
</span>
730 <span class=
"o">}
</span>
732 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeEvent
</span><span class=
"o">.
</span><span class=
"nx">unsubscribe
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">onDomResize
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">);
</span>
734 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">destroyEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
735 <span class=
"o">},
</span>
737 <span class=
"c">/**
</span>
738 <span class=
"c"> * 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.
</span>
739 <span class=
"c"> * @method show
</span>
740 <span class=
"c"> */
</span>
741 <span class=
"nx">show
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
742 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">setProperty
</span><span class=
"o">(
</span><span class=
"s2">"visible
"</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
743 <span class=
"o">},
</span>
745 <span class=
"c">/**
</span>
746 <span class=
"c"> * 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.
</span>
747 <span class=
"c"> * @method hide
</span>
748 <span class=
"c"> */
</span>
749 <span class=
"nx">hide
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
750 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">cfg
</span><span class=
"o">.
</span><span class=
"nx">setProperty
</span><span class=
"o">(
</span><span class=
"s2">"visible
"</span><span class=
"o">,
</span> <span class=
"kc">false
</span><span class=
"o">);
</span>
751 <span class=
"o">},
</span>
753 <span class=
"c">// BUILT-IN EVENT HANDLERS FOR MODULE //
</span>
754 <span class=
"c"></span>
755 <span class=
"c">/**
</span>
756 <span class=
"c"> * 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
".
</span>
757 <span class=
"c"> * This method is responsible for firing showEvent and hideEvent.
</span>
758 <span class=
"c"> * @param {String} type The CustomEvent type (usually the property name)
</span>
759 <span class=
"c"> * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[
0] will equal the newly applied value for the property.
</span>
760 <span class=
"c"> * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
</span>
761 <span class=
"c"> * @method configVisible
</span>
762 <span class=
"c"> */
</span>
763 <span class=
"nx">configVisible
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">type
</span><span class=
"o">,
</span> <span class=
"nx">args
</span><span class=
"o">,
</span> <span class=
"nx">obj
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
764 <span class=
"k">var
</span> <span class=
"nx">visible
</span> <span class=
"o">=
</span> <span class=
"nx">args
</span><span class=
"o">[
</span><span class=
"m">0</span><span class=
"o">];
</span>
765 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">visible
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
766 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeShowEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
767 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">setStyle
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">,
</span> <span class=
"s2">"display
"</span><span class=
"o">,
</span> <span class=
"s2">"block
"</span><span class=
"o">);
</span>
768 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">showEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
769 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
770 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">beforeHideEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
771 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">util
</span><span class=
"o">.
</span><span class=
"nx">Dom
</span><span class=
"o">.
</span><span class=
"nx">setStyle
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">element
</span><span class=
"o">,
</span> <span class=
"s2">"display
"</span><span class=
"o">,
</span> <span class=
"s2">"none
"</span><span class=
"o">);
</span>
772 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">hideEvent
</span><span class=
"o">.
</span><span class=
"nx">fire
</span><span class=
"o">();
</span>
773 <span class=
"o">}
</span>
774 <span class=
"o">},
</span>
776 <span class=
"c">/**
</span>
777 <span class=
"c"> * Default event handler for the
"monitorresize
" configuration property
</span>
778 <span class=
"c"> * @param {String} type The CustomEvent type (usually the property name)
</span>
779 <span class=
"c"> * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[
0] will equal the newly applied value for the property.
</span>
780 <span class=
"c"> * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
</span>
781 <span class=
"c"> * @method configMonitorResize
</span>
782 <span class=
"c"> */
</span>
783 <span class=
"nx">configMonitorResize
</span> <span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">type
</span><span class=
"o">,
</span> <span class=
"nx">args
</span><span class=
"o">,
</span> <span class=
"nx">obj
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
784 <span class=
"k">var
</span> <span class=
"nx">monitor
</span> <span class=
"o">=
</span> <span class=
"nx">args
</span><span class=
"o">[
</span><span class=
"m">0</span><span class=
"o">];
</span>
785 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">monitor
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
786 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">initResizeMonitor
</span><span class=
"o">();
</span>
787 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
788 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">textResizeEvent
</span><span class=
"o">.
</span><span class=
"nx">unsubscribe
</span><span class=
"o">(
</span><span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">onDomResize
</span><span class=
"o">,
</span> <span class=
"k">this
</span><span class=
"o">,
</span> <span class=
"kc">true
</span><span class=
"o">);
</span>
789 <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">resizeMonitor
</span> <span class=
"o">=
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
790 <span class=
"o">}
</span>
791 <span class=
"o">}
</span>
792 <span class=
"o">};
</span>
794 <span class=
"c">/**
</span>
795 <span class=
"c">* Returns a String representation of the Object.
</span>
796 <span class=
"c">* @method toString
</span>
797 <span class=
"c">* @return {String} The string representation of the Module
</span>
798 <span class=
"c">*/
</span>
799 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">Module
</span><span class=
"o">.
</span><span class=
"nx">prototype
</span><span class=
"o">.
</span><span class=
"nx">toString
</span> <span class=
"o">=
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
800 <span class=
"k">return
</span> <span class=
"s2">"Module
"</span> <span class=
"o">+
</span> <span class=
"k">this
</span><span class=
"o">.
</span><span class=
"nx">id
</span><span class=
"o">;
</span>
801 <span class=
"o">};
</span>
813 <li class=
""><a href=
"module_animation.html">animation
</a></li>
815 <li class=
""><a href=
"module_autocomplete.html">autocomplete
</a></li>
817 <li class=
""><a href=
"module_button.html">button
</a></li>
819 <li class=
""><a href=
"module_calendar.html">calendar
</a></li>
821 <li class=
""><a href=
"module_connection.html">connection
</a></li>
823 <li class=
"selected"><a href=
"module_container.html">container
</a></li>
825 <li class=
""><a href=
"module_datasource.html">datasource
</a></li>
827 <li class=
""><a href=
"module_datatable.html">datatable
</a></li>
829 <li class=
""><a href=
"module_dom.html">dom
</a></li>
831 <li class=
""><a href=
"module_dragdrop.html">dragdrop
</a></li>
833 <li class=
""><a href=
"module_element.html">element
</a></li>
835 <li class=
""><a href=
"module_event.html">event
</a></li>
837 <li class=
""><a href=
"module_history.html">history
</a></li>
839 <li class=
""><a href=
"module_logger.html">logger
</a></li>
841 <li class=
""><a href=
"module_menu.html">menu
</a></li>
843 <li class=
""><a href=
"module_slider.html">slider
</a></li>
845 <li class=
""><a href=
"module_tabview.html">tabview
</a></li>
847 <li class=
""><a href=
"module_treeview.html">treeview
</a></li>
849 <li class=
""><a href=
"module_yahoo.html">yahoo
</a></li>
856 <li class=
""><a href=
"YAHOO.util.Config.html">YAHOO.util.Config
</a></li>
857 <li class=
""><a href=
"YAHOO.util.KeyListener.html">YAHOO.util.KeyListener
</a></li>
858 <li class=
""><a href=
"YAHOO.widget.ContainerEffect.html">YAHOO.widget.ContainerEffect
</a></li>
859 <li class=
""><a href=
"YAHOO.widget.Dialog.html">YAHOO.widget.Dialog
</a></li>
860 <li class=
""><a href=
"YAHOO.widget.Module.html">YAHOO.widget.Module
</a></li>
861 <li class=
""><a href=
"YAHOO.widget.Overlay.html">YAHOO.widget.Overlay
</a></li>
862 <li class=
""><a href=
"YAHOO.widget.OverlayManager.html">YAHOO.widget.OverlayManager
</a></li>
863 <li class=
""><a href=
"YAHOO.widget.Panel.html">YAHOO.widget.Panel
</a></li>
864 <li class=
""><a href=
"YAHOO.widget.SimpleDialog.html">YAHOO.widget.SimpleDialog
</a></li>
865 <li class=
""><a href=
"YAHOO.widget.Tooltip.html">YAHOO.widget.Tooltip
</a></li>
872 <li class=
""><a href=
"Config.js.html">Config.js
</a></li>
873 <li class=
""><a href=
"ContainerEffect.js.html">ContainerEffect.js
</a></li>
874 <li class=
""><a href=
"Dialog.js.html">Dialog.js
</a></li>
875 <li class=
""><a href=
"KeyListener.js.html">KeyListener.js
</a></li>
876 <li class=
"selected"><a href=
"Module.js.html">Module.js
</a></li>
877 <li class=
""><a href=
"Overlay.js.html">Overlay.js
</a></li>
878 <li class=
""><a href=
"OverlayManager.js.html">OverlayManager.js
</a></li>
879 <li class=
""><a href=
"Panel.js.html">Panel.js
</a></li>
880 <li class=
""><a href=
"SimpleDialog.js.html">SimpleDialog.js
</a></li>
881 <li class=
""><a href=
"Tooltip.js.html">Tooltip.js
</a></li>
894 Copyright
© 2007 Yahoo! Inc. All rights reserved.