From 1c6fa9010daf0d0c21de9e20fe6ac4dba1788d90 Mon Sep 17 00:00:00 2001
From: Katie Zhu <to.kzhu@gmail.com>
Date: Mon, 9 Jun 2014 22:18:05 -0700
Subject: [PATCH] MD/CommonJS/Globals #12909

---
 js/.jscsrc       | 3 +--
 js/.jshintrc     | 4 ++--
 js/affix.js      | 8 ++++++--
 js/alert.js      | 8 ++++++--
 js/button.js     | 8 ++++++--
 js/carousel.js   | 8 ++++++--
 js/collapse.js   | 8 ++++++--
 js/dropdown.js   | 8 ++++++--
 js/modal.js      | 8 ++++++--
 js/popover.js    | 8 ++++++--
 js/scrollspy.js  | 8 ++++++--
 js/tab.js        | 8 ++++++--
 js/tooltip.js    | 8 ++++++--
 js/transition.js | 8 ++++++--
 14 files changed, 75 insertions(+), 28 deletions(-)

diff --git a/js/.jscsrc b/js/.jscsrc
index fb6cd10c23..e6eb845600 100644
--- a/js/.jscsrc
+++ b/js/.jscsrc
@@ -11,10 +11,9 @@
   "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
   "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
   "disallowSpacesInsideArrayBrackets": true,
-  "disallowSpacesInsideParentheses": true,
   "disallowTrailingComma": true,
+  "disallowSpacesInsideParentheses": true,
   "disallowTrailingWhitespace": true,
-  "requireCamelCaseOrUpperCaseIdentifiers": true,
   "requireCapitalizedConstructors": true,
   "requireCommaBeforeLineBreak": true,
   "requireDotNotation": true,
diff --git a/js/.jshintrc b/js/.jshintrc
index a59e1d00a1..0cf661ddc2 100644
--- a/js/.jshintrc
+++ b/js/.jshintrc
@@ -9,7 +9,7 @@
   "latedef"  : true,
   "laxbreak" : true,
   "nonbsp"   : true,
-  "strict"   : true,
   "undef"    : true,
-  "unused"   : true
+  "unused"   : true,
+  "predef"   : [ "define", "require" ]
 }
diff --git a/js/affix.js b/js/affix.js
index 5af32fee64..d5f591fb5e 100644
--- a/js/affix.js
+++ b/js/affix.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // AFFIX CLASS DEFINITION
@@ -139,4 +143,4 @@
     })
   })
 
-}(jQuery);
+});
diff --git a/js/alert.js b/js/alert.js
index 905aacc150..f7fc6fb8e2 100644
--- a/js/alert.js
+++ b/js/alert.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // ALERT CLASS DEFINITION
@@ -89,4 +93,4 @@
 
   $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
 
-}(jQuery);
+});
diff --git a/js/button.js b/js/button.js
index aa71450722..cab7d8c3da 100644
--- a/js/button.js
+++ b/js/button.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // BUTTON PUBLIC CLASS DEFINITION
@@ -107,4 +111,4 @@
     e.preventDefault()
   })
 
-}(jQuery);
+});
diff --git a/js/carousel.js b/js/carousel.js
index f0117980d9..af51cf50d5 100644
--- a/js/carousel.js
+++ b/js/carousel.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // CAROUSEL CLASS DEFINITION
@@ -209,4 +213,4 @@
     })
   })
 
-}(jQuery);
+});
diff --git a/js/collapse.js b/js/collapse.js
index 87098dbd23..d5d74d07b9 100644
--- a/js/collapse.js
+++ b/js/collapse.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // COLLAPSE PUBLIC CLASS DEFINITION
@@ -178,4 +182,4 @@
     Plugin.call($target, option)
   })
 
-}(jQuery);
+});
diff --git a/js/dropdown.js b/js/dropdown.js
index bc671fef01..39d2951eb6 100644
--- a/js/dropdown.js
+++ b/js/dropdown.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // DROPDOWN CLASS DEFINITION
@@ -148,4 +152,4 @@
     .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
     .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
 
-}(jQuery);
+});
diff --git a/js/modal.js b/js/modal.js
index f23ba825f2..2c363ec331 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // MODAL CLASS DEFINITION
@@ -277,4 +281,4 @@
     Plugin.call($target, option, this)
   })
 
-}(jQuery);
+});
diff --git a/js/popover.js b/js/popover.js
index c8ec3bef40..8d2840c2e8 100644
--- a/js/popover.js
+++ b/js/popover.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // POPOVER PUBLIC CLASS DEFINITION
@@ -110,4 +114,4 @@
     return this
   }
 
-}(jQuery);
+});
diff --git a/js/scrollspy.js b/js/scrollspy.js
index d527e9c2d9..78858680e3 100644
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // SCROLLSPY CLASS DEFINITION
@@ -157,4 +161,4 @@
     })
   })
 
-}(jQuery);
+});
diff --git a/js/tab.js b/js/tab.js
index 51f5cbb687..57ae6bc9f2 100644
--- a/js/tab.js
+++ b/js/tab.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // TAB CLASS DEFINITION
@@ -125,4 +129,4 @@
     Plugin.call($(this), 'show')
   })
 
-}(jQuery);
+});
diff --git a/js/tooltip.js b/js/tooltip.js
index b4ced6d2af..692651457f 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -8,7 +8,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // TOOLTIP PUBLIC CLASS DEFINITION
@@ -454,4 +458,4 @@
     return this
   }
 
-}(jQuery);
+});
diff --git a/js/transition.js b/js/transition.js
index e8c8f992ff..8fcf8ff4bd 100644
--- a/js/transition.js
+++ b/js/transition.js
@@ -7,7 +7,11 @@
  * ======================================================================== */
 
 
-+function ($) {
+(function (o_o) {
+  typeof define  === 'function' && define.amd ? define(['jquery'], o_o) :
+  typeof exports === 'object' ? o_o(require('jquery')) : o_o(this.jQuery)
+})(function ($) {
+
   'use strict';
 
   // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
@@ -46,4 +50,4 @@
     $.support.transition = transitionEnd()
   })
 
-}(jQuery);
+});
-- 
GitLab