info@54
|
1 |
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
info@54
|
2 |
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
info@54
|
3 |
// ++++++++++++++++++++++++++++++++++++++++++
|
info@54
|
4 |
|
info@54
|
5 |
/*!
|
info@54
|
6 |
* Copyright 2013 Twitter, Inc.
|
info@54
|
7 |
*
|
info@54
|
8 |
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
info@54
|
9 |
* details, see http://creativecommons.org/licenses/by/3.0/.
|
info@54
|
10 |
*/
|
info@54
|
11 |
|
info@54
|
12 |
|
info@54
|
13 |
!function ($) {
|
info@54
|
14 |
|
info@54
|
15 |
$(function(){
|
info@54
|
16 |
|
info@54
|
17 |
// IE10 viewport hack for Surface/desktop Windows 8 bug
|
info@54
|
18 |
//
|
info@54
|
19 |
// See Getting Started docs for more information
|
info@54
|
20 |
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
|
info@54
|
21 |
var msViewportStyle = document.createElement("style");
|
info@54
|
22 |
msViewportStyle.appendChild(
|
info@54
|
23 |
document.createTextNode(
|
info@54
|
24 |
"@-ms-viewport{width:auto!important}"
|
info@54
|
25 |
)
|
info@54
|
26 |
);
|
info@54
|
27 |
document.getElementsByTagName("head")[0].
|
info@54
|
28 |
appendChild(msViewportStyle);
|
info@54
|
29 |
}
|
info@54
|
30 |
|
info@54
|
31 |
|
info@54
|
32 |
var $window = $(window)
|
info@54
|
33 |
var $body = $(document.body)
|
info@54
|
34 |
|
info@54
|
35 |
var navHeight = $('.navbar').outerHeight(true) + 10
|
info@54
|
36 |
|
info@54
|
37 |
$body.scrollspy({
|
info@54
|
38 |
target: '.bs-sidebar',
|
info@54
|
39 |
offset: navHeight
|
info@54
|
40 |
})
|
info@54
|
41 |
|
info@54
|
42 |
$window.on('load', function () {
|
info@54
|
43 |
$body.scrollspy('refresh')
|
info@54
|
44 |
})
|
info@54
|
45 |
|
info@54
|
46 |
$('.bs-docs-container [href=#]').click(function (e) {
|
info@54
|
47 |
e.preventDefault()
|
info@54
|
48 |
})
|
info@54
|
49 |
|
info@54
|
50 |
// back to top
|
info@54
|
51 |
setTimeout(function () {
|
info@54
|
52 |
var $sideBar = $('.bs-sidebar')
|
info@54
|
53 |
|
info@54
|
54 |
$sideBar.affix({
|
info@54
|
55 |
offset: {
|
info@54
|
56 |
top: function () {
|
info@54
|
57 |
var offsetTop = $sideBar.offset().top
|
info@54
|
58 |
var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
|
info@54
|
59 |
var navOuterHeight = $('.bs-docs-nav').height()
|
info@54
|
60 |
|
info@54
|
61 |
return (this.top = offsetTop - navOuterHeight - sideBarMargin)
|
info@54
|
62 |
}
|
info@54
|
63 |
, bottom: function () {
|
info@54
|
64 |
return (this.bottom = $('.bs-footer').outerHeight(true))
|
info@54
|
65 |
}
|
info@54
|
66 |
}
|
info@54
|
67 |
})
|
info@54
|
68 |
}, 100)
|
info@54
|
69 |
|
info@54
|
70 |
setTimeout(function () {
|
info@54
|
71 |
$('.bs-top').affix()
|
info@54
|
72 |
}, 100)
|
info@54
|
73 |
|
info@54
|
74 |
// tooltip demo
|
info@54
|
75 |
$('.tooltip-demo').tooltip({
|
info@54
|
76 |
selector: "[data-toggle=tooltip]",
|
info@54
|
77 |
container: "body"
|
info@54
|
78 |
})
|
info@54
|
79 |
|
info@54
|
80 |
$('.tooltip-test').tooltip()
|
info@54
|
81 |
$('.popover-test').popover()
|
info@54
|
82 |
|
info@54
|
83 |
$('.bs-docs-navbar').tooltip({
|
info@54
|
84 |
selector: "a[data-toggle=tooltip]",
|
info@54
|
85 |
container: ".bs-docs-navbar .nav"
|
info@54
|
86 |
})
|
info@54
|
87 |
|
info@54
|
88 |
// popover demo
|
info@54
|
89 |
$("[data-toggle=popover]")
|
info@54
|
90 |
.popover()
|
info@54
|
91 |
|
info@54
|
92 |
// button state demo
|
info@54
|
93 |
$('#fat-btn')
|
info@54
|
94 |
.click(function () {
|
info@54
|
95 |
var btn = $(this)
|
info@54
|
96 |
btn.button('loading')
|
info@54
|
97 |
setTimeout(function () {
|
info@54
|
98 |
btn.button('reset')
|
info@54
|
99 |
}, 3000)
|
info@54
|
100 |
})
|
info@54
|
101 |
})
|
info@54
|
102 |
|
info@54
|
103 |
}(jQuery)
|