From 88fdd4542749275d6ab970ee040f2efe10018d5b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 13 Feb 2014 01:12:26 -0800 Subject: v3.1.1 bump --- js/affix.js | 2 +- js/alert.js | 2 +- js/button.js | 2 +- js/carousel.js | 2 +- js/collapse.js | 2 +- js/dropdown.js | 2 +- js/modal.js | 2 +- js/popover.js | 2 +- js/scrollspy.js | 2 +- js/tab.js | 2 +- js/tooltip.js | 2 +- js/transition.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'js') diff --git a/js/affix.js b/js/affix.js index d447b0947..05c909e16 100644 --- a/js/affix.js +++ b/js/affix.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: affix.js v3.1.0 + * Bootstrap: affix.js v3.1.1 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/alert.js b/js/alert.js index 1c0756a95..516fe4ff5 100644 --- a/js/alert.js +++ b/js/alert.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: alert.js v3.1.0 + * Bootstrap: alert.js v3.1.1 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/button.js b/js/button.js index 2be72d53d..f4d8d8b30 100644 --- a/js/button.js +++ b/js/button.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: button.js v3.1.0 + * Bootstrap: button.js v3.1.1 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/carousel.js b/js/carousel.js index 88c9b23da..19e9af1ed 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: carousel.js v3.1.0 + * Bootstrap: carousel.js v3.1.1 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/collapse.js b/js/collapse.js index 1abafd6a5..7130282b0 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: collapse.js v3.1.0 + * Bootstrap: collapse.js v3.1.1 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/dropdown.js b/js/dropdown.js index 9c13aac97..43d7ae3ea 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: dropdown.js v3.1.0 + * Bootstrap: dropdown.js v3.1.1 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/modal.js b/js/modal.js index 24506ea28..20ff27046 100644 --- a/js/modal.js +++ b/js/modal.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: modal.js v3.1.0 + * Bootstrap: modal.js v3.1.1 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/popover.js b/js/popover.js index 193cf06f4..23aa82987 100644 --- a/js/popover.js +++ b/js/popover.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: popover.js v3.1.0 + * Bootstrap: popover.js v3.1.1 * http://getbootstrap.com/javascript/#popovers * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/scrollspy.js b/js/scrollspy.js index 04958a585..4346c865c 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: scrollspy.js v3.1.0 + * Bootstrap: scrollspy.js v3.1.1 * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/tab.js b/js/tab.js index 6f0fd4557..400cb7b84 100644 --- a/js/tab.js +++ b/js/tab.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: tab.js v3.1.0 + * Bootstrap: tab.js v3.1.1 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2014 Twitter, Inc. diff --git a/js/tooltip.js b/js/tooltip.js index 6cf2b0f8e..f6c0a376c 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: tooltip.js v3.1.0 + * Bootstrap: tooltip.js v3.1.1 * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== diff --git a/js/transition.js b/js/transition.js index 0bcbdcd43..efa8c1716 100644 --- a/js/transition.js +++ b/js/transition.js @@ -1,5 +1,5 @@ /* ======================================================================== - * Bootstrap: transition.js v3.1.0 + * Bootstrap: transition.js v3.1.1 * http://getbootstrap.com/javascript/#transitions * ======================================================================== * Copyright 2011-2014 Twitter, Inc. -- cgit v1.2.3 From 895b0006b9adbaf3c56953d2ab2967aa85071086 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Feb 2014 09:55:12 +0200 Subject: Re-indent test files. --- js/.jshintrc | 1 + js/tests/unit/affix.js | 90 ++--- js/tests/unit/alert.js | 112 +++--- js/tests/unit/button.js | 236 ++++++------- js/tests/unit/carousel.js | 184 +++++----- js/tests/unit/collapse.js | 250 +++++++------- js/tests/unit/dropdown.js | 416 +++++++++++----------- js/tests/unit/modal.js | 378 ++++++++++---------- js/tests/unit/popover.js | 248 +++++++------- js/tests/unit/scrollspy.js | 54 +-- js/tests/unit/tab.js | 134 ++++---- js/tests/unit/tooltip.js | 838 ++++++++++++++++++++++----------------------- 12 files changed, 1471 insertions(+), 1470 deletions(-) (limited to 'js') diff --git a/js/.jshintrc b/js/.jshintrc index ab4dfdfc9..ec4925964 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -8,6 +8,7 @@ "eqeqeq" : false, "eqnull" : true, "expr" : true, + "indent" : 2, "laxbreak" : true, "quotmark" : "single", "validthis": true diff --git a/js/tests/unit/affix.js b/js/tests/unit/affix.js index 3c8105bce..b348ecf2b 100644 --- a/js/tests/unit/affix.js +++ b/js/tests/unit/affix.js @@ -1,50 +1,50 @@ $(function () { - module('affix') - - test('should provide no conflict', function () { - var affix = $.fn.affix.noConflict() - ok(!$.fn.affix, 'affix was set back to undefined (org value)') - $.fn.affix = affix - }) - - test('should be defined on jquery object', function () { - ok($(document.body).affix, 'affix method is defined') - }) - - test('should return element', function () { - ok($(document.body).affix()[0] == document.body, 'document.body returned') - }) - - test('should exit early if element is not visible', function () { - var $affix = $('
').affix() - $affix.data('bs.affix').checkPosition() - ok(!$affix.hasClass('affix'), 'affix class was not added') + module('affix') + + test('should provide no conflict', function () { + var affix = $.fn.affix.noConflict() + ok(!$.fn.affix, 'affix was set back to undefined (org value)') + $.fn.affix = affix + }) + + test('should be defined on jquery object', function () { + ok($(document.body).affix, 'affix method is defined') + }) + + test('should return element', function () { + ok($(document.body).affix()[0] == document.body, 'document.body returned') + }) + + test('should exit early if element is not visible', function () { + var $affix = $('
').affix() + $affix.data('bs.affix').checkPosition() + ok(!$affix.hasClass('affix'), 'affix class was not added') + }) + + test('should trigger affixed event after affix', function () { + stop() + + var template = $('
  • Please affix
  • And unaffix
') + template.appendTo('body') + + var affixer = $('#affixTarget').affix({ + offset: $('#affixTarget ul').position() + }) + + $('#affixTarget') + .on('affix.bs.affix', function (e) { + ok(true, 'affix event triggered') + }).on('affixed.bs.affix', function (e) { + ok(true,'affixed event triggered') + $('#affixTarget').remove() + $('#affixAfter').remove() + start() }) - test('should trigger affixed event after affix', function () { - stop() - - var template = $('
  • Please affix
  • And unaffix
') - template.appendTo('body') - - var affixer = $('#affixTarget').affix({ - offset: $('#affixTarget ul').position() - }) - - $('#affixTarget') - .on('affix.bs.affix', function (e) { - ok(true, 'affix event triggered') - }).on('affixed.bs.affix', function (e) { - ok(true,'affixed event triggered') - $('#affixTarget').remove() - $('#affixAfter').remove() - start() - }) - - setTimeout(function () { - window.scrollTo(0, document.body.scrollHeight) - setTimeout(function () { window.scroll(0,0) }, 0) - },0) - }) + setTimeout(function () { + window.scrollTo(0, document.body.scrollHeight) + setTimeout(function () { window.scroll(0,0) }, 0) + },0) + }) }) diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index b88b95fee..755d9d1e5 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -1,62 +1,62 @@ $(function () { - module('alert') - - test('should provide no conflict', function () { - var alert = $.fn.alert.noConflict() - ok(!$.fn.alert, 'alert was set back to undefined (org value)') - $.fn.alert = alert - }) - - test('should be defined on jquery object', function () { - ok($(document.body).alert, 'alert method is defined') - }) - - test('should return element', function () { - ok($(document.body).alert()[0] == document.body, 'document.body returned') - }) - - test('should fade element out on clicking .close', function () { - var alertHTML = '
' + - '×' + - '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + - '
', - alert = $(alertHTML).alert() - - alert.find('.close').click() - - ok(!alert.hasClass('in'), 'remove .in class on .close click') - }) - - test('should remove element when clicking .close', function () { - $.support.transition = false - - var alertHTML = '
' + - '×' + - '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + - '
', - alert = $(alertHTML).appendTo('#qunit-fixture').alert() - - ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom') - - alert.find('.close').click() - - ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom') + module('alert') + + test('should provide no conflict', function () { + var alert = $.fn.alert.noConflict() + ok(!$.fn.alert, 'alert was set back to undefined (org value)') + $.fn.alert = alert + }) + + test('should be defined on jquery object', function () { + ok($(document.body).alert, 'alert method is defined') + }) + + test('should return element', function () { + ok($(document.body).alert()[0] == document.body, 'document.body returned') + }) + + test('should fade element out on clicking .close', function () { + var alertHTML = '
' + + '×' + + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + + '
', + alert = $(alertHTML).alert() + + alert.find('.close').click() + + ok(!alert.hasClass('in'), 'remove .in class on .close click') + }) + + test('should remove element when clicking .close', function () { + $.support.transition = false + + var alertHTML = '
' + + '×' + + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + + '
', + alert = $(alertHTML).appendTo('#qunit-fixture').alert() + + ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom') + + alert.find('.close').click() + + ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom') + }) + + test('should not fire closed when close is prevented', function () { + $.support.transition = false + stop(); + $('
') + .on('close.bs.alert', function (e) { + e.preventDefault(); + ok(true); + start(); }) - - test('should not fire closed when close is prevented', function () { - $.support.transition = false - stop(); - $('
') - .on('close.bs.alert', function (e) { - e.preventDefault(); - ok(true); - start(); - }) - .on('closed.bs.alert', function () { - ok(false); - }) - .alert('close') + .on('closed.bs.alert', function () { + ok(false); }) + .alert('close') + }) }) diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 104e8d857..73420863c 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -1,122 +1,122 @@ $(function () { - module('button') - - test('should provide no conflict', function () { - var button = $.fn.button.noConflict() - ok(!$.fn.button, 'button was set back to undefined (org value)') - $.fn.button = button - }) - - test('should be defined on jquery object', function () { - ok($(document.body).button, 'button method is defined') - }) - - test('should return element', function () { - ok($(document.body).button()[0] == document.body, 'document.body returned') - }) - - test('should return set state to loading', function () { - var btn = $('') - equal(btn.html(), 'mdo', 'btn text equals mdo') - btn.button('loading') - equal(btn.html(), 'fat', 'btn text equals fat') - stop() - setTimeout(function () { - ok(btn.attr('disabled'), 'btn is disabled') - ok(btn.hasClass('disabled'), 'btn has disabled class') - start() - }, 0) - }) - - test('should return reset state', function () { - var btn = $('') - equal(btn.html(), 'mdo', 'btn text equals mdo') - btn.button('loading') - equal(btn.html(), 'fat', 'btn text equals fat') - stop() - setTimeout(function () { - ok(btn.attr('disabled'), 'btn is disabled') - ok(btn.hasClass('disabled'), 'btn has disabled class') - start() - stop() - btn.button('reset') - equal(btn.html(), 'mdo', 'btn text equals mdo') - setTimeout(function () { - ok(!btn.attr('disabled'), 'btn is not disabled') - ok(!btn.hasClass('disabled'), 'btn does not have disabled class') - start() - }, 0) - }, 0) - - }) - - test('should toggle active', function () { - var btn = $('') - ok(!btn.hasClass('active'), 'btn does not have active class') - btn.button('toggle') - ok(btn.hasClass('active'), 'btn has class active') - }) - - test('should toggle active when btn children are clicked', function () { - var btn = $(''), - inner = $('') - btn - .append(inner) - .appendTo($('#qunit-fixture')) - ok(!btn.hasClass('active'), 'btn does not have active class') - inner.click() - ok(btn.hasClass('active'), 'btn has class active') - }) - - test('should toggle active when btn children are clicked within btn-group', function () { - var btngroup = $('
'), - btn = $(''), - inner = $('') - btngroup - .append(btn.append(inner)) - .appendTo($('#qunit-fixture')) - ok(!btn.hasClass('active'), 'btn does not have active class') - inner.click() - ok(btn.hasClass('active'), 'btn has class active') - }) - - test('should check for closest matching toggle', function () { - var group = '
' + - '' + - '' + - '' + - '
' - - group = $(group) - - var btn1 = $(group.children()[0]) - var btn2 = $(group.children()[1]) - var btn3 = $(group.children()[2]) - - group.appendTo($('#qunit-fixture')) - - ok(btn1.hasClass('active'), 'btn1 has active class') - ok(btn1.find('input').prop('checked'), 'btn1 is checked') - ok(!btn2.hasClass('active'), 'btn2 does not have active class') - ok(!btn2.find('input').prop('checked'), 'btn2 is not checked') - btn2.find('input').click() - ok(!btn1.hasClass('active'), 'btn1 does not have active class') - ok(!btn1.find('input').prop('checked'), 'btn1 is checked') - ok(btn2.hasClass('active'), 'btn2 has active class') - ok(btn2.find('input').prop('checked'), 'btn2 is checked') - - btn2.find('input').click() /* clicking an already checked radio should not un-check it */ - ok(!btn1.hasClass('active'), 'btn1 does not have active class') - ok(!btn1.find('input').prop('checked'), 'btn1 is checked') - ok(btn2.hasClass('active'), 'btn2 has active class') - ok(btn2.find('input').prop('checked'), 'btn2 is checked') - }) + module('button') + + test('should provide no conflict', function () { + var button = $.fn.button.noConflict() + ok(!$.fn.button, 'button was set back to undefined (org value)') + $.fn.button = button + }) + + test('should be defined on jquery object', function () { + ok($(document.body).button, 'button method is defined') + }) + + test('should return element', function () { + ok($(document.body).button()[0] == document.body, 'document.body returned') + }) + + test('should return set state to loading', function () { + var btn = $('') + equal(btn.html(), 'mdo', 'btn text equals mdo') + btn.button('loading') + equal(btn.html(), 'fat', 'btn text equals fat') + stop() + setTimeout(function () { + ok(btn.attr('disabled'), 'btn is disabled') + ok(btn.hasClass('disabled'), 'btn has disabled class') + start() + }, 0) + }) + + test('should return reset state', function () { + var btn = $('') + equal(btn.html(), 'mdo', 'btn text equals mdo') + btn.button('loading') + equal(btn.html(), 'fat', 'btn text equals fat') + stop() + setTimeout(function () { + ok(btn.attr('disabled'), 'btn is disabled') + ok(btn.hasClass('disabled'), 'btn has disabled class') + start() + stop() + btn.button('reset') + equal(btn.html(), 'mdo', 'btn text equals mdo') + setTimeout(function () { + ok(!btn.attr('disabled'), 'btn is not disabled') + ok(!btn.hasClass('disabled'), 'btn does not have disabled class') + start() + }, 0) + }, 0) + + }) + + test('should toggle active', function () { + var btn = $('') + ok(!btn.hasClass('active'), 'btn does not have active class') + btn.button('toggle') + ok(btn.hasClass('active'), 'btn has class active') + }) + + test('should toggle active when btn children are clicked', function () { + var btn = $(''), + inner = $('') + btn + .append(inner) + .appendTo($('#qunit-fixture')) + ok(!btn.hasClass('active'), 'btn does not have active class') + inner.click() + ok(btn.hasClass('active'), 'btn has class active') + }) + + test('should toggle active when btn children are clicked within btn-group', function () { + var btngroup = $('
'), + btn = $(''), + inner = $('') + btngroup + .append(btn.append(inner)) + .appendTo($('#qunit-fixture')) + ok(!btn.hasClass('active'), 'btn does not have active class') + inner.click() + ok(btn.hasClass('active'), 'btn has class active') + }) + + test('should check for closest matching toggle', function () { + var group = '
' + + '' + + '' + + '' + + '
' + + group = $(group) + + var btn1 = $(group.children()[0]) + var btn2 = $(group.children()[1]) + var btn3 = $(group.children()[2]) + + group.appendTo($('#qunit-fixture')) + + ok(btn1.hasClass('active'), 'btn1 has active class') + ok(btn1.find('input').prop('checked'), 'btn1 is checked') + ok(!btn2.hasClass('active'), 'btn2 does not have active class') + ok(!btn2.find('input').prop('checked'), 'btn2 is not checked') + btn2.find('input').click() + ok(!btn1.hasClass('active'), 'btn1 does not have active class') + ok(!btn1.find('input').prop('checked'), 'btn1 is checked') + ok(btn2.hasClass('active'), 'btn2 has active class') + ok(btn2.find('input').prop('checked'), 'btn2 is checked') + + btn2.find('input').click() /* clicking an already checked radio should not un-check it */ + ok(!btn1.hasClass('active'), 'btn1 does not have active class') + ok(!btn1.find('input').prop('checked'), 'btn1 is checked') + ok(btn2.hasClass('active'), 'btn2 has active class') + ok(btn2.find('input').prop('checked'), 'btn2 is checked') + }) }) diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 5edec68ad..6851e17a5 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -1,110 +1,110 @@ $(function () { - module('carousel') + module('carousel') - test('should provide no conflict', function () { - var carousel = $.fn.carousel.noConflict() - ok(!$.fn.carousel, 'carousel was set back to undefined (org value)') - $.fn.carousel = carousel - }) + test('should provide no conflict', function () { + var carousel = $.fn.carousel.noConflict() + ok(!$.fn.carousel, 'carousel was set back to undefined (org value)') + $.fn.carousel = carousel + }) - test('should be defined on jquery object', function () { - ok($(document.body).carousel, 'carousel method is defined') - }) + test('should be defined on jquery object', function () { + ok($(document.body).carousel, 'carousel method is defined') + }) - test('should return element', function () { - ok($(document.body).carousel()[0] == document.body, 'document.body returned') - }) + test('should return element', function () { + ok($(document.body).carousel()[0] == document.body, 'document.body returned') + }) - test('should not fire slide when slide is prevented', function () { - $.support.transition = false - stop() - $('