2012-01-28 08:36:37 +00:00
|
|
|
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
|
|
|
|
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
|
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++
|
2013-10-17 21:11:40 +00:00
|
|
|
|
2013-10-17 18:33:04 +00:00
|
|
|
/*!
|
2014-01-14 05:58:27 +00:00
|
|
|
* JavaScript for Bootstrap's docs (http://getbootstrap.com)
|
2014-01-07 00:05:24 +00:00
|
|
|
* Copyright 2011-2014 Twitter, Inc.
|
2013-10-17 21:11:40 +00:00
|
|
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
|
|
|
|
* details, see http://creativecommons.org/licenses/by/3.0/.
|
2013-10-17 18:33:04 +00:00
|
|
|
*/
|
|
|
|
|
|
2011-12-22 02:42:43 +00:00
|
|
|
|
2012-01-28 08:36:37 +00:00
|
|
|
!function ($) {
|
2011-12-22 02:42:43 +00:00
|
|
|
|
2013-09-18 18:37:55 +00:00
|
|
|
$(function () {
|
2012-01-25 01:13:02 +00:00
|
|
|
|
2013-09-11 21:46:31 +00:00
|
|
|
// IE10 viewport hack for Surface/desktop Windows 8 bug
|
|
|
|
|
//
|
|
|
|
|
// See Getting Started docs for more information
|
|
|
|
|
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
|
2013-09-18 16:50:02 +00:00
|
|
|
var msViewportStyle = document.createElement('style');
|
2013-09-11 21:46:31 +00:00
|
|
|
msViewportStyle.appendChild(
|
|
|
|
|
document.createTextNode(
|
2013-09-18 16:50:02 +00:00
|
|
|
'@-ms-viewport{width:auto!important}'
|
2013-09-11 21:46:31 +00:00
|
|
|
)
|
|
|
|
|
);
|
2014-01-05 19:15:48 +00:00
|
|
|
document.querySelector('head').
|
2013-09-11 21:46:31 +00:00
|
|
|
appendChild(msViewportStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-08-15 04:06:08 +00:00
|
|
|
var $window = $(window)
|
2013-07-29 05:23:20 +00:00
|
|
|
var $body = $(document.body)
|
2012-08-15 04:06:08 +00:00
|
|
|
|
2013-07-27 02:25:45 +00:00
|
|
|
var navHeight = $('.navbar').outerHeight(true) + 10
|
|
|
|
|
|
2013-07-29 05:23:20 +00:00
|
|
|
$body.scrollspy({
|
2013-07-27 02:25:45 +00:00
|
|
|
target: '.bs-sidebar',
|
2014-01-10 02:05:04 +00:00
|
|
|
// offset: navHeight
|
2013-07-27 02:25:45 +00:00
|
|
|
})
|
|
|
|
|
|
2013-08-11 22:03:48 +00:00
|
|
|
$window.on('load', function () {
|
|
|
|
|
$body.scrollspy('refresh')
|
|
|
|
|
})
|
|
|
|
|
|
2013-07-29 05:14:43 +00:00
|
|
|
$('.bs-docs-container [href=#]').click(function (e) {
|
2012-01-23 22:14:16 +00:00
|
|
|
e.preventDefault()
|
|
|
|
|
})
|
|
|
|
|
|
2013-03-31 01:41:26 +00:00
|
|
|
// back to top
|
2013-05-09 04:56:08 +00:00
|
|
|
setTimeout(function () {
|
2013-07-26 06:30:13 +00:00
|
|
|
var $sideBar = $('.bs-sidebar')
|
|
|
|
|
|
|
|
|
|
$sideBar.affix({
|
2013-05-09 04:56:08 +00:00
|
|
|
offset: {
|
2013-07-26 06:30:13 +00:00
|
|
|
top: function () {
|
|
|
|
|
var offsetTop = $sideBar.offset().top
|
|
|
|
|
var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
|
|
|
|
|
var navOuterHeight = $('.bs-docs-nav').height()
|
|
|
|
|
|
|
|
|
|
return (this.top = offsetTop - navOuterHeight - sideBarMargin)
|
2013-12-21 20:59:40 +00:00
|
|
|
},
|
|
|
|
|
bottom: function () {
|
2013-07-26 06:30:13 +00:00
|
|
|
return (this.bottom = $('.bs-footer').outerHeight(true))
|
|
|
|
|
}
|
2013-05-09 04:56:08 +00:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}, 100)
|
2012-08-15 04:06:08 +00:00
|
|
|
|
2013-03-31 01:41:26 +00:00
|
|
|
setTimeout(function () {
|
2013-05-09 05:52:48 +00:00
|
|
|
$('.bs-top').affix()
|
2013-03-31 01:41:26 +00:00
|
|
|
}, 100)
|
|
|
|
|
|
2012-01-28 08:46:04 +00:00
|
|
|
// tooltip demo
|
2012-06-06 01:25:46 +00:00
|
|
|
$('.tooltip-demo').tooltip({
|
2013-09-18 16:50:02 +00:00
|
|
|
selector: '[data-toggle=tooltip]',
|
|
|
|
|
container: 'body'
|
2012-01-28 08:46:04 +00:00
|
|
|
})
|
2012-01-27 00:12:34 +00:00
|
|
|
|
2012-01-28 20:08:41 +00:00
|
|
|
$('.tooltip-test').tooltip()
|
|
|
|
|
$('.popover-test').popover()
|
2012-01-28 08:46:04 +00:00
|
|
|
|
2013-03-28 06:33:45 +00:00
|
|
|
$('.bs-docs-navbar').tooltip({
|
2013-09-18 16:50:02 +00:00
|
|
|
selector: 'a[data-toggle=tooltip]',
|
|
|
|
|
container: '.bs-docs-navbar .nav'
|
2013-03-28 06:33:45 +00:00
|
|
|
})
|
|
|
|
|
|
2012-01-28 08:46:04 +00:00
|
|
|
// popover demo
|
2013-12-13 02:10:58 +00:00
|
|
|
$('[data-toggle=popover]').popover()
|
2012-01-28 08:46:04 +00:00
|
|
|
|
|
|
|
|
// button state demo
|
2013-12-09 01:42:59 +00:00
|
|
|
$('#loading-example-btn')
|
2012-01-28 08:46:04 +00:00
|
|
|
.click(function () {
|
|
|
|
|
var btn = $(this)
|
|
|
|
|
btn.button('loading')
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
btn.button('reset')
|
|
|
|
|
}, 3000)
|
|
|
|
|
})
|
2013-09-18 18:37:55 +00:00
|
|
|
})
|
2012-01-28 08:36:37 +00:00
|
|
|
|
2013-11-26 07:43:26 +00:00
|
|
|
}(jQuery)
|