|
1 | 1 | <script> |
2 | | - $(function () { |
3 | | - // build side menu |
4 | | - var html = ''; |
5 | | - |
6 | | - $('.bs-docs-section').each(function () { |
7 | | - var h1 = $(this).find('h1[id]').first(), |
8 | | - h23 = $(this).find('h2[id], h3[id]'); |
9 | | - |
10 | | - if (h1.length) { |
11 | | - html += '<li><a href="#' + h1[0].id + '">' + h1.clone().children().remove().end().text() + '</a>'; |
12 | | - |
13 | | - if (h23.length) { |
14 | | - html += '<ul class="nav">'; |
15 | | - h23.each(function () { |
16 | | - html += '<li><a href="#' + this.id + '">' + $(this).clone().children().remove().end().text() + '</a></li>'; |
17 | | - }); |
18 | | - html += '</ul>'; |
19 | | - } |
20 | | - |
21 | | - html += '</li>'; |
22 | | - } |
23 | | - }); |
24 | | - |
25 | | - if (html == '') { |
26 | | - $('[role=complementary]').hide(); |
27 | | - $('[role=main]').toggleClass('col-md-9 col-md-12'); |
28 | | - } else { |
29 | | - $('.bs-docs-sidenav').html(html); |
30 | | - } |
31 | | - |
32 | | - $('[data-bootbox]').on('click', function () { |
33 | | - var $target = $('#' + $(this).data('bootbox')); |
34 | | - bootbox.alert({title: $target.attr('title'), message: $target.html()}); |
35 | | - }); |
36 | | - |
37 | | - /*! |
38 | | - * JavaScript for Bootstrap's docs (http://getbootstrap.com) |
39 | | - * Copyright 2011-2014 Twitter, Inc. |
40 | | - * Licensed under the Creative Commons Attribution 3.0 Unported License. For |
41 | | - * details, see http://creativecommons.org/licenses/by/3.0/. |
42 | | - */ |
43 | | - !function (a) { |
44 | | - a(function () { |
45 | | - if (navigator.userAgent.match(/IEMobile\/10\.0/)) { |
46 | | - var b = document.createElement("style"); |
47 | | - b.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")), |
48 | | - document.querySelector("head").appendChild(b) |
49 | | - } |
50 | | - { |
51 | | - var c = a(window), |
52 | | - d = a(document.body); |
53 | | - a(".navbar").outerHeight(!0) + 10 |
54 | | - } |
55 | | - d.scrollspy({target: ".bs-docs-sidebar"}), |
56 | | - c.on("load", function () { |
57 | | - d.scrollspy("refresh") |
58 | | - }), |
59 | | - a(".bs-docs-container [href=#]").click(function (a) { |
60 | | - a.preventDefault() |
61 | | - }), |
62 | | - setTimeout(function () { |
63 | | - var b = a(".bs-docs-sidebar"); |
64 | | - b.affix({ |
65 | | - offset: { |
66 | | - top: function () { |
67 | | - var c = b.offset().top, |
68 | | - d = parseInt(b.children(0).css("margin-top"), 10), |
69 | | - e = a(".bs-docs-nav").height(); |
70 | | - return this.top = c - e - d |
71 | | - }, |
72 | | - bottom: function () { |
73 | | - return this.bottom = a(".bs-docs-footer").outerHeight(!0) |
74 | | - } |
75 | | - } |
76 | | - }) |
77 | | - }, 100), |
78 | | - setTimeout(function () { |
79 | | - a(".bs-top").affix() |
80 | | - }, 100) |
81 | | - }) |
82 | | - }(jQuery); |
83 | | - }); |
84 | | -</script> |
85 | | - |
86 | | -<script> |
87 | | -$(function(){ |
88 | | - $('.gif').hover(function(){ |
89 | | - // on mouse enter |
90 | | - var path = $(this).attr('src'); |
91 | | - var gif = path.substring(0, path.lastIndexOf('.')) + '.gif'; |
92 | | - $(this).attr('src', gif); |
93 | | - }, function(){ |
94 | | - // on mouse leave |
95 | | - var path = $(this).attr('src'); |
96 | | - var png = path.substring(0, path.lastIndexOf('.')) + '.png'; |
97 | | - $(this).attr('src', png); |
98 | | - }); |
99 | | -}); |
| 2 | +$(function(){var t="";$(".bs-docs-section").each(function(){var e=$(this).find("h1[id]").first(),o=$(this).find("h2[id], h3[id]");e.length&&(t+='<li><a href="#'+e[0].id+'">'+e.clone().children().remove().end().text()+"</a>",o.length&&(t+='<ul class="nav">',o.each(function(){t+='<li><a href="#'+this.id+'">'+$(this).clone().children().remove().end().text()+"</a></li>"}),t+="</ul>"),t+="</li>")}),""==t?($("[role=complementary]").hide(),$("[role=main]").toggleClass("col-md-9 col-md-12")):$(".bs-docs-sidenav").html(t),$("[data-bootbox]").on("click",function(){var t=$("#"+$(this).data("bootbox"));bootbox.alert({title:t.attr("title"),message:t.html()})}),!function(t){t(function(){if(navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(e)}var o=t(window),i=t(document.body);t(".navbar").outerHeight(!0)+10,i.scrollspy({target:".bs-docs-sidebar"}),o.on("load",function(){i.scrollspy("refresh")}),t(".bs-docs-container [href=#]").click(function(t){t.preventDefault()}),setTimeout(function(){var e=t(".bs-docs-sidebar");e.affix({offset:{top:function(){var o=e.offset().top,i=parseInt(e.children(0).css("margin-top"),10),n=t(".bs-docs-nav").height();return this.top=o-n-i},bottom:function(){return this.bottom=t(".bs-docs-footer").outerHeight(!0)}}})},100),setTimeout(function(){t(".bs-top").affix()},100)})}(jQuery),$(".gif").hover(function(){var t=$(this).attr("src"),e=t.substring(0,t.lastIndexOf("."))+".gif";$(this).attr("src",e)},function(){var t=$(this).attr("src"),e=t.substring(0,t.lastIndexOf("."))+".png";$(this).attr("src",e)})}); |
100 | 3 | </script> |
0 commit comments