Skip to content

Commit

Permalink
add boostrap-twipsy and bootstrap-alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Aug 27, 2011
1 parent b68b53d commit 11721f3
Show file tree
Hide file tree
Showing 8 changed files with 534 additions and 307 deletions.
145 changes: 24 additions & 121 deletions bootstrap-1.1.1.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Sat Aug 27 00:28:54 PDT 2011
* Date: Sat Aug 27 13:02:54 PDT 2011
*/
/* 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).
Expand Down Expand Up @@ -421,6 +421,12 @@ body {
max-width: 1180px;
margin-left: 240px;
}
.hide {
display: none;
}
.show {
display: block;
}
a {
color: #0069d6;
text-decoration: none;
Expand All @@ -431,115 +437,6 @@ a:hover {
color: #0050a3;
text-decoration: underline;
}
.btn {
display: inline-block;
background-color: #e6e6e6;
background-repeat: no-repeat;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(0.25, #ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(#ffffff, #ffffff 0.25, #e6e6e6);
background-image: -moz-linear-gradient(#ffffff, #ffffff 0.25, #e6e6e6);
background-image: -ms-linear-gradient(#ffffff, #ffffff 0.25, #e6e6e6);
background-image: -o-linear-gradient(#ffffff, #ffffff 0.25, #e6e6e6);
background-image: linear-gradient(#ffffff, #ffffff 0.25, #e6e6e6);
padding: 4px 14px;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
color: #333;
font-size: 13px;
line-height: 18px;
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);
}
.btn:hover {
background-position: 0 -15px;
color: #333;
text-decoration: none;
}
.primary {
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);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border: 1px solid #004b9a;
border-bottom-color: #003f81;
}
.primary:hover {
color: #fff;
}
.btn {
-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.primary {
color: #fff;
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:hover {
color: #fff;
}
.btn.large {
font-size: 16px;
line-height: 28px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.btn.small {
padding-right: 9px;
padding-left: 9px;
font-size: 11px;
}
.btn.disabled {
background-image: none;
filter: alpha(opacity=65);
-khtml-opacity: 0.65;
-moz-opacity: 0.65;
opacity: 0.65;
cursor: default;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn:disabled {
background-image: none;
filter: alpha(opacity=65);
-khtml-opacity: 0.65;
-moz-opacity: 0.65;
opacity: 0.65;
cursor: default;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn:disabled.primary {
color: #fff;
}
.btn:active {
-webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
padding: 0;
border: 0;
}
/* Typography.less
* Headings, body text, lists, code, and more for a versatile and durable typography system
* ---------------------------------------------------------------------------------------- */
Expand Down Expand Up @@ -1781,17 +1678,6 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.modal-backdrop, .modal {
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-ms-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
opacity: 0;
}
.modal-backdrop.open, .modal.open {
opacity: 1;
}
.modal-backdrop {
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
Expand Down Expand Up @@ -2007,3 +1893,20 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
.popover .content p, .popover .content ul, .popover .content ol {
margin-bottom: 0;
}
.modal-backdrop,
.modal,
.twipsy,
.alert-message {
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-ms-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
opacity: 0;
}
.modal-backdrop.show,
.modal.show,
.twipsy.show,
.alert-message.show {
opacity: 1;
}
13 changes: 3 additions & 10 deletions bootstrap-1.1.1.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions examples/assets/js/bootstrap-alerts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
(function( $ ){

/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */

$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()


/* SHARED VARS
* =========== */

var transitionEnd

// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}


/* ALERT CLASS DEFINITION
* ====================== */

var Alert = function ( content ) {
var that = this
this.$element = $(content)
this.$element.delegate('.close', 'click', function (e) {
e.preventDefault()
that.close()
})
}

Alert.prototype = {

close: function () {
var that = this

function removeElement () {
that.$element.remove()
that.$element = null
}

$.support.transition ?
this.$element.bind(transitionEnd, removeElement) :
removeElement()

this.$element.removeClass('show')
}

}


/* ALERT PLUGIN DEFINITION
* ======================= */

$.fn.alert = function ( options ) {
return this.each(function () {
new Alert(this)
})
}

})( jQuery || ender )
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
* ============================= */

var Modal = function ( options ) {
this.settings = {
backdrop: false
, closeOnEscape: false
, content: false
}
this.settings = $.extend({}, $.fn.modal.defaults)

if ( typeof options == 'string' ) {
this.settings.content = options
Expand All @@ -59,17 +55,17 @@
var that = this
this.isOpen = true

_private.escape.call(this)
_private.backdrop.call(this)
_.escape.call(this)
_.backdrop.call(this)

this.$element = $(this.settings.content)
.delegate('.close', 'click', function (e) { e.preventDefault(); that.close() })
.appendTo(document.body)
.show()

setTimeout(function () {
that.$element.addClass('open')
that.$backdrop && that.$backdrop.addClass('open')
that.$element.addClass('show')
that.$backdrop && that.$backdrop.addClass('show')
}, 1)

return this
Expand All @@ -80,10 +76,10 @@

this.isOpen = false

_private.escape.call(this)
_private.backdrop.call(this)
_.escape.call(this)
_.backdrop.call(this)

this.$element.removeClass('open')
this.$element.removeClass('show')

function removeElement () {
that.$element.remove()
Expand All @@ -103,7 +99,7 @@
/* MODAL PRIVATE METHODS
* ===================== */

var _private = {
var _ = {

backdrop: function () {
var that = this
Expand All @@ -112,7 +108,7 @@
.click(function () { that.close() })
.appendTo(document.body)
} else if ( !this.isOpen && this.$backdrop ) {
this.$backdrop.removeClass('open')
this.$backdrop.removeClass('show')

function removeElement() {
that.$backdrop.remove()
Expand Down Expand Up @@ -144,14 +140,16 @@
/* MODAL PLUGIN DEFINITION
* ======================= */

$.modal = function ( options ) {
return new Modal(options)
}

$.fn.modal = function ( options ) {
options = options || {}
options.content = this
return new Modal(options)
}

$.fn.modal.defaults = {
backdrop: false
, closeOnEscape: false
, content: false
}

})( jQuery || ender )

0 comments on commit 11721f3

Please sign in to comment.