spiderfw 0.6.22 → 0.6.23
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/VERSION +1 -1
- data/apps/app_server/controllers/app_server_controller.rb +7 -2
- data/apps/app_server/lib/git_app.rb +5 -3
- data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +2 -1
- data/apps/core/admin/controllers/admin_controller.rb +4 -4
- data/apps/core/admin/controllers/app_admin_controller.rb +3 -2
- data/apps/core/admin/public/css/sass/admin.css +56 -31
- data/apps/core/admin/public/sass/admin.scss +38 -4
- data/apps/core/admin/views/_breadcrumb.shtml +8 -0
- data/apps/core/admin/views/admin.layout.shtml +8 -5
- data/apps/core/auth/controllers/login_controller.rb +3 -8
- data/apps/core/components/assets.rb +37 -1
- data/apps/core/components/public/bootstrap/LICENSE +13 -0
- data/apps/core/components/public/bootstrap/README.md +28 -0
- data/apps/core/components/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/apps/core/components/public/bootstrap/img/glyphicons-halflings.png +0 -0
- data/apps/core/components/public/bootstrap/js/README.md +106 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-alert.js +91 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-button.js +98 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-carousel.js +154 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-collapse.js +136 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-dropdown.js +92 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-modal.js +209 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-popover.js +95 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-scrollspy.js +125 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-tab.js +130 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-tooltip.js +270 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-transition.js +51 -0
- data/apps/core/components/public/bootstrap/js/bootstrap-typeahead.js +271 -0
- data/apps/core/components/public/bootstrap/js/tests/index.html +49 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js +41 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-button.js +54 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-collapse.js +25 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-dropdown.js +53 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-modal.js +85 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-popover.js +93 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-scrollspy.js +31 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-tab.js +45 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-tooltip.js +62 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-transition.js +13 -0
- data/apps/core/components/public/bootstrap/js/tests/unit/bootstrap-typeahead.js +128 -0
- data/apps/core/components/public/bootstrap/js/tests/vendor/jquery.js +9252 -0
- data/apps/core/components/public/bootstrap/js/tests/vendor/qunit.css +232 -0
- data/apps/core/components/public/bootstrap/js/tests/vendor/qunit.js +1510 -0
- data/apps/core/components/public/bootstrap/scss/_accordion.scss +28 -0
- data/apps/core/components/public/bootstrap/scss/_alerts.scss +70 -0
- data/apps/core/components/public/bootstrap/scss/_breadcrumbs.scss +22 -0
- data/apps/core/components/public/bootstrap/scss/_button-groups.scss +146 -0
- data/apps/core/components/public/bootstrap/scss/_buttons.scss +165 -0
- data/apps/core/components/public/bootstrap/scss/_carousel.scss +121 -0
- data/apps/core/components/public/bootstrap/scss/_close.scss +18 -0
- data/apps/core/components/public/bootstrap/scss/_code.scss +44 -0
- data/apps/core/components/public/bootstrap/scss/_component-animations.scss +18 -0
- data/apps/core/components/public/bootstrap/scss/_custom.css +0 -0
- data/apps/core/components/public/bootstrap/scss/_dropdowns.scss +131 -0
- data/apps/core/components/public/bootstrap/scss/_forms.scss +516 -0
- data/apps/core/components/public/bootstrap/scss/_grid.scss +8 -0
- data/apps/core/components/public/bootstrap/scss/_hero-unit.scss +20 -0
- data/apps/core/components/public/bootstrap/scss/_labels.scss +16 -0
- data/apps/core/components/public/bootstrap/scss/_layouts.scss +17 -0
- data/apps/core/components/public/bootstrap/scss/_mixins.scss +538 -0
- data/apps/core/components/public/bootstrap/scss/_modals.scss +72 -0
- data/apps/core/components/public/bootstrap/scss/_navbar.scss +292 -0
- data/apps/core/components/public/bootstrap/scss/_navs.scss +343 -0
- data/apps/core/components/public/bootstrap/scss/_pager.scss +30 -0
- data/apps/core/components/public/bootstrap/scss/_pagination.scss +64 -0
- data/apps/core/components/public/bootstrap/scss/_patterns.scss +13 -0
- data/apps/core/components/public/bootstrap/scss/_popovers.scss +49 -0
- data/apps/core/components/public/bootstrap/scss/_print.scss +18 -0
- data/apps/core/components/public/bootstrap/scss/_progress-bars.scss +95 -0
- data/apps/core/{admin/public/sass/bootstrap/reset.scss → components/public/bootstrap/scss/_reset.scss} +36 -51
- data/apps/core/components/public/bootstrap/scss/_scaffolding.scss +29 -0
- data/apps/core/components/public/bootstrap/scss/_sprites.scss +156 -0
- data/apps/core/components/public/bootstrap/scss/_tables.scss +139 -0
- data/apps/core/components/public/bootstrap/scss/_thumbnails.scss +35 -0
- data/apps/core/components/public/bootstrap/scss/_tooltip.scss +35 -0
- data/apps/core/components/public/bootstrap/scss/_type.scss +217 -0
- data/apps/core/components/public/bootstrap/scss/_utilities.scss +23 -0
- data/apps/core/components/public/bootstrap/scss/_variables.scss +99 -0
- data/apps/core/components/public/bootstrap/scss/_wells.scss +17 -0
- data/apps/core/components/public/bootstrap/scss/bootstrap-responsive.css +707 -0
- data/apps/core/components/public/bootstrap/scss/bootstrap-responsive.scss +323 -0
- data/apps/core/components/public/bootstrap/scss/bootstrap.css +4604 -0
- data/apps/core/components/public/bootstrap/scss/bootstrap.scss +62 -0
- data/apps/core/components/public/bootstrap/scss/config.rb +36 -0
- data/apps/core/components/public/css/admin.css +2 -1
- data/apps/core/components/public/css/sass/bootstrap/bootstrap.css +3107 -0
- data/apps/core/components/public/css/table_base.css +9 -0
- data/apps/core/components/public/widgets/month_calendar.js +9 -0
- data/apps/core/components/widgets/crud/crud.rb +9 -1
- data/apps/core/components/widgets/crud/crud.shtml +2 -2
- data/apps/core/components/widgets/month_calendar/month_calendar.shtml +1 -0
- data/apps/core/components/widgets/table/table.rb +84 -55
- data/apps/core/components/widgets/table/table.shtml +2 -1
- data/apps/core/forms/public/ckeditor/CHANGES.html +139 -1
- data/apps/core/forms/public/ckeditor/LICENSE.html +1 -8
- data/apps/core/forms/public/ckeditor/ckeditor.js +141 -137
- data/apps/core/forms/public/ckeditor/ckeditor_basic.js +3 -3
- data/apps/core/forms/public/ckeditor/ckeditor_basic_source.js +1 -1
- data/apps/core/forms/public/ckeditor/ckeditor_source.js +13 -3
- data/apps/core/forms/public/ckeditor/contents.css +4 -2
- data/apps/core/forms/public/ckeditor/lang/_translationstatus.txt +59 -59
- data/apps/core/forms/public/ckeditor/lang/af.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ar.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/bg.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/bn.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/bs.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ca.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/cs.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/cy.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/da.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/de.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/el.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/en-au.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/en-ca.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/en-gb.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/en.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/eo.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/es.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/et.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/eu.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/fa.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/fi.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/fo.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/fr-ca.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/fr.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/gl.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/gu.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/he.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/hi.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/hr.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/hu.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/is.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/it.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ja.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ka.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/km.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ko.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/lt.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/lv.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/mn.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ms.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/nb.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/nl.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/no.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/pl.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/pt-br.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/pt.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ro.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/ru.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/sk.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/sl.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/sr-latn.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/sr.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/sv.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/th.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/tr.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/uk.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/vi.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/zh-cn.js +1 -1
- data/apps/core/forms/public/ckeditor/lang/zh.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/bbcode/plugin.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/docprops/dialogs/docprops.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js +5 -4
- data/apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/select.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/iframe/dialogs/iframe.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js +6 -6
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/link.js +6 -5
- data/apps/core/forms/public/ckeditor/plugins/liststyle/dialogs/liststyle.js +2 -1
- data/apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js +5 -5
- data/apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/specialchar/lang/en.js +1 -1
- data/apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js +4 -4
- data/apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js +2 -2
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js +1 -1
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/README.md +26 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/dialog.css +616 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/editor.css +1088 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/icons.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/dialog_sides.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/dialog_sides.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/dialog_sides_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/mini.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/noimage.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/sprites.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/sprites_ie6.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/images/toolbar_start.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/skin.js +7 -0
- data/apps/core/forms/public/ckeditor/skins/BootstrapCK-Skin/templates.css +54 -0
- data/apps/core/forms/public/ckeditor/skins/kama/dialog.css +4 -3
- data/apps/core/forms/public/ckeditor/skins/kama/editor.css +3 -3
- data/apps/core/forms/public/ckeditor/themes/default/theme.js +2 -2
- data/apps/core/forms/public/css/form.css +5 -5
- data/apps/core/forms/public/html_area.js +5 -5
- data/apps/core/forms/tags/element_label.erb +1 -1
- data/apps/core/forms/tags/row.erb +1 -1
- data/apps/core/forms/widgets/form/form.rb +2 -1
- data/apps/core/forms/widgets/form/form.shtml +3 -3
- data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +1 -1
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -1
- data/apps/core/forms/widgets/inputs/file_input/file_input.shtml +1 -1
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +1 -1
- data/apps/core/forms/widgets/inputs/input/input.shtml +1 -1
- data/apps/core/forms/widgets/inputs/input/readonly.shtml +1 -1
- data/apps/core/forms/widgets/inputs/password/password.shtml +1 -1
- data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +1 -1
- data/apps/core/forms/widgets/inputs/select/select.shtml +1 -1
- data/apps/core/forms/widgets/inputs/text/text.shtml +1 -1
- data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +1 -1
- data/apps/core/forms/widgets/inputs/time_span/time_span.shtml +1 -1
- data/apps/messenger/controllers/messenger_admin_controller.rb +19 -4
- data/apps/messenger/views/admin/_admin.layout.shtml +1 -1
- data/apps/messenger/views/admin/queue.shtml +6 -6
- data/apps/messenger/views/admin/view_email.shtml +7 -0
- data/apps/messenger/views/admin/view_sms.shtml +4 -0
- data/blueprints/app/.dirs +2 -1
- data/blueprints/app/test/features/support/env.rb +4 -0
- data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
- data/lib/spiderfw/cmd/commands/config.rb +6 -3
- data/lib/spiderfw/config/configuration.rb +11 -2
- data/lib/spiderfw/config/options/spider.rb +1 -1
- data/lib/spiderfw/controller/controller.rb +27 -15
- data/lib/spiderfw/controller/dispatcher.rb +8 -4
- data/lib/spiderfw/controller/http_controller.rb +9 -5
- data/lib/spiderfw/controller/mixins/static_content.rb +1 -0
- data/lib/spiderfw/controller/mixins/visual.rb +48 -31
- data/lib/spiderfw/home.rb +8 -0
- data/lib/spiderfw/i18n/cldr.rb +1 -0
- data/lib/spiderfw/model/base_model.rb +2 -2
- data/lib/spiderfw/model/mappers/db_mapper.rb +1 -0
- data/lib/spiderfw/model/unit_of_work.rb +2 -2
- data/lib/spiderfw/requires.rb +1 -0
- data/lib/spiderfw/setup/app_manager.rb +16 -8
- data/lib/spiderfw/spider.rb +2 -2
- data/lib/spiderfw/templates/layout.rb +16 -9
- data/lib/spiderfw/templates/template.rb +28 -8
- data/lib/spiderfw/utils/logger.rb +9 -9
- data/views/errors/error.layout.shtml +9 -4
- metadata +98 -13
- data/apps/core/admin/public/sass/bootstrap/bootstrap.scss +0 -29
- data/apps/core/admin/public/sass/bootstrap/forms.scss +0 -478
- data/apps/core/admin/public/sass/bootstrap/mixins.scss +0 -220
- data/apps/core/admin/public/sass/bootstrap/patterns.scss +0 -1062
- data/apps/core/admin/public/sass/bootstrap/scaffolding.scss +0 -136
- data/apps/core/admin/public/sass/bootstrap/tables.scss +0 -224
- data/apps/core/admin/public/sass/bootstrap/type.scss +0 -187
- data/apps/core/admin/public/sass/bootstrap/variables.scss +0 -60
@@ -0,0 +1,270 @@
|
|
1
|
+
/* ===========================================================
|
2
|
+
* bootstrap-tooltip.js v2.0.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
4
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
5
|
+
* ===========================================================
|
6
|
+
* Copyright 2012 Twitter, Inc.
|
7
|
+
*
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
* you may not use this file except in compliance with the License.
|
10
|
+
* You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
* See the License for the specific language governing permissions and
|
18
|
+
* limitations under the License.
|
19
|
+
* ========================================================== */
|
20
|
+
|
21
|
+
!function( $ ) {
|
22
|
+
|
23
|
+
"use strict"
|
24
|
+
|
25
|
+
/* TOOLTIP PUBLIC CLASS DEFINITION
|
26
|
+
* =============================== */
|
27
|
+
|
28
|
+
var Tooltip = function ( element, options ) {
|
29
|
+
this.init('tooltip', element, options)
|
30
|
+
}
|
31
|
+
|
32
|
+
Tooltip.prototype = {
|
33
|
+
|
34
|
+
constructor: Tooltip
|
35
|
+
|
36
|
+
, init: function ( type, element, options ) {
|
37
|
+
var eventIn
|
38
|
+
, eventOut
|
39
|
+
|
40
|
+
this.type = type
|
41
|
+
this.$element = $(element)
|
42
|
+
this.options = this.getOptions(options)
|
43
|
+
this.enabled = true
|
44
|
+
|
45
|
+
if (this.options.trigger != 'manual') {
|
46
|
+
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
47
|
+
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
48
|
+
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
|
49
|
+
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
|
50
|
+
}
|
51
|
+
|
52
|
+
this.options.selector ?
|
53
|
+
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
54
|
+
this.fixTitle()
|
55
|
+
}
|
56
|
+
|
57
|
+
, getOptions: function ( options ) {
|
58
|
+
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
59
|
+
|
60
|
+
if (options.delay && typeof options.delay == 'number') {
|
61
|
+
options.delay = {
|
62
|
+
show: options.delay
|
63
|
+
, hide: options.delay
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
return options
|
68
|
+
}
|
69
|
+
|
70
|
+
, enter: function ( e ) {
|
71
|
+
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
72
|
+
|
73
|
+
if (!self.options.delay || !self.options.delay.show) {
|
74
|
+
self.show()
|
75
|
+
} else {
|
76
|
+
self.hoverState = 'in'
|
77
|
+
setTimeout(function() {
|
78
|
+
if (self.hoverState == 'in') {
|
79
|
+
self.show()
|
80
|
+
}
|
81
|
+
}, self.options.delay.show)
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
, leave: function ( e ) {
|
86
|
+
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
87
|
+
|
88
|
+
if (!self.options.delay || !self.options.delay.hide) {
|
89
|
+
self.hide()
|
90
|
+
} else {
|
91
|
+
self.hoverState = 'out'
|
92
|
+
setTimeout(function() {
|
93
|
+
if (self.hoverState == 'out') {
|
94
|
+
self.hide()
|
95
|
+
}
|
96
|
+
}, self.options.delay.hide)
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
, show: function () {
|
101
|
+
var $tip
|
102
|
+
, inside
|
103
|
+
, pos
|
104
|
+
, actualWidth
|
105
|
+
, actualHeight
|
106
|
+
, placement
|
107
|
+
, tp
|
108
|
+
|
109
|
+
if (this.hasContent() && this.enabled) {
|
110
|
+
$tip = this.tip()
|
111
|
+
this.setContent()
|
112
|
+
|
113
|
+
if (this.options.animation) {
|
114
|
+
$tip.addClass('fade')
|
115
|
+
}
|
116
|
+
|
117
|
+
placement = typeof this.options.placement == 'function' ?
|
118
|
+
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
119
|
+
this.options.placement
|
120
|
+
|
121
|
+
inside = /in/.test(placement)
|
122
|
+
|
123
|
+
$tip
|
124
|
+
.remove()
|
125
|
+
.css({ top: 0, left: 0, display: 'block' })
|
126
|
+
.appendTo(inside ? this.$element : document.body)
|
127
|
+
|
128
|
+
pos = this.getPosition(inside)
|
129
|
+
|
130
|
+
actualWidth = $tip[0].offsetWidth
|
131
|
+
actualHeight = $tip[0].offsetHeight
|
132
|
+
|
133
|
+
switch (inside ? placement.split(' ')[1] : placement) {
|
134
|
+
case 'bottom':
|
135
|
+
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
136
|
+
break
|
137
|
+
case 'top':
|
138
|
+
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
139
|
+
break
|
140
|
+
case 'left':
|
141
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
142
|
+
break
|
143
|
+
case 'right':
|
144
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
145
|
+
break
|
146
|
+
}
|
147
|
+
|
148
|
+
$tip
|
149
|
+
.css(tp)
|
150
|
+
.addClass(placement)
|
151
|
+
.addClass('in')
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
, setContent: function () {
|
156
|
+
var $tip = this.tip()
|
157
|
+
$tip.find('.tooltip-inner').html(this.getTitle())
|
158
|
+
$tip.removeClass('fade in top bottom left right')
|
159
|
+
}
|
160
|
+
|
161
|
+
, hide: function () {
|
162
|
+
var that = this
|
163
|
+
, $tip = this.tip()
|
164
|
+
|
165
|
+
$tip.removeClass('in')
|
166
|
+
|
167
|
+
function removeWithAnimation() {
|
168
|
+
var timeout = setTimeout(function () {
|
169
|
+
$tip.off($.support.transition.end).remove()
|
170
|
+
}, 500)
|
171
|
+
|
172
|
+
$tip.one($.support.transition.end, function () {
|
173
|
+
clearTimeout(timeout)
|
174
|
+
$tip.remove()
|
175
|
+
})
|
176
|
+
}
|
177
|
+
|
178
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
179
|
+
removeWithAnimation() :
|
180
|
+
$tip.remove()
|
181
|
+
}
|
182
|
+
|
183
|
+
, fixTitle: function () {
|
184
|
+
var $e = this.$element
|
185
|
+
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
186
|
+
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
, hasContent: function () {
|
191
|
+
return this.getTitle()
|
192
|
+
}
|
193
|
+
|
194
|
+
, getPosition: function (inside) {
|
195
|
+
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
196
|
+
width: this.$element[0].offsetWidth
|
197
|
+
, height: this.$element[0].offsetHeight
|
198
|
+
})
|
199
|
+
}
|
200
|
+
|
201
|
+
, getTitle: function () {
|
202
|
+
var title
|
203
|
+
, $e = this.$element
|
204
|
+
, o = this.options
|
205
|
+
|
206
|
+
title = $e.attr('data-original-title')
|
207
|
+
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
208
|
+
|
209
|
+
title = title.toString().replace(/(^\s*|\s*$)/, "")
|
210
|
+
|
211
|
+
return title
|
212
|
+
}
|
213
|
+
|
214
|
+
, tip: function () {
|
215
|
+
return this.$tip = this.$tip || $(this.options.template)
|
216
|
+
}
|
217
|
+
|
218
|
+
, validate: function () {
|
219
|
+
if (!this.$element[0].parentNode) {
|
220
|
+
this.hide()
|
221
|
+
this.$element = null
|
222
|
+
this.options = null
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
, enable: function () {
|
227
|
+
this.enabled = true
|
228
|
+
}
|
229
|
+
|
230
|
+
, disable: function () {
|
231
|
+
this.enabled = false
|
232
|
+
}
|
233
|
+
|
234
|
+
, toggleEnabled: function () {
|
235
|
+
this.enabled = !this.enabled
|
236
|
+
}
|
237
|
+
|
238
|
+
, toggle: function () {
|
239
|
+
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
240
|
+
}
|
241
|
+
|
242
|
+
}
|
243
|
+
|
244
|
+
|
245
|
+
/* TOOLTIP PLUGIN DEFINITION
|
246
|
+
* ========================= */
|
247
|
+
|
248
|
+
$.fn.tooltip = function ( option ) {
|
249
|
+
return this.each(function () {
|
250
|
+
var $this = $(this)
|
251
|
+
, data = $this.data('tooltip')
|
252
|
+
, options = typeof option == 'object' && option
|
253
|
+
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
254
|
+
if (typeof option == 'string') data[option]()
|
255
|
+
})
|
256
|
+
}
|
257
|
+
|
258
|
+
$.fn.tooltip.Constructor = Tooltip
|
259
|
+
|
260
|
+
$.fn.tooltip.defaults = {
|
261
|
+
animation: true
|
262
|
+
, delay: 0
|
263
|
+
, selector: false
|
264
|
+
, placement: 'top'
|
265
|
+
, trigger: 'hover'
|
266
|
+
, title: ''
|
267
|
+
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
268
|
+
}
|
269
|
+
|
270
|
+
}( window.jQuery )
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/* ===================================================
|
2
|
+
* bootstrap-transition.js v2.0.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#transitions
|
4
|
+
* ===================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* ========================================================== */
|
19
|
+
|
20
|
+
!function( $ ) {
|
21
|
+
|
22
|
+
$(function () {
|
23
|
+
|
24
|
+
"use strict"
|
25
|
+
|
26
|
+
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
27
|
+
* ======================================================= */
|
28
|
+
|
29
|
+
$.support.transition = (function () {
|
30
|
+
var thisBody = document.body || document.documentElement
|
31
|
+
, thisStyle = thisBody.style
|
32
|
+
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
33
|
+
|
34
|
+
return support && {
|
35
|
+
end: (function () {
|
36
|
+
var transitionEnd = "TransitionEnd"
|
37
|
+
if ( $.browser.webkit ) {
|
38
|
+
transitionEnd = "webkitTransitionEnd"
|
39
|
+
} else if ( $.browser.mozilla ) {
|
40
|
+
transitionEnd = "transitionend"
|
41
|
+
} else if ( $.browser.opera ) {
|
42
|
+
transitionEnd = "oTransitionEnd"
|
43
|
+
}
|
44
|
+
return transitionEnd
|
45
|
+
}())
|
46
|
+
}
|
47
|
+
})()
|
48
|
+
|
49
|
+
})
|
50
|
+
|
51
|
+
}( window.jQuery )
|
@@ -0,0 +1,271 @@
|
|
1
|
+
/* =============================================================
|
2
|
+
* bootstrap-typeahead.js v2.0.0
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#typeahead
|
4
|
+
* =============================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* ============================================================ */
|
19
|
+
|
20
|
+
!function( $ ){
|
21
|
+
|
22
|
+
"use strict"
|
23
|
+
|
24
|
+
var Typeahead = function ( element, options ) {
|
25
|
+
this.$element = $(element)
|
26
|
+
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
27
|
+
this.matcher = this.options.matcher || this.matcher
|
28
|
+
this.sorter = this.options.sorter || this.sorter
|
29
|
+
this.highlighter = this.options.highlighter || this.highlighter
|
30
|
+
this.$menu = $(this.options.menu).appendTo('body')
|
31
|
+
this.source = this.options.source
|
32
|
+
this.shown = false
|
33
|
+
this.listen()
|
34
|
+
}
|
35
|
+
|
36
|
+
Typeahead.prototype = {
|
37
|
+
|
38
|
+
constructor: Typeahead
|
39
|
+
|
40
|
+
, select: function () {
|
41
|
+
var val = this.$menu.find('.active').attr('data-value')
|
42
|
+
this.$element.val(val)
|
43
|
+
return this.hide()
|
44
|
+
}
|
45
|
+
|
46
|
+
, show: function () {
|
47
|
+
var pos = $.extend({}, this.$element.offset(), {
|
48
|
+
height: this.$element[0].offsetHeight
|
49
|
+
})
|
50
|
+
|
51
|
+
this.$menu.css({
|
52
|
+
top: pos.top + pos.height
|
53
|
+
, left: pos.left
|
54
|
+
})
|
55
|
+
|
56
|
+
this.$menu.show()
|
57
|
+
this.shown = true
|
58
|
+
return this
|
59
|
+
}
|
60
|
+
|
61
|
+
, hide: function () {
|
62
|
+
this.$menu.hide()
|
63
|
+
this.shown = false
|
64
|
+
return this
|
65
|
+
}
|
66
|
+
|
67
|
+
, lookup: function (event) {
|
68
|
+
var that = this
|
69
|
+
, items
|
70
|
+
, q
|
71
|
+
|
72
|
+
this.query = this.$element.val()
|
73
|
+
|
74
|
+
if (!this.query) {
|
75
|
+
return this.shown ? this.hide() : this
|
76
|
+
}
|
77
|
+
|
78
|
+
items = $.grep(this.source, function (item) {
|
79
|
+
if (that.matcher(item)) return item
|
80
|
+
})
|
81
|
+
|
82
|
+
items = this.sorter(items)
|
83
|
+
|
84
|
+
if (!items.length) {
|
85
|
+
return this.shown ? this.hide() : this
|
86
|
+
}
|
87
|
+
|
88
|
+
return this.render(items.slice(0, this.options.items)).show()
|
89
|
+
}
|
90
|
+
|
91
|
+
, matcher: function (item) {
|
92
|
+
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
93
|
+
}
|
94
|
+
|
95
|
+
, sorter: function (items) {
|
96
|
+
var beginswith = []
|
97
|
+
, caseSensitive = []
|
98
|
+
, caseInsensitive = []
|
99
|
+
, item
|
100
|
+
|
101
|
+
while (item = items.shift()) {
|
102
|
+
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
103
|
+
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
104
|
+
else caseInsensitive.push(item)
|
105
|
+
}
|
106
|
+
|
107
|
+
return beginswith.concat(caseSensitive, caseInsensitive)
|
108
|
+
}
|
109
|
+
|
110
|
+
, highlighter: function (item) {
|
111
|
+
return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
|
112
|
+
return '<strong>' + match + '</strong>'
|
113
|
+
})
|
114
|
+
}
|
115
|
+
|
116
|
+
, render: function (items) {
|
117
|
+
var that = this
|
118
|
+
|
119
|
+
items = $(items).map(function (i, item) {
|
120
|
+
i = $(that.options.item).attr('data-value', item)
|
121
|
+
i.find('a').html(that.highlighter(item))
|
122
|
+
return i[0]
|
123
|
+
})
|
124
|
+
|
125
|
+
items.first().addClass('active')
|
126
|
+
this.$menu.html(items)
|
127
|
+
return this
|
128
|
+
}
|
129
|
+
|
130
|
+
, next: function (event) {
|
131
|
+
var active = this.$menu.find('.active').removeClass('active')
|
132
|
+
, next = active.next()
|
133
|
+
|
134
|
+
if (!next.length) {
|
135
|
+
next = $(this.$menu.find('li')[0])
|
136
|
+
}
|
137
|
+
|
138
|
+
next.addClass('active')
|
139
|
+
}
|
140
|
+
|
141
|
+
, prev: function (event) {
|
142
|
+
var active = this.$menu.find('.active').removeClass('active')
|
143
|
+
, prev = active.prev()
|
144
|
+
|
145
|
+
if (!prev.length) {
|
146
|
+
prev = this.$menu.find('li').last()
|
147
|
+
}
|
148
|
+
|
149
|
+
prev.addClass('active')
|
150
|
+
}
|
151
|
+
|
152
|
+
, listen: function () {
|
153
|
+
this.$element
|
154
|
+
.on('blur', $.proxy(this.blur, this))
|
155
|
+
.on('keypress', $.proxy(this.keypress, this))
|
156
|
+
.on('keyup', $.proxy(this.keyup, this))
|
157
|
+
|
158
|
+
if ($.browser.webkit || $.browser.msie) {
|
159
|
+
this.$element.on('keydown', $.proxy(this.keypress, this))
|
160
|
+
}
|
161
|
+
|
162
|
+
this.$menu
|
163
|
+
.on('click', $.proxy(this.click, this))
|
164
|
+
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
165
|
+
}
|
166
|
+
|
167
|
+
, keyup: function (e) {
|
168
|
+
e.stopPropagation()
|
169
|
+
e.preventDefault()
|
170
|
+
|
171
|
+
switch(e.keyCode) {
|
172
|
+
case 40: // down arrow
|
173
|
+
case 38: // up arrow
|
174
|
+
break
|
175
|
+
|
176
|
+
case 9: // tab
|
177
|
+
case 13: // enter
|
178
|
+
if (!this.shown) return
|
179
|
+
this.select()
|
180
|
+
break
|
181
|
+
|
182
|
+
case 27: // escape
|
183
|
+
this.hide()
|
184
|
+
break
|
185
|
+
|
186
|
+
default:
|
187
|
+
this.lookup()
|
188
|
+
}
|
189
|
+
|
190
|
+
}
|
191
|
+
|
192
|
+
, keypress: function (e) {
|
193
|
+
e.stopPropagation()
|
194
|
+
if (!this.shown) return
|
195
|
+
|
196
|
+
switch(e.keyCode) {
|
197
|
+
case 9: // tab
|
198
|
+
case 13: // enter
|
199
|
+
case 27: // escape
|
200
|
+
e.preventDefault()
|
201
|
+
break
|
202
|
+
|
203
|
+
case 38: // up arrow
|
204
|
+
e.preventDefault()
|
205
|
+
this.prev()
|
206
|
+
break
|
207
|
+
|
208
|
+
case 40: // down arrow
|
209
|
+
e.preventDefault()
|
210
|
+
this.next()
|
211
|
+
break
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
, blur: function (e) {
|
216
|
+
var that = this
|
217
|
+
e.stopPropagation()
|
218
|
+
e.preventDefault()
|
219
|
+
setTimeout(function () { that.hide() }, 150)
|
220
|
+
}
|
221
|
+
|
222
|
+
, click: function (e) {
|
223
|
+
e.stopPropagation()
|
224
|
+
e.preventDefault()
|
225
|
+
this.select()
|
226
|
+
}
|
227
|
+
|
228
|
+
, mouseenter: function (e) {
|
229
|
+
this.$menu.find('.active').removeClass('active')
|
230
|
+
$(e.currentTarget).addClass('active')
|
231
|
+
}
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
/* TYPEAHEAD PLUGIN DEFINITION
|
237
|
+
* =========================== */
|
238
|
+
|
239
|
+
$.fn.typeahead = function ( option ) {
|
240
|
+
return this.each(function () {
|
241
|
+
var $this = $(this)
|
242
|
+
, data = $this.data('typeahead')
|
243
|
+
, options = typeof option == 'object' && option
|
244
|
+
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
245
|
+
if (typeof option == 'string') data[option]()
|
246
|
+
})
|
247
|
+
}
|
248
|
+
|
249
|
+
$.fn.typeahead.defaults = {
|
250
|
+
source: []
|
251
|
+
, items: 8
|
252
|
+
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
253
|
+
, item: '<li><a href="#"></a></li>'
|
254
|
+
}
|
255
|
+
|
256
|
+
$.fn.typeahead.Constructor = Typeahead
|
257
|
+
|
258
|
+
|
259
|
+
/* TYPEAHEAD DATA-API
|
260
|
+
* ================== */
|
261
|
+
|
262
|
+
$(function () {
|
263
|
+
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
264
|
+
var $this = $(this)
|
265
|
+
if ($this.data('typeahead')) return
|
266
|
+
e.preventDefault()
|
267
|
+
$this.typeahead($this.data())
|
268
|
+
})
|
269
|
+
})
|
270
|
+
|
271
|
+
}( window.jQuery )
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Bootstrap Plugin Test Suite</title>
|
5
|
+
|
6
|
+
<!-- jquery -->
|
7
|
+
<!--<script src="http://code.jquery.com/jquery-1.7.min.js"></script>-->
|
8
|
+
<script src="vendor/jquery.js"></script>
|
9
|
+
|
10
|
+
<!-- qunit -->
|
11
|
+
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
|
12
|
+
<script src="vendor/qunit.js"></script>
|
13
|
+
|
14
|
+
<!-- plugin sources -->
|
15
|
+
<script src="../../js/bootstrap-transition.js"></script>
|
16
|
+
<script src="../../js/bootstrap-alert.js"></script>
|
17
|
+
<script src="../../js/bootstrap-button.js"></script>
|
18
|
+
<script src="../../js/bootstrap-collapse.js"></script>
|
19
|
+
<script src="../../js/bootstrap-dropdown.js"></script>
|
20
|
+
<script src="../../js/bootstrap-modal.js"></script>
|
21
|
+
<script src="../../js/bootstrap-scrollspy.js"></script>
|
22
|
+
<script src="../../js/bootstrap-tab.js"></script>
|
23
|
+
<script src="../../js/bootstrap-tooltip.js"></script>
|
24
|
+
<script src="../../js/bootstrap-popover.js"></script>
|
25
|
+
<script src="../../js/bootstrap-typeahead.js"></script>
|
26
|
+
|
27
|
+
<!-- unit tests -->
|
28
|
+
<script src="unit/bootstrap-transition.js"></script>
|
29
|
+
<script src="unit/bootstrap-alert.js"></script>
|
30
|
+
<script src="unit/bootstrap-button.js"></script>
|
31
|
+
<script src="unit/bootstrap-collapse.js"></script>
|
32
|
+
<script src="unit/bootstrap-dropdown.js"></script>
|
33
|
+
<script src="unit/bootstrap-modal.js"></script>
|
34
|
+
<script src="unit/bootstrap-scrollspy.js"></script>
|
35
|
+
<script src="unit/bootstrap-tab.js"></script>
|
36
|
+
<script src="unit/bootstrap-tooltip.js"></script>
|
37
|
+
<script src="unit/bootstrap-popover.js"></script>
|
38
|
+
<script src="unit/bootstrap-typeahead.js"></script>
|
39
|
+
|
40
|
+
<body>
|
41
|
+
<div>
|
42
|
+
<h1 id="qunit-header">Bootstrap Plugin Test Suite</h1>
|
43
|
+
<h2 id="qunit-banner"></h2>
|
44
|
+
<h2 id="qunit-userAgent"></h2>
|
45
|
+
<ol id="qunit-tests"></ol>
|
46
|
+
<div id="qunit-fixture"></div>
|
47
|
+
</div>
|
48
|
+
</body>
|
49
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
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
|
+
})
|