_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q29800
train
function (element) { var oFooter = this.footer || (this.footer = createFooter()); oFooter.appendChild(element); this.changeFooterEvent.fire(element); this.changeContentEvent.fire(); }
javascript
{ "resource": "" }
q29801
train
function(moduleElement){ moduleElement = moduleElement || this.element; // Need to get everything into the DOM if it isn't already if (this.header && !Dom.inDocument(this.header)) { // There is a header, but it's not in the DOM yet. Need to add it. var firstChild = moduleElement.firstChild; if (firstChild) { moduleElement.insertBefore(this.header, firstChild); } else { moduleElement.appendChild(this.header); } } }
javascript
{ "resource": "" }
q29802
train
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.body && !Dom.inDocument(this.body)) { // There is a body, but it's not in the DOM yet. Need to add it. if (this.footer && Dom.isAncestor(moduleElement, this.footer)) { moduleElement.insertBefore(this.body, this.footer); } else { moduleElement.appendChild(this.body); } } }
javascript
{ "resource": "" }
q29803
train
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.footer && !Dom.inDocument(this.footer)) { // There is a footer, but it's not in the DOM yet. Need to add it. moduleElement.appendChild(this.footer); } }
javascript
{ "resource": "" }
q29804
train
function () { var parent; if (this.element) { Event.purgeElement(this.element, true); parent = this.element.parentNode; } if (parent) { parent.removeChild(this.element); } this.element = null; this.header = null; this.body = null; this.footer = null; Module.textResizeEvent.unsubscribe(this.onDomResize, this); this.cfg.destroy(); this.cfg = null; this.destroyEvent.fire(); }
javascript
{ "resource": "" }
q29805
train
function (type, args, obj) { var monitor = args[0]; if (monitor) { this.initResizeMonitor(); } else { Module.textResizeEvent.unsubscribe(this.onDomResize, this, true); this.resizeMonitor = null; } }
javascript
{ "resource": "" }
q29806
train
function () { Overlay.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired before the Overlay is moved. * @event beforeMoveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE); this.beforeMoveEvent.signature = SIGNATURE; /** * CustomEvent fired after the Overlay is moved. * @event moveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.moveEvent = this.createEvent(EVENT_TYPES.MOVE); this.moveEvent.signature = SIGNATURE; }
javascript
{ "resource": "" }
q29807
train
function(show) { Dom.setStyle(this.element, "visibility", (show) ? "visible" : "hidden"); var hiddenClass = Overlay.CSS_HIDDEN; if (show) { Dom.removeClass(this.element, hiddenClass); } else { Dom.addClass(this.element, hiddenClass); } }
javascript
{ "resource": "" }
q29808
train
function (type, args, obj) { var val = args[0], alreadySubscribed = Config.alreadySubscribed, windowResizeEvent = Overlay.windowResizeEvent, windowScrollEvent = Overlay.windowScrollEvent; if (val) { this.center(); if (!alreadySubscribed(this.beforeShowEvent, this.center)) { this.beforeShowEvent.subscribe(this.center); } if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) { windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true); } if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) { windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true); } } else { this.beforeShowEvent.unsubscribe(this.center); windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this); windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this); } }
javascript
{ "resource": "" }
q29809
train
function (type, args, obj) { var height = args[0], el = this.element; Dom.setStyle(el, "height", height); this.cfg.refireEvent("iframe"); }
javascript
{ "resource": "" }
q29810
train
function (type, args, obj) { var x = args[0], y = this.cfg.getProperty("y"); this.cfg.setProperty("x", x, true); this.cfg.setProperty("y", y, true); this.beforeMoveEvent.fire([x, y]); x = this.cfg.getProperty("x"); y = this.cfg.getProperty("y"); Dom.setX(this.element, x, true); this.cfg.setProperty("xy", [x, y], true); this.cfg.refireEvent("iframe"); this.moveEvent.fire([x, y]); }
javascript
{ "resource": "" }
q29811
train
function () { var oIFrame = this.iframe, oParentNode; if (oIFrame) { oParentNode = this.element.parentNode; if (oParentNode != oIFrame.parentNode) { this._addToParent(oParentNode, oIFrame); } oIFrame.style.display = "block"; } }
javascript
{ "resource": "" }
q29812
train
function () { var oIFrame = this.iframe, oElement = this.element, nOffset = Overlay.IFRAME_OFFSET, nDimensionOffset = (nOffset * 2), aXY; if (oIFrame) { // Size <iframe> oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px"); oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px"); // Position <iframe> aXY = this.cfg.getProperty("xy"); if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) { this.syncPosition(); aXY = this.cfg.getProperty("xy"); } Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]); } }
javascript
{ "resource": "" }
q29813
train
function () { if (this.iframe) { var overlayZ = Dom.getStyle(this.element, "zIndex"); if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) { Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1)); } } }
javascript
{ "resource": "" }
q29814
train
function (type, args, obj) { var bIFrame = args[0]; function createIFrame() { var oIFrame = this.iframe, oElement = this.element, oParent; if (!oIFrame) { if (!m_oIFrameTemplate) { m_oIFrameTemplate = document.createElement("iframe"); if (this.isSecure) { m_oIFrameTemplate.src = Overlay.IFRAME_SRC; } /* Set the opacity of the <iframe> to 0 so that it doesn't modify the opacity of any transparent elements that may be on top of it (like a shadow). */ if (UA.ie) { m_oIFrameTemplate.style.filter = "alpha(opacity=0)"; /* Need to set the "frameBorder" property to 0 supress the default <iframe> border in IE. Setting the CSS "border" property alone doesn't supress it. */ m_oIFrameTemplate.frameBorder = 0; } else { m_oIFrameTemplate.style.opacity = "0"; } m_oIFrameTemplate.style.position = "absolute"; m_oIFrameTemplate.style.border = "none"; m_oIFrameTemplate.style.margin = "0"; m_oIFrameTemplate.style.padding = "0"; m_oIFrameTemplate.style.display = "none"; m_oIFrameTemplate.tabIndex = -1; m_oIFrameTemplate.className = Overlay.CSS_IFRAME; } oIFrame = m_oIFrameTemplate.cloneNode(false); oIFrame.id = this.id + "_f"; oParent = oElement.parentNode; var parentNode = oParent || document.body; this._addToParent(parentNode, oIFrame); this.iframe = oIFrame; } /* Show the <iframe> before positioning it since the "setXY" method of DOM requires the element be in the document and visible. */ this.showIframe(); /* Syncronize the size and position of the <iframe> to that of the Overlay. */ this.syncIframe(); this.stackIframe(); // Add event listeners to update the <iframe> when necessary if (!this._hasIframeEventListeners) { this.showEvent.subscribe(this.showIframe); this.hideEvent.subscribe(this.hideIframe); this.changeContentEvent.subscribe(this.syncIframe); this._hasIframeEventListeners = true; } } function onBeforeShow() { createIFrame.call(this); this.beforeShowEvent.unsubscribe(onBeforeShow); this._iframeDeferred = false; } if (bIFrame) { // <iframe> shim is enabled if (this.cfg.getProperty("visible")) { createIFrame.call(this); } else { if (!this._iframeDeferred) { this.beforeShowEvent.subscribe(onBeforeShow); this._iframeDeferred = true; } } } else { // <iframe> shim is disabled this.hideIframe(); if (this._hasIframeEventListeners) { this.showEvent.unsubscribe(this.showIframe); this.hideEvent.unsubscribe(this.hideIframe); this.changeContentEvent.unsubscribe(this.syncIframe); this._hasIframeEventListeners = false; } } }
javascript
{ "resource": "" }
q29815
train
function() { if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) { // Set CFG XY based on DOM XY this.syncPosition(); // Account for XY being set silently in syncPosition (no moveTo fired/called) this.cfg.refireEvent("xy"); this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); } }
javascript
{ "resource": "" }
q29816
train
function (type, args, obj) { var val = args[0]; if (val) { if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) { this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true); } if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) { this.beforeShowEvent.subscribe(this._primeXYFromDOM); } } else { this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this); } }
javascript
{ "resource": "" }
q29817
train
function(t) { var tce = null; if (t instanceof CustomEvent) { tce = t; } else if (Overlay._TRIGGER_MAP[t]) { tce = Overlay._TRIGGER_MAP[t]; } return tce; }
javascript
{ "resource": "" }
q29818
train
function(triggers, mode, fn) { var t, tce; for (var i = 0, l = triggers.length; i < l; ++i) { t = triggers[i]; tce = this._findTriggerCE(t); if (tce) { tce[mode](fn, this, true); } else { this[mode](t, fn); } } }
javascript
{ "resource": "" }
q29819
train
function (type, args, obj) { var pos = args[0]; var cXY = this.getConstrainedXY(pos[0], pos[1]); this.cfg.setProperty("x", cXY[0], true); this.cfg.setProperty("y", cXY[1], true); this.cfg.setProperty("xy", cXY, true); }
javascript
{ "resource": "" }
q29820
train
function(pos, val) { var overlayEl = this.element, buffer = Overlay.VIEWPORT_OFFSET, x = (pos == "x"), overlaySize = (x) ? overlayEl.offsetWidth : overlayEl.offsetHeight, viewportSize = (x) ? Dom.getViewportWidth() : Dom.getViewportHeight(), docScroll = (x) ? Dom.getDocumentScrollLeft() : Dom.getDocumentScrollTop(), overlapPositions = (x) ? Overlay.PREVENT_OVERLAP_X : Overlay.PREVENT_OVERLAP_Y, context = this.cfg.getProperty("context"), bOverlayFitsInViewport = (overlaySize + buffer < viewportSize), bPreventContextOverlap = this.cfg.getProperty("preventcontextoverlap") && context && overlapPositions[(context[1] + context[2])], minConstraint = docScroll + buffer, maxConstraint = docScroll + viewportSize - overlaySize - buffer, constrainedVal = val; if (val < minConstraint || val > maxConstraint) { if (bPreventContextOverlap) { constrainedVal = this._preventOverlap(pos, context[0], overlaySize, viewportSize, docScroll); } else { if (bOverlayFitsInViewport) { if (val < minConstraint) { constrainedVal = minConstraint; } else if (val > maxConstraint) { constrainedVal = maxConstraint; } } else { constrainedVal = minConstraint; } } } return constrainedVal; }
javascript
{ "resource": "" }
q29821
train
function () { var nViewportOffset = Overlay.VIEWPORT_OFFSET, elementWidth = this.element.offsetWidth, elementHeight = this.element.offsetHeight, viewPortWidth = Dom.getViewportWidth(), viewPortHeight = Dom.getViewportHeight(), x, y; if (elementWidth < viewPortWidth) { x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft(); } else { x = nViewportOffset + Dom.getDocumentScrollLeft(); } if (elementHeight < viewPortHeight) { y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop(); } else { y = nViewportOffset + Dom.getDocumentScrollTop(); } this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]); this.cfg.refireEvent("iframe"); if (UA.webkit) { this.forceContainerRedraw(); } }
javascript
{ "resource": "" }
q29822
train
function () { var pos = Dom.getXY(this.element); this.cfg.setProperty("x", pos[0], true); this.cfg.setProperty("y", pos[1], true); this.cfg.setProperty("xy", pos, true); }
javascript
{ "resource": "" }
q29823
train
function(type, args, el) { var height = this.cfg.getProperty("height"); if ((height && height !== "auto") || (height === 0)) { this.fillHeight(el); } }
javascript
{ "resource": "" }
q29824
train
function(el) { var height = el.offsetHeight; if (el.getBoundingClientRect) { var rect = el.getBoundingClientRect(); height = rect.bottom - rect.top; } return height; }
javascript
{ "resource": "" }
q29825
train
function () { var aOverlays = [], oElement = this.element; function compareZIndexDesc(p_oOverlay1, p_oOverlay2) { var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"), sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"), nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10), nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10); if (nZIndex1 > nZIndex2) { return -1; } else if (nZIndex1 < nZIndex2) { return 1; } else { return 0; } } function isOverlayElement(p_oElement) { var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY), Panel = YAHOO.widget.Panel; if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) { if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) { aOverlays[aOverlays.length] = p_oElement.parentNode; } else { aOverlays[aOverlays.length] = p_oElement; } } } Dom.getElementsBy(isOverlayElement, "DIV", document.body); aOverlays.sort(compareZIndexDesc); var oTopOverlay = aOverlays[0], nTopZIndex; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay != oElement) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } } }
javascript
{ "resource": "" }
q29826
train
function () { if (this.iframe) { this.iframe.parentNode.removeChild(this.iframe); } this.iframe = null; Overlay.windowResizeEvent.unsubscribe( this.doCenterOnDOMEvent, this); Overlay.windowScrollEvent.unsubscribe( this.doCenterOnDOMEvent, this); Module.textResizeEvent.unsubscribe(this._autoFillOnHeightChange); if (this._contextTriggers) { // Unsubscribe context triggers - to cover context triggers which listen for global // events such as windowResize and windowScroll. Easier just to unsubscribe all this._processTriggers(this._contextTriggers, _UNSUBSCRIBE, this._alignOnTrigger); } Overlay.superclass.destroy.call(this); }
javascript
{ "resource": "" }
q29827
train
function(overlay) { var mgr = this; if (!overlay.focusEvent) { overlay.focusEvent = overlay.createEvent("focus"); overlay.focusEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr); } if (!overlay.focus) { Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay); overlay.focus = function () { if (mgr._manageFocus(this)) { // For Panel/Dialog if (this.cfg.getProperty("visible") && this.focusFirst) { this.focusFirst(); } this.focusEvent.fire(); } }; overlay.focus._managed = true; } }
javascript
{ "resource": "" }
q29828
train
function(overlay) { var mgr = this; if (!overlay.blurEvent) { overlay.blurEvent = overlay.createEvent("blur"); overlay.blurEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.blurEvent.subscribe(mgr._onOverlayBlurHandler, overlay, mgr); } if (!overlay.blur) { overlay.blur = function () { if (mgr._manageBlur(this)) { this.blurEvent.fire(); } }; overlay.blur._managed = true; } overlay.hideEvent.subscribe(overlay.blur); }
javascript
{ "resource": "" }
q29829
train
function (overlay) { var registered = false, i, n; if (overlay instanceof Overlay) { overlay.cfg.addProperty("manager", { value: this } ); this._bindFocus(overlay); this._bindBlur(overlay); this._bindDestroy(overlay); this._syncZIndex(overlay); this.overlays.push(overlay); this.bringToTop(overlay); registered = true; } else if (overlay instanceof Array) { for (i = 0, n = overlay.length; i < n; i++) { registered = this.register(overlay[i]) || registered; } } return registered; }
javascript
{ "resource": "" }
q29830
train
function (p_oOverlay) { var oOverlay = this.find(p_oOverlay), nTopZIndex, oTopOverlay, aOverlays; if (oOverlay) { aOverlays = this.overlays; aOverlays.sort(this.compareZIndexDesc); oTopOverlay = aOverlays[0]; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay !== oOverlay) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } aOverlays.sort(this.compareZIndexDesc); } } }
javascript
{ "resource": "" }
q29831
train
function (overlay) { var isInstance = overlay instanceof Overlay, overlays = this.overlays, n = overlays.length, found = null, o, i; if (isInstance || typeof overlay == "string") { for (i = n-1; i >= 0; i--) { o = overlays[i]; if ((isInstance && (o === overlay)) || (o.id == overlay)) { found = o; break; } } } return found; }
javascript
{ "resource": "" }
q29832
train
function (o1, o2) { var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed) zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom. if (zIndex1 === null && zIndex2 === null) { return 0; } else if (zIndex1 === null){ return 1; } else if (zIndex2 === null) { return -1; } else if (zIndex1 > zIndex2) { return -1; } else if (zIndex1 < zIndex2) { return 1; } else { return 0; } }
javascript
{ "resource": "" }
q29833
train
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].show(); } }
javascript
{ "resource": "" }
q29834
train
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].hide(); } }
javascript
{ "resource": "" }
q29835
train
function (el, userConfig) { Tooltip.superclass.init.call(this, el); this.beforeInitEvent.fire(Tooltip); Dom.addClass(this.element, Tooltip.CSS_TOOLTIP); if (userConfig) { this.cfg.applyConfig(userConfig, true); } this.cfg.queueProperty("visible", false); this.cfg.queueProperty("constraintoviewport", true); this.setBody(""); this.subscribe("changeContent", setWidthToOffsetWidth); this.subscribe("init", onInit); this.subscribe("render", this.onRender); this.initEvent.fire(Tooltip); }
javascript
{ "resource": "" }
q29836
train
function () { Tooltip.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired when user mouses over a context element. Returning false from * a subscriber to this event will prevent the tooltip from being displayed for * the current context element. * * @event contextMouseOverEvent * @param {HTMLElement} context The context element which the user just moused over * @param {DOMEvent} e The DOM event object, associated with the mouse over */ this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER); this.contextMouseOverEvent.signature = SIGNATURE; /** * CustomEvent fired when the user mouses out of a context element. * * @event contextMouseOutEvent * @param {HTMLElement} context The context element which the user just moused out of * @param {DOMEvent} e The DOM event object, associated with the mouse out */ this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT); this.contextMouseOutEvent.signature = SIGNATURE; /** * CustomEvent fired just before the tooltip is displayed for the current context. * <p> * You can subscribe to this event if you need to set up the text for the * tooltip based on the context element for which it is about to be displayed. * </p> * <p>This event differs from the beforeShow event in following respects:</p> * <ol> * <li> * When moving from one context element to another, if the tooltip is not * hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not * be fired when the tooltip is displayed for the new context since it is already visible. * However the contextTrigger event is always fired before displaying the tooltip for * a new context. * </li> * <li> * The trigger event provides access to the context element, allowing you to * set the text of the tooltip based on context element for which the tooltip is * triggered. * </li> * </ol> * <p> * It is not possible to prevent the tooltip from being displayed * using this event. You can use the contextMouseOverEvent if you need to prevent * the tooltip from being displayed. * </p> * @event contextTriggerEvent * @param {HTMLElement} context The context element for which the tooltip is triggered */ this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER); this.contextTriggerEvent.signature = SIGNATURE; }
javascript
{ "resource": "" }
q29837
train
function (type, args, obj) { var container = args[0]; if (typeof container == 'string') { this.cfg.setProperty("container", document.getElementById(container), true); } }
javascript
{ "resource": "" }
q29838
train
function (e, obj) { var context = this; if (context.title) { obj._tempTitle = context.title; context.title = ""; } // Fire first, to honor disabled set in the listner if (obj.fireEvent("contextMouseOver", context, e) !== false && !obj.cfg.getProperty("disabled")) { // Stop the tooltip from being hidden (set on last mouseout) if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } Event.on(context, "mousemove", obj.onContextMouseMove, obj); /** * The unique process ID associated with the thread responsible * for showing the Tooltip. * @type int */ obj.showProcId = obj.doShow(e, context); } }
javascript
{ "resource": "" }
q29839
train
function (e, obj) { var el = this; if (obj._tempTitle) { el.title = obj._tempTitle; obj._tempTitle = null; } if (obj.showProcId) { clearTimeout(obj.showProcId); obj.showProcId = null; } if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } obj.fireEvent("contextMouseOut", el, e); obj.hideProcId = setTimeout(function () { obj.hide(); }, obj.cfg.getProperty("hidedelay")); }
javascript
{ "resource": "" }
q29840
train
function() { var e = document.createElement("button"); e.style.height = "1px"; e.style.width = "1px"; e.style.position = "absolute"; e.style.left = "-10000em"; e.style.opacity = 0; e.tabIndex = -1; this.innerElement.appendChild(e); this._modalFocus = e; }
javascript
{ "resource": "" }
q29841
train
function (type, args, obj) { var el = this.lastElement; if (args && args[1]) { Event.stopEvent(args[1]); } if (el) { try { el.focus(); } catch(err) { // Ignore } } }
javascript
{ "resource": "" }
q29842
train
function(root) { root = root || this.innerElement; var focusable = {}; for (var i = 0; i < Panel.FOCUSABLE.length; i++) { focusable[Panel.FOCUSABLE[i]] = true; } function isFocusable(el) { if (el.focus && el.type !== "hidden" && !el.disabled && focusable[el.tagName.toLowerCase()]) { return true; } return false; } // Not looking by Tag, since we want elements in DOM order return Dom.getElementsBy(isFocusable, null, root); }
javascript
{ "resource": "" }
q29843
train
function() { this.firstElement = null; this.lastElement = null; var elements = this.getFocusableElements(); this.focusableElements = elements; if (elements.length > 0) { this.firstElement = elements[0]; this.lastElement = elements[elements.length - 1]; } if (this.cfg.getProperty("modal")) { this.setTabLoop(this.firstElement, this.lastElement); } }
javascript
{ "resource": "" }
q29844
train
function (type, args, obj) { var val = args[0]; if (val) { if (!Util.DD) { this.cfg.setProperty("draggable", false); return; } if (this.header) { Dom.setStyle(this.header, "cursor", "move"); this.registerDragDrop(); } this.subscribe("beforeShow", setWidthToOffsetWidth); } else { if (this.dd) { this.dd.unreg(); } if (this.header) { Dom.setStyle(this.header,"cursor","auto"); } this.unsubscribe("beforeShow", setWidthToOffsetWidth); } }
javascript
{ "resource": "" }
q29845
train
function (type, args, obj) { var modal = args[0]; if (modal) { if (!this._hasModalityEventListeners) { this.subscribe("beforeShow", this.buildMask); this.subscribe("beforeShow", this.bringToTop); this.subscribe("beforeShow", this.showMask); this.subscribe("hide", this.hideMask); Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true); this._hasModalityEventListeners = true; } } else { if (this._hasModalityEventListeners) { if (this.cfg.getProperty("visible")) { this.hideMask(); this.removeMask(); } this.unsubscribe("beforeShow", this.buildMask); this.unsubscribe("beforeShow", this.bringToTop); this.unsubscribe("beforeShow", this.showMask); this.unsubscribe("hide", this.hideMask); Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this); this._hasModalityEventListeners = false; } } }
javascript
{ "resource": "" }
q29846
train
function () { var oMask = this.mask, oParentNode; if (oMask) { /* Hide the mask before destroying it to ensure that DOM event handlers on focusable elements get removed. */ this.hideMask(); oParentNode = oMask.parentNode; if (oParentNode) { oParentNode.removeChild(oMask); } this.mask = null; } }
javascript
{ "resource": "" }
q29847
train
function (type, args, obj) { var listeners = args[0], listener, nListeners, i; if (listeners) { if (listeners instanceof Array) { nListeners = listeners.length; for (i = 0; i < nListeners; i++) { listener = listeners[i]; if (!Config.alreadySubscribed(this.showEvent, listener.enable, listener)) { this.showEvent.subscribe(listener.enable, listener, true); } if (!Config.alreadySubscribed(this.hideEvent, listener.disable, listener)) { this.hideEvent.subscribe(listener.disable, listener, true); this.destroyEvent.subscribe(listener.disable, listener, true); } } } else { if (!Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) { this.showEvent.subscribe(listeners.enable, listeners, true); } if (!Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) { this.hideEvent.subscribe(listeners.disable, listeners, true); this.destroyEvent.subscribe(listeners.disable, listeners, true); } } } }
javascript
{ "resource": "" }
q29848
train
function(type, args, obj) { var val = Lang.merge(DEFAULT_CONFIG.STRINGS.value, args[0]); this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key, val, true); }
javascript
{ "resource": "" }
q29849
train
function(type, args, el) { Panel.superclass._autoFillOnHeightChange.apply(this, arguments); if (bIEQuirks) { var panel = this; setTimeout(function() { panel.sizeUnderlay(); },0); } }
javascript
{ "resource": "" }
q29850
train
function () { var oUnderlay = this.underlay, oElement; if (oUnderlay) { oElement = this.element; oUnderlay.style.width = oElement.offsetWidth + "px"; oUnderlay.style.height = oElement.offsetHeight + "px"; } }
javascript
{ "resource": "" }
q29851
train
function () { var oMask = this.mask; if (!oMask) { if (!m_oMaskTemplate) { m_oMaskTemplate = document.createElement("div"); m_oMaskTemplate.className = "mask"; m_oMaskTemplate.innerHTML = "&#160;"; } oMask = m_oMaskTemplate.cloneNode(true); oMask.id = this.id + "_mask"; document.body.insertBefore(oMask, document.body.firstChild); this.mask = oMask; if (YAHOO.env.ua.gecko && this.platform == "mac") { Dom.addClass(this.mask, "block-scrollbars"); } // Stack mask based on the element zindex this.stackMask(); } }
javascript
{ "resource": "" }
q29852
train
function () { if (this.mask) { // Shrink mask first, so it doesn't affect the document size. var mask = this.mask, viewWidth = Dom.getViewportWidth(), viewHeight = Dom.getViewportHeight(); if (mask.offsetHeight > viewHeight) { mask.style.height = viewHeight + "px"; } if (mask.offsetWidth > viewWidth) { mask.style.width = viewWidth + "px"; } // Then size it to the document mask.style.height = Dom.getDocumentHeight() + "px"; mask.style.width = Dom.getDocumentWidth() + "px"; } }
javascript
{ "resource": "" }
q29853
train
function() { if (this.mask) { var panelZ = Dom.getStyle(this.element, "zIndex"); if (!YAHOO.lang.isUndefined(panelZ) && !isNaN(panelZ)) { Dom.setStyle(this.mask, "zIndex", panelZ - 1); } } }
javascript
{ "resource": "" }
q29854
train
function () { Dialog.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired prior to submission * @event beforeSubmitEvent */ this.beforeSubmitEvent = this.createEvent(EVENT_TYPES.BEFORE_SUBMIT); this.beforeSubmitEvent.signature = SIGNATURE; /** * CustomEvent fired after submission * @event submitEvent */ this.submitEvent = this.createEvent(EVENT_TYPES.SUBMIT); this.submitEvent.signature = SIGNATURE; /** * CustomEvent fired for manual submission, before the generic submit event is fired * @event manualSubmitEvent */ this.manualSubmitEvent = this.createEvent(EVENT_TYPES.MANUAL_SUBMIT); this.manualSubmitEvent.signature = SIGNATURE; /** * CustomEvent fired after asynchronous submission, before the generic submit event is fired * * @event asyncSubmitEvent * @param {Object} conn The connection object, returned by YAHOO.util.Connect.asyncRequest */ this.asyncSubmitEvent = this.createEvent(EVENT_TYPES.ASYNC_SUBMIT); this.asyncSubmitEvent.signature = SIGNATURE; /** * CustomEvent fired after form-based submission, before the generic submit event is fired * @event formSubmitEvent */ this.formSubmitEvent = this.createEvent(EVENT_TYPES.FORM_SUBMIT); this.formSubmitEvent.signature = SIGNATURE; /** * CustomEvent fired after cancel * @event cancelEvent */ this.cancelEvent = this.createEvent(EVENT_TYPES.CANCEL); this.cancelEvent.signature = SIGNATURE; }
javascript
{ "resource": "" }
q29855
train
function (el, userConfig) { /* Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level */ Dialog.superclass.init.call(this, el/*, userConfig*/); this.beforeInitEvent.fire(Dialog); Dom.addClass(this.element, Dialog.CSS_DIALOG); this.cfg.setProperty("visible", false); if (userConfig) { this.cfg.applyConfig(userConfig, true); } this.showEvent.subscribe(this.focusFirst, this, true); this.beforeHideEvent.subscribe(this.blurButtons, this, true); this.subscribe("changeBody", this.registerForm); this.initEvent.fire(Dialog); }
javascript
{ "resource": "" }
q29856
train
function() { var form = this.element.getElementsByTagName("form")[0]; if (this.form) { if (this.form == form && Dom.isAncestor(this.element, this.form)) { return; } else { Event.purgeElement(this.form); this.form = null; } } if (!form) { form = document.createElement("form"); form.name = "frm_" + this.id; this.body.appendChild(form); } if (form) { this.form = form; Event.on(form, "submit", this._submitHandler, this, true); } }
javascript
{ "resource": "" }
q29857
train
function() { Dialog.superclass.setFirstLastFocusable.call(this); var i, l, el, elements = this.focusableElements; this.firstFormElement = null; this.lastFormElement = null; if (this.form && elements && elements.length > 0) { l = elements.length; for (i = 0; i < l; ++i) { el = elements[i]; if (this.form === el.form) { this.firstFormElement = el; break; } } for (i = l-1; i >= 0; --i) { el = elements[i]; if (this.form === el.form) { this.lastFormElement = el; break; } } } }
javascript
{ "resource": "" }
q29858
train
function (type, args, obj) { var aButtons = this.cfg.getProperty("buttons"), el = this.lastFormElement; if (args && args[1]) { Event.stopEvent(args[1]); } if (aButtons && Lang.isArray(aButtons)) { this.focusLastButton(); } else { if (el) { try { el.focus(); } catch(oException) { // Ignore } } } }
javascript
{ "resource": "" }
q29859
train
function(button) { var Button = YAHOO.widget.Button; // If we have an HTML button and YUI Button is on the page, // get the YUI Button reference if available. if (Button && button && button.nodeName && button.id) { button = Button.getButton(button.id) || button; } return button; }
javascript
{ "resource": "" }
q29860
train
function () { var aButtons = this.cfg.getProperty("buttons"), oButton, oElement; if (aButtons && Lang.isArray(aButtons)) { oButton = aButtons[0]; if (oButton) { oElement = this._getButton(oButton.htmlButton); if (oElement) { /* Place the call to the "focus" method inside a try/catch block to prevent IE from throwing JavaScript errors if the element is disabled or hidden. */ try { oElement.focus(); } catch(oException) { // ignore } } } } }
javascript
{ "resource": "" }
q29861
train
function () { if (this.validate()) { if (this.beforeSubmitEvent.fire()) { this.doSubmit(); this.submitEvent.fire(); if (this.cfg.getProperty("hideaftersubmit")) { this.hide(); } return true; } else { return false; } } else { return false; } }
javascript
{ "resource": "" }
q29862
train
function () { var oForm = this.form, aElements, nTotalElements, oData, sName, oElement, nElements, sType, sTagName, aOptions, nOptions, aValues, oOption, oRadio, oCheckbox, valueAttr, i, n; function isFormElement(p_oElement) { var sTag = p_oElement.tagName.toUpperCase(); return ((sTag == "INPUT" || sTag == "TEXTAREA" || sTag == "SELECT") && p_oElement.name == sName); } if (oForm) { aElements = oForm.elements; nTotalElements = aElements.length; oData = {}; for (i = 0; i < nTotalElements; i++) { sName = aElements[i].name; /* Using "Dom.getElementsBy" to safeguard user from JS errors that result from giving a form field (or set of fields) the same name as a native method of a form (like "submit") or a DOM collection (such as the "item" method). Originally tried accessing fields via the "namedItem" method of the "element" collection, but discovered that it won't return a collection of fields in Gecko. */ oElement = Dom.getElementsBy(isFormElement, "*", oForm); nElements = oElement.length; if (nElements > 0) { if (nElements == 1) { oElement = oElement[0]; sType = oElement.type; sTagName = oElement.tagName.toUpperCase(); switch (sTagName) { case "INPUT": if (sType == "checkbox") { oData[sName] = oElement.checked; } else if (sType != "radio") { oData[sName] = oElement.value; } break; case "TEXTAREA": oData[sName] = oElement.value; break; case "SELECT": aOptions = oElement.options; nOptions = aOptions.length; aValues = []; for (n = 0; n < nOptions; n++) { oOption = aOptions[n]; if (oOption.selected) { valueAttr = oOption.attributes.value; aValues[aValues.length] = (valueAttr && valueAttr.specified) ? oOption.value : oOption.text; } } oData[sName] = aValues; break; } } else { sType = oElement[0].type; switch (sType) { case "radio": for (n = 0; n < nElements; n++) { oRadio = oElement[n]; if (oRadio.checked) { oData[sName] = oRadio.value; break; } } break; case "checkbox": aValues = []; for (n = 0; n < nElements; n++) { oCheckbox = oElement[n]; if (oCheckbox.checked) { aValues[aValues.length] = oCheckbox.value; } } oData[sName] = aValues; break; } } } } } return oData; }
javascript
{ "resource": "" }
q29863
train
function (el, userConfig) { /* Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level */ SimpleDialog.superclass.init.call(this, el/*, userConfig*/); this.beforeInitEvent.fire(SimpleDialog); Dom.addClass(this.element, SimpleDialog.CSS_SIMPLEDIALOG); this.cfg.queueProperty("postmethod", "manual"); if (userConfig) { this.cfg.applyConfig(userConfig, true); } this.beforeRenderEvent.subscribe(function () { if (! this.body) { this.setBody(""); } }, this, true); this.initEvent.fire(SimpleDialog); }
javascript
{ "resource": "" }
q29864
train
function (type,args,obj) { var text = args[0]; if (text) { this.setBody(text); this.cfg.refireEvent("icon"); } }
javascript
{ "resource": "" }
q29865
train
function(val, sendUpdatedEvt) { // don't always rewrite the value to able selections with Ctrl+A var uppered = val.toUpperCase(); if(uppered != this.getValue()) { inputEx.UpperCaseField.superclass.setValue.call(this, uppered, sendUpdatedEvt); } }
javascript
{ "resource": "" }
q29866
train
function(e) { inputEx.UpperCaseField.superclass.onKeyPress.call(this,e); // Re-Apply a toUpperCase method YAHOO.lang.later(0,this,function() {this.setValue( (this.getValue()) );}); }
javascript
{ "resource": "" }
q29867
train
function(el, oAttr) { el = YUD.get(el); // some sensible defaults oAttr = oAttr || {}; if(!el) { el = document.createElement(this.CONFIG.TAG_NAME); } if (el.id) {oAttr.id = el.id; } YAHOO.widget.AccordionView.superclass.constructor.call(this, el, oAttr); this.initList(el, oAttr); // This refresh forces all defaults to be set this.refresh(['id', 'width','hoverActivated'],true); }
javascript
{ "resource": "" }
q29868
train
function (oAttr) { AccordionView.superclass.initAttributes.call(this, oAttr); var bAnimate = (YAHOO.env.modules.animation) ? true : false; this.setAttributeConfig('id', { writeOnce: true, validator: function (value) { return (/^[a-zA-Z][\w0-9\-_.:]*$/.test(value)); }, value: YUD.generateId(), method: function (value) { this.get('element').id = value; } }); this.setAttributeConfig('width', { value: '400px', method: function (value) { this.setStyle('width', value); } } ); this.setAttributeConfig('animationSpeed', { value: 0.7 } ); this.setAttributeConfig('animate', { value: bAnimate, validator: YAHOO.lang.isBoolean } ); this.setAttributeConfig('collapsible', { value: false, validator: YAHOO.lang.isBoolean } ); this.setAttributeConfig('expandable', { value: false, validator: YAHOO.lang.isBoolean } ); this.setAttributeConfig('effect', { value: YAHOO.util.Easing.easeBoth, validator: YAHOO.lang.isString } ); this.setAttributeConfig('hoverActivated', { value: false, validator: YAHOO.lang.isBoolean, method: function (value) { if (value) { YUE.on(this, 'mouseover', this._onMouseOver, this, true); } else { YUE.removeListener(this, 'mouseover', this._onMouseOver); } } }); this.setAttributeConfig('_hoverTimeout', { value: 500, validator: YAHOO.lang.isInteger } ); }
javascript
{ "resource": "" }
q29869
train
function() { if(true === this.get('hoverActivated')) { this.on('mouseover', this._onMouseOver, this, true); this.on('mouseout', this._onMouseOut, this, true); } this.on('click', this._onClick, this, true); this.on('keydown', this._onKeydown, this, true); // set this._opening and this._closing before open/close operations begin this.on('panelOpen', function(){this._opening = true;}, this, true); this.on('panelClose', function(){this._closing = true;}, this, true); // This makes sure that this._fixTabindexes is called after a change has // fully completed this.on('afterPanelClose', function(){ this._closing = false; if(!this._closing && !this._opening) { this._fixTabIndexes(); } }, this, true); this.on('afterPanelOpen', function(){ this._opening = false; if(!this._closing && !this._opening) { this._fixTabIndexes(); } }, this, true); /* This is needed when the hrefs are removed from links to be able to still hit enter to follow the link We only do this when we have ARIA support */ if(this._ARIACapable) { this.on('keypress', function(ev){ var eCurrentPanel = YUD.getAncestorByClassName(YUE.getTarget(ev), this.CLASSES.PANEL); var keyCode = YUE.getCharCode(ev); if(keyCode === 13) { this._onClick(eCurrentPanel.firstChild); return false; } }); } }
javascript
{ "resource": "" }
q29870
train
function() { YUD.batch(this._panels, function(e) { var elContent = this.firstChild.nextSibling; if(elContent) { YUD.removeClass(e.firstChild, this.CLASSES.ACTIVE); YUD.addClass(elContent, this.CLASSES.HIDDEN); this._setARIA(elContent, 'aria-hidden', 'true'); } }, this); }
javascript
{ "resource": "" }
q29871
train
function() { var aLength = this._panels.length; var bAllClosed = true; for(var i=0;i<aLength;i++) { if(YUD.hasClass(this._panels[i].firstChild, this.CLASSES.ACTIVE)) { this._panels[i].firstChild.tabIndex = 0; bAllClosed = false; } else { this._panels[i].firstChild.tabIndex = -1; } } if(bAllClosed) { this._panels[0].firstChild.tabIndex = 0; } // now everything is done so we can fire the stateChanged event this.fireEvent(stateChangedEvent); }
javascript
{ "resource": "" }
q29872
train
function(index) { this.removeChild(YUD.getElementsByClassName(this.CLASSES.PANEL, this.CONFIG.ITEM_WRAPPER_TAG_NAME, this)[index]); var aNewPanels = []; var nLength = this._panels.length; for(var i=0;i<nLength;i++) { if(i !== index) { aNewPanels.push(this._panels[i]); } } this._panels = aNewPanels; var t= YAHOO.lang.later(0, this, function(){this._fixTabIndexes();this.fireEvent(stateChangedEvent);}); }
javascript
{ "resource": "" }
q29873
train
function(nIndex) { var ePanelNode = this._panels[nIndex]; if(!ePanelNode) {return false;} // invalid node if(YUD.hasClass(ePanelNode.firstChild, this.CLASSES.ACTIVE)) {return false;} // already open this._onClick(ePanelNode.firstChild); return true; }
javascript
{ "resource": "" }
q29874
train
function(ev) { var eCurrentPanel = YUD.getAncestorByClassName(YUE.getTarget(ev), this.CLASSES.PANEL); var nKeyCode = YUE.getCharCode(ev); var nLength = this._panels.length; if(nKeyCode === 37 || nKeyCode === 38) { for(var i=0;i<nLength;i++) { if((eCurrentPanel === this._panels[i]) && i>0) { this._panels[i-1].firstChild.focus(); return; } } } if(nKeyCode === 39 || nKeyCode === 40) { for(var i=0;i<nLength;i++) { if((eCurrentPanel === this._panels[i]) && i<nLength-1) { this._panels[i+1].firstChild.focus(); return; } } } }
javascript
{ "resource": "" }
q29875
train
function(ev) { YUE.stopPropagation(ev); // must provide the TARGET or IE will destroy the event before we can // use it. Thanks Nicholas Zakas for pointing this out to me var target = YUE.getTarget(ev); this._hoverTimer = YAHOO.lang.later(this.get('_hoverTimeout'), this, function(){ this._onClick(target); }); }
javascript
{ "resource": "" }
q29876
train
function(el) { var id, nodes, c, i, len, attr; if (el) { if (el[NODE_TYPE] || el.item) { // Node, or NodeList return el; } if (typeof el === 'string') { // id id = el; el = document.getElementById(el); attr = (el) ? el.attributes : null; if (el && attr && attr.id && attr.id.value === id) { // IE: avoid false match on "name" attribute return el; } else if (el && document.all) { // filter by name el = null; nodes = document.all[id]; for (i = 0, len = nodes.length; i < len; ++i) { if (nodes[i].id === id) { return nodes[i]; } } } return el; } if (YAHOO.util.Element && el instanceof YAHOO.util.Element) { el = el.get('element'); } if ('length' in el) { // array-like c = []; for (i = 0, len = el.length; i < len; ++i) { c[c.length] = Y.Dom.get(el[i]); } return c; } return el; // some other object, just pass it back } return null; }
javascript
{ "resource": "" }
q29877
train
function(el, property) { return Y.Dom.batch(el, Y.Dom._getStyle, property); }
javascript
{ "resource": "" }
q29878
train
function(el, property, val) { Y.Dom.batch(el, Y.Dom._setStyle, { prop: property, val: val }); }
javascript
{ "resource": "" }
q29879
train
function(el, className) { return Y.Dom.batch(el, Y.Dom._hasClass, className); }
javascript
{ "resource": "" }
q29880
train
function(el, className) { return Y.Dom.batch(el, Y.Dom._addClass, className); }
javascript
{ "resource": "" }
q29881
train
function(el, className) { return Y.Dom.batch(el, Y.Dom._removeClass, className); }
javascript
{ "resource": "" }
q29882
train
function(el, oldClassName, newClassName) { return Y.Dom.batch(el, Y.Dom._replaceClass, { from: oldClassName, to: newClassName }); }
javascript
{ "resource": "" }
q29883
train
function(el, prefix) { prefix = prefix || 'yui-gen'; var f = function(el) { if (el && el.id) { // do not override existing ID YAHOO.log('generateId returning existing id ' + el.id, 'info', 'Dom'); return el.id; } var id = prefix + YAHOO.env._id_counter++; YAHOO.log('generateId generating ' + id, 'info', 'Dom'); if (el) { if (el[OWNER_DOCUMENT] && el[OWNER_DOCUMENT].getElementById(id)) { // in case one already exists // use failed id plus prefix to help ensure uniqueness return Y.Dom.generateId(el, id + prefix); } el.id = id; } return id; }; // batch fails when no element, so just generate and return single ID return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments); }
javascript
{ "resource": "" }
q29884
train
function(haystack, needle) { haystack = Y.Dom.get(haystack); needle = Y.Dom.get(needle); var ret = false; if ( (haystack && needle) && (haystack[NODE_TYPE] && needle[NODE_TYPE]) ) { if (haystack.contains && haystack !== needle) { // contains returns true when equal ret = haystack.contains(needle); } else if (haystack.compareDocumentPosition) { // gecko ret = !!(haystack.compareDocumentPosition(needle) & 16); } } else { YAHOO.log('isAncestor failed; invalid input: ' + haystack + ',' + needle, 'error', 'Dom'); } YAHOO.log('isAncestor(' + haystack + ',' + needle + ' returning ' + ret, 'info', 'Dom'); return ret; }
javascript
{ "resource": "" }
q29885
train
function(el, doc) { return Y.Dom._inDoc(Y.Dom.get(el), doc); }
javascript
{ "resource": "" }
q29886
train
function(method, tag, root) { return Y.Dom.getElementsBy(method, tag, root, null, null, null, true); }
javascript
{ "resource": "" }
q29887
train
function() { var height = self.innerHeight, // Safari, Opera mode = document[COMPAT_MODE]; if ( (mode || isIE) && !isOpera ) { // IE, Gecko height = (mode == CSS1_COMPAT) ? documentElement.clientHeight : // Standards document.body.clientHeight; // Quirks } YAHOO.log('getViewportHeight returning ' + height, 'info', 'Dom'); return height; }
javascript
{ "resource": "" }
q29888
train
function(node, method) { while (node) { node = node.previousSibling; if ( Y.Dom._testElement(node, method) ) { return node; } } return null; }
javascript
{ "resource": "" }
q29889
train
function(node, method) { while (node) { node = node.nextSibling; if ( Y.Dom._testElement(node, method) ) { return node; } } return null; }
javascript
{ "resource": "" }
q29890
train
function(node, method) { var child = ( Y.Dom._testElement(node.firstChild, method) ) ? node.firstChild : null; return child || Y.Dom.getNextSiblingBy(node.firstChild, method); }
javascript
{ "resource": "" }
q29891
train
function(node, method) { if (!node) { YAHOO.log('getLastChild failed: invalid node argument', 'error', 'Dom'); return null; } var child = ( Y.Dom._testElement(node.lastChild, method) ) ? node.lastChild : null; return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method); }
javascript
{ "resource": "" }
q29892
train
function(node) { node = Y.Dom.get(node); return Y.Dom.getLastChildBy(node); }
javascript
{ "resource": "" }
q29893
train
function(node, method) { var child = Y.Dom.getFirstChildBy(node, method), children = child ? [child] : []; Y.Dom.getNextSiblingBy(child, function(node) { if ( !method || method(node) ) { children[children.length] = node; } return false; // fail test to collect all children }); return children; }
javascript
{ "resource": "" }
q29894
train
function(doc) { doc = doc || document; return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft); }
javascript
{ "resource": "" }
q29895
train
function(doc) { doc = doc || document; return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop); }
javascript
{ "resource": "" }
q29896
train
function() { var t = Y.Dom.getDocumentScrollTop(), l = Y.Dom.getDocumentScrollLeft(), r = Y.Dom.getViewportWidth() + l, b = Y.Dom.getViewportHeight() + t; return new Y.Region(t, r, b, l); }
javascript
{ "resource": "" }
q29897
train
function(oData) { var date = null; //Convert to date if(!(oData instanceof Date)) { date = new Date(oData); } else { return oData; } // Validate if(date instanceof Date) { return date; } else { YAHOO.log("Could not convert data " + lang.dump(oData) + " to type Date", "warn", this.toString()); return null; } }
javascript
{ "resource": "" }
q29898
train
function(nMsec, oRequest, oCallback, oCaller) { if(lang.isNumber(nMsec) && (nMsec >= 0)) { YAHOO.log("Enabling polling to live data for \"" + oRequest + "\" at interval " + nMsec, "info", this.toString()); var oSelf = this; var nId = setInterval(function() { oSelf.makeConnection(oRequest, oCallback, oCaller); }, nMsec); this._aIntervals.push(nId); return nId; } else { YAHOO.log("Could not enable polling to live data for \"" + oRequest + "\" at interval " + nMsec, "info", this.toString()); } }
javascript
{ "resource": "" }
q29899
train
function(nId) { // Remove from tracker if there var tracker = this._aIntervals || []; for(var i=tracker.length-1; i>-1; i--) { if(tracker[i] === nId) { tracker.splice(i,1); clearInterval(nId); } } }
javascript
{ "resource": "" }