From 0f3d427bbdccec8597dff63494d390df6b441c24 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sat, 4 Jun 2016 18:21:15 -0700 Subject: grunt [ci skip] --- docs/dist/js/umd/util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs/dist/js/umd/util.js') diff --git a/docs/dist/js/umd/util.js b/docs/dist/js/umd/util.js index 99dcaaf6d..ee2ee2067 100644 --- a/docs/dist/js/umd/util.js +++ b/docs/dist/js/umd/util.js @@ -30,6 +30,8 @@ var transition = false; + var MAX_UID = 1000000; + var TransitionEndEvent = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', @@ -54,6 +56,7 @@ if ($(event.target).is(this)) { return event.handleObj.handler.apply(this, arguments); } + return undefined; } }; } @@ -115,7 +118,7 @@ getUID: function getUID(prefix) { do { /* eslint-disable no-bitwise */ - prefix += ~ ~(Math.random() * 1000000); // "~~" acts like a faster Math.floor() here + prefix += ~ ~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here /* eslint-enable no-bitwise */ } while (document.getElementById(prefix)); return prefix; -- cgit v1.2.3 From ce2e944aa6957528f23f1f7e680ac0cb4a75dcac Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Fri, 10 Jun 2016 09:28:03 -0700 Subject: Strip out UMD & CJS in favor of ES6 modules (#20072) --- docs/dist/js/umd/util.js | 177 ----------------------------------------------- 1 file changed, 177 deletions(-) delete mode 100644 docs/dist/js/umd/util.js (limited to 'docs/dist/js/umd/util.js') diff --git a/docs/dist/js/umd/util.js b/docs/dist/js/umd/util.js deleted file mode 100644 index ee2ee2067..000000000 --- a/docs/dist/js/umd/util.js +++ /dev/null @@ -1,177 +0,0 @@ -(function (global, factory) { - if (typeof define === 'function' && define.amd) { - define(['exports', 'module'], factory); - } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { - factory(exports, module); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, mod); - global.util = mod.exports; - } -})(this, function (exports, module) { - /** - * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.2): util.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * -------------------------------------------------------------------------- - */ - - 'use strict'; - - var Util = (function ($) { - - /** - * ------------------------------------------------------------------------ - * Private TransitionEnd Helpers - * ------------------------------------------------------------------------ - */ - - var transition = false; - - var MAX_UID = 1000000; - - var TransitionEndEvent = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }; - - // shoutout AngusCroll (https://goo.gl/pxwQGp) - function toType(obj) { - return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); - } - - function isElement(obj) { - return (obj[0] || obj).nodeType; - } - - function getSpecialTransitionEndEvent() { - return { - bindType: transition.end, - delegateType: transition.end, - handle: function handle(event) { - if ($(event.target).is(this)) { - return event.handleObj.handler.apply(this, arguments); - } - return undefined; - } - }; - } - - function transitionEndTest() { - if (window.QUnit) { - return false; - } - - var el = document.createElement('bootstrap'); - - for (var _name in TransitionEndEvent) { - if (el.style[_name] !== undefined) { - return { end: TransitionEndEvent[_name] }; - } - } - - return false; - } - - function transitionEndEmulator(duration) { - var _this = this; - - var called = false; - - $(this).one(Util.TRANSITION_END, function () { - called = true; - }); - - setTimeout(function () { - if (!called) { - Util.triggerTransitionEnd(_this); - } - }, duration); - - return this; - } - - function setTransitionEndSupport() { - transition = transitionEndTest(); - - $.fn.emulateTransitionEnd = transitionEndEmulator; - - if (Util.supportsTransitionEnd()) { - $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); - } - } - - /** - * -------------------------------------------------------------------------- - * Public Util Api - * -------------------------------------------------------------------------- - */ - - var Util = { - - TRANSITION_END: 'bsTransitionEnd', - - getUID: function getUID(prefix) { - do { - /* eslint-disable no-bitwise */ - prefix += ~ ~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here - /* eslint-enable no-bitwise */ - } while (document.getElementById(prefix)); - return prefix; - }, - - getSelectorFromElement: function getSelectorFromElement(element) { - var selector = element.getAttribute('data-target'); - - if (!selector) { - selector = element.getAttribute('href') || ''; - selector = /^#[a-z]/i.test(selector) ? selector : null; - } - - return selector; - }, - - reflow: function reflow(element) { - new Function('bs', 'return bs')(element.offsetHeight); - }, - - triggerTransitionEnd: function triggerTransitionEnd(element) { - $(element).trigger(transition.end); - }, - - supportsTransitionEnd: function supportsTransitionEnd() { - return Boolean(transition); - }, - - typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { - for (var property in configTypes) { - if (configTypes.hasOwnProperty(property)) { - var expectedTypes = configTypes[property]; - var value = config[property]; - var valueType = undefined; - - if (value && isElement(value)) { - valueType = 'element'; - } else { - valueType = toType(value); - } - - if (!new RegExp(expectedTypes).test(valueType)) { - throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".')); - } - } - } - } - }; - - setTransitionEndSupport(); - - return Util; - })(jQuery); - - module.exports = Util; -}); -- cgit v1.2.3