]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Re-wrap every JavaScript module in an IIFE, but only pass in jQuery, not Foundation
authorGeoff Kimball <geoff@zurb.com>
Thu, 11 Feb 2016 22:24:04 +0000 (14:24 -0800)
committerGeoff Kimball <geoff@zurb.com>
Thu, 11 Feb 2016 22:24:04 +0000 (14:24 -0800)
27 files changed:
js/foundation.abide.js
js/foundation.accordion.js
js/foundation.accordionMenu.js
js/foundation.core.js
js/foundation.drilldown.js
js/foundation.dropdown.js
js/foundation.dropdownMenu.js
js/foundation.equalizer.js
js/foundation.interchange.js
js/foundation.magellan.js
js/foundation.offcanvas.js
js/foundation.orbit.js
js/foundation.responsiveMenu.js
js/foundation.responsiveToggle.js
js/foundation.reveal.js
js/foundation.slider.js
js/foundation.sticky.js
js/foundation.tabs.js
js/foundation.toggler.js
js/foundation.tooltip.js
js/foundation.util.box.js
js/foundation.util.keyboard.js
js/foundation.util.mediaQuery.js
js/foundation.util.motion.js
js/foundation.util.nest.js
js/foundation.util.timerAndImageLoader.js
js/foundation.util.triggers.js

index 78f6b1e1846436758faccf4ca3c831cecacd4f87..cc481b4810c5c18b114a6321cb2599267a3019cb 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Abide module.
  * @module foundation.abide
@@ -456,3 +458,5 @@ Abide.defaults = {
 
 // Window exports
 Foundation.plugin(Abide, 'Abide');
+
+}(jQuery);
index 9c2eb5f6a70075222c7681c31cb27e546c8ad066..ae33816087ca9ed81f6437dd900df4a70606d801 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Accordion module.
  * @module foundation.accordion
@@ -233,3 +235,5 @@ Accordion.defaults = {
 
 // Window exports
 Foundation.plugin(Accordion, 'Accordion');
+
+}(jQuery);
index 885824842036b771abcb14fdfc317d6dd590ee2c..8d3bcb087d0ec2852a03cd4efeb6db615ce53230 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * AccordionMenu module.
  * @module foundation.accordionMenu
@@ -264,3 +266,5 @@ AccordionMenu.defaults = {
 
 // Window exports
 Foundation.plugin(AccordionMenu, 'AccordionMenu');
+
+}(jQuery);
index a782fa2c7c7302aea08b4da1244682299378933d..2513d2bba926bd88c49a6f994df93cde582f8286 100644 (file)
@@ -1,4 +1,5 @@
 !function($) {
+
 "use strict";
 
 var FOUNDATION_VERSION = '6.1.2';
@@ -219,7 +220,6 @@ var Foundation = {
   }
 };
 
