diff options
Diffstat (limited to 'assets/js')
-rwxr-xr-x | assets/js/application.js | 280 | ||||
-rwxr-xr-x | assets/js/bootstrap-alert.js | 13 | ||||
-rwxr-xr-x | assets/js/bootstrap-button.js | 8 | ||||
-rwxr-xr-x | assets/js/bootstrap-carousel.js | 11 | ||||
-rwxr-xr-x | assets/js/bootstrap-collapse.js | 8 | ||||
-rwxr-xr-x | assets/js/bootstrap-dropdown.js | 4 | ||||
-rwxr-xr-x | assets/js/bootstrap-modal.js | 6 | ||||
-rwxr-xr-x | assets/js/bootstrap-popover.js | 4 | ||||
-rwxr-xr-x | assets/js/bootstrap-scrollspy.js | 4 | ||||
-rwxr-xr-x | assets/js/bootstrap-tab.js | 4 | ||||
-rwxr-xr-x | assets/js/bootstrap-tooltip.js | 6 | ||||
-rwxr-xr-x | assets/js/bootstrap-transition.js | 6 | ||||
-rwxr-xr-x | assets/js/bootstrap-typeahead.js | 16 |
13 files changed, 192 insertions, 178 deletions
diff --git a/assets/js/application.js b/assets/js/application.js index 675653a4..0b59876f 100755 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -8,40 +8,40 @@ // Disable certain links in docs // $('section [href^=#]').click(function (e) { - // e.preventDefault() - // }) - - // make code pretty - // window.prettyPrint && prettyPrint() - // - // // add-ons - // $('.add-on :checkbox').on('click', function () { - // var $this = $(this) - // , method = $this.attr('checked') ? 'addClass' : 'removeClass' - // $(this).parents('.add-on')[method]('active') - // }) - - // position static twipsies for components page - // if ($(".twipsies a").length) { - // $(window).on('load resize', function () { - // $(".twipsies a").each(function () { - // $(this) - // .tooltip({ - // placement: $(this).attr('title') - // , trigger: 'manual' - // }) - // .tooltip('show') + // e.preventDefault() + // }) + // + // // make code pretty + // window.prettyPrint && prettyPrint() + // + // // add-ons + // $('.add-on :checkbox').on('click', function () { + // var $this = $(this) + // , method = $this.attr('checked') ? 'addClass' : 'removeClass' + // $(this).parents('.add-on')[method]('active') + // }) + // + // // position static twipsies for components page + // if ($(".twipsies a").length) { + // $(window).on('load resize', function () { + // $(".twipsies a").each(function () { + // $(this) + // .tooltip({ + // placement: $(this).attr('title') + // , trigger: 'manual' + // }) + // .tooltip('show') + // }) // }) - // }) - // } - - // add tipsies to grid for scaffolding - // if ($('#grid-system').length) { - // $('#grid-system').tooltip({ - // selector: '.show-grid > div' - // , title: function () { return $(this).width() + 'px' } - // }) - // } + // } + // + // // add tipsies to grid for scaffolding + // if ($('#grid-system').length) { + // $('#grid-system').tooltip({ + // selector: '.show-grid > div' + // , title: function () { return $(this).width() + 'px' } + // }) + // } // fix sub nav on scroll var $win = $(window) @@ -67,115 +67,115 @@ // tooltip demo // $('.tooltip-demo.well').tooltip({ - // selector: "a[rel=tooltip]" - // }) + // selector: "a[rel=tooltip]" + // }) + // + // $('.tooltip-test').tooltip() + // $('.popover-test').popover() + // + // // popover demo + // $("a[rel=popover]") + // .popover() + // .click(function(e) { + // e.preventDefault() + // }) + // + // // button state demo + // $('#fat-btn') + // .click(function () { + // var btn = $(this) + // btn.button('loading') + // setTimeout(function () { + // btn.button('reset') + // }, 3000) + // }) + // + // // carousel demo + // $('#myCarousel').carousel() + // + // // javascript build logic + // var inputsComponent = $("#components.download input") + // , inputsPlugin = $("#plugins.download input") + // , inputsVariables = $("#variables.download input") + // + // // toggle all plugin checkboxes + // $('#components.download .toggle-all').on('click', function (e) { + // e.preventDefault() + // inputsComponent.attr('checked', !inputsComponent.is(':checked')) + // }) + // + // $('#plugins.download .toggle-all').on('click', function (e) { + // e.preventDefault() + // inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) + // }) + // + // $('#variables.download .toggle-all').on('click', function (e) { + // e.preventDefault() + // inputsVariables.val('') + // }) + // + // // request built javascript + // $('.download-btn').on('click', function () { + // + // var css = $("#components.download input:checked") + // .map(function () { return this.value }) + // .toArray() + // , js = $("#plugins.download input:checked") + // .map(function () { return this.value }) + // .toArray() + // , vars = {} + // , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] + // + // $("#variables.download input") + // .each(function () { + // $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) + // }) + // + // $.ajax({ + // type: 'POST' + // , url: 'http://bootstrap.herokuapp.com' + // , dataType: 'jsonpi' + // , params: { + // js: js + // , css: css + // , vars: vars + // , img: img + // } + // }) + // }) // - // $('.tooltip-test').tooltip() - // $('.popover-test').popover() - - // popover demo - // $("a[rel=popover]") - // .popover() - // .click(function(e) { - // e.preventDefault() - // }) - - // button state demo - // $('#fat-btn') - // .click(function () { - // var btn = $(this) - // btn.button('loading') - // setTimeout(function () { - // btn.button('reset') - // }, 3000) // }) - - // carousel demo - // $('#myCarousel').carousel() - - // javascript build logic - // var inputsComponent = $("#components.download input") - // , inputsPlugin = $("#plugins.download input") - // , inputsVariables = $("#variables.download input") - - // toggle all plugin checkboxes - // $('#components.download .toggle-all').on('click', function (e) { - // e.preventDefault() - // inputsComponent.attr('checked', !inputsComponent.is(':checked')) - // }) - // - // $('#plugins.download .toggle-all').on('click', function (e) { - // e.preventDefault() - // inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) - // }) - // - // $('#variables.download .toggle-all').on('click', function (e) { - // e.preventDefault() - // inputsVariables.val('') - // }) - - // request built javascript - // $('.download-btn').on('click', function () { - // - // var css = $("#components.download input:checked") - // .map(function () { return this.value }) - // .toArray() - // , js = $("#plugins.download input:checked") - // .map(function () { return this.value }) - // .toArray() - // , vars = {} - // , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] - // - // $("#variables.download input") - // .each(function () { - // $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) - // }) - // - // $.ajax({ - // type: 'POST' - // , url: 'http://bootstrap.herokuapp.com' - // , dataType: 'jsonpi' - // , params: { - // js: js - // , css: css - // , vars: vars - // , img: img - // } - // }) - // }) - // - // }) - -// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi -// $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { -// var url = opts.url; -// -// return { -// send: function(_, completeCallback) { -// var name = 'jQuery_iframe_' + jQuery.now() -// , iframe, form -// -// iframe = $('<iframe>') -// .attr('name', name) -// .appendTo('head') -// -// form = $('<form>') -// .attr('method', opts.type) // GET or POST -// .attr('action', url) -// .attr('target', name) -// -// $.each(opts.params, function(k, v) { -// -// $('<input>') -// .attr('type', 'hidden') -// .attr('name', k) -// .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) -// .appendTo(form) -// }) -// -// form.appendTo('body').submit() -// } -// } + // + // // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi + // $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { + // var url = opts.url; + // + // return { + // send: function(_, completeCallback) { + // var name = 'jQuery_iframe_' + jQuery.now() + // , iframe, form + // + // iframe = $('<iframe>') + // .attr('name', name) + // .appendTo('head') + // + // form = $('<form>') + // .attr('method', opts.type) // GET or POST + // .attr('action', url) + // .attr('target', name) + // + // $.each(opts.params, function(k, v) { + // + // $('<input>') + // .attr('type', 'hidden') + // .attr('name', k) + // .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) + // .appendTo(form) + // }) + // + // form.appendTo('body').submit() + // } + // } }) }(window.jQuery)
\ No newline at end of file diff --git a/assets/js/bootstrap-alert.js b/assets/js/bootstrap-alert.js index 4a65b135..d17f44e1 100755 --- a/assets/js/bootstrap-alert.js +++ b/assets/js/bootstrap-alert.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-alert.js v2.0.0 + * bootstrap-alert.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2012 Twitter, Inc. @@ -51,11 +51,14 @@ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - $parent.removeClass('in') + $parent + .trigger('close') + .removeClass('in') function removeElement() { - $parent.remove() - $parent.trigger('closed') + $parent + .trigger('closed') + .remove() } $.support.transition && $parent.hasClass('fade') ? @@ -88,4 +91,4 @@ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-button.js b/assets/js/bootstrap-button.js index d85c8294..6b36753d 100755 --- a/assets/js/bootstrap-button.js +++ b/assets/js/bootstrap-button.js @@ -1,5 +1,5 @@ /* ============================================================ - * bootstrap-button.js v2.0.0 + * bootstrap-button.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#buttons * ============================================================ * Copyright 2012 Twitter, Inc. @@ -91,8 +91,10 @@ $(function () { $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { - $(e.target).button('toggle') + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-carousel.js b/assets/js/bootstrap-carousel.js index 2f47edb8..8c0723d2 100755 --- a/assets/js/bootstrap-carousel.js +++ b/assets/js/bootstrap-carousel.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-carousel.js v2.0.0 + * bootstrap-carousel.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== * Copyright 2012 Twitter, Inc. @@ -29,6 +29,9 @@ this.$element = $(element) this.options = $.extend({}, $.fn.carousel.defaults, options) this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.prototype = { @@ -61,6 +64,7 @@ , pause: function () { clearInterval(this.interval) + this.interval = null return this } @@ -88,6 +92,8 @@ $next = $next.length ? $next : this.$element.find('.item')[fallback]() + if ($next.hasClass('active')) return + if (!$.support.transition && this.$element.hasClass('slide')) { this.$element.trigger('slide') $active.removeClass('active') @@ -133,6 +139,7 @@ $.fn.carousel.defaults = { interval: 5000 + , pause: 'hover' } $.fn.carousel.Constructor = Carousel @@ -151,4 +158,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-collapse.js b/assets/js/bootstrap-collapse.js index 8134cc42..9a364468 100755 --- a/assets/js/bootstrap-collapse.js +++ b/assets/js/bootstrap-collapse.js @@ -1,5 +1,5 @@ /* ============================================================= - * bootstrap-collapse.js v2.0.0 + * bootstrap-collapse.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= * Copyright 2012 Twitter, Inc. @@ -74,7 +74,9 @@ [dimension](size || 'auto') [0].offsetWidth - this.$element.addClass('collapse') + this.$element[size ? 'addClass' : 'removeClass']('collapse') + + return this } , transition: function ( method, startEvent, completeEvent ) { @@ -133,4 +135,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-dropdown.js b/assets/js/bootstrap-dropdown.js index 48d3ce0f..54b61c5e 100755 --- a/assets/js/bootstrap-dropdown.js +++ b/assets/js/bootstrap-dropdown.js @@ -1,5 +1,5 @@ /* ============================================================ - * bootstrap-dropdown.js v2.0.0 + * bootstrap-dropdown.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ * Copyright 2012 Twitter, Inc. @@ -89,4 +89,4 @@ $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-modal.js b/assets/js/bootstrap-modal.js index 180f0b64..e9297062 100755 --- a/assets/js/bootstrap-modal.js +++ b/assets/js/bootstrap-modal.js @@ -1,5 +1,5 @@ /* ========================================================= - * bootstrap-modal.js v2.0.0 + * bootstrap-modal.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Copyright 2012 Twitter, Inc. @@ -177,7 +177,7 @@ return this.each(function () { var $this = $(this) , data = $this.data('modal') - , options = $.extend({}, $.fn.modal.defaults, typeof option == 'object' && option) + , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option) if (!data) $this.data('modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option]() else if (options.show) data.show() @@ -207,4 +207,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-popover.js b/assets/js/bootstrap-popover.js index 35ff9d0a..e1aa5ac3 100755 --- a/assets/js/bootstrap-popover.js +++ b/assets/js/bootstrap-popover.js @@ -1,5 +1,5 @@ /* =========================================================== - * bootstrap-popover.js v2.0.0 + * bootstrap-popover.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#popovers * =========================================================== * Copyright 2012 Twitter, Inc. @@ -92,4 +92,4 @@ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>' }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-scrollspy.js b/assets/js/bootstrap-scrollspy.js index e8bd0715..ea29f2f8 100755 --- a/assets/js/bootstrap-scrollspy.js +++ b/assets/js/bootstrap-scrollspy.js @@ -1,5 +1,5 @@ /* ============================================================= - * bootstrap-scrollspy.js v2.0.0 + * bootstrap-scrollspy.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#scrollspy * ============================================================= * Copyright 2012 Twitter, Inc. @@ -122,4 +122,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-tab.js b/assets/js/bootstrap-tab.js index f19db5da..b3938f67 100755 --- a/assets/js/bootstrap-tab.js +++ b/assets/js/bootstrap-tab.js @@ -1,5 +1,5 @@ /* ======================================================== - * bootstrap-tab.js v2.0.0 + * bootstrap-tab.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2012 Twitter, Inc. @@ -127,4 +127,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-tooltip.js b/assets/js/bootstrap-tooltip.js index 21f2311f..49b5f728 100755 --- a/assets/js/bootstrap-tooltip.js +++ b/assets/js/bootstrap-tooltip.js @@ -1,5 +1,5 @@ /* =========================================================== - * bootstrap-tooltip.js v2.0.0 + * bootstrap-tooltip.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#tooltips * Inspired by the original jQuery.tipsy by Jason Frame * =========================================================== @@ -206,7 +206,7 @@ title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - title = title.toString().replace(/(^\s*|\s*$)/, "") + title = (title || '').toString().replace(/(^\s*|\s*$)/, "") return title } @@ -267,4 +267,4 @@ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' } -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-transition.js b/assets/js/bootstrap-transition.js index 956350bd..f5226f96 100755 --- a/assets/js/bootstrap-transition.js +++ b/assets/js/bootstrap-transition.js @@ -1,5 +1,5 @@ /* =================================================== - * bootstrap-transition.js v2.0.0 + * bootstrap-transition.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#transitions * =================================================== * Copyright 2012 Twitter, Inc. @@ -47,5 +47,5 @@ })() }) - -}( window.jQuery ) + +}( window.jQuery );
\ No newline at end of file diff --git a/assets/js/bootstrap-typeahead.js b/assets/js/bootstrap-typeahead.js index 1426185a..dc2f8822 100755 --- a/assets/js/bootstrap-typeahead.js +++ b/assets/js/bootstrap-typeahead.js @@ -1,5 +1,5 @@ /* ============================================================= - * bootstrap-typeahead.js v2.0.0 + * bootstrap-typeahead.js v2.0.2 * http://twitter.github.com/bootstrap/javascript.html#typeahead * ============================================================= * Copyright 2012 Twitter, Inc. @@ -40,6 +40,7 @@ , select: function () { var val = this.$menu.find('.active').attr('data-value') this.$element.val(val) + this.$element.change(); return this.hide() } @@ -165,9 +166,6 @@ } , keyup: function (e) { - e.stopPropagation() - e.preventDefault() - switch(e.keyCode) { case 40: // down arrow case 38: // up arrow @@ -180,6 +178,7 @@ break case 27: // escape + if (!this.shown) return this.hide() break @@ -187,10 +186,11 @@ this.lookup() } + e.stopPropagation() + e.preventDefault() } , keypress: function (e) { - e.stopPropagation() if (!this.shown) return switch(e.keyCode) { @@ -210,12 +210,12 @@ this.next() break } + + e.stopPropagation() } , blur: function (e) { var that = this - e.stopPropagation() - e.preventDefault() setTimeout(function () { that.hide() }, 150) } @@ -268,4 +268,4 @@ }) }) -}( window.jQuery ) +}( window.jQuery );
\ No newline at end of file |