1 // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2 // IT'S ALL JUST JUNK FOR OUR DOCS!
3 // ++++++++++++++++++++++++++++++++++++++++++
9 // Disable certain links in docs
10 // $('section [href^=#]').click(function (e) {
15 // window.prettyPrint && prettyPrint()
18 // $('.add-on :checkbox').on('click', function () {
19 // var $this = $(this)
20 // , method = $this.attr('checked') ? 'addClass' : 'removeClass'
21 // $(this).parents('.add-on')[method]('active')
24 // position static twipsies for components page
25 // if ($(".twipsies a").length) {
26 // $(window).on('load resize', function () {
27 // $(".twipsies a").each(function () {
30 // placement: $(this).attr('title')
31 // , trigger: 'manual'
38 // add tipsies to grid for scaffolding
39 // if ($('#grid-system').length) {
40 // $('#grid-system').tooltip({
41 // selector: '.show-grid > div'
42 // , title: function () { return $(this).width() + 'px' }
46 // fix sub nav on scroll
49 , navHeight = $('.navbar').first().height()
50 , navTop = $('.subnav').length && $('.subnav').offset().top - navHeight
55 $win.on('scroll', processScroll)
57 function processScroll() {
58 var i, scrollTop = $win.scrollTop()
59 if (scrollTop >= navTop && !isFixed) {
61 $nav.addClass('subnav-fixed')
62 } else if (scrollTop <= navTop && isFixed) {
64 $nav.removeClass('subnav-fixed')
69 // $('.tooltip-demo.well').tooltip({
70 // selector: "a[rel=tooltip]"
73 // $('.tooltip-test').tooltip()
74 // $('.popover-test').popover()
77 // $("a[rel=popover]")
79 // .click(function(e) {
85 // .click(function () {
87 // btn.button('loading')
88 // setTimeout(function () {
89 // btn.button('reset')
94 // $('#myCarousel').carousel()
96 // javascript build logic
97 // var inputsComponent = $("#components.download input")
98 // , inputsPlugin = $("#plugins.download input")
99 // , inputsVariables = $("#variables.download input")
101 // toggle all plugin checkboxes
102 // $('#components.download .toggle-all').on('click', function (e) {
103 // e.preventDefault()
104 // inputsComponent.attr('checked', !inputsComponent.is(':checked'))
107 // $('#plugins.download .toggle-all').on('click', function (e) {
108 // e.preventDefault()
109 // inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
112 // $('#variables.download .toggle-all').on('click', function (e) {
113 // e.preventDefault()
114 // inputsVariables.val('')
117 // request built javascript
118 // $('.download-btn').on('click', function () {
120 // var css = $("#components.download input:checked")
121 // .map(function () { return this.value })
123 // , js = $("#plugins.download input:checked")
124 // .map(function () { return this.value })
127 // , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
129 // $("#variables.download input")
130 // .each(function () {
131 // $(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
136 // , url: 'http://bootstrap.herokuapp.com'
137 // , dataType: 'jsonpi'
149 // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
150 // $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
151 // var url = opts.url;
154 // send: function(_, completeCallback) {
155 // var name = 'jQuery_iframe_' + jQuery.now()
158 // iframe = $('<iframe>')
159 // .attr('name', name)
162 // form = $('<form>')
163 // .attr('method', opts.type) // GET or POST
164 // .attr('action', url)
165 // .attr('target', name)
167 // $.each(opts.params, function(k, v) {
170 // .attr('type', 'hidden')
172 // .attr('value', typeof v == 'string' ? v : JSON.stringify(v))
176 // form.appendTo('body').submit()