cmstyle 0.0.13 → 0.0.14
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.
- data/lib/app/assets/images/cm_app.ico +0 -0
- data/lib/app/assets/images/cm_app.png +0 -0
- data/lib/app/assets/images/cm_app_30x30.png +0 -0
- data/lib/app/assets/stylesheets/application.css +9 -78
- data/lib/app/views/layouts/_footer.slim +12 -5
- data/lib/app/views/layouts/application.slim +27 -18
- data/lib/assets/images/glyphicons-halflings-white.png +0 -0
- data/lib/assets/images/glyphicons-halflings.png +0 -0
- data/lib/assets/javascripts/bootstrap.js +165 -31
- data/lib/assets/javascripts/prettify.js +0 -0
- data/lib/assets/stylesheets/bootstrap-responsive.css +5 -1
- data/lib/assets/stylesheets/bootstrap.css +335 -189
- data/lib/assets/stylesheets/prettify.css +0 -0
- data/lib/cmstyle.rb +4 -1
- data/lib/cmstyle/navigation_helpers.rb +165 -0
- data/lib/cmstyle/version.rb +1 -1
- metadata +6 -83
- data/lib/app/assets/images/novartis-micro.png +0 -0
- data/lib/app/assets/images/novartis-small.png +0 -0
- data/lib/app/views/cmstyle/_footer.slim +0 -5
- data/lib/app/views/cmstyle/_header.slim +0 -40
- data/lib/app/views/cmstyle/_modals.slim +0 -62
- data/lib/assets/images/8020select.png +0 -0
- data/lib/assets/images/adoptahydrant.png +0 -0
- data/lib/assets/images/apple-touch-icon-114-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-144-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-57-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-72-precomposed.png +0 -0
- data/lib/assets/images/bootstrap-example-carousel.png +0 -0
- data/lib/assets/images/bootstrap-example-fluid.jpg +0 -0
- data/lib/assets/images/bootstrap-example-hero.jpg +0 -0
- data/lib/assets/images/bootstrap-example-marketing-narrow.png +0 -0
- data/lib/assets/images/bootstrap-example-signin.png +0 -0
- data/lib/assets/images/bootstrap-example-starter.jpg +0 -0
- data/lib/assets/images/bootstrap-example-sticky-footer.png +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/lib/assets/images/breakingnews.png +0 -0
- data/lib/assets/images/browser-icon-chrome.png +0 -0
- data/lib/assets/images/browser-icon-firefox.png +0 -0
- data/lib/assets/images/browser-icon-safari.png +0 -0
- data/lib/assets/images/bs-docs-bootstrap-features.png +0 -0
- data/lib/assets/images/bs-docs-masthead-pattern.png +0 -0
- data/lib/assets/images/bs-docs-responsive-illustrations.png +0 -0
- data/lib/assets/images/bs-docs-twitter-github.png +0 -0
- data/lib/assets/images/fleetio.png +0 -0
- data/lib/assets/images/gathercontent.png +0 -0
- data/lib/assets/images/grid-baseline-20px.png +0 -0
- data/lib/assets/images/jshint.png +0 -0
- data/lib/assets/images/kippt.png +0 -0
- data/lib/assets/images/less-logo-large.png +0 -0
- data/lib/assets/images/logo.png +0 -0
- data/lib/assets/images/noise.png +0 -0
- data/lib/assets/images/responsive-illustrations.png +0 -0
- data/lib/assets/images/slide-01.jpg +0 -0
- data/lib/assets/images/slide-02.jpg +0 -0
- data/lib/assets/images/slide-03.jpg +0 -0
- data/lib/assets/images/small-hogan-icon.png +0 -0
- data/lib/assets/images/soundready.png +0 -0
- data/lib/assets/images/stripes.png +0 -0
- data/lib/assets/javascripts/application.js +0 -154
- data/lib/assets/javascripts/bootstrap-affix.js +0 -19
- data/lib/assets/javascripts/bootstrap-alert.js +0 -56
- data/lib/assets/javascripts/bootstrap-button.js +0 -96
- data/lib/assets/javascripts/bootstrap-carousel.js +0 -63
- data/lib/assets/javascripts/bootstrap-collapse.js +0 -88
- data/lib/assets/javascripts/bootstrap-dropdown.js +0 -145
- data/lib/assets/javascripts/bootstrap-modal.js +0 -114
- data/lib/assets/javascripts/bootstrap-phantom.js +0 -21
- data/lib/assets/javascripts/bootstrap-popover.js +0 -107
- data/lib/assets/javascripts/bootstrap-scrollspy.js +0 -31
- data/lib/assets/javascripts/bootstrap-tab.js +0 -80
- data/lib/assets/javascripts/bootstrap-tooltip.js +0 -153
- data/lib/assets/javascripts/bootstrap-transition.js +0 -13
- data/lib/assets/javascripts/bootstrap-typeahead.js +0 -199
- data/lib/assets/javascripts/compiler.js +0 -348
- data/lib/assets/javascripts/hogan-1.0.5.amd.js +0 -576
- data/lib/assets/javascripts/hogan-1.0.5.common.js +0 -576
- data/lib/assets/javascripts/hogan-1.0.5.js +0 -572
- data/lib/assets/javascripts/hogan-1.0.5.mustache.js +0 -619
- data/lib/assets/javascripts/hogan.js +0 -545
- data/lib/assets/javascripts/index.js +0 -848
- data/lib/assets/javascripts/jquery.js +0 -2
- data/lib/assets/javascripts/mustache.js +0 -90
- data/lib/assets/javascripts/phantom.js +0 -63
- data/lib/assets/javascripts/qunit.js +0 -1510
- data/lib/assets/javascripts/release.js +0 -74
- data/lib/assets/javascripts/server.js +0 -14
- data/lib/assets/javascripts/spec.js +0 -77
- data/lib/assets/javascripts/template-1.0.5.js +0 -233
- data/lib/assets/javascripts/template.js +0 -233
- data/lib/assets/javascripts/web_templates.js +0 -32
- data/lib/assets/stylesheets/css-tests.css +0 -139
- data/lib/assets/stylesheets/docs.css +0 -1015
- data/lib/assets/stylesheets/layout.css +0 -206
- data/lib/assets/stylesheets/qunit.css +0 -232
- data/lib/assets/stylesheets/skeleton.css +0 -236
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/assets/images/kippt.png
DELETED
|
Binary file
|
|
Binary file
|
data/lib/assets/images/logo.png
DELETED
|
Binary file
|
data/lib/assets/images/noise.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
|
2
|
-
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
|
3
|
-
// ++++++++++++++++++++++++++++++++++++++++++
|
|
4
|
-
|
|
5
|
-
!function ($) {
|
|
6
|
-
|
|
7
|
-
$(function(){
|
|
8
|
-
|
|
9
|
-
var $window = $(window)
|
|
10
|
-
|
|
11
|
-
// Disable certain links in docs
|
|
12
|
-
$('section [href^=#]').click(function (e) {
|
|
13
|
-
e.preventDefault()
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
// side bar
|
|
17
|
-
$('.bs-docs-sidenav').affix({
|
|
18
|
-
offset: {
|
|
19
|
-
top: function () { return $window.width() <= 980 ? 290 : 210 }
|
|
20
|
-
, bottom: 270
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
// make code pretty
|
|
25
|
-
window.prettyPrint && prettyPrint()
|
|
26
|
-
|
|
27
|
-
// add-ons
|
|
28
|
-
$('.add-on :checkbox').on('click', function () {
|
|
29
|
-
var $this = $(this)
|
|
30
|
-
, method = $this.attr('checked') ? 'addClass' : 'removeClass'
|
|
31
|
-
$(this).parents('.add-on')[method]('active')
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
// add tipsies to grid for scaffolding
|
|
35
|
-
if ($('#gridSystem').length) {
|
|
36
|
-
$('#gridSystem').tooltip({
|
|
37
|
-
selector: '.show-grid > div'
|
|
38
|
-
, title: function () { return $(this).width() + 'px' }
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// tooltip demo
|
|
43
|
-
$('.tooltip-demo').tooltip({
|
|
44
|
-
selector: "a[rel=tooltip]"
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
$('.tooltip-test').tooltip()
|
|
48
|
-
$('.popover-test').popover()
|
|
49
|
-
|
|
50
|
-
// popover demo
|
|
51
|
-
$("a[rel=popover]")
|
|
52
|
-
.popover()
|
|
53
|
-
.click(function(e) {
|
|
54
|
-
e.preventDefault()
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
// button state demo
|
|
58
|
-
$('#fat-btn')
|
|
59
|
-
.click(function () {
|
|
60
|
-
var btn = $(this)
|
|
61
|
-
btn.button('loading')
|
|
62
|
-
setTimeout(function () {
|
|
63
|
-
btn.button('reset')
|
|
64
|
-
}, 3000)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
// carousel demo
|
|
68
|
-
$('#myCarousel').carousel()
|
|
69
|
-
|
|
70
|
-
// javascript build logic
|
|
71
|
-
var inputsComponent = $("#components.download input")
|
|
72
|
-
, inputsPlugin = $("#plugins.download input")
|
|
73
|
-
, inputsVariables = $("#variables.download input")
|
|
74
|
-
|
|
75
|
-
// toggle all plugin checkboxes
|
|
76
|
-
$('#components.download .toggle-all').on('click', function (e) {
|
|
77
|
-
e.preventDefault()
|
|
78
|
-
inputsComponent.attr('checked', !inputsComponent.is(':checked'))
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
$('#plugins.download .toggle-all').on('click', function (e) {
|
|
82
|
-
e.preventDefault()
|
|
83
|
-
inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
$('#variables.download .toggle-all').on('click', function (e) {
|
|
87
|
-
e.preventDefault()
|
|
88
|
-
inputsVariables.val('')
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
// request built javascript
|
|
92
|
-
$('.download-btn').on('click', function () {
|
|
93
|
-
|
|
94
|
-
var css = $("#components.download input:checked")
|
|
95
|
-
.map(function () { return this.value })
|
|
96
|
-
.toArray()
|
|
97
|
-
, js = $("#plugins.download input:checked")
|
|
98
|
-
.map(function () { return this.value })
|
|
99
|
-
.toArray()
|
|
100
|
-
, vars = {}
|
|
101
|
-
, img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
|
|
102
|
-
|
|
103
|
-
$("#variables.download input")
|
|
104
|
-
.each(function () {
|
|
105
|
-
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
$.ajax({
|
|
109
|
-
type: 'POST'
|
|
110
|
-
, url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com'
|
|
111
|
-
, dataType: 'jsonpi'
|
|
112
|
-
, params: {
|
|
113
|
-
js: js
|
|
114
|
-
, css: css
|
|
115
|
-
, vars: vars
|
|
116
|
-
, img: img
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
|
|
123
|
-
$.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
|
|
124
|
-
var url = opts.url;
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
send: function(_, completeCallback) {
|
|
128
|
-
var name = 'jQuery_iframe_' + jQuery.now()
|
|
129
|
-
, iframe, form
|
|
130
|
-
|
|
131
|
-
iframe = $('<iframe>')
|
|
132
|
-
.attr('name', name)
|
|
133
|
-
.appendTo('head')
|
|
134
|
-
|
|
135
|
-
form = $('<form>')
|
|
136
|
-
.attr('method', opts.type) // GET or POST
|
|
137
|
-
.attr('action', url)
|
|
138
|
-
.attr('target', name)
|
|
139
|
-
|
|
140
|
-
$.each(opts.params, function(k, v) {
|
|
141
|
-
|
|
142
|
-
$('<input>')
|
|
143
|
-
.attr('type', 'hidden')
|
|
144
|
-
.attr('name', k)
|
|
145
|
-
.attr('value', typeof v == 'string' ? v : JSON.stringify(v))
|
|
146
|
-
.appendTo(form)
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
form.appendTo('body').submit()
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
}(window.jQuery)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
$(function () {
|
|
2
|
-
|
|
3
|
-
module("bootstrap-affix")
|
|
4
|
-
|
|
5
|
-
test("should be defined on jquery object", function () {
|
|
6
|
-
ok($(document.body).affix, 'affix method is defined')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("should return element", function () {
|
|
10
|
-
ok($(document.body).affix()[0] == document.body, 'document.body returned')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
test("should exit early if element is not visible", function () {
|
|
14
|
-
var $affix = $('<div style="display: none"></div>').affix()
|
|
15
|
-
$affix.data('affix').checkPosition()
|
|
16
|
-
ok(!$affix.hasClass('affix'), 'affix class was not added')
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
})
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
$(function () {
|
|
2
|
-
|
|
3
|
-
module("bootstrap-alerts")
|
|
4
|
-
|
|
5
|
-
test("should be defined on jquery object", function () {
|
|
6
|
-
ok($(document.body).alert, 'alert method is defined')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("should return element", function () {
|
|
10
|
-
ok($(document.body).alert()[0] == document.body, 'document.body returned')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
test("should fade element out on clicking .close", function () {
|
|
14
|
-
var alertHTML = '<div class="alert-message warning fade in">'
|
|
15
|
-
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
|
16
|
-
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
|
|
17
|
-
+ '</div>'
|
|
18
|
-
, alert = $(alertHTML).alert()
|
|
19
|
-
|
|
20
|
-
alert.find('.close').click()
|
|
21
|
-
|
|
22
|
-
ok(!alert.hasClass('in'), 'remove .in class on .close click')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
test("should remove element when clicking .close", function () {
|
|
26
|
-
$.support.transition = false
|
|
27
|
-
|
|
28
|
-
var alertHTML = '<div class="alert-message warning fade in">'
|
|
29
|
-
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
|
30
|
-
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
|
|
31
|
-
+ '</div>'
|
|
32
|
-
, alert = $(alertHTML).appendTo('#qunit-fixture').alert()
|
|
33
|
-
|
|
34
|
-
ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
|
|
35
|
-
|
|
36
|
-
alert.find('.close').click()
|
|
37
|
-
|
|
38
|
-
ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
test("should not fire closed when close is prevented", function () {
|
|
42
|
-
$.support.transition = false
|
|
43
|
-
stop();
|
|
44
|
-
$('<div class="alert"/>')
|
|
45
|
-
.bind('close', function (e) {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
ok(true);
|
|
48
|
-
start();
|
|
49
|
-
})
|
|
50
|
-
.bind('closed', function () {
|
|
51
|
-
ok(false);
|
|
52
|
-
})
|
|
53
|
-
.alert('close')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
})
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
$(function () {
|
|
2
|
-
|
|
3
|
-
module("bootstrap-buttons")
|
|
4
|
-
|
|
5
|
-
test("should be defined on jquery object", function () {
|
|
6
|
-
ok($(document.body).button, 'button method is defined')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("should return element", function () {
|
|
10
|
-
ok($(document.body).button()[0] == document.body, 'document.body returned')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
test("should return set state to loading", function () {
|
|
14
|
-
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
|
15
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
|
16
|
-
btn.button('loading')
|
|
17
|
-
equals(btn.html(), 'fat', 'btn text equals fat')
|
|
18
|
-
stop()
|
|
19
|
-
setTimeout(function () {
|
|
20
|
-
ok(btn.attr('disabled'), 'btn is disabled')
|
|
21
|
-
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
|
22
|
-
start()
|
|
23
|
-
}, 0)
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
test("should return reset state", function () {
|
|
27
|
-
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
|
28
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
|
29
|
-
btn.button('loading')
|
|
30
|
-
equals(btn.html(), 'fat', 'btn text equals fat')
|
|
31
|
-
stop()
|
|
32
|
-
setTimeout(function () {
|
|
33
|
-
ok(btn.attr('disabled'), 'btn is disabled')
|
|
34
|
-
ok(btn.hasClass('disabled'), 'btn has disabled class')
|
|
35
|
-
start()
|
|
36
|
-
stop()
|
|
37
|
-
}, 0)
|
|
38
|
-
btn.button('reset')
|
|
39
|
-
equals(btn.html(), 'mdo', 'btn text equals mdo')
|
|
40
|
-
setTimeout(function () {
|
|
41
|
-
ok(!btn.attr('disabled'), 'btn is not disabled')
|
|
42
|
-
ok(!btn.hasClass('disabled'), 'btn does not have disabled class')
|
|
43
|
-
start()
|
|
44
|
-
}, 0)
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
test("should toggle active", function () {
|
|
48
|
-
var btn = $('<button class="btn">mdo</button>')
|
|
49
|
-
ok(!btn.hasClass('active'), 'btn does not have active class')
|
|
50
|
-
btn.button('toggle')
|
|
51
|
-
ok(btn.hasClass('active'), 'btn has class active')
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
test("should toggle active when btn children are clicked", function () {
|
|
55
|
-
var btn = $('<button class="btn" data-toggle="button">mdo</button>')
|
|
56
|
-
, inner = $('<i></i>')
|
|
57
|
-
btn
|
|
58
|
-
.append(inner)
|
|
59
|
-
.appendTo($('#qunit-fixture'))
|
|
60
|
-
ok(!btn.hasClass('active'), 'btn does not have active class')
|
|
61
|
-
inner.click()
|
|
62
|
-
ok(btn.hasClass('active'), 'btn has class active')
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
test("should toggle active when btn children are clicked within btn-group", function () {
|
|
66
|
-
var btngroup = $('<div class="btn-group" data-toggle="buttons-checkbox"></div>')
|
|
67
|
-
, btn = $('<button class="btn">fat</button>')
|
|
68
|
-
, inner = $('<i></i>')
|
|
69
|
-
btngroup
|
|
70
|
-
.append(btn.append(inner))
|
|
71
|
-
.appendTo($('#qunit-fixture'))
|
|
72
|
-
ok(!btn.hasClass('active'), 'btn does not have active class')
|
|
73
|
-
inner.click()
|
|
74
|
-
ok(btn.hasClass('active'), 'btn has class active')
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
test("should check for closest matching toggle", function () {
|
|
78
|
-
var group = $("<div data-toggle='buttons-radio'></div>")
|
|
79
|
-
, btn1 = $("<button class='btn active'></button>")
|
|
80
|
-
, btn2 = $("<button class='btn'></button>")
|
|
81
|
-
, wrap = $("<div></div>")
|
|
82
|
-
|
|
83
|
-
wrap.append(btn1, btn2)
|
|
84
|
-
|
|
85
|
-
group
|
|
86
|
-
.append(wrap)
|
|
87
|
-
.appendTo($('#qunit-fixture'))
|
|
88
|
-
|
|
89
|
-
ok(btn1.hasClass('active'), 'btn1 has active class')
|
|
90
|
-
ok(!btn2.hasClass('active'), 'btn2 does not have active class')
|
|
91
|
-
btn2.click()
|
|
92
|
-
ok(!btn1.hasClass('active'), 'btn1 does not have active class')
|
|
93
|
-
ok(btn2.hasClass('active'), 'btn2 has active class')
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
})
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
$(function () {
|
|
2
|
-
|
|
3
|
-
module("bootstrap-carousel")
|
|
4
|
-
|
|
5
|
-
test("should be defined on jquery object", function () {
|
|
6
|
-
ok($(document.body).carousel, 'carousel method is defined')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test("should return element", function () {
|
|
10
|
-
ok($(document.body).carousel()[0] == document.body, 'document.body returned')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
test("should not fire sliden when slide is prevented", function () {
|
|
14
|
-
$.support.transition = false
|
|
15
|
-
stop()
|
|
16
|
-
$('<div class="carousel"/>')
|
|
17
|
-
.bind('slide', function (e) {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
ok(true);
|
|
20
|
-
start();
|
|
21
|
-
})
|
|
22
|
-
.bind('slid', function () {
|
|
23
|
-
ok(false);
|
|
24
|
-
})
|
|
25
|
-
.carousel('next')
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
test("should fire slide event with relatedTarget", function () {
|
|
29
|
-
var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a><a class="right carousel-control" href="#myCarousel" data-slide="next">›</a></div>'
|
|
30
|
-
$.support.transition = false
|
|
31
|
-
stop()
|
|
32
|
-
$(template)
|
|
33
|
-
.on('slide', function (e) {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
ok(e.relatedTarget);
|
|
36
|
-
ok($(e.relatedTarget).hasClass('item'));
|
|
37
|
-
start();
|
|
38
|
-
})
|
|
39
|
-
.carousel('next')
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
test("should set interval from data attribute", 3,function () {
|
|
43
|
-
var template = $('<div id="myCarousel" class="carousel slide"> <div class="carousel-inner"> <div class="item active"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}First Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Second Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Third Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a> </div>');
|
|
44
|
-
template.attr("data-interval", 1814);
|
|
45
|
-
|
|
46
|
-
template.appendTo("body");
|
|
47
|
-
$('[data-slide]').first().click();
|
|
48
|
-
ok($('#myCarousel').data('carousel').options.interval == 1814);
|
|
49
|
-
$('#myCarousel').remove();
|
|
50
|
-
|
|
51
|
-
template.appendTo("body").attr("data-modal", "foobar");
|
|
52
|
-
$('[data-slide]').first().click();
|
|
53
|
-
ok($('#myCarousel').data('carousel').options.interval == 1814, "even if there is an data-modal attribute set");
|
|
54
|
-
$('#myCarousel').remove();
|
|
55
|
-
|
|
56
|
-
template.appendTo("body");
|
|
57
|
-
$('[data-slide]').first().click();
|
|
58
|
-
$('#myCarousel').attr('data-interval', 1860);
|
|
59
|
-
$('[data-slide]').first().click();
|
|
60
|
-
ok($('#myCarousel').data('carousel').options.interval == 1814, "attributes should be read only on intitialization");
|
|
61
|
-
$('#myCarousel').remove();
|
|
62
|
-
})
|
|
63
|
-
})
|