Commit a21363a7 authored by Mark Otto's avatar Mark Otto

Merge branch 'dev' of github.com:twitter/bootstrap into dev

Conflicts:
	bootstrap.css
parents 98007b83 8f726dc6
*~
.DS_Store .DS_Store
thumbs.db
This diff is collapsed.
...@@ -97,19 +97,9 @@ Authors ...@@ -97,19 +97,9 @@ Authors
+ http://github.com/fat + http://github.com/fat
Copyright and license License
--------------------- ---------------------
Copyright 2011 Twitter, Inc. Copyright 2011 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
you may not use this work except in compliance with the License. \ No newline at end of file
You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Designed and built with all the love in the world @twitter by @mdo and @fat. * Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Mon Oct 31 23:18:19 PDT 2011 * Date: Mon Oct 31 23:21:58 PDT 2011
*/ */
/* Reset.less /* Reset.less
* Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc).
...@@ -814,67 +814,99 @@ textarea.xxlarge { ...@@ -814,67 +814,99 @@ textarea.xxlarge {
} }
input.span1, textarea.span1 { input.span1, textarea.span1 {
display: inline-block; display: inline-block;
float: none;
width: 30px; width: 30px;
margin-left: 0;
} }
input.span2, textarea.span2 { input.span2, textarea.span2 {
display: inline-block; display: inline-block;
float: none;
width: 90px; width: 90px;
margin-left: 0;
} }
input.span3, textarea.span3 { input.span3, textarea.span3 {
display: inline-block; display: inline-block;
float: none;
width: 150px; width: 150px;
margin-left: 0;
} }
input.span4, textarea.span4 { input.span4, textarea.span4 {
display: inline-block; display: inline-block;
float: none;
width: 210px; width: 210px;
margin-left: 0;
} }
input.span5, textarea.span5 { input.span5, textarea.span5 {
display: inline-block; display: inline-block;
float: none;
width: 270px; width: 270px;
margin-left: 0;
} }
input.span6, textarea.span6 { input.span6, textarea.span6 {
display: inline-block; display: inline-block;
float: none;
width: 330px; width: 330px;
margin-left: 0;
} }
input.span7, textarea.span7 { input.span7, textarea.span7 {
display: inline-block; display: inline-block;
float: none;
width: 390px; width: 390px;
margin-left: 0;
} }
input.span8, textarea.span8 { input.span8, textarea.span8 {
display: inline-block; display: inline-block;
float: none;
width: 450px; width: 450px;
margin-left: 0;
} }
input.span9, textarea.span9 { input.span9, textarea.span9 {
display: inline-block; display: inline-block;
float: none;
width: 510px; width: 510px;
margin-left: 0;
} }
input.span10, textarea.span10 { input.span10, textarea.span10 {
display: inline-block; display: inline-block;
float: none;
width: 570px; width: 570px;
margin-left: 0;
} }
input.span11, textarea.span11 { input.span11, textarea.span11 {
display: inline-block; display: inline-block;
float: none;
width: 630px; width: 630px;
margin-left: 0;
} }
input.span12, textarea.span12 { input.span12, textarea.span12 {
display: inline-block; display: inline-block;
float: none;
width: 690px; width: 690px;
margin-left: 0;
} }
input.span13, textarea.span13 { input.span13, textarea.span13 {
display: inline-block; display: inline-block;
float: none;
width: 750px; width: 750px;
margin-left: 0;
} }
input.span14, textarea.span14 { input.span14, textarea.span14 {
display: inline-block; display: inline-block;
float: none;
width: 810px; width: 810px;
margin-left: 0;
} }
input.span15, textarea.span15 { input.span15, textarea.span15 {
display: inline-block; display: inline-block;
float: none;
width: 870px; width: 870px;
margin-left: 0;
} }
input.span16, textarea.span16 { input.span16, textarea.span16 {
display: inline-block; display: inline-block;
float: none;
width: 930px; width: 930px;
margin-left: 0;
} }
input[disabled], input[disabled],
select[disabled], select[disabled],
...@@ -1886,7 +1918,7 @@ footer { ...@@ -1886,7 +1918,7 @@ footer {
border-color: #0064cd #0064cd #003f81; border-color: #0064cd #0064cd #003f81;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
} }
.btn:active { .btn.active, .btn :active {
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
......
...@@ -141,22 +141,22 @@ form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-appe ...@@ -141,22 +141,22 @@ form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-appe
.input-xlarge,input.xlarge,textarea.xlarge,select.xlarge{width:270px;} .input-xlarge,input.xlarge,textarea.xlarge,select.xlarge{width:270px;}
.input-xxlarge,input.xxlarge,textarea.xxlarge,select.xxlarge{width:530px;} .input-xxlarge,input.xxlarge,textarea.xxlarge,select.xxlarge{width:530px;}
textarea.xxlarge{overflow-y:auto;} textarea.xxlarge{overflow-y:auto;}
input.span1,textarea.span1{display:inline-block;width:30px;} input.span1,textarea.span1{display:inline-block;float:none;width:30px;margin-left:0;}
input.span2,textarea.span2{display:inline-block;width:90px;} input.span2,textarea.span2{display:inline-block;float:none;width:90px;margin-left:0;}
input.span3,textarea.span3{display:inline-block;width:150px;} input.span3,textarea.span3{display:inline-block;float:none;width:150px;margin-left:0;}
input.span4,textarea.span4{display:inline-block;width:210px;} input.span4,textarea.span4{display:inline-block;float:none;width:210px;margin-left:0;}
input.span5,textarea.span5{display:inline-block;width:270px;} input.span5,textarea.span5{display:inline-block;float:none;width:270px;margin-left:0;}
input.span6,textarea.span6{display:inline-block;width:330px;} input.span6,textarea.span6{display:inline-block;float:none;width:330px;margin-left:0;}
input.span7,textarea.span7{display:inline-block;width:390px;} input.span7,textarea.span7{display:inline-block;float:none;width:390px;margin-left:0;}
input.span8,textarea.span8{display:inline-block;width:450px;} input.span8,textarea.span8{display:inline-block;float:none;width:450px;margin-left:0;}
input.span9,textarea.span9{display:inline-block;width:510px;} input.span9,textarea.span9{display:inline-block;float:none;width:510px;margin-left:0;}
input.span10,textarea.span10{display:inline-block;width:570px;} input.span10,textarea.span10{display:inline-block;float:none;width:570px;margin-left:0;}
input.span11,textarea.span11{display:inline-block;width:630px;} input.span11,textarea.span11{display:inline-block;float:none;width:630px;margin-left:0;}
input.span12,textarea.span12{display:inline-block;width:690px;} input.span12,textarea.span12{display:inline-block;float:none;width:690px;margin-left:0;}
input.span13,textarea.span13{display:inline-block;width:750px;} input.span13,textarea.span13{display:inline-block;float:none;width:750px;margin-left:0;}
input.span14,textarea.span14{display:inline-block;width:810px;} input.span14,textarea.span14{display:inline-block;float:none;width:810px;margin-left:0;}
input.span15,textarea.span15{display:inline-block;width:870px;} input.span15,textarea.span15{display:inline-block;float:none;width:870px;margin-left:0;}
input.span16,textarea.span16{display:inline-block;width:930px;} input.span16,textarea.span16{display:inline-block;float:none;width:930px;margin-left:0;}
input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;} input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;}
.actions{background:#f5f5f5;margin-top:18px;margin-bottom:18px;padding:17px 20px 18px 150px;border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.actions .secondary-action{float:right;}.actions .secondary-action a{line-height:30px;}.actions .secondary-action a:hover{text-decoration:underline;} .actions{background:#f5f5f5;margin-top:18px;margin-bottom:18px;padding:17px 20px 18px 150px;border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.actions .secondary-action{float:right;}.actions .secondary-action a{line-height:30px;}.actions .secondary-action a:hover{text-decoration:underline;}
.help-inline,.help-block{font-size:13px;line-height:18px;color:#bfbfbf;} .help-inline,.help-block{font-size:13px;line-height:18px;color:#bfbfbf;}
...@@ -285,7 +285,7 @@ footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;} ...@@ -285,7 +285,7 @@ footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;}
.btn{cursor:pointer;display:inline-block;background-color:#e6e6e6;background-repeat:no-repeat;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);padding:5px 14px 6px;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);color:#333;font-size:13px;line-height:normal;border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{background-position:0 -15px;color:#333;text-decoration:none;} .btn{cursor:pointer;display:inline-block;background-color:#e6e6e6;background-repeat:no-repeat;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);padding:5px 14px 6px;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);color:#333;font-size:13px;line-height:normal;border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{background-position:0 -15px;color:#333;text-decoration:none;}
.btn:focus{outline:1px dotted #666;} .btn:focus{outline:1px dotted #666;}
.btn.primary{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} .btn.primary{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} .btn.active,.btn :active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);}
.btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
.btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
.btn.large{font-size:15px;line-height:normal;padding:9px 14px 9px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} .btn.large{font-size:15px;line-height:normal;padding:9px 14px 9px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
......
...@@ -611,7 +611,7 @@ ...@@ -611,7 +611,7 @@
<tbody> <tbody>
<tr> <tr>
<td><code>&lt;code&gt;</code></td> <td><code>&lt;code&gt;</code></td>
<td>In a line of text like this, your wrapped code will look like this <code>&gt;html&lt;</code> element.</td> <td>In a line of text like this, your wrapped code will look like this <code>&lt;html&gt;</code> element.</td>
</tr> </tr>
<tr> <tr>
<td><code>&lt;pre&gt;</code></td> <td><code>&lt;pre&gt;</code></td>
...@@ -620,7 +620,7 @@ ...@@ -620,7 +620,7 @@
&lt;h1&gt;Heading&lt;/h1&gt; &lt;h1&gt;Heading&lt;/h1&gt;
&lt;p&gt;Something right here...&lt;/p&gt; &lt;p&gt;Something right here...&lt;/p&gt;
&lt;/div&gt;</pre> &lt;/div&gt;</pre>
<p><strong>Note:</strong> Be sure to keep code within <code>pre</code> tags as close to the left as possible; it will render all tabs.</p> <p><strong>Note:</strong> Be sure to keep code within <code>&lt;pre&gt;</code> tags as close to the left as possible; it will render all tabs.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
......
This diff is collapsed.
...@@ -52,17 +52,17 @@ ...@@ -52,17 +52,17 @@
<!-- Example row of columns --> <!-- Example row of columns -->
<div class="row"> <div class="row">
<div class="span6"> <div class="span-one-third">
<h2>Heading</h2> <h2>Heading</h2>
<p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p> <p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
<p><a class="btn" href="#">View details &raquo;</a></p> <p><a class="btn" href="#">View details &raquo;</a></p>
</div> </div>
<div class="span5"> <div class="span-one-third">
<h2>Heading</h2> <h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p> <p><a class="btn" href="#">View details &raquo;</a></p>
</div> </div>
<div class="span5"> <div class="span-one-third">
<h2>Heading</h2> <h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn" href="#">View details &raquo;</a></p> <p><a class="btn" href="#">View details &raquo;</a></p>
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ){ !function( $ ){
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
...@@ -51,9 +53,10 @@ ...@@ -51,9 +53,10 @@
/* ALERT CLASS DEFINITION /* ALERT CLASS DEFINITION
* ====================== */ * ====================== */
var Alert = function ( content, selector ) { var Alert = function ( content, options ) {
this.settings = $.extend({}, $.fn.alert.defaults, options)
this.$element = $(content) this.$element = $(content)
.delegate(selector || '.close', 'click', this.close) .delegate(this.settings.selector, 'click', this.close)
} }
Alert.prototype = { Alert.prototype = {
...@@ -92,13 +95,19 @@ ...@@ -92,13 +95,19 @@
return $this.data('alert')[options]() return $this.data('alert')[options]()
} }
$(this).data('alert', new Alert( this )) $(this).data('alert', new Alert( this, options ))
}) })
} }
$.fn.alert.defaults = {
selector: '.close'
}
$(document).ready(function () { $(document).ready(function () {
new Alert($('body'), '.alert-message[data-alert] .close') new Alert($('body'), {
selector: '.alert-message[data-alert] .close'
})
}) })
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
/* ============================================================
* bootstrap-dropdown.js v1.3.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
function setState(el, state) {
var d = 'disabled'
, $el = $(el)
, data = $el.data()
state = state + 'Text'
data.resetText || $el.data('resetText', $el.html())
$el.html( data[state] || $.fn.button.defaults[state] )
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}
function toggle(el) {
$(el).toggleClass('active')
}
$.fn.button = function(options) {
return this.each(function () {
if (options == 'toggle') {
return toggle(this)
}
options && setState(this, options)
})
}
$.fn.button.defaults = {
loadingText: 'loading...'
}
$(function () {
$('body').delegate('.btn[data-toggle]', 'click', function () {
$(this).button('toggle')
})
})
}( window.jQuery || window.ender );
\ No newline at end of file
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ){ !function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION /* DROPDOWN PLUGIN DEFINITION
* ========================== */ * ========================== */
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ){ !function( $ ){
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
...@@ -53,12 +55,10 @@ ...@@ -53,12 +55,10 @@
* ============================= */ * ============================= */
var Modal = function ( content, options ) { var Modal = function ( content, options ) {
this.settings = $.extend({}, $.fn.modal.defaults) this.settings = $.extend({}, $.fn.modal.defaults, options)
this.$element = $(content) this.$element = $(content)
.delegate('.close', 'click.modal', $.proxy(this.hide, this)) .delegate('.close', 'click.modal', $.proxy(this.hide, this))
$.extend( this.settings, options )
if ( this.settings.show ) { if ( this.settings.show ) {
this.show() this.show()
} }
...@@ -89,8 +89,7 @@ ...@@ -89,8 +89,7 @@
that.$element[0].offsetWidth // force reflow that.$element[0].offsetWidth // force reflow
} }
that.$element that.$element.addClass('in')
.addClass('in')
transition ? transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
...@@ -117,17 +116,9 @@ ...@@ -117,17 +116,9 @@
.trigger('hide') .trigger('hide')
.removeClass('in') .removeClass('in')
function removeElement () {
that.$element
.hide()
.trigger('hidden')
backdrop.call(that)
}
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
this.$element.one(transitionEnd, removeElement) : hideWithTransition.call(this) :
removeElement() hideModal.call(this)
return this return this
} }
...@@ -138,6 +129,28 @@ ...@@ -138,6 +129,28 @@
/* MODAL PRIVATE METHODS /* MODAL PRIVATE METHODS
* ===================== */ * ===================== */
function hideWithTransition() {
// firefox drops transitionEnd events :{o
var that = this
, timeout = setTimeout(function () {
that.$element.unbind(transitionEnd)
hideModal.call(that)
}, 500)
this.$element.one(transitionEnd, function () {
clearTimeout(timeout)
hideModal.call(that)
})
}
function hideModal (that) {
this.$element
.hide()
.trigger('hidden')
backdrop.call(this)
}
function backdrop ( callback ) { function backdrop ( callback ) {
var that = this var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : '' , animate = this.$element.hasClass('fade') ? 'fade' : ''
...@@ -164,19 +177,20 @@ ...@@ -164,19 +177,20 @@
} else if ( !this.isShown && this.$backdrop ) { } else if ( !this.isShown && this.$backdrop ) {
this.$backdrop.removeClass('in') this.$backdrop.removeClass('in')
function removeElement() {
that.$backdrop.remove()
that.$backdrop = null
}
$.support.transition && this.$element.hasClass('fade')? $.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one(transitionEnd, removeElement) : this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
removeElement() removeBackdrop.call(this)
} else if ( callback ) { } else if ( callback ) {
callback() callback()
} }
} }
function removeBackdrop() {
this.$backdrop.remove()
this.$backdrop = null
}
function escape() { function escape() {
var that = this var that = this
if ( this.isShown && this.settings.keyboard ) { if ( this.isShown && this.settings.keyboard ) {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ) { !function( $ ) {
"use strict"
var Popover = function ( element, options ) { var Popover = function ( element, options ) {
this.$element = $(element) this.$element = $(element)
this.options = options this.options = options
...@@ -39,13 +41,17 @@ ...@@ -39,13 +41,17 @@
$tip[0].className = 'popover' $tip[0].className = 'popover'
} }
, hasContent: function () {
return this.getTitle() || this.getContent()
}
, getContent: function () { , getContent: function () {
var content var content
, $e = this.$element , $e = this.$element
, o = this.options , o = this.options
if (typeof this.options.content == 'string') { if (typeof this.options.content == 'string') {
content = $e.attr(o.content) content = this.options.content
} else if (typeof this.options.content == 'function') { } else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0]) content = this.options.content.call(this.$element[0])
} }
...@@ -55,7 +61,7 @@ ...@@ -55,7 +61,7 @@
, tip: function() { , tip: function() {
if (!this.$tip) { if (!this.$tip) {
this.$tip = $('<div class="popover" />') this.$tip = $('<div class="popover" />')
.html('<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>') .html(this.options.template)
} }
return this.$tip return this.$tip
} }
...@@ -72,6 +78,9 @@ ...@@ -72,6 +78,9 @@
return this return this
} }
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'}) $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right'
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
})
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function ( $ ) { !function ( $ ) {
"use strict"
var $window = $(window) var $window = $(window)
function ScrollSpy( topbar, selector ) { function ScrollSpy( topbar, selector ) {
......
...@@ -20,25 +20,37 @@ ...@@ -20,25 +20,37 @@
!function( $ ){ !function( $ ){
"use strict"
function activate ( element, container ) { function activate ( element, container ) {
container.find('> .active').removeClass('active') container
.find('> .active')
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active') element.addClass('active')
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
} }
function tab( e ) { function tab( e ) {
var $this = $(this) var $this = $(this)
, $ul = $this.closest('ul') , $ul = $this.closest('ul:not(.dropdown-menu)')
, href = $this.attr('href') , href = $this.attr('href')
, previous , previous
, $href
if (/^#\w+/.test(href)) { if ( /^#\w+/.test(href) ) {
e.preventDefault() e.preventDefault()
if ($this.parent('li').hasClass('active')) { if ( $this.parent('li').hasClass('active') ) {
return return
} }
previous = $ul.find('.active a')[0] previous = $ul.find('.active a').last()[0]
$href = $(href) $href = $(href)
activate($this.parent('li'), $ul) activate($this.parent('li'), $ul)
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
!function( $ ) { !function( $ ) {
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
...@@ -70,7 +72,7 @@ ...@@ -70,7 +72,7 @@
, $tip , $tip
, tp , tp
if (this.getTitle() && this.enabled) { if (this.hasContent() && this.enabled) {
$tip = this.tip() $tip = this.tip()
this.setContent() this.setContent()
...@@ -90,7 +92,8 @@ ...@@ -90,7 +92,8 @@
actualWidth = $tip[0].offsetWidth actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight actualHeight = $tip[0].offsetHeight
placement = _.maybeCall(this.options.placement, this.$element[0])
placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
switch (placement) { switch (placement) {
case 'below': case 'below':
...@@ -142,6 +145,10 @@ ...@@ -142,6 +145,10 @@
} }
} }
, hasContent: function () {
return this.getTitle()
}
, getTitle: function() { , getTitle: function() {
var title var title
, $e = this.$element , $e = this.$element
...@@ -162,7 +169,7 @@ ...@@ -162,7 +169,7 @@
, tip: function() { , tip: function() {
if (!this.$tip) { if (!this.$tip) {
this.$tip = $('<div class="twipsy" />').html('<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>') this.$tip = $('<div class="twipsy" />').html(this.options.template)
} }
return this.$tip return this.$tip
} }
...@@ -193,15 +200,10 @@ ...@@ -193,15 +200,10 @@
/* TWIPSY PRIVATE METHODS /* TWIPSY PRIVATE METHODS
* ====================== */ * ====================== */
var _ = { function maybeCall ( thing, ctx, args ) {
return typeof thing == 'function' ? thing.apply(ctx, args) : thing
maybeCall: function ( thing, ctx ) {
return (typeof thing == 'function') ? (thing.call(ctx)) : thing
}
} }
/* TWIPSY PLUGIN DEFINITION /* TWIPSY PLUGIN DEFINITION
* ======================== */ * ======================== */
...@@ -298,10 +300,11 @@ ...@@ -298,10 +300,11 @@
, offset: 0 , offset: 0
, title: 'title' , title: 'title'
, trigger: 'hover' , trigger: 'hover'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
} }
$.fn.twipsy.elementOptions = function(ele, options) { $.fn.twipsy.elementOptions = function(ele, options) {
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options return $.extend({}, options, $(ele).data())
} }
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<title>Bootstrap Plugin Test Suite</title> <title>Bootstrap Plugin Test Suite</title>
<!-- jquery --> <!-- jquery -->
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<!-- qunit --> <!-- qunit -->
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" /> <link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<script src="../../js/bootstrap-tabs.js"></script> <script src="../../js/bootstrap-tabs.js"></script>
<script src="../../js/bootstrap-twipsy.js"></script> <script src="../../js/bootstrap-twipsy.js"></script>
<script src="../../js/bootstrap-popover.js"></script> <script src="../../js/bootstrap-popover.js"></script>
<script src="../../js/bootstrap-buttons.js"></script>
<!-- unit tests --> <!-- unit tests -->
<script src="unit/bootstrap-alerts.js"></script> <script src="unit/bootstrap-alerts.js"></script>
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<script src="unit/bootstrap-popover.js"></script> <script src="unit/bootstrap-popover.js"></script>
<script src="unit/bootstrap-tabs.js"></script> <script src="unit/bootstrap-tabs.js"></script>
<script src="unit/bootstrap-twipsy.js"></script> <script src="unit/bootstrap-twipsy.js"></script>
<script src="unit/bootstrap-buttons.js"></script>
<body> <body>
<div> <div>
......
$(function () {
module("bootstrap-buttons")
test("should be defined on jquery object", function () {
ok($(document.body).button, 'tabs method is defined')
})
test("should return element", function () {
ok($(document.body).button()[0] == document.body, 'document.body returned')
})
test("should return set state to loading", function () {
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
equals(btn.html(), 'mdo', 'btn text equals mdo')
btn.button('loading')
equals(btn.html(), 'fat', 'btn text equals fat')
ok(btn.attr('disabled'), 'btn is disabled')
ok(btn.hasClass('disabled'), 'btn has disabled class')
})
test("should return reset state", function () {
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
equals(btn.html(), 'mdo', 'btn text equals mdo')
btn.button('loading')
equals(btn.html(), 'fat', 'btn text equals fat')
ok(btn.attr('disabled'), 'btn is disabled')
ok(btn.hasClass('disabled'), 'btn is disabled')
btn.button('reset')
equals(btn.html(), 'mdo', 'btn text equals mdo')
ok(!btn.attr('disabled'), 'btn is not disabled')
ok(!btn.hasClass('disabled'), 'btn does not have disabled class')
})
test("should toggle active", function () {
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
ok(!btn.hasClass('active'), 'btn does not have active class')
btn.button('toggle')
ok(btn.hasClass('active'), 'btn has class active')
})
})
\ No newline at end of file
...@@ -255,7 +255,9 @@ textarea.xxlarge { ...@@ -255,7 +255,9 @@ textarea.xxlarge {
// This is a duplication of the main grid .columns() mixin, but subtracts 10px to account for input padding and border // This is a duplication of the main grid .columns() mixin, but subtracts 10px to account for input padding and border
.formColumns(@columnSpan: 1) { .formColumns(@columnSpan: 1) {
display: inline-block; display: inline-block;
float: none;
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 10; width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 10;
margin-left: 0;
} }
input, input,
textarea { textarea {
......
...@@ -573,7 +573,8 @@ footer { ...@@ -573,7 +573,8 @@ footer {
.transition(.1s linear all); .transition(.1s linear all);
// Active and Disabled states // Active and Disabled states
&:active { &.active,
:active {
@shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05); @shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
.box-shadow(@shadow); .box-shadow(@shadow);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment