]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
add jshint support + a few minor stylistic changes
authorJacob Thornton <jacobthornton@gmail.com>
Sat, 14 Apr 2012 23:29:53 +0000 (16:29 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Sat, 14 Apr 2012 23:29:53 +0000 (16:29 -0700)
29 files changed:
Makefile
README.md
docs/assets/bootstrap.zip
docs/assets/js/bootstrap-alert.js
docs/assets/js/bootstrap-button.js
docs/assets/js/bootstrap-carousel.js
docs/assets/js/bootstrap-collapse.js
docs/assets/js/bootstrap-dropdown.js
docs/assets/js/bootstrap-modal.js
docs/assets/js/bootstrap-popover.js
docs/assets/js/bootstrap-scrollspy.js
docs/assets/js/bootstrap-tab.js
docs/assets/js/bootstrap-tooltip.js
docs/assets/js/bootstrap-transition.js
docs/assets/js/bootstrap-typeahead.js
js/.jshintrc [new file with mode: 0644]
js/bootstrap-alert.js
js/bootstrap-button.js
js/bootstrap-carousel.js
js/bootstrap-collapse.js
js/bootstrap-dropdown.js
js/bootstrap-modal.js
js/bootstrap-popover.js
js/bootstrap-scrollspy.js
js/bootstrap-tab.js
js/bootstrap-tooltip.js
js/bootstrap-transition.js
js/bootstrap-typeahead.js
js/tests/unit/bootstrap-transition.js

index 59cd451b724636d25278bd7a7dcc641b8299b67b..8f57099b99de0b25dc82c34b5d7645edb2e17191 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,8 @@ bootstrap:
        lessc --yui-compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
        lessc ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
        lessc --yui-compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
+       jshint js/*.js --config js/.jshintrc
+       jshint js/tests/unit/*.js --config js/.jshintrc
        cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
        uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
        echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
index 0a2a171d72404418f360ebfe3e77812e72ce2472..8907f059a36edcb89c36a51ce3992299c405ad77 100644 (file)
--- a/README.md
+++ b/README.md
@@ -81,6 +81,13 @@ Developers
 
 We have included a makefile with convenience methods for working with the Bootstrap library.
 
++ **dependencies**
+Our makefile depends on you having less, uglify.js, and jshint installed. To install, just run the following command in npm:
+
+```
+$ npm install less uglify-js jshint -g
+```
+
 + **build** - `make`
 Runs the LESS compiler to rebuild the `/less` files and compiles the docs pages. Requires lessc and uglify-js. <a href="http://twitter.github.com/bootstrap/less.html#compiling">Read more in our docs &raquo;</a>
 
index 671d7c68c58fe5ff59749f5e7a98d3f56d84264d..0d3af08d2c34593db77e839170da3daf1ea59e75 100644 (file)
Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ
index c7171855d16b4bcc42fe0de2492de271bf259231..167a57f841230211f6e03e4f59a409041ce61a01 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* ALERT CLASS DEFINITION
   * ====================== */
         $(el).on('click', dismiss, this.close)
       }
 
