Index: openacs-4/packages/ajaxhelper/www/resources/yui/container/container_core.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/resources/yui/container/container_core.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ajaxhelper/www/resources/yui/container/container_core.js 8 Sep 2007 14:22:02 -0000 1.3 +++ openacs-4/packages/ajaxhelper/www/resources/yui/container/container_core.js 9 Apr 2009 17:03:49 -0000 1.4 @@ -1,8 +1,8 @@ /* -Copyright (c) 2007, Yahoo! Inc. All rights reserved. +Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt -version: 2.3.0 +version: 2.7.0 */ (function () { @@ -18,26 +18,20 @@ * @param {Object} owner The owner Object to which this Config Object belongs */ YAHOO.util.Config = function (owner) { - + if (owner) { - this.init(owner); - } - - if (!owner) { - - - } - + + }; var Lang = YAHOO.lang, - CustomEvent = YAHOO.util.CustomEvent, + CustomEvent = YAHOO.util.CustomEvent, Config = YAHOO.util.Config; - + /** * Constant representing the CustomEvent type for the config changed event. * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT @@ -203,16 +197,19 @@ getConfig: function () { var cfg = {}, + currCfg = this.config, prop, property; - for (prop in this.config) { - property = this.config[prop]; - if (property && property.event) { - cfg[prop] = property.value; + for (prop in currCfg) { + if (Lang.hasOwnProperty(currCfg, prop)) { + property = currCfg[prop]; + if (property && property.event) { + cfg[prop] = property.value; + } } } - + return cfg; }, @@ -353,7 +350,7 @@ if (queueItem) { queueItemKey = queueItem[0]; queueItemValue = queueItem[1]; - + if (queueItemKey == key) { /* @@ -381,37 +378,37 @@ } if (property.supercedes) { - + sLen = property.supercedes.length; - + for (s = 0; s < sLen; s++) { - + supercedesCheck = property.supercedes[s]; qLen = this.eventQueue.length; - + for (q = 0; q < qLen; q++) { queueItemCheck = this.eventQueue[q]; - + if (queueItemCheck) { queueItemCheckKey = queueItemCheck[0]; queueItemCheckValue = queueItemCheck[1]; - + if (queueItemCheckKey == supercedesCheck.toLowerCase() ) { - + this.eventQueue.push([queueItemCheckKey, queueItemCheckValue]); - + this.eventQueue[q] = null; break; - + } } } } } - + return true; } else { return false; @@ -460,37 +457,23 @@ applyConfig: function (userConfig, init) { var sKey, - oValue, oConfig; if (init) { - oConfig = {}; - for (sKey in userConfig) { - if (Lang.hasOwnProperty(userConfig, sKey)) { - oConfig[sKey.toLowerCase()] = userConfig[sKey]; - } - } - this.initialConfig = oConfig; - } for (sKey in userConfig) { - if (Lang.hasOwnProperty(userConfig, sKey)) { - this.queueProperty(sKey, userConfig[sKey]); - } - } - }, /** @@ -499,11 +482,13 @@ * @method refresh */ refresh: function () { - + var prop; - + for (prop in this.config) { - this.refireEvent(prop); + if (Lang.hasOwnProperty(this.config, prop)) { + this.refireEvent(prop); + } } }, @@ -527,9 +512,14 @@ key = queueItem[0]; value = queueItem[1]; property = this.config[key]; - + property.value = value; - + + // Clear out queue entry, to avoid it being + // re-added to the queue by any queueProperty/supercedes + // calls which are invoked during fireEvent + this.eventQueue[i] = null; + this.fireEvent(key,value); } } @@ -557,19 +547,12 @@ var property = this.config[key.toLowerCase()]; if (property && property.event) { - if (!Config.alreadySubscribed(property.event, handler, obj)) { - property.event.subscribe(handler, obj, override); - } - return true; - } else { - return false; - } }, @@ -689,31 +672,24 @@ i; if (nSubscribers > 0) { - i = nSubscribers - 1; - do { - subsc = evt.subscribers[i]; - if (subsc && subsc.obj == obj && subsc.fn == fn) { - return true; - - } - + } } while (i--); - } - + return false; - + }; - + YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider); }()); + (function () { /** @@ -746,25 +722,19 @@ * documentation for more details. */ YAHOO.widget.Module = function (el, userConfig) { - if (el) { - this.init(el, userConfig); - } else { - - } - }; - var Dom = YAHOO.util.Dom, Config = YAHOO.util.Config, Event = YAHOO.util.Event, CustomEvent = YAHOO.util.CustomEvent, Module = YAHOO.widget.Module, - + UA = YAHOO.env.ua, + m_oModuleTemplate, m_oHeaderTemplate, m_oBodyTemplate, @@ -778,7 +748,6 @@ * @type Object */ EVENT_TYPES = { - "BEFORE_INIT": "beforeInit", "INIT": "init", "APPEND": "append", @@ -793,7 +762,6 @@ "SHOW": "show", "BEFORE_HIDE": "beforeHide", "HIDE": "hide" - }, /** @@ -810,21 +778,24 @@ value: true, validator: YAHOO.lang.isBoolean }, - - "EFFECT": { - key: "effect", - suppressEvent: true, - supercedes: ["visible"] + + "EFFECT": { + key: "effect", + suppressEvent: true, + supercedes: ["visible"] }, - - "MONITOR_RESIZE": { - key: "monitorresize", - value: true + + "MONITOR_RESIZE": { + key: "monitorresize", + value: true + }, + + "APPEND_TO_DOCUMENT_BODY": { + key: "appendtodocumentbody", + value: false } - }; - /** * Constant representing the prefix path to use for non-secure images * @property YAHOO.widget.Module.IMG_ROOT @@ -860,7 +831,7 @@ * @type String */ Module.CSS_HEADER = "hd"; - + /** * Constant representing the module body * @property YAHOO.widget.Module.CSS_BODY @@ -888,20 +859,46 @@ * @type String */ Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;"; - + /** + * Constant representing the buffer amount (in pixels) to use when positioning + * the text resize monitor offscreen. The resize monitor is positioned + * offscreen by an amount eqaul to its offsetHeight + the buffer value. + * + * @property YAHOO.widget.Module.RESIZE_MONITOR_BUFFER + * @static + * @type Number + */ + // Set to 1, to work around pixel offset in IE8, which increases when zoom is used + Module.RESIZE_MONITOR_BUFFER = 1; + + /** * Singleton CustomEvent fired when the font size is changed in the browser. * Opera's "zoom" functionality currently does not support text * size detection. * @event YAHOO.widget.Module.textResizeEvent */ Module.textResizeEvent = new CustomEvent("textResize"); + /** + * Helper utility method, which forces a document level + * redraw for Opera, which can help remove repaint + * irregularities after applying DOM changes. + * + * @method YAHOO.widget.Module.forceDocumentRedraw + * @static + */ + Module.forceDocumentRedraw = function() { + var docEl = document.documentElement; + if (docEl) { + docEl.className += " "; + docEl.className = YAHOO.lang.trim(docEl.className); + } + }; function createModuleTemplate() { if (!m_oModuleTemplate) { - m_oModuleTemplate = document.createElement("div"); m_oModuleTemplate.innerHTML = ("