fennec 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. data/README.md +23 -6
  2. data/lib/fennec/version.rb +1 -1
  3. data/vendor/assets/javascripts/bootstrap-alert.js +8 -5
  4. data/vendor/assets/javascripts/bootstrap-button.js +5 -3
  5. data/vendor/assets/javascripts/bootstrap-carousel.js +9 -2
  6. data/vendor/assets/javascripts/bootstrap-collapse.js +5 -3
  7. data/vendor/assets/javascripts/bootstrap-dropdown.js +2 -2
  8. data/vendor/assets/javascripts/bootstrap-modal.js +3 -3
  9. data/vendor/assets/javascripts/bootstrap-popover.js +2 -2
  10. data/vendor/assets/javascripts/bootstrap-scrollspy.js +2 -2
  11. data/vendor/assets/javascripts/bootstrap-tab.js +2 -2
  12. data/vendor/assets/javascripts/bootstrap-tooltip.js +3 -3
  13. data/vendor/assets/javascripts/bootstrap-transition.js +3 -3
  14. data/vendor/assets/javascripts/bootstrap-typeahead.js +8 -8
  15. data/vendor/assets/javascripts/bootstrap.js +1726 -0
  16. data/vendor/assets/javascripts/bootstrap.min.js +6 -0
  17. data/vendor/assets/stylesheets/bootstrap-responsive.css +337 -218
  18. data/vendor/assets/stylesheets/bootstrap.css +1022 -397
  19. data/vendor/assets/stylesheets/docs.css +85 -30
  20. metadata +13 -61
  21. data/vendor/assets/javascripts/tests/index.html +0 -49
  22. data/vendor/assets/javascripts/tests/unit/bootstrap-alert.js +0 -41
  23. data/vendor/assets/javascripts/tests/unit/bootstrap-button.js +0 -54
  24. data/vendor/assets/javascripts/tests/unit/bootstrap-collapse.js +0 -25
  25. data/vendor/assets/javascripts/tests/unit/bootstrap-dropdown.js +0 -53
  26. data/vendor/assets/javascripts/tests/unit/bootstrap-modal.js +0 -85
  27. data/vendor/assets/javascripts/tests/unit/bootstrap-popover.js +0 -93
  28. data/vendor/assets/javascripts/tests/unit/bootstrap-scrollspy.js +0 -31
  29. data/vendor/assets/javascripts/tests/unit/bootstrap-tab.js +0 -45
  30. data/vendor/assets/javascripts/tests/unit/bootstrap-tooltip.js +0 -62
  31. data/vendor/assets/javascripts/tests/unit/bootstrap-transition.js +0 -13
  32. data/vendor/assets/javascripts/tests/unit/bootstrap-typeahead.js +0 -128
  33. data/vendor/assets/javascripts/tests/vendor/jquery.js +0 -9252
  34. data/vendor/assets/javascripts/tests/vendor/qunit.css +0 -232
  35. data/vendor/assets/javascripts/tests/vendor/qunit.js +0 -1510
  36. data/vendor/assets/stylesheets/bootstrap/accordion.less +0 -28
  37. data/vendor/assets/stylesheets/bootstrap/alerts.less +0 -70
  38. data/vendor/assets/stylesheets/bootstrap/bootstrap.less +0 -62
  39. data/vendor/assets/stylesheets/bootstrap/breadcrumbs.less +0 -22
  40. data/vendor/assets/stylesheets/bootstrap/button-groups.less +0 -147
  41. data/vendor/assets/stylesheets/bootstrap/buttons.less +0 -165
  42. data/vendor/assets/stylesheets/bootstrap/carousel.less +0 -121
  43. data/vendor/assets/stylesheets/bootstrap/close.less +0 -18
  44. data/vendor/assets/stylesheets/bootstrap/code.less +0 -44
  45. data/vendor/assets/stylesheets/bootstrap/component-animations.less +0 -18
  46. data/vendor/assets/stylesheets/bootstrap/dropdowns.less +0 -131
  47. data/vendor/assets/stylesheets/bootstrap/forms.less +0 -515
  48. data/vendor/assets/stylesheets/bootstrap/grid.less +0 -8
  49. data/vendor/assets/stylesheets/bootstrap/hero-unit.less +0 -20
  50. data/vendor/assets/stylesheets/bootstrap/labels.less +0 -16
  51. data/vendor/assets/stylesheets/bootstrap/layouts.less +0 -17
  52. data/vendor/assets/stylesheets/bootstrap/mixins.less +0 -537
  53. data/vendor/assets/stylesheets/bootstrap/modals.less +0 -72
  54. data/vendor/assets/stylesheets/bootstrap/navbar.less +0 -292
  55. data/vendor/assets/stylesheets/bootstrap/navs.less +0 -344
  56. data/vendor/assets/stylesheets/bootstrap/pager.less +0 -30
  57. data/vendor/assets/stylesheets/bootstrap/pagination.less +0 -55
  58. data/vendor/assets/stylesheets/bootstrap/popovers.less +0 -49
  59. data/vendor/assets/stylesheets/bootstrap/progress-bars.less +0 -95
  60. data/vendor/assets/stylesheets/bootstrap/reset.less +0 -126
  61. data/vendor/assets/stylesheets/bootstrap/responsive.less +0 -323
  62. data/vendor/assets/stylesheets/bootstrap/scaffolding.less +0 -29
  63. data/vendor/assets/stylesheets/bootstrap/sprites.less +0 -156
  64. data/vendor/assets/stylesheets/bootstrap/tables.less +0 -139
  65. data/vendor/assets/stylesheets/bootstrap/thumbnails.less +0 -35
  66. data/vendor/assets/stylesheets/bootstrap/tooltip.less +0 -35
  67. data/vendor/assets/stylesheets/bootstrap/type.less +0 -217
  68. data/vendor/assets/stylesheets/bootstrap/utilities.less +0 -23
  69. data/vendor/assets/stylesheets/bootstrap/variables.less +0 -99
  70. data/vendor/assets/stylesheets/bootstrap/wells.less +0 -17
