mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-15 10:05:40 +02:00
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
$(document).ready(function(){
|
$(function(){
|
||||||
|
|
||||||
// table sort example
|
// table sort example
|
||||||
// ==================
|
// ==================
|
||||||
|
@@ -53,8 +53,8 @@
|
|||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-dropdown="true">Patterns</a>
|
<a href="#" class="dropdown-toggle" data-dropdown="true">Patterns</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="#navigation">Navigation</a></li>
|
|
||||||
<li><a href="#media">Media</a></li>
|
<li><a href="#media">Media</a></li>
|
||||||
|
<li><a href="#navigation">Navigation</a></li>
|
||||||
<li><a href="#alerts">Alerts</a></li>
|
<li><a href="#alerts">Alerts</a></li>
|
||||||
<li><a href="#popovers">Popovers</a></li>
|
<li><a href="#popovers">Popovers</a></li>
|
||||||
<li><a href="#autocomplete">Autocomplete</a></li>
|
<li><a href="#autocomplete">Autocomplete</a></li>
|
||||||
@@ -147,6 +147,7 @@
|
|||||||
|
|
||||||
<!-- About Bootstrap
|
<!-- About Bootstrap
|
||||||
================================================== -->
|
================================================== -->
|
||||||
|
<section id="about">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h2>Built for and by nerds</h2>
|
<h2>Built for and by nerds</h2>
|
||||||
@@ -177,6 +178,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /row -->
|
</div><!-- /row -->
|
||||||
|
</section>
|
||||||
|
|
||||||
<h3>Quick-start examples</h3>
|
<h3>Quick-start examples</h3>
|
||||||
<p>Need some quick templates? Check out these basic examples we've put together:</p>
|
<p>Need some quick templates? Check out these basic examples we've put together:</p>
|
||||||
@@ -2184,6 +2186,7 @@ Lorem ipsum dolar sit amet illo error <a href="#" title="below">ipsum</a> verita
|
|||||||
<script src="http://autobahn.tablesorter.com/jquery.tablesorter.min.js"></script>
|
<script src="http://autobahn.tablesorter.com/jquery.tablesorter.min.js"></script>
|
||||||
<script src="assets/js/google-code-prettify/prettify.js"></script>
|
<script src="assets/js/google-code-prettify/prettify.js"></script>
|
||||||
<script>$(function () { prettyPrint() })</script>
|
<script>$(function () { prettyPrint() })</script>
|
||||||
|
<script src="../js/bootstrap-transitions.js"></script>
|
||||||
<script src="../js/bootstrap-dropdown.js"></script>
|
<script src="../js/bootstrap-dropdown.js"></script>
|
||||||
<script src="../js/bootstrap-twipsy.js"></script>
|
<script src="../js/bootstrap-twipsy.js"></script>
|
||||||
<script src="../js/bootstrap-scrollspy.js"></script>
|
<script src="../js/bootstrap-scrollspy.js"></script>
|
||||||
|
41
js/bootstrap-accordion.js
vendored
Normal file
41
js/bootstrap-accordion.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/* =============================================================
|
||||||
|
* bootstrap-accordion.js v2.0.0
|
||||||
|
* http://twitter.github.com/bootstrap/javascript.html#accordion
|
||||||
|
* =============================================================
|
||||||
|
* 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( $ ){
|
||||||
|
|
||||||
|
var Accordion = function ( element, options ) {}
|
||||||
|
|
||||||
|
Accordion.prototype = {}
|
||||||
|
|
||||||
|
/* ALERT PLUGIN DEFINITION
|
||||||
|
* ======================= */
|
||||||
|
|
||||||
|
$.fn.accordion = function ( options ) {
|
||||||
|
|
||||||
|
if ( options === true ) {
|
||||||
|
return this.data('accordion')
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.each(function () {
|
||||||
|
new Accordion(this, options)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})( window.jQuery || window.ender )
|
68
js/bootstrap-alerts.js
vendored
68
js/bootstrap-alerts.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================================
|
/* ==========================================================
|
||||||
* bootstrap-alerts.js v1.3.0
|
* bootstrap-alerts.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
||||||
* ==========================================================
|
* ==========================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -17,53 +17,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* ========================================================== */
|
* ========================================================== */
|
||||||
|
|
||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
|
||||||
* ======================================================= */
|
|
||||||
|
|
||||||
var transitionEnd
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
|
|
||||||
$.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
|
|
||||||
})()
|
|
||||||
|
|
||||||
// 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
|
/* ALERT CLASS DEFINITION
|
||||||
* ====================== */
|
* ====================== */
|
||||||
|
|
||||||
var Alert = function ( content, selector ) {
|
function close(e) {
|
||||||
this.$element = $(content)
|
|
||||||
.delegate('[data-alert-dismiss]', 'click', this.close)
|
|
||||||
}
|
|
||||||
|
|
||||||
Alert.prototype = {
|
|
||||||
|
|
||||||
close: function (e) {
|
|
||||||
var $element = $(this).parent('.alert-message')
|
var $element = $(this).parent('.alert-message')
|
||||||
|
|
||||||
e && e.preventDefault()
|
e && e.preventDefault()
|
||||||
e && e.stopPropagation()
|
|
||||||
|
|
||||||
$element.removeClass('in')
|
$element.removeClass('in')
|
||||||
|
|
||||||
function removeElement () {
|
function removeElement () {
|
||||||
@@ -71,36 +33,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.support.transition && $element.hasClass('fade') ?
|
$.support.transition && $element.hasClass('fade') ?
|
||||||
$element.bind(transitionEnd, removeElement) :
|
$element.bind($.support.transition.end, removeElement) :
|
||||||
removeElement()
|
removeElement()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ALERT PLUGIN DEFINITION
|
/* ALERT PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
$.fn.alert = function ( options ) {
|
$(function () {
|
||||||
|
$('body').delegate('[data-alert-dismiss]', 'click', close)
|
||||||
if ( options === true ) {
|
|
||||||
return this.data('alert')
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
|
|
||||||
if ( typeof options == 'string' ) {
|
|
||||||
return $this.data('alert')[options]()
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this).data('alert', new Alert( this ))
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
new Alert($('body'))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
})( window.jQuery || window.ender )
|
})( window.jQuery || window.ender )
|
31
js/bootstrap-dropdown.js
vendored
31
js/bootstrap-dropdown.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* ============================================================
|
/* ============================================================
|
||||||
* bootstrap-dropdown.js v1.3.0
|
* bootstrap-dropdown.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#dropdown
|
* http://twitter.github.com/bootstrap/javascript.html#dropdown
|
||||||
* ============================================================
|
* ============================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -20,34 +20,23 @@
|
|||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
var d = '[data-dropdown]'
|
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||||
|
* =================================== */
|
||||||
|
var selector = '[data-dropdown]'
|
||||||
|
|
||||||
/* DROPDOWN PLUGIN DEFINITION
|
function clearMenus() {
|
||||||
* ========================== */
|
$(selector).parent('li').removeClass('open')
|
||||||
|
}
|
||||||
|
|
||||||
$.fn.dropdown = function () {
|
$(function () {
|
||||||
return this.each(function () {
|
$('html').bind("click", clearMenus)
|
||||||
$(this).delegate(d, 'click', function (e) {
|
$('body').delegate(selector, 'click', function (e) {
|
||||||
var li = $(this).parent('li')
|
var li = $(this).parent('li')
|
||||||
, isActive = li.hasClass('open')
|
, isActive = li.hasClass('open')
|
||||||
|
|
||||||
clearMenus()
|
clearMenus()
|
||||||
!isActive && li.toggleClass('open')
|
!isActive && li.toggleClass('open')
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
|
||||||
* =================================== */
|
|
||||||
|
|
||||||
function clearMenus() {
|
|
||||||
$(d).parent('li').removeClass('open')
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$('html').bind("click", clearMenus)
|
|
||||||
$('body').dropdown()
|
|
||||||
})
|
|
||||||
|
|
||||||
})( window.jQuery || window.ender )
|
})( window.jQuery || window.ender )
|
83
js/bootstrap-modal.js
vendored
83
js/bootstrap-modal.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* =========================================================
|
/* =========================================================
|
||||||
* bootstrap-modal.js v1.3.0
|
* bootstrap-modal.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#modal
|
* http://twitter.github.com/bootstrap/javascript.html#modal
|
||||||
* =========================================================
|
* =========================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -20,35 +20,6 @@
|
|||||||
|
|
||||||
!function( $ ){
|
!function( $ ){
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
|
||||||
* ======================================================= */
|
|
||||||
|
|
||||||
var transitionEnd
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
|
|
||||||
$.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
|
|
||||||
})()
|
|
||||||
|
|
||||||
// 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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
/* MODAL PUBLIC CLASS DEFINITION
|
/* MODAL PUBLIC CLASS DEFINITION
|
||||||
* ============================= */
|
* ============================= */
|
||||||
|
|
||||||
@@ -76,25 +47,7 @@
|
|||||||
this.$element.trigger('show')
|
this.$element.trigger('show')
|
||||||
|
|
||||||
escape.call(this)
|
escape.call(this)
|
||||||
backdrop.call(this, function () {
|
backdrop.call(this)
|
||||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
|
||||||
|
|
||||||
that.$element
|
|
||||||
.appendTo(document.body)
|
|
||||||
.show()
|
|
||||||
|
|
||||||
if (transition) {
|
|
||||||
that.$element[0].offsetWidth // force reflow
|
|
||||||
}
|
|
||||||
|
|
||||||
that.$element
|
|
||||||
.addClass('in')
|
|
||||||
|
|
||||||
transition ?
|
|
||||||
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
|
|
||||||
that.$element.trigger('shown')
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@@ -124,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.support.transition && this.$element.hasClass('fade') ?
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
this.$element.one(transitionEnd, removeElement) :
|
this.$element.one($.support.transition.end, removeElement) :
|
||||||
removeElement()
|
removeElement()
|
||||||
|
|
||||||
return this
|
return this
|
||||||
@@ -136,9 +89,11 @@
|
|||||||
/* MODAL PRIVATE METHODS
|
/* MODAL PRIVATE METHODS
|
||||||
* ===================== */
|
* ===================== */
|
||||||
|
|
||||||
function backdrop ( callback ) {
|
function backdrop () {
|
||||||
var that = this
|
var that = this
|
||||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
, callback = $.proxy(show, this)
|
||||||
|
|
||||||
if ( this.isShown && this.settings.backdrop ) {
|
if ( this.isShown && this.settings.backdrop ) {
|
||||||
var doAnimate = $.support.transition && animate
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
@@ -156,7 +111,7 @@
|
|||||||
this.$backdrop.addClass('in')
|
this.$backdrop.addClass('in')
|
||||||
|
|
||||||
doAnimate ?
|
doAnimate ?
|
||||||
this.$backdrop.one(transitionEnd, callback) :
|
this.$backdrop.one($.support.transition.end, callback) :
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
} else if ( !this.isShown && this.$backdrop ) {
|
} else if ( !this.isShown && this.$backdrop ) {
|
||||||
@@ -168,13 +123,33 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.support.transition && this.$element.hasClass('fade')?
|
$.support.transition && this.$element.hasClass('fade')?
|
||||||
this.$backdrop.one(transitionEnd, removeElement) :
|
this.$backdrop.one($.support.transition.end, removeElement) :
|
||||||
removeElement()
|
removeElement()
|
||||||
} else if ( callback ) {
|
} else if ( callback ) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show() {
|
||||||
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
, that = this
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.appendTo(document.body)
|
||||||
|
.show()
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
this.$element[0].offsetWidth // force reflow
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.addClass('in')
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
this.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
||||||
|
this.$element.trigger('shown')
|
||||||
|
}
|
||||||
|
|
||||||
function escape() {
|
function escape() {
|
||||||
var that = this
|
var that = this
|
||||||
if ( this.isShown && this.settings.keyboard ) {
|
if ( this.isShown && this.settings.keyboard ) {
|
||||||
@@ -233,7 +208,7 @@
|
|||||||
/* MODAL DATA-IMPLEMENTATION
|
/* MODAL DATA-IMPLEMENTATION
|
||||||
* ========================= */
|
* ========================= */
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(function () {
|
||||||
$('body').delegate('[data-controls-modal]', 'click', function (e) {
|
$('body').delegate('[data-controls-modal]', 'click', function (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
var $this = $(this).data('show', true)
|
var $this = $(this).data('show', true)
|
||||||
|
3
js/bootstrap-popover.js
vendored
3
js/bootstrap-popover.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* ===========================================================
|
/* ===========================================================
|
||||||
* bootstrap-popover.js v1.3.0
|
* bootstrap-popover.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#popover
|
* http://twitter.github.com/bootstrap/javascript.html#popover
|
||||||
* ===========================================================
|
* ===========================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -62,7 +62,6 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/* POPOVER PLUGIN DEFINITION
|
/* POPOVER PLUGIN DEFINITION
|
||||||
* ======================= */
|
* ======================= */
|
||||||
|
|
||||||
|
54
js/bootstrap-scrollspy.js
vendored
54
js/bootstrap-scrollspy.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* =============================================================
|
/* =============================================================
|
||||||
* bootstrap-scrollspy.js v1.3.0
|
* bootstrap-scrollspy.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
||||||
* =============================================================
|
* =============================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -22,14 +22,14 @@
|
|||||||
|
|
||||||
var $window = $(window)
|
var $window = $(window)
|
||||||
|
|
||||||
function ScrollSpy( topbar, selector ) {
|
function ScrollSpy() {
|
||||||
var processScroll = $.proxy(this.processScroll, this)
|
var process = $.proxy(this.process, this)
|
||||||
this.$topbar = $(topbar)
|
this.$topbar = $('body')
|
||||||
this.selector = selector || 'li > a'
|
this.selector = '[data-scrollspy] li > a'
|
||||||
this.refresh()
|
this.refresh()
|
||||||
this.$topbar.delegate(this.selector, 'click', processScroll)
|
this.$topbar.delegate(this.selector, 'click', process)
|
||||||
$window.scroll(processScroll)
|
$window.scroll(process)
|
||||||
this.processScroll()
|
this.process()
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollSpy.prototype = {
|
ScrollSpy.prototype = {
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
, processScroll: function () {
|
, process: function () {
|
||||||
var scrollTop = $window.scrollTop() + 10
|
var scrollTop = $window.scrollTop() + 10
|
||||||
, offsets = this.offsets
|
, offsets = this.offsets
|
||||||
, targets = this.targets
|
, targets = this.targets
|
||||||
@@ -56,50 +56,34 @@
|
|||||||
activeTarget != targets[i]
|
activeTarget != targets[i]
|
||||||
&& scrollTop >= offsets[i]
|
&& scrollTop >= offsets[i]
|
||||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||||
&& this.activateButton( targets[i] )
|
&& this.activate( targets[i] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
, activateButton: function (target) {
|
, activate: function (target) {
|
||||||
|
var active
|
||||||
|
|
||||||
this.activeTarget = target
|
this.activeTarget = target
|
||||||
|
|
||||||
this.$topbar
|
this.$topbar
|
||||||
.find(this.selector).parent('.active')
|
.find(this.selector).parent('.active')
|
||||||
.removeClass('active')
|
.removeClass('active')
|
||||||
|
|
||||||
this.$topbar
|
active = this.$topbar
|
||||||
.find(this.selector + '[href="' + target + '"]')
|
.find(this.selector + '[href="' + target + '"]')
|
||||||
.parent('li')
|
.parent('li')
|
||||||
.addClass('active')
|
.addClass('active')
|
||||||
|
|
||||||
|
if ( active.parent('.dropdown-menu') ) {
|
||||||
|
active.closest('li.dropdown').addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SCROLLSPY PLUGIN DEFINITION
|
|
||||||
* =========================== */
|
|
||||||
|
|
||||||
$.fn.scrollSpy = function( options ) {
|
|
||||||
var scrollspy = this.data('scrollspy')
|
|
||||||
|
|
||||||
if (!scrollspy) {
|
|
||||||
return this.each(function () {
|
|
||||||
$(this).data('scrollspy', new ScrollSpy( this, options ))
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( options === true ) {
|
$(function () {
|
||||||
return scrollspy
|
new ScrollSpy()
|
||||||
}
|
|
||||||
|
|
||||||
if ( typeof options == 'string' ) {
|
|
||||||
scrollspy[options]()
|
|
||||||
}
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('body').scrollSpy('[data-scrollspy] li > a')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery || window.ender )
|
}( window.jQuery || window.ender )
|
27
js/bootstrap-tabs.js
vendored
27
js/bootstrap-tabs.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* ========================================================
|
/* ========================================================
|
||||||
* bootstrap-tabs.js v1.3.0
|
* bootstrap-tabs.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
||||||
* ========================================================
|
* ========================================================
|
||||||
* Copyright 2011 Twitter, Inc.
|
* Copyright 2011 Twitter, Inc.
|
||||||
@@ -21,13 +21,22 @@
|
|||||||
!function( $ ){
|
!function( $ ){
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -38,7 +47,7 @@
|
|||||||
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)
|
||||||
@@ -55,14 +64,8 @@
|
|||||||
/* TABS/PILLS PLUGIN DEFINITION
|
/* TABS/PILLS PLUGIN DEFINITION
|
||||||
* ============================ */
|
* ============================ */
|
||||||
|
|
||||||
$.fn.tabs = $.fn.pills = function ( selector ) {
|
$(function () {
|
||||||
return this.each(function () {
|
$('body').delegate('ul[data-tabs] > li > a, ul[data-pills] > li > a', 'click', tab)
|
||||||
$(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}( window.jQuery || window.ender );
|
}( window.jQuery || window.ender );
|
45
js/bootstrap-transitions.js
vendored
Normal file
45
js/bootstrap-transitions.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/* ===================================================
|
||||||
|
* bootstrap-transitions.js v2.0.0
|
||||||
|
* http://twitter.github.com/bootstrap/javascript.html
|
||||||
|
* ===================================================
|
||||||
|
* 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 () {
|
||||||
|
|
||||||
|
/* 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 && {
|
||||||
|
end: (function () {
|
||||||
|
var transitionEnd = "TransitionEnd"
|
||||||
|
if ( $.browser.webkit ) {
|
||||||
|
transitionEnd = "webkitTransitionEnd"
|
||||||
|
} else if ( $.browser.mozilla ) {
|
||||||
|
transitionEnd = "transitionend"
|
||||||
|
} else if ( $.browser.opera ) {
|
||||||
|
transitionEnd = "oTransitionEnd"
|
||||||
|
}
|
||||||
|
return transitionEnd
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
})
|
33
js/bootstrap-twipsy.js
vendored
33
js/bootstrap-twipsy.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================================
|
/* ==========================================================
|
||||||
* bootstrap-twipsy.js v1.3.0
|
* bootstrap-twipsy.js v2.0.0
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#twipsy
|
* http://twitter.github.com/bootstrap/javascript.html#twipsy
|
||||||
* Adapted from the original jQuery.tipsy by Jason Frame
|
* Adapted from the original jQuery.tipsy by Jason Frame
|
||||||
* ==========================================================
|
* ==========================================================
|
||||||
@@ -21,35 +21,6 @@
|
|||||||
|
|
||||||
!function( $ ) {
|
!function( $ ) {
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
|
||||||
* ======================================================= */
|
|
||||||
|
|
||||||
var transitionEnd
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
|
|
||||||
$.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
|
|
||||||
})()
|
|
||||||
|
|
||||||
// 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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
/* TWIPSY PUBLIC CLASS DEFINITION
|
/* TWIPSY PUBLIC CLASS DEFINITION
|
||||||
* ============================== */
|
* ============================== */
|
||||||
|
|
||||||
@@ -131,7 +102,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
$tip.bind(transitionEnd, removeElement) :
|
$tip.bind($.support.transition.end, removeElement) :
|
||||||
removeElement()
|
removeElement()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
<script src="vendor/qunit.js"></script>
|
<script src="vendor/qunit.js"></script>
|
||||||
|
|
||||||
<!-- plugin sources -->
|
<!-- plugin sources -->
|
||||||
|
<script src="../../js/bootstrap-transitions.js"></script>
|
||||||
<script src="../../js/bootstrap-alerts.js"></script>
|
<script src="../../js/bootstrap-alerts.js"></script>
|
||||||
<script src="../../js/bootstrap-dropdown.js"></script>
|
<script src="../../js/bootstrap-dropdown.js"></script>
|
||||||
<script src="../../js/bootstrap-modal.js"></script>
|
<script src="../../js/bootstrap-modal.js"></script>
|
||||||
|
Reference in New Issue
Block a user