Controlgroup: Add missing entry to demos bootstrap

This commit is contained in:
Alexander Schmitz 2015-08-09 00:30:34 -04:00
parent de1296b985
commit a00c02513d
9 changed files with 23 additions and 131 deletions

View File

@ -4,23 +4,13 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>jQuery UI Controlgroup - Default Functionality</title> <title>jQuery UI Controlgroup - Default Functionality</title>
<link rel="stylesheet" href="../../themes/base/all.css"> <link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/checkboxradio.js"></script>
<script src="../../ui/menu.js"></script>
<script src="../../ui/position.js"></script>
<script src="../../ui/selectmenu.js"></script>
<script src="../../ui/controlgroup.js"></script>
<link rel="stylesheet" href="../demos.css"> <link rel="stylesheet" href="../demos.css">
<script> <script src="../../external/requirejs/require.js"></script>
$(function() { <script src="../bootstrap.js">
$( ".controlgroup" ).controlgroup() $( ".controlgroup" ).controlgroup()
$( ".controlgroup-vertical" ).controlgroup({ $( ".controlgroup-vertical" ).controlgroup({
"direction": "vertical" "direction": "vertical"
}); });
});
</script> </script>
<style> <style>
.ui-controlgroup-vertical { .ui-controlgroup-vertical {

View File

@ -4,18 +4,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>jQuery UI Controlgroup - Split Button</title> <title>jQuery UI Controlgroup - Split Button</title>
<link rel="stylesheet" href="../../themes/base/all.css"> <link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/checkboxradio.js"></script>
<script src="../../ui/menu.js"></script>
<script src="../../ui/position.js"></script>
<script src="../../ui/selectmenu.js"></script>
<script src="../../ui/controlgroup.js"></script>
<link rel="stylesheet" href="../demos.css"> <link rel="stylesheet" href="../demos.css">
<script> <script src="../../external/requirejs/require.js"></script>
$(function() { <script src="../bootstrap.js" data-modules="button checkboxradio selectmenu">
$( "select" ).selectmenu({ $( "select" ).selectmenu({
classes: { classes: {
"ui-selectmenu-button": "ui-button-icon-only" "ui-selectmenu-button": "ui-button-icon-only"
@ -28,7 +19,6 @@
$( "button" ).click(function() { $( "button" ).click(function() {
$( ".output" ).append( "<li>Running Last Action...</li>" ); $( ".output" ).append( "<li>Running Last Action...</li>" );
}); });
});
</script> </script>
</head> </head>
<body> <body>

View File

@ -4,18 +4,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>jQuery UI Controlgroup - Toolbar</title> <title>jQuery UI Controlgroup - Toolbar</title>
<link rel="stylesheet" href="../../themes/base/all.css"> <link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/checkboxradio.js"></script>
<script src="../../ui/menu.js"></script>
<script src="../../ui/position.js"></script>
<script src="../../ui/selectmenu.js"></script>
<script src="../../ui/controlgroup.js"></script>
<link rel="stylesheet" href="../demos.css"> <link rel="stylesheet" href="../demos.css">
<script> <script src="../../external/requirejs/require.js"></script>
$(function() { <script src="../bootstrap.js" data-modules="button checkboxradio selectmenu">
var iframe = $( "<iframe id='display' contenteditable='true'>" ), var iframe = $( "<iframe id='display' contenteditable='true'>" ),
contents = iframe.appendTo( "body" ); contents = iframe.appendTo( "body" );
@ -54,7 +45,6 @@
return false; return false;
}); });
}); });
});
</script> </script>
<style> <style>
#zoom, #fontsize { #zoom, #fontsize {

View File