@@ -1,25 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-collapse")
4
-
5
- test("should be defined on jquery object", function () {
6
- ok($(document.body).collapse, 'collapse method is defined')
7
- })
8
-
9
- test("should return element", function () {
10
- ok($(document.body).collapse()[0] == document.body, 'document.body returned')
11
- })
12
-
13
- test("should show a collapsed element", function () {
14
- var el = $('<div class="collapse"></div>').collapse('show')
15
- ok(el.hasClass('in'), 'has class in')
16
- ok(/height/.test(el.attr('style')), 'has height set')
17
- })
18
-
19
- test("should hide a collapsed element", function () {
20
- var el = $('<div class="collapse"></div>').collapse('hide')
21
- ok(!el.hasClass('in'), 'does not have class in')
22
- ok(/height/.test(el.attr('style')), 'has height set')
23
- })
24
-
25
- })
@@ -1,53 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-dropdowns")
4
-
5
- test("should be defined on jquery object", function () {
6
- ok($(document.body).dropdown, 'dropdown method is defined')
7
- })
8
-
9
- test("should return element", function () {
10
- ok($(document.body).dropdown()[0] == document.body, 'document.body returned')
11
- })
12
-
13
- test("should add class open to menu if clicked", function () {
14
- var dropdownHTML = '<ul class="tabs">'
15
- + '<li class="dropdown">'
16
- + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
17
- + '<ul class="dropdown-menu">'
18
- + '<li><a href="#">Secondary link</a></li>'
19
- + '<li><a href="#">Something else here</a></li>'
20
- + '<li class="divider"></li>'
21
- + '<li><a href="#">Another link</a></li>'
22
- + '</ul>'
23
- + '</li>'
24
- + '</ul>'
25
- , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
26
-
27
- ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
28
- })
29
-
30
- test("should remove open class if body clicked", function () {
31
- var dropdownHTML = '<ul class="tabs">'
32
- + '<li class="dropdown">'
33
- + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
34
- + '<ul class="dropdown-menu">'
35
- + '<li><a href="#">Secondary link</a></li>'
36
- + '<li><a href="#">Something else here</a></li>'
37
- + '<li class="divider"></li>'
38
- + '<li><a href="#">Another link</a></li>'
39
- + '</ul>'
40
- + '</li>'
41
- + '</ul>'
42
- , dropdown = $(dropdownHTML)
43
- .appendTo('#qunit-fixture')
44
- .find('[data-toggle="dropdown"]')
45
- .dropdown()
46
- .click()
47
- ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
48
- $('body').click()
49
- ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed')
50
- dropdown.remove()
51
- })
52
-
53
- })
@@ -1,85 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-modal")
4
-
5
- test("should be defined on jquery object", function () {
6
- var div = $("<div id='modal-test'></div>")
7
- ok(div.modal, 'modal method is defined')
8
- })
9
-
10
- test("should return element", function () {
11
- var div = $("<div id='modal-test'></div>")
12
- ok(div.modal() == div, 'document.body returned')
13
- $('#modal-test').remove()
14
- })
15
-
16
- test("should expose defaults var for settings", function () {
17
- ok($.fn.modal.defaults, 'default object exposed')
18
- })
19
-
20
- test("should insert into dom when show method is called", function () {
21
- stop()
22
- $.support.transition = false
23
- $("<div id='modal-test'></div>")
24
- .bind("shown", function () {
25
- ok($('#modal-test').length, 'modal insterted into dom')
26
- $(this).remove()
27
- start()
28
- })
29
- .modal("show")
30
- })
31
-
32
- test("should hide modal when hide is called", function () {
33
- stop()
34
- $.support.transition = false
35
-
36
- $("<div id='modal-test'></div>")
37
- .bind("shown", function () {
38
- ok($('#modal-test').is(":visible"), 'modal visible')
39
- ok($('#modal-test').length, 'modal insterted into dom')
40
- $(this).modal("hide")
41
- })
42
- .bind("hidden", function() {
43
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
44
- $('#modal-test').remove()
45
- start()
46
- })
47
- .modal("show")
48
- })
49
-
50
- test("should toggle when toggle is called", function () {
51
- stop()
52
- $.support.transition = false
53
- var div = $("<div id='modal-test'></div>")
54
- div
55
- .bind("shown", function () {
56
- ok($('#modal-test').is(":visible"), 'modal visible')
57
- ok($('#modal-test').length, 'modal insterted into dom')
58
- div.modal("toggle")
59
- })
60
- .bind("hidden", function() {
61
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
62
- div.remove()
63
- start()
64
- })
65
- .modal("toggle")
66
- })
67
-
68
- test("should remove from dom when click [data-dismiss=modal]", function () {
69
- stop()
70
- $.support.transition = false
71
- var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>")
72
- div
73
- .bind("shown", function () {
74
- ok($('#modal-test').is(":visible"), 'modal visible')
75
- ok($('#modal-test').length, 'modal insterted into dom')
76
- div.find('.close').click()
77
- })
78
- .bind("hidden", function() {
79
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
80
- div.remove()
81
- start()
82
- })
83
- .modal("toggle")
84
- })
85
- })
@@ -1,93 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-popover")
4
-
5
- test("should be defined on jquery object", function () {
6
- var div = $('<div></div>')
7
- ok(div.popover, 'popover method is defined')
8
- })
9
-
10
- test("should return element", function () {
11
- var div = $('<div></div>')
12
- ok(div.popover() == div, 'document.body returned')
13
- })
14
-
15
- test("should render popover element", function () {
16
- $.support.transition = false
17
- var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
18
- .appendTo('#qunit-fixture')
19
- .popover('show')
20
-
21
- ok($('.popover').length, 'popover was inserted')
22
- popover.popover('hide')
23
- ok(!$(".popover").length, 'popover removed')
24
- })
25
-
26
- test("should store popover instance in popover data object", function () {
27
- $.support.transition = false
28
- var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
29
- .popover()
30
-
31
- ok(!!popover.data('popover'), 'popover instance exists')
32
- })
33
-
34
- test("should get title and content from options", function () {
35
- $.support.transition = false
36
- var popover = $('<a href="#">@fat</a>')
37
- .appendTo('#qunit-fixture')
38
- .popover({
39
- title: function () {
40
- return '@fat'
41
- }
42
- , content: function () {
43
- return 'loves writing tests (╯°□°)╯︵ ┻━┻'
44
- }
45
- })
46
-
47
- popover.popover('show')
48
-
49
- ok($('.popover').length, 'popover was inserted')
50
- equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
51
- equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
52
-
53
- popover.popover('hide')
54
- ok(!$('.popover').length, 'popover was removed')
55
- $('#qunit-fixture').empty()
56
- })
57
-
58
- test("should get title and content from attributes", function () {
59
- $.support.transition = false
60
- var popover = $('<a href="#" title="@mdo" data-content="loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻" >@mdo</a>')
61
- .appendTo('#qunit-fixture')
62
- .popover()
63
- .popover('show')
64
-
65
- ok($('.popover').length, 'popover was inserted')
66
- equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
67
- equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
68
-
69
- popover.popover('hide')
70
- ok(!$('.popover').length, 'popover was removed')
71
- $('#qunit-fixture').empty()
72
- })
73
-
74
- test("should respect custom classes", function() {
75
- $.support.transition = false
76
- var popover = $('<a href="#">@fat</a>')
77
- .appendTo('#qunit-fixture')
78
- .popover({
79
- title: 'Test'
80
- , content: 'Test'
81
- , template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
82
- })
83
-
84
- popover.popover('show')
85
-
86
- ok($('.popover').length, 'popover was inserted')
87
- ok($('.popover').hasClass('foobar'), 'custom class is present')
88
-
89
- popover.popover('hide')
90
- ok(!$('.popover').length, 'popover was removed')
91
- $('#qunit-fixture').empty()
92
- })
93
- })
@@ -1,31 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-scrollspy")
4
-
5
- test("should be defined on jquery object", function () {
6
- ok($(document.body).scrollspy, 'scrollspy method is defined')
7
- })
8
-
9
- test("should return element", function () {
10
- ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
11
- })
12
-
13
- test("should switch active class on scroll", function () {
14
- var sectionHTML = '<div id="masthead"></div>'
15
- , $section = $(sectionHTML).append('#qunit-fixture')
16
- , topbarHTML ='<div class="topbar">'
17
- + '<div class="topbar-inner">'
18
- + '<div class="container">'
19
- + '<h3><a href="#">Bootstrap</a></h3>'
20
- + '<ul class="nav">'
21
- + '<li><a href="#masthead">Overview</a></li>'
22
- + '</ul>'
23
- + '</div>'
24
- + '</div>'
25
- + '</div>'
26
- , $topbar = $(topbarHTML).scrollspy()
27
-
28
- ok($topbar.find('.active', true))
29
- })
30
-
31
- })
@@ -1,45 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-tabs")
4
-
5
- test("should be defined on jquery object", function () {
6
- ok($(document.body).tab, 'tabs method is defined')
7
- })
8
-
9
- test("should return element", function () {
10
- ok($(document.body).tab()[0] == document.body, 'document.body returned')
11
- })
12
-
13
- test("should activate element by tab id", function () {
14
- var tabsHTML =
15
- '<ul class="tabs">'
16
- + '<li><a href="#home">Home</a></li>'
17
- + '<li><a href="#profile">Profile</a></li>'
18
- + '</ul>'
19
-
20
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
21
-
22
- $(tabsHTML).find('li:last a').tab('show')
23
- equals($("#qunit-fixture").find('.active').attr('id'), "profile")
24
-
25
- $(tabsHTML).find('li:first a').tab('show')
26
- equals($("#qunit-fixture").find('.active').attr('id'), "home")
27
- })
28
-
29
- test("should activate element by tab id", function () {
30
- var pillsHTML =
31
- '<ul class="pills">'
32
- + '<li><a href="#home">Home</a></li>'
33
- + '<li><a href="#profile">Profile</a></li>'
34
- + '</ul>'
35
-
36
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
37
-
38
- $(pillsHTML).find('li:last a').tab('show')
39
- equals($("#qunit-fixture").find('.active').attr('id'), "profile")
40
-
41
- $(pillsHTML).find('li:first a').tab('show')
42
- equals($("#qunit-fixture").find('.active').attr('id'), "home")
43
- })
44
-
45
- })
@@ -1,62 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-tooltip")
4
-
5
- test("should be defined on jquery object", function () {
6
- var div = $("<div></div>")
7
- ok(div.tooltip, 'popover method is defined')
8
- })
9
-
10
- test("should return element", function () {
11
- var div = $("<div></div>")
12
- ok(div.tooltip() == div, 'document.body returned')
13
- })
14
-
15
- test("should expose default settings", function () {
16
- ok(!!$.fn.tooltip.defaults, 'defaults is defined')
17
- })
18
-
19
- test("should remove title attribute", function () {
20
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
21
- ok(!tooltip.attr('title'), 'title tag was removed')
22
- })
23
-
24
- test("should add data attribute for referencing original title", function () {
25
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
26
- equals(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute')
27
- })
28
-
29
- test("should place tooltips relative to placement option", function () {
30
- $.support.transition = false
31
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
32
- .appendTo('#qunit-fixture')
33
- .tooltip({placement: 'bottom'})
34
- .tooltip('show')
35
-
36
- ok($(".tooltip").hasClass('fade bottom in'), 'has correct classes applied')
37
- tooltip.tooltip('hide')
38
- })
39
-
40
- test("should always allow html entities", function () {
41
- $.support.transition = false
42
- var tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"></a>')
43
- .appendTo('#qunit-fixture')
44
- .tooltip('show')
45
-
46
- ok($('.tooltip b').length, 'b tag was inserted')
47
- tooltip.tooltip('hide')
48
- ok(!$(".tooltip").length, 'tooltip removed')
49
- })
50
-
51
- test("should respect custom classes", function () {
52
- var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
53
- .appendTo('#qunit-fixture')
54
- .tooltip({ template: '<div class="tooltip some-class"><div class="tooltip-arrow"/><div class="tooltip-inner"/></div>'})
55
- .tooltip('show')
56
-
57
- ok($('.tooltip').hasClass('some-class'), 'custom class is present')
58
- tooltip.tooltip('hide')
59
- ok(!$(".tooltip").length, 'tooltip removed')
60
- })
61
-
62
- })
@@ -1,13 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-transition")
4
-
5
- test("should be defined on jquery support object", function () {
6
- ok($.support.transition != undefined, 'transition object is defined')
7
- })
8
-
9
- test("should provide an end object", function () {
10
- ok($.support.transition ? $.support.transition.end : true, 'end string is defined')
11
- })
12
-
13
- })
@@ -1,128 +0,0 @@
1
- $(function () {
2
-
3
- module("bootstrap-typeahead")
4
-
5
- test("should be defined on jquery object", function () {
6
- ok($(document.body).typeahead, 'alert method is defined')
7
- })
8
-
9
- test("should return element", function () {
10
- ok($(document.body).typeahead()[0] == document.body, 'document.body returned')
11
- })
12
-
13
- test("should listen to an input", function () {
14
- var $input = $('<input />')
15
- $input.typeahead()
16
- ok($input.data('events').blur, 'has a blur event')
17
- ok($input.data('events').keypress, 'has a keypress event')
18
- ok($input.data('events').keyup, 'has a keyup event')
19
- if ($.browser.webkit || $.browser.msie) {
20
- ok($input.data('events').keydown, 'has a keydown event')
21
- } else {
22
- ok($input.data('events').keydown, 'does not have a keydown event')
23
- }
24
- })
25
-
26
- test("should create a menu", function () {
27
- var $input = $('<input />')
28
- ok($input.typeahead().data('typeahead').$menu, 'has a menu')
29
- })
30
-
31
- test("should listen to the menu", function () {
32
- var $input = $('<input />')
33
- , $menu = $input.typeahead().data('typeahead').$menu
34
-
35
- ok($menu.data('events').mouseover, 'has a mouseover(pseudo: mouseenter)')
36
- ok($menu.data('events').click, 'has a click')
37
- })
38
-
39
- test("should show menu when query entered", function () {
40
- var $input = $('<input />').typeahead({
41
- source: ['aa', 'ab', 'ac']
42
- })
43
- , typeahead = $input.data('typeahead')
44
-
45
- $input.val('a')
46
- typeahead.lookup()
47
-
48
- ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
49
- equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
50
- equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
51
-
52
- typeahead.$menu.remove()
53
- })
54
-
55
- test("should hide menu when query entered", function () {
56
- stop()
57
- var $input = $('<input />').typeahead({
58
- source: ['aa', 'ab', 'ac']
59
- })
60
- , typeahead = $input.data('typeahead')
61
-
62
- $input.val('a')
63
- typeahead.lookup()
64
-
65
- ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
66
- equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
67
- equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
68
-
69
- $input.blur()
70
-
71
- setTimeout(function () {
72
- ok(!typeahead.$menu.is(":visible"), "typeahead is no longer visible")
73
- start()
74
- }, 200)
75
-
76
- typeahead.$menu.remove()
77
- })
78
-
79
- test("should set next item when down arrow is pressed", function () {
80
- var $input = $('<input />').typeahead({
81
- source: ['aa', 'ab', 'ac']
82
- })
83
- , typeahead = $input.data('typeahead')
84
-
85
- $input.val('a')
86
- typeahead.lookup()
87
-
88
- ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
89
- equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
90
- equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
91
- ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
92
-
93
- $input.trigger({
94
- type: 'keypress'
95
- , keyCode: 40
96
- })
97
-
98
- ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
99
-
100
-
101
- $input.trigger({
102
- type: 'keypress'
103
- , keyCode: 38
104
- })
105
-
106
- ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
107
-
108
- typeahead.$menu.remove()
109
- })
110
-
111
-
112
- test("should set input value to selected item", function () {
113
- var $input = $('<input />').typeahead({
114
- source: ['aa', 'ab', 'ac']
115
- })
116
- , typeahead = $input.data('typeahead')
117
-
118
- $input.val('a')
119
- typeahead.lookup()
120
-
121
- $(typeahead.$menu.find('li')[2]).mouseover().click()
122
-
123
- equals($input.val(), 'ac', 'input value was correctly set')
124
- ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
125
-
126
- typeahead.$menu.remove()
127
- })
128
- })