diff options
| author | James Friend <[email protected]> | 2014-08-28 09:32:08 +0800 |
|---|---|---|
| committer | James Friend <[email protected]> | 2014-08-28 09:32:08 +0800 |
| commit | 9aeaf19b1dca68ee71e916ae415a0c270a47d301 (patch) | |
| tree | bc8385acb8ec7a46bba03ff2ef7e4283cd9f1146 /docs/_includes | |
| parent | e7991a9a1e2f474c8f1d8a2e0ed113816f1c5e82 (diff) | |
| parent | 35f09315ed543a0479719afa2143240952c215db (diff) | |
| download | bootstrap-9aeaf19b1dca68ee71e916ae415a0c270a47d301.tar.xz bootstrap-9aeaf19b1dca68ee71e916ae415a0c270a47d301.zip | |
Merge remote-tracking branch 'upstream/master' into node-requirable
Conflicts:
Gruntfile.js
Diffstat (limited to 'docs/_includes')
36 files changed, 687 insertions, 480 deletions
diff --git a/docs/_includes/components/alerts.html b/docs/_includes/components/alerts.html index f0895b0ed..bdb88517b 100644 --- a/docs/_includes/components/alerts.html +++ b/docs/_includes/components/alerts.html @@ -1,7 +1,7 @@ <div class="bs-docs-section"> <h1 id="alerts" class="page-header">Alerts</h1> - <p class="lead">Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. For inline dismissal, use the <a href="../javascript/#alerts">alerts jQuery plugin</a>.</p> + <p class="lead">Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p> <h2 id="alerts-examples">Examples</h2> <p>Wrap any text and an optional dismiss button in <code>.alert</code> and one of the four contextual classes (e.g., <code>.alert-success</code>) for basic alert messages.</p> @@ -32,16 +32,20 @@ <div class="alert alert-danger" role="alert">...</div> {% endhighlight %} - <h2 id="alerts-dismissable">Dismissable alerts</h2> - <p>Build on any alert by adding an optional <code>.alert-dismissable</code> and close button.</p> + <h2 id="alerts-dismissible">Dismissible alerts</h2> + <p>Build on any alert by adding an optional <code>.alert-dismissible</code> and close button.</p> + <div class="bs-callout bs-callout-info"> + <h4>Requires JavaScript alert plugin</h4> + <p>For fully functioning, dismissible alerts, you must use the <a href="../javascript/#alerts">alerts JavaScript plugin</a>.</p> + </div> <div class="bs-example"> - <div class="alert alert-warning alert-dismissable" role="alert"> + <div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <strong>Warning!</strong> Better check yourself, you're not looking too good. </div> </div> {% highlight html %} -<div class="alert alert-warning alert-dismissable" role="alert"> +<div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <strong>Warning!</strong> Better check yourself, you're not looking too good. </div> diff --git a/docs/_includes/components/badges.html b/docs/_includes/components/badges.html index daa0636cb..7c67ba769 100644 --- a/docs/_includes/components/badges.html +++ b/docs/_includes/components/badges.html @@ -21,21 +21,21 @@ <h4>Adapts to active nav states</h4> <p>Built-in styles are included for placing badges in active states in pill navigations.</p> <div class="bs-example"> - <ul class="nav nav-pills"> - <li class="active"><a href="#">Home <span class="badge">42</span></a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages <span class="badge">3</span></a></li> + <ul class="nav nav-pills" role="tablist"> + <li role="presentation" class="active"><a href="#">Home <span class="badge">42</span></a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages <span class="badge">3</span></a></li> </ul> <br> - <ul class="nav nav-pills nav-stacked" style="max-width: 260px;"> - <li class="active"> + <ul class="nav nav-pills nav-stacked" role="tablist" style="max-width: 260px;"> + <li role="presentation" class="active"> <a href="#"> <span class="badge pull-right">42</span> Home </a> </li> - <li><a href="#">Profile</a></li> - <li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"> <a href="#"> <span class="badge pull-right">3</span> Messages @@ -48,8 +48,8 @@ </button> </div> {% highlight html %} -<ul class="nav nav-pills nav-stacked"> - <li class="active"> +<ul class="nav nav-pills nav-stacked" role="tablist"> + <li role="presentation" class="active"> <a href="#"> <span class="badge pull-right">42</span> Home diff --git a/docs/_includes/components/glyphicons.html b/docs/_includes/components/glyphicons.html index e87434137..c614103c6 100644 --- a/docs/_includes/components/glyphicons.html +++ b/docs/_includes/components/glyphicons.html @@ -45,10 +45,10 @@ <div class="bs-example"> <div class="btn-toolbar" role="toolbar"> <div class="btn-group"> - <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-left"></span></button> - <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-center"></span></button> - <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-right"></span></button> - <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-justify"></span></button> + <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-left"></span> <span class="sr-only">Left Align</span></button> + <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-center"></span> <span class="sr-only">Center Align</span></button> + <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-right"></span> <span class="sr-only">Right Align</span></button> + <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-justify"></span> <span class="sr-only">Justify</span></button> </div> </div> <div class="btn-toolbar" role="toolbar"> diff --git a/docs/_includes/components/navbar.html b/docs/_includes/components/navbar.html index cdcfbf634..2bacc282d 100644 --- a/docs/_includes/components/navbar.html +++ b/docs/_includes/components/navbar.html @@ -27,7 +27,7 @@ <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -82,7 +82,7 @@ <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -144,6 +144,32 @@ </div> + <h2 id="navbar-brand-image">Brand image</h2> + <p>Replace the navbar brand with your own image by swapping the text for an <code><img></code>. Since the <code>.navbar-brand</code> has its own padding and height, you may need to override some CSS depending on your image.</p> + <div class="bs-example"> + <nav class="navbar navbar-default" role="navigation"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="#"> + <img alt="Brand" height="20" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAYAAAAYwiAhAAAMU0lEQVR4AeyZzU4TARSFhx08ienKiAsSSymliEjpdBBqoUX++gMJupZC/6B0prPUhIRI4qvIwoUhxAU8gBKiS0kkYQW5npsUAZloy4xYp3fxJSxYDMOXc07uKETkGJmI6clo5iLYmtfMbXAwP2IeA2oNqo6Q0W6N40ykegC205HqFlgEHiedcECq6j0ItQGZDptcABGqXiLVQ7CRVo3OfyLYU1+uDQ+iQaqdyy8cD0Szj9fp2cM1SvSVaNxfoFhPnvD7LmDFEaLdzQP/Xfz/iQeKNNm/SjODZUqFK7/IZuykVV2Ldi+33YpgMLsLibV7LlUqbNDUwBrLxA8sMlkI1bwsWwHpcgiJEiWHL2RLRYzdlKp3/TXBkE4dXIWQ6gzQXKhC8b6iCPWfy2TF2CXGA3maGSpTGpKBs3TE2EyG9Q5HBYNYHki1f55YLJbI5A6hxuqERZsbrtREM/aRaB5HBEMl+hZGzCPsLd5WIpQL0skOif4SIcW4No9SquGzJRjkUpFaJzzeJwJFkckV6WSfWG+e9xmLdoJGU28kGOTyslzJYZ1i/rwLZJJ0soX3KlG8t9mh9ZpkurchwXBsu7Ogmd+SIcjVk2+5dBKZ6gPPAcnKfMpAXeqeugRDarVjb+0huVgukcldVWdDqKwVNcmQZKq+hzRr/6NgGc3c5M2FWhShWjadsg0R9S3zJmPJNn8rGB9RkV6nzg96SafmlYnJ2ibmz7Fgp/gS0GUpGH/+gVwfcYqQIS7p1BCjNeLBIqUi+i5+brsmGNJL4yOqC9JJZLoVoayZDa1TUq1o1wRDen3AhV5kcuEQty9T/cR6c5RS9Z0rgiG9OvFtUYRq8apjRh1genCNsMXuXwimma+QXpJOUnWN82DpGjH/Cgv2+qdguHl9lXSSqrupUFbgAPuF3UI9GnenBlal6qyRdLohiWCBkuGKB/VYfTHuz0vVMZJOjoH3wYI9V7D437ZSOskQd16mJ9bQTKj8Rpl+VH4v6SRVZ1soCyYHSu+URLD0WWSSqrMrkxXxYOGTMhEofJeqk3SyK9MFL8/hc8WxEuvJSzpJ1dmWyYqx7izxR24Z4pJOtmWyYtS7RIpUXeNIOtWP0tpVJ0P8Rzt39ptlEcVx/HDHPwJeIUvRondcSG3LoneiFKIXKG3ZRMGyaGSRVcJarKxuiUQWNxCI7DS2mFAEb0ohCg0mGilqgiiBPJ4M9SX1TF4Z3jnvb9r3TPK9NdF+cuZ5Z57HeJi4x2Rk06n3b3V4ULKnu6PUz5wuXejs9X1/tiPbv/eka8WCHdnMSW/3iekkQcko9enUh5fDd+zQt1njyp3ZC2MX9XpMstkZpb7VldI6z5PuvU2fA0DFweSLUn8QL8V1/drvbjtNfTrJZJT6gzh24aFtXLkzvekUEAEwGbDwrZOf0RaippMmMPyZk62766fOXxwyLKbwKOkzJwnMkI1ZmBIm0VMjekapH2DKZcieZ2R4UBKT7NWM8KAMWOg63XweP50kJm+U+vWKf9lavmB7cph8UeqXv/5lq4uPMECgFIEpYzJgYWvHps8AmMIi4HQyYBEe+GM8iGtGqb+aYiv/mj5xZYTppBel/hZm/mXrkw8OgTHJxo14JRel/uJc7MWXyLGuV3h6rOJfczu62+7+2Pz6Db+Gc6V410htHQmBkhEeEwCY/vUKH4a+6R7C+deeKrCbf/6Fx+Sr/G6U+jviCsCKfsWyf+8JTWPJYPJFKWGSqQBDXK+4aaa1ls3fVjxQ5WERGhQAGOy+jp/RAMAUplNABMYEAHYCevl7sf0KBJg+Jn+U+udQCsCg1ysbVnysDgyFaWz5LBHhMcnwwHRPxDWA4UH5o9Q/h1IABr+v421SFxgIky9KDRQAmAImADA8KG+U+udQsdc+Boa+rzvfdgEMTGBSi1L/HEoBmAIm7ARDYRI9KiPkdMIBw97VxQTGV1EpgRIRHhMYGOCKJeb9ZGvzORwm0csiCsCkDAoADHBfN61mRRZzbW/8FA/K05juKAAU4HpFFxjgvo6viw5mMdfE6tfxmPJEKX6sqQ8Mc/k7qfqN2NujEiYuHJM3SvBjzR5pAQNc/joQMdfUmuWA6RQWJfixpj4wwH3dvj1x3wk7eug0AFN4hMYEAKYJSsRTJvq519XOn92zV0qgRI/MdFGRtrrEgOnf182but5tiRqvSM+rX58kJl+EnE4AYO6PzlcrBbd0/tZc+/Ycz8XXQA4BL21cyWEa7YkA0ykoWz1wpQ5KRBJUWt/X2XLPXA4XHlN4lBImmQE7erA1q6legAEVIQqCALheKeWptXTeFiQmADDA9UopLv6hoIdJtRkiQk4nmaikH+pbT53L5tav7w2gRNXdEWA6BZXZcge1vF0mj8kXIaeTAQtaPNG+y2qqFiQJSjT8bgTBFHAibktunW/xNINj8oMSUWIfa4ps+de2xr3JYfJFYFAKwAyZxlYX3nQXATApADNkiOkkQclIH5MB014N9Wsh00kUDgz/OZTG/1+ef/YX0GVvQa9CK/w7TaiajwflifCY8hd78Ss1RTkR5196bvviowX3y097fbnnGAqTqCqXBJba93UawCAn4oxNc8o5xHXPLYViEpUxsIQwicboAEOeiLtJo7WOHGxVBSURCVAiSgXUGJkeMOwVC2+fm93E0ZhiEyrnF206yUKB4T+HUnhWOZ7E9cq65R/pHFts3FO06SSbJiI0Jjww3PVKC/8AiL3OtbUXbTpJUDICgEoRGOREnB/KNbZJGCZflPq3dfrAoPd1buLEXkvmbo671QVU+Z8o/EFcFZRIHxj0vs49M8VeO9//yo9JH5SIGE7K39dpHEiCMDlQooa6NfH/HXcfg2DyRXhMMn1guMtfX7EXX10VDKoyUgQFhQEGwAQAhgHFTe0RATChgcFBVfVMAxgEk2gYAwNgwgNL7L5OFVgRMfmi1D+H0geGv6+LvToYmCqoYfcfpf5tnS4w/H0dHlj4dAqJEgMl0gEmoaCuV5bMfRcATAWT6EmOksEEAAa4/BUdOdiiA0x/OglMslBggPs6fWDY+7qua79lsRejLT4mUb2L0sFUPGASEea+7ovdRzONxf/ceFtdACZfhPlYEwssAJPaificujVq7+ovaWiCYAoABrv8FSnd0+lf/oJw8UKCElGKH2vqA8Nd/q5d9qEqrnNn2iGYREPvRkBMIGBH9UH5Yblfd9pr68bdOUwAUCIKwAS4XsEBqywwPt9yf+yWU2fFxNL8dG18RQMCk6iiO0oMlCj24mMB8VV2R4QSWA6zxKQPqiJPBMUkCrhGsSWm15RnFxdtOuWvLpcEBr38NWAFnH0BMAlQIgrCBLivs3V/2/74itfCQClg8kVpYBIFALM1p3Y1ZDoFA8ODMmDhxxK7FKZTvAiAKeiYwFaeS+0DLVEexDVzwOCXv3my5V8tJ8+GTidIBJlOAdmSa8uGXVhMAREeUwgwO+ta3NCEBxUQBWCCfFtn696W+AwfReDRhEV4UFPzZMA62n/kqfVOr8A0akitiAIwQb6vM1i9BlMAMBAmX6V2In/4wDfZS+MX9VZQIlKYTgGYDBhPKr5HPJLNrl2dEqZoUXGmkwFjSDlMfMyA3/50QIkIjwn/Wi+HPxHHY1KJkKDSxyQzTGFRn8SEuvw1UCKyrc4wKfY3MYY/bDoZKKV+JQbyQ9KgDFOv64khU1yjhtZeIj4HO24P4oVmmHxVDKs7Tvw+WJNtdQaqAEz5gDXR6PIZtfYgHppNJ2+De1ZZVv8ijXt81iDb6mQ2nYJBiUaXT3+IsiwjRnHVtrr82XQKrpNt0b/AVtl0EhmmwlqVA1Y1fNpgm0621cWM/zsOzgHrnmLN9iBu0ylSzd2u7gFjPNW21dl0ilS1AMZY+nGtNp0MU4G1cv0EsG5kZdxtm0621T1gt7ky50kAyyGrW2ugbDo9YGtzlvIA68+dMUw2nQI7w/X3A5PIBnBdhsmm0312nRsoLXmB5ZCVczcMlGH6n25w5dKQBOZDVsXdNEwuwyS7yVUJOwJYfmQjw7dLm04lUBc3MmclHJh4Jmsr1elkmERt3ABhJRyY+HW5hrtjD+Il2x1unfi1WAAwEf+ByrgWw1RytfQ4RI0KTCLrx1VzzbbV9fmauerc9Y86MIltELeau9xnppN1hVvNPRxgQQGYxDaQm8w1cl9zF7ku7lZy08m6xXVxF7nDXCM3WR6YFtY/g9j2sjS1K/4AAAAASUVORK5CYII="> + </a> + </div> + </div> + </nav> + </div> +{% highlight html %} +<nav class="navbar navbar-default" role="navigation"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="#"> + <img alt="Brand" src="..."> + </a> + </div> + </div> +</nav> +{% endhighlight %} + + <h2 id="navbar-forms">Forms</h2> <p>Place form content within <code>.navbar-form</code> for proper vertical alignment and collapsed behavior in narrow viewports. Use the alignment options to decide where it resides within the navbar content.</p> <p>As a heads up, <code>.navbar-form</code> shares much of its code with <code>.form-inline</code> via mixin. <strong class="text-danger">Some form controls, like input groups, may require fixed widths to be show up properly within a navbar.</strong></p> @@ -151,7 +177,7 @@ <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -196,7 +222,7 @@ <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-3"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-3"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -225,7 +251,7 @@ <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-4"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-4"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -250,7 +276,7 @@ <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-5"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-5"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -286,7 +312,7 @@ <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. --> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-6"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-6"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -330,7 +356,7 @@ body { padding-top: 70px; } <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. --> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-7"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-7"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -375,7 +401,7 @@ body { padding-bottom: 70px; } <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. --> <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-8"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-8"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -411,7 +437,7 @@ body { padding-bottom: 70px; } <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> diff --git a/docs/_includes/components/navs.html b/docs/_includes/components/navs.html index 26cae463d..3b15c4e16 100644 --- a/docs/_includes/components/navs.html +++ b/docs/_includes/components/navs.html @@ -7,16 +7,16 @@ <p>Note the <code>.nav-tabs</code> class requires the <code>.nav</code> base class.</p> <div class="bs-example"> <ul class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> </div> {% highlight html %} <ul class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> {% endhighlight %} <div class="bs-callout bs-callout-info"> @@ -27,29 +27,29 @@ <h2 id="nav-pills">Pills</h2> <p>Take that same HTML, but use <code>.nav-pills</code> instead:</p> <div class="bs-example"> - <ul class="nav nav-pills"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <ul class="nav nav-pills" role="tablist"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> </div> {% highlight html %} -<ul class="nav nav-pills"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> +<ul class="nav nav-pills" role="tablist"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> {% endhighlight %} <p>Pills are also vertically stackable. Just add <code>.nav-stacked</code>.</p> <div class="bs-example"> - <ul class="nav nav-pills nav-stacked" style="max-width: 300px;"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <ul class="nav nav-pills nav-stacked" role="tablist" style="max-width: 300px;"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> </div> {% highlight html %} -<ul class="nav nav-pills nav-stacked"> +<ul class="nav nav-pills nav-stacked" role="tablist"> ... </ul> {% endhighlight %} @@ -63,22 +63,22 @@ </div> <div class="bs-example"> <ul class="nav nav-tabs nav-justified" role="tablist"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> <br> - <ul class="nav nav-pills nav-justified"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Profile</a></li> - <li><a href="#">Messages</a></li> + <ul class="nav nav-pills nav-justified" role="tablist"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Profile</a></li> + <li role="presentation"><a href="#">Messages</a></li> </ul> </div> {% highlight html %} <ul class="nav nav-tabs nav-justified" role="tablist"> ... </ul> -<ul class="nav nav-pills nav-justified"> +<ul class="nav nav-pills nav-justified" role="tablist"> ... </ul> {% endhighlight %} @@ -93,16 +93,16 @@ </div> <div class="bs-example"> - <ul class="nav nav-pills"> - <li><a href="#">Clickable link</a></li> - <li><a href="#">Clickable link</a></li> - <li class="disabled"><a href="#">Disabled link</a></li> + <ul class="nav nav-pills" role="tablist"> + <li role="presentation"><a href="#">Clickable link</a></li> + <li role="presentation"><a href="#">Clickable link</a></li> + <li role="presentation" class="disabled"><a href="#">Disabled link</a></li> </ul> </div> {% highlight html %} -<ul class="nav nav-pills"> +<ul class="nav nav-pills" role="tablist"> ... - <li class="disabled"><a href="#">Disabled link</a></li> + <li role="presentation" class="disabled"><a href="#">Disabled link</a></li> ... </ul> {% endhighlight %} @@ -114,9 +114,9 @@ <h3>Tabs with dropdowns</h3> <div class="bs-example"> <ul class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Help</a></li> - <li class="dropdown"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Help</a></li> + <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Dropdown <span class="caret"></span> </a> @@ -133,7 +133,7 @@ {% highlight html %} <ul class="nav nav-tabs" role="tablist"> ... - <li class="dropdown"> + <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Dropdown <span class="caret"></span> </a> @@ -147,10 +147,10 @@ <h3>Pills with dropdowns</h3> <div class="bs-example"> - <ul class="nav nav-pills"> - <li class="active"><a href="#">Home</a></li> - <li><a href="#">Help</a></li> - <li class="dropdown"> + <ul class="nav nav-pills" role="tablist"> + <li role="presentation" class="active"><a href="#">Home</a></li> + <li role="presentation"><a href="#">Help</a></li> + <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Dropdown <span class="caret"></span> </a> @@ -165,9 +165,9 @@ </ul> </div><!-- /example --> {% highlight html %} -<ul class="nav nav-pills"> +<ul class="nav nav-pills" role="tablist"> ... - <li class="dropdown"> + <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Dropdown <span class="caret"></span> </a> diff --git a/docs/_includes/components/panels.html b/docs/_includes/components/panels.html index b00cd0f72..acf32c51c 100644 --- a/docs/_includes/components/panels.html +++ b/docs/_includes/components/panels.html @@ -22,6 +22,7 @@ <h3 id="panels-heading">Panel with heading</h3> <p>Easily add a heading container to your panel with <code>.panel-heading</code>. You may also include any <code><h1></code>-<code><h6></code> with a <code>.panel-title</code> class to add a pre-styled heading.</p> + <p>For proper link coloring, be sure to place links in headings within <code>.panel-title</code>.</p> <div class="bs-example"> <div class="panel panel-default"> <div class="panel-heading">Panel heading without title</div> diff --git a/docs/_includes/components/progress-bars.html b/docs/_includes/components/progress-bars.html index a78e2c881..adf686853 100644 --- a/docs/_includes/components/progress-bars.html +++ b/docs/_includes/components/progress-bars.html @@ -112,7 +112,7 @@ </div> <div class="progress"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> - <span class="sr-only">80% Complete</span> + <span class="sr-only">80% Complete (danger)</span> </div> </div> {% endhighlight %} @@ -120,60 +120,60 @@ <h3 id="progress-striped">Striped</h3> <p>Uses a gradient to create a striped effect. Not available in IE8.</p> <div class="bs-example"> - <div class="progress progress-striped" > - <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> + <div class="progress"> + <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete (success)</span> </div> </div> - <div class="progress progress-striped"> - <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> + <div class="progress"> + <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% Complete</span> </div> </div> - <div class="progress progress-striped"> - <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> + <div class="progress"> + <div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% Complete (warning)</span> </div> </div> - <div class="progress progress-striped"> - <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> + <div class="progress"> + <div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete (danger)</span> </div> </div> </div> {% highlight html %} -<div class="progress progress-striped"> - <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> +<div class="progress"> + <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete (success)</span> </div> </div> -<div class="progress progress-striped"> - <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> +<div class="progress"> + <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% Complete</span> </div> </div> -<div class="progress progress-striped"> - <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> +<div class="progress"> + <div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% Complete (warning)</span> </div> </div> -<div class="progress progress-striped"> - <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> +<div class="progress"> + <div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete (danger)</span> </div> </div> {% endhighlight %} <h3 id="progress-animated">Animated</h3> - <p>Add <code>.active</code> to <code>.progress-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p> + <p>Add <code>.active</code> to <code>.progress-bar-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p> <div class="bs-example"> - <div class="progress progress-striped active"> - <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div> + <div class="progress"> + <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div> </div> </div> {% highlight html %} -<div class="progress progress-striped active"> - <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"> +<div class="progress"> + <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"> <span class="sr-only">45% Complete</span> </div> </div> @@ -186,7 +186,7 @@ <div class="progress-bar progress-bar-success" style="width: 35%"> <span class="sr-only">35% Complete (success)</span> </div> - <div class="progress-bar progress-bar-warning" style="width: 20%"> + <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%"> <span class="sr-only">20% Complete (warning)</span> </div> <div class="progress-bar progress-bar-danger" style="width: 10%"> @@ -199,7 +199,7 @@ <div class="progress-bar progress-bar-success" style="width: 35%"> <span class="sr-only">35% Complete (success)</span> </div> - <div class="progress-bar progress-bar-warning" style="width: 20%"> + <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%"> <span class="sr-only">20% Complete (warning)</span> </div> <div class="progress-bar progress-bar-danger" style="width: 10%"> diff --git a/docs/_includes/css/buttons.html b/docs/_includes/css/buttons.html index 15b0f5ed2..bfc5ded80 100644 --- a/docs/_includes/css/buttons.html +++ b/docs/_includes/css/buttons.html @@ -88,7 +88,7 @@ <h2 id="buttons-active">Active state</h2> - <p>Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <code><button></code> elements, this is done via <code>:active</code>. For <code><a></code> elements, it's done with <code>.active</code>. However, you may use <code>.active</code> on <code><button></code>s should you need to replicate the active state progammatically.</p> + <p>Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <code><button></code> elements, this is done via <code>:active</code>. For <code><a></code> elements, it's done with <code>.active</code>. However, you may use <code>.active</code> on <code><button></code>s should you need to replicate the active state programmatically.</p> <h3>Button element</h3> <p>No need to add <code>:active</code> as it's a pseudo-class, but if you need to force the same appearance, go ahead and add <code>.active</code>.</p> diff --git a/docs/_includes/css/code.html b/docs/_includes/css/code.html index 675ac10e9..ba2edc151 100644 --- a/docs/_includes/css/code.html +++ b/docs/_includes/css/code.html @@ -17,7 +17,8 @@ For example, <code><section></code> should be wrapped as inline. To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd> </div> {% highlight html %} -To switch directories, type <kbd>cd</kbd> followed by the name of the directory. +To switch directories, type <kbd>cd</kbd> followed by the name of the directory.<br> +To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd> {% endhighlight %} <h2 id="code-block">Basic block</h2> diff --git a/docs/_includes/css/forms.html b/docs/_includes/css/forms.html index 95bb29c59..5bb99f00c 100644 --- a/docs/_includes/css/forms.html +++ b/docs/_includes/css/forms.html @@ -49,17 +49,17 @@ <button type="submit" class="btn btn-default">Submit</button> </form> {% endhighlight %} - <div class="bs-callout bs-callout-warning"> - <h4>Don't mix form groups with input groups</h4> - <p>Do not mix form groups directly with <a href="/components/#input-groups">input groups</a>. Instead, nest the input group inside of the form group.</p> - </div> + <div class="bs-callout bs-callout-warning"> + <h4>Don't mix form groups with input groups</h4> + <p>Do not mix form groups directly with <a href="/components/#input-groups">input groups</a>. Instead, nest the input group inside of the form group.</p> + </div> <h2 id="forms-inline">Inline form</h2> <p>Add <code>.form-inline</code> to your <code><form></code> for left-aligned and inline-block controls. <strong>This only applies to forms within viewports that are at least 768px wide.</strong></p> <div class="bs-callout bs-callout-danger"> <h4>Requires custom widths</h4> - <p>Inputs, selects, and textareas are 100% wide by default in Bootstrap. To use the inline form, you'll have to set a width on the form controls used within.</p> + <p>Inputs and selects have <code>width: 100%;</code> applied by default in Bootstrap. Within inline forms, we reset that to <code>width: auto;</code> so multiple controls can reside on the same line. Depending on your layout, additional custom widths may be required.</p> </div> <div class="bs-callout bs-callout-warning"> <h4>Always add labels</h4> @@ -96,6 +96,12 @@ <input type="email" class="form-control" id="exampleInputEmail2" placeholder="Enter email"> </div> <div class="form-group"> + <div class="input-group"> + <div class="input-group-addon">@</div> + <input class="form-control" type="email" placeholder="Enter email"> + </div> + </div> + <div class="form-group"> <label class="sr-only" for="exampleInputPassword2">Password</label> <input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password"> </div> @@ -369,7 +375,7 @@ <h2 id="forms-controls-static">Static control</h2> - <p>When you need to place plain text next to a form label within a horizontal form, use the <code>.form-control-static</code> class on a <code><p></code>.</p> + <p>When you need to place plain text next to a form label within a form, use the <code>.form-control-static</code> class on a <code><p></code>.</p> <div class="bs-example"> <form class="form-horizontal" role="form"> <div class="form-group"> @@ -402,6 +408,32 @@ </div> </form> {% endhighlight %} + <div class="bs-example"> + <form class="form-inline" role="form"> + <div class="form-group"> + <label class="sr-only">Email</label> + <p class="form-control-static">[email protected]</p> + </div> + <div class="form-group"> + <label for="inputPassword2" class="sr-only">Password</label> + <input type="password" class="form-control" id="inputPassword2" placeholder="Password"> + </div> + <button type="submit" class="btn btn-default">Confirm identity</button> + </form> + </div> +{% highlight html %} +<form class="form-inline" role="form"> + <div class="form-group"> + <label class="sr-only">Email</label> + <p class="form-control-static">[email protected]</p> + </div> + <div class="form-group"> + <label for="inputPassword2" class="sr-only">Password</label> + <input type="password" class="form-control" id="inputPassword2" placeholder="Password"> + </div> + <button type="submit" class="btn btn-default">Confirm identity</button> +</form> +{% endhighlight %} <h2 id="forms-control-focus">Input focus</h2> <p>We remove the default <code>outline</code> styles on some form controls and apply a <code>box-shadow</code> in its place for <code>:focus</code>.</p> @@ -515,6 +547,30 @@ <label class="control-label" for="inputError1">Input with error</label> <input type="text" class="form-control" id="inputError1"> </div> + <div class="has-success"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxSuccess" value="option1"> + Checkbox with success + </label> + </div> + </div> + <div class="has-warning"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxWarning" value="option1"> + Checkbox with warning + </label> + </div> + </div> + <div class="has-error"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxError" value="option1"> + Checkbox with error + </label> + </div> + </div> </form> </div><!-- /.bs-example --> {% highlight html %} @@ -530,10 +586,35 @@ <label class="control-label" for="inputError1">Input with error</label> <input type="text" class="form-control" id="inputError1"> </div> +<div class="has-success"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxSuccess" value="option1"> + Checkbox with success + </label> + </div> +</div> +<div class="has-warning"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxWarning" value="option1"> + Checkbox with warning + </label> + </div> +</div> +<div class="has-error"> + <div class="checkbox"> + <label> + <input type="checkbox" id="checkboxError" value="option1"> + Checkbox with error + </label> + </div> +</div> {% endhighlight %} <h3>With optional icons</h3> <p>You can also add optional feedback icons with the addition of <code>.has-feedback</code> and the right icon.</p> + <p><strong class="text-danger">Feedback icons only work with textual <code><input class="form-control"></code> elements.</strong></p> <div class="bs-callout bs-callout-warning"> <h4>Icons, labels, and input groups</h4> <p>Manual positioning of feedback icons is required for inputs without a label and for <a href="../components#input-groups">input groups</a> with an add-on on the right. You are strongly encouraged to provide labels for all inputs for accessibility reasons. If you wish to prevent labels from being displayed, hide them with the <code>sr-only</code> class. If you must do without labels, adjust the <code>top</code> value of the feedback icon. For input groups, adjust the <code>right</code> value to an appropriate pixel value depending on the width of your addon.</p> @@ -670,6 +751,42 @@ <select class="form-control input-sm">...</select> {% endhighlight %} + <h3>Horizontal form group sizes</h3> + <p>Quickly size labels and form controls within <code>.form-horizontal</code> by adding <code>.form-group-lg</code> or <code>.form-group-sm</code>.</p> + <div class="bs-example"> + <form class="form-horizontal" role="form"> + <div class="form-group form-group-lg"> + <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label> + <div class="col-sm-10"> + <input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input"> + </div> + </div> + <div class="form-group form-group-sm"> + <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label> + <div class="col-sm-10"> + <input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input"> + </div> + </div> + </form> + </div><!-- /.bs-example --> +{% highlight html %} +<form class="form-horizontal" role="form"> + <div class="form-group form-group-lg"> + <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label> + <div class="col-sm-10"> + <input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input"> + </div> + </div> + <div class="form-group form-group-sm"> + <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label> + <div class="col-sm-10"> + <input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input"> + </div> + </div> +</form> +{% endhighlight %} + + <h3>Column sizing</h3> <p>Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.</p> <div class="bs-example"> diff --git a/docs/_includes/css/grid.html b/docs/_includes/css/grid.html index 8ff53dd71..429ef90f9 100644 --- a/docs/_includes/css/grid.html +++ b/docs/_includes/css/grid.html @@ -347,16 +347,16 @@ <h3 id="grid-nesting">Nesting columns</h3> - <p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-md-*</code> columns within an existing <code>.col-md-*</code> column. Nested rows should include a set of columns that add up to 12 or less (it is not required that you use all 12 available columns).</p> + <p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-sm-*</code> columns within an existing <code>.col-sm-*</code> column. Nested rows should include a set of columns that add up to 12 or less (it is not required that you use all 12 available columns).</p> <div class="row show-grid"> <div class="col-sm-9"> - Level 1: .col-md-9 + Level 1: .col-sm-9 <div class="row show-grid"> <div class="col-xs-8 col-sm-6"> - Level 2: .col-xs-8 .col-md-6 + Level 2: .col-xs-8 .col-sm-6 </div> <div class="col-xs-4 col-sm-6"> - Level 2: .col-xs-4 .col-md-6 + Level 2: .col-xs-4 .col-sm-6 </div> </div> </div> @@ -364,13 +364,13 @@ {% highlight html %} <div class="row"> <div class="col-sm-9"> - Level 1: .col-md-9 + Level 1: .col-sm-9 <div class="row"> <div class="col-xs-8 col-sm-6"> - Level 2: .col-xs-8 .col-md-6 + Level 2: .col-xs-8 .col-sm-6 </div> <div class="col-xs-4 col-sm-6"> - Level 2: .col-xs-4 .col-md-6 + Level 2: .col-xs-4 .col-sm-6 </div> </div> </div> diff --git a/docs/_includes/css/images.html b/docs/_includes/css/images.html index 4e0fc4a77..4f3687ea6 100644 --- a/docs/_includes/css/images.html +++ b/docs/_includes/css/images.html @@ -3,6 +3,10 @@ <h2 id="images-responsive">Responsive images</h2> <p>Images in Bootstrap 3 can be made responsive-friendly via the addition of the <code>.img-responsive</code> class. This applies <code>max-width: 100%;</code> and <code>height: auto;</code> to the image so that it scales nicely to the parent element.</p> + <div class="bs-callout bs-callout-warning"> + <h4>SVG images and IE 8-10</h4> + <p>In Internet Explorer 8-10, SVG images with <code>.img-responsive</code> are disproportionately sized. To fix this, add <code>width: 100% \9;</code> where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.</p> + </div> {% highlight html %} <img src="..." class="img-responsive" alt="Responsive image"> {% endhighlight %} diff --git a/docs/_includes/css/less.html b/docs/_includes/css/less.html index eadbda775..b325ea9eb 100644 --- a/docs/_includes/css/less.html +++ b/docs/_includes/css/less.html @@ -7,7 +7,7 @@ <h2 id="less-bootstrap">Compiling Bootstrap</h2> - <p>Bootstrap can be used in at least two ways: with the compiled CSS or with the source Less files. To compile the Less files, <a href="https://github.com/twbs/bootstrap#compiling-css-and-javascript">visit the README</a> for how to setup your development environment to run the necessary commands.</p> + <p>Bootstrap can be used in at least two ways: with the compiled CSS or with the source Less files. To compile the Less files, <a href="../getting-started/#grunt">consult the Getting Started section</a> for how to setup your development environment to run the necessary commands.</p> <p>Third party compilation tools may work with Bootstrap, but they are not supported by our core team.</p> <h2 id="less-variables">Variables</h2> @@ -28,7 +28,7 @@ @gray-darker: lighten(#000, 13.5%); // #222 @gray-dark: lighten(#000, 20%); // #333 @gray: lighten(#000, 33.5%); // #555 -@gray-light: lighten(#000, 60%); // #999 +@gray-light: lighten(#000, 46.7%); // #777 @gray-lighter: lighten(#000, 93.5%); // #eee {% endhighlight %} diff --git a/docs/_includes/css/tables.html b/docs/_includes/css/tables.html index 655545112..011a4dbba 100644 --- a/docs/_includes/css/tables.html +++ b/docs/_includes/css/tables.html @@ -5,6 +5,7 @@ <p>For basic styling—light padding and only horizontal dividers—add the base class <code>.table</code> to any <code><table></code>. It may seem super redundant, but given the widespread use of tables for other plugins like calendars and date pickers, we've opted to isolate our custom table styles.</p> <div class="bs-example"> <table class="table"> + <caption>Optional table caption.</caption> <thead> <tr> <th>#</th> diff --git a/docs/_includes/customizer-variables.html b/docs/_includes/customizer-variables.html index 11f6e0385..095482e05 100644 --- a/docs/_includes/customizer-variables.html +++ b/docs/_includes/customizer-variables.html @@ -4,24 +4,28 @@ <p>Gray and brand colors for use across Bootstrap.</p> <div class="row"> <div class="bs-customizer-input"> + <label for="input-@gray-base">@gray-base</label> + <input id="input-@gray-base" type="text" value="#000" data-var="@gray-base" class="form-control"/> + </div> + <div class="bs-customizer-input"> <label for="input-@gray-darker">@gray-darker</label> - <input id="input-@gray-darker" type="text" value="lighten(#000, 13.5%)" data-var="@gray-darker" class="form-control"/> + <input id="input-@gray-darker" type="text" value="lighten(@gray-base, 13.5%)" data-var="@gray-darker" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@gray-dark">@gray-dark</label> - <input id="input-@gray-dark" type="text" value="lighten(#000, 20%)" data-var="@gray-dark" class="form-control"/> + <input id="input-@gray-dark" type="text" value="lighten(@gray-base, 20%)" data-var="@gray-dark" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@gray">@gray</label> - <input id="input-@gray" type="text" value="lighten(#000, 33.5%)" data-var="@gray" class="form-control"/> + <input id="input-@gray" type="text" value="lighten(@gray-base, 33.5%)" data-var="@gray" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@gray-light">@gray-light</label> - <input id="input-@gray-light" type="text" value="lighten(#000, 60%)" data-var="@gray-light" class="form-control"/> + <input id="input-@gray-light" type="text" value="lighten(@gray-base, 46.7%)" data-var="@gray-light" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@gray-lighter">@gray-lighter</label> - <input id="input-@gray-lighter" type="text" value="lighten(#000, 93.5%)" data-var="@gray-lighter" class="form-control"/> + <input id="input-@gray-lighter" type="text" value="lighten(@gray-base, 93.5%)" data-var="@gray-lighter" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@brand-primary">@brand-primary</label> @@ -404,7 +408,7 @@ </div> <div class="bs-customizer-input"> <label for="input-@input-color-placeholder">@input-color-placeholder</label> - <input id="input-@input-color-placeholder" type="text" value="@gray-light" data-var="@input-color-placeholder" class="form-control"/> + <input id="input-@input-color-placeholder" type="text" value="#999" data-var="@input-color-placeholder" class="form-control"/> <p class="help-block">Placeholder text color</p> </div> <div class="bs-customizer-input"> @@ -726,7 +730,7 @@ </div> <div class="bs-customizer-input"> <label for="input-@navbar-inverse-color">@navbar-inverse-color</label> - <input id="input-@navbar-inverse-color" type="text" value="@gray-light" data-var="@navbar-inverse-color" class="form-control"/> + <input id="input-@navbar-inverse-color" type="text" value="lighten(@gray-light, 15%)" data-var="@navbar-inverse-color" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@navbar-inverse-bg">@navbar-inverse-bg</label> @@ -738,7 +742,7 @@ </div> <div class="bs-customizer-input"> <label for="input-@navbar-inverse-link-color">@navbar-inverse-link-color</label> - <input id="input-@navbar-inverse-link-color" type="text" value="@gray-light" data-var="@navbar-inverse-link-color" class="form-control"/> + <input id="input-@navbar-inverse-link-color" type="text" value="lighten(@gray-light, 15%)" data-var="@navbar-inverse-link-color" class="form-control"/> </div> <div class="bs-customizer-input"> <label for="input-@navbar-inverse-link-hover-color">@navbar-inverse-link-hover-color</label> @@ -809,10 +813,6 @@ <label for="input-@nav-disabled-link-hover-color">@nav-disabled-link-hover-color</label> <input id="input-@nav-disabled-link-hover-color" type="text" value="@gray-light" data-var="@nav-disabled-link-hover-color" class="form-control"/> </div> - <div class="bs-customizer-input"> - <label for="input-@nav-open-link-hover-color">@nav-open-link-hover-color</label> - <input id="input-@nav-open-link-hover-color" type="text" value="#fff" data-var="@nav-open-link-hover-color" class="form-control"/> - </div> </div> <h2 id="tabs">Tabs</h2> <div class="row"> @@ -1701,6 +1701,11 @@ <p></p> <div class="row"> <div class="bs-customizer-input"> + <label for="input-@component-offset-horizontal">@component-offset-horizontal</label> + <input id="input-@component-offset-horizontal" type="text" value="180px" data-var="@component-offset-horizontal" class="form-control"/> + <p class="help-block">Horizontal offset for forms and lists.</p> + </div> + <div class="bs-customizer-input"> <label for="input-@text-muted">@text-muted</label> <input id="input-@text-muted" type="text" value="@gray-light" data-var="@text-muted" class="form-control"/> <p class="help-block">Text muted color</p> @@ -1735,19 +1740,15 @@ <input id="input-@page-header-border-color" type="text" value="@gray-lighter" data-var="@page-header-border-color" class="form-control"/> <p class="help-block">Page header border color</p> </div> -</div> -<h2 id="miscellaneous">Miscellaneous</h2> -<p></p> -<div class="row"> + <div class="bs-customizer-input"> + <label for="input-@dl-horizontal-offset">@dl-horizontal-offset</label> + <input id="input-@dl-horizontal-offset" type="text" value="@component-offset-horizontal" data-var="@dl-horizontal-offset" class="form-control"/> + <p class="help-block">Width of horizontal description list titles</p> + </div> <div class="bs-customizer-input"> <label for="input-@hr-border">@hr-border</label> <input id="input-@hr-border" type="text" value="@gray-lighter" data-var="@hr-border" class="form-control"/> <p class="help-block">Horizontal line color.</p> </div> - <div class="bs-customizer-input"> - <label for="input-@component-offset-horizontal">@component-offset-horizontal</label> - <input id="input-@component-offset-horizontal" type="text" value="180px" data-var="@component-offset-horizontal" class="form-control"/> - <p class="help-block">Horizontal offset for forms and lists.</p> - </div> </div> <!-- NOTE: DO NOT EDIT THE PRECEDING SECTION DIRECTLY! It is autogenerated via the `build-customizer-html` Grunt task using the customizer-variables.jade template.-->
\ No newline at end of file diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 0bb3eafd3..75fb572e0 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -33,11 +33,23 @@ ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> +{% if site.github %} <script src="../dist/js/bootstrap.min.js"></script> +{% else %} +<script src="../dist/js/bootstrap.js"></script> +{% endif %} +{% if site.github %} <script src="../assets/js/docs.min.js"></script> +{% else %} +<script src="../assets/js/vendor/holder.js"></script> +<script src="../assets/js/vendor/ZeroClipboard.min.js"></script> +<script src="../assets/js/src/application.js"></script> +{% endif %} {% if page.slug == "customize" %} <script src="../assets/js/customize.min.js"></script> {% endif %} +<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> +<script src="../assets/js/ie10-viewport-bug-workaround.js"></script> {% comment %} Inject Twitter widgets asynchronously. Snippet snipped from Twitter's diff --git a/docs/_includes/getting-started/browser-device-support.html b/docs/_includes/getting-started/browser-device-support.html index 1a1236440..6dde94bdb 100644 --- a/docs/_includes/getting-started/browser-device-support.html +++ b/docs/_includes/getting-started/browser-device-support.html @@ -106,6 +106,9 @@ <h3 id="support-ie8-box-sizing">Internet Explorer 8 and box-sizing</h3> <p>IE8 does not fully support <code>box-sizing: border-box;</code> when combined with <code>min-width</code>, <code>max-width</code>, <code>min-height</code>, or <code>max-height</code>. For that reason, as of v3.0.1, we no longer use <code>max-width</code> on <code>.container</code>s.</p> + <h3 id="support-ie8-font-face">Internet Explorer 8 and @font-face</h3> + <p>IE8 has some issues with <code>@font-face</code> when combined with <code>:before</code>. Bootstrap uses that combination with its Glyphicons. If a page is cached, and loaded without the mouse over the window (i.e. hit the refresh button or load something in an iframe) then the page gets rendered before the font loads. Hovering over the page (body) will show some of the icons and hovering over the remaining icons will show those as well. <a href="https://github.com/twbs/bootstrap/issues/13863">See issue #13863</a> for details.</p> + <h3 id="support-ie-compatibility-modes">IE Compatibility modes</h3> <p>Bootstrap is not supported in the old Internet Explorer compatibility modes. To be sure you're using the latest rendering mode for IE, consider including the appropriate <code><meta></code> tag in your pages:</p> {% highlight html %} @@ -155,7 +158,7 @@ if (navigator.userAgent.match(/IEMobile\/10\.0/)) { <h4>Overflow and scrolling</h4> <p>Support for <code>overflow: hidden</code> on the <code><body></code> element is quite limited in iOS and Android. To that end, when you scroll past the top or bottom of a modal in either of those devices' browsers, the <code><body></code> content will begin to scroll.</p> <h4>Virtual keyboards</h4> - <p>Also, note that if you're using inputs in your modal or navbar, iOS has a rendering bug that doesn't update the position of fixed elements when the virtual keyboard is triggered. A few workarounds for this include transforming your elements to <code>position: absolute</code> or invoking a timer on focus to try to correct the positioning manually. This is not handled by Bootstrap, so it is up to you to decide which solution is best for your application.</p> + <p>Also, note that if you're using a fixed navbar or using inputs within a modal, iOS has a rendering bug that doesn't update the position of fixed elements when the virtual keyboard is triggered. A few workarounds for this include transforming your elements to <code>position: absolute</code> or invoking a timer on focus to try to correct the positioning manually. This is not handled by Bootstrap, so it is up to you to decide which solution is best for your application.</p> <h4>Navbar Dropdowns</h4> <p>The <code>.dropdown-backdrop</code> element isn't used on iOS in the nav because of the complexity of z-indexing. Thus, to close dropdowns in navbars, you must directly click the dropdown element (or any other element which will fire a click event in iOS).</p> @@ -185,5 +188,5 @@ $(function () { }) </script> {% endhighlight %} - <p>Want to see an example? <a href="http://jsbin.com/OyaqoDO/2">Check out this JS Bin demo.</a></p> + <p>Want to see an example? <a href="http://jsbin.com/kuvoz/1">Check out this JS Bin demo.</a></p> </div> diff --git a/docs/_includes/getting-started/examples.html b/docs/_includes/getting-started/examples.html index bf87a2cec..b1739f1d7 100644 --- a/docs/_includes/getting-started/examples.html +++ b/docs/_includes/getting-started/examples.html @@ -1,7 +1,7 @@ <div class="bs-docs-section"> <h1 id="examples" class="page-header">Examples</h1> - <p class="lead">Build on the basic template above with Bootstrap's many components. See also <a href="#customizing">Customizing Bootstrap</a> for tips on maintaining your own Bootstrap variants.</p> + <p class="lead">Build on the basic template above with Bootstrap's many components. We encourage you to customize and adapt Bootstrap to suit your individual project's needs.</p> <h3 id="examples-framework">Using the framework</h3> <div class="row bs-examples"> @@ -119,7 +119,7 @@ <img src="../examples/screenshots/justified-nav.jpg" alt=""> </a> <h4>Justified nav</h4> - <p>Create a custom navbar with justified links. Heads up! <a href="../components/#nav-justified">Not too WebKit friendly.</a></p> + <p>Create a custom navbar with justified links. Heads up! <a href="../components/#nav-justified">Not too Safari friendly.</a></p> </div> <div class="clearfix visible-xs"></div> @@ -155,12 +155,5 @@ <h4>Offcanvas</h4> <p>Build a toggleable off-canvas navigation menu for use with Bootstrap.</p> </div> - <div class="col-xs-6 col-md-4"> - <a class="thumbnail" href="../examples/equal-height-columns/"> - <img src="../examples/screenshots/equal-height-columns.jpg" alt=""> - </a> - <h4>Equal-height grid columns</h4> - <p>Adds automatic equal-height grid columns to Bootstrap's grid system.</p> - </div> </div> </div> diff --git a/docs/_includes/header.html b/docs/_includes/header.html index e60853ef4..6f0227da2 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -6,7 +6,7 @@ <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"> <title> - {% if page.title == "Bootstrap" %} + {% if page.url == site.baseurl %} {{ page.title }} {% else %} {{ page.title }} · Bootstrap @@ -14,17 +14,28 @@ </title> <!-- Bootstrap core CSS --> +{% if site.github %} <link href="../dist/css/bootstrap.min.css" rel="stylesheet"> +{% else %} +<link href="../dist/css/bootstrap.css" rel="stylesheet"> +{% endif %} {% if page.slug == "css" or page.slug == "components" or page.slug == "js" %} <!-- Optional Bootstrap Theme --> +{% if site.github %} <link href="data:text/css;charset=utf-8," data-href="../dist/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet"> +{% else %} + <link href="data:text/css;charset=utf-8," data-href="../dist/css/bootstrap-theme.css" rel="stylesheet" id="bs-theme-stylesheet"> +{% endif %} {% endif %} <!-- Documentation extras --> +{% if site.github %} <link href="../assets/css/docs.min.css" rel="stylesheet"> +{% else %} +<link href="../assets/css/src/docs.css" rel="stylesheet"> +<link href="../assets/css/src/pygments-manni.css" rel="stylesheet"> +{% endif %} <!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> -<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> -<script src="../assets/js/ie10-viewport-bug-workaround.js"></script> <script src="../assets/js/ie-emulation-modes-warning.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> diff --git a/docs/_includes/js/affix.html b/docs/_includes/js/affix.html index 4ce51cb34..56168d6a8 100644 --- a/docs/_includes/js/affix.html +++ b/docs/_includes/js/affix.html @@ -14,8 +14,8 @@ <p>Here's how the affix plugin works:</p> <ol> <li>To start, the plugin adds <code>.affix-top</code> to indicate the element is in its top-most position. At this point no CSS positioning is required.</li> - <li>Scrolling past the element you want affixed should trigger the actual affixing. This is where <code>.affix</code> replaces <code>.affix-top</code> and sets <code>position: fixed;</code> (provided by Bootstrap's code CSS).</li> - <li>If a bottom offset is defined, scrolling past that should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.</li> + <li>Scrolling past the element you want affixed should trigger the actual affixing. This is where <code>.affix</code> replaces <code>.affix-top</code> and sets <code>position: fixed;</code> (provided by Bootstrap's CSS).</li> + <li>If a bottom offset is defined, scrolling past it should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.</li> </ol> <p>Follow the above steps to set your CSS for either of the usage options below.</p> @@ -31,14 +31,14 @@ <h3>Via JavaScript</h3> <p>Call the affix plugin via JavaScript:</p> {% highlight js %} - $('#my-affix').affix({ - offset: { - top: 100 - , bottom: function () { - return (this.bottom = $('.footer').outerHeight(true)) - } +$('#myAffix').affix({ + offset: { + top: 100, + bottom: function () { + return (this.bottom = $('.footer').outerHeight(true)) } - }) + } +}) {% endhighlight %} @@ -75,7 +75,7 @@ <h3>Events</h3> - <p>Bootstrap's affix class exposes a few events for hooking into affix functionality.</p> + <p>Bootstrap's affix plugin exposes a few events for hooking into affix functionality.</p> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html index 351301533..e9a3120de 100644 --- a/docs/_includes/js/alerts.html +++ b/docs/_includes/js/alerts.html @@ -3,15 +3,13 @@ <h2 id="alerts-examples">Example alerts</h2> <p>Add dismiss functionality to all alert messages with this plugin.</p> - <div class="bs-example"> - <div class="alert alert-warning fade in" role="alert"> + <div class="bs-example bs-example-standalone"> + <div class="alert alert-warning alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good. </div> - </div><!-- /example --> - <div class="bs-example"> - <div class="alert alert-danger fade in" role="alert"> + <div class="alert alert-danger alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4>Oh snap! You got an error!</h4> <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p> @@ -24,25 +22,29 @@ <h2 id="alerts-usage">Usage</h2> - <p>Enable dismissal of an alert via JavaScript:</p> - {% highlight js %}$(".alert").alert(){% endhighlight %} - <h3>Markup</h3> - <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p> - {% highlight html %}<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>{% endhighlight %} + <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality. Closing an alert removes it from the DOM.</p> + +{% highlight html %} +<button type="button" class="close" data-dismiss="alert"> + <span aria-hidden="true">×</span> + <span class="sr-only">Close</span> +</button> +{% endhighlight %} + + <p>To have your alerts use animation when closing, make sure they have the <code>.fade</code> and <code>.in</code> classes already applied to them.</p> <h3>Methods</h3> <h4>$().alert()</h4> - <p>Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p> + <p>Makes an alert listen for click events on descendant elements which have the <code>data-dismiss="alert"</code> attribute. (Not necessary when using the data-api's auto-initialization.)</p> - <h4>.alert('close')</h4> - <p>Closes an alert.</p> - {% highlight js %}$(".alert").alert('close'){% endhighlight %} + <h4>$().alert('close')</h4> + <p>Closes an alert by removing it from the DOM. If the <code>.fade</code> and <code>.in</code> classes are present on the element, the alert will fade out before it is removed.</p> <h3>Events</h3> - <p>Bootstrap's alert class exposes a few events for hooking into alert functionality.</p> + <p>Bootstrap's alert plugin exposes a few events for hooking into alert functionality.</p> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> @@ -64,7 +66,7 @@ </table> </div><!-- /.table-responsive --> {% highlight js %} -$('#my-alert').on('closed.bs.alert', function () { +$('#myAlert').on('closed.bs.alert', function () { // do something… }) {% endhighlight %} diff --git a/docs/_includes/js/buttons.html b/docs/_includes/js/buttons.html index 154320e48..f07e716c8 100644 --- a/docs/_includes/js/buttons.html +++ b/docs/_includes/js/buttons.html @@ -1,161 +1,134 @@ <div class="bs-docs-section"> <h1 id="buttons" class="page-header">Buttons <small>button.js</small></h1> - <h2 id="buttons-examples">Example uses</h2> - <p>Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p> + <p class="lead">Do more with buttons. Control button states or create groups of buttons for more components like toolbars.</p> - <h4>Stateful</h4> + <div class="bs-callout bs-callout-danger"> + <h4>Cross-browser compatibility</h4> + <p><a href="https://github.com/twbs/bootstrap/issues/793">Firefox persists form control states (disabledness and checkedness) across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.</p> + </div> + + <h2 id="buttons-stateful">Stateful</h2> <p>Add <code>data-loading-text="Loading..."</code> to use a loading state on a button.</p> - <div class="bs-example" style="padding-bottom: 24px;"> - <button type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary"> + <div class="bs-callout bs-callout-info"> + <h4>Use whichever state you like!</h4> + <p>For the sake of this demonstration, we are using <code>data-loading-text</code> and <code>$().button('loading')</code>, but that's not the only state you can use. <a href="#buttons-methods">See more on this below in the <code>$().button(string)</code> documentation</a>.</p> + </div> + <div class="bs-example"> + <button type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary" autocomplete="off"> Loading state </button> </div><!-- /example --> {% highlight html %} -<button type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary"> +<button type="button" id="myButton" data-loading-text="Loading..." class="btn btn-primary" autocomplete="off"> Loading state </button> + <script> - $('#loading-example-btn').click(function () { - var btn = $(this) - btn.button('loading') - $.ajax(...).always(function () { - btn.button('reset') - }); - }); + $('#myButton').on('click', function () { + var $btn = $(this).button('loading') + // business logic... + $btn.button('reset') + }) </script> {% endhighlight %} - <h4>Single toggle</h4> + <h2 id="buttons-single-toggle">Single toggle</h2> <p>Add <code>data-toggle="button"</code> to activate toggling on a single button.</p> - <div class="bs-example" style="padding-bottom: 24px;"> - <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button> + <div class="bs-example"> + <button type="button" class="btn btn-primary" data-toggle="button" autocomplete="off"> + Single toggle + </button> </div><!-- /example --> {% highlight html %} -<button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button> +<button type="button" class="btn btn-primary" data-toggle="button" autocomplete="off"> + Single toggle +</button> {% endhighlight %} - <h4>Checkbox</h4> - <p>Add <code>data-toggle="buttons"</code> to a group of checkboxes for checkbox style toggling on btn-group.</p> + <h2 id="buttons-checkbox-radio">Checkbox / Radio</h2> + <p>Add <code>data-toggle="buttons"</code> to a <code>.btn-group</code> containing checkbox or radio inputs to enable toggling in their respective styles.</p> <div class="bs-callout bs-callout-warning"> - <h4>Pre-checked options need <code>.active</code></h4> - <p>For pre-checked options, you must add the <code>.active</code> class to the input's <code>label</code> yourself.</p> + <h4>Preselected options need <code>.active</code></h4> + <p>For preselected options, you must add the <code>.active</code> class to the input's <code>label</code> yourself.</p> + </div> + <div class="bs-callout bs-callout-warning"> + <h4>Visual checked state only updated on click</h4> + <p>If the checked state of a checkbox button is updated without firing a <code>click</code> event on the button (e.g. via <code><input type="reset"></code> or via setting the <code>checked</code> property of the input), you will need to toggle the <code>.active</code> class on the input's <code>label</code> yourself.</p> </div> - <div class="bs-example" style="padding-bottom: 24px;"> + <div class="bs-example"> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> - <input type="checkbox" checked> Option 1 (pre-checked) + <input type="checkbox" checked autocomplete="off"> Checkbox 1 (pre-checked) </label> <label class="btn btn-primary"> - <input type="checkbox"> Option 2 + <input type="checkbox" autocomplete="off"> Checkbox 2 </label> <label class="btn btn-primary"> - <input type="checkbox"> Option 3 + <input type="checkbox" autocomplete="off"> Checkbox 3 </label> </div> </div><!-- /example --> {% highlight html %} <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> - <input type="checkbox" checked> Option 1 (pre-checked) + <input type="checkbox" autocomplete="off" checked> Checkbox 1 (pre-checked) </label> <label class="btn btn-primary"> - <input type="checkbox"> Option 2 + <input type="checkbox" autocomplete="off"> Checkbox 2 </label> <label class="btn btn-primary"> - <input type="checkbox"> Option 3 + <input type="checkbox" autocomplete="off"> Checkbox 3 </label> </div> {% endhighlight %} - <h4>Radio</h4> - <p>Add <code>data-toggle="buttons"</code> to a group of radio inputs for radio style toggling on btn-group.</p> - <div class="bs-callout bs-callout-warning"> - <h4>Preselected options need <code>.active</code></h4> - <p>For preselected options, you must add the <code>.active</code> class to the input's <code>label</code> yourself.</p> - </div> - <div class="bs-example" style="padding-bottom: 24px;"> + <div class="bs-example"> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> - <input type="radio" name="options" id="option1" checked> Option 1 (preselected) + <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected) </label> <label class="btn btn-primary"> - <input type="radio" name="options" id="option2"> Option 2 + <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2 </label> <label class="btn btn-primary"> - <input type="radio" name="options" id="option3"> Option 3 + <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3 </label> </div> </div><!-- /example --> {% highlight html %} <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> - <input type="radio" name="options" id="option1" checked> Option 1 (preselected) + <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected) </label> <label class="btn btn-primary"> - <input type="radio" name="options" id="option2"> Option 2 + <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2 </label> <label class="btn btn-primary"> - <input type="radio" name="options" id="option3"> Option 3 + <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3 </label> </div> {% endhighlight %} - - <h2 id="buttons-usage">Usage</h2> - <p>Enable buttons via JavaScript:</p> -{% highlight js %} -$('.btn').button() -{% endhighlight %} - - <h3>Markup</h3> - <p>Data attributes are integral to the button plugin. Check out the example code below for the various markup types.</p> - - <h3>Options</h3> - <p><em>None</em></p> - - <h3>Methods</h3> + <h2 id="buttons-methods">Methods</h2> <h4>$().button('toggle')</h4> <p>Toggles push state. Gives the button the appearance that it has been activated.</p> - <div class="bs-callout bs-callout-info"> - <h4>Auto toggling</h4> - <p>You can enable auto toggling of a button by using the <code>data-toggle</code> attribute.</p> - </div> -{% highlight html %} -<button type="button" class="btn btn-primary" data-toggle="button">...</button> -{% endhighlight %} - - <h4>$().button('loading')</h4> - <p>Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute <code>data-loading-text</code>. - </p> -{% highlight html %} -<button id="loading-example-btn" type="button" class="btn btn-primary" data-loading-text="loading stuff...">...</button> -<script> - $('#loading-example-btn').click(function () { - var btn = $(this) - btn.button('loading') - $.ajax(...).always(function () { - btn.button('reset') - }); - }); -</script> -{% endhighlight %} - - <div class="bs-callout bs-callout-danger"> - <h4>Cross-browser compatibility</h4> - <p><a href="https://github.com/twbs/bootstrap/issues/793">Firefox persists the disabled state across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.</p> - </div> <h4>$().button('reset')</h4> <p>Resets button state - swaps text to original text.</p> <h4>$().button(string)</h4> - <p>Resets button state - swaps text to any data defined text state.</p> + <p>Swaps text to any data defined text state.</p> {% highlight html %} -<button type="button" class="btn btn-primary" data-complete-text="finished!" >...</button> +<button type="button" id="myStateButton" data-complete-text="finished!" class="btn btn-primary" autocomplete="off"> + ... +</button> + <script> - $('.btn').button('complete') + $('#myStateButton').on('click', function () { + $(this).button('complete') // button text will be "finished!" + }) </script> {% endhighlight %} </div> diff --git a/docs/_includes/js/carousel.html b/docs/_includes/js/carousel.html index b8a0d1e4b..23f9af97a 100644 --- a/docs/_includes/js/carousel.html +++ b/docs/_includes/js/carousel.html @@ -1,8 +1,9 @@ <div class="bs-docs-section"> <h1 id="carousel" class="page-header">Carousel <small>carousel.js</small></h1> + <p>A slideshow component for cycling through elemnts, like a carousel. <strong>Nested carousels are not supported.</strong></p> + <h2 id="carousel-examples">Examples</h2> - <p>The slideshow below shows a generic plugin and component for cycling through elements like a carousel.</p> <div class="bs-example"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> @@ -10,7 +11,7 @@ <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> - <div class="carousel-inner"> + <div class="carousel-inner" role="listbox"> <div class="item active"> <img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide"> </div> @@ -23,9 +24,11 @@ </div> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> + <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> + <span class="sr-only">Next</span> </a> </div> </div><!-- /example --> @@ -39,7 +42,7 @@ </ol> <!-- Wrapper for slides --> - <div class="carousel-inner"> + <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="..." alt="..."> <div class="carousel-caption"> @@ -58,9 +61,11 @@ <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> + <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> + <span class="sr-only">Next</span> </a> </div> {% endhighlight %} @@ -79,7 +84,7 @@ <li data-target="#carousel-example-captions" data-slide-to="1"></li> <li data-target="#carousel-example-captions" data-slide-to="2"></li> </ol> - <div class="carousel-inner"> + <div class="carousel-inner" role="listbox"> <div class="item active"> <img data-src="holder.js/900x500/auto/#777:#777" alt="First slide image"> <div class="carousel-caption"> @@ -104,9 +109,11 @@ </div> <a class="left carousel-control" href="#carousel-example-captions" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> + <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-captions" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> + <span class="sr-only">Next</span> </a> </div> </div><!-- /example --> @@ -132,7 +139,7 @@ <h3>Via data attributes</h3> <p>Use data attributes to easily control the position of the carousel. <code>data-slide</code> accepts the keywords <code>prev</code> or <code>next</code>, which alters the slide position relative to its current position. Alternatively, use <code>data-slide-to</code> to pass a raw slide index to the carousel <code>data-slide-to="2"</code>, which shifts the slide position to a particular index beginning with <code>0</code>.</p> - <p>The <code>data-ride="carousel"</code> attribute is used to mark a carousel as animating starting at page load.</p> + <p>The <code>data-ride="carousel"</code> attribute is used to mark a carousel as animating starting at page load. <strong class="text-danger">It cannot be used in combination with (redundant and unnecessary) explicit JavaScript initialization of the same carousel.</strong></p> <h3>Via JavaScript</h3> <p>Call carousel manually with:</p> diff --git a/docs/_includes/js/collapse.html b/docs/_includes/js/collapse.html index e878cdb09..4e7fb450a 100644 --- a/docs/_includes/js/collapse.html +++ b/docs/_includes/js/collapse.html @@ -13,7 +13,7 @@ <p>Using the collapse plugin, we built a simple accordion by extending the panel component.</p> <div class="bs-example"> - <div class="panel-group" id="accordion"> + <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> @@ -22,7 +22,7 @@ </a> </h4> </div> - <div id="collapseOne" class="panel-collapse collapse in"> + <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> @@ -36,7 +36,7 @@ </a> </h4> </div> - <div id="collapseTwo" class="panel-collapse collapse"> + <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> @@ -50,7 +50,7 @@ </a> </h4> </div> - <div id="collapseThree" class="panel-collapse collapse"> + <div id="collapseThree" class="panel-collapse collapse" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> @@ -59,7 +59,7 @@ </div> </div><!-- /example --> {% highlight html %} -<div class="panel-group" id="accordion"> +<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> @@ -68,7 +68,7 @@ </a> </h4> </div> - <div id="collapseOne" class="panel-collapse collapse in"> + <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> @@ -82,7 +82,7 @@ </a> </h4> </div> - <div id="collapseTwo" class="panel-collapse collapse"> + <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> @@ -96,7 +96,7 @@ </a> </h4> </div> - <div id="collapseThree" class="panel-collapse collapse"> + <div id="collapseThree" class="panel-collapse collapse" role="tabpanel"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> diff --git a/docs/_includes/js/dropdowns.html b/docs/_includes/js/dropdowns.html index 27b06fe95..6e4710155 100644 --- a/docs/_includes/js/dropdowns.html +++ b/docs/_includes/js/dropdowns.html @@ -9,7 +9,7 @@ <nav id="navbar-example" class="navbar navbar-default navbar-static" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-collapse"> + <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> @@ -20,7 +20,10 @@ <div class="collapse navbar-collapse bs-example-js-navbar-collapse"> <ul class="nav navbar-nav"> <li class="dropdown"> - <a id="drop1" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a> + <a id="drop1" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul class="dropdown-menu" role="menu" aria-labelledby="drop1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -30,7 +33,10 @@ </ul> </li> <li class="dropdown"> - <a href="#" id="drop2" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 2 <span class="caret"></span></a> + <a id="drop2" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul class="dropdown-menu" role="menu" aria-labelledby="drop2"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -42,7 +48,10 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li id="fat-menu" class="dropdown"> - <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">Dropdown 3 <span class="caret"></span></a> + <a id="drop3" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul class="dropdown-menu" role="menu" aria-labelledby="drop3"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -59,10 +68,13 @@ <h3>Within pills</h3> <div class="bs-example"> - <ul class="nav nav-pills"> - <li class="active"><a href="#">Regular link</a></li> - <li class="dropdown"> - <a id="drop4" role="button" data-toggle="dropdown" href="#">Dropdown <span class="caret"></span></a> + <ul class="nav nav-pills" role="tablist"> + <li role="presentation" class="active"><a href="#">Regular link</a></li> + <li role="presentation" class="dropdown"> + <a id="drop4" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul id="menu1" class="dropdown-menu" role="menu" aria-labelledby="drop4"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -71,8 +83,11 @@ <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li> </ul> </li> - <li class="dropdown"> - <a id="drop5" role="button" data-toggle="dropdown" href="#">Dropdown 2 <span class="caret"></span></a> + <li role="presentation" class="dropdown"> + <a id="drop5" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul id="menu2" class="dropdown-menu" role="menu" aria-labelledby="drop5"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -81,8 +96,11 @@ <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Separated link</a></li> </ul> </li> - <li class="dropdown"> - <a id="drop6" role="button" data-toggle="dropdown" href="#">Dropdown 3 <span class="caret"></span></a> + <li role="presentation" class="dropdown"> + <a id="drop6" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown + <span class="caret"></span> + </a> <ul id="menu3" class="dropdown-menu" role="menu" aria-labelledby="drop6"> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="http://twitter.com/fat">Another action</a></li> @@ -96,26 +114,31 @@ <h2 id="dropdowns-usage">Usage</h2> - <p>Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the <code>.open</code> class on the parent list item. When opened, the plugin also adds <code>.dropdown-backdrop</code> as a click area for closing dropdown menus when clicking outside the menu. Note: The <code>data-toggle=dropdown</code> attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.</p> + <p>Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the <code>.open</code> class on the parent list item.</p> + <p>On mobile devices, opening a dropdown adds a <code>.dropdown-backdrop</code> as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. <strong class="text-danger">This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.</strong></p> + <p>Note: The <code>data-toggle="dropdown"</code> attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.</p> <h3>Via data attributes</h3> <p>Add <code>data-toggle="dropdown"</code> to a link or button to toggle a dropdown.</p> {% highlight html %} <div class="dropdown"> - <a data-toggle="dropdown" href="#">Dropdown trigger</a> + <button id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown trigger + <span class="caret"></span> + </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> ... </ul> </div> {% endhighlight %} - <p>To keep URLs intact, use the <code>data-target</code> attribute instead of <code>href="#"</code>.</p> + <p>To keep URLs intact with link buttons, use the <code>data-target</code> attribute instead of <code>href="#"</code>.</p> {% highlight html %} <div class="dropdown"> - <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html"> - Dropdown <span class="caret"></span> + <a id="dLabel" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Dropdown trigger + <span class="caret"></span> </a> - <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> ... </ul> diff --git a/docs/_includes/js/modal.html b/docs/_includes/js/modal.html index c1cc6f055..d5b1aee84 100644 --- a/docs/_includes/js/modal.html +++ b/docs/_includes/js/modal.html @@ -67,7 +67,7 @@ <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> - <h4 class="modal-title" id="myModalLabel">Modal Heading</h4> + <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> <h4>Text in a modal</h4> @@ -259,7 +259,9 @@ <td>remote</td> <td>path</td> <td>false</td> - <td><p>If a remote URL is provided, <strong>content will be loaded one time</strong> via jQuery's <code>load</code> method and injected into the <code>.modal-content</code> div. If you're using the data-api, you may alternatively use the <code>href</code> attribute to specify the remote source. An example of this is shown below:</p> + <td> + <p><span class="text-danger">This option is deprecated since v3.2.1 and will be removed in v4.</span> We recommend instead using client-side templating or a data binding framework, or calling <a href="http://api.jquery.com/load/">jQuery.load</a> yourself.</p> + <p>If a remote URL is provided, <strong>content will be loaded one time</strong> via jQuery's <code>load</code> method and injected into the <code>.modal-content</code> div. If you're using the data-api, you may alternatively use the <code>href</code> attribute to specify the remote source. An example of this is shown below:</p> {% highlight html %} <a data-toggle="modal" href="remote.html" data-target="#modal">Click me</a> {% endhighlight %} @@ -320,7 +322,7 @@ $('#myModal').modal({ </tr> <tr> <td>loaded.bs.modal</td> - <td>This event is fired when the modal has loaded content using the remote option.</td> + <td>This event is fired when the modal has loaded content using the <code>remote</code> option.</td> </tr> </tbody> </table> diff --git a/docs/_includes/js/overview.html b/docs/_includes/js/overview.html index 2ef8fe850..2a3c41a8b 100644 --- a/docs/_includes/js/overview.html +++ b/docs/_includes/js/overview.html @@ -47,6 +47,12 @@ $('#myModal').modal('show') // initializes and invokes show immed <p>Each plugin also exposes its raw constructor on a <code>Constructor</code> property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel="popover"]').data('popover')</code>.</p> + <h4>Default settings</h4> + <p>You can change the default settings for a plugin by modifying the plugin's <code>Constructor.DEFAULTS</code> object:<p> +{% highlight js %} +$.fn.modal.Constructor.DEFAULTS.keyboard = false // changes default for the modal plugin's `keyboard` option to false +{% endhighlight %} + <h3 id="js-noconflict">No conflict</h3> <p>Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call <code>.noConflict</code> on the plugin you wish to revert the value of.</p> {% highlight js %} @@ -64,6 +70,9 @@ $('#myModal').on('show.bs.modal', function (e) { }) {% endhighlight %} + <h3 id="js-disabled">No special fallbacks when JavaScript is disabled</h3> + <p>Bootstrap's plugins don't fall back particularly gracefully when JavaScript is disabled. If you care about the user experience in this case, use <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript"><code><noscript></code></a> to explain the situation (and how to re-enable JavaScript) to your users, and/or add your own custom fallbacks.</p> + <div class="bs-callout bs-callout-warning" id="callout-third-party-libs"> <h4>Third-party libraries</h4> <p><strong>Bootstrap does not officially support third-party JavaScript libraries</strong> like Prototype or jQuery UI. Despite <code>.noConflict</code> and namespaced events, there may be compatibility problems that you need to fix on your own.</p> diff --git a/docs/_includes/js/popovers.html b/docs/_includes/js/popovers.html index 2ee670741..108b51205 100644 --- a/docs/_includes/js/popovers.html +++ b/docs/_includes/js/popovers.html @@ -3,6 +3,7 @@ <h2 id="popovers-examples">Examples</h2> <p>Add small overlays of content, like those on the iPad, to any element for housing secondary information.</p> + <p>Popovers whose both title and content are zero-length are never displayed.</p> <div class="bs-callout bs-callout-danger"> <h4>Plugin dependency</h4> @@ -24,6 +25,10 @@ <h4>Popovers on disabled elements require wrapper elements</h4> <p>To add a popover to a <code>disabled</code> or <code>.disabled</code> element, put the element inside of a <code><div></code> and apply the popover to that <code><div></code> instead.</p> </div> + <div class="bs-callout bs-callout-info"> + <h4>Multiple-line links</h4> + <p>Sometimes you want to add a popover to a hyperlink that wraps multiple lines. The default behavior of the popover plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p> + </div> <h3>Static popover</h3> <p>Four options are available: top, right, bottom, and left aligned.</p> @@ -73,8 +78,8 @@ {% endhighlight %} <h4>Four directions</h4> - <div class="bs-example tooltip-demo"> - <div class="bs-example-tooltips"> + <div class="bs-example popover-demo"> + <div class="bs-example-popovers"> <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> Popover on left </button> @@ -109,24 +114,18 @@ sagittis lacus vel augue laoreet rutrum faucibus."> {% endhighlight %} <h4>Dismiss on next click</h4> - <p>Use the <code>focus</code> trigger to dismiss popovers on their next click.</p> + <p>Use the <code>focus</code> trigger to dismiss popovers on the next click that the user makes.</p> + <div class="bs-callout bs-callout-danger"> + <h4>Specific markup required for dismiss-on-next-click</h4> + <p>For proper cross-browser and cross-platform behavior, you must use the <code><a></code> tag, <i>not</i> the <code><button></code> tag, and you also must include a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#tabindex"><code>tabindex</code></a> attribute.</p> + </div> <div class="bs-example" style="padding-bottom: 24px;"> - <button type="button" class="btn btn-lg btn-danger bs-docs-popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button> + <a href="#" tabindex="0" class="btn btn-lg btn-danger bs-docs-popover" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a> </div> {% highlight html %} -<button type="button" class="btn btn-lg btn-danger popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button> -{% endhighlight %} -{% highlight js %} -$('.popover-dismiss').popover({ - trigger: 'focus' -}) +<a href="#" tabindex="0" class="btn btn-lg btn-danger" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a> {% endhighlight %} - <div class="bs-callout bs-callout-warning"> - <h4>Multiple-line links</h4> - <p>Sometimes you want to add a popover to a hyperlink that wraps multiple lines. The default behavior of the popover plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p> - </div> - <h2 id="popovers-usage">Usage</h2> <p>Enable popovers via JavaScript:</p> @@ -156,7 +155,7 @@ $('.popover-dismiss').popover({ <td>string | false</td> <td>false</td> <td> - <p>Appends the popover to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.</p> + <p>Appends the popover to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.</p> </td> </tr> <tr> @@ -165,7 +164,7 @@ $('.popover-dismiss').popover({ <td>''</td> <td> <p>Default content value if <code>data-content</code> attribute isn't present.</p> - <p>If a function is given, it will be called with 1 argument, which is the element that the popover is attached to.</p> + <p>If a function is given, it will be called with its <code>this</code> reference set to the element that the popover is attached to.</p> </td> </tr> <tr> @@ -175,7 +174,7 @@ $('.popover-dismiss').popover({ <td> <p>Delay showing and hiding the popover (ms) - does not apply to manual trigger type</p> <p>If a number is supplied, delay is applied to both hide/show</p> - <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p> + <p>Object structure is: <code>delay: { "show": 500, "hide": 100 }</code></p> </td> </tr> <tr> @@ -188,31 +187,37 @@ $('.popover-dismiss').popover({ <td>placement</td> <td>string | function</td> <td>'right'</td> - <td>How to position the popover - top | bottom | left | right | auto.<br> When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.</td> + <td> + <p>How to position the popover - top | bottom | left | right | auto.<br>When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.</p> + <p>When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the popover instance.</p> + </td> </tr> <tr> <td>selector</td> <td>string</td> <td>false</td> - <td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsfiddle.net/fScua/">an informative example</a>.</td> + <td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsbin.com/zopod/1/edit">an informative example</a>.</td> </tr> <tr> <td>template</td> <td>string</td> <td><code>'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'</code></td> <td> - <p>Base HTML to use when creating the popover.</p> - <p>The popover's <code>title</code> will be injected into the <code>.popover-title</code>.</p> - <p>The popover's <code>content</code> will be injected into the <code>.popover-content</code>.</p> - <p><code>.arrow</code> will become the popover's arrow.</p> - <p>The outermost wrapper element should have the <code>.popover</code> class.</p> + <p>Base HTML to use when creating the popover.</p> + <p>The popover's <code>title</code> will be injected into the <code>.popover-title</code>.</p> + <p>The popover's <code>content</code> will be injected into the <code>.popover-content</code>.</p> + <p><code>.arrow</code> will become the popover's arrow.</p> + <p>The outermost wrapper element should have the <code>.popover</code> class.</p> </td> </tr> <tr> <td>title</td> <td>string | function</td> <td>''</td> - <td>Default title value if <code>title</code> attribute isn't present</td> + <td> + <p>Default title value if <code>title</code> attribute isn't present.</p> + <p>If a function is given, it will be called with its <code>this</code> reference set to the element that the popover is attached to.</p> + </td> </tr> <tr> <td>trigger</td> @@ -221,12 +226,12 @@ $('.popover-dismiss').popover({ <td>How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</td> </tr> <tr> - <td>viewport</td> - <td>string | object</td> - <td>{ selector: 'body', padding: 0 }</td> - <td> - <p>Keeps the popover within the bounds of this element. Example: <code>viewport: '#viewport'</code> or <code>{ selector: '#viewport', padding: 0 }</code></p> - </td> + <td>viewport</td> + <td>string | object</td> + <td>{ selector: 'body', padding: 0 }</td> + <td> + <p>Keeps the popover within the bounds of this element. Example: <code>viewport: '#viewport'</code> or <code>{ "selector": "#viewport", "padding": 0 }</code></p> + </td> </tr> </tbody> </table> @@ -259,28 +264,28 @@ $('.popover-dismiss').popover({ <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> - <tr> - <th style="width: 150px;">Event Type</th> - <th>Description</th> - </tr> + <tr> + <th style="width: 150px;">Event Type</th> + <th>Description</th> + </tr> </thead> <tbody> - <tr> - <td>show.bs.popover</td> - <td>This event fires immediately when the <code>show</code> instance method is called.</td> - </tr> - <tr> - <td>shown.bs.popover</td> - <td>This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).</td> - </tr> - <tr> - <td>hide.bs.popover</td> - <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td> - </tr> - <tr> - <td>hidden.bs.popover</td> - <td>This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).</td> - </tr> + <tr> + <td>show.bs.popover</td> + <td>This event fires immediately when the <code>show</code> instance method is called.</td> + </tr> + <tr> + <td>shown.bs.popover</td> + <td>This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).</td> + </tr> + <tr> + <td>hide.bs.popover</td> + <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td> + </tr> + <tr> + <td>hidden.bs.popover</td> + <td>This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).</td> + </tr> </tbody> </table> </div><!-- /.table-responsive --> diff --git a/docs/_includes/js/scrollspy.html b/docs/_includes/js/scrollspy.html index 2ceedb0ca..c68ec32a4 100644 --- a/docs/_includes/js/scrollspy.html +++ b/docs/_includes/js/scrollspy.html @@ -7,7 +7,7 @@ <nav id="navbar-example2" class="navbar navbar-default navbar-static" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> - <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-scrollspy"> + <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-scrollspy"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> diff --git a/docs/_includes/js/tabs.html b/docs/_includes/js/tabs.html index 38518f0b1..39c244e8e 100644 --- a/docs/_includes/js/tabs.html +++ b/docs/_includes/js/tabs.html @@ -5,9 +5,9 @@ <p>Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.</p> <div class="bs-example bs-example-tabs"> <ul id="myTab" class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> - <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> - <li class="dropdown"> + <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> + <li role="presentation"><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> + <li role="presentation" class="dropdown"> <a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop1"> <li><a href="#dropdown1" tabindex="-1" role="tab" data-toggle="tab">@fat</a></li> @@ -16,16 +16,16 @@ </li> </ul> <div id="myTabContent" class="tab-content"> - <div class="tab-pane fade in active" id="home"> + <div role="tabpanel" class="tab-pane fade in active" id="home"> <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> </div> - <div class="tab-pane fade" id="profile"> + <div role="tabpanel" class="tab-pane fade" id="profile"> <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p> </div> - <div class="tab-pane fade" id="dropdown1"> + <div role="tabpanel" class="tab-pane fade" id="dropdown1"> <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p> </div> - <div class="tab-pane fade" id="dropdown2"> + <div role="tabpanel" class="tab-pane fade" id="dropdown2"> <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p> </div> </div> @@ -61,18 +61,18 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed) {% highlight html %} <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> - <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> - <li><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> - <li><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> + <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> + <li role="presentation"><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> + <li role="presentation"><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> + <li role="presentation"><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> - <div class="tab-pane active" id="home">...</div> - <div class="tab-pane" id="profile">...</div> - <div class="tab-pane" id="messages">...</div> - <div class="tab-pane" id="settings">...</div> + <div role="tabpanel" class="tab-pane active" id="home">...</div> + <div role="tabpanel" class="tab-pane" id="profile">...</div> + <div role="tabpanel" class="tab-pane" id="messages">...</div> + <div role="tabpanel" class="tab-pane" id="settings">...</div> </div> {% endhighlight %} @@ -80,10 +80,10 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed) <p>To make tabs fade in, add <code>.fade</code> to each <code>.tab-pane</code>. The first tab pane must also have <code>.in</code> to properly fade in initial content.</p> {% highlight html %} <div class="tab-content"> - <div class="tab-pane fade in active" id="home">...</div> - <div class="tab-pane fade" id="profile">...</div> - <div class="tab-pane fade" id="messages">...</div> - <div class="tab-pane fade" id="settings">...</div> + <div role="tabpanel" class="tab-pane fade in active" id="home">...</div> + <div role="tabpanel" class="tab-pane fade" id="profile">...</div> + <div role="tabpanel" class="tab-pane fade" id="messages">...</div> + <div role="tabpanel" class="tab-pane fade" id="settings">...</div> </div> {% endhighlight %} @@ -94,17 +94,17 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed) </p> {% highlight html %} <ul class="nav nav-tabs" role="tablist" id="myTab"> - <li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> - <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> - <li><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> - <li><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> + <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> + <li role="presentation"><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> + <li role="presentation"><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> + <li role="presentation"><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> </ul> <div class="tab-content"> - <div class="tab-pane active" id="home">...</div> - <div class="tab-pane" id="profile">...</div> - <div class="tab-pane" id="messages">...</div> - <div class="tab-pane" id="settings">...</div> + <div role="tabpanel" class="tab-pane active" id="home">...</div> + <div role="tabpanel" class="tab-pane" id="profile">...</div> + <div role="tabpanel" class="tab-pane" id="messages">...</div> + <div role="tabpanel" class="tab-pane" id="settings">...</div> </div> <script> diff --git a/docs/_includes/js/tooltips.html b/docs/_includes/js/tooltips.html index 5a43c1ddd..127e10155 100644 --- a/docs/_includes/js/tooltips.html +++ b/docs/_includes/js/tooltips.html @@ -1,8 +1,9 @@ <div class="bs-docs-section"> <h1 id="tooltips" class="page-header">Tooltips <small>tooltip.js</small></h1> + <p>Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.</p> + <p>Tooltips with zero-length titles are never displayed.</p> <h2 id="tooltips-examples">Examples</h2> - <p>Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.</p> <p>Hover over the links below to see tooltips:</p> <div class="bs-example tooltip-demo"> <p class="muted" style="margin-bottom: 0;">Tight pants next level keffiyeh <a href="#" data-toggle="tooltip" title="Default tooltip">you probably</a> haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel <a href="#" data-toggle="tooltip" title="Another tooltip">have a</a> terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan <a href="#" data-toggle="tooltip" title="Another one here too">whatever keytar</a>, scenester farm-to-table banksy Austin <a href="#" data-toggle="tooltip" title="The last tip!">twitter handle</a> freegan cred raw denim single-origin coffee viral. @@ -58,7 +59,7 @@ $('#example').tooltip(options) <h4>Multiple-line links</h4> <p>Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p> </div> -{% highlight html linenos %} +{% highlight html %} <!-- HTML to write --> <a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a> @@ -76,87 +77,93 @@ $('#example').tooltip(options) <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> - <tr> - <th style="width: 100px;">Name</th> - <th style="width: 100px;">Type</th> - <th style="width: 50px;">Default</th> - <th>Description</th> - </tr> + <tr> + <th style="width: 100px;">Name</th> + <th style="width: 100px;">Type</th> + <th style="width: 50px;">Default</th> + <th>Description</th> + </tr> </thead> <tbody> - <tr> - <td>animation</td> - <td>boolean</td> - <td>true</td> - <td>Apply a CSS fade transition to the tooltip</td> - </tr> - <tr> - <td>container</td> - <td>string | false</td> - <td>false</td> - <td> - <p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p> - </td> - </tr> - <tr> - <td>delay</td> - <td>number | object</td> - <td>0</td> - <td> - <p>Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type</p> - <p>If a number is supplied, delay is applied to both hide/show</p> - <p>Object structure is: <code>delay: { show: 500, hide: 100 }</code></p> - </td> - </tr> - <tr> - <td>html</td> - <td>boolean</td> - <td>false</td> - <td>Insert HTML into the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td> - </tr> - <tr> - <td>placement</td> - <td>string | function</td> - <td>'top'</td> - <td>How to position the tooltip - top | bottom | left | right | auto. <br> When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</td> - </tr> - <tr> - <td>selector</td> - <td>string</td> - <td>false</td> - <td>If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have tooltips added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsfiddle.net/fScua/">an informative example</a>.</td> - </tr> - <tr> - <td>template</td> - <td>string</td> - <td><code>'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'</code></td> - <td> - <p>Base HTML to use when creating the tooltip.</p> - <p>The tooltip's <code>title</code> will be injected into the <code>.tooltip-inner</code>.</p> - <p><code>.tooltip-arrow</code> will become the tooltip's arrow.</p> - <p>The outermost wrapper element should have the <code>.tooltip</code> class.</p> - </td> - </tr> - <tr> - <td>title</td> - <td>string | function</td> - <td>''</td> - <td>Default title value if <code>title</code> attribute isn't present</td> - </tr> - <tr> - <td>trigger</td> - <td>string</td> - <td>'hover focus'</td> - <td>How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</td> - </tr> - <tr> - <td>viewport</td> - <td>string | object</td> - <td>{ selector: 'body', padding: 0 }</td> - <td> - <p>Keeps the tooltip within the bounds of this element. Example: <code>viewport: '#viewport'</code> or <code>{ selector: '#viewport', padding: 0 }</code></p> - </td> - </tr> + <tr> + <td>animation</td> + <td>boolean</td> + <td>true</td> + <td>Apply a CSS fade transition to the tooltip</td> + </tr> + <tr> + <td>container</td> + <td>string | false</td> + <td>false</td> + <td> + <p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p> + </td> + </tr> + <tr> + <td>delay</td> + <td>number | object</td> + <td>0</td> + <td> + <p>Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type</p> + <p>If a number is supplied, delay is applied to both hide/show</p> + <p>Object structure is: <code>delay: { "show": 500, "hide": 100 }</code></p> + </td> + </tr> + <tr> + <td>html</td> + <td>boolean</td> + <td>false</td> + <td>Insert HTML into the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td> + </tr> + <tr> + <td>placement</td> + <td>string | function</td> + <td>'top'</td> + <td> + <p>How to position the tooltip - top | bottom | left | right | auto.<br>When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</p> + <p>When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the tooltip instance.</p> + </td> + </tr> + <tr> + <td>selector</td> + <td>string</td> + <td>false</td> + <td>If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have tooltips added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsbin.com/zopod/1/edit">an informative example</a>.</td> + </tr> + <tr> + <td>template</td> + <td>string</td> + <td><code>'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'</code></td> + <td> + <p>Base HTML to use when creating the tooltip.</p> + <p>The tooltip's <code>title</code> will be injected into the <code>.tooltip-inner</code>.</p> + <p><code>.tooltip-arrow</code> will become the tooltip's arrow.</p> + <p>The outermost wrapper element should have the <code>.tooltip</code> class.</p> + </td> + </tr> + <tr> + <td>title</td> + <td>string | function</td> + <td>''</td> + <td> + <p>Default title value if <code>title</code> attribute isn't present.</p> + <p>If a function is given, it will be called with its <code>this</code> reference set to the element that the tooltip is attached to.</p> + </td> + </tr> + <tr> + <td>trigger</td> + <td>string</td> + <td>'hover focus'</td> + <td>How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</td> + </tr> + <tr> + <td>viewport</td> + <td>string | object</td> + <td>{ selector: 'body', padding: 0 }</td> + <td> + <p>Keeps the tooltip within the bounds of this element. Example: <code>viewport: '#viewport'</code> or <code>{ "selector": "#viewport", "padding": 0 }</code></p> + </td> + </tr> </tbody> </table> </div><!-- /.table-responsive --> @@ -190,28 +197,28 @@ $('#example').tooltip(options) <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> - <tr> - <th style="width: 150px;">Event Type</th> - <th>Description</th> - </tr> + <tr> + <th style="width: 150px;">Event Type</th> + <th>Description</th> + </tr> </thead> <tbody> - <tr> - <td>show.bs.tooltip</td> - <td>This event fires immediately when the <code>show</code> instance method is called.</td> - </tr> - <tr> - <td>shown.bs.tooltip</td> - <td>This event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).</td> - </tr> - <tr> - <td>hide.bs.tooltip</td> - <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td> - </tr> - <tr> - <td>hidden.bs.tooltip</td> - <td>This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).</td> - </tr> + <tr> + <td>show.bs.tooltip</td> + <td>This event fires immediately when the <code>show</code> instance method is called.</td> + </tr> + <tr> + <td>shown.bs.tooltip</td> + <td>This event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).</td> + </tr> + <tr> + <td>hide.bs.tooltip</td> + <td>This event is fired immediately when the <code>hide</code> instance method has been called.</td> + </tr> + <tr> + <td>hidden.bs.tooltip</td> + <td>This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).</td> + </tr> </tbody> </table> </div><!-- /.table-responsive --> diff --git a/docs/_includes/nav/components.html b/docs/_includes/nav/components.html index e850f3abc..ebc0c904f 100644 --- a/docs/_includes/nav/components.html +++ b/docs/_includes/nav/components.html @@ -60,6 +60,7 @@ <a href="#navbar">Navbar</a> <ul class="nav"> <li><a href="#navbar-default">Default navbar</a></li> + <li><a href="#navbar-brand-image">Brand image</a></li> <li><a href="#navbar-forms">Forms</a></li> <li><a href="#navbar-buttons">Buttons</a></li> <li><a href="#navbar-text">Text</a></li> @@ -94,7 +95,7 @@ <a href="#alerts">Alerts</a> <ul class="nav"> <li><a href="#alerts-examples">Examples</a></li> - <li><a href="#alerts-dismissable">Dismissable alerts</a></li> + <li><a href="#alerts-dismissible">Dismissible alerts</a></li> <li><a href="#alerts-links">Links in alerts</a></li> </ul> </li> diff --git a/docs/_includes/nav/customize.html b/docs/_includes/nav/customize.html index 04725096c..99eaba9cb 100644 --- a/docs/_includes/nav/customize.html +++ b/docs/_includes/nav/customize.html @@ -1,5 +1,6 @@ <!-- NOTE: DO NOT EDIT THE FOLLOWING SECTION DIRECTLY! It is autogenerated via the `build-customizer-html` Grunt task using the customizer-nav.jade template.--> +<li><a href="#import">Import</a></li> <li><a href="#less">Less components</a></li> <li><a href="#plugins">jQuery plugins</a></li> <li><a href="#less-variables">Less variables</a> @@ -40,7 +41,6 @@ <li><a href="#close">Close</a></li> <li><a href="#code">Code</a></li> <li><a href="#type">Type</a></li> - <li><a href="#miscellaneous">Miscellaneous</a></li> </ul> </li> <li><a href="#download">Download</a></li> diff --git a/docs/_includes/nav/getting-started.html b/docs/_includes/nav/getting-started.html index fae906920..54927c22a 100644 --- a/docs/_includes/nav/getting-started.html +++ b/docs/_includes/nav/getting-started.html @@ -44,6 +44,7 @@ <li><a href="#support-ie8-ie9">Internet Explorer 8-9</a></li> <li><a href="#support-ie8-respondjs">IE8 and Respond.js</a></li> <li><a href="#support-ie8-box-sizing">IE8 and box-sizing</a></li> + <li><a href="#support-ie8-font-face">IE8 and @font-face</a></li> <li><a href="#support-ie-compatibility-modes">IE Compatibility modes</a></li> <li><a href="#support-ie10-width">IE10 and Windows (Phone) 8</a></li> <li><a href="#support-safari-percentages">Safari percent rounding</a></li> diff --git a/docs/_includes/nav/javascript.html b/docs/_includes/nav/javascript.html index 9cccf1d99..3459bb1e4 100644 --- a/docs/_includes/nav/javascript.html +++ b/docs/_includes/nav/javascript.html @@ -6,6 +6,7 @@ <li><a href="#js-programmatic-api">Programmatic API</a></li> <li><a href="#js-noconflict">No conflict</a></li> <li><a href="#js-events">Events</a></li> + <li><a href="#js-disabled">When JavaScript is disabled</a></li> <li><a href="#callout-third-party-libs">Third-party libraries</a></li> </ul> </li> @@ -64,8 +65,10 @@ <li> <a href="#buttons">Button</a> <ul class="nav"> - <li><a href="#buttons-examples">Examples</a></li> - <li><a href="#buttons-usage">Usage</a></li> + <li><a href="#buttons-stateful">Stateful</a></li> + <li><a href="#buttons-single-toggle">Single toggle</a></li> + <li><a href="#buttons-checkbox-radio">Checkbox / Radio</a></li> + <li><a href="#buttons-methods">Methods</a></li> </ul> </li> <li> diff --git a/docs/_includes/nav/main.html b/docs/_includes/nav/main.html index 6f773d2c1..1b7cd1bea 100644 --- a/docs/_includes/nav/main.html +++ b/docs/_includes/nav/main.html @@ -1,7 +1,7 @@ <header class="navbar navbar-static-top bs-docs-nav" id="top" role="banner"> <div class="container"> <div class="navbar-header"> - <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> + <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> |
