update YUI to 2.8.0r4

This commit is contained in:
Graham Knop 2009-09-21 12:54:44 -05:00
parent 27f474ec64
commit 2d28e0c0ba
2007 changed files with 344487 additions and 210070 deletions

View file

@ -1,8 +1,8 @@
/*
Copyright (c) 2008, 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.6.0
version: 2.8.0r4
*/
/**
* Provides a mechanism to fetch remote resources and
@ -87,15 +87,20 @@ YAHOO.util.Get = function() {
* @return {HTMLElement} the generated node
* @private
*/
var _linkNode = function(url, win, charset) {
var c = charset || "utf-8";
return _node("link", {
"id": "yui__dyn_" + (nidx++),
"type": "text/css",
"charset": c,
"rel": "stylesheet",
"href": url
}, win);
var _linkNode = function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/css",
rel: "stylesheet",
href: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("link", o, win);
};
/**
@ -106,14 +111,18 @@ YAHOO.util.Get = function() {
* @return {HTMLElement} the generated node
* @private
*/
var _scriptNode = function(url, win, charset) {
var c = charset || "utf-8";
return _node("script", {
"id": "yui__dyn_" + (nidx++),
"type": "text/javascript",
"charset": c,
"src": url
}, win);
var _scriptNode = function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/javascript",
src: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("script", o, win);
};
/**
@ -196,7 +205,7 @@ YAHOO.util.Get = function() {
YAHOO.log("Timeout " + id, "info", "get");
var q = queues[id];
if (q.onTimeout) {
var sc=q.context || q;
var sc=q.scope || q;
q.onTimeout.call(sc, _returnData(q));
}
};
@ -252,7 +261,7 @@ YAHOO.util.Get = function() {
// arbitrary timeout. It is possible that the browser does
// block subsequent script execution in this case for a limited
// time.
var extra = _scriptNode(null, q.win, q.charset);
var extra = _scriptNode(null, q.win, q.attributes);
extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
q.nodes.push(extra); h.appendChild(extra);
@ -281,9 +290,9 @@ YAHOO.util.Get = function() {
}
if (q.type === "script") {
n = _scriptNode(url, w, q.charset);
n = _scriptNode(url, w, q.attributes);
} else {
n = _linkNode(url, w, q.charset);
n = _linkNode(url, w, q.attributes);
}
// track this node's load progress
@ -342,20 +351,33 @@ YAHOO.util.Get = function() {
* @private
*/
var _purge = function(tId) {
var q=queues[tId];
if (q) {
var n=q.nodes, l=n.length, d=q.win.document,
h=d.getElementsByTagName("head")[0];
if (queues[tId]) {
var q = queues[tId],
nodes = q.nodes,
l = nodes.length,
d = q.win.document,
h = d.getElementsByTagName("head")[0],
sib, i, node, attr;
if (q.insertBefore) {
var s = _get(q.insertBefore, tId);
if (s) {
h = s.parentNode;
sib = _get(q.insertBefore, tId);
if (sib) {
h = sib.parentNode;
}
}
for (var i=0; i<l; i=i+1) {
h.removeChild(n[i]);
for (i=0; i<l; i=i+1) {
node = nodes[i];
if (node.clearAttributes) {
node.clearAttributes();
} else {
for (attr in node) {
delete node[attr];
}
}
h.removeChild(node);
}
q.nodes = [];
@ -395,6 +417,11 @@ YAHOO.util.Get = function() {
q.autopurge = ("autopurge" in q) ? q.autopurge :
(type === "script") ? true : false;
if (opts.charset) {
q.attributes = q.attributes || {};
q.attributes.charset = opts.charset;
}
lang.later(0, q, _next, id);
return {
@ -654,14 +681,16 @@ YAHOO.util.Get = function() {
* <dd>node or node id that will become the new node's nextSibling</dd>
* </dl>
* <dt>charset</dt>
* <dd>Node charset, default utf-8</dd>
* <dd>Node charset, deprecated, use 'attributes'</dd>
* <dt>attributes</dt>
* <dd>A hash of attributes to apply to dynamic nodes.</dd>
* <dt>timeout</dt>
* <dd>Number of milliseconds to wait before aborting and firing the timeout event</dd>
* <pre>
* // assumes yahoo, dom, and event are already on the page
* &nbsp;&nbsp;YAHOO.util.Get.script(
* &nbsp;&nbsp;["http://yui.yahooapis.com/2.3.1/build/dragdrop/dragdrop-min.js",
* &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"], &#123;
* &nbsp;&nbsp;["http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js",
* &nbsp;&nbsp;&nbsp;"http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js"], &#123;
* &nbsp;&nbsp;&nbsp;&nbsp;onSuccess: function(o) &#123;
* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YAHOO.log(o.data); // foo
* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
@ -722,14 +751,16 @@ YAHOO.util.Get = function() {
* <dt>insertBefore</dt>
* <dd>node or node id that will become the new node's nextSibling</dd>
* <dt>charset</dt>
* <dd>Node charset, default utf-8</dd>
* <dd>Node charset, deprecated, use 'attributes'</dd>
* <dt>attributes</dt>
* <dd>A hash of attributes to apply to dynamic nodes.</dd>
* </dl>
* <pre>
* YAHOO.util.Get.css("http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css");
* YAHOO.util.Get.css("http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css");
* </pre>
* <pre>
* YAHOO.util.Get.css(["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
* "http://yui.yahooapis.com/2.3.1/build/logger/assets/skins/sam/logger.css"]);
* YAHOO.util.Get.css(["http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css",
* "http://yui.yahooapis.com/2.7.0/build/logger/assets/skins/sam/logger.css"]);
* </pre>
* @return {tId: string} an object containing info about the transaction
*/
@ -739,4 +770,4 @@ YAHOO.util.Get = function() {
};
}();
YAHOO.register("get", YAHOO.util.Get, {version: "2.6.0", build: "1321"});
YAHOO.register("get", YAHOO.util.Get, {version: "2.8.0r4", build: "2449"});