Find file
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (77 sloc) 3.76 KB
<title>YUI: YAHOO.Tools</title>
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" href="" type="text/css">
<link rel="stylesheet" type="text/css" href="">
<style type="text/css" media="screen">
p, h2 {
margin: 1em;
#demo {
height: 100px;
width: 100px;
border: 1px solid black;
background-color: #ccc;
<body class="yui-skin-sam">
<div id="davdoc" class="yui-t7">
<div id="hd"><h1 id="header"><a href="">YUI: YAHOO.Tools</a></h1></div>
<div id="bd">
<div id="demo"></div>
<div id="ft">&nbsp;</div>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script src=""></script>
<script type="text/javascript" src="tools.js"></script>
<script type="text/javascript" src="../js/davglass.js"></script>
<script type="text/javascript">
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event,
Tool = YAHOO.tool,
Suite = new Tool.TestSuite('yuisuite'),
Assert = YAHOO.util.Assert;
Event.onDOMReady(function() {
var logger = new Tool.TestLogger(null, { height: '80%' });
Suite.add( new Tool.TestCase({
name: 'YAHOO.Tools',
test_clipStyle: function() {
YAHOO.Tools.clipStyle('demo', 'backgroundColor', 'blue');
Assert.areEqual(Dom.get('demo')._style._backgroundColor, 'rgb(204, 204, 204)', 'Could not find the clipped style');
YAHOO.Tools.unclipStyle('demo', 'backgroundColor');
Assert.areEqual(Dom.getStyle('demo', 'backgroundColor'), 'rgb(204, 204, 204)', 'Could not find the clipped style');
Assert.areEqual(Dom.get('editor_container'), editor.get('element_cont').get('element'), 'Could not find Editors container');
Assert.areEqual(Dom.get('editor_toolbar'), editor.toolbar.get('element'), 'Could not find Editors Toolbar');
Assert.isInstanceOf(YAHOO.widget.Toolbar, editor.toolbar, 'Could not find Toolbars Instance');
Assert.areEqual(Dom.getStyle('editor', 'display'), editor.getStyle('display'), 'Textarea is visible..');
Assert.isInstanceOf(YAHOO.widget.Overlay, editor.get('panel'), 'Could not find Overlay Instance');
test_content: function() {
var t_data = Dom.get('editor').value;
var e_data = editor.getEditorHTML();
Assert.areEqual(t_data, e_data, 'Editor data is different than text area');
if (parent && parent != window) {
} else {;