diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js index dcc192f..5fb3a1e 100644 --- a/docs/assets/js/docs.js +++ b/docs/assets/js/docs.js @@ -2,6 +2,7 @@ /* global FingerBlast: true */ $(function() { + 'use strict'; var doc; var device; diff --git a/docs/assets/js/fingerblast.js b/docs/assets/js/fingerblast.js index b99a68a..ea42a9b 100644 --- a/docs/assets/js/fingerblast.js +++ b/docs/assets/js/fingerblast.js @@ -1,10 +1,12 @@ // FINGERBLAST.js // -------------- -// Adapted from phantom limb by brian cartensen +// Adapted from phantom limb by Brian Cartensen /* global GLOBAL: true */ function FingerBlast(element) { + 'use strict'; + this.element = typeof element === 'string' ? document.querySelector(element) : element; this.listen(); } @@ -19,6 +21,7 @@ FingerBlast.prototype = { mouseIsDown: false, listen: function () { + 'use strict'; var activate = this.activate.bind(this); var deactivate = this.deactivate.bind(this); @@ -49,6 +52,8 @@ FingerBlast.prototype = { }, activate: function () { + 'use strict'; + if (this.active) return; this.element.addEventListener('mousedown', (this.touchStart = this.touchStart.bind(this)), true); this.element.addEventListener('mousemove', (this.touchMove = this.touchMove.bind(this)), true); @@ -58,6 +63,8 @@ FingerBlast.prototype = { }, deactivate: function (e) { + 'use strict'; + this.active = false; if (this.mouseIsDown) this.touchEnd(e); this.element.removeEventListener('mousedown', this.touchStart, true); @@ -67,12 +74,16 @@ FingerBlast.prototype = { }, click: function (e) { + 'use strict'; + if (e.synthetic) return; e.preventDefault(); e.stopPropagation(); }, touchStart: function (e) { + 'use strict'; + if (e.synthetic || /input|textarea/.test(e.target.tagName.toLowerCase())) return; this.mouseIsDown = true; @@ -84,6 +95,8 @@ FingerBlast.prototype = { }, touchMove: function (e) { + 'use strict'; + if (e.synthetic) return; e.preventDefault(); @@ -95,6 +108,8 @@ FingerBlast.prototype = { }, touchEnd: function (e) { + 'use strict'; + if (e.synthetic) return; this.mouseIsDown = false; @@ -113,6 +128,8 @@ FingerBlast.prototype = { }, fireTouchEvents: function (eventName, originalEvent) { + 'use strict'; + var events = []; var gestures = []; @@ -191,6 +208,8 @@ FingerBlast.prototype = { }, createMouseEvent: function (eventName, originalEvent) { + 'use strict'; + var e = document.createEvent('MouseEvent'); e.initMouseEvent(eventName, true, true, @@ -209,6 +228,8 @@ FingerBlast.prototype = { }, move: function (x, y) { + 'use strict'; + if (isNaN(x) || isNaN(y)) { this.target = null; } else { diff --git a/js/modals.js b/js/modals.js index f4fbb68..4ede916 100644 --- a/js/modals.js +++ b/js/modals.js @@ -5,6 +5,8 @@ * ---------------------------------- */ !function () { + 'use strict'; + var findModals = function (target) { var i, modals = document.querySelectorAll('a'); for (; target && target !== document; target = target.parentNode) { diff --git a/js/popovers.js b/js/popovers.js index 198e917..1b028e4 100644 --- a/js/popovers.js +++ b/js/popovers.js @@ -5,6 +5,7 @@ * ---------------------------------- */ !function () { + 'use strict'; var popover; diff --git a/js/push.js b/js/push.js index faaaa6a..a069674 100644 --- a/js/push.js +++ b/js/push.js @@ -8,6 +8,7 @@ /* global _gaq: true */ !function () { + 'use strict'; var noop = function () {}; diff --git a/js/segmented-controllers.js b/js/segmented-controllers.js index df36bea..7a25b32 100644 --- a/js/segmented-controllers.js +++ b/js/segmented-controllers.js @@ -5,6 +5,8 @@ * ---------------------------------- */ !function () { + 'use strict'; + var getTarget = function (target) { var i, segmentedControls = document.querySelectorAll('.segmented-control .control-item'); for (; target && target !== document; target = target.parentNode) { diff --git a/js/sliders.js b/js/sliders.js index 4ba660f..0207423 100644 --- a/js/sliders.js +++ b/js/sliders.js @@ -6,6 +6,7 @@ * ---------------------------------- */ !function () { + 'use strict'; var pageX; var pageY; diff --git a/js/toggles.js b/js/toggles.js index 4aecd4a..a15b936 100644 --- a/js/toggles.js +++ b/js/toggles.js @@ -5,6 +5,7 @@ * ---------------------------------- */ !function () { + 'use strict'; var start = {}; var touchMove = false;