@ -1,9 +1,9 @@
define( [ define( [
"lib/common", "lib/common",
"ui/controlgroup", "ui/widgets/controlgroup",
"ui/checkboxradio", "ui/widgets/checkboxradio",
"ui/selectmenu", "ui/widgets/selectmenu",
"ui/button" "ui/widgets/button"
], function( common ) { ], function( common ) {
common.testWidget( "controlgroup", { common.testWidget( "controlgroup", {

View File

@ -1,77 +0,0 @@
module( "Controlgroup: Core" );
function hasCornerClass( element ) {
return !!element.attr( "class" ).match( /ui-corner/g );
}
test( "selectmenu: open/close corners", function( assert ) {
expect( 1 );
var element = $( ".controlgroup" ).controlgroup(),
selects = element.find( "select" ),
selectButton = selects.eq( 0 ).selectmenu( "widget" );
expect( 12 );
selects.eq( 0 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-tl",
"Horizontal: First selectmenu gets ui-corner-tl when opened" );
selects.eq( 0 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-left",
"Horizontal: First selectmenu gets ui-corner-left when closed" );
selectButton = selects.eq( 1 ).selectmenu( "widget" );
selects.eq( 1 ).selectmenu( "open" );
strictEqual( hasCornerClass( selectButton ), false,
"Horizontal: Middle selectmenu does not get corner class when opened" );
selects.eq( 1 ).selectmenu( "close" );
strictEqual( hasCornerClass( selectButton ), false,
"Horizontal: Middle selectmenu does not get corner class when closed" );
selectButton = selects.eq( 2 ).selectmenu( "widget" );
selects.eq( 2 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-tr",
"Horizontal: Last selectmenu gets ui-corner-tr when opened" );
selects.eq( 2 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-right",
"Horizontal: Last selectmenu gets ui-corner-right when closed" );
element.controlgroup( "option", "direction", "vertical" );
selectButton = selects.eq( 0 ).selectmenu( "widget" );
selects.eq( 0 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-top",
"vertical: First selectmenu gets ui-corner-top when opened" );
selects.eq( 0 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-top",
"vertical: First selectmenu gets ui-corner-top when closed" );
selectButton = selects.eq( 1 ).selectmenu( "widget" );
selects.eq( 1 ).selectmenu( "open" );
strictEqual( hasCornerClass( selectButton ), false,
"vertical: Middle selectmenu does not get corner class when opened" );
selects.eq( 1 ).selectmenu( "close" );
strictEqual( hasCornerClass( selectButton ), false,
"vertical: Middle selectmenu does not get corner class when closed" );
selectButton = selects.eq( 2 ).selectmenu( "widget" );
selects.eq( 2 ).selectmenu( "open" );
strictEqual( hasCornerClass( selectButton ), false,
"vertical: Last selectmenu does not get corner class when opened" );
selects.eq( 2 ).selectmenu( "close" );
assert.hasClasses( selectButton, "ui-corner-bottom",
"vertical: Last selectmenu gets ui-corner-bottom when closed" );
});
test( "invisibles excluded from corner classes", function( assert ) {
expect( 2 );
var element = $( ".controlgroup" ).controlgroup(),
buttons = element.children( ".ui-button" );
strictEqual( hasCornerClass( buttons.eq( 0 ) ), false,
"ExcludeInvisible: true: Hidden first element does not get a corner class" );
assert.hasClasses( buttons.eq( 1 ), "ui-corner-left",
"ExcludeInvisible: true: First button is hidden second button get corner class" );
});

View File

@ -1,9 +1,9 @@
define( [ define( [
"jquery", "jquery",
"ui/controlgroup", "ui/widgets/controlgroup",
"ui/checkboxradio", "ui/widgets/checkboxradio",
"ui/selectmenu", "ui/widgets/selectmenu",
"ui/button" "ui/widgets/button"
], function( $ ) { ], function( $ ) {
module( "Controlgroup: Core" ); module( "Controlgroup: Core" );

View File

@ -1,9 +1,9 @@
define( [ define( [
"jquery", "jquery",
"ui/controlgroup", "ui/widgets/controlgroup",
"ui/checkboxradio", "ui/widgets/checkboxradio",
"ui/selectmenu", "ui/widgets/selectmenu",
"ui/button" "ui/widgets/button"
], function( $ ) { ], function( $ ) {
module( "Controlgroup: methods" ); module( "Controlgroup: methods" );

View File

@ -1,9 +1,9 @@
define( [ define( [
"jquery", "jquery",
"ui/controlgroup", "ui/widgets/controlgroup",
"ui/checkboxradio", "ui/widgets/checkboxradio",
"ui/selectmenu", "ui/widgets/selectmenu",
"ui/button" "ui/widgets/button"
], function( $ ) { ], function( $ ) {
module( "Controlgroup: options" ); module( "Controlgroup: options" );

View File

@ -14,8 +14,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./core", "../widget"
"./widget"
], factory ); ], factory );
} else { } else {