2012-01-28 09:36:37 +01:00
|
|
|
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
|
|
|
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++
|
2013-10-17 23:11:40 +02:00
|
|
|
|
2013-10-17 20:33:04 +02:00
|
|
|
/*!
|
2014-01-14 06:58:27 +01:00
|
|
|
* JavaScript for Bootstrap's docs (http://getbootstrap.com)
|
2014-01-07 01:05:24 +01:00
|
|
|
* Copyright 2011-2014 Twitter, Inc.
|
2013-10-17 23:11:40 +02:00
|
|
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
|
|
|
* details, see http://creativecommons.org/licenses/by/3.0/.
|
2013-10-17 20:33:04 +02:00
|
|
|
*/
|
|
|
|
|
2011-12-22 03:42:43 +01:00
|
|
|
|
2012-01-28 09:36:37 +01:00
|
|
|
!function ($) {
|
2011-12-22 03:42:43 +01:00
|
|
|
|
2013-09-18 20:37:55 +02:00
|
|
|
$(function () {
|
2012-01-25 02:13:02 +01:00
|
|
|
|
2012-08-15 06:06:08 +02:00
|
|
|
var $window = $(window)
|
2013-07-29 07:23:20 +02:00
|
|
|
var $body = $(document.body)
|
2012-08-15 06:06:08 +02:00
|
|
|
|
2013-07-29 07:23:20 +02:00
|
|
|
$body.scrollspy({
|
2014-03-01 17:19:50 +01:00
|
|
|
target: '.bs-docs-sidebar'
|
2013-07-27 04:25:45 +02:00
|
|
|
})
|
|
|
|
|
2013-08-12 00:03:48 +02:00
|
|
|
$window.on('load', function () {
|
|
|
|
$body.scrollspy('refresh')
|
|
|
|
})
|
|
|
|
|
2013-07-29 07:14:43 +02:00
|
|
|
$('.bs-docs-container [href=#]').click(function (e) {
|
2012-01-23 23:14:16 +01:00
|
|
|
e.preventDefault()
|
|
|
|
})
|
|
|
|
|
2013-03-31 03:41:26 +02:00
|
|
|
// back to top
|
2013-05-09 06:56:08 +02:00
|
|
|
setTimeout(function () {
|
2014-02-12 20:02:37 +01:00
|
|
|
var $sideBar = $('.bs-docs-sidebar')
|
2013-07-26 08:30:13 +02:00
|
|
|
|
|
|
|
$sideBar.affix({
|
2013-05-09 06:56:08 +02:00
|
|
|
offset: {
|
2013-07-26 08:30:13 +02: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 21:59:40 +01:00
|
|
|
},
|
|
|
|
bottom: function () {
|
2014-02-12 20:02:37 +01:00
|
|
|
return (this.bottom = $('.bs-docs-footer').outerHeight(true))
|
2013-07-26 08:30:13 +02:00
|
|
|
}
|
2013-05-09 06:56:08 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}, 100)
|
2012-08-15 06:06:08 +02:00
|
|
|
|
2013-03-31 03:41:26 +02:00
|
|
|
setTimeout(function () {
|
2013-05-09 07:52:48 +02:00
|
|
|
$('.bs-top').affix()
|
2013-03-31 03:41:26 +02:00
|
|
|
}, 100)
|
|
|
|
|
2014-04-30 00:54:05 +02:00
|
|
|
// theme toggler
|
|
|
|
;(function () {
|
|
|
|
var stylesheetLink = $('#bs-theme-stylesheet')
|
|
|
|
var themeBtn = $('#bs-theme-btn')
|
|
|
|
themeBtn.click(function () {
|
|
|
|
if (stylesheetLink.attr('href')) {
|
|
|
|
stylesheetLink.attr('href', '')
|
|
|
|
themeBtn.text('Activate Theme')
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
stylesheetLink.attr('href', stylesheetLink.attr('data-href'))
|
|
|
|
themeBtn.text('Deactivate Theme')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})();
|
|
|
|
|
2012-01-28 09:46:04 +01:00
|
|
|
// tooltip demo
|
2012-06-06 03:25:46 +02:00
|
|
|
$('.tooltip-demo').tooltip({
|
2014-04-19 03:53:05 +02:00
|
|
|
selector: '[data-toggle="tooltip"]',
|
2013-09-18 18:50:02 +02:00
|
|
|
container: 'body'
|
2012-01-28 09:46:04 +01:00
|
|
|
})
|
2012-01-27 01:12:34 +01:00
|
|
|
|
2012-01-28 21:08:41 +01:00
|
|
|
$('.tooltip-test').tooltip()
|
|
|
|
$('.popover-test').popover()
|
2012-01-28 09:46:04 +01:00
|
|
|
|
2013-03-28 07:33:45 +01:00
|
|
|
$('.bs-docs-navbar').tooltip({
|
2014-04-19 03:53:05 +02:00
|
|
|
selector: 'a[data-toggle="tooltip"]',
|
2013-09-18 18:50:02 +02:00
|
|
|
container: '.bs-docs-navbar .nav'
|
2013-03-28 07:33:45 +01:00
|
|
|
})
|
|
|
|
|
2012-01-28 09:46:04 +01:00
|
|
|
// popover demo
|
2014-02-11 06:34:05 +01:00
|
|
|
$('.bs-docs-popover').popover()
|
|
|
|
|
|
|
|
// Popover dismiss on next click
|
|
|
|
$('.bs-docs-popover-dismiss').popover({
|
|
|
|
trigger: 'focus'
|
|
|
|
})
|
2012-01-28 09:46:04 +01:00
|
|
|
|
|
|
|
// button state demo
|
2013-12-09 02:42:59 +01:00
|
|
|
$('#loading-example-btn')
|
2012-01-28 09:46:04 +01:00
|
|
|
.click(function () {
|
|
|
|
var btn = $(this)
|
|
|
|
btn.button('loading')
|
|
|
|
setTimeout(function () {
|
|
|
|
btn.button('reset')
|
|
|
|
}, 3000)
|
|
|
|
})
|
2013-09-18 20:37:55 +02:00
|
|
|
})
|
2012-01-28 09:36:37 +01:00
|
|
|
|
2013-11-26 08:43:26 +01:00
|
|
|
}(jQuery)
|