2011-04-04 14:11:19 +00:00
|
|
|
<!doctype html>
|
2011-03-26 19:00:39 +00:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2011-04-04 14:11:19 +00:00
|
|
|
<meta charset="utf-8">
|
2011-03-26 19:00:39 +00:00
|
|
|
<title>jQuery UI Tabs Test Suite</title>
|
|
|
|
|
2011-04-04 14:11:19 +00:00
|
|
|
<link rel="stylesheet" href="../../../themes/base/jquery.ui.tabs.css">
|
2011-03-26 19:00:39 +00:00
|
|
|
|
2011-07-25 15:46:45 +00:00
|
|
|
<script src="../../../jquery-1.6.2.js"></script>
|
2011-04-04 14:11:19 +00:00
|
|
|
<script src="../../../external/jquery.cookie.js"></script>
|
|
|
|
<script src="../../../ui/jquery.ui.core.js"></script>
|
|
|
|
<script src="../../../ui/jquery.ui.widget.js"></script>
|
|
|
|
<script src="../../../ui/jquery.ui.tabs.js"></script>
|
2011-03-26 19:00:39 +00:00
|
|
|
|
2011-04-04 14:11:19 +00:00
|
|
|
<link rel="stylesheet" href="../../../external/qunit.css">
|
|
|
|
<script src="../../../external/qunit.js"></script>
|
|
|
|
<script src="../../jquery.simulate.js"></script>
|
|
|
|
<script src="../testsuite.js"></script>
|
|
|
|
|
|
|
|
<script src="tabs_defaults_deprecated.js"></script>
|
|
|
|
<script src="tabs_core.js"></script>
|
|
|
|
<script src="tabs_events.js"></script>
|
|
|
|
<script src="tabs_methods.js"></script>
|
|
|
|
<script src="tabs_options.js"></script>
|
|
|
|
<script src="tabs_deprecated.js"></script>
|
|
|
|
|
2011-04-04 15:22:32 +00:00
|
|
|
<script>
|
|
|
|
function tabs_state( tabs ) {
|
|
|
|
var expected = $.makeArray( arguments ).slice( 1 );
|
|
|
|
var actual = tabs.find( ".ui-tabs-nav li" ).map(function() {
|
2011-04-15 12:53:05 +00:00
|
|
|
var tab = $( this ),
|
|
|
|
panel = $( $.ui.tabs.prototype._sanitizeSelector(
|
|
|
|
"#" + tab.find( "a" ).attr( "aria-controls" ) ) ),
|
|
|
|
tabIsActive = tab.hasClass( "ui-state-active" ),
|
2011-04-29 01:35:04 +00:00
|
|
|
panelIsActive = panel.css( "display" ) !== "none";
|
2011-04-15 12:53:05 +00:00
|
|
|
|
|
|
|
if ( tabIsActive && panelIsActive ) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if ( !tabIsActive && !panelIsActive ) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -1; // mixed state - invalid
|
2011-04-04 15:22:32 +00:00
|
|
|
}).get();
|
|
|
|
same( actual, expected );
|
|
|
|
}
|
2011-04-28 16:04:08 +00:00
|
|
|
|
|
|
|
function tabs_disabled( tabs, state ) {
|
|
|
|
var expected = $.map( new Array( tabs.find ( ".ui-tabs-nav li" ).length ), function( _, index ) {
|
|
|
|
if ( typeof state === "boolean" ) {
|
|
|
|
return state ? 1 : 0;
|
|
|
|
} else {
|
|
|
|
return $.inArray( index, state ) !== -1 ? 1 : 0;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var internalState = tabs.tabs( "option", "disabled" );
|
|
|
|
if ( internalState === false ) {
|
|
|
|
internalState = [];
|
|
|
|
}
|
|
|
|
if ( internalState === true ) {
|
|
|
|
internalState = $.map( new Array( tabs.find( ".ui-tabs-nav li" ).length ), function( _, index ) {
|
|
|
|
return index;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var actual = tabs.find( ".ui-tabs-nav li" ).map(function( index ) {
|
|
|
|
var tab = $( this ),
|
|
|
|
tabIsDisabled = tab.hasClass( "ui-state-disabled" );
|
|
|
|
|
|
|
|
if ( tabIsDisabled && $.inArray( index, internalState ) !== -1 ) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if ( !tabIsDisabled && $.inArray( index, internalState ) === -1 ) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -1; // mixed state - invalid
|
|
|
|
}).get();
|
|
|
|
same( tabs.tabs( "option", "disabled" ), state );
|
|
|
|
same( actual, expected );
|
|
|
|
}
|
2011-04-04 15:22:32 +00:00
|
|
|
</script>
|
2011-04-04 14:11:19 +00:00
|
|
|
<script src="../swarminject.js"></script>
|
2011-03-26 19:00:39 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2011-04-04 14:11:19 +00:00
|
|
|
<h1 id="qunit-header">jQuery UI Tabs Test Suite</h1>
|
2011-03-26 19:00:39 +00:00
|
|
|
<h2 id="qunit-banner"></h2>
|
|
|
|
<div id="qunit-testrunner-toolbar"></div>
|
|
|
|
<h2 id="qunit-userAgent"></h2>
|
2011-04-04 14:11:19 +00:00
|
|
|
<ol id="qunit-tests"></ol>
|
2011-03-26 19:00:39 +00:00
|
|
|
<div id="qunit-fixture">
|
|
|
|
|
2011-04-04 14:11:19 +00:00
|
|
|
<div id="tabs1">
|
|
|
|
<ul>
|
|
|
|
<li><a href="#fragment-1"><span>1</span></a></li>
|
|
|
|
<li><a href="#fragment-2"><span>2</span></a></li>
|
|
|
|
<li><a href="#fragment-3"><span>3</span></a></li>
|
|
|
|
</ul>
|
|
|
|
<div id="fragment-1"></div>
|
|
|
|
<div id="fragment-2"></div>
|
|
|
|
<div id="fragment-3"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs2">
|
|
|
|
<ul>
|
|
|
|
<li><a href="#colon:test"><span>1</span></a></li>
|
|
|
|
<li><a href="#inline-style"><span>2</span></a></li>
|
|
|
|
<li><a href="data/test.html#test"><span>3</span></a></li>
|
2011-04-07 17:53:20 +00:00
|
|
|
<li><a href="data/test.html" aria-controls="custom-id"><span>4</span></a></li>
|
|
|
|
<li><a href="data/test.html" title="∫ßáö Սե"><span>5</span></a></li>
|
2011-04-04 14:11:19 +00:00
|
|
|
</ul>
|
|
|
|
<div id="colon:test"></div>
|
|
|
|
<div style="height: 300px;" id="inline-style"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs3">
|
|
|
|
<div>
|
|
|
|
<ul id="tabs3-list">
|
|
|
|
<li><a href="#tabs3-1">1</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs4">
|
|
|
|
<ul id="tabs4-list">
|
|
|
|
<li><a href="#tabs4-1">1</a></li>
|
|
|
|
</ul>
|
|
|
|
<ol>
|
|
|
|
<li><a href="#tabs4-1">1</a></li>
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs4a">
|
|
|
|
<ol id="tabs4a-list">
|
|
|
|
<li><a href="#tabs4a-1">1</a></li>
|
|
|
|
</ol>
|
|
|
|
<ul>
|
|
|
|
<li><a href="#tabs4a-1">1</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs5">
|
|
|
|
<div>
|
|
|
|
<ul id="tabs5-list"></ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs6">
|
|
|
|
<ul id="tabs6-list">
|
|
|
|
<li><a href="#tabs6-1">1</a>
|
2011-03-26 19:00:39 +00:00
|
|
|
<ul>
|
2011-04-04 14:11:19 +00:00
|
|
|
<li><a href="#item6-3">3</a></li>
|
|
|
|
<li><a href="#item6-4">4</a></li>
|
2011-03-26 19:00:39 +00:00
|
|
|
</ul>
|
2011-04-04 14:11:19 +00:00
|
|
|
</li>
|
|
|
|
<li><a href="#tabs6-2">2</a></li>
|
|
|
|
</ul>
|
|
|
|
<div id="tabs6-1"></div>
|
|
|
|
<div id="tabs6-2"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tabs7">
|
|
|
|
<ul id="tabs7-list">
|
|
|
|
<li><a href="#tabs7-1">1</a></li>
|
|
|
|
<li><a href="#tabs7-2">2</a></li>
|
|
|
|
</ul>
|
|
|
|
<div id="tabs7-2"></div>
|
|
|
|
<div id="tabs7-1"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2011-03-26 19:00:39 +00:00
|
|
|
</body>
|
|
|
|
</html>
|