cms-fortress 1.0.2 → 1.0.3
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/VERSION +1 -1
- data/app/assets/javascripts/cms/fortress/cms_fortress.js +0 -14
- data/cms-fortress.gemspec +1 -15
- data/lib/cms/fortress/rails/engine.rb +4 -0
- data/lib/generators/cms/fortress/fortress_generator.rb +11 -2
- metadata +2 -16
- data/app/assets/javascripts/cms/fortress/bootstrap-affix.js +0 -117
- data/app/assets/javascripts/cms/fortress/bootstrap-alert.js +0 -99
- data/app/assets/javascripts/cms/fortress/bootstrap-button.js +0 -105
- data/app/assets/javascripts/cms/fortress/bootstrap-carousel.js +0 -207
- data/app/assets/javascripts/cms/fortress/bootstrap-collapse.js +0 -167
- data/app/assets/javascripts/cms/fortress/bootstrap-dropdown.js +0 -165
- data/app/assets/javascripts/cms/fortress/bootstrap-modal.js +0 -247
- data/app/assets/javascripts/cms/fortress/bootstrap-popover.js +0 -114
- data/app/assets/javascripts/cms/fortress/bootstrap-scrollspy.js +0 -162
- data/app/assets/javascripts/cms/fortress/bootstrap-tab.js +0 -144
- data/app/assets/javascripts/cms/fortress/bootstrap-tooltip.js +0 -361
- data/app/assets/javascripts/cms/fortress/bootstrap-transition.js +0 -60
- data/app/assets/javascripts/cms/fortress/bootstrap-typeahead.js +0 -335
- data/app/assets/javascripts/cms/fortress/bootstrap.js +0 -2276
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.0. | 
| 1 | 
            +
            1.0.3
         | 
| @@ -1,14 +0,0 @@ | |
| 1 | 
            -
            //= require jquery
         | 
| 2 | 
            -
            //= require jquery_ujs
         | 
| 3 | 
            -
            //= require ./bootstrap-transition
         | 
| 4 | 
            -
            //= require ./bootstrap-alert
         | 
| 5 | 
            -
            //= require ./bootstrap-modal
         | 
| 6 | 
            -
            //= require ./bootstrap-dropdown
         | 
| 7 | 
            -
            //= require ./bootstrap-scrollspy
         | 
| 8 | 
            -
            //= require ./bootstrap-tab
         | 
| 9 | 
            -
            //= require ./bootstrap-tooltip
         | 
| 10 | 
            -
            //= require ./bootstrap-popover
         | 
| 11 | 
            -
            //= require ./bootstrap-button
         | 
| 12 | 
            -
            //= require ./bootstrap-collapse
         | 
| 13 | 
            -
            //= require ./bootstrap-carousel
         | 
| 14 | 
            -
            //= require ./bootstrap-typeahead
         | 
    
        data/cms-fortress.gemspec
    CHANGED
    
    | @@ -5,7 +5,7 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = "cms-fortress"
         | 
| 8 | 
            -
              s.version = "1.0. | 
| 8 | 
            +
              s.version = "1.0.3"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["Melvin Sembrano"]
         | 
| @@ -27,20 +27,6 @@ Gem::Specification.new do |s| | |
| 27 27 | 
             
                "README.rdoc",
         | 
| 28 28 | 
             
                "Rakefile",
         | 
| 29 29 | 
             
                "VERSION",
         | 
| 30 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-affix.js",
         | 
| 31 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-alert.js",
         | 
| 32 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-button.js",
         | 
| 33 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-carousel.js",
         | 
| 34 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-collapse.js",
         | 
| 35 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-dropdown.js",
         | 
| 36 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-modal.js",
         | 
| 37 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-popover.js",
         | 
| 38 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-scrollspy.js",
         | 
| 39 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-tab.js",
         | 
| 40 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-tooltip.js",
         | 
| 41 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-transition.js",
         | 
| 42 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap-typeahead.js",
         | 
| 43 | 
            -
                "app/assets/javascripts/cms/fortress/bootstrap.js",
         | 