-  Alert.prototype = {
-
-    constructor: Alert
-
-  , close: function ( e ) {
-      var $this = $(this)
-        , selector = $this.attr('data-target')
-        , $parent
-
-      if (!selector) {
-        selector = $this.attr('href')
-        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-      }
+  Alert.prototype.close = function (e) {
+    var $this = $(this)
+      , selector = $this.attr('data-target')
+      , $parent
 
-      $parent = $(selector)
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+    }
 
-      e && e.preventDefault()
+    $parent = $(selector)
 
-      $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+    e && e.preventDefault()
 
-      $parent.trigger(e = $.Event('close'))
+    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
 
-      if (e.isDefaultPrevented()) return
+    $parent.trigger(e = $.Event('close'))
 
-      $parent.removeClass('in')
+    if (e.isDefaultPrevented()) return
 
-      function removeElement() {
-        $parent
-          .trigger('closed')
-          .remove()
-      }
+    $parent.removeClass('in')
 
-      $.support.transition && $parent.hasClass('fade') ?
-        $parent.on($.support.transition.end, removeElement) :
-        removeElement()
+    function removeElement() {
+      $parent
+        .trigger('closed')
+        .remove()
     }
 
+    $.support.transition && $parent.hasClass('fade') ?
+      $parent.on($.support.transition.end, removeElement) :
+      removeElement()
   }
 
 
@@ -92,4 +87,4 @@
     $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 77af03760b3d65644bc2c9d51c593c805f264164..49e88e49ade7d6252ba4a5c956ab08c088cd473d 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* BUTTON PUBLIC CLASS DEFINITION
   * ============================== */
 
-  var Button = function ( element, options ) {
+  var Button = function (element, options) {
     this.$element = $(element)
     this.options = $.extend({}, $.fn.button.defaults, options)
   }
 
-  Button.prototype = {
-
-      constructor: Button
-
-    , setState: function ( state ) {
-        var d = 'disabled'
-          , $el = this.$element
-          , data = $el.data()
-          , val = $el.is('input') ? 'val' : 'html'
+  Button.prototype.setState = function (state) {
+    var d = 'disabled'
+      , $el = this.$element
+      , data = $el.data()
+      , val = $el.is('input') ? 'val' : 'html'
 
-        state = state + 'Text'
-        data.resetText || $el.data('resetText', $el[val]())
+    state = state + 'Text'
+    data.resetText || $el.data('resetText', $el[val]())
 
-        $el[val](data[state] || this.options[state])
+    $el[val](data[state] || this.options[state])
 
-        // push to event loop to allow forms to submit
-        setTimeout(function () {
-          state == 'loadingText' ?
-            $el.addClass(d).attr(d, d) :
-            $el.removeClass(d).removeAttr(d)
-        }, 0)
-      }
-
-    , toggle: function () {
-        var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+    // push to event loop to allow forms to submit
+    setTimeout(function () {
+      state == 'loadingText' ?
+        $el.addClass(d).attr(d, d) :
+        $el.removeClass(d).removeAttr(d)
+    }, 0)
+  }
 
-        $parent && $parent
-          .find('.active')
-          .removeClass('active')
+  Button.prototype.toggle = function () {
+    var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
 
-        this.$element.toggleClass('active')
-      }
+    $parent && $parent
+      .find('.active')
+      .removeClass('active')
 
+    this.$element.toggleClass('active')
   }
 
 
  /* BUTTON PLUGIN DEFINITION
   * ======================== */
 
-  $.fn.button = function ( option ) {
+  $.fn.button = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('button')
@@ -98,4 +93,4 @@
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 0c8c5a202a2d18ce8fbe895641d74a2da4f34378..d1c3079e443863219a6292b14eba31f96f51c622 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* CAROUSEL CLASS DEFINITION
   * ========================= */
  /* CAROUSEL PLUGIN DEFINITION
   * ========================== */
 
-  $.fn.carousel = function ( option ) {
+  $.fn.carousel = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('carousel')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 9f462e6bcc0756106d259e7676ebb906dc18a742..30e139cf89e00307dd8896c06d51fcb2aeddf82d 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
 
-  "use strict"
+  "use strict"; // jshint ;_;
 
-  var Collapse = function ( element, options ) {
-       this.$element = $(element)
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+  * ================================ */
+
+  var Collapse = function (element, options) {
+    this.$element = $(element)
     this.options = $.extend({}, $.fn.collapse.defaults, options)
 
-    if (this.options["parent"]) {
-      this.$parent = $(this.options["parent"])
+    if (this.options.parent) {
+      this.$parent = $(this.options.parent)
     }
 
     this.options.toggle && this.toggle()
@@ -53,7 +57,6 @@
       dimension = this.dimension()
       scroll = $.camelCase(['scroll', dimension].join('-'))
       actives = this.$parent && this.$parent.find('> .accordion-group > .in')
-      hasData
 
       if (actives && actives.length) {
         hasData = actives.data('collapse')
@@ -75,7 +78,7 @@
       this.$element[dimension](0)
     }
 
-  , reset: function ( size ) {
+  , reset: function (size) {
       var dimension = this.dimension()
 
       this.$element
         [dimension](size || 'auto')
         [0].offsetWidth
 
-      this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
+      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
 
       return this
     }
 
-  , transition: function ( method, startEvent, completeEvent ) {
+  , transition: function (method, startEvent, completeEvent) {
       var that = this
         , complete = function () {
             if (startEvent == 'show') that.reset()
       $.support.transition && this.$element.hasClass('collapse') ?
         this.$element.one($.support.transition.end, complete) :
         complete()
-       }
+    }
 
   , toggle: function () {
       this[this.$element.hasClass('in') ? 'hide' : 'show']()
-       }
+    }
 
   }
 
-  /* COLLAPSIBLE PLUGIN DEFINITION
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
   * ============================== */
 
-  $.fn.collapse = function ( option ) {
+  $.fn.collapse = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('collapse')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 661b22713c53eead00ed558471ddcd80a2968766..f27f4d2f437c4c24345cd2f93305a9d54f1fac26 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* DROPDOWN CLASS DEFINITION
   * ========================= */
 
   var toggle = '[data-toggle="dropdown"]'
-    , Dropdown = function ( element ) {
+    , Dropdown = function (element) {
         var $el = $(element).on('click.dropdown.data-api', this.toggle)
         $('html').on('click.dropdown.data-api', function () {
           $el.parent().removeClass('open')
@@ -37,7 +38,7 @@
 
     constructor: Dropdown
 
-  , toggle: function ( e ) {
+  , toggle: function (e) {
       var $this = $(this)
         , selector = $this.attr('data-target')
         , $parent
@@ -54,7 +55,8 @@
       isActive = $parent.hasClass('open')
 
       clearMenus()
-      !isActive && $parent.toggleClass('open')
+
+      if (!isActive) $parent.toggleClass('open')
 
       return false
     }
@@ -69,7 +71,7 @@
   /* DROPDOWN PLUGIN DEFINITION
    * ========================== */
 
-  $.fn.dropdown = function ( option ) {
+  $.fn.dropdown = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('dropdown')
@@ -91,4 +93,4 @@
       .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index f16b565003f41b34815658f711263cc9fd9d2dfc..959433f2aedf6241ff317cf30ac1ed1bdcc82e4a 100644 (file)
  * ========================================================= */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* MODAL CLASS DEFINITION
   * ====================== */
 
-  var Modal = function ( content, options ) {
+  var Modal = function (content, options) {
     this.options = options
     this.$element = $(content)
       .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
@@ -55,7 +56,9 @@
         backdrop.call(this, function () {
           var transition = $.support.transition && that.$element.hasClass('fade')
 
-          !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
+          if (!that.$element.parent().length) {
+            that.$element.appendTo(document.body) //don't move modals dom position
+          }
 
           that.$element
             .show()
@@ -73,7 +76,7 @@
         })
       }
 
-    , hide: function ( e ) {
+    , hide: function (e) {
         e && e.preventDefault()
 
         var that = this
     })
   }
 
-  function hideModal( that ) {
+  function hideModal(that) {
     this.$element
       .hide()
       .trigger('hidden')
     backdrop.call(this)
   }
 
-  function backdrop( callback ) {
+  function backdrop(callback) {
     var that = this
       , animate = this.$element.hasClass('fade') ? 'fade' : ''
 
  /* MODAL PLUGIN DEFINITION
   * ======================= */
 
-  $.fn.modal = function ( option ) {
+  $.fn.modal = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('modal')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index df6ef3dfffd0ffc06d8a0dc8832a511375f24017..51820979a478ecf2a9b73b217d9b95ee138dfa17 100644 (file)
  * =========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
 
- "use strict"
+  "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+  * =============================== */
 
   var Popover = function ( element, options ) {
     this.init('popover', element, options)
   }
 
+
   /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
      ========================================== */
 
@@ -59,7 +64,7 @@
       return content
     }
 
-  , tip: function() {
+  , tip: function () {
       if (!this.$tip) {
         this.$tip = $(this.options.template)
       }
@@ -72,7 +77,7 @@
  /* POPOVER PLUGIN DEFINITION
   * ======================= */
 
-  $.fn.popover = function ( option ) {
+  $.fn.popover = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('popover')
@@ -90,4 +95,4 @@
   , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 518ccafb24823b92d409839f100211c65e629774..3dee609c732c2f7bcc7eca8a4ae28e7665f4ecd6 100644 (file)
  * ============================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
   /* SCROLLSPY CLASS DEFINITION
    * ========================== */
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index d46ef790a7175c4c319e91cdc28bfcc0ef7c8ee1..6255d53ef50e3d392ddcef1eac8be491226f995b 100644 (file)
  * ======================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* TAB CLASS DEFINITION
   * ==================== */
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 2f9254ed2acc0d3e387178f985c83b1cd8cbf45d..454e7a4484dbc2698d62195de8f25ddac59c1246 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* TOOLTIP PUBLIC CLASS DEFINITION
   * =============================== */
 
-  var Tooltip = function ( element, options ) {
+  var Tooltip = function (element, options) {
     this.init('tooltip', element, options)
   }
 
@@ -34,7 +35,7 @@
 
     constructor: Tooltip
 
-  , init: function ( type, element, options ) {
+  , init: function (type, element, options) {
       var eventIn
         , eventOut
 
@@ -55,7 +56,7 @@
         this.fixTitle()
     }
 
-  , getOptions: function ( options ) {
+  , getOptions: function (options) {
       options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
 
       if (options.delay && typeof options.delay == 'number') {
@@ -68,7 +69,7 @@
       return options
     }
 
-  , enter: function ( e ) {
+  , enter: function (e) {
       var self = $(e.currentTarget)[this.type](this._options).data(this.type)
 
       if (!self.options.delay || !self.options.delay.show) {
@@ -84,7 +85,7 @@
       }
     }
 
-  , leave: function ( e ) {
+  , leave: function (e) {
       var self = $(e.currentTarget)[this.type](this._options).data(this.type)
 
       if (!self.options.delay || !self.options.delay.hide) {
       }
     }
 
-  , isHTML: function( text ) {
+  , isHTML: function(text) {
       // html string detection logic adapted from jQuery
       return typeof text != 'string'
         || ( text.charAt(0) === "<"
 
   $.fn.tooltip.defaults = {
     animation: true
-  , delay: 0
-  , selector: false
   , placement: 'top'
+  , selector: false
+  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
   , trigger: 'hover'
   , title: ''
-  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+  , delay: 0
   }
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 8ff3c90023550056ec59cb1a89e150bae496f268..d34caa1b98fe79cddef42d7c50068ef3da1c1d79 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
 
   $(function () {
 
-    "use strict"
+    "use strict"; // jshint ;_;
+
 
     /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
      * ======================================================= */
@@ -57,4 +58,4 @@
 
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 3876e630715aac1444b17c1f50f838086aecefff..526cf320c3589d6e85304a92c9489e7fdc35d4ec 100644 (file)
  * ============================================================ */
 
 
-!function( $ ){
+!function($){
 
-  "use strict"
+  "use strict"; // jshint ;_;
 
-  var Typeahead = function ( element, options ) {
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+  * ================================= */
+
+  var Typeahead = function (element, options) {
     this.$element = $(element)
     this.options = $.extend({}, $.fn.typeahead.defaults, options)
     this.matcher = this.options.matcher || this.matcher
     }
 
   , highlighter: function (item) {
-      var query = this.query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
+      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
       return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
         return '<strong>' + match + '</strong>'
       })
   /* TYPEAHEAD PLUGIN DEFINITION
    * =========================== */
 
-  $.fn.typeahead = function ( option ) {
+  $.fn.typeahead = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('typeahead')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
diff --git a/js/.jshintrc b/js/.jshintrc
new file mode 100644 (file)
index 0000000..bb41ef9
--- /dev/null
@@ -0,0 +1,9 @@
+{
+       "browser"  : true,
+    "expr"     : true,
+    "laxbreak" : true,
+    "boss"     : true,
+    "asi"      : true,
+    "laxcomma" : true,
+    "validthis": true
+}
\ No newline at end of file
index c7171855d16b4bcc42fe0de2492de271bf259231..167a57f841230211f6e03e4f59a409041ce61a01 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* ALERT CLASS DEFINITION
   * ====================== */
         $(el).on('click', dismiss, this.close)
       }
 
-  Alert.prototype = {
-
-    constructor: Alert
-
-  , close: function ( e ) {
-      var $this = $(this)
-        , selector = $this.attr('data-target')
-        , $parent
-
-      if (!selector) {
-        selector = $this.attr('href')
-        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-      }
+  Alert.prototype.close = function (e) {
+    var $this = $(this)
+      , selector = $this.attr('data-target')
+      , $parent
 
-      $parent = $(selector)
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+    }
 
-      e && e.preventDefault()
+    $parent = $(selector)
 
-      $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+    e && e.preventDefault()
 
-      $parent.trigger(e = $.Event('close'))
+    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
 
-      if (e.isDefaultPrevented()) return
+    $parent.trigger(e = $.Event('close'))
 
-      $parent.removeClass('in')
+    if (e.isDefaultPrevented()) return
 
-      function removeElement() {
-        $parent
-          .trigger('closed')
-          .remove()
-      }
+    $parent.removeClass('in')
 
-      $.support.transition && $parent.hasClass('fade') ?
-        $parent.on($.support.transition.end, removeElement) :
-        removeElement()
+    function removeElement() {
+      $parent
+        .trigger('closed')
+        .remove()
     }
 
+    $.support.transition && $parent.hasClass('fade') ?
+      $parent.on($.support.transition.end, removeElement) :
+      removeElement()
   }
 
 
@@ -92,4 +87,4 @@
     $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 77af03760b3d65644bc2c9d51c593c805f264164..49e88e49ade7d6252ba4a5c956ab08c088cd473d 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* BUTTON PUBLIC CLASS DEFINITION
   * ============================== */
 
-  var Button = function ( element, options ) {
+  var Button = function (element, options) {
     this.$element = $(element)
     this.options = $.extend({}, $.fn.button.defaults, options)
   }
 
-  Button.prototype = {
-
-      constructor: Button
-
-    , setState: function ( state ) {
-        var d = 'disabled'
-          , $el = this.$element
-          , data = $el.data()
-          , val = $el.is('input') ? 'val' : 'html'
+  Button.prototype.setState = function (state) {
+    var d = 'disabled'
+      , $el = this.$element
+      , data = $el.data()
+      , val = $el.is('input') ? 'val' : 'html'
 
-        state = state + 'Text'
-        data.resetText || $el.data('resetText', $el[val]())
+    state = state + 'Text'
+    data.resetText || $el.data('resetText', $el[val]())
 
-        $el[val](data[state] || this.options[state])
+    $el[val](data[state] || this.options[state])
 
-        // push to event loop to allow forms to submit
-        setTimeout(function () {
-          state == 'loadingText' ?
-            $el.addClass(d).attr(d, d) :
-            $el.removeClass(d).removeAttr(d)
-        }, 0)
-      }
-
-    , toggle: function () {
-        var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+    // push to event loop to allow forms to submit
+    setTimeout(function () {
+      state == 'loadingText' ?
+        $el.addClass(d).attr(d, d) :
+        $el.removeClass(d).removeAttr(d)
+    }, 0)
+  }
 
-        $parent && $parent
-          .find('.active')
-          .removeClass('active')
+  Button.prototype.toggle = function () {
+    var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
 
-        this.$element.toggleClass('active')
-      }
+    $parent && $parent
+      .find('.active')
+      .removeClass('active')
 
+    this.$element.toggleClass('active')
   }
 
 
  /* BUTTON PLUGIN DEFINITION
   * ======================== */
 
-  $.fn.button = function ( option ) {
+  $.fn.button = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('button')
@@ -98,4 +93,4 @@
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 0c8c5a202a2d18ce8fbe895641d74a2da4f34378..d1c3079e443863219a6292b14eba31f96f51c622 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* CAROUSEL CLASS DEFINITION
   * ========================= */
  /* CAROUSEL PLUGIN DEFINITION
   * ========================== */
 
-  $.fn.carousel = function ( option ) {
+  $.fn.carousel = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('carousel')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 9f462e6bcc0756106d259e7676ebb906dc18a742..30e139cf89e00307dd8896c06d51fcb2aeddf82d 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
 
-  "use strict"
+  "use strict"; // jshint ;_;
 
-  var Collapse = function ( element, options ) {
-       this.$element = $(element)
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+  * ================================ */
+
+  var Collapse = function (element, options) {
+    this.$element = $(element)
     this.options = $.extend({}, $.fn.collapse.defaults, options)
 
-    if (this.options["parent"]) {
-      this.$parent = $(this.options["parent"])
+    if (this.options.parent) {
+      this.$parent = $(this.options.parent)
     }
 
     this.options.toggle && this.toggle()
@@ -53,7 +57,6 @@
       dimension = this.dimension()
       scroll = $.camelCase(['scroll', dimension].join('-'))
       actives = this.$parent && this.$parent.find('> .accordion-group > .in')
-      hasData
 
       if (actives && actives.length) {
         hasData = actives.data('collapse')
@@ -75,7 +78,7 @@
       this.$element[dimension](0)
     }
 
-  , reset: function ( size ) {
+  , reset: function (size) {
       var dimension = this.dimension()
 
       this.$element
         [dimension](size || 'auto')
         [0].offsetWidth
 
-      this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
+      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
 
       return this
     }
 
-  , transition: function ( method, startEvent, completeEvent ) {
+  , transition: function (method, startEvent, completeEvent) {
       var that = this
         , complete = function () {
             if (startEvent == 'show') that.reset()
       $.support.transition && this.$element.hasClass('collapse') ?
         this.$element.one($.support.transition.end, complete) :
         complete()
-       }
+    }
 
   , toggle: function () {
       this[this.$element.hasClass('in') ? 'hide' : 'show']()
-       }
+    }
 
   }
 
-  /* COLLAPSIBLE PLUGIN DEFINITION
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
   * ============================== */
 
-  $.fn.collapse = function ( option ) {
+  $.fn.collapse = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('collapse')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 661b22713c53eead00ed558471ddcd80a2968766..f27f4d2f437c4c24345cd2f93305a9d54f1fac26 100644 (file)
  * ============================================================ */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* DROPDOWN CLASS DEFINITION
   * ========================= */
 
   var toggle = '[data-toggle="dropdown"]'
-    , Dropdown = function ( element ) {
+    , Dropdown = function (element) {
         var $el = $(element).on('click.dropdown.data-api', this.toggle)
         $('html').on('click.dropdown.data-api', function () {
           $el.parent().removeClass('open')
@@ -37,7 +38,7 @@
 
     constructor: Dropdown
 
-  , toggle: function ( e ) {
+  , toggle: function (e) {
       var $this = $(this)
         , selector = $this.attr('data-target')
         , $parent
@@ -54,7 +55,8 @@
       isActive = $parent.hasClass('open')
 
       clearMenus()
-      !isActive && $parent.toggleClass('open')
+
+      if (!isActive) $parent.toggleClass('open')
 
       return false
     }
@@ -69,7 +71,7 @@
   /* DROPDOWN PLUGIN DEFINITION
    * ========================== */
 
-  $.fn.dropdown = function ( option ) {
+  $.fn.dropdown = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('dropdown')
@@ -91,4 +93,4 @@
       .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index f16b565003f41b34815658f711263cc9fd9d2dfc..959433f2aedf6241ff317cf30ac1ed1bdcc82e4a 100644 (file)
  * ========================================================= */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* MODAL CLASS DEFINITION
   * ====================== */
 
-  var Modal = function ( content, options ) {
+  var Modal = function (content, options) {
     this.options = options
     this.$element = $(content)
       .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
@@ -55,7 +56,9 @@
         backdrop.call(this, function () {
           var transition = $.support.transition && that.$element.hasClass('fade')
 
-          !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
+          if (!that.$element.parent().length) {
+            that.$element.appendTo(document.body) //don't move modals dom position
+          }
 
           that.$element
             .show()
@@ -73,7 +76,7 @@
         })
       }
 
-    , hide: function ( e ) {
+    , hide: function (e) {
         e && e.preventDefault()
 
         var that = this
     })
   }
 
-  function hideModal( that ) {
+  function hideModal(that) {
     this.$element
       .hide()
       .trigger('hidden')
     backdrop.call(this)
   }
 
-  function backdrop( callback ) {
+  function backdrop(callback) {
     var that = this
       , animate = this.$element.hasClass('fade') ? 'fade' : ''
 
  /* MODAL PLUGIN DEFINITION
   * ======================= */
 
-  $.fn.modal = function ( option ) {
+  $.fn.modal = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('modal')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index df6ef3dfffd0ffc06d8a0dc8832a511375f24017..51820979a478ecf2a9b73b217d9b95ee138dfa17 100644 (file)
  * =========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
 
- "use strict"
+  "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+  * =============================== */
 
   var Popover = function ( element, options ) {
     this.init('popover', element, options)
   }
 
+
   /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
      ========================================== */
 
@@ -59,7 +64,7 @@
       return content
     }
 
-  , tip: function() {
+  , tip: function () {
       if (!this.$tip) {
         this.$tip = $(this.options.template)
       }
@@ -72,7 +77,7 @@
  /* POPOVER PLUGIN DEFINITION
   * ======================= */
 
-  $.fn.popover = function ( option ) {
+  $.fn.popover = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('popover')
@@ -90,4 +95,4 @@
   , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 518ccafb24823b92d409839f100211c65e629774..3dee609c732c2f7bcc7eca8a4ae28e7665f4ecd6 100644 (file)
  * ============================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
   /* SCROLLSPY CLASS DEFINITION
    * ========================== */
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index d46ef790a7175c4c319e91cdc28bfcc0ef7c8ee1..6255d53ef50e3d392ddcef1eac8be491226f995b 100644 (file)
  * ======================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* TAB CLASS DEFINITION
   * ==================== */
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 2f9254ed2acc0d3e387178f985c83b1cd8cbf45d..454e7a4484dbc2698d62195de8f25ddac59c1246 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
+
+  "use strict"; // jshint ;_;
 
-  "use strict"
 
  /* TOOLTIP PUBLIC CLASS DEFINITION
   * =============================== */
 
-  var Tooltip = function ( element, options ) {
+  var Tooltip = function (element, options) {
     this.init('tooltip', element, options)
   }
 
@@ -34,7 +35,7 @@
 
     constructor: Tooltip
 
-  , init: function ( type, element, options ) {
+  , init: function (type, element, options) {
       var eventIn
         , eventOut
 
@@ -55,7 +56,7 @@
         this.fixTitle()
     }
 
-  , getOptions: function ( options ) {
+  , getOptions: function (options) {
       options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
 
       if (options.delay && typeof options.delay == 'number') {
@@ -68,7 +69,7 @@
       return options
     }
 
-  , enter: function ( e ) {
+  , enter: function (e) {
       var self = $(e.currentTarget)[this.type](this._options).data(this.type)
 
       if (!self.options.delay || !self.options.delay.show) {
@@ -84,7 +85,7 @@
       }
     }
 
-  , leave: function ( e ) {
+  , leave: function (e) {
       var self = $(e.currentTarget)[this.type](this._options).data(this.type)
 
       if (!self.options.delay || !self.options.delay.hide) {
       }
     }
 
-  , isHTML: function( text ) {
+  , isHTML: function(text) {
       // html string detection logic adapted from jQuery
       return typeof text != 'string'
         || ( text.charAt(0) === "<"
 
   $.fn.tooltip.defaults = {
     animation: true
-  , delay: 0
-  , selector: false
   , placement: 'top'
+  , selector: false
+  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
   , trigger: 'hover'
   , title: ''
-  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+  , delay: 0
   }
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 8ff3c90023550056ec59cb1a89e150bae496f268..d34caa1b98fe79cddef42d7c50068ef3da1c1d79 100644 (file)
  * ========================================================== */
 
 
-!function ( $ ) {
+!function ($) {
 
   $(function () {
 
-    "use strict"
+    "use strict"; // jshint ;_;
+
 
     /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
      * ======================================================= */
@@ -57,4 +58,4 @@
 
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 3876e630715aac1444b17c1f50f838086aecefff..526cf320c3589d6e85304a92c9489e7fdc35d4ec 100644 (file)
  * ============================================================ */
 
 
-!function( $ ){
+!function($){
 
-  "use strict"
+  "use strict"; // jshint ;_;
 
-  var Typeahead = function ( element, options ) {
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+  * ================================= */
+
+  var Typeahead = function (element, options) {
     this.$element = $(element)
     this.options = $.extend({}, $.fn.typeahead.defaults, options)
     this.matcher = this.options.matcher || this.matcher
     }
 
   , highlighter: function (item) {
-      var query = this.query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
+      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
       return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
         return '<strong>' + match + '</strong>'
       })
   /* TYPEAHEAD PLUGIN DEFINITION
    * =========================== */
 
-  $.fn.typeahead = function ( option ) {
+  $.fn.typeahead = function (option) {
     return this.each(function () {
       var $this = $(this)
         , data = $this.data('typeahead')
     })
   })
 
-}( window.jQuery );
\ No newline at end of file
+}(window.jQuery);
\ No newline at end of file
index 3f28d2676ddd02d44df11a50b02ba39841d5b807..086773fa272f17a3e4d2b11c006fb1cf21493135 100644 (file)
@@ -3,7 +3,7 @@ $(function () {
     module("bootstrap-transition")
 
       test("should be defined on jquery support object", function () {
-        ok($.support.transition != undefined, 'transition object is defined')
+        ok($.support.transition !== undefined, 'transition object is defined')
       })
 
       test("should provide an end object", function () {