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

@ -14,8 +14,18 @@
* @param checked {boolean} The initial checked/unchecked state
*/
YAHOO.widget.TaskNode = function(oData, oParent, expanded, checked) {
YAHOO.widget.TaskNode.superclass.constructor.call(this,oData,oParent,expanded);
this.setUpCheck(checked || oData.checked);
if (YAHOO.widget.LogWriter) {
this.logger = new YAHOO.widget.LogWriter(this.toString());
} else {
this.logger = YAHOO;
}
if (oData) {
this.init(oData, oParent, expanded);
this.setUpLabel(oData);
this.setUpCheck(checked);
}
};
@ -35,19 +45,10 @@ YAHOO.extend(YAHOO.widget.TaskNode, YAHOO.widget.TextNode, {
*/
checkState: 0,
/**
* The node type
* @property _type
* @private
* @type string
* @default "TextNode"
*/
_type: "TaskNode",
taskNodeParentChange: function() {
taskNodeParentChange: function() {
//this.updateParent();
},
setUpCheck: function(checked) {
// if this node is checked by default, run the check code to update
// the parent's display state
@ -75,10 +76,8 @@ YAHOO.extend(YAHOO.widget.TaskNode, YAHOO.widget.TextNode, {
this.tree.createEvent("checkClick", this.tree);
}
this.tree.subscribe('clickEvent',this.checkClick);
this.subscribe("parentChange", this.taskNodeParentChange);
},
/**
@ -106,25 +105,28 @@ YAHOO.extend(YAHOO.widget.TaskNode, YAHOO.widget.TextNode, {
return "ygtvcheck" + this.checkState;
},
/**
* Returns the link that will invoke this node's check toggle
* @return {string} returns the link required to adjust the checkbox state
*/
getCheckLink: function() {
return "YAHOO.widget.TreeView.getNode(\'" + this.tree.id + "\'," +
this.index + ").checkClick()";
},
/**
/**
* Invoked when the user clicks the check box
*/
checkClick: function(oArgs) {
var node = oArgs.node;
var target = YAHOO.util.Event.getTarget(oArgs.event);
if (YAHOO.util.Dom.hasClass(target,'ygtvspacer')) {
node.logger.log("previous checkstate: " + node.checkState);
if (node.checkState === 0) {
node.check();
} else {
node.uncheck();
}
checkClick: function() {
this.logger.log("previous checkstate: " + this.checkState);
if (this.checkState === 0) {
this.check();
} else {
this.uncheck();
}
node.onCheckClick(node);
this.fireEvent("checkClick", node);
return false;
}
this.onCheckClick(this);
this.tree.fireEvent("checkClick", this);
},
/**
@ -225,46 +227,83 @@ YAHOO.extend(YAHOO.widget.TaskNode, YAHOO.widget.TextNode, {
this.updateCheckHtml();
this.updateParent();
},
// Overrides YAHOO.widget.TextNode
/*
getContentHtml: function() {
// Overrides YAHOO.widget.TextNode
getNodeHtml: function() {
this.logger.log("Generating html");
var sb = [];
var getNode = 'YAHOO.widget.TreeView.getNode(\'' +
this.tree.id + '\',' + this.index + ')';
sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';
sb[sb.length] = '<tr>';
for (var i=0;i<this.depth;++i) {
//sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '">&#160;</td>';
sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';
}
sb[sb.length] = '<td';
sb[sb.length] = ' id="' + this.getToggleElId() + '"';
sb[sb.length] = ' class="' + this.getStyle() + '"';
if (this.hasChildren(true)) {
sb[sb.length] = ' onmouseover="this.className=';
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';
sb[sb.length] = this.tree.id + '\',' + this.index + ').getHoverStyle()"';
sb[sb.length] = ' onmouseout="this.className=';
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';
sb[sb.length] = this.tree.id + '\',' + this.index + ').getStyle()"';
}
//sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">&#160;';
sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';
//sb[sb.length] = '</td>';
sb[sb.length] = '<div class="ygtvspacer"></div></td>';
// check box
sb[sb.length] = '<td';
sb[sb.length] = ' id="' + this.getCheckElId() + '"';
sb[sb.length] = ' class="' + this.getCheckStyle() + '"';
sb[sb.length] = '>';
sb[sb.length] = ' onclick="javascript:' + this.getCheckLink() + '">';
//sb[sb.length] = '&#160;</td>';
sb[sb.length] = '<div class="ygtvspacer"></div></td>';
sb[sb.length] = '<span';
sb[sb.length] = '<td>';
sb[sb.length] = '<a';
sb[sb.length] = ' id="' + this.labelElId + '"';
if (this.title) {
sb[sb.length] = ' title="' + this.title + '"';
}
sb[sb.length] = ' class="' + this.labelStyle + '"';
sb[sb.length] = ' class="' + this.labelStyle + '"';
sb[sb.length] = ' href="' + this.href + '"';
sb[sb.length] = ' target="' + this.target + '"';
sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';
if (this.hasChildren(true)) {
sb[sb.length] = ' onmouseover="document.getElementById(\'';
sb[sb.length] = this.getToggleElId() + '\').className=';
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';
sb[sb.length] = this.tree.id + '\',' + this.index + ').getHoverStyle()"';
sb[sb.length] = ' onmouseout="document.getElementById(\'';
sb[sb.length] = this.getToggleElId() + '\').className=';
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';
sb[sb.length] = this.tree.id + '\',' + this.index + ').getStyle()"';
}
sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';
sb[sb.length] = ' >';
sb[sb.length] = this.label;
sb[sb.length] = '</span>';
sb[sb.length] = '</a>';
sb[sb.length] = '</td>';
sb[sb.length] = '</tr>';
sb[sb.length] = '</table>';
return sb.join("");
},
toString: function() {
return "TaskNode (" + this.index + ") " + this.label;
}
*/
getContentHtml: function() {
var sb = [];
sb[sb.length] = '<td';
sb[sb.length] = ' id="' + this.getCheckElId() + '"';
sb[sb.length] = ' class="' + this.getCheckStyle() + '"';
sb[sb.length] = '>';
sb[sb.length] = '<div class="ygtvspacer"></div></td>';
sb[sb.length] = '<td><span';
sb[sb.length] = ' id="' + this.labelElId + '"';
if (this.title) {
sb[sb.length] = ' title="' + this.title + '"';
}
sb[sb.length] = ' class="' + this.labelStyle + '"';
sb[sb.length] = ' >';
sb[sb.length] = this.label;
sb[sb.length] = '</span></td>';
return sb.join("");
}
});

View file

@ -1,150 +1,150 @@
/*
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
The global object JSON contains two methods.
JSON.stringify(value) takes a JavaScript value and produces a JSON text.
The value must not be cyclical.
JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
throw a 'JSONError' exception if there is an error.
*/
var JSON = {
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html',
/*
Stringify a JavaScript value, producing a JSON text.
*/
stringify: function (v) {
var a = [];
/*
Emit a string.
*/
function e(s) {
a[a.length] = s;
}
/*
Convert a value.
*/
function g(x) {
var c, i, l, v;
switch (typeof x) {
case 'object':
if (x) {
if (x instanceof Array) {
e('[');
l = a.length;
for (i = 0; i < x.length; i += 1) {
v = x[i];
if (typeof v != 'undefined' &&
typeof v != 'function') {
if (l < a.length) {
e(',');
}
g(v);
}
}
e(']');
return;
} else if (typeof x.valueOf == 'function') {
e('{');
l = a.length;
for (i in x) {
v = x[i];
if (typeof v != 'undefined' &&
typeof v != 'function' &&
(!v || typeof v != 'object' ||
typeof v.valueOf == 'function')) {
if (l < a.length) {
e(',');
}
g(i);
e(':');
g(v);
}
}
return e('}');
}
}
e('null');
return;
case 'number':
e(isFinite(x) ? +x : 'null');
return;
case 'string':
l = x.length;
e('"');
for (i = 0; i < l; i += 1) {
c = x.charAt(i);
if (c >= ' ') {
if (c == '\\' || c == '"') {
e('\\');
}
e(c);
} else {
switch (c) {
case '\b':
e('\\b');
break;
case '\f':
e('\\f');
break;
case '\n':
e('\\n');
break;
case '\r':
e('\\r');
break;
case '\t':
e('\\t');
break;
default:
c = c.charCodeAt();
e('\\u00' + Math.floor(c / 16).toString(16) +
(c % 16).toString(16));
}
}
}
e('"');
return;
case 'boolean':
e(String(x));
return;
default:
e('null');
return;
}
}
g(v);
return a.join('');
},
/*
Parse a JSON text, producing a JavaScript value.
*/
parse: function (text) {
return (/^(\s+|[,:{}\[\]]|"(\\["\\\/bfnrtu]|[^\x00-\x1f"\\]+)*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)+$/.test(text)) &&
eval('(' + text + ')');
}
};
/*
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
The global object JSON contains two methods.
JSON.stringify(value) takes a JavaScript value and produces a JSON text.
The value must not be cyclical.
JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
throw a 'JSONError' exception if there is an error.
*/
var JSON = {
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html',
/*
Stringify a JavaScript value, producing a JSON text.
*/
stringify: function (v) {
var a = [];
/*
Emit a string.
*/
function e(s) {
a[a.length] = s;
}
/*
Convert a value.
*/
function g(x) {
var c, i, l, v;
switch (typeof x) {
case 'object':
if (x) {
if (x instanceof Array) {
e('[');
l = a.length;
for (i = 0; i < x.length; i += 1) {
v = x[i];
if (typeof v != 'undefined' &&
typeof v != 'function') {
if (l < a.length) {
e(',');
}
g(v);
}
}
e(']');
return;
} else if (typeof x.valueOf == 'function') {
e('{');
l = a.length;
for (i in x) {
v = x[i];
if (typeof v != 'undefined' &&
typeof v != 'function' &&
(!v || typeof v != 'object' ||
typeof v.valueOf == 'function')) {
if (l < a.length) {
e(',');
}
g(i);
e(':');
g(v);
}
}
return e('}');
}
}
e('null');
return;
case 'number':
e(isFinite(x) ? +x : 'null');
return;
case 'string':
l = x.length;
e('"');
for (i = 0; i < l; i += 1) {
c = x.charAt(i);
if (c >= ' ') {
if (c == '\\' || c == '"') {
e('\\');
}
e(c);
} else {
switch (c) {
case '\b':
e('\\b');
break;
case '\f':
e('\\f');
break;
case '\n':
e('\\n');
break;
case '\r':
e('\\r');
break;
case '\t':
e('\\t');
break;
default:
c = c.charCodeAt();
e('\\u00' + Math.floor(c / 16).toString(16) +
(c % 16).toString(16));
}
}
}
e('"');
return;
case 'boolean':
e(String(x));
return;
default:
e('null');
return;
}
}
g(v);
return a.join('');
},
/*
Parse a JSON text, producing a JavaScript value.
*/
parse: function (text) {
return (/^(\s+|[,:{}\[\]]|"(\\["\\\/bfnrtu]|[^\x00-\x1f"\\]+)*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)+$/.test(text)) &&
eval('(' + text + ')');
}
};