twitter-bootstrap-rails 2.2.5 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of twitter-bootstrap-rails might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +460 -187
- data/Rakefile +7 -1
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +640 -0
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/javascripts/twitter/bootstrap.js +12 -0
- data/app/assets/javascripts/twitter/bootstrap/affix.js +142 -0
- data/app/assets/javascripts/twitter/bootstrap/alert.js +92 -0
- data/app/assets/javascripts/twitter/bootstrap/button.js +110 -0
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +223 -0
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +151 -0
- data/app/assets/javascripts/twitter/bootstrap/modal.js +280 -0
- data/app/assets/javascripts/twitter/bootstrap/popover.js +113 -0
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +170 -0
- data/app/assets/javascripts/twitter/bootstrap/tab.js +128 -0
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +457 -0
- data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
- data/{vendor → app}/assets/javascripts/twitter/bootstrap_ujs.js +0 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +2026 -0
- data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -0
- data/app/helpers/badge_label_helper.rb +16 -0
- data/app/helpers/bootstrap_flash_helper.rb +15 -8
- data/app/helpers/form_errors_helper.rb +22 -0
- data/app/helpers/glyph_helper.rb +13 -5
- data/app/helpers/modal_helper.rb +37 -20
- data/app/helpers/navbar_helper.rb +209 -0
- data/app/helpers/twitter_breadcrumbs_helper.rb +11 -2
- data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +9 -9
- data/lib/generators/bootstrap/install/install_generator.rb +13 -8
- data/lib/generators/bootstrap/install/templates/bootstrap.coffee +2 -3
- data/lib/generators/bootstrap/install/templates/bootstrap.js +2 -3
- data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +14 -13
- data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +10 -4
- data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
- data/lib/generators/bootstrap/layout/templates/layout.html.erb +34 -58
- data/lib/generators/bootstrap/layout/templates/layout.html.haml +25 -44
- data/lib/generators/bootstrap/layout/templates/layout.html.slim +20 -39
- data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
- data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
- data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
- data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
- data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/edit.html.slim +2 -2
- data/lib/generators/bootstrap/themed/templates/index.html.erb +3 -3
- data/lib/generators/bootstrap/themed/templates/index.html.haml +3 -3
- data/lib/generators/bootstrap/themed/templates/index.html.slim +5 -6
- data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
- data/lib/generators/bootstrap/themed/templates/new.html.slim +2 -2
- data/lib/generators/bootstrap/themed/templates/show.html.erb +6 -8
- data/lib/generators/bootstrap/themed/templates/show.html.haml +5 -5
- data/lib/generators/bootstrap/themed/templates/show.html.slim +7 -8
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
- data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
- data/lib/generators/bootstrap/themed/themed_generator.rb +3 -3
- data/lib/twitter-bootstrap-rails.rb +4 -4
- data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
- data/lib/twitter/bootstrap/rails/engine.rb +17 -7
- data/lib/twitter/bootstrap/rails/version.rb +1 -1
- data/spec/lib/breadcrumbs_spec.rb +99 -0
- data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +30 -0
- data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
- data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
- data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
- data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
- data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +396 -0
- data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +49 -0
- data/spec/spec_helper.rb +21 -0
- data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5990 -195
- data/vendor/static-source/bootstrap.less +0 -1
- data/vendor/static-source/fontawesome.less +7 -6
- data/vendor/static-source/sprites.less +3 -3
- data/vendor/toolkit/fontawesome/bordered-pulled.less +16 -0
- data/vendor/toolkit/fontawesome/core.less +11 -0
- data/vendor/toolkit/fontawesome/fixed-width.less +6 -0
- data/vendor/toolkit/fontawesome/font-awesome.less +17 -0
- data/vendor/toolkit/fontawesome/icons.less +552 -0
- data/vendor/toolkit/fontawesome/larger.less +13 -0
- data/vendor/toolkit/fontawesome/list.less +19 -0
- data/vendor/toolkit/fontawesome/mixins.less +25 -0
- data/vendor/toolkit/fontawesome/path.less +14 -0
- data/vendor/toolkit/fontawesome/rotated-flipped.less +20 -0
- data/vendor/toolkit/fontawesome/spinning.less +29 -0
- data/vendor/toolkit/fontawesome/stacked.less +20 -0
- data/vendor/toolkit/fontawesome/variables.less +561 -0
- data/vendor/toolkit/twitter/bootstrap/alerts.less +47 -58
- data/vendor/toolkit/twitter/bootstrap/badges.less +55 -0
- data/vendor/toolkit/twitter/bootstrap/bootstrap.less +26 -40
- data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +168 -152
- data/vendor/toolkit/twitter/bootstrap/buttons.less +101 -170
- data/vendor/toolkit/twitter/bootstrap/carousel.less +150 -65
- data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
- data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +12 -3
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +124 -146
- data/vendor/toolkit/twitter/bootstrap/forms.less +401 -547
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +234 -0
- data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
- data/vendor/toolkit/twitter/bootstrap/input-groups.less +166 -0
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +48 -0
- data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
- data/vendor/toolkit/twitter/bootstrap/list-group.less +132 -0
- data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
- data/vendor/toolkit/twitter/bootstrap/mixins.less +36 -699
- data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +52 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
- data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
- data/vendor/toolkit/twitter/bootstrap/navbar.less +542 -384
- data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
- data/vendor/toolkit/twitter/bootstrap/normalize.less +425 -0
- data/vendor/toolkit/twitter/bootstrap/pager.less +46 -34
- data/vendor/toolkit/twitter/bootstrap/pagination.less +70 -105
- data/vendor/toolkit/twitter/bootstrap/panels.less +248 -0
- data/vendor/toolkit/twitter/bootstrap/popovers.less +61 -61
- data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +51 -73
- data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
- data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +120 -23
- data/vendor/toolkit/twitter/bootstrap/tables.less +171 -182
- data/vendor/toolkit/twitter/bootstrap/theme.less +260 -0
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +26 -43
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +49 -24
- data/vendor/toolkit/twitter/bootstrap/type.less +208 -147
- data/vendor/toolkit/twitter/bootstrap/utilities.less +33 -7
- data/vendor/toolkit/twitter/bootstrap/variables.less +761 -215
- data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
- metadata +172 -94
- data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +0 -13
- data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
- data/test/lib/breadcrumbs_test.rb +0 -75
- data/test/test_helper.rb +0 -8
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +0 -13
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -165
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
- data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -531
- data/vendor/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +0 -146
- data/vendor/toolkit/fontawesome-ie7.less +0 -350
- data/vendor/toolkit/fontawesome.less +0 -532
- data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
- data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
- data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
- data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
- data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -1,42 +0,0 @@
|
|
1
|
-
module Twitter
|
2
|
-
module Bootstrap
|
3
|
-
module BreadCrumbs
|
4
|
-
def self.included(base)
|
5
|
-
base.extend(ClassMethods)
|
6
|
-
end
|
7
|
-
|
8
|
-
module ClassMethods
|
9
|
-
def add_breadcrumb(name, url, options = {})
|
10
|
-
class_name = self.name
|
11
|
-
before_filter options do |controller|
|
12
|
-
name = controller.send :translate_breadcrumb, name, class_name if name.is_a?(Symbol)
|
13
|
-
controller.send :add_breadcrumb, name, url
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
protected
|
19
|
-
|
20
|
-
def add_breadcrumb(name, url = '', options = {})
|
21
|
-
@breadcrumbs ||= []
|
22
|
-
name = translate_breadcrumb(name, self.class.name) if name.is_a?(Symbol)
|
23
|
-
url = eval(url.to_s) if url =~ /_path|_url|@/
|
24
|
-
@breadcrumbs << {:name => name, :url => url, :options => options}
|
25
|
-
end
|
26
|
-
|
27
|
-
def translate_breadcrumb(name, class_name)
|
28
|
-
scope = [:breadcrumbs]
|
29
|
-
namespace = class_name.underscore.split('/')
|
30
|
-
namespace.last.sub!('_controller', '')
|
31
|
-
scope += namespace
|
32
|
-
|
33
|
-
I18n.t name, :scope => scope
|
34
|
-
end
|
35
|
-
|
36
|
-
def render_breadcrumbs(divider = '/')
|
37
|
-
s = render :partial => 'twitter-bootstrap/breadcrumbs', :locals => {:divider => divider}
|
38
|
-
s.first
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
module AbstractController
|
4
|
-
module Testing
|
5
|
-
|
6
|
-
class TestHelper
|
7
|
-
BREADCRUMB_NAMES = [:class_level, :class_level_i18n, :instance_level,
|
8
|
-
:instance_level_i18n, :base_level, :base_level_i18n]
|
9
|
-
|
10
|
-
class << self
|
11
|
-
BREADCRUMB_NAMES.each do |name|
|
12
|
-
define_method "#{name}_name" do
|
13
|
-
"test-breadcrumb-#{name}"
|
14
|
-
end
|
15
|
-
|
16
|
-
define_method "#{name}_path" do
|
17
|
-
"/test/breadcrumb/#{name}"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class BaseTestController < AbstractController::Base
|
24
|
-
include Twitter::Bootstrap::BreadCrumbs
|
25
|
-
include AbstractController::Callbacks
|
26
|
-
|
27
|
-
add_breadcrumb TestHelper.base_level_name, TestHelper.base_level_path
|
28
|
-
add_breadcrumb :base_level_i18n, TestHelper.base_level_i18n_path
|
29
|
-
|
30
|
-
def breadcrumbs
|
31
|
-
@breadcrumbs
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class TestController < BaseTestController
|
36
|
-
add_breadcrumb TestHelper.class_level_name, TestHelper.class_level_path
|
37
|
-
add_breadcrumb :class_level_i18n, TestHelper.class_level_i18n_path
|
38
|
-
|
39
|
-
def index
|
40
|
-
add_breadcrumb TestHelper.instance_level_name, TestHelper.instance_level_path
|
41
|
-
add_breadcrumb :instance_level_i18n, TestHelper.instance_level_i18n_path
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class BreadcrumbsTest < MiniTest::Unit::TestCase
|
46
|
-
def setup
|
47
|
-
options = { scope: [:breadcrumbs, 'abstract_controller', 'testing', 'test'] }
|
48
|
-
[:class_level_i18n, :instance_level_i18n].each do |name|
|
49
|
-
I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
|
50
|
-
end
|
51
|
-
|
52
|
-
name = :base_level_i18n
|
53
|
-
options = { scope: [:breadcrumbs, 'abstract_controller', 'testing', 'base_test'] }
|
54
|
-
I18n.expects(:t).with(name, options).returns(TestHelper.send("#{name}_name"))
|
55
|
-
|
56
|
-
@controller = TestController.new
|
57
|
-
@controller.process(:index)
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_should_have_breadcrumbs
|
61
|
-
TestHelper::BREADCRUMB_NAMES.each do |name|
|
62
|
-
assert include_breadcrumb?(name), "#{name} breadcrumb not found"
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def include_breadcrumb?(name)
|
67
|
-
selected = @controller.breadcrumbs.select { |b|
|
68
|
-
b[:name] == TestHelper.send("#{name}_name") &&
|
69
|
-
b[:url] == TestHelper.send("#{name}_path")
|
70
|
-
}
|
71
|
-
selected.any?
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
data/test/test_helper.rb
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//= require twitter/bootstrap/bootstrap-transition
|
2
|
-
//= require twitter/bootstrap/bootstrap-alert
|
3
|
-
//= require twitter/bootstrap/bootstrap-modal
|
4
|
-
//= require twitter/bootstrap/bootstrap-dropdown
|
5
|
-
//= require twitter/bootstrap/bootstrap-scrollspy
|
6
|
-
//= require twitter/bootstrap/bootstrap-tab
|
7
|
-
//= require twitter/bootstrap/bootstrap-tooltip
|
8
|
-
//= require twitter/bootstrap/bootstrap-popover
|
9
|
-
//= require twitter/bootstrap/bootstrap-button
|
10
|
-
//= require twitter/bootstrap/bootstrap-collapse
|
11
|
-
//= require twitter/bootstrap/bootstrap-carousel
|
12
|
-
//= require twitter/bootstrap/bootstrap-typeahead
|
13
|
-
//= require twitter/bootstrap/bootstrap-affix
|
@@ -1,117 +0,0 @@
|
|
1
|
-
/* ==========================================================
|
2
|
-
* bootstrap-affix.js v2.3.1
|
3
|
-
* http://twitter.github.com/bootstrap/javascript.html#affix
|
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
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* AFFIX CLASS DEFINITION
|
27
|
-
* ====================== */
|
28
|
-
|
29
|
-
var Affix = function (element, options) {
|
30
|
-
this.options = $.extend({}, $.fn.affix.defaults, options)
|
31
|
-
this.$window = $(window)
|
32
|
-
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
33
|
-
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
34
|
-
this.$element = $(element)
|
35
|
-
this.checkPosition()
|
36
|
-
}
|
37
|
-
|
38
|
-
Affix.prototype.checkPosition = function () {
|
39
|
-
if (!this.$element.is(':visible')) return
|
40
|
-
|
41
|
-
var scrollHeight = $(document).height()
|
42
|
-
, scrollTop = this.$window.scrollTop()
|
43
|
-
, position = this.$element.offset()
|
44
|
-
, offset = this.options.offset
|
45
|
-
, offsetBottom = offset.bottom
|
46
|
-
, offsetTop = offset.top
|
47
|
-
, reset = 'affix affix-top affix-bottom'
|
48
|
-
, affix
|
49
|
-
|
50
|
-
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
51
|
-
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
52
|
-
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
53
|
-
|
54
|
-
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
|
55
|
-
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
56
|
-
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
57
|
-
'top' : false
|
58
|
-
|
59
|
-
if (this.affixed === affix) return
|
60
|
-
|
61
|
-
this.affixed = affix
|
62
|
-
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
63
|
-
|
64
|
-
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
/* AFFIX PLUGIN DEFINITION
|
69
|
-
* ======================= */
|
70
|
-
|
71
|
-
var old = $.fn.affix
|
72
|
-
|
73
|
-
$.fn.affix = function (option) {
|
74
|
-
return this.each(function () {
|
75
|
-
var $this = $(this)
|
76
|
-
, data = $this.data('affix')
|
77
|
-
, options = typeof option == 'object' && option
|
78
|
-
if (!data) $this.data('affix', (data = new Affix(this, options)))
|
79
|
-
if (typeof option == 'string') data[option]()
|
80
|
-
})
|
81
|
-
}
|
82
|
-
|
83
|
-
$.fn.affix.Constructor = Affix
|
84
|
-
|
85
|
-
$.fn.affix.defaults = {
|
86
|
-
offset: 0
|
87
|
-
}
|
88
|
-
|
89
|
-
|
90
|
-
/* AFFIX NO CONFLICT
|
91
|
-
* ================= */
|
92
|
-
|
93
|
-
$.fn.affix.noConflict = function () {
|
94
|
-
$.fn.affix = old
|
95
|
-
return this
|
96
|
-
}
|
97
|
-
|
98
|
-
|
99
|
-
/* AFFIX DATA-API
|
100
|
-
* ============== */
|
101
|
-
|
102
|
-
$(window).on('load', function () {
|
103
|
-
$('[data-spy="affix"]').each(function () {
|
104
|
-
var $spy = $(this)
|
105
|
-
, data = $spy.data()
|
106
|
-
|
107
|
-
data.offset = data.offset || {}
|
108
|
-
|
109
|
-
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
|
110
|
-
data.offsetTop && (data.offset.top = data.offsetTop)
|
111
|
-
|
112
|
-
$spy.affix(data)
|
113
|
-
})
|
114
|
-
})
|
115
|
-
|
116
|
-
|
117
|
-
}(window.jQuery);
|
@@ -1,99 +0,0 @@
|
|
1
|
-
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.3.1
|
3
|
-
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
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
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* ALERT CLASS DEFINITION
|
27
|
-
* ====================== */
|
28
|
-
|
29
|
-
var dismiss = '[data-dismiss="alert"]'
|
30
|
-
, Alert = function (el) {
|
31
|
-
$(el).on('click', dismiss, this.close)
|
32
|
-
}
|
33
|
-
|
34
|
-
Alert.prototype.close = function (e) {
|
35
|
-
var $this = $(this)
|
36
|
-
, selector = $this.attr('data-target')
|
37
|
-
, $parent
|
38
|
-
|
39
|
-
if (!selector) {
|
40
|
-
selector = $this.attr('href')
|
41
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
42
|
-
}
|
43
|
-
|
44
|
-
$parent = $(selector)
|
45
|
-
|
46
|
-
e && e.preventDefault()
|
47
|
-
|
48
|
-
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
49
|
-
|
50
|
-
$parent.trigger(e = $.Event('close'))
|
51
|
-
|
52
|
-
if (e.isDefaultPrevented()) return
|
53
|
-
|
54
|
-
$parent.removeClass('in')
|
55
|
-
|
56
|
-
function removeElement() {
|
57
|
-
$parent
|
58
|
-
.trigger('closed')
|
59
|
-
.remove()
|
60
|
-
}
|
61
|
-
|
62
|
-
$.support.transition && $parent.hasClass('fade') ?
|
63
|
-
$parent.on($.support.transition.end, removeElement) :
|
64
|
-
removeElement()
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
/* ALERT PLUGIN DEFINITION
|
69
|
-
* ======================= */
|
70
|
-
|
71
|
-
var old = $.fn.alert
|
72
|
-
|
73
|
-
$.fn.alert = function (option) {
|
74
|
-
return this.each(function () {
|
75
|
-
var $this = $(this)
|
76
|
-
, data = $this.data('alert')
|
77
|
-
if (!data) $this.data('alert', (data = new Alert(this)))
|
78
|
-
if (typeof option == 'string') data[option].call($this)
|
79
|
-
})
|
80
|
-
}
|
81
|
-
|
82
|
-
$.fn.alert.Constructor = Alert
|
83
|
-
|
84
|
-
|
85
|
-
/* ALERT NO CONFLICT
|
86
|
-
* ================= */
|
87
|
-
|
88
|
-
$.fn.alert.noConflict = function () {
|
89
|
-
$.fn.alert = old
|
90
|
-
return this
|
91
|
-
}
|
92
|
-
|
93
|
-
|
94
|
-
/* ALERT DATA-API
|
95
|
-
* ============== */
|
96
|
-
|
97
|
-
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
98
|
-
|
99
|
-
}(window.jQuery);
|
@@ -1,105 +0,0 @@
|
|
1
|
-
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.3.1
|
3
|
-
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
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
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* BUTTON PUBLIC CLASS DEFINITION
|
27
|
-
* ============================== */
|
28
|
-
|
29
|
-
var Button = function (element, options) {
|
30
|
-
this.$element = $(element)
|
31
|
-
this.options = $.extend({}, $.fn.button.defaults, options)
|
32
|
-
}
|
33
|
-
|
34
|
-
Button.prototype.setState = function (state) {
|
35
|
-
var d = 'disabled'
|
36
|
-
, $el = this.$element
|
37
|
-
, data = $el.data()
|
38
|
-
, val = $el.is('input') ? 'val' : 'html'
|
39
|
-
|
40
|
-
state = state + 'Text'
|
41
|
-
data.resetText || $el.data('resetText', $el[val]())
|
42
|
-
|
43
|
-
$el[val](data[state] || this.options[state])
|
44
|
-
|
45
|
-
// push to event loop to allow forms to submit
|
46
|
-
setTimeout(function () {
|
47
|
-
state == 'loadingText' ?
|
48
|
-
$el.addClass(d).attr(d, d) :
|
49
|
-
$el.removeClass(d).removeAttr(d)
|
50
|
-
}, 0)
|
51
|
-
}
|
52
|
-
|
53
|
-
Button.prototype.toggle = function () {
|
54
|
-
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
55
|
-
|
56
|
-
$parent && $parent
|
57
|
-
.find('.active')
|
58
|
-
.removeClass('active')
|
59
|
-
|
60
|
-
this.$element.toggleClass('active')
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
/* BUTTON PLUGIN DEFINITION
|
65
|
-
* ======================== */
|
66
|
-
|
67
|
-
var old = $.fn.button
|
68
|
-
|
69
|
-
$.fn.button = function (option) {
|
70
|
-
return this.each(function () {
|
71
|
-
var $this = $(this)
|
72
|
-
, data = $this.data('button')
|
73
|
-
, options = typeof option == 'object' && option
|
74
|
-
if (!data) $this.data('button', (data = new Button(this, options)))
|
75
|
-
if (option == 'toggle') data.toggle()
|
76
|
-
else if (option) data.setState(option)
|
77
|
-
})
|
78
|
-
}
|
79
|
-
|
80
|
-
$.fn.button.defaults = {
|
81
|
-
loadingText: 'loading...'
|
82
|
-
}
|
83
|
-
|
84
|
-
$.fn.button.Constructor = Button
|
85
|
-
|
86
|
-
|
87
|
-
/* BUTTON NO CONFLICT
|
88
|
-
* ================== */
|
89
|
-
|
90
|
-
$.fn.button.noConflict = function () {
|
91
|
-
$.fn.button = old
|
92
|
-
return this
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
/* BUTTON DATA-API
|
97
|
-
* =============== */
|
98
|
-
|
99
|
-
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
100
|
-
var $btn = $(e.target)
|
101
|
-
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
102
|
-
$btn.button('toggle')
|
103
|
-
})
|
104
|
-
|
105
|
-
}(window.jQuery);
|