| 44 30 | 
             
                "app/assets/javascripts/cms/fortress/cms_fortress.js",
         | 
| 45 31 | 
             
                "app/assets/javascripts/html5shiv.js",
         | 
| 46 32 | 
             
                "app/assets/stylesheets/cms/fortress/admin_overrides.css",
         | 
| @@ -17,6 +17,10 @@ module Cms | |
| 17 17 | 
             
                      include Cms::Fortress::ApplicationControllerMethods
         | 
| 18 18 | 
             
                    end
         | 
| 19 19 | 
             
                  end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  initializer :assets do |config|
         | 
| 22 | 
            +
                    Rails.application.config.assets.precompile += %w( cms/fortress/admin_overrides.css cms/fortress/session.css )
         | 
| 23 | 
            +
                  end
         | 
| 20 24 | 
             
                end
         | 
| 21 25 | 
             
              end
         | 
| 22 26 | 
             
            end
         | 
| @@ -1,6 +1,7 @@ | |
| 1 1 |  | 
| 2 2 | 
             
            class Cms::FortressGenerator < Rails::Generators::Base
         | 
| 3 | 
            -
              source_root File.expand_path('../templates', __FILE__)
         | 
| 3 | 
            +
              # source_root File.expand_path('../templates', __FILE__)
         | 
| 4 | 
            +
              source_root File.expand_path('../../../../..', __FILE__)
         | 
| 4 5 |  | 
| 5 6 | 
             
              def install_devise
         | 
| 6 7 | 
             
                generate("devise:install")
         | 
| @@ -14,8 +15,16 @@ class Cms::FortressGenerator < Rails::Generators::Base | |
| 14 15 | 
             
                rake("cms_fortress_engine:install:migrations")
         | 
| 15 16 | 
             
              end
         | 
| 16 17 |  | 
| 18 | 
            +
              def generate_assets
         | 
| 19 | 
            +
                directory 'app/assets/javascripts/cms/fortress',
         | 
| 20 | 
            +
                  'app/assets/javascripts/cms/fortress'
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                directory 'app/assets/stylesheets/cms/fortress',
         | 
| 23 | 
            +
                  'app/assets/stylesheets/cms/fortress'
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 17 26 | 
             
              def show_readme
         | 
| 18 | 
            -
                readme 'README'
         | 
| 27 | 
            +
                readme 'lib/generators/cms/fortress/templates/README'
         | 
| 19 28 | 
             
              end
         | 
| 20 29 |  | 
| 21 30 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cms-fortress
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.3
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -173,20 +173,6 @@ files: | |
| 173 173 | 
             
            - README.rdoc
         | 
| 174 174 | 
             
            - Rakefile
         | 
| 175 175 | 
             
            - VERSION
         | 
| 176 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-affix.js
         | 
| 177 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-alert.js
         | 
| 178 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-button.js
         | 
| 179 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-carousel.js
         | 
| 180 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-collapse.js
         | 
| 181 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-dropdown.js
         | 
| 182 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-modal.js
         | 
| 183 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-popover.js
         | 
| 184 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-scrollspy.js
         | 
| 185 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-tab.js
         | 
| 186 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-tooltip.js
         | 
| 187 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-transition.js
         | 
| 188 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap-typeahead.js
         | 
| 189 | 
            -
            - app/assets/javascripts/cms/fortress/bootstrap.js
         | 
| 190 176 | 
             
            - app/assets/javascripts/cms/fortress/cms_fortress.js
         | 
| 191 177 | 
             
            - app/assets/javascripts/html5shiv.js
         | 
| 192 178 | 
             
            - app/assets/stylesheets/cms/fortress/admin_overrides.css
         | 
| @@ -278,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 278 264 | 
             
                  version: '0'
         | 
| 279 265 | 
             
                  segments:
         | 
| 280 266 | 
             
                  - 0
         | 
| 281 | 
            -
                  hash:  | 
| 267 | 
            +
                  hash: -1555868352439146595
         | 
| 282 268 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 283 269 | 
             
              none: false
         | 
| 284 270 | 
             
              requirements:
         | 
| @@ -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);
         |