upgrade to yui 2.5.1

This commit is contained in:
JT Smith 2008-03-25 16:13:25 +00:00
parent e00050ad1c
commit ff7d72becc
1632 changed files with 812103 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using addClass</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using addClass</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>addClass</code> method to add the class <code>baz</code> to the element.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo" class="bar">foo</div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var addClass = function(e) {
YAHOO.util.Dom.addClass('foo', 'baz');
alert(YAHOO.util.Dom.get('foo').className);
};
YAHOO.util.Event.on('demo-run', 'click', addClass);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,73 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using getElementsByClassName</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using getElementsByClassName</h1>
<div class="exampleIntro">
<p>Clicking the document will use Dom's <code>getElementsByClassName</code> method to collect all of the elements with the class <code>bar</code> applied.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div class="bar">div class="bar"</div>
<div class="bar-baz">div class="bar-baz"</div>
<div class="bar ">div class="bar "</div>
<div class=" bar ">div class=" bar "</div>
<div class="bar baz">div class=" bar baz"</div>
<div class="bar2 baz">div class=" bar2 baz"</div>
<div class="foo">div class="foo"</div>
<div class="foo" id="bar">div class="foo" id="bar"</div>
<div class="foo bar baz">div class="foo bar baz"</div>
<p class="bar">p class="bar"</p>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var getByClass = function(e) {
alert('found: ' + YAHOO.util.Dom.getElementsByClassName('bar', 'div').length + ' elements');
};
YAHOO.util.Event.on('demo-run', 'click', getByClass);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,77 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using getStyle</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
background-color:#00f;
height:10px;
width:10px;
}
#bar {
width:100px;
height:100px;
background-color:#f00;
margin:0 0 1em 100px;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using getStyle</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>getStyle</code> method to get the background color of the red element and pass it to the <code>setStyle</code> method, which will set the blue element's background to the same color.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo"></div>
<div id="bar"></div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var setBgColor = function() {
var bgcolor = YAHOO.util.Dom.getStyle('bar', 'backgroundColor');
YAHOO.util.Dom.setStyle('foo', 'backgroundColor', bgcolor);
};
YAHOO.util.Event.on('demo-run', 'click', setBgColor);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,77 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using getXY</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
background-color:#00f;
height:10px;
width:10px;
}
#bar {
background-color:#f00;
height:100px;
width:100px;
margin:0 100px 1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using getXY</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>getXY</code> method to get the position of the red element and pass it to the <code>setXY</code> method, which will move the blue element to that position.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo"></div>
<div id="bar"></div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var move = function() {
var xy = YAHOO.util.Dom.getXY('bar');
YAHOO.util.Dom.setXY('foo', xy);
};
YAHOO.util.Event.on('demo-run', 'click', move);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,66 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using hasClass</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using hasClass</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>hasClass</code> method to test if the element has the class <code>baz</code> applied.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo" class="bar baz">foo</div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var testClass = function(e) {
alert(YAHOO.util.Dom.hasClass('foo', 'baz'));
};
YAHOO.util.Event.on('demo-run', 'click', testClass);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using removeClass</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using removeClass</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>removeClass</code> method to remove the class <code>baz</code> from the element.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo" class="bar baz">foo</div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var removeClass = function(e) {
YAHOO.util.Dom.removeClass('foo', 'baz');
alert(YAHOO.util.Dom.get('foo').className);
};
YAHOO.util.Event.on('demo-run', 'click', removeClass);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,70 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using setStyle</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#foo {
background-color:#00f;
color:#fff;
height:100px;
width:100px;
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using setStyle</h1>
<div class="exampleIntro">
<p>Clicking the button will use Dom's <code>setStyle</code> method to set the opacity of the element.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<div id="foo">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
<button id="demo-run">run</button>
<script type="text/javascript">
(function() {
var fade = function() {
YAHOO.util.Dom.setStyle('foo', 'opacity', 0.5);
};
YAHOO.util.Event.on('demo-run', 'click', fade);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Using setXY</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<!--begin custom header content for this example-->
<style type="text/css">
#demo {
background-color:#00f;
height:10px;
width:10px;
margin-bottom:1em;
}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Using setXY</h1>
<div class="exampleIntro">
<p>Clicking the document will use Dom's <code>setXY</code> method to position the element to the click point.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<style type="text/css">
#foo {width:10px; height:10px;background-color:#00f;}
</style>
<div id="foo"></div>
<script>
(function() {
var move = function(e) {
YAHOO.util.Dom.setXY('foo', YAHOO.util.Event.getXY(e));
};
YAHOO.util.Event.on(document, "click", move);
YAHOO.log("The example has finished loading; as you interact with it, you'll see log messages appearing here.", "info", "example");
})();
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>

File diff suppressed because one or more lines are too long