-
 Foundation.util = {
   /**
    * Function for applying a debounce effect to a function call.
index 6faed1098a92967a08eda4bd4ca07cb64175c14c..88be960842a0a3f6f8009256d6219f2fb11ee5fd 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Drilldown module.
  * @module foundation.drilldown
@@ -331,3 +333,5 @@ Drilldown.defaults = {
 
 // Window exports
 Foundation.plugin(Drilldown, 'Drilldown');
+
+}(jQuery);
index bd9d667da30214804a52e85a74133be2dcb4b17e..3f585138fb0261adffa9b2f4c108056e9413ac75 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Dropdown module.
  * @module foundation.dropdown
@@ -398,3 +400,5 @@ Dropdown.defaults = {
 
 // Window exports
 Foundation.plugin(Dropdown, 'Dropdown');
+
+}(jQuery);
index efc3787e63789cd8cf92791faaec961157808dab..9138fcc135ebf61625b2095ad82e42bc2c588e25 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * DropdownMenu module.
  * @module foundation.dropdown-menu
@@ -395,3 +397,5 @@ DropdownMenu.defaults = {
 
 // Window exports
 Foundation.plugin(DropdownMenu, 'DropdownMenu');
+
+}(jQuery);
index e7130e4562f3d54fe6b0d8cee1f8e49cb8aaafd5..0893c557305deb31f2ab1791fc02a66bd52e9f0d 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Equalizer module.
  * @module foundation.equalizer
@@ -279,3 +281,5 @@ Equalizer.defaults = {
 
 // Window exports
 Foundation.plugin(Equalizer, 'Equalizer');
+
+}(jQuery);
index 764540e275435126d10fefd226fce59512922d3a..dc7463bed54d1334b3b2b64511f100474bfa18ad 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Interchange module.
  * @module foundation.interchange
@@ -185,6 +187,6 @@ Interchange.SPECIAL_QUERIES = {
 };
 
 // Window exports
-if (window.Foundation) {
-  Foundation.plugin(Interchange, 'Interchange');
-}
+Foundation.plugin(Interchange, 'Interchange');
+
+}(jQuery);
index 379141e74b358a972131a5a5335a5addb845f588..ff95dc06656a74c35adb391b628d08da53b60285 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Magellan module.
  * @module foundation.magellan
@@ -217,3 +219,5 @@ Magellan.defaults = {
 
 // Window exports
 Foundation.plugin(Magellan, 'Magellan');
+
+}(jQuery);
index 6897c5ec0328e5a6ab6e5779a1b2a0eea816b47b..cca11d20e7e385e19c5275e5d6f79ca495938812 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * OffCanvas module.
  * @module foundation.offcanvas
@@ -389,3 +391,5 @@ OffCanvas.defaults = {
 
 // Window exports
 Foundation.plugin(OffCanvas, 'OffCanvas');
+
+}(jQuery);
index 0b9c120edd5401a06ea7fc267fa3c1e3e59a7d96..32bcdbf6057679dfcb6a7e9b3312e3ee5de87d2f 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Orbit module.
  * @module foundation.orbit
@@ -439,3 +441,5 @@ Orbit.defaults = {
 
 // Window exports
 Foundation.plugin(Orbit, 'Orbit');
+
+}(jQuery);
index f146b3bb6dcd9a0998f7ac4c3281d7ac35aac8f7..559fe1fd7a5688194eb525f238c6f9a1a2a2fb51 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * ResponsiveMenu module.
  * @module foundation.responsiveMenu
@@ -139,3 +141,5 @@ var MenuPlugins = {
 
 // Window exports
 Foundation.plugin(ResponsiveMenu, 'ResponsiveMenu');
+
+}(jQuery);
index 16fbfc2719ef1606ab64d786f489b6778375cab1..d39cecfe26bfaf1d7499840e610d284a66637962 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * ResponsiveToggle module.
  * @module foundation.responsiveToggle
@@ -106,3 +108,5 @@ ResponsiveToggle.defaults = {
 
 // Window exports
 Foundation.plugin(ResponsiveToggle, 'ResponsiveToggle');
+
+}(jQuery);
index 4f8d8a474b6c0867c1d5c729ed4a4a95a95e22d9..5806de500b476ca0544254cf40b96d3b093c1b05 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Reveal module.
  * @module foundation.reveal
@@ -549,3 +551,5 @@ Foundation.plugin(Reveal, 'Reveal');
 function iPhoneSniff() {
   return /iP(ad|hone|od).*OS/.test(window.navigator.userAgent);
 }
+
+}(jQuery);
index 343e552c8902dd2529343094bde0d86b0713ef8f..62a13b56f7ef545c366ae20ca64f30e57723eb4b 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Slider module.
  * @module foundation.slider
@@ -530,6 +532,8 @@ function absPosition($handle, dir, clickPos, param) {
 // Window exports
 Foundation.plugin(Slider, 'Slider');
 
+}(jQuery);
+
 //*********this is in case we go to static, absolute positions instead of dynamic positioning********
 // this.setSteps(function() {
 //   _this._events();
index 19de99629609c2bddff378096c4a158f745fd4df..4594e9361f6eae32f8e837f04fe90edfc0eb8088 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Sticky module.
  * @module foundation.sticky
@@ -441,3 +443,5 @@ function emCalc(em) {
 
 // Window exports
 Foundation.plugin(Sticky, 'Sticky');
+
+}(jQuery);
index e4172e3071e68ad1f0e8ce4e667826a61733056f..48bebc9bf4fad52e8abd7e238babaa0352d5b806 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Tabs module.
  * @module foundation.tabs
@@ -319,3 +321,5 @@ function checkClass($elem){
 
 // Window exports
 Foundation.plugin(Tabs, 'Tabs');
+
+}(jQuery);
index 8633eff1defb3ffe8856fb5223e16bb9017c3a8b..0bd400b2368f2dc323f9cf131a131c06dfb0e012 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Toggler module.
  * @module foundation.toggler
@@ -137,3 +139,5 @@ Toggler.defaults = {
 
 // Window exports
 Foundation.plugin(Toggler, 'Toggler');
+
+}(jQuery);
index 76361c97d7d5bb792604449bf35b7e43d2ce6eb9..827fcd298490d4b3cba946564b9c7aa8951e8878 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 /**
  * Tooltip module.
  * @module foundation.tooltip
@@ -432,3 +434,5 @@ Tooltip.defaults = {
 
 // Window exports
 Foundation.plugin(Tooltip, 'Tooltip');
+
+}(jQuery);
index b4a395900aa8b7a18766a5452398e110b6765874..3d0ce87d7770d177df105a46331c4ab1661d27a4 100644 (file)
@@ -1,3 +1,7 @@
+'use strict';
+
+!function($) {
+
 Foundation.Box = {
   ImNotTouchingYou: ImNotTouchingYou,
   GetDimensions: GetDimensions,
@@ -175,3 +179,5 @@ function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {
       }
   }
 }
+
+}(jQuery);
index 301e416ff95d4108e9d4334c3dc3bef241f2adea..75dc16aa290c84a5f27d8ad6fc329e1a170efcee 100644 (file)
@@ -8,6 +8,8 @@
 
 'use strict';
 
+!function($) {
+
 const keyCodes = {
   9: 'TAB',
   13: 'ENTER',
@@ -109,3 +111,5 @@ function getKeyCodes(kcs) {
 }
 
 Foundation.Keyboard = Keyboard;
+
+}(jQuery);
index 5284c102741d0561334db548d68436a10963a420..6175b13af963118174d017b8d0593396a354c9f6 100644 (file)
@@ -1,3 +1,7 @@
+'use strict';
+
+!function($) {
+
 // Default set of media queries
 const defaultQueries = {
   'default' : 'only screen',
@@ -201,4 +205,6 @@ function parseStyleToObject(str) {
   return styleObject;
 }
 
-window.Foundation.MediaQuery = MediaQuery;
+Foundation.MediaQuery = MediaQuery;
+
+}(jQuery);
index dd141a61396f4898c7a779b71452b4fa655cd753..0473a110ef1b3135adbd6c34b38257ed2ea44388 100644 (file)
@@ -1,3 +1,7 @@
+'use strict';
+
+!function($) {
+
 /**
  * Motion module.
  * @module foundation.motion
@@ -6,7 +10,7 @@
 const initClasses   = ['mui-enter', 'mui-leave'];
 const activeClasses = ['mui-enter-active', 'mui-leave-active'];
 
-export const Motion = {
+const Motion = {
   animateIn: function(element, animation, cb) {
     animate(true, element, animation, cb);
   },
@@ -16,7 +20,7 @@ export const Motion = {
   }
 }
 
-export function Move(duration, elem, fn){
+function Move(duration, elem, fn){
   var anim, prog, start = null;
   // console.log('called');
 
@@ -91,3 +95,5 @@ function animate(isIn, element, animation, cb) {
 
 Foundation.Move = Move;
 Foundation.Motion = Motion;
+
+}(jQuery);
index 6a29fade509c6196273c4a5a6765ffbf7077839c..a2602442df37b5c426a56a2499920d4bc285f341 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 const Nest = {
   Feather(menu, type = 'zf') {
     menu.attr('role', 'menubar');
@@ -70,3 +72,5 @@ const Nest = {
 }
 
 Foundation.Nest = Nest;
+
+}(jQuery);
index 7ef2f68217220fa88752672d316425ed48479965..b5facd02f3d3095b07916d7ec894fced478c6990 100644 (file)
@@ -1,6 +1,8 @@
 'use strict';
 
-export function Timer(elem, options, cb) {
+!function($) {
+
+function Timer(elem, options, cb) {
   var _this = this,
       duration = options.duration,//options is an object for easily adding features later.
       nameSpace = Object.keys(elem.data())[0] || 'timer',
@@ -48,7 +50,7 @@ export function Timer(elem, options, cb) {
  * @param {Object} images - Image(s) to check if loaded.
  * @param {Func} callback - Function to execute when image is fully loaded.
  */
-export function onImagesLoaded(images, callback){
+function onImagesLoaded(images, callback){
   var self = this,
       unloaded = images.length;
 
@@ -80,3 +82,5 @@ export function onImagesLoaded(images, callback){
 
 Foundation.Timer = Timer;
 Foundation.onImagesLoaded = onImagesLoaded;
+
+}(jQuery);
index 743790d1cfe954dcac8d3118ee3c89087346ddbb..c904c9946cc08251be84d9237248c6377c68f417 100644 (file)
@@ -1,5 +1,7 @@
 'use strict';
 
+!function($) {
+
 const MutationObserver = (function () {
   var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
   for (var i=0; i < prefixes.length; i++) {
@@ -199,6 +201,8 @@ Foundation.IHearYou = checkListeners;
 // Foundation.ISeeYou = scrollListener;
 // Foundation.IFeelYou = closemeListener;
 
+}(jQuery);
+
 // function domMutationObserver(debounce) {
 //   // !!! This is coming soon and needs more work; not active  !!! //
 //   var